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