@feedmepos/mf-connect 0.1.9-prod → 0.1.11-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 (90) hide show
  1. package/dist/{Analytic-8Ew7y5t9.js → Analytic-Bbt1kP2U.js} +24 -23
  2. package/dist/{App-3BVNH3r-.js → App-CVA65EVC.js} +56 -51
  3. package/dist/{Broadcast-CrsPUhLT.js → Broadcast-BJXK8OE5.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DE300Y56.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DDEx0cK9.js} +7 -7
  5. package/dist/Card-DFiUkfYj.js +895 -0
  6. package/dist/{Collections-djS9hLI8.js → Collections-qVnvveUf.js} +24 -29
  7. package/dist/{Credit-D4KEvIov.js → Credit-BWHTbAG-.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-4_cHlWUJ.js} +648 -1284
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-aEWfdpCg.js → EffectSheet.vue_vue_type_style_index_0_lang-DLgZd4HU.js} +19 -19
  10. package/dist/{Experience-2FPLO7aV.js → Experience-BmGSus53.js} +8 -8
  11. package/dist/{Game-e_UjVJgU.js → Game-49w7XN5k.js} +8 -8
  12. package/dist/Index-D-7hsAaE.js +258 -0
  13. package/dist/{Marketing-B2hCjZ2r.js → Marketing-DtbJxS_j.js} +5 -5
  14. package/dist/{Member-D_ykRIBb.js → Member-jZks4pw_.js} +4 -4
  15. package/dist/{MemberList-LmzzYxEn.js → MemberList-BqO54kPC.js} +193 -189
  16. package/dist/{MemberTransactions-B2vqlKaP.js → MemberTransactions-CLK7VmPw.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DQ2ubF0N.js → MessageInput.vue_vue_type_script_setup_true_lang-ef2Qrdvd.js} +2 -2
  18. package/dist/Mission-LGC1CGrB.js +273 -0
  19. package/dist/Overview-Dm_ycoqZ.js +1078 -0
  20. package/dist/{Point-DFriwWWY.js → Point-BBNJ9cc5.js} +8 -8
  21. package/dist/{Promotion-Db3IEs2F.js → Promotion-DFh9IEmP.js} +9 -9
  22. package/dist/Record-oBmJTn3G.js +338 -0
  23. package/dist/Reward-DR_HzrrM.js +441 -0
  24. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Du_0o2b9.js +150 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CxXugphA.js +1638 -0
  26. package/dist/{Segment-CE8q9JV2.js → Segment-DjyHLWZC.js} +13 -13
  27. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-stTwgie4.js +181 -0
  28. package/dist/{Setting-Vcz1S27V.js → Setting-a7Tw-3ht.js} +31 -31
  29. package/dist/Store-HWGWswEm.js +1744 -0
  30. package/dist/{StoreRewards-Dt30AkWo.js → StoreRewards-s4cX1bFH.js} +12 -12
  31. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dq4qIXZu.js +1132 -0
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-f59onlgt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BQpbScyf.js} +1 -1
  33. package/dist/{Tier-a6yXEtLd.js → Tier-C7kiLjzE.js} +19 -19
  34. package/dist/{Title-A3-2EI0w.js → Title-BPv1ZiHg.js} +19 -19
  35. package/dist/{Transaction-DswABr2P.js → Transaction-HdR7RiGY.js} +2 -2
  36. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D3VgIQb-.js +130 -0
  37. package/dist/{Voucher-DEoVgZYa.js → Voucher-Y5Lh5xms.js} +11 -11
  38. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CFKID7mS.js +419 -0
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-ccc1vxjS.js → ZodTextField.vue_vue_type_script_setup_true_lang-6asSbt53.js} +1 -1
  40. package/dist/{app-C23GfQGq.js → app-Bh2mviM1.js} +1 -1
  41. package/dist/{app-C66C2KLW.js → app-MbHo43vs.js} +982 -698
  42. package/dist/app.js +1 -1
  43. package/dist/{business-DNAVZOSH.js → business-DMzeDNMd.js} +1 -1
  44. package/dist/{campaign-Cv0HaUD1.js → campaign-2swZVVbi.js} +2 -2
  45. package/dist/campaign.enum-CHI6p9lH.js +20 -0
  46. package/dist/campaign.fn-DNwV5ZWO.js +758 -0
  47. package/dist/collectible.enum-Y3ALLTcR.js +19 -0
  48. package/dist/{collection.fn-Dxzr2oPt.js → collection.fn-CfvnmVQa.js} +2 -2
  49. package/dist/dto-DseG41FR.js +2018 -0
  50. package/dist/{effect-CUuL8Tci.js → effect-BH4hGy1N.js} +1 -1
  51. package/dist/{email-addresses-Yt3s7i2b.js → email-addresses-doOfKmSj.js} +1 -1
  52. package/dist/{export-CNg5YWMm.js → export-DGrsZa4F.js} +3 -3
  53. package/dist/{helper-DzmKNFue.js → helper-3ohDu5Tn.js} +1 -1
  54. package/dist/{index-BK8X9RF6.js → index-B8HMoADH.js} +3 -3
  55. package/dist/{index-D0obMrAS.js → index-BUzeShnL.js} +173 -62
  56. package/dist/index-BWwF7uuk.js +1049 -0
  57. package/dist/index-BXw9yi-G.js +32 -0
  58. package/dist/{index-yzH5eyKW.js → index-C-ozJGq6.js} +1 -1
  59. package/dist/{index-CsCgQ8gt.js → index-CDT7BpQ3.js} +1 -1
  60. package/dist/{index-Dnf7j71V.js → index-CKfeyWFN.js} +9 -3
  61. package/dist/{index-9CXt2kbQ.js → index-CKji0U5N.js} +293 -287
  62. package/dist/{index-QuBsnXgx.js → index-CVlbqA1t.js} +1 -1
  63. package/dist/{index-B88e_9YI.js → index-D5CHO7oc.js} +1 -1
  64. package/dist/{index-O9lB54LY.js → index-rYTZxC9p.js} +1348 -1342
  65. package/dist/index-vh86FiIQ.js +10 -0
  66. package/dist/index-wBdTUnZ6.js +54 -0
  67. package/dist/{index.esm2017-TpBElhnN.js → index.esm2017-D-hthfW3.js} +1 -1
  68. package/dist/{loading-ChoC5E9d.js → loading-DQnXnCXT.js} +156 -153
  69. package/dist/{membership-CU-k0-Tf.js → membership-C3envHTy.js} +52 -44
  70. package/dist/{money-DANmyTBj.js → money-Dm7B8wUJ.js} +1 -1
  71. package/dist/{number-DrocTWDD.js → number-Swjcamr8.js} +1 -1
  72. package/dist/objectid-xH_8eWzr.js +145 -0
  73. package/dist/reward-DOggYNm3.js +36 -0
  74. package/dist/{rule-BQLmpER9.js → rule-BQy3e3DE.js} +4 -3
  75. package/dist/{rule-builder-3YRdr18A.js → rule-builder-CPWmw5lP.js} +1 -1
  76. package/dist/{template-DOKU1QkY.js → template-Dprn2jD_.js} +4 -4
  77. package/dist/trigger-BUY-zCBi.js +144 -0
  78. package/dist/{usePagination-JGI7x0W7.js → usePagination-CEQLUMQ7.js} +1 -1
  79. package/dist/user-DIK4sBIA.js +54 -0
  80. package/dist/{vue-i18n-Bch1JmhI.js → vue-i18n-B7ledd-g.js} +120 -120
  81. package/package.json +2 -2
  82. package/dist/Card-DndggRLr.js +0 -1036
  83. package/dist/Mission-CsLdMq1M.js +0 -261
  84. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-_P2yImhi.js +0 -1804
  85. package/dist/Store-C8kT7JN5.js +0 -1531
  86. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cc2F_06x.js +0 -1065
  87. package/dist/dto-CcrufW2j.js +0 -2770
  88. package/dist/index-C7745kXl.js +0 -755
  89. package/dist/index-CZ28ywyB.js +0 -298
  90. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as j, ref as P, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as w, Fragment as b, createVNode as r, unref as t, withCtx as _, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as x, resolveDynamicComponent as q } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q, u as W } from "./loading-ChoC5E9d.js";
5
- import { u as X } from "./business-DNAVZOSH.js";
6
- import { u as Y } from "./campaign-Cv0HaUD1.js";
7
- import { g as V, a as I } from "./dto-CcrufW2j.js";
4
+ import { p as Q, u as W } from "./loading-DQnXnCXT.js";
5
+ import { u as X } from "./business-DMzeDNMd.js";
6
+ import { u as Y } from "./campaign-2swZVVbi.js";
7
+ import { g as V, a as I } from "./dto-DseG41FR.js";
8
8
  import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js";
10
- import { u as te } from "./template-DOKU1QkY.js";
11
- import { u as oe } from "./vue-i18n-Bch1JmhI.js";
12
- import { c as g } from "./index-CsCgQ8gt.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-4_cHlWUJ.js";
10
+ import { u as te } from "./template-Dprn2jD_.js";
11
+ import { u as oe } from "./vue-i18n-B7ledd-g.js";
12
+ import { c as g } from "./index-CDT7BpQ3.js";
13
13
  const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = /* @__PURE__ */ n("img", {
14
14
  src: z,
15
15
  class: "aspect-square w-[150px]"
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as r, openBlock as m, createElementBlock as h, Fragment as w, createVNode as i, unref as n, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
2
2
  import { _ as W } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as X, components as Y } from "@feedmepos/ui-library";
4
- import { c as O, p as I, u as Z } from "./loading-ChoC5E9d.js";
5
- import { u as ee } from "./business-DNAVZOSH.js";
6
- import { u as oe } from "./campaign-Cv0HaUD1.js";
7
- import { u as te } from "./vue-i18n-Bch1JmhI.js";
8
- import { g as V } from "./dto-CcrufW2j.js";
9
- import { e as L } from "./effect-CUuL8Tci.js";
4
+ import { c as O, p as I, u as Z } from "./loading-DQnXnCXT.js";
5
+ import { u as ee } from "./business-DMzeDNMd.js";
6
+ import { u as oe } from "./campaign-2swZVVbi.js";
7
+ import { u as te } from "./vue-i18n-B7ledd-g.js";
8
+ import { g as V } from "./dto-DseG41FR.js";
9
+ import { e as L } from "./effect-BH4hGy1N.js";
10
10
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js";
12
- import { u as se } from "./template-DOKU1QkY.js";
13
- import { c as u } from "./index-CsCgQ8gt.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-4_cHlWUJ.js";
12
+ import { u as se } from "./template-Dprn2jD_.js";
13
+ import { c as u } from "./index-CDT7BpQ3.js";
14
14
  const ce = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = /* @__PURE__ */ s("img", {
15
15
  src: W,
16
16
  class: "aspect-square w-[150px]"
@@ -0,0 +1,338 @@
1
+ var q = Object.defineProperty;
2
+ var G = (g, o, m) => o in g ? q(g, o, { enumerable: !0, configurable: !0, writable: !0, value: m }) : g[o] = m;
3
+ var z = (g, o, m) => G(g, typeof o != "symbol" ? o + "" : o, m);
4
+ import { defineComponent as T, ref as B, computed as H, resolveComponent as C, openBlock as I, createBlock as J, unref as n, isRef as Q, withCtx as X, createElementBlock as U, createVNode as w, withModifiers as Z, createCommentVNode as ee, createElementVNode as N, h, onMounted as re, Fragment as te } from "vue";
5
+ import { u as V, a as oe, _ as ae, w as se } from "./usePagination-CEQLUMQ7.js";
6
+ import { g as A } from "./user-DIK4sBIA.js";
7
+ import { components as R } from "@feedmepos/ui-library";
8
+ import { u as j, a as ie, c as ne } from "./loading-DQnXnCXT.js";
9
+ import { u as L } from "./vue-i18n-B7ledd-g.js";
10
+ import { useCoreStore as ce } from "@feedmepos/mf-common";
11
+ import { r as v } from "./index-BXw9yi-G.js";
12
+ import { c as le, a as de } from "./object-qECH92oz.js";
13
+ import { u as me } from "./membership-C3envHTy.js";
14
+ import { e as f } from "./index-vh86FiIQ.js";
15
+ import { h as ue } from "./moment-BWErdI6_.js";
16
+ import { o as pe } from "./objectId-dwaoBfJX.js";
17
+ const fe = {
18
+ key: 0,
19
+ class: "flex justify-end mb-16"
20
+ }, ge = { class: "flex flex-col space-y-16 pr-12" }, he = /* @__PURE__ */ T({
21
+ __name: "UpdateCriteriaProgressSheet",
22
+ emits: ["refresh"],
23
+ setup(g, { expose: o, emit: m }) {
24
+ const y = m;
25
+ L();
26
+ const { minor: k } = j, l = B(!1), d = B({}), F = ce(), S = [
27
+ {
28
+ header: "Criteria title",
29
+ accessorFn: (a) => a.name
30
+ },
31
+ {
32
+ header: "Status",
33
+ cell(a) {
34
+ var u;
35
+ const e = a.row.original, r = (u = d.value.criteria_progress) == null ? void 0 : u.find(
36
+ (_) => _.criteria === e._id
37
+ ), i = r ? "Completed" : "Pending", c = r ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100";
38
+ return [
39
+ h(R.FmChip, {
40
+ label: i,
41
+ compact: !0,
42
+ class: c
43
+ })
44
+ ];
45
+ }
46
+ },
47
+ {
48
+ id: "actions",
49
+ cell(a) {
50
+ var i;
51
+ const e = a.row.original;
52
+ return [
53
+ !((i = d.value.criteria_progress) == null ? void 0 : i.some(
54
+ (c) => c.criteria === e._id
55
+ )) && e.type == "MANUAL" ? h(R.FmButton, {
56
+ variant: "secondary",
57
+ label: "Mark as completed",
58
+ size: "md",
59
+ onClick: (c) => {
60
+ c.stopPropagation(), x(e._id.toString());
61
+ }
62
+ }) : null
63
+ ];
64
+ }
65
+ }
66
+ ], M = H(() => {
67
+ var e, r, i, c;
68
+ return (((r = (e = d.value) == null ? void 0 : e.criteria_progress) == null ? void 0 : r.filter(
69
+ (u) => {
70
+ var _;
71
+ return (_ = d.value) == null ? void 0 : _.criteria.some(
72
+ (P) => P._id.toString() === u.criteria.toString()
73
+ );
74
+ }
75
+ )) || []).length == ((i = d.value) == null ? void 0 : i.criteria.length) && ((c = d.value) == null ? void 0 : c.status) != "COMPLETED";
76
+ });
77
+ async function x(a) {
78
+ var r;
79
+ const e = le(de(d.value));
80
+ e.criteria_progress = [
81
+ {
82
+ criteria: a,
83
+ ref: `ADMIN:${(r = F.user) == null ? void 0 : r.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
84
+ completedAt: /* @__PURE__ */ new Date()
85
+ }
86
+ ], k(
87
+ async () => {
88
+ await v.updateCriteriaProgress(
89
+ d.value._id,
90
+ e
91
+ ), l.value = !1, y("refresh");
92
+ },
93
+ {
94
+ message: "Updating criteria progress",
95
+ successMessage: "Criteria progress updated successfully"
96
+ }
97
+ );
98
+ }
99
+ function t(a, e) {
100
+ l.value = a, d.value = e;
101
+ }
102
+ function s() {
103
+ l.value = !1;
104
+ }
105
+ return o({
106
+ showSheet: t,
107
+ hideSheet: s,
108
+ data: d
109
+ }), (a, e) => {
110
+ const r = C("FmButton"), i = C("FmTable"), c = C("FmSideSheet");
111
+ return I(), J(c, {
112
+ "max-width": 768,
113
+ modelValue: n(l),
114
+ "onUpdate:modelValue": e[1] || (e[1] = (u) => Q(l) ? l.value = u : null),
115
+ header: "Referee Criteria"
116
+ }, {
117
+ default: X(() => [
118
+ n(M) ? (I(), U("div", fe, [
119
+ w(r, {
120
+ icon: "refresh",
121
+ label: "Refresh",
122
+ onClick: e[0] || (e[0] = Z((u) => x(n(d)._id), ["stop"]))
123
+ })
124
+ ])) : ee("", !0),
125
+ N("div", ge, [
126
+ w(i, {
127
+ "row-data": n(d).criteria,
128
+ "hide-footer": !0,
129
+ "page-size": 100,
130
+ "column-defs": S
131
+ }, null, 8, ["row-data"])
132
+ ])
133
+ ]),
134
+ _: 1
135
+ }, 8, ["modelValue"]);
136
+ };
137
+ }
138
+ });
139
+ class _e {
140
+ constructor() {
141
+ z(this, "data", []);
142
+ }
143
+ addRecord(o) {
144
+ this.data.push(o);
145
+ }
146
+ buildExcel() {
147
+ const o = V.book_new(), m = V.json_to_sheet(this.data);
148
+ return V.book_append_sheet(o, m, "Referrals"), o;
149
+ }
150
+ }
151
+ const we = { class: "flex items-center justify-end" }, Ie = /* @__PURE__ */ T({
152
+ __name: "Record",
153
+ setup(g) {
154
+ const { t: o } = L();
155
+ me();
156
+ const { minor: m } = j, y = B(null), k = [
157
+ {
158
+ header: "ID",
159
+ meta: {
160
+ maxWidth: "100px"
161
+ },
162
+ cell(t) {
163
+ return h("div", { class: "flex items-center" }, [
164
+ h(R.FmIcon, {
165
+ name: "content_copy",
166
+ outline: !0,
167
+ size: "sm",
168
+ class: "cursor-pointer mr-4",
169
+ onClick: (s) => {
170
+ s.preventDefault(), s.stopPropagation(), ie(t.row.original._id.toString());
171
+ }
172
+ }),
173
+ h(
174
+ "div",
175
+ { class: "pr-2 text-ellipsis overflow-hidden" },
176
+ t.row.original._id.toString()
177
+ )
178
+ ]);
179
+ },
180
+ enableSorting: !1
181
+ },
182
+ {
183
+ header: o("connect.referral.record.referer_info"),
184
+ enableSorting: !0,
185
+ cell(t) {
186
+ return t.row.original.pf_referer ? A(t.row.original.pf_referer, !0) : "N/A";
187
+ }
188
+ },
189
+ {
190
+ header: o("connect.referral.record.referee_info"),
191
+ enableSorting: !0,
192
+ cell(t) {
193
+ return t.row.original.pf_referee ? A(t.row.original.pf_referee, !0) : "N/A";
194
+ }
195
+ },
196
+ {
197
+ header: o("connect.referral.record.referee_criteria"),
198
+ accessorKey: "criteria",
199
+ id: "criteria",
200
+ cell(t) {
201
+ var r;
202
+ const a = (((r = t.row.original.criteria_progress) == null ? void 0 : r.filter(
203
+ (i) => t.row.original.criteria.some(
204
+ (c) => c._id.toString() === i.criteria.toString()
205
+ )
206
+ )) || []).length, e = t.row.original.criteria.length;
207
+ return e === 0 ? h("div", "No criteria") : h("div", `${a}/${e} completed criteria`);
208
+ }
209
+ },
210
+ {
211
+ header: o("connect.referral.record.status"),
212
+ id: "status",
213
+ cell(t) {
214
+ const s = t.row.original.status;
215
+ return h(R.FmChip, {
216
+ label: ne.title(s.replace("_", " ")),
217
+ compact: !0,
218
+ class: s == "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-primary bg-fm-color-system-primary-100"
219
+ });
220
+ }
221
+ }
222
+ ], { tableMeta: l, rowData: d, onSort: F, debouncedFetchData: S, onSearch: M } = oe(v.readRecords);
223
+ async function x() {
224
+ const t = new _e(), s = (await v.readRecords({
225
+ limit: 1,
226
+ skip: 0,
227
+ sortBy: f.sortBy,
228
+ descending: f.descending
229
+ })).meta.totalResources ?? 0, a = f.rowsPerPage;
230
+ await m(
231
+ async () => {
232
+ var e, r, i, c;
233
+ for (let u = 0; u < s; u += a) {
234
+ const _ = {
235
+ ...f,
236
+ limit: a,
237
+ skip: f.page - 1,
238
+ sortBy: f.sortBy,
239
+ descending: f.descending
240
+ }, P = await v.readRecords(_);
241
+ for (const p of P.resources) {
242
+ const E = (p.criteria || []).reduce(
243
+ (b, D) => {
244
+ var $;
245
+ const Y = (($ = p.criteria_progress) == null ? void 0 : $.filter(
246
+ (K) => p.criteria.some(
247
+ (W) => W._id.toString() === K.criteria.toString()
248
+ )
249
+ )) || [];
250
+ return b[D.name] = Y.length > 0 ? "Completed" : "In Progress", b;
251
+ },
252
+ {}
253
+ );
254
+ console.log(E);
255
+ const O = {
256
+ ID: p._id.toString(),
257
+ RefererName: ((e = p.pf_referer) == null ? void 0 : e.name) ?? "",
258
+ RefererPhone: ((r = p.pf_referer) == null ? void 0 : r.phoneNumber) ?? "",
259
+ RefereeName: ((i = p.pf_referee) == null ? void 0 : i.name) ?? "",
260
+ RefereePhone: ((c = p.pf_referee) == null ? void 0 : c.phoneNumber) ?? "",
261
+ ReferredAt: ue(pe(p._id)).format(
262
+ "DD/MM/YYYY"
263
+ ),
264
+ Status: p.status,
265
+ Criteria: Object.entries(E).map(([b, D]) => `${b}: ${D}`).join(", ")
266
+ };
267
+ t.addRecord(O);
268
+ }
269
+ f.page++;
270
+ }
271
+ await se(
272
+ t.buildExcel(),
273
+ `referrals-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
274
+ {
275
+ bookType: "xlsx",
276
+ bookSST: !1,
277
+ type: "array"
278
+ }
279
+ ), f.page = 1;
280
+ },
281
+ {
282
+ message: "Exporting referral records...",
283
+ successMessage: "Referral record exported successfully"
284
+ }
285
+ );
286
+ }
287
+ return re(async () => {
288
+ await S();
289
+ }), (t, s) => {
290
+ const a = C("FmSearch"), e = C("FmButton");
291
+ return I(), U(te, null, [
292
+ N("div", null, [
293
+ N("div", we, [
294
+ w(a, {
295
+ class: "mt-4",
296
+ modelValue: n(l).searchValue,
297
+ "onUpdate:modelValue": [
298
+ s[0] || (s[0] = (r) => n(l).searchValue = r),
299
+ n(M)
300
+ ],
301
+ placeholder: "Search",
302
+ collapsible: ""
303
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
304
+ w(e, {
305
+ icon: "ios_share",
306
+ variant: "tertiary",
307
+ onClick: x
308
+ })
309
+ ]),
310
+ w(ae, {
311
+ loading: n(l).isLoading,
312
+ "row-data": n(d),
313
+ "row-count": n(l).totalRows,
314
+ "column-defs": k,
315
+ "shrink-at": !1,
316
+ "page-count": n(l).pageCount,
317
+ "page-index": n(l).pageIndex,
318
+ "page-size": n(l).pageSize,
319
+ onSortChange: n(F),
320
+ onPageChange: s[1] || (s[1] = (r) => n(S)({ pageSize: r.pageSize, pageIndex: r.pageIndex })),
321
+ onRowClick: s[2] || (s[2] = (r) => {
322
+ var i;
323
+ return (i = n(y)) == null ? void 0 : i.showSheet(!0, r.original);
324
+ })
325
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
326
+ ]),
327
+ w(he, {
328
+ ref_key: "updateCriteriaProgressSheetRef",
329
+ ref: y,
330
+ onRefresh: n(S)
331
+ }, null, 8, ["onRefresh"])
332
+ ], 64);
333
+ };
334
+ }
335
+ });
336
+ export {
337
+ Ie as default
338
+ };