@feedmepos/mf-connect 0.1.98-beta.6 → 0.1.98-beta.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/{App-CvJ0ASlp.js → App-BPFhGsvV.js} +812 -666
  2. package/dist/{AuditLogs-Bt9S2LKL.js → AuditLogs-CW8vs5kM.js} +14 -13
  3. package/dist/{Bin-ZSCDSioa.js → Bin-CgdkmL0M.js} +8 -8
  4. package/dist/Broadcast-CoRRvfXh.js +302 -0
  5. package/dist/CampaignAnalytic-UAwVz0E3.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-LweQ57aG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_IbtQLp.js} +6 -5
  7. package/dist/Card-D3-MgguK.js +1084 -0
  8. package/dist/{Collections-H7zhe9zN.js → Collections-BU7-Lz_-.js} +14 -13
  9. package/dist/Credit-C9gf6eCr.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-UK9GcPFC.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B9A98JpX.js +4213 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-qNmiKaJc.js → EffectSheet.vue_vue_type_style_index_0_lang-nKD6CT3U.js} +35 -35
  13. package/dist/{Experience-CH5tg-tm.js → Experience-dKvKT4v4.js} +112 -86
  14. package/dist/{FileSaver.min-DNFqiyZb.js → FileSaver.min-CI8hZvUL.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-CBjdeb6F.js +356 -0
  17. package/dist/GiftCardSetup-DA9yMwPR.js +662 -0
  18. package/dist/{Grab-3s_sLewD.js → Grab-zCeZMSNI.js} +33 -32
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fbmoN1e9.js → ImageInput.vue_vue_type_script_setup_true_lang-CxhlYuM9.js} +1 -1
  20. package/dist/{Index-zTWZCiEo.js → Index-UGpjUfjV.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BOxYPkf5.js → LocationPicker.vue_vue_type_script_setup_true_lang-D21fIVUX.js} +1 -1
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-wjJ_cwft.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DrB7xzy1.js} +1 -1
  23. package/dist/LoyaltyDashboard-CBPnQReU.js +2865 -0
  24. package/dist/MainLayout-BBJUWsAz.js +143 -0
  25. package/dist/{Marketing-Bto1OvK1.js → Marketing-BjQG6Q41.js} +7 -6
  26. package/dist/{MarketingMaterialEdit-D7rIqF5U.js → MarketingMaterialEdit-CMUbiKjd.js} +15 -14
  27. package/dist/Member-B-7tGoFW.js +649 -0
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BLmafK0n.js +1287 -0
  29. package/dist/MemberImportHistory-CDyHKO1L.js +187 -0
  30. package/dist/MemberList-f0dMdOF8.js +336 -0
  31. package/dist/{MemberTransactions-CjTtGB2y.js → MemberTransactions-DVcRoyxv.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DvKL7BL5.js → MessageInput.vue_vue_type_script_setup_true_lang-CnpXUVvO.js} +5682 -5479
  33. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BTBXutpq.js +40 -0
  34. package/dist/Mission-CrrXaD8F.js +360 -0
  35. package/dist/{Overview-mxGLyFvE.js → Overview-CAIxshHU.js} +21 -20
  36. package/dist/Overview-Y_hxLN7Y.js +1316 -0
  37. package/dist/Point-CE0G4oxW.js +288 -0
  38. package/dist/Promotion-C_NQWWOT.js +423 -0
  39. package/dist/{Queue-DgaFyyyH.js → Queue-BfZGOOsa.js} +14 -13
  40. package/dist/{Record-BRol__6_.js → Record-BR3Su26B.js} +9 -9
  41. package/dist/Review-FrIgV7vH.js +45 -0
  42. package/dist/ReviewFacebookCallback-DOyee73-.js +238 -0
  43. package/dist/ReviewGoogleCallback-CX0cbT4r.js +213 -0
  44. package/dist/{Reward-DQI0PvmR.js → Reward-COkgkVT-.js} +35 -35
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B6bvQNsU.js → RewardGroup.vue_vue_type_script_setup_true_lang-CUd-Gy5a.js} +14 -13
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DgAU7jGo.js → RuleGroup.vue_vue_type_script_setup_true_lang-eBVDv0Qy.js} +103 -109
  47. package/dist/{Segment-DFaLx0QZ.js → Segment-kh3FuWRP.js} +30 -29
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cpb2i9iV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CUoiQlba.js} +31 -30
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-MvoepHn9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BkylJ859.js} +4 -4
  50. package/dist/{Setting-D2NjFJvq.js → Setting-UDrEIdF9.js} +14 -14
  51. package/dist/{SettingAdvertisements-CPWgSMaA.js → SettingAdvertisements-Dic4fC0u.js} +12 -12
  52. package/dist/Settings-Ct_ESMn8.js +230 -0
  53. package/dist/Store-CyG1FPWq.js +2612 -0
  54. package/dist/{StoreRewards-Ccj12pyq.js → StoreRewards-C9b_rMRT.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DaGFayps.js +1329 -0
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CfWTn0Xd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dew6rC4d.js} +2 -2
  57. package/dist/{Tier-vaJoohiM.js → Tier-DgLEHrFJ.js} +2296 -750
  58. package/dist/{Title-BqHC7-v9.js → Title-C_8gMnYS.js} +39 -37
  59. package/dist/Transaction-B9E0jWw9.js +45 -0
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dporb9KE.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DgW4dSkV.js} +26 -26
  61. package/dist/{Voucher-DeN6C6DQ.js → Voucher-DR3Eteh4.js} +156 -133
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-De16fuC4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-JexB74ky.js} +115 -121
  63. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DAC-j0Ln.js → ZodTextField.vue_vue_type_script_setup_true_lang-ChOd_di8.js} +2 -2
  64. package/dist/{app-n4Y2jMee.js → app-BIjITpNJ.js} +29593 -25208
  65. package/dist/app.js +1 -1
  66. package/dist/base.export-DqZ38Nx2.js +75 -0
  67. package/dist/{business-jn-_l48y.js → business-j4ZuiLuJ.js} +5 -5
  68. package/dist/campaign-DxhXoOvw.js +100 -0
  69. package/dist/campaign-MS9awZ18.js +368 -0
  70. package/dist/{campaign.enum-C9HvoKuq.js → campaign.enum-Bk6qcWR3.js} +1 -1
  71. package/dist/campaign.fn-DR_X38U8.js +776 -0
  72. package/dist/{collectible.enum-_HVU4lWn.js → collectible.enum-C_E4CCGR.js} +1 -1
  73. package/dist/collection.fn-BfyWr7cC.js +26 -0
  74. package/dist/currency-DZzC-632.js +7 -0
  75. package/dist/{duplicateCampaign-gzVwrnWb.js → duplicateCampaign-BgTmR0T2.js} +11 -11
  76. package/dist/{effect-DhpIv1L3.js → effect-DPCjkqDR.js} +1 -1
  77. package/dist/{email-addresses-DPxYLSoa.js → email-addresses-BoPJkP5p.js} +209 -201
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-WYHUnHVy.js → helper-DwJK1iKj.js} +1 -1
  80. package/dist/{index-BPsofsGt.js → index-8vHynDvo.js} +1933 -2560
  81. package/dist/{index-BdqRrCt8.js → index-Bd4ErVnX.js} +5 -5
  82. package/dist/index-BkFxLxI6.js +137 -0
  83. package/dist/index-BvxBDSzh.js +72 -0
  84. package/dist/{index-DUTFNEn9.js → index-C5Jm1Was.js} +4 -4
  85. package/dist/{index-xao4ggML.js → index-CIuQyo1z.js} +5 -5
  86. package/dist/{index-C-5YgmkC.js → index-CMJCsyXT.js} +7 -5
  87. package/dist/index-CTo26AN3.js +14530 -0
  88. package/dist/{index-Cte6dHHy.js → index-CVMsPseO.js} +14 -14
  89. package/dist/{index-BdnHQSDd.js → index-CXbojcfi.js} +5 -4
  90. package/dist/index-Cso1GrEu.js +53 -0
  91. package/dist/{index-Cvfavr2M.js → index-DD24eHtV.js} +351 -216
  92. package/dist/index-DGOX45St.js +151 -0
  93. package/dist/index-DP6WMBRq.js +900 -0
  94. package/dist/{index-7HizF3GI.js → index-DfwXt9fy.js} +1588 -1522
  95. package/dist/{index--fNMSXUf.js → index-Dn2mOB0A.js} +1 -1
  96. package/dist/{index-BuLfxJyC.js → index-LJrZDUgh.js} +105 -123
  97. package/dist/{index-BN-FP9kx.js → index-a15EaBn7.js} +1 -1
  98. package/dist/{index.esm2017-CjzFPUCa.js → index.esm2017-CWii-ZqX.js} +164 -164
  99. package/dist/{loading-CojnK00V.js → loading-CibOtJVR.js} +1 -1
  100. package/dist/{lodash-CLkg5jTT.js → lodash-oHoQ9t6u.js} +1 -1
  101. package/dist/member-import-BgJP811X.js +187 -0
  102. package/dist/membership-CqFY6ya6.js +274 -0
  103. package/dist/{money-CyaLaEKo.js → money-tVvfE8ha.js} +1 -1
  104. package/dist/{number-DEtI4bEX.js → number-B4p37H0W.js} +1 -1
  105. package/dist/objectid-reVda6sT.js +145 -0
  106. package/dist/{plugins-MnP1vCcg.js → plugins-S4qmcyLz.js} +13 -12
  107. package/dist/remy-Qz_pNsUS.js +13 -0
  108. package/dist/{reward-Dk3D26xC.js → reward-CgHNw9uj.js} +1 -1
  109. package/dist/{rule-B1Agad1n.js → rule-BECsW_aD.js} +335 -275
  110. package/dist/style.css +1 -1
  111. package/dist/{template-DpqLCq1p.js → template-jOqP_F7D.js} +6 -6
  112. package/dist/timezone-BBXko2_m.js +20 -0
  113. package/dist/transaction.fn-3DOFgJNT.js +64 -0
  114. package/dist/{trigger-cwPN-4Ia.js → trigger-DBIaHlqi.js} +17 -17
  115. package/dist/useMarketingMaterialActions-Dnln39_O.js +96 -0
  116. package/dist/{usePagination-D8zBMxdJ.js → usePagination-BKN2uLM2.js} +1 -1
  117. package/dist/{user-EUGwaL2f.js → user-CTKTBdLx.js} +1 -1
  118. package/dist/{vue-i18n-BBj45p9N.js → vue-i18n-Di-6yoyq.js} +233 -233
  119. package/dist/{xlsx-DiMIlKmu.js → xlsx-Z1jRdg68.js} +584 -584
  120. package/dist/{zod-B1cU167C.js → zod-BmQ5EO9I.js} +1 -1
  121. package/package.json +6 -5
  122. package/dist/Broadcast-BT0R11RB.js +0 -266
  123. package/dist/Card-Wdh8lyUv.js +0 -910
  124. package/dist/Credit-BuKLrFtM.js +0 -260
  125. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  126. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js +0 -3377
  127. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  128. package/dist/Game-C9s4qZz4.js +0 -330
  129. package/dist/LoyaltyDashboard-tOOk6zvV.js +0 -1082
  130. package/dist/MainLayout-iWi1DzXS.js +0 -41
  131. package/dist/Member-BdgdT-sa.js +0 -280
  132. package/dist/MemberList-DBIE-RWC.js +0 -1601
  133. package/dist/Mission-CWR6FBvN.js +0 -334
  134. package/dist/Point-BIt82fJk.js +0 -262
  135. package/dist/Promotion-Cl1vPi0B.js +0 -397
  136. package/dist/Review-DmV2YnFd.js +0 -1076
  137. package/dist/ReviewFacebookCallback-B5XgAWXo.js +0 -243
  138. package/dist/ReviewGoogleCallback-CYR03Wfd.js +0 -208
  139. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CAImd3yc.js +0 -181
  140. package/dist/Store-DjUe8ady.js +0 -1996
  141. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B7w69A3j.js +0 -1130
  142. package/dist/Transaction-BOmDOGnD.js +0 -39
  143. package/dist/campaign-BnI7-ceP.js +0 -219
  144. package/dist/campaign-rgDnocfT.js +0 -277
  145. package/dist/campaign.fn-D21ettpH.js +0 -776
  146. package/dist/export-CWAxYj7W.js +0 -97
  147. package/dist/index-B6EBgIUx.js +0 -85
  148. package/dist/index-CxR1baaG.js +0 -52
  149. package/dist/membership-CeX8E_I9.js +0 -255
  150. package/dist/objectid-CMau7CW-.js +0 -145
  151. package/dist/useMarketingMaterialActions-CGzfJ68e.js +0 -107
@@ -0,0 +1,649 @@
1
+ import { defineComponent as J, resolveComponent as v, 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 E, toDisplayString as r, createCommentVNode as c, createTextVNode as le, isRef as Ae, watch as Ne, createSlots as Me } from "vue";
2
+ import "./index-Dn2mOB0A.js";
3
+ import { useDialog as ue } from "@feedmepos/ui-library";
4
+ import { u as de } from "./vue-i18n-Di-6yoyq.js";
5
+ import { useCoreStore as Fe } from "@feedmepos/mf-common";
6
+ import { F as re } from "./FileSaver.min-CI8hZvUL.js";
7
+ import { u as V, w as Pe } from "./xlsx-Z1jRdg68.js";
8
+ import { u as De } from "./app-wDQR6dpb.js";
9
+ import { M as ie, a as Be } from "./member-import-BgJP811X.js";
10
+ import { m as A } from "./index-BkFxLxI6.js";
11
+ import { useRouter as Oe } from "vue-router";
12
+ import { R as I } from "./app-BIjITpNJ.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 k = v("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(k, {
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
+ }, ut = { class: "rounded-md bg-fm-color-system-error-100 p-16" }, dt = { 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 } = de(), M = ue(), D = De(), f = g(null), k = g(null), e = g(null), d = 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 a;
116
+ return ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING", "CANCELLING"].includes(
117
+ ((a = e.value) == null ? void 0 : a.status) ?? ""
118
+ );
119
+ }
120
+ ), K = P(() => {
121
+ var a;
122
+ return !(((a = e.value) == null ? void 0 : a.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 a = e.value, o = a == null ? void 0 : a.summary, p = !!a && R.value === a.businessName;
125
+ return [
126
+ {
127
+ label: "Status is READY",
128
+ passed: (a == null ? void 0 : a.status) === "READY",
129
+ value: (a == null ? void 0 : a.status) ?? "missing"
130
+ },
131
+ {
132
+ label: "Uploaded file exists",
133
+ passed: !!(a != null && a.file),
134
+ value: a != null && a.file ? "yes" : "no"
135
+ },
136
+ {
137
+ label: "Business name matches exactly",
138
+ passed: p,
139
+ value: `entered "${R.value}" / expected "${(a == null ? void 0 : a.businessName) ?? ""}"`
140
+ },
141
+ {
142
+ label: "Shared-profile acknowledgement",
143
+ passed: !(o != null && o.sharedProfiles) || T.value,
144
+ value: o != null && o.sharedProfiles ? `${T.value ? "checked" : "required"} (${o.sharedProfiles} rows)` : "not required"
145
+ },
146
+ {
147
+ label: "Balance-replacement acknowledgement",
148
+ passed: !(o != null && o.balanceRows) || x.value,
149
+ value: o != null && o.balanceRows ? `${x.value ? "checked" : "required"} (${o.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(a) {
159
+ var o, p;
160
+ f.value = ((p = (o = a.target) == null ? void 0 : o.files) == null ? void 0 : p[0]) ?? null;
161
+ }
162
+ function pe() {
163
+ k.value && (k.value.value = "", k.value.click());
164
+ }
165
+ function fe(a) {
166
+ const o = [
167
+ [...ie],
168
+ [...Be]
169
+ ], p = V.aoa_to_sheet(o);
170
+ if (a === "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 y = 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(y, p, "Members"), Pe(y, "ImportMemberTemplate.xlsx", { cellStyles: !0 });
185
+ }
186
+ async function ve() {
187
+ if (!f.value) {
188
+ d.value = "Please upload a file.";
189
+ return;
190
+ }
191
+ if (!B.value) {
192
+ d.value = "Please read and acknowledge the import warnings.";
193
+ return;
194
+ }
195
+ b.value = !0, d.value = "";
196
+ try {
197
+ const a = new FormData();
198
+ a.append("file", f.value), a.append("config", JSON.stringify(L.value)), e.value = await A.import(a), await F();
199
+ } catch (a) {
200
+ d.value = a instanceof Error ? a.message : String(a);
201
+ } finally {
202
+ b.value = !1;
203
+ }
204
+ }
205
+ async function ye(a) {
206
+ var p, y;
207
+ if (!e.value) return !1;
208
+ const o = e.value._id.toString();
209
+ try {
210
+ const C = await A.readImport(o);
211
+ return a !== _ || ((p = e.value) == null ? void 0 : p._id.toString()) !== o ? !1 : (e.value = C, !0);
212
+ } catch (C) {
213
+ if (a !== _ || ((y = e.value) == null ? void 0 : y._id.toString()) !== o)
214
+ return !1;
215
+ throw C;
216
+ }
217
+ }
218
+ async function F() {
219
+ var o;
220
+ Y();
221
+ const a = _;
222
+ try {
223
+ if (!await ye(a)) return;
224
+ } catch (p) {
225
+ if (a !== _) return;
226
+ d.value = p instanceof Error ? p.message : String(p), z.value && (w = setTimeout(F, 5e3));
227
+ return;
228
+ }
229
+ a === _ && z.value && (w = setTimeout(F, ((o = e.value) == null ? void 0 : o.status) === "RUNNING" ? 5e3 : 1500));
230
+ }
231
+ async function be() {
232
+ try {
233
+ e.value = await A.resumableImport(), e.value && await F();
234
+ } catch (a) {
235
+ d.value = a instanceof Error ? a.message : String(a);
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, d.value = "", S.value = !1;
245
+ }
246
+ async function ge() {
247
+ if (!(!e.value || !K.value)) {
248
+ b.value = !0, d.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 (a) {
258
+ d.value = a instanceof Error ? a.message : String(a);
259
+ } finally {
260
+ b.value = !1;
261
+ }
262
+ }
263
+ }
264
+ async function he() {
265
+ if (e.value) {
266
+ b.value = !0, d.value = "";
267
+ try {
268
+ e.value = await A.retryImport(e.value._id.toString()), await F();
269
+ } catch (a) {
270
+ d.value = a instanceof Error ? a.message : String(a);
271
+ } finally {
272
+ b.value = !1;
273
+ }
274
+ }
275
+ }
276
+ async function we() {
277
+ if (!e.value || ["COMPLETED", "CANCELLED", "INVALID"].includes(e.value.status)) {
278
+ M.close();
279
+ return;
280
+ }
281
+ if (e.value.status !== "CANCELLING") {
282
+ b.value = !0, d.value = "";
283
+ try {
284
+ const a = await A.cancelImport(e.value._id.toString());
285
+ Y(), e.value = a, e.value.status === "CANCELLING" && await F();
286
+ } catch (a) {
287
+ d.value = a instanceof Error ? a.message : String(a);
288
+ } finally {
289
+ b.value = !1;
290
+ }
291
+ }
292
+ }
293
+ async function ke() {
294
+ if (!e.value) return;
295
+ const a = await A.downloadImportResult(e.value._id.toString());
296
+ re.saveAs(a, `member-import-${e.value._id}.csv`);
297
+ }
298
+ return xe(be), Se(Y), (a, o) => {
299
+ var X, Z, ee, te, ae, oe, se;
300
+ const p = v("FmSelect"), y = v("FmButton"), C = v("FmMenuItem"), $ = v("FmMenu"), Ee = v("FmDropField"), U = v("FmCheckbox"), Ie = v("FmChip"), H = v("FmCard"), Re = v("FmTextField"), Ce = v("FmHelperText"), Te = v("FmSpacer");
301
+ return n(), i("div", $e, [
302
+ t(h) ? (n(), i("div", Ue, " Checking for an unfinished import… ")) : t(e) ? (n(), i(O, { key: 2 }, [
303
+ s("div", je, [
304
+ s("div", null, [
305
+ s("div", ze, r(((X = t(e).file) == null ? void 0 : X.originalName) ?? "Unknown file"), 1),
306
+ s("div", Qe, " Import " + r(t(e)._id) + " · " + r(t(e).status), 1)
307
+ ]),
308
+ u(Ie, {
309
+ label: t(e).status,
310
+ compact: ""
311
+ }, null, 8, ["label"])
312
+ ]),
313
+ t(e).file ? c("", !0) : (n(), i("div", We, " The saved import is missing its uploaded file. Cancel it and upload the file again. ")),
314
+ t(z) ? (n(), i("div", Je, r(t(e).status === "RUNNING" ? "Importing members…" : t(e).status === "CANCELLING" ? "Cancelling import…" : "Preparing import preview…"), 1)) : c("", !0),
315
+ t(e).status === "READY" ? (n(), i("div", Ke, [
316
+ s("div", Xe, [
317
+ u(H, {
318
+ variant: "outlined",
319
+ class: "p-12"
320
+ }, {
321
+ default: N(() => [
322
+ s("div", Ze, r(t(e).summary.total), 1),
323
+ o[8] || (o[8] = s("div", { class: "fm-typo-en-body-sm-400" }, "Rows", -1))
324
+ ]),
325
+ _: 1
326
+ }),
327
+ u(H, {
328
+ variant: "outlined",
329
+ class: "p-12"
330
+ }, {
331
+ default: N(() => [
332
+ s("div", et, r(t(e).summary.create), 1),
333
+ o[9] || (o[9] = s("div", { class: "fm-typo-en-body-sm-400" }, "Create", -1))
334
+ ]),
335
+ _: 1
336
+ }),
337
+ u(H, {
338
+ variant: "outlined",
339
+ class: "p-12"
340
+ }, {
341
+ default: N(() => [
342
+ s("div", tt, r(t(e).summary.update), 1),
343
+ o[10] || (o[10] = s("div", { class: "fm-typo-en-body-sm-400" }, "Update", -1))
344
+ ]),
345
+ _: 1
346
+ }),
347
+ u(H, {
348
+ variant: "outlined",
349
+ class: "p-12"
350
+ }, {
351
+ default: N(() => [
352
+ s("div", at, r(t(e).summary.balanceRows), 1),
353
+ o[11] || (o[11] = s("div", { class: "fm-typo-en-body-sm-400" }, "Balance rows", -1))
354
+ ]),
355
+ _: 1
356
+ })
357
+ ]),
358
+ 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)) : c("", !0),
359
+ t(e).summary.sharedProfiles ? (n(), i("div", st, r(t(e).summary.sharedProfiles) + " rows can update a shared profile used by another business. ", 1)) : c("", !0),
360
+ s("div", nt, [
361
+ o[12] || (o[12] = le(" To confirm your action, type ", -1)),
362
+ s("span", lt, r(t(e).businessName), 1),
363
+ o[13] || (o[13] = le(" in the text field ", -1))
364
+ ]),
365
+ u(Re, {
366
+ modelValue: t(R),
367
+ "onUpdate:modelValue": o[3] || (o[3] = (l) => Ae(R) ? R.value = l : null)
368
+ }, null, 8, ["modelValue"]),
369
+ t(e).summary.sharedProfiles ? (n(), E(U, {
370
+ key: 2,
371
+ "model-value": t(T),
372
+ value: "shared-profile",
373
+ label: "I understand that shared profile fields can affect other businesses.",
374
+ "onUpdate:modelValue": o[4] || (o[4] = (l) => T.value = l)
375
+ }, null, 8, ["model-value"])) : c("", !0),
376
+ t(e).summary.balanceRows ? (n(), E(U, {
377
+ key: 3,
378
+ "model-value": t(x),
379
+ value: "balance-replacement",
380
+ label: "I understand that populated balance cells replace final balances.",
381
+ "onUpdate:modelValue": o[5] || (o[5] = (l) => x.value = l)
382
+ }, null, 8, ["model-value"])) : c("", !0),
383
+ u(U, {
384
+ "model-value": t(S),
385
+ value: "import-responsibility",
386
+ label: "I acknowledge that I understand what data I import and will take the responsibility",
387
+ "onUpdate:modelValue": o[6] || (o[6] = (l) => S.value = l)
388
+ }, null, 8, ["model-value"]),
389
+ t(D).debugMode ? (n(), i("div", rt, [
390
+ o[14] || (o[14] = s("div", { class: "fm-typo-en-body-sm-600" }, "Start import checks", -1)),
391
+ (n(!0), i(O, null, Q(t(ce), (l) => (n(), i("div", {
392
+ key: l.label,
393
+ class: "flex gap-8"
394
+ }, [
395
+ s("span", {
396
+ class: W(l.passed ? "text-green-600" : "text-red-600")
397
+ }, r(l.passed ? "✓" : "✗"), 3),
398
+ s("span", null, r(l.label) + ": " + r(l.value), 1)
399
+ ]))), 128))
400
+ ])) : c("", !0)
401
+ ])) : c("", !0),
402
+ t(e).status === "INVALID" ? (n(), i("div", it, [
403
+ s("div", ut, [
404
+ o[15] || (o[15] = s("div", { class: "fm-typo-en-body-md-600" }, "The file is not importable", -1)),
405
+ s("div", dt, r(t(e).error), 1)
406
+ ]),
407
+ (n(!0), i(O, null, Q((Z = t(e).rowErrors) == null ? void 0 : Z.slice(0, 10), (l) => (n(), i("div", {
408
+ key: l.rowNumber,
409
+ class: "fm-typo-en-body-sm-400"
410
+ }, " Row " + r(l.rowNumber) + ": " + r(l.errors.join("; ")), 1))), 128))
411
+ ])) : c("", !0),
412
+ t(e).status === "STOPPED" ? (n(), i("div", ct, [
413
+ o[16] || (o[16] = s("div", { class: "fm-typo-en-body-md-600" }, "Import stopped", -1)),
414
+ 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),
415
+ s("div", pt, r(t(e).error), 1)
416
+ ])) : c("", !0),
417
+ t(e).status === "COMPLETED" ? (n(), i("div", ft, [
418
+ o[17] || (o[17] = s("div", { class: "fm-typo-en-body-md-600" }, "Import completed", -1)),
419
+ s("div", vt, r(t(e).summary.completed) + " members were processed. ", 1)
420
+ ])) : c("", !0),
421
+ t(e).status === "CANCELLED" ? (n(), i("div", yt, [
422
+ o[18] || (o[18] = s("div", { class: "fm-typo-en-body-md-600" }, "Import cancelled", -1)),
423
+ s("div", bt, r(t(e).summary.completed) + " rows were completed before cancellation. ", 1)
424
+ ])) : c("", !0)
425
+ ], 64)) : (n(), i(O, { key: 1 }, [
426
+ o[7] || (o[7] = 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>&quot;VIP,VVIP,SVIP&quot;</code> and <code>&quot;05/09/2026,06/09/2026,07/09/2026&quot;</code>. </span></div></div></div>', 1)),
427
+ u(p, {
428
+ modelValue: t(L).mode,
429
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => t(L).mode = l),
430
+ label: "Import mode",
431
+ items: q
432
+ }, null, 8, ["modelValue"]),
433
+ s("div", He, [
434
+ u($, null, {
435
+ "menu-button": N(() => [
436
+ u(y, {
437
+ variant: "tertiary",
438
+ icon: "download",
439
+ label: "Download template"
440
+ })
441
+ ]),
442
+ default: N(() => [
443
+ (n(), i(O, null, Q(j, (l) => u(C, {
444
+ key: l.value,
445
+ icon: l.icon,
446
+ label: l.label,
447
+ selectable: "",
448
+ onClick: (wt) => fe(l.value)
449
+ }, null, 8, ["icon", "label", "onClick"])), 64))
450
+ ]),
451
+ _: 1
452
+ })
453
+ ]),
454
+ t(f) ? (n(), i("div", Ge, [
455
+ u(y, {
456
+ variant: "tertiary",
457
+ "prepend-icon": "attach_file"
458
+ }),
459
+ s("p", qe, r(t(f).name), 1),
460
+ u(y, {
461
+ variant: "plain",
462
+ label: t(m)("Replace File"),
463
+ onClick: pe
464
+ }, null, 8, ["label"]),
465
+ s("input", {
466
+ ref_key: "replaceFileInput",
467
+ ref: k,
468
+ id: "member-import-file",
469
+ accept: ".csv, .xlsx",
470
+ class: "hidden",
471
+ type: "file",
472
+ onChange: me
473
+ }, null, 544)
474
+ ])) : (n(), E(Ee, {
475
+ key: 0,
476
+ accept: ".csv, .xlsx",
477
+ "max-file-size": 5e6,
478
+ onFileUpload: o[1] || (o[1] = (l) => f.value = l)
479
+ })),
480
+ u(U, {
481
+ "model-value": t(B),
482
+ value: "import-warnings",
483
+ label: "I have read and understand these import rules.",
484
+ "onUpdate:modelValue": o[2] || (o[2] = (l) => B.value = l)
485
+ }, null, 8, ["model-value"])
486
+ ], 64)),
487
+ t(d) ? (n(), E(Ce, {
488
+ key: 3,
489
+ state: "error",
490
+ text: t(d)
491
+ }, null, 8, ["text"])) : c("", !0),
492
+ s("div", _t, [
493
+ t(e) && ["INVALID", "STOPPED", "COMPLETED", "CANCELLED"].includes(t(e).status) ? (n(), E(y, {
494
+ key: 0,
495
+ variant: "tertiary",
496
+ icon: "download",
497
+ label: "Download result",
498
+ disabled: t(e).summary.total === 0,
499
+ onClick: ke
500
+ }, null, 8, ["disabled"])) : c("", !0),
501
+ ((ee = t(e)) == null ? void 0 : ee.status) === "INVALID" ? (n(), E(y, {
502
+ key: 1,
503
+ variant: "tertiary",
504
+ label: "Choose another file",
505
+ onClick: _e
506
+ })) : c("", !0),
507
+ u(Te),
508
+ u(y, {
509
+ variant: "secondary",
510
+ label: ((te = t(e)) == null ? void 0 : te.status) === "CANCELLING" ? "Cancelling…" : t(e) && ["COMPLETED", "CANCELLED", "INVALID"].includes(t(e).status) ? "Close" : "Cancel",
511
+ disabled: t(b) || ((ae = t(e)) == null ? void 0 : ae.status) === "CANCELLING",
512
+ onClick: we
513
+ }, null, 8, ["label", "disabled"]),
514
+ t(e) ? c("", !0) : (n(), E(y, {
515
+ key: 2,
516
+ label: "Validate file",
517
+ disabled: !t(f) || !t(B) || t(b),
518
+ onClick: ve
519
+ }, null, 8, ["disabled"])),
520
+ ((oe = t(e)) == null ? void 0 : oe.status) === "READY" ? (n(), E(y, {
521
+ key: 3,
522
+ label: "Start import",
523
+ disabled: !t(K) || t(b),
524
+ onClick: ge
525
+ }, null, 8, ["disabled"])) : c("", !0),
526
+ ((se = t(e)) == null ? void 0 : se.status) === "STOPPED" ? (n(), E(y, {
527
+ key: 4,
528
+ label: "Retry import",
529
+ disabled: t(b) || !t(e).file,
530
+ onClick: he
531
+ }, null, 8, ["disabled"])) : c("", !0)
532
+ ])
533
+ ]);
534
+ };
535
+ }
536
+ }), ht = { class: "px-24 flex flex-col gap-y-16 pb-24" }, Ft = /* @__PURE__ */ J({
537
+ __name: "Member",
538
+ setup(G) {
539
+ const m = Oe(), { t: M } = de(), D = ue(), f = [
540
+ {
541
+ label: M("connect.loyalty.member.tabs.member_list"),
542
+ value: I["$connect-LOYALTY_MEMBER_LIST"]
543
+ }
544
+ ], k = P(() => {
545
+ var w, _, L;
546
+ const h = m.currentRoute.value.name;
547
+ return h == I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"] ? {
548
+ title: "Import history",
549
+ description: void 0,
550
+ backButton: !0,
551
+ onBackButton: async () => {
552
+ await m.push({
553
+ name: I["$connect-LOYALTY_MEMBER_LIST"]
554
+ });
555
+ }
556
+ } : h != I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
557
+ title: e.value.label,
558
+ description: void 0
559
+ } : (e.value = f[1], {
560
+ backButton: !0,
561
+ title: M("connect.loyalty.member.title"),
562
+ description: `${(w = d.value) == null ? void 0 : w.name} (${(_ = d.value) == null ? void 0 : _._id}) (${(L = d.value) == null ? void 0 : L.phoneNumber})`,
563
+ onBackButton: async () => {
564
+ await m.push({ name: I["$connect-LOYALTY_MEMBER_LIST"] });
565
+ }
566
+ });
567
+ }), e = g(
568
+ f.find((h) => h.value === m.currentRoute.value.name) ?? f[0]
569
+ ), d = g(), R = P(
570
+ () => m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] || m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
571
+ ), B = P(
572
+ () => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_TRANSACTIONS"]
573
+ ), T = P(
574
+ () => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
575
+ );
576
+ async function x(h) {
577
+ await m.push({ name: h });
578
+ }
579
+ async function S() {
580
+ D.open({
581
+ title: "Import members",
582
+ closeButton: !1,
583
+ dismissAway: !1,
584
+ maxHeight: "90vh",
585
+ contentComponent: gt
586
+ });
587
+ }
588
+ async function b() {
589
+ await m.push({
590
+ name: I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
591
+ });
592
+ }
593
+ return Ne(
594
+ () => m.currentRoute.value.name,
595
+ async (h) => {
596
+ e.value = f.find((_) => _.value === h) ?? f[0];
597
+ const w = m.currentRoute.value.params.id;
598
+ w && (d.value = await A.readById(w));
599
+ },
600
+ { immediate: !0 }
601
+ ), (h, w) => {
602
+ const _ = v("FmButton"), L = v("FmPageHead"), q = v("FmTabs"), j = v("RouterView");
603
+ return n(), i(O, null, [
604
+ u(L, {
605
+ title: t(k).title,
606
+ description: t(k).description,
607
+ "back-button": t(k).backButton,
608
+ "onClick:back": t(k).onBackButton
609
+ }, Me({ _: 2 }, [
610
+ t(B) ? {
611
+ name: "append",
612
+ fn: N(() => [
613
+ u(Ye, null, {
614
+ default: N(() => [
615
+ t(T) ? (n(), E(_, {
616
+ key: 0,
617
+ label: "Import history",
618
+ "prepend-icon": "work_history",
619
+ variant: "tertiary",
620
+ onClick: b
621
+ })) : c("", !0),
622
+ u(_, {
623
+ label: t(M)("connect.loyalty.member.import"),
624
+ "prepend-icon": "download",
625
+ onClick: S
626
+ }, null, 8, ["label"])
627
+ ]),
628
+ _: 1
629
+ })
630
+ ]),
631
+ key: "0"
632
+ } : void 0
633
+ ]), 1032, ["title", "description", "back-button", "onClick:back"]),
634
+ s("div", ht, [
635
+ t(R) ? c("", !0) : (n(), E(q, {
636
+ key: 0,
637
+ "model-value": t(e).value,
638
+ items: f,
639
+ "onUpdate:modelValue": x
640
+ }, null, 8, ["model-value"])),
641
+ u(j)
642
+ ])
643
+ ], 64);
644
+ };
645
+ }
646
+ });
647
+ export {
648
+ Ft as default
649
+ };