@feedmepos/mf-connect 0.1.98-beta.39 → 0.1.98-beta.40
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/package.json +1 -1
- package/dist/App-DwjQisFZ.js +0 -4785
- package/dist/AuditLogs-DMGqmriL.js +0 -2014
- package/dist/Bin-4wvIqogM.js +0 -166
- package/dist/Broadcast-DPpuSZ8_.js +0 -269
- package/dist/CampaignAnalytic-CXFDo2X_.js +0 -1826
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-SLoy1-Kd.js +0 -122
- package/dist/Card-C8SA6un0.js +0 -911
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-BCpSiM_4.js +0 -541
- package/dist/Credit-C8RTBpP7.js +0 -286
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-0OI5QzpR.js +0 -3382
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CJTduNh3.js +0 -351
- package/dist/Experience-Bg3kFQQE.js +0 -285
- package/dist/FileSaver.min-DMUuMi9w.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
- package/dist/Game-D3DbkRUj.js +0 -356
- package/dist/GiftCardSetup-CxlMM4up.js +0 -542
- package/dist/Grab-DvEK8ixP.js +0 -301
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBK-UrEe.js +0 -145
- package/dist/Index-Do_9DXuY.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BKPGBYiU.js +0 -48
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-D6wJN9Gj.js +0 -18737
- package/dist/LoyaltyDashboard-B4WqycGN.js +0 -1345
- package/dist/MainLayout-DdxLaufS.js +0 -143
- package/dist/Marketing-CcFEMwKB.js +0 -236
- package/dist/MarketingMaterialEdit-DoYFaMf7.js +0 -1036
- package/dist/Member-BussgBln.js +0 -281
- package/dist/MemberList-BXJxSsjo.js +0 -1603
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-O-XY5nz3.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DsxrIO0r.js +0 -60957
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +0 -38
- package/dist/Mission-CPkM-8Ns.js +0 -360
- package/dist/Overview-BJjpYUJN.js +0 -1080
- package/dist/Overview-C5KF_Jxj.js +0 -1316
- package/dist/Point-FDFwR3Hk.js +0 -288
- package/dist/Promotion-qtucKxn0.js +0 -423
- package/dist/Queue-d91tocPX.js +0 -261
- package/dist/Record-CvkK2iLq.js +0 -342
- package/dist/Review-C_zLGtzU.js +0 -45
- package/dist/ReviewFacebookCallback-Bidg3P76.js +0 -238
- package/dist/ReviewGoogleCallback-DL0lxMBL.js +0 -213
- package/dist/Reward-BTsQaI-J.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BjxA4eMX.js +0 -150
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D4NIDc-C.js +0 -1913
- package/dist/Segment-BgFyB3BK.js +0 -1017
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CkhjFNvZ.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-HYbRyACe.js +0 -189
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-7dv3cAW3.js +0 -226
- package/dist/Setting-BxHoCSxw.js +0 -2047
- package/dist/SettingAdvertisements-WfvuE4fA.js +0 -264
- package/dist/Settings-B42SAvEx.js +0 -179
- package/dist/Store-BnvWfCy-.js +0 -2413
- package/dist/StoreRewards-BRzAMqR-.js +0 -540
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C3FJr1L5.js +0 -1075
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-UZYzUcif.js +0 -7007
- package/dist/Tier-BrzLNat2.js +0 -972
- package/dist/Title-EnlaNXld.js +0 -569
- package/dist/Transaction-BiXNxUGX.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Db5_DKQ0.js +0 -130
- package/dist/Voucher-C2dyk-jj.js +0 -444
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DPE24a-J.js +0 -421
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CI1HM9HA.js +0 -56
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-Bt8HrAEr.js +0 -60740
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -7
- package/dist/business-BwtQpfUr.js +0 -82
- package/dist/campaign-B6U9lwKi.js +0 -255
- package/dist/campaign-C6Cb9s3C.js +0 -100
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign.enum-Dx-Zo68Q.js +0 -26
- package/dist/campaign.fn-B0x2EGhw.js +0 -776
- package/dist/collectible.enum-Liy2wH3s.js +0 -19
- package/dist/collection.fn-DfoA9sJV.js +0 -26
- package/dist/duplicateCampaign-Cnq5N-V8.js +0 -51
- package/dist/effect-B2REbrv8.js +0 -89
- package/dist/email-addresses-BzmOsxLn.js +0 -705
- package/dist/export-jHpRhPQu.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/helper-DQAHX1kX.js +0 -86
- package/dist/index-4GG-yjdN.js +0 -2963
- package/dist/index-BWgMbKOB.js +0 -85
- package/dist/index-BccUpf0U.js +0 -3
- package/dist/index-BkgkJkVs.js +0 -8919
- package/dist/index-C0PKVTf9.js +0 -32
- package/dist/index-C8cXXcLk.js +0 -45
- package/dist/index-CTTGf4TM.js +0 -151
- package/dist/index-C_H8jFYf.js +0 -2743
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DJN4auwx.js +0 -146
- package/dist/index-DMr9ohGV.js +0 -1139
- package/dist/index-DQTo_ytu.js +0 -31
- package/dist/index-DW7-0rf_.js +0 -53
- package/dist/index-Da7J83jM.js +0 -2706
- package/dist/index-Di1Z4vLS.js +0 -27550
- package/dist/index-FoKZGh7Z.js +0 -67
- package/dist/index-N25Px7RQ.js +0 -72
- package/dist/index-PgblELTo.js +0 -897
- package/dist/index-STBMTK1u.js +0 -28900
- package/dist/index-hP3Mgc0u.js +0 -55
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-DV56jzfJ.js +0 -3069
- package/dist/loading-D__sDcq1.js +0 -72
- package/dist/lodash-DgkDIHoV.js +0 -3678
- package/dist/membership-CBjt1MGx.js +0 -255
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-BFUbPKDM.js +0 -15
- package/dist/number-CJb8OUa3.js +0 -12
- package/dist/object-BYyQ0PZp.js +0 -18
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-BMUFNR9T.js +0 -145
- package/dist/plugins-D95ZeD-9.js +0 -1788
- package/dist/remy-Qz_pNsUS.js +0 -13
- package/dist/reward-CSfV_XFK.js +0 -36
- package/dist/rule-DIzVHy2z.js +0 -1969
- package/dist/rule-builder-DF7fCvec.js +0 -126
- package/dist/string-Gcy5IM_H.js +0 -32
- package/dist/style.css +0 -4
- package/dist/template-r3lAQP1B.js +0 -188
- package/dist/tier-BJDhpH6X.js +0 -4
- 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-D40qRUoz.js +0 -20
- 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/transaction.fn-DV-cpfOj.js +0 -64
- package/dist/trigger-BEJaSv5R.js +0 -213
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/useMarketingMaterialActions-Bd5BDfE1.js +0 -96
- package/dist/usePagination-DLIo76-X.js +0 -220
- package/dist/user-DtEjuhyM.js +0 -55
- package/dist/vue-i18n-dQ1XCaUv.js +0 -2365
- package/dist/xlsx-BUMZsTov.js +0 -15491
- package/dist/zod-B_pVZhsV.js +0 -91
package/dist/app-wDQR6dpb.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ref as u, computed as a } from "vue";
|
|
2
|
-
import { defineStore as v } from "pinia";
|
|
3
|
-
const b = v("mf-connect-app", () => {
|
|
4
|
-
const e = u([]), l = u(null), t = u(null), i = u(localStorage.getItem("debugMode") === "true"), r = a(
|
|
5
|
-
() => e.value.some((o) => o.isGlobal === !0) || !1
|
|
6
|
-
), s = a(() => e.value.length > 0);
|
|
7
|
-
function c(o) {
|
|
8
|
-
e.value = [...e.value, ...o];
|
|
9
|
-
}
|
|
10
|
-
function d() {
|
|
11
|
-
e.value = [];
|
|
12
|
-
}
|
|
13
|
-
function f(o) {
|
|
14
|
-
e.value = e.value.filter(
|
|
15
|
-
(n) => !o.includes(n.id)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
function g(o, n) {
|
|
19
|
-
l.value = o, t.value = n;
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
// state
|
|
23
|
-
loadingQueue: e,
|
|
24
|
-
snackbar: l,
|
|
25
|
-
dialog: t,
|
|
26
|
-
debugMode: i,
|
|
27
|
-
// getters
|
|
28
|
-
isGlobalLoading: r,
|
|
29
|
-
isLoading: s,
|
|
30
|
-
// actions
|
|
31
|
-
addLoadingQueues: c,
|
|
32
|
-
clearLoadingQueue: d,
|
|
33
|
-
resolveQueues: f,
|
|
34
|
-
initProvider: g
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
export {
|
|
38
|
-
b as u
|
|
39
|
-
};
|
package/dist/app.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { ref as i, computed as u } from "vue";
|
|
2
|
-
import { defineStore as w } from "pinia";
|
|
3
|
-
import { useCoreStore as y } from "@feedmepos/mf-common";
|
|
4
|
-
import { a as I, g as r, A as b, S, b as D } from "./index-STBMTK1u.js";
|
|
5
|
-
const $ = {
|
|
6
|
-
async readSettings(e) {
|
|
7
|
-
try {
|
|
8
|
-
return r(await I(`marketing-v2/${e}/setting`).get(""));
|
|
9
|
-
} catch (t) {
|
|
10
|
-
if (console.error(JSON.stringify(t)), t instanceof b)
|
|
11
|
-
return {
|
|
12
|
-
_id: e,
|
|
13
|
-
business: e,
|
|
14
|
-
apiVersion: "v1"
|
|
15
|
-
};
|
|
16
|
-
throw t;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}, o = () => {
|
|
20
|
-
const e = S.getBusinessId();
|
|
21
|
-
if (!e) throw new Error("Invalid business ID");
|
|
22
|
-
return D(`businesses/${e}/location`, {
|
|
23
|
-
noIdRequired: !0
|
|
24
|
-
});
|
|
25
|
-
}, l = {
|
|
26
|
-
async read() {
|
|
27
|
-
return r(await o().get(""));
|
|
28
|
-
},
|
|
29
|
-
async readDevices() {
|
|
30
|
-
return r(await o().get("devices"));
|
|
31
|
-
},
|
|
32
|
-
async unregisterDevice(e) {
|
|
33
|
-
await r(await o().delete(`devices/${e}`));
|
|
34
|
-
},
|
|
35
|
-
async getOtp(e) {
|
|
36
|
-
return r(await o().post(`${e}/otp`));
|
|
37
|
-
}
|
|
38
|
-
}, h = w("mf-connect-business", () => {
|
|
39
|
-
const e = i("v2"), t = i(!1), a = i([]), c = i([]);
|
|
40
|
-
async function v() {
|
|
41
|
-
const n = y().currentBusiness.value, s = await $.readSettings(n == null ? void 0 : n.id);
|
|
42
|
-
return t.value = s && "business" in s && s.premium == !0 || !1, e.value = (s == null ? void 0 : s.apiVersion) || "v1", t.value;
|
|
43
|
-
}
|
|
44
|
-
async function d() {
|
|
45
|
-
return a.value = await l.read(), a.value;
|
|
46
|
-
}
|
|
47
|
-
async function p() {
|
|
48
|
-
return c.value = await l.readDevices(), c.value;
|
|
49
|
-
}
|
|
50
|
-
function m(n) {
|
|
51
|
-
return a.value.find((s) => s._id === n);
|
|
52
|
-
}
|
|
53
|
-
const f = u(() => [
|
|
54
|
-
{ label: "All", value: null },
|
|
55
|
-
...a.value.map((n) => ({
|
|
56
|
-
label: n.name,
|
|
57
|
-
value: n._id
|
|
58
|
-
}))
|
|
59
|
-
]), g = u(() => a.value.map((n) => ({
|
|
60
|
-
label: `${n.code ? `${n.code} - ` : ""} ${n.name}`,
|
|
61
|
-
value: n._id
|
|
62
|
-
})));
|
|
63
|
-
return {
|
|
64
|
-
// state
|
|
65
|
-
version: e,
|
|
66
|
-
isPremium: t,
|
|
67
|
-
locations: a,
|
|
68
|
-
locationDevices: c,
|
|
69
|
-
// actions
|
|
70
|
-
readPremium: v,
|
|
71
|
-
readLocations: d,
|
|
72
|
-
readLocationDevices: p,
|
|
73
|
-
locationById: m,
|
|
74
|
-
// getters
|
|
75
|
-
locationItems: f,
|
|
76
|
-
locationOptions: g
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
export {
|
|
80
|
-
l,
|
|
81
|
-
h as u
|
|
82
|
-
};
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { h as i } from "./moment-D7p2TMB-.js";
|
|
2
|
-
import "./index-PgblELTo.js";
|
|
3
|
-
import { e as p } from "./effect-B2REbrv8.js";
|
|
4
|
-
import { components as f } from "@feedmepos/ui-library";
|
|
5
|
-
import { i as y } from "./rule-builder-DF7fCvec.js";
|
|
6
|
-
import { c as h } from "./rule-DIzVHy2z.js";
|
|
7
|
-
import { u as O } from "./business-BwtQpfUr.js";
|
|
8
|
-
import { C as m } from "./campaign.fn-B0x2EGhw.js";
|
|
9
|
-
import { c as g } from "./string-Gcy5IM_H.js";
|
|
10
|
-
import { i as d } from "./plugins-D95ZeD-9.js";
|
|
11
|
-
import { h as s } from "vue";
|
|
12
|
-
import { F as a } from "./campaign.enum-Dx-Zo68Q.js";
|
|
13
|
-
const n = d.global.t;
|
|
14
|
-
function C() {
|
|
15
|
-
const e = d.global.locale;
|
|
16
|
-
return typeof e == "string" ? e : e.value;
|
|
17
|
-
}
|
|
18
|
-
function u(e) {
|
|
19
|
-
return new Intl.DateTimeFormat(C(), {
|
|
20
|
-
day: "2-digit",
|
|
21
|
-
month: "short",
|
|
22
|
-
year: "numeric"
|
|
23
|
-
}).format(new Date(e));
|
|
24
|
-
}
|
|
25
|
-
function c(e) {
|
|
26
|
-
return s(
|
|
27
|
-
"div",
|
|
28
|
-
{
|
|
29
|
-
class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
|
|
30
|
-
},
|
|
31
|
-
[
|
|
32
|
-
s(f.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
|
|
33
|
-
s("span", { class: "fm-typo-en-body-md-600" }, e.name)
|
|
34
|
-
]
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
const P = {
|
|
38
|
-
[a.enum.CREDIT]: {
|
|
39
|
-
chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
|
|
40
|
-
icon: "local_activity",
|
|
41
|
-
get name() {
|
|
42
|
-
return n("connect.campaign.common.typeName.CREDIT");
|
|
43
|
-
},
|
|
44
|
-
chip() {
|
|
45
|
-
return c(this);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
[a.enum.PROMOTION]: {
|
|
49
|
-
chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
|
|
50
|
-
icon: "loyalty",
|
|
51
|
-
get name() {
|
|
52
|
-
return n("connect.campaign.common.typeName.PROMOTION");
|
|
53
|
-
},
|
|
54
|
-
chip() {
|
|
55
|
-
return c(this);
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
[a.enum.VOUCHER]: {
|
|
59
|
-
chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
|
|
60
|
-
icon: "sell",
|
|
61
|
-
get name() {
|
|
62
|
-
return n("connect.campaign.common.typeName.VOUCHER");
|
|
63
|
-
},
|
|
64
|
-
chip() {
|
|
65
|
-
return c(this);
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
[a.enum.POINT]: {
|
|
69
|
-
chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
|
|
70
|
-
icon: "award_star",
|
|
71
|
-
get name() {
|
|
72
|
-
return n("connect.campaign.common.typeName.POINT");
|
|
73
|
-
},
|
|
74
|
-
chip() {
|
|
75
|
-
return c(this);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
[a.enum.BROADCAST]: {
|
|
79
|
-
chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
80
|
-
icon: "campaign",
|
|
81
|
-
get name() {
|
|
82
|
-
return n("connect.campaign.common.typeName.BROADCAST");
|
|
83
|
-
},
|
|
84
|
-
chip() {
|
|
85
|
-
return c(this);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
[a.enum.GAME]: {
|
|
89
|
-
chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
|
|
90
|
-
icon: "database",
|
|
91
|
-
get name() {
|
|
92
|
-
return n("connect.campaign.common.typeName.GAME");
|
|
93
|
-
},
|
|
94
|
-
chip() {
|
|
95
|
-
return c(this);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
[a.enum.REWARD_POOL]: {
|
|
99
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
100
|
-
icon: "editor_choice",
|
|
101
|
-
get name() {
|
|
102
|
-
return n("connect.campaign.common.typeName.REWARD_POOL");
|
|
103
|
-
},
|
|
104
|
-
chip() {
|
|
105
|
-
return c(this);
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
[a.enum.COIN]: {
|
|
109
|
-
chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
|
|
110
|
-
icon: "monetization_on",
|
|
111
|
-
get name() {
|
|
112
|
-
return n("connect.campaign.common.typeName.COIN");
|
|
113
|
-
},
|
|
114
|
-
chip() {
|
|
115
|
-
return c(this);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
[a.enum.MEMBERSHIP]: {
|
|
119
|
-
chipClass: "",
|
|
120
|
-
icon: "",
|
|
121
|
-
get name() {
|
|
122
|
-
return n("connect.campaign.common.typeName.MEMBERSHIP");
|
|
123
|
-
},
|
|
124
|
-
chip() {
|
|
125
|
-
return c(this);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
[a.enum.MISSION]: {
|
|
129
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
130
|
-
icon: "editor_choice",
|
|
131
|
-
get name() {
|
|
132
|
-
return n("connect.campaign.common.typeName.MISSION");
|
|
133
|
-
},
|
|
134
|
-
chip() {
|
|
135
|
-
return c(this);
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
[a.enum.GRAB]: {
|
|
139
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
140
|
-
icon: "editor_choice",
|
|
141
|
-
name: "Grab",
|
|
142
|
-
chip() {
|
|
143
|
-
return c(this);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
function L(e) {
|
|
148
|
-
const t = b(e), o = {
|
|
149
|
-
active: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
150
|
-
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
151
|
-
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
152
|
-
};
|
|
153
|
-
return e.type == "VOUCHER" ? s(f.FmChip, {
|
|
154
|
-
class: o[t],
|
|
155
|
-
label: g.title(n(`connect.campaign.common.status.${t}`)),
|
|
156
|
-
compact: !0
|
|
157
|
-
}) : s(f.FmChip, {
|
|
158
|
-
class: o[t],
|
|
159
|
-
label: g.title(n(`connect.campaign.common.status.${t}`)),
|
|
160
|
-
compact: !0
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
function w(e) {
|
|
164
|
-
const t = e.timeframeOptions;
|
|
165
|
-
if (!t || !t.start && !t.end)
|
|
166
|
-
return n("connect.campaign.common.always_active");
|
|
167
|
-
if (!t.start && t.end)
|
|
168
|
-
return n("connect.campaign.common.valid_until", {
|
|
169
|
-
date: u(t.end)
|
|
170
|
-
});
|
|
171
|
-
const o = u(t.start), r = t.end ? u(t.end) : n("connect.campaign.common.unlimited");
|
|
172
|
-
return `${o} -> ${r}`;
|
|
173
|
-
}
|
|
174
|
-
function E(e) {
|
|
175
|
-
if (!e || !e.start && !e.end)
|
|
176
|
-
return "connect.campaign.common.always";
|
|
177
|
-
const t = e.start ? i(e.start).format("DD MMM YYYY") : "From campaign creation", o = e.end ? i(e.end).format("DD MMM YYYY") : "Never ends";
|
|
178
|
-
return `${t} - ${o}`;
|
|
179
|
-
}
|
|
180
|
-
function Y(e) {
|
|
181
|
-
const { campaign: t } = e;
|
|
182
|
-
return {
|
|
183
|
-
"connect.campaign.common.campaign_name": t.name,
|
|
184
|
-
"connect.campaign.common.campaign_period": E(
|
|
185
|
-
t.timeframeOptions
|
|
186
|
-
),
|
|
187
|
-
get "connect.campaign.common.next_schedule_at"() {
|
|
188
|
-
if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !y(t.event.rule))
|
|
189
|
-
return;
|
|
190
|
-
const o = h(
|
|
191
|
-
t.event.rule.rules.g_schedule
|
|
192
|
-
);
|
|
193
|
-
return o ? i(o).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
|
|
194
|
-
},
|
|
195
|
-
get "connect.campaign.common.discount_type"() {
|
|
196
|
-
if (t.type == "PROMOTION") return p(t.effect);
|
|
197
|
-
if ("configs" in e && e.configs.type == "VOUCHER")
|
|
198
|
-
return p(e.configs.extras.effect);
|
|
199
|
-
},
|
|
200
|
-
get "connect.campaign.common.available_at"() {
|
|
201
|
-
return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
|
|
202
|
-
(o) => O().locationItems.find((r) => r.value == o).label
|
|
203
|
-
).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
function b(e) {
|
|
208
|
-
return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? i().isBetween(
|
|
209
|
-
e.timeframeOptions.start ?? i().subtract(1, "d"),
|
|
210
|
-
e.timeframeOptions.end ?? i().add(1, "d")
|
|
211
|
-
) ? "active" : i().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
|
|
212
|
-
}
|
|
213
|
-
function B(e) {
|
|
214
|
-
var t, o;
|
|
215
|
-
switch (e.event.type) {
|
|
216
|
-
case "BILL_COMPLETED":
|
|
217
|
-
const r = `Spend to get ${m.formattedType(e.type)}`;
|
|
218
|
-
switch (e.type) {
|
|
219
|
-
case "POINT":
|
|
220
|
-
case "CREDIT":
|
|
221
|
-
case "COIN":
|
|
222
|
-
return e.earningOption.type == "FIXED" ? `Spend to get ${e.earningOption.amount} ${m.formattedType(e.type)}` : `Every ${e.earningOption.every} amount spent get ${e.earningOption.amount} ${m.formattedType(e.type)}`;
|
|
223
|
-
case "VOUCHER":
|
|
224
|
-
const l = (o = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : o.effect;
|
|
225
|
-
return l ? `${r} - ${p(l)}` : r;
|
|
226
|
-
default:
|
|
227
|
-
return r;
|
|
228
|
-
}
|
|
229
|
-
case "FEEDBACK":
|
|
230
|
-
return `Give feedback to receive ${m.formattedType(e.type)}`;
|
|
231
|
-
case "SCHEDULE":
|
|
232
|
-
return `Receive ${m.formattedType(e.type)} on scheduled time`;
|
|
233
|
-
case "SIMPLE_CLAIM":
|
|
234
|
-
return "Simple claim voucher";
|
|
235
|
-
case "TIER_UPGRADED":
|
|
236
|
-
return `Receive ${m.formattedType(e.type)} when member tier upgraded`;
|
|
237
|
-
case "MEMBERSHIP_JOINED":
|
|
238
|
-
return `Receive ${m.formattedType(e.type)} when member joined`;
|
|
239
|
-
case "MAKING_ORDER":
|
|
240
|
-
return e.type !== "PROMOTION" ? void 0 : p(e.effect);
|
|
241
|
-
default:
|
|
242
|
-
throw new Error(
|
|
243
|
-
`Not implemented ${JSON.stringify({ cause: e.event.type })}`
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
export {
|
|
248
|
-
P as C,
|
|
249
|
-
b as a,
|
|
250
|
-
L as b,
|
|
251
|
-
B as c,
|
|
252
|
-
Y as d,
|
|
253
|
-
w as g,
|
|
254
|
-
E as s
|
|
255
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { defineStore as d } from "pinia";
|
|
2
|
-
import { reactive as b, onMounted as f, ref as s } from "vue";
|
|
3
|
-
import { c } from "./index-DJN4auwx.js";
|
|
4
|
-
import { g as i, S as g, b as h } from "./index-STBMTK1u.js";
|
|
5
|
-
const p = () => {
|
|
6
|
-
const e = g.getBusinessId();
|
|
7
|
-
if (!e) throw new Error("Invalid business ID");
|
|
8
|
-
return h(`businesses/${e}/campaigns`, {
|
|
9
|
-
noIdRequired: !0
|
|
10
|
-
});
|
|
11
|
-
}, I = {
|
|
12
|
-
async readAll() {
|
|
13
|
-
return i(await p().get("templates"));
|
|
14
|
-
},
|
|
15
|
-
async readById(e) {
|
|
16
|
-
return i(
|
|
17
|
-
await p().get(`templates/${e}`)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}, A = d("mf-connect-campaign", () => {
|
|
21
|
-
const e = b({
|
|
22
|
-
promotion: [],
|
|
23
|
-
voucher: [],
|
|
24
|
-
broadcast: [],
|
|
25
|
-
experience: [],
|
|
26
|
-
point: [],
|
|
27
|
-
credit: [],
|
|
28
|
-
token: [],
|
|
29
|
-
mission: [],
|
|
30
|
-
grab: [],
|
|
31
|
-
all: []
|
|
32
|
-
});
|
|
33
|
-
f(() => {
|
|
34
|
-
console.log("🔧 CampaignStore Installed");
|
|
35
|
-
});
|
|
36
|
-
const t = s([]), r = s([]), n = s([]);
|
|
37
|
-
async function u(k) {
|
|
38
|
-
const o = await c.readAll({
|
|
39
|
-
limit: 1e3,
|
|
40
|
-
skip: 0,
|
|
41
|
-
sortBy: "_id",
|
|
42
|
-
descending: !0
|
|
43
|
-
});
|
|
44
|
-
Object.keys(e).forEach((a) => {
|
|
45
|
-
e[a] = [];
|
|
46
|
-
}), e.all = o.resources.filter(
|
|
47
|
-
(a) => a.type !== "MEMBERSHIP"
|
|
48
|
-
);
|
|
49
|
-
for (const a of o.resources)
|
|
50
|
-
switch (a.type) {
|
|
51
|
-
case "PROMOTION":
|
|
52
|
-
e.promotion.push(a);
|
|
53
|
-
break;
|
|
54
|
-
case "VOUCHER":
|
|
55
|
-
e.voucher.push(a), n.value.push(a);
|
|
56
|
-
break;
|
|
57
|
-
case "BROADCAST":
|
|
58
|
-
["SCHEDULE", "FEEDBACK"].includes(a.event.type) && e.broadcast.push(a);
|
|
59
|
-
break;
|
|
60
|
-
case "POINT":
|
|
61
|
-
e.experience.push(a);
|
|
62
|
-
break;
|
|
63
|
-
case "COIN":
|
|
64
|
-
e.point.push(a);
|
|
65
|
-
break;
|
|
66
|
-
case "CREDIT":
|
|
67
|
-
e.credit.push(a);
|
|
68
|
-
break;
|
|
69
|
-
case "GAME":
|
|
70
|
-
e.token.push(a);
|
|
71
|
-
break;
|
|
72
|
-
case "MISSION":
|
|
73
|
-
e.mission.push(a);
|
|
74
|
-
break;
|
|
75
|
-
case "GRAB":
|
|
76
|
-
e.grab.push(a);
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
async function l() {
|
|
81
|
-
r.value = await c.readGroups();
|
|
82
|
-
}
|
|
83
|
-
async function m() {
|
|
84
|
-
t.value = await I.readAll();
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
// State
|
|
88
|
-
campaigns: e,
|
|
89
|
-
templates: t,
|
|
90
|
-
groups: r,
|
|
91
|
-
voucher: n,
|
|
92
|
-
// Actions
|
|
93
|
-
read: u,
|
|
94
|
-
readGroups: l,
|
|
95
|
-
readTemplates: m
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
export {
|
|
99
|
-
A as u
|
|
100
|
-
};
|