@feedmepos/mf-connect 0.1.38-beta.74 → 0.1.38-beta.76
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-BrBxRQue.js +761 -0
- package/dist/App-CE_19YJc.js +4642 -0
- package/dist/AuditLogs-CQtMmVIp.js +1991 -0
- package/dist/Bin-D9CHhiUb.js +166 -0
- package/dist/Broadcast-Dg6eBL_f.js +267 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CSv0R9XX.js +121 -0
- package/dist/Card-BTkf67i1.js +910 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-Czq4nsdu.js +541 -0
- package/dist/Credit-B3nX8aJA.js +261 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js +3120 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-5U6cSZGZ.js +351 -0
- package/dist/Experience-B9Vn3NTH.js +260 -0
- package/dist/FileSaver.min-CJaOkSQt.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-DTx_EsM3.js +331 -0
- package/dist/GenerateMaterial-C3J9_YHw.js +589 -0
- package/dist/Grab-B29W7rka.js +301 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DyegKNzM.js +145 -0
- package/dist/Index-Fk8EP5dG.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D2XPGgTM.js +48 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-K8qUYrPk.js +18737 -0
- package/dist/MainLayout-BFmqJkE_.js +41 -0
- package/dist/Marketing-BRHQHAWD.js +145 -0
- package/dist/MarketingMaterialEdit-7s3WEDyJ.js +746 -0
- package/dist/Member-DwPJNAo9.js +280 -0
- package/dist/MemberList-mS1W0qHY.js +1601 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-BV3xvFYS.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DzKqVp2O.js +60799 -0
- package/dist/Mission-QmoURSu4.js +335 -0
- package/dist/Overview-CaTMLlq-.js +1078 -0
- package/dist/Point-CjG77Sma.js +263 -0
- package/dist/Promotion-C5I-1qPN.js +397 -0
- package/dist/Queue-BaIBCCaX.js +259 -0
- package/dist/Record-DqpGwZIU.js +341 -0
- package/dist/Review-Bq-edSOO.js +621 -0
- package/dist/ReviewFacebookCallback-yaC4rLki.js +243 -0
- package/dist/ReviewGoogleCallback-uxrrCQdu.js +213 -0
- package/dist/Reward-DGP65n5t.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-bNMoMZOy.js +149 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dgrc6vXF.js +1912 -0
- package/dist/Segment-CNz0sR3c.js +881 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DLZEzpve.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CLdIeyef.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js +147 -0
- package/dist/Setting-BKDSGYBR.js +2000 -0
- package/dist/SettingAdvertisements-B2GMFfN9.js +264 -0
- package/dist/Store-C6uLl_Ue.js +1996 -0
- package/dist/StoreRewards-D4728UDf.js +535 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CG09fJTP.js +1129 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-B0_bMK5u.js +7005 -0
- package/dist/Tier-BNzTa1_w.js +970 -0
- package/dist/Title-DY5knovF.js +568 -0
- package/dist/Transaction-Ct4yAJ9n.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CHnxi3XZ.js +130 -0
- package/dist/Voucher-DFTMRPT0.js +422 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DZU7XVlZ.js +421 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BndLHmHB.js +56 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-6lG4w5PT.js +59396 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +7 -0
- package/dist/business-CrfQ56D0.js +82 -0
- package/dist/campaign-B9fR7RwT.js +100 -0
- package/dist/campaign-B_iIaTKz.js +253 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign.enum-BAHf0dSv.js +26 -0
- package/dist/campaign.fn-DDEgBzH2.js +776 -0
- package/dist/collectible.enum-9os2zr5a.js +19 -0
- package/dist/collection.fn-7qP_m2MW.js +26 -0
- package/dist/dto-C2hLQKuu.js +222 -0
- package/dist/duplicateCampaign-C6RXfeWE.js +51 -0
- package/dist/effect-DGVfWyIc.js +89 -0
- package/dist/email-addresses-BHa_qQBd.js +705 -0
- package/dist/export-CRPfo4hq.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-0_zrz4kj.js +86 -0
- package/dist/index-4Vl1VXum.js +2639 -0
- package/dist/index-4bX0ewBJ.js +31 -0
- package/dist/index-Bj0TV_D5.js +36 -0
- package/dist/index-BpdSswT6.js +48 -0
- package/dist/index-By2wenzb.js +32 -0
- package/dist/index-C8L2jQ_6.js +28897 -0
- package/dist/index-CO5kQMIK.js +85 -0
- package/dist/index-CW_ub4cF.js +8912 -0
- package/dist/index-Cp8wkBus.js +124 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-D6Te1BQZ.js +54 -0
- package/dist/index-DbJGJ2fB.js +146 -0
- package/dist/index-DeaGdUSH.js +30289 -0
- package/dist/index-Dp1J9Fxa.js +3 -0
- package/dist/index-QUvYZydO.js +67 -0
- package/dist/index-lwxV5iX0.js +3431 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index.esm2017-ofRmIpjY.js +3069 -0
- package/dist/loading-8_73fcXo.js +71 -0
- package/dist/lodash-Bz_vrY3P.js +3678 -0
- package/dist/membership-CpB39vNW.js +235 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-DALHjzjF.js +15 -0
- package/dist/number-D_GJahxw.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-BZSH63yc.js +145 -0
- package/dist/plugins-A4jDcmfS.js +1817 -0
- package/dist/remy-D_Deb3ue.js +13 -0
- package/dist/reward-BqFB2Yn2.js +36 -0
- package/dist/rule-DNylZfIG.js +1969 -0
- package/dist/rule-builder-2iT04EOj.js +102 -0
- package/dist/style.css +13 -0
- package/dist/template-D7rpG7FN.js +188 -0
- package/dist/tier-BJDhpH6X.js +4 -0
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-BW17tvi2.js +1154 -0
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-CbVrS2i6.js +213 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/usePagination-dXSoqxfG.js +266 -0
- package/dist/user-Ck-m3cB3.js +55 -0
- package/dist/vue-i18n-BvqmcBWZ.js +2365 -0
- package/dist/xlsx-CkqDfUNs.js +15491 -0
- package/dist/zod-B0YxCfoE.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { defineComponent as C, ref as F, computed as g, resolveComponent as s, openBlock as u, createBlock as m, unref as d, withCtx as c, createVNode as p, normalizeClass as i, createCommentVNode as V, createElementVNode as k, toDisplayString as b, renderSlot as q, createElementBlock as S, Fragment as I, renderList as M } from "vue";
|
|
2
|
+
const B = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, z = /* @__PURE__ */ C({
|
|
3
|
+
__name: "ChipMenu",
|
|
4
|
+
props: {
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Object,
|
|
7
|
+
required: !1
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: !0
|
|
12
|
+
},
|
|
13
|
+
showItemLabel: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
placement: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: !1,
|
|
20
|
+
default: "bottom-end"
|
|
21
|
+
},
|
|
22
|
+
class: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: !1
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: !1
|
|
29
|
+
},
|
|
30
|
+
items: {
|
|
31
|
+
type: Array,
|
|
32
|
+
required: !1
|
|
33
|
+
},
|
|
34
|
+
icon: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: !1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
emits: ["update:model-value"],
|
|
40
|
+
setup(a, { emit: f }) {
|
|
41
|
+
const e = a, v = f, r = F(!1), y = g(
|
|
42
|
+
() => {
|
|
43
|
+
var n, t;
|
|
44
|
+
return (t = (n = e.items) == null ? void 0 : n.find((o) => o.value === e.modelValue)) == null ? void 0 : t.label;
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
return (n, t) => {
|
|
48
|
+
const o = s("FmIcon"), _ = s("FmChip"), h = s("FmMenuItem"), w = s("FmMenu");
|
|
49
|
+
return u(), m(w, {
|
|
50
|
+
placement: a.placement || "bottom-end",
|
|
51
|
+
disabled: a.disabled == !0,
|
|
52
|
+
"model-value": d(r),
|
|
53
|
+
onMenuChanged: t[0] || (t[0] = (l) => r.value = l)
|
|
54
|
+
}, {
|
|
55
|
+
"menu-button": c(() => [
|
|
56
|
+
p(_, {
|
|
57
|
+
label: e.label,
|
|
58
|
+
class: i(e.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
59
|
+
}, {
|
|
60
|
+
default: c(() => [
|
|
61
|
+
e.icon ? (u(), m(o, {
|
|
62
|
+
key: 0,
|
|
63
|
+
name: e.icon,
|
|
64
|
+
class: i(e.class),
|
|
65
|
+
outline: "",
|
|
66
|
+
size: "sm"
|
|
67
|
+
}, null, 8, ["name", "class"])) : V("", !0),
|
|
68
|
+
k("div", B, b(e.label) + " " + b(a.showItemLabel ? d(y) : ""), 1),
|
|
69
|
+
p(o, {
|
|
70
|
+
name: d(r) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
71
|
+
class: i(e.class),
|
|
72
|
+
outline: "",
|
|
73
|
+
size: "sm"
|
|
74
|
+
}, null, 8, ["name", "class"])
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["label", "class"])
|
|
78
|
+
]),
|
|
79
|
+
default: c(() => [
|
|
80
|
+
q(n.$slots, "default", {}, () => [
|
|
81
|
+
(u(!0), S(I, null, M(e.items ?? [], (l) => (u(), m(h, {
|
|
82
|
+
key: l.value,
|
|
83
|
+
value: l.value,
|
|
84
|
+
label: l.label,
|
|
85
|
+
"model-value": e.modelValue === l.value,
|
|
86
|
+
"onUpdate:modelValue": (x) => v("update:model-value", l.value)
|
|
87
|
+
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
88
|
+
])
|
|
89
|
+
]),
|
|
90
|
+
_: 3
|
|
91
|
+
}, 8, ["placement", "disabled", "model-value"]);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
export {
|
|
96
|
+
z as _
|
|
97
|
+
};
|
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var ue = (y, u, v) => u in y ? ie(y, u, { enumerable: !0, configurable: !0, writable: !0, value: v }) : y[u] = v;
|
|
3
|
+
var Z = (y, u, v) => ue(y, typeof u != "symbol" ? u + "" : u, v);
|
|
4
|
+
import { defineComponent as ae, ref as C, computed as D, watch as W, resolveComponent as p, openBlock as w, createBlock as Q, unref as o, isRef as ee, withCtx as Y, createElementVNode as V, createVNode as i, createElementBlock as T, Fragment as L, renderList as ce, createCommentVNode as q, h, onMounted as de } from "vue";
|
|
5
|
+
import { h as E } from "./moment-D7p2TMB-.js";
|
|
6
|
+
import { components as X } from "@feedmepos/ui-library";
|
|
7
|
+
import "./index-DeaGdUSH.js";
|
|
8
|
+
import { J as me } from "./JsonViewer-v8_C7l5N.js";
|
|
9
|
+
import { u as le } from "./loading-8_73fcXo.js";
|
|
10
|
+
import { u as pe } from "./app-wDQR6dpb.js";
|
|
11
|
+
import { useRoute as ne, useRouter as fe } from "vue-router";
|
|
12
|
+
import { c as re } from "./index-Cp8wkBus.js";
|
|
13
|
+
import { e as b } from "./index-vh86FiIQ.js";
|
|
14
|
+
import { u as J, w as ge } from "./xlsx-CkqDfUNs.js";
|
|
15
|
+
import { u as ve, _ as he } from "./usePagination-dXSoqxfG.js";
|
|
16
|
+
import { a as te } from "./plugins-A4jDcmfS.js";
|
|
17
|
+
import { u as be } from "./campaign-B9fR7RwT.js";
|
|
18
|
+
import { m as Ce } from "./index-DbJGJ2fB.js";
|
|
19
|
+
import { o as oe } from "./objectId-dwaoBfJX.js";
|
|
20
|
+
const ye = { class: "space-y-16" }, xe = { class: "gap-16 grid grid-cols-2" }, Se = { class: "flex items-center gap-8" }, Ve = /* @__PURE__ */ ae({
|
|
21
|
+
__name: "CreateCollectionSheet",
|
|
22
|
+
emits: ["success"],
|
|
23
|
+
setup(y, { expose: u, emit: v }) {
|
|
24
|
+
const { minor: M } = le, P = ne(), F = C(), k = C(!1), $ = v, x = C(!1);
|
|
25
|
+
function R(r) {
|
|
26
|
+
x.value = r, r && (n.value = {
|
|
27
|
+
quantity: 1,
|
|
28
|
+
code: "",
|
|
29
|
+
codeConfig: {
|
|
30
|
+
length: 8,
|
|
31
|
+
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
32
|
+
prefix: "",
|
|
33
|
+
suffix: "",
|
|
34
|
+
pattern: "########"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const n = C({
|
|
39
|
+
quantity: 1,
|
|
40
|
+
code: "",
|
|
41
|
+
codeConfig: {
|
|
42
|
+
length: 8,
|
|
43
|
+
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
44
|
+
prefix: "",
|
|
45
|
+
suffix: "",
|
|
46
|
+
pattern: "########"
|
|
47
|
+
}
|
|
48
|
+
}), z = [
|
|
49
|
+
{
|
|
50
|
+
label: "Bulk codes",
|
|
51
|
+
value: "bulk",
|
|
52
|
+
sublabel: "Bulk generate unique codes"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "Custom code",
|
|
56
|
+
value: "single",
|
|
57
|
+
sublabel: "Enter your own custom codes"
|
|
58
|
+
}
|
|
59
|
+
], A = [
|
|
60
|
+
{
|
|
61
|
+
label: "Alphanumeric",
|
|
62
|
+
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "Alphabetic",
|
|
66
|
+
value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
67
|
+
},
|
|
68
|
+
{ label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
|
|
69
|
+
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
70
|
+
{ label: "Numbers", value: "0123456789" },
|
|
71
|
+
{ label: "Custom", value: "" }
|
|
72
|
+
], U = C(A[0].value), f = C("bulk"), _ = C(!1), K = D(() => P.params.id);
|
|
73
|
+
async function N(r) {
|
|
74
|
+
var t;
|
|
75
|
+
await ((t = F.value) == null ? void 0 : t.validateInputs()), k.value && await M(
|
|
76
|
+
async () => {
|
|
77
|
+
await re.createCollectionByCampaignId(K.value, r), await $("success");
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
message: "Creating claim(s)",
|
|
81
|
+
successMessage: "Claim(s) created"
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
u({
|
|
86
|
+
showSheet: R
|
|
87
|
+
}), W(
|
|
88
|
+
() => f.value,
|
|
89
|
+
(r, t) => {
|
|
90
|
+
t != r && (n.value.code = "", n.value.codeConfig.length = 8, n.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n.value.codeConfig.prefix = "", n.value.codeConfig.suffix = "", n.value.codeConfig.pattern = "########");
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
function g(r) {
|
|
94
|
+
if (f.value !== "single") return !1;
|
|
95
|
+
const t = r.split(`
|
|
96
|
+
`).map((B) => B.trim()).filter(Boolean);
|
|
97
|
+
return new Set(t).size !== t.length;
|
|
98
|
+
}
|
|
99
|
+
function j(r) {
|
|
100
|
+
return /[ \t]/.test(r);
|
|
101
|
+
}
|
|
102
|
+
return W(
|
|
103
|
+
() => n.value.codeConfig.length,
|
|
104
|
+
(r, t) => {
|
|
105
|
+
r != t && (n.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(r))));
|
|
106
|
+
}
|
|
107
|
+
), W(
|
|
108
|
+
() => n.value.codeConfig.pattern,
|
|
109
|
+
(r, t) => {
|
|
110
|
+
r != t && (n.value.codeConfig.length = (n.value.codeConfig.pattern.match(/#/g) || []).length);
|
|
111
|
+
}
|
|
112
|
+
), (r, t) => {
|
|
113
|
+
const B = p("FmRadio"), O = p("FmRadioGroup"), H = p("FmSwitch"), l = p("FmStepperField"), e = p("FmSelect"), c = p("FmTextField"), d = p("FmTextarea"), s = p("FmForm"), S = p("FmButton"), G = p("FmSideSheet");
|
|
114
|
+
return w(), Q(G, {
|
|
115
|
+
"max-width": 560,
|
|
116
|
+
"dismiss-away": !0,
|
|
117
|
+
header: "Create collection",
|
|
118
|
+
modelValue: o(x),
|
|
119
|
+
"onUpdate:modelValue": [
|
|
120
|
+
t[14] || (t[14] = (a) => ee(x) ? x.value = a : null),
|
|
121
|
+
t[15] || (t[15] = (a) => x.value = a)
|
|
122
|
+
]
|
|
123
|
+
}, {
|
|
124
|
+
"side-sheet-footer": Y(() => [
|
|
125
|
+
V("div", Se, [
|
|
126
|
+
i(S, {
|
|
127
|
+
label: "Save",
|
|
128
|
+
onClick: t[12] || (t[12] = (a) => N(o(n))),
|
|
129
|
+
loading: o(pe)().isLoading
|
|
130
|
+
}, null, 8, ["loading"]),
|
|
131
|
+
i(S, {
|
|
132
|
+
label: "Cancel",
|
|
133
|
+
type: "button",
|
|
134
|
+
variant: "tertiary",
|
|
135
|
+
onClick: t[13] || (t[13] = (a) => x.value = !1)
|
|
136
|
+
})
|
|
137
|
+
])
|
|
138
|
+
]),
|
|
139
|
+
default: Y(() => [
|
|
140
|
+
i(me, { json: o(n) }, null, 8, ["json"]),
|
|
141
|
+
i(s, {
|
|
142
|
+
ref_key: "form",
|
|
143
|
+
ref: F,
|
|
144
|
+
class: "space-y-40",
|
|
145
|
+
onValidationSuccess: t[10] || (t[10] = (a) => k.value = !0),
|
|
146
|
+
onValidationFailed: t[11] || (t[11] = (a) => k.value = !1)
|
|
147
|
+
}, {
|
|
148
|
+
default: Y(() => [
|
|
149
|
+
V("div", null, [
|
|
150
|
+
t[16] || (t[16] = V("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
|
|
151
|
+
i(O, {
|
|
152
|
+
modelValue: o(f),
|
|
153
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => ee(f) ? f.value = a : null),
|
|
154
|
+
inline: !1
|
|
155
|
+
}, {
|
|
156
|
+
default: Y(() => [
|
|
157
|
+
(w(), T(L, null, ce(z, (a) => i(B, {
|
|
158
|
+
key: a.value,
|
|
159
|
+
value: a.value,
|
|
160
|
+
label: a.label,
|
|
161
|
+
sublabel: a.sublabel
|
|
162
|
+
}, null, 8, ["value", "label", "sublabel"])), 64))
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
}, 8, ["modelValue"])
|
|
166
|
+
]),
|
|
167
|
+
V("div", ye, [
|
|
168
|
+
t[17] || (t[17] = V("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
|
|
169
|
+
o(f) === "bulk" ? (w(), T(L, { key: 0 }, [
|
|
170
|
+
i(H, {
|
|
171
|
+
"model-value": o(_),
|
|
172
|
+
"label-placement": "right",
|
|
173
|
+
value: "true",
|
|
174
|
+
label: "Advance code setting",
|
|
175
|
+
required: !0,
|
|
176
|
+
"onUpdate:modelValue": t[1] || (t[1] = () => _.value = !o(_))
|
|
177
|
+
}, null, 8, ["model-value"]),
|
|
178
|
+
o(_) ? (w(), T(L, { key: 0 }, [
|
|
179
|
+
i(l, {
|
|
180
|
+
modelValue: o(n).codeConfig.length,
|
|
181
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => o(n).codeConfig.length = a),
|
|
182
|
+
label: "Code length",
|
|
183
|
+
max: 16,
|
|
184
|
+
min: 1,
|
|
185
|
+
rules: [
|
|
186
|
+
(a) => Number(a) >= 1 || "Code length must at least 1",
|
|
187
|
+
(a) => Number(a) <= 16 || "Code length must less than 16"
|
|
188
|
+
],
|
|
189
|
+
required: !0
|
|
190
|
+
}, null, 8, ["modelValue", "rules"]),
|
|
191
|
+
i(e, {
|
|
192
|
+
label: "Charset",
|
|
193
|
+
"model-value": o(U),
|
|
194
|
+
items: A,
|
|
195
|
+
"helper-text": o(n).codeConfig.charset.length > 62 ? `${o(n).codeConfig.charset.substring(0, 62)}...` : o(n).codeConfig.charset,
|
|
196
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => {
|
|
197
|
+
U.value = a, o(n).codeConfig.charset = a;
|
|
198
|
+
})
|
|
199
|
+
}, null, 8, ["model-value", "helper-text"]),
|
|
200
|
+
o(U) === "" ? (w(), Q(c, {
|
|
201
|
+
key: 0,
|
|
202
|
+
modelValue: o(n).codeConfig.charset,
|
|
203
|
+
"onUpdate:modelValue": t[4] || (t[4] = (a) => o(n).codeConfig.charset = a),
|
|
204
|
+
label: "Custom Charset",
|
|
205
|
+
required: ""
|
|
206
|
+
}, null, 8, ["modelValue"])) : q("", !0),
|
|
207
|
+
V("div", xe, [
|
|
208
|
+
i(c, {
|
|
209
|
+
modelValue: o(n).codeConfig.prefix,
|
|
210
|
+
"onUpdate:modelValue": t[5] || (t[5] = (a) => o(n).codeConfig.prefix = a),
|
|
211
|
+
label: "Prefix (Optional)"
|
|
212
|
+
}, null, 8, ["modelValue"]),
|
|
213
|
+
i(c, {
|
|
214
|
+
modelValue: o(n).codeConfig.suffix,
|
|
215
|
+
"onUpdate:modelValue": t[6] || (t[6] = (a) => o(n).codeConfig.suffix = a),
|
|
216
|
+
label: "Suffix (Optional)"
|
|
217
|
+
}, null, 8, ["modelValue"])
|
|
218
|
+
]),
|
|
219
|
+
i(c, {
|
|
220
|
+
modelValue: o(n).codeConfig.pattern,
|
|
221
|
+
"onUpdate:modelValue": t[7] || (t[7] = (a) => o(n).codeConfig.pattern = a),
|
|
222
|
+
label: "Pattern",
|
|
223
|
+
required: !0
|
|
224
|
+
}, null, 8, ["modelValue"])
|
|
225
|
+
], 64)) : q("", !0),
|
|
226
|
+
i(c, {
|
|
227
|
+
modelValue: o(n).quantity,
|
|
228
|
+
"onUpdate:modelValue": t[8] || (t[8] = (a) => o(n).quantity = a),
|
|
229
|
+
label: "Number of code",
|
|
230
|
+
rules: [
|
|
231
|
+
(a) => a >= 1 || "Quantity cannot be less than 1",
|
|
232
|
+
(a) => a <= 1e4 || "Quantity cannot more than 10,000"
|
|
233
|
+
],
|
|
234
|
+
required: !0,
|
|
235
|
+
"helper-text": `${o(n).quantity} claim will be created`
|
|
236
|
+
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
237
|
+
], 64)) : q("", !0),
|
|
238
|
+
o(f) !== "bulk" ? (w(), Q(d, {
|
|
239
|
+
key: 1,
|
|
240
|
+
modelValue: o(n).code,
|
|
241
|
+
"onUpdate:modelValue": t[9] || (t[9] = (a) => o(n).code = a),
|
|
242
|
+
label: "Custom Code",
|
|
243
|
+
rules: [
|
|
244
|
+
(a) => o(f) != "single" || !!a || "Custom code is required",
|
|
245
|
+
(a) => !g(a) || "Custom code must be unique",
|
|
246
|
+
(a) => !j(a) || "Custom code must not contain space"
|
|
247
|
+
],
|
|
248
|
+
placeholder: "(For multiple codes, please enter in the new row.)"
|
|
249
|
+
}, null, 8, ["modelValue", "rules"])) : q("", !0)
|
|
250
|
+
])
|
|
251
|
+
]),
|
|
252
|
+
_: 1
|
|
253
|
+
}, 512)
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
}, 8, ["modelValue"]);
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
class we {
|
|
261
|
+
constructor() {
|
|
262
|
+
Z(this, "data", []);
|
|
263
|
+
}
|
|
264
|
+
addRecord(u) {
|
|
265
|
+
this.data.push(u);
|
|
266
|
+
}
|
|
267
|
+
buildExcel() {
|
|
268
|
+
const u = J.book_new(), v = J.json_to_sheet(this.data);
|
|
269
|
+
return J.book_append_sheet(u, v, "Collection"), u;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
var Fe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
273
|
+
const ke = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ue = { class: "flex items-center justify-end py-4 xs:hidden" }, je = /* @__PURE__ */ ae({
|
|
274
|
+
__name: "Collections",
|
|
275
|
+
setup(y) {
|
|
276
|
+
function u(l) {
|
|
277
|
+
return l.hideInApp === !1;
|
|
278
|
+
}
|
|
279
|
+
const v = fe(), M = ne(), P = C(), F = D(() => M.params.id), k = C(!1), { custom: $ } = le;
|
|
280
|
+
function x(l) {
|
|
281
|
+
var e;
|
|
282
|
+
return (e = l._id) == null ? void 0 : e.toString();
|
|
283
|
+
}
|
|
284
|
+
function R(l) {
|
|
285
|
+
var d;
|
|
286
|
+
const e = (d = Fe.voucherAppUrl) == null ? void 0 : d.replace(/\/$/, ""), c = x(l);
|
|
287
|
+
return !e || !c ? "" : `${e}/c/${c}`;
|
|
288
|
+
}
|
|
289
|
+
function n(l) {
|
|
290
|
+
var d, s;
|
|
291
|
+
const e = (d = l.user) == null ? void 0 : d.toString(), c = (s = l.business) == null ? void 0 : s.toString();
|
|
292
|
+
return (l.balance || 0) > 0 && (!e || e === c);
|
|
293
|
+
}
|
|
294
|
+
async function z(l) {
|
|
295
|
+
const e = R(l);
|
|
296
|
+
e && await te(e, {
|
|
297
|
+
successMessage: "Collection link copied to clipboard"
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
const A = be(), U = D(
|
|
301
|
+
() => A.campaigns.voucher.find(
|
|
302
|
+
(l) => {
|
|
303
|
+
var e;
|
|
304
|
+
return ((e = l._id) == null ? void 0 : e.toString()) === F.value;
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
), f = D(
|
|
308
|
+
() => !!U.value && !u(U.value)
|
|
309
|
+
), _ = D(() => [
|
|
310
|
+
{
|
|
311
|
+
header: "ID/Code",
|
|
312
|
+
accessorKey: "_id",
|
|
313
|
+
cell(l) {
|
|
314
|
+
return h("div", { class: "flex items-center" }, [
|
|
315
|
+
h(X.FmIcon, {
|
|
316
|
+
name: "content_copy",
|
|
317
|
+
outline: !0,
|
|
318
|
+
size: "sm",
|
|
319
|
+
class: "cursor-pointer mr-4",
|
|
320
|
+
onClick: (e) => {
|
|
321
|
+
e.preventDefault(), e.stopPropagation(), te(
|
|
322
|
+
l.row.original.code || l.row.original._id.toString()
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
}),
|
|
326
|
+
h(
|
|
327
|
+
"div",
|
|
328
|
+
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
329
|
+
l.row.original.code || l.row.original._id.toString()
|
|
330
|
+
)
|
|
331
|
+
]);
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
header: "User",
|
|
336
|
+
accessorKey: "user",
|
|
337
|
+
enableSorting: !1,
|
|
338
|
+
cell(l) {
|
|
339
|
+
const e = l.row.original.pf_user;
|
|
340
|
+
return h(
|
|
341
|
+
"div",
|
|
342
|
+
{
|
|
343
|
+
class: "flex items-center gap-x-8"
|
|
344
|
+
},
|
|
345
|
+
[
|
|
346
|
+
h(X.FmAvatar, {
|
|
347
|
+
name: e != null && e.photoUrl || e == null ? void 0 : e.name,
|
|
348
|
+
src: (e == null ? void 0 : e.photoUrl) ?? void 0,
|
|
349
|
+
size: "sm"
|
|
350
|
+
}),
|
|
351
|
+
h("span", e == null ? void 0 : e.name)
|
|
352
|
+
]
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
header: "Phone",
|
|
358
|
+
accessorFn: (l) => {
|
|
359
|
+
var e;
|
|
360
|
+
return ((e = l.pf_user) == null ? void 0 : e.phoneNumber) || "-";
|
|
361
|
+
},
|
|
362
|
+
accessorKey: "pf_user.phoneNumber"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
header: "Balance",
|
|
366
|
+
accessorKey: "balance"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
header: "Created at",
|
|
370
|
+
accessorKey: "_id",
|
|
371
|
+
accessorFn: (l) => E(oe(l._id.toString())).format("DD MMM YYYY")
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
header: "Nearest expired at",
|
|
375
|
+
accessorKey: "expiryBalance",
|
|
376
|
+
accessorFn: (l) => {
|
|
377
|
+
var e;
|
|
378
|
+
return l.expiryBalance && l.expiryBalance.length ? E((e = l.expiryBalance) == null ? void 0 : e[0].expiredAt).format("DD MMM YYYY") : "Never expires";
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
...f.value ? [
|
|
382
|
+
{
|
|
383
|
+
header: "Actions",
|
|
384
|
+
accessorKey: "actions",
|
|
385
|
+
enableSorting: !1,
|
|
386
|
+
meta: {
|
|
387
|
+
maxWidth: "72px"
|
|
388
|
+
},
|
|
389
|
+
cell(l) {
|
|
390
|
+
return n(l.row.original) ? h("div", { class: "flex items-center justify-center" }, [
|
|
391
|
+
h(X.FmButton, {
|
|
392
|
+
icon: "share",
|
|
393
|
+
variant: "tertiary",
|
|
394
|
+
iconColor: "neutral-gray-400",
|
|
395
|
+
onClick: async (e) => {
|
|
396
|
+
e.preventDefault(), e.stopPropagation(), await z(l.row.original);
|
|
397
|
+
}
|
|
398
|
+
})
|
|
399
|
+
]) : h(
|
|
400
|
+
"div",
|
|
401
|
+
{
|
|
402
|
+
class: "flex items-center justify-center text-fm-color-typo-disabled"
|
|
403
|
+
},
|
|
404
|
+
"-"
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
] : []
|
|
409
|
+
]), K = {
|
|
410
|
+
"$connect-STORE_REWARD_COLLECTIONS": Ce.readCollectionsByRewardId,
|
|
411
|
+
"$connect-CAMPAIGN_VOUCHER_COLLECTIONS": re.readCollectionsByCampaignId
|
|
412
|
+
}, N = (l) => {
|
|
413
|
+
const e = K[M.name];
|
|
414
|
+
return (c) => e(l, c);
|
|
415
|
+
}, { tableMeta: g, rowData: j, onSort: r, debouncedFetchData: t, onSearch: B } = ve(N(F.value));
|
|
416
|
+
async function O() {
|
|
417
|
+
var l;
|
|
418
|
+
await t(), (l = P.value) == null || l.showSheet(!1);
|
|
419
|
+
}
|
|
420
|
+
async function H() {
|
|
421
|
+
k.value || $(
|
|
422
|
+
async () => {
|
|
423
|
+
var s;
|
|
424
|
+
const l = new we(), e = N(F.value), c = (await e({
|
|
425
|
+
limit: 1,
|
|
426
|
+
skip: 0,
|
|
427
|
+
sortBy: b.sortBy,
|
|
428
|
+
descending: b.descending
|
|
429
|
+
})).meta.totalResources ?? 0, d = b.rowsPerPage;
|
|
430
|
+
for (let S = 0; S < c; S += d) {
|
|
431
|
+
const G = {
|
|
432
|
+
...b,
|
|
433
|
+
limit: d,
|
|
434
|
+
skip: b.page - 1,
|
|
435
|
+
sortBy: b.sortBy,
|
|
436
|
+
descending: b.descending
|
|
437
|
+
}, a = await e(G);
|
|
438
|
+
for await (const m of a.resources) {
|
|
439
|
+
const I = m.pf_user, se = {
|
|
440
|
+
"ID/Code": (m == null ? void 0 : m.code) || ((s = m._id) == null ? void 0 : s.toString()),
|
|
441
|
+
User: (I == null ? void 0 : I.name) || "-",
|
|
442
|
+
Phone: (I == null ? void 0 : I.phoneNumber) || "-",
|
|
443
|
+
Balance: (m == null ? void 0 : m.balance) || 0,
|
|
444
|
+
"Created at": E(
|
|
445
|
+
oe(m._id.toString())
|
|
446
|
+
).format("DD MMM YYYY"),
|
|
447
|
+
"Nearest expired at": m.expiryBalance && m.expiryBalance.length ? E(m.expiryBalance[0].expiredAt).format(
|
|
448
|
+
"DD MMM YYYY"
|
|
449
|
+
) : "Never expires",
|
|
450
|
+
Url: R(m)
|
|
451
|
+
};
|
|
452
|
+
l.addRecord(se);
|
|
453
|
+
}
|
|
454
|
+
b.page++;
|
|
455
|
+
}
|
|
456
|
+
await ge(
|
|
457
|
+
l.buildExcel(),
|
|
458
|
+
`vouchers-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
459
|
+
{
|
|
460
|
+
bookType: "xlsx",
|
|
461
|
+
bookSST: !1,
|
|
462
|
+
type: "array"
|
|
463
|
+
}
|
|
464
|
+
), b.page = 1;
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
isLoading: k
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
return de(async () => {
|
|
472
|
+
await t();
|
|
473
|
+
}), (l, e) => {
|
|
474
|
+
const c = p("FmPageHead"), d = p("FmSearch");
|
|
475
|
+
return w(), T(L, null, [
|
|
476
|
+
i(c, {
|
|
477
|
+
title: "Collections",
|
|
478
|
+
"back-button": !0,
|
|
479
|
+
actions: [
|
|
480
|
+
{ label: "Export", value: "export", isPrimary: !1 },
|
|
481
|
+
...o(f) ? [
|
|
482
|
+
{
|
|
483
|
+
label: "Create collection",
|
|
484
|
+
value: "create",
|
|
485
|
+
isPrimary: !0
|
|
486
|
+
}
|
|
487
|
+
] : []
|
|
488
|
+
],
|
|
489
|
+
"onClick:back": e[0] || (e[0] = (s) => o(v).back()),
|
|
490
|
+
"onClick:action": e[1] || (e[1] = (s) => {
|
|
491
|
+
var S;
|
|
492
|
+
s === "create" && ((S = o(P)) == null || S.showSheet(!0)), s === "export" && H();
|
|
493
|
+
})
|
|
494
|
+
}, null, 8, ["actions"]),
|
|
495
|
+
V("div", ke, [
|
|
496
|
+
i(d, {
|
|
497
|
+
class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
|
|
498
|
+
modelValue: o(g).searchValue,
|
|
499
|
+
"onUpdate:modelValue": [
|
|
500
|
+
e[2] || (e[2] = (s) => o(g).searchValue = s),
|
|
501
|
+
o(B)
|
|
502
|
+
],
|
|
503
|
+
placeholder: "Search",
|
|
504
|
+
collapsible: ""
|
|
505
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
506
|
+
V("div", Ue, [
|
|
507
|
+
i(d, {
|
|
508
|
+
modelValue: o(g).searchValue,
|
|
509
|
+
"onUpdate:modelValue": [
|
|
510
|
+
e[3] || (e[3] = (s) => o(g).searchValue = s),
|
|
511
|
+
o(B)
|
|
512
|
+
],
|
|
513
|
+
placeholder: "Search",
|
|
514
|
+
collapsible: ""
|
|
515
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
516
|
+
]),
|
|
517
|
+
i(he, {
|
|
518
|
+
loading: o(g).isLoading,
|
|
519
|
+
"row-data": o(j),
|
|
520
|
+
"column-defs": o(_),
|
|
521
|
+
"row-count": o(g).totalRows,
|
|
522
|
+
"page-count": o(g).pageCount,
|
|
523
|
+
"page-index": o(g).pageIndex,
|
|
524
|
+
"page-size": o(g).pageSize,
|
|
525
|
+
"shrink-at": !1,
|
|
526
|
+
onSortChange: o(r),
|
|
527
|
+
onPageChange: e[4] || (e[4] = (s) => o(t)({ pageSize: s.pageSize, pageIndex: s.pageIndex }))
|
|
528
|
+
}, null, 8, ["loading", "row-data", "column-defs", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
529
|
+
i(Ve, {
|
|
530
|
+
ref_key: "sheetRef",
|
|
531
|
+
ref: P,
|
|
532
|
+
onSuccess: O
|
|
533
|
+
}, null, 512)
|
|
534
|
+
])
|
|
535
|
+
], 64);
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
export {
|
|
540
|
+
je as default
|
|
541
|
+
};
|