@feedmepos/mf-connect 0.1.38-beta.1 → 0.1.38-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-Dc1l0CZK.js +427 -0
- package/dist/{App-BWZ2EE71.js → App-BLg0CWv-.js} +352 -364
- package/dist/{Bin-C-Ha-4yF.js → Bin-DDbKIePj.js} +8 -8
- package/dist/{Broadcast-Bo3QS8lS.js → Broadcast-CihKie6G.js} +40 -40
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-4vUMzH-l.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DbdBGvgR.js} +18 -18
- package/dist/{Card-Bs1TDE0e.js → Card-h1dYFE_s.js} +159 -159
- package/dist/{Collections-Dy5RN7Js.js → Collections-DUXdnJqQ.js} +91 -103
- package/dist/{Credit-Bqc4dw1s.js → Credit-CsGEuX9p.js} +74 -74
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-D6AmN3o3.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-0gMUNtdO.js} +488 -488
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BzwADnKp.js → EffectSheet.vue_vue_type_style_index_0_lang-CQDnl97F.js} +94 -94
- package/dist/{Experience-C2e2T7B-.js → Experience-CBbqYrql.js} +41 -41
- package/dist/{Game-C86eEhcx.js → Game-CicPpdT5.js} +31 -31
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{Index-BRGweFco.js → Index-Xgvlt4vk.js} +10 -10
- package/dist/Marketing-CqOAQgg4.js +319 -0
- package/dist/{Member-B3o0Zhcw.js → Member-D1k4ZQ95.js} +76 -76
- package/dist/MemberList-BdV9sxO_.js +1606 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-C4hao-d9.js → MemberTransactions-Q0_4nT4e.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D9zfmqLs.js → MessageInput.vue_vue_type_script_setup_true_lang-COGCJGRc.js} +36 -36
- package/dist/{Mission-BURXfzjd.js → Mission-D-TW52zn.js} +21 -21
- package/dist/{Overview-D_hrrM4O.js → Overview-BleJmxHa.js} +335 -335
- package/dist/{Point-CJXkJY5Q.js → Point-B7BYX9us.js} +41 -41
- package/dist/{Promotion-CunJrh42.js → Promotion-BphlQC55.js} +42 -42
- package/dist/{Queue-v5Itg9J4.js → Queue-DJfZqO1f.js} +51 -51
- package/dist/{Record-DJe4tg9R.js → Record-Bv1P0s2g.js} +9 -9
- package/dist/{Reward-Y9aHpny5.js → Reward-CRyEjr47.js} +173 -173
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-1KAjCblO.js → RewardGroup.vue_vue_type_script_setup_true_lang-Ckqox5Ut.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cr99ikbK.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dp4ku9ep.js} +431 -431
- package/dist/Segment-Br0Y5hzV.js +882 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BhJ-oVMb.js → SelectItems.vue_vue_type_script_setup_true_lang-BuB-qwcM.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-b5bjfBvc.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DanHGQXC.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DoKAgSLE.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCKUXnGl.js} +3 -3
- package/dist/{Setting-BU5778gG.js → Setting-BPFArJMv.js} +432 -432
- package/dist/{Store-IWg0POAU.js → Store-e_odFoS5.js} +210 -210
- package/dist/StoreRewards-wXhyzIFI.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CVPQt-bn.js +995 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BcOvr526.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CWJmeeo-.js} +1 -1
- package/dist/{Tier-iN30KD7g.js → Tier-GfdGRbTX.js} +106 -106
- package/dist/{Title-Duh_Srek.js → Title-C2ZyFxNf.js} +131 -133
- package/dist/{Transaction-DLBA7Svl.js → Transaction-Dv8yYXJS.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DLD5d43d.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CK_4iMCA.js} +6 -6
- package/dist/{Voucher-cTvlMN0Y.js → Voucher-CBujqgnF.js} +37 -37
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CgooH4yn.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-C5S-bi5J.js → ZodTextField.vue_vue_type_script_setup_true_lang-B8pgaARn.js} +1 -1
- package/dist/{app-De-yQ1CJ.js → app-B2Cgyy70.js} +124 -161
- package/dist/{app-A3oEKLq5.js → app-B8E3wp8L.js} +1 -1
- package/dist/app.js +3 -4
- package/dist/{business-B2JBpm4y.js → business-BRidHvRK.js} +1 -1
- package/dist/{campaign-vkzui6F2.js → campaign-B0vnIan2.js} +3 -5
- package/dist/{campaign-Bhur0NJx.js → campaign-B7v0a8YV.js} +9 -9
- package/dist/{campaign.enum-DCYkKGhd.js → campaign.enum-NH5faqyS.js} +1 -1
- package/dist/{campaign.fn--affTEi5.js → campaign.fn-BPHARk3Y.js} +161 -161
- package/dist/{collectible.enum-CLBCnfev.js → collectible.enum-Cun9w38h.js} +1 -1
- package/dist/{collection.fn-bA8q0KYy.js → collection.fn-RR5q6jqi.js} +2 -2
- package/dist/{dto-RCcWeYE0.js → dto-DK1VnGlq.js} +4 -4
- package/dist/{effect-D7qRfPe_.js → effect-CI4ZR8HW.js} +1 -1
- package/dist/{email-addresses-a8PqViID.js → email-addresses-bguwgnrW.js} +1 -1
- package/dist/{export-BneqNRn4.js → export-CcepocZB.js} +3 -3
- package/dist/{helper-DfvvxOyO.js → helper-BM1JTEFS.js} +1 -1
- package/dist/{index-CbsJ6vMJ.js → index-B0Slqiqo.js} +1 -1
- package/dist/{index-y-7yUm2e.js → index-B6_uPXyL.js} +9 -9
- package/dist/{index-CTKMdxSm.js → index-BS3AjuVw.js} +1 -1
- package/dist/{index-2LpkG8Ye.js → index-BfGdztHf.js} +1 -1
- package/dist/{index-D0GnMoag.js → index-CBuCx_0r.js} +79 -168
- package/dist/{index-4kMeSNTr.js → index-CLkqja9X.js} +385 -376
- package/dist/{index-DMrIQqFt.js → index-Cm_6xScD.js} +1 -1
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-DHEJX75j.js +44 -0
- package/dist/{index-CMBPIb8x.js → index-D_gLVFsk.js} +941 -932
- package/dist/{index-BWTvsoH0.js → index-DbjZHuoG.js} +1 -1
- package/dist/{index-CrFUhsZO.js → index-De1JnaPh.js} +1 -1
- package/dist/{index-DeXvASjP.js → index-Di6bqaLm.js} +3 -3
- package/dist/{index-CtDqXnOp.js → index-DjycZwfg.js} +448 -515
- package/dist/{index-B0T9GDIZ.js → index-vs1HgFHz.js} +1 -1
- package/dist/{index.esm2017-JtyypweZ.js → index.esm2017-DANlqJ4g.js} +127 -127
- package/dist/{loading-a-FqrwqI.js → loading-BXu9ofEu.js} +1 -1
- package/dist/{membership-CGVtil5J.js → membership-BBb7gdZg.js} +3 -3
- package/dist/{money-CTc1l_Cq.js → money-C02BW-pt.js} +1 -1
- package/dist/{number-W3R-0nYP.js → number-D7tIDv2q.js} +1 -1
- package/dist/objectid-oVX5A5oa.js +145 -0
- package/dist/{plugins-D2sSgTSl.js → plugins-B5tuGbFw.js} +2 -2
- package/dist/{reward-atP8vnNn.js → reward-CE-bnnnQ.js} +1 -1
- package/dist/{rule-eA5IvnjB.js → rule-BN5R8pYj.js} +3 -3
- package/dist/{rule-builder-BB29ZJ_C.js → rule-builder-16JDtaoI.js} +17 -17
- package/dist/style.css +1 -1
- package/dist/{template-DhBeDaAm.js → template-C-zyZgxl.js} +64 -64
- package/dist/{trigger-Bq_pZj1J.js → trigger-DCLjl3mM.js} +4 -4
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{user-B-bhVFIG.js → user-C7bmFOaT.js} +1 -1
- package/dist/{vue-i18n-D-h8VDSx.js → vue-i18n-Cts9OsqE.js} +277 -277
- package/dist/{xlsx-DsByAcZl.js → xlsx-CJ5ufXk3.js} +226 -226
- package/package.json +3 -5
- package/dist/Analytic-O-qZWrFp.js +0 -761
- package/dist/AuditLogs-DlmcFEta.js +0 -1887
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +0 -58
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/Marketing-CnnrnXbS.js +0 -20073
- package/dist/MemberList-BpE1IjED.js +0 -1606
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/Segment-DVT8uDn8.js +0 -882
- package/dist/StoreRewards-CIjHcVoh.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cx05-OPF.js +0 -1029
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DkjojUvD.js +0 -419
- package/dist/index-CVAWGMus.js +0 -56
- package/dist/index-CsaQJMAR.js +0 -66
- package/dist/objectid-BU0Y8iAN.js +0 -145
- package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { defineComponent as j, ref as y, watch as X, onMounted as I, resolveComponent as x, openBlock as d, createBlock as A, withCtx as L, createVNode as h, unref as t, createElementVNode as i, createElementBlock as k, Fragment as $, renderList as D, computed as G, toDisplayString as O, isRef as T, createSlots as Y, createCommentVNode as V, createTextVNode as ee, reactive as te, onBeforeMount as ae } from "vue";
|
|
2
|
+
import { _ as ne } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import "./index-CLkqja9X.js";
|
|
4
|
+
import "./campaign-B7v0a8YV.js";
|
|
5
|
+
import { useRouter as le } from "vue-router";
|
|
6
|
+
import { c as R } from "./index-DbjZHuoG.js";
|
|
7
|
+
import { _ as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B8pgaARn.js";
|
|
8
|
+
import { Z as se } from "./zod-Bg2FbC-D.js";
|
|
9
|
+
import { F as re } from "./dto-DK1VnGlq.js";
|
|
10
|
+
import { J as ie } from "./JsonViewer-v8_C7l5N.js";
|
|
11
|
+
import "./index-D_gLVFsk.js";
|
|
12
|
+
import { useSnackbar as ue } from "@feedmepos/ui-library";
|
|
13
|
+
import { u as ce } from "./app-wDQR6dpb.js";
|
|
14
|
+
import { u as me } from "./loading-BXu9ofEu.js";
|
|
15
|
+
import { C as de } from "./campaign.fn-BPHARk3Y.js";
|
|
16
|
+
import { g as pe } from "./object-qECH92oz.js";
|
|
17
|
+
import { u as ve } from "./campaign-B0vnIan2.js";
|
|
18
|
+
import { u as fe } from "./membership-BBb7gdZg.js";
|
|
19
|
+
import { u as ye } from "./vue-i18n-Cts9OsqE.js";
|
|
20
|
+
const _e = { class: "ml-32 flex flex-col" }, ge = /* @__PURE__ */ j({
|
|
21
|
+
__name: "CampaignCard",
|
|
22
|
+
props: {
|
|
23
|
+
title: {},
|
|
24
|
+
items: {},
|
|
25
|
+
modelValue: {}
|
|
26
|
+
},
|
|
27
|
+
emits: ["update:model-value"],
|
|
28
|
+
setup(U, { emit: b }) {
|
|
29
|
+
const u = U, v = b, S = (o) => {
|
|
30
|
+
o ? p.value = u.items.map((a) => a.value) : p.value = [], r.value = o, v("update:model-value", p.value);
|
|
31
|
+
}, _ = (o) => {
|
|
32
|
+
p.value = o, r.value = o.length === u.items.length, v("update:model-value", o);
|
|
33
|
+
}, r = y(!1), p = y([]);
|
|
34
|
+
return X(
|
|
35
|
+
() => u.modelValue,
|
|
36
|
+
() => {
|
|
37
|
+
p.value = u.modelValue.filter(
|
|
38
|
+
(o) => u.items.find((a) => a.value === o)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
), I(() => {
|
|
42
|
+
p.value = u.modelValue.filter(
|
|
43
|
+
(o) => u.items.find((a) => a.value === o)
|
|
44
|
+
);
|
|
45
|
+
}), (o, a) => {
|
|
46
|
+
const g = x("FmCheckbox"), l = x("FmCard");
|
|
47
|
+
return d(), A(l, {
|
|
48
|
+
variant: "outlined",
|
|
49
|
+
class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
|
|
50
|
+
}, {
|
|
51
|
+
default: L(() => [
|
|
52
|
+
h(g, {
|
|
53
|
+
"model-value": t(r),
|
|
54
|
+
value: "1",
|
|
55
|
+
label: u.title,
|
|
56
|
+
indeterminate: t(p).length > 0,
|
|
57
|
+
"onUpdate:modelValue": S
|
|
58
|
+
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
59
|
+
i("div", _e, [
|
|
60
|
+
(d(!0), k($, null, D(u.items, (n, c) => (d(), A(g, {
|
|
61
|
+
key: c,
|
|
62
|
+
"model-value": t(p),
|
|
63
|
+
label: n.label,
|
|
64
|
+
value: n.value,
|
|
65
|
+
"onUpdate:modelValue": _
|
|
66
|
+
}, null, 8, ["model-value", "label", "value"]))), 128))
|
|
67
|
+
])
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}), he = { class: "space-y-16" }, be = { class: "flex items-center" }, xe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Ce = { class: "space-y-[40px]" }, ke = /* @__PURE__ */ j({
|
|
74
|
+
__name: "LinkCampaign",
|
|
75
|
+
props: {
|
|
76
|
+
modelValue: {
|
|
77
|
+
type: Array,
|
|
78
|
+
required: !0
|
|
79
|
+
},
|
|
80
|
+
campaigns: {
|
|
81
|
+
type: Object,
|
|
82
|
+
required: !0
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
emits: ["update:model-value"],
|
|
86
|
+
setup(U, { emit: b }) {
|
|
87
|
+
const u = y(""), v = y([]), S = U, _ = b, r = G(() => Object.entries(S.campaigns).reduce((o, [a, g]) => {
|
|
88
|
+
const l = g.filter(
|
|
89
|
+
(n) => n.label.toLowerCase().includes(u.value.toLowerCase())
|
|
90
|
+
);
|
|
91
|
+
return l.length > 0 && (o[a] = l), o;
|
|
92
|
+
}, {}));
|
|
93
|
+
function p(o, a) {
|
|
94
|
+
v.value = v.value.filter(
|
|
95
|
+
(g) => !a.map((l) => l.value).includes(g)
|
|
96
|
+
), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], _("update:model-value", v.value);
|
|
97
|
+
}
|
|
98
|
+
return I(() => {
|
|
99
|
+
v.value = S.modelValue;
|
|
100
|
+
}), (o, a) => {
|
|
101
|
+
const g = x("FmTextField");
|
|
102
|
+
return d(), k($, null, [
|
|
103
|
+
h(ie, { json: U.campaigns }, null, 8, ["json"]),
|
|
104
|
+
i("div", he, [
|
|
105
|
+
i("div", be, [
|
|
106
|
+
i("div", xe, O(t(v).length) + " campaign(s) linked ", 1),
|
|
107
|
+
h(g, {
|
|
108
|
+
modelValue: t(u),
|
|
109
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => T(u) ? u.value = l : null),
|
|
110
|
+
"prepend-icon": "search",
|
|
111
|
+
placeholder: "Search",
|
|
112
|
+
class: "w-full"
|
|
113
|
+
}, null, 8, ["modelValue"])
|
|
114
|
+
]),
|
|
115
|
+
i("div", Ce, [
|
|
116
|
+
(d(!0), k($, null, D(t(r), (l, n) => (d(), A(ge, {
|
|
117
|
+
"model-value": t(v),
|
|
118
|
+
title: n,
|
|
119
|
+
items: l,
|
|
120
|
+
"onUpdate:modelValue": (c) => p(c, l)
|
|
121
|
+
}, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
|
|
122
|
+
])
|
|
123
|
+
])
|
|
124
|
+
], 64);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}), Ve = { class: "flex items-center gap-x-8" }, Se = {
|
|
128
|
+
key: 0,
|
|
129
|
+
class: "space-y-16 pr-12"
|
|
130
|
+
}, we = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1), Fe = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1), Ae = { class: "flex items-center gap-x-16" }, $e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ue = { class: "mt-16" }, Pe = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Le = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Ge = { class: "flex items-center gap-8" }, Me = /* @__PURE__ */ j({
|
|
131
|
+
__name: "AnalyticSheet",
|
|
132
|
+
emits: ["success"],
|
|
133
|
+
setup(U, { expose: b, emit: u }) {
|
|
134
|
+
const v = u, S = ce();
|
|
135
|
+
ue();
|
|
136
|
+
const _ = y(!1), r = y(!1), p = {
|
|
137
|
+
name: "",
|
|
138
|
+
campaigns: []
|
|
139
|
+
}, o = y(""), a = y({ ...p }), g = re.superRefine((s, e) => {
|
|
140
|
+
}), l = y([]), n = y(null), { global: c, minor: w } = me, P = G(() => {
|
|
141
|
+
const s = g.safeParse(a.value);
|
|
142
|
+
return s.success ? [] : s.error.errors;
|
|
143
|
+
});
|
|
144
|
+
function M(s) {
|
|
145
|
+
var e;
|
|
146
|
+
_.value = !0, s ? (n.value = { ...s }, a.value = { ...s, campaigns: (e = s.pf_campaigns) == null ? void 0 : e.map((m) => m._id) }) : (n.value = null, a.value = { ...p });
|
|
147
|
+
}
|
|
148
|
+
function F() {
|
|
149
|
+
_.value = !1, n.value = null;
|
|
150
|
+
}
|
|
151
|
+
function K() {
|
|
152
|
+
r.value = !0;
|
|
153
|
+
}
|
|
154
|
+
async function W() {
|
|
155
|
+
const s = await R.readAll({
|
|
156
|
+
limit: 1e3,
|
|
157
|
+
skip: 0,
|
|
158
|
+
sortBy: "_id",
|
|
159
|
+
search: "",
|
|
160
|
+
descending: !0
|
|
161
|
+
});
|
|
162
|
+
l.value = s.resources.filter(
|
|
163
|
+
(e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
const N = G(() => {
|
|
167
|
+
const s = (m) => m.map((C) => ({
|
|
168
|
+
label: C.name,
|
|
169
|
+
value: C._id
|
|
170
|
+
}));
|
|
171
|
+
return pe(
|
|
172
|
+
l.value,
|
|
173
|
+
(m) => de.formattedType(m.type),
|
|
174
|
+
s
|
|
175
|
+
);
|
|
176
|
+
}), q = G(() => Object.entries(N.value).reduce(
|
|
177
|
+
(s, [e, m]) => {
|
|
178
|
+
const C = m.filter((B) => {
|
|
179
|
+
var E, f;
|
|
180
|
+
return (f = (E = a.value) == null ? void 0 : E.campaigns) == null ? void 0 : f.includes(B.value);
|
|
181
|
+
}).filter(
|
|
182
|
+
(B) => B.label.toLowerCase().includes(o.value.toLowerCase())
|
|
183
|
+
);
|
|
184
|
+
return C.length > 0 && (s[e] = C), s;
|
|
185
|
+
},
|
|
186
|
+
{}
|
|
187
|
+
));
|
|
188
|
+
function J(s) {
|
|
189
|
+
var m, C;
|
|
190
|
+
const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
|
|
191
|
+
e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
|
|
192
|
+
}
|
|
193
|
+
async function Z() {
|
|
194
|
+
g.safeParse(a.value).success && await w(
|
|
195
|
+
async () => {
|
|
196
|
+
var e;
|
|
197
|
+
n.value ? await R.updateGroup(
|
|
198
|
+
(e = n.value) == null ? void 0 : e._id,
|
|
199
|
+
a.value
|
|
200
|
+
) : await R.createGroup(a.value), v("success"), F();
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
message: "Saving group",
|
|
204
|
+
successMessage: "Group saved"
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
async function z() {
|
|
209
|
+
await w(
|
|
210
|
+
async () => {
|
|
211
|
+
var s;
|
|
212
|
+
await R.deleteGroup((s = n.value) == null ? void 0 : s._id), v("success"), F();
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
message: "Deleting group",
|
|
216
|
+
successMessage: "Group deleted"
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return I(async () => {
|
|
221
|
+
await W();
|
|
222
|
+
}), b({
|
|
223
|
+
showSheet: M,
|
|
224
|
+
hideSheet: F
|
|
225
|
+
}), (s, e) => {
|
|
226
|
+
const m = x("FmButton"), C = x("FmTextField"), B = x("FmList"), E = x("FmSideSheet");
|
|
227
|
+
return d(), A(E, {
|
|
228
|
+
modelValue: t(_),
|
|
229
|
+
"onUpdate:modelValue": e[7] || (e[7] = (f) => T(_) ? _.value = f : null),
|
|
230
|
+
header: t(n) ? "Edit group" : "Add group",
|
|
231
|
+
"dismiss-away": "",
|
|
232
|
+
"close-button": !0,
|
|
233
|
+
"max-width": 550
|
|
234
|
+
}, Y({
|
|
235
|
+
"side-sheet-footer": L(() => [
|
|
236
|
+
i("div", Ge, [
|
|
237
|
+
t(r) ? V("", !0) : (d(), k($, { key: 0 }, [
|
|
238
|
+
h(m, {
|
|
239
|
+
label: "Submit",
|
|
240
|
+
onClick: Z,
|
|
241
|
+
disabled: t(P).length > 0 || t(S).isLoading
|
|
242
|
+
}, null, 8, ["disabled"]),
|
|
243
|
+
h(m, {
|
|
244
|
+
label: "Cancel",
|
|
245
|
+
onClick: e[4] || (e[4] = (f) => F()),
|
|
246
|
+
variant: "tertiary"
|
|
247
|
+
}),
|
|
248
|
+
t(n) ? (d(), A(m, {
|
|
249
|
+
key: 0,
|
|
250
|
+
label: "Delete",
|
|
251
|
+
variant: "plain",
|
|
252
|
+
class: "ml-auto fm-color-system-error-300",
|
|
253
|
+
onClick: e[5] || (e[5] = (f) => z())
|
|
254
|
+
})) : V("", !0)
|
|
255
|
+
], 64)),
|
|
256
|
+
t(r) ? (d(), A(m, {
|
|
257
|
+
key: 1,
|
|
258
|
+
label: "Confirm",
|
|
259
|
+
onClick: e[6] || (e[6] = (f) => r.value = !1)
|
|
260
|
+
})) : V("", !0)
|
|
261
|
+
])
|
|
262
|
+
]),
|
|
263
|
+
default: L(() => [
|
|
264
|
+
t(r) ? V("", !0) : (d(), k("div", Se, [
|
|
265
|
+
we,
|
|
266
|
+
h(oe, {
|
|
267
|
+
modelValue: t(a).name,
|
|
268
|
+
"onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
|
|
269
|
+
label: "Name",
|
|
270
|
+
schema: t(se).typeAtPath(t(g), "name")
|
|
271
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
272
|
+
Fe,
|
|
273
|
+
i("div", Ae, [
|
|
274
|
+
i("div", $e, O(t(a).campaigns.length) + " campaign(s) linked ", 1),
|
|
275
|
+
h(C, {
|
|
276
|
+
modelValue: t(o),
|
|
277
|
+
"onUpdate:modelValue": e[2] || (e[2] = (f) => T(o) ? o.value = f : null),
|
|
278
|
+
"prepend-icon": "search",
|
|
279
|
+
placeholder: "Search",
|
|
280
|
+
class: "w-auto"
|
|
281
|
+
}, null, 8, ["modelValue"])
|
|
282
|
+
]),
|
|
283
|
+
h(m, {
|
|
284
|
+
variant: "plain",
|
|
285
|
+
icon: "link",
|
|
286
|
+
label: "Link Campaign",
|
|
287
|
+
onClick: K
|
|
288
|
+
})
|
|
289
|
+
])),
|
|
290
|
+
t(r) ? (d(), A(ke, {
|
|
291
|
+
key: 1,
|
|
292
|
+
modelValue: t(a).campaigns,
|
|
293
|
+
"onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
|
|
294
|
+
campaigns: t(N)
|
|
295
|
+
}, null, 8, ["modelValue", "campaigns"])) : V("", !0),
|
|
296
|
+
i("div", Ue, [
|
|
297
|
+
t(r) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(q), (f, Q) => (d(), k("div", null, [
|
|
298
|
+
i("div", Pe, O(Q), 1),
|
|
299
|
+
h(B, { separator: !0 }, {
|
|
300
|
+
default: L(() => [
|
|
301
|
+
(d(!0), k($, null, D(f, (H) => (d(), k("div", Le, [
|
|
302
|
+
i("div", null, O(H.label), 1),
|
|
303
|
+
i("div", null, [
|
|
304
|
+
h(m, {
|
|
305
|
+
icon: "delete",
|
|
306
|
+
onClick: (je) => J(H.value),
|
|
307
|
+
variant: "tertiary"
|
|
308
|
+
}, null, 8, ["onClick"])
|
|
309
|
+
])
|
|
310
|
+
]))), 256))
|
|
311
|
+
]),
|
|
312
|
+
_: 2
|
|
313
|
+
}, 1024)
|
|
314
|
+
]))), 256))
|
|
315
|
+
])
|
|
316
|
+
]),
|
|
317
|
+
_: 2
|
|
318
|
+
}, [
|
|
319
|
+
t(r) ? {
|
|
320
|
+
name: "side-sheet-header",
|
|
321
|
+
fn: L(() => [
|
|
322
|
+
i("div", Ve, [
|
|
323
|
+
h(m, {
|
|
324
|
+
icon: "arrow_back",
|
|
325
|
+
variant: "tertiary",
|
|
326
|
+
onClick: e[0] || (e[0] = (f) => r.value = !1)
|
|
327
|
+
}),
|
|
328
|
+
ee("Link campaign ")
|
|
329
|
+
])
|
|
330
|
+
]),
|
|
331
|
+
key: "0"
|
|
332
|
+
} : void 0
|
|
333
|
+
]), 1032, ["modelValue", "header"]);
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}), Be = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Re = { class: "space-y-16" }, Ee = { class: "flex items-center justify-end" }, Oe = /* @__PURE__ */ i("img", {
|
|
337
|
+
src: ne,
|
|
338
|
+
class: "w-[150px]"
|
|
339
|
+
}, null, -1), De = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1), Te = /* @__PURE__ */ i("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " We apologize for the inconvenience. The analytics dashboard is currently under maintenance to improve your experience. Please check back later for updates on system availability. ", -1), rt = /* @__PURE__ */ j({
|
|
340
|
+
__name: "Analytic",
|
|
341
|
+
setup(U) {
|
|
342
|
+
const { t: b } = ye(), u = {
|
|
343
|
+
label: b("connect.analytic.addGroup"),
|
|
344
|
+
value: "create",
|
|
345
|
+
isPrimary: !0,
|
|
346
|
+
prependIcon: "add"
|
|
347
|
+
}, v = ve(), S = y(), _ = y([]), r = y(""), p = te({
|
|
348
|
+
totalCampaign: 0,
|
|
349
|
+
totalProgram: 0,
|
|
350
|
+
totalMember: 0
|
|
351
|
+
}), o = y("1");
|
|
352
|
+
b("connect.analytic.summary.totalCampaign"), b("connect.analytic.summary.totalProgram"), b("connect.analytic.summary.totalMember");
|
|
353
|
+
function a(n) {
|
|
354
|
+
var c;
|
|
355
|
+
o.value = (/* @__PURE__ */ new Date()).toISOString(), (c = S.value) == null || c.showSheet(n);
|
|
356
|
+
}
|
|
357
|
+
async function g() {
|
|
358
|
+
await v.readGroups();
|
|
359
|
+
const n = await R.readAllGrouped({
|
|
360
|
+
limit: 100,
|
|
361
|
+
skip: 0,
|
|
362
|
+
sortBy: "_id",
|
|
363
|
+
search: "",
|
|
364
|
+
descending: !0
|
|
365
|
+
});
|
|
366
|
+
_.value = n.resources;
|
|
367
|
+
}
|
|
368
|
+
G(() => _.value.filter((n) => {
|
|
369
|
+
var c;
|
|
370
|
+
return n.name.includes(r.value) || ((c = n.pf_campaigns) == null ? void 0 : c.filter((w) => w.name.includes(r.value)).length);
|
|
371
|
+
}));
|
|
372
|
+
const l = fe();
|
|
373
|
+
return le(), y(!0), G(() => {
|
|
374
|
+
var n, c, w, P;
|
|
375
|
+
return !l.storeOption || !l.storeOption.company ? -1 : !l.payoutAccount || !l.payoutAccount.enable || l.payoutAccount.status != "APPROVED" ? 0 : (c = (n = l.store) == null ? void 0 : n.categories) != null && c.length ? (P = (w = l.store) == null ? void 0 : w.categories) != null && P.some(
|
|
376
|
+
(M) => M.bundles.some((F) => F.isFeedvibe)
|
|
377
|
+
) ? 3 : 2 : 1;
|
|
378
|
+
}), ae(async () => {
|
|
379
|
+
await l.readMemberStore(), await l.readMembership(), await l.readPayoutAccount();
|
|
380
|
+
}), (n, c) => {
|
|
381
|
+
const w = x("FmPageHead"), P = x("FmSearch"), M = x("FmCard");
|
|
382
|
+
return x("FmButton"), x("FmIcon"), d(), k($, null, [
|
|
383
|
+
h(w, {
|
|
384
|
+
title: t(b)("connect.analytic.title"),
|
|
385
|
+
actions: t(_).length > 0 ? [u] : [],
|
|
386
|
+
"onClick:action": c[0] || (c[0] = (F) => a())
|
|
387
|
+
}, null, 8, ["title", "actions"]),
|
|
388
|
+
i("div", Be, [
|
|
389
|
+
i("div", Re, [
|
|
390
|
+
i("div", Ee, [
|
|
391
|
+
h(P, {
|
|
392
|
+
class: "xs:hidden",
|
|
393
|
+
modelValue: t(r),
|
|
394
|
+
"onUpdate:modelValue": c[1] || (c[1] = (F) => T(r) ? r.value = F : null),
|
|
395
|
+
placeholder: t(b)("connect.analytic.search"),
|
|
396
|
+
collapsible: ""
|
|
397
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
398
|
+
]),
|
|
399
|
+
V("", !0)
|
|
400
|
+
]),
|
|
401
|
+
V("", !0),
|
|
402
|
+
t(_).length ? V("", !0) : (d(), A(M, {
|
|
403
|
+
key: 1,
|
|
404
|
+
variant: "outlined",
|
|
405
|
+
class: "flex flex-col gap-y-24 items-center p-16"
|
|
406
|
+
}, {
|
|
407
|
+
default: L(() => [
|
|
408
|
+
Oe,
|
|
409
|
+
De,
|
|
410
|
+
Te
|
|
411
|
+
]),
|
|
412
|
+
_: 1
|
|
413
|
+
})),
|
|
414
|
+
V("", !0),
|
|
415
|
+
h(Me, {
|
|
416
|
+
ref_key: "sheetRef",
|
|
417
|
+
ref: S,
|
|
418
|
+
onSuccess: g
|
|
419
|
+
}, null, 512)
|
|
420
|
+
])
|
|
421
|
+
], 64);
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
export {
|
|
426
|
+
rt as default
|
|
427
|
+
};
|