@feedmepos/mf-connect 0.1.0-beta.36 → 0.1.0-beta.38
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.
- package/dist/{Analytic-BQQMo8gn.js → Analytic-C4_MynWX.js} +10 -10
- package/dist/{App-XbDR-3id.js → App-hlqZyd4R.js} +6 -6
- package/dist/{Broadcast-BV0fALHZ.js → Broadcast-BqqsoThP.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cmq6EQxz.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-P5nMPF4-.js} +6 -6
- package/dist/{Card-ni0g9f0W.js → Card-oCKMHTar.js} +21 -22
- package/dist/{Collections-CzqFRaQq.js → Collections-DX_tY8Kf.js} +28 -34
- package/dist/{Credit-BhaiYIIH.js → Credit-BnUOjfjo.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-ByIKDwhp.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-MHFf8UAD.js} +27 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CCPGbV9-.js → EffectSheet.vue_vue_type_style_index_0_lang-DpsYYy14.js} +6 -6
- package/dist/{Experience-l24HNuYa.js → Experience-Dc5Y-lES.js} +8 -8
- package/dist/{Game-CYR3nNcT.js → Game-r_sCITiE.js} +8 -8
- package/dist/{Index-BYC9ThLe.js → Index-ppbyBBbU.js} +9 -9
- package/dist/{Marketing-C_oZtbqT.js → Marketing-MpsjOJXt.js} +5 -5
- package/dist/{Member-DxAoZFfz.js → Member-B8NQd2MB.js} +4 -4
- package/dist/{MemberList-CyHaxFqq.js → MemberList-CYokRc3j.js} +398 -381
- package/dist/{MemberTransactions-Ce1N88OQ.js → MemberTransactions-DM6LBtNR.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CwF3Vok8.js → MessageInput.vue_vue_type_script_setup_true_lang-BPn30LFE.js} +2 -2
- package/dist/{Mission-DdgpqYWl.js → Mission-CveIUM0n.js} +8 -8
- package/dist/{Overview-DVcotUZ5.js → Overview-B53mnhkL.js} +18 -18
- package/dist/{Point-B56BrM7H.js → Point-BuKZ_7_s.js} +8 -8
- package/dist/{Promotion-4yL1H9g5.js → Promotion-Bxeg_jHA.js} +9 -9
- package/dist/Record-DGPwDG2x.js +337 -0
- package/dist/{Reward-DX5V3RGG.js → Reward-BIak3ZV2.js} +14 -14
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D9UFAixa.js → RewardGroup.vue_vue_type_script_setup_true_lang-RCTORBPH.js} +10 -10
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-4tF-6JVC.js → RuleGroup.vue_vue_type_script_setup_true_lang-BzF7Dg58.js} +12 -12
- package/dist/{Segment-DKpM-dlV.js → Segment-CwFGTGmM.js} +72 -73
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4Co06qsp.js → SelectItems.vue_vue_type_script_setup_true_lang-DWW1BMiA.js} +2 -2
- package/dist/{Setting-CbV6piRR.js → Setting-BpU3V7FC.js} +8 -8
- package/dist/{Store-BIMMzBEA.js → Store-BmzQ5J94.js} +17 -17
- package/dist/{StoreRewards-Tr8TXAWt.js → StoreRewards-a4btCX5g.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-wPxHMj1_.js → StoreTransactions.vue_vue_type_script_setup_true_lang-IlyXfny9.js} +17 -17
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CaRE8E-o.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DhOWGk5q.js} +1 -1
- package/dist/{Tier-BN3HKQpg.js → Tier-BHOq6Aqg.js} +18 -18
- package/dist/{Title-DhDuDHSD.js → Title-DLESKXyK.js} +18 -18
- package/dist/{Transaction-Tz3ewMZm.js → Transaction-C9dlvQgb.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-w5Cq6L8_.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-z4d8Q8Jy.js} +6 -6
- package/dist/{Voucher-CdEDGQkq.js → Voucher-BTzc3xmh.js} +11 -11
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CajIUE-r.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BBWktc_y.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CFCVdVWx.js → ZodTextField.vue_vue_type_script_setup_true_lang-D9YPGFAr.js} +1 -1
- package/dist/{app-oW33KZ3o.js → app-BDUi969b.js} +30 -29
- package/dist/{app-Cx8AYCg_.js → app-CRn8LdnG.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-DjK1cD6M.js → business-X8rRPAfz.js} +1 -1
- package/dist/{campaign-DBISpYyM.js → campaign-C8KDR1Eb.js} +2 -2
- package/dist/{campaign-D4CDaSod.js → campaign-FXpP8n18.js} +9 -9
- package/dist/{campaign.enum-BB6zKvqL.js → campaign.enum-DpHc_AKY.js} +1 -1
- package/dist/{campaign.fn-BBuN-vxE.js → campaign.fn-CWbQSsaV.js} +2 -2
- package/dist/{collectible.enum-BkzPmWP5.js → collectible.enum-Bc6yW99E.js} +1 -1
- package/dist/{collection.fn--9IoH5C8.js → collection.fn--L45oV4w.js} +2 -2
- package/dist/{dto-Cf4bZ2Ha.js → dto-pirGeUnW.js} +4 -4
- package/dist/{effect-BpSxSe0d.js → effect-YTFtNuVH.js} +1 -1
- package/dist/{email-addresses-wHQnOKcN.js → email-addresses-B8bKFPN_.js} +1 -1
- package/dist/{export-pg40fbOp.js → export-K8csYP6E.js} +3 -3
- package/dist/{helper-vuZmD3vd.js → helper-mK6u9Bg8.js} +1 -1
- package/dist/{index-UNh4BJAd.js → index-6IGDKCf8.js} +1 -1
- package/dist/{index-K7WU4vc1.js → index-C8ctZEra.js} +1 -1
- package/dist/{index-CCRD2tgv.js → index-C8mcPqGM.js} +75 -69
- package/dist/{index-t-NFK-AQ.js → index-C96irFRB.js} +1 -1
- package/dist/{index-BjcUav4X.js → index-CEZb4fna.js} +3 -3
- package/dist/{index-Bl60bODV.js → index-CYHgJwnc.js} +3 -3
- package/dist/{index-BbhmmxBp.js → index-CpxH7mdN.js} +4 -4
- package/dist/{index-VjvyNKmR.js → index-DE2MpHut.js} +2 -2
- package/dist/{index-D6knHtFJ.js → index-DFLG_2P9.js} +1 -1
- package/dist/{index-D8CIHJ0z.js → index-DP7HXEr9.js} +1 -1
- package/dist/index-F-pD5WRJ.js +32 -0
- package/dist/{index-DInxnKvr.js → index-espwcMLv.js} +1 -1
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-Djt10vTu.js → index.esm2017-BG85b82Z.js} +1 -1
- package/dist/{loading-CVE2HNjb.js → loading-DNvnRgpP.js} +4 -4
- package/dist/{membership-BLkSVFx9.js → membership-Ja85Dtss.js} +3 -3
- package/dist/{money-DqUkifCn.js → money-hL_Dsbxu.js} +1 -1
- package/dist/{number-BPlOwScu.js → number-CwTwPu4r.js} +1 -1
- package/dist/{objectid-J3u1WeUz.js → objectid-DbcihVwq.js} +4 -4
- package/dist/{reward-B9WzNBWQ.js → reward-1byDPYcc.js} +1 -1
- package/dist/{rule-FtBYuezP.js → rule-BdWrXdvd.js} +3 -3
- package/dist/{rule-builder-caiYx8mw.js → rule-builder-i8OVsDJ3.js} +1 -1
- package/dist/{template-C1Iii37r.js → template-CGMDec1D.js} +4 -4
- package/dist/{trigger-DEH6eTbm.js → trigger-qTKI0OAW.js} +4 -4
- package/dist/{xlsx-DNspY5sG.js → usePagination-BGkqnwZO.js} +3183 -2962
- package/dist/{user-DqSmwkKW.js → user-BG8vrTfB.js} +1 -1
- package/dist/{vue-i18n-4lC91qO3.js → vue-i18n-DXJ3bXfe.js} +2 -2
- package/package.json +1 -1
- package/dist/Record-DZ2SbNCg.js +0 -209
- package/dist/index-tWez6zPm.js +0 -38
- package/dist/usePagination-BeF5K3M7.js +0 -223
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { defineComponent as pe, computed as
|
|
2
|
-
import { h as
|
|
3
|
-
import { useDialog as Ie, components as
|
|
4
|
-
import { e as mt, M as ut } from "./email-addresses-
|
|
5
|
-
import { w as pt } from "./
|
|
6
|
-
import "./index-
|
|
7
|
-
import { p as Ye, c as bt, b as Oe, u as
|
|
8
|
-
import { u as Ve, C as Re, s as ft } from "./membership-
|
|
9
|
-
import { c as yt } from "./index-
|
|
1
|
+
import { defineComponent as pe, computed as j, ref as Q, resolveComponent as I, openBlock as f, createElementBlock as A, Fragment as L, createElementVNode as n, unref as t, createBlock as q, createCommentVNode as xe, createVNode as v, renderList as ie, withCtx as ve, createTextVNode as Fe, toDisplayString as E, withDirectives as Le, vShow as ze, watch as it, onBeforeMount as lt, h as z, onMounted as je, isRef as ct, normalizeClass as dt } from "vue";
|
|
2
|
+
import { h as w } from "./moment-BWErdI6_.js";
|
|
3
|
+
import { useDialog as Ie, components as ge } from "@feedmepos/ui-library";
|
|
4
|
+
import { e as mt, M as ut } from "./email-addresses-B8bKFPN_.js";
|
|
5
|
+
import { a as qe, _ as Ge, w as pt } from "./usePagination-BGkqnwZO.js";
|
|
6
|
+
import "./index-C96irFRB.js";
|
|
7
|
+
import { p as Ye, c as bt, b as Oe, u as Ke } from "./loading-DNvnRgpP.js";
|
|
8
|
+
import { u as Ve, C as Re, s as ft } from "./membership-Ja85Dtss.js";
|
|
9
|
+
import { c as yt } from "./index-CEZb4fna.js";
|
|
10
10
|
import { _ as Ue } from "./lodash-B5I3zXaY.js";
|
|
11
11
|
import { D as gt } from "./type_drinks-D6jnpvwV.js";
|
|
12
|
-
import { i as vt, j as xt, k as ht, l as St, m as _t, d as
|
|
13
|
-
import { C as Ae } from "./collection.fn--
|
|
14
|
-
import { u as
|
|
12
|
+
import { i as vt, j as xt, k as ht, l as St, m as _t, d as Te } from "./index-CpxH7mdN.js";
|
|
13
|
+
import { C as Ae } from "./collection.fn--L45oV4w.js";
|
|
14
|
+
import { u as He } from "./business-X8rRPAfz.js";
|
|
15
15
|
import { defineStore as Ct } from "pinia";
|
|
16
|
-
import { u as wt } from "./campaign-
|
|
17
|
-
import { f as X } from "./number-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { s as Tt } from "./index-CsaQJMAR.js";
|
|
16
|
+
import { u as wt } from "./campaign-C8KDR1Eb.js";
|
|
17
|
+
import { f as X } from "./number-CwTwPu4r.js";
|
|
18
|
+
import "./index-DE2MpHut.js";
|
|
19
|
+
import "./index-C8mcPqGM.js";
|
|
20
|
+
import "./index-DFLG_2P9.js";
|
|
21
|
+
import "./index-CYHgJwnc.js";
|
|
22
|
+
import { m as We } from "./index-espwcMLv.js";
|
|
23
|
+
import { s as Ft } from "./index-CsaQJMAR.js";
|
|
25
24
|
import { o as Me } from "./objectId-dwaoBfJX.js";
|
|
26
|
-
import { a as ke } from "./collectible.enum-
|
|
27
|
-
import { c as
|
|
25
|
+
import { a as ke } from "./collectible.enum-Bc6yW99E.js";
|
|
26
|
+
import { c as Tt, a as Mt } from "./campaign-FXpP8n18.js";
|
|
28
27
|
import { useRouter as Je } from "vue-router";
|
|
29
|
-
import { m as le } from "./index-
|
|
30
|
-
import { t as kt } from "./index-
|
|
31
|
-
import { R as Xe } from "./app-
|
|
32
|
-
import { t as At } from "./money-
|
|
33
|
-
import { g as It, a as Vt, b as Et } from "./user-
|
|
28
|
+
import { m as le } from "./index-DP7HXEr9.js";
|
|
29
|
+
import { t as kt } from "./index-C8ctZEra.js";
|
|
30
|
+
import { R as Xe } from "./app-BDUi969b.js";
|
|
31
|
+
import { t as At } from "./money-hL_Dsbxu.js";
|
|
32
|
+
import { g as It, a as Vt, b as Et } from "./user-BG8vrTfB.js";
|
|
34
33
|
const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex-nowrap gap-4 items-center my-[-4px]" }, Pt = { class: "flex flex-nowrap gap-8 items-center pt-24 w-full" }, Bt = /* @__PURE__ */ pe({
|
|
35
34
|
__name: "MemberStatsDialog",
|
|
36
35
|
props: {
|
|
@@ -44,25 +43,25 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
44
43
|
}
|
|
45
44
|
},
|
|
46
45
|
setup(y) {
|
|
47
|
-
var be, ne,
|
|
48
|
-
const V = Ie(), b = Ve(), u = y,
|
|
46
|
+
var be, ne, ae, H;
|
|
47
|
+
const V = Ie(), b = Ve(), u = y, r = j(
|
|
49
48
|
() => {
|
|
50
49
|
var m;
|
|
51
50
|
return (((m = u.member.collection) == null ? void 0 : m.TITLE) ?? []).reduce(
|
|
52
|
-
(d,
|
|
53
|
-
var
|
|
51
|
+
(d, M) => {
|
|
52
|
+
var C, F, O, N, D;
|
|
54
53
|
const s = b.sortedTitles.find(
|
|
55
|
-
(ee) => ee._id.toString() ===
|
|
54
|
+
(ee) => ee._id.toString() === M.collectible
|
|
56
55
|
);
|
|
57
56
|
if (!s) return d;
|
|
58
|
-
const
|
|
59
|
-
(ee,
|
|
57
|
+
const c = [...M.expiryBalance ?? []].sort(
|
|
58
|
+
(ee, se) => w(ee.expiredAt).isAfter(w(se.expiredAt)) ? -1 : 1
|
|
60
59
|
);
|
|
61
|
-
return (
|
|
60
|
+
return (C = c[0]) != null && C.expiredAt && w((F = c[0]) == null ? void 0 : F.expiredAt).isBefore(w()) || d.push({
|
|
62
61
|
_id: s._id,
|
|
63
62
|
name: s.name,
|
|
64
|
-
expiredAt: (O =
|
|
65
|
-
expiresIn:
|
|
63
|
+
expiredAt: (O = c[0]) != null && O.expiredAt ? w((N = c[0]) == null ? void 0 : N.expiredAt).toISOString() : "",
|
|
64
|
+
expiresIn: w((D = c[0]) == null ? void 0 : D.expiredAt).diff(w(), "days")
|
|
66
65
|
}), d;
|
|
67
66
|
},
|
|
68
67
|
[]
|
|
@@ -71,15 +70,15 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
71
70
|
), a = Q({
|
|
72
71
|
cardNo: u.member.cardNo,
|
|
73
72
|
experience: ((ne = (be = u.member.collection) == null ? void 0 : be.POINT) == null ? void 0 : ne[0].balance) ?? 0,
|
|
74
|
-
tier: ((H = (
|
|
75
|
-
titles:
|
|
76
|
-
}),
|
|
73
|
+
tier: ((H = (ae = u.member.collection) == null ? void 0 : ae.TIER) == null ? void 0 : H[0].balance) ?? -1,
|
|
74
|
+
titles: r.value.map((m) => ({ expiredAt: m.expiresIn, id: m._id })) ?? void 0
|
|
75
|
+
}), h = j(
|
|
77
76
|
() => (b.sortedTitles ?? []).map((m) => ({
|
|
78
77
|
label: m.name,
|
|
79
78
|
value: m._id.toString(),
|
|
80
|
-
sublabel:
|
|
79
|
+
sublabel: r.value.some((d) => d._id === m._id) ? "Owned" : void 0
|
|
81
80
|
}))
|
|
82
|
-
),
|
|
81
|
+
), x = j(() => (b.sortedTiers ?? []).map((m, d) => ({
|
|
83
82
|
label: m.name,
|
|
84
83
|
sublabel: `${m.option.from} - ${m.option.to}`,
|
|
85
84
|
from: m.option.from,
|
|
@@ -87,19 +86,19 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
87
86
|
value: d + 1
|
|
88
87
|
})));
|
|
89
88
|
function T() {
|
|
90
|
-
var
|
|
91
|
-
const m = ((
|
|
89
|
+
var M, s;
|
|
90
|
+
const m = ((M = x.value[(a.value.tier ?? 1) - 1]) == null ? void 0 : M.from) ?? 0, d = (s = x.value[(a.value.tier ?? 1) - 1]) == null ? void 0 : s.to;
|
|
92
91
|
a.value.experience = Math.min(
|
|
93
92
|
d ?? m,
|
|
94
93
|
Math.max(m, a.value.experience ?? 0)
|
|
95
94
|
);
|
|
96
95
|
}
|
|
97
|
-
const
|
|
98
|
-
var
|
|
99
|
-
const m = ((s = (
|
|
96
|
+
const _ = j(() => {
|
|
97
|
+
var M, s, c, C, F, O;
|
|
98
|
+
const m = ((s = (M = u.member.collection) == null ? void 0 : M.TIER) == null ? void 0 : s[0].balance) ?? -1, d = ((C = (c = u.member.collection) == null ? void 0 : c.POINT) == null ? void 0 : C[0].balance) ?? 0;
|
|
100
99
|
if (m != a.value.tier) return !0;
|
|
101
100
|
if (a.value.experience && a.value.experience != d) {
|
|
102
|
-
const N = ((
|
|
101
|
+
const N = ((F = x.value[m - 1]) == null ? void 0 : F.from) ?? 0, D = ((O = x.value[m - 1]) == null ? void 0 : O.to) ?? 0;
|
|
103
102
|
if (a.value.experience < N || D && a.value.experience > D)
|
|
104
103
|
return !0;
|
|
105
104
|
}
|
|
@@ -107,102 +106,102 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
107
106
|
});
|
|
108
107
|
function p(m) {
|
|
109
108
|
var d;
|
|
110
|
-
return (d =
|
|
109
|
+
return (d = r.value.find((M) => M._id === m)) == null ? void 0 : d.expiresIn;
|
|
111
110
|
}
|
|
112
|
-
const Y =
|
|
111
|
+
const Y = j(() => {
|
|
113
112
|
const m = vt.safeParse(a.value);
|
|
114
113
|
return m.success ? void 0 : m.error.errors;
|
|
115
114
|
});
|
|
116
|
-
function
|
|
117
|
-
var d,
|
|
118
|
-
return (
|
|
115
|
+
function G(m) {
|
|
116
|
+
var d, M;
|
|
117
|
+
return (M = (d = Y.value) == null ? void 0 : d.find((s) => s.path.join(".") === m)) == null ? void 0 : M.message;
|
|
119
118
|
}
|
|
120
119
|
function Z(m) {
|
|
121
120
|
var d;
|
|
122
|
-
return (d = Y.value) == null ? void 0 : d.filter((
|
|
121
|
+
return (d = Y.value) == null ? void 0 : d.filter((M) => M.path.join(".").startsWith(m)).map((M) => M.message);
|
|
123
122
|
}
|
|
124
|
-
async function
|
|
123
|
+
async function K() {
|
|
125
124
|
await u.onSubmit(a.value), V.close();
|
|
126
125
|
}
|
|
127
126
|
return (m, d) => {
|
|
128
|
-
var ee,
|
|
129
|
-
const
|
|
130
|
-
return f(),
|
|
127
|
+
var ee, se;
|
|
128
|
+
const M = I("FmSelect"), s = I("FmStepperField"), c = I("FmTextField"), C = I("FmField"), F = I("FmFormGroup"), O = I("FmButton"), N = I("FmHelperText"), D = I("FmSpacer");
|
|
129
|
+
return f(), A(L, null, [
|
|
131
130
|
n("div", $t, [
|
|
132
131
|
d[6] || (d[6] = n("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
|
|
133
|
-
t(
|
|
132
|
+
t(x).length ? (f(), q(M, {
|
|
134
133
|
key: 0,
|
|
135
134
|
modelValue: t(a).tier,
|
|
136
135
|
"onUpdate:modelValue": [
|
|
137
|
-
d[0] || (d[0] = (
|
|
136
|
+
d[0] || (d[0] = (k) => t(a).tier = k),
|
|
138
137
|
T
|
|
139
138
|
],
|
|
140
139
|
label: "Member Tier",
|
|
141
|
-
items: t(
|
|
142
|
-
"helper-text":
|
|
143
|
-
"helper-state":
|
|
144
|
-
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) :
|
|
140
|
+
items: t(x),
|
|
141
|
+
"helper-text": G("tier"),
|
|
142
|
+
"helper-state": G("tier") ? "error" : void 0
|
|
143
|
+
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : xe("", !0),
|
|
145
144
|
v(s, {
|
|
146
145
|
"model-value": t(a).experience ?? 0,
|
|
147
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
146
|
+
"onUpdate:modelValue": d[1] || (d[1] = (k) => t(a).experience = k),
|
|
148
147
|
label: "Member Experience",
|
|
149
148
|
"max-fraction-digits": 0,
|
|
150
|
-
"helper-text":
|
|
151
|
-
"helper-state":
|
|
149
|
+
"helper-text": G("experience"),
|
|
150
|
+
"helper-state": G("experience") ? "error" : void 0
|
|
152
151
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
153
152
|
d[7] || (d[7] = n("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
|
|
154
|
-
v(
|
|
153
|
+
v(c, {
|
|
155
154
|
modelValue: t(a).cardNo,
|
|
156
|
-
"onUpdate:modelValue": d[2] || (d[2] = (
|
|
155
|
+
"onUpdate:modelValue": d[2] || (d[2] = (k) => t(a).cardNo = k),
|
|
157
156
|
label: "Card number",
|
|
158
|
-
"helper-text":
|
|
159
|
-
"helper-state":
|
|
157
|
+
"helper-text": G("cardNo"),
|
|
158
|
+
"helper-state": G("cardNo") ? "error" : void 0
|
|
160
159
|
}, null, 8, ["modelValue", "helper-text", "helper-state"]),
|
|
161
160
|
d[8] || (d[8] = n("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
|
|
162
|
-
(ee = t(a).titles) != null && ee.length ? (f(),
|
|
161
|
+
(ee = t(a).titles) != null && ee.length ? (f(), A("div", Nt, d[5] || (d[5] = [
|
|
163
162
|
n("div", { class: "flex flex-nowrap gap-4 items-center" }, [
|
|
164
163
|
n("div", { class: "flex-1" }, "Title"),
|
|
165
164
|
n("div", { class: "flex-1" }, "Expires in days"),
|
|
166
165
|
n("div", { class: "w-24 h-1" })
|
|
167
166
|
], -1)
|
|
168
|
-
]))) :
|
|
169
|
-
(f(!0),
|
|
167
|
+
]))) : xe("", !0),
|
|
168
|
+
(f(!0), A(L, null, ie(t(a).titles ?? [], (k, P) => (f(), A("div", { key: P }, [
|
|
170
169
|
n("div", Dt, [
|
|
171
|
-
t(
|
|
170
|
+
t(r).some((o) => o._id === k.id) ? (f(), q(F, {
|
|
172
171
|
key: 1,
|
|
173
172
|
"model-value": "",
|
|
174
173
|
class: "flex-1"
|
|
175
174
|
}, {
|
|
176
|
-
default:
|
|
177
|
-
v(
|
|
175
|
+
default: ve(() => [
|
|
176
|
+
v(C, {
|
|
178
177
|
disabled: !0,
|
|
179
178
|
class: "text-fm-color-typo-secondary"
|
|
180
179
|
}, {
|
|
181
|
-
default:
|
|
180
|
+
default: ve(() => {
|
|
182
181
|
var o;
|
|
183
182
|
return [
|
|
184
|
-
|
|
183
|
+
Fe(E((o = t(h).find((e) => e.value === k.id)) == null ? void 0 : o.label), 1)
|
|
185
184
|
];
|
|
186
185
|
}),
|
|
187
186
|
_: 2
|
|
188
187
|
}, 1024)
|
|
189
188
|
]),
|
|
190
189
|
_: 2
|
|
191
|
-
}, 1024)) : (f(),
|
|
190
|
+
}, 1024)) : (f(), q(M, {
|
|
192
191
|
key: 0,
|
|
193
|
-
modelValue:
|
|
194
|
-
"onUpdate:modelValue": [(o) =>
|
|
192
|
+
modelValue: k.id,
|
|
193
|
+
"onUpdate:modelValue": [(o) => k.id = o, (o) => k.expiredAt = p(o) ?? 1],
|
|
195
194
|
class: "flex-1",
|
|
196
|
-
items: t(
|
|
195
|
+
items: t(h).filter(
|
|
197
196
|
(o) => {
|
|
198
197
|
var e;
|
|
199
|
-
return !((e = t(a).titles) != null && e.map((
|
|
198
|
+
return !((e = t(a).titles) != null && e.map((i) => i.id).includes(o.value)) || k.id === o.value;
|
|
200
199
|
}
|
|
201
200
|
)
|
|
202
201
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "items"])),
|
|
203
202
|
v(s, {
|
|
204
|
-
modelValue:
|
|
205
|
-
"onUpdate:modelValue": (o) =>
|
|
203
|
+
modelValue: k.expiredAt,
|
|
204
|
+
"onUpdate:modelValue": (o) => k.expiredAt = o,
|
|
206
205
|
class: "flex-1",
|
|
207
206
|
label: "",
|
|
208
207
|
"max-fraction-digits": 0
|
|
@@ -217,55 +216,55 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
217
216
|
}
|
|
218
217
|
}, null, 8, ["onClick"])
|
|
219
218
|
]),
|
|
220
|
-
(f(!0),
|
|
219
|
+
(f(!0), A(L, null, ie(Z(`titles.${P}`), (o, e) => (f(), q(N, {
|
|
221
220
|
key: e,
|
|
222
221
|
class: "items-center",
|
|
223
222
|
state: "error",
|
|
224
223
|
text: o.toString()
|
|
225
224
|
}, null, 8, ["text"]))), 128))
|
|
226
225
|
]))), 128)),
|
|
227
|
-
t(
|
|
226
|
+
t(h).length && (((se = t(a).titles) == null ? void 0 : se.length) ?? 0) < t(h).length ? (f(), q(O, {
|
|
228
227
|
key: 2,
|
|
229
228
|
icon: "add",
|
|
230
229
|
label: "Give title",
|
|
231
230
|
variant: "plain",
|
|
232
|
-
onClick: d[3] || (d[3] = (
|
|
231
|
+
onClick: d[3] || (d[3] = (k) => {
|
|
233
232
|
var P;
|
|
234
233
|
return t(a).titles = [
|
|
235
234
|
...t(a).titles ?? [],
|
|
236
235
|
{
|
|
237
|
-
id: ((P = t(
|
|
236
|
+
id: ((P = t(h).find(
|
|
238
237
|
(o) => {
|
|
239
238
|
var e;
|
|
240
|
-
return !((e = t(a).titles) != null && e.map((
|
|
239
|
+
return !((e = t(a).titles) != null && e.map((i) => i.id).includes(o.value));
|
|
241
240
|
}
|
|
242
|
-
)) == null ? void 0 : P.value) || t(
|
|
241
|
+
)) == null ? void 0 : P.value) || t(h)[0].value,
|
|
243
242
|
expiredAt: 0
|
|
244
243
|
}
|
|
245
244
|
];
|
|
246
245
|
})
|
|
247
|
-
})) :
|
|
246
|
+
})) : xe("", !0)
|
|
248
247
|
]),
|
|
249
248
|
n("div", Pt, [
|
|
250
249
|
Le(v(N, {
|
|
251
250
|
state: "warning",
|
|
252
251
|
text: "Updating member will cause tier to change"
|
|
253
252
|
}, null, 512), [
|
|
254
|
-
[ze, t(
|
|
253
|
+
[ze, t(_)]
|
|
255
254
|
]),
|
|
256
255
|
v(D),
|
|
257
256
|
v(O, {
|
|
258
257
|
variant: "secondary",
|
|
259
258
|
label: "Cancel",
|
|
260
259
|
size: "md",
|
|
261
|
-
onClick: d[4] || (d[4] = (
|
|
260
|
+
onClick: d[4] || (d[4] = (k) => t(V).close())
|
|
262
261
|
}),
|
|
263
262
|
v(O, {
|
|
264
263
|
disabled: !!t(Y),
|
|
265
264
|
variant: "primary",
|
|
266
265
|
label: "Submit",
|
|
267
266
|
size: "md",
|
|
268
|
-
onClick:
|
|
267
|
+
onClick: K
|
|
269
268
|
}, null, 8, ["disabled"])
|
|
270
269
|
])
|
|
271
270
|
], 64);
|
|
@@ -286,37 +285,37 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
286
285
|
amount: 1,
|
|
287
286
|
day: 1,
|
|
288
287
|
remark: void 0
|
|
289
|
-
}),
|
|
290
|
-
function
|
|
291
|
-
|
|
288
|
+
}), r = Q(!0), a = j(() => Ae.formattedType(b.type.toUpperCase()));
|
|
289
|
+
function h(_) {
|
|
290
|
+
r.value = _, !_ && b.type === "coin" && (u.value.day = void 0);
|
|
292
291
|
}
|
|
293
|
-
async function
|
|
292
|
+
async function x() {
|
|
294
293
|
if (b.action === "send") {
|
|
295
|
-
const
|
|
294
|
+
const _ = u.value.day ? `, expire in ${u.value.day} days` : "";
|
|
296
295
|
Ye.confirm(
|
|
297
|
-
`Are you sure to send ${u.value.amount} ${a.value.toLowerCase()}${
|
|
296
|
+
`Are you sure to send ${u.value.amount} ${a.value.toLowerCase()}${_}? This action cannot be reversed.`
|
|
298
297
|
).then(async (p) => {
|
|
299
298
|
p && await b.onSubmit(u.value);
|
|
300
299
|
});
|
|
301
300
|
} else
|
|
302
301
|
Ye.confirm(
|
|
303
302
|
`Are you sure to deduct ${u.value.amount} ${a.value.toLowerCase()}? This action cannot be reversed.`
|
|
304
|
-
).then(async (
|
|
305
|
-
|
|
303
|
+
).then(async (_) => {
|
|
304
|
+
_ && await b.onSubmit(u.value);
|
|
306
305
|
});
|
|
307
306
|
}
|
|
308
|
-
const T =
|
|
307
|
+
const T = j(() => {
|
|
309
308
|
const p = (b.action === "send" ? b.type === "coin" ? xt : ht : b.type === "coin" ? St : _t).safeParse(u.value);
|
|
310
309
|
return p.success == !1 ? p.error.flatten().fieldErrors : void 0;
|
|
311
310
|
});
|
|
312
|
-
return (
|
|
313
|
-
const Y = I("FmStepperField"),
|
|
314
|
-
return f(),
|
|
315
|
-
default:
|
|
316
|
-
var ne,
|
|
311
|
+
return (_, p) => {
|
|
312
|
+
const Y = I("FmStepperField"), G = I("FmSwitch"), Z = I("FmTextarea"), K = I("FmButton"), be = I("FmCard");
|
|
313
|
+
return f(), q(be, { class: "flex flex-col gap-16 p-16" }, {
|
|
314
|
+
default: ve(() => {
|
|
315
|
+
var ne, ae, H, m, d, M;
|
|
317
316
|
return [
|
|
318
317
|
n("div", Yt, E(b.action == "send" ? "Send" : "Deduct") + " " + E(t(Re)[b.type.toUpperCase()].name), 1),
|
|
319
|
-
|
|
318
|
+
Fe(" " + E(t(T)) + " ", 1),
|
|
320
319
|
n("div", Ot, [
|
|
321
320
|
v(Y, {
|
|
322
321
|
modelValue: t(u).amount,
|
|
@@ -325,16 +324,16 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
325
324
|
"is-currency": !0,
|
|
326
325
|
"max-fraction-digits": 2,
|
|
327
326
|
"helper-state": (ne = t(T)) != null && ne.amount ? "error" : void 0,
|
|
328
|
-
"helper-text": (H = (
|
|
327
|
+
"helper-text": (H = (ae = t(T)) == null ? void 0 : ae.amount) == null ? void 0 : H[0]
|
|
329
328
|
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
330
|
-
y.action === "send" && b.type === "coin" ? (f(),
|
|
329
|
+
y.action === "send" && b.type === "coin" ? (f(), q(G, {
|
|
331
330
|
key: 0,
|
|
332
|
-
"model-value": t(
|
|
331
|
+
"model-value": t(r),
|
|
333
332
|
label: `${t(a)} expires`,
|
|
334
333
|
"label-placement": "right",
|
|
335
|
-
"onUpdate:modelValue": p[1] || (p[1] = (s) =>
|
|
336
|
-
}, null, 8, ["model-value", "label"])) :
|
|
337
|
-
y.action === "send" && t(
|
|
334
|
+
"onUpdate:modelValue": p[1] || (p[1] = (s) => h(s))
|
|
335
|
+
}, null, 8, ["model-value", "label"])) : xe("", !0),
|
|
336
|
+
y.action === "send" && t(r) ? (f(), q(Y, {
|
|
338
337
|
key: 1,
|
|
339
338
|
modelValue: t(u).day,
|
|
340
339
|
"onUpdate:modelValue": p[2] || (p[2] = (s) => t(u).day = s),
|
|
@@ -344,8 +343,8 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
344
343
|
max: 9999,
|
|
345
344
|
min: 0,
|
|
346
345
|
"helper-state": (m = t(T)) != null && m.day ? "error" : void 0,
|
|
347
|
-
"helper-text": (
|
|
348
|
-
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) :
|
|
346
|
+
"helper-text": (M = (d = t(T)) == null ? void 0 : d.day) == null ? void 0 : M[0]
|
|
347
|
+
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : xe("", !0),
|
|
349
348
|
v(Z, {
|
|
350
349
|
modelValue: t(u).remark,
|
|
351
350
|
"onUpdate:modelValue": p[3] || (p[3] = (s) => t(u).remark = s),
|
|
@@ -353,18 +352,18 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
353
352
|
}, null, 8, ["modelValue"])
|
|
354
353
|
]),
|
|
355
354
|
n("div", Rt, [
|
|
356
|
-
v(
|
|
355
|
+
v(K, {
|
|
357
356
|
variant: "secondary",
|
|
358
357
|
label: "Cancel",
|
|
359
358
|
size: "md",
|
|
360
359
|
onClick: p[4] || (p[4] = (s) => t(V).close())
|
|
361
360
|
}),
|
|
362
|
-
v(
|
|
361
|
+
v(K, {
|
|
363
362
|
disabled: !!t(T),
|
|
364
363
|
variant: "primary",
|
|
365
364
|
label: "Submit",
|
|
366
365
|
size: "md",
|
|
367
|
-
onClick: p[5] || (p[5] = async () =>
|
|
366
|
+
onClick: p[5] || (p[5] = async () => x())
|
|
368
367
|
}, null, 8, ["disabled"])
|
|
369
368
|
])
|
|
370
369
|
];
|
|
@@ -412,35 +411,35 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
412
411
|
setup(y) {
|
|
413
412
|
const V = y, b = Q({
|
|
414
413
|
search: ""
|
|
415
|
-
}), { tableMeta: u, rowData:
|
|
416
|
-
const
|
|
414
|
+
}), { tableMeta: u, rowData: r, onSort: a, debouncedFetchData: h, onSearch: x } = qe(async (T) => {
|
|
415
|
+
const _ = {
|
|
417
416
|
...b.value,
|
|
418
417
|
...V.filters
|
|
419
418
|
};
|
|
420
419
|
return await We.readCollectionsByMemberId(
|
|
421
420
|
V.member._id.toString(),
|
|
422
421
|
T,
|
|
423
|
-
|
|
422
|
+
_
|
|
424
423
|
);
|
|
425
424
|
});
|
|
426
425
|
return it(
|
|
427
426
|
b,
|
|
428
427
|
() => {
|
|
429
|
-
|
|
428
|
+
h();
|
|
430
429
|
},
|
|
431
430
|
{ deep: !0 }
|
|
432
431
|
), lt(async () => {
|
|
433
|
-
await
|
|
434
|
-
}), (T,
|
|
432
|
+
await h();
|
|
433
|
+
}), (T, _) => {
|
|
435
434
|
const p = I("FmSearch");
|
|
436
|
-
return f(),
|
|
435
|
+
return f(), A("div", Lt, [
|
|
437
436
|
n("div", zt, [
|
|
438
437
|
v(p, {
|
|
439
438
|
class: "hidden xs:flex",
|
|
440
439
|
modelValue: t(b).search,
|
|
441
440
|
"onUpdate:modelValue": [
|
|
442
|
-
|
|
443
|
-
t(
|
|
441
|
+
_[0] || (_[0] = (Y) => t(b).search = Y),
|
|
442
|
+
t(x)
|
|
444
443
|
],
|
|
445
444
|
placeholder: "Search",
|
|
446
445
|
collapsible: ""
|
|
@@ -455,15 +454,15 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
455
454
|
class: "xs:hidden",
|
|
456
455
|
modelValue: t(b).search,
|
|
457
456
|
"onUpdate:modelValue": [
|
|
458
|
-
|
|
459
|
-
t(
|
|
457
|
+
_[1] || (_[1] = (Y) => t(b).search = Y),
|
|
458
|
+
t(x)
|
|
460
459
|
],
|
|
461
460
|
placeholder: "Search"
|
|
462
461
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
463
462
|
]),
|
|
464
|
-
v(
|
|
463
|
+
v(Ge, {
|
|
465
464
|
loading: t(u).isLoading,
|
|
466
|
-
"row-data": t(
|
|
465
|
+
"row-data": t(r),
|
|
467
466
|
"row-count": t(u).totalRows,
|
|
468
467
|
"column-defs": y.columns,
|
|
469
468
|
"page-count": t(u).pageCount,
|
|
@@ -471,7 +470,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
471
470
|
"page-size": t(u).pageSize,
|
|
472
471
|
"shrink-at": !1,
|
|
473
472
|
onSortChange: t(a),
|
|
474
|
-
onPageChange:
|
|
473
|
+
onPageChange: _[2] || (_[2] = (Y) => t(h)({
|
|
475
474
|
pageSize: Y.pageSize,
|
|
476
475
|
pageIndex: Y.pageIndex
|
|
477
476
|
}))
|
|
@@ -494,11 +493,12 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
494
493
|
meta: {
|
|
495
494
|
maxWidth: "300px"
|
|
496
495
|
},
|
|
497
|
-
cell(
|
|
498
|
-
|
|
496
|
+
cell(r) {
|
|
497
|
+
var a;
|
|
498
|
+
return z(
|
|
499
499
|
"div",
|
|
500
500
|
{ class: "text-ellipsis truncate" },
|
|
501
|
-
|
|
501
|
+
((a = r.row.original.pf_collectible) == null ? void 0 : a.name) || "-"
|
|
502
502
|
);
|
|
503
503
|
},
|
|
504
504
|
enableSorting: !1
|
|
@@ -506,30 +506,33 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
506
506
|
{
|
|
507
507
|
header: "Claimed at",
|
|
508
508
|
accessorKey: "_id",
|
|
509
|
-
accessorFn: (
|
|
509
|
+
accessorFn: (r) => w(Me(r._id.toString())).format("D MMM YYYY"),
|
|
510
510
|
enableSorting: !1
|
|
511
511
|
},
|
|
512
512
|
{
|
|
513
513
|
header: "Expired at",
|
|
514
|
-
cell(
|
|
515
|
-
var
|
|
516
|
-
const a = (
|
|
514
|
+
cell(r) {
|
|
515
|
+
var h, x, T, _;
|
|
516
|
+
const a = (x = (h = r.row.original.expiryBalance) == null ? void 0 : h[0]) != null && x.expiredAt ? w((_ = (T = r.row.original.expiryBalance) == null ? void 0 : T[0]) == null ? void 0 : _.expiredAt).format(
|
|
517
517
|
"D MMM YYYY"
|
|
518
518
|
) : "-";
|
|
519
|
-
return
|
|
519
|
+
return z("div", {}, a);
|
|
520
520
|
},
|
|
521
521
|
enableSorting: !0
|
|
522
522
|
},
|
|
523
523
|
{
|
|
524
524
|
header: "Transfer open",
|
|
525
|
-
accessorFn: (
|
|
525
|
+
accessorFn: (r) => {
|
|
526
|
+
var a, h, x;
|
|
527
|
+
return Ft((x = (h = (a = r.pf_collectible) == null ? void 0 : a.options) == null ? void 0 : h.enableTransfer) == null ? void 0 : x.toString());
|
|
528
|
+
},
|
|
526
529
|
enableSorting: !1
|
|
527
530
|
}
|
|
528
|
-
], u = (
|
|
531
|
+
], u = (r) => ({
|
|
529
532
|
type: [ke.enum.VOUCHER],
|
|
530
|
-
isActive:
|
|
533
|
+
isActive: r
|
|
531
534
|
});
|
|
532
|
-
return (
|
|
535
|
+
return (r, a) => (f(), A(L, null, [
|
|
533
536
|
a[0] || (a[0] = n("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Voucher Collections", -1)),
|
|
534
537
|
v(he, {
|
|
535
538
|
member: V.member,
|
|
@@ -560,27 +563,37 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
560
563
|
meta: {
|
|
561
564
|
maxWidth: "300px"
|
|
562
565
|
},
|
|
563
|
-
cell(
|
|
564
|
-
|
|
566
|
+
cell(r) {
|
|
567
|
+
var a;
|
|
568
|
+
return z(
|
|
565
569
|
"div",
|
|
566
570
|
{ class: "text-ellipsis truncate" },
|
|
567
|
-
|
|
571
|
+
((a = r.row.original.pf_campaign) == null ? void 0 : a.name) || "-"
|
|
568
572
|
);
|
|
569
573
|
},
|
|
570
574
|
enableSorting: !1
|
|
571
575
|
},
|
|
572
576
|
{
|
|
573
577
|
header: "Status",
|
|
574
|
-
cell(
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
578
|
+
cell(r) {
|
|
579
|
+
if (r.row.original.pf_campaign) {
|
|
580
|
+
const a = {
|
|
581
|
+
active: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
|
|
582
|
+
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
583
|
+
completed: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
584
|
+
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
585
|
+
}, h = Tt(
|
|
586
|
+
r.row.original.pf_campaign
|
|
587
|
+
), T = r.row.original.balance === r.row.original.pf_collectible.extras.mission.end && h === "active" ? "completed" : h;
|
|
588
|
+
return z(ge.FmChip, {
|
|
589
|
+
class: a[T],
|
|
590
|
+
label: bt.title(T),
|
|
591
|
+
compact: !0
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
return z(ge.FmChip, {
|
|
595
|
+
class: "",
|
|
596
|
+
label: "-",
|
|
584
597
|
compact: !0
|
|
585
598
|
});
|
|
586
599
|
},
|
|
@@ -588,7 +601,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
588
601
|
},
|
|
589
602
|
{
|
|
590
603
|
header: "Summary",
|
|
591
|
-
accessorFn: (
|
|
604
|
+
accessorFn: (r) => r != null && r.pf_campaign ? Mt(r.pf_campaign) : "-",
|
|
592
605
|
enableSorting: !1
|
|
593
606
|
},
|
|
594
607
|
{
|
|
@@ -598,26 +611,29 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
598
611
|
},
|
|
599
612
|
{
|
|
600
613
|
header: "Total Step",
|
|
601
|
-
|
|
614
|
+
accessorFn: (r) => {
|
|
615
|
+
var a, h, x;
|
|
616
|
+
return ((x = (h = (a = r == null ? void 0 : r.pf_collectible) == null ? void 0 : a.extras) == null ? void 0 : h.mission) == null ? void 0 : x.end) ?? 0;
|
|
617
|
+
},
|
|
602
618
|
enableSorting: !1
|
|
603
619
|
}
|
|
604
|
-
], u = (
|
|
620
|
+
], u = (r) => ({
|
|
605
621
|
type: [ke.enum.STAMP],
|
|
606
|
-
"pf_collectible.extras.mission.type": [
|
|
622
|
+
"pf_collectible.extras.mission.type": [r]
|
|
607
623
|
});
|
|
608
|
-
return (
|
|
624
|
+
return (r, a) => (f(), A(L, null, [
|
|
609
625
|
a[0] || (a[0] = n("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Mission", -1)),
|
|
610
626
|
v(he, {
|
|
611
627
|
member: V.member,
|
|
612
628
|
columns: b,
|
|
613
629
|
title: "Stamp mission",
|
|
614
|
-
filters: u(t(
|
|
630
|
+
filters: u(t(Te).enum.STAMP)
|
|
615
631
|
}, null, 8, ["member", "filters"]),
|
|
616
632
|
v(he, {
|
|
617
633
|
member: V.member,
|
|
618
634
|
columns: b,
|
|
619
635
|
title: "Progress mission",
|
|
620
|
-
filters: u(t(
|
|
636
|
+
filters: u(t(Te).enum.PROGRESSIVE)
|
|
621
637
|
}, null, 8, ["member", "filters"])
|
|
622
638
|
], 64));
|
|
623
639
|
}
|
|
@@ -636,11 +652,12 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
636
652
|
meta: {
|
|
637
653
|
maxWidth: "300px"
|
|
638
654
|
},
|
|
639
|
-
cell(
|
|
640
|
-
|
|
655
|
+
cell(r) {
|
|
656
|
+
var a;
|
|
657
|
+
return z(
|
|
641
658
|
"div",
|
|
642
659
|
{ class: "text-ellipsis truncate" },
|
|
643
|
-
|
|
660
|
+
((a = r.row.original.pf_campaign) == null ? void 0 : a.name) || "-"
|
|
644
661
|
);
|
|
645
662
|
},
|
|
646
663
|
enableSorting: !1
|
|
@@ -648,17 +665,17 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
648
665
|
{
|
|
649
666
|
header: "Claimed at",
|
|
650
667
|
accessorKey: "_id",
|
|
651
|
-
accessorFn: (
|
|
668
|
+
accessorFn: (r) => w(Me(r._id.toString())).format("D MMM YYYY"),
|
|
652
669
|
enableSorting: !1
|
|
653
670
|
},
|
|
654
671
|
{
|
|
655
672
|
header: "Expired at",
|
|
656
|
-
cell(
|
|
657
|
-
var
|
|
658
|
-
const a = (
|
|
673
|
+
cell(r) {
|
|
674
|
+
var h, x, T, _;
|
|
675
|
+
const a = (x = (h = r.row.original.expiryBalance) == null ? void 0 : h[0]) != null && x.expiredAt ? w((_ = (T = r.row.original.expiryBalance) == null ? void 0 : T[0]) == null ? void 0 : _.expiredAt).format(
|
|
659
676
|
"D MMM YYYY"
|
|
660
677
|
) : "-";
|
|
661
|
-
return
|
|
678
|
+
return z("div", {}, a);
|
|
662
679
|
},
|
|
663
680
|
enableSorting: !1
|
|
664
681
|
},
|
|
@@ -667,11 +684,11 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
667
684
|
accessorKey: "balance",
|
|
668
685
|
enableSorting: !1
|
|
669
686
|
}
|
|
670
|
-
], u = (
|
|
687
|
+
], u = (r) => ({
|
|
671
688
|
type: [ke.enum.GAME],
|
|
672
|
-
isActive:
|
|
689
|
+
isActive: r
|
|
673
690
|
});
|
|
674
|
-
return (
|
|
691
|
+
return (r, a) => (f(), A(L, null, [
|
|
675
692
|
a[0] || (a[0] = n("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Game program", -1)),
|
|
676
693
|
v(he, {
|
|
677
694
|
member: V.member,
|
|
@@ -687,13 +704,13 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
687
704
|
}, null, 8, ["member", "filters"])
|
|
688
705
|
], 64));
|
|
689
706
|
}
|
|
690
|
-
}), Xt = { class: "flex flex-col flex-nowrap gap-y-24 max-h-full" }, Qt = { class: "grid md:grid-cols-2 lg:grid-cols-2 gap-x-36 gap-y-24" }, Zt = { class: "space-y-16" }, eo = { class: "flex gap-16 items-center" }, to = { class: "flex-auto" }, oo = { class: "fm-typo-en-body-md-600" }, no = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
707
|
+
}), Xt = { class: "flex flex-col flex-nowrap gap-y-24 max-h-full" }, Qt = { class: "grid md:grid-cols-2 lg:grid-cols-2 gap-x-36 gap-y-24" }, Zt = { class: "space-y-16" }, eo = { class: "flex gap-16 items-center" }, to = { class: "flex-auto" }, oo = { class: "fm-typo-en-body-md-600" }, no = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ao = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, so = { class: "fm-typo-en-body-md-800" }, ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, io = { class: "fm-typo-en-body-md-800" }, lo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, co = { class: "fm-typo-en-body-md-600" }, mo = { class: "gap-16 grid grid-cols-1" }, uo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, po = { class: "fm-typo-en-body-md-600" }, bo = { class: "p-16 grid md:grid-cols-3 lg:grid-cols-3 border-2 border-fm-color-neutral-gray-100 rounded-lg gap-16 divide-y md:divide-y-0 lg:divide-y-0 md:divide-x lg:divide-x divide-fm-color-neutral-gray-100" }, fo = { class: "flex justify-between mb-16" }, yo = { class: "fm-typo-en-title-sm-600" }, go = ["onClick"], vo = { class: "flex flex-col gap-y-16" }, xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ho = { class: "fm-typo-en-body-md-600" }, So = { class: "space-y-8" }, _o = {
|
|
691
708
|
key: 0,
|
|
692
709
|
class: "space-x-8"
|
|
693
710
|
}, Co = {
|
|
694
711
|
key: 1,
|
|
695
712
|
class: "text-fm-color-typo-secondary"
|
|
696
|
-
}, wo = { class: "space-y-8" },
|
|
713
|
+
}, wo = { class: "space-y-8" }, Fo = ["src"], To = { class: "fm-typo-en-body-md-600" }, Mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ko = {
|
|
697
714
|
key: 1,
|
|
698
715
|
class: "text-fm-color-typo-secondary"
|
|
699
716
|
}, Ao = {
|
|
@@ -709,28 +726,28 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
709
726
|
},
|
|
710
727
|
emits: ["update:member"],
|
|
711
728
|
setup(y, { expose: V, emit: b }) {
|
|
712
|
-
const u = Je(),
|
|
729
|
+
const u = Je(), r = He(), a = Ve(), h = Qe(), x = wt(), T = Ie(), { minor: _ } = Ke, p = y, Y = b, G = j(() => r.locations.map((o) => ({
|
|
713
730
|
label: o.name,
|
|
714
731
|
value: o._id
|
|
715
|
-
}))), Z =
|
|
732
|
+
}))), Z = j(() => (p.member.segment || []).map((o) => {
|
|
716
733
|
var e;
|
|
717
|
-
return ((e =
|
|
718
|
-
}).filter(Boolean)),
|
|
734
|
+
return ((e = h.segments.find((i) => i._id === o)) == null ? void 0 : e.name) || "";
|
|
735
|
+
}).filter(Boolean)), K = [
|
|
719
736
|
{
|
|
720
737
|
label: "Loyalty",
|
|
721
738
|
stats: [
|
|
722
739
|
{
|
|
723
740
|
label: "Experiences",
|
|
724
741
|
getter: (o) => {
|
|
725
|
-
var e,
|
|
726
|
-
return X(((
|
|
742
|
+
var e, i, S;
|
|
743
|
+
return X(((S = (i = (e = o.collection) == null ? void 0 : e.POINT) == null ? void 0 : i[0]) == null ? void 0 : S.balance) ?? 0, 2);
|
|
727
744
|
}
|
|
728
745
|
},
|
|
729
746
|
{
|
|
730
747
|
label: "Credits",
|
|
731
748
|
getter: (o) => {
|
|
732
|
-
var e,
|
|
733
|
-
return X(((
|
|
749
|
+
var e, i, S;
|
|
750
|
+
return X(((S = (i = (e = o.collection) == null ? void 0 : e.CREDIT) == null ? void 0 : i[0]) == null ? void 0 : S.balance) ?? 0, 2);
|
|
734
751
|
}
|
|
735
752
|
}
|
|
736
753
|
]
|
|
@@ -740,11 +757,11 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
740
757
|
stats: [
|
|
741
758
|
{
|
|
742
759
|
label: "Active vouchers",
|
|
743
|
-
getter: (o) => X(
|
|
760
|
+
getter: (o) => X(F.value.active, 0)
|
|
744
761
|
},
|
|
745
762
|
{
|
|
746
763
|
label: "Past vouchers",
|
|
747
|
-
getter: (o) => X(
|
|
764
|
+
getter: (o) => X(F.value.past, 0)
|
|
748
765
|
}
|
|
749
766
|
]
|
|
750
767
|
},
|
|
@@ -753,11 +770,11 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
753
770
|
stats: [
|
|
754
771
|
{
|
|
755
772
|
label: "Stamp missions",
|
|
756
|
-
getter: (o) => X(
|
|
773
|
+
getter: (o) => X(C.value.stamp.length, 0)
|
|
757
774
|
},
|
|
758
775
|
{
|
|
759
776
|
label: "Progress missions",
|
|
760
|
-
getter: (o) => X(
|
|
777
|
+
getter: (o) => X(C.value.progressive.length, 0)
|
|
761
778
|
}
|
|
762
779
|
]
|
|
763
780
|
},
|
|
@@ -767,10 +784,10 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
767
784
|
{
|
|
768
785
|
label: "Tokens",
|
|
769
786
|
getter: (o) => {
|
|
770
|
-
var e,
|
|
787
|
+
var e, i;
|
|
771
788
|
return X(
|
|
772
|
-
((
|
|
773
|
-
(
|
|
789
|
+
((i = (e = o.collection) == null ? void 0 : e.GAME) == null ? void 0 : i.reduce(
|
|
790
|
+
(S, $) => S + $.balance,
|
|
774
791
|
0
|
|
775
792
|
)) || 0,
|
|
776
793
|
0
|
|
@@ -790,11 +807,11 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
790
807
|
}
|
|
791
808
|
], ne = (() => {
|
|
792
809
|
const e = [];
|
|
793
|
-
for (let
|
|
794
|
-
e.push(
|
|
810
|
+
for (let i = 0; i < K.length; i += 3)
|
|
811
|
+
e.push(K.slice(i, i + 3));
|
|
795
812
|
return e;
|
|
796
813
|
})();
|
|
797
|
-
async function
|
|
814
|
+
async function ae(o, e) {
|
|
798
815
|
switch (o.stopPropagation(), e) {
|
|
799
816
|
case "Store bundle":
|
|
800
817
|
await u.push({
|
|
@@ -804,7 +821,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
804
821
|
});
|
|
805
822
|
break;
|
|
806
823
|
default:
|
|
807
|
-
P.value =
|
|
824
|
+
P.value = k.find((i) => i.label === e) || k[0];
|
|
808
825
|
break;
|
|
809
826
|
}
|
|
810
827
|
}
|
|
@@ -815,22 +832,22 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
815
832
|
dialogComponentProps: {
|
|
816
833
|
type: o,
|
|
817
834
|
action: e,
|
|
818
|
-
onSubmit: async (
|
|
819
|
-
await
|
|
835
|
+
onSubmit: async (i) => {
|
|
836
|
+
await _(
|
|
820
837
|
async () => {
|
|
821
|
-
const
|
|
838
|
+
const S = {
|
|
822
839
|
"credit-send": le.sendCredit,
|
|
823
840
|
"credit-deduct": le.deductCredit,
|
|
824
841
|
"coin-send": le.sendCoin,
|
|
825
842
|
"coin-deduct": le.deductCoin
|
|
826
|
-
}, $ = `${o}-${e}`, R =
|
|
827
|
-
R && await R(p.member._id,
|
|
843
|
+
}, $ = `${o}-${e}`, R = S[$];
|
|
844
|
+
R && await R(p.member._id, i), Y("update:member"), T.close();
|
|
828
845
|
},
|
|
829
846
|
{
|
|
830
847
|
message: `Adjusting ${Ae.formattedType(
|
|
831
848
|
o.toUpperCase()
|
|
832
849
|
).toLowerCase()}`,
|
|
833
|
-
successMessage: `${
|
|
850
|
+
successMessage: `${i.amount} ${Ae.formattedType(
|
|
834
851
|
o.toUpperCase()
|
|
835
852
|
).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${p.member.phoneNumber}`
|
|
836
853
|
}
|
|
@@ -846,7 +863,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
846
863
|
contentComponentProps: {
|
|
847
864
|
member: p.member,
|
|
848
865
|
onSubmit: async (o) => {
|
|
849
|
-
await
|
|
866
|
+
await _(
|
|
850
867
|
async () => {
|
|
851
868
|
await le.updateMember(p.member._id, o), Y("update:member"), T.close();
|
|
852
869
|
},
|
|
@@ -868,8 +885,8 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
868
885
|
label: "Tier",
|
|
869
886
|
getter: (o) => {
|
|
870
887
|
var re, ce, fe, g, B;
|
|
871
|
-
const e = (((ce = Ue.first((re = p.member.collection) == null ? void 0 : re.TIER)) == null ? void 0 : ce.balance) || 0) - 1,
|
|
872
|
-
return `${
|
|
888
|
+
const e = (((ce = Ue.first((re = p.member.collection) == null ? void 0 : re.TIER)) == null ? void 0 : ce.balance) || 0) - 1, i = s.value.name, S = ((g = (fe = o.collection) == null ? void 0 : fe.POINT) == null ? void 0 : g[0].balance) ?? 0, $ = a.sortedTiers[e + 1], R = ((B = $ == null ? void 0 : $.option) == null ? void 0 : B.to) ?? 1 / 0;
|
|
889
|
+
return `${i} (${S}/${R})`;
|
|
873
890
|
}
|
|
874
891
|
},
|
|
875
892
|
{
|
|
@@ -878,18 +895,18 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
878
895
|
},
|
|
879
896
|
{
|
|
880
897
|
label: "Birthday",
|
|
881
|
-
getter: (o) => o.birthday ?
|
|
898
|
+
getter: (o) => o.birthday ? w(o.birthday).format("D MMM YYYY") : "-"
|
|
882
899
|
}
|
|
883
|
-
],
|
|
900
|
+
], M = [
|
|
884
901
|
{
|
|
885
902
|
label: "Customer since",
|
|
886
|
-
getter: (o) =>
|
|
903
|
+
getter: (o) => w(Me(o._id.toString())).format("D MMM YYYY")
|
|
887
904
|
},
|
|
888
905
|
{
|
|
889
906
|
label: "Joined at location",
|
|
890
907
|
getter: (o) => {
|
|
891
908
|
var e;
|
|
892
|
-
return o != null && o.location && ((e =
|
|
909
|
+
return o != null && o.location && ((e = G.value.find((i) => i.value == o.location)) == null ? void 0 : e.label) || "-";
|
|
893
910
|
}
|
|
894
911
|
},
|
|
895
912
|
{
|
|
@@ -898,7 +915,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
898
915
|
},
|
|
899
916
|
{
|
|
900
917
|
label: "Last visit",
|
|
901
|
-
getter: (o) =>
|
|
918
|
+
getter: (o) => w(o.stats.lastVisit).fromNow()
|
|
902
919
|
},
|
|
903
920
|
{
|
|
904
921
|
label: "Frequency",
|
|
@@ -925,57 +942,57 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
925
942
|
// label: 'Point Earned this season',
|
|
926
943
|
// key: 'lastSeasonPointEarned',
|
|
927
944
|
// },
|
|
928
|
-
], s =
|
|
929
|
-
var
|
|
930
|
-
const o = (((
|
|
945
|
+
], s = j(() => {
|
|
946
|
+
var i, S;
|
|
947
|
+
const o = (((S = Ue.first((i = p.member.collection) == null ? void 0 : i.TIER)) == null ? void 0 : S.balance) || 0) - 1, e = a.sortedTiers[o];
|
|
931
948
|
return { name: (e == null ? void 0 : e.name) || "-", tier: o, config: e };
|
|
932
|
-
}),
|
|
949
|
+
}), c = j(() => {
|
|
933
950
|
var o;
|
|
934
951
|
return (((o = p.member.collection) == null ? void 0 : o.TITLE) || []).map((e) => {
|
|
935
|
-
var
|
|
936
|
-
const
|
|
952
|
+
var S, $, R;
|
|
953
|
+
const i = (S = a.sortedTitles) == null ? void 0 : S.find(
|
|
937
954
|
(re) => re._id == e.collectible
|
|
938
955
|
);
|
|
939
956
|
return {
|
|
940
|
-
name:
|
|
957
|
+
name: i == null ? void 0 : i.name,
|
|
941
958
|
expiredAt: (R = ($ = e.expiryBalance) == null ? void 0 : $.at(-1)) == null ? void 0 : R.expiredAt,
|
|
942
|
-
collectible:
|
|
959
|
+
collectible: i
|
|
943
960
|
};
|
|
944
961
|
}).filter(
|
|
945
|
-
(e) => e.expiredAt ?
|
|
962
|
+
(e) => e.expiredAt ? w(e.expiredAt).isAfter(w()) : !0
|
|
946
963
|
);
|
|
947
|
-
}),
|
|
964
|
+
}), C = j(() => {
|
|
948
965
|
var e;
|
|
949
|
-
const o = (((e = p.member.collection) == null ? void 0 : e.STAMP) || []).map((
|
|
950
|
-
var
|
|
951
|
-
return ($ = (
|
|
952
|
-
(R) => R.collectible.toString() ===
|
|
966
|
+
const o = (((e = p.member.collection) == null ? void 0 : e.STAMP) || []).map((i) => {
|
|
967
|
+
var S, $;
|
|
968
|
+
return ($ = (S = x.campaigns) == null ? void 0 : S.mission) == null ? void 0 : $.find(
|
|
969
|
+
(R) => R.collectible.toString() === i.collectible
|
|
953
970
|
);
|
|
954
|
-
}).filter((
|
|
971
|
+
}).filter((i) => i);
|
|
955
972
|
return {
|
|
956
973
|
stamp: o.filter(
|
|
957
|
-
(
|
|
958
|
-
var
|
|
959
|
-
return ((
|
|
974
|
+
(i) => {
|
|
975
|
+
var S;
|
|
976
|
+
return ((S = i == null ? void 0 : i.mission) == null ? void 0 : S.type) === Te.enum.STAMP;
|
|
960
977
|
}
|
|
961
978
|
),
|
|
962
979
|
progressive: o.filter(
|
|
963
|
-
(
|
|
964
|
-
var
|
|
965
|
-
return ((
|
|
980
|
+
(i) => {
|
|
981
|
+
var S;
|
|
982
|
+
return ((S = i == null ? void 0 : i.mission) == null ? void 0 : S.type) === Te.enum.PROGRESSIVE;
|
|
966
983
|
}
|
|
967
984
|
)
|
|
968
985
|
};
|
|
969
|
-
}),
|
|
986
|
+
}), F = Q({ active: 0, past: 0 }), O = Q([]), N = j(
|
|
970
987
|
() => O.value.reduce((o, e) => o + e.count, 0)
|
|
971
988
|
), D = Q(!0);
|
|
972
989
|
function ee() {
|
|
973
|
-
D.value = !0, P.value =
|
|
990
|
+
D.value = !0, P.value = k[0];
|
|
974
991
|
}
|
|
975
|
-
function
|
|
992
|
+
function se() {
|
|
976
993
|
D.value = !1;
|
|
977
994
|
}
|
|
978
|
-
const
|
|
995
|
+
const k = [
|
|
979
996
|
{
|
|
980
997
|
label: "Overview",
|
|
981
998
|
value: "overview"
|
|
@@ -996,20 +1013,20 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
996
1013
|
label: "Game",
|
|
997
1014
|
value: "game"
|
|
998
1015
|
}
|
|
999
|
-
], P = Q(
|
|
1016
|
+
], P = Q(k[0]);
|
|
1000
1017
|
return je(async () => {
|
|
1001
|
-
await a.readMembership(),
|
|
1018
|
+
await a.readMembership(), F.value = await We.readCollectionCountByMemberId(
|
|
1002
1019
|
p.member._id.toString(),
|
|
1003
1020
|
ke.enum.VOUCHER
|
|
1004
|
-
), await
|
|
1021
|
+
), await x.read("MISSION"), O.value = await kt.readPurchaseCountByMember(
|
|
1005
1022
|
p.member._id.toString()
|
|
1006
|
-
),
|
|
1023
|
+
), r.locations.length || await r.readLocations();
|
|
1007
1024
|
}), V({
|
|
1008
1025
|
showSheet: ee,
|
|
1009
|
-
hideSheet:
|
|
1026
|
+
hideSheet: se
|
|
1010
1027
|
}), (o, e) => {
|
|
1011
|
-
const
|
|
1012
|
-
return f(),
|
|
1028
|
+
const i = I("FmTabs"), S = I("FmAvatar"), $ = I("FmButton"), R = I("FmIcon"), re = I("FmChip"), ce = I("FmCard"), fe = I("FmSideSheet");
|
|
1029
|
+
return f(), q(fe, {
|
|
1013
1030
|
modelValue: t(D),
|
|
1014
1031
|
"onUpdate:modelValue": e[5] || (e[5] = (g) => ct(D) ? D.value = g : null),
|
|
1015
1032
|
header: "Member Detail",
|
|
@@ -1017,24 +1034,24 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1017
1034
|
"close-button": !0,
|
|
1018
1035
|
"max-width": 1100
|
|
1019
1036
|
}, {
|
|
1020
|
-
"side-sheet-footer":
|
|
1021
|
-
default:
|
|
1037
|
+
"side-sheet-footer": ve(() => e[19] || (e[19] = [])),
|
|
1038
|
+
default: ve(() => [
|
|
1022
1039
|
n("div", Xt, [
|
|
1023
1040
|
n("div", null, [
|
|
1024
|
-
v(
|
|
1041
|
+
v(i, {
|
|
1025
1042
|
"model-value": t(P).value,
|
|
1026
|
-
items:
|
|
1043
|
+
items: k,
|
|
1027
1044
|
class: "overflow-x-auto",
|
|
1028
|
-
"onUpdate:modelValue": e[0] || (e[0] = (g) => P.value =
|
|
1045
|
+
"onUpdate:modelValue": e[0] || (e[0] = (g) => P.value = k.find((B) => B.value === g))
|
|
1029
1046
|
}, null, 8, ["model-value"])
|
|
1030
1047
|
]),
|
|
1031
|
-
t(P).value == "overview" ? (f(),
|
|
1048
|
+
t(P).value == "overview" ? (f(), A(L, { key: 0 }, [
|
|
1032
1049
|
n("div", Qt, [
|
|
1033
1050
|
n("div", null, [
|
|
1034
1051
|
e[9] || (e[9] = n("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
|
|
1035
1052
|
n("div", Zt, [
|
|
1036
1053
|
n("div", eo, [
|
|
1037
|
-
v(
|
|
1054
|
+
v(S, {
|
|
1038
1055
|
name: y.member.photoUrl ? void 0 : y.member.name,
|
|
1039
1056
|
src: y.member.photoUrl || void 0
|
|
1040
1057
|
}, null, 8, ["name", "src"]),
|
|
@@ -1042,12 +1059,12 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1042
1059
|
e[8] || (e[8] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
|
|
1043
1060
|
n("div", oo, E(y.member.name), 1),
|
|
1044
1061
|
n("div", no, E(y.member._id), 1),
|
|
1045
|
-
n("div",
|
|
1046
|
-
e[6] || (e[6] =
|
|
1047
|
-
n("span",
|
|
1062
|
+
n("div", ao, [
|
|
1063
|
+
e[6] || (e[6] = Fe(" Member Card: ")),
|
|
1064
|
+
n("span", so, E(y.member.cardNo ? y.member.cardNo : "-"), 1)
|
|
1048
1065
|
]),
|
|
1049
1066
|
n("div", ro, [
|
|
1050
|
-
e[7] || (e[7] =
|
|
1067
|
+
e[7] || (e[7] = Fe(" Referral Code: ")),
|
|
1051
1068
|
n("span", io, E(y.member.referralCode ? y.member.referralCode : "-"), 1)
|
|
1052
1069
|
])
|
|
1053
1070
|
]),
|
|
@@ -1057,7 +1074,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1057
1074
|
onClick: m
|
|
1058
1075
|
})
|
|
1059
1076
|
]),
|
|
1060
|
-
(f(),
|
|
1077
|
+
(f(), A(L, null, ie(d, (g, B) => n("div", { key: B }, [
|
|
1061
1078
|
n("div", lo, E(g.label), 1),
|
|
1062
1079
|
n("div", co, E(g.key ? y.member[g.key] : g.getter(y.member)), 1)
|
|
1063
1080
|
])), 64))
|
|
@@ -1066,7 +1083,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1066
1083
|
n("div", null, [
|
|
1067
1084
|
e[10] || (e[10] = n("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
|
|
1068
1085
|
n("div", mo, [
|
|
1069
|
-
(f(),
|
|
1086
|
+
(f(), A(L, null, ie(M, (g) => n("div", {
|
|
1070
1087
|
key: g.key
|
|
1071
1088
|
}, [
|
|
1072
1089
|
n("div", uo, E(g.label), 1),
|
|
@@ -1076,15 +1093,15 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1076
1093
|
])
|
|
1077
1094
|
]),
|
|
1078
1095
|
e[13] || (e[13] = n("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1079
|
-
(f(!0),
|
|
1080
|
-
(f(!0),
|
|
1096
|
+
(f(!0), A(L, null, ie(t(ne), (g) => (f(), A("div", bo, [
|
|
1097
|
+
(f(!0), A(L, null, ie(g, (B, te) => (f(), A("div", { key: te }, [
|
|
1081
1098
|
n("div", {
|
|
1082
1099
|
class: dt(te !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
|
|
1083
1100
|
}, [
|
|
1084
1101
|
n("div", fo, [
|
|
1085
1102
|
n("div", yo, E(B.label), 1),
|
|
1086
1103
|
n("button", {
|
|
1087
|
-
onClick: (U) =>
|
|
1104
|
+
onClick: (U) => ae(U, B.label)
|
|
1088
1105
|
}, [
|
|
1089
1106
|
v(R, {
|
|
1090
1107
|
name: "chevron_right",
|
|
@@ -1094,7 +1111,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1094
1111
|
], 8, go)
|
|
1095
1112
|
]),
|
|
1096
1113
|
n("div", vo, [
|
|
1097
|
-
(f(!0),
|
|
1114
|
+
(f(!0), A(L, null, ie(B.stats, (U) => (f(), A("div", {
|
|
1098
1115
|
key: U.key
|
|
1099
1116
|
}, [
|
|
1100
1117
|
n("div", xo, E(U.label), 1),
|
|
@@ -1106,35 +1123,35 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1106
1123
|
]))), 256)),
|
|
1107
1124
|
n("div", So, [
|
|
1108
1125
|
e[11] || (e[11] = n("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
|
|
1109
|
-
t(Z).length ? (f(),
|
|
1110
|
-
(f(!0),
|
|
1126
|
+
t(Z).length ? (f(), A("div", _o, [
|
|
1127
|
+
(f(!0), A(L, null, ie(t(Z), (g) => (f(), q(re, {
|
|
1111
1128
|
label: g.toString()
|
|
1112
1129
|
}, null, 8, ["label"]))), 256))
|
|
1113
|
-
])) : (f(),
|
|
1130
|
+
])) : (f(), A("div", Co, "No titles"))
|
|
1114
1131
|
]),
|
|
1115
1132
|
e[14] || (e[14] = n("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1116
1133
|
n("div", wo, [
|
|
1117
1134
|
e[12] || (e[12] = n("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
|
|
1118
|
-
t(
|
|
1135
|
+
t(c).length ? (f(!0), A(L, { key: 0 }, ie(t(c).filter((g) => g.collectible), (g) => (f(), A("div", {
|
|
1119
1136
|
class: "flex items-center gap-x-8 h-48",
|
|
1120
1137
|
key: g.name
|
|
1121
1138
|
}, [
|
|
1122
1139
|
n("img", {
|
|
1123
1140
|
src: g.collectible.image || t(gt),
|
|
1124
1141
|
class: "aspect-square h-full object-contain"
|
|
1125
|
-
}, null, 8,
|
|
1142
|
+
}, null, 8, Fo),
|
|
1126
1143
|
n("div", null, [
|
|
1127
|
-
n("div",
|
|
1128
|
-
n("div", Mo, " Expired on " + E(t(
|
|
1144
|
+
n("div", To, E(g.name), 1),
|
|
1145
|
+
n("div", Mo, " Expired on " + E(t(w)(g.expiredAt).format("MMM D, Y")), 1)
|
|
1129
1146
|
])
|
|
1130
|
-
]))), 128)) : (f(),
|
|
1147
|
+
]))), 128)) : (f(), A("div", ko, "No titles"))
|
|
1131
1148
|
])
|
|
1132
|
-
], 64)) : t(P).value == "loyalty" ? (f(),
|
|
1149
|
+
], 64)) : t(P).value == "loyalty" ? (f(), A("div", Ao, [
|
|
1133
1150
|
v(ce, {
|
|
1134
1151
|
class: "p-16 space-y-24",
|
|
1135
1152
|
variant: "outlined"
|
|
1136
1153
|
}, {
|
|
1137
|
-
default:
|
|
1154
|
+
default: ve(() => {
|
|
1138
1155
|
var g, B, te, U, de, me, ue;
|
|
1139
1156
|
return [
|
|
1140
1157
|
n("div", Io, [
|
|
@@ -1144,7 +1161,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1144
1161
|
n("div", Eo, [
|
|
1145
1162
|
e[16] || (e[16] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit(s) to be expired in 30 days ", -1)),
|
|
1146
1163
|
n("div", $o, E(((ue = (me = (de = (U = y.member.collection) == null ? void 0 : U.CREDIT) == null ? void 0 : de[0]) == null ? void 0 : me.expiryBalance) == null ? void 0 : ue.reduce(
|
|
1147
|
-
(W, J) => J.expiredAt && t(
|
|
1164
|
+
(W, J) => J.expiredAt && t(w)(J.expiredAt).isAfter(t(w)()) && t(w)(J.expiredAt).isBefore(t(w)().add(30, "days")) ? W + J.amount : W,
|
|
1148
1165
|
0
|
|
1149
1166
|
)) ?? 0), 1)
|
|
1150
1167
|
]),
|
|
@@ -1170,7 +1187,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1170
1187
|
class: "p-16 space-y-24",
|
|
1171
1188
|
variant: "outlined"
|
|
1172
1189
|
}, {
|
|
1173
|
-
default:
|
|
1190
|
+
default: ve(() => {
|
|
1174
1191
|
var g, B, te, U, de, me, ue;
|
|
1175
1192
|
return [
|
|
1176
1193
|
n("div", Do, [
|
|
@@ -1180,7 +1197,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1180
1197
|
n("div", Bo, [
|
|
1181
1198
|
e[18] || (e[18] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point(s) to be expired in 30 days ", -1)),
|
|
1182
1199
|
n("div", Yo, E(((ue = (me = (de = (U = y.member.collection) == null ? void 0 : U.COIN) == null ? void 0 : de[0]) == null ? void 0 : me.expiryBalance) == null ? void 0 : ue.reduce(
|
|
1183
|
-
(W, J) => J.expiredAt && t(
|
|
1200
|
+
(W, J) => J.expiredAt && t(w)(J.expiredAt).isAfter(t(w)()) && t(w)(J.expiredAt).isBefore(t(w)().add(30, "days")) ? W + J.amount : W,
|
|
1184
1201
|
0
|
|
1185
1202
|
)) ?? 0), 1)
|
|
1186
1203
|
]),
|
|
@@ -1202,26 +1219,26 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1202
1219
|
}),
|
|
1203
1220
|
_: 1
|
|
1204
1221
|
})
|
|
1205
|
-
])) : t(P).value == "voucher" ? (f(),
|
|
1222
|
+
])) : t(P).value == "voucher" ? (f(), q(Ht, {
|
|
1206
1223
|
key: 2,
|
|
1207
1224
|
member: p.member
|
|
1208
|
-
}, null, 8, ["member"])) : t(P).value == "mission" ? (f(),
|
|
1225
|
+
}, null, 8, ["member"])) : t(P).value == "mission" ? (f(), q(Wt, {
|
|
1209
1226
|
key: 3,
|
|
1210
1227
|
member: p.member
|
|
1211
|
-
}, null, 8, ["member"])) : t(P).value == "game" ? (f(),
|
|
1228
|
+
}, null, 8, ["member"])) : t(P).value == "game" ? (f(), q(Jt, {
|
|
1212
1229
|
key: 4,
|
|
1213
1230
|
member: p.member
|
|
1214
|
-
}, null, 8, ["member"])) :
|
|
1231
|
+
}, null, 8, ["member"])) : xe("", !0)
|
|
1215
1232
|
])
|
|
1216
1233
|
]),
|
|
1217
1234
|
_: 1
|
|
1218
1235
|
}, 8, ["modelValue"]);
|
|
1219
1236
|
};
|
|
1220
1237
|
}
|
|
1221
|
-
}), Uo = { class: "flex items-center justify-end" },
|
|
1238
|
+
}), Uo = { class: "flex items-center justify-end" }, Sn = /* @__PURE__ */ pe({
|
|
1222
1239
|
__name: "MemberList",
|
|
1223
1240
|
setup(y) {
|
|
1224
|
-
const V = Qe(), b = Ve(), u =
|
|
1241
|
+
const V = Qe(), b = Ve(), u = He(), { minor: r } = Ke, a = Je(), h = [
|
|
1225
1242
|
{
|
|
1226
1243
|
header: "Name",
|
|
1227
1244
|
enableSorting: !0,
|
|
@@ -1231,7 +1248,7 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1231
1248
|
}
|
|
1232
1249
|
},
|
|
1233
1250
|
{
|
|
1234
|
-
accessorFn: (s) =>
|
|
1251
|
+
accessorFn: (s) => w(Me(s._id.toString())).format("D MMM YYYY"),
|
|
1235
1252
|
header: "Customer Since",
|
|
1236
1253
|
accessorKey: "_id",
|
|
1237
1254
|
id: "_id"
|
|
@@ -1260,8 +1277,8 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1260
1277
|
{
|
|
1261
1278
|
accessorKey: "collection_CREDIT_0_balance",
|
|
1262
1279
|
accessorFn: (s) => {
|
|
1263
|
-
var
|
|
1264
|
-
return X(((
|
|
1280
|
+
var c, C, F;
|
|
1281
|
+
return X(((F = (C = (c = s.collection) == null ? void 0 : c.CREDIT) == null ? void 0 : C[0]) == null ? void 0 : F.balance) ?? 0, 2);
|
|
1265
1282
|
},
|
|
1266
1283
|
header: "Credit(s)",
|
|
1267
1284
|
enableSorting: !0
|
|
@@ -1269,8 +1286,8 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1269
1286
|
{
|
|
1270
1287
|
accessorKey: "collection_POINT_0_balance",
|
|
1271
1288
|
accessorFn: (s) => {
|
|
1272
|
-
var
|
|
1273
|
-
return X(((
|
|
1289
|
+
var c, C, F;
|
|
1290
|
+
return X(((F = (C = (c = s.collection) == null ? void 0 : c.POINT) == null ? void 0 : C[0]) == null ? void 0 : F.balance) ?? 0, 2);
|
|
1274
1291
|
},
|
|
1275
1292
|
header: "Experience(s)",
|
|
1276
1293
|
enableSorting: !0
|
|
@@ -1278,16 +1295,16 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1278
1295
|
{
|
|
1279
1296
|
accessorKey: "collection_COIN_0_balance",
|
|
1280
1297
|
accessorFn: (s) => {
|
|
1281
|
-
var
|
|
1282
|
-
return X(((
|
|
1298
|
+
var c, C, F;
|
|
1299
|
+
return X(((F = (C = (c = s.collection) == null ? void 0 : c.COIN) == null ? void 0 : C[0]) == null ? void 0 : F.balance) ?? 0, 2);
|
|
1283
1300
|
},
|
|
1284
1301
|
header: "Point(s)",
|
|
1285
1302
|
enableSorting: !0
|
|
1286
1303
|
},
|
|
1287
1304
|
{
|
|
1288
1305
|
accessorFn: (s) => {
|
|
1289
|
-
var
|
|
1290
|
-
return ((
|
|
1306
|
+
var c;
|
|
1307
|
+
return ((c = s.stats) == null ? void 0 : c.visitCount) ?? 0;
|
|
1291
1308
|
},
|
|
1292
1309
|
header: "Total visit",
|
|
1293
1310
|
accessorKey: "stats.visitCount",
|
|
@@ -1295,30 +1312,30 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1295
1312
|
},
|
|
1296
1313
|
{
|
|
1297
1314
|
accessorFn: (s) => {
|
|
1298
|
-
var
|
|
1299
|
-
return (
|
|
1315
|
+
var c;
|
|
1316
|
+
return (c = s.stats) == null ? void 0 : c.lastVisit;
|
|
1300
1317
|
},
|
|
1301
|
-
sortingFn: (s,
|
|
1302
|
-
var
|
|
1303
|
-
return new Date((
|
|
1318
|
+
sortingFn: (s, c) => {
|
|
1319
|
+
var C, F;
|
|
1320
|
+
return new Date((C = s.original.stats) == null ? void 0 : C.lastVisit).getTime() - new Date((F = c.original.stats) == null ? void 0 : F.lastVisit).getTime();
|
|
1304
1321
|
},
|
|
1305
1322
|
id: "stats.lastVisit",
|
|
1306
1323
|
header: "Last visit",
|
|
1307
1324
|
cell(s) {
|
|
1308
|
-
var
|
|
1309
|
-
return
|
|
1310
|
-
|
|
1325
|
+
var c, C;
|
|
1326
|
+
return z("div", { class: "flex items-center justify-end gap-4" }, [
|
|
1327
|
+
z(
|
|
1311
1328
|
"span",
|
|
1312
|
-
(
|
|
1329
|
+
(c = s.row.original.stats) != null && c.lastVisit ? w((C = s.row.original.stats) == null ? void 0 : C.lastVisit).fromNow() : "NA"
|
|
1313
1330
|
),
|
|
1314
|
-
|
|
1315
|
-
|
|
1331
|
+
z(
|
|
1332
|
+
ge.FmTooltip,
|
|
1316
1333
|
{
|
|
1317
|
-
content:
|
|
1334
|
+
content: w(s.row.original.stats.lastVisit).format(
|
|
1318
1335
|
"D MMM YYYY - hh:mmA"
|
|
1319
1336
|
)
|
|
1320
1337
|
},
|
|
1321
|
-
[
|
|
1338
|
+
[z(ge.FmIcon, { name: "info", outline: !0, size: "sm" })]
|
|
1322
1339
|
)
|
|
1323
1340
|
]);
|
|
1324
1341
|
}
|
|
@@ -1326,21 +1343,21 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1326
1343
|
{
|
|
1327
1344
|
id: "actions",
|
|
1328
1345
|
cell(s) {
|
|
1329
|
-
return
|
|
1330
|
-
|
|
1346
|
+
return z(
|
|
1347
|
+
ge.FmMenu,
|
|
1331
1348
|
{
|
|
1332
1349
|
placement: "bottom-end",
|
|
1333
|
-
onClick: (
|
|
1334
|
-
|
|
1350
|
+
onClick: (c) => {
|
|
1351
|
+
c.stopPropagation();
|
|
1335
1352
|
}
|
|
1336
1353
|
},
|
|
1337
1354
|
{
|
|
1338
|
-
"menu-button": () =>
|
|
1355
|
+
"menu-button": () => z(ge.FmButton, { icon: "more_vert", variant: "tertiary" }),
|
|
1339
1356
|
default: () => [
|
|
1340
|
-
|
|
1357
|
+
z(ge.FmMenuItem, {
|
|
1341
1358
|
label: "Transaction details",
|
|
1342
|
-
onClick: async (
|
|
1343
|
-
|
|
1359
|
+
onClick: async (c) => {
|
|
1360
|
+
c.stopPropagation(), await H(s.row.original._id);
|
|
1344
1361
|
}
|
|
1345
1362
|
})
|
|
1346
1363
|
]
|
|
@@ -1348,16 +1365,16 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1348
1365
|
);
|
|
1349
1366
|
}
|
|
1350
1367
|
}
|
|
1351
|
-
], { tableMeta:
|
|
1368
|
+
], { tableMeta: x, rowData: T, onSort: _, debouncedFetchData: p, onSearch: Y } = qe(le.read), G = Q(), Z = Q(!1), K = Q(), be = j(() => u.locations.map((s) => ({
|
|
1352
1369
|
label: s.name,
|
|
1353
1370
|
value: s._id
|
|
1354
1371
|
})));
|
|
1355
1372
|
async function ne() {
|
|
1356
|
-
|
|
1357
|
-
|
|
1373
|
+
K.value = await le.readById(
|
|
1374
|
+
K.value._id.toString()
|
|
1358
1375
|
), Z.value = !0;
|
|
1359
1376
|
}
|
|
1360
|
-
async function
|
|
1377
|
+
async function ae() {
|
|
1361
1378
|
await p(), Z.value = !1;
|
|
1362
1379
|
}
|
|
1363
1380
|
async function H(s) {
|
|
@@ -1374,31 +1391,31 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1374
1391
|
rowsNumber: 0
|
|
1375
1392
|
};
|
|
1376
1393
|
function d(s) {
|
|
1377
|
-
const
|
|
1378
|
-
return
|
|
1394
|
+
const c = w(s);
|
|
1395
|
+
return c.isValid() ? c.format("DD/MM/YYYY") : "";
|
|
1379
1396
|
}
|
|
1380
|
-
async function
|
|
1381
|
-
const s = new ut(),
|
|
1397
|
+
async function M() {
|
|
1398
|
+
const s = new ut(), c = (await le.read({
|
|
1382
1399
|
limit: 1,
|
|
1383
1400
|
skip: 0,
|
|
1384
1401
|
sortBy: m.sortBy,
|
|
1385
1402
|
descending: m.descending
|
|
1386
|
-
})).meta.totalResources ?? 0,
|
|
1387
|
-
await
|
|
1403
|
+
})).meta.totalResources ?? 0, C = m.rowsPerPage;
|
|
1404
|
+
await r(
|
|
1388
1405
|
async () => {
|
|
1389
|
-
var
|
|
1390
|
-
for (let Ne = 0; Ne <
|
|
1406
|
+
var F, O, N, D, ee, se, k, P, o, e, i, S, $, R, re, ce, fe, g, B, te, U, de, me, ue, W, J, Ee, $e;
|
|
1407
|
+
for (let Ne = 0; Ne < c; Ne += C) {
|
|
1391
1408
|
const Ze = {
|
|
1392
1409
|
...m,
|
|
1393
|
-
limit:
|
|
1410
|
+
limit: C,
|
|
1394
1411
|
skip: m.page - 1,
|
|
1395
1412
|
sortBy: m.sortBy,
|
|
1396
1413
|
descending: m.descending
|
|
1397
1414
|
}, et = await le.read(Ze);
|
|
1398
|
-
for (const
|
|
1399
|
-
const tt = (
|
|
1400
|
-
|
|
1401
|
-
)) != null &&
|
|
1415
|
+
for (const l of et.resources) {
|
|
1416
|
+
const tt = (F = mt.parseOneAddress(
|
|
1417
|
+
l == null ? void 0 : l.email
|
|
1418
|
+
)) != null && F.domain.includes("feedmepos.com") ? void 0 : l.email, ot = (N = ((O = l == null ? void 0 : l.collection) == null ? void 0 : O.TITLE) || []) == null ? void 0 : N.reduce(
|
|
1402
1419
|
(oe, ye) => {
|
|
1403
1420
|
var _e, Ce;
|
|
1404
1421
|
const Se = (Ce = (_e = b.sortedTitles) == null ? void 0 : _e.find(
|
|
@@ -1410,48 +1427,48 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1410
1427
|
), nt = (b.sortedTitles || []).reduce(
|
|
1411
1428
|
(oe, ye) => {
|
|
1412
1429
|
var _e, Ce, we, Be;
|
|
1413
|
-
const Se = (Be = (we = (Ce = (((_e =
|
|
1430
|
+
const Se = (Be = (we = (Ce = (((_e = l == null ? void 0 : l.collection) == null ? void 0 : _e.TITLE) || []).find(
|
|
1414
1431
|
(rt) => rt.collectible === ye._id
|
|
1415
1432
|
)) == null ? void 0 : Ce.expiryBalance) == null ? void 0 : we[0]) == null ? void 0 : Be.expiredAt;
|
|
1416
|
-
return oe[ye.name] = Se ?
|
|
1433
|
+
return oe[ye.name] = Se ? w(Se).format("DD/MM/YYYY") : "", oe;
|
|
1417
1434
|
},
|
|
1418
1435
|
{}
|
|
1419
|
-
),
|
|
1436
|
+
), at = ((se = (ee = (D = l.collection) == null ? void 0 : D.CREDIT) == null ? void 0 : ee.at(0)) == null ? void 0 : se.balance) || 0, De = ((e = (o = (P = (k = l.collection) == null ? void 0 : k.CREDIT) == null ? void 0 : P.at(0)) == null ? void 0 : o.expiryBalance) == null ? void 0 : e.reduce(
|
|
1420
1437
|
(oe, ye) => oe + ye.amount,
|
|
1421
1438
|
0
|
|
1422
|
-
)) || 0, Pe = X(
|
|
1423
|
-
ID:
|
|
1424
|
-
Name: ((
|
|
1425
|
-
Phone: ((
|
|
1439
|
+
)) || 0, Pe = X(at, 2), st = {
|
|
1440
|
+
ID: l._id.toString(),
|
|
1441
|
+
Name: ((i = l.name) == null ? void 0 : i.trim()) || "",
|
|
1442
|
+
Phone: ((S = l == null ? void 0 : l.phoneNumber) == null ? void 0 : S.trim()) || "",
|
|
1426
1443
|
Email: tt || "",
|
|
1427
|
-
Gender:
|
|
1428
|
-
CardNo:
|
|
1429
|
-
Birthday:
|
|
1444
|
+
Gender: l.gender || "",
|
|
1445
|
+
CardNo: l.cardNo || "",
|
|
1446
|
+
Birthday: l != null && l.birthday ? d(l == null ? void 0 : l.birthday) : "",
|
|
1430
1447
|
Credit: (Number(Pe) - Number(De)).toFixed(2),
|
|
1431
1448
|
FreeCredit: Number(De.toFixed(2)),
|
|
1432
1449
|
TotalCredit: Number(Pe),
|
|
1433
|
-
Exp:
|
|
1434
|
-
Point:
|
|
1435
|
-
Level:
|
|
1436
|
-
Tier:
|
|
1450
|
+
Exp: l != null && l.collection ? ((re = (R = ($ = l.collection) == null ? void 0 : $.POINT) == null ? void 0 : R.at(0)) == null ? void 0 : re.balance) ?? 0 : 0,
|
|
1451
|
+
Point: l != null && l.collection ? ((g = (fe = (ce = l.collection) == null ? void 0 : ce.COIN) == null ? void 0 : fe.at(0)) == null ? void 0 : g.balance) ?? 0 : 0,
|
|
1452
|
+
Level: l != null && l.collection ? ((U = (te = (B = l.collection) == null ? void 0 : B.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : U.balance) ?? 0 : 0,
|
|
1453
|
+
Tier: l != null && l.collection ? ((ue = (me = (de = l.collection) == null ? void 0 : de.TIER) == null ? void 0 : me.at(0)) == null ? void 0 : ue.balance) ?? 0 : 0,
|
|
1437
1454
|
Titles: ot.join(","),
|
|
1438
1455
|
...nt,
|
|
1439
|
-
TotalTransaction:
|
|
1440
|
-
AvgSpent: At(Number(
|
|
1456
|
+
TotalTransaction: l.stats.visitCount,
|
|
1457
|
+
AvgSpent: At(Number(l.stats.avgBillSize || 0)).toFormat(
|
|
1441
1458
|
!1
|
|
1442
1459
|
),
|
|
1443
|
-
TotalSpent:
|
|
1444
|
-
LastVisit: d(
|
|
1445
|
-
Feedback: ((W =
|
|
1446
|
-
LastSeasonTierEarned: ((J =
|
|
1447
|
-
LastSeasonPointEarned: ((Ee =
|
|
1448
|
-
JoinedAt: d(
|
|
1449
|
-
JoinedAtLocation:
|
|
1460
|
+
TotalSpent: l.stats.avgBillSize * l.stats.visitCount,
|
|
1461
|
+
LastVisit: d(l.stats.lastVisit),
|
|
1462
|
+
Feedback: ((W = l.stats) == null ? void 0 : W.feedbackCount) || 0,
|
|
1463
|
+
LastSeasonTierEarned: ((J = l.stats) == null ? void 0 : J.lastSeasonTierEarned) || 0,
|
|
1464
|
+
LastSeasonPointEarned: ((Ee = l.stats) == null ? void 0 : Ee.lastSeasonPointEarned) || 0,
|
|
1465
|
+
JoinedAt: d(l.joinAt || void 0),
|
|
1466
|
+
JoinedAtLocation: l.location && (($e = be.value.find((oe) => oe.value == l.location)) == null ? void 0 : $e.label) || "-",
|
|
1450
1467
|
VisitFrequency: `${Number(
|
|
1451
|
-
Math.ceil(
|
|
1468
|
+
Math.ceil(l.stats.avgVisitFrequency).toFixed(0)
|
|
1452
1469
|
)}`
|
|
1453
1470
|
};
|
|
1454
|
-
s.addRecord(
|
|
1471
|
+
s.addRecord(st);
|
|
1455
1472
|
}
|
|
1456
1473
|
m.page++;
|
|
1457
1474
|
}
|
|
@@ -1473,24 +1490,24 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1473
1490
|
}
|
|
1474
1491
|
return je(async () => {
|
|
1475
1492
|
await b.readMembership(), await u.readLocations(), await V.read(), await u.readLocations(), await p();
|
|
1476
|
-
}), (s,
|
|
1477
|
-
const
|
|
1478
|
-
return f(),
|
|
1493
|
+
}), (s, c) => {
|
|
1494
|
+
const C = I("FmSearch"), F = I("FmButton"), O = I("FmSnackbar");
|
|
1495
|
+
return f(), A("div", null, [
|
|
1479
1496
|
n("div", Uo, [
|
|
1480
|
-
v(
|
|
1497
|
+
v(C, {
|
|
1481
1498
|
class: "mt-4",
|
|
1482
|
-
modelValue: t(
|
|
1499
|
+
modelValue: t(x).searchValue,
|
|
1483
1500
|
"onUpdate:modelValue": [
|
|
1484
|
-
|
|
1501
|
+
c[0] || (c[0] = (N) => t(x).searchValue = N),
|
|
1485
1502
|
t(Y)
|
|
1486
1503
|
],
|
|
1487
1504
|
placeholder: "Search",
|
|
1488
1505
|
collapsible: ""
|
|
1489
1506
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1490
|
-
v(
|
|
1507
|
+
v(F, {
|
|
1491
1508
|
icon: "ios_share",
|
|
1492
1509
|
variant: "tertiary",
|
|
1493
|
-
onClick:
|
|
1510
|
+
onClick: M
|
|
1494
1511
|
})
|
|
1495
1512
|
]),
|
|
1496
1513
|
Le(v(O, {
|
|
@@ -1500,39 +1517,39 @@ const $t = { class: "flex flex-col" }, Nt = { key: 1 }, Dt = { class: "flex flex
|
|
|
1500
1517
|
description: "Current list is not up to date, please refresh table for latest data.",
|
|
1501
1518
|
variant: "info",
|
|
1502
1519
|
dismissable: "",
|
|
1503
|
-
onOnDismiss:
|
|
1520
|
+
onOnDismiss: c[1] || (c[1] = (N) => Z.value = !1),
|
|
1504
1521
|
action: "Refresh",
|
|
1505
|
-
onOnAction:
|
|
1522
|
+
onOnAction: ae
|
|
1506
1523
|
}, null, 512), [
|
|
1507
1524
|
[ze, t(Z)]
|
|
1508
1525
|
]),
|
|
1509
|
-
v(
|
|
1510
|
-
loading: t(
|
|
1526
|
+
v(Ge, {
|
|
1527
|
+
loading: t(x).isLoading,
|
|
1511
1528
|
"row-data": t(T),
|
|
1512
|
-
"row-count": t(
|
|
1513
|
-
"column-defs":
|
|
1529
|
+
"row-count": t(x).totalRows,
|
|
1530
|
+
"column-defs": h,
|
|
1514
1531
|
"shrink-at": !1,
|
|
1515
|
-
"page-count": t(
|
|
1516
|
-
"page-index": t(
|
|
1517
|
-
"page-size": t(
|
|
1518
|
-
onSortChange: t(
|
|
1519
|
-
onPageChange:
|
|
1520
|
-
onRowClick:
|
|
1532
|
+
"page-count": t(x).pageCount,
|
|
1533
|
+
"page-index": t(x).pageIndex,
|
|
1534
|
+
"page-size": t(x).pageSize,
|
|
1535
|
+
onSortChange: t(_),
|
|
1536
|
+
onPageChange: c[2] || (c[2] = (N) => t(p)({ pageSize: N.pageSize, pageIndex: N.pageIndex })),
|
|
1537
|
+
onRowClick: c[3] || (c[3] = (N) => {
|
|
1521
1538
|
var D;
|
|
1522
|
-
|
|
1539
|
+
K.value = N.original, (D = t(G)) == null || D.showSheet();
|
|
1523
1540
|
})
|
|
1524
1541
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
1525
|
-
t(
|
|
1542
|
+
t(K) ? (f(), q(Ro, {
|
|
1526
1543
|
key: 0,
|
|
1527
1544
|
ref_key: "sheetRef",
|
|
1528
|
-
ref:
|
|
1529
|
-
member: t(
|
|
1545
|
+
ref: G,
|
|
1546
|
+
member: t(K),
|
|
1530
1547
|
"onUpdate:member": ne
|
|
1531
|
-
}, null, 8, ["member"])) :
|
|
1548
|
+
}, null, 8, ["member"])) : xe("", !0)
|
|
1532
1549
|
]);
|
|
1533
1550
|
};
|
|
1534
1551
|
}
|
|
1535
1552
|
});
|
|
1536
1553
|
export {
|
|
1537
|
-
|
|
1554
|
+
Sn as default
|
|
1538
1555
|
};
|