@feedmepos/mf-connect 0.1.128-dev → 0.1.129-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-CPSC0ccq.js → App-CgtQ9UIg.js} +215 -223
- package/dist/{Bin-Cn7sCPql.js → Bin-DMgRFBtT.js} +8 -8
- package/dist/{Broadcast-bR7HAyV2.js → Broadcast-BBoLXcAt.js} +21 -22
- package/dist/{CampaignAnalytic-Dnpw_Jwo.js → CampaignAnalytic-7id6XGu5.js} +6 -6
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-HaWMLA4s.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-6QxiK0J7.js} +10 -9
- package/dist/{Card-BE3Y0KHF.js → Card-BfqTdIhC.js} +23 -23
- package/dist/{Collections-CLSp9Uah.js → Collections-Ca5iBZQN.js} +185 -197
- package/dist/{Credit-DgMyKROt.js → Credit-DM-hrq47.js} +20 -21
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-D8eCQE4D.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CuWzYh0T.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-fch7sWPv.js +3638 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CXw7yS8N.js → EffectSheet.vue_vue_type_style_index_0_lang-COGdYitL.js} +33 -33
- package/dist/{Experience-CCeRbvIe.js → Experience-Esl5jJIv.js} +31 -32
- package/dist/{FileSaver.min-D8Rw2VVN.js → FileSaver.min-COdUgnCD.js} +1 -1
- package/dist/{Game-CYGg8vWQ.js → Game-CUayhiK9.js} +18 -19
- package/dist/{GiftCardSetup-rzea90xr.js → GiftCardSetup-BFnYVo6x.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BFUBfL-S.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-BwVSP2tE.js} +128 -140
- package/dist/{Goals-BnZfK7a3.js → Goals-F7WJ5oYC.js} +4 -4
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Cw2imjlQ.js → ImageInput.vue_vue_type_script_setup_true_lang-CqDz9E6H.js} +1 -1
- package/dist/{Index-DjZi_lVg.js → Index-DVu2x3VY.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B1q4NtuM.js → LocationPicker.vue_vue_type_script_setup_true_lang-CrF5V3bJ.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CUjzbMcb.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CBLORz65.js} +1 -1
- package/dist/{LoyaltyDashboard-C3TZSSQz.js → LoyaltyDashboard-BXtAIIwE.js} +14 -14
- package/dist/{MainLayout-uNGpBpJi.js → MainLayout-BoQpqLPT.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-0PcswtGl.js → MainLayout.vue_vue_type_script_setup_true_lang-CoDtG7GL.js} +3 -3
- package/dist/{Marketing-SXmxcw3-.js → Marketing-CSFifAsA.js} +4 -4
- package/dist/{MarketingMaterialEdit-DK0tjHpF.js → MarketingMaterialEdit-2UgbFmpl.js} +211 -214
- package/dist/{Member-BFSwupq6.js → Member-BP_B3BvA.js} +7 -7
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-CjllSBjR.js +1308 -0
- package/dist/{MemberImportHistory-z12l_IAQ.js → MemberImportHistory-B3d0xGVj.js} +7 -7
- package/dist/{MemberList-DfN7ur0J.js → MemberList-CmRijOUZ.js} +105 -103
- package/dist/{MemberTransactions-Bntt4bRR.js → MemberTransactions-9gxO0FZF.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-ComtYItw.js → MessageInput.vue_vue_type_script_setup_true_lang-TrfCfwiu.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-_Imnj16x.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DsKAiGQG.js} +1 -1
- package/dist/{Mission-CvpeYVjB.js → Mission-YZoqUj_8.js} +21 -22
- package/dist/{Overview-BtTkltlY.js → Overview-Cm4UvReJ.js} +144 -145
- package/dist/{Overview-BkaFC5La.js → Overview-D5W62m_5.js} +21 -21
- package/dist/{Point-CpNAFABM.js → Point-B6PYl0Av.js} +21 -22
- package/dist/{Promotion-B_vD_9UF.js → Promotion-D6IVdgP9.js} +131 -137
- package/dist/{Queue-D5jDhI0f.js → Queue-CrAJB-NQ.js} +46 -46
- package/dist/{Record-EsNXzy4D.js → Record-BxBSeGCs.js} +9 -9
- package/dist/{Review-ByMrkymf.js → Review-CpewMLNi.js} +2 -2
- package/dist/ReviewFacebookCallback-BUwvOweo.js +238 -0
- package/dist/{ReviewGoogleCallback-BzU-hUy5.js → ReviewGoogleCallback-DgR17qMj.js} +5 -5
- package/dist/{Reward-kxAuVGDE.js → Reward-FQA-iBCK.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-i9B1R3XP.js → RewardGroup.vue_vue_type_script_setup_true_lang-DPUuepSH.js} +14 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B9mhQFnd.js +1884 -0
- package/dist/{Segment-C5SJs7al.js → Segment-CUlSXXCp.js} +307 -304
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-RIerABcb.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BBx4Vsad.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8jS4gee.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DNQwB2po.js} +4 -4
- package/dist/{Setting-zmlu3QcR.js → Setting-4m9maYGQ.js} +17 -17
- package/dist/{SettingAdvertisements-DewXGZoE.js → SettingAdvertisements-B2TVVGk_.js} +12 -12
- package/dist/Settings-DnYKPpMT.js +179 -0
- package/dist/{Store-CiTwDcgr.js → Store-CiNooWmM.js} +29 -29
- package/dist/{StoreRewards-DaOJxsVm.js → StoreRewards-Do7Y0tmg.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BTqxeKR4.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BNnXXDOX.js} +25 -25
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Tx5gxGgN.js +142 -0
- package/dist/{Tier-lNI7GWMP.js → Tier-C51gzsGE.js} +688 -2583
- package/dist/{Title-CDxDztnl.js → Title-Dz1_3FI-.js} +95 -96
- package/dist/{Transaction-CcsUvIns.js → Transaction-Uow2MU3k.js} +2 -2
- package/dist/{Upselling-BDirPkWX.js → Upselling-ljPWgZm_.js} +3 -3
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hqzfBpop.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Dk082NOB.js} +26 -26
- package/dist/{Voucher-CJDo5U_P.js → Voucher-BahN-_B8.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-WjsLHh_E.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C5YJIrEQ.js} +12 -12
- package/dist/{WhatsappAccount-CQBti7RJ.js → WhatsappAccount-BsJfi4aQ.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DVNZ774z.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D6Q2lt81.js} +1 -1
- package/dist/{WhatsappBot-91lIlikm.js → WhatsappBot-DsETxGDb.js} +7 -7
- package/dist/{WhatsappBotLogs-PQTwT8e5.js → WhatsappBotLogs-rxhWcCic.js} +5 -5
- package/dist/{WhatsappBotSettings-CUES9UL-.js → WhatsappBotSettings-BVVqPUuB.js} +5 -5
- package/dist/{WhatsappLayout-pZGYJj0J.js → WhatsappLayout-ww0HSVET.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DAoonwsO.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-PRbvIqZI.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-HEIeZYCP.js → ZodTextField.vue_vue_type_script_setup_true_lang-B3kaDL4W.js} +2 -2
- package/dist/{app--pRyBODF.js → app-DRy3Qq-e.js} +3380 -4144
- package/dist/app.js +3 -4
- package/dist/{base.export-CSdCmt-6.js → base.export-CjcYq9u_.js} +2 -2
- package/dist/business-DyQFxLGA.js +82 -0
- package/dist/{campaign-CwQjWU63.js → campaign-CWGgZxbn.js} +94 -121
- package/dist/{campaign-t9ubUkjB.js → campaign-Diyxk6-K.js} +25 -31
- package/dist/{campaign.enum-Damu7hgo.js → campaign.enum-CkIW-mae.js} +2 -3
- package/dist/campaign.fn-DmM_bev0.js +776 -0
- package/dist/{collectible.enum-C8LbgIQ7.js → collectible.enum-BXcUSpN2.js} +1 -1
- package/dist/{collection.fn-BV7pDqa5.js → collection.fn-BZuMGmeM.js} +2 -2
- package/dist/{currency-pS0xeJA6.js → currency-B0CeepgW.js} +1 -1
- package/dist/{effect-B532leFF.js → effect-C3tRo5Vc.js} +1 -1
- package/dist/{email-addresses-CKkT_5O5.js → email-addresses-CPm5eBoR.js} +2 -2
- package/dist/{feature-flag-25oDCLLB.js → feature-flag-COBMyDEn.js} +84 -84
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-DxOj04aq.js → helper-scL87EvT.js} +1 -1
- package/dist/{index-C7wVaeC1.js → index-40lptiZw.js} +1 -1
- package/dist/{index-BCgTcZ7c.js → index-4D44dKUi.js} +252 -609
- package/dist/{index-ip2EqUEW.js → index-BUGWEUx9.js} +1 -1
- package/dist/{index-DEENB4la.js → index-BWu5WNw5.js} +198 -198
- package/dist/{index-DBzCfWxW.js → index-BaqeaRIe.js} +2 -2
- package/dist/{index-DVlo0TO9.js → index-BefX1Cnk.js} +23 -23
- package/dist/{index-BHnMLtU2.js → index-BexTIIOc.js} +235 -381
- package/dist/{index-ClD2-18P.js → index-C55j-xHV.js} +6 -19
- package/dist/{index-B3sR1LMa.js → index-CHzG8fUk.js} +7 -7
- package/dist/{index-Diw9710S.js → index-CLwEr_8O.js} +4 -4
- package/dist/{index-DiYuhtNS.js → index-CW-lY5-3.js} +4 -4
- package/dist/{index-C6pr4oIv.js → index-CWAhvR-e.js} +1243 -1315
- package/dist/{index-uCkkfjE3.js → index-CpO-jDv5.js} +4 -4
- package/dist/{index-BFJ2FmB4.js → index-CsnGMcHq.js} +2 -2
- package/dist/{index-BViMt33t.js → index-Dc4-mMaE.js} +1 -1
- package/dist/{index-DqQ1q8sX.js → index-DcDRRNH6.js} +19 -26
- package/dist/{index-CBYY3VEG.js → index-DsP7OUWn.js} +2614 -2700
- package/dist/{index-BX6lcJDB.js → index-OMMh3tr2.js} +1 -1
- package/dist/{index-C_qmnOKQ.js → index-VR97zHF5.js} +9 -9
- package/dist/{index-DSAEs8u0.js → index-koWxgq3V.js} +1 -1
- package/dist/{index-BLRv_4gJ.js → index-tn-XNvX5.js} +1 -1
- package/dist/{index-DBT1f1M3.js → index-xopF1dSo.js} +2 -2
- package/dist/{index.esm2017-DRrIFPLo.js → index.esm2017-T25AMY_y.js} +93 -93
- package/dist/{loading--SZI7Tpo.js → loading-BYmbcfaQ.js} +1 -1
- package/dist/{lodash-BZqvXM_P.js → lodash-7z2rsw4O.js} +1 -1
- package/dist/{member-import-Bmt1OdRW.js → member-import-BI7Pvj61.js} +2 -2
- package/dist/{membership-BTFpH7Mg.js → membership-BrZIRGS0.js} +3 -3
- package/dist/{money-BVtlYyxo.js → money-DdNo8GRv.js} +1 -1
- package/dist/{number-DrOdGSrF.js → number-Gfw2iUoP.js} +1 -1
- package/dist/objectid-D-yjbqcO.js +145 -0
- package/dist/{onboarding-BjcSBC8v.js → onboarding-CUqT7rpt.js} +25 -25
- package/dist/{onboardingSetup-Dcv8i8qd.js → onboardingSetup-BC5HuwKA.js} +2 -2
- package/dist/{plugins-Iw52rJ1s.js → plugins-DlLEAHTq.js} +3 -3
- package/dist/{reward-DF9tE7iA.js → reward-D038cMaw.js} +1 -1
- package/dist/{rule-rCPhlgAq.js → rule-BVpbZ7F8.js} +492 -572
- package/dist/rule-builder-DA9K7mBN.js +102 -0
- package/dist/style.css +1 -1
- package/dist/template-CgJvGx2j.js +275 -0
- package/dist/{transaction.fn-Cp3ylqFD.js → transaction.fn-PmR-QOML.js} +2 -2
- package/dist/{trigger-O6JvCms4.js → trigger-DjOMEcv_.js} +9 -9
- package/dist/{useMarketingMaterialActions-Cnadk3AO.js → useMarketingMaterialActions-D2fkr1yK.js} +4 -4
- package/dist/{usePagination-C5lSxdqt.js → usePagination-oq_rR3Lp.js} +1 -1
- package/dist/{user-B7iv0TRE.js → user-CkwZIW3i.js} +1 -1
- package/dist/vue-i18n-1lTcxtBS.js +2365 -0
- package/dist/{xlsx-DTJ6bUKL.js → xlsx-BtcfpQDU.js} +381 -381
- package/dist/{zod-cIIx_Ng9.js → zod-CUrnHp4O.js} +1 -1
- package/package.json +2 -6
- package/dist/AuditLogs-CgrYStwa.js +0 -2016
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BB2gszsG.js +0 -4584
- package/dist/Grab-BRbn6ffm.js +0 -301
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dvcasf5O.js +0 -1322
- package/dist/ReviewFacebookCallback-BDl6NBkw.js +0 -225
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D3MZsh4A.js +0 -1923
- package/dist/Settings-5HU_uY6B.js +0 -286
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DlFCI1BT.js +0 -7007
- package/dist/business-BtEfH8Mt.js +0 -83
- package/dist/campaign.fn-D3_OzyyQ.js +0 -776
- package/dist/duplicateCampaign-19CDT2kM.js +0 -51
- package/dist/google-BQK68wbe.js +0 -5
- package/dist/objectid-DdJFC6TI.js +0 -145
- package/dist/template-v1F1rvUU.js +0 -227
- package/dist/vue-i18n-CYFvlTTS.js +0 -2365
|
@@ -0,0 +1,1308 @@
|
|
|
1
|
+
import { defineComponent as ie, computed as L, ref as K, resolveComponent as A, openBlock as i, createElementBlock as w, Fragment as U, createElementVNode as o, unref as t, createBlock as D, createCommentVNode as te, createVNode as g, renderList as J, withCtx as le, createTextVNode as ye, toDisplayString as S, withDirectives as Ve, vShow as Be, watch as $e, onBeforeMount as Ie, h as ae, onMounted as De, isRef as Ye, normalizeClass as Ne } from "vue";
|
|
2
|
+
import { h } from "./moment-D7p2TMB-.js";
|
|
3
|
+
import { c as Ue } from "./index-CHzG8fUk.js";
|
|
4
|
+
import { u as Ee, C as we, s as Oe } from "./membership-BrZIRGS0.js";
|
|
5
|
+
import { useDialog as Ce, components as Fe } from "@feedmepos/ui-library";
|
|
6
|
+
import { _ as Me } from "./lodash-7z2rsw4O.js";
|
|
7
|
+
import { D as Pe } from "./type_drinks-D6jnpvwV.js";
|
|
8
|
+
import { b as Re, c as je, d as Le, e as qe, f as ze } from "./index-CWAhvR-e.js";
|
|
9
|
+
import "./index-CW-lY5-3.js";
|
|
10
|
+
import { c as ke, f as Ae } from "./string-Gcy5IM_H.js";
|
|
11
|
+
import { u as Ge } from "./loading-BYmbcfaQ.js";
|
|
12
|
+
import { p as Te } from "./plugins-DlLEAHTq.js";
|
|
13
|
+
import { C as _e } from "./collection.fn-BZuMGmeM.js";
|
|
14
|
+
import { defineStore as He } from "pinia";
|
|
15
|
+
import { u as Ke } from "./business-DyQFxLGA.js";
|
|
16
|
+
import { f as j } from "./number-Gfw2iUoP.js";
|
|
17
|
+
import "./index-DsP7OUWn.js";
|
|
18
|
+
import "./index-BexTIIOc.js";
|
|
19
|
+
import "./index-4D44dKUi.js";
|
|
20
|
+
import "./index-CpO-jDv5.js";
|
|
21
|
+
import "./index-koWxgq3V.js";
|
|
22
|
+
import "./index-DcDRRNH6.js";
|
|
23
|
+
import "./index-40lptiZw.js";
|
|
24
|
+
import { s as We } from "./index-CuvNtC_M.js";
|
|
25
|
+
import { u as Xe, _ as Je } from "./usePagination-oq_rR3Lp.js";
|
|
26
|
+
import { B as Qe, e as Ze } from "./base.export-CjcYq9u_.js";
|
|
27
|
+
import { m as ve } from "./index-C55j-xHV.js";
|
|
28
|
+
import { o as ge } from "./objectId-dwaoBfJX.js";
|
|
29
|
+
import { F as he } from "./collectible.enum-BXcUSpN2.js";
|
|
30
|
+
import { g as et, b as tt } from "./campaign-CWGgZxbn.js";
|
|
31
|
+
import { useRouter as ot } from "vue-router";
|
|
32
|
+
import { m as ue } from "./index-xopF1dSo.js";
|
|
33
|
+
import { t as rt } from "./index-BefX1Cnk.js";
|
|
34
|
+
import { R as nt } from "./app-DRy3Qq-e.js";
|
|
35
|
+
const st = { class: "flex flex-col" }, lt = { key: 1 }, at = { class: "flex flex-nowrap gap-4 items-center my-[-4px]" }, it = { class: "flex flex-nowrap gap-8 items-center pt-24 w-full" }, mt = /* @__PURE__ */ ie({
|
|
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 de, oe, re, W;
|
|
49
|
+
const F = Ce(), p = Ee(), b = m, s = L(
|
|
50
|
+
() => {
|
|
51
|
+
var u;
|
|
52
|
+
return (((u = b.member.collection) == null ? void 0 : u.TITLE) ?? []).reduce(
|
|
53
|
+
(l, _) => {
|
|
54
|
+
var q, z, R, X, N;
|
|
55
|
+
const C = p.sortedTitles.find(
|
|
56
|
+
(Q) => Q._id.toString() === _.collectible
|
|
57
|
+
);
|
|
58
|
+
if (!C) return l;
|
|
59
|
+
const P = [..._.expiryBalance ?? []].sort(
|
|
60
|
+
(Q, me) => h(Q.expiredAt).isAfter(h(me.expiredAt)) ? -1 : 1
|
|
61
|
+
);
|
|
62
|
+
return (q = P[0]) != null && q.expiredAt && h((z = P[0]) == null ? void 0 : z.expiredAt).isBefore(h()) || l.push({
|
|
63
|
+
_id: C._id,
|
|
64
|
+
name: C.name,
|
|
65
|
+
expiredAt: (R = P[0]) != null && R.expiredAt ? h((X = P[0]) == null ? void 0 : X.expiredAt).toISOString() : "",
|
|
66
|
+
expiresIn: h((N = P[0]) == null ? void 0 : N.expiredAt).diff(h(), "days")
|
|
67
|
+
}), l;
|
|
68
|
+
},
|
|
69
|
+
[]
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
), r = K({
|
|
73
|
+
cardNo: b.member.cardNo,
|
|
74
|
+
experience: ((oe = (de = b.member.collection) == null ? void 0 : de.POINT) == null ? void 0 : oe[0].balance) ?? 0,
|
|
75
|
+
tier: ((W = (re = b.member.collection) == null ? void 0 : re.TIER) == null ? void 0 : W[0].balance) ?? -1,
|
|
76
|
+
titles: s.value.map((u) => ({ expiredAt: u.expiresIn, id: u._id })) ?? void 0
|
|
77
|
+
}), c = L(
|
|
78
|
+
() => (p.sortedTitles ?? []).map((u) => ({
|
|
79
|
+
label: u.name,
|
|
80
|
+
value: u._id.toString(),
|
|
81
|
+
sublabel: s.value.some((l) => l._id === u._id) ? "Owned" : void 0
|
|
82
|
+
}))
|
|
83
|
+
), d = L(() => (p.sortedTiers ?? []).map((u, l) => ({
|
|
84
|
+
label: u.name,
|
|
85
|
+
sublabel: `${u.option.from} - ${u.option.to}`,
|
|
86
|
+
from: u.option.from,
|
|
87
|
+
to: u.option.to,
|
|
88
|
+
value: l + 1
|
|
89
|
+
})));
|
|
90
|
+
function x() {
|
|
91
|
+
var _, C;
|
|
92
|
+
const u = ((_ = d.value[(r.value.tier ?? 1) - 1]) == null ? void 0 : _.from) ?? 0, l = (C = d.value[(r.value.tier ?? 1) - 1]) == null ? void 0 : C.to;
|
|
93
|
+
r.value.experience = Math.min(
|
|
94
|
+
l ?? u,
|
|
95
|
+
Math.max(u, r.value.experience ?? 0)
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
const a = L(() => {
|
|
99
|
+
var _, C, P, q, z, R;
|
|
100
|
+
const u = ((C = (_ = b.member.collection) == null ? void 0 : _.TIER) == null ? void 0 : C[0].balance) ?? -1, l = ((q = (P = b.member.collection) == null ? void 0 : P.POINT) == null ? void 0 : q[0].balance) ?? 0;
|
|
101
|
+
if (u != r.value.tier) return !0;
|
|
102
|
+
if (r.value.experience && r.value.experience != l) {
|
|
103
|
+
const X = ((z = d.value[u - 1]) == null ? void 0 : z.from) ?? 0, N = ((R = d.value[u - 1]) == null ? void 0 : R.to) ?? 0;
|
|
104
|
+
if (r.value.experience < X || N && r.value.experience > N)
|
|
105
|
+
return !0;
|
|
106
|
+
}
|
|
107
|
+
return !1;
|
|
108
|
+
});
|
|
109
|
+
function f(u) {
|
|
110
|
+
var l;
|
|
111
|
+
return (l = s.value.find((_) => _._id === u)) == null ? void 0 : l.expiresIn;
|
|
112
|
+
}
|
|
113
|
+
const k = L(() => {
|
|
114
|
+
const u = Re.safeParse(r.value);
|
|
115
|
+
return u.success ? void 0 : u.error.errors;
|
|
116
|
+
});
|
|
117
|
+
function V(u) {
|
|
118
|
+
var l, _;
|
|
119
|
+
return (_ = (l = k.value) == null ? void 0 : l.find((C) => C.path.join(".") === u)) == null ? void 0 : _.message;
|
|
120
|
+
}
|
|
121
|
+
function O(u) {
|
|
122
|
+
var l;
|
|
123
|
+
return (l = k.value) == null ? void 0 : l.filter((_) => _.path.join(".").startsWith(u)).map((_) => _.message);
|
|
124
|
+
}
|
|
125
|
+
async function Y() {
|
|
126
|
+
await b.onSubmit(r.value), F.close();
|
|
127
|
+
}
|
|
128
|
+
return (u, l) => {
|
|
129
|
+
var Q, me;
|
|
130
|
+
const _ = A("FmSelect"), C = A("FmStepperField"), P = A("FmTextField"), q = A("FmField"), z = A("FmFormGroup"), R = A("FmButton"), X = A("FmHelperText"), N = A("FmSpacer");
|
|
131
|
+
return i(), w(U, null, [
|
|
132
|
+
o("div", st, [
|
|
133
|
+
l[6] || (l[6] = o("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1)),
|
|
134
|
+
t(d).length ? (i(), D(_, {
|
|
135
|
+
key: 0,
|
|
136
|
+
modelValue: t(r).tier,
|
|
137
|
+
"onUpdate:modelValue": [
|
|
138
|
+
l[0] || (l[0] = (M) => t(r).tier = M),
|
|
139
|
+
x
|
|
140
|
+
],
|
|
141
|
+
label: "Member Tier",
|
|
142
|
+
items: t(d),
|
|
143
|
+
"helper-text": V("tier"),
|
|
144
|
+
"helper-state": V("tier") ? "error" : void 0
|
|
145
|
+
}, null, 8, ["modelValue", "items", "helper-text", "helper-state"])) : te("", !0),
|
|
146
|
+
g(C, {
|
|
147
|
+
"model-value": t(r).experience ?? 0,
|
|
148
|
+
"onUpdate:modelValue": l[1] || (l[1] = (M) => t(r).experience = M),
|
|
149
|
+
label: "Member Experience",
|
|
150
|
+
"max-fraction-digits": 0,
|
|
151
|
+
"helper-text": V("experience"),
|
|
152
|
+
"helper-state": V("experience") ? "error" : void 0
|
|
153
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
154
|
+
l[7] || (l[7] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1)),
|
|
155
|
+
g(P, {
|
|
156
|
+
modelValue: t(r).cardNo,
|
|
157
|
+
"onUpdate:modelValue": l[2] || (l[2] = (M) => t(r).cardNo = M),
|
|
158
|
+
label: "Card number",
|
|
159
|
+
"helper-text": V("cardNo"),
|
|
160
|
+
"helper-state": V("cardNo") ? "error" : void 0
|
|
161
|
+
}, null, 8, ["modelValue", "helper-text", "helper-state"]),
|
|
162
|
+
l[8] || (l[8] = o("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1)),
|
|
163
|
+
(Q = t(r).titles) != null && Q.length ? (i(), w("div", lt, [...l[5] || (l[5] = [
|
|
164
|
+
o("div", { class: "flex flex-nowrap gap-4 items-center" }, [
|
|
165
|
+
o("div", { class: "flex-1" }, "Title"),
|
|
166
|
+
o("div", { class: "flex-1" }, "Expires in days"),
|
|
167
|
+
o("div", { class: "w-24 h-1" })
|
|
168
|
+
], -1)
|
|
169
|
+
])])) : te("", !0),
|
|
170
|
+
(i(!0), w(U, null, J(t(r).titles ?? [], (M, B) => (i(), w("div", { key: B }, [
|
|
171
|
+
o("div", at, [
|
|
172
|
+
t(s).some((T) => T._id === M.id) ? (i(), D(z, {
|
|
173
|
+
key: 1,
|
|
174
|
+
"model-value": "",
|
|
175
|
+
class: "flex-1"
|
|
176
|
+
}, {
|
|
177
|
+
default: le(() => [
|
|
178
|
+
g(q, {
|
|
179
|
+
disabled: !0,
|
|
180
|
+
class: "text-fm-color-typo-secondary"
|
|
181
|
+
}, {
|
|
182
|
+
default: le(() => {
|
|
183
|
+
var T;
|
|
184
|
+
return [
|
|
185
|
+
ye(S((T = t(c).find((n) => n.value === M.id)) == null ? void 0 : T.label), 1)
|
|
186
|
+
];
|
|
187
|
+
}),
|
|
188
|
+
_: 2
|
|
189
|
+
}, 1024)
|
|
190
|
+
]),
|
|
191
|
+
_: 2
|
|
192
|
+
}, 1024)) : (i(), D(_, {
|
|
193
|
+
key: 0,
|
|
194
|
+
modelValue: M.id,
|
|
195
|
+
"onUpdate:modelValue": [(T) => M.id = T, (T) => M.expiredAt = f(T) ?? 1],
|
|
196
|
+
class: "flex-1",
|
|
197
|
+
items: t(c).filter(
|
|
198
|
+
(T) => {
|
|
199
|
+
var n;
|
|
200
|
+
return !((n = t(r).titles) != null && n.map((e) => e.id).includes(T.value)) || M.id === T.value;
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "items"])),
|
|
204
|
+
g(C, {
|
|
205
|
+
modelValue: M.expiredAt,
|
|
206
|
+
"onUpdate:modelValue": (T) => M.expiredAt = T,
|
|
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(R, {
|
|
215
|
+
class: "w-24 h-24",
|
|
216
|
+
icon: "close",
|
|
217
|
+
variant: "tertiary",
|
|
218
|
+
onClick: (T) => {
|
|
219
|
+
var n;
|
|
220
|
+
return (n = t(r).titles) == null ? void 0 : n.splice(B, 1);
|
|
221
|
+
}
|
|
222
|
+
}, null, 8, ["onClick"])
|
|
223
|
+
]),
|
|
224
|
+
(i(!0), w(U, null, J(O(`titles.${B}`), (T, n) => (i(), D(X, {
|
|
225
|
+
key: n,
|
|
226
|
+
class: "items-center",
|
|
227
|
+
state: "error",
|
|
228
|
+
text: T.toString()
|
|
229
|
+
}, null, 8, ["text"]))), 128))
|
|
230
|
+
]))), 128)),
|
|
231
|
+
t(c).length && (((me = t(r).titles) == null ? void 0 : me.length) ?? 0) < t(c).length ? (i(), D(R, {
|
|
232
|
+
key: 2,
|
|
233
|
+
icon: "add",
|
|
234
|
+
label: "Give title",
|
|
235
|
+
variant: "plain",
|
|
236
|
+
onClick: l[3] || (l[3] = (M) => {
|
|
237
|
+
var B;
|
|
238
|
+
return t(r).titles = [
|
|
239
|
+
...t(r).titles ?? [],
|
|
240
|
+
{
|
|
241
|
+
id: ((B = t(c).find(
|
|
242
|
+
(T) => {
|
|
243
|
+
var n;
|
|
244
|
+
return !((n = t(r).titles) != null && n.map((e) => e.id).includes(T.value));
|
|
245
|
+
}
|
|
246
|
+
)) == null ? void 0 : B.value) || t(c)[0].value,
|
|
247
|
+
expiredAt: 0
|
|
248
|
+
}
|
|
249
|
+
];
|
|
250
|
+
})
|
|
251
|
+
})) : te("", !0)
|
|
252
|
+
]),
|
|
253
|
+
o("div", it, [
|
|
254
|
+
Ve(g(X, {
|
|
255
|
+
state: "warning",
|
|
256
|
+
text: "Updating member will cause tier to change"
|
|
257
|
+
}, null, 512), [
|
|
258
|
+
[Be, t(a)]
|
|
259
|
+
]),
|
|
260
|
+
g(N),
|
|
261
|
+
g(R, {
|
|
262
|
+
variant: "secondary",
|
|
263
|
+
label: "Cancel",
|
|
264
|
+
size: "md",
|
|
265
|
+
onClick: l[4] || (l[4] = (M) => t(F).close())
|
|
266
|
+
}),
|
|
267
|
+
g(R, {
|
|
268
|
+
disabled: !!t(k),
|
|
269
|
+
variant: "primary",
|
|
270
|
+
label: "Submit",
|
|
271
|
+
size: "md",
|
|
272
|
+
onClick: Y
|
|
273
|
+
}, null, 8, ["disabled"])
|
|
274
|
+
])
|
|
275
|
+
], 64);
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
}), dt = { class: "fm-typo-en-title-sm-800" }, ct = { class: "space-y-16" }, ut = { class: "flex flex-nowrap gap-8 items-center justify-end pt-24 w-full" }, pt = /* @__PURE__ */ ie({
|
|
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(), p = m, b = K({
|
|
290
|
+
amount: 1,
|
|
291
|
+
day: 1,
|
|
292
|
+
remark: void 0
|
|
293
|
+
}), s = K(!0), r = L(() => _e.formattedType(p.type.toUpperCase()));
|
|
294
|
+
function c(a) {
|
|
295
|
+
s.value = a, !a && p.type === "coin" && (b.value.day = void 0);
|
|
296
|
+
}
|
|
297
|
+
async function d() {
|
|
298
|
+
if (p.action === "send") {
|
|
299
|
+
const a = b.value.day ? `, expire in ${b.value.day} days` : "";
|
|
300
|
+
Te.confirm(
|
|
301
|
+
`Are you sure to send ${b.value.amount} ${r.value.toLowerCase()}${a}? This action cannot be reversed.`
|
|
302
|
+
).then(async (f) => {
|
|
303
|
+
f && await p.onSubmit(b.value);
|
|
304
|
+
});
|
|
305
|
+
} else
|
|
306
|
+
Te.confirm(
|
|
307
|
+
`Are you sure to deduct ${b.value.amount} ${r.value.toLowerCase()}? This action cannot be reversed.`
|
|
308
|
+
).then(async (a) => {
|
|
309
|
+
a && await p.onSubmit(b.value);
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
const x = L(() => {
|
|
313
|
+
const f = (p.action === "send" ? p.type === "coin" ? je : Le : p.type === "coin" ? qe : ze).safeParse(b.value);
|
|
314
|
+
return f.success == !1 ? f.error.flatten().fieldErrors : void 0;
|
|
315
|
+
});
|
|
316
|
+
return (a, f) => {
|
|
317
|
+
const k = A("FmStepperField"), V = A("FmSwitch"), O = A("FmTextarea"), Y = A("FmButton"), de = A("FmCard");
|
|
318
|
+
return i(), D(de, { class: "flex flex-col gap-16 p-16" }, {
|
|
319
|
+
default: le(() => {
|
|
320
|
+
var oe, re, W, u, l, _;
|
|
321
|
+
return [
|
|
322
|
+
o("div", dt, S(p.action == "send" ? "Send" : "Deduct") + " " + S(t(we)[p.type.toUpperCase()].name), 1),
|
|
323
|
+
ye(" " + S(t(x)) + " ", 1),
|
|
324
|
+
o("div", ct, [
|
|
325
|
+
g(k, {
|
|
326
|
+
modelValue: t(b).amount,
|
|
327
|
+
"onUpdate:modelValue": f[0] || (f[0] = (C) => t(b).amount = C),
|
|
328
|
+
label: `${t(we)[p.type.toUpperCase()].name} amount`,
|
|
329
|
+
"is-currency": !0,
|
|
330
|
+
"max-fraction-digits": 2,
|
|
331
|
+
"helper-state": (oe = t(x)) != null && oe.amount ? "error" : void 0,
|
|
332
|
+
"helper-text": (W = (re = t(x)) == null ? void 0 : re.amount) == null ? void 0 : W[0]
|
|
333
|
+
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
334
|
+
m.action === "send" && p.type === "coin" ? (i(), D(V, {
|
|
335
|
+
key: 0,
|
|
336
|
+
"model-value": t(s),
|
|
337
|
+
label: `${t(r)} expires`,
|
|
338
|
+
"label-placement": "right",
|
|
339
|
+
"onUpdate:modelValue": f[1] || (f[1] = (C) => c(C))
|
|
340
|
+
}, null, 8, ["model-value", "label"])) : te("", !0),
|
|
341
|
+
m.action === "send" && t(s) ? (i(), D(k, {
|
|
342
|
+
key: 1,
|
|
343
|
+
modelValue: t(b).day,
|
|
344
|
+
"onUpdate:modelValue": f[2] || (f[2] = (C) => t(b).day = C),
|
|
345
|
+
label: `${t(r)} expires in`,
|
|
346
|
+
"max-fraction-digits": 0,
|
|
347
|
+
"append-text": "day(s)",
|
|
348
|
+
max: 9999,
|
|
349
|
+
min: 0,
|
|
350
|
+
"helper-state": (u = t(x)) != null && u.day ? "error" : void 0,
|
|
351
|
+
"helper-text": (_ = (l = t(x)) == null ? void 0 : l.day) == null ? void 0 : _[0]
|
|
352
|
+
}, null, 8, ["modelValue", "label", "helper-state", "helper-text"])) : te("", !0),
|
|
353
|
+
g(O, {
|
|
354
|
+
modelValue: t(b).remark,
|
|
355
|
+
"onUpdate:modelValue": f[3] || (f[3] = (C) => t(b).remark = C),
|
|
356
|
+
label: "Remark"
|
|
357
|
+
}, null, 8, ["modelValue"])
|
|
358
|
+
]),
|
|
359
|
+
o("div", ut, [
|
|
360
|
+
g(Y, {
|
|
361
|
+
variant: "secondary",
|
|
362
|
+
label: "Cancel",
|
|
363
|
+
size: "md",
|
|
364
|
+
onClick: f[4] || (f[4] = (C) => t(F).close())
|
|
365
|
+
}),
|
|
366
|
+
g(Y, {
|
|
367
|
+
disabled: !!t(x),
|
|
368
|
+
variant: "primary",
|
|
369
|
+
label: "Submit",
|
|
370
|
+
size: "md",
|
|
371
|
+
onClick: f[5] || (f[5] = async () => d())
|
|
372
|
+
}, null, 8, ["disabled"])
|
|
373
|
+
])
|
|
374
|
+
];
|
|
375
|
+
}),
|
|
376
|
+
_: 1
|
|
377
|
+
});
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
}), ft = He("segment", () => {
|
|
381
|
+
const m = K([]);
|
|
382
|
+
async function F() {
|
|
383
|
+
const p = await Oe.readAll({
|
|
384
|
+
limit: 1e3,
|
|
385
|
+
skip: 0,
|
|
386
|
+
sortBy: "_id",
|
|
387
|
+
descending: !0
|
|
388
|
+
});
|
|
389
|
+
m.value = p.resources;
|
|
390
|
+
}
|
|
391
|
+
return {
|
|
392
|
+
segments: m,
|
|
393
|
+
read: F
|
|
394
|
+
};
|
|
395
|
+
});
|
|
396
|
+
class bt extends Qe {
|
|
397
|
+
}
|
|
398
|
+
const yt = { class: "border border-fm-color-neutral-gray-100 rounded-lg p-16" }, vt = { class: "hidden xs:!flex items-center justify-end" }, gt = { class: "flex items-center justify-between mb-4" }, xt = { class: "flex items-center justify-between gap-x-8" }, ht = { class: "fm-typo-en-body-lg-600" }, _t = { class: "px-4 py-0.5 rounded-md bg-fm-color-neutral-gray-100 fm-typo-en-body-md-600" }, Ct = { class: "xs:hidden flex justify-between gap-x-4" }, xe = /* @__PURE__ */ ie({
|
|
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, p = K({
|
|
428
|
+
search: ""
|
|
429
|
+
}), b = K(!1), { tableMeta: s, rowData: r, onSort: c, debouncedFetchData: d, onSearch: x } = Xe(async (f) => {
|
|
430
|
+
const k = {
|
|
431
|
+
...p.value,
|
|
432
|
+
...F.filters
|
|
433
|
+
};
|
|
434
|
+
return await ve.readCollectionsByMemberId(
|
|
435
|
+
F.member._id.toString(),
|
|
436
|
+
f,
|
|
437
|
+
k
|
|
438
|
+
);
|
|
439
|
+
});
|
|
440
|
+
$e(
|
|
441
|
+
p,
|
|
442
|
+
() => {
|
|
443
|
+
d();
|
|
444
|
+
},
|
|
445
|
+
{ deep: !0 }
|
|
446
|
+
);
|
|
447
|
+
async function a() {
|
|
448
|
+
try {
|
|
449
|
+
b.value = !0;
|
|
450
|
+
const f = {
|
|
451
|
+
...p.value,
|
|
452
|
+
...F.filters
|
|
453
|
+
};
|
|
454
|
+
await Ze({
|
|
455
|
+
exporter: new bt(),
|
|
456
|
+
readFunction: (k) => ve.readCollectionsByMemberId(
|
|
457
|
+
F.member._id.toString(),
|
|
458
|
+
k,
|
|
459
|
+
f
|
|
460
|
+
),
|
|
461
|
+
transformRecord: F.transformExportRecord,
|
|
462
|
+
filename: `${F.member._id.toString()}-${F.title.replace(" ", "-").toLowerCase()}`
|
|
463
|
+
});
|
|
464
|
+
} catch (f) {
|
|
465
|
+
console.error(f);
|
|
466
|
+
} finally {
|
|
467
|
+
b.value = !1;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return Ie(async () => {
|
|
471
|
+
await d();
|
|
472
|
+
}), (f, k) => {
|
|
473
|
+
const V = A("FmSearch"), O = A("FmButton");
|
|
474
|
+
return i(), w("div", yt, [
|
|
475
|
+
o("div", vt, [
|
|
476
|
+
g(V, {
|
|
477
|
+
class: "hidden xs:!flex",
|
|
478
|
+
modelValue: t(p).search,
|
|
479
|
+
"onUpdate:modelValue": [
|
|
480
|
+
k[0] || (k[0] = (Y) => t(p).search = Y),
|
|
481
|
+
t(x)
|
|
482
|
+
],
|
|
483
|
+
placeholder: "Search",
|
|
484
|
+
collapsible: ""
|
|
485
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
486
|
+
m.withExport ? (i(), D(O, {
|
|
487
|
+
key: 0,
|
|
488
|
+
icon: "ios_share",
|
|
489
|
+
variant: "tertiary",
|
|
490
|
+
onClick: a
|
|
491
|
+
})) : te("", !0)
|
|
492
|
+
]),
|
|
493
|
+
o("div", gt, [
|
|
494
|
+
o("div", xt, [
|
|
495
|
+
o("div", ht, S(F.title), 1),
|
|
496
|
+
o("div", _t, S(t(s).totalRows), 1)
|
|
497
|
+
]),
|
|
498
|
+
o("div", Ct, [
|
|
499
|
+
g(V, {
|
|
500
|
+
modelValue: t(p).search,
|
|
501
|
+
"onUpdate:modelValue": [
|
|
502
|
+
k[1] || (k[1] = (Y) => t(p).search = Y),
|
|
503
|
+
t(x)
|
|
504
|
+
],
|
|
505
|
+
placeholder: "Search"
|
|
506
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
507
|
+
m.withExport ? (i(), D(O, {
|
|
508
|
+
key: 0,
|
|
509
|
+
icon: "ios_share",
|
|
510
|
+
variant: "tertiary",
|
|
511
|
+
onClick: a
|
|
512
|
+
})) : te("", !0)
|
|
513
|
+
])
|
|
514
|
+
]),
|
|
515
|
+
g(Je, {
|
|
516
|
+
loading: t(s).isLoading,
|
|
517
|
+
"row-data": t(r),
|
|
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(c),
|
|
525
|
+
onPageChange: k[2] || (k[2] = (Y) => t(d)({
|
|
526
|
+
pageSize: Y.pageSize,
|
|
527
|
+
pageIndex: Y.pageIndex
|
|
528
|
+
}))
|
|
529
|
+
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
530
|
+
]);
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
}), St = /* @__PURE__ */ ie({
|
|
534
|
+
__name: "MemberVouchers",
|
|
535
|
+
props: {
|
|
536
|
+
member: {
|
|
537
|
+
type: Object,
|
|
538
|
+
required: !0
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
setup(m) {
|
|
542
|
+
const F = m, p = [
|
|
543
|
+
{
|
|
544
|
+
header: "Voucher title",
|
|
545
|
+
meta: {
|
|
546
|
+
maxWidth: "300px"
|
|
547
|
+
},
|
|
548
|
+
cell(r) {
|
|
549
|
+
var c;
|
|
550
|
+
return ae(
|
|
551
|
+
"div",
|
|
552
|
+
{ class: "text-ellipsis truncate" },
|
|
553
|
+
((c = r.row.original.pf_collectible) == null ? void 0 : c.name) || "-"
|
|
554
|
+
);
|
|
555
|
+
},
|
|
556
|
+
enableSorting: !1
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
header: "Claimed at",
|
|
560
|
+
accessorKey: "_id",
|
|
561
|
+
accessorFn: (r) => h(ge(r._id.toString())).format("D MMM YYYY"),
|
|
562
|
+
enableSorting: !1
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
header: "Expired at",
|
|
566
|
+
cell(r) {
|
|
567
|
+
var d, x, a, f;
|
|
568
|
+
const c = (x = (d = r.row.original.expiryBalance) == null ? void 0 : d[0]) != null && x.expiredAt ? h((f = (a = r.row.original.expiryBalance) == null ? void 0 : a[0]) == null ? void 0 : f.expiredAt).format(
|
|
569
|
+
"D MMM YYYY"
|
|
570
|
+
) : "-";
|
|
571
|
+
return ae("div", {}, c);
|
|
572
|
+
},
|
|
573
|
+
enableSorting: !0
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
header: "Transfer open",
|
|
577
|
+
accessorFn: (r) => {
|
|
578
|
+
var c, d, x;
|
|
579
|
+
return We((x = (d = (c = r.pf_collectible) == null ? void 0 : c.options) == null ? void 0 : d.enableTransfer) == null ? void 0 : x.toString());
|
|
580
|
+
},
|
|
581
|
+
enableSorting: !1
|
|
582
|
+
}
|
|
583
|
+
], b = (r) => ({
|
|
584
|
+
type: he.enum.VOUCHER,
|
|
585
|
+
isActive: r
|
|
586
|
+
}), s = (r) => {
|
|
587
|
+
var c, d, x, a, f, k, V;
|
|
588
|
+
return {
|
|
589
|
+
CollectionID: r._id,
|
|
590
|
+
Title: (c = r.pf_collectible) == null ? void 0 : c.name,
|
|
591
|
+
ClaimedAt: h(ge(r._id.toString())).format(
|
|
592
|
+
"D MMM YYYY, hh:mmA"
|
|
593
|
+
),
|
|
594
|
+
ExpiredAt: (x = (d = r.expiryBalance) == null ? void 0 : d[0]) != null && x.expiredAt ? h((f = (a = r.expiryBalance) == null ? void 0 : a[0]) == null ? void 0 : f.expiredAt).format("D MMM YYYY") : "",
|
|
595
|
+
TransferOpen: ((V = (k = r.pf_collectible) == null ? void 0 : k.options) == null ? void 0 : V.enableTransfer) || !1
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
return (r, c) => (i(), w(U, null, [
|
|
599
|
+
c[0] || (c[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Voucher Collections", -1)),
|
|
600
|
+
g(xe, {
|
|
601
|
+
member: F.member,
|
|
602
|
+
columns: p,
|
|
603
|
+
title: "Active voucher",
|
|
604
|
+
filters: b(!0),
|
|
605
|
+
withExport: !0,
|
|
606
|
+
transformExportRecord: s
|
|
607
|
+
}, null, 8, ["member", "filters"]),
|
|
608
|
+
g(xe, {
|
|
609
|
+
member: F.member,
|
|
610
|
+
columns: p,
|
|
611
|
+
title: "Past voucher",
|
|
612
|
+
filters: b(!1),
|
|
613
|
+
withExport: !0,
|
|
614
|
+
transformExportRecord: s
|
|
615
|
+
}, null, 8, ["member", "filters"])
|
|
616
|
+
], 64));
|
|
617
|
+
}
|
|
618
|
+
}), wt = /* @__PURE__ */ ie({
|
|
619
|
+
__name: "MemberMissions",
|
|
620
|
+
props: {
|
|
621
|
+
member: {
|
|
622
|
+
type: Object,
|
|
623
|
+
required: !0
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
setup(m) {
|
|
627
|
+
const F = m, p = [
|
|
628
|
+
{
|
|
629
|
+
header: "Mission title",
|
|
630
|
+
meta: {
|
|
631
|
+
maxWidth: "300px"
|
|
632
|
+
},
|
|
633
|
+
cell(s) {
|
|
634
|
+
var r;
|
|
635
|
+
return ae(
|
|
636
|
+
"div",
|
|
637
|
+
{ class: "text-ellipsis truncate" },
|
|
638
|
+
((r = s.row.original.pf_campaign) == null ? void 0 : r.name) || "Deleted Campaign"
|
|
639
|
+
);
|
|
640
|
+
},
|
|
641
|
+
enableSorting: !1
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
header: "Type",
|
|
645
|
+
accessorFn: (s) => {
|
|
646
|
+
var r, c, d;
|
|
647
|
+
return ke.title(((d = (c = (r = s == null ? void 0 : s.pf_collectible) == null ? void 0 : r.extras) == null ? void 0 : c.mission) == null ? void 0 : d.type) || "-");
|
|
648
|
+
},
|
|
649
|
+
enableSorting: !1
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
header: "Status",
|
|
653
|
+
cell(s) {
|
|
654
|
+
var r;
|
|
655
|
+
if (s.row.original.pf_campaign) {
|
|
656
|
+
const c = {
|
|
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 = et(
|
|
662
|
+
s.row.original.pf_campaign
|
|
663
|
+
), a = s.row.original.balance === s.row.original.pf_collectible.extras.mission.end && d === "active" ? "completed" : (r = s.row.original) != null && r.deactivatedAt ? "expired" : d;
|
|
664
|
+
return ae(Fe.FmChip, {
|
|
665
|
+
class: c[a],
|
|
666
|
+
label: ke.title(a),
|
|
667
|
+
compact: !0
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
return ae(Fe.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 ? tt(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 r, c, d;
|
|
692
|
+
return ((d = (c = (r = s == null ? void 0 : s.pf_collectible) == null ? void 0 : r.extras) == null ? void 0 : c.mission) == null ? void 0 : d.end) ?? 0;
|
|
693
|
+
},
|
|
694
|
+
enableSorting: !1
|
|
695
|
+
}
|
|
696
|
+
], b = {
|
|
697
|
+
type: he.enum.STAMP
|
|
698
|
+
};
|
|
699
|
+
return (s, r) => (i(), w(U, null, [
|
|
700
|
+
r[0] || (r[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Mission", -1)),
|
|
701
|
+
g(xe, {
|
|
702
|
+
member: F.member,
|
|
703
|
+
columns: p,
|
|
704
|
+
title: "Mission",
|
|
705
|
+
filters: b
|
|
706
|
+
}, null, 8, ["member"])
|
|
707
|
+
], 64));
|
|
708
|
+
}
|
|
709
|
+
}), Ft = /* @__PURE__ */ ie({
|
|
710
|
+
__name: "MemberGames",
|
|
711
|
+
props: {
|
|
712
|
+
member: {
|
|
713
|
+
type: Object,
|
|
714
|
+
required: !0
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
setup(m) {
|
|
718
|
+
const F = m, p = [
|
|
719
|
+
{
|
|
720
|
+
header: "Game title",
|
|
721
|
+
meta: {
|
|
722
|
+
maxWidth: "300px"
|
|
723
|
+
},
|
|
724
|
+
cell(s) {
|
|
725
|
+
var r;
|
|
726
|
+
return ae(
|
|
727
|
+
"div",
|
|
728
|
+
{ class: "text-ellipsis truncate" },
|
|
729
|
+
((r = s.row.original.pf_campaign) == null ? void 0 : r.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 c, d, x, a;
|
|
744
|
+
const r = (d = (c = s.row.original.expiryBalance) == null ? void 0 : c[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 ae("div", {}, r);
|
|
748
|
+
},
|
|
749
|
+
enableSorting: !1
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
header: "Token received",
|
|
753
|
+
accessorKey: "balance",
|
|
754
|
+
enableSorting: !1
|
|
755
|
+
}
|
|
756
|
+
], b = (s) => ({
|
|
757
|
+
type: he.enum.GAME,
|
|
758
|
+
isActive: s
|
|
759
|
+
});
|
|
760
|
+
return (s, r) => (i(), w(U, null, [
|
|
761
|
+
r[0] || (r[0] = o("div", { class: "fm-typo-en-title-sm-600 mb-16" }, "Game program", -1)),
|
|
762
|
+
g(xe, {
|
|
763
|
+
member: F.member,
|
|
764
|
+
columns: p,
|
|
765
|
+
title: "Active game token",
|
|
766
|
+
filters: b(!0)
|
|
767
|
+
}, null, 8, ["member", "filters"])
|
|
768
|
+
], 64));
|
|
769
|
+
}
|
|
770
|
+
}), Mt = { class: "flex flex-col flex-nowrap gap-y-24 max-h-full" }, kt = { class: "grid md:grid-cols-2 lg:grid-cols-2 gap-x-36 gap-y-24" }, At = { class: "space-y-16" }, Tt = { class: "flex gap-16 items-center" }, $t = { class: "flex-auto" }, Et = { class: "fm-typo-en-body-md-600" }, Vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, It = { class: "fm-typo-en-body-md-800" }, Dt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "fm-typo-en-body-md-600" }, Nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "fm-typo-en-body-md-800" }, Ot = { class: "gap-16 grid grid-cols-1" }, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-md-600" }, jt = { 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" }, Lt = { class: "flex justify-between mb-16" }, qt = { class: "fm-typo-en-title-sm-600" }, zt = ["onClick"], Gt = { class: "flex flex-col gap-y-16" }, Ht = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = { class: "fm-typo-en-body-md-600" }, Wt = { class: "space-y-8" }, Xt = {
|
|
771
|
+
key: 0,
|
|
772
|
+
class: "space-x-8"
|
|
773
|
+
}, Jt = {
|
|
774
|
+
key: 1,
|
|
775
|
+
class: "text-fm-color-typo-secondary"
|
|
776
|
+
}, Qt = { class: "space-y-8" }, Zt = ["src"], eo = { class: "fm-typo-en-body-md-600" }, to = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, oo = {
|
|
777
|
+
key: 1,
|
|
778
|
+
class: "text-fm-color-typo-secondary"
|
|
779
|
+
}, ro = {
|
|
780
|
+
key: 1,
|
|
781
|
+
class: "space-y-24"
|
|
782
|
+
}, no = { class: "space-y-8" }, so = { class: "fm-typo-en-title-md-800" }, lo = { class: "grid grid-cols-2 gap-16" }, ao = { class: "space-y-4" }, io = { class: "fm-typo-en-body-md-600" }, mo = { class: "space-y-4" }, co = { class: "fm-typo-en-body-md-600" }, uo = { class: "space-y-4" }, po = { class: "fm-typo-en-body-md-600" }, fo = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, bo = { class: "space-y-8" }, yo = { class: "fm-typo-en-title-md-800" }, vo = { class: "space-y-4" }, go = { class: "fm-typo-en-body-md-600" }, xo = { class: "flex gap-24 items-center xs:flex-col xs:items-start" }, er = /* @__PURE__ */ ie({
|
|
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: p }) {
|
|
792
|
+
const b = ot(), s = Ee(), r = Ke(), c = ft(), d = Ce(), { minor: x } = Ge, a = m, f = p, k = L(() => r.locations.map((n) => ({
|
|
793
|
+
label: n.name,
|
|
794
|
+
value: n._id
|
|
795
|
+
}))), V = L(() => (a.member.segment || []).map((n) => {
|
|
796
|
+
var e;
|
|
797
|
+
return ((e = c.segments.find((y) => y._id === n)) == null ? void 0 : e.name) || "";
|
|
798
|
+
}).filter(Boolean)), O = L(() => {
|
|
799
|
+
var $, E;
|
|
800
|
+
const n = (E = ($ = a.member.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : E[0], e = (n == null ? void 0 : n.balance) ?? 0, y = ((n == null ? void 0 : n.expiryBalance) ?? []).reduce((G, Z) => G + Z.amount, 0);
|
|
801
|
+
return { total: e, free: y, normal: e - y };
|
|
802
|
+
}), Y = [
|
|
803
|
+
{
|
|
804
|
+
label: "Loyalty",
|
|
805
|
+
stats: [
|
|
806
|
+
{
|
|
807
|
+
label: "Experiences",
|
|
808
|
+
getter: (n) => {
|
|
809
|
+
var e, y, $;
|
|
810
|
+
return j((($ = (y = (e = n.collection) == null ? void 0 : e.POINT) == null ? void 0 : y[0]) == null ? void 0 : $.balance) ?? 0, 2);
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
label: "Credits",
|
|
815
|
+
getter: () => j(O.value.total, 2)
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
label: "Normal credits",
|
|
819
|
+
getter: () => j(O.value.normal, 2)
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
label: "Free credits",
|
|
823
|
+
getter: () => j(O.value.free, 2)
|
|
824
|
+
}
|
|
825
|
+
]
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
label: "Voucher",
|
|
829
|
+
stats: [
|
|
830
|
+
{
|
|
831
|
+
label: "Active vouchers",
|
|
832
|
+
getter: () => j(z.value.active, 0)
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
label: "Past vouchers",
|
|
836
|
+
getter: () => j(z.value.past, 0)
|
|
837
|
+
}
|
|
838
|
+
]
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
label: "Mission",
|
|
842
|
+
stats: [
|
|
843
|
+
{
|
|
844
|
+
label: "Stamp missions",
|
|
845
|
+
getter: () => j(q.value.stamp, 0)
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
label: "Progress missions",
|
|
849
|
+
getter: () => j(q.value.progressive, 0)
|
|
850
|
+
}
|
|
851
|
+
]
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
label: "Game",
|
|
855
|
+
stats: [
|
|
856
|
+
{
|
|
857
|
+
label: "Tokens",
|
|
858
|
+
getter: (n) => {
|
|
859
|
+
var e, y;
|
|
860
|
+
return j(
|
|
861
|
+
((y = (e = n.collection) == null ? void 0 : e.GAME) == null ? void 0 : y.reduce(
|
|
862
|
+
($, E) => $ + E.balance,
|
|
863
|
+
0
|
|
864
|
+
)) || 0,
|
|
865
|
+
0
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
]
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
label: "Store bundle",
|
|
873
|
+
stats: [
|
|
874
|
+
{
|
|
875
|
+
label: "Bundle purchased",
|
|
876
|
+
getter: () => j(X.value, 0)
|
|
877
|
+
}
|
|
878
|
+
]
|
|
879
|
+
}
|
|
880
|
+
], oe = (() => {
|
|
881
|
+
const e = [];
|
|
882
|
+
for (let y = 0; y < Y.length; y += 3)
|
|
883
|
+
e.push(Y.slice(y, y + 3));
|
|
884
|
+
return e;
|
|
885
|
+
})();
|
|
886
|
+
async function re(n, e) {
|
|
887
|
+
switch (n.stopPropagation(), e) {
|
|
888
|
+
case "Store bundle":
|
|
889
|
+
await b.push({
|
|
890
|
+
name: nt["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
891
|
+
params: { id: a.member._id.toString() },
|
|
892
|
+
query: { tab: "store" }
|
|
893
|
+
});
|
|
894
|
+
break;
|
|
895
|
+
default:
|
|
896
|
+
B.value = M.find((y) => y.label === e) || M[0];
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
async function W(n, e) {
|
|
901
|
+
d.open({
|
|
902
|
+
title: "",
|
|
903
|
+
dialogComponent: pt,
|
|
904
|
+
dialogComponentProps: {
|
|
905
|
+
type: n,
|
|
906
|
+
action: e,
|
|
907
|
+
onSubmit: async (y) => {
|
|
908
|
+
await x(
|
|
909
|
+
async () => {
|
|
910
|
+
const $ = {
|
|
911
|
+
"credit-send": ue.sendCredit,
|
|
912
|
+
"credit-deduct": ue.deductCredit,
|
|
913
|
+
"coin-send": ue.sendCoin,
|
|
914
|
+
"coin-deduct": ue.deductCoin
|
|
915
|
+
}, E = `${n}-${e}`, G = $[E];
|
|
916
|
+
G && await G(a.member._id, y), f("update:member"), d.close();
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
message: `Adjusting ${_e.formattedType(
|
|
920
|
+
n.toUpperCase()
|
|
921
|
+
).toLowerCase()}`,
|
|
922
|
+
successMessage: `${y.amount} ${_e.formattedType(
|
|
923
|
+
n.toUpperCase()
|
|
924
|
+
).toLowerCase()} ${e} ${e == "send" ? "to" : "from"} ${a.member.phoneNumber}`
|
|
925
|
+
}
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
async function u() {
|
|
932
|
+
d.open({
|
|
933
|
+
title: "Update member statistics",
|
|
934
|
+
contentComponent: mt,
|
|
935
|
+
contentComponentProps: {
|
|
936
|
+
member: a.member,
|
|
937
|
+
onSubmit: async (n) => {
|
|
938
|
+
await x(
|
|
939
|
+
async () => {
|
|
940
|
+
await ue.updateMember(a.member._id, n), f("update:member"), d.close();
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
message: "Updating member stats",
|
|
944
|
+
successMessage: `Updated member ${a.member.phoneNumber} stats successfully`
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
const l = [
|
|
952
|
+
{
|
|
953
|
+
label: "Mobile No.",
|
|
954
|
+
key: "phoneNumber"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
label: "Tier",
|
|
958
|
+
getter: (n) => {
|
|
959
|
+
var Z, ce, pe, v, I;
|
|
960
|
+
const e = (((ce = Me.first((Z = a.member.collection) == null ? void 0 : Z.TIER)) == null ? void 0 : ce.balance) || 0) - 1, y = C.value.name, $ = ((v = (pe = n.collection) == null ? void 0 : pe.POINT) == null ? void 0 : v[0].balance) ?? 0, E = s.sortedTiers[e + 1], G = ((I = E == null ? void 0 : E.option) == null ? void 0 : I.from) ?? 1 / 0;
|
|
961
|
+
return `${y} (${$}/${G})`;
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
label: "Email",
|
|
966
|
+
key: "email"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
label: "Birthday",
|
|
970
|
+
getter: (n) => n.birthday ? h(n.birthday).format("D MMM YYYY") : "-"
|
|
971
|
+
}
|
|
972
|
+
], _ = [
|
|
973
|
+
{
|
|
974
|
+
label: "Customer since",
|
|
975
|
+
getter: (n) => h(n.joinAt || ge(n._id.toString())).format("D MMM YYYY")
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
label: "Joined at location",
|
|
979
|
+
getter: (n) => {
|
|
980
|
+
var e;
|
|
981
|
+
return n != null && n.location && ((e = k.value.find((y) => y.value == n.location)) == null ? void 0 : e.label) || "-";
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
label: "Total visit(s)",
|
|
986
|
+
getter: (n) => Ae.singularOrPlural(n.stats.visitCount, "bill")
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
label: "Last visit",
|
|
990
|
+
getter: (n) => h(n.stats.lastVisit).fromNow()
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
label: "Frequency",
|
|
994
|
+
getter: (n) => `Every ${Ae.singularOrPlural(
|
|
995
|
+
Number(Math.ceil(n.stats.avgVisitFrequency).toFixed(0)),
|
|
996
|
+
"day"
|
|
997
|
+
)}`
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
label: "Average spend",
|
|
1001
|
+
getter: (n) => Ue.Dinero.fromNumber({ number: Number(n.stats.avgBillSize || 0) }).toFormat(
|
|
1002
|
+
!0
|
|
1003
|
+
)
|
|
1004
|
+
}
|
|
1005
|
+
// {
|
|
1006
|
+
// label: 'Feedback',
|
|
1007
|
+
// key: 'feedbackCount',
|
|
1008
|
+
// },
|
|
1009
|
+
// {
|
|
1010
|
+
// label: 'Tier Earned this season',
|
|
1011
|
+
// key: 'lastSeasonTierEarned',
|
|
1012
|
+
// },
|
|
1013
|
+
// {
|
|
1014
|
+
// label: 'Point Earned this season',
|
|
1015
|
+
// key: 'lastSeasonPointEarned',
|
|
1016
|
+
// },
|
|
1017
|
+
], C = L(() => {
|
|
1018
|
+
var y, $;
|
|
1019
|
+
const n = ((($ = Me.first((y = a.member.collection) == null ? void 0 : y.TIER)) == null ? void 0 : $.balance) || 0) - 1, e = s.sortedTiers[n];
|
|
1020
|
+
return { name: (e == null ? void 0 : e.name) || "-", tier: n, config: e };
|
|
1021
|
+
}), P = L(() => {
|
|
1022
|
+
var n;
|
|
1023
|
+
return (((n = a.member.collection) == null ? void 0 : n.TITLE) || []).map((e) => {
|
|
1024
|
+
var $, E, G;
|
|
1025
|
+
const y = ($ = s.sortedTitles) == null ? void 0 : $.find(
|
|
1026
|
+
(Z) => Z._id == e.collectible
|
|
1027
|
+
);
|
|
1028
|
+
return {
|
|
1029
|
+
name: y == null ? void 0 : y.name,
|
|
1030
|
+
expiredAt: (G = (E = e.expiryBalance) == null ? void 0 : E.at(-1)) == null ? void 0 : G.expiredAt,
|
|
1031
|
+
collectible: y
|
|
1032
|
+
};
|
|
1033
|
+
}).filter(
|
|
1034
|
+
(e) => e.expiredAt ? h(e.expiredAt).isAfter(h()) : !0
|
|
1035
|
+
);
|
|
1036
|
+
}), q = K({ stamp: 0, progressive: 0 }), z = K({ active: 0, past: 0 }), R = K([]), X = L(
|
|
1037
|
+
() => R.value.reduce((n, e) => n + e.count, 0)
|
|
1038
|
+
), N = K(!0);
|
|
1039
|
+
function Q() {
|
|
1040
|
+
N.value = !0, B.value = M[0];
|
|
1041
|
+
}
|
|
1042
|
+
function me() {
|
|
1043
|
+
N.value = !1;
|
|
1044
|
+
}
|
|
1045
|
+
const M = [
|
|
1046
|
+
{
|
|
1047
|
+
label: "Overview",
|
|
1048
|
+
value: "overview"
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
label: "Loyalty",
|
|
1052
|
+
value: "loyalty"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
label: "Voucher",
|
|
1056
|
+
value: "voucher"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
label: "Mission",
|
|
1060
|
+
value: "mission"
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
label: "Game",
|
|
1064
|
+
value: "game"
|
|
1065
|
+
}
|
|
1066
|
+
], B = K(M[0]), T = async () => {
|
|
1067
|
+
z.value = await ve.readCollectionCountByMemberId(
|
|
1068
|
+
a.member._id.toString(),
|
|
1069
|
+
he.enum.VOUCHER
|
|
1070
|
+
), R.value = await rt.readPurchaseCountByMember(
|
|
1071
|
+
a.member._id.toString()
|
|
1072
|
+
), q.value = await ve.readMissionCountByMemberId(
|
|
1073
|
+
a.member._id.toString()
|
|
1074
|
+
);
|
|
1075
|
+
};
|
|
1076
|
+
return De(async () => {
|
|
1077
|
+
await s.readMembership(), await T(), r.locations.length || await r.readLocations();
|
|
1078
|
+
}), $e(N, async () => {
|
|
1079
|
+
await T();
|
|
1080
|
+
}), F({
|
|
1081
|
+
showSheet: Q,
|
|
1082
|
+
hideSheet: me
|
|
1083
|
+
}), (n, e) => {
|
|
1084
|
+
const y = A("FmTabs"), $ = A("FmAvatar"), E = A("FmButton"), G = A("FmIcon"), Z = A("FmChip"), ce = A("FmCard"), pe = A("FmSideSheet");
|
|
1085
|
+
return i(), D(pe, {
|
|
1086
|
+
modelValue: t(N),
|
|
1087
|
+
"onUpdate:modelValue": e[5] || (e[5] = (v) => Ye(N) ? N.value = v : null),
|
|
1088
|
+
header: "Member Detail",
|
|
1089
|
+
"dismiss-away": "",
|
|
1090
|
+
"close-button": !0,
|
|
1091
|
+
"max-width": 1100
|
|
1092
|
+
}, {
|
|
1093
|
+
"side-sheet-footer": le(() => [...e[21] || (e[21] = [])]),
|
|
1094
|
+
default: le(() => [
|
|
1095
|
+
o("div", Mt, [
|
|
1096
|
+
o("div", null, [
|
|
1097
|
+
g(y, {
|
|
1098
|
+
"model-value": t(B).value,
|
|
1099
|
+
items: M,
|
|
1100
|
+
class: "overflow-x-auto",
|
|
1101
|
+
"onUpdate:modelValue": e[0] || (e[0] = (v) => B.value = M.find((I) => I.value === v))
|
|
1102
|
+
}, null, 8, ["model-value"])
|
|
1103
|
+
]),
|
|
1104
|
+
t(B).value == "overview" ? (i(), w(U, { key: 0 }, [
|
|
1105
|
+
o("div", kt, [
|
|
1106
|
+
o("div", null, [
|
|
1107
|
+
e[9] || (e[9] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Profile Information", -1)),
|
|
1108
|
+
o("div", At, [
|
|
1109
|
+
o("div", Tt, [
|
|
1110
|
+
g($, {
|
|
1111
|
+
name: m.member.photoUrl ? void 0 : m.member.name,
|
|
1112
|
+
src: m.member.photoUrl || void 0
|
|
1113
|
+
}, null, 8, ["name", "src"]),
|
|
1114
|
+
o("div", $t, [
|
|
1115
|
+
e[7] || (e[7] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Member Name ", -1)),
|
|
1116
|
+
o("div", Et, S(m.member.name), 1),
|
|
1117
|
+
o("div", Vt, S(m.member._id), 1),
|
|
1118
|
+
o("div", Bt, [
|
|
1119
|
+
e[6] || (e[6] = ye(" Member Card: ", -1)),
|
|
1120
|
+
o("span", It, S(m.member.cardNo ? m.member.cardNo : "-"), 1)
|
|
1121
|
+
])
|
|
1122
|
+
]),
|
|
1123
|
+
g(E, {
|
|
1124
|
+
variant: "tertiary",
|
|
1125
|
+
icon: "settings",
|
|
1126
|
+
onClick: u
|
|
1127
|
+
})
|
|
1128
|
+
]),
|
|
1129
|
+
(i(), w(U, null, J(l, (v, I) => o("div", { key: I }, [
|
|
1130
|
+
o("div", Dt, S(v.label), 1),
|
|
1131
|
+
o("div", Yt, S(v.key ? m.member[v.key] : v.getter(m.member)), 1)
|
|
1132
|
+
])), 64)),
|
|
1133
|
+
o("div", Nt, [
|
|
1134
|
+
e[8] || (e[8] = ye(" Referral Code: ", -1)),
|
|
1135
|
+
o("span", Ut, S(m.member.referralCode ? m.member.referralCode : "-"), 1)
|
|
1136
|
+
])
|
|
1137
|
+
])
|
|
1138
|
+
]),
|
|
1139
|
+
o("div", null, [
|
|
1140
|
+
e[10] || (e[10] = o("div", { class: "fm-typo-en-title-sm-800 mb-16" }, "Activities", -1)),
|
|
1141
|
+
o("div", Ot, [
|
|
1142
|
+
(i(), w(U, null, J(_, (v) => o("div", {
|
|
1143
|
+
key: v.key
|
|
1144
|
+
}, [
|
|
1145
|
+
o("div", Pt, S(v.label), 1),
|
|
1146
|
+
o("div", Rt, S(v.key ? a.member.stats[v.key] || "-" : v.getter(m.member)), 1)
|
|
1147
|
+
])), 64))
|
|
1148
|
+
])
|
|
1149
|
+
])
|
|
1150
|
+
]),
|
|
1151
|
+
e[13] || (e[13] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1152
|
+
(i(!0), w(U, null, J(t(oe), (v) => (i(), w("div", jt, [
|
|
1153
|
+
(i(!0), w(U, null, J(v, (I, ee) => (i(), w("div", { key: ee }, [
|
|
1154
|
+
o("div", {
|
|
1155
|
+
class: Ne(ee !== 0 ? "pt-12 md:pt-0 lg:pt-0 md:pl-12 lg:pl-12" : "")
|
|
1156
|
+
}, [
|
|
1157
|
+
o("div", Lt, [
|
|
1158
|
+
o("div", qt, S(I.label), 1),
|
|
1159
|
+
o("button", {
|
|
1160
|
+
onClick: (H) => re(H, I.label)
|
|
1161
|
+
}, [
|
|
1162
|
+
g(G, {
|
|
1163
|
+
name: "chevron_right",
|
|
1164
|
+
outline: "",
|
|
1165
|
+
size: "md"
|
|
1166
|
+
})
|
|
1167
|
+
], 8, zt)
|
|
1168
|
+
]),
|
|
1169
|
+
o("div", Gt, [
|
|
1170
|
+
(i(!0), w(U, null, J(I.stats, (H) => (i(), w("div", {
|
|
1171
|
+
key: H.key
|
|
1172
|
+
}, [
|
|
1173
|
+
o("div", Ht, S(H.label), 1),
|
|
1174
|
+
o("div", Kt, S(H.getter(m.member)), 1)
|
|
1175
|
+
]))), 128))
|
|
1176
|
+
])
|
|
1177
|
+
], 2)
|
|
1178
|
+
]))), 128))
|
|
1179
|
+
]))), 256)),
|
|
1180
|
+
o("div", Wt, [
|
|
1181
|
+
e[11] || (e[11] = o("div", { class: "fm-typo-en-title-sm-800" }, "Segments", -1)),
|
|
1182
|
+
t(V).length ? (i(), w("div", Xt, [
|
|
1183
|
+
(i(!0), w(U, null, J(t(V), (v) => (i(), D(Z, {
|
|
1184
|
+
label: v.toString()
|
|
1185
|
+
}, null, 8, ["label"]))), 256))
|
|
1186
|
+
])) : (i(), w("div", Jt, "No titles"))
|
|
1187
|
+
]),
|
|
1188
|
+
e[14] || (e[14] = o("div", { class: "border-fm-color-neutral-gray-100 rounded-sm border-t" }, null, -1)),
|
|
1189
|
+
o("div", Qt, [
|
|
1190
|
+
e[12] || (e[12] = o("div", { class: "fm-typo-en-title-sm-800" }, "Title badge", -1)),
|
|
1191
|
+
t(P).length ? (i(!0), w(U, { key: 0 }, J(t(P).filter((v) => v.collectible), (v) => (i(), w("div", {
|
|
1192
|
+
class: "flex items-center gap-x-8 h-48",
|
|
1193
|
+
key: v.name
|
|
1194
|
+
}, [
|
|
1195
|
+
o("img", {
|
|
1196
|
+
src: v.collectible.image || t(Pe),
|
|
1197
|
+
class: "aspect-square h-full object-contain"
|
|
1198
|
+
}, null, 8, Zt),
|
|
1199
|
+
o("div", null, [
|
|
1200
|
+
o("div", eo, S(v.name), 1),
|
|
1201
|
+
o("div", to, " Expired on " + S(t(h)(v.expiredAt).format("MMM D, Y")), 1)
|
|
1202
|
+
])
|
|
1203
|
+
]))), 128)) : (i(), w("div", oo, "No titles"))
|
|
1204
|
+
])
|
|
1205
|
+
], 64)) : t(B).value == "loyalty" ? (i(), w("div", ro, [
|
|
1206
|
+
g(ce, {
|
|
1207
|
+
class: "p-16 space-y-24",
|
|
1208
|
+
variant: "outlined"
|
|
1209
|
+
}, {
|
|
1210
|
+
default: le(() => {
|
|
1211
|
+
var v, I, ee, H;
|
|
1212
|
+
return [
|
|
1213
|
+
o("div", no, [
|
|
1214
|
+
e[15] || (e[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Total credit ", -1)),
|
|
1215
|
+
o("div", so, S(t(j)(t(O).total, 2)), 1)
|
|
1216
|
+
]),
|
|
1217
|
+
o("div", lo, [
|
|
1218
|
+
o("div", ao, [
|
|
1219
|
+
e[16] || (e[16] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Normal credit ", -1)),
|
|
1220
|
+
o("div", io, S(t(j)(t(O).normal, 2)), 1)
|
|
1221
|
+
]),
|
|
1222
|
+
o("div", mo, [
|
|
1223
|
+
e[17] || (e[17] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Free credit (with expiry) ", -1)),
|
|
1224
|
+
o("div", co, S(t(j)(t(O).free, 2)), 1)
|
|
1225
|
+
])
|
|
1226
|
+
]),
|
|
1227
|
+
o("div", uo, [
|
|
1228
|
+
e[18] || (e[18] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credit(s) to be expired in 30 days ", -1)),
|
|
1229
|
+
o("div", po, S(((H = (ee = (I = (v = m.member.collection) == null ? void 0 : v.CREDIT) == null ? void 0 : I[0]) == null ? void 0 : ee.expiryBalance) == null ? void 0 : H.reduce(
|
|
1230
|
+
(ne, se) => se.expiredAt && t(h)(se.expiredAt).isAfter(t(h)()) && t(h)(se.expiredAt).isBefore(t(h)().add(30, "days")) ? ne + se.amount : ne,
|
|
1231
|
+
0
|
|
1232
|
+
)) ?? 0), 1)
|
|
1233
|
+
]),
|
|
1234
|
+
o("div", fo, [
|
|
1235
|
+
g(E, {
|
|
1236
|
+
label: "Add credit",
|
|
1237
|
+
icon: "add",
|
|
1238
|
+
variant: "plain",
|
|
1239
|
+
onClick: e[1] || (e[1] = (ne) => W("credit", "send"))
|
|
1240
|
+
}),
|
|
1241
|
+
g(E, {
|
|
1242
|
+
label: "Deduct credit",
|
|
1243
|
+
icon: "remove",
|
|
1244
|
+
variant: "plain",
|
|
1245
|
+
onClick: e[2] || (e[2] = (ne) => W("credit", "deduct"))
|
|
1246
|
+
})
|
|
1247
|
+
])
|
|
1248
|
+
];
|
|
1249
|
+
}),
|
|
1250
|
+
_: 1
|
|
1251
|
+
}),
|
|
1252
|
+
g(ce, {
|
|
1253
|
+
class: "p-16 space-y-24",
|
|
1254
|
+
variant: "outlined"
|
|
1255
|
+
}, {
|
|
1256
|
+
default: le(() => {
|
|
1257
|
+
var v, I, ee, H, ne, se, Se;
|
|
1258
|
+
return [
|
|
1259
|
+
o("div", bo, [
|
|
1260
|
+
e[19] || (e[19] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point ", -1)),
|
|
1261
|
+
o("div", yo, S(((ee = (I = (v = m.member.collection) == null ? void 0 : v.COIN) == null ? void 0 : I[0]) == null ? void 0 : ee.balance) ?? 0), 1)
|
|
1262
|
+
]),
|
|
1263
|
+
o("div", vo, [
|
|
1264
|
+
e[20] || (e[20] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Point(s) to be expired in 30 days ", -1)),
|
|
1265
|
+
o("div", go, S(((Se = (se = (ne = (H = m.member.collection) == null ? void 0 : H.COIN) == null ? void 0 : ne[0]) == null ? void 0 : se.expiryBalance) == null ? void 0 : Se.reduce(
|
|
1266
|
+
(fe, be) => be.expiredAt && t(h)(be.expiredAt).isAfter(t(h)()) && t(h)(be.expiredAt).isBefore(t(h)().add(30, "days")) ? fe + be.amount : fe,
|
|
1267
|
+
0
|
|
1268
|
+
)) ?? 0), 1)
|
|
1269
|
+
]),
|
|
1270
|
+
o("div", xo, [
|
|
1271
|
+
g(E, {
|
|
1272
|
+
label: "Add point",
|
|
1273
|
+
icon: "add",
|
|
1274
|
+
variant: "plain",
|
|
1275
|
+
onClick: e[3] || (e[3] = (fe) => W("coin", "send"))
|
|
1276
|
+
}),
|
|
1277
|
+
g(E, {
|
|
1278
|
+
label: "Deduct point",
|
|
1279
|
+
icon: "remove",
|
|
1280
|
+
variant: "plain",
|
|
1281
|
+
onClick: e[4] || (e[4] = (fe) => W("coin", "deduct"))
|
|
1282
|
+
})
|
|
1283
|
+
])
|
|
1284
|
+
];
|
|
1285
|
+
}),
|
|
1286
|
+
_: 1
|
|
1287
|
+
})
|
|
1288
|
+
])) : t(B).value == "voucher" ? (i(), D(St, {
|
|
1289
|
+
key: 2,
|
|
1290
|
+
member: a.member
|
|
1291
|
+
}, null, 8, ["member"])) : t(B).value == "mission" ? (i(), D(wt, {
|
|
1292
|
+
key: 3,
|
|
1293
|
+
member: a.member
|
|
1294
|
+
}, null, 8, ["member"])) : t(B).value == "game" ? (i(), D(Ft, {
|
|
1295
|
+
key: 4,
|
|
1296
|
+
member: a.member
|
|
1297
|
+
}, null, 8, ["member"])) : te("", !0)
|
|
1298
|
+
])
|
|
1299
|
+
]),
|
|
1300
|
+
_: 1
|
|
1301
|
+
}, 8, ["modelValue"]);
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
export {
|
|
1306
|
+
er as _,
|
|
1307
|
+
ft as u
|
|
1308
|
+
};
|