@feedmepos/mf-connect 0.1.98-beta.13 → 0.1.98-beta.15

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 (138) hide show
  1. package/package.json +1 -1
  2. package/dist/App-DQqZfak3.js +0 -4782
  3. package/dist/AuditLogs-C19m85wp.js +0 -2013
  4. package/dist/Bin-GjJ5Q2ae.js +0 -166
  5. package/dist/Broadcast-CVTBL0T0.js +0 -266
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6BYvVmq.js +0 -120
  7. package/dist/Card-DzYit3v6.js +0 -910
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-CaU7auvn.js +0 -540
  10. package/dist/Credit-B_eUMV0R.js +0 -260
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgcm1S_g.js +0 -3377
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CZLoCJM4.js +0 -351
  15. package/dist/Experience-B7kxE07l.js +0 -259
  16. package/dist/FileSaver.min-BBvy4uPh.js +0 -74
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  19. package/dist/Game-B98hcWvR.js +0 -330
  20. package/dist/Grab-RdxV7xhM.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBYekrJp.js +0 -145
  22. package/dist/Index-CvMVxCY5.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D4-wjMg6.js +0 -48
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Jir8zY8e.js +0 -18737
  26. package/dist/LoyaltyDashboard-B1OzFT4q.js +0 -1082
  27. package/dist/MainLayout-De_edc-D.js +0 -41
  28. package/dist/Marketing-B7-To3XF.js +0 -235
  29. package/dist/MarketingMaterialEdit-DGONncxn.js +0 -1035
  30. package/dist/Member-DEGCrqnh.js +0 -280
  31. package/dist/MemberList-vKYbpLVu.js +0 -1601
  32. package/dist/MemberOverview-wL_ailso.js +0 -58
  33. package/dist/MemberTransactions-CGC3vYKC.js +0 -45
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BP9YtuPA.js +0 -60802
  35. package/dist/Mission-hxf_AIGL.js +0 -334
  36. package/dist/Overview-NvgUuMYp.js +0 -949
  37. package/dist/Overview-iRLMLoAo.js +0 -1079
  38. package/dist/Point-tkUTXOCe.js +0 -262
  39. package/dist/Promotion-DNUcMKJQ.js +0 -397
  40. package/dist/Queue-5XYiIuG8.js +0 -260
  41. package/dist/Record-B5aYp7eF.js +0 -342
  42. package/dist/Review-BqaHlzXV.js +0 -45
  43. package/dist/ReviewFacebookCallback-BqlFkSB7.js +0 -248
  44. package/dist/ReviewGoogleCallback-ssKL4jh4.js +0 -213
  45. package/dist/Reward-1xOMowTW.js +0 -442
  46. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Db3FSfIc.js +0 -149
  47. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cmrp2Tia.js +0 -1911
  48. package/dist/Segment-BMBwsUug.js +0 -1014
  49. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DSfdei-h.js +0 -181
  50. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BJVeGJ5J.js +0 -188
  51. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-OBZubKUy.js +0 -226
  52. package/dist/Setting-DWygYkHW.js +0 -2047
  53. package/dist/SettingAdvertisements-TYB1b7dB.js +0 -264
  54. package/dist/Settings-DynjmCPL.js +0 -220
  55. package/dist/Store-DRYkmigC.js +0 -1996
  56. package/dist/StoreRewards-DU8eWbXE.js +0 -540
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BkqBjEFm.js +0 -1130
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l6KmXVBZ.js +0 -7007
  59. package/dist/Tier-4k8SxKtl.js +0 -969
  60. package/dist/Title-B9lWQ_jl.js +0 -566
  61. package/dist/Transaction-C38Yd0tf.js +0 -39
  62. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D6tgpKpc.js +0 -130
  63. package/dist/Voucher-BQbqC7RV.js +0 -421
  64. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-erwpbvYi.js +0 -421
  65. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Dt05b7fU.js +0 -56
  66. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  67. package/dist/app-BTm9mz0r.js +0 -59940
  68. package/dist/app-wDQR6dpb.js +0 -39
  69. package/dist/app.js +0 -7
  70. package/dist/business-B7GwHLce.js +0 -82
  71. package/dist/campaign-BCdKDHgz.js +0 -277
  72. package/dist/campaign-CpzFl8Vr.js +0 -4
  73. package/dist/campaign-DWlsbsKQ.js +0 -219
  74. package/dist/campaign.enum-BgK4maXz.js +0 -26
  75. package/dist/campaign.fn-DxnwGCB2.js +0 -776
  76. package/dist/collectible.enum-CdOSUDwG.js +0 -19
  77. package/dist/duplicateCampaign-BSHe0P-g.js +0 -51
  78. package/dist/effect-C7wkN_13.js +0 -89
  79. package/dist/email-addresses-DJycNI7L.js +0 -705
  80. package/dist/export-uIHWDxuh.js +0 -97
  81. package/dist/feedme.ico +0 -0
  82. package/dist/google-BQK68wbe.js +0 -5
  83. package/dist/helper-czpAhAIw.js +0 -86
  84. package/dist/index-5Sa4xS2m.js +0 -151
  85. package/dist/index-5WGEWCcI.js +0 -3
  86. package/dist/index-B2C7kc4z.js +0 -31
  87. package/dist/index-B5eb6_bi.js +0 -3678
  88. package/dist/index-B7nE1Pb2.js +0 -67
  89. package/dist/index-BFAHLexA.js +0 -32
  90. package/dist/index-BanxlNli.js +0 -8910
  91. package/dist/index-ByHoFriu.js +0 -85
  92. package/dist/index-Ca2bBJuR.js +0 -54
  93. package/dist/index-CuvNtC_M.js +0 -61
  94. package/dist/index-D-kYrDAi.js +0 -30289
  95. package/dist/index-D2gAYMIp.js +0 -28900
  96. package/dist/index-DWxmK2NJ.js +0 -61
  97. package/dist/index-U_rwkNKU.js +0 -2819
  98. package/dist/index-knizSLfz.js +0 -1157
  99. package/dist/index-vh86FiIQ.js +0 -10
  100. package/dist/index.esm2017-DFVkiPjd.js +0 -3069
  101. package/dist/loading-B3OgwEC8.js +0 -72
  102. package/dist/lodash-CiRTkvui.js +0 -3678
  103. package/dist/membership-s2VKnu_8.js +0 -255
  104. package/dist/moment-D7p2TMB-.js +0 -2583
  105. package/dist/money-DqxOXYd0.js +0 -15
  106. package/dist/number-Bt4sacaM.js +0 -12
  107. package/dist/object-BYyQ0PZp.js +0 -18
  108. package/dist/objectId-dwaoBfJX.js +0 -7
  109. package/dist/objectid-CxCupSWP.js +0 -145
  110. package/dist/plugins-CQ1JAqJB.js +0 -1788
  111. package/dist/reward-pjbal-XX.js +0 -36
  112. package/dist/rule-CzU2GAur.js +0 -1969
  113. package/dist/string-Gcy5IM_H.js +0 -32
  114. package/dist/style.css +0 -4
  115. package/dist/template-7yiMSL1f.js +0 -188
  116. package/dist/tier-BJDhpH6X.js +0 -4
  117. package/dist/tiers/tier=1.png +0 -0
  118. package/dist/tiers/tier=2.png +0 -0
  119. package/dist/tiers/tier=3.png +0 -0
  120. package/dist/tiers/tier=4.png +0 -0
  121. package/dist/titles/type=diamond.png +0 -0
  122. package/dist/titles/type=drinks.png +0 -0
  123. package/dist/titles/type=food.png +0 -0
  124. package/dist/titles/type=heart.png +0 -0
  125. package/dist/titles/type=medal.png +0 -0
  126. package/dist/titles/type=spend.png +0 -0
  127. package/dist/titles/type=thank-you.png +0 -0
  128. package/dist/titles/type=thumbs-up.png +0 -0
  129. package/dist/titles/type=years.png +0 -0
  130. package/dist/trigger-C5bqlYHn.js +0 -213
  131. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  132. package/dist/type_drinks-D6jnpvwV.js +0 -4
  133. package/dist/useMarketingMaterialActions-CW_QRtQb.js +0 -107
  134. package/dist/usePagination-D2pke4vy.js +0 -220
  135. package/dist/user-BcXrT_t5.js +0 -55
  136. package/dist/vue-i18n-CFNkj6JK.js +0 -2365
  137. package/dist/xlsx-DyVY5_Qx.js +0 -15491
  138. package/dist/zod-BD_8DRqQ.js +0 -91
@@ -1,260 +0,0 @@
1
- import { defineComponent as h, h as n, ref as A, watch as B, onBeforeMount as U, resolveComponent as V, openBlock as z, createElementBlock as L, Fragment as O, createVNode as m, unref as o, createElementVNode as g } from "vue";
2
- import { u as q, _ as G } from "./usePagination-D2pke4vy.js";
3
- import { _ as S } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
4
- import { c as u } from "./string-Gcy5IM_H.js";
5
- import { c as Y } from "./plugins-CQ1JAqJB.js";
6
- import { useDialog as j, components as y } from "@feedmepos/ui-library";
7
- import "./index-U_rwkNKU.js";
8
- import { L as c, c as d } from "./index-B5eb6_bi.js";
9
- import "./index-BanxlNli.js";
10
- import "./index-D-kYrDAi.js";
11
- import "./index-Ca2bBJuR.js";
12
- import { h as b } from "./moment-D7p2TMB-.js";
13
- import { u as W } from "./vue-i18n-CFNkj6JK.js";
14
- import { u as H, v as K, w as Q } from "./index.esm2017-DFVkiPjd.js";
15
- import { useRoute as $ } from "vue-router";
16
- import { g as J, S as Z, u as X } from "./index-D2gAYMIp.js";
17
- import { o as ee } from "./objectId-dwaoBfJX.js";
18
- const te = () => {
19
- if (!Z.getBusinessId()) throw new Error("Invalid business ID");
20
- return X("queues");
21
- }, oe = {
22
- async readImportMember(p, w) {
23
- return J(
24
- await te().get("", {
25
- params: { ...p, ...w }
26
- })
27
- );
28
- }
29
- };
30
- var ae = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" };
31
- const re = { class: "p-24 flex flex-col gap-y-2" }, ne = { class: "flex items-center justify-between" }, se = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, xe = /* @__PURE__ */ h({
32
- __name: "Queue",
33
- setup(p) {
34
- const v = $().query.type, { t: x } = W(), E = j(), C = [
35
- {
36
- header: "ID",
37
- accessorKey: "_id",
38
- meta: {
39
- maxWidth: "100px"
40
- },
41
- cell(t) {
42
- return n("div", { class: "flex items-center" }, [
43
- n(y.FmIcon, {
44
- name: "content_copy",
45
- outline: !0,
46
- size: "sm",
47
- class: "cursor-pointer mr-4",
48
- onClick: (e) => {
49
- e.preventDefault(), e.stopPropagation(), Y(t.row.original._id.toString());
50
- }
51
- }),
52
- n(
53
- "div",
54
- { class: "pr-2 text-ellipsis overflow-hidden" },
55
- t.row.original._id.toString()
56
- )
57
- ]);
58
- },
59
- enableSorting: !1
60
- },
61
- {
62
- header: "Type",
63
- accessorFn: (t) => u.title(t.type.replace("_", " ")),
64
- enableSorting: !1
65
- },
66
- {
67
- header: "Status",
68
- accessorFn: (t) => {
69
- var e;
70
- return t.status ? u.title((e = t.status) == null ? void 0 : e.toString()) : "-";
71
- },
72
- cell(t) {
73
- const e = t.row.original.status;
74
- return n(y.FmChip, {
75
- label: e ? u.title(e) : "-",
76
- compact: !0,
77
- class: D(e)
78
- });
79
- },
80
- enableSorting: !1
81
- },
82
- {
83
- header: "Ref",
84
- accessorKey: "ref",
85
- enableSorting: !1
86
- },
87
- {
88
- header: "Created at",
89
- accessorFn: (t) => b(ee(t._id.toString())).format("D MMM YYYY, hh:mmA"),
90
- enableSorting: !0
91
- },
92
- {
93
- header: "Context",
94
- cell(t) {
95
- var r, a;
96
- const e = ((a = (r = t.row.original.context) == null ? void 0 : r.context) == null ? void 0 : a.file) || null;
97
- return e != null && e.downloadUrl && (e != null && e.originalName) ? n(
98
- "a",
99
- {
100
- class: "fm-typo-en-link-md-600",
101
- href: e.downloadUrl,
102
- download: e.originalName,
103
- target: "_blank",
104
- rel: "noopener"
105
- },
106
- e.originalName
107
- ) : e != null && e.originalName ? n("div", null, e.originalName) : n("div", null, "-");
108
- },
109
- enableSorting: !1
110
- },
111
- {
112
- header: "Failed reason",
113
- cell(t) {
114
- return n(y.FmButton, {
115
- icon: "visibility",
116
- variant: "tertiary",
117
- disabled: !t.row.original.failedReason,
118
- onClick: (e) => {
119
- e.preventDefault(), e.stopPropagation(), M(t.row.original.failedReason);
120
- }
121
- });
122
- },
123
- enableSorting: !1
124
- }
125
- ], D = (t) => {
126
- switch (t) {
127
- case c.enum.ACTIVE:
128
- return "text-fm-color-typo-info bg-fm-color-system-info-100";
129
- case c.enum.WAITING:
130
- return "text-fm-color-typo-warning bg-fm-color-system-warning-100";
131
- case c.enum.COMPLETED:
132
- return "text-fm-color-typo-success bg-fm-color-system-success-100";
133
- case c.enum.FAILED:
134
- return "text-fm-color-typo-error bg-fm-color-system-error-100";
135
- default:
136
- return "text-fm-color-typo-primary bg-fm-color-system-primary-100";
137
- }
138
- }, F = h({
139
- name: "FailedReasonDialog",
140
- props: {
141
- data: {
142
- type: String,
143
- required: !0
144
- }
145
- },
146
- setup(t) {
147
- return () => n("div", { class: "whitespace-pre-line" }, t.data);
148
- }
149
- });
150
- async function M(t) {
151
- E.open({
152
- title: "Failed Reason",
153
- closeButton: !0,
154
- dismissAway: !0,
155
- contentComponent: F,
156
- contentComponentProps: {
157
- data: t
158
- }
159
- });
160
- }
161
- const T = async (t) => {
162
- const e = H(void 0, ae.importFilesBucketUrl), r = K(e, t);
163
- return await Q(r);
164
- }, R = c.options.map((t) => ({ label: u.title(t), value: t })), s = A({
165
- type: v ?? [
166
- d.enum.MEMBER_IMPORTED,
167
- d.enum.SEGMENTATION_IMPORTED
168
- ],
169
- status: []
170
- }), { tableMeta: i, rowData: P, onSort: k, debouncedFetchData: f } = q(
171
- async (t) => {
172
- const e = {
173
- ...s.value
174
- }, r = await oe.readImportMember(t, e);
175
- return await Promise.all(
176
- r.resources.map(async (a) => {
177
- var _, I;
178
- const l = (I = (_ = a.context) == null ? void 0 : _.context) == null ? void 0 : I.file;
179
- if (b(a.context.emittedAt).diff(b(), "days") < 7 && l)
180
- try {
181
- l.downloadUrl = await T(l == null ? void 0 : l.fbFilePath);
182
- } catch (N) {
183
- console.log(N);
184
- }
185
- })
186
- ), {
187
- resources: r.resources,
188
- meta: r.meta
189
- };
190
- }
191
- );
192
- return B(
193
- s,
194
- () => {
195
- f();
196
- },
197
- { deep: !0 }
198
- ), U(async () => {
199
- await f();
200
- }), (t, e) => {
201
- const r = V("FmPageHead");
202
- return z(), L(O, null, [
203
- m(r, {
204
- title: o(x)("connect.queue.title")
205
- }, null, 8, ["title"]),
206
- g("div", re, [
207
- g("div", ne, [
208
- g("div", se, [
209
- m(S, {
210
- class: "cursor-pointer text-fm-color-neutral-gray-400",
211
- "right-icon": "keyboard_arrow_down",
212
- modelValue: o(s).type,
213
- "onUpdate:modelValue": e[0] || (e[0] = (a) => o(s).type = a),
214
- label: "Type: ",
215
- "show-item-label": !0,
216
- items: [
217
- {
218
- label: "Member Imported",
219
- value: o(d).enum.MEMBER_IMPORTED
220
- },
221
- {
222
- label: "Segmentation Imported",
223
- value: o(d).enum.SEGMENTATION_IMPORTED
224
- }
225
- ]
226
- }, null, 8, ["modelValue", "items"]),
227
- m(S, {
228
- class: "cursor-pointer text-fm-color-neutral-gray-400",
229
- "right-icon": "keyboard_arrow_down",
230
- modelValue: o(s).status,
231
- "onUpdate:modelValue": e[1] || (e[1] = (a) => o(s).status = a),
232
- label: "Status: ",
233
- "show-item-label": !0,
234
- items: o(R)
235
- }, null, 8, ["modelValue", "items"])
236
- ])
237
- ]),
238
- m(G, {
239
- loading: o(i).isLoading,
240
- "row-data": o(P),
241
- "row-count": o(i).totalRows,
242
- "column-defs": C,
243
- "page-count": o(i).pageCount,
244
- "page-index": o(i).pageIndex,
245
- "page-size": o(i).pageSize,
246
- "shrink-at": !1,
247
- onSortChange: o(k),
248
- onPageChange: e[2] || (e[2] = (a) => o(f)({
249
- pageSize: a.pageSize,
250
- pageIndex: a.pageIndex
251
- }))
252
- }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
253
- ])
254
- ], 64);
255
- };
256
- }
257
- });
258
- export {
259
- xe as default
260
- };
@@ -1,342 +0,0 @@
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 oe, _ as ae } from "./usePagination-D2pke4vy.js";
6
- import { g as A } from "./user-BcXrT_t5.js";
7
- import { components as R } from "@feedmepos/ui-library";
8
- import "./index-D-kYrDAi.js";
9
- import { u as j } from "./vue-i18n-CFNkj6JK.js";
10
- import { u as L } from "./loading-B3OgwEC8.js";
11
- import { useCoreStore as se } from "@feedmepos/mf-common";
12
- import { r as v } from "./index-BFAHLexA.js";
13
- import { c as ie, a as ne } from "./object-BYyQ0PZp.js";
14
- import { u as ce } from "./membership-s2VKnu_8.js";
15
- import { c as le } from "./string-Gcy5IM_H.js";
16
- import { c as de } from "./plugins-CQ1JAqJB.js";
17
- import { u as V, w as me } from "./xlsx-DyVY5_Qx.js";
18
- import { e as f } from "./index-vh86FiIQ.js";
19
- import { h as ue } from "./moment-D7p2TMB-.js";
20
- import { o as pe } from "./objectId-dwaoBfJX.js";
21
- const fe = {
22
- key: 0,
23
- class: "flex justify-end mb-16"
24
- }, ge = { class: "flex flex-col space-y-16 pr-12" }, he = /* @__PURE__ */ T({
25
- __name: "UpdateCriteriaProgressSheet",
26
- emits: ["refresh"],
27
- setup(g, { expose: o, emit: m }) {
28
- const y = m;
29
- j();
30
- const { minor: k } = L, l = B(!1), d = B({}), F = se(), S = [
31
- {
32
- header: "Criteria title",
33
- accessorFn: (a) => a.name
34
- },
35
- {
36
- header: "Status",
37
- cell(a) {
38
- var u;
39
- const e = a.row.original, r = (u = d.value.criteria_progress) == null ? void 0 : u.find(
40
- (_) => _.criteria === e._id
41
- ), 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";
42
- return [
43
- h(R.FmChip, {
44
- label: i,
45
- compact: !0,
46
- class: c
47
- })
48
- ];
49
- }
50
- },
51
- {
52
- id: "actions",
53
- cell(a) {
54
- var i;
55
- const e = a.row.original;
56
- return [
57
- !((i = d.value.criteria_progress) == null ? void 0 : i.some(
58
- (c) => c.criteria === e._id
59
- )) && e.type == "MANUAL" ? h(R.FmButton, {
60
- variant: "secondary",
61
- label: "Mark as completed",
62
- size: "md",
63
- onClick: (c) => {
64
- c.stopPropagation(), x(e._id.toString());
65
- }
66
- }) : null
67
- ];
68
- }
69
- }
70
- ], M = H(() => {
71
- var e, r, i, c;
72
- return (((r = (e = d.value) == null ? void 0 : e.criteria_progress) == null ? void 0 : r.filter(
73
- (u) => {
74
- var _;
75
- return (_ = d.value) == null ? void 0 : _.criteria.some(
76
- (P) => P._id.toString() === u.criteria.toString()
77
- );
78
- }
79
- )) || []).length == ((i = d.value) == null ? void 0 : i.criteria.length) && ((c = d.value) == null ? void 0 : c.status) != "COMPLETED";
80
- });
81
- async function x(a) {
82
- var r;
83
- const e = ie(ne(d.value));
84
- e.criteria_progress = [
85
- {
86
- criteria: a,
87
- ref: `ADMIN:${(r = F.user) == null ? void 0 : r.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
88
- completedAt: /* @__PURE__ */ new Date()
89
- }
90
- ], k(
91
- async () => {
92
- await v.updateCriteriaProgress(
93
- d.value._id,
94
- e
95
- ), l.value = !1, y("refresh");
96
- },
97
- {
98
- message: "Updating criteria progress",
99
- successMessage: "Criteria progress updated successfully"
100
- }
101
- );
102
- }
103
- function t(a, e) {
104
- l.value = a, d.value = e;
105
- }
106
- function s() {
107
- l.value = !1;
108
- }
109
- return o({
110
- showSheet: t,
111
- hideSheet: s,
112
- data: d
113
- }), (a, e) => {
114
- const r = C("FmButton"), i = C("FmTable"), c = C("FmSideSheet");
115
- return I(), J(c, {
116
- "max-width": 768,
117
- modelValue: n(l),
118
- "onUpdate:modelValue": e[1] || (e[1] = (u) => Q(l) ? l.value = u : null),
119
- header: "Referee Criteria"
120
- }, {
121
- default: X(() => [
122
- n(M) ? (I(), U("div", fe, [
123
- w(r, {
124
- icon: "refresh",
125
- label: "Refresh",
126
- onClick: e[0] || (e[0] = Z((u) => x(n(d)._id), ["stop"]))
127
- })
128
- ])) : ee("", !0),
129
- N("div", ge, [
130
- w(i, {
131
- "row-data": n(d).criteria,
132
- "hide-footer": !0,
133
- "page-size": 100,
134
- "column-defs": S
135
- }, null, 8, ["row-data"])
136
- ])
137
- ]),
138
- _: 1
139
- }, 8, ["modelValue"]);
140
- };
141
- }
142
- });
143
- class _e {
144
- constructor() {
145
- z(this, "data", []);
146
- }
147
- addRecord(o) {
148
- this.data.push(o);
149
- }
150
- buildExcel() {
151
- const o = V.book_new(), m = V.json_to_sheet(this.data);
152
- return V.book_append_sheet(o, m, "Referrals"), o;
153
- }
154
- }
155
- const we = { class: "flex items-center justify-end" }, ze = /* @__PURE__ */ T({
156
- __name: "Record",
157
- setup(g) {
158
- const { t: o } = j();
159
- ce();
160
- const { minor: m } = L, y = B(null), k = [
161
- {
162
- header: "ID",
163
- meta: {
164
- maxWidth: "100px"
165
- },
166
- cell(t) {
167
- return h("div", { class: "flex items-center" }, [
168
- h(R.FmIcon, {
169
- name: "content_copy",
170
- outline: !0,
171
- size: "sm",
172
- class: "cursor-pointer mr-4",
173
- onClick: (s) => {
174
- s.preventDefault(), s.stopPropagation(), de(t.row.original._id.toString());
175
- }
176
- }),
177
- h(
178
- "div",
179
- { class: "pr-2 text-ellipsis overflow-hidden" },
180
- t.row.original._id.toString()
181
- )
182
- ]);
183
- },
184
- enableSorting: !1
185
- },
186
- {
187
- header: o("connect.referral.record.referer_info"),
188
- enableSorting: !0,
189
- cell(t) {
190
- return t.row.original.pf_referer ? A(t.row.original.pf_referer, !0) : "N/A";
191
- }
192
- },
193
- {
194
- header: o("connect.referral.record.referee_info"),
195
- enableSorting: !0,
196
- cell(t) {
197
- return t.row.original.pf_referee ? A(t.row.original.pf_referee, !0) : "N/A";
198
- }
199
- },
200
- {
201
- header: o("connect.referral.record.referee_criteria"),
202
- accessorKey: "criteria",
203
- id: "criteria",
204
- cell(t) {
205
- var r;
206
- const a = (((r = t.row.original.criteria_progress) == null ? void 0 : r.filter(
207
- (i) => t.row.original.criteria.some(
208
- (c) => c._id.toString() === i.criteria.toString()
209
- )
210
- )) || []).length, e = t.row.original.criteria.length;
211
- return e === 0 ? h("div", "No criteria") : h("div", `${a}/${e} completed criteria`);
212
- }
213
- },
214
- {
215
- header: o("connect.referral.record.status"),
216
- id: "status",
217
- cell(t) {
218
- const s = t.row.original.status;
219
- return h(R.FmChip, {
220
- label: le.title(s.replace("_", " ")),
221
- compact: !0,
222
- 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"
223
- });
224
- }
225
- }
226
- ], { tableMeta: l, rowData: d, onSort: F, debouncedFetchData: S, onSearch: M } = oe(v.readRecords);
227
- async function x() {
228
- const t = new _e(), s = (await v.readRecords({
229
- limit: 1,
230
- skip: 0,
231
- sortBy: f.sortBy,
232
- descending: f.descending
233
- })).meta.totalResources ?? 0, a = f.rowsPerPage;
234
- await m(
235
- async () => {
236
- var e, r, i, c;
237
- for (let u = 0; u < s; u += a) {
238
- const _ = {
239
- ...f,
240
- limit: a,
241
- skip: f.page - 1,
242
- sortBy: f.sortBy,
243
- descending: f.descending
244
- }, P = await v.readRecords(_);
245
- for (const p of P.resources) {
246
- const E = (p.criteria || []).reduce(
247
- (b, D) => {
248
- var $;
249
- const Y = (($ = p.criteria_progress) == null ? void 0 : $.filter(
250
- (K) => p.criteria.some(
251
- (W) => W._id.toString() === K.criteria.toString()
252
- )
253
- )) || [];
254
- return b[D.name] = Y.length > 0 ? "Completed" : "In Progress", b;
255
- },
256
- {}
257
- );
258
- console.log(E);
259
- const O = {
260
- ID: p._id.toString(),
261
- RefererName: ((e = p.pf_referer) == null ? void 0 : e.name) ?? "",
262
- RefererPhone: ((r = p.pf_referer) == null ? void 0 : r.phoneNumber) ?? "",
263
- RefereeName: ((i = p.pf_referee) == null ? void 0 : i.name) ?? "",
264
- RefereePhone: ((c = p.pf_referee) == null ? void 0 : c.phoneNumber) ?? "",
265
- ReferredAt: ue(pe(p._id)).format(
266
- "DD/MM/YYYY"
267
- ),
268
- Status: p.status,
269
- Criteria: Object.entries(E).map(([b, D]) => `${b}: ${D}`).join(", ")
270
- };
271
- t.addRecord(O);
272
- }
273
- f.page++;
274
- }
275
- await me(
276
- t.buildExcel(),
277
- `referrals-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
278
- {
279
- bookType: "xlsx",
280
- bookSST: !1,
281
- type: "array"
282
- }
283
- ), f.page = 1;
284
- },
285
- {
286
- message: "Exporting referral records...",
287
- successMessage: "Referral record exported successfully"
288
- }
289
- );
290
- }
291
- return re(async () => {
292
- await S();
293
- }), (t, s) => {
294
- const a = C("FmSearch"), e = C("FmButton");
295
- return I(), U(te, null, [
296
- N("div", null, [
297
- N("div", we, [
298
- w(a, {
299
- class: "mt-4",
300
- modelValue: n(l).searchValue,
301
- "onUpdate:modelValue": [
302
- s[0] || (s[0] = (r) => n(l).searchValue = r),
303
- n(M)
304
- ],
305
- placeholder: "Search",
306
- collapsible: ""
307
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
308
- w(e, {
309
- icon: "ios_share",
310
- variant: "tertiary",
311
- onClick: x
312
- })
313
- ]),
314
- w(ae, {
315
- loading: n(l).isLoading,
316
- "row-data": n(d),
317
- "row-count": n(l).totalRows,
318
- "column-defs": k,
319
- "shrink-at": !1,
320
- "page-count": n(l).pageCount,
321
- "page-index": n(l).pageIndex,
322
- "page-size": n(l).pageSize,
323
- onSortChange: n(F),
324
- onPageChange: s[1] || (s[1] = (r) => n(S)({ pageSize: r.pageSize, pageIndex: r.pageIndex })),
325
- onRowClick: s[2] || (s[2] = (r) => {
326
- var i;
327
- return (i = n(y)) == null ? void 0 : i.showSheet(!0, r.original);
328
- })
329
- }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
330
- ]),
331
- w(he, {
332
- ref_key: "updateCriteriaProgressSheetRef",
333
- ref: y,
334
- onRefresh: n(S)
335
- }, null, 8, ["onRefresh"])
336
- ], 64);
337
- };
338
- }
339
- });
340
- export {
341
- ze as default
342
- };
@@ -1,45 +0,0 @@
1
- import { defineComponent as d, computed as v, resolveComponent as n, openBlock as f, createElementBlock as E, Fragment as R, createVNode as a, unref as l, createElementVNode as s } from "vue";
2
- import { u as b } from "./vue-i18n-CFNkj6JK.js";
3
- import { R as r } from "./app-BTm9mz0r.js";
4
- import { useRouter as V } from "vue-router";
5
- const w = { class: "flex flex-col" }, T = { class: "px-24" }, S = /* @__PURE__ */ d({
6
- __name: "Review",
7
- setup(g) {
8
- const { t } = b(), c = V(), o = [
9
- {
10
- label: t("connect.review.tabs.overview"),
11
- value: r["$connect-REVIEW_OVERVIEW"]
12
- },
13
- {
14
- label: t("connect.review.tabs.settings"),
15
- value: r["$connect-REVIEW_SETTINGS"]
16
- }
17
- ], m = v(
18
- () => o.find((e) => e.value === c.currentRoute.value.name) ?? o[0]
19
- );
20
- async function u(e) {
21
- await c.push({ name: e });
22
- }
23
- return (e, x) => {
24
- const i = n("FmPageHead"), _ = n("FmTabs"), p = n("RouterView");
25
- return f(), E(R, null, [
26
- a(i, {
27
- title: l(t)("connect.navigation.review")
28
- }, null, 8, ["title"]),
29
- s("div", w, [
30
- s("div", T, [
31
- a(_, {
32
- "model-value": l(m).value,
33
- items: o,
34
- "onUpdate:modelValue": u
35
- }, null, 8, ["model-value"])
36
- ]),
37
- a(p)
38
- ])
39
- ], 64);
40
- };
41
- }
42
- });
43
- export {
44
- S as default
45
- };