@feedmepos/mf-connect 0.1.124-dev → 0.1.124-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-C7BnLHSt.js → App-DMh2xABv.js} +493 -502
- package/dist/{Bin-Bq7yY0I2.js → Bin-C_pkPgIo.js} +8 -8
- package/dist/{Broadcast-D52rPmVl.js → Broadcast-6ZJzdY0b.js} +21 -22
- package/dist/{CampaignAnalytic-DpiWtzIp.js → CampaignAnalytic-CLd5ecQe.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1eAAN64.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C4OWhhAx.js} +9 -8
- package/dist/{Card-BQc7vud2.js → Card-CkS8F43U.js} +22 -22
- package/dist/{Collections--VzkneGp.js → Collections-BA9I-dDz.js} +185 -197
- package/dist/{Credit-DhfAcw-p.js → Credit-CXm0A-qe.js} +20 -21
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-D2Csdg-3.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DzsHTlrN.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C5INV6R7.js +3493 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Cr2_XbyY.js → EffectSheet.vue_vue_type_style_index_0_lang-zSPUBUSz.js} +16 -16
- package/dist/{Experience-CUwbHfo5.js → Experience-Bq4ykqTJ.js} +31 -32
- package/dist/{FileSaver.min-DvZpiwMd.js → FileSaver.min-BtBxrIBi.js} +1 -1
- package/dist/{Game-CI5-y0JJ.js → Game-DpLFmP-G.js} +18 -19
- package/dist/{GiftCardSetup-CGacqQ0j.js → GiftCardSetup-BqOqEUim.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B6POxDLJ.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-B06xj5q7.js} +7 -7
- package/dist/{Goals-fqJY9iMx.js → Goals-DMlNeiUc.js} +4 -4
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DTKf7uR-.js → ImageInput.vue_vue_type_script_setup_true_lang-DPWRgxG_.js} +1 -1
- package/dist/{Index-CT1Gnjsv.js → Index-Cw07jj0k.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BRQ12Yum.js → LocationPicker.vue_vue_type_script_setup_true_lang-CLjjquVP.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BRzuWJ1Y.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DHOShJQp.js} +1 -1
- package/dist/{LoyaltyDashboard-IJIDEBWf.js → LoyaltyDashboard-DzSiK6M7.js} +15 -15
- package/dist/{MainLayout-BMghr-wf.js → MainLayout-1EF680_j.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BitJKgvd.js → MainLayout.vue_vue_type_script_setup_true_lang-Df9pBgH9.js} +3 -3
- package/dist/{Marketing-Ckr9cp3w.js → Marketing-T-epFsvG.js} +4 -4
- package/dist/{MarketingMaterialEdit-BIZnE8CY.js → MarketingMaterialEdit-CVhPfyEp.js} +211 -214
- package/dist/{Member-d1nPxr74.js → Member-BUZOPyQR.js} +7 -7
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-zURjtl1z.js +1308 -0
- package/dist/{MemberImportHistory-CxX9iYhV.js → MemberImportHistory-DGz9i6L7.js} +7 -7
- package/dist/{MemberList-DUzYpxhj.js → MemberList-CNdSrzBa.js} +105 -103
- package/dist/{MemberTransactions-BFM3ybeo.js → MemberTransactions-CdQMuQsd.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B5j0YBix.js → MessageInput.vue_vue_type_script_setup_true_lang-CWKVXeCa.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DsSHSbBB.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-xZitIoXE.js} +1 -1
- package/dist/{Mission-De9BF5wb.js → Mission-CYxgMBPt.js} +21 -22
- package/dist/{Overview-Pmxqv6qp.js → Overview-DSm8AfDB.js} +20 -20
- package/dist/{Overview-DeHo3gef.js → Overview-qZ1KKw9D.js} +144 -145
- package/dist/{Point-DE_Cc85N.js → Point-BGlbT9OK.js} +21 -22
- package/dist/{Promotion-cZDzgho4.js → Promotion-CtlrUFa8.js} +131 -137
- package/dist/{Queue-DmDbrtTk.js → Queue-Dc_z9MKc.js} +45 -45
- package/dist/{Record-uxNNOvmK.js → Record-DVKrhFwJ.js} +9 -9
- package/dist/{Review-CIIn_Bdx.js → Review-Bh8Tw_QU.js} +2 -2
- package/dist/ReviewFacebookCallback-ZZ0pxplM.js +238 -0
- package/dist/{ReviewGoogleCallback-B7kmGwb_.js → ReviewGoogleCallback-CsSCz_C5.js} +5 -5
- package/dist/{Reward-Bj1snFu8.js → Reward-DY1Q3m1w.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BO-36dE4.js → RewardGroup.vue_vue_type_script_setup_true_lang-4A91EkSW.js} +13 -13
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-JA0XIgqb.js +1884 -0
- package/dist/{Segment-BgJgWa6C.js → Segment-D6LchJFl.js} +306 -303
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-D2TDoZgQ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CSAtkMnJ.js} +14 -14
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CEBH11hR.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Co1MQoVq.js} +4 -4
- package/dist/Setting-UkdSKiUb.js +578 -0
- package/dist/{SettingAdvertisements-vdUtIXwC.js → SettingAdvertisements-DK97gcus.js} +12 -12
- package/dist/Settings-BFcVswDS.js +179 -0
- package/dist/{Store-DgltT0RA.js → Store-2VVStL5_.js} +28 -28
- package/dist/{StoreRewards-BXH_5cYL.js → StoreRewards-f3Pyb9hu.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BmnyPSVT.js +1297 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CCWNzg4p.js +142 -0
- package/dist/{Tier-CqfHGUX0.js → Tier-D4Of9P17.js} +687 -2575
- package/dist/{Title-B5VnUNiS.js → Title-Cg6X9UkB.js} +94 -95
- package/dist/{Transaction-BZh1Q9Lj.js → Transaction-LJbjQnj_.js} +2 -2
- package/dist/Upselling-B-VwbtjT.js +214 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Buj7CRlQ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DqH6Upx-.js} +26 -26
- package/dist/{Voucher-CZJdV2Ok.js → Voucher-BJG6VKXt.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-65x2VrpD.js → VoucherEditor.vue_vue_type_script_setup_true_lang-7kYeJthi.js} +12 -12
- package/dist/{WhatsappAccount-DsRilNC5.js → WhatsappAccount-Dc1fJWWj.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Bn26qwx5.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BV0Bsl7a.js} +1 -1
- package/dist/{WhatsappBot-CpzMaTss.js → WhatsappBot-Coq1WP96.js} +6 -6
- package/dist/{WhatsappBotLogs-DRF8VufQ.js → WhatsappBotLogs-EH9PQVn9.js} +6 -6
- package/dist/{WhatsappBotSettings-DSUPGC-p.js → WhatsappBotSettings-fNRFecJX.js} +4 -4
- package/dist/{WhatsappLayout-BCWYcQmD.js → WhatsappLayout-x9Ovpu6e.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DyxyISRP.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DZlT0uLW.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Db-Z7cY_.js → ZodTextField.vue_vue_type_script_setup_true_lang-DSJncfI_.js} +2 -2
- package/dist/{app-BQeODViN.js → app-BMFxxLUm.js} +15017 -14861
- package/dist/app.js +3 -4
- package/dist/{base.export-kSFLDDoC.js → base.export-LmQ51u5f.js} +2 -2
- package/dist/{business-EP-Do3Ew.js → business-DZWViiMC.js} +1 -1
- package/dist/{campaign-BjnUPowX.js → campaign-C9xvGyrL.js} +28 -34
- package/dist/{campaign-C8GgaCub.js → campaign-DZDGbR4W.js} +94 -121
- package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
- package/dist/{campaign.fn-DQ--gL4B.js → campaign.fn-OVkj0QLu.js} +87 -87
- package/dist/{collection.fn-BhXecwh5.js → collection.fn-DrNrla0B.js} +2 -2
- package/dist/{currency-CGMNh1Q_.js → currency-BZv2gSlF.js} +1 -1
- package/dist/{effect-Bc6oGIWd.js → effect-CvumfBMY.js} +1 -1
- package/dist/{email-addresses-B3KWfUMk.js → email-addresses-79tPeI4j.js} +25 -25
- package/dist/{feature-flag-HhjvSuDm.js → feature-flag-CYXnrECh.js} +185 -171
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-D1BYvcED.js → helper-DFjsyjri.js} +1 -1
- package/dist/{index-GQv1_jaJ.js → index-B_8PAyia.js} +2 -2
- package/dist/{index-C-46QHFh.js → index-Ba1t5vQv.js} +234 -380
- package/dist/{index-Yw4M7v7m.js → index-BiPRZRyE.js} +2614 -2699
- package/dist/{index-BkevK_Hp.js → index-Bnane9cm.js} +1 -1
- package/dist/{index-VLFerh-X.js → index-Bt-n8QuD.js} +10 -10
- package/dist/{index-VyoufKYY.js → index-C-pVo6PI.js} +1 -1
- package/dist/{index-CsYTLmPa.js → index-C43KoLej.js} +4 -4
- package/dist/{index-DeqpfWLa.js → index-C5bC2n8X.js} +3 -3
- package/dist/{index-Br2SLVsn.js → index-C6Rx7pjc.js} +251 -608
- package/dist/{index-BIBcfAw5.js → index-C6ZTa-eq.js} +1 -1
- package/dist/{index-gMrtUwSD.js → index-CA7oIW_T.js} +316 -316
- package/dist/{index-Bunp1bt_.js → index-CAWnce4u.js} +1 -1
- package/dist/{index-cPPWotJe.js → index-CBd91xYU.js} +10 -10
- package/dist/{index-C3MK8Twg.js → index-CNzQ3FLi.js} +1 -1
- package/dist/{index-Ptcqv0W6.js → index-CW4rNV1_.js} +2 -2
- package/dist/{index-DOSuhtdE.js → index-CcCiEG6N.js} +1 -1
- package/dist/{index-DiCgGQoC.js → index-DWZzsJHU.js} +2 -2
- package/dist/{index-oIo5Cful.js → index-DZrX13oF.js} +462 -533
- package/dist/{index-D2TnjKPP.js → index-MhAbTpBy.js} +23 -23
- package/dist/{index-DCC3pLug.js → index-_-nCOZ1D.js} +6 -19
- package/dist/{index.esm2017-DUZpLdEB.js → index.esm2017-DtTjnHHc.js} +57 -57
- package/dist/{loading-DhpcQgdj.js → loading-DkqEFbrR.js} +1 -1
- package/dist/{lodash-r4AR7GJC.js → lodash-BxU_5gPB.js} +1 -1
- package/dist/{member-import-CogEef9H.js → member-import-B3NBqSF6.js} +1 -1
- package/dist/{membership-BQFkjRjs.js → membership-Dr5BxoL-.js} +2 -2
- package/dist/{money-Ifqd4pyC.js → money-D58xuACG.js} +1 -1
- package/dist/{number-C9Tw_Ncm.js → number-C9CiD5ci.js} +1 -1
- package/dist/objectid-CgTtbB6Q.js +145 -0
- package/dist/{onboarding-D4dm_rxU.js → onboarding-BssUSfGQ.js} +36 -36
- package/dist/{onboardingSetup-DtNZUoRr.js → onboardingSetup-Dc_lD-K8.js} +2 -2
- package/dist/{plugins-DGI9Fkiu.js → plugins-D7Xjefvk.js} +3 -3
- package/dist/{reward-DTtejZqM.js → reward-CACqYkQp.js} +1 -1
- package/dist/{rule-C4N3ce3c.js → rule-BRaTrwKz.js} +492 -572
- package/dist/rule-builder-DZOASGFD.js +102 -0
- package/dist/style.css +1 -1
- package/dist/template-DdeVPIBt.js +275 -0
- package/dist/{timezone-5rYhX7XZ.js → timezone-CgVEOC5i.js} +1 -1
- package/dist/{transaction.fn-Ba_U7HdT.js → transaction.fn-C64l_ja_.js} +2 -2
- package/dist/{trigger-B8I1aO6Y.js → trigger-d2RIqXLt.js} +9 -9
- package/dist/{useMarketingMaterialActions-CTOFHmlL.js → useMarketingMaterialActions-Drf2MY9h.js} +4 -4
- package/dist/{usePagination-3wAPVCOp.js → usePagination-IUw34YLE.js} +1 -1
- package/dist/{user-Ds4DW_-Y.js → user-ClGyYHyS.js} +1 -1
- package/dist/vue-i18n-Cby9s0nj.js +2365 -0
- package/dist/{xlsx-xlOCvuAq.js → xlsx-HvtVSofi.js} +166 -166
- package/dist/{zod-GVNjvrpT.js → zod-IPdjFU_b.js} +1 -1
- package/package.json +2 -6
- package/dist/AuditLogs-BPKQdFga.js +0 -2016
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DFz_2GZ1.js +0 -4439
- package/dist/Grab-CAx1cCE4.js +0 -301
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DI4XM_rJ.js +0 -1281
- package/dist/ReviewFacebookCallback-CO6FxHzc.js +0 -225
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-b7ZEMd4s.js +0 -1923
- package/dist/Setting-DpEI72mW.js +0 -574
- package/dist/Settings-C6yJ1WEB.js +0 -286
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DqlluwMB.js +0 -1319
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DjCO9U0c.js +0 -7007
- package/dist/Upselling-Cf24ub-9.js +0 -1055
- package/dist/duplicateCampaign-icqF8Na9.js +0 -51
- package/dist/google-BQK68wbe.js +0 -5
- package/dist/objectid-D7dqM1a3.js +0 -145
- package/dist/template-YhWRyNGp.js +0 -227
- package/dist/vue-i18n-Bqlt_-jA.js +0 -2365
|
@@ -1,1281 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ae, computed as O, ref as L, resolveComponent as A, openBlock as i, createElementBlock as w, Fragment as Y, createElementVNode as r, unref as t, createBlock as I, createCommentVNode as oe, createVNode as g, renderList as Q, withCtx as se, createTextVNode as ye, toDisplayString as M, withDirectives as Ee, vShow as Ve, watch as Te, onBeforeMount as Ie, h as le, onMounted as Be, isRef as De, normalizeClass as Ye } from "vue";
|
|
2
|
-
import { h } from "./moment-D7p2TMB-.js";
|
|
3
|
-
import { c as Ue } from "./index-cPPWotJe.js";
|
|
4
|
-
import { u as $e, C as Se, s as Ne } from "./membership-BQFkjRjs.js";
|
|
5
|
-
import { useDialog as Ce, components as we } from "@feedmepos/ui-library";
|
|
6
|
-
import { _ as Fe } from "./lodash-r4AR7GJC.js";
|
|
7
|
-
import { D as Oe } from "./type_drinks-D6jnpvwV.js";
|
|
8
|
-
import { d as Pe, e as Re, f as je, g as Le, h as qe } from "./index-oIo5Cful.js";
|
|
9
|
-
import "./index-DeqpfWLa.js";
|
|
10
|
-
import { c as Me, f as ke } from "./string-Gcy5IM_H.js";
|
|
11
|
-
import { u as ze } from "./loading-DhpcQgdj.js";
|
|
12
|
-
import { p as Ae } from "./plugins-DGI9Fkiu.js";
|
|
13
|
-
import { C as _e } from "./collection.fn-BhXecwh5.js";
|
|
14
|
-
import { u as Ge } from "./business-EP-Do3Ew.js";
|
|
15
|
-
import { defineStore as He } from "pinia";
|
|
16
|
-
import { f as te } from "./number-C9Tw_Ncm.js";
|
|
17
|
-
import "./index-Br2SLVsn.js";
|
|
18
|
-
import "./index-Yw4M7v7m.js";
|
|
19
|
-
import "./index-C-46QHFh.js";
|
|
20
|
-
import "./index-Ptcqv0W6.js";
|
|
21
|
-
import "./index-I9lmcd2w.js";
|
|
22
|
-
import "./index-DOSuhtdE.js";
|
|
23
|
-
import "./index-BkevK_Hp.js";
|
|
24
|
-
import { s as Ke } from "./index-CuvNtC_M.js";
|
|
25
|
-
import { u as We, _ as Xe } from "./usePagination-3wAPVCOp.js";
|
|
26
|
-
import { B as Je, e as Qe } from "./base.export-kSFLDDoC.js";
|
|
27
|
-
import { m as ve } from "./index-DCC3pLug.js";
|
|
28
|
-
import { o as ge } from "./objectId-dwaoBfJX.js";
|
|
29
|
-
import { F as he } from "./collectible.enum-Liy2wH3s.js";
|
|
30
|
-
import { a as Ze, c as et } from "./campaign-C8GgaCub.js";
|
|
31
|
-
import { useRouter as tt } from "vue-router";
|
|
32
|
-
import { m as fe } from "./index-DiCgGQoC.js";
|
|
33
|
-
import { t as ot } from "./index-D2TnjKPP.js";
|
|
34
|
-
import { R as rt } from "./app-BQeODViN.js";
|
|
35
|
-
const nt = { class: "flex flex-col" }, st = { key: 1 }, lt = { class: "flex flex-nowrap gap-4 items-center my-[-4px]" }, at = { class: "flex flex-nowrap gap-8 items-center pt-24 w-full" }, it = /* @__PURE__ */ ae({
|
|
36
|
-
__name: "MemberStatsDialog",
|
|
37
|
-
props: {
|
|
38
|
-
member: {
|
|
39
|
-
type: Object,
|
|
40
|
-
required: !0
|
|
41
|
-
},
|
|
42
|
-
onSubmit: {
|
|
43
|
-
type: Function,
|
|
44
|
-
required: !0
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
setup(m) {
|
|
48
|
-
var ie, re, q, ne;
|
|
49
|
-
const F = Ce(), f = $e(), y = m, s = O(
|
|
50
|
-
() => {
|
|
51
|
-
var p;
|
|
52
|
-
return (((p = y.member.collection) == null ? void 0 : p.TITLE) ?? []).reduce(
|
|
53
|
-
(l, S) => {
|
|
54
|
-
var P, z, N, D, H;
|
|
55
|
-
const _ = f.sortedTitles.find(
|
|
56
|
-
(Z) => Z._id.toString() === S.collectible
|
|
57
|
-
);
|
|
58
|
-
if (!_) return l;
|
|
59
|
-
const B = [...S.expiryBalance ?? []].sort(
|
|
60
|
-
(Z, R) => h(Z.expiredAt).isAfter(h(R.expiredAt)) ? -1 : 1
|
|
61
|
-
);
|
|
62
|
-
return (P = B[0]) != null && P.expiredAt && h((z = B[0]) == null ? void 0 : z.expiredAt).isBefore(h()) || l.push({
|
|
63
|
-
_id: _._id,
|
|
64
|
-
name: _.name,
|
|
65
|
-
expiredAt: (N = B[0]) != null && N.expiredAt ? h((D = B[0]) == null ? void 0 : D.expiredAt).toISOString() : "",
|
|
66
|
-
expiresIn: h((H = B[0]) == null ? void 0 : H.expiredAt).diff(h(), "days")
|
|
67
|
-
}), l;
|
|
68
|
-
},
|
|
69
|
-
[]
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
), o = L({
|
|
73
|
-
cardNo: y.member.cardNo,
|
|
74
|
-
experience: ((re = (ie = y.member.collection) == null ? void 0 : ie.POINT) == null ? void 0 : re[0].balance) ?? 0,
|
|
75
|
-
tier: ((ne = (q = y.member.collection) == null ? void 0 : q.TIER) == null ? void 0 : ne[0].balance) ?? -1,
|
|
76
|
-
titles: s.value.map((p) => ({ expiredAt: p.expiresIn, id: p._id })) ?? void 0
|
|
77
|
-
}), u = O(
|
|
78
|
-
() => (f.sortedTitles ?? []).map((p) => ({
|
|
79
|
-
label: p.name,
|
|
80
|
-
value: p._id.toString(),
|
|
81
|
-
sublabel: s.value.some((l) => l._id === p._id) ? "Owned" : void 0
|
|
82
|
-
}))
|
|
83
|
-
), d = O(() => (f.sortedTiers ?? []).map((p, l) => ({
|
|
84
|
-
label: p.name,
|
|
85
|
-
sublabel: `${p.option.from} - ${p.option.to}`,
|
|
86
|
-
from: p.option.from,
|
|
87
|
-
to: p.option.to,
|
|
88
|
-
value: l + 1
|
|
89
|
-
})));
|
|
90
|
-
function x() {
|
|
91
|
-
var S, _;
|
|
92
|
-
const p = ((S = d.value[(o.value.tier ?? 1) - 1]) == null ? void 0 : S.from) ?? 0, l = (_ = d.value[(o.value.tier ?? 1) - 1]) == null ? void 0 : _.to;
|
|
93
|
-
o.value.experience = Math.min(
|
|
94
|
-
l ?? p,
|
|
95
|
-
Math.max(p, o.value.experience ?? 0)
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
const a = O(() => {
|
|
99
|
-
var S, _, B, P, z, N;
|
|
100
|
-
const p = ((_ = (S = y.member.collection) == null ? void 0 : S.TIER) == null ? void 0 : _[0].balance) ?? -1, l = ((P = (B = y.member.collection) == null ? void 0 : B.POINT) == null ? void 0 : P[0].balance) ?? 0;
|
|
101
|
-
if (p != o.value.tier) return !0;
|
|
102
|
-
if (o.value.experience && o.value.experience != l) {
|
|
103
|
-
const D = ((z = d.value[p - 1]) == null ? void 0 : z.from) ?? 0, H = ((N = d.value[p - 1]) == null ? void 0 : N.to) ?? 0;
|
|
104
|
-
if (o.value.experience < D || H && o.value.experience > H)
|
|
105
|
-
return !0;
|
|
106
|
-
}
|
|
107
|
-
return !1;
|
|
108
|
-
});
|
|
109
|
-
function b(p) {
|
|
110
|
-
var l;
|
|
111
|
-
return (l = s.value.find((S) => S._id === p)) == null ? void 0 : l.expiresIn;
|
|
112
|
-
}
|
|
113
|
-
const k = O(() => {
|
|
114
|
-
const p = Pe.safeParse(o.value);
|
|
115
|
-
return p.success ? void 0 : p.error.errors;
|
|
116
|
-
});
|
|
117
|
-
function $(p) {
|
|
118
|
-
var l, S;
|
|
119
|
-
return (S = (l = k.value) == null ? void 0 : l.find((_) => _.path.join(".") === p)) == null ? void 0 : S.message;
|
|
120
|
-
}
|
|
121
|
-
function G(p) {
|
|
122
|
-
var l;
|
|
123
|
-
return (l = k.value) == null ? void 0 : l.filter((S) => S.path.join(".").startsWith(p)).map((S) => S.message);
|
|
124
|
-
}
|
|
125
|
-
async function U() {
|
|
126
|
-
await y.onSubmit(o.value), F.close();
|
|
127
|
-
}
|
|
128
|
-
return (p, l) => {
|
|
129
|
-
var Z, R;
|
|
130
|
-
const S = A("FmSelect"), _ = A("FmStepperField"), B = A("FmTextField"), P = A("FmField"), z = A("FmFormGroup"), N = A("FmButton"), D = A("FmHelperText"), H = A("FmSpacer");
|
|
131
|
-
return i(), w(Y, null, [
|
|
132
|
-
r("div", nt, [
|
|
133
|
-
l[6] || (l[6] = r("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
|
|
134
|
-
t(d).length ? (i(), I(S, {
|
|
135
|
-
key: 0,
|
|
136
|
-
modelValue: t(o).tier,
|
|
137
|
-
"onUpdate:modelValue": [
|
|
138
|
-
l[0] || (l[0] = (C) => t(o).tier = C),
|
|
139
|
-
x
|
|
140
|
-
],
|
|
141
|
-
label: "Member Tier",
|
|
142
|
-
items: t(d),
|
|
143
|
-
"helper-text": $("tier"),
|
|
144
|
-
"helper-state": $("tier") ? "error" : void 0
|
|
145
|
-
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : oe("", !0),
|
|
146
|
-
g(_, {
|
|
147
|
-
"model-value": t(o).experience ?? 0,
|
|
148
|
-
"onUpdate:modelValue": l[1] || (l[1] = (C) => t(o).experience = C),
|
|
149
|
-
label: "Member Experience",
|
|
150
|
-
"max-fraction-digits": 0,
|
|
151
|
-
"helper-text": $("experience"),
|
|
152
|
-
"helper-state": $("experience") ? "error" : void 0
|
|
153
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
154
|
-
l[7] || (l[7] = r("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
|
|
155
|
-
g(B, {
|
|
156
|
-
modelValue: t(o).cardNo,
|
|
157
|
-
"onUpdate:modelValue": l[2] || (l[2] = (C) => t(o).cardNo = C),
|
|
158
|
-
label: "Card number",
|
|
159
|
-
"helper-text": $("cardNo"),
|
|
160
|
-
"helper-state": $("cardNo") ? "error" : void 0
|
|
161
|
-
}, null, 8, ["modelValue", "helper-text", "helper-state"]),
|
|
162
|
-
l[8] || (l[8] = r("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
|
|
163
|
-
(Z = t(o).titles) != null && Z.length ? (i(), w("div", st, [...l[5] || (l[5] = [
|
|
164
|
-
r("div", { class: "flex flex-nowrap gap-4 items-center" }, [
|
|
165
|
-
r("div", { class: "flex-1" }, "Title"),
|
|
166
|
-
r("div", { class: "flex-1" }, "Expires in days"),
|
|
167
|
-
r("div", { class: "w-24 h-1" })
|
|
168
|
-
], -1)
|
|
169
|
-
])])) : oe("", !0),
|
|
170
|
-
(i(!0), w(Y, null, Q(t(o).titles ?? [], (C, K) => (i(), w("div", { key: K }, [
|
|
171
|
-
r("div", lt, [
|
|
172
|
-
t(s).some((n) => n._id === C.id) ? (i(), I(z, {
|
|
173
|
-
key: 1,
|
|
174
|
-
"model-value": "",
|
|
175
|
-
class: "flex-1"
|
|
176
|
-
}, {
|
|
177
|
-
default: se(() => [
|
|
178
|
-
g(P, {
|
|
179
|
-
disabled: !0,
|
|
180
|
-
class: "text-fm-color-typo-secondary"
|
|
181
|
-
}, {
|
|
182
|
-
default: se(() => {
|
|
183
|
-
var n;
|
|
184
|
-
return [
|
|
185
|
-
ye(M((n = t(u).find((e) => e.value === C.id)) == null ? void 0 : n.label), 1)
|
|
186
|
-
];
|
|
187
|
-
}),
|
|
188
|
-
_: 2
|
|
189
|
-
}, 1024)
|
|
190
|
-
]),
|
|
191
|
-
_: 2
|
|
192
|
-
}, 1024)) : (i(), I(S, {
|
|
193
|
-
key: 0,
|
|
194
|
-
modelValue: C.id,
|
|
195
|
-
"onUpdate:modelValue": [(n) => C.id = n, (n) => C.expiredAt = b(n) ?? 1],
|
|
196
|
-
class: "flex-1",
|
|
197
|
-
items: t(u).filter(
|
|
198
|
-
(n) => {
|
|
199
|
-
var e;
|
|
200
|
-
return !((e = t(o).titles) != null && e.map((c) => c.id).includes(n.value)) || C.id === n.value;
|
|
201
|
-
}
|
|
202
|
-
)
|
|
203
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "items"])),
|
|
204
|
-
g(_, {
|
|
205
|
-
modelValue: C.expiredAt,
|
|
206
|
-
"onUpdate:modelValue": (n) => C.expiredAt = n,
|
|
207
|
-
class: "flex-1",
|
|
208
|
-
label: "",
|
|
209
|
-
"max-fraction-digits": 0,
|
|
210
|
-
min: 0,
|
|
211
|
-
max: 9999,
|
|
212
|
-
step: 1
|
|
213
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
214
|
-
g(N, {
|
|
215
|
-
class: "w-24 h-24",
|
|
216
|
-
icon: "close",
|
|
217
|
-
variant: "tertiary",
|
|
218
|
-
onClick: (n) => {
|
|
219
|
-
var e;
|
|
220
|
-
return (e = t(o).titles) == null ? void 0 : e.splice(K, 1);
|
|
221
|
-
}
|
|
222
|
-
}, null, 8, ["onClick"])
|
|
223
|
-
]),
|
|
224
|
-
(i(!0), w(Y, null, Q(G(`titles.${K}`), (n, e) => (i(), I(D, {
|
|
225
|
-
key: e,
|
|
226
|
-
class: "items-center",
|
|
227
|
-
state: "error",
|
|
228
|
-
text: n.toString()
|
|
229
|
-
}, null, 8, ["text"]))), 128))
|
|
230
|
-
]))), 128)),
|
|
231
|
-
t(u).length && (((R = t(o).titles) == null ? void 0 : R.length) ?? 0) < t(u).length ? (i(), I(N, {
|
|
232
|
-
key: 2,
|
|
233
|
-
icon: "add",
|
|
234
|
-
label: "Give title",
|
|
235
|
-
variant: "plain",
|
|
236
|
-
onClick: l[3] || (l[3] = (C) => {
|
|
237
|
-
var K;
|
|
238
|
-
return t(o).titles = [
|
|
239
|
-
...t(o).titles ?? [],
|
|
240
|
-
{
|
|
241
|
-
id: ((K = t(u).find(
|
|
242
|
-
(n) => {
|
|
243
|
-
var e;
|
|
244
|
-
return !((e = t(o).titles) != null && e.map((c) => c.id).includes(n.value));
|
|
245
|
-
}
|
|
246
|
-
)) == null ? void 0 : K.value) || t(u)[0].value,
|
|
247
|
-
expiredAt: 0
|
|
248
|
-
}
|
|
249
|
-
];
|
|
250
|
-
})
|
|
251
|
-
})) : oe("", !0)
|
|
252
|
-
]),
|
|
253
|
-
r("div", at, [
|
|
254
|
-
Ee(g(D, {
|
|
255
|
-
state: "warning",
|
|
256
|
-
text: "Updating member will cause tier to change"
|
|
257
|
-
}, null, 512), [
|
|
258
|
-
[Ve, t(a)]
|
|
259
|
-
]),
|
|
260
|
-
g(H),
|
|
261
|
-
g(N, {
|
|
262
|
-
variant: "secondary",
|
|
263
|
-
label: "Cancel",
|
|
264
|
-
size: "md",
|
|
265
|
-
onClick: l[4] || (l[4] = (C) => t(F).close())
|
|
266
|
-
}),
|
|
267
|
-
g(N, {
|
|
268
|
-
disabled: !!t(k),
|
|
269
|
-
variant: "primary",
|
|
270
|
-
label: "Submit",
|
|
271
|
-
size: "md",
|
|
272
|
-
onClick: U
|
|
273
|
-
}, null, 8, ["disabled"])
|
|
274
|
-
])
|
|
275
|
-
], 64);
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
}), mt = { class: "fm-typo-en-title-sm-800" }, dt = { class: "space-y-16" }, ct = { class: "flex flex-nowrap gap-8 items-center justify-end pt-24 w-full" }, ut = /* @__PURE__ */ ae({
|
|
279
|
-
__name: "CreditCoinDialog",
|
|
280
|
-
props: {
|
|
281
|
-
type: { type: String, required: !0 },
|
|
282
|
-
action: { type: String, required: !0 },
|
|
283
|
-
onSubmit: {
|
|
284
|
-
type: Function,
|
|
285
|
-
required: !0
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
setup(m) {
|
|
289
|
-
const F = Ce(), f = m, y = L({
|
|
290
|
-
amount: 1,
|
|
291
|
-
day: 1,
|
|
292
|
-
remark: void 0
|
|
293
|
-
}), s = L(!0), o = O(() => _e.formattedType(f.type.toUpperCase()));
|
|
294
|
-
function u(a) {
|
|
295
|
-
s.value = a, !a && f.type === "coin" && (y.value.day = void 0);
|
|
296
|
-
}
|
|
297
|
-
async function d() {
|
|
298
|
-
if (f.action === "send") {
|
|
299
|
-
const a = y.value.day ? `, expire in ${y.value.day} days` : "";
|
|
300
|
-
Ae.confirm(
|
|
301
|
-
`Are you sure to send ${y.value.amount} ${o.value.toLowerCase()}${a}? This action cannot be reversed.`
|
|
302
|
-
).then(async (b) => {
|
|
303
|
-
b && await f.onSubmit(y.value);
|
|
304
|
-
});
|
|
305
|
-
} else
|
|
306
|
-
Ae.confirm(
|
|
307
|
-
`Are you sure to deduct ${y.value.amount} ${o.value.toLowerCase()}? This action cannot be reversed.`
|
|
308
|
-
).then(async (a) => {
|
|
309
|
-
a && await f.onSubmit(y.value);
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
const x = O(() => {
|
|
313
|
-
const b = (f.action === "send" ? f.type === "coin" ? Re : je : f.type === "coin" ? Le : qe).safeParse(y.value);
|
|
314
|
-
return b.success == !1 ? b.error.flatten().fieldErrors : void 0;
|
|
315
|
-
});
|
|
316
|
-
return (a, b) => {
|
|
317
|
-
const k = A("FmStepperField"), $ = A("FmSwitch"), G = A("FmTextarea"), U = A("FmButton"), ie = A("FmCard");
|
|
318
|
-
return i(), I(ie, { class: "flex flex-col gap-16 p-16" }, {
|
|
319
|
-
default: se(() => {
|
|
320
|
-
var re, q, ne, p, l, S;
|
|
321
|
-
return [
|
|
322
|
-
r("div", mt, M(f.action == "send" ? "Send" : "Deduct") + " " + M(t(Se)[f.type.toUpperCase()].name), 1),
|
|
323
|
-
ye(" " + M(t(x)) + " ", 1),
|
|
324
|
-
r("div", dt, [
|
|
325
|
-
g(k, {
|
|
326
|
-
modelValue: t(y).amount,
|
|
327
|
-
"onUpdate:modelValue": b[0] || (b[0] = (_) => t(y).amount = _),
|
|
328
|
-
label: `${t(Se)[f.type.toUpperCase()].name} amount`,
|
|
329
|
-
"is-currency": !0,
|
|
330
|
-
"max-fraction-digits": 2,
|
|
331
|
-
"helper-state": (re = t(x)) != null && re.amount ? "error" : void 0,
|
|
332
|
-
"helper-text": (ne = (q = t(x)) == null ? void 0 : q.amount) == null ? void 0 : ne[0]
|
|
333
|
-
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
334
|
-
m.action === "send" && f.type === "coin" ? (i(), I($, {
|
|
335
|
-
key: 0,
|
|
336
|
-
"model-value": t(s),
|
|
337
|
-
label: `${t(o)} expires`,
|
|
338
|
-
"label-placement": "right",
|
|
339
|
-
"onUpdate:modelValue": b[1] || (b[1] = (_) => u(_))
|
|
340
|
-
}, null, 8, ["model-value", "label"])) : oe("", !0),
|
|
341
|
-
m.action === "send" && t(s) ? (i(), I(k, {
|
|
342
|
-
key: 1,
|
|
343
|
-
modelValue: t(y).day,
|
|
344
|
-
"onUpdate:modelValue": b[2] || (b[2] = (_) => t(y).day = _),
|
|
345
|
-
label: `${t(o)} expires in`,
|
|
346
|
-
"max-fraction-digits": 0,
|
|
347
|
-
"append-text": "day(s)",
|
|
348
|
-
max: 9999,
|
|
349
|
-
min: 0,
|
|
350
|
-
"helper-state": (p = t(x)) != null && p.day ? "error" : void 0,
|
|
351
|
-
"helper-text": (S = (l = t(x)) == null ? void 0 : l.day) == null ? void 0 : S[0]
|
|
352
|
-
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : oe("", !0),
|
|
353
|
-
g(G, {
|
|
354
|
-
modelValue: t(y).remark,
|
|
355
|
-
"onUpdate:modelValue": b[3] || (b[3] = (_) => t(y).remark = _),
|
|
356
|
-
label: "Remark"
|
|
357
|
-
}, null, 8, ["modelValue"])
|
|
358
|
-
]),
|
|
359
|
-
r("div", ct, [
|
|
360
|
-
g(U, {
|
|
361
|
-
variant: "secondary",
|
|
362
|
-
label: "Cancel",
|
|
363
|
-
size: "md",
|
|
364
|
-
onClick: b[4] || (b[4] = (_) => t(F).close())
|
|
365
|
-
}),
|
|
366
|
-
g(U, {
|
|
367
|
-
disabled: !!t(x),
|
|
368
|
-
variant: "primary",
|
|
369
|
-
label: "Submit",
|
|
370
|
-
size: "md",
|
|
371
|
-
onClick: b[5] || (b[5] = async () => d())
|
|
372
|
-
}, null, 8, ["disabled"])
|
|
373
|
-
])
|
|
374
|
-
];
|
|
375
|
-
}),
|
|
376
|
-
_: 1
|
|
377
|
-
});
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
}), pt = He("segment", () => {
|
|
381
|
-
const m = L([]);
|
|
382
|
-
async function F() {
|
|
383
|
-
const f = await Ne.readAll({
|
|
384
|
-
limit: 1e3,
|
|
385
|
-
skip: 0,
|
|
386
|
-
sortBy: "_id",
|
|
387
|
-
descending: !0
|
|
388
|
-
});
|
|
389
|
-
m.value = f.resources;
|
|
390
|
-
}
|
|
391
|
-
return {
|
|
392
|
-
segments: m,
|
|
393
|
-
read: F
|
|
394
|
-
};
|
|
395
|
-
});
|
|
396
|
-
class ft extends Je {
|
|
397
|
-
}
|
|
398
|
-
const bt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" }, yt = { class: "hidden xs:!flex items-center justify-end" }, vt = { class: "flex items-center justify-between mb-4" }, gt = { class: "flex items-center justify-between gap-x-8" }, xt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "px-4 py-0.5 rounded-md bg-fm-color-neutral-gray-100 fm-typo-en-body-md-600" }, _t = { class: "xs:hidden flex justify-between gap-x-4" }, xe = /* @__PURE__ */ ae({
|
|
399
|
-
__name: "MemberCollectionTable",
|
|
400
|
-
props: {
|
|
401
|
-
member: {
|
|
402
|
-
type: Object,
|
|
403
|
-
required: !0
|
|
404
|
-
},
|
|
405
|
-
title: {
|
|
406
|
-
type: String,
|
|
407
|
-
default: ""
|
|
408
|
-
},
|
|
409
|
-
columns: {
|
|
410
|
-
type: Array,
|
|
411
|
-
default: [],
|
|
412
|
-
required: !0
|
|
413
|
-
},
|
|
414
|
-
filters: {
|
|
415
|
-
type: Object,
|
|
416
|
-
default: {}
|
|
417
|
-
},
|
|
418
|
-
withExport: {
|
|
419
|
-
type: Boolean,
|
|
420
|
-
default: !1
|
|
421
|
-
},
|
|
422
|
-
transformExportRecord: {
|
|
423
|
-
type: Function
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
setup(m) {
|
|
427
|
-
const F = m, f = L({
|
|
428
|
-
search: ""
|
|
429
|
-
}), y = L(!1), { tableMeta: s, rowData: o, onSort: u, debouncedFetchData: d, onSearch: x } = We(async (b) => {
|
|
430
|
-
const k = {
|
|
431
|
-
...f.value,
|
|
432
|
-
...F.filters
|
|
433
|
-
};
|
|
434
|
-
return await ve.readCollectionsByMemberId(
|
|
435
|
-
F.member._id.toString(),
|
|
436
|
-
b,
|
|
437
|
-
k
|
|
438
|
-
);
|
|
439
|
-
});
|
|
440
|
-
Te(
|
|
441
|
-
f,
|
|
442
|
-
() => {
|
|
443
|
-
d();
|
|
444
|
-
},
|
|
445
|
-
{ deep: !0 }
|
|
446
|
-
);
|
|
447
|
-
async function a() {
|
|
448
|
-
try {
|
|
449
|
-
y.value = !0;
|
|
450
|
-
const b = {
|
|
451
|
-
...f.value,
|
|
452
|
-
...F.filters
|
|
453
|
-
};
|
|
454
|
-
await Qe({
|
|
455
|
-
exporter: new ft(),
|
|
456
|
-
readFunction: (k) => ve.readCollectionsByMemberId(
|
|
457
|
-
F.member._id.toString(),
|
|
458
|
-
k,
|
|
459
|
-
b
|
|
460
|
-
),
|
|
461
|
-
transformRecord: F.transformExportRecord,
|
|
462
|
-
filename: `${F.member._id.toString()}-${F.title.replace(" ", "-").toLowerCase()}`
|
|
463
|
-
});
|
|
464
|
-
} catch (b) {
|
|
465
|
-
console.error(b);
|
|
466
|
-
} finally {
|
|
467
|
-
y.value = !1;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
return Ie(async () => {
|
|
471
|
-
await d();
|
|
472
|
-
}), (b, k) => {
|
|
473
|
-
const $ = A("FmSearch"), G = A("FmButton");
|
|
474
|
-
return i(), w("div", bt, [
|
|
475
|
-
r("div", yt, [
|
|
476
|
-
g($, {
|
|
477
|
-
class: "hidden xs:!flex",
|
|
478
|
-
modelValue: t(f).search,
|
|
479
|
-
"onUpdate:modelValue": [
|
|
480
|
-
k[0] || (k[0] = (U) => t(f).search = U),
|
|
481
|
-
t(x)
|
|
482
|
-
],
|
|
483
|
-
placeholder: "Search",
|
|
484
|
-
collapsible: ""
|
|
485
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
486
|
-
m.withExport ? (i(), I(G, {
|
|
487
|
-
key: 0,
|
|
488
|
-
icon: "ios_share",
|
|
489
|
-
variant: "tertiary",
|
|
490
|
-
onClick: a
|
|
491
|
-
})) : oe("", !0)
|
|
492
|
-
]),
|
|
493
|
-
r("div", vt, [
|
|
494
|
-
r("div", gt, [
|
|
495
|
-
r("div", xt, M(F.title), 1),
|
|
496
|
-
r("div", ht, M(t(s).totalRows), 1)
|
|
497
|
-
]),
|
|
498
|
-
r("div", _t, [
|
|
499
|
-
g($, {
|
|
500
|
-
modelValue: t(f).search,
|
|
501
|
-
"onUpdate:modelValue": [
|
|
502
|
-
k[1] || (k[1] = (U) => t(f).search = U),
|
|
503
|
-
t(x)
|
|
504
|
-
],
|
|
505
|
-
placeholder: "Search"
|
|
506
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
507
|
-
m.withExport ? (i(), I(G, {
|
|
508
|
-
key: 0,
|
|
509
|
-
icon: "ios_share",
|
|
510
|
-
variant: "tertiary",
|
|
511
|
-
onClick: a
|
|
512
|
-
})) : oe("", !0)
|
|
513
|
-
])
|
|
514
|
-
]),
|
|
515
|
-
g(Xe, {
|
|
516
|
-
loading: t(s).isLoading,
|
|
517
|
-
"row-data": t(o),
|
|
518
|
-
"row-count": t(s).totalRows,
|
|
519
|
-
"column-defs": m.columns,
|
|
520
|
-
"page-count": t(s).pageCount,
|
|
521
|
-
"page-index": t(s).pageIndex,
|
|
522
|
-
"page-size": t(s).pageSize,
|
|
523
|
-
"shrink-at": !1,
|
|
524
|
-
onSortChange: t(u),
|
|
525
|
-
onPageChange: k[2] || (k[2] = (U) => t(d)({
|
|
526
|
-
pageSize: U.pageSize,
|
|
527
|
-
pageIndex: U.pageIndex
|
|
528
|
-
}))
|
|
529
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
530
|
-
]);
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
}), Ct = /* @__PURE__ */ ae({
|
|
534
|
-
__name: "MemberVouchers",
|
|
535
|
-
props: {
|
|
536
|
-
member: {
|
|
537
|
-
type: Object,
|
|
538
|
-
required: !0
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
setup(m) {
|
|
542
|
-
const F = m, f = [
|
|
543
|
-
{
|
|
544
|
-
header: "Voucher title",
|
|
545
|
-
meta: {
|
|
546
|
-
maxWidth: "300px"
|
|
547
|
-
},
|
|
548
|
-
cell(o) {
|
|
549
|
-
var u;
|
|
550
|
-
return le(
|
|
551
|
-
"div",
|
|
552
|
-
{ class: "text-ellipsis truncate" },
|
|
553
|
-
((u = o.row.original.pf_collectible) == null ? void 0 : u.name) || "-"
|
|
554
|
-
);
|
|
555
|
-
},
|
|
556
|
-
enableSorting: !1
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
header: "Claimed at",
|
|
560
|
-
accessorKey: "_id",
|
|
561
|
-
accessorFn: (o) => h(ge(o._id.toString())).format("D MMM YYYY"),
|
|
562
|
-
enableSorting: !1
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
header: "Expired at",
|
|
566
|
-
cell(o) {
|
|
567
|
-
var d, x, a, b;
|
|
568
|
-
const u = (x = (d = o.row.original.expiryBalance) == null ? void 0 : d[0]) != null && x.expiredAt ? h((b = (a = o.row.original.expiryBalance) == null ? void 0 : a[0]) == null ? void 0 : b.expiredAt).format(
|
|
569
|
-
"D MMM YYYY"
|
|
570
|
-
) : "-";
|
|
571
|
-
return le("div", {}, u);
|
|
572
|
-
},
|
|
573
|
-
enableSorting: !0
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
header: "Transfer open",
|
|
577
|
-
accessorFn: (o) => {
|
|
578
|
-
var u, d, x;
|
|
579
|
-
return Ke((x = (d = (u = o.pf_collectible) == null ? void 0 : u.options) == null ? void 0 : d.enableTransfer) == null ? void 0 : x.toString());
|
|
580
|
-
},
|
|
581
|
-
enableSorting: !1
|
|
582
|
-
}
|
|
583
|
-
], y = (o) => ({
|
|
584
|
-
type: he.enum.VOUCHER,
|
|
585
|
-
isActive: o
|
|
586
|
-
}), s = (o) => {
|
|
587
|
-
var u, d, x, a, b, k, $;
|
|
588
|
-
return {
|
|
589
|
-
CollectionID: o._id,
|
|
590
|
-
Title: (u = o.pf_collectible) == null ? void 0 : u.name,
|
|
591
|
-
ClaimedAt: h(ge(o._id.toString())).format(
|
|
592
|
-
"D MMM YYYY, hh:mmA"
|
|
593
|
-
),
|
|
594
|
-
ExpiredAt: (x = (d = o.expiryBalance) == null ? void 0 : d[0]) != null && x.expiredAt ? h((b = (a = o.expiryBalance) == null ? void 0 : a[0]) == null ? void 0 : b.expiredAt).format("D MMM YYYY") : "",
|
|
595
|
-
TransferOpen: (($ = (k = o.pf_collectible) == null ? void 0 : k.options) == null ? void 0 : $.enableTransfer) || !1
|
|
596
|
-
};
|
|
597
|
-
};
|
|
598
|
-
return (o, u) => (i(), w(Y, null, [
|
|
599
|
-
u[0] || (u[0] = r("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Voucher Collections", -1)),
|
|
600
|
-
g(xe, {
|
|
601
|
-
member: F.member,
|
|
602
|
-
columns: f,
|
|
603
|
-
title: "Active voucher",
|
|
604
|
-
filters: y(!0),
|
|
605
|
-
withExport: !0,
|
|
606
|
-
transformExportRecord: s
|
|
607
|
-
}, null, 8, ["member", "filters"]),
|
|
608
|
-
g(xe, {
|
|
609
|
-
member: F.member,
|
|
610
|
-
columns: f,
|
|
611
|
-
title: "Past voucher",
|
|
612
|
-
filters: y(!1),
|
|
613
|
-
withExport: !0,
|
|
614
|
-
transformExportRecord: s
|
|
615
|
-
}, null, 8, ["member", "filters"])
|
|
616
|
-
], 64));
|
|
617
|
-
}
|
|
618
|
-
}), St = /* @__PURE__ */ ae({
|
|
619
|
-
__name: "MemberMissions",
|
|
620
|
-
props: {
|
|
621
|
-
member: {
|
|
622
|
-
type: Object,
|
|
623
|
-
required: !0
|
|
624
|
-
}
|
|
625
|
-
},
|
|
626
|
-
setup(m) {
|
|
627
|
-
const F = m, f = [
|
|
628
|
-
{
|
|
629
|
-
header: "Mission title",
|
|
630
|
-
meta: {
|
|
631
|
-
maxWidth: "300px"
|
|
632
|
-
},
|
|
633
|
-
cell(s) {
|
|
634
|
-
var o;
|
|
635
|
-
return le(
|
|
636
|
-
"div",
|
|
637
|
-
{ class: "text-ellipsis truncate" },
|
|
638
|
-
((o = s.row.original.pf_campaign) == null ? void 0 : o.name) || "Deleted Campaign"
|
|
639
|
-
);
|
|
640
|
-
},
|
|
641
|
-
enableSorting: !1
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
header: "Type",
|
|
645
|
-
accessorFn: (s) => {
|
|
646
|
-
var o, u, d;
|
|
647
|
-
return Me.title(((d = (u = (o = s == null ? void 0 : s.pf_collectible) == null ? void 0 : o.extras) == null ? void 0 : u.mission) == null ? void 0 : d.type) || "-");
|
|
648
|
-
},
|
|
649
|
-
enableSorting: !1
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
header: "Status",
|
|
653
|
-
cell(s) {
|
|
654
|
-
var o;
|
|
655
|
-
if (s.row.original.pf_campaign) {
|
|
656
|
-
const u = {
|
|
657
|
-
active: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
|
|
658
|
-
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
659
|
-
completed: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
660
|
-
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
661
|
-
}, d = Ze(
|
|
662
|
-
s.row.original.pf_campaign
|
|
663
|
-
), a = s.row.original.balance === s.row.original.pf_collectible.extras.mission.end && d === "active" ? "completed" : (o = s.row.original) != null && o.deactivatedAt ? "expired" : d;
|
|
664
|
-
return le(we.FmChip, {
|
|
665
|
-
class: u[a],
|
|
666
|
-
label: Me.title(a),
|
|
667
|
-
compact: !0
|
|
668
|
-
});
|
|
669
|
-
}
|
|
670
|
-
return le(we.FmChip, {
|
|
671
|
-
class: "",
|
|
672
|
-
label: "-",
|
|
673
|
-
compact: !0
|
|
674
|
-
});
|
|
675
|
-
},
|
|
676
|
-
enableSorting: !1
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
header: "Summary",
|
|
680
|
-
accessorFn: (s) => s != null && s.pf_campaign ? et(s.pf_campaign) : "Deleted Campaign",
|
|
681
|
-
enableSorting: !1
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
header: "Current Step",
|
|
685
|
-
accessorKey: "balance",
|
|
686
|
-
enableSorting: !1
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
header: "Total Step",
|
|
690
|
-
accessorFn: (s) => {
|
|
691
|
-
var o, u, d;
|
|
692
|
-
return ((d = (u = (o = s == null ? void 0 : s.pf_collectible) == null ? void 0 : o.extras) == null ? void 0 : u.mission) == null ? void 0 : d.end) ?? 0;
|
|
693
|
-
},
|
|
694
|
-
enableSorting: !1
|
|
695
|
-
}
|
|
696
|
-
], y = {
|
|
697
|
-
type: he.enum.STAMP
|
|
698
|
-
};
|
|
699
|
-
return (s, o) => (i(), w(Y, null, [
|
|
700
|
-
o[0] || (o[0] = r("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Mission", -1)),
|
|
701
|
-
g(xe, {
|
|
702
|
-
member: F.member,
|
|
703
|
-
columns: f,
|
|
704
|
-
title: "Mission",
|
|
705
|
-
filters: y
|
|
706
|
-
}, null, 8, ["member"])
|
|
707
|
-
], 64));
|
|
708
|
-
}
|
|
709
|
-
}), wt = /* @__PURE__ */ ae({
|
|
710
|
-
__name: "MemberGames",
|
|
711
|
-
props: {
|
|
712
|
-
member: {
|
|
713
|
-
type: Object,
|
|
714
|
-
required: !0
|
|
715
|
-
}
|
|
716
|
-
},
|
|
717
|
-
setup(m) {
|
|
718
|
-
const F = m, f = [
|
|
719
|
-
{
|
|
720
|
-
header: "Game title",
|
|
721
|
-
meta: {
|
|
722
|
-
maxWidth: "300px"
|
|
723
|
-
},
|
|
724
|
-
cell(s) {
|
|
725
|
-
var o;
|
|
726
|
-
return le(
|
|
727
|
-
"div",
|
|
728
|
-
{ class: "text-ellipsis truncate" },
|
|
729
|
-
((o = s.row.original.pf_campaign) == null ? void 0 : o.name) || "-"
|
|
730
|
-
);
|
|
731
|
-
},
|
|
732
|
-
enableSorting: !1
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
header: "Claimed at",
|
|
736
|
-
accessorKey: "_id",
|
|
737
|
-
accessorFn: (s) => h(ge(s._id.toString())).format("D MMM YYYY"),
|
|
738
|
-
enableSorting: !1
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
header: "Expired at",
|
|
742
|
-
cell(s) {
|
|
743
|
-
var u, d, x, a;
|
|
744
|
-
const o = (d = (u = s.row.original.expiryBalance) == null ? void 0 : u[0]) != null && d.expiredAt ? h((a = (x = s.row.original.expiryBalance) == null ? void 0 : x[0]) == null ? void 0 : a.expiredAt).format(
|
|
745
|
-
"D MMM YYYY"
|
|
746
|
-
) : "-";
|
|
747
|
-
return le("div", {}, o);
|
|
748
|
-
},
|
|
749
|
-
enableSorting: !1
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
header: "Token received",
|
|
753
|
-
accessorKey: "balance",
|
|
754
|
-
enableSorting: !1
|
|
755
|
-
}
|
|
756
|
-
], y = (s) => ({
|
|
757
|
-
type: he.enum.GAME,
|
|
758
|
-
isActive: s
|
|
759
|
-
});
|
|
760
|
-
return (s, o) => (i(), w(Y, null, [
|
|
761
|
-
o[0] || (o[0] = r("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Game program", -1)),
|
|
762
|
-
g(xe, {
|
|
763
|
-
member: F.member,
|
|
764
|
-
columns: f,
|
|
765
|
-
title: "Active game token",
|
|
766
|
-
filters: y(!0)
|
|
767
|
-
}, null, 8, ["member", "filters"])
|
|
768
|
-
], 64));
|
|
769
|
-
}
|
|
770
|
-
}), Ft = { class: "flex flex-col flex-nowrap gap-y-24 max-h-full" }, Mt = { class: "grid md:grid-cols-2 lg:grid-cols-2 gap-x-36 gap-y-24" }, kt = { class: "space-y-16" }, At = { class: "flex gap-16 items-center" }, Tt = { class: "flex-auto" }, $t = { class: "fm-typo-en-body-md-600" }, Et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, It = { class: "fm-typo-en-body-md-800" }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Dt = { class: "fm-typo-en-body-md-800" }, Yt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "fm-typo-en-body-md-600" }, Nt = { class: "gap-16 grid grid-cols-1" }, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pt = { class: "fm-typo-en-body-md-600" }, Rt = { 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" }, jt = { class: "flex justify-between mb-16" }, Lt = { class: "fm-typo-en-title-sm-600" }, qt = ["onClick"], zt = { class: "flex flex-col gap-y-16" }, Gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-md-600" }, Kt = { class: "space-y-8" }, Wt = {
|
|
771
|
-
key: 0,
|
|
772
|
-
class: "space-x-8"
|
|
773
|
-
}, Xt = {
|
|
774
|
-
key: 1,
|
|
775
|
-
class: "text-fm-color-typo-secondary"
|
|
776
|
-
}, Jt = { class: "space-y-8" }, Qt = ["src"], Zt = { class: "fm-typo-en-body-md-600" }, eo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, to = {
|
|
777
|
-
key: 1,
|
|
778
|
-
class: "text-fm-color-typo-secondary"
|
|
779
|
-
}, oo = {
|
|
780
|
-
key: 1,
|
|
781
|
-
class: "space-y-24"
|
|
782
|
-
}, ro = { class: "space-y-8" }, no = { class: "fm-typo-en-title-md-800" }, so = { class: "space-y-4" }, lo = { class: "fm-typo-en-body-md-600" }, ao = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, io = { class: "space-y-8" }, mo = { class: "fm-typo-en-title-md-800" }, co = { class: "space-y-4" }, uo = { class: "fm-typo-en-body-md-600" }, po = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, Ko = /* @__PURE__ */ ae({
|
|
783
|
-
__name: "MemberDetailSheet",
|
|
784
|
-
props: {
|
|
785
|
-
member: {
|
|
786
|
-
type: Object,
|
|
787
|
-
required: !0
|
|
788
|
-
}
|
|
789
|
-
},
|
|
790
|
-
emits: ["update:member"],
|
|
791
|
-
setup(m, { expose: F, emit: f }) {
|
|
792
|
-
const y = tt(), s = Ge(), o = $e(), u = pt(), d = Ce(), { minor: x } = ze, a = m, b = f, k = O(() => s.locations.map((n) => ({
|
|
793
|
-
label: n.name,
|
|
794
|
-
value: n._id
|
|
795
|
-
}))), $ = O(() => (a.member.segment || []).map((n) => {
|
|
796
|
-
var e;
|
|
797
|
-
return ((e = u.segments.find((c) => c._id === n)) == null ? void 0 : e.name) || "";
|
|
798
|
-
}).filter(Boolean)), G = [
|
|
799
|
-
{
|
|
800
|
-
label: "Loyalty",
|
|
801
|
-
stats: [
|
|
802
|
-
{
|
|
803
|
-
label: "Experiences",
|
|
804
|
-
getter: (n) => {
|
|
805
|
-
var e, c, T;
|
|
806
|
-
return te(((T = (c = (e = n.collection) == null ? void 0 : e.POINT) == null ? void 0 : c[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
807
|
-
}
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
label: "Credits",
|
|
811
|
-
getter: (n) => {
|
|
812
|
-
var e, c, T;
|
|
813
|
-
return te(((T = (c = (e = n.collection) == null ? void 0 : e.CREDIT) == null ? void 0 : c[0]) == null ? void 0 : T.balance) ?? 0, 2);
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
]
|
|
817
|
-
},
|
|
818
|
-
{
|
|
819
|
-
label: "Voucher",
|
|
820
|
-
stats: [
|
|
821
|
-
{
|
|
822
|
-
label: "Active vouchers",
|
|
823
|
-
getter: () => te(P.value.active, 0)
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
label: "Past vouchers",
|
|
827
|
-
getter: () => te(P.value.past, 0)
|
|
828
|
-
}
|
|
829
|
-
]
|
|
830
|
-
},
|
|
831
|
-
{
|
|
832
|
-
label: "Mission",
|
|
833
|
-
stats: [
|
|
834
|
-
{
|
|
835
|
-
label: "Stamp missions",
|
|
836
|
-
getter: () => te(B.value.stamp, 0)
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
label: "Progress missions",
|
|
840
|
-
getter: () => te(B.value.progressive, 0)
|
|
841
|
-
}
|
|
842
|
-
]
|
|
843
|
-
},
|
|
844
|
-
{
|
|
845
|
-
label: "Game",
|
|
846
|
-
stats: [
|
|
847
|
-
{
|
|
848
|
-
label: "Tokens",
|
|
849
|
-
getter: (n) => {
|
|
850
|
-
var e, c;
|
|
851
|
-
return te(
|
|
852
|
-
((c = (e = n.collection) == null ? void 0 : e.GAME) == null ? void 0 : c.reduce(
|
|
853
|
-
(T, E) => T + E.balance,
|
|
854
|
-
0
|
|
855
|
-
)) || 0,
|
|
856
|
-
0
|
|
857
|
-
);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
]
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
label: "Store bundle",
|
|
864
|
-
stats: [
|
|
865
|
-
{
|
|
866
|
-
label: "Bundle purchased",
|
|
867
|
-
getter: () => te(N.value, 0)
|
|
868
|
-
}
|
|
869
|
-
]
|
|
870
|
-
}
|
|
871
|
-
], ie = (() => {
|
|
872
|
-
const e = [];
|
|
873
|
-
for (let c = 0; c < G.length; c += 3)
|
|
874
|
-
e.push(G.slice(c, c + 3));
|
|
875
|
-
return e;
|
|
876
|
-
})();
|
|
877
|
-
async function re(n, e) {
|
|
878
|
-
switch (n.stopPropagation(), e) {
|
|
879
|
-
case "Store bundle":
|
|
880
|
-
await y.push({
|
|
881
|
-
name: rt["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
882
|
-
params: { id: a.member._id.toString() },
|
|
883
|
-
query: { tab: "store" }
|
|
884
|
-
});
|
|
885
|
-
break;
|
|
886
|
-
default:
|
|
887
|
-
C.value = R.find((c) => c.label === e) || R[0];
|
|
888
|
-
break;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
async function q(n, e) {
|
|
892
|
-
d.open({
|
|
893
|
-
title: "",
|
|
894
|
-
dialogComponent: ut,
|
|
895
|
-
dialogComponentProps: {
|
|
896
|
-
type: n,
|
|
897
|
-
action: e,
|
|
898
|
-
onSubmit: async (c) => {
|
|
899
|
-
await x(
|
|
900
|
-
async () => {
|
|
901
|
-
const T = {
|
|
902
|
-
"credit-send": fe.sendCredit,
|
|
903
|
-
"credit-deduct": fe.deductCredit,
|
|
904
|
-
"coin-send": fe.sendCoin,
|
|
905
|
-
"coin-deduct": fe.deductCoin
|
|
906
|
-
}, E = `${n}-${e}`, W = T[E];
|
|
907
|
-
W && await W(a.member._id, c), b("update:member"), d.close();
|
|
908
|
-
},
|
|
909
|
-
{
|
|
910
|
-
message: `Adjusting ${_e.formattedType(
|
|
911
|
-
n.toUpperCase()
|
|
912
|
-
).toLowerCase()}`,
|
|
913
|
-
successMessage: `${c.amount} ${_e.formattedType(
|
|
914
|
-
n.toUpperCase()
|
|
915
|
-
).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${a.member.phoneNumber}`
|
|
916
|
-
}
|
|
917
|
-
);
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
async function ne() {
|
|
923
|
-
d.open({
|
|
924
|
-
title: "Update member statistics",
|
|
925
|
-
contentComponent: it,
|
|
926
|
-
contentComponentProps: {
|
|
927
|
-
member: a.member,
|
|
928
|
-
onSubmit: async (n) => {
|
|
929
|
-
await x(
|
|
930
|
-
async () => {
|
|
931
|
-
await fe.updateMember(a.member._id, n), b("update:member"), d.close();
|
|
932
|
-
},
|
|
933
|
-
{
|
|
934
|
-
message: "Updating member stats",
|
|
935
|
-
successMessage: `Updated member ${a.member.phoneNumber} stats successfully`
|
|
936
|
-
}
|
|
937
|
-
);
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
});
|
|
941
|
-
}
|
|
942
|
-
const p = [
|
|
943
|
-
{
|
|
944
|
-
label: "Mobile No.",
|
|
945
|
-
key: "phoneNumber"
|
|
946
|
-
},
|
|
947
|
-
{
|
|
948
|
-
label: "Tier",
|
|
949
|
-
getter: (n) => {
|
|
950
|
-
var me, de, be, v, V;
|
|
951
|
-
const e = (((de = Fe.first((me = a.member.collection) == null ? void 0 : me.TIER)) == null ? void 0 : de.balance) || 0) - 1, c = S.value.name, T = ((v = (be = n.collection) == null ? void 0 : be.POINT) == null ? void 0 : v[0].balance) ?? 0, E = o.sortedTiers[e + 1], W = ((V = E == null ? void 0 : E.option) == null ? void 0 : V.from) ?? 1 / 0;
|
|
952
|
-
return `${c} (${T}/${W})`;
|
|
953
|
-
}
|
|
954
|
-
},
|
|
955
|
-
{
|
|
956
|
-
label: "Email",
|
|
957
|
-
key: "email"
|
|
958
|
-
},
|
|
959
|
-
{
|
|
960
|
-
label: "Birthday",
|
|
961
|
-
getter: (n) => n.birthday ? h(n.birthday).format("D MMM YYYY") : "-"
|
|
962
|
-
}
|
|
963
|
-
], l = [
|
|
964
|
-
{
|
|
965
|
-
label: "Customer since",
|
|
966
|
-
getter: (n) => h(n.joinAt || ge(n._id.toString())).format("D MMM YYYY")
|
|
967
|
-
},
|
|
968
|
-
{
|
|
969
|
-
label: "Joined at location",
|
|
970
|
-
getter: (n) => {
|
|
971
|
-
var e;
|
|
972
|
-
return n != null && n.location && ((e = k.value.find((c) => c.value == n.location)) == null ? void 0 : e.label) || "-";
|
|
973
|
-
}
|
|
974
|
-
},
|
|
975
|
-
{
|
|
976
|
-
label: "Total visit(s)",
|
|
977
|
-
getter: (n) => ke.singularOrPlural(n.stats.visitCount, "bill")
|
|
978
|
-
},
|
|
979
|
-
{
|
|
980
|
-
label: "Last visit",
|
|
981
|
-
getter: (n) => h(n.stats.lastVisit).fromNow()
|
|
982
|
-
},
|
|
983
|
-
{
|
|
984
|
-
label: "Frequency",
|
|
985
|
-
getter: (n) => `Every ${ke.singularOrPlural(
|
|
986
|
-
Number(Math.ceil(n.stats.avgVisitFrequency).toFixed(0)),
|
|
987
|
-
"day"
|
|
988
|
-
)}`
|
|
989
|
-
},
|
|
990
|
-
{
|
|
991
|
-
label: "Average spend",
|
|
992
|
-
getter: (n) => Ue.Dinero.fromNumber({ number: Number(n.stats.avgBillSize || 0) }).toFormat(
|
|
993
|
-
!0
|
|
994
|
-
)
|
|
995
|
-
}
|
|
996
|
-
// {
|
|
997
|
-
// label: 'Feedback',
|
|
998
|
-
// key: 'feedbackCount',
|
|
999
|
-
// },
|
|
1000
|
-
], S = O(() => {
|
|
1001
|
-
var c, T;
|
|
1002
|
-
const n = (((T = Fe.first((c = a.member.collection) == null ? void 0 : c.TIER)) == null ? void 0 : T.balance) || 0) - 1, e = o.sortedTiers[n];
|
|
1003
|
-
return { name: (e == null ? void 0 : e.name) || "-", tier: n, config: e };
|
|
1004
|
-
}), _ = O(() => {
|
|
1005
|
-
var n;
|
|
1006
|
-
return (((n = a.member.collection) == null ? void 0 : n.TITLE) || []).map((e) => {
|
|
1007
|
-
var T, E, W;
|
|
1008
|
-
const c = (T = o.sortedTitles) == null ? void 0 : T.find(
|
|
1009
|
-
(me) => me._id == e.collectible
|
|
1010
|
-
);
|
|
1011
|
-
return {
|
|
1012
|
-
name: c == null ? void 0 : c.name,
|
|
1013
|
-
expiredAt: (W = (E = e.expiryBalance) == null ? void 0 : E.at(-1)) == null ? void 0 : W.expiredAt,
|
|
1014
|
-
collectible: c
|
|
1015
|
-
};
|
|
1016
|
-
}).filter(
|
|
1017
|
-
(e) => e.expiredAt ? h(e.expiredAt).isAfter(h()) : !0
|
|
1018
|
-
);
|
|
1019
|
-
}), B = L({ stamp: 0, progressive: 0 }), P = L({ active: 0, past: 0 }), z = L([]), N = O(
|
|
1020
|
-
() => z.value.reduce((n, e) => n + e.count, 0)
|
|
1021
|
-
), D = L(!0);
|
|
1022
|
-
function H() {
|
|
1023
|
-
D.value = !0, C.value = R[0];
|
|
1024
|
-
}
|
|
1025
|
-
function Z() {
|
|
1026
|
-
D.value = !1;
|
|
1027
|
-
}
|
|
1028
|
-
const R = [
|
|
1029
|
-
{
|
|
1030
|
-
label: "Overview",
|
|
1031
|
-
value: "overview"
|
|
1032
|
-
},
|
|
1033
|
-
{
|
|
1034
|
-
label: "Loyalty",
|
|
1035
|
-
value: "loyalty"
|
|
1036
|
-
},
|
|
1037
|
-
{
|
|
1038
|
-
label: "Voucher",
|
|
1039
|
-
value: "voucher"
|
|
1040
|
-
},
|
|
1041
|
-
{
|
|
1042
|
-
label: "Mission",
|
|
1043
|
-
value: "mission"
|
|
1044
|
-
},
|
|
1045
|
-
{
|
|
1046
|
-
label: "Game",
|
|
1047
|
-
value: "game"
|
|
1048
|
-
}
|
|
1049
|
-
], C = L(R[0]), K = async () => {
|
|
1050
|
-
P.value = await ve.readCollectionCountByMemberId(
|
|
1051
|
-
a.member._id.toString(),
|
|
1052
|
-
he.enum.VOUCHER
|
|
1053
|
-
), z.value = await ot.readPurchaseCountByMember(
|
|
1054
|
-
a.member._id.toString()
|
|
1055
|
-
), B.value = await ve.readMissionCountByMemberId(
|
|
1056
|
-
a.member._id.toString()
|
|
1057
|
-
);
|
|
1058
|
-
};
|
|
1059
|
-
return Be(async () => {
|
|
1060
|
-
await o.readMembership(), await K(), s.locations.length || await s.readLocations();
|
|
1061
|
-
}), Te(D, async () => {
|
|
1062
|
-
await K();
|
|
1063
|
-
}), F({
|
|
1064
|
-
showSheet: H,
|
|
1065
|
-
hideSheet: Z
|
|
1066
|
-
}), (n, e) => {
|
|
1067
|
-
const c = A("FmTabs"), T = A("FmAvatar"), E = A("FmButton"), W = A("FmIcon"), me = A("FmChip"), de = A("FmCard"), be = A("FmSideSheet");
|
|
1068
|
-
return i(), I(be, {
|
|
1069
|
-
modelValue: t(D),
|
|
1070
|
-
"onUpdate:modelValue": e[5] || (e[5] = (v) => De(D) ? D.value = v : null),
|
|
1071
|
-
header: "Member Detail",
|
|
1072
|
-
"dismiss-away": "",
|
|
1073
|
-
"close-button": !0,
|
|
1074
|
-
"max-width": 1100
|
|
1075
|
-
}, {
|
|
1076
|
-
"side-sheet-footer": se(() => [...e[19] || (e[19] = [])]),
|
|
1077
|
-
default: se(() => [
|
|
1078
|
-
r("div", Ft, [
|
|
1079
|
-
r("div", null, [
|
|
1080
|
-
g(c, {
|
|
1081
|
-
"model-value": t(C).value,
|
|
1082
|
-
items: R,
|
|
1083
|
-
class: "overflow-x-auto",
|
|
1084
|
-
"onUpdate:modelValue": e[0] || (e[0] = (v) => C.value = R.find((V) => V.value === v))
|
|
1085
|
-
}, null, 8, ["model-value"])
|
|
1086
|
-
]),
|
|
1087
|
-
t(C).value == "overview" ? (i(), w(Y, { key: 0 }, [
|
|
1088
|
-
r("div", Mt, [
|
|
1089
|
-
r("div", null, [
|
|
1090
|
-
e[9] || (e[9] = r("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
|
|
1091
|
-
r("div", kt, [
|
|
1092
|
-
r("div", At, [
|
|
1093
|
-
g(T, {
|
|
1094
|
-
name: m.member.photoUrl ? void 0 : m.member.name,
|
|
1095
|
-
src: m.member.photoUrl || void 0
|
|
1096
|
-
}, null, 8, ["name", "src"]),
|
|
1097
|
-
r("div", Tt, [
|
|
1098
|
-
e[8] || (e[8] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
|
|
1099
|
-
r("div", $t, M(m.member.name), 1),
|
|
1100
|
-
r("div", Et, M(m.member._id), 1),
|
|
1101
|
-
r("div", Vt, [
|
|
1102
|
-
e[6] || (e[6] = ye(" Member Card: ", -1)),
|
|
1103
|
-
r("span", It, M(m.member.cardNo ? m.member.cardNo : "-"), 1)
|
|
1104
|
-
]),
|
|
1105
|
-
r("div", Bt, [
|
|
1106
|
-
e[7] || (e[7] = ye(" Referral Code: ", -1)),
|
|
1107
|
-
r("span", Dt, M(m.member.referralCode ? m.member.referralCode : "-"), 1)
|
|
1108
|
-
])
|
|
1109
|
-
]),
|
|
1110
|
-
g(E, {
|
|
1111
|
-
variant: "tertiary",
|
|
1112
|
-
icon: "settings",
|
|
1113
|
-
onClick: ne
|
|
1114
|
-
})
|
|
1115
|
-
]),
|
|
1116
|
-
(i(), w(Y, null, Q(p, (v, V) => r("div", { key: V }, [
|
|
1117
|
-
r("div", Yt, M(v.label), 1),
|
|
1118
|
-
r("div", Ut, M(v.key ? m.member[v.key] : v.getter(m.member)), 1)
|
|
1119
|
-
])), 64))
|
|
1120
|
-
])
|
|
1121
|
-
]),
|
|
1122
|
-
r("div", null, [
|
|
1123
|
-
e[10] || (e[10] = r("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
|
|
1124
|
-
r("div", Nt, [
|
|
1125
|
-
(i(), w(Y, null, Q(l, (v) => r("div", {
|
|
1126
|
-
key: v.key
|
|
1127
|
-
}, [
|
|
1128
|
-
r("div", Ot, M(v.label), 1),
|
|
1129
|
-
r("div", Pt, M(v.key ? a.member.stats[v.key] || "-" : v.getter(m.member)), 1)
|
|
1130
|
-
])), 64))
|
|
1131
|
-
])
|
|
1132
|
-
])
|
|
1133
|
-
]),
|
|
1134
|
-
e[13] || (e[13] = r("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1135
|
-
(i(!0), w(Y, null, Q(t(ie), (v) => (i(), w("div", Rt, [
|
|
1136
|
-
(i(!0), w(Y, null, Q(v, (V, ee) => (i(), w("div", { key: ee }, [
|
|
1137
|
-
r("div", {
|
|
1138
|
-
class: Ye(ee !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
|
|
1139
|
-
}, [
|
|
1140
|
-
r("div", jt, [
|
|
1141
|
-
r("div", Lt, M(V.label), 1),
|
|
1142
|
-
r("button", {
|
|
1143
|
-
onClick: (j) => re(j, V.label)
|
|
1144
|
-
}, [
|
|
1145
|
-
g(W, {
|
|
1146
|
-
name: "chevron_right",
|
|
1147
|
-
outline: "",
|
|
1148
|
-
size: "md"
|
|
1149
|
-
})
|
|
1150
|
-
], 8, qt)
|
|
1151
|
-
]),
|
|
1152
|
-
r("div", zt, [
|
|
1153
|
-
(i(!0), w(Y, null, Q(V.stats, (j) => (i(), w("div", {
|
|
1154
|
-
key: j.key
|
|
1155
|
-
}, [
|
|
1156
|
-
r("div", Gt, M(j.label), 1),
|
|
1157
|
-
r("div", Ht, M(j.getter(m.member)), 1)
|
|
1158
|
-
]))), 128))
|
|
1159
|
-
])
|
|
1160
|
-
], 2)
|
|
1161
|
-
]))), 128))
|
|
1162
|
-
]))), 256)),
|
|
1163
|
-
r("div", Kt, [
|
|
1164
|
-
e[11] || (e[11] = r("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
|
|
1165
|
-
t($).length ? (i(), w("div", Wt, [
|
|
1166
|
-
(i(!0), w(Y, null, Q(t($), (v) => (i(), I(me, {
|
|
1167
|
-
label: v.toString()
|
|
1168
|
-
}, null, 8, ["label"]))), 256))
|
|
1169
|
-
])) : (i(), w("div", Xt, "No titles"))
|
|
1170
|
-
]),
|
|
1171
|
-
e[14] || (e[14] = r("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1172
|
-
r("div", Jt, [
|
|
1173
|
-
e[12] || (e[12] = r("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
|
|
1174
|
-
t(_).length ? (i(!0), w(Y, { key: 0 }, Q(t(_).filter((v) => v.collectible), (v) => (i(), w("div", {
|
|
1175
|
-
class: "flex items-center gap-x-8 h-48",
|
|
1176
|
-
key: v.name
|
|
1177
|
-
}, [
|
|
1178
|
-
r("img", {
|
|
1179
|
-
src: v.collectible.image || t(Oe),
|
|
1180
|
-
class: "aspect-square h-full object-contain"
|
|
1181
|
-
}, null, 8, Qt),
|
|
1182
|
-
r("div", null, [
|
|
1183
|
-
r("div", Zt, M(v.name), 1),
|
|
1184
|
-
r("div", eo, " Expired on " + M(t(h)(v.expiredAt).format("MMM D, Y")), 1)
|
|
1185
|
-
])
|
|
1186
|
-
]))), 128)) : (i(), w("div", to, "No titles"))
|
|
1187
|
-
])
|
|
1188
|
-
], 64)) : t(C).value == "loyalty" ? (i(), w("div", oo, [
|
|
1189
|
-
g(de, {
|
|
1190
|
-
class: "p-16 space-y-24",
|
|
1191
|
-
variant: "outlined"
|
|
1192
|
-
}, {
|
|
1193
|
-
default: se(() => {
|
|
1194
|
-
var v, V, ee, j, ce, ue, pe;
|
|
1195
|
-
return [
|
|
1196
|
-
r("div", ro, [
|
|
1197
|
-
e[15] || (e[15] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit ", -1)),
|
|
1198
|
-
r("div", no, M(((ee = (V = (v = m.member.collection) == null ? void 0 : v.CREDIT) == null ? void 0 : V[0]) == null ? void 0 : ee.balance) ?? 0), 1)
|
|
1199
|
-
]),
|
|
1200
|
-
r("div", so, [
|
|
1201
|
-
e[16] || (e[16] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit(s) to be expired in 30 days ", -1)),
|
|
1202
|
-
r("div", lo, M(((pe = (ue = (ce = (j = m.member.collection) == null ? void 0 : j.CREDIT) == null ? void 0 : ce[0]) == null ? void 0 : ue.expiryBalance) == null ? void 0 : pe.reduce(
|
|
1203
|
-
(X, J) => J.expiredAt && t(h)(J.expiredAt).isAfter(t(h)()) && t(h)(J.expiredAt).isBefore(t(h)().add(30, "days")) ? X + J.amount : X,
|
|
1204
|
-
0
|
|
1205
|
-
)) ?? 0), 1)
|
|
1206
|
-
]),
|
|
1207
|
-
r("div", ao, [
|
|
1208
|
-
g(E, {
|
|
1209
|
-
label: "Add credit",
|
|
1210
|
-
icon: "add",
|
|
1211
|
-
variant: "plain",
|
|
1212
|
-
onClick: e[1] || (e[1] = (X) => q("credit", "send"))
|
|
1213
|
-
}),
|
|
1214
|
-
g(E, {
|
|
1215
|
-
label: "Deduct credit",
|
|
1216
|
-
icon: "remove",
|
|
1217
|
-
variant: "plain",
|
|
1218
|
-
onClick: e[2] || (e[2] = (X) => q("credit", "deduct"))
|
|
1219
|
-
})
|
|
1220
|
-
])
|
|
1221
|
-
];
|
|
1222
|
-
}),
|
|
1223
|
-
_: 1
|
|
1224
|
-
}),
|
|
1225
|
-
g(de, {
|
|
1226
|
-
class: "p-16 space-y-24",
|
|
1227
|
-
variant: "outlined"
|
|
1228
|
-
}, {
|
|
1229
|
-
default: se(() => {
|
|
1230
|
-
var v, V, ee, j, ce, ue, pe;
|
|
1231
|
-
return [
|
|
1232
|
-
r("div", io, [
|
|
1233
|
-
e[17] || (e[17] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point ", -1)),
|
|
1234
|
-
r("div", mo, M(((ee = (V = (v = m.member.collection) == null ? void 0 : v.COIN) == null ? void 0 : V[0]) == null ? void 0 : ee.balance) ?? 0), 1)
|
|
1235
|
-
]),
|
|
1236
|
-
r("div", co, [
|
|
1237
|
-
e[18] || (e[18] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point(s) to be expired in 30 days ", -1)),
|
|
1238
|
-
r("div", uo, M(((pe = (ue = (ce = (j = m.member.collection) == null ? void 0 : j.COIN) == null ? void 0 : ce[0]) == null ? void 0 : ue.expiryBalance) == null ? void 0 : pe.reduce(
|
|
1239
|
-
(X, J) => J.expiredAt && t(h)(J.expiredAt).isAfter(t(h)()) && t(h)(J.expiredAt).isBefore(t(h)().add(30, "days")) ? X + J.amount : X,
|
|
1240
|
-
0
|
|
1241
|
-
)) ?? 0), 1)
|
|
1242
|
-
]),
|
|
1243
|
-
r("div", po, [
|
|
1244
|
-
g(E, {
|
|
1245
|
-
label: "Add point",
|
|
1246
|
-
icon: "add",
|
|
1247
|
-
variant: "plain",
|
|
1248
|
-
onClick: e[3] || (e[3] = (X) => q("coin", "send"))
|
|
1249
|
-
}),
|
|
1250
|
-
g(E, {
|
|
1251
|
-
label: "Deduct point",
|
|
1252
|
-
icon: "remove",
|
|
1253
|
-
variant: "plain",
|
|
1254
|
-
onClick: e[4] || (e[4] = (X) => q("coin", "deduct"))
|
|
1255
|
-
})
|
|
1256
|
-
])
|
|
1257
|
-
];
|
|
1258
|
-
}),
|
|
1259
|
-
_: 1
|
|
1260
|
-
})
|
|
1261
|
-
])) : t(C).value == "voucher" ? (i(), I(Ct, {
|
|
1262
|
-
key: 2,
|
|
1263
|
-
member: a.member
|
|
1264
|
-
}, null, 8, ["member"])) : t(C).value == "mission" ? (i(), I(St, {
|
|
1265
|
-
key: 3,
|
|
1266
|
-
member: a.member
|
|
1267
|
-
}, null, 8, ["member"])) : t(C).value == "game" ? (i(), I(wt, {
|
|
1268
|
-
key: 4,
|
|
1269
|
-
member: a.member
|
|
1270
|
-
}, null, 8, ["member"])) : oe("", !0)
|
|
1271
|
-
])
|
|
1272
|
-
]),
|
|
1273
|
-
_: 1
|
|
1274
|
-
}, 8, ["modelValue"]);
|
|
1275
|
-
};
|
|
1276
|
-
}
|
|
1277
|
-
});
|
|
1278
|
-
export {
|
|
1279
|
-
Ko as _,
|
|
1280
|
-
pt as u
|
|
1281
|
-
};
|