@feedmepos/mf-connect 0.1.38-beta.2 → 0.1.38-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-BjSfI2Ff.js → Analytic-CEd_WApy.js} +14 -14
- package/dist/{App-D11A2JY1.js → App-ulCtuU5o.js} +671 -661
- package/dist/{AuditLogs-DWCFYoRg.js → AuditLogs-BM1Np61K.js} +11 -11
- package/dist/{Bin-9wV4Ah3M.js → Bin-icbjnKXw.js} +9 -9
- package/dist/{Broadcast-I3BtSk8V.js → Broadcast-COQ3E8vI.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BbXEYOFK.js} +6 -6
- package/dist/{Card-CqALG5RM.js → Card-Cwh3GXi0.js} +142 -136
- package/dist/{Collections-rg3SzoUb.js → Collections-EuOjzpkL.js} +81 -75
- package/dist/{Credit-BNn1sYZv.js → Credit-BY2Fpdhh.js} +9 -9
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BbsLgUMQ.js} +678 -675
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js → EffectSheet.vue_vue_type_style_index_0_lang-BLw3-hI1.js} +6 -6
- package/dist/{Experience-D_Qm8SUj.js → Experience-rAH7zk71.js} +9 -9
- package/dist/{Game-CKXgXm6Q.js → Game-DlI0yNF0.js} +10 -10
- package/dist/{Index-D4DGfUHd.js → Index-DemXFS3d.js} +10 -10
- package/dist/{Marketing-Dn9A1vgH.js → Marketing-shNBO9Rc.js} +7 -7
- package/dist/{Member-B55vWHDd.js → Member-C19ZgpaL.js} +10 -10
- package/dist/{MemberList-BWTG9Ohy.js → MemberList-B2tNB4yg.js} +27 -27
- package/dist/{MemberTransactions-CP5EI-W0.js → MemberTransactions-BN3qaTVY.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js → MessageInput.vue_vue_type_script_setup_true_lang-BY3j1h72.js} +5621 -5418
- package/dist/{Mission-CFvhROuB.js → Mission-j1KI0-hJ.js} +10 -10
- package/dist/{Overview-4273yNwL.js → Overview-BN2Vdu8Q.js} +18 -18
- package/dist/{Point-B_-_C919.js → Point-8zy7QcTk.js} +9 -9
- package/dist/{Promotion-D2S3COxk.js → Promotion-mcUcylXB.js} +10 -10
- package/dist/{Queue-BmS1Oi-C.js → Queue-BsNv4P8u.js} +11 -11
- package/dist/{Record-DRBl0M8g.js → Record-VA6Bdlnz.js} +9 -9
- package/dist/{Reward-8056NmfK.js → Reward-CVyO3Ga1.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js → RewardGroup.vue_vue_type_script_setup_true_lang-BR9_a9bJ.js} +11 -11
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js +1763 -0
- package/dist/{Segment-Bzq-pyhc.js → Segment-BMgcdIIS.js} +209 -209
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js → SelectItems.vue_vue_type_script_setup_true_lang-CKRpWcn_.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DZCNcdVW.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BESF672g.js} +3 -3
- package/dist/{Setting-BrJfYoru.js → Setting-BMKKkZTD.js} +457 -442
- package/dist/{Store-Bpl_4yZW.js → Store-DdxMDtfL.js} +466 -459
- package/dist/{StoreRewards-Cu7n7Pjz.js → StoreRewards-CRyeHEMF.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DS6-9WP9.js} +207 -221
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BTKpclKX.js} +1 -1
- package/dist/{Tier-_LnXg3n6.js → Tier-D5Xmp5vV.js} +229 -226
- package/dist/{Title-B7AGStvx.js → Title-CsK2crqD.js} +141 -138
- package/dist/{Transaction-Chxv6V7u.js → Transaction-Dvfc9x4f.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CqCxWltm.js} +6 -6
- package/dist/{Voucher-C5z2kOq9.js → Voucher-CPN7TMho.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DMye9MS3.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js → ZodTextField.vue_vue_type_script_setup_true_lang-CnaQAEKo.js} +1 -1
- package/dist/{app-BVojNX0w.js → app-DRBevJsF.js} +1 -1
- package/dist/{app-7cvPyHJ7.js → app-DteFjR9L.js} +459 -449
- package/dist/app.js +1 -1
- package/dist/{business-CmxV69wT.js → business-BqV9jK-p.js} +1 -1
- package/dist/{campaign-CT_cNJEL.js → campaign-BHDq-yx-.js} +10 -10
- package/dist/{campaign-Dq5C_no-.js → campaign-CsWoG6e_.js} +2 -2
- package/dist/{campaign.enum-dp7yHKzF.js → campaign.enum-Dfa96W5V.js} +1 -1
- package/dist/{campaign.fn-BYZgKDN7.js → campaign.fn-pLrwyHA_.js} +37 -37
- package/dist/{collectible.enum-DxbB4DxT.js → collectible.enum-BYTYWPsR.js} +1 -1
- package/dist/{collection.fn-CNZRdUgy.js → collection.fn-CYLIQJig.js} +2 -2
- package/dist/{dto-CT9zZbv9.js → dto-DBfDbpyb.js} +4 -4
- package/dist/{effect-FIlOEC4H.js → effect-D9pD5RCk.js} +1 -1
- package/dist/{email-addresses-Ba7xImfX.js → email-addresses-BApvdLkQ.js} +1 -1
- package/dist/{export-uzjZFNF9.js → export--EfmCiw0.js} +4 -4
- package/dist/{helper-D4sAZde0.js → helper-BHiK3pLT.js} +1 -1
- package/dist/{index-B9pl4zRZ.js → index-2dknXEFJ.js} +19 -9
- package/dist/{index-CNJLP3D5.js → index-B9_Tn8si.js} +1 -1
- package/dist/{index-BjU8LVUC.js → index-BSQXDDQY.js} +6347 -6305
- package/dist/{index-CwsMG2cV.js → index-Bqc7PV3K.js} +1 -1
- package/dist/{index-CONvJfKv.js → index-C1Vrltkc.js} +1 -1
- package/dist/{index-D5rvMvzx.js → index-CD2bkLo_.js} +1 -1
- package/dist/{index-DNxa8Rqx.js → index-CDLBLuYq.js} +69 -68
- package/dist/{index-BXz54M1s.js → index-COiVJ9pA.js} +1 -1
- package/dist/{index-CH3z92VV.js → index-CVxruvVB.js} +1 -1
- package/dist/{index-CS3Jmojj.js → index-Cc80pBYX.js} +573 -573
- package/dist/{index-l2F5MnLF.js → index-DXM3o6kl.js} +11 -4
- package/dist/{index-BI3m1Ehv.js → index-DYgdunxw.js} +3 -3
- package/dist/{index-CvBcve-r.js → index-Pd9RCQxn.js} +1 -1
- package/dist/{index-CUfS9Kp1.js → index-qd_dvZcw.js} +2 -2
- package/dist/{index.esm2017-ATcsD5N4.js → index.esm2017-DAWS_ALH.js} +34 -34
- package/dist/{loading-BWGQSrCB.js → loading-BVUeda4s.js} +1 -1
- package/dist/{membership-Cc4OZ8-U.js → membership-BL_43RJR.js} +3 -3
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-D7p8nfun.js → money-Cd8hLiNc.js} +1 -1
- package/dist/{number-CMJjC4qz.js → number-DVb8PSrj.js} +1 -1
- package/dist/objectid-D33s3gxp.js +145 -0
- package/dist/{plugins-eQis66QR.js → plugins-BKtBkC9Q.js} +2 -2
- package/dist/{reward-DrnzbG20.js → reward-f41dJcaL.js} +1 -1
- package/dist/{rule-CtRxkYXB.js → rule-Cbux1-fC.js} +4 -4
- package/dist/rule-builder-BrZeF45Z.js +91 -0
- package/dist/style.css +4 -1
- package/dist/{template-C3UfY0v5.js → template-tqhgmIdT.js} +4 -4
- package/dist/timezone-DaTVH4y0.js +1150 -0
- package/dist/{trigger-C9U7Zgad.js → trigger-C34RfwrT.js} +4 -4
- package/dist/{user-D7n9yYmO.js → user-DgKhDLYr.js} +1 -1
- package/dist/{vue-i18n-Bz45zC04.js → vue-i18n-xo56wiwi.js} +410 -410
- package/dist/{xlsx-D4S4qbcZ.js → xlsx-D8ZZRjtf.js} +1 -1
- package/package.json +3 -2
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js +0 -1728
- package/dist/objectid-D5T27iny.js +0 -145
- package/dist/rule-builder-Di9RIYHF.js +0 -89
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as z, resolveComponent as
|
|
1
|
+
import { defineComponent as ee, ref as z, resolveComponent as F, openBlock as p, createElementBlock as k, createElementVNode as i, createVNode as r, unref as t, createCommentVNode as le, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as R, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
|
|
2
2
|
import { _ as Ee } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import {
|
|
4
|
-
import { u as
|
|
3
|
+
import { n as Ae, p as De } from "./plugins-BKtBkC9Q.js";
|
|
4
|
+
import { u as $e } from "./loading-BVUeda4s.js";
|
|
5
5
|
import { FmButtonVariant as ae, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as we, _ as
|
|
7
|
-
import { u as
|
|
8
|
-
import "./index-
|
|
9
|
-
import { i as
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import "./index-
|
|
13
|
-
import { u as ne, w as he } from "./xlsx-
|
|
14
|
-
import { e as
|
|
15
|
-
import { Z as
|
|
16
|
-
import { u as
|
|
17
|
-
import { F as ye, z as
|
|
18
|
-
import { R as ge } from "./rule-builder-
|
|
19
|
-
import { _ as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { u as
|
|
22
|
-
import { F as
|
|
23
|
-
import { h as H } from "./moment-
|
|
24
|
-
import { s as B, u as
|
|
25
|
-
import { o as
|
|
26
|
-
import { u as Ce } from "./business-
|
|
27
|
-
import { f as
|
|
28
|
-
import { t as
|
|
29
|
-
import "./index-
|
|
30
|
-
import { useRouter as
|
|
31
|
-
import { m as ve } from "./index-
|
|
32
|
-
import { R as _e } from "./app-
|
|
33
|
-
const
|
|
6
|
+
import { u as we, _ as Fe } from "./usePagination-BeF5K3M7.js";
|
|
7
|
+
import { u as be } from "./vue-i18n-xo56wiwi.js";
|
|
8
|
+
import "./index-2dknXEFJ.js";
|
|
9
|
+
import { i as Pe, j as $, c as fe } from "./index-CDLBLuYq.js";
|
|
10
|
+
import "./index-qd_dvZcw.js";
|
|
11
|
+
import "./index-C1Vrltkc.js";
|
|
12
|
+
import "./index-DYgdunxw.js";
|
|
13
|
+
import { u as ne, w as he } from "./xlsx-D8ZZRjtf.js";
|
|
14
|
+
import { e as Be, M as Ne } from "./email-addresses-BApvdLkQ.js";
|
|
15
|
+
import { Z as Ve } from "./zod-Bg2FbC-D.js";
|
|
16
|
+
import { u as Ye } from "./app-wDQR6dpb.js";
|
|
17
|
+
import { F as ye, z as Ue } from "./index-Cc80pBYX.js";
|
|
18
|
+
import { R as ge } from "./rule-builder-BrZeF45Z.js";
|
|
19
|
+
import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CnaQAEKo.js";
|
|
20
|
+
import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js";
|
|
21
|
+
import { u as Oe, v as je, w as qe } from "./index.esm2017-DAWS_ALH.js";
|
|
22
|
+
import { F as Ge } from "./FileSaver.min-NlMItPOc.js";
|
|
23
|
+
import { h as H } from "./moment-D7p2TMB-.js";
|
|
24
|
+
import { s as B, u as He } from "./membership-BL_43RJR.js";
|
|
25
|
+
import { o as Je } from "./objectId-dwaoBfJX.js";
|
|
26
|
+
import { u as Ce } from "./business-BqV9jK-p.js";
|
|
27
|
+
import { f as Qe } from "./number-DVb8PSrj.js";
|
|
28
|
+
import { t as We } from "./money-Cd8hLiNc.js";
|
|
29
|
+
import "./index-B9_Tn8si.js";
|
|
30
|
+
import { useRouter as Ze } from "vue-router";
|
|
31
|
+
import { m as ve } from "./index-Pd9RCQxn.js";
|
|
32
|
+
import { R as _e } from "./app-DteFjR9L.js";
|
|
33
|
+
const Ke = Pe.extend({
|
|
34
34
|
_id: ye.optional(),
|
|
35
35
|
business: ye.optional(),
|
|
36
|
-
file:
|
|
36
|
+
file: Ue.any().nullish()
|
|
37
37
|
});
|
|
38
|
-
var
|
|
39
|
-
const
|
|
38
|
+
var Xe = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" };
|
|
39
|
+
const et = { class: "flex flex-col space-y-16" }, tt = {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: /* @__PURE__ */ re([
|
|
42
42
|
"p-16 pl-24 space-x-8",
|
|
@@ -44,21 +44,21 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
44
44
|
"flex items-center",
|
|
45
45
|
"justify-between"
|
|
46
46
|
])
|
|
47
|
-
},
|
|
47
|
+
}, ot = { class: "flex justify-end" }, at = {
|
|
48
48
|
key: 1,
|
|
49
49
|
class: /* @__PURE__ */ re([
|
|
50
50
|
"flex items-center",
|
|
51
51
|
"border border-fm-color-neutral-gray-300",
|
|
52
52
|
"p-16 space-x-16 rounded-md"
|
|
53
53
|
])
|
|
54
|
-
},
|
|
54
|
+
}, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
|
|
55
55
|
__name: "ImportSegment",
|
|
56
56
|
props: {
|
|
57
57
|
importFile: {}
|
|
58
58
|
},
|
|
59
59
|
emits: ["update:file"],
|
|
60
60
|
setup(e, { emit: _ }) {
|
|
61
|
-
const x = e,
|
|
61
|
+
const x = e, C = _, { t: m } = be(), y = z(null), f = z(null), b = ["Id"], s = [
|
|
62
62
|
{
|
|
63
63
|
label: "CSV",
|
|
64
64
|
icon: "csv",
|
|
@@ -73,39 +73,39 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
73
73
|
async function n() {
|
|
74
74
|
if (x.importFile)
|
|
75
75
|
try {
|
|
76
|
-
const S =
|
|
76
|
+
const S = Oe(void 0, Xe.importFilesBucketUrl), g = je(S, x.importFile), w = await qe(g);
|
|
77
77
|
window.open(w, "_blank");
|
|
78
78
|
} catch (S) {
|
|
79
|
-
console.log(S);
|
|
79
|
+
console.log(S), Ae.error("Failed to download uploaded file");
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
async function c(S) {
|
|
83
83
|
switch (S) {
|
|
84
84
|
case "csv":
|
|
85
|
-
const g = new Blob([
|
|
85
|
+
const g = new Blob([b.join(",")], {
|
|
86
86
|
type: "text/csv;charset=utf-8;"
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
Ge.saveAs(g, "ImportSegmentTemplate.csv");
|
|
89
89
|
break;
|
|
90
90
|
case "xlsx":
|
|
91
|
-
const w = ne.aoa_to_sheet([
|
|
91
|
+
const w = ne.aoa_to_sheet([b]), I = ne.book_new();
|
|
92
92
|
ne.book_append_sheet(I, w, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
|
|
93
93
|
break;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
y.value = S,
|
|
96
|
+
function h(S) {
|
|
97
|
+
y.value = S, C("update:file", y.value);
|
|
98
98
|
}
|
|
99
99
|
function A(S) {
|
|
100
100
|
var w, I;
|
|
101
101
|
const g = ((I = (w = S.target) == null ? void 0 : w.files) == null ? void 0 : I[0]) ?? null;
|
|
102
|
-
|
|
102
|
+
h(g);
|
|
103
103
|
}
|
|
104
104
|
return (S, g) => {
|
|
105
|
-
const w =
|
|
106
|
-
return p(), k("div",
|
|
107
|
-
g[2] || (g[2] =
|
|
108
|
-
S.importFile ? (p(), k("div",
|
|
105
|
+
const w = F("FmButton"), I = F("FmMenuItem"), d = F("FmMenu"), l = F("FmDropField");
|
|
106
|
+
return p(), k("div", et, [
|
|
107
|
+
g[2] || (g[2] = i("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
|
|
108
|
+
S.importFile ? (p(), k("div", tt, [
|
|
109
109
|
r(w, {
|
|
110
110
|
label: t(m)("View uploaded file"),
|
|
111
111
|
variant: t(ae).Plain,
|
|
@@ -113,9 +113,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
113
113
|
onClick: n
|
|
114
114
|
}, null, 8, ["label", "variant"])
|
|
115
115
|
])) : le("", !0),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
r(
|
|
116
|
+
i("div", null, [
|
|
117
|
+
i("div", ot, [
|
|
118
|
+
r(d, { class: "" }, {
|
|
119
119
|
"menu-button": E(() => [
|
|
120
120
|
r(w, {
|
|
121
121
|
variant: "tertiary",
|
|
@@ -124,7 +124,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
124
124
|
})
|
|
125
125
|
]),
|
|
126
126
|
default: E(() => [
|
|
127
|
-
(p(), k(O, null, ie(
|
|
127
|
+
(p(), k(O, null, ie(s, (v) => r(I, {
|
|
128
128
|
key: v.value,
|
|
129
129
|
icon: v.icon,
|
|
130
130
|
label: v.label,
|
|
@@ -135,13 +135,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
135
135
|
_: 1
|
|
136
136
|
})
|
|
137
137
|
]),
|
|
138
|
-
y.value ? (p(), k("div",
|
|
138
|
+
y.value ? (p(), k("div", at, [
|
|
139
139
|
r(w, {
|
|
140
140
|
variant: t(ae).Tertiary,
|
|
141
141
|
"prepend-icon": "attach_file"
|
|
142
142
|
}, null, 8, ["variant"]),
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
i("p", nt, R(y.value.name), 1),
|
|
144
|
+
i("label", {
|
|
145
145
|
ref_key: "fileLabelRef",
|
|
146
146
|
ref: f,
|
|
147
147
|
htmlFor: "file"
|
|
@@ -154,7 +154,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
154
154
|
return (v = f.value) == null ? void 0 : v.click();
|
|
155
155
|
})
|
|
156
156
|
}, null, 8, ["variant", "label"]),
|
|
157
|
-
|
|
157
|
+
i("input", {
|
|
158
158
|
id: "file",
|
|
159
159
|
accept: ".csv",
|
|
160
160
|
class: "hidden",
|
|
@@ -163,9 +163,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
163
163
|
onChange: A
|
|
164
164
|
}, null, 32)
|
|
165
165
|
], 512)
|
|
166
|
-
])) : (p(), J(
|
|
166
|
+
])) : (p(), J(l, {
|
|
167
167
|
key: 0,
|
|
168
|
-
onFileUpload: g[0] || (g[0] = (v) =>
|
|
168
|
+
onFileUpload: g[0] || (g[0] = (v) => h(v)),
|
|
169
169
|
accept: ".csv, .xlsx",
|
|
170
170
|
"max-file-size": 2e7
|
|
171
171
|
}))
|
|
@@ -173,7 +173,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
173
173
|
]);
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
176
|
+
}), lt = { class: "space-y-16 pr-12" }, it = { class: "fm-typo-en-title-md-800" }, rt = { class: "flex space-x-8" }, ct = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, dt = { class: "text-fm-color-typo-secondary" }, ut = /* @__PURE__ */ ee({
|
|
177
177
|
__name: "ReviewSegment",
|
|
178
178
|
props: {
|
|
179
179
|
title: {},
|
|
@@ -191,7 +191,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
header: "Customer Since",
|
|
194
|
-
accessorFn: (n) => H(
|
|
194
|
+
accessorFn: (n) => H(Je(n._id.toString())).format("DD MMM YYYY")
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
header: "Phone",
|
|
@@ -206,7 +206,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
206
206
|
accessorFn: (n) => H(n.stats.lastVisit).format("DD MMM YYYY")
|
|
207
207
|
}
|
|
208
208
|
];
|
|
209
|
-
async function
|
|
209
|
+
async function C(n) {
|
|
210
210
|
return _.segment._id ? (console.log(n), await B.paginateSegmentUsers(
|
|
211
211
|
_.segment._id,
|
|
212
212
|
n
|
|
@@ -221,19 +221,19 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData:
|
|
224
|
+
const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: b, onSearch: s } = we(C);
|
|
225
225
|
return Se(async () => {
|
|
226
|
-
await
|
|
227
|
-
}), (n, c) => (p(), k("div",
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
c[1] || (c[1] =
|
|
233
|
-
|
|
226
|
+
await b();
|
|
227
|
+
}), (n, c) => (p(), k("div", lt, [
|
|
228
|
+
i("div", it, R(_.title), 1),
|
|
229
|
+
i("div", rt, [
|
|
230
|
+
i("div", ct, R(n.segment.members.length), 1),
|
|
231
|
+
i("div", dt, [
|
|
232
|
+
c[1] || (c[1] = i("div", null, "contacts in your segment", -1)),
|
|
233
|
+
i("div", null, "as of " + R(t(H)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
|
|
234
234
|
])
|
|
235
235
|
]),
|
|
236
|
-
r(
|
|
236
|
+
r(Fe, {
|
|
237
237
|
loading: t(m).isLoading,
|
|
238
238
|
"row-data": t(y),
|
|
239
239
|
"row-count": t(m).totalRows,
|
|
@@ -242,11 +242,11 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
242
242
|
"page-count": t(m).pageCount,
|
|
243
243
|
"page-index": t(m).pageIndex,
|
|
244
244
|
onSortChange: t(f),
|
|
245
|
-
onPageChange: c[0] || (c[0] = (
|
|
245
|
+
onPageChange: c[0] || (c[0] = (h) => t(b)({ pageSize: h.pageSize, pageIndex: h.pageIndex }))
|
|
246
246
|
}, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
|
|
247
247
|
]));
|
|
248
248
|
}
|
|
249
|
-
}),
|
|
249
|
+
}), pt = { class: "space-y-24" }, mt = { class: "grid grid-cols-2 gap-16" }, ft = { class: "fm-typo-en-title-sm-800" }, yt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, gt = /* @__PURE__ */ ee({
|
|
250
250
|
__name: "SegmentTypeOption",
|
|
251
251
|
props: {
|
|
252
252
|
modelValue: {},
|
|
@@ -254,38 +254,38 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
254
254
|
},
|
|
255
255
|
emits: ["update:model-value"],
|
|
256
256
|
setup(e, { emit: _ }) {
|
|
257
|
-
const x = e,
|
|
257
|
+
const x = e, C = _, m = [
|
|
258
258
|
{
|
|
259
259
|
label: "Dynamic",
|
|
260
260
|
sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
|
|
261
|
-
value:
|
|
261
|
+
value: $.enum.DYNAMIC
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
label: "Static",
|
|
265
265
|
sublabel: "Segment statistics are based on imported data and will not be recalculated.",
|
|
266
|
-
value:
|
|
266
|
+
value: $.enum.STATIC
|
|
267
267
|
}
|
|
268
268
|
];
|
|
269
269
|
function y(f) {
|
|
270
|
-
f !== x.modelValue &&
|
|
270
|
+
f !== x.modelValue && C("update:model-value", f);
|
|
271
271
|
}
|
|
272
|
-
return (f,
|
|
273
|
-
const
|
|
274
|
-
return p(), k("div",
|
|
275
|
-
|
|
276
|
-
(p(), k(O, null, ie(m, (c) => r(
|
|
272
|
+
return (f, b) => {
|
|
273
|
+
const s = F("FmCard"), n = F("FmHelperText");
|
|
274
|
+
return p(), k("div", pt, [
|
|
275
|
+
i("div", mt, [
|
|
276
|
+
(p(), k(O, null, ie(m, (c) => r(s, {
|
|
277
277
|
variant: "outlined",
|
|
278
278
|
class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
279
279
|
"col-span-2": m.length == 1,
|
|
280
280
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
|
|
281
281
|
"hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
|
|
282
282
|
}]),
|
|
283
|
-
onClick: (
|
|
283
|
+
onClick: (h) => y(c.value),
|
|
284
284
|
key: c.value
|
|
285
285
|
}, {
|
|
286
286
|
default: E(() => [
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
i("div", ft, R(c.label), 1),
|
|
288
|
+
i("div", yt, R(c.sublabel), 1)
|
|
289
289
|
]),
|
|
290
290
|
_: 2
|
|
291
291
|
}, 1032, ["class", "onClick"])), 64))
|
|
@@ -299,93 +299,93 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
299
299
|
]);
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
}),
|
|
302
|
+
}), vt = { class: "flex items-center gap-x-8" }, _t = {
|
|
303
303
|
key: 0,
|
|
304
304
|
class: "space-y-16 pr-12"
|
|
305
|
-
},
|
|
305
|
+
}, xt = { class: "flex flex-col space-y-16" }, St = {
|
|
306
306
|
key: 0,
|
|
307
307
|
class: "flex flex-col space-y-16"
|
|
308
|
-
},
|
|
308
|
+
}, wt = {
|
|
309
309
|
key: 1,
|
|
310
310
|
class: "flex flex-col space-y-16"
|
|
311
|
-
},
|
|
311
|
+
}, Ft = {
|
|
312
312
|
key: 2,
|
|
313
313
|
class: "flex flex-col space-y-16"
|
|
314
|
-
}, bt = { class: "flex items-center gap-8" },
|
|
314
|
+
}, bt = { class: "flex items-center gap-8" }, ht = /* @__PURE__ */ ee({
|
|
315
315
|
__name: "SegmentSheet",
|
|
316
316
|
emits: ["update:model-value"],
|
|
317
317
|
setup(e, { expose: _, emit: x }) {
|
|
318
|
-
const
|
|
318
|
+
const C = Ye(), m = z(!1), y = z(!1), f = {
|
|
319
319
|
name: "",
|
|
320
320
|
isActive: !0,
|
|
321
|
-
type:
|
|
321
|
+
type: $.enum.DYNAMIC,
|
|
322
322
|
rule: ge.scaffoldGroup(),
|
|
323
323
|
members: []
|
|
324
|
-
},
|
|
325
|
-
const
|
|
326
|
-
return
|
|
324
|
+
}, b = Ke, s = z(f), n = ce(() => {
|
|
325
|
+
const d = b.safeParse(s.value);
|
|
326
|
+
return d.success ? [] : d.error.errors;
|
|
327
327
|
});
|
|
328
|
-
function c(
|
|
329
|
-
m.value = !0, y.value = !1,
|
|
330
|
-
...
|
|
331
|
-
isActive:
|
|
332
|
-
type:
|
|
333
|
-
} :
|
|
328
|
+
function c(d) {
|
|
329
|
+
m.value = !0, y.value = !1, d ? s.value = {
|
|
330
|
+
...d,
|
|
331
|
+
isActive: d.isActive !== !1,
|
|
332
|
+
type: d.type ?? (d.importFile ? $.enum.STATIC : $.enum.DYNAMIC)
|
|
333
|
+
} : s.value = { ...f };
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function h() {
|
|
336
336
|
m.value = !1;
|
|
337
337
|
}
|
|
338
338
|
async function A() {
|
|
339
|
-
|
|
339
|
+
b.safeParse(s.value).success && (y.value = !0);
|
|
340
340
|
}
|
|
341
|
-
function S() {
|
|
342
|
-
y.value = !1;
|
|
341
|
+
function S(d) {
|
|
342
|
+
d === $.enum.STATIC ? h() : y.value = !1;
|
|
343
343
|
}
|
|
344
344
|
async function g() {
|
|
345
|
-
|
|
345
|
+
s.value.type === $.enum.STATIC ? (s.value.rule = ge.scaffoldGroup(), s.value.isActive = !0) : s.value.file = void 0, I("update:model-value", s.value);
|
|
346
346
|
}
|
|
347
|
-
async function w(
|
|
348
|
-
|
|
347
|
+
async function w(d) {
|
|
348
|
+
s.value.type = d;
|
|
349
349
|
}
|
|
350
350
|
Se(async () => {
|
|
351
351
|
});
|
|
352
352
|
const I = x;
|
|
353
353
|
return _({
|
|
354
354
|
showSheet: c,
|
|
355
|
-
hideSheet:
|
|
356
|
-
}), (
|
|
357
|
-
const v =
|
|
355
|
+
hideSheet: h
|
|
356
|
+
}), (d, l) => {
|
|
357
|
+
const v = F("FmButton"), U = F("FmSwitch"), a = F("FmSideSheet");
|
|
358
358
|
return p(), J(a, {
|
|
359
359
|
modelValue: t(m),
|
|
360
|
-
"onUpdate:modelValue":
|
|
360
|
+
"onUpdate:modelValue": l[8] || (l[8] = (o) => Ie(m) ? m.value = o : null),
|
|
361
361
|
header: "Add segment",
|
|
362
362
|
"dismiss-away": "",
|
|
363
363
|
"close-button": !0,
|
|
364
364
|
"max-width": 1100
|
|
365
365
|
}, Me({
|
|
366
366
|
"side-sheet-footer": E(() => [
|
|
367
|
-
|
|
368
|
-
t(y) || t(
|
|
367
|
+
i("div", bt, [
|
|
368
|
+
t(y) || t(s).type === t($).enum.STATIC ? (p(), k(O, { key: 0 }, [
|
|
369
369
|
r(v, {
|
|
370
370
|
label: "Save Segment",
|
|
371
371
|
onClick: g,
|
|
372
|
-
loading: t(
|
|
373
|
-
disabled: t(n).length > 0 || t(
|
|
372
|
+
loading: t(C).isLoading,
|
|
373
|
+
disabled: t(n).length > 0 || t(C).isLoading
|
|
374
374
|
}, null, 8, ["loading", "disabled"]),
|
|
375
375
|
r(v, {
|
|
376
376
|
label: "Cancel",
|
|
377
|
-
onClick:
|
|
377
|
+
onClick: l[6] || (l[6] = (o) => S(t(s).type)),
|
|
378
378
|
variant: "tertiary"
|
|
379
379
|
})
|
|
380
380
|
], 64)) : (p(), k(O, { key: 1 }, [
|
|
381
381
|
r(v, {
|
|
382
382
|
label: "Review Segment",
|
|
383
|
-
disabled: t(n).length > 0 || t(
|
|
383
|
+
disabled: t(n).length > 0 || t(C).isLoading,
|
|
384
384
|
onClick: A
|
|
385
385
|
}, null, 8, ["disabled"]),
|
|
386
386
|
r(v, {
|
|
387
387
|
label: "Cancel",
|
|
388
|
-
onClick:
|
|
388
|
+
onClick: l[7] || (l[7] = (o) => h()),
|
|
389
389
|
variant: "tertiary"
|
|
390
390
|
})
|
|
391
391
|
], 64))
|
|
@@ -394,49 +394,49 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
394
394
|
default: E(() => {
|
|
395
395
|
var o;
|
|
396
396
|
return [
|
|
397
|
-
t(y) ? (p(), J(
|
|
397
|
+
t(y) ? (p(), J(ut, {
|
|
398
398
|
key: 1,
|
|
399
|
-
title: t(
|
|
400
|
-
segment: t(
|
|
401
|
-
}, null, 8, ["title", "segment"])) : (p(), k("div",
|
|
402
|
-
r(
|
|
403
|
-
modelValue: t(
|
|
404
|
-
"onUpdate:modelValue":
|
|
399
|
+
title: t(s).name,
|
|
400
|
+
segment: t(s)
|
|
401
|
+
}, null, 8, ["title", "segment"])) : (p(), k("div", _t, [
|
|
402
|
+
r(Le, {
|
|
403
|
+
modelValue: t(s).name,
|
|
404
|
+
"onUpdate:modelValue": l[1] || (l[1] = (u) => t(s).name = u),
|
|
405
405
|
label: "Segment title",
|
|
406
|
-
schema: t(
|
|
406
|
+
schema: t(Ve).typeAtPath(t(b), "name")
|
|
407
407
|
}, null, 8, ["modelValue", "schema"]),
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
r(
|
|
411
|
-
"model-value": t(
|
|
412
|
-
"onUpdate:modelValue":
|
|
413
|
-
w(
|
|
408
|
+
i("div", xt, [
|
|
409
|
+
l[10] || (l[10] = i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
|
|
410
|
+
r(gt, {
|
|
411
|
+
"model-value": t(s).type,
|
|
412
|
+
"onUpdate:modelValue": l[2] || (l[2] = (u) => {
|
|
413
|
+
w(u);
|
|
414
414
|
})
|
|
415
415
|
}, null, 8, ["model-value"])
|
|
416
416
|
]),
|
|
417
|
-
t(
|
|
418
|
-
|
|
419
|
-
r(
|
|
417
|
+
t(s).type === t($).enum.DYNAMIC ? (p(), k("div", St, [
|
|
418
|
+
l[11] || (l[11] = i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
|
|
419
|
+
r(ze, {
|
|
420
420
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
421
421
|
includeOnly: "user",
|
|
422
|
-
"model-value": (o = t(
|
|
423
|
-
"onUpdate:modelValue":
|
|
424
|
-
t(
|
|
422
|
+
"model-value": (o = t(s)) == null ? void 0 : o.rule,
|
|
423
|
+
"onUpdate:modelValue": l[3] || (l[3] = (u) => {
|
|
424
|
+
t(s).rule = u;
|
|
425
425
|
})
|
|
426
426
|
}, null, 8, ["model-value"])
|
|
427
|
-
])) : (p(), k("div",
|
|
428
|
-
r(
|
|
429
|
-
importFile: t(
|
|
430
|
-
"onUpdate:file":
|
|
431
|
-
t(
|
|
427
|
+
])) : (p(), k("div", wt, [
|
|
428
|
+
r(st, {
|
|
429
|
+
importFile: t(s).importFile,
|
|
430
|
+
"onUpdate:file": l[4] || (l[4] = (u) => {
|
|
431
|
+
t(s).file = u;
|
|
432
432
|
})
|
|
433
433
|
}, null, 8, ["importFile"])
|
|
434
434
|
])),
|
|
435
|
-
t(
|
|
436
|
-
|
|
435
|
+
t(s).type === t($).enum.DYNAMIC ? (p(), k("div", Ft, [
|
|
436
|
+
l[12] || (l[12] = i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
|
|
437
437
|
r(U, {
|
|
438
|
-
"model-value": t(
|
|
439
|
-
"onUpdate:modelValue":
|
|
438
|
+
"model-value": t(s).isActive ?? !0,
|
|
439
|
+
"onUpdate:modelValue": l[5] || (l[5] = (u) => t(s).isActive = u),
|
|
440
440
|
label: "Active",
|
|
441
441
|
sublabel: "When enabled, this will recalculate the segment statistics daily.",
|
|
442
442
|
"label-placement": "right"
|
|
@@ -450,13 +450,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
450
450
|
t(y) ? {
|
|
451
451
|
name: "side-sheet-header",
|
|
452
452
|
fn: E(() => [
|
|
453
|
-
|
|
453
|
+
i("div", vt, [
|
|
454
454
|
r(v, {
|
|
455
455
|
icon: "arrow_back",
|
|
456
456
|
variant: "tertiary",
|
|
457
|
-
onClick:
|
|
457
|
+
onClick: l[0] || (l[0] = (o) => y.value = !1)
|
|
458
458
|
}),
|
|
459
|
-
|
|
459
|
+
l[9] || (l[9] = i("div", null, "Review segment", -1))
|
|
460
460
|
])
|
|
461
461
|
]),
|
|
462
462
|
key: "0"
|
|
@@ -464,20 +464,20 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
|
|
|
464
464
|
]), 1032, ["modelValue"]);
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
|
-
}), xe =
|
|
467
|
+
}), xe = He(), Ct = Ce();
|
|
468
468
|
function se(e) {
|
|
469
469
|
const _ = H(e);
|
|
470
470
|
return _.isValid() ? _.format("DD/MM/YYYY") : "";
|
|
471
471
|
}
|
|
472
|
-
const
|
|
472
|
+
const kt = {
|
|
473
473
|
mapMemberExportRow: (e) => {
|
|
474
|
-
var n, c,
|
|
475
|
-
const _ = ce(() =>
|
|
474
|
+
var n, c, h, A, S, g, w, I, d, l, v, U, a, o, u, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
|
|
475
|
+
const _ = ce(() => Ct.locations.map((T) => ({
|
|
476
476
|
label: T.name,
|
|
477
477
|
value: T._id
|
|
478
|
-
}))), x = (n =
|
|
478
|
+
}))), x = (n = Be.parseOneAddress(
|
|
479
479
|
e == null ? void 0 : e.email
|
|
480
|
-
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email,
|
|
480
|
+
)) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, C = (h = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : h.reduce(
|
|
481
481
|
(T, L) => {
|
|
482
482
|
var Z, K;
|
|
483
483
|
const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
|
|
@@ -495,10 +495,10 @@ const Ct = {
|
|
|
495
495
|
return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
|
|
496
496
|
},
|
|
497
497
|
{}
|
|
498
|
-
), y = ((g = (S = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : S.at(0)) == null ? void 0 : g.balance) || 0, f = ((
|
|
498
|
+
), y = ((g = (S = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : S.at(0)) == null ? void 0 : g.balance) || 0, f = ((l = (d = (I = (w = e.collection) == null ? void 0 : w.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : l.reduce(
|
|
499
499
|
(T, L) => T + L.amount,
|
|
500
500
|
0
|
|
501
|
-
)) || 0,
|
|
501
|
+
)) || 0, b = Qe(y, 2);
|
|
502
502
|
return {
|
|
503
503
|
ID: e._id.toString(),
|
|
504
504
|
Name: ((v = e.name) == null ? void 0 : v.trim()) || "",
|
|
@@ -507,17 +507,17 @@ const Ct = {
|
|
|
507
507
|
Gender: e.gender || "",
|
|
508
508
|
CardNo: e.cardNo || "",
|
|
509
509
|
Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
|
|
510
|
-
Credit: parseFloat((Number(
|
|
510
|
+
Credit: parseFloat((Number(b) - Number(f)).toFixed(2)),
|
|
511
511
|
FreeCredit: Number(f.toFixed(2)),
|
|
512
|
-
TotalCredit: Number(
|
|
513
|
-
Exp: e != null && e.collection ? ((
|
|
512
|
+
TotalCredit: Number(b),
|
|
513
|
+
Exp: e != null && e.collection ? ((u = (o = (a = e.collection) == null ? void 0 : a.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : u.balance) ?? 0 : 0,
|
|
514
514
|
Point: e != null && e.collection ? ((N = (D = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : D.at(0)) == null ? void 0 : N.balance) ?? 0 : 0,
|
|
515
515
|
Level: e != null && e.collection ? ((q = (j = (V = e.collection) == null ? void 0 : V.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : q.balance) ?? 0 : 0,
|
|
516
516
|
Tier: e != null && e.collection ? ((M = (te = (G = e.collection) == null ? void 0 : G.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
|
|
517
|
-
Titles:
|
|
517
|
+
Titles: C.join(","),
|
|
518
518
|
...m,
|
|
519
519
|
TotalTransaction: e.stats.visitCount,
|
|
520
|
-
AvgSpent:
|
|
520
|
+
AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
521
521
|
!1
|
|
522
522
|
),
|
|
523
523
|
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
@@ -532,10 +532,10 @@ const Ct = {
|
|
|
532
532
|
)}`
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
},
|
|
535
|
+
}, It = { class: "flex items-center" }, Mt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Tt = { class: "px-24 flex flex-col gap-y-16" }, Et = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, At = { class: "fm-typo-en-body-md-600" }, Dt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, po = /* @__PURE__ */ ee({
|
|
536
536
|
__name: "Segment",
|
|
537
537
|
setup(e) {
|
|
538
|
-
const { minor: _ } =
|
|
538
|
+
const { minor: _ } = $e, { t: x } = be(), C = Ce(), { mapMemberExportRow: m } = kt, y = Re(), f = Ze(), b = z(0), s = [
|
|
539
539
|
{
|
|
540
540
|
header: x("connect.loyalty.segment.table.name"),
|
|
541
541
|
accessorFn: (a) => a.name
|
|
@@ -558,7 +558,7 @@ const Ct = {
|
|
|
558
558
|
},
|
|
559
559
|
{
|
|
560
560
|
header: x("connect.loyalty.segment.table.customer_percentage"),
|
|
561
|
-
accessorFn: (a) => ((a.memberCount ?? 0) * 100 /
|
|
561
|
+
accessorFn: (a) => ((a.memberCount ?? 0) * 100 / b.value).toFixed(2)
|
|
562
562
|
},
|
|
563
563
|
{
|
|
564
564
|
header: x("connect.loyalty.segment.table.actions"),
|
|
@@ -622,7 +622,7 @@ const Ct = {
|
|
|
622
622
|
]);
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
-
], n = z(null), { tableMeta: c, rowData:
|
|
625
|
+
], n = z(null), { tableMeta: c, rowData: h, debouncedFetchData: A } = we(
|
|
626
626
|
B.readAll
|
|
627
627
|
);
|
|
628
628
|
async function S() {
|
|
@@ -634,7 +634,7 @@ const Ct = {
|
|
|
634
634
|
);
|
|
635
635
|
}
|
|
636
636
|
async function g(a) {
|
|
637
|
-
await
|
|
637
|
+
await De.remove(`Are you sure you want to remove ${a.name}?`) && await _(
|
|
638
638
|
async () => {
|
|
639
639
|
await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
|
|
640
640
|
},
|
|
@@ -651,7 +651,7 @@ const Ct = {
|
|
|
651
651
|
rowsPerPage: 1e3,
|
|
652
652
|
page: 1,
|
|
653
653
|
rowsNumber: 0
|
|
654
|
-
},
|
|
654
|
+
}, u = new Ne(), P = (await ve.read({
|
|
655
655
|
limit: 1,
|
|
656
656
|
skip: 0,
|
|
657
657
|
sortBy: o.sortBy,
|
|
@@ -672,12 +672,12 @@ const Ct = {
|
|
|
672
672
|
);
|
|
673
673
|
for (const q of j.resources) {
|
|
674
674
|
const G = m(q);
|
|
675
|
-
|
|
675
|
+
u.addRecord(G);
|
|
676
676
|
}
|
|
677
677
|
o.page++;
|
|
678
678
|
}
|
|
679
679
|
await he(
|
|
680
|
-
|
|
680
|
+
u.buildExcel(),
|
|
681
681
|
`[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
682
682
|
{
|
|
683
683
|
bookType: "xlsx",
|
|
@@ -696,14 +696,14 @@ const Ct = {
|
|
|
696
696
|
await _(
|
|
697
697
|
async () => {
|
|
698
698
|
var o;
|
|
699
|
-
if (a.type ===
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
699
|
+
if (a.type === $.enum.STATIC) {
|
|
700
|
+
const u = new FormData();
|
|
701
|
+
if (u.append("file", a.file), a._id) {
|
|
702
702
|
const { members: P, _id: D, file: N, ...V } = a;
|
|
703
|
-
|
|
703
|
+
u.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, u);
|
|
704
704
|
} else {
|
|
705
705
|
const { file: P, ...D } = a;
|
|
706
|
-
|
|
706
|
+
u.append("segment", JSON.stringify(D)), await B.createStatic(u);
|
|
707
707
|
}
|
|
708
708
|
a.file && y.open({
|
|
709
709
|
type: "info",
|
|
@@ -717,7 +717,7 @@ const Ct = {
|
|
|
717
717
|
}
|
|
718
718
|
});
|
|
719
719
|
} else if (a._id) {
|
|
720
|
-
const { members:
|
|
720
|
+
const { members: u, _id: P, ...D } = a;
|
|
721
721
|
await B.update(a._id, D);
|
|
722
722
|
} else
|
|
723
723
|
await B.create(a);
|
|
@@ -729,17 +729,17 @@ const Ct = {
|
|
|
729
729
|
}
|
|
730
730
|
);
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function d(a) {
|
|
733
733
|
var o;
|
|
734
734
|
(o = n.value) == null || o.showSheet(a);
|
|
735
735
|
}
|
|
736
|
-
const
|
|
736
|
+
const l = {
|
|
737
737
|
label: x("connect.navigation.queue"),
|
|
738
738
|
value: "queue",
|
|
739
739
|
isPrimary: !1,
|
|
740
740
|
prependIcon: "work_history"
|
|
741
|
-
}, v = ce(() =>
|
|
742
|
-
|
|
741
|
+
}, v = ce(() => C.isPremium ? [
|
|
742
|
+
l,
|
|
743
743
|
{
|
|
744
744
|
label: "Refresh segments",
|
|
745
745
|
value: "refresh",
|
|
@@ -755,7 +755,7 @@ const Ct = {
|
|
|
755
755
|
function U(a) {
|
|
756
756
|
switch (a) {
|
|
757
757
|
case "add":
|
|
758
|
-
|
|
758
|
+
d();
|
|
759
759
|
break;
|
|
760
760
|
case "refresh":
|
|
761
761
|
S();
|
|
@@ -776,9 +776,9 @@ const Ct = {
|
|
|
776
776
|
search: void 0,
|
|
777
777
|
descending: !1
|
|
778
778
|
});
|
|
779
|
-
|
|
779
|
+
b.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await C.readPremium(), await C.readLocations();
|
|
780
780
|
}), (a, o) => {
|
|
781
|
-
const
|
|
781
|
+
const u = F("FmPill"), P = F("FmPageHead"), D = F("FmIcon"), N = F("FmMenuItem"), V = F("FmMenu"), j = F("FmListItem"), q = F("FmList"), G = F("FmButton"), te = F("FmCard");
|
|
782
782
|
return p(), k(O, null, [
|
|
783
783
|
r(P, {
|
|
784
784
|
title: "Segments",
|
|
@@ -786,41 +786,41 @@ const Ct = {
|
|
|
786
786
|
"onClick:action": o[0] || (o[0] = (M) => U(M))
|
|
787
787
|
}, {
|
|
788
788
|
title: E(() => [
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
r(
|
|
789
|
+
i("div", It, [
|
|
790
|
+
i("span", Mt, R(t(x)("connect.loyalty.segment.title")), 1),
|
|
791
|
+
r(u, { variant: "premium" })
|
|
792
792
|
])
|
|
793
793
|
]),
|
|
794
794
|
_: 1
|
|
795
795
|
}, 8, ["actions"]),
|
|
796
|
-
|
|
797
|
-
t(
|
|
798
|
-
r(
|
|
796
|
+
i("div", Tt, [
|
|
797
|
+
t(h).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
|
|
798
|
+
r(Fe, {
|
|
799
799
|
loading: t(c).isLoading,
|
|
800
|
-
"row-data": t(
|
|
800
|
+
"row-data": t(h),
|
|
801
801
|
"row-count": t(c).totalRows,
|
|
802
|
-
"column-defs":
|
|
802
|
+
"column-defs": s,
|
|
803
803
|
"shrink-at": !1,
|
|
804
804
|
"page-count": t(c).pageCount,
|
|
805
805
|
"page-index": t(c).pageIndex,
|
|
806
806
|
"page-size": t(c).pageSize,
|
|
807
807
|
onRowClick: o[1] || (o[1] = (M) => {
|
|
808
|
-
|
|
808
|
+
d(M.original);
|
|
809
809
|
}),
|
|
810
810
|
onPageChange: t(A)
|
|
811
811
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
|
|
812
812
|
r(q, { class: "w-full hidden xs:block" }, {
|
|
813
813
|
default: E(() => [
|
|
814
|
-
(p(!0), k(O, null, ie(t(
|
|
814
|
+
(p(!0), k(O, null, ie(t(h), (M) => (p(), J(j, {
|
|
815
815
|
key: M._id.toString(),
|
|
816
816
|
tag: "label",
|
|
817
|
-
onClick: (Q) =>
|
|
817
|
+
onClick: (Q) => d(M)
|
|
818
818
|
}, {
|
|
819
819
|
default: E(() => [
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
820
|
+
i("div", null, [
|
|
821
|
+
i("div", Et, R((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
|
|
822
|
+
i("div", At, R(M.name), 1),
|
|
823
|
+
i("div", Dt, R(((M.memberCount ?? 0) * 100 / t(b)).toFixed(2)) + "% of customers ", 1)
|
|
824
824
|
])
|
|
825
825
|
]),
|
|
826
826
|
append: E(() => [
|
|
@@ -849,25 +849,25 @@ const Ct = {
|
|
|
849
849
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
850
850
|
}, {
|
|
851
851
|
default: E(() => [
|
|
852
|
-
o[3] || (o[3] =
|
|
852
|
+
o[3] || (o[3] = i("img", {
|
|
853
853
|
src: Ee,
|
|
854
854
|
class: "aspect-square w-[150px]"
|
|
855
855
|
}, null, -1)),
|
|
856
|
-
o[4] || (o[4] =
|
|
857
|
-
|
|
858
|
-
|
|
856
|
+
o[4] || (o[4] = i("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
857
|
+
i("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
|
|
858
|
+
i("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
|
|
859
859
|
], -1)),
|
|
860
860
|
r(G, {
|
|
861
861
|
variant: "primary",
|
|
862
862
|
label: "Create segment",
|
|
863
|
-
disabled: !t(
|
|
863
|
+
disabled: !t(C).isPremium,
|
|
864
864
|
icon: "add",
|
|
865
|
-
onClick: o[2] || (o[2] = (M) =>
|
|
865
|
+
onClick: o[2] || (o[2] = (M) => d())
|
|
866
866
|
}, null, 8, ["disabled"])
|
|
867
867
|
]),
|
|
868
868
|
_: 1
|
|
869
869
|
})),
|
|
870
|
-
r(
|
|
870
|
+
r(ht, {
|
|
871
871
|
ref_key: "sheetRef",
|
|
872
872
|
ref: n,
|
|
873
873
|
"onUpdate:modelValue": I
|
|
@@ -878,5 +878,5 @@ const Ct = {
|
|
|
878
878
|
}
|
|
879
879
|
});
|
|
880
880
|
export {
|
|
881
|
-
|
|
881
|
+
po as default
|
|
882
882
|
};
|