@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.1-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-C2etD-eu.js +620 -0
- package/dist/{App-DQUbRsdA.js → App-DlRvkDpN.js} +58 -59
- package/dist/Broadcast-DpCGUS6r.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-BFllvG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cj4IcH5D.js} +20 -20
- package/dist/Card-DjGC6jmq.js +823 -0
- package/dist/Collections-Q2pYWnJF.js +440 -0
- package/dist/Credit-DOIq2VYW.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D7ML8ePp.js} +1010 -1026
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CyxWG5I7.js +344 -0
- package/dist/Experience-DUst4I0H.js +211 -0
- package/dist/Game-CXnQR-wV.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-CZfHsMFC.js +309 -0
- package/dist/Member-CX5Ohgeg.js +92 -0
- package/dist/MemberList-D8I3SaAs.js +1040 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-zSxSnUkK.js → MemberTransactions-DfZNbCHD.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BxFVEoBX.js +203 -0
- package/dist/Mission-S1pwDbqp.js +248 -0
- package/dist/Point-BdLUcGZy.js +220 -0
- package/dist/Promotion-DWAeQGkU.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTKKhH-r.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dux_NMO5.js} +577 -568
- package/dist/Segment-CXSE8Bzf.js +560 -0
- package/dist/Setting-CLuXuEId.js +1870 -0
- package/dist/Store-Be3cui0S.js +1533 -0
- package/dist/StoreRewards-zFy_w8p4.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-2Jqj_rKv.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DxGJKgbc.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BkdSj0cX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dreo45H1.js} +1 -1
- package/dist/{Tier-Cpl0FV8L.js → Tier-ChzcISYF.js} +453 -481
- package/dist/{Title-CbMDd1Et.js → Title-DQSjhBkT.js} +295 -314
- package/dist/Transaction-CeWmWpN_.js +36 -0
- package/dist/Voucher-BkLIxiZN.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-CLNirPsB.js +2974 -0
- package/dist/{app-VxaUCtgl.js → app-DuNsy0aC.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-DR7jpnLz.js → business-COGiTmLD.js} +1 -1
- package/dist/{campaign-MqcTb329.js → campaign-BHZMjQi5.js} +3 -5
- package/dist/{collection.fn-CvEoe61K.js → collection.fn-sAxtYO_r.js} +2 -2
- package/dist/dto-ndeeV_nc.js +1145 -0
- package/dist/{effect-BjjQeiQg.js → effect-BQt0rkdT.js} +9 -9
- package/dist/email-addresses-B3PazwKs.js +705 -0
- package/dist/{export-B8cvWh5n.js → export-D6r-xNji.js} +3 -3
- package/dist/{helper-DfgVNY7B.js → helper-CrjQw_Et.js} +1 -1
- package/dist/{index-CWR3qYjb.js → index-Btlj28Vg.js} +1 -1
- package/dist/{index-C7zMfUgy.js → index-Buy-yvAZ.js} +319 -304
- package/dist/{index-0UYoh1-7.js → index-C3AAy__p.js} +1 -1
- package/dist/index-CHAaFSD2.js +11 -0
- package/dist/{index-Dap5R3vr.js → index-Cg3RFxc9.js} +91 -102
- package/dist/{index-2P9w5u3m.js → index-CqpEhMr6.js} +4 -4
- package/dist/{index-BsfWRB8R.js → index-CvHj-wYi.js} +1 -1
- package/dist/index-DGLmbBnE.js +28997 -0
- package/dist/{index-CJ8Uh2Ja.js → index-DXpd07G3.js} +3 -3
- package/dist/{index-B5NufbUt.js → index-Daax_BQa.js} +1 -1
- package/dist/{index-C2JNcGc-.js → index-DrLEuIe1.js} +281 -299
- package/dist/{index-DBy30v8N.js → index-tSEYvA-2.js} +3 -3
- package/dist/{index.esm2017-D1X3PgpO.js → index.esm2017-a5BlZ76G.js} +55 -55
- package/dist/{loading-CJ3nOovJ.js → loading-B3XGyQ8W.js} +460 -469
- package/dist/{membership-B1cmSRyk.js → membership-GIOJ1ptN.js} +3 -3
- package/dist/money-z7VwzhZP.js +15 -0
- package/dist/number-DHYb2ua_.js +12 -0
- package/dist/{rule-builder-CSmOONdb.js → rule-builder-CcsWd5r9.js} +1 -1
- package/dist/{rule-ChWyR-0j.js → rule-iIEblTE4.js} +179 -177
- package/dist/style.css +1 -1
- package/dist/{template-Cug7aRK0.js → template-DMRMDZOW.js} +63 -63
- package/dist/{xlsx-CfgPFFvp.js → usePagination-CNFe0T2B.js} +3176 -2955
- package/package.json +5 -8
- package/dist/Analytic-CMXUjK_F.js +0 -622
- package/dist/Broadcast-DowFtHv6.js +0 -223
- package/dist/Card-C7rhL0pV.js +0 -825
- package/dist/Collections-B-1wlk3r.js +0 -453
- package/dist/Credit-DDjozmoF.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-pwMuIgs5.js +0 -345
- package/dist/Experience-BbE-c1Op.js +0 -221
- package/dist/Game-DQdRpaN-.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-Dgmxzg4h.js +0 -316
- package/dist/Member-w23oRVwN.js +0 -69
- package/dist/MemberList-BLIdjznQ.js +0 -1735
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dy_lMdZA.js +0 -432
- package/dist/Mission-Cjt0E083.js +0 -261
- package/dist/Point-CQJL3Ewu.js +0 -222
- package/dist/Promotion-BYViH3bu.js +0 -247
- package/dist/Segment-B9Jj1ak0.js +0 -437
- package/dist/Setting-DXWbgRxs.js +0 -1901
- package/dist/Store-Dswk2e_z.js +0 -1511
- package/dist/StoreRewards-CNUhG_Ue.js +0 -401
- package/dist/Transaction-BB-kk-84.js +0 -39
- package/dist/Voucher-b1_Jlm6X.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js +0 -56
- package/dist/app-DCHKJoql.js +0 -5639
- package/dist/dto-jcK3TGB7.js +0 -2770
- package/dist/index-Cv7pLAYq.js +0 -3
- package/dist/index-LrSSauN2.js +0 -29193
- package/dist/money-BEATdGS6.js +0 -15
- package/dist/number-CeAYAKCp.js +0 -12
- package/dist/usePagination-BeF5K3M7.js +0 -223
- package/dist/vue-i18n-BRhKDHdF.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { z } from "./app-
|
|
4
|
-
import { Z as ZodHelper } from "./
|
|
5
|
-
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-
|
|
6
|
-
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-
|
|
7
|
-
import { u as useBusinessStore } from "./business-
|
|
8
|
-
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-
|
|
9
|
-
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
3
|
+
import { z } from "./app-CLNirPsB.js";
|
|
4
|
+
import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
5
|
+
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-ndeeV_nc.js";
|
|
6
|
+
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-GIOJ1ptN.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-COGiTmLD.js";
|
|
8
|
+
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-Buy-yvAZ.js";
|
|
9
|
+
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-CcsWd5r9.js";
|
|
10
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
11
11
|
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
12
|
-
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-
|
|
13
|
-
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
15
|
-
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-
|
|
18
|
-
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { c as
|
|
22
|
-
import
|
|
23
|
-
import "./index-
|
|
24
|
-
import "./index-
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-B5NufbUt.js";
|
|
12
|
+
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-Cg3RFxc9.js";
|
|
13
|
+
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
14
|
+
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-CyxWG5I7.js";
|
|
15
|
+
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Dreo45H1.js";
|
|
16
|
+
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dux_NMO5.js";
|
|
17
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-B3XGyQ8W.js";
|
|
18
|
+
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-DrLEuIe1.js";
|
|
19
|
+
import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-BxFVEoBX.js";
|
|
20
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-iIEblTE4.js";
|
|
21
|
+
import { c as core, S as SvcConfig } from "./index-DGLmbBnE.js";
|
|
22
|
+
import "./index-DXpd07G3.js";
|
|
23
|
+
import "./index-tSEYvA-2.js";
|
|
24
|
+
import "./index-CqpEhMr6.js";
|
|
25
|
+
import "./index-Daax_BQa.js";
|
|
27
26
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { C as CollectionUtils } from "./collection.fn-CvEoe61K.js";
|
|
27
|
+
import { i as initCollectibleConfig } from "./helper-CrjQw_Et.js";
|
|
28
|
+
import { C as CollectionUtils } from "./collection.fn-sAxtYO_r.js";
|
|
31
29
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
32
30
|
import { useDialog } from "@feedmepos/ui-library";
|
|
33
|
-
import { u as useCampaignStore } from "./campaign-
|
|
31
|
+
import { u as useCampaignStore } from "./campaign-BHZMjQi5.js";
|
|
34
32
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
35
33
|
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
36
34
|
__name: "SegmentConfigurator",
|
|
@@ -41,27 +39,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
41
39
|
}
|
|
42
40
|
},
|
|
43
41
|
emits: ["update:model-value"],
|
|
44
|
-
setup(e, { emit:
|
|
45
|
-
const
|
|
46
|
-
var
|
|
47
|
-
const [
|
|
48
|
-
return (
|
|
49
|
-
}),
|
|
50
|
-
return (
|
|
42
|
+
setup(e, { emit: i }) {
|
|
43
|
+
const n = e, r = computed(() => {
|
|
44
|
+
var t;
|
|
45
|
+
const [s] = isRuleGroup(n.modelValue) ? Object.values(((t = n.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
|
|
46
|
+
return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
47
|
+
}), o = i;
|
|
48
|
+
return (s, l) => (openBlock(), createBlock(_sfc_main$q, {
|
|
51
49
|
multiselect: !0,
|
|
52
50
|
items: unref(useMembershipStore)().segmentOptions,
|
|
53
|
-
"model-value": unref(
|
|
54
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
51
|
+
"model-value": unref(r),
|
|
52
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => o(
|
|
55
53
|
"update:model-value",
|
|
56
54
|
unref(RuleBuilder).setRuleToGroup(
|
|
57
55
|
unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
58
|
-
unref(RuleBuilder).constructEntry("user.segment", "_hasAny",
|
|
56
|
+
unref(RuleBuilder).constructEntry("user.segment", "_hasAny", t)
|
|
59
57
|
)
|
|
60
58
|
)),
|
|
61
59
|
label: "Select segment(s) to match"
|
|
62
60
|
}, null, 8, ["items", "model-value"]));
|
|
63
61
|
}
|
|
64
|
-
}), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$
|
|
62
|
+
}), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$h = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
65
63
|
__name: "UserRuleGroup",
|
|
66
64
|
props: {
|
|
67
65
|
modelValue: {
|
|
@@ -71,78 +69,75 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
71
69
|
}
|
|
72
70
|
},
|
|
73
71
|
emits: ["update:model-value"],
|
|
74
|
-
setup(e, { emit:
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
),
|
|
72
|
+
setup(e, { emit: i }) {
|
|
73
|
+
const n = e, r = i, o = ref(
|
|
74
|
+
n.modelValue ? RuleBuilder.getRules(n.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(n.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
75
|
+
), s = [
|
|
78
76
|
{
|
|
79
77
|
value: "all_users",
|
|
80
|
-
label:
|
|
78
|
+
label: "All audience"
|
|
81
79
|
},
|
|
82
80
|
{
|
|
83
81
|
value: "segment",
|
|
84
|
-
label:
|
|
82
|
+
label: "Member segment"
|
|
85
83
|
},
|
|
86
84
|
{
|
|
87
85
|
value: "custom",
|
|
88
|
-
label:
|
|
86
|
+
label: "Custom audience"
|
|
89
87
|
}
|
|
90
88
|
];
|
|
91
|
-
return watch(
|
|
92
|
-
var
|
|
93
|
-
if (
|
|
94
|
-
(
|
|
89
|
+
return watch(o, async (l, t) => {
|
|
90
|
+
var a;
|
|
91
|
+
if (t != "all_users" && t != l && RuleBuilder.getRules(
|
|
92
|
+
(a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
95
93
|
).length > 0) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
s("connect.common.confirm"),
|
|
99
|
-
s("connect.common.confirm"),
|
|
100
|
-
s("connect.common.cancel")
|
|
94
|
+
const c = await prompt.confirm(
|
|
95
|
+
"Are you sure you want to change the audience type? This will remove all the rules you have set."
|
|
101
96
|
);
|
|
102
|
-
|
|
97
|
+
c && r(
|
|
103
98
|
"update:model-value",
|
|
104
99
|
RuleBuilder.setRuleToGroup(
|
|
105
|
-
|
|
106
|
-
RuleBuilder.scaffoldGroup(
|
|
100
|
+
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
101
|
+
RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
107
102
|
)
|
|
108
|
-
),
|
|
103
|
+
), o.value = c ? l : t;
|
|
109
104
|
}
|
|
110
|
-
}), (
|
|
111
|
-
var
|
|
112
|
-
const
|
|
105
|
+
}), (l, t) => {
|
|
106
|
+
var c, v;
|
|
107
|
+
const a = resolveComponent("FmRadio");
|
|
113
108
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
114
109
|
createElementVNode("div", null, [
|
|
115
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(
|
|
116
|
-
key:
|
|
117
|
-
value:
|
|
118
|
-
label:
|
|
119
|
-
modelValue: unref(
|
|
120
|
-
"onUpdate:modelValue":
|
|
110
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(s, (m) => createVNode(a, {
|
|
111
|
+
key: m.value,
|
|
112
|
+
value: m.value,
|
|
113
|
+
label: m.label,
|
|
114
|
+
modelValue: unref(o),
|
|
115
|
+
"onUpdate:modelValue": t[0] || (t[0] = (g) => isRef(o) ? o.value = g : null)
|
|
121
116
|
}, null, 8, ["value", "label", "modelValue"])), 64))
|
|
122
117
|
]),
|
|
123
|
-
unref(
|
|
118
|
+
unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
124
119
|
createVNode(_sfc_main$p, {
|
|
125
|
-
modelValue: ((
|
|
126
|
-
"onUpdate:modelValue":
|
|
120
|
+
modelValue: ((c = e.modelValue) == null ? void 0 : c.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
121
|
+
"onUpdate:modelValue": t[1] || (t[1] = (m) => r(
|
|
127
122
|
"update:model-value",
|
|
128
123
|
unref(RuleBuilder).setRuleToGroup(
|
|
129
124
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
130
|
-
|
|
125
|
+
m,
|
|
131
126
|
"&&"
|
|
132
127
|
)
|
|
133
128
|
))
|
|
134
129
|
}, null, 8, ["modelValue"])
|
|
135
130
|
])) : createCommentVNode("", !0),
|
|
136
|
-
unref(
|
|
131
|
+
unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
137
132
|
key: 1,
|
|
138
133
|
"include-only": "user",
|
|
139
134
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
140
|
-
"model-value": ((
|
|
141
|
-
"onUpdate:modelValue":
|
|
135
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
|
|
136
|
+
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
142
137
|
"update:model-value",
|
|
143
138
|
unref(RuleBuilder).setRuleToGroup(
|
|
144
139
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
145
|
-
|
|
140
|
+
m,
|
|
146
141
|
"&&"
|
|
147
142
|
)
|
|
148
143
|
))
|
|
@@ -160,83 +155,77 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
160
155
|
}
|
|
161
156
|
},
|
|
162
157
|
emits: ["update:model-value"],
|
|
163
|
-
setup(e, { emit:
|
|
164
|
-
const
|
|
165
|
-
!
|
|
158
|
+
setup(e, { emit: i }) {
|
|
159
|
+
const n = e, r = i, o = ref(
|
|
160
|
+
!n.modelValue || !n.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(n.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
166
161
|
);
|
|
167
|
-
watch(
|
|
168
|
-
var
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
s("connect.common.confirm"),
|
|
173
|
-
s("connect.common.confirm"),
|
|
174
|
-
s("connect.common.cancel")
|
|
162
|
+
watch(o, async (l, t) => {
|
|
163
|
+
var a;
|
|
164
|
+
if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
165
|
+
const c = await prompt.confirm(
|
|
166
|
+
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
175
167
|
);
|
|
176
|
-
|
|
168
|
+
c && r(
|
|
177
169
|
"update:model-value",
|
|
178
170
|
RuleBuilder.setRuleToGroup(
|
|
179
|
-
|
|
171
|
+
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
180
172
|
RuleBuilder.scaffoldGroup("g_time")
|
|
181
173
|
)
|
|
182
|
-
),
|
|
174
|
+
), o.value = c ? l : t;
|
|
183
175
|
}
|
|
184
176
|
});
|
|
185
|
-
async function l
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
177
|
+
async function s(l) {
|
|
178
|
+
var t;
|
|
179
|
+
if (l == "custom" && RuleBuilder.getRules((t = n.modelValue) == null ? void 0 : t.rules.g_time).length > 0) {
|
|
188
180
|
if (!await prompt.confirm(
|
|
189
|
-
|
|
190
|
-
s("connect.common.confirm"),
|
|
191
|
-
s("connect.common.confirm"),
|
|
192
|
-
s("connect.common.cancel")
|
|
181
|
+
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
193
182
|
)) {
|
|
194
|
-
|
|
183
|
+
o.value = "all_time";
|
|
195
184
|
return;
|
|
196
185
|
}
|
|
197
|
-
|
|
186
|
+
r(
|
|
198
187
|
"update:model-value",
|
|
199
188
|
RuleBuilder.setRuleToGroup(
|
|
200
|
-
|
|
189
|
+
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
201
190
|
RuleBuilder.scaffoldGroup("g_time")
|
|
202
191
|
)
|
|
203
192
|
);
|
|
204
193
|
}
|
|
205
194
|
}
|
|
206
|
-
return (
|
|
207
|
-
var
|
|
208
|
-
const
|
|
195
|
+
return (l, t) => {
|
|
196
|
+
var v;
|
|
197
|
+
const a = resolveComponent("FmRadio"), c = resolveComponent("FmRadioGroup");
|
|
209
198
|
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
210
|
-
createVNode(
|
|
211
|
-
modelValue: unref(
|
|
199
|
+
createVNode(c, {
|
|
200
|
+
modelValue: unref(o),
|
|
212
201
|
"onUpdate:modelValue": [
|
|
213
|
-
|
|
214
|
-
|
|
202
|
+
t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
|
|
203
|
+
t[1] || (t[1] = (m) => s(m))
|
|
215
204
|
]
|
|
216
205
|
}, {
|
|
217
206
|
default: withCtx(() => [
|
|
218
|
-
createVNode(
|
|
219
|
-
label:
|
|
207
|
+
createVNode(a, {
|
|
208
|
+
label: "All time",
|
|
220
209
|
value: "all_time"
|
|
221
|
-
}
|
|
222
|
-
createVNode(
|
|
223
|
-
label:
|
|
210
|
+
}),
|
|
211
|
+
createVNode(a, {
|
|
212
|
+
label: "Custom date/time",
|
|
224
213
|
value: "custom"
|
|
225
|
-
}
|
|
214
|
+
})
|
|
226
215
|
]),
|
|
227
216
|
_: 1
|
|
228
217
|
}, 8, ["modelValue"]),
|
|
229
|
-
unref(
|
|
218
|
+
unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
230
219
|
key: 0,
|
|
231
220
|
class: "!mt-[0px]",
|
|
232
221
|
"include-only": "trigger",
|
|
233
222
|
"trigger-type": "SCHEDULE",
|
|
234
|
-
"model-value": ((
|
|
235
|
-
"onUpdate:modelValue":
|
|
223
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
224
|
+
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
236
225
|
"update:model-value",
|
|
237
226
|
unref(RuleBuilder).setRuleToGroup(
|
|
238
227
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
239
|
-
|
|
228
|
+
m,
|
|
240
229
|
"&&"
|
|
241
230
|
)
|
|
242
231
|
))
|
|
@@ -254,15 +243,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
254
243
|
}
|
|
255
244
|
},
|
|
256
245
|
emits: ["update:model-value"],
|
|
257
|
-
setup(e, { emit:
|
|
258
|
-
const
|
|
259
|
-
return (
|
|
260
|
-
var
|
|
246
|
+
setup(e, { emit: i }) {
|
|
247
|
+
const n = i;
|
|
248
|
+
return (r, o) => {
|
|
249
|
+
var s;
|
|
261
250
|
return openBlock(), createBlock(_sfc_main$r, {
|
|
262
251
|
"include-only": "bill",
|
|
263
252
|
"trigger-type": "BILL_COMPLETED",
|
|
264
|
-
"model-value": ((
|
|
265
|
-
"onUpdate:modelValue":
|
|
253
|
+
"model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
|
|
254
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => n(
|
|
266
255
|
"update:model-value",
|
|
267
256
|
unref(RuleBuilder).setRuleToGroup(
|
|
268
257
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -281,29 +270,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
281
270
|
}
|
|
282
271
|
},
|
|
283
272
|
emits: ["update:model-value"],
|
|
284
|
-
setup(e, { emit:
|
|
285
|
-
const
|
|
286
|
-
const { property:
|
|
287
|
-
|
|
273
|
+
setup(e, { emit: i }) {
|
|
274
|
+
const n = e, r = i, o = computed(() => {
|
|
275
|
+
const { property: s, operator: l, equator: t } = RuleBuilder.simplify(
|
|
276
|
+
n.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
288
277
|
op: "before",
|
|
289
278
|
x: 1
|
|
290
279
|
})
|
|
291
280
|
);
|
|
292
281
|
return {
|
|
293
|
-
property:
|
|
282
|
+
property: s,
|
|
294
283
|
operator: l,
|
|
295
|
-
equator:
|
|
284
|
+
equator: t
|
|
296
285
|
};
|
|
297
286
|
});
|
|
298
|
-
return (
|
|
299
|
-
const
|
|
287
|
+
return (s, l) => {
|
|
288
|
+
const t = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
|
|
300
289
|
return openBlock(), createElementBlock("div", null, [
|
|
301
|
-
createVNode(
|
|
290
|
+
createVNode(t, {
|
|
302
291
|
label: "On birthday",
|
|
303
292
|
value: "_isRange-day",
|
|
304
|
-
"model-value": `${unref(
|
|
293
|
+
"model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
|
|
305
294
|
"onUpdate:modelValue": l[0] || (l[0] = () => {
|
|
306
|
-
|
|
295
|
+
r(
|
|
307
296
|
"update:model-value",
|
|
308
297
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
309
298
|
op: "this",
|
|
@@ -313,12 +302,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
313
302
|
);
|
|
314
303
|
})
|
|
315
304
|
}, null, 8, ["model-value"]),
|
|
316
|
-
createVNode(
|
|
305
|
+
createVNode(t, {
|
|
317
306
|
label: "N days before birthday",
|
|
318
307
|
value: "_isDay",
|
|
319
|
-
"model-value": unref(
|
|
308
|
+
"model-value": unref(o).operator,
|
|
320
309
|
"onUpdate:modelValue": l[1] || (l[1] = () => {
|
|
321
|
-
|
|
310
|
+
r(
|
|
322
311
|
"update:model-value",
|
|
323
312
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
324
313
|
op: "after",
|
|
@@ -328,26 +317,26 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
328
317
|
);
|
|
329
318
|
})
|
|
330
319
|
}, null, 8, ["model-value"]),
|
|
331
|
-
unref(
|
|
320
|
+
unref(o).operator == "_isDay" ? (openBlock(), createBlock(a, {
|
|
332
321
|
key: 0,
|
|
333
322
|
label: "Days before birthday",
|
|
334
323
|
"show-steppers": !1,
|
|
335
|
-
"model-value": unref(
|
|
336
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
324
|
+
"model-value": unref(o).equator.x,
|
|
325
|
+
"onUpdate:modelValue": l[2] || (l[2] = (c) => r(
|
|
337
326
|
"update:model-value",
|
|
338
327
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
339
328
|
op: "after",
|
|
340
|
-
x:
|
|
329
|
+
x: c,
|
|
341
330
|
ignoreYear: !0
|
|
342
331
|
})
|
|
343
332
|
))
|
|
344
333
|
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
345
|
-
createVNode(
|
|
334
|
+
createVNode(t, {
|
|
346
335
|
label: "In birthday week",
|
|
347
336
|
value: "_isRange-week",
|
|
348
|
-
"model-value": `${unref(
|
|
337
|
+
"model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
|
|
349
338
|
"onUpdate:modelValue": l[3] || (l[3] = () => {
|
|
350
|
-
|
|
339
|
+
r(
|
|
351
340
|
"update:model-value",
|
|
352
341
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
353
342
|
op: "this",
|
|
@@ -357,12 +346,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
357
346
|
);
|
|
358
347
|
})
|
|
359
348
|
}, null, 8, ["model-value"]),
|
|
360
|
-
createVNode(
|
|
349
|
+
createVNode(t, {
|
|
361
350
|
label: "In birthday month",
|
|
362
351
|
value: "_isRange-month",
|
|
363
|
-
"model-value": `${unref(
|
|
352
|
+
"model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
|
|
364
353
|
"onUpdate:modelValue": l[4] || (l[4] = () => {
|
|
365
|
-
|
|
354
|
+
r(
|
|
366
355
|
"update:model-value",
|
|
367
356
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
368
357
|
op: "this",
|
|
@@ -385,15 +374,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
385
374
|
}
|
|
386
375
|
},
|
|
387
376
|
emits: ["update:model-value"],
|
|
388
|
-
setup(e, { emit:
|
|
389
|
-
const
|
|
390
|
-
return (
|
|
391
|
-
var
|
|
377
|
+
setup(e, { emit: i }) {
|
|
378
|
+
const n = i;
|
|
379
|
+
return (r, o) => {
|
|
380
|
+
var s;
|
|
392
381
|
return openBlock(), createBlock(_sfc_main$r, {
|
|
393
382
|
"include-only": "feedback",
|
|
394
383
|
"trigger-type": "FEEDBACK",
|
|
395
|
-
"model-value": ((
|
|
396
|
-
"onUpdate:modelValue":
|
|
384
|
+
"model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
|
|
385
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => n(
|
|
397
386
|
"update:model-value",
|
|
398
387
|
unref(RuleBuilder).setRuleToGroup(
|
|
399
388
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -472,13 +461,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
472
461
|
"GAME",
|
|
473
462
|
"MISSION"
|
|
474
463
|
].map((e) => {
|
|
475
|
-
const
|
|
464
|
+
const i = CAMPAIGN_TRIGGER[e];
|
|
476
465
|
return [
|
|
477
466
|
e,
|
|
478
|
-
(
|
|
467
|
+
(i == null ? void 0 : i.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
|
|
479
468
|
];
|
|
480
469
|
})
|
|
481
|
-
), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$
|
|
470
|
+
), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$d = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
482
471
|
__name: "CampaignTriggerInput",
|
|
483
472
|
props: {
|
|
484
473
|
campaignType: {
|
|
@@ -494,31 +483,31 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
494
483
|
}
|
|
495
484
|
},
|
|
496
485
|
emits: ["update:model-value"],
|
|
497
|
-
setup(e, { emit:
|
|
498
|
-
const
|
|
499
|
-
(
|
|
500
|
-
) : TypeToTriggerOptions[
|
|
501
|
-
return (
|
|
502
|
-
const
|
|
486
|
+
setup(e, { emit: i }) {
|
|
487
|
+
const n = e, r = i, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
|
|
488
|
+
(s) => s.value == n.modelValue
|
|
489
|
+
) : TypeToTriggerOptions[n.campaignType]);
|
|
490
|
+
return (s, l) => {
|
|
491
|
+
const t = resolveComponent("FmCard");
|
|
503
492
|
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
504
|
-
|
|
505
|
-
createElementVNode("div",
|
|
506
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
493
|
+
_hoisted_2$g,
|
|
494
|
+
createElementVNode("div", _hoisted_3$e, [
|
|
495
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
|
|
507
496
|
variant: "outlined",
|
|
508
|
-
disabled:
|
|
497
|
+
disabled: n.disabled,
|
|
509
498
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
510
|
-
"col-span-3": unref(
|
|
511
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
512
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
499
|
+
"col-span-3": unref(o).length == 1,
|
|
500
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
501
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
513
502
|
}]),
|
|
514
503
|
onClick: () => {
|
|
515
|
-
|
|
504
|
+
n.modelValue != a.value && !n.disabled && r("update:model-value", a.value);
|
|
516
505
|
},
|
|
517
|
-
key:
|
|
506
|
+
key: a.name
|
|
518
507
|
}, {
|
|
519
508
|
default: withCtx(() => [
|
|
520
|
-
createElementVNode("div",
|
|
521
|
-
createElementVNode("div",
|
|
509
|
+
createElementVNode("div", _hoisted_4$d, toDisplayString(a.name), 1),
|
|
510
|
+
createElementVNode("div", _hoisted_5$8, toDisplayString(a.description), 1)
|
|
522
511
|
]),
|
|
523
512
|
_: 2
|
|
524
513
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -539,27 +528,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
539
528
|
}
|
|
540
529
|
},
|
|
541
530
|
emits: ["update:model-value"],
|
|
542
|
-
setup(e, { emit:
|
|
543
|
-
const
|
|
544
|
-
return (
|
|
545
|
-
const
|
|
546
|
-
return openBlock(), createBlock(
|
|
531
|
+
setup(e, { emit: i }) {
|
|
532
|
+
const n = i;
|
|
533
|
+
return (r, o) => {
|
|
534
|
+
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
|
|
535
|
+
return openBlock(), createBlock(t, {
|
|
547
536
|
label: e.label,
|
|
548
537
|
"model-value": e.modelValue || "",
|
|
549
|
-
"onUpdate:modelValue":
|
|
538
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => n("update:model-value", a))
|
|
550
539
|
}, {
|
|
551
|
-
"trigger-button": withCtx(({ opened:
|
|
540
|
+
"trigger-button": withCtx(({ opened: a }) => [
|
|
552
541
|
createVNode(l, {
|
|
553
542
|
class: "flex items-center",
|
|
554
543
|
"prepend-icon": "calendar_month",
|
|
555
|
-
"icon-outlined": !
|
|
544
|
+
"icon-outlined": !a
|
|
556
545
|
}, {
|
|
557
546
|
append: withCtx(() => [
|
|
558
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
547
|
+
e.modelValue ? (openBlock(), createBlock(s, {
|
|
559
548
|
key: 0,
|
|
560
549
|
variant: "tertiary",
|
|
561
550
|
icon: "clear",
|
|
562
|
-
onClick:
|
|
551
|
+
onClick: o[0] || (o[0] = (c) => (c.stopPropagation(), n("update:model-value", null)))
|
|
563
552
|
})) : createCommentVNode("", !0)
|
|
564
553
|
]),
|
|
565
554
|
default: withCtx(() => [
|
|
@@ -574,7 +563,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
574
563
|
}, 8, ["label", "model-value"]);
|
|
575
564
|
};
|
|
576
565
|
}
|
|
577
|
-
}), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$
|
|
566
|
+
}), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$f = { class: "flex-1 xs:w-full" }, _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$c = { class: "flex-1 xs:w-full" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
578
567
|
__name: "DateRangeInput",
|
|
579
568
|
props: {
|
|
580
569
|
modelValue: {
|
|
@@ -583,34 +572,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
583
572
|
}
|
|
584
573
|
},
|
|
585
574
|
emits: ["update:model-value"],
|
|
586
|
-
setup(e, { emit:
|
|
587
|
-
const
|
|
588
|
-
return (
|
|
589
|
-
var
|
|
575
|
+
setup(e, { emit: i }) {
|
|
576
|
+
const n = i;
|
|
577
|
+
return (r, o) => {
|
|
578
|
+
var s, l;
|
|
590
579
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
591
|
-
createElementVNode("div", _hoisted_2$
|
|
580
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
592
581
|
createVNode(_sfc_main$i, {
|
|
593
|
-
"model-value": ((
|
|
582
|
+
"model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
|
|
594
583
|
label: "Start date",
|
|
595
|
-
"onUpdate:modelValue":
|
|
596
|
-
var
|
|
597
|
-
return
|
|
598
|
-
startDate:
|
|
599
|
-
endDate: ((
|
|
584
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => {
|
|
585
|
+
var a;
|
|
586
|
+
return n("update:model-value", {
|
|
587
|
+
startDate: t,
|
|
588
|
+
endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
|
|
600
589
|
});
|
|
601
590
|
})
|
|
602
591
|
}, null, 8, ["model-value"])
|
|
603
592
|
]),
|
|
604
|
-
|
|
605
|
-
createElementVNode("div",
|
|
593
|
+
_hoisted_3$d,
|
|
594
|
+
createElementVNode("div", _hoisted_4$c, [
|
|
606
595
|
createVNode(_sfc_main$i, {
|
|
607
596
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
|
|
608
597
|
label: "End date",
|
|
609
|
-
"onUpdate:modelValue":
|
|
610
|
-
var
|
|
611
|
-
return
|
|
612
|
-
startDate: ((
|
|
613
|
-
endDate:
|
|
598
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => {
|
|
599
|
+
var a;
|
|
600
|
+
return n("update:model-value", {
|
|
601
|
+
startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
|
|
602
|
+
endDate: t
|
|
614
603
|
});
|
|
615
604
|
})
|
|
616
605
|
}, null, 8, ["model-value"])
|
|
@@ -618,10 +607,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
618
607
|
]);
|
|
619
608
|
};
|
|
620
609
|
}
|
|
621
|
-
}), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$
|
|
610
|
+
}), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$e = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$c = {
|
|
622
611
|
key: 0,
|
|
623
612
|
class: "space-y-4"
|
|
624
|
-
}, _hoisted_4$
|
|
613
|
+
}, _hoisted_4$b = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$7 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
625
614
|
__name: "ScheduleRuleInput",
|
|
626
615
|
props: {
|
|
627
616
|
modelValue: {
|
|
@@ -636,34 +625,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
636
625
|
}
|
|
637
626
|
},
|
|
638
627
|
emits: ["update:model-value"],
|
|
639
|
-
setup(e, { emit:
|
|
640
|
-
const
|
|
641
|
-
function
|
|
642
|
-
const
|
|
643
|
-
return
|
|
628
|
+
setup(e, { emit: i }) {
|
|
629
|
+
const n = e, r = i;
|
|
630
|
+
function o() {
|
|
631
|
+
const m = RuleBuilder.getRules(n.modelValue);
|
|
632
|
+
return m.length == 0 ? "fixed" : m.some(
|
|
644
633
|
(g) => isRuleEntry(g) && RuleBuilder.simplify(g).operator == "_rrule"
|
|
645
634
|
) ? "repeating" : "fixed";
|
|
646
635
|
}
|
|
647
|
-
const
|
|
648
|
-
const
|
|
636
|
+
const s = ref(o()), l = ref(!1), t = computed(() => {
|
|
637
|
+
const m = RuleBuilder.getRules(n.modelValue), g = m.find(
|
|
649
638
|
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.date"
|
|
650
|
-
),
|
|
639
|
+
), p = m.find(
|
|
651
640
|
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.time"
|
|
652
641
|
);
|
|
653
642
|
return {
|
|
654
643
|
date: g ? RuleBuilder.simplify(g).equator : null,
|
|
655
|
-
time:
|
|
644
|
+
time: p ? RuleBuilder.simplify(p).equator : null
|
|
656
645
|
};
|
|
657
|
-
}),
|
|
646
|
+
}), a = computed(
|
|
658
647
|
() => calculateNextScheduleAt(
|
|
659
|
-
|
|
648
|
+
n.modelValue,
|
|
660
649
|
/* @__PURE__ */ new Date(),
|
|
661
|
-
|
|
662
|
-
|
|
650
|
+
n.startDate ? new Date(n.startDate) : void 0,
|
|
651
|
+
n.endDate ? new Date(n.endDate) : void 0
|
|
663
652
|
)
|
|
664
653
|
);
|
|
665
|
-
function
|
|
666
|
-
const g =
|
|
654
|
+
function c(m) {
|
|
655
|
+
const g = m.label.toLowerCase(), p = g == "fixed" ? [
|
|
667
656
|
RuleBuilder.constructEntry(
|
|
668
657
|
"trigger.date",
|
|
669
658
|
"_isOnDate",
|
|
@@ -678,73 +667,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
678
667
|
),
|
|
679
668
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
680
669
|
];
|
|
681
|
-
|
|
670
|
+
r(
|
|
682
671
|
"update:model-value",
|
|
683
672
|
RuleBuilder.setRuleToGroup(
|
|
684
673
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
685
|
-
|
|
674
|
+
p
|
|
686
675
|
)
|
|
687
|
-
),
|
|
676
|
+
), s.value = g;
|
|
688
677
|
}
|
|
689
|
-
function
|
|
690
|
-
|
|
678
|
+
function v(m) {
|
|
679
|
+
s.value == "fixed" ? r(
|
|
691
680
|
"update:model-value",
|
|
692
681
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
693
682
|
RuleBuilder.constructEntry(
|
|
694
683
|
"trigger.date",
|
|
695
684
|
"_isOnDate",
|
|
696
|
-
|
|
685
|
+
m.date
|
|
697
686
|
),
|
|
698
687
|
RuleBuilder.constructEntry(
|
|
699
688
|
"trigger.time",
|
|
700
689
|
"_isOnTime",
|
|
701
|
-
|
|
690
|
+
m.time
|
|
702
691
|
)
|
|
703
692
|
])
|
|
704
|
-
) :
|
|
693
|
+
) : r(
|
|
705
694
|
"update:model-value",
|
|
706
695
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
707
696
|
RuleBuilder.constructEntry(
|
|
708
697
|
"trigger.date",
|
|
709
698
|
"_rrule",
|
|
710
|
-
|
|
699
|
+
m.date
|
|
711
700
|
),
|
|
712
701
|
RuleBuilder.constructEntry(
|
|
713
702
|
"trigger.time",
|
|
714
703
|
"_isOnTime",
|
|
715
|
-
|
|
704
|
+
m.time
|
|
716
705
|
)
|
|
717
706
|
])
|
|
718
707
|
);
|
|
719
708
|
}
|
|
720
|
-
return (
|
|
721
|
-
const
|
|
709
|
+
return (m, g) => {
|
|
710
|
+
const p = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
|
|
722
711
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
723
|
-
createVNode(
|
|
712
|
+
createVNode(p, {
|
|
724
713
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
725
|
-
"model-value": { label: unref(cases).title(unref(
|
|
726
|
-
"onUpdate:modelValue":
|
|
714
|
+
"model-value": { label: unref(cases).title(unref(s)) },
|
|
715
|
+
"onUpdate:modelValue": c,
|
|
727
716
|
class: "mb-8"
|
|
728
717
|
}, null, 8, ["model-value"]),
|
|
729
718
|
createElementVNode("div", _hoisted_1$g, [
|
|
730
|
-
createElementVNode("div", _hoisted_2$
|
|
719
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
731
720
|
createVNode(d, {
|
|
732
721
|
label: "Notify time",
|
|
733
|
-
"model-value": unref(
|
|
734
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
735
|
-
"helper-text": unref(
|
|
736
|
-
"helper-state": unref(
|
|
722
|
+
"model-value": unref(t).time,
|
|
723
|
+
"onUpdate:modelValue": g[0] || (g[0] = (E) => v({ date: unref(t).date, time: E })),
|
|
724
|
+
"helper-text": unref(t).time ? void 0 : "Time is required",
|
|
725
|
+
"helper-state": unref(t).time ? void 0 : "error"
|
|
737
726
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
738
|
-
unref(
|
|
739
|
-
createElementVNode("div", _hoisted_4$
|
|
740
|
-
|
|
741
|
-
unref(
|
|
727
|
+
unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
|
|
728
|
+
createElementVNode("div", _hoisted_4$b, [
|
|
729
|
+
_hoisted_5$7,
|
|
730
|
+
unref(t).date ? (openBlock(), createBlock(f, {
|
|
742
731
|
key: 0,
|
|
743
732
|
"z-index": 9999,
|
|
744
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
733
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
|
|
745
734
|
}, {
|
|
746
735
|
default: withCtx(() => [
|
|
747
|
-
createVNode(
|
|
736
|
+
createVNode(u, {
|
|
748
737
|
name: "info",
|
|
749
738
|
size: "sm",
|
|
750
739
|
outline: !0
|
|
@@ -753,30 +742,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
753
742
|
_: 1
|
|
754
743
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
755
744
|
]),
|
|
756
|
-
createVNode(
|
|
745
|
+
createVNode(C, {
|
|
757
746
|
"show-popover": unref(l),
|
|
758
|
-
onPopoverChanged: g[3] || (g[3] = (
|
|
747
|
+
onPopoverChanged: g[3] || (g[3] = (E) => l.value = E)
|
|
759
748
|
}, {
|
|
760
749
|
"popover-button": withCtx(() => [
|
|
761
|
-
createVNode(
|
|
750
|
+
createVNode(y, {
|
|
762
751
|
class: "cursor-pointer",
|
|
763
|
-
"helper-text": unref(
|
|
764
|
-
"helper-state": unref(
|
|
752
|
+
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
753
|
+
"helper-state": unref(t).date ? void 0 : "error"
|
|
765
754
|
}, {
|
|
766
755
|
default: withCtx(() => [
|
|
767
|
-
createElementVNode("div",
|
|
756
|
+
createElementVNode("div", _hoisted_6$4, toDisplayString(unref(t).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options) : "Set a repeating date"), 1)
|
|
768
757
|
]),
|
|
769
758
|
_: 1
|
|
770
759
|
}, 8, ["helper-text", "helper-state"])
|
|
771
760
|
]),
|
|
772
761
|
default: withCtx(() => [
|
|
773
|
-
createVNode(
|
|
762
|
+
createVNode(k, { class: "elevated p-8 w-[450px]" }, {
|
|
774
763
|
default: withCtx(() => [
|
|
775
764
|
createVNode(_sfc_main$s, {
|
|
776
765
|
"apply-button": !0,
|
|
777
|
-
"model-value": unref(
|
|
778
|
-
onCancel: g[1] || (g[1] = (
|
|
779
|
-
"onUpdate:modelValue": g[2] || (g[2] = (
|
|
766
|
+
"model-value": unref(t).date || "",
|
|
767
|
+
onCancel: g[1] || (g[1] = (E) => l.value = !1),
|
|
768
|
+
"onUpdate:modelValue": g[2] || (g[2] = (E) => (v({ date: E, time: unref(t).time }), l.value = !1))
|
|
780
769
|
}, null, 8, ["model-value"])
|
|
781
770
|
]),
|
|
782
771
|
_: 1
|
|
@@ -784,19 +773,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
784
773
|
]),
|
|
785
774
|
_: 1
|
|
786
775
|
}, 8, ["show-popover"])
|
|
787
|
-
])) : (openBlock(), createBlock(
|
|
776
|
+
])) : (openBlock(), createBlock(b, {
|
|
788
777
|
key: 1,
|
|
789
778
|
label: "Notify date",
|
|
790
|
-
"model-value": unref(
|
|
791
|
-
"onUpdate:modelValue": g[4] || (g[4] = (
|
|
792
|
-
"helper-text": unref(
|
|
793
|
-
"helper-state": unref(
|
|
779
|
+
"model-value": unref(t).date || "",
|
|
780
|
+
"onUpdate:modelValue": g[4] || (g[4] = (E) => v({ date: E, time: unref(t).time })),
|
|
781
|
+
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
782
|
+
"helper-state": unref(t).date ? void 0 : "error"
|
|
794
783
|
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
795
784
|
]),
|
|
796
|
-
unref(
|
|
785
|
+
unref(t).date && unref(t).time && unref(a) ? (openBlock(), createBlock(x, {
|
|
797
786
|
key: 0,
|
|
798
|
-
text: `${unref(hooks)(unref(
|
|
799
|
-
${unref(hooks)(unref(
|
|
787
|
+
text: `${unref(hooks)(unref(a)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(a)).format("dddd, DD MMM YYYY")} at
|
|
788
|
+
${unref(hooks)(unref(a)).format("hh:mmA")} (${unref(hooks)(unref(a)).fromNow()})`
|
|
800
789
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
801
790
|
])
|
|
802
791
|
], 64);
|
|
@@ -809,18 +798,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
809
798
|
filterItems: { type: Function }
|
|
810
799
|
},
|
|
811
800
|
emits: ["confirm"],
|
|
812
|
-
setup(e, { emit:
|
|
813
|
-
const
|
|
814
|
-
function
|
|
801
|
+
setup(e, { emit: i }) {
|
|
802
|
+
const n = ref(), r = ref(!1);
|
|
803
|
+
function o() {
|
|
815
804
|
var l;
|
|
816
|
-
(l =
|
|
805
|
+
(l = n.value) == null || l.onConfirm();
|
|
817
806
|
}
|
|
818
|
-
const
|
|
819
|
-
return (l,
|
|
820
|
-
const
|
|
821
|
-
return openBlock(), createBlock(
|
|
822
|
-
modelValue:
|
|
823
|
-
"onUpdate:modelValue":
|
|
807
|
+
const s = i;
|
|
808
|
+
return (l, t) => {
|
|
809
|
+
const a = resolveComponent("FmField"), c = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
|
|
810
|
+
return openBlock(), createBlock(v, {
|
|
811
|
+
modelValue: r.value,
|
|
812
|
+
"onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
|
|
824
813
|
title: "Select Items",
|
|
825
814
|
"close-button": !1,
|
|
826
815
|
"dismiss-away": !0,
|
|
@@ -828,7 +817,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
828
817
|
}, {
|
|
829
818
|
"side-sheet-button": withCtx(() => [
|
|
830
819
|
renderSlot(l.$slots, "side-sheet-button", {}, () => [
|
|
831
|
-
createVNode(
|
|
820
|
+
createVNode(a, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
|
|
832
821
|
default: withCtx(() => [
|
|
833
822
|
createTextVNode(toDisplayString(l.modelValue.length) + " item(s) selected ", 1)
|
|
834
823
|
]),
|
|
@@ -838,14 +827,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
838
827
|
]),
|
|
839
828
|
"side-sheet-footer": withCtx(() => [
|
|
840
829
|
createElementVNode("div", _hoisted_1$f, [
|
|
841
|
-
createVNode(
|
|
830
|
+
createVNode(c, {
|
|
842
831
|
variant: "tertiary",
|
|
843
|
-
onClick:
|
|
832
|
+
onClick: t[0] || (t[0] = (m) => r.value = !1),
|
|
844
833
|
label: "Cancel"
|
|
845
834
|
}),
|
|
846
|
-
createVNode(
|
|
835
|
+
createVNode(c, {
|
|
847
836
|
variant: "primary",
|
|
848
|
-
onClick:
|
|
837
|
+
onClick: o,
|
|
849
838
|
label: "Confirm"
|
|
850
839
|
})
|
|
851
840
|
])
|
|
@@ -855,11 +844,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
855
844
|
class: "h-full",
|
|
856
845
|
"max-height": 0,
|
|
857
846
|
ref_key: "selectItemRef",
|
|
858
|
-
ref:
|
|
847
|
+
ref: n,
|
|
859
848
|
"initial-value": l.modelValue,
|
|
860
849
|
"filter-items": l.filterItems,
|
|
861
|
-
"on-complete": (
|
|
862
|
-
|
|
850
|
+
"on-complete": (m) => {
|
|
851
|
+
s("confirm", m), r.value = !1;
|
|
863
852
|
}
|
|
864
853
|
}, null, 8, ["initial-value", "filter-items", "on-complete"])
|
|
865
854
|
]),
|
|
@@ -867,13 +856,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
867
856
|
}, 8, ["modelValue"]);
|
|
868
857
|
};
|
|
869
858
|
}
|
|
870
|
-
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$
|
|
859
|
+
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_8$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
|
|
871
860
|
key: 0,
|
|
872
861
|
class: "xs:!block flex gap-16 items-center pt-8"
|
|
873
|
-
},
|
|
862
|
+
}, _hoisted_10$3 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _hoisted_11$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_13 = {
|
|
874
863
|
key: 0,
|
|
875
864
|
class: "pt-8 space-y-8"
|
|
876
|
-
},
|
|
865
|
+
}, _hoisted_14 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_15 = { class: "xs:!block flex gap-16 items-center" }, _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
877
866
|
__name: "EarningOptionInput",
|
|
878
867
|
props: {
|
|
879
868
|
modelValue: {
|
|
@@ -890,9 +879,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
890
879
|
}
|
|
891
880
|
},
|
|
892
881
|
emits: ["update:model-value"],
|
|
893
|
-
setup(e, { emit:
|
|
894
|
-
var
|
|
895
|
-
const
|
|
882
|
+
setup(e, { emit: i }) {
|
|
883
|
+
var v, m, g;
|
|
884
|
+
const n = useBusinessStore(), r = e, o = i, s = [
|
|
896
885
|
{
|
|
897
886
|
label: "Based on spending",
|
|
898
887
|
sublabel: "Customers earn rewards based on how much they spend.",
|
|
@@ -903,22 +892,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
903
892
|
sublabel: "Customers earn a set amount of rewards for specific actions.",
|
|
904
893
|
value: "FIXED"
|
|
905
894
|
}
|
|
906
|
-
].filter((
|
|
907
|
-
var d,
|
|
908
|
-
return
|
|
895
|
+
].filter((p) => {
|
|
896
|
+
var d, u;
|
|
897
|
+
return r.fixedType || ((u = (d = r.extras) == null ? void 0 : d.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? p.value == "FIXED" : !0;
|
|
909
898
|
}), l = computed(() => {
|
|
910
|
-
var d,
|
|
911
|
-
const
|
|
912
|
-
return (((
|
|
913
|
-
}),
|
|
914
|
-
const
|
|
915
|
-
return
|
|
899
|
+
var d, u;
|
|
900
|
+
const p = r.extras && "configs" in r.extras ? r.extras.configs.type : (d = r.extras) == null ? void 0 : d.campaign.type;
|
|
901
|
+
return (((u = CollectibleOptions[p]) == null ? void 0 : u.name) || "reward").toLowerCase();
|
|
902
|
+
}), t = computed(() => {
|
|
903
|
+
const p = FdoEarningOption.safeParse(r.modelValue);
|
|
904
|
+
return p.success ? [] : p.error.errors;
|
|
916
905
|
});
|
|
917
|
-
function
|
|
906
|
+
function a(p) {
|
|
918
907
|
var d;
|
|
919
|
-
|
|
908
|
+
p != ((d = r.modelValue) == null ? void 0 : d.type) && o(
|
|
920
909
|
"update:model-value",
|
|
921
|
-
|
|
910
|
+
p === "FIXED" ? {
|
|
922
911
|
type: "FIXED",
|
|
923
912
|
amount: 1
|
|
924
913
|
} : {
|
|
@@ -928,95 +917,95 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
928
917
|
}
|
|
929
918
|
);
|
|
930
919
|
}
|
|
931
|
-
const
|
|
932
|
-
((
|
|
920
|
+
const c = ref(
|
|
921
|
+
((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
|
|
933
922
|
);
|
|
934
|
-
return (
|
|
935
|
-
var
|
|
936
|
-
const
|
|
923
|
+
return (p, d) => {
|
|
924
|
+
var E, V, N;
|
|
925
|
+
const u = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
|
|
937
926
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
938
|
-
createElementVNode("div", _hoisted_2$
|
|
939
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
940
|
-
var
|
|
941
|
-
return openBlock(), createBlock(
|
|
927
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
928
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
|
|
929
|
+
var R, B;
|
|
930
|
+
return openBlock(), createBlock(u, {
|
|
942
931
|
variant: "outlined",
|
|
943
932
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
944
|
-
"col-span-2": unref(
|
|
945
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
946
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
933
|
+
"col-span-2": unref(s).length == 1,
|
|
934
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) === h.value,
|
|
935
|
+
"hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != h.value
|
|
947
936
|
}]),
|
|
948
|
-
onClick: (
|
|
949
|
-
key:
|
|
937
|
+
onClick: ($) => a(h.value),
|
|
938
|
+
key: h.value
|
|
950
939
|
}, {
|
|
951
940
|
default: withCtx(() => [
|
|
952
|
-
createElementVNode("div", _hoisted_3$
|
|
953
|
-
createElementVNode("div", _hoisted_4$
|
|
941
|
+
createElementVNode("div", _hoisted_3$b, toDisplayString(h.label), 1),
|
|
942
|
+
createElementVNode("div", _hoisted_4$a, toDisplayString(h.sublabel), 1)
|
|
954
943
|
]),
|
|
955
944
|
_: 2
|
|
956
945
|
}, 1032, ["class", "onClick"]);
|
|
957
946
|
}), 128))
|
|
958
947
|
]),
|
|
959
|
-
createElementVNode("div", _hoisted_5$
|
|
960
|
-
((
|
|
948
|
+
createElementVNode("div", _hoisted_5$6, [
|
|
949
|
+
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(f, {
|
|
961
950
|
key: 0,
|
|
962
951
|
label: `Receive ${unref(l)}(s)`,
|
|
963
952
|
class: "flex-1",
|
|
964
|
-
"model-value": ((
|
|
965
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
953
|
+
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
954
|
+
"onUpdate:modelValue": d[0] || (d[0] = (h) => o("update:model-value", {
|
|
966
955
|
...e.modelValue ?? { type: "FIXED" },
|
|
967
|
-
amount:
|
|
956
|
+
amount: h
|
|
968
957
|
}))
|
|
969
|
-
}, null, 8, ["label", "model-value"])) : ((
|
|
970
|
-
|
|
971
|
-
createVNode(
|
|
972
|
-
"model-value": unref(
|
|
973
|
-
"onUpdate:modelValue": d[6] || (d[6] = (
|
|
974
|
-
unref(
|
|
958
|
+
}, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
959
|
+
_hoisted_6$3,
|
|
960
|
+
createVNode(b, {
|
|
961
|
+
"model-value": unref(c),
|
|
962
|
+
"onUpdate:modelValue": d[6] || (d[6] = (h) => {
|
|
963
|
+
unref(c) != h && (o("update:model-value", {
|
|
975
964
|
...e.modelValue ?? {
|
|
976
965
|
type: "PROPORTIONAL",
|
|
977
966
|
amount: 1,
|
|
978
967
|
every: 1
|
|
979
968
|
},
|
|
980
|
-
property:
|
|
969
|
+
property: h ? [] : void 0,
|
|
981
970
|
every: 1
|
|
982
|
-
}),
|
|
971
|
+
}), c.value = h);
|
|
983
972
|
})
|
|
984
973
|
}, {
|
|
985
974
|
default: withCtx(() => [
|
|
986
|
-
createVNode(
|
|
975
|
+
createVNode(y, {
|
|
987
976
|
label: "Amount spent",
|
|
988
977
|
sublabel: `Receive ${unref(l)} by amount spent`,
|
|
989
978
|
value: !1
|
|
990
979
|
}, {
|
|
991
980
|
label: withCtx(() => {
|
|
992
|
-
var
|
|
981
|
+
var h, R;
|
|
993
982
|
return [
|
|
994
|
-
|
|
995
|
-
createElementVNode("div",
|
|
996
|
-
unref(
|
|
983
|
+
_hoisted_7$3,
|
|
984
|
+
createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
|
|
985
|
+
unref(c) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
997
986
|
createVNode(f, {
|
|
998
987
|
label: `Receive ${unref(l)}(s)`,
|
|
999
988
|
inputmode: "decimal",
|
|
1000
989
|
class: "flex-1",
|
|
1001
|
-
"model-value": ((
|
|
1002
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
990
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
991
|
+
"onUpdate:modelValue": d[1] || (d[1] = (B) => o("update:model-value", {
|
|
1003
992
|
...e.modelValue ?? { type: "FIXED" },
|
|
1004
|
-
amount:
|
|
993
|
+
amount: B
|
|
1005
994
|
}))
|
|
1006
995
|
}, null, 8, ["label", "model-value"]),
|
|
1007
|
-
|
|
996
|
+
_hoisted_10$3,
|
|
1008
997
|
createVNode(f, {
|
|
1009
|
-
label: `Amount spend (${unref(
|
|
998
|
+
label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
1010
999
|
class: "flex-1",
|
|
1011
1000
|
inputmode: "decimal",
|
|
1012
|
-
"model-value": ((
|
|
1013
|
-
"onUpdate:modelValue": d[2] || (d[2] = (
|
|
1001
|
+
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1002
|
+
"onUpdate:modelValue": d[2] || (d[2] = (B) => o("update:model-value", {
|
|
1014
1003
|
...e.modelValue,
|
|
1015
|
-
every:
|
|
1004
|
+
every: B
|
|
1016
1005
|
}))
|
|
1017
1006
|
}, {
|
|
1018
1007
|
prepend: withCtx(() => [
|
|
1019
|
-
createTextVNode(toDisplayString(unref(
|
|
1008
|
+
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
1020
1009
|
]),
|
|
1021
1010
|
_: 1
|
|
1022
1011
|
}, 8, ["label", "model-value"])
|
|
@@ -1025,34 +1014,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1025
1014
|
}),
|
|
1026
1015
|
_: 1
|
|
1027
1016
|
}, 8, ["sublabel"]),
|
|
1028
|
-
createVNode(
|
|
1017
|
+
createVNode(y, {
|
|
1029
1018
|
label: "Product bought",
|
|
1030
1019
|
sublabel: `Receive ${unref(l)} by product bought`,
|
|
1031
1020
|
value: !0,
|
|
1032
|
-
disabled: !unref(
|
|
1021
|
+
disabled: !unref(n).isPremium
|
|
1033
1022
|
}, {
|
|
1034
1023
|
label: withCtx(() => {
|
|
1035
|
-
var
|
|
1024
|
+
var h, R;
|
|
1036
1025
|
return [
|
|
1037
|
-
createElementVNode("div",
|
|
1038
|
-
|
|
1039
|
-
createVNode(
|
|
1026
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
1027
|
+
createTextVNode(" Product bought "),
|
|
1028
|
+
createVNode(k, { variant: "premium" })
|
|
1040
1029
|
]),
|
|
1041
|
-
createElementVNode("div",
|
|
1042
|
-
unref(
|
|
1043
|
-
createElementVNode("div",
|
|
1030
|
+
createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
|
|
1031
|
+
unref(c) ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
1032
|
+
createElementVNode("div", _hoisted_14, [
|
|
1044
1033
|
createVNode(_sfc_main$f, {
|
|
1045
|
-
"model-value":
|
|
1046
|
-
onConfirm: d[3] || (d[3] = (
|
|
1034
|
+
"model-value": r.modelValue.property || [],
|
|
1035
|
+
onConfirm: d[3] || (d[3] = (B) => o("update:model-value", {
|
|
1047
1036
|
...e.modelValue,
|
|
1048
|
-
property:
|
|
1037
|
+
property: B
|
|
1049
1038
|
}))
|
|
1050
1039
|
}, {
|
|
1051
1040
|
"side-sheet-button": withCtx(() => {
|
|
1052
|
-
var
|
|
1041
|
+
var B, $;
|
|
1053
1042
|
return [
|
|
1054
|
-
createVNode(
|
|
1055
|
-
label: (
|
|
1043
|
+
createVNode(C, {
|
|
1044
|
+
label: (B = r.modelValue.property) != null && B.length ? `${($ = r.modelValue.property) == null ? void 0 : $.length} product(s) selected` : "Select product",
|
|
1056
1045
|
icon: "link",
|
|
1057
1046
|
variant: "secondary"
|
|
1058
1047
|
}, null, 8, ["label"])
|
|
@@ -1061,27 +1050,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1061
1050
|
_: 1
|
|
1062
1051
|
}, 8, ["model-value"])
|
|
1063
1052
|
]),
|
|
1064
|
-
createElementVNode("div",
|
|
1053
|
+
createElementVNode("div", _hoisted_15, [
|
|
1065
1054
|
createVNode(f, {
|
|
1066
1055
|
inputmode: "decimal",
|
|
1067
1056
|
label: `Receive ${unref(l)}(s)`,
|
|
1068
1057
|
class: "flex-1",
|
|
1069
|
-
"model-value": ((
|
|
1070
|
-
"onUpdate:modelValue": d[4] || (d[4] = (
|
|
1058
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
1059
|
+
"onUpdate:modelValue": d[4] || (d[4] = (B) => o("update:model-value", {
|
|
1071
1060
|
...e.modelValue ?? { type: "FIXED" },
|
|
1072
|
-
amount:
|
|
1061
|
+
amount: B
|
|
1073
1062
|
}))
|
|
1074
1063
|
}, null, 8, ["label", "model-value"]),
|
|
1075
|
-
|
|
1064
|
+
_hoisted_16,
|
|
1076
1065
|
createVNode(f, {
|
|
1077
1066
|
label: "Item purchased",
|
|
1078
1067
|
class: "flex-1",
|
|
1079
|
-
"model-value": ((
|
|
1068
|
+
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1080
1069
|
inputmode: "numeric",
|
|
1081
1070
|
"max-fraction-digits": 0,
|
|
1082
|
-
"onUpdate:modelValue": d[5] || (d[5] = (
|
|
1071
|
+
"onUpdate:modelValue": d[5] || (d[5] = (B) => o("update:model-value", {
|
|
1083
1072
|
...e.modelValue,
|
|
1084
|
-
every:
|
|
1073
|
+
every: B
|
|
1085
1074
|
}))
|
|
1086
1075
|
}, null, 8, ["model-value"])
|
|
1087
1076
|
])
|
|
@@ -1095,16 +1084,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1095
1084
|
}, 8, ["model-value"])
|
|
1096
1085
|
], 64)) : createCommentVNode("", !0)
|
|
1097
1086
|
]),
|
|
1098
|
-
e.errorText || unref(
|
|
1087
|
+
e.errorText || unref(t).length > 0 ? (openBlock(), createBlock(x, {
|
|
1099
1088
|
key: 0,
|
|
1100
1089
|
class: "!mt-4",
|
|
1101
|
-
text: e.errorText || unref(ZodHelper).helperText(unref(
|
|
1090
|
+
text: e.errorText || unref(ZodHelper).helperText(unref(t), ""),
|
|
1102
1091
|
state: "error"
|
|
1103
1092
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1104
1093
|
]);
|
|
1105
1094
|
};
|
|
1106
1095
|
}
|
|
1107
|
-
}), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$
|
|
1096
|
+
}), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$c = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1108
1097
|
__name: "GameTypeInput",
|
|
1109
1098
|
props: {
|
|
1110
1099
|
modelValue: {
|
|
@@ -1112,8 +1101,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1112
1101
|
}
|
|
1113
1102
|
},
|
|
1114
1103
|
emits: ["update:model-value"],
|
|
1115
|
-
setup(e, { emit:
|
|
1116
|
-
const
|
|
1104
|
+
setup(e, { emit: i }) {
|
|
1105
|
+
const n = e, r = i, o = computed(
|
|
1117
1106
|
() => [
|
|
1118
1107
|
{
|
|
1119
1108
|
label: "Fortune Wheel",
|
|
@@ -1127,28 +1116,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1127
1116
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
1128
1117
|
hidden: !0
|
|
1129
1118
|
}
|
|
1130
|
-
].filter((
|
|
1119
|
+
].filter((s) => !s.hidden)
|
|
1131
1120
|
);
|
|
1132
|
-
return (
|
|
1133
|
-
const
|
|
1121
|
+
return (s, l) => {
|
|
1122
|
+
const t = resolveComponent("FmCard");
|
|
1134
1123
|
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
1135
|
-
|
|
1136
|
-
createElementVNode("div",
|
|
1137
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1124
|
+
_hoisted_2$c,
|
|
1125
|
+
createElementVNode("div", _hoisted_3$a, [
|
|
1126
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
|
|
1138
1127
|
variant: "outlined",
|
|
1139
1128
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1140
|
-
"col-span-2": unref(
|
|
1141
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1142
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1129
|
+
"col-span-2": unref(o).length == 1,
|
|
1130
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
1131
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
1143
1132
|
}]),
|
|
1144
1133
|
onClick: () => {
|
|
1145
|
-
|
|
1134
|
+
n.modelValue != a.value && r("update:model-value", a.value);
|
|
1146
1135
|
},
|
|
1147
|
-
key:
|
|
1136
|
+
key: a.value
|
|
1148
1137
|
}, {
|
|
1149
1138
|
default: withCtx(() => [
|
|
1150
|
-
createElementVNode("div",
|
|
1151
|
-
createElementVNode("div",
|
|
1139
|
+
createElementVNode("div", _hoisted_4$9, toDisplayString(a.label), 1),
|
|
1140
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(a.description), 1)
|
|
1152
1141
|
]),
|
|
1153
1142
|
_: 2
|
|
1154
1143
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1156,7 +1145,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1156
1145
|
]);
|
|
1157
1146
|
};
|
|
1158
1147
|
}
|
|
1159
|
-
}), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1148
|
+
}), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _hoisted_2$b = /* @__PURE__ */ createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1), _hoisted_3$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _hoisted_4$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), _hoisted_5$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1160
1149
|
__name: "VoucherEditor",
|
|
1161
1150
|
props: {
|
|
1162
1151
|
modelValue: {
|
|
@@ -1167,33 +1156,33 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1167
1156
|
}
|
|
1168
1157
|
},
|
|
1169
1158
|
emits: ["update:model-value", "update:reward-image"],
|
|
1170
|
-
setup(e, { emit:
|
|
1171
|
-
const
|
|
1159
|
+
setup(e, { emit: i }) {
|
|
1160
|
+
const r = ref(
|
|
1172
1161
|
e.modelValue ?? initCollectibleConfig("VOUCHER", {
|
|
1173
1162
|
business: useCoreStore().currentBusiness.value._id,
|
|
1174
1163
|
name: ""
|
|
1175
1164
|
})
|
|
1176
|
-
),
|
|
1177
|
-
return (
|
|
1178
|
-
var
|
|
1179
|
-
const
|
|
1165
|
+
), o = FdtoCollectibleConfig, s = i;
|
|
1166
|
+
return (l, t) => {
|
|
1167
|
+
var v, m, g;
|
|
1168
|
+
const a = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText");
|
|
1180
1169
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1181
1170
|
createVNode(_sfc_main$u, {
|
|
1182
|
-
modelValue: unref(
|
|
1183
|
-
"onUpdate:modelValue":
|
|
1171
|
+
modelValue: unref(r).name,
|
|
1172
|
+
"onUpdate:modelValue": t[0] || (t[0] = (p) => unref(r).name = p),
|
|
1184
1173
|
label: "Voucher name",
|
|
1185
|
-
schema: unref(ZodHelper).typeAtPath(unref(
|
|
1174
|
+
schema: unref(ZodHelper).typeAtPath(unref(o), "name", [unref(r).type])
|
|
1186
1175
|
}, null, 8, ["modelValue", "schema"]),
|
|
1187
|
-
createVNode(
|
|
1176
|
+
createVNode(a, {
|
|
1188
1177
|
class: "!mb-[-16px]",
|
|
1189
|
-
modelValue: unref(
|
|
1190
|
-
"onUpdate:modelValue":
|
|
1191
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1178
|
+
modelValue: unref(r).description,
|
|
1179
|
+
"onUpdate:modelValue": t[1] || (t[1] = (p) => unref(r).description = p),
|
|
1180
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(o), "description", [unref(r).type])]
|
|
1192
1181
|
}, {
|
|
1193
1182
|
label: withCtx(() => [
|
|
1194
1183
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1195
1184
|
unref(ZodHelper).toInputLabel(
|
|
1196
|
-
unref(ZodHelper).typeAtPath(unref(
|
|
1185
|
+
unref(ZodHelper).typeAtPath(unref(o), "description", [unref(r).type]),
|
|
1197
1186
|
"Voucher description"
|
|
1198
1187
|
)
|
|
1199
1188
|
)))
|
|
@@ -1201,55 +1190,55 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1201
1190
|
_: 1
|
|
1202
1191
|
}, 8, ["modelValue", "rules"]),
|
|
1203
1192
|
createElementVNode("div", _hoisted_1$c, [
|
|
1204
|
-
|
|
1205
|
-
createElementVNode("div", null, toDisplayString(((
|
|
1193
|
+
_hoisted_2$b,
|
|
1194
|
+
createElementVNode("div", null, toDisplayString(((v = unref(r).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
|
|
1206
1195
|
]),
|
|
1207
1196
|
createVNode(_sfc_main$v, {
|
|
1208
1197
|
class: "w-1/2 xs:w-2/3",
|
|
1209
1198
|
"aspect-ratio": "16/9",
|
|
1210
1199
|
file: e.rewardImage ?? void 0,
|
|
1211
|
-
thumbnail: unref(
|
|
1212
|
-
"onUpdate:file":
|
|
1213
|
-
|
|
1200
|
+
thumbnail: unref(r).image ?? void 0,
|
|
1201
|
+
"onUpdate:file": t[2] || (t[2] = async (p) => {
|
|
1202
|
+
s("update:reward-image", p), p || (unref(r).image = null);
|
|
1214
1203
|
})
|
|
1215
1204
|
}, {
|
|
1216
1205
|
label: withCtx(() => [
|
|
1217
1206
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1218
1207
|
unref(ZodHelper).toInputLabel(
|
|
1219
|
-
unref(ZodHelper).typeAtPath(unref(
|
|
1208
|
+
unref(ZodHelper).typeAtPath(unref(o), "image", [unref(r).type]),
|
|
1220
1209
|
"Voucher image"
|
|
1221
1210
|
)
|
|
1222
1211
|
)))
|
|
1223
1212
|
]),
|
|
1224
1213
|
_: 1
|
|
1225
1214
|
}, 8, ["file", "thumbnail"]),
|
|
1226
|
-
|
|
1215
|
+
_hoisted_3$9,
|
|
1227
1216
|
createVNode(_sfc_main$w, {
|
|
1228
|
-
"model-value": unref(
|
|
1229
|
-
"onUpdate:modelValue":
|
|
1217
|
+
"model-value": unref(r).extras.effect,
|
|
1218
|
+
"onUpdate:modelValue": t[3] || (t[3] = (p) => unref(r).extras.effect = p)
|
|
1230
1219
|
}, null, 8, ["model-value"]),
|
|
1231
|
-
unref(
|
|
1220
|
+
unref(r).extras.effect == null ? (openBlock(), createBlock(c, {
|
|
1232
1221
|
key: 0,
|
|
1233
1222
|
class: "!mt-8",
|
|
1234
|
-
text:
|
|
1223
|
+
text: "Effect is required",
|
|
1235
1224
|
state: "error"
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1225
|
+
})) : createCommentVNode("", !0),
|
|
1226
|
+
_hoisted_4$8,
|
|
1238
1227
|
createVNode(_sfc_main$x, {
|
|
1239
|
-
"model-value": unref(
|
|
1240
|
-
"no-campaign": unref(
|
|
1241
|
-
"onUpdate:modelValue":
|
|
1242
|
-
schema: unref(ZodHelper).typeAtPath(unref(
|
|
1228
|
+
"model-value": unref(r).options,
|
|
1229
|
+
"no-campaign": unref(r).noCampaign,
|
|
1230
|
+
"onUpdate:modelValue": t[4] || (t[4] = (p) => unref(r).options = p),
|
|
1231
|
+
schema: unref(ZodHelper).typeAtPath(unref(o), "options", ["VOUCHER"])
|
|
1243
1232
|
}, null, 8, ["model-value", "no-campaign", "schema"]),
|
|
1244
|
-
|
|
1245
|
-
unref(
|
|
1233
|
+
_hoisted_5$4,
|
|
1234
|
+
unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
1246
1235
|
key: 1,
|
|
1247
|
-
"model-value": ((
|
|
1236
|
+
"model-value": ((g = (m = unref(r).extras) == null ? void 0 : m.targetLocation) == null ? void 0 : g.map(String)) ?? null,
|
|
1248
1237
|
type: "select",
|
|
1249
|
-
"onUpdate:modelValue":
|
|
1250
|
-
unref(
|
|
1238
|
+
"onUpdate:modelValue": t[5] || (t[5] = (p) => {
|
|
1239
|
+
unref(r).extras.targetLocation = p;
|
|
1251
1240
|
}),
|
|
1252
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1241
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(o), "extras.targetLocation")]
|
|
1253
1242
|
}, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
|
|
1254
1243
|
], 64);
|
|
1255
1244
|
};
|
|
@@ -1257,74 +1246,74 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1257
1246
|
}), _hoisted_1$b = {
|
|
1258
1247
|
key: 0,
|
|
1259
1248
|
class: "flex flex-col gap-y-24"
|
|
1260
|
-
}, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1249
|
+
}, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1261
1250
|
__name: "EditRewardPoolSheet",
|
|
1262
1251
|
emits: ["update:model-value"],
|
|
1263
|
-
setup(e, { expose:
|
|
1264
|
-
const
|
|
1265
|
-
var
|
|
1266
|
-
return ((
|
|
1252
|
+
setup(e, { expose: i, emit: n }) {
|
|
1253
|
+
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), c = computed(() => {
|
|
1254
|
+
var u;
|
|
1255
|
+
return ((u = r.loyaltyRewards.items.find(
|
|
1267
1256
|
(f) => {
|
|
1268
|
-
var
|
|
1269
|
-
return f.value === ((
|
|
1257
|
+
var y;
|
|
1258
|
+
return f.value === ((y = l.value) == null ? void 0 : y.collectible);
|
|
1270
1259
|
}
|
|
1271
|
-
)) == null ? void 0 :
|
|
1272
|
-
}),
|
|
1273
|
-
const d =
|
|
1260
|
+
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1261
|
+
}), v = computed(() => {
|
|
1262
|
+
const d = c.value.safeParse(l.value);
|
|
1274
1263
|
return d.success ? [] : d.error.errors;
|
|
1275
1264
|
});
|
|
1276
|
-
function
|
|
1277
|
-
d && (l.value =
|
|
1265
|
+
function m(d, u, f) {
|
|
1266
|
+
d && (l.value = u, a.value = f), s.value = d;
|
|
1278
1267
|
}
|
|
1279
|
-
const g =
|
|
1280
|
-
async function
|
|
1281
|
-
const d =
|
|
1282
|
-
d.success && (await
|
|
1268
|
+
const g = n;
|
|
1269
|
+
async function p() {
|
|
1270
|
+
const d = c.value.safeParse(l.value);
|
|
1271
|
+
d.success && (await o(
|
|
1283
1272
|
async () => {
|
|
1284
|
-
d.data.type === "VOUCHER" &&
|
|
1285
|
-
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0,
|
|
1286
|
-
|
|
1273
|
+
d.data.type === "VOUCHER" && t.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1274
|
+
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
|
|
1275
|
+
t.value
|
|
1287
1276
|
));
|
|
1288
1277
|
},
|
|
1289
1278
|
{
|
|
1290
1279
|
message: "Uploading reward image",
|
|
1291
1280
|
successMessage: "Reward image updated"
|
|
1292
1281
|
}
|
|
1293
|
-
), g("update:model-value", d.data,
|
|
1282
|
+
), g("update:model-value", d.data, a.value));
|
|
1294
1283
|
}
|
|
1295
|
-
return
|
|
1296
|
-
showSheet:
|
|
1297
|
-
}), (d,
|
|
1298
|
-
const f = resolveComponent("FmSelect"),
|
|
1299
|
-
return openBlock(), createBlock(
|
|
1284
|
+
return i({
|
|
1285
|
+
showSheet: m
|
|
1286
|
+
}), (d, u) => {
|
|
1287
|
+
const f = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
1288
|
+
return openBlock(), createBlock(C, {
|
|
1300
1289
|
"max-width": 560,
|
|
1301
|
-
modelValue: unref(
|
|
1290
|
+
modelValue: unref(s),
|
|
1302
1291
|
"onUpdate:modelValue": [
|
|
1303
|
-
|
|
1304
|
-
|
|
1292
|
+
u[9] || (u[9] = (b) => isRef(s) ? s.value = b : null),
|
|
1293
|
+
u[10] || (u[10] = (b) => s.value = b)
|
|
1305
1294
|
],
|
|
1306
1295
|
header: "Edit reward",
|
|
1307
1296
|
"dismiss-away": ""
|
|
1308
1297
|
}, {
|
|
1309
1298
|
"side-sheet-footer": withCtx(() => [
|
|
1310
|
-
createElementVNode("div",
|
|
1311
|
-
createVNode(
|
|
1299
|
+
createElementVNode("div", _hoisted_4$7, [
|
|
1300
|
+
createVNode(k, {
|
|
1312
1301
|
variant: "primary",
|
|
1313
1302
|
type: "button",
|
|
1314
|
-
disabled: unref(
|
|
1303
|
+
disabled: unref(v).length > 0,
|
|
1315
1304
|
label: "Confirm",
|
|
1316
|
-
onClick:
|
|
1305
|
+
onClick: u[7] || (u[7] = (b) => p())
|
|
1317
1306
|
}, null, 8, ["disabled"]),
|
|
1318
|
-
createVNode(
|
|
1307
|
+
createVNode(k, {
|
|
1319
1308
|
variant: "secondary",
|
|
1320
1309
|
type: "button",
|
|
1321
1310
|
label: "Cancel",
|
|
1322
|
-
onClick:
|
|
1311
|
+
onClick: u[8] || (u[8] = (b) => s.value = !1)
|
|
1323
1312
|
})
|
|
1324
1313
|
])
|
|
1325
1314
|
]),
|
|
1326
1315
|
default: withCtx(() => {
|
|
1327
|
-
var
|
|
1316
|
+
var b, x, E;
|
|
1328
1317
|
return [
|
|
1329
1318
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1330
1319
|
createVNode(f, {
|
|
@@ -1335,12 +1324,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1335
1324
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1336
1325
|
],
|
|
1337
1326
|
"model-value": unref(l).type,
|
|
1338
|
-
"onUpdate:modelValue":
|
|
1339
|
-
|
|
1327
|
+
"onUpdate:modelValue": u[0] || (u[0] = (V) => {
|
|
1328
|
+
V == "NO_REWARD" ? l.value = {
|
|
1340
1329
|
type: "NO_REWARD",
|
|
1341
1330
|
collectible: null,
|
|
1342
1331
|
weight: 1
|
|
1343
|
-
} :
|
|
1332
|
+
} : V === "VOUCHER" ? l.value = {
|
|
1344
1333
|
collectible: null,
|
|
1345
1334
|
type: "VOUCHER",
|
|
1346
1335
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1355,7 +1344,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1355
1344
|
},
|
|
1356
1345
|
weight: 1
|
|
1357
1346
|
} : l.value = {
|
|
1358
|
-
collectible: unref(
|
|
1347
|
+
collectible: unref(r).loyaltyRewards.raw[0]._id,
|
|
1359
1348
|
type: "LOYALTY",
|
|
1360
1349
|
earningOption: {
|
|
1361
1350
|
amount: 1,
|
|
@@ -1371,71 +1360,71 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1371
1360
|
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
|
|
1372
1361
|
key: 0,
|
|
1373
1362
|
label: "Loyalty type",
|
|
1374
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1375
|
-
items: unref(
|
|
1363
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(l).type])],
|
|
1364
|
+
items: unref(r).loyaltyRewards.items,
|
|
1376
1365
|
"model-value": unref(l).collectible,
|
|
1377
|
-
"onUpdate:modelValue":
|
|
1366
|
+
"onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
|
|
1378
1367
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1379
|
-
createVNode(
|
|
1368
|
+
createVNode(y, {
|
|
1380
1369
|
label: "Weight",
|
|
1381
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1370
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(l).type])],
|
|
1382
1371
|
"model-value": unref(l).weight,
|
|
1383
|
-
"onUpdate:modelValue":
|
|
1372
|
+
"onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
|
|
1384
1373
|
...unref(l),
|
|
1385
|
-
weight:
|
|
1374
|
+
weight: V
|
|
1386
1375
|
})
|
|
1387
1376
|
}, null, 8, ["rules", "model-value"]),
|
|
1388
1377
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1389
|
-
((
|
|
1390
|
-
(
|
|
1391
|
-
var
|
|
1392
|
-
return
|
|
1378
|
+
((b = unref(r).loyaltyRewards.items.find(
|
|
1379
|
+
(V) => {
|
|
1380
|
+
var N;
|
|
1381
|
+
return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1393
1382
|
}
|
|
1394
|
-
)) == null ? void 0 :
|
|
1395
|
-
|
|
1383
|
+
)) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1384
|
+
_hoisted_2$a,
|
|
1396
1385
|
createVNode(_sfc_main$e, {
|
|
1397
1386
|
class: "mt-[-8px]",
|
|
1398
1387
|
rules: [
|
|
1399
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
1388
|
+
unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(l).type])
|
|
1400
1389
|
],
|
|
1401
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1402
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1390
|
+
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
1391
|
+
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
1403
1392
|
"fixed-type": !0,
|
|
1404
1393
|
"model-value": unref(l).earningOption,
|
|
1405
|
-
"onUpdate:modelValue":
|
|
1394
|
+
"onUpdate:modelValue": u[3] || (u[3] = (V) => l.value = {
|
|
1406
1395
|
...unref(l),
|
|
1407
|
-
earningOption:
|
|
1396
|
+
earningOption: V
|
|
1408
1397
|
})
|
|
1409
1398
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1410
1399
|
], 64)) : createCommentVNode("", !0),
|
|
1411
|
-
|
|
1400
|
+
_hoisted_3$8,
|
|
1412
1401
|
createVNode(_sfc_main$z, {
|
|
1413
|
-
"for-credit": unref(l).type === "LOYALTY" && ((
|
|
1414
|
-
(
|
|
1415
|
-
var
|
|
1416
|
-
return
|
|
1402
|
+
"for-credit": unref(l).type === "LOYALTY" && ((x = unref(r).loyaltyRewards.items.find(
|
|
1403
|
+
(V) => {
|
|
1404
|
+
var N;
|
|
1405
|
+
return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1417
1406
|
}
|
|
1418
|
-
)) == null ? void 0 :
|
|
1407
|
+
)) == null ? void 0 : x.raw.type) === "CREDIT",
|
|
1419
1408
|
class: "!gap-24",
|
|
1420
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1409
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(l).type])],
|
|
1421
1410
|
"model-value": unref(l).validityOption,
|
|
1422
|
-
"onUpdate:modelValue":
|
|
1411
|
+
"onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
|
|
1423
1412
|
...unref(l),
|
|
1424
|
-
validityOption:
|
|
1413
|
+
validityOption: V
|
|
1425
1414
|
})
|
|
1426
1415
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1427
1416
|
], 64)) : createCommentVNode("", !0),
|
|
1428
1417
|
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1429
1418
|
key: 2,
|
|
1430
|
-
"reward-image": unref(
|
|
1431
|
-
"model-value": ((
|
|
1432
|
-
"onUpdate:modelValue":
|
|
1419
|
+
"reward-image": unref(t),
|
|
1420
|
+
"model-value": ((E = unref(l)) == null ? void 0 : E.collectibleConfig) ?? void 0,
|
|
1421
|
+
"onUpdate:modelValue": u[5] || (u[5] = (V) => l.value = {
|
|
1433
1422
|
...unref(l),
|
|
1434
|
-
collectibleConfig:
|
|
1423
|
+
collectibleConfig: V
|
|
1435
1424
|
}),
|
|
1436
|
-
"onUpdate:rewardImage":
|
|
1425
|
+
"onUpdate:rewardImage": u[6] || (u[6] = (V) => t.value = V)
|
|
1437
1426
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1438
|
-
createVNode(JsonViewer, { json: unref(
|
|
1427
|
+
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
1439
1428
|
])) : createCommentVNode("", !0)
|
|
1440
1429
|
];
|
|
1441
1430
|
}),
|
|
@@ -1447,7 +1436,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1447
1436
|
function isNullOrEmpty(e) {
|
|
1448
1437
|
return e == null || e === "";
|
|
1449
1438
|
}
|
|
1450
|
-
const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$
|
|
1439
|
+
const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1), _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1451
1440
|
__name: "RewardPoolInput",
|
|
1452
1441
|
props: {
|
|
1453
1442
|
modelValue: {
|
|
@@ -1462,37 +1451,37 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1462
1451
|
}
|
|
1463
1452
|
},
|
|
1464
1453
|
emits: ["update:model-value"],
|
|
1465
|
-
setup(e, { emit:
|
|
1466
|
-
const
|
|
1467
|
-
const d =
|
|
1454
|
+
setup(e, { emit: i }) {
|
|
1455
|
+
const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => n.modelValue ?? []), t = computed(() => {
|
|
1456
|
+
const d = s.safeParse(l.value);
|
|
1468
1457
|
return d.success ? [] : d.error.errors;
|
|
1469
|
-
}),
|
|
1470
|
-
function
|
|
1471
|
-
var
|
|
1458
|
+
}), a = ref();
|
|
1459
|
+
function c(d, u) {
|
|
1460
|
+
var y;
|
|
1472
1461
|
const f = [...l.value];
|
|
1473
|
-
f[
|
|
1462
|
+
f[u] = d, (y = a.value) == null || y.showSheet(!1), r("update:model-value", f);
|
|
1474
1463
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const
|
|
1477
|
-
(
|
|
1478
|
-
), f = CollectionUtils.formattedType((
|
|
1464
|
+
function v(d) {
|
|
1465
|
+
const u = d.type == "VOUCHER" ? d.collectibleConfig : o.collectibles.find(
|
|
1466
|
+
(k) => k._id.toString() == d.collectible
|
|
1467
|
+
), f = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), y = d.weight;
|
|
1479
1468
|
return {
|
|
1480
1469
|
label: isNullOrEmpty(f) ? "NO REWARD" : f,
|
|
1481
|
-
sublabel: `${
|
|
1470
|
+
sublabel: `${y} (${(y / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
|
|
1482
1471
|
};
|
|
1483
1472
|
}
|
|
1484
|
-
function
|
|
1473
|
+
function m(d) {
|
|
1485
1474
|
var f;
|
|
1486
|
-
const
|
|
1487
|
-
(f =
|
|
1475
|
+
const u = [...l.value];
|
|
1476
|
+
(f = a.value) == null || f.showSheet(!0, u[d], d);
|
|
1488
1477
|
}
|
|
1489
1478
|
function g(d) {
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1479
|
+
const u = [...l.value];
|
|
1480
|
+
u.splice(d, 1), r("update:model-value", u);
|
|
1492
1481
|
}
|
|
1493
|
-
function
|
|
1482
|
+
function p() {
|
|
1494
1483
|
var d;
|
|
1495
|
-
(d =
|
|
1484
|
+
(d = a.value) == null || d.showSheet(
|
|
1496
1485
|
!0,
|
|
1497
1486
|
{
|
|
1498
1487
|
type: "NO_REWARD",
|
|
@@ -1502,52 +1491,55 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1502
1491
|
l.value.length
|
|
1503
1492
|
);
|
|
1504
1493
|
}
|
|
1505
|
-
return (d,
|
|
1506
|
-
const f = resolveComponent("FmButton"),
|
|
1494
|
+
return (d, u) => {
|
|
1495
|
+
const f = resolveComponent("FmButton"), y = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
1507
1496
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1508
|
-
|
|
1497
|
+
_hoisted_2$9,
|
|
1509
1498
|
createVNode(f, {
|
|
1510
1499
|
label: "Add Reward",
|
|
1511
|
-
onClick:
|
|
1500
|
+
onClick: u[0] || (u[0] = (C) => p()),
|
|
1512
1501
|
variant: "plain",
|
|
1513
1502
|
icon: "add"
|
|
1514
1503
|
}),
|
|
1515
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (
|
|
1516
|
-
key:
|
|
1504
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(y, {
|
|
1505
|
+
key: b,
|
|
1517
1506
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1518
1507
|
variant: "outlined",
|
|
1519
|
-
onClick: (
|
|
1508
|
+
onClick: (x) => m(b)
|
|
1520
1509
|
}, {
|
|
1521
|
-
default: withCtx(() =>
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
createElementVNode("div",
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1510
|
+
default: withCtx(() => {
|
|
1511
|
+
var x;
|
|
1512
|
+
return [
|
|
1513
|
+
createElementVNode("div", null, [
|
|
1514
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(C.type == "LOYALTY" ? (x = C == null ? void 0 : C.earningOption) == null ? void 0 : x.amount : "") + " " + toDisplayString(v(C).label), 1),
|
|
1515
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
|
|
1516
|
+
]),
|
|
1517
|
+
createVNode(f, {
|
|
1518
|
+
icon: "delete",
|
|
1519
|
+
variant: "tertiary",
|
|
1520
|
+
onClick: (E) => (E.stopPropagation(), g(b))
|
|
1521
|
+
}, null, 8, ["onClick"])
|
|
1522
|
+
];
|
|
1523
|
+
}),
|
|
1532
1524
|
_: 2
|
|
1533
1525
|
}, 1032, ["onClick"]))), 128)),
|
|
1534
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1535
|
-
key:
|
|
1536
|
-
text:
|
|
1526
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(k, {
|
|
1527
|
+
key: C.message,
|
|
1528
|
+
text: C.message,
|
|
1537
1529
|
state: "error"
|
|
1538
1530
|
}, null, 8, ["text"]))), 128)),
|
|
1539
1531
|
createVNode(_sfc_main$b, {
|
|
1540
1532
|
ref_key: "sheetRef",
|
|
1541
|
-
ref:
|
|
1542
|
-
"onUpdate:modelValue":
|
|
1533
|
+
ref: a,
|
|
1534
|
+
"onUpdate:modelValue": c
|
|
1543
1535
|
}, null, 512)
|
|
1544
1536
|
]);
|
|
1545
1537
|
};
|
|
1546
1538
|
}
|
|
1547
|
-
}), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$
|
|
1539
|
+
}), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$8 = {
|
|
1548
1540
|
key: 0,
|
|
1549
1541
|
class: "grid grid-cols-2 gap-16"
|
|
1550
|
-
}, _hoisted_3$
|
|
1542
|
+
}, _hoisted_3$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1551
1543
|
__name: "PromotionGameTypeInput",
|
|
1552
1544
|
props: {
|
|
1553
1545
|
modelValue: {
|
|
@@ -1555,48 +1547,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1555
1547
|
}
|
|
1556
1548
|
},
|
|
1557
1549
|
emits: ["update:model-value"],
|
|
1558
|
-
setup(e, { emit:
|
|
1559
|
-
const
|
|
1550
|
+
setup(e, { emit: i }) {
|
|
1551
|
+
const n = e, r = i, o = computed(() => [
|
|
1560
1552
|
{
|
|
1561
1553
|
label: "Rock paper scissor",
|
|
1562
1554
|
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
1563
1555
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
1564
1556
|
}
|
|
1565
1557
|
]);
|
|
1566
|
-
return (
|
|
1567
|
-
var
|
|
1568
|
-
const
|
|
1558
|
+
return (s, l) => {
|
|
1559
|
+
var v, m, g;
|
|
1560
|
+
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
|
|
1569
1561
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1570
|
-
createVNode(
|
|
1562
|
+
createVNode(t, {
|
|
1571
1563
|
label: "Enable game",
|
|
1572
|
-
"model-value": !!((
|
|
1573
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
1564
|
+
"model-value": !!((v = e.modelValue) != null && v.gameType),
|
|
1565
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => p ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
1574
1566
|
}, null, 8, ["model-value"]),
|
|
1575
|
-
((
|
|
1576
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1577
|
-
var d,
|
|
1578
|
-
return openBlock(), createBlock(
|
|
1567
|
+
((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1568
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (p) => {
|
|
1569
|
+
var d, u;
|
|
1570
|
+
return openBlock(), createBlock(a, {
|
|
1579
1571
|
variant: "outlined",
|
|
1580
1572
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1581
|
-
"col-span-2": unref(
|
|
1582
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) ==
|
|
1583
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
1573
|
+
"col-span-2": unref(o).length == 1,
|
|
1574
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) == p.value,
|
|
1575
|
+
"hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != p.value
|
|
1584
1576
|
}]),
|
|
1585
1577
|
onClick: () => {
|
|
1586
1578
|
var f;
|
|
1587
|
-
((f =
|
|
1579
|
+
((f = n.modelValue) == null ? void 0 : f.gameType) != p.value && r("update:model-value", { gameType: p.value });
|
|
1588
1580
|
},
|
|
1589
|
-
key:
|
|
1581
|
+
key: p.value
|
|
1590
1582
|
}, {
|
|
1591
1583
|
default: withCtx(() => [
|
|
1592
|
-
createElementVNode("div", _hoisted_3$
|
|
1593
|
-
createElementVNode("div", _hoisted_4$
|
|
1584
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(p.label), 1),
|
|
1585
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(p.description), 1)
|
|
1594
1586
|
]),
|
|
1595
1587
|
_: 2
|
|
1596
1588
|
}, 1032, ["class", "onClick"]);
|
|
1597
1589
|
}), 128))
|
|
1598
1590
|
])) : createCommentVNode("", !0),
|
|
1599
|
-
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(
|
|
1591
|
+
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
|
|
1600
1592
|
key: 1,
|
|
1601
1593
|
text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
|
|
1602
1594
|
state: "warning"
|
|
@@ -1604,7 +1596,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1604
1596
|
]);
|
|
1605
1597
|
};
|
|
1606
1598
|
}
|
|
1607
|
-
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "grid grid-cols-2 gap-16" },
|
|
1599
|
+
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$7 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1608
1600
|
__name: "MissionTypeInput",
|
|
1609
1601
|
props: {
|
|
1610
1602
|
modelValue: {
|
|
@@ -1612,8 +1604,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1612
1604
|
}
|
|
1613
1605
|
},
|
|
1614
1606
|
emits: ["update:model-value"],
|
|
1615
|
-
setup(e, { emit:
|
|
1616
|
-
const
|
|
1607
|
+
setup(e, { emit: i }) {
|
|
1608
|
+
const n = e, r = i, o = computed(() => [
|
|
1617
1609
|
{
|
|
1618
1610
|
label: "Stamp",
|
|
1619
1611
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -1625,26 +1617,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1625
1617
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1626
1618
|
}
|
|
1627
1619
|
]);
|
|
1628
|
-
return (
|
|
1629
|
-
const
|
|
1620
|
+
return (s, l) => {
|
|
1621
|
+
const t = resolveComponent("FmCard");
|
|
1630
1622
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1631
|
-
|
|
1632
|
-
createElementVNode("div",
|
|
1633
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1623
|
+
_hoisted_2$7,
|
|
1624
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
1625
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
|
|
1634
1626
|
variant: "outlined",
|
|
1635
1627
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1636
|
-
"col-span-2": unref(
|
|
1637
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1638
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1628
|
+
"col-span-2": unref(o).length == 1,
|
|
1629
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
1630
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
1639
1631
|
}]),
|
|
1640
1632
|
onClick: () => {
|
|
1641
|
-
|
|
1633
|
+
n.modelValue != a.value && r("update:model-value", a.value);
|
|
1642
1634
|
},
|
|
1643
|
-
key:
|
|
1635
|
+
key: a.value
|
|
1644
1636
|
}, {
|
|
1645
1637
|
default: withCtx(() => [
|
|
1646
|
-
createElementVNode("div",
|
|
1647
|
-
createElementVNode("div",
|
|
1638
|
+
createElementVNode("div", _hoisted_4$4, toDisplayString(a.label), 1),
|
|
1639
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(a.description), 1)
|
|
1648
1640
|
]),
|
|
1649
1641
|
_: 2
|
|
1650
1642
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1652,7 +1644,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1652
1644
|
]);
|
|
1653
1645
|
};
|
|
1654
1646
|
}
|
|
1655
|
-
}), _hoisted_1$7 = { class: "space-y-16" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1647
|
+
}), _hoisted_1$7 = { class: "space-y-16" }, _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1), _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1656
1648
|
__name: "MissionEndInput",
|
|
1657
1649
|
props: {
|
|
1658
1650
|
modelValue: {
|
|
@@ -1666,23 +1658,23 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1666
1658
|
}
|
|
1667
1659
|
},
|
|
1668
1660
|
emits: ["update:model-value"],
|
|
1669
|
-
setup(e, { emit:
|
|
1670
|
-
const
|
|
1671
|
-
return (
|
|
1672
|
-
const
|
|
1661
|
+
setup(e, { emit: i }) {
|
|
1662
|
+
const n = i;
|
|
1663
|
+
return (r, o) => {
|
|
1664
|
+
const s = resolveComponent("FmStepperField");
|
|
1673
1665
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1674
|
-
|
|
1675
|
-
createVNode(
|
|
1666
|
+
_hoisted_2$6,
|
|
1667
|
+
createVNode(s, {
|
|
1676
1668
|
label: "Maximum to collect",
|
|
1677
1669
|
"model-value": e.modelValue || null,
|
|
1678
|
-
"onUpdate:modelValue":
|
|
1670
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => n("update:model-value", l)),
|
|
1679
1671
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1680
1672
|
"helper-state": e.helperState || "none"
|
|
1681
1673
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
1682
1674
|
]);
|
|
1683
1675
|
};
|
|
1684
1676
|
}
|
|
1685
|
-
}), _hoisted_1$6 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1677
|
+
}), _hoisted_1$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_2$5 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1686
1678
|
__name: "EditMissionPoolSheet",
|
|
1687
1679
|
props: {
|
|
1688
1680
|
maxThreshold: {
|
|
@@ -1691,103 +1683,103 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1691
1683
|
}
|
|
1692
1684
|
},
|
|
1693
1685
|
emits: ["update:model-value"],
|
|
1694
|
-
setup(e, { expose:
|
|
1695
|
-
const
|
|
1696
|
-
const f =
|
|
1686
|
+
setup(e, { expose: i, emit: n }) {
|
|
1687
|
+
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), c = ref(0), v = FdtoThresholdReward, m = computed(() => {
|
|
1688
|
+
const f = v.safeParse(t.value);
|
|
1697
1689
|
return f.success ? [] : f.error.errors;
|
|
1698
1690
|
});
|
|
1699
|
-
function g(f,
|
|
1700
|
-
f && (
|
|
1691
|
+
function g(f, y, k) {
|
|
1692
|
+
f && (t.value = y, c.value = k), l.value = f;
|
|
1701
1693
|
}
|
|
1702
|
-
const
|
|
1694
|
+
const p = n;
|
|
1703
1695
|
async function d() {
|
|
1704
|
-
console.log(
|
|
1705
|
-
const f =
|
|
1706
|
-
f.success && (await
|
|
1696
|
+
console.log(t.value);
|
|
1697
|
+
const f = v.safeParse(t.value);
|
|
1698
|
+
f.success && (await s(
|
|
1707
1699
|
async () => {
|
|
1708
|
-
f.data.type === "VOUCHER" &&
|
|
1709
|
-
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0,
|
|
1710
|
-
|
|
1700
|
+
f.data.type === "VOUCHER" && a.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1701
|
+
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
1702
|
+
a.value
|
|
1711
1703
|
));
|
|
1712
1704
|
},
|
|
1713
1705
|
{
|
|
1714
1706
|
message: "Uploading reward image",
|
|
1715
1707
|
successMessage: "Reward image updated"
|
|
1716
1708
|
}
|
|
1717
|
-
),
|
|
1709
|
+
), p("update:model-value", f.data, c.value));
|
|
1718
1710
|
}
|
|
1719
|
-
const
|
|
1720
|
-
return
|
|
1711
|
+
const u = ref();
|
|
1712
|
+
return i({
|
|
1721
1713
|
showSheet: g
|
|
1722
|
-
}), (f,
|
|
1723
|
-
const
|
|
1724
|
-
return openBlock(), createBlock(
|
|
1714
|
+
}), (f, y) => {
|
|
1715
|
+
const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
|
|
1716
|
+
return openBlock(), createBlock(E, {
|
|
1725
1717
|
"max-width": 560,
|
|
1726
1718
|
modelValue: unref(l),
|
|
1727
1719
|
"onUpdate:modelValue": [
|
|
1728
|
-
|
|
1729
|
-
|
|
1720
|
+
y[10] || (y[10] = (V) => isRef(l) ? l.value = V : null),
|
|
1721
|
+
y[11] || (y[11] = (V) => l.value = V)
|
|
1730
1722
|
],
|
|
1731
1723
|
header: "Edit reward",
|
|
1732
1724
|
"dismiss-away": ""
|
|
1733
1725
|
}, {
|
|
1734
1726
|
"side-sheet-footer": withCtx(() => [
|
|
1735
|
-
createElementVNode("div",
|
|
1736
|
-
createVNode(
|
|
1727
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
1728
|
+
createVNode(x, {
|
|
1737
1729
|
variant: "primary",
|
|
1738
1730
|
type: "button",
|
|
1739
1731
|
label: "Confirm",
|
|
1740
|
-
onClick:
|
|
1741
|
-
var
|
|
1742
|
-
return (
|
|
1732
|
+
onClick: y[8] || (y[8] = async () => {
|
|
1733
|
+
var V;
|
|
1734
|
+
return (V = unref(u)) == null ? void 0 : V.validateInputs();
|
|
1743
1735
|
})
|
|
1744
1736
|
}),
|
|
1745
|
-
createVNode(
|
|
1737
|
+
createVNode(x, {
|
|
1746
1738
|
variant: "secondary",
|
|
1747
1739
|
type: "button",
|
|
1748
1740
|
label: "Cancel",
|
|
1749
|
-
onClick:
|
|
1741
|
+
onClick: y[9] || (y[9] = (V) => l.value = !1)
|
|
1750
1742
|
})
|
|
1751
1743
|
])
|
|
1752
1744
|
]),
|
|
1753
1745
|
default: withCtx(() => [
|
|
1754
|
-
unref(
|
|
1746
|
+
unref(t) ? (openBlock(), createBlock(b, {
|
|
1755
1747
|
key: 0,
|
|
1756
1748
|
class: "flex flex-col gap-y-24",
|
|
1757
1749
|
ref_key: "formRef",
|
|
1758
|
-
ref:
|
|
1759
|
-
onValidationSuccess:
|
|
1750
|
+
ref: u,
|
|
1751
|
+
onValidationSuccess: y[7] || (y[7] = (V) => d())
|
|
1760
1752
|
}, {
|
|
1761
1753
|
default: withCtx(() => {
|
|
1762
|
-
var
|
|
1754
|
+
var V, N;
|
|
1763
1755
|
return [
|
|
1764
|
-
unref(
|
|
1756
|
+
unref(t).type ? (openBlock(), createBlock(k, {
|
|
1765
1757
|
key: 0,
|
|
1766
1758
|
label: "Threshold",
|
|
1767
1759
|
rules: [
|
|
1768
1760
|
unref(ZodHelper).toRule(
|
|
1769
1761
|
unref(z).number().min(1).max(
|
|
1770
|
-
|
|
1771
|
-
`Number cannot be more than ${
|
|
1762
|
+
r.maxThreshold,
|
|
1763
|
+
`Number cannot be more than ${r.maxThreshold}`
|
|
1772
1764
|
)
|
|
1773
1765
|
)
|
|
1774
1766
|
],
|
|
1775
|
-
"model-value": unref(
|
|
1776
|
-
"onUpdate:modelValue":
|
|
1777
|
-
...unref(
|
|
1778
|
-
threshold:
|
|
1767
|
+
"model-value": unref(t).threshold,
|
|
1768
|
+
"onUpdate:modelValue": y[0] || (y[0] = (h) => t.value = {
|
|
1769
|
+
...unref(t),
|
|
1770
|
+
threshold: h
|
|
1779
1771
|
})
|
|
1780
1772
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1781
|
-
createVNode(
|
|
1773
|
+
createVNode(C, {
|
|
1782
1774
|
label: "Reward Type",
|
|
1783
1775
|
items: [
|
|
1784
1776
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1785
1777
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1786
1778
|
],
|
|
1787
|
-
"model-value": unref(
|
|
1788
|
-
"onUpdate:modelValue":
|
|
1789
|
-
var
|
|
1790
|
-
|
|
1779
|
+
"model-value": unref(t).type,
|
|
1780
|
+
"onUpdate:modelValue": y[1] || (y[1] = (h) => {
|
|
1781
|
+
var R, B;
|
|
1782
|
+
h === "VOUCHER" ? t.value = {
|
|
1791
1783
|
collectible: null,
|
|
1792
1784
|
type: "VOUCHER",
|
|
1793
1785
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1800,9 +1792,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1800
1792
|
validityOption: {
|
|
1801
1793
|
validForDay: 7
|
|
1802
1794
|
},
|
|
1803
|
-
threshold: (
|
|
1804
|
-
} :
|
|
1805
|
-
collectible: unref(
|
|
1795
|
+
threshold: (R = unref(t)) == null ? void 0 : R.threshold
|
|
1796
|
+
} : t.value = {
|
|
1797
|
+
collectible: unref(o).loyaltyRewards.raw[0]._id,
|
|
1806
1798
|
type: "LOYALTY",
|
|
1807
1799
|
earningOption: {
|
|
1808
1800
|
amount: 1,
|
|
@@ -1811,59 +1803,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1811
1803
|
validityOption: {
|
|
1812
1804
|
validForDay: 7
|
|
1813
1805
|
},
|
|
1814
|
-
threshold: (
|
|
1806
|
+
threshold: (B = unref(t)) == null ? void 0 : B.threshold
|
|
1815
1807
|
};
|
|
1816
1808
|
})
|
|
1817
1809
|
}, null, 8, ["model-value"]),
|
|
1818
|
-
unref(
|
|
1810
|
+
unref(t).type == "LOYALTY" ? (openBlock(), createBlock(C, {
|
|
1819
1811
|
key: 1,
|
|
1820
1812
|
label: "Loyalty type",
|
|
1821
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1822
|
-
items: unref(
|
|
1823
|
-
"model-value": unref(
|
|
1824
|
-
"onUpdate:modelValue":
|
|
1813
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
|
|
1814
|
+
items: unref(o).loyaltyRewards.items,
|
|
1815
|
+
"model-value": unref(t).collectible,
|
|
1816
|
+
"onUpdate:modelValue": y[2] || (y[2] = (h) => unref(t).collectible = h)
|
|
1825
1817
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1826
|
-
unref(
|
|
1827
|
-
|
|
1818
|
+
unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1819
|
+
_hoisted_1$6,
|
|
1828
1820
|
createVNode(_sfc_main$e, {
|
|
1829
1821
|
class: "mt-[-8px]",
|
|
1830
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1831
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1832
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1822
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(v), "earningOption", [unref(t).type])],
|
|
1823
|
+
"helper-state": unref(ZodHelper).helperState(unref(m), "earningOption"),
|
|
1824
|
+
"error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
|
|
1833
1825
|
"fixed-type": !0,
|
|
1834
|
-
"model-value": unref(
|
|
1835
|
-
"onUpdate:modelValue":
|
|
1836
|
-
...unref(
|
|
1837
|
-
earningOption:
|
|
1826
|
+
"model-value": unref(t).earningOption,
|
|
1827
|
+
"onUpdate:modelValue": y[3] || (y[3] = (h) => t.value = {
|
|
1828
|
+
...unref(t),
|
|
1829
|
+
earningOption: h
|
|
1838
1830
|
})
|
|
1839
1831
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1840
1832
|
createVNode(_sfc_main$z, {
|
|
1841
1833
|
class: "!gap-24",
|
|
1842
|
-
"for-credit": unref(
|
|
1843
|
-
(
|
|
1844
|
-
var
|
|
1845
|
-
return
|
|
1834
|
+
"for-credit": unref(t).type === "LOYALTY" && ((V = unref(o).loyaltyRewards.items.find(
|
|
1835
|
+
(h) => {
|
|
1836
|
+
var R;
|
|
1837
|
+
return h.value === ((R = unref(t)) == null ? void 0 : R.collectible);
|
|
1846
1838
|
}
|
|
1847
|
-
)) == null ? void 0 :
|
|
1848
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1849
|
-
"model-value": unref(
|
|
1850
|
-
"onUpdate:modelValue":
|
|
1851
|
-
...unref(
|
|
1852
|
-
validityOption:
|
|
1839
|
+
)) == null ? void 0 : V.raw.type) === "CREDIT",
|
|
1840
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
|
|
1841
|
+
"model-value": unref(t).validityOption,
|
|
1842
|
+
"onUpdate:modelValue": y[4] || (y[4] = (h) => t.value = {
|
|
1843
|
+
...unref(t),
|
|
1844
|
+
validityOption: h
|
|
1853
1845
|
})
|
|
1854
1846
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1855
1847
|
], 64)) : createCommentVNode("", !0),
|
|
1856
|
-
unref(
|
|
1848
|
+
unref(t).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1857
1849
|
key: 3,
|
|
1858
|
-
"reward-image": unref(
|
|
1859
|
-
"model-value": ((
|
|
1860
|
-
"onUpdate:modelValue":
|
|
1861
|
-
...unref(
|
|
1862
|
-
collectibleConfig:
|
|
1850
|
+
"reward-image": unref(a),
|
|
1851
|
+
"model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
|
|
1852
|
+
"onUpdate:modelValue": y[5] || (y[5] = (h) => t.value = {
|
|
1853
|
+
...unref(t),
|
|
1854
|
+
collectibleConfig: h
|
|
1863
1855
|
}),
|
|
1864
|
-
"onUpdate:rewardImage":
|
|
1856
|
+
"onUpdate:rewardImage": y[6] || (y[6] = (h) => a.value = h)
|
|
1865
1857
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1866
|
-
createVNode(JsonViewer, { json: unref(
|
|
1858
|
+
createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
|
|
1867
1859
|
];
|
|
1868
1860
|
}),
|
|
1869
1861
|
_: 1
|
|
@@ -1876,7 +1868,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1876
1868
|
}), _hoisted_1$5 = {
|
|
1877
1869
|
key: 0,
|
|
1878
1870
|
class: "grid grid-cols-5 text-center gap-8 justify-between items-center w-full"
|
|
1879
|
-
}, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1871
|
+
}, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", null, "🎁", -1), _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1880
1872
|
__name: "MissionProgress",
|
|
1881
1873
|
props: {
|
|
1882
1874
|
type: {
|
|
@@ -1897,19 +1889,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1897
1889
|
}
|
|
1898
1890
|
},
|
|
1899
1891
|
setup(e) {
|
|
1900
|
-
const
|
|
1901
|
-
() => Math.min(
|
|
1902
|
-
), l = (
|
|
1903
|
-
return (
|
|
1904
|
-
const
|
|
1892
|
+
const i = e, { maxRange: n, currentRange: r, markers: o } = toRefs(i), s = computed(
|
|
1893
|
+
() => Math.min(r.value / n.value * 100, 100)
|
|
1894
|
+
), l = (t) => t / n.value * 100;
|
|
1895
|
+
return (t, a) => {
|
|
1896
|
+
const c = resolveComponent("FmIcon");
|
|
1905
1897
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1906
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(
|
|
1898
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(c, {
|
|
1907
1899
|
class: normalizeClass(
|
|
1908
|
-
unref(
|
|
1900
|
+
unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1909
1901
|
),
|
|
1910
|
-
outline: unref(
|
|
1911
|
-
key:
|
|
1912
|
-
name: unref(
|
|
1902
|
+
outline: unref(r) < v,
|
|
1903
|
+
key: v,
|
|
1904
|
+
name: unref(o).some((m) => m === v) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
1913
1905
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
1914
1906
|
])) : (openBlock(), createElementBlock("div", {
|
|
1915
1907
|
key: 1,
|
|
@@ -1917,18 +1909,18 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1917
1909
|
}, [
|
|
1918
1910
|
createElementVNode("div", {
|
|
1919
1911
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
1920
|
-
style: normalizeStyle({ width: unref(
|
|
1912
|
+
style: normalizeStyle({ width: unref(s) + "%" })
|
|
1921
1913
|
}, null, 4),
|
|
1922
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1923
|
-
key:
|
|
1914
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (v, m) => (openBlock(), createElementBlock("div", {
|
|
1915
|
+
key: m,
|
|
1924
1916
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
1925
|
-
style: normalizeStyle({ left: l(
|
|
1917
|
+
style: normalizeStyle({ left: l(v) + "%" })
|
|
1926
1918
|
}, [
|
|
1927
1919
|
createElementVNode("div", _hoisted_2$4, [
|
|
1928
1920
|
createElementVNode("div", {
|
|
1929
1921
|
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
1930
1922
|
}),
|
|
1931
|
-
|
|
1923
|
+
_hoisted_3$4
|
|
1932
1924
|
])
|
|
1933
1925
|
], 4))), 128))
|
|
1934
1926
|
]));
|
|
@@ -1936,19 +1928,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1936
1928
|
}
|
|
1937
1929
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1938
1930
|
function changeKeysFactory(e) {
|
|
1939
|
-
return function
|
|
1940
|
-
if (
|
|
1941
|
-
return
|
|
1942
|
-
if (Array.isArray(
|
|
1943
|
-
return
|
|
1944
|
-
const
|
|
1945
|
-
return Object.keys(
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1948
|
-
}),
|
|
1931
|
+
return function i(n, r = 1, o) {
|
|
1932
|
+
if (r === 0 || !isObject(n))
|
|
1933
|
+
return n;
|
|
1934
|
+
if (Array.isArray(n))
|
|
1935
|
+
return n.map((l) => i(l, r - 1, o));
|
|
1936
|
+
const s = Object.create(Object.getPrototypeOf(n));
|
|
1937
|
+
return Object.keys(n).forEach((l) => {
|
|
1938
|
+
const t = n[l], a = e(l, o), c = i(t, r - 1, o);
|
|
1939
|
+
s[a] = c;
|
|
1940
|
+
}), s;
|
|
1949
1941
|
};
|
|
1950
1942
|
}
|
|
1951
|
-
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1943
|
+
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1), _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1), _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1952
1944
|
__name: "MissionPoolInput",
|
|
1953
1945
|
props: {
|
|
1954
1946
|
modelValue: {
|
|
@@ -1961,43 +1953,43 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1961
1953
|
}
|
|
1962
1954
|
},
|
|
1963
1955
|
emits: ["update:model-value"],
|
|
1964
|
-
setup(e, { emit:
|
|
1965
|
-
const
|
|
1966
|
-
() =>
|
|
1967
|
-
),
|
|
1968
|
-
const
|
|
1969
|
-
return
|
|
1970
|
-
}),
|
|
1971
|
-
function
|
|
1972
|
-
var
|
|
1973
|
-
const
|
|
1974
|
-
|
|
1956
|
+
setup(e, { emit: i }) {
|
|
1957
|
+
const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1958
|
+
() => n.modelValue.sort((u, f) => u.threshold - f.threshold) ?? []
|
|
1959
|
+
), t = computed(() => {
|
|
1960
|
+
const u = s.safeParse(l.value);
|
|
1961
|
+
return u.success ? [] : u.error.errors;
|
|
1962
|
+
}), a = ref();
|
|
1963
|
+
function c(u, f) {
|
|
1964
|
+
var k;
|
|
1965
|
+
const y = [...l.value];
|
|
1966
|
+
y[f] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", y);
|
|
1975
1967
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const f =
|
|
1978
|
-
(
|
|
1979
|
-
),
|
|
1968
|
+
function v(u) {
|
|
1969
|
+
const f = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
|
|
1970
|
+
(k) => k._id.toString() == u.collectible
|
|
1971
|
+
), y = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
|
|
1980
1972
|
return {
|
|
1981
|
-
label: isNullOrEmpty(
|
|
1982
|
-
sublabel: `Reward at ${
|
|
1973
|
+
label: isNullOrEmpty(y) ? "NO REWARD" : y,
|
|
1974
|
+
sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
|
|
1983
1975
|
};
|
|
1984
1976
|
}
|
|
1985
|
-
function
|
|
1986
|
-
var
|
|
1977
|
+
function m(u) {
|
|
1978
|
+
var y;
|
|
1987
1979
|
const f = [...l.value];
|
|
1988
|
-
(
|
|
1980
|
+
(y = a.value) == null || y.showSheet(!0, f[u], u);
|
|
1989
1981
|
}
|
|
1990
|
-
function g(
|
|
1982
|
+
function g(u) {
|
|
1991
1983
|
const f = [...l.value];
|
|
1992
|
-
f.splice(
|
|
1984
|
+
f.splice(u, 1), r("update:model-value", f);
|
|
1993
1985
|
}
|
|
1994
|
-
function
|
|
1995
|
-
var
|
|
1996
|
-
(
|
|
1986
|
+
function p() {
|
|
1987
|
+
var u;
|
|
1988
|
+
(u = a.value) == null || u.showSheet(
|
|
1997
1989
|
!0,
|
|
1998
1990
|
{
|
|
1999
1991
|
type: "LOYALTY",
|
|
2000
|
-
collectible:
|
|
1992
|
+
collectible: o.loyaltyRewards.items[0].value,
|
|
2001
1993
|
threshold: null,
|
|
2002
1994
|
validityOption: {
|
|
2003
1995
|
validForDay: 7
|
|
@@ -2010,71 +2002,71 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2010
2002
|
l.value.length
|
|
2011
2003
|
);
|
|
2012
2004
|
}
|
|
2013
|
-
function d(
|
|
2014
|
-
var f,
|
|
2015
|
-
return
|
|
2016
|
-
((
|
|
2017
|
-
(
|
|
2018
|
-
)) == null ? void 0 :
|
|
2005
|
+
function d(u) {
|
|
2006
|
+
var f, y;
|
|
2007
|
+
return u.type == "VOUCHER" ? (f = u.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
|
|
2008
|
+
((y = o.loyaltyRewards.items.find(
|
|
2009
|
+
(k) => k.value == u.collectible
|
|
2010
|
+
)) == null ? void 0 : y.label) || ""
|
|
2019
2011
|
);
|
|
2020
2012
|
}
|
|
2021
|
-
return (
|
|
2022
|
-
const
|
|
2013
|
+
return (u, f) => {
|
|
2014
|
+
const y = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2023
2015
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2024
|
-
|
|
2025
|
-
createVNode(
|
|
2016
|
+
_hoisted_2$3,
|
|
2017
|
+
createVNode(y, {
|
|
2026
2018
|
label: "Add Reward",
|
|
2027
|
-
onClick: f[0] || (f[0] = (
|
|
2019
|
+
onClick: f[0] || (f[0] = (b) => p()),
|
|
2028
2020
|
variant: "plain",
|
|
2029
2021
|
icon: "add"
|
|
2030
2022
|
}),
|
|
2031
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (
|
|
2032
|
-
key:
|
|
2023
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (b, x) => (openBlock(), createBlock(k, {
|
|
2024
|
+
key: x,
|
|
2033
2025
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2034
2026
|
variant: "outlined",
|
|
2035
|
-
onClick: (
|
|
2027
|
+
onClick: (E) => m(x)
|
|
2036
2028
|
}, {
|
|
2037
2029
|
default: withCtx(() => [
|
|
2038
2030
|
createElementVNode("div", null, [
|
|
2039
|
-
createElementVNode("div",
|
|
2040
|
-
createElementVNode("div",
|
|
2031
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(v(b).label), 1),
|
|
2032
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(v(b).sublabel), 1)
|
|
2041
2033
|
]),
|
|
2042
|
-
createVNode(
|
|
2034
|
+
createVNode(y, {
|
|
2043
2035
|
icon: "delete",
|
|
2044
2036
|
variant: "tertiary",
|
|
2045
|
-
onClick: (
|
|
2037
|
+
onClick: (E) => (E.stopPropagation(), g(x))
|
|
2046
2038
|
}, null, 8, ["onClick"])
|
|
2047
2039
|
]),
|
|
2048
2040
|
_: 2
|
|
2049
2041
|
}, 1032, ["onClick"]))), 128)),
|
|
2050
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2051
|
-
key:
|
|
2052
|
-
text:
|
|
2042
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(C, {
|
|
2043
|
+
key: b.message,
|
|
2044
|
+
text: b.message,
|
|
2053
2045
|
state: "error"
|
|
2054
2046
|
}, null, 8, ["text"]))), 128)),
|
|
2055
|
-
|
|
2056
|
-
(openBlock(), createBlock(
|
|
2047
|
+
_hoisted_5$2,
|
|
2048
|
+
(openBlock(), createBlock(k, {
|
|
2057
2049
|
key: 0,
|
|
2058
2050
|
variant: "outlined",
|
|
2059
2051
|
class: "p-24 space-y-16 w-fit"
|
|
2060
2052
|
}, {
|
|
2061
2053
|
default: withCtx(() => {
|
|
2062
|
-
var
|
|
2054
|
+
var b, x;
|
|
2063
2055
|
return [
|
|
2064
|
-
createElementVNode("div",
|
|
2056
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
2065
2057
|
createElementVNode("div", null, [
|
|
2066
|
-
createElementVNode("div",
|
|
2067
|
-
|
|
2058
|
+
createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((b = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : b.earningOption.amount) > 1 ? (x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? d(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
2059
|
+
_hoisted_8$2
|
|
2068
2060
|
])
|
|
2069
2061
|
]),
|
|
2070
|
-
createElementVNode("div",
|
|
2062
|
+
createElementVNode("div", _hoisted_9$2, [
|
|
2071
2063
|
createVNode(_sfc_main$5, {
|
|
2072
2064
|
type: e.mission.type,
|
|
2073
2065
|
"max-range": e.mission.end,
|
|
2074
2066
|
currentRange: e.mission.end / 4,
|
|
2075
|
-
markers: e.modelValue.map((
|
|
2067
|
+
markers: e.modelValue.map((E) => E.threshold)
|
|
2076
2068
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
2077
|
-
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div",
|
|
2069
|
+
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
2078
2070
|
])
|
|
2079
2071
|
];
|
|
2080
2072
|
}),
|
|
@@ -2082,24 +2074,24 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2082
2074
|
})),
|
|
2083
2075
|
createVNode(_sfc_main$6, {
|
|
2084
2076
|
ref_key: "sheetRef",
|
|
2085
|
-
ref:
|
|
2086
|
-
"onUpdate:modelValue":
|
|
2077
|
+
ref: a,
|
|
2078
|
+
"onUpdate:modelValue": c,
|
|
2087
2079
|
"max-threshold": e.mission.end
|
|
2088
2080
|
}, null, 8, ["max-threshold"])
|
|
2089
2081
|
]);
|
|
2090
2082
|
};
|
|
2091
2083
|
}
|
|
2092
|
-
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "grid grid-cols-2 gap-16" },
|
|
2084
|
+
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1), _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1), _hoisted_10$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1), _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2093
2085
|
__name: "MissionInput",
|
|
2094
2086
|
props: {
|
|
2095
2087
|
modelValue: Object
|
|
2096
2088
|
},
|
|
2097
2089
|
emits: ["update:model-value"],
|
|
2098
|
-
setup(e, { emit:
|
|
2099
|
-
const
|
|
2100
|
-
const l = FdoMission.safeParse(
|
|
2090
|
+
setup(e, { emit: i }) {
|
|
2091
|
+
const n = e, r = computed(() => {
|
|
2092
|
+
const l = FdoMission.safeParse(n.modelValue);
|
|
2101
2093
|
return l.success ? [] : l.error.errors;
|
|
2102
|
-
}),
|
|
2094
|
+
}), o = computed(() => [
|
|
2103
2095
|
{
|
|
2104
2096
|
label: "Stamp",
|
|
2105
2097
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -2110,59 +2102,59 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2110
2102
|
description: "Reward customers when they reach a cumulative spending goal.",
|
|
2111
2103
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
2112
2104
|
}
|
|
2113
|
-
]),
|
|
2114
|
-
return (l,
|
|
2115
|
-
var
|
|
2116
|
-
const
|
|
2105
|
+
]), s = i;
|
|
2106
|
+
return (l, t) => {
|
|
2107
|
+
var v;
|
|
2108
|
+
const a = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
|
|
2117
2109
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2118
2110
|
createElementVNode("div", _hoisted_2$2, [
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
createElementVNode("div",
|
|
2122
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2123
|
-
var g,
|
|
2124
|
-
return openBlock(), createBlock(
|
|
2111
|
+
_hoisted_3$2,
|
|
2112
|
+
_hoisted_4$2,
|
|
2113
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
2114
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (m) => {
|
|
2115
|
+
var g, p;
|
|
2116
|
+
return openBlock(), createBlock(a, {
|
|
2125
2117
|
variant: "outlined",
|
|
2126
2118
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2127
|
-
"col-span-2": unref(
|
|
2128
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) ==
|
|
2129
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2119
|
+
"col-span-2": unref(o).length == 1,
|
|
2120
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) == m.value,
|
|
2121
|
+
"hover:bg-fm-color-opacity-sm": ((p = e.modelValue) == null ? void 0 : p.type) != m.value
|
|
2130
2122
|
}]),
|
|
2131
2123
|
onClick: () => {
|
|
2132
|
-
var d,
|
|
2133
|
-
((d = e.modelValue) == null ? void 0 : d.type) !=
|
|
2124
|
+
var d, u;
|
|
2125
|
+
((d = e.modelValue) == null ? void 0 : d.type) != m.value && s("update:model-value", {
|
|
2134
2126
|
...e.modelValue,
|
|
2135
|
-
type:
|
|
2136
|
-
end: ((
|
|
2127
|
+
type: m.value,
|
|
2128
|
+
end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
|
|
2137
2129
|
});
|
|
2138
2130
|
},
|
|
2139
|
-
key:
|
|
2131
|
+
key: m.value
|
|
2140
2132
|
}, {
|
|
2141
2133
|
default: withCtx(() => [
|
|
2142
|
-
createElementVNode("div",
|
|
2143
|
-
createElementVNode("div",
|
|
2134
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(m.label), 1),
|
|
2135
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(m.description), 1)
|
|
2144
2136
|
]),
|
|
2145
2137
|
_: 2
|
|
2146
2138
|
}, 1032, ["class", "onClick"]);
|
|
2147
2139
|
}), 128))
|
|
2148
2140
|
])
|
|
2149
2141
|
]),
|
|
2150
|
-
createElementVNode("div",
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
createVNode(
|
|
2142
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
2143
|
+
_hoisted_9$1,
|
|
2144
|
+
_hoisted_10$1,
|
|
2145
|
+
createVNode(c, {
|
|
2154
2146
|
label: "Maximum to collect",
|
|
2155
|
-
"model-value": ((
|
|
2156
|
-
"onUpdate:modelValue":
|
|
2147
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
2148
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => {
|
|
2157
2149
|
var g;
|
|
2158
|
-
return
|
|
2150
|
+
return s("update:model-value", {
|
|
2159
2151
|
...e.modelValue,
|
|
2160
2152
|
type: ((g = e.modelValue) == null ? void 0 : g.type) || "STAMP",
|
|
2161
|
-
end:
|
|
2153
|
+
end: m
|
|
2162
2154
|
});
|
|
2163
2155
|
}),
|
|
2164
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
2165
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2156
|
+
"helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
|
|
2157
|
+
"helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
|
|
2166
2158
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
2167
2159
|
])
|
|
2168
2160
|
]);
|
|
@@ -2190,205 +2182,204 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2190
2182
|
}
|
|
2191
2183
|
},
|
|
2192
2184
|
emits: ["update:model-value", "update:file"],
|
|
2193
|
-
setup(e, { emit:
|
|
2194
|
-
const
|
|
2195
|
-
function
|
|
2196
|
-
switch (
|
|
2185
|
+
setup(e, { emit: i }) {
|
|
2186
|
+
const n = e, r = i;
|
|
2187
|
+
function o(a) {
|
|
2188
|
+
switch (n.field.type) {
|
|
2197
2189
|
case "timeframe":
|
|
2198
|
-
const
|
|
2199
|
-
|
|
2190
|
+
const c = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
|
|
2191
|
+
r("update:model-value", {
|
|
2200
2192
|
type: "timeframe",
|
|
2201
2193
|
property: "__now",
|
|
2202
|
-
start:
|
|
2203
|
-
end:
|
|
2194
|
+
start: c,
|
|
2195
|
+
end: v
|
|
2204
2196
|
});
|
|
2205
2197
|
break;
|
|
2206
2198
|
case "image": {
|
|
2207
|
-
|
|
2199
|
+
r(
|
|
2208
2200
|
"update:file",
|
|
2209
|
-
|
|
2210
|
-
|
|
2201
|
+
a,
|
|
2202
|
+
s.value || firebaseStorage.collectibleImagePath(void 0, a)
|
|
2211
2203
|
);
|
|
2212
2204
|
break;
|
|
2213
2205
|
}
|
|
2214
2206
|
default:
|
|
2215
|
-
|
|
2207
|
+
r("update:model-value", a);
|
|
2216
2208
|
break;
|
|
2217
2209
|
}
|
|
2218
2210
|
}
|
|
2219
|
-
const
|
|
2220
|
-
switch (
|
|
2211
|
+
const s = computed(() => {
|
|
2212
|
+
switch (n.field.type) {
|
|
2221
2213
|
case "timeframe": {
|
|
2222
|
-
const
|
|
2214
|
+
const a = n.modelValue;
|
|
2223
2215
|
return {
|
|
2224
|
-
startDate:
|
|
2225
|
-
endDate:
|
|
2216
|
+
startDate: a != null && a.start ? hooks(a == null ? void 0 : a.start).format("YYYY-MM-DD") : null,
|
|
2217
|
+
endDate: a != null && a.end ? hooks(a == null ? void 0 : a.end).format("YYYY-MM-DD") : null
|
|
2226
2218
|
};
|
|
2227
2219
|
}
|
|
2228
2220
|
default:
|
|
2229
|
-
return
|
|
2221
|
+
return n.modelValue;
|
|
2230
2222
|
}
|
|
2231
2223
|
});
|
|
2232
|
-
function
|
|
2233
|
-
if (!
|
|
2234
|
-
const
|
|
2235
|
-
return
|
|
2224
|
+
function l() {
|
|
2225
|
+
if (!t.value.schema) return [];
|
|
2226
|
+
const a = t.value.schema.safeParse(n.modelValue);
|
|
2227
|
+
return a.success ? [] : a.error.errors;
|
|
2236
2228
|
}
|
|
2237
|
-
const
|
|
2238
|
-
schema:
|
|
2239
|
-
unwrapped:
|
|
2240
|
-
rules:
|
|
2241
|
-
labelMark:
|
|
2242
|
-
zodLabel:
|
|
2229
|
+
const t = computed(() => ({
|
|
2230
|
+
schema: n.schema,
|
|
2231
|
+
unwrapped: n.schema ? ZodHelper.unwrap(n.schema) : void 0,
|
|
2232
|
+
rules: n.schema ? [ZodHelper.ruleAtPath(n.schema, "")] : void 0,
|
|
2233
|
+
labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
|
|
2234
|
+
zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
|
|
2243
2235
|
}));
|
|
2244
|
-
return (
|
|
2245
|
-
var
|
|
2246
|
-
const
|
|
2247
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
2236
|
+
return (a, c) => {
|
|
2237
|
+
var u, f, y, k, C;
|
|
2238
|
+
const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
|
|
2239
|
+
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
2248
2240
|
key: 0,
|
|
2249
|
-
label:
|
|
2250
|
-
"label-mark": unref(
|
|
2251
|
-
rules: unref(
|
|
2252
|
-
"model-value": unref(
|
|
2253
|
-
"onUpdate:modelValue":
|
|
2241
|
+
label: e.field.label,
|
|
2242
|
+
"label-mark": unref(t).labelMark,
|
|
2243
|
+
rules: unref(t).rules,
|
|
2244
|
+
"model-value": unref(s),
|
|
2245
|
+
"onUpdate:modelValue": o,
|
|
2254
2246
|
"helper-state": e.helperText ? "error" : void 0,
|
|
2255
2247
|
"helper-text": e.helperText
|
|
2256
2248
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2257
2249
|
createVNode(JsonViewer, {
|
|
2258
|
-
json: { schema: unref(
|
|
2250
|
+
json: { schema: unref(t).unwrapped, props: n }
|
|
2259
2251
|
}, null, 8, ["json"]),
|
|
2260
|
-
createVNode(
|
|
2261
|
-
label:
|
|
2262
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(
|
|
2263
|
-
"model-value": unref(
|
|
2264
|
-
rules: e.field.isRuleChildren ? [] : unref(
|
|
2265
|
-
"onUpdate:modelValue":
|
|
2252
|
+
createVNode(m, {
|
|
2253
|
+
label: e.field.label,
|
|
2254
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(t).labelMark,
|
|
2255
|
+
"model-value": unref(s),
|
|
2256
|
+
rules: e.field.isRuleChildren ? [] : unref(t).rules,
|
|
2257
|
+
"onUpdate:modelValue": o,
|
|
2266
2258
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
2267
2259
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
2268
2260
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2269
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
2261
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
|
|
2270
2262
|
key: 2,
|
|
2271
|
-
label:
|
|
2272
|
-
"label-mark": unref(
|
|
2273
|
-
rules: unref(
|
|
2274
|
-
"model-value": unref(
|
|
2275
|
-
"onUpdate:modelValue":
|
|
2263
|
+
label: e.field.label,
|
|
2264
|
+
"label-mark": unref(t).labelMark,
|
|
2265
|
+
rules: unref(t).rules,
|
|
2266
|
+
"model-value": unref(s),
|
|
2267
|
+
"onUpdate:modelValue": o,
|
|
2276
2268
|
"show-word-count": "",
|
|
2277
|
-
"max-length": (
|
|
2269
|
+
"max-length": (C = (k = (y = (f = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : f._def) == null ? void 0 : y.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
|
|
2278
2270
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2279
2271
|
key: 3,
|
|
2280
2272
|
"campaign-type": e.extras,
|
|
2281
|
-
"model-value": unref(
|
|
2273
|
+
"model-value": unref(s),
|
|
2282
2274
|
disabled: e.disabled,
|
|
2283
|
-
"onUpdate:modelValue":
|
|
2275
|
+
"onUpdate:modelValue": o
|
|
2284
2276
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2285
2277
|
createVNode(_sfc_main$h, {
|
|
2286
|
-
"model-value": unref(
|
|
2287
|
-
"onUpdate:modelValue":
|
|
2278
|
+
"model-value": unref(s),
|
|
2279
|
+
"onUpdate:modelValue": o
|
|
2288
2280
|
}, null, 8, ["model-value"]),
|
|
2289
|
-
createVNode(
|
|
2281
|
+
createVNode(p, {
|
|
2290
2282
|
class: "!mt-[8px]",
|
|
2291
|
-
text: unref(ZodHelper).helperText(
|
|
2292
|
-
state: unref(ZodHelper).helperState(
|
|
2283
|
+
text: unref(ZodHelper).helperText(l(), ""),
|
|
2284
|
+
state: unref(ZodHelper).helperState(l(), "")
|
|
2293
2285
|
}, null, 8, ["text", "state"])
|
|
2294
2286
|
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$v, {
|
|
2295
2287
|
key: 5,
|
|
2296
|
-
thumbnail: unref(
|
|
2288
|
+
thumbnail: unref(s),
|
|
2297
2289
|
"aspect-ratio": "16 / 9",
|
|
2298
2290
|
class: "w-1/2 xs:w-2/3",
|
|
2299
|
-
"onUpdate:file":
|
|
2291
|
+
"onUpdate:file": o
|
|
2300
2292
|
}, {
|
|
2301
2293
|
label: withCtx(() => [
|
|
2302
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
2294
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
|
|
2303
2295
|
]),
|
|
2304
2296
|
_: 1
|
|
2305
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
2297
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
|
|
2306
2298
|
key: 6,
|
|
2307
|
-
label:
|
|
2299
|
+
label: e.field.label,
|
|
2308
2300
|
"label-placement": "right",
|
|
2309
2301
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2310
|
-
"label-mark": unref(
|
|
2311
|
-
rules: unref(
|
|
2312
|
-
"model-value": unref(
|
|
2313
|
-
"onUpdate:modelValue":
|
|
2302
|
+
"label-mark": unref(t).labelMark,
|
|
2303
|
+
rules: unref(t).rules,
|
|
2304
|
+
"model-value": unref(s),
|
|
2305
|
+
"onUpdate:modelValue": o
|
|
2314
2306
|
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2315
2307
|
key: 7,
|
|
2316
|
-
"model-value": unref(
|
|
2317
|
-
"onUpdate:modelValue":
|
|
2308
|
+
"model-value": unref(s),
|
|
2309
|
+
"onUpdate:modelValue": o,
|
|
2318
2310
|
"no-campaign": !1,
|
|
2319
|
-
schema: unref(
|
|
2311
|
+
schema: unref(t).schema,
|
|
2320
2312
|
"is-mission": e.extras === "MISSION"
|
|
2321
2313
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
2322
2314
|
key: 8,
|
|
2323
|
-
"model-value": unref(
|
|
2324
|
-
"onUpdate:modelValue":
|
|
2315
|
+
"model-value": unref(s),
|
|
2316
|
+
"onUpdate:modelValue": o
|
|
2325
2317
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
2326
2318
|
createVNode(_sfc_main$w, {
|
|
2327
|
-
"model-value": unref(
|
|
2328
|
-
"onUpdate:modelValue":
|
|
2319
|
+
"model-value": unref(s),
|
|
2320
|
+
"onUpdate:modelValue": o,
|
|
2329
2321
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2330
2322
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2331
|
-
unref(
|
|
2323
|
+
unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
|
|
2332
2324
|
key: 0,
|
|
2333
2325
|
class: "!mt-[8px]",
|
|
2334
|
-
text:
|
|
2326
|
+
text: "Effect is required",
|
|
2335
2327
|
state: "error"
|
|
2336
|
-
}
|
|
2328
|
+
}))
|
|
2337
2329
|
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
|
|
2338
2330
|
key: 10,
|
|
2339
|
-
"
|
|
2340
|
-
"
|
|
2341
|
-
"
|
|
2342
|
-
"helper-text": unref(ZodHelper).helperText(o(), ""),
|
|
2331
|
+
"model-value": unref(s),
|
|
2332
|
+
"onUpdate:modelValue": o,
|
|
2333
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
2343
2334
|
"trigger-type": e.field.extras,
|
|
2344
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2335
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
2345
2336
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
2346
2337
|
key: 11,
|
|
2347
|
-
"model-value": unref(
|
|
2348
|
-
"onUpdate:modelValue":
|
|
2338
|
+
"model-value": unref(s),
|
|
2339
|
+
"onUpdate:modelValue": o,
|
|
2349
2340
|
extras: e.extras,
|
|
2350
2341
|
"error-text": e.helperText
|
|
2351
2342
|
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$z, {
|
|
2352
2343
|
key: 12,
|
|
2353
2344
|
type: "custom",
|
|
2354
|
-
"model-value": unref(
|
|
2355
|
-
"onUpdate:modelValue":
|
|
2356
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
2345
|
+
"model-value": unref(s),
|
|
2346
|
+
"onUpdate:modelValue": o,
|
|
2347
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
|
|
2357
2348
|
}, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
|
|
2358
2349
|
key: 13,
|
|
2359
|
-
"model-value": unref(
|
|
2360
|
-
"onUpdate:modelValue":
|
|
2350
|
+
"model-value": unref(s),
|
|
2351
|
+
"onUpdate:modelValue": o
|
|
2361
2352
|
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
2362
2353
|
key: 14,
|
|
2363
|
-
"model-value": unref(
|
|
2364
|
-
"onUpdate:modelValue":
|
|
2354
|
+
"model-value": unref(s),
|
|
2355
|
+
"onUpdate:modelValue": o
|
|
2365
2356
|
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
2366
2357
|
key: 15,
|
|
2367
|
-
"model-value": unref(
|
|
2368
|
-
"onUpdate:modelValue":
|
|
2358
|
+
"model-value": unref(s),
|
|
2359
|
+
"onUpdate:modelValue": o
|
|
2369
2360
|
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
2370
2361
|
key: 16,
|
|
2371
|
-
"model-value": unref(
|
|
2372
|
-
"onUpdate:modelValue":
|
|
2362
|
+
"model-value": unref(s),
|
|
2363
|
+
"onUpdate:modelValue": o
|
|
2373
2364
|
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
2374
2365
|
key: 17,
|
|
2375
|
-
"model-value": unref(
|
|
2376
|
-
"onUpdate:modelValue":
|
|
2377
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
2378
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2366
|
+
"model-value": unref(s),
|
|
2367
|
+
"onUpdate:modelValue": o,
|
|
2368
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
2369
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
2379
2370
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
2380
2371
|
key: 18,
|
|
2381
|
-
"model-value": unref(
|
|
2382
|
-
"onUpdate:modelValue":
|
|
2372
|
+
"model-value": unref(s),
|
|
2373
|
+
"onUpdate:modelValue": o,
|
|
2383
2374
|
mission: e.extras.mission
|
|
2384
2375
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
2385
2376
|
createVNode(_sfc_main$g, {
|
|
2386
|
-
"model-value": unref(
|
|
2387
|
-
"onUpdate:modelValue":
|
|
2377
|
+
"model-value": unref(s),
|
|
2378
|
+
"onUpdate:modelValue": o,
|
|
2388
2379
|
"start-date": e.extras.start,
|
|
2389
2380
|
"end-date": e.extras.end
|
|
2390
2381
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
2391
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2382
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2392
2383
|
key: 0,
|
|
2393
2384
|
class: "!mt-[8px]",
|
|
2394
2385
|
text: e.helperText,
|
|
@@ -2396,26 +2387,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2396
2387
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2397
2388
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
2398
2389
|
createVNode(_sfc_main$o, {
|
|
2399
|
-
"model-value": unref(
|
|
2400
|
-
"onUpdate:modelValue":
|
|
2390
|
+
"model-value": unref(s),
|
|
2391
|
+
"onUpdate:modelValue": o
|
|
2401
2392
|
}, null, 8, ["model-value"]),
|
|
2402
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2393
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2403
2394
|
key: 0,
|
|
2404
2395
|
class: "!mt-[8px]",
|
|
2405
2396
|
text: e.helperText,
|
|
2406
2397
|
state: "error"
|
|
2407
2398
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2408
2399
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
2409
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(
|
|
2400
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
|
|
2410
2401
|
key: 0,
|
|
2411
2402
|
state: "warning",
|
|
2412
2403
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
2413
2404
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2414
2405
|
createVNode(_sfc_main$n, {
|
|
2415
|
-
"model-value": unref(
|
|
2416
|
-
"onUpdate:modelValue":
|
|
2406
|
+
"model-value": unref(s),
|
|
2407
|
+
"onUpdate:modelValue": o
|
|
2417
2408
|
}, null, 8, ["model-value"]),
|
|
2418
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2409
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2419
2410
|
key: 1,
|
|
2420
2411
|
class: "!mt-[8px]",
|
|
2421
2412
|
text: e.helperText,
|
|
@@ -2423,10 +2414,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2423
2414
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2424
2415
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
2425
2416
|
createVNode(_sfc_main$m, {
|
|
2426
|
-
"model-value": unref(
|
|
2427
|
-
"onUpdate:modelValue":
|
|
2417
|
+
"model-value": unref(s),
|
|
2418
|
+
"onUpdate:modelValue": o
|
|
2428
2419
|
}, null, 8, ["model-value"]),
|
|
2429
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2420
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2430
2421
|
key: 0,
|
|
2431
2422
|
class: "!mt-[8px]",
|
|
2432
2423
|
text: e.helperText,
|
|
@@ -2434,10 +2425,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2434
2425
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2435
2426
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
2436
2427
|
createVNode(_sfc_main$k, {
|
|
2437
|
-
"model-value": unref(
|
|
2438
|
-
"onUpdate:modelValue":
|
|
2428
|
+
"model-value": unref(s),
|
|
2429
|
+
"onUpdate:modelValue": o
|
|
2439
2430
|
}, null, 8, ["model-value"]),
|
|
2440
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2431
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2441
2432
|
key: 0,
|
|
2442
2433
|
class: "!mt-[8px]",
|
|
2443
2434
|
text: e.helperText,
|
|
@@ -2445,10 +2436,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2445
2436
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2446
2437
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
2447
2438
|
createVNode(_sfc_main$l, {
|
|
2448
|
-
"model-value": unref(
|
|
2449
|
-
"onUpdate:modelValue":
|
|
2439
|
+
"model-value": unref(s),
|
|
2440
|
+
"onUpdate:modelValue": o
|
|
2450
2441
|
}, null, 8, ["model-value"]),
|
|
2451
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2442
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2452
2443
|
key: 0,
|
|
2453
2444
|
class: "!mt-[8px]",
|
|
2454
2445
|
text: e.helperText,
|
|
@@ -2456,19 +2447,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2456
2447
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2457
2448
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
2458
2449
|
createVNode(_sfc_main$9, {
|
|
2459
|
-
"model-value": unref(
|
|
2460
|
-
"onUpdate:modelValue":
|
|
2450
|
+
"model-value": unref(s),
|
|
2451
|
+
"onUpdate:modelValue": o
|
|
2461
2452
|
}, null, 8, ["model-value"]),
|
|
2462
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2453
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2463
2454
|
key: 0,
|
|
2464
2455
|
class: "!mt-[8px]",
|
|
2465
2456
|
text: e.helperText,
|
|
2466
2457
|
state: "error"
|
|
2467
2458
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2468
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
2459
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(n.field), 1));
|
|
2469
2460
|
};
|
|
2470
2461
|
}
|
|
2471
|
-
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" },
|
|
2462
|
+
}), _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Campaign summary", -1), _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1), _hoisted_3$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2472
2463
|
__name: "CampaignSummary",
|
|
2473
2464
|
props: {
|
|
2474
2465
|
data: {
|
|
@@ -2477,23 +2468,22 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2477
2468
|
}
|
|
2478
2469
|
},
|
|
2479
2470
|
setup(e) {
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
return openBlock(), createBlock(i, {
|
|
2471
|
+
return (i, n) => {
|
|
2472
|
+
const r = resolveComponent("FmCard");
|
|
2473
|
+
return openBlock(), createBlock(r, {
|
|
2484
2474
|
variant: "outlined",
|
|
2485
2475
|
class: "p-16 space-y-8"
|
|
2486
2476
|
}, {
|
|
2487
2477
|
default: withCtx(() => [
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
2478
|
+
_hoisted_1$1,
|
|
2479
|
+
_hoisted_2$1,
|
|
2480
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, s) => (openBlock(), createElementBlock("div", {
|
|
2491
2481
|
class: "space-y-4",
|
|
2492
|
-
key:
|
|
2482
|
+
key: s
|
|
2493
2483
|
}, [
|
|
2494
|
-
|
|
2495
|
-
createElementVNode("div",
|
|
2496
|
-
createElementVNode("div",
|
|
2484
|
+
o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2485
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(s), 1),
|
|
2486
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(o), 1)
|
|
2497
2487
|
], 64)) : createCommentVNode("", !0)
|
|
2498
2488
|
]))), 128))
|
|
2499
2489
|
]),
|
|
@@ -2504,47 +2494,62 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2504
2494
|
}), _hoisted_1 = { class: "xs:hidden px-24 pb-[14px] pt-[22px] flex items-center justify-between w-full border-b" }, _hoisted_2 = { class: "flex items-center gap-8" }, _hoisted_3 = {
|
|
2505
2495
|
key: 0,
|
|
2506
2496
|
class: "max-w-6xl mx-auto"
|
|
2507
|
-
}, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" },
|
|
2497
|
+
}, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
|
|
2498
|
+
/* @__PURE__ */ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
|
|
2499
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2500
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2501
|
+
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
2502
|
+
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2503
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2504
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2505
|
+
]),
|
|
2506
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2507
|
+
]),
|
|
2508
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2509
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2510
|
+
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
2511
|
+
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2512
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2513
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2514
|
+
]),
|
|
2515
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2516
|
+
])
|
|
2517
|
+
])
|
|
2518
|
+
], -1), _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2508
2519
|
__name: "EditCampaignSheet",
|
|
2509
2520
|
emits: ["submit:model-value"],
|
|
2510
2521
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2511
|
-
const Dialog = useDialog(), sheetVisible = ref(!1),
|
|
2522
|
+
const Dialog = useDialog(), sheetVisible = ref(!1), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
2512
2523
|
TEMPLATES.VOUCHER
|
|
2513
2524
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
|
|
2514
2525
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
2515
|
-
var e,
|
|
2526
|
+
var e, i;
|
|
2516
2527
|
if (sheetVisible.value = visible, visible == !0) {
|
|
2517
2528
|
try {
|
|
2518
2529
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
2519
2530
|
} catch {
|
|
2520
2531
|
} finally {
|
|
2521
|
-
await new Promise((
|
|
2532
|
+
await new Promise((n) => setTimeout(n, 120)), isLoading.value = !1;
|
|
2522
2533
|
}
|
|
2523
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
2524
|
-
|
|
2525
|
-
(
|
|
2526
|
-
) &&
|
|
2534
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((n, r) => {
|
|
2535
|
+
n.campaign.type === "VOUCHER" && n.campaign.code && useCampaignStore().campaigns.voucher.some(
|
|
2536
|
+
(o) => o.code === n.campaign.code && o._id.toString() !== n.campaign._id.toString()
|
|
2537
|
+
) && r.addIssue({
|
|
2527
2538
|
code: "custom",
|
|
2528
2539
|
message: "Code already exists, please use another code",
|
|
2529
2540
|
path: ["campaign", "code"]
|
|
2530
2541
|
});
|
|
2531
2542
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
2532
|
-
...(
|
|
2543
|
+
...(i = template.value) == null ? void 0 : i.defaultValue
|
|
2533
2544
|
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
|
|
2534
2545
|
}
|
|
2535
2546
|
}
|
|
2536
2547
|
async function hideSheet() {
|
|
2537
2548
|
Dialog.open({
|
|
2538
|
-
title:
|
|
2539
|
-
message:
|
|
2540
|
-
primaryActions: {
|
|
2541
|
-
|
|
2542
|
-
close: !0
|
|
2543
|
-
},
|
|
2544
|
-
secondaryActions: {
|
|
2545
|
-
text: t("connect.campaign.common.unsaved_changes_cancel"),
|
|
2546
|
-
close: !1
|
|
2547
|
-
}
|
|
2549
|
+
title: "Unsaved Changes",
|
|
2550
|
+
message: "Are you sure you want to discard this changes?",
|
|
2551
|
+
primaryActions: { text: "Discard", close: !0 },
|
|
2552
|
+
secondaryActions: { text: "Cancel", close: !1 }
|
|
2548
2553
|
}).onPrimary(() => {
|
|
2549
2554
|
sheetVisible.value = !1;
|
|
2550
2555
|
}).onSecondary(() => {
|
|
@@ -2556,10 +2561,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2556
2561
|
return e.success ? [] : e.error.errors;
|
|
2557
2562
|
});
|
|
2558
2563
|
function stepErrors(e = currentStep.value - 1) {
|
|
2559
|
-
const
|
|
2560
|
-
(
|
|
2564
|
+
const i = template.value.steps[e].groups.flatMap(
|
|
2565
|
+
(n) => n.fields.map((r) => r.property)
|
|
2561
2566
|
);
|
|
2562
|
-
return errors.value.filter((
|
|
2567
|
+
return errors.value.filter((n) => i.includes(n.path.join(".")));
|
|
2563
2568
|
}
|
|
2564
2569
|
__expose({ showSheet });
|
|
2565
2570
|
function showSummaryDialog() {
|
|
@@ -2571,9 +2576,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2571
2576
|
}
|
|
2572
2577
|
});
|
|
2573
2578
|
}
|
|
2574
|
-
function onUpdateProperty(e,
|
|
2575
|
-
if (_.set(data.value, e,
|
|
2576
|
-
const
|
|
2579
|
+
function onUpdateProperty(e, i) {
|
|
2580
|
+
if (_.set(data.value, e, i), e == "campaign.event.type") {
|
|
2581
|
+
const n = RuleBuilder.setRuleToGroup(
|
|
2577
2582
|
RuleBuilder.scaffoldGroup(),
|
|
2578
2583
|
[
|
|
2579
2584
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -2581,7 +2586,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2581
2586
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
2582
2587
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
2583
2588
|
]
|
|
2584
|
-
),
|
|
2589
|
+
), r = RuleBuilder.setRuleToGroup(
|
|
2585
2590
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2586
2591
|
[
|
|
2587
2592
|
RuleBuilder.constructEntry(
|
|
@@ -2593,29 +2598,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2593
2598
|
],
|
|
2594
2599
|
"&&"
|
|
2595
2600
|
);
|
|
2596
|
-
if (
|
|
2597
|
-
_.set(data.value, "campaign.event.rule",
|
|
2601
|
+
if (i != "SCHEDULE") {
|
|
2602
|
+
_.set(data.value, "campaign.event.rule", n);
|
|
2598
2603
|
return;
|
|
2599
2604
|
}
|
|
2600
2605
|
_.set(
|
|
2601
2606
|
data.value,
|
|
2602
2607
|
"campaign.event.rule",
|
|
2603
|
-
RuleBuilder.setRuleToGroup(
|
|
2608
|
+
RuleBuilder.setRuleToGroup(n, r)
|
|
2604
2609
|
);
|
|
2605
2610
|
}
|
|
2606
|
-
e == "campaign.notify" &&
|
|
2611
|
+
e == "campaign.notify" && i == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
2607
2612
|
}
|
|
2608
|
-
async function onUpdateFile(e,
|
|
2609
|
-
return e ? await minor(async () => firebaseStorage.update(
|
|
2613
|
+
async function onUpdateFile(e, i) {
|
|
2614
|
+
return e ? await minor(async () => firebaseStorage.update(i, e), {
|
|
2610
2615
|
message: `${e ? "Uploading" : "Removing"} file`,
|
|
2611
2616
|
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
2612
2617
|
}) : "";
|
|
2613
2618
|
}
|
|
2614
2619
|
function isDisable(e) {
|
|
2615
|
-
var
|
|
2620
|
+
var i, n;
|
|
2616
2621
|
switch (e == null ? void 0 : e.property) {
|
|
2617
2622
|
case "campaign.event.type":
|
|
2618
|
-
return ((
|
|
2623
|
+
return ((n = (i = data.value) == null ? void 0 : i.campaign) == null ? void 0 : n._id) || !1;
|
|
2619
2624
|
default:
|
|
2620
2625
|
return !1;
|
|
2621
2626
|
}
|
|
@@ -2624,30 +2629,30 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2624
2629
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
2625
2630
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2626
2631
|
}
|
|
2627
|
-
return (e,
|
|
2628
|
-
const
|
|
2632
|
+
return (e, i) => {
|
|
2633
|
+
const n = resolveComponent("FmButton"), r = resolveComponent("FmStep"), o = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2629
2634
|
return openBlock(), createBlock(l, {
|
|
2630
2635
|
"fullscreen-size": "lg",
|
|
2631
2636
|
modelValue: unref(sheetVisible),
|
|
2632
2637
|
"onUpdate:modelValue": [
|
|
2633
|
-
|
|
2634
|
-
|
|
2638
|
+
i[7] || (i[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
|
|
2639
|
+
i[8] || (i[8] = (t) => sheetVisible.value = t)
|
|
2635
2640
|
]
|
|
2636
2641
|
}, createSlots({
|
|
2637
2642
|
"top-sheet-header": withCtx(() => [
|
|
2638
2643
|
createElementVNode("div", _hoisted_1, [
|
|
2639
2644
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2640
2645
|
createElementVNode("div", _hoisted_2, [
|
|
2641
|
-
createVNode(
|
|
2642
|
-
onClick:
|
|
2643
|
-
label:
|
|
2646
|
+
createVNode(n, {
|
|
2647
|
+
onClick: i[0] || (i[0] = (t) => hideSheet()),
|
|
2648
|
+
label: "Cancel",
|
|
2644
2649
|
variant: "tertiary"
|
|
2645
|
-
}
|
|
2646
|
-
createVNode(
|
|
2650
|
+
}),
|
|
2651
|
+
createVNode(n, {
|
|
2647
2652
|
onClick: onSubmit,
|
|
2648
|
-
label:
|
|
2653
|
+
label: "Save",
|
|
2649
2654
|
disabled: unref(errors).length > 0
|
|
2650
|
-
}, null, 8, ["
|
|
2655
|
+
}, null, 8, ["disabled"])
|
|
2651
2656
|
])
|
|
2652
2657
|
])
|
|
2653
2658
|
]),
|
|
@@ -2659,29 +2664,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2659
2664
|
createElementVNode("div", _hoisted_9, [
|
|
2660
2665
|
createElementVNode("div", _hoisted_10, [
|
|
2661
2666
|
createElementVNode("div", _hoisted_11, [
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2665
|
-
createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2666
|
-
createElementVNode("div", { class: "space-y-3" }, [
|
|
2667
|
-
createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2668
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2669
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2670
|
-
]),
|
|
2671
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2672
|
-
]),
|
|
2673
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2674
|
-
createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2675
|
-
createElementVNode("div", { class: "space-y-3" }, [
|
|
2676
|
-
createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2677
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2678
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2679
|
-
]),
|
|
2680
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2681
|
-
])
|
|
2682
|
-
])
|
|
2683
|
-
], -1)),
|
|
2684
|
-
createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2667
|
+
_hoisted_12,
|
|
2668
|
+
createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2685
2669
|
])
|
|
2686
2670
|
])
|
|
2687
2671
|
])
|
|
@@ -2691,51 +2675,51 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2691
2675
|
name: "default",
|
|
2692
2676
|
fn: withCtx(() => [
|
|
2693
2677
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2694
|
-
createVNode(
|
|
2678
|
+
createVNode(o, {
|
|
2695
2679
|
modelValue: unref(currentStep),
|
|
2696
|
-
"onUpdate:modelValue":
|
|
2680
|
+
"onUpdate:modelValue": i[1] || (i[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2697
2681
|
orientation: "horizontal",
|
|
2698
2682
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2699
2683
|
}, {
|
|
2700
2684
|
default: withCtx(() => [
|
|
2701
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2702
|
-
key:
|
|
2703
|
-
title:
|
|
2704
|
-
value:
|
|
2705
|
-
error: () => stepErrors(
|
|
2706
|
-
complete: () =>
|
|
2685
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
|
|
2686
|
+
key: t.name,
|
|
2687
|
+
title: t.name,
|
|
2688
|
+
value: a + 1,
|
|
2689
|
+
error: () => stepErrors(a).length > 0,
|
|
2690
|
+
complete: () => a + 1 <= unref(currentStep)
|
|
2707
2691
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
2708
2692
|
]),
|
|
2709
2693
|
_: 1
|
|
2710
2694
|
}, 8, ["modelValue"]),
|
|
2711
2695
|
createElementVNode("div", _hoisted_4, [
|
|
2712
|
-
createVNode(
|
|
2696
|
+
createVNode(n, {
|
|
2713
2697
|
icon: "close",
|
|
2714
2698
|
variant: "tertiary",
|
|
2715
|
-
onClick:
|
|
2699
|
+
onClick: i[2] || (i[2] = (t) => sheetVisible.value = !1)
|
|
2716
2700
|
}),
|
|
2717
|
-
createVNode(
|
|
2701
|
+
createVNode(o, {
|
|
2718
2702
|
modelValue: unref(currentStep),
|
|
2719
|
-
"onUpdate:modelValue":
|
|
2703
|
+
"onUpdate:modelValue": i[3] || (i[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2720
2704
|
orientation: "horizontal",
|
|
2721
2705
|
class: "flex-1"
|
|
2722
2706
|
}, {
|
|
2723
2707
|
default: withCtx(() => [
|
|
2724
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2725
|
-
key:
|
|
2708
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
|
|
2709
|
+
key: t.name,
|
|
2726
2710
|
title: unref(sheetTitle),
|
|
2727
|
-
description:
|
|
2728
|
-
value:
|
|
2729
|
-
error: () => stepErrors(
|
|
2730
|
-
complete: () =>
|
|
2711
|
+
description: t.name,
|
|
2712
|
+
value: a + 1,
|
|
2713
|
+
error: () => stepErrors(a).length > 0,
|
|
2714
|
+
complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
2731
2715
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
2732
2716
|
]),
|
|
2733
2717
|
_: 1
|
|
2734
2718
|
}, 8, ["modelValue"]),
|
|
2735
|
-
createVNode(
|
|
2719
|
+
createVNode(n, {
|
|
2736
2720
|
icon: "info",
|
|
2737
2721
|
variant: "tertiary",
|
|
2738
|
-
onClick:
|
|
2722
|
+
onClick: i[4] || (i[4] = () => showSummaryDialog())
|
|
2739
2723
|
})
|
|
2740
2724
|
]),
|
|
2741
2725
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -2744,54 +2728,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2744
2728
|
json: {
|
|
2745
2729
|
data: unref(data),
|
|
2746
2730
|
errors: unref(errors).map(
|
|
2747
|
-
(
|
|
2731
|
+
(t) => `${t.path.join(".")} - ${t.message}`
|
|
2748
2732
|
),
|
|
2749
2733
|
stepErrors: stepErrors().map(
|
|
2750
|
-
(
|
|
2734
|
+
(t) => `${t.path.join(".")} - ${t.message}`
|
|
2751
2735
|
),
|
|
2752
2736
|
schema: unref(schema)
|
|
2753
2737
|
}
|
|
2754
2738
|
}, null, 8, ["json"]),
|
|
2755
2739
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2756
|
-
(
|
|
2757
|
-
), (
|
|
2758
|
-
key:
|
|
2740
|
+
(t) => t.fields.length && (!t.condition || unref(_).get(unref(data), t.condition.property) == t.condition.value == (t.condition.not != !0))
|
|
2741
|
+
), (t, a) => (openBlock(), createElementBlock("div", {
|
|
2742
|
+
key: a,
|
|
2759
2743
|
class: "space-y-24"
|
|
2760
2744
|
}, [
|
|
2761
|
-
createElementVNode("div", _hoisted_7, toDisplayString(
|
|
2762
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2745
|
+
createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
|
|
2746
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (c, v) => (openBlock(), createElementBlock("div", { key: v }, [
|
|
2763
2747
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2764
|
-
key:
|
|
2765
|
-
field:
|
|
2766
|
-
modelValue: unref(_).get(unref(data),
|
|
2767
|
-
disabled: isDisable(
|
|
2768
|
-
"onUpdate:modelValue": (
|
|
2769
|
-
"onUpdate:file": async (
|
|
2770
|
-
const
|
|
2771
|
-
onUpdateProperty(
|
|
2748
|
+
key: v,
|
|
2749
|
+
field: c,
|
|
2750
|
+
modelValue: unref(_).get(unref(data), c.property),
|
|
2751
|
+
disabled: isDisable(c),
|
|
2752
|
+
"onUpdate:modelValue": (m) => onUpdateProperty(c.property, m),
|
|
2753
|
+
"onUpdate:file": async (m, g) => {
|
|
2754
|
+
const p = await onUpdateFile(m, g);
|
|
2755
|
+
onUpdateProperty(c.property, p || "");
|
|
2772
2756
|
},
|
|
2773
2757
|
schema: unref(ZodHelper).typeAtPath(
|
|
2774
2758
|
unref(schema),
|
|
2775
|
-
|
|
2759
|
+
c.property,
|
|
2776
2760
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2777
2761
|
),
|
|
2778
|
-
"helper-state": unref(ZodHelper).helperState(unref(errors),
|
|
2779
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2780
|
-
extras:
|
|
2762
|
+
"helper-state": unref(ZodHelper).helperState(unref(errors), c.property),
|
|
2763
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), c.property),
|
|
2764
|
+
extras: c.extras != null ? c.extras == "" ? unref(data) : unref(_).get(unref(data), c.extras) : void 0
|
|
2781
2765
|
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
2782
2766
|
]))), 128))
|
|
2783
2767
|
]))), 128)),
|
|
2784
2768
|
createElementVNode("div", _hoisted_8, [
|
|
2785
|
-
createVNode(
|
|
2769
|
+
createVNode(n, {
|
|
2786
2770
|
label: "Back",
|
|
2787
2771
|
variant: "tertiary",
|
|
2788
2772
|
disabled: unref(currentStep) == 1,
|
|
2789
|
-
onClick:
|
|
2773
|
+
onClick: i[5] || (i[5] = (t) => currentStep.value--)
|
|
2790
2774
|
}, null, 8, ["disabled"]),
|
|
2791
|
-
createVNode(
|
|
2775
|
+
createVNode(n, {
|
|
2792
2776
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2793
2777
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
2794
|
-
onClick:
|
|
2778
|
+
onClick: i[6] || (i[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2795
2779
|
}, null, 8, ["disabled", "label"])
|
|
2796
2780
|
])
|
|
2797
2781
|
]),
|