@feedmepos/mf-connect 0.1.13-prod → 0.1.15-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 (91) hide show
  1. package/dist/{Analytic-CBEDTJ94.js → Analytic-C7qqDS5D.js} +18 -17
  2. package/dist/{App-BcrQs0nE.js → App-DKZYz5r2.js} +68 -64
  3. package/dist/Bin-U7U1Vaju.js +165 -0
  4. package/dist/{Broadcast-ClM81ght.js → Broadcast-BzChnp4V.js} +38 -37
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CTwScH9I.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BELIbS3v.js} +6 -7
  6. package/dist/{Card-B7_nUT03.js → Card-DAfZz7q5.js} +78 -79
  7. package/dist/Collections-joGRHyag.js +445 -0
  8. package/dist/{Credit-DC6pzGIR.js → Credit-N1qDB4XC.js} +57 -56
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCwaUg09.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-J95iaF7a.js} +27 -27
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2qCLBp3.js → EffectSheet.vue_vue_type_style_index_0_lang-DwzQSmst.js} +8 -8
  11. package/dist/{Experience-ClJWQLEB.js → Experience-D5GrDbft.js} +39 -38
  12. package/dist/{Game-BznCxZXt.js → Game-DI7BDPO_.js} +46 -45
  13. package/dist/{Index-D27v-Lqw.js → Index-CbuAJ2dE.js} +9 -9
  14. package/dist/{Marketing-FvYJ_Lt-.js → Marketing-BSqMfy70.js} +5 -5
  15. package/dist/{Member-CQYj0FQK.js → Member-CGd5wNHJ.js} +4 -4
  16. package/dist/MemberList-DnS8KHYF.js +1596 -0
  17. package/dist/MemberTransactions-GAAX3aSV.js +45 -0
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-_72tx6g3.js → MessageInput.vue_vue_type_script_setup_true_lang-Bc2wcibo.js} +5 -5
  19. package/dist/{Mission-LwSpobZu.js → Mission-BVM_1IJ8.js} +35 -34
  20. package/dist/{Overview-PXshmkPD.js → Overview-D2IYZCPn.js} +62 -63
  21. package/dist/{Point-uaIRQMRW.js → Point-B684quZM.js} +51 -50
  22. package/dist/{Promotion-qjos6ksl.js → Promotion-DJOoRnxt.js} +34 -33
  23. package/dist/{Record-qqPaVdrx.js → Record-Bk74XVUj.js} +6 -6
  24. package/dist/{Reward-BC6GJ4kD.js → Reward-BM0AGGL6.js} +35 -35
  25. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CF7hNZIU.js → RewardGroup.vue_vue_type_script_setup_true_lang-CuA2D52B.js} +12 -13
  26. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DQ8rQIwv.js → RuleGroup.vue_vue_type_script_setup_true_lang-Cxv3cZ1v.js} +14 -15
  27. package/dist/{Segment-B5E2FdYc.js → Segment-DqOsH95n.js} +13 -13
  28. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dqz3uAze.js → SelectItems.vue_vue_type_script_setup_true_lang-ypjkVZkZ.js} +2 -2
  29. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Qo0aOTI9.js +147 -0
  30. package/dist/{Setting-CA9PQVKp.js → Setting-D6cRTVUl.js} +31 -31
  31. package/dist/{Store-irRFotGI.js → Store-DqtUurcv.js} +295 -293
  32. package/dist/{StoreRewards-CcJ8MMvp.js → StoreRewards-DPFMA3p9.js} +12 -12
  33. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CYqo5att.js +1105 -0
  34. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-2i2fDWDC.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxEV-6_4.js} +1 -1
  35. package/dist/{Tier-CdxK-QtB.js → Tier-CFd-HaGX.js} +20 -21
  36. package/dist/{Title-Ci_NXdrD.js → Title-CBktBb5l.js} +20 -21
  37. package/dist/{Transaction-ChKg7UTd.js → Transaction-Bb8UU_lj.js} +2 -2
  38. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B3INK4Ue.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DBiUmz3C.js} +6 -6
  39. package/dist/Voucher-Bukem4U7.js +353 -0
  40. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-D9wqrTVc.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CTbqVMCn.js} +10 -10
  41. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Di6QPzfu.js → ZodTextField.vue_vue_type_script_setup_true_lang-D8zMv7ks.js} +1 -1
  42. package/dist/{app-B9MkUjRo.js → app-BL2xIPMp.js} +102 -66
  43. package/dist/{app-BmT3kZJr.js → app-CO6FVdHg.js} +1 -1
  44. package/dist/app.js +1 -1
  45. package/dist/{business-1nKmKs9l.js → business-BMTDDe8v.js} +1 -1
  46. package/dist/{dto-DP9kIlr_.js → campaign-C5TEfnWg.js} +610 -818
  47. package/dist/{campaign-xn4PhDSV.js → campaign-CzpECNqa.js} +2 -2
  48. package/dist/{campaign.enum-KwZQ6yBR.js → campaign.enum-CVF3KbJ2.js} +1 -1
  49. package/dist/{campaign.fn-CVj38fae.js → campaign.fn-WT1gfEwK.js} +2 -2
  50. package/dist/{collectible.enum-DojcTb50.js → collectible.enum-BW7-BEa-.js} +3 -3
  51. package/dist/{collection.fn-Bv2EZuA3.js → collection.fn-BRsC9uPP.js} +2 -2
  52. package/dist/dto-B1tWHAjt.js +214 -0
  53. package/dist/{effect-47JS4i8Q.js → effect-4Ov4Jl68.js} +1 -1
  54. package/dist/{email-addresses-C6Jvh8MK.js → email-addresses-L25192f3.js} +1 -1
  55. package/dist/{export-BdPv7Hej.js → export-UEJjaL0g.js} +5 -5
  56. package/dist/{helper-Di0AEV1F.js → helper-BNBSbgdl.js} +1 -1
  57. package/dist/{index-BPkcvPHp.js → index-BWY2o9U9.js} +1 -1
  58. package/dist/index-BnWjqXOJ.js +115 -0
  59. package/dist/{index-D5LMqy6S.js → index-BxwVs3Ot.js} +29 -4
  60. package/dist/index-Cg64BkVG.js +44 -0
  61. package/dist/{index-DHb0pIVR.js → index-ChKwu49G.js} +6 -6
  62. package/dist/{index-Be9fjCVp.js → index-CtY-c-yc.js} +1 -1
  63. package/dist/{index-CVsuhUpe.js → index-D4iYmdD4.js} +12 -13
  64. package/dist/{index-YAoPUv6z.js → index-D8Qn3ZjQ.js} +1 -1
  65. package/dist/{index-gYvuI9Nk.js → index-DpCBCiH_.js} +5 -5
  66. package/dist/{index-BZg5tj39.js → index-DxjXJh5H.js} +3039 -3036
  67. package/dist/{index-BUjGxHkM.js → index-fdv6AHmk.js} +2057 -1010
  68. package/dist/{index-CDmiwLKd.js → index-jf1CG6wc.js} +1 -1
  69. package/dist/{index.esm2017-C-O-0X0H.js → index.esm2017-D-3LEGru.js} +1 -1
  70. package/dist/{loading-E0zwe5lq.js → loading-CUp8ZsA0.js} +4 -4
  71. package/dist/{membership-OECc9rWj.js → membership-DwbiFGd7.js} +6 -6
  72. package/dist/{money-CVSdH00t.js → money-BLrbHrdQ.js} +1 -1
  73. package/dist/{number-Iu6cix1k.js → number--bZt83Nn.js} +1 -1
  74. package/dist/objectid-CCGQh_Y_.js +145 -0
  75. package/dist/{reward-BH_1xbHQ.js → reward-D99cFWcD.js} +1 -1
  76. package/dist/{rule-CbkzOdR3.js → rule-UpH1Y1i5.js} +3 -3
  77. package/dist/{rule-builder-WIEeIoXD.js → rule-builder-ujLy6UTt.js} +1 -1
  78. package/dist/{template-Dlo0YPQp.js → template-FiuUP37O.js} +4 -4
  79. package/dist/{trigger-BMknrXKj.js → trigger-BZYtwSky.js} +13 -13
  80. package/dist/{usePagination-B9K_XXDC.js → usePagination-DDW-s6D3.js} +1 -1
  81. package/dist/{user-CuX5BIg5.js → user-BA3Sw5dU.js} +1 -1
  82. package/dist/{vue-i18n-CrVlAF7z.js → vue-i18n-C5t_xZZj.js} +2 -2
  83. package/package.json +6 -6
  84. package/dist/Collections-N7LIfZ2D.js +0 -435
  85. package/dist/MemberList-UIZANV1T.js +0 -1043
  86. package/dist/MemberTransactions-JKLzrvh6.js +0 -38
  87. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CcNjdcMX.js +0 -1132
  88. package/dist/Voucher-CDlHku1x.js +0 -490
  89. package/dist/index-CPjDZrsE.js +0 -99
  90. package/dist/index-Dd0IgwOF.js +0 -1051
  91. package/dist/objectid-B16Lk1pC.js +0 -145
@@ -0,0 +1,445 @@
1
+ var oe = Object.defineProperty;
2
+ var te = (g, u, c) => u in g ? oe(g, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : g[u] = c;
3
+ var O = (g, u, c) => te(g, typeof u != "symbol" ? u + "" : u, c);
4
+ import { defineComponent as H, ref as f, computed as J, watch as K, resolveComponent as d, openBlock as h, createBlock as T, unref as o, isRef as j, withCtx as I, createElementVNode as C, createVNode as r, createElementBlock as R, Fragment as P, renderList as ae, createCommentVNode as U, onMounted as le, h as z } from "vue";
5
+ import { h as G } from "./moment-BWErdI6_.js";
6
+ import { components as ne } from "@feedmepos/ui-library";
7
+ import { u as Q, a as se } from "./loading-CUp8ZsA0.js";
8
+ import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
+ import { u as ie } from "./app-wDQR6dpb.js";
10
+ import { useRoute as W, useRouter as ue } from "vue-router";
11
+ import { c as N } from "./index-BnWjqXOJ.js";
12
+ import { e as p } from "./index-vh86FiIQ.js";
13
+ import { u as Y, a as de, _ as ce, w as me } from "./usePagination-DDW-s6D3.js";
14
+ import { g as pe } from "./user-BA3Sw5dU.js";
15
+ import { m as fe } from "./index-BxwVs3Ot.js";
16
+ import { o as ge } from "./objectId-dwaoBfJX.js";
17
+ const be = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1), Ce = { class: "space-y-16" }, ve = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1), he = { class: "gap-16 grid grid-cols-2" }, ye = { class: "flex items-center gap-8" }, xe = /* @__PURE__ */ H({
18
+ __name: "CreateCollectionSheet",
19
+ emits: ["success"],
20
+ setup(g, { expose: u, emit: c }) {
21
+ const { minor: S } = Q, w = W(), F = f(), k = f(!1), q = c, b = f(!1);
22
+ function D(s) {
23
+ b.value = s, s && (a.value = {
24
+ quantity: 1,
25
+ code: "",
26
+ codeConfig: {
27
+ length: 8,
28
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
29
+ prefix: "",
30
+ suffix: "",
31
+ pattern: "########"
32
+ }
33
+ });
34
+ }
35
+ const a = f({
36
+ quantity: 1,
37
+ code: "",
38
+ codeConfig: {
39
+ length: 8,
40
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
41
+ prefix: "",
42
+ suffix: "",
43
+ pattern: "########"
44
+ }
45
+ }), E = [
46
+ {
47
+ label: "Bulk codes",
48
+ value: "bulk",
49
+ sublabel: "Bulk generate unique codes"
50
+ },
51
+ {
52
+ label: "Custom code",
53
+ value: "single",
54
+ sublabel: "Enter your own custom codes"
55
+ }
56
+ ], B = [
57
+ {
58
+ label: "Alphanumeric",
59
+ value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
60
+ },
61
+ {
62
+ label: "Alphabetic",
63
+ value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
64
+ },
65
+ { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
66
+ { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
67
+ { label: "Numbers", value: "0123456789" },
68
+ { label: "Custom", value: "" }
69
+ ], v = f(B[0].value), m = f("bulk"), y = f(!1), A = J(() => w.params.id);
70
+ async function n(s) {
71
+ var e;
72
+ await ((e = F.value) == null ? void 0 : e.validateInputs()), k.value && await S(
73
+ async () => {
74
+ await N.createCollectionByCampaignId(A.value, s), await q("success");
75
+ },
76
+ {
77
+ message: "Creating claim(s)",
78
+ successMessage: "Claim(s) created"
79
+ }
80
+ );
81
+ }
82
+ u({
83
+ showSheet: D
84
+ }), K(
85
+ () => m.value,
86
+ (s, e) => {
87
+ 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 = "########");
88
+ }
89
+ );
90
+ function l(s) {
91
+ if (m.value !== "single") return !1;
92
+ const e = s.split(`
93
+ `).map((i) => i.trim()).filter(Boolean);
94
+ return new Set(e).size !== e.length;
95
+ }
96
+ return K(
97
+ () => a.value.codeConfig.length,
98
+ (s, e) => {
99
+ s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
100
+ }
101
+ ), (s, e) => {
102
+ const i = d("FmRadio"), x = d("FmRadioGroup"), M = d("FmSwitch"), V = d("FmStepperField"), L = d("FmSelect"), _ = d("FmTextField"), X = d("FmTextarea"), Z = d("FmForm"), $ = d("FmButton"), ee = d("FmSideSheet");
103
+ return h(), T(ee, {
104
+ "max-width": 560,
105
+ "dismiss-away": !0,
106
+ header: "Create collection",
107
+ modelValue: o(b),
108
+ "onUpdate:modelValue": [
109
+ e[14] || (e[14] = (t) => j(b) ? b.value = t : null),
110
+ e[15] || (e[15] = (t) => b.value = t)
111
+ ]
112
+ }, {
113
+ "side-sheet-footer": I(() => [
114
+ C("div", ye, [
115
+ r($, {
116
+ label: "Save",
117
+ onClick: e[12] || (e[12] = (t) => n(o(a))),
118
+ loading: o(ie)().isLoading
119
+ }, null, 8, ["loading"]),
120
+ r($, {
121
+ label: "Cancel",
122
+ type: "button",
123
+ variant: "tertiary",
124
+ onClick: e[13] || (e[13] = (t) => b.value = !1)
125
+ })
126
+ ])
127
+ ]),
128
+ default: I(() => [
129
+ r(re, { json: o(a) }, null, 8, ["json"]),
130
+ r(Z, {
131
+ ref_key: "form",
132
+ ref: F,
133
+ class: "space-y-40",
134
+ onValidationSuccess: e[10] || (e[10] = (t) => k.value = !0),
135
+ onValidationFailed: e[11] || (e[11] = (t) => k.value = !1)
136
+ }, {
137
+ default: I(() => [
138
+ C("div", null, [
139
+ be,
140
+ r(x, {
141
+ modelValue: o(m),
142
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => j(m) ? m.value = t : null),
143
+ inline: !1
144
+ }, {
145
+ default: I(() => [
146
+ (h(), R(P, null, ae(E, (t) => r(i, {
147
+ key: t.value,
148
+ value: t.value,
149
+ label: t.label,
150
+ sublabel: t.sublabel
151
+ }, null, 8, ["value", "label", "sublabel"])), 64))
152
+ ]),
153
+ _: 1
154
+ }, 8, ["modelValue"])
155
+ ]),
156
+ C("div", Ce, [
157
+ ve,
158
+ o(m) === "bulk" ? (h(), R(P, { key: 0 }, [
159
+ r(M, {
160
+ "model-value": o(y),
161
+ "label-placement": "right",
162
+ value: "true",
163
+ label: "Advance code setting",
164
+ required: !0,
165
+ "onUpdate:modelValue": e[1] || (e[1] = () => y.value = !o(y))
166
+ }, null, 8, ["model-value"]),
167
+ o(y) ? (h(), R(P, { key: 0 }, [
168
+ r(V, {
169
+ modelValue: o(a).codeConfig.length,
170
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
171
+ label: "Code length",
172
+ max: 16,
173
+ min: 1,
174
+ rules: [
175
+ (t) => Number(t) >= 1 || "Code length must at least 1",
176
+ (t) => Number(t) <= 16 || "Code length must less than 16"
177
+ ],
178
+ required: !0
179
+ }, null, 8, ["modelValue", "rules"]),
180
+ r(L, {
181
+ label: "Charset",
182
+ "model-value": o(v),
183
+ items: B,
184
+ "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
185
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => {
186
+ v.value = t, o(a).codeConfig.charset = t;
187
+ })
188
+ }, null, 8, ["model-value", "helper-text"]),
189
+ o(v) === "" ? (h(), T(_, {
190
+ key: 0,
191
+ modelValue: o(a).codeConfig.charset,
192
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
193
+ label: "Custom Charset",
194
+ required: ""
195
+ }, null, 8, ["modelValue"])) : U("", !0),
196
+ C("div", he, [
197
+ r(_, {
198
+ modelValue: o(a).codeConfig.prefix,
199
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
200
+ label: "Prefix (Optional)"
201
+ }, null, 8, ["modelValue"]),
202
+ r(_, {
203
+ modelValue: o(a).codeConfig.suffix,
204
+ "onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
205
+ label: "Suffix (Optional)"
206
+ }, null, 8, ["modelValue"])
207
+ ]),
208
+ r(_, {
209
+ modelValue: o(a).codeConfig.pattern,
210
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
211
+ label: "Pattern",
212
+ required: !0
213
+ }, null, 8, ["modelValue"])
214
+ ], 64)) : U("", !0),
215
+ r(_, {
216
+ modelValue: o(a).quantity,
217
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
218
+ label: "Number of code",
219
+ rules: [
220
+ (t) => t >= 1 || "Quantity cannot be less than 1",
221
+ (t) => t <= 1e4 || "Quantity cannot more than 10,000"
222
+ ],
223
+ required: !0,
224
+ "helper-text": `${o(a).quantity} claim will be created`
225
+ }, null, 8, ["modelValue", "rules", "helper-text"])
226
+ ], 64)) : U("", !0),
227
+ o(m) !== "bulk" ? (h(), T(X, {
228
+ key: 1,
229
+ modelValue: o(a).code,
230
+ "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
231
+ label: "Custom Code",
232
+ rules: [
233
+ (t) => o(m) != "single" || !!t || "Custom code is required",
234
+ (t) => !l(t) || "Custom code must be unique"
235
+ ],
236
+ placeholder: "(For multiple codes, please enter in the new row.)"
237
+ }, null, 8, ["modelValue", "rules"])) : U("", !0)
238
+ ])
239
+ ]),
240
+ _: 1
241
+ }, 512)
242
+ ]),
243
+ _: 1
244
+ }, 8, ["modelValue"]);
245
+ };
246
+ }
247
+ });
248
+ class Ve {
249
+ constructor() {
250
+ O(this, "data", []);
251
+ }
252
+ addRecord(u) {
253
+ this.data.push(u);
254
+ }
255
+ buildExcel() {
256
+ const u = Y.book_new(), c = Y.json_to_sheet(this.data);
257
+ return Y.book_append_sheet(u, c, "Collection"), u;
258
+ }
259
+ }
260
+ const Se = { class: "px-24 flex flex-col gap-y-32 pb-24" }, we = { class: "flex items-center justify-end py-4 xs:hidden" }, Le = /* @__PURE__ */ H({
261
+ __name: "Collections",
262
+ setup(g) {
263
+ const u = ue(), c = W(), S = f(), w = J(() => c.params.id), F = f(!1), { custom: k } = Q, q = [
264
+ {
265
+ header: "ID/Code",
266
+ accessorKey: "_id",
267
+ cell(n) {
268
+ return z("div", { class: "flex items-center" }, [
269
+ z(ne.FmIcon, {
270
+ name: "content_copy",
271
+ outline: !0,
272
+ size: "sm",
273
+ class: "cursor-pointer mr-4",
274
+ onClick: (l) => {
275
+ l.preventDefault(), l.stopPropagation(), se(
276
+ n.row.original.code || n.row.original._id.toString()
277
+ );
278
+ }
279
+ }),
280
+ z(
281
+ "div",
282
+ { class: "pr-2 text-ellipsis overflow-hidden" },
283
+ n.row.original.code || n.row.original._id.toString()
284
+ )
285
+ ]);
286
+ }
287
+ },
288
+ {
289
+ header: "User",
290
+ accessorKey: "user",
291
+ enableSorting: !1,
292
+ cell(n) {
293
+ const l = n.row.original.pf_user;
294
+ return pe(l);
295
+ }
296
+ },
297
+ {
298
+ header: "Phone",
299
+ accessorFn: (n) => {
300
+ var l;
301
+ return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
302
+ },
303
+ accessorKey: "pf_user.phoneNumber"
304
+ },
305
+ {
306
+ header: "Balance",
307
+ accessorKey: "balance"
308
+ },
309
+ {
310
+ header: "Created at",
311
+ accessorKey: "_id",
312
+ accessorFn: (n) => G(ge(n._id.toString())).format("DD MMM YYYY")
313
+ },
314
+ {
315
+ header: "Nearest expired at",
316
+ accessorKey: "expiryBalance",
317
+ accessorFn: (n) => {
318
+ var l;
319
+ return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
320
+ }
321
+ }
322
+ ], b = {
323
+ "$connect-STORE_REWARD_COLLECTIONS": fe.readCollectionsByRewardId,
324
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": N.readCollectionsByCampaignId
325
+ }, D = (n) => {
326
+ const l = b[c.name];
327
+ return (s) => l(n, s);
328
+ }, { tableMeta: a, rowData: E, onSort: B, debouncedFetchData: v, onSearch: m } = de(D(w.value));
329
+ async function y() {
330
+ var n;
331
+ await v(), (n = S.value) == null || n.showSheet(!1);
332
+ }
333
+ async function A() {
334
+ F.value || k(
335
+ async () => {
336
+ var e;
337
+ const n = new Ve(), l = (await N.readCollectionsByCampaignId(w.value, {
338
+ limit: 1,
339
+ skip: 0,
340
+ sortBy: p.sortBy,
341
+ descending: p.descending
342
+ })).meta.totalResources ?? 0, s = p.rowsPerPage;
343
+ for (let i = 0; i < l; i += s) {
344
+ const x = {
345
+ ...p,
346
+ limit: s,
347
+ skip: (p.page - 1) * p.rowsPerPage,
348
+ sortBy: p.sortBy,
349
+ descending: p.descending
350
+ }, M = await N.readCollectionsByCampaignId(
351
+ w.value,
352
+ x
353
+ );
354
+ for await (const V of M.resources) {
355
+ const L = {
356
+ Id: (V == null ? void 0 : V.code) || ((e = V._id) == null ? void 0 : e.toString()) || ""
357
+ };
358
+ n.addRecord(L);
359
+ }
360
+ p.page++;
361
+ }
362
+ await me(
363
+ n.buildExcel(),
364
+ `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
365
+ {
366
+ bookType: "xlsx",
367
+ bookSST: !1,
368
+ type: "array"
369
+ }
370
+ ), p.page = 1;
371
+ },
372
+ {
373
+ isLoading: F
374
+ }
375
+ );
376
+ }
377
+ return le(async () => {
378
+ await v();
379
+ }), (n, l) => {
380
+ const s = d("FmPageHead"), e = d("FmSearch");
381
+ return h(), R(P, null, [
382
+ r(s, {
383
+ title: "Collections",
384
+ "back-button": !0,
385
+ actions: [
386
+ { label: "Export", value: "export", isPrimary: !1 },
387
+ {
388
+ label: "Create collection",
389
+ value: "create",
390
+ isPrimary: !0
391
+ }
392
+ ],
393
+ "onClick:back": l[0] || (l[0] = (i) => o(u).back()),
394
+ "onClick:action": l[1] || (l[1] = (i) => {
395
+ var x;
396
+ i === "create" && ((x = o(S)) == null || x.showSheet(!0)), i === "export" && A();
397
+ })
398
+ }),
399
+ C("div", Se, [
400
+ r(e, {
401
+ class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
402
+ modelValue: o(a).searchValue,
403
+ "onUpdate:modelValue": [
404
+ l[2] || (l[2] = (i) => o(a).searchValue = i),
405
+ o(m)
406
+ ],
407
+ placeholder: "Search",
408
+ collapsible: ""
409
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
410
+ C("div", we, [
411
+ r(e, {
412
+ modelValue: o(a).searchValue,
413
+ "onUpdate:modelValue": [
414
+ l[3] || (l[3] = (i) => o(a).searchValue = i),
415
+ o(m)
416
+ ],
417
+ placeholder: "Search",
418
+ collapsible: ""
419
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
420
+ ]),
421
+ r(ce, {
422
+ loading: o(a).isLoading,
423
+ "row-data": o(E),
424
+ "column-defs": q,
425
+ "row-count": o(a).totalRows,
426
+ "page-count": o(a).pageCount,
427
+ "page-index": o(a).pageIndex,
428
+ "page-size": o(a).pageSize,
429
+ "shrink-at": !1,
430
+ onSortChange: o(B),
431
+ onPageChange: l[4] || (l[4] = (i) => o(v)({ pageSize: i.pageSize, pageIndex: i.pageIndex }))
432
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
433
+ r(xe, {
434
+ ref_key: "sheetRef",
435
+ ref: S,
436
+ onSuccess: y
437
+ }, null, 512)
438
+ ])
439
+ ], 64);
440
+ };
441
+ }
442
+ });
443
+ export {
444
+ Le as default
445
+ };