@feedmepos/mf-connect 0.1.98-beta.7 → 0.1.98-beta.71
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-BonFFUVJ.js → App-B-Onur9k.js} +812 -666
- package/dist/{AuditLogs-CaQisyMC.js → AuditLogs-BnEeKG1C.js} +14 -13
- package/dist/{Bin-Mu8gAiHw.js → Bin-BH9_nATR.js} +8 -8
- package/dist/Broadcast-Gt2ZLLpZ.js +302 -0
- package/dist/CampaignAnalytic-BT6zTgNk.js +1830 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BoLZVrCU.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-nNLLEzii.js} +6 -5
- package/dist/Card-dD52oor7.js +1084 -0
- package/dist/{Collections-CByXxRW_.js → Collections-7bwYNl3M.js} +14 -13
- package/dist/Credit-qZdlqXqR.js +286 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js +53 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C09W9Qja.js +4213 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BXsAX1Xa.js → EffectSheet.vue_vue_type_style_index_0_lang-Bz1HRBMa.js} +35 -35
- package/dist/{Experience-B7J-aqPK.js → Experience-CAaWgWXP.js} +112 -86
- package/dist/{FileSaver.min-D_F_MSZt.js → FileSaver.min-BpfY6VnX.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
- package/dist/Game-fhrbFb_5.js +356 -0
- package/dist/GiftCardSetup-CTwmNKim.js +736 -0
- package/dist/{Grab-C45MmlD9.js → Grab-BnPfb92x.js} +33 -32
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CPPcB3PC.js → ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js} +1 -1
- package/dist/{Index-vQ6uP49O.js → Index-DRwvmm_j.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cj3hN3tg.js → LocationPicker.vue_vue_type_script_setup_true_lang-Ya4r9NNE.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DU9eIein.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CDwtqqLQ.js} +1 -1
- package/dist/LoyaltyDashboard-8jn6SIWo.js +2865 -0
- package/dist/MainLayout-Bf42AcB1.js +143 -0
- package/dist/{Marketing-B6xMdQvW.js → Marketing-DruTMjiR.js} +7 -6
- package/dist/{MarketingMaterialEdit-0cZN4bek.js → MarketingMaterialEdit-moEHd_gP.js} +15 -14
- package/dist/Member-C9VTQqIm.js +654 -0
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DEsVSWmv.js +1279 -0
- package/dist/MemberImportHistory-DZVwya9v.js +187 -0
- package/dist/MemberList-KusIfy1u.js +334 -0
- package/dist/{MemberTransactions-Bg-ziZy8.js → MemberTransactions-msyjdzlI.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jbDJkbZh.js → MessageInput.vue_vue_type_script_setup_true_lang-DbV-m3cC.js} +5928 -5644
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js +40 -0
- package/dist/Mission-CUUxpBUF.js +360 -0
- package/dist/{Overview-nsyJGSCq.js → Overview-C9jyKXHX.js} +21 -20
- package/dist/Overview-CYKoF8Hp.js +1316 -0
- package/dist/Point-CPpQ07yp.js +288 -0
- package/dist/Promotion-CJ95m9Qb.js +423 -0
- package/dist/{Queue-Dkipt6fw.js → Queue-CX39ILh_.js} +14 -13
- package/dist/{Record-BFqx6vM-.js → Record-6I0qyXB5.js} +9 -9
- package/dist/Review-DoWu2XNT.js +45 -0
- package/dist/ReviewFacebookCallback-Co-5TnI7.js +238 -0
- package/dist/ReviewGoogleCallback-Ca7ZuMcF.js +213 -0
- package/dist/{Reward-DjFEE7I_.js → Reward-Cx_N6qBJ.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BzZ6VH80.js → RewardGroup.vue_vue_type_script_setup_true_lang-Cn5Yp37p.js} +14 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-A9jQX4jt.js → RuleGroup.vue_vue_type_script_setup_true_lang-M0c67Dyl.js} +196 -186
- package/dist/{Segment-BAjdUfZ6.js → Segment-Bx0EW966.js} +275 -276
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CAQPFzRH.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-ahvrEUGa.js} +37 -36
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Gkz8jhES.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C7zSfZdl.js} +4 -4
- package/dist/{Setting-BK7y0XC-.js → Setting-DzEK3dWj.js} +14 -14
- package/dist/{SettingAdvertisements-DfQ645xr.js → SettingAdvertisements-BNALbI88.js} +12 -12
- package/dist/Settings-Cw85-xzq.js +230 -0
- package/dist/Store-BSqW1gwf.js +2612 -0
- package/dist/{StoreRewards-usHKOGmB.js → StoreRewards-CJXnS8Qf.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C6tUwHEj.js +1329 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrcWUZuR.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-iylphGuV.js} +2 -2
- package/dist/{Tier-BF3V430O.js → Tier-DfitNxp2.js} +2580 -754
- package/dist/{Title-DwPuqKfJ.js → Title-QCbtOvKB.js} +39 -37
- package/dist/Transaction-dOCzlidD.js +45 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DToNRTJS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Be5X1C-Y.js} +26 -26
- package/dist/{Voucher-DnhVIl_o.js → Voucher-BfoCDwjg.js} +156 -133
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Btb3UZCn.js → VoucherEditor.vue_vue_type_script_setup_true_lang-0EIYoZ0F.js} +118 -124
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-EFUW9DMY.js → ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js} +2 -2
- package/dist/{app-i3r-6ZVm.js → app-BxTElIm-.js} +45168 -37577
- package/dist/app.js +1 -1
- package/dist/base.export-BmUK8hMh.js +75 -0
- package/dist/{business-i0Gxk7gG.js → business-DjAiT8tR.js} +5 -5
- package/dist/campaign-DlR3KF9m.js +368 -0
- package/dist/campaign-tAmQNoq7.js +100 -0
- package/dist/{campaign.enum-CbUTfxek.js → campaign.enum-BjwEQd11.js} +1 -1
- package/dist/{campaign.fn-BjHSIDd1.js → campaign.fn-C6kWWIQx.js} +53 -53
- package/dist/{collectible.enum-DN7E_kHg.js → collectible.enum-BrtXpT9S.js} +1 -1
- package/dist/collection.fn-CDhfM3Eq.js +26 -0
- package/dist/currency-10nX5QnT.js +7 -0
- package/dist/{duplicateCampaign-DmdJQEIA.js → duplicateCampaign-6oMZOvfM.js} +11 -11
- package/dist/{effect-DM4AzeQl.js → effect-T4YzuTc5.js} +1 -1
- package/dist/{email-addresses-BlqVJhwZ.js → email-addresses-BjODnJMM.js} +209 -201
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-CkdISSVP.js → helper-BCl5r5yZ.js} +1 -1
- package/dist/{index-DgzNGQgE.js → index-B9ZMIUMa.js} +2083 -2559
- package/dist/{index-CB7ytKOE.js → index-BBsK7TUw.js} +1588 -1522
- package/dist/index-BQk6zTgf.js +32437 -0
- package/dist/index-Bd4clHfr.js +901 -0
- package/dist/index-BeVWchv7.js +14550 -0
- package/dist/index-Bht1Z11w.js +72 -0
- package/dist/{index-FD50UHqf.js → index-BiolIgqR.js} +105 -123
- package/dist/{index-Cl8t41Sk.js → index-BxU--5J5.js} +5 -5
- package/dist/index-Bz6oSli7.js +151 -0
- package/dist/index-C5IfNJUl.js +53 -0
- package/dist/{index-BWsj6lCJ.js → index-CRvUvCMA.js} +14 -14
- package/dist/{index-B6xi1soU.js → index-CnaQt4Pn.js} +1 -1
- package/dist/{index-4EtrCy_K.js → index-Ctja--IE.js} +4 -4
- package/dist/{index-D6qeYVNz.js → index-D8rGhchh.js} +1 -1
- package/dist/{index-BrboOmPq.js → index-DJdTDF9C.js} +347 -216
- package/dist/index-DXiJa8Cw.js +137 -0
- package/dist/{index-CxdLExX0.js → index-DeQKLilv.js} +24 -9
- package/dist/{index-vI-ndGu_.js → index-DhtKt4OL.js} +5 -5
- package/dist/{index.esm2017-BX5CyKoc.js → index.esm2017-CEOegJjn.js} +132 -132
- package/dist/{loading-DTKDhqew.js → loading-Dx4SCvZY.js} +1 -1
- package/dist/{lodash-CCPBsqhe.js → lodash-Dq8OKCKK.js} +1 -1
- package/dist/member-import-DX-jn2uk.js +187 -0
- package/dist/membership-CltAa-gH.js +274 -0
- package/dist/{money-wMK3QkZ5.js → money-DsaAjJTI.js} +1 -1
- package/dist/{number-DjKVlWn0.js → number-DmhHKYgY.js} +1 -1
- package/dist/objectid-BdNv-dZX.js +145 -0
- package/dist/{plugins-D25PaNJk.js → plugins-BFKVM3uC.js} +13 -12
- package/dist/remy-Qz_pNsUS.js +13 -0
- package/dist/{reward-E63jqJHm.js → reward--SjvIeyy.js} +1 -1
- package/dist/{rule-RVvPtAnk.js → rule-CAKdNobZ.js} +335 -275
- package/dist/style.css +1 -1
- package/dist/{template-zNxOQaqe.js → template-Cfxc5eM8.js} +6 -6
- package/dist/timezone-D2b-V5XD.js +20 -0
- package/dist/transaction.fn-B5mLY7bz.js +71 -0
- package/dist/{trigger-BXV02FhP.js → trigger-DvYcjRBZ.js} +17 -17
- package/dist/useMarketingMaterialActions-DtqnjMSt.js +96 -0
- package/dist/{usePagination-BPcPhEnp.js → usePagination-DKX24g31.js} +1 -1
- package/dist/{user-Bd8S7R5u.js → user-fWb1NxGO.js} +1 -1
- package/dist/vue-i18n-wJReAVJw.js +2365 -0
- package/dist/{xlsx-_tQC9Ezf.js → xlsx-Mthhu4JR.js} +440 -440
- package/dist/{zod-C1j2GLZP.js → zod-CVpVUgBZ.js} +1 -1
- package/package.json +10 -6
- package/dist/Broadcast-Cy-i-WOT.js +0 -266
- package/dist/Card-f2XOtWxp.js +0 -910
- package/dist/Credit-CcZF4aQS.js +0 -260
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7KZ8GMx.js +0 -3377
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-CUW7NeVG.js +0 -330
- package/dist/LoyaltyDashboard-GqyUwvXz.js +0 -1082
- package/dist/MainLayout-R5NxIBR-.js +0 -41
- package/dist/Member-CC5F6Bmz.js +0 -280
- package/dist/MemberList-Cq4zxopX.js +0 -1601
- package/dist/Mission-DcCZ6tAG.js +0 -334
- package/dist/Point-D1vLd5hL.js +0 -262
- package/dist/Promotion-Cv7MW5RJ.js +0 -397
- package/dist/Review-CKhakUMe.js +0 -1123
- package/dist/ReviewFacebookCallback-xgRpXQAg.js +0 -243
- package/dist/ReviewGoogleCallback-Cqi_43qi.js +0 -208
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DDqK4kV1.js +0 -181
- package/dist/Store-uTRQ6KbC.js +0 -1996
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bb2sTsuA.js +0 -1130
- package/dist/Transaction-CnTEfMGU.js +0 -39
- package/dist/campaign-CbMlARNI.js +0 -219
- package/dist/campaign-f7FT91GR.js +0 -277
- package/dist/export-DQR-0lmK.js +0 -97
- package/dist/index-COrXX9MR.js +0 -52
- package/dist/index-CWiaP-aV.js +0 -28900
- package/dist/index-jVfDVEtz.js +0 -85
- package/dist/membership-rifuatxU.js +0 -255
- package/dist/objectid-DjpWkCxH.js +0 -145
- package/dist/useMarketingMaterialActions-5TFNqZVo.js +0 -107
- package/dist/vue-i18n-CgMK-TaC.js +0 -2365
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import { defineComponent as J, resolveComponent as y, unref as t, openBlock as n, createElementBlock as i, normalizeClass as W, renderSlot as ne, createElementVNode as s, createVNode as u, ref as g, computed as P, onMounted as xe, onBeforeUnmount as Se, Fragment as O, createStaticVNode as Le, withCtx as N, renderList as Q, createBlock as k, toDisplayString as r, createCommentVNode as d, createTextVNode as le, isRef as Ae, watch as Ne, createSlots as Me } from "vue";
|
|
2
|
+
import "./index-D8rGhchh.js";
|
|
3
|
+
import { useDialog as de } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as ue } from "./vue-i18n-wJReAVJw.js";
|
|
5
|
+
import { useCoreStore as Fe } from "@feedmepos/mf-common";
|
|
6
|
+
import { F as re } from "./FileSaver.min-BpfY6VnX.js";
|
|
7
|
+
import { u as V, w as Pe } from "./xlsx-Mthhu4JR.js";
|
|
8
|
+
import { u as De } from "./app-wDQR6dpb.js";
|
|
9
|
+
import { M as ie, a as Be } from "./member-import-DX-jn2uk.js";
|
|
10
|
+
import { m as A } from "./index-DXiJa8Cw.js";
|
|
11
|
+
import { useRouter as Oe } from "vue-router";
|
|
12
|
+
import { R as I } from "./app-BxTElIm-.js";
|
|
13
|
+
const Ve = { class: "fm-typo-en-body-sm-400 justify-center flex items-center w-full" }, Ye = /* @__PURE__ */ J({
|
|
14
|
+
__name: "FmAdminBadge",
|
|
15
|
+
props: {
|
|
16
|
+
class: { default: void 0 },
|
|
17
|
+
selectable: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
setup(G) {
|
|
20
|
+
const m = G, M = Fe();
|
|
21
|
+
return (D, f) => {
|
|
22
|
+
var e;
|
|
23
|
+
const E = y("FmIcon");
|
|
24
|
+
return (e = t(M).sessionUser.value) != null && e.role.isAdmin ? (n(), i("div", {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: W([
|
|
27
|
+
"group gap-8 inline-flex items-center relative border-1 border-dashed rounded-md border-red-500 hover:border-opacity-30 transition-opacity",
|
|
28
|
+
{ "select-none": !m.selectable }
|
|
29
|
+
])
|
|
30
|
+
}, [
|
|
31
|
+
ne(D.$slots, "default"),
|
|
32
|
+
s("div", {
|
|
33
|
+
class: W([
|
|
34
|
+
"pointer-events-none opacity-90 flex items-center justify-center rounded-xxxl bg-red-500 text-white group-hover:opacity-20",
|
|
35
|
+
m.class,
|
|
36
|
+
{
|
|
37
|
+
absolute: !0,
|
|
38
|
+
"bottom-[-5px] right-[-8px] px-4 h-[25px] w-[25px] border-2 border-red-800": !0
|
|
39
|
+
}
|
|
40
|
+
])
|
|
41
|
+
}, [
|
|
42
|
+
s("span", Ve, [
|
|
43
|
+
u(E, {
|
|
44
|
+
name: "support_agent",
|
|
45
|
+
size: "sm",
|
|
46
|
+
outline: ""
|
|
47
|
+
})
|
|
48
|
+
])
|
|
49
|
+
], 2)
|
|
50
|
+
], 2)) : ne(D.$slots, "non-admin", { key: 1 });
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}), $e = { class: "w-[800px] max-w-full space-y-24 pb-16" }, Ue = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
56
|
+
}, He = { class: "flex justify-end" }, Ge = {
|
|
57
|
+
key: 1,
|
|
58
|
+
class: "flex items-center rounded-md border border-fm-color-neutral-gray-300 p-16"
|
|
59
|
+
}, qe = { class: "fm-typo-en-body-lg-400 min-w-0 flex-1 truncate px-8" }, je = { class: "flex items-center justify-between" }, ze = { class: "fm-typo-en-title-sm-800" }, Qe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, We = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "rounded-md bg-fm-color-system-error-100 p-16 fm-typo-en-body-sm-400"
|
|
62
|
+
}, Je = {
|
|
63
|
+
key: 1,
|
|
64
|
+
class: "rounded-md bg-fm-color-system-info-100 p-16 fm-typo-en-body-md-400"
|
|
65
|
+
}, Ke = {
|
|
66
|
+
key: 2,
|
|
67
|
+
class: "space-y-16"
|
|
68
|
+
}, Xe = { class: "grid grid-cols-2 gap-8 md:grid-cols-4" }, Ze = { class: "fm-typo-en-title-sm-800" }, et = { class: "fm-typo-en-title-sm-800" }, tt = { class: "fm-typo-en-title-sm-800" }, at = { class: "fm-typo-en-title-sm-800" }, ot = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
|
|
71
|
+
}, st = {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
|
|
74
|
+
}, nt = { class: "fm-typo-en-body-md-400" }, lt = { class: "fm-typo-en-body-md-600" }, rt = {
|
|
75
|
+
key: 4,
|
|
76
|
+
class: "rounded-md bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400"
|
|
77
|
+
}, it = {
|
|
78
|
+
key: 3,
|
|
79
|
+
class: "space-y-12"
|
|
80
|
+
}, dt = { class: "rounded-md bg-fm-color-system-error-100 p-16" }, ut = { class: "fm-typo-en-body-sm-400" }, ct = {
|
|
81
|
+
key: 4,
|
|
82
|
+
class: "rounded-md bg-fm-color-system-error-100 p-16"
|
|
83
|
+
}, mt = { class: "fm-typo-en-body-sm-400" }, pt = { class: "fm-typo-en-body-sm-400" }, ft = {
|
|
84
|
+
key: 5,
|
|
85
|
+
class: "rounded-md bg-fm-color-system-success-100 p-16"
|
|
86
|
+
}, vt = { class: "fm-typo-en-body-sm-400" }, yt = {
|
|
87
|
+
key: 6,
|
|
88
|
+
class: "rounded-md bg-fm-color-system-info-100 p-16"
|
|
89
|
+
}, bt = { class: "fm-typo-en-body-sm-400" }, _t = { class: "flex items-center justify-end gap-8" }, gt = /* @__PURE__ */ J({
|
|
90
|
+
__name: "ImportMemberDialog",
|
|
91
|
+
setup(G) {
|
|
92
|
+
const { t: m } = ue(), M = de(), D = De(), f = g(null), E = g(null), e = g(null), c = g(""), R = g(""), B = g(!1), T = g(!1), x = g(!1), S = g(!1), b = g(!1), h = g(!0);
|
|
93
|
+
let w, _ = 0;
|
|
94
|
+
const L = g({
|
|
95
|
+
mode: "UPSERT"
|
|
96
|
+
}), q = [
|
|
97
|
+
{ label: "Create missing members only", value: "CREATE" },
|
|
98
|
+
{ label: "Update existing members only", value: "UPDATE" },
|
|
99
|
+
{ label: "Create and update members", value: "UPSERT" }
|
|
100
|
+
], j = [
|
|
101
|
+
{
|
|
102
|
+
label: "CSV",
|
|
103
|
+
icon: "csv",
|
|
104
|
+
value: "csv"
|
|
105
|
+
/* csv */
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: "Excel",
|
|
109
|
+
icon: "description",
|
|
110
|
+
value: "xlsx"
|
|
111
|
+
/* xlsx */
|
|
112
|
+
}
|
|
113
|
+
], z = P(
|
|
114
|
+
() => {
|
|
115
|
+
var o;
|
|
116
|
+
return ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING", "CANCELLING"].includes(
|
|
117
|
+
((o = e.value) == null ? void 0 : o.status) ?? ""
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
), K = P(() => {
|
|
121
|
+
var o;
|
|
122
|
+
return !(((o = e.value) == null ? void 0 : o.status) !== "READY" || !e.value.file || R.value !== e.value.businessName || !S.value || e.value.summary.sharedProfiles > 0 && !T.value || e.value.summary.balanceRows > 0 && !x.value);
|
|
123
|
+
}), ce = P(() => {
|
|
124
|
+
const o = e.value, a = o == null ? void 0 : o.summary, p = !!o && R.value === o.businessName;
|
|
125
|
+
return [
|
|
126
|
+
{
|
|
127
|
+
label: "Status is READY",
|
|
128
|
+
passed: (o == null ? void 0 : o.status) === "READY",
|
|
129
|
+
value: (o == null ? void 0 : o.status) ?? "missing"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: "Uploaded file exists",
|
|
133
|
+
passed: !!(o != null && o.file),
|
|
134
|
+
value: o != null && o.file ? "yes" : "no"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: "Business name matches exactly",
|
|
138
|
+
passed: p,
|
|
139
|
+
value: `entered "${R.value}" / expected "${(o == null ? void 0 : o.businessName) ?? ""}"`
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: "Shared-profile acknowledgement",
|
|
143
|
+
passed: !(a != null && a.sharedProfiles) || T.value,
|
|
144
|
+
value: a != null && a.sharedProfiles ? `${T.value ? "checked" : "required"} (${a.sharedProfiles} rows)` : "not required"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: "Balance-replacement acknowledgement",
|
|
148
|
+
passed: !(a != null && a.balanceRows) || x.value,
|
|
149
|
+
value: a != null && a.balanceRows ? `${x.value ? "checked" : "required"} (${a.balanceRows} rows)` : "not required"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
label: "Import responsibility acknowledgement",
|
|
153
|
+
passed: S.value,
|
|
154
|
+
value: S.value ? "checked" : "required"
|
|
155
|
+
}
|
|
156
|
+
];
|
|
157
|
+
});
|
|
158
|
+
function me(o) {
|
|
159
|
+
var a, p;
|
|
160
|
+
f.value = ((p = (a = o.target) == null ? void 0 : a.files) == null ? void 0 : p[0]) ?? null;
|
|
161
|
+
}
|
|
162
|
+
function pe() {
|
|
163
|
+
E.value && (E.value.value = "", E.value.click());
|
|
164
|
+
}
|
|
165
|
+
function fe(o) {
|
|
166
|
+
const a = [
|
|
167
|
+
[...ie],
|
|
168
|
+
[...Be]
|
|
169
|
+
], p = V.aoa_to_sheet(a);
|
|
170
|
+
if (o === "csv") {
|
|
171
|
+
re.saveAs(
|
|
172
|
+
new Blob([V.sheet_to_csv(p)], {
|
|
173
|
+
type: "text/csv;charset=utf-8;"
|
|
174
|
+
}),
|
|
175
|
+
"ImportMemberTemplate.csv"
|
|
176
|
+
);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const v = V.book_new();
|
|
180
|
+
for (let C = 0; C < ie.length; C++) {
|
|
181
|
+
const $ = p[V.encode_cell({ r: 1, c: C })];
|
|
182
|
+
$ && ($.z = "@");
|
|
183
|
+
}
|
|
184
|
+
V.book_append_sheet(v, p, "Members"), Pe(v, "ImportMemberTemplate.xlsx", { cellStyles: !0 });
|
|
185
|
+
}
|
|
186
|
+
async function ve() {
|
|
187
|
+
if (!f.value) {
|
|
188
|
+
c.value = "Please upload a file.";
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (!B.value) {
|
|
192
|
+
c.value = "Please read and acknowledge the import warnings.";
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
b.value = !0, c.value = "";
|
|
196
|
+
try {
|
|
197
|
+
const o = new FormData();
|
|
198
|
+
o.append("file", f.value), o.append("config", JSON.stringify(L.value)), e.value = await A.import(o), await F();
|
|
199
|
+
} catch (o) {
|
|
200
|
+
c.value = o instanceof Error ? o.message : String(o);
|
|
201
|
+
} finally {
|
|
202
|
+
b.value = !1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
async function ye(o) {
|
|
206
|
+
var p, v;
|
|
207
|
+
if (!e.value) return !1;
|
|
208
|
+
const a = e.value._id.toString();
|
|
209
|
+
try {
|
|
210
|
+
const C = await A.readImport(a);
|
|
211
|
+
return o !== _ || ((p = e.value) == null ? void 0 : p._id.toString()) !== a ? !1 : (e.value = C, !0);
|
|
212
|
+
} catch (C) {
|
|
213
|
+
if (o !== _ || ((v = e.value) == null ? void 0 : v._id.toString()) !== a)
|
|
214
|
+
return !1;
|
|
215
|
+
throw C;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
async function F() {
|
|
219
|
+
var a;
|
|
220
|
+
Y();
|
|
221
|
+
const o = _;
|
|
222
|
+
try {
|
|
223
|
+
if (!await ye(o)) return;
|
|
224
|
+
} catch (p) {
|
|
225
|
+
if (o !== _) return;
|
|
226
|
+
c.value = p instanceof Error ? p.message : String(p), z.value && (w = setTimeout(F, 5e3));
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
o === _ && z.value && (w = setTimeout(F, ((a = e.value) == null ? void 0 : a.status) === "RUNNING" ? 5e3 : 1500));
|
|
230
|
+
}
|
|
231
|
+
async function be() {
|
|
232
|
+
try {
|
|
233
|
+
e.value = await A.resumableImport(), e.value && await F();
|
|
234
|
+
} catch (o) {
|
|
235
|
+
c.value = o instanceof Error ? o.message : String(o);
|
|
236
|
+
} finally {
|
|
237
|
+
h.value = !1;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function Y() {
|
|
241
|
+
_ += 1, w && clearTimeout(w), w = void 0;
|
|
242
|
+
}
|
|
243
|
+
function _e() {
|
|
244
|
+
Y(), e.value = null, f.value = null, c.value = "", S.value = !1;
|
|
245
|
+
}
|
|
246
|
+
async function ge() {
|
|
247
|
+
if (!(!e.value || !K.value)) {
|
|
248
|
+
b.value = !0, c.value = "";
|
|
249
|
+
try {
|
|
250
|
+
e.value = await A.confirmImport(e.value._id.toString(), {
|
|
251
|
+
businessName: R.value,
|
|
252
|
+
fileHash: e.value.fileHash,
|
|
253
|
+
previewVersion: e.value.previewVersion,
|
|
254
|
+
acknowledgeSharedProfiles: T.value,
|
|
255
|
+
acknowledgeBalanceReplacement: x.value
|
|
256
|
+
}), await F();
|
|
257
|
+
} catch (o) {
|
|
258
|
+
c.value = o instanceof Error ? o.message : String(o);
|
|
259
|
+
} finally {
|
|
260
|
+
b.value = !1;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
async function he() {
|
|
265
|
+
if (e.value) {
|
|
266
|
+
b.value = !0, c.value = "";
|
|
267
|
+
try {
|
|
268
|
+
e.value = await A.retryImport(e.value._id.toString()), await F();
|
|
269
|
+
} catch (o) {
|
|
270
|
+
c.value = o instanceof Error ? o.message : String(o);
|
|
271
|
+
} finally {
|
|
272
|
+
b.value = !1;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async function we() {
|
|
277
|
+
if (!(!e.value || ["COMPLETED", "CANCELLED", "INVALID", "CANCELLING"].includes(
|
|
278
|
+
e.value.status
|
|
279
|
+
))) {
|
|
280
|
+
b.value = !0, c.value = "";
|
|
281
|
+
try {
|
|
282
|
+
const o = await A.cancelImport(e.value._id.toString());
|
|
283
|
+
Y(), e.value = o, e.value.status === "CANCELLING" && await F();
|
|
284
|
+
} catch (o) {
|
|
285
|
+
c.value = o instanceof Error ? o.message : String(o);
|
|
286
|
+
} finally {
|
|
287
|
+
b.value = !1;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
async function ke() {
|
|
292
|
+
if (!e.value) return;
|
|
293
|
+
const o = await A.downloadImportResult(e.value._id.toString());
|
|
294
|
+
re.saveAs(o, `member-import-${e.value._id}.csv`);
|
|
295
|
+
}
|
|
296
|
+
return xe(be), Se(Y), (o, a) => {
|
|
297
|
+
var X, Z, ee, te, ae, oe, se;
|
|
298
|
+
const p = y("FmSelect"), v = y("FmButton"), C = y("FmMenuItem"), $ = y("FmMenu"), Ee = y("FmDropField"), U = y("FmCheckbox"), Ie = y("FmChip"), H = y("FmCard"), Re = y("FmTextField"), Ce = y("FmHelperText"), Te = y("FmSpacer");
|
|
299
|
+
return n(), i("div", $e, [
|
|
300
|
+
t(h) ? (n(), i("div", Ue, " Checking for an unfinished import… ")) : t(e) ? (n(), i(O, { key: 2 }, [
|
|
301
|
+
s("div", je, [
|
|
302
|
+
s("div", null, [
|
|
303
|
+
s("div", ze, r(((X = t(e).file) == null ? void 0 : X.originalName) ?? "Unknown file"), 1),
|
|
304
|
+
s("div", Qe, " Import " + r(t(e)._id) + " · " + r(t(e).status), 1)
|
|
305
|
+
]),
|
|
306
|
+
u(Ie, {
|
|
307
|
+
label: t(e).status,
|
|
308
|
+
compact: ""
|
|
309
|
+
}, null, 8, ["label"])
|
|
310
|
+
]),
|
|
311
|
+
t(e).file ? d("", !0) : (n(), i("div", We, " The saved import is missing its uploaded file. Cancel it and upload the file again. ")),
|
|
312
|
+
t(z) ? (n(), i("div", Je, r(t(e).status === "RUNNING" ? "Importing members…" : t(e).status === "CANCELLING" ? "Cancelling import…" : "Preparing import preview…"), 1)) : d("", !0),
|
|
313
|
+
t(e).status === "READY" ? (n(), i("div", Ke, [
|
|
314
|
+
s("div", Xe, [
|
|
315
|
+
u(H, {
|
|
316
|
+
variant: "outlined",
|
|
317
|
+
class: "p-12"
|
|
318
|
+
}, {
|
|
319
|
+
default: N(() => [
|
|
320
|
+
s("div", Ze, r(t(e).summary.total), 1),
|
|
321
|
+
a[9] || (a[9] = s("div", { class: "fm-typo-en-body-sm-400" }, "Rows", -1))
|
|
322
|
+
]),
|
|
323
|
+
_: 1
|
|
324
|
+
}),
|
|
325
|
+
u(H, {
|
|
326
|
+
variant: "outlined",
|
|
327
|
+
class: "p-12"
|
|
328
|
+
}, {
|
|
329
|
+
default: N(() => [
|
|
330
|
+
s("div", et, r(t(e).summary.create), 1),
|
|
331
|
+
a[10] || (a[10] = s("div", { class: "fm-typo-en-body-sm-400" }, "Create", -1))
|
|
332
|
+
]),
|
|
333
|
+
_: 1
|
|
334
|
+
}),
|
|
335
|
+
u(H, {
|
|
336
|
+
variant: "outlined",
|
|
337
|
+
class: "p-12"
|
|
338
|
+
}, {
|
|
339
|
+
default: N(() => [
|
|
340
|
+
s("div", tt, r(t(e).summary.update), 1),
|
|
341
|
+
a[11] || (a[11] = s("div", { class: "fm-typo-en-body-sm-400" }, "Update", -1))
|
|
342
|
+
]),
|
|
343
|
+
_: 1
|
|
344
|
+
}),
|
|
345
|
+
u(H, {
|
|
346
|
+
variant: "outlined",
|
|
347
|
+
class: "p-12"
|
|
348
|
+
}, {
|
|
349
|
+
default: N(() => [
|
|
350
|
+
s("div", at, r(t(e).summary.balanceRows), 1),
|
|
351
|
+
a[12] || (a[12] = s("div", { class: "fm-typo-en-body-sm-400" }, "Balance rows", -1))
|
|
352
|
+
]),
|
|
353
|
+
_: 1
|
|
354
|
+
})
|
|
355
|
+
]),
|
|
356
|
+
t(e).summary.balanceRows ? (n(), i("div", ot, " Final target totals — Credit: " + r(t(e).summary.creditTargetTotal) + ", Experience: " + r(t(e).summary.experienceTargetTotal) + ", Points: " + r(t(e).summary.pointTargetTotal) + ". Tier changes: " + r(t(e).summary.tierRows) + ". ", 1)) : d("", !0),
|
|
357
|
+
t(e).summary.sharedProfiles ? (n(), i("div", st, r(t(e).summary.sharedProfiles) + " rows can update a shared profile used by another business. ", 1)) : d("", !0),
|
|
358
|
+
s("div", nt, [
|
|
359
|
+
a[13] || (a[13] = le(" To confirm your action, type ", -1)),
|
|
360
|
+
s("span", lt, r(t(e).businessName), 1),
|
|
361
|
+
a[14] || (a[14] = le(" in the text field ", -1))
|
|
362
|
+
]),
|
|
363
|
+
u(Re, {
|
|
364
|
+
modelValue: t(R),
|
|
365
|
+
"onUpdate:modelValue": a[3] || (a[3] = (l) => Ae(R) ? R.value = l : null)
|
|
366
|
+
}, null, 8, ["modelValue"]),
|
|
367
|
+
t(e).summary.sharedProfiles ? (n(), k(U, {
|
|
368
|
+
key: 2,
|
|
369
|
+
"model-value": t(T),
|
|
370
|
+
value: "shared-profile",
|
|
371
|
+
label: "I understand that shared profile fields can affect other businesses.",
|
|
372
|
+
"onUpdate:modelValue": a[4] || (a[4] = (l) => T.value = l)
|
|
373
|
+
}, null, 8, ["model-value"])) : d("", !0),
|
|
374
|
+
t(e).summary.balanceRows ? (n(), k(U, {
|
|
375
|
+
key: 3,
|
|
376
|
+
"model-value": t(x),
|
|
377
|
+
value: "balance-replacement",
|
|
378
|
+
label: "I understand that populated balance cells replace final balances.",
|
|
379
|
+
"onUpdate:modelValue": a[5] || (a[5] = (l) => x.value = l)
|
|
380
|
+
}, null, 8, ["model-value"])) : d("", !0),
|
|
381
|
+
u(U, {
|
|
382
|
+
"model-value": t(S),
|
|
383
|
+
value: "import-responsibility",
|
|
384
|
+
label: "I acknowledge that I understand what data I import and will take the responsibility",
|
|
385
|
+
"onUpdate:modelValue": a[6] || (a[6] = (l) => S.value = l)
|
|
386
|
+
}, null, 8, ["model-value"]),
|
|
387
|
+
t(D).debugMode ? (n(), i("div", rt, [
|
|
388
|
+
a[15] || (a[15] = s("div", { class: "fm-typo-en-body-sm-600" }, "Start import checks", -1)),
|
|
389
|
+
(n(!0), i(O, null, Q(t(ce), (l) => (n(), i("div", {
|
|
390
|
+
key: l.label,
|
|
391
|
+
class: "flex gap-8"
|
|
392
|
+
}, [
|
|
393
|
+
s("span", {
|
|
394
|
+
class: W(l.passed ? "text-green-600" : "text-red-600")
|
|
395
|
+
}, r(l.passed ? "✓" : "✗"), 3),
|
|
396
|
+
s("span", null, r(l.label) + ": " + r(l.value), 1)
|
|
397
|
+
]))), 128))
|
|
398
|
+
])) : d("", !0)
|
|
399
|
+
])) : d("", !0),
|
|
400
|
+
t(e).status === "INVALID" ? (n(), i("div", it, [
|
|
401
|
+
s("div", dt, [
|
|
402
|
+
a[16] || (a[16] = s("div", { class: "fm-typo-en-body-md-600" }, "The file is not importable", -1)),
|
|
403
|
+
s("div", ut, r(t(e).error), 1)
|
|
404
|
+
]),
|
|
405
|
+
(n(!0), i(O, null, Q((Z = t(e).rowErrors) == null ? void 0 : Z.slice(0, 10), (l) => (n(), i("div", {
|
|
406
|
+
key: l.rowNumber,
|
|
407
|
+
class: "fm-typo-en-body-sm-400"
|
|
408
|
+
}, " Row " + r(l.rowNumber) + ": " + r(l.errors.join("; ")), 1))), 128))
|
|
409
|
+
])) : d("", !0),
|
|
410
|
+
t(e).status === "STOPPED" ? (n(), i("div", ct, [
|
|
411
|
+
a[17] || (a[17] = s("div", { class: "fm-typo-en-body-md-600" }, "Import stopped", -1)),
|
|
412
|
+
s("div", mt, r(t(e).summary.completed) + " rows completed before the first runtime error. Fix the cause, then retry this same import safely. ", 1),
|
|
413
|
+
s("div", pt, r(t(e).error), 1)
|
|
414
|
+
])) : d("", !0),
|
|
415
|
+
t(e).status === "COMPLETED" ? (n(), i("div", ft, [
|
|
416
|
+
a[18] || (a[18] = s("div", { class: "fm-typo-en-body-md-600" }, "Import completed", -1)),
|
|
417
|
+
s("div", vt, r(t(e).summary.completed) + " members were processed. ", 1)
|
|
418
|
+
])) : d("", !0),
|
|
419
|
+
t(e).status === "CANCELLED" ? (n(), i("div", yt, [
|
|
420
|
+
a[19] || (a[19] = s("div", { class: "fm-typo-en-body-md-600" }, "Import cancelled", -1)),
|
|
421
|
+
s("div", bt, r(t(e).summary.completed) + " rows were completed before cancellation. ", 1)
|
|
422
|
+
])) : d("", !0)
|
|
423
|
+
], 64)) : (n(), i(O, { key: 1 }, [
|
|
424
|
+
a[8] || (a[8] = Le('<div class="rounded-md bg-fm-color-system-warning-100 p-16"><div class="fm-typo-en-title-sm-800"> Import changes production data </div><div class="fm-typo-en-body-md-400 text-fm-color-typo-secondary"><div class="grid grid-cols-[auto_1fr] gap-x-8 gap-y-8"><span aria-hidden="true">•</span><span>The file is fully validated before any member is changed.</span><span aria-hidden="true">•</span><span>Keep the sample row and paste your members from row 3 onward.</span><span aria-hidden="true">•</span><span>Blank cells keep existing values.</span><span aria-hidden="true">•</span><span>Use <code>__CLEAR__</code> to clear supported fields.</span><span aria-hidden="true">•</span><span>Use day/month/year for every date column; day and month may have one or two digits, for example <code>1/12/1989</code>. The sample row adds <code>(DD/MM/YYYY)</code> as a reminder; omit it in member rows.</span><span aria-hidden="true">•</span><span>Credit without CreditExpiryDate remains normal and non-expiring.</span><span aria-hidden="true">•</span><span> Each title requires one matching positional expiry. Quote both comma-separated fields in CSV, for example <code>"VIP,VVIP,SVIP"</code> and <code>"05/09/2026,06/09/2026,07/09/2026"</code>. </span></div></div></div>', 1)),
|
|
425
|
+
u(p, {
|
|
426
|
+
modelValue: t(L).mode,
|
|
427
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => t(L).mode = l),
|
|
428
|
+
label: "Import mode",
|
|
429
|
+
items: q
|
|
430
|
+
}, null, 8, ["modelValue"]),
|
|
431
|
+
s("div", He, [
|
|
432
|
+
u($, null, {
|
|
433
|
+
"menu-button": N(() => [
|
|
434
|
+
u(v, {
|
|
435
|
+
variant: "tertiary",
|
|
436
|
+
icon: "download",
|
|
437
|
+
label: "Download template"
|
|
438
|
+
})
|
|
439
|
+
]),
|
|
440
|
+
default: N(() => [
|
|
441
|
+
(n(), i(O, null, Q(j, (l) => u(C, {
|
|
442
|
+
key: l.value,
|
|
443
|
+
icon: l.icon,
|
|
444
|
+
label: l.label,
|
|
445
|
+
selectable: "",
|
|
446
|
+
onClick: (wt) => fe(l.value)
|
|
447
|
+
}, null, 8, ["icon", "label", "onClick"])), 64))
|
|
448
|
+
]),
|
|
449
|
+
_: 1
|
|
450
|
+
})
|
|
451
|
+
]),
|
|
452
|
+
t(f) ? (n(), i("div", Ge, [
|
|
453
|
+
u(v, {
|
|
454
|
+
variant: "tertiary",
|
|
455
|
+
"prepend-icon": "attach_file"
|
|
456
|
+
}),
|
|
457
|
+
s("p", qe, r(t(f).name), 1),
|
|
458
|
+
u(v, {
|
|
459
|
+
variant: "plain",
|
|
460
|
+
label: t(m)("Replace File"),
|
|
461
|
+
onClick: pe
|
|
462
|
+
}, null, 8, ["label"]),
|
|
463
|
+
s("input", {
|
|
464
|
+
ref_key: "replaceFileInput",
|
|
465
|
+
ref: E,
|
|
466
|
+
id: "member-import-file",
|
|
467
|
+
accept: ".csv, .xlsx",
|
|
468
|
+
class: "hidden",
|
|
469
|
+
type: "file",
|
|
470
|
+
onChange: me
|
|
471
|
+
}, null, 544)
|
|
472
|
+
])) : (n(), k(Ee, {
|
|
473
|
+
key: 0,
|
|
474
|
+
accept: ".csv, .xlsx",
|
|
475
|
+
"max-file-size": 5e6,
|
|
476
|
+
onFileUpload: a[1] || (a[1] = (l) => f.value = l)
|
|
477
|
+
})),
|
|
478
|
+
u(U, {
|
|
479
|
+
"model-value": t(B),
|
|
480
|
+
value: "import-warnings",
|
|
481
|
+
label: "I have read and understand these import rules.",
|
|
482
|
+
"onUpdate:modelValue": a[2] || (a[2] = (l) => B.value = l)
|
|
483
|
+
}, null, 8, ["model-value"])
|
|
484
|
+
], 64)),
|
|
485
|
+
t(c) ? (n(), k(Ce, {
|
|
486
|
+
key: 3,
|
|
487
|
+
state: "error",
|
|
488
|
+
text: t(c)
|
|
489
|
+
}, null, 8, ["text"])) : d("", !0),
|
|
490
|
+
s("div", _t, [
|
|
491
|
+
t(e) && ["INVALID", "STOPPED", "COMPLETED", "CANCELLED"].includes(t(e).status) ? (n(), k(v, {
|
|
492
|
+
key: 0,
|
|
493
|
+
variant: "tertiary",
|
|
494
|
+
icon: "download",
|
|
495
|
+
label: "Download result",
|
|
496
|
+
disabled: t(e).summary.total === 0,
|
|
497
|
+
onClick: ke
|
|
498
|
+
}, null, 8, ["disabled"])) : d("", !0),
|
|
499
|
+
((ee = t(e)) == null ? void 0 : ee.status) === "INVALID" ? (n(), k(v, {
|
|
500
|
+
key: 1,
|
|
501
|
+
variant: "tertiary",
|
|
502
|
+
label: "Choose another file",
|
|
503
|
+
onClick: _e
|
|
504
|
+
})) : d("", !0),
|
|
505
|
+
u(Te),
|
|
506
|
+
u(v, {
|
|
507
|
+
variant: "secondary",
|
|
508
|
+
label: "Close",
|
|
509
|
+
disabled: t(b),
|
|
510
|
+
onClick: a[7] || (a[7] = (l) => t(M).close())
|
|
511
|
+
}, null, 8, ["disabled"]),
|
|
512
|
+
t(e) && !["COMPLETED", "CANCELLED", "INVALID"].includes(t(e).status) ? (n(), k(v, {
|
|
513
|
+
key: 2,
|
|
514
|
+
variant: "secondary",
|
|
515
|
+
label: ((te = t(e)) == null ? void 0 : te.status) === "CANCELLING" ? "Cancelling…" : "Cancel import",
|
|
516
|
+
disabled: t(b) || ((ae = t(e)) == null ? void 0 : ae.status) === "CANCELLING",
|
|
517
|
+
onClick: we
|
|
518
|
+
}, null, 8, ["label", "disabled"])) : d("", !0),
|
|
519
|
+
t(e) ? d("", !0) : (n(), k(v, {
|
|
520
|
+
key: 3,
|
|
521
|
+
label: "Validate file",
|
|
522
|
+
disabled: !t(f) || !t(B) || t(b),
|
|
523
|
+
onClick: ve
|
|
524
|
+
}, null, 8, ["disabled"])),
|
|
525
|
+
((oe = t(e)) == null ? void 0 : oe.status) === "READY" ? (n(), k(v, {
|
|
526
|
+
key: 4,
|
|
527
|
+
label: "Start import",
|
|
528
|
+
disabled: !t(K) || t(b),
|
|
529
|
+
onClick: ge
|
|
530
|
+
}, null, 8, ["disabled"])) : d("", !0),
|
|
531
|
+
((se = t(e)) == null ? void 0 : se.status) === "STOPPED" ? (n(), k(v, {
|
|
532
|
+
key: 5,
|
|
533
|
+
label: "Retry import",
|
|
534
|
+
disabled: t(b) || !t(e).file,
|
|
535
|
+
onClick: he
|
|
536
|
+
}, null, 8, ["disabled"])) : d("", !0)
|
|
537
|
+
])
|
|
538
|
+
]);
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
}), ht = { class: "px-24 flex flex-col gap-y-16 pb-24" }, Ft = /* @__PURE__ */ J({
|
|
542
|
+
__name: "Member",
|
|
543
|
+
setup(G) {
|
|
544
|
+
const m = Oe(), { t: M } = ue(), D = de(), f = [
|
|
545
|
+
{
|
|
546
|
+
label: M("connect.loyalty.member.tabs.member_list"),
|
|
547
|
+
value: I["$connect-LOYALTY_MEMBER_LIST"]
|
|
548
|
+
}
|
|
549
|
+
], E = P(() => {
|
|
550
|
+
var w, _, L;
|
|
551
|
+
const h = m.currentRoute.value.name;
|
|
552
|
+
return h == I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"] ? {
|
|
553
|
+
title: "Import history",
|
|
554
|
+
description: void 0,
|
|
555
|
+
backButton: !0,
|
|
556
|
+
onBackButton: async () => {
|
|
557
|
+
await m.push({
|
|
558
|
+
name: I["$connect-LOYALTY_MEMBER_LIST"]
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
} : h != I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
|
|
562
|
+
title: e.value.label,
|
|
563
|
+
description: void 0
|
|
564
|
+
} : (e.value = f[1], {
|
|
565
|
+
backButton: !0,
|
|
566
|
+
title: M("connect.loyalty.member.title"),
|
|
567
|
+
description: `${(w = c.value) == null ? void 0 : w.name} (${(_ = c.value) == null ? void 0 : _._id}) (${(L = c.value) == null ? void 0 : L.phoneNumber})`,
|
|
568
|
+
onBackButton: async () => {
|
|
569
|
+
await m.push({ name: I["$connect-LOYALTY_MEMBER_LIST"] });
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}), e = g(
|
|
573
|
+
f.find((h) => h.value === m.currentRoute.value.name) ?? f[0]
|
|
574
|
+
), c = g(), R = P(
|
|
575
|
+
() => m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] || m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
576
|
+
), B = P(
|
|
577
|
+
() => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_TRANSACTIONS"]
|
|
578
|
+
), T = P(
|
|
579
|
+
() => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
580
|
+
);
|
|
581
|
+
async function x(h) {
|
|
582
|
+
await m.push({ name: h });
|
|
583
|
+
}
|
|
584
|
+
async function S() {
|
|
585
|
+
D.open({
|
|
586
|
+
title: "Import members",
|
|
587
|
+
closeButton: !1,
|
|
588
|
+
dismissAway: !1,
|
|
589
|
+
maxHeight: "90vh",
|
|
590
|
+
contentComponent: gt
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
async function b() {
|
|
594
|
+
await m.push({
|
|
595
|
+
name: I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
return Ne(
|
|
599
|
+
() => m.currentRoute.value.name,
|
|
600
|
+
async (h) => {
|
|
601
|
+
e.value = f.find((_) => _.value === h) ?? f[0];
|
|
602
|
+
const w = m.currentRoute.value.params.id;
|
|
603
|
+
w && (c.value = await A.readById(w));
|
|
604
|
+
},
|
|
605
|
+
{ immediate: !0 }
|
|
606
|
+
), (h, w) => {
|
|
607
|
+
const _ = y("FmButton"), L = y("FmPageHead"), q = y("FmTabs"), j = y("RouterView");
|
|
608
|
+
return n(), i(O, null, [
|
|
609
|
+
u(L, {
|
|
610
|
+
title: t(E).title,
|
|
611
|
+
description: t(E).description,
|
|
612
|
+
"back-button": t(E).backButton,
|
|
613
|
+
"onClick:back": t(E).onBackButton
|
|
614
|
+
}, Me({ _: 2 }, [
|
|
615
|
+
t(B) ? {
|
|
616
|
+
name: "append",
|
|
617
|
+
fn: N(() => [
|
|
618
|
+
u(Ye, null, {
|
|
619
|
+
default: N(() => [
|
|
620
|
+
t(T) ? (n(), k(_, {
|
|
621
|
+
key: 0,
|
|
622
|
+
label: "Import history",
|
|
623
|
+
"prepend-icon": "work_history",
|
|
624
|
+
variant: "tertiary",
|
|
625
|
+
onClick: b
|
|
626
|
+
})) : d("", !0),
|
|
627
|
+
u(_, {
|
|
628
|
+
label: t(M)("connect.loyalty.member.import"),
|
|
629
|
+
"prepend-icon": "download",
|
|
630
|
+
onClick: S
|
|
631
|
+
}, null, 8, ["label"])
|
|
632
|
+
]),
|
|
633
|
+
_: 1
|
|
634
|
+
})
|
|
635
|
+
]),
|
|
636
|
+
key: "0"
|
|
637
|
+
} : void 0
|
|
638
|
+
]), 1032, ["title", "description", "back-button", "onClick:back"]),
|
|
639
|
+
s("div", ht, [
|
|
640
|
+
t(R) ? d("", !0) : (n(), k(q, {
|
|
641
|
+
key: 0,
|
|
642
|
+
"model-value": t(e).value,
|
|
643
|
+
items: f,
|
|
644
|
+
"onUpdate:modelValue": x
|
|
645
|
+
}, null, 8, ["model-value"])),
|
|
646
|
+
u(j)
|
|
647
|
+
])
|
|
648
|
+
], 64);
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
export {
|
|
653
|
+
Ft as default
|
|
654
|
+
};
|