@feedmepos/mf-connect 0.1.70-prod → 0.1.72-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-PyqBxIYV.js → Analytic-CxQKbOnR.js} +163 -163
- package/dist/{App-Jvndjs57.js → App-C0HCgYW2.js} +7 -7
- package/dist/{Bin-COT0Y0Ho.js → Bin-BFx6j8vs.js} +8 -8
- package/dist/{Broadcast-BEXF2mv2.js → Broadcast-CUfwWq6_.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D_2YsnqM.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-2oosZTlv.js} +6 -6
- package/dist/{Card-B_PJslck.js → Card-DsMVa01V.js} +16 -16
- package/dist/{Collections-BNXcAI8E.js → Collections-DSbNXU78.js} +72 -71
- package/dist/{Credit-CbefgVBA.js → Credit-Dp-tSMfE.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BWrvk8cN.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BW7V_Nsq.js} +817 -794
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D7QHcodO.js +348 -0
- package/dist/{Experience-D4PlCeQu.js → Experience-DkQbI88m.js} +8 -8
- package/dist/{Game-ByPV3v3c.js → Game-BJvtVGC7.js} +9 -9
- package/dist/{Index-CTE6GcPE.js → Index-BcHe2Qqe.js} +10 -10
- package/dist/{Marketing-CBarYi4e.js → Marketing-BaYjdZpb.js} +6 -6
- package/dist/{Member-aiHpHoBw.js → Member-BzrcLN4X.js} +10 -10
- package/dist/{MemberList-ZfDDJKU8.js → MemberList-_uD6WR--.js} +25 -25
- package/dist/{MemberTransactions-YPSNz6QZ.js → MemberTransactions-DIG5noli.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DyJKk8W7.js → MessageInput.vue_vue_type_script_setup_true_lang-Cm4jVJBM.js} +7 -7
- package/dist/{Mission-CX9m_lVc.js → Mission-B0h7ECrd.js} +9 -9
- package/dist/{Overview-93wWO0vg.js → Overview-BfjTYcaf.js} +18 -18
- package/dist/{Point-CvBoOpox.js → Point-yBqZgf08.js} +8 -8
- package/dist/{Promotion-DzABoX1Q.js → Promotion-Bh8yiwPe.js} +9 -9
- package/dist/{Queue-CLsAkssT.js → Queue-CMMyxmWP.js} +10 -10
- package/dist/{Record-D7H9PUO9.js → Record-DSLpbGVk.js} +8 -8
- package/dist/{Reward-RuXRWNEz.js → Reward-BzAIdcgx.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BhooU8k4.js → RewardGroup.vue_vue_type_script_setup_true_lang-DoGsPRbi.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CX4uEjpm.js → RuleGroup.vue_vue_type_script_setup_true_lang-B7qMLC2M.js} +595 -591
- package/dist/{Segment-DttKqwI6.js → Segment-BVH3YC8I.js} +22 -22
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Bc52DzKg.js → SelectItems.vue_vue_type_script_setup_true_lang-BkHWRVba.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cs31sJoR.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D-4QjkWh.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVDJSZ2m.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzCSXHge.js} +3 -3
- package/dist/{Setting-B-OauIYc.js → Setting-CFLtqHFJ.js} +12 -12
- package/dist/{SettingAdvertisements-DgeX4O4l.js → SettingAdvertisements-CvFG5Fun.js} +11 -11
- package/dist/{Store-DXolnTox.js → Store-CHcszdPx.js} +19 -19
- package/dist/{StoreRewards-AZL1ZRuo.js → StoreRewards-BXrXO3Cg.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-EdoXx3OE.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Clou5scZ.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-mHmnkhIP.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BEpXudTV.js} +1 -1
- package/dist/{Tier-C95me-Y-.js → Tier-98o6YCz1.js} +19 -19
- package/dist/{Title-Cl3aYevK.js → Title-BmvCMh9F.js} +18 -18
- package/dist/{Transaction-DQXVmId0.js → Transaction-D07dnpCB.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D8Kfo_M8.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DHvItthe.js} +6 -6
- package/dist/{Voucher-C-P0YBPO.js → Voucher-BX5Dy6oL.js} +12 -12
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BlXCP_IR.js +421 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXArW7Vz.js → ZodTextField.vue_vue_type_script_setup_true_lang-TkZAyKkk.js} +1 -1
- package/dist/{app-B6euOjfV.js → app-7Ivt_7kS.js} +1974 -914
- package/dist/{app-7__6-fNI.js → app-C98aAmiY.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-qci70l-A.js → business-B55rTB5S.js} +1 -1
- package/dist/{campaign-FPNFOCIx.js → campaign-RS-eYMBW.js} +1 -1
- package/dist/campaign-dSphYCws.js +226 -0
- package/dist/{campaign.enum-BshKRCYQ.js → campaign.enum-BZRXf9TI.js} +1 -1
- package/dist/{campaign.fn-B5brKxfK.js → campaign.fn-D_b763b6.js} +73 -73
- package/dist/{collectible.enum-BYIdgjMd.js → collectible.enum-ANnJMtnj.js} +1 -1
- package/dist/{collection.fn-Czegj-3i.js → collection.fn-BObHG1bS.js} +2 -2
- package/dist/{dto-CoTw6KOu.js → dto-BA2PX6Mi.js} +4 -4
- package/dist/{effect-AUk5fAKr.js → effect-DDAGMMzr.js} +1 -1
- package/dist/{email-addresses-CzoIsTNA.js → email-addresses-jx17hvtN.js} +1 -1
- package/dist/{export-a4tq7KAV.js → export-DI_2PZhY.js} +3 -3
- package/dist/{helper-BPAmOP7l.js → helper-ApDLcgT1.js} +1 -1
- package/dist/{index-DFrGNKGq.js → index-B5J1HBw3.js} +1 -1
- package/dist/{index-DyNcdfkp.js → index-BCOxYH7r.js} +1 -1
- package/dist/{index-CPHYlicy.js → index-BbNMr2Lt.js} +3 -3
- package/dist/{index-DROE-IrQ.js → index-C1tcqVNm.js} +3 -3
- package/dist/{index-BqKYZ98Q.js → index-CEeIezsZ.js} +1 -1
- package/dist/{index-CGryjlaX.js → index-CN0ree8J.js} +1 -1
- package/dist/{index-CQ4_BfJL.js → index-Cl85lvDM.js} +1 -1
- package/dist/{index-ZC8SINKX.js → index-CtpRdZKH.js} +2 -2
- package/dist/{index-BioBPRnA.js → index-DUfWM7U3.js} +1023 -1023
- package/dist/{index-DD6t-ukB.js → index-D_9bRGRa.js} +1 -1
- package/dist/{index-DdTu5PZ4.js → index-Dg6gbVXO.js} +1 -1
- package/dist/{index-BicoBDJX.js → index-Dpe36Jv6.js} +4 -4
- package/dist/{index-CKd9UEIG.js → index-DtB1XLw6.js} +183 -178
- package/dist/{index.esm2017-DBUyLYkl.js → index.esm2017-CcAT1nnu.js} +1 -1
- package/dist/{loading-E0yVUdfI.js → loading-Hh5FSOP9.js} +1 -1
- package/dist/{membership-yP4z8gbJ.js → membership-DXQf9Mj3.js} +3 -3
- package/dist/{money-DhnXYNa2.js → money-OBHKTSCa.js} +1 -1
- package/dist/{number-XYUCGxPv.js → number-DTqujv4j.js} +1 -1
- package/dist/{objectid-BfQ_M2eI.js → objectid-BkZDKSpn.js} +1 -1
- package/dist/{campaign-D_eIup7X.js → plugins-CQqQawn6.js} +784 -776
- package/dist/{reward-B3J0dhNd.js → reward-n9uPwsH1.js} +1 -1
- package/dist/{rule-BzqUqJYa.js → rule-BgsibUNE.js} +3 -3
- package/dist/{rule-builder-BvtsmkMr.js → rule-builder-BkzqGukH.js} +1 -1
- package/dist/template-gXT-yGOY.js +188 -0
- package/dist/{timezone-BCyUSe2a.js → timezone-X-iXAUqa.js} +1 -1
- package/dist/{trigger-DCSJm_qA.js → trigger-DEZuV7Fw.js} +4 -4
- package/dist/{user-BwjCcgQT.js → user-DG_FfcGk.js} +1 -1
- package/dist/{vue-i18n-BLkfzQts.js → vue-i18n-BB1YkgAs.js} +201 -201
- package/dist/{xlsx-D2Uw1Ytp.js → xlsx-CJQa9ako.js} +1 -1
- package/package.json +1 -1
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVdF1Urm.js +0 -348
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DRn1HmAb.js +0 -419
- package/dist/plugins-bpWCIR9y.js +0 -208
- package/dist/template-BFr8iIV_.js +0 -190
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass,
|
|
1
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
|
|
2
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { z } from "./app-
|
|
3
|
+
import { z } from "./app-7Ivt_7kS.js";
|
|
4
4
|
import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
10
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BvtsmkMr.js";
|
|
5
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-BA2PX6Mi.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-DXQf9Mj3.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-B55rTB5S.js";
|
|
8
|
+
import "./index-CtpRdZKH.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BkzqGukH.js";
|
|
11
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
12
11
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
13
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-BZRXf9TI.js";
|
|
14
13
|
import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js";
|
|
15
|
-
import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
16
|
-
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { p as prompt,
|
|
20
|
-
import { u as useI18n } from "./vue-i18n-
|
|
21
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-
|
|
22
|
-
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { C as CountryTimezone, m as moment } from "./timezone-
|
|
24
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
14
|
+
import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-D7QHcodO.js";
|
|
15
|
+
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BEpXudTV.js";
|
|
16
|
+
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DHvItthe.js";
|
|
17
|
+
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-B7qMLC2M.js";
|
|
18
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-CQqQawn6.js";
|
|
19
|
+
import { u as useI18n } from "./vue-i18n-BB1YkgAs.js";
|
|
20
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-DEZuV7Fw.js";
|
|
21
|
+
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-Cm4jVJBM.js";
|
|
22
|
+
import { C as CountryTimezone, m as moment } from "./timezone-X-iXAUqa.js";
|
|
23
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BgsibUNE.js";
|
|
25
24
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
26
|
-
import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
27
|
-
import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-
|
|
28
|
-
import { T as TEMPLATES } from "./index-
|
|
29
|
-
import "./index-
|
|
30
|
-
import "./index-
|
|
31
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
32
|
-
import { u as useLoading } from "./loading-
|
|
33
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
34
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
25
|
+
import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BlXCP_IR.js";
|
|
26
|
+
import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-Dpe36Jv6.js";
|
|
27
|
+
import { T as TEMPLATES } from "./index-DtB1XLw6.js";
|
|
28
|
+
import "./index-D_9bRGRa.js";
|
|
29
|
+
import "./index-BbNMr2Lt.js";
|
|
30
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-ANnJMtnj.js";
|
|
31
|
+
import { u as useLoading } from "./loading-Hh5FSOP9.js";
|
|
32
|
+
import { i as initCollectibleConfig } from "./helper-ApDLcgT1.js";
|
|
33
|
+
import { C as CollectionUtils } from "./collection.fn-BObHG1bS.js";
|
|
35
34
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
36
|
-
import "./
|
|
35
|
+
import { c as getCampaignSummaryObject } from "./campaign-dSphYCws.js";
|
|
36
|
+
import "./index-DUfWM7U3.js";
|
|
37
37
|
import { useDialog } from "@feedmepos/ui-library";
|
|
38
|
-
import { u as useCampaignStore } from "./campaign-
|
|
39
|
-
import { S as SvcConfig } from "./index-
|
|
38
|
+
import { u as useCampaignStore } from "./campaign-RS-eYMBW.js";
|
|
39
|
+
import { S as SvcConfig } from "./index-C1tcqVNm.js";
|
|
40
40
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
41
41
|
const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
42
42
|
__name: "TimeRuleGroup",
|
|
@@ -49,82 +49,82 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
49
49
|
},
|
|
50
50
|
emits: ["update:model-value"],
|
|
51
51
|
setup(e, { emit: m }) {
|
|
52
|
-
const { t:
|
|
53
|
-
!
|
|
52
|
+
const { t: o } = useI18n(), c = e, s = m, p = ref(
|
|
53
|
+
!c.modelValue || !c.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(c.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
54
54
|
);
|
|
55
|
-
watch(
|
|
56
|
-
var
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
watch(p, async (l, i) => {
|
|
56
|
+
var a;
|
|
57
|
+
if (i == "custom" && l == "all_time" && RuleBuilder.getRules((a = c.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
58
|
+
const f = await prompt.confirm(
|
|
59
|
+
o("connect.template.rule.time.confirm_remove"),
|
|
60
|
+
o("connect.common.confirm"),
|
|
61
|
+
o("connect.common.confirm"),
|
|
62
|
+
o("connect.common.cancel")
|
|
63
63
|
);
|
|
64
|
-
|
|
64
|
+
f && s(
|
|
65
65
|
"update:model-value",
|
|
66
66
|
RuleBuilder.setRuleToGroup(
|
|
67
|
-
|
|
67
|
+
c.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
68
68
|
RuleBuilder.scaffoldGroup("g_time")
|
|
69
69
|
)
|
|
70
|
-
),
|
|
70
|
+
), p.value = f ? l : i;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
async function l
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
73
|
+
async function n(l) {
|
|
74
|
+
var i;
|
|
75
|
+
if (l == "custom" && RuleBuilder.getRules((i = c.modelValue) == null ? void 0 : i.rules.g_time).length > 0) {
|
|
76
76
|
if (!await prompt.confirm(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
o("connect.template.rule.time.confirm_remove"),
|
|
78
|
+
o("connect.common.confirm"),
|
|
79
|
+
o("connect.common.confirm"),
|
|
80
|
+
o("connect.common.cancel")
|
|
81
81
|
)) {
|
|
82
|
-
|
|
82
|
+
p.value = "all_time";
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
s(
|
|
86
86
|
"update:model-value",
|
|
87
87
|
RuleBuilder.setRuleToGroup(
|
|
88
|
-
|
|
88
|
+
c.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
89
89
|
RuleBuilder.scaffoldGroup("g_time")
|
|
90
90
|
)
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
return (
|
|
95
|
-
var
|
|
96
|
-
const
|
|
94
|
+
return (l, i) => {
|
|
95
|
+
var y;
|
|
96
|
+
const a = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
|
|
97
97
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
98
|
-
createVNode(
|
|
99
|
-
modelValue: unref(
|
|
98
|
+
createVNode(f, {
|
|
99
|
+
modelValue: unref(p),
|
|
100
100
|
"onUpdate:modelValue": [
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
i[0] || (i[0] = (v) => isRef(p) ? p.value = v : null),
|
|
102
|
+
i[1] || (i[1] = (v) => n(v))
|
|
103
103
|
]
|
|
104
104
|
}, {
|
|
105
105
|
default: withCtx(() => [
|
|
106
|
-
createVNode(
|
|
107
|
-
label: unref(
|
|
106
|
+
createVNode(a, {
|
|
107
|
+
label: unref(o)("connect.template.rule.time.all_time"),
|
|
108
108
|
value: "all_time"
|
|
109
109
|
}, null, 8, ["label"]),
|
|
110
|
-
createVNode(
|
|
111
|
-
label: unref(
|
|
110
|
+
createVNode(a, {
|
|
111
|
+
label: unref(o)("connect.template.rule.time.custom"),
|
|
112
112
|
value: "custom"
|
|
113
113
|
}, null, 8, ["label"])
|
|
114
114
|
]),
|
|
115
115
|
_: 1
|
|
116
116
|
}, 8, ["modelValue"]),
|
|
117
|
-
unref(
|
|
117
|
+
unref(p) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
118
118
|
key: 0,
|
|
119
119
|
class: "!mt-[0px]",
|
|
120
120
|
"include-only": "trigger",
|
|
121
121
|
"trigger-type": "SCHEDULE",
|
|
122
|
-
"model-value": ((
|
|
123
|
-
"onUpdate:modelValue":
|
|
122
|
+
"model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
123
|
+
"onUpdate:modelValue": i[2] || (i[2] = (v) => s(
|
|
124
124
|
"update:model-value",
|
|
125
125
|
unref(RuleBuilder).setRuleToGroup(
|
|
126
126
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
127
|
-
|
|
127
|
+
v,
|
|
128
128
|
"&&"
|
|
129
129
|
)
|
|
130
130
|
))
|
|
@@ -141,28 +141,28 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
141
141
|
},
|
|
142
142
|
emits: ["update:model-value"],
|
|
143
143
|
setup(e, { emit: m }) {
|
|
144
|
-
const
|
|
145
|
-
const { property:
|
|
146
|
-
|
|
144
|
+
const { t: o } = useI18n(), c = e, s = m, p = computed(() => {
|
|
145
|
+
const { property: n, operator: l, equator: i } = RuleBuilder.simplify(
|
|
146
|
+
c.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
147
147
|
op: "before",
|
|
148
148
|
x: 1
|
|
149
149
|
})
|
|
150
150
|
);
|
|
151
151
|
return {
|
|
152
|
-
property:
|
|
152
|
+
property: n,
|
|
153
153
|
operator: l,
|
|
154
|
-
equator:
|
|
154
|
+
equator: i
|
|
155
155
|
};
|
|
156
156
|
});
|
|
157
|
-
return (
|
|
158
|
-
const
|
|
157
|
+
return (n, l) => {
|
|
158
|
+
const i = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
|
|
159
159
|
return openBlock(), createElementBlock("div", null, [
|
|
160
|
-
createVNode(
|
|
161
|
-
label: "
|
|
160
|
+
createVNode(i, {
|
|
161
|
+
label: unref(o)("connect.template.rule.birthday.on_birthday"),
|
|
162
162
|
value: "_isRange-day",
|
|
163
|
-
"model-value": `${unref(
|
|
163
|
+
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
164
164
|
"onUpdate:modelValue": l[0] || (l[0] = () => {
|
|
165
|
-
|
|
165
|
+
s(
|
|
166
166
|
"update:model-value",
|
|
167
167
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
168
168
|
op: "this",
|
|
@@ -171,13 +171,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
171
171
|
})
|
|
172
172
|
);
|
|
173
173
|
})
|
|
174
|
-
}, null, 8, ["model-value"]),
|
|
175
|
-
createVNode(
|
|
176
|
-
label: "
|
|
174
|
+
}, null, 8, ["label", "model-value"]),
|
|
175
|
+
createVNode(i, {
|
|
176
|
+
label: unref(o)("connect.template.rule.birthday.days_before"),
|
|
177
177
|
value: "_isDay",
|
|
178
|
-
"model-value": unref(
|
|
178
|
+
"model-value": unref(p).operator,
|
|
179
179
|
"onUpdate:modelValue": l[1] || (l[1] = () => {
|
|
180
|
-
|
|
180
|
+
s(
|
|
181
181
|
"update:model-value",
|
|
182
182
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
183
183
|
op: "after",
|
|
@@ -186,27 +186,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
186
186
|
})
|
|
187
187
|
);
|
|
188
188
|
})
|
|
189
|
-
}, null, 8, ["model-value"]),
|
|
190
|
-
unref(
|
|
189
|
+
}, null, 8, ["label", "model-value"]),
|
|
190
|
+
unref(p).operator == "_isDay" ? (openBlock(), createBlock(a, {
|
|
191
191
|
key: 0,
|
|
192
|
-
label: "
|
|
192
|
+
label: unref(o)("connect.template.rule.birthday.days_before_label"),
|
|
193
193
|
"show-steppers": !1,
|
|
194
|
-
"model-value": unref(
|
|
195
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
194
|
+
"model-value": unref(p).equator.x,
|
|
195
|
+
"onUpdate:modelValue": l[2] || (l[2] = (f) => s(
|
|
196
196
|
"update:model-value",
|
|
197
197
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
198
198
|
op: "after",
|
|
199
|
-
x:
|
|
199
|
+
x: f,
|
|
200
200
|
ignoreYear: !0
|
|
201
201
|
})
|
|
202
202
|
))
|
|
203
|
-
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
204
|
-
createVNode(
|
|
205
|
-
label: "
|
|
203
|
+
}, null, 8, ["label", "model-value"])) : createCommentVNode("", !0),
|
|
204
|
+
createVNode(i, {
|
|
205
|
+
label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
|
|
206
206
|
value: "_isRange-week",
|
|
207
|
-
"model-value": `${unref(
|
|
207
|
+
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
208
208
|
"onUpdate:modelValue": l[3] || (l[3] = () => {
|
|
209
|
-
|
|
209
|
+
s(
|
|
210
210
|
"update:model-value",
|
|
211
211
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
212
212
|
op: "this",
|
|
@@ -215,13 +215,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
215
215
|
})
|
|
216
216
|
);
|
|
217
217
|
})
|
|
218
|
-
}, null, 8, ["model-value"]),
|
|
219
|
-
createVNode(
|
|
220
|
-
label: "
|
|
218
|
+
}, null, 8, ["label", "model-value"]),
|
|
219
|
+
createVNode(i, {
|
|
220
|
+
label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
|
|
221
221
|
value: "_isRange-month",
|
|
222
|
-
"model-value": `${unref(
|
|
222
|
+
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
223
223
|
"onUpdate:modelValue": l[4] || (l[4] = () => {
|
|
224
|
-
|
|
224
|
+
s(
|
|
225
225
|
"update:model-value",
|
|
226
226
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
227
227
|
op: "this",
|
|
@@ -230,11 +230,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
230
230
|
})
|
|
231
231
|
);
|
|
232
232
|
})
|
|
233
|
-
}, null, 8, ["model-value"])
|
|
233
|
+
}, null, 8, ["label", "model-value"])
|
|
234
234
|
]);
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
}), _hoisted_1$f = { class: "space-y-16" }, _hoisted_2$c = { class: "grid grid-cols-3 gap-16" },
|
|
237
|
+
}), _hoisted_1$f = { class: "space-y-16" }, _hoisted_2$c = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$a = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
238
238
|
__name: "CampaignTriggerInput",
|
|
239
239
|
props: {
|
|
240
240
|
campaignType: {
|
|
@@ -251,30 +251,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
251
251
|
},
|
|
252
252
|
emits: ["update:model-value"],
|
|
253
253
|
setup(e, { emit: m }) {
|
|
254
|
-
const
|
|
255
|
-
(
|
|
256
|
-
) : TypeToTriggerOptions[
|
|
257
|
-
return (
|
|
258
|
-
const
|
|
254
|
+
const { t: o } = useI18n(), c = e, s = m, p = computed(() => c.disabled ? TypeToTriggerOptions[c.campaignType].filter(
|
|
255
|
+
(n) => n.value == c.modelValue
|
|
256
|
+
) : TypeToTriggerOptions[c.campaignType]);
|
|
257
|
+
return (n, l) => {
|
|
258
|
+
const i = resolveComponent("FmCard");
|
|
259
259
|
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
260
|
-
|
|
261
|
-
createElementVNode("div",
|
|
262
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
260
|
+
createElementVNode("div", _hoisted_2$c, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
|
|
261
|
+
createElementVNode("div", _hoisted_3$a, [
|
|
262
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(i, {
|
|
263
263
|
variant: "outlined",
|
|
264
|
-
disabled:
|
|
264
|
+
disabled: c.disabled,
|
|
265
265
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
266
|
-
"col-span-3": unref(
|
|
267
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
268
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
266
|
+
"col-span-3": unref(p).length == 1,
|
|
267
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
268
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
269
269
|
}]),
|
|
270
270
|
onClick: () => {
|
|
271
|
-
|
|
271
|
+
c.modelValue != a.value && !c.disabled && s("update:model-value", a.value);
|
|
272
272
|
},
|
|
273
|
-
key:
|
|
273
|
+
key: a.name
|
|
274
274
|
}, {
|
|
275
275
|
default: withCtx(() => [
|
|
276
|
-
createElementVNode("div",
|
|
277
|
-
createElementVNode("div",
|
|
276
|
+
createElementVNode("div", _hoisted_4$9, toDisplayString(a.name), 1),
|
|
277
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(a.description), 1)
|
|
278
278
|
]),
|
|
279
279
|
_: 2
|
|
280
280
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -296,26 +296,26 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
296
296
|
},
|
|
297
297
|
emits: ["update:model-value"],
|
|
298
298
|
setup(e, { emit: m }) {
|
|
299
|
-
const
|
|
300
|
-
return (
|
|
301
|
-
const
|
|
302
|
-
return openBlock(), createBlock(
|
|
299
|
+
const o = m;
|
|
300
|
+
return (c, s) => {
|
|
301
|
+
const p = resolveComponent("FmButton"), n = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
|
|
302
|
+
return openBlock(), createBlock(l, {
|
|
303
303
|
label: e.label,
|
|
304
304
|
"model-value": e.modelValue || "",
|
|
305
|
-
"onUpdate:modelValue":
|
|
305
|
+
"onUpdate:modelValue": s[1] || (s[1] = (i) => o("update:model-value", i))
|
|
306
306
|
}, {
|
|
307
|
-
"trigger-button": withCtx(({ opened:
|
|
308
|
-
createVNode(
|
|
307
|
+
"trigger-button": withCtx(({ opened: i }) => [
|
|
308
|
+
createVNode(n, {
|
|
309
309
|
class: "flex items-center",
|
|
310
310
|
"prepend-icon": "calendar_month",
|
|
311
|
-
"icon-outlined": !
|
|
311
|
+
"icon-outlined": !i
|
|
312
312
|
}, {
|
|
313
313
|
append: withCtx(() => [
|
|
314
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
314
|
+
e.modelValue ? (openBlock(), createBlock(p, {
|
|
315
315
|
key: 0,
|
|
316
316
|
variant: "tertiary",
|
|
317
317
|
icon: "clear",
|
|
318
|
-
onClick:
|
|
318
|
+
onClick: s[0] || (s[0] = (a) => (a.stopPropagation(), o("update:model-value", null)))
|
|
319
319
|
})) : createCommentVNode("", !0)
|
|
320
320
|
]),
|
|
321
321
|
default: withCtx(() => [
|
|
@@ -330,7 +330,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
330
330
|
}, 8, ["label", "model-value"]);
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
|
-
}), _hoisted_1$e = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$b = { class: "flex-1 xs:w-full" }, _hoisted_3$9 = { class: "flex-1 xs:w-full" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
333
|
+
}), _hoisted_1$e = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$b = { class: "flex-1 xs:w-full" }, _hoisted_3$9 = { class: "mt-5 xs:hidden" }, _hoisted_4$8 = { class: "flex-1 xs:w-full" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
334
334
|
__name: "DateRangeInput",
|
|
335
335
|
props: {
|
|
336
336
|
modelValue: {
|
|
@@ -340,36 +340,36 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
340
340
|
},
|
|
341
341
|
emits: ["update:model-value"],
|
|
342
342
|
setup(e, { emit: m }) {
|
|
343
|
-
const
|
|
344
|
-
return (
|
|
345
|
-
var
|
|
343
|
+
const { t: o } = useI18n(), c = m;
|
|
344
|
+
return (s, p) => {
|
|
345
|
+
var n, l;
|
|
346
346
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
347
347
|
createElementVNode("div", _hoisted_2$b, [
|
|
348
348
|
createVNode(_sfc_main$f, {
|
|
349
|
-
"model-value": ((
|
|
350
|
-
label: "
|
|
351
|
-
"onUpdate:modelValue":
|
|
352
|
-
var
|
|
353
|
-
return
|
|
354
|
-
startDate:
|
|
355
|
-
endDate: ((
|
|
349
|
+
"model-value": ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
|
|
350
|
+
label: unref(o)("connect.common.startDate"),
|
|
351
|
+
"onUpdate:modelValue": p[0] || (p[0] = (i) => {
|
|
352
|
+
var a;
|
|
353
|
+
return c("update:model-value", {
|
|
354
|
+
startDate: i,
|
|
355
|
+
endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
|
|
356
356
|
});
|
|
357
357
|
})
|
|
358
|
-
}, null, 8, ["model-value"])
|
|
358
|
+
}, null, 8, ["model-value", "label"])
|
|
359
359
|
]),
|
|
360
|
-
|
|
361
|
-
createElementVNode("div",
|
|
360
|
+
createElementVNode("div", _hoisted_3$9, toDisplayString(unref(o)("connect.common.to")), 1),
|
|
361
|
+
createElementVNode("div", _hoisted_4$8, [
|
|
362
362
|
createVNode(_sfc_main$f, {
|
|
363
363
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
|
|
364
|
-
label: "
|
|
365
|
-
"onUpdate:modelValue":
|
|
366
|
-
var
|
|
367
|
-
return
|
|
368
|
-
startDate: ((
|
|
369
|
-
endDate:
|
|
364
|
+
label: unref(o)("connect.common.endDate"),
|
|
365
|
+
"onUpdate:modelValue": p[1] || (p[1] = (i) => {
|
|
366
|
+
var a;
|
|
367
|
+
return c("update:model-value", {
|
|
368
|
+
startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
|
|
369
|
+
endDate: i
|
|
370
370
|
});
|
|
371
371
|
})
|
|
372
|
-
}, null, 8, ["model-value"])
|
|
372
|
+
}, null, 8, ["model-value", "label"])
|
|
373
373
|
])
|
|
374
374
|
]);
|
|
375
375
|
};
|
|
@@ -377,7 +377,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
377
377
|
}), _hoisted_1$d = { class: "space-y-8" }, _hoisted_2$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$8 = {
|
|
378
378
|
key: 0,
|
|
379
379
|
class: "space-y-4"
|
|
380
|
-
}, _hoisted_4$
|
|
380
|
+
}, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$5 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
381
381
|
__name: "ScheduleRuleInput",
|
|
382
382
|
props: {
|
|
383
383
|
modelValue: {
|
|
@@ -393,35 +393,38 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
393
393
|
},
|
|
394
394
|
emits: ["update:model-value"],
|
|
395
395
|
setup(e, { emit: m }) {
|
|
396
|
-
const
|
|
397
|
-
() => CountryTimezone[
|
|
396
|
+
const { t: o } = useI18n(), c = e, s = m, p = useCoreStore(), n = computed(
|
|
397
|
+
() => CountryTimezone[p.currentCountry.value || "MY"]
|
|
398
398
|
);
|
|
399
399
|
function l() {
|
|
400
|
-
const
|
|
401
|
-
return
|
|
402
|
-
(
|
|
400
|
+
const u = RuleBuilder.getRules(c.modelValue);
|
|
401
|
+
return u.length == 0 ? "fixed" : u.some(
|
|
402
|
+
(r) => isRuleEntry(r) && RuleBuilder.simplify(r).operator == "_rrule"
|
|
403
403
|
) ? "repeating" : "fixed";
|
|
404
404
|
}
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
405
|
+
const i = ref(l()), a = ref(!1), f = computed(() => [
|
|
406
|
+
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
407
|
+
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
408
|
+
]), y = computed(() => {
|
|
409
|
+
const u = RuleBuilder.getRules(c.modelValue), r = u.find(
|
|
410
|
+
(g) => isRuleEntry(g) && RuleBuilder.simplify(g).property == "trigger.date"
|
|
411
|
+
), d = u.find(
|
|
412
|
+
(g) => isRuleEntry(g) && RuleBuilder.simplify(g).property == "trigger.time"
|
|
410
413
|
);
|
|
411
414
|
return {
|
|
412
|
-
date:
|
|
413
|
-
time:
|
|
415
|
+
date: r ? RuleBuilder.simplify(r).equator : null,
|
|
416
|
+
time: d ? RuleBuilder.simplify(d).equator : null
|
|
414
417
|
};
|
|
415
|
-
}),
|
|
418
|
+
}), v = computed(
|
|
416
419
|
() => calculateNextScheduleAt(
|
|
417
|
-
|
|
420
|
+
c.modelValue,
|
|
418
421
|
/* @__PURE__ */ new Date(),
|
|
419
|
-
|
|
420
|
-
|
|
422
|
+
c.startDate ? new Date(c.startDate) : void 0,
|
|
423
|
+
c.endDate ? new Date(c.endDate) : void 0
|
|
421
424
|
)
|
|
422
425
|
);
|
|
423
|
-
function
|
|
424
|
-
const
|
|
426
|
+
function C(u) {
|
|
427
|
+
const r = u.value, d = r == "fixed" ? [
|
|
425
428
|
RuleBuilder.constructEntry(
|
|
426
429
|
"trigger.date",
|
|
427
430
|
"_isOnDate",
|
|
@@ -436,73 +439,73 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
436
439
|
),
|
|
437
440
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
438
441
|
];
|
|
439
|
-
|
|
442
|
+
s(
|
|
440
443
|
"update:model-value",
|
|
441
444
|
RuleBuilder.setRuleToGroup(
|
|
442
445
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
443
|
-
|
|
446
|
+
d
|
|
444
447
|
)
|
|
445
|
-
),
|
|
448
|
+
), i.value = r;
|
|
446
449
|
}
|
|
447
|
-
function
|
|
448
|
-
|
|
450
|
+
function b(u) {
|
|
451
|
+
i.value == "fixed" ? s(
|
|
449
452
|
"update:model-value",
|
|
450
453
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
451
454
|
RuleBuilder.constructEntry(
|
|
452
455
|
"trigger.date",
|
|
453
456
|
"_isOnDate",
|
|
454
|
-
|
|
457
|
+
u.date
|
|
455
458
|
),
|
|
456
459
|
RuleBuilder.constructEntry(
|
|
457
460
|
"trigger.time",
|
|
458
461
|
"_isOnTime",
|
|
459
|
-
|
|
462
|
+
u.time
|
|
460
463
|
)
|
|
461
464
|
])
|
|
462
|
-
) :
|
|
465
|
+
) : s(
|
|
463
466
|
"update:model-value",
|
|
464
467
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
465
468
|
RuleBuilder.constructEntry(
|
|
466
469
|
"trigger.date",
|
|
467
470
|
"_rrule",
|
|
468
|
-
|
|
471
|
+
u.date
|
|
469
472
|
),
|
|
470
473
|
RuleBuilder.constructEntry(
|
|
471
474
|
"trigger.time",
|
|
472
475
|
"_isOnTime",
|
|
473
|
-
|
|
476
|
+
u.time
|
|
474
477
|
)
|
|
475
478
|
])
|
|
476
479
|
);
|
|
477
480
|
}
|
|
478
|
-
return (
|
|
479
|
-
const
|
|
481
|
+
return (u, r) => {
|
|
482
|
+
const d = resolveComponent("FmButtonGroup"), g = resolveComponent("FmTimePicker"), k = resolveComponent("FmIcon"), V = resolveComponent("FmTooltip"), x = resolveComponent("FmField"), B = resolveComponent("FmCard"), h = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), S = resolveComponent("FmHelperText");
|
|
480
483
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
481
|
-
createVNode(
|
|
482
|
-
items:
|
|
483
|
-
"model-value":
|
|
484
|
-
"onUpdate:modelValue":
|
|
484
|
+
createVNode(d, {
|
|
485
|
+
items: unref(f),
|
|
486
|
+
"model-value": unref(f).find((E) => E.value === unref(i)) ?? null,
|
|
487
|
+
"onUpdate:modelValue": C,
|
|
485
488
|
class: "mb-8"
|
|
486
|
-
}, null, 8, ["model-value"]),
|
|
489
|
+
}, null, 8, ["items", "model-value"]),
|
|
487
490
|
createElementVNode("div", _hoisted_1$d, [
|
|
488
491
|
createElementVNode("div", _hoisted_2$a, [
|
|
489
|
-
createVNode(
|
|
490
|
-
label: "
|
|
491
|
-
"model-value": unref(
|
|
492
|
-
"onUpdate:modelValue":
|
|
493
|
-
"helper-text": unref(
|
|
494
|
-
"helper-state": unref(
|
|
495
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
496
|
-
unref(
|
|
497
|
-
createElementVNode("div", _hoisted_4$
|
|
498
|
-
|
|
499
|
-
unref(
|
|
492
|
+
createVNode(g, {
|
|
493
|
+
label: unref(o)("connect.template.rule.schedule.notify_time"),
|
|
494
|
+
"model-value": unref(y).time,
|
|
495
|
+
"onUpdate:modelValue": r[0] || (r[0] = (E) => b({ date: unref(y).date, time: E })),
|
|
496
|
+
"helper-text": unref(y).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
|
|
497
|
+
"helper-state": unref(y).time ? void 0 : "error"
|
|
498
|
+
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
499
|
+
unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
|
|
500
|
+
createElementVNode("div", _hoisted_4$7, [
|
|
501
|
+
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
502
|
+
unref(y).date ? (openBlock(), createBlock(V, {
|
|
500
503
|
key: 0,
|
|
501
504
|
"z-index": 9999,
|
|
502
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
505
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options)
|
|
503
506
|
}, {
|
|
504
507
|
default: withCtx(() => [
|
|
505
|
-
createVNode(
|
|
508
|
+
createVNode(k, {
|
|
506
509
|
name: "info",
|
|
507
510
|
size: "sm",
|
|
508
511
|
outline: !0
|
|
@@ -511,30 +514,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
511
514
|
_: 1
|
|
512
515
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
513
516
|
]),
|
|
514
|
-
createVNode(
|
|
515
|
-
"show-popover": unref(
|
|
516
|
-
onPopoverChanged:
|
|
517
|
+
createVNode(h, {
|
|
518
|
+
"show-popover": unref(a),
|
|
519
|
+
onPopoverChanged: r[3] || (r[3] = (E) => a.value = E)
|
|
517
520
|
}, {
|
|
518
521
|
"popover-button": withCtx(() => [
|
|
519
|
-
createVNode(
|
|
522
|
+
createVNode(x, {
|
|
520
523
|
class: "cursor-pointer",
|
|
521
|
-
"helper-text": unref(
|
|
522
|
-
"helper-state": unref(
|
|
524
|
+
"helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
525
|
+
"helper-state": unref(y).date ? void 0 : "error"
|
|
523
526
|
}, {
|
|
524
527
|
default: withCtx(() => [
|
|
525
|
-
createElementVNode("div", _hoisted_5$
|
|
528
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(unref(y).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
|
|
526
529
|
]),
|
|
527
530
|
_: 1
|
|
528
531
|
}, 8, ["helper-text", "helper-state"])
|
|
529
532
|
]),
|
|
530
533
|
default: withCtx(() => [
|
|
531
|
-
createVNode(
|
|
534
|
+
createVNode(B, { class: "elevated p-8 w-[450px]" }, {
|
|
532
535
|
default: withCtx(() => [
|
|
533
536
|
createVNode(_sfc_main$k, {
|
|
534
537
|
"apply-button": !0,
|
|
535
|
-
"model-value": unref(
|
|
536
|
-
onCancel:
|
|
537
|
-
"onUpdate:modelValue":
|
|
538
|
+
"model-value": unref(y).date || "",
|
|
539
|
+
onCancel: r[1] || (r[1] = (E) => a.value = !1),
|
|
540
|
+
"onUpdate:modelValue": r[2] || (r[2] = (E) => (b({ date: E, time: unref(y).time }), a.value = !1))
|
|
538
541
|
}, null, 8, ["model-value"])
|
|
539
542
|
]),
|
|
540
543
|
_: 1
|
|
@@ -544,23 +547,23 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
544
547
|
}, 8, ["show-popover"])
|
|
545
548
|
])) : (openBlock(), createBlock(R, {
|
|
546
549
|
key: 1,
|
|
547
|
-
label: "
|
|
548
|
-
"model-value": unref(
|
|
549
|
-
"onUpdate:modelValue":
|
|
550
|
-
"helper-text": unref(
|
|
551
|
-
"helper-state": unref(
|
|
552
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
550
|
+
label: unref(o)("connect.template.rule.schedule.notify_date"),
|
|
551
|
+
"model-value": unref(y).date || "",
|
|
552
|
+
"onUpdate:modelValue": r[4] || (r[4] = (E) => b({ date: E, time: unref(y).time })),
|
|
553
|
+
"helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
554
|
+
"helper-state": unref(y).date ? void 0 : "error"
|
|
555
|
+
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
553
556
|
]),
|
|
554
|
-
unref(
|
|
557
|
+
unref(y).date && unref(y).time && unref(v) ? (openBlock(), createBlock(S, {
|
|
555
558
|
key: 0,
|
|
556
|
-
text: `${unref(moment)(unref(
|
|
557
|
-
${unref(moment)(unref(
|
|
559
|
+
text: `${unref(moment)(unref(v)).isAfter(unref(moment)()) ? unref(o)("connect.template.rule.schedule.next_notification") : unref(o)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(v)).format("dddd, DD MMM YYYY")} at
|
|
560
|
+
${unref(moment)(unref(v)).format("hh:mmA")}(UTC${unref(moment).tz(unref(n)).format("Z")}) (${unref(moment)(unref(v)).fromNow()})`
|
|
558
561
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
559
562
|
])
|
|
560
563
|
], 64);
|
|
561
564
|
};
|
|
562
565
|
}
|
|
563
|
-
}), _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "grid grid-cols-2 gap-16" },
|
|
566
|
+
}), _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$7 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
564
567
|
__name: "GameTypeInput",
|
|
565
568
|
props: {
|
|
566
569
|
modelValue: {
|
|
@@ -569,42 +572,42 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
569
572
|
},
|
|
570
573
|
emits: ["update:model-value"],
|
|
571
574
|
setup(e, { emit: m }) {
|
|
572
|
-
const
|
|
575
|
+
const { t: o } = useI18n(), c = e, s = m, p = computed(
|
|
573
576
|
() => [
|
|
574
577
|
{
|
|
575
|
-
label: "
|
|
576
|
-
description: "
|
|
578
|
+
label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
579
|
+
description: o("connect.campaign.gameType.option.FORTUNE_WHEEL.description"),
|
|
577
580
|
value: F_GAME_TYPE.enum.FORTUNE_WHEEL,
|
|
578
581
|
hidden: !1
|
|
579
582
|
},
|
|
580
583
|
{
|
|
581
|
-
label: "
|
|
582
|
-
description: "
|
|
584
|
+
label: o("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.label"),
|
|
585
|
+
description: o("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.description"),
|
|
583
586
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
584
587
|
hidden: !0
|
|
585
588
|
}
|
|
586
|
-
].filter((
|
|
589
|
+
].filter((n) => !n.hidden)
|
|
587
590
|
);
|
|
588
|
-
return (
|
|
589
|
-
const
|
|
591
|
+
return (n, l) => {
|
|
592
|
+
const i = resolveComponent("FmCard");
|
|
590
593
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
591
|
-
|
|
592
|
-
createElementVNode("div",
|
|
593
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
594
|
+
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
595
|
+
createElementVNode("div", _hoisted_3$7, [
|
|
596
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(i, {
|
|
594
597
|
variant: "outlined",
|
|
595
598
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
596
|
-
"col-span-2": unref(
|
|
597
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
598
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
599
|
+
"col-span-2": unref(p).length == 1,
|
|
600
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
601
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
599
602
|
}]),
|
|
600
603
|
onClick: () => {
|
|
601
|
-
|
|
604
|
+
c.modelValue != a.value && s("update:model-value", a.value);
|
|
602
605
|
},
|
|
603
|
-
key:
|
|
606
|
+
key: a.value
|
|
604
607
|
}, {
|
|
605
608
|
default: withCtx(() => [
|
|
606
|
-
createElementVNode("div",
|
|
607
|
-
createElementVNode("div",
|
|
609
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(a.label), 1),
|
|
610
|
+
createElementVNode("div", _hoisted_5$4, toDisplayString(a.description), 1)
|
|
608
611
|
]),
|
|
609
612
|
_: 2
|
|
610
613
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -618,87 +621,87 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
618
621
|
}, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
619
622
|
__name: "EditRewardPoolSheet",
|
|
620
623
|
emits: ["update:model-value"],
|
|
621
|
-
setup(e, { expose: m, emit:
|
|
622
|
-
const
|
|
623
|
-
var
|
|
624
|
-
return ((
|
|
625
|
-
(
|
|
626
|
-
var
|
|
627
|
-
return
|
|
624
|
+
setup(e, { expose: m, emit: o }) {
|
|
625
|
+
const c = useMembershipStore(), { minor: s } = useLoading, p = ref(!1), n = ref(), l = ref(), i = ref(0), a = computed(() => {
|
|
626
|
+
var u;
|
|
627
|
+
return ((u = c.loyaltyRewards.items.find(
|
|
628
|
+
(r) => {
|
|
629
|
+
var d;
|
|
630
|
+
return r.value === ((d = n.value) == null ? void 0 : d.collectible);
|
|
628
631
|
}
|
|
629
|
-
)) == null ? void 0 :
|
|
630
|
-
}),
|
|
631
|
-
const
|
|
632
|
-
return
|
|
632
|
+
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
633
|
+
}), f = computed(() => {
|
|
634
|
+
const b = a.value.safeParse(n.value);
|
|
635
|
+
return b.success ? [] : b.error.errors;
|
|
633
636
|
});
|
|
634
|
-
function
|
|
635
|
-
|
|
637
|
+
function y(b, u, r) {
|
|
638
|
+
b && (n.value = u, i.value = r), p.value = b;
|
|
636
639
|
}
|
|
637
|
-
const
|
|
638
|
-
async function
|
|
639
|
-
const
|
|
640
|
-
|
|
640
|
+
const v = o;
|
|
641
|
+
async function C() {
|
|
642
|
+
const b = a.value.safeParse(n.value);
|
|
643
|
+
b.success && (await s(
|
|
641
644
|
async () => {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
+
b.data.type === "VOUCHER" && l.value && (b.data.collectibleConfig.image = await firebaseStorage.update(
|
|
646
|
+
b.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
|
|
647
|
+
l.value
|
|
645
648
|
));
|
|
646
649
|
},
|
|
647
650
|
{
|
|
648
651
|
message: "Uploading reward image",
|
|
649
652
|
successMessage: "Reward image updated"
|
|
650
653
|
}
|
|
651
|
-
),
|
|
654
|
+
), v("update:model-value", b.data, i.value));
|
|
652
655
|
}
|
|
653
656
|
return m({
|
|
654
|
-
showSheet:
|
|
655
|
-
}), (
|
|
656
|
-
const
|
|
657
|
-
return openBlock(), createBlock(
|
|
657
|
+
showSheet: y
|
|
658
|
+
}), (b, u) => {
|
|
659
|
+
const r = resolveComponent("FmSelect"), d = resolveComponent("FmStepperField"), g = resolveComponent("FmButton"), k = resolveComponent("FmSideSheet");
|
|
660
|
+
return openBlock(), createBlock(k, {
|
|
658
661
|
"max-width": 560,
|
|
659
|
-
modelValue: unref(
|
|
662
|
+
modelValue: unref(p),
|
|
660
663
|
"onUpdate:modelValue": [
|
|
661
|
-
|
|
662
|
-
|
|
664
|
+
u[9] || (u[9] = (V) => isRef(p) ? p.value = V : null),
|
|
665
|
+
u[10] || (u[10] = (V) => p.value = V)
|
|
663
666
|
],
|
|
664
667
|
header: "Edit reward",
|
|
665
668
|
"dismiss-away": ""
|
|
666
669
|
}, {
|
|
667
670
|
"side-sheet-footer": withCtx(() => [
|
|
668
671
|
createElementVNode("div", _hoisted_2$8, [
|
|
669
|
-
createVNode(
|
|
672
|
+
createVNode(g, {
|
|
670
673
|
variant: "primary",
|
|
671
674
|
type: "button",
|
|
672
|
-
disabled: unref(
|
|
675
|
+
disabled: unref(f).length > 0,
|
|
673
676
|
label: "Confirm",
|
|
674
|
-
onClick:
|
|
677
|
+
onClick: u[7] || (u[7] = (V) => C())
|
|
675
678
|
}, null, 8, ["disabled"]),
|
|
676
|
-
createVNode(
|
|
679
|
+
createVNode(g, {
|
|
677
680
|
variant: "secondary",
|
|
678
681
|
type: "button",
|
|
679
682
|
label: "Cancel",
|
|
680
|
-
onClick:
|
|
683
|
+
onClick: u[8] || (u[8] = (V) => p.value = !1)
|
|
681
684
|
})
|
|
682
685
|
])
|
|
683
686
|
]),
|
|
684
687
|
default: withCtx(() => {
|
|
685
|
-
var V, x,
|
|
688
|
+
var V, x, B;
|
|
686
689
|
return [
|
|
687
|
-
unref(
|
|
688
|
-
createVNode(
|
|
690
|
+
unref(n) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
691
|
+
createVNode(r, {
|
|
689
692
|
label: "Reward Type",
|
|
690
693
|
items: [
|
|
691
694
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
692
695
|
{ label: "Voucher", value: "VOUCHER" },
|
|
693
696
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
694
697
|
],
|
|
695
|
-
"model-value": unref(
|
|
696
|
-
"onUpdate:modelValue":
|
|
697
|
-
|
|
698
|
+
"model-value": unref(n).type,
|
|
699
|
+
"onUpdate:modelValue": u[0] || (u[0] = (h) => {
|
|
700
|
+
h == "NO_REWARD" ? n.value = {
|
|
698
701
|
type: "NO_REWARD",
|
|
699
702
|
collectible: null,
|
|
700
703
|
weight: 1
|
|
701
|
-
} :
|
|
704
|
+
} : h === "VOUCHER" ? n.value = {
|
|
702
705
|
collectible: null,
|
|
703
706
|
type: "VOUCHER",
|
|
704
707
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -712,8 +715,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
712
715
|
validForDay: 7
|
|
713
716
|
},
|
|
714
717
|
weight: 1
|
|
715
|
-
} :
|
|
716
|
-
collectible: unref(
|
|
718
|
+
} : n.value = {
|
|
719
|
+
collectible: unref(c).loyaltyRewards.raw[0]._id,
|
|
717
720
|
type: "LOYALTY",
|
|
718
721
|
earningOption: {
|
|
719
722
|
amount: 1,
|
|
@@ -726,75 +729,75 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
726
729
|
};
|
|
727
730
|
})
|
|
728
731
|
}, null, 8, ["model-value"]),
|
|
729
|
-
unref(
|
|
732
|
+
unref(n).type == "LOYALTY" ? (openBlock(), createBlock(r, {
|
|
730
733
|
key: 0,
|
|
731
734
|
label: "Loyalty type",
|
|
732
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
733
|
-
items: unref(
|
|
734
|
-
"model-value": unref(
|
|
735
|
-
"onUpdate:modelValue":
|
|
735
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(a), "collectible", [unref(n).type])],
|
|
736
|
+
items: unref(c).loyaltyRewards.items,
|
|
737
|
+
"model-value": unref(n).collectible,
|
|
738
|
+
"onUpdate:modelValue": u[1] || (u[1] = (h) => unref(n).collectible = h)
|
|
736
739
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
737
|
-
createVNode(
|
|
740
|
+
createVNode(d, {
|
|
738
741
|
label: "Weight",
|
|
739
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
740
|
-
"model-value": unref(
|
|
741
|
-
"onUpdate:modelValue":
|
|
742
|
-
...unref(
|
|
743
|
-
weight:
|
|
742
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(a), "weight", [unref(n).type])],
|
|
743
|
+
"model-value": unref(n).weight,
|
|
744
|
+
"onUpdate:modelValue": u[2] || (u[2] = (h) => n.value = {
|
|
745
|
+
...unref(n),
|
|
746
|
+
weight: h
|
|
744
747
|
})
|
|
745
748
|
}, null, 8, ["rules", "model-value"]),
|
|
746
|
-
unref(
|
|
747
|
-
((V = unref(
|
|
748
|
-
(
|
|
749
|
-
var
|
|
750
|
-
return
|
|
749
|
+
unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
750
|
+
((V = unref(c).loyaltyRewards.items.find(
|
|
751
|
+
(h) => {
|
|
752
|
+
var R;
|
|
753
|
+
return h.value === ((R = unref(n)) == null ? void 0 : R.collectible);
|
|
751
754
|
}
|
|
752
755
|
)) == null ? void 0 : V.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
753
|
-
|
|
756
|
+
u[11] || (u[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
754
757
|
createVNode(_sfc_main$l, {
|
|
755
758
|
class: "mt-[-8px]",
|
|
756
759
|
rules: [
|
|
757
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
760
|
+
unref(ZodHelper).ruleAtPath(unref(a), "earningOption", [unref(n).type])
|
|
758
761
|
],
|
|
759
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
760
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
762
|
+
"helper-state": unref(ZodHelper).helperState(unref(f), "earningOption"),
|
|
763
|
+
"error-text": unref(ZodHelper).helperText(unref(f), "earningOption"),
|
|
761
764
|
"fixed-type": !0,
|
|
762
|
-
"model-value": unref(
|
|
763
|
-
"onUpdate:modelValue":
|
|
764
|
-
...unref(
|
|
765
|
-
earningOption:
|
|
765
|
+
"model-value": unref(n).earningOption,
|
|
766
|
+
"onUpdate:modelValue": u[3] || (u[3] = (h) => n.value = {
|
|
767
|
+
...unref(n),
|
|
768
|
+
earningOption: h
|
|
766
769
|
})
|
|
767
770
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
768
771
|
], 64)) : createCommentVNode("", !0),
|
|
769
|
-
|
|
772
|
+
u[12] || (u[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
770
773
|
createVNode(_sfc_main$m, {
|
|
771
|
-
type: unref(
|
|
772
|
-
"for-credit": unref(
|
|
773
|
-
(
|
|
774
|
-
var
|
|
775
|
-
return
|
|
774
|
+
type: unref(n).type === "LOYALTY" ? "custom" : "range",
|
|
775
|
+
"for-credit": unref(n).type === "LOYALTY" && ((x = unref(c).loyaltyRewards.items.find(
|
|
776
|
+
(h) => {
|
|
777
|
+
var R;
|
|
778
|
+
return h.value === ((R = unref(n)) == null ? void 0 : R.collectible);
|
|
776
779
|
}
|
|
777
780
|
)) == null ? void 0 : x.raw.type) === "CREDIT",
|
|
778
781
|
class: "!gap-24",
|
|
779
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
780
|
-
"model-value": unref(
|
|
781
|
-
"onUpdate:modelValue":
|
|
782
|
-
...unref(
|
|
783
|
-
validityOption:
|
|
782
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(a), "validityOption", [unref(n).type])],
|
|
783
|
+
"model-value": unref(n).validityOption,
|
|
784
|
+
"onUpdate:modelValue": u[4] || (u[4] = (h) => n.value = {
|
|
785
|
+
...unref(n),
|
|
786
|
+
validityOption: h
|
|
784
787
|
})
|
|
785
788
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
786
789
|
], 64)) : createCommentVNode("", !0),
|
|
787
|
-
unref(
|
|
790
|
+
unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
788
791
|
key: 2,
|
|
789
|
-
"reward-image": unref(
|
|
790
|
-
"model-value": ((
|
|
791
|
-
"onUpdate:modelValue":
|
|
792
|
-
...unref(
|
|
793
|
-
collectibleConfig:
|
|
792
|
+
"reward-image": unref(l),
|
|
793
|
+
"model-value": ((B = unref(n)) == null ? void 0 : B.collectibleConfig) ?? void 0,
|
|
794
|
+
"onUpdate:modelValue": u[5] || (u[5] = (h) => n.value = {
|
|
795
|
+
...unref(n),
|
|
796
|
+
collectibleConfig: h
|
|
794
797
|
}),
|
|
795
|
-
"onUpdate:rewardImage":
|
|
798
|
+
"onUpdate:rewardImage": u[6] || (u[6] = (h) => l.value = h)
|
|
796
799
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
797
|
-
createVNode(JsonViewer, { json: unref(
|
|
800
|
+
createVNode(JsonViewer, { json: unref(f) }, null, 8, ["json"])
|
|
798
801
|
])) : createCommentVNode("", !0)
|
|
799
802
|
];
|
|
800
803
|
}),
|
|
@@ -806,7 +809,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
806
809
|
function isNullOrEmpty(e) {
|
|
807
810
|
return e == null || e === "";
|
|
808
811
|
}
|
|
809
|
-
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({
|
|
812
|
+
const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$6 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$5 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
810
813
|
__name: "RewardPoolInput",
|
|
811
814
|
props: {
|
|
812
815
|
modelValue: {
|
|
@@ -822,36 +825,36 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
822
825
|
},
|
|
823
826
|
emits: ["update:model-value"],
|
|
824
827
|
setup(e, { emit: m }) {
|
|
825
|
-
const
|
|
826
|
-
const
|
|
827
|
-
return
|
|
828
|
-
}),
|
|
829
|
-
function
|
|
830
|
-
var
|
|
831
|
-
const
|
|
832
|
-
|
|
828
|
+
const o = e, c = m, s = useMembershipStore(), { t: p } = useI18n(), n = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => o.modelValue ?? []), i = computed(() => {
|
|
829
|
+
const u = n.safeParse(l.value);
|
|
830
|
+
return u.success ? [] : u.error.errors;
|
|
831
|
+
}), a = ref();
|
|
832
|
+
function f(u, r) {
|
|
833
|
+
var g;
|
|
834
|
+
const d = [...l.value];
|
|
835
|
+
d[r] = u, (g = a.value) == null || g.showSheet(!1), c("update:model-value", d);
|
|
833
836
|
}
|
|
834
|
-
function y(
|
|
835
|
-
const r =
|
|
836
|
-
(
|
|
837
|
-
),
|
|
837
|
+
function y(u) {
|
|
838
|
+
const r = u.type == "VOUCHER" ? u.collectibleConfig : s.collectibles.find(
|
|
839
|
+
(k) => k._id.toString() == u.collectible
|
|
840
|
+
), d = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), g = u.weight;
|
|
838
841
|
return {
|
|
839
|
-
label: isNullOrEmpty(
|
|
840
|
-
sublabel: `${
|
|
842
|
+
label: isNullOrEmpty(d) ? "NO REWARD" : d,
|
|
843
|
+
sublabel: `${g} (${(g / l.value.reduce((k, V) => k + V.weight, 0) * 100).toFixed(2)}%)`
|
|
841
844
|
};
|
|
842
845
|
}
|
|
843
|
-
function v(
|
|
844
|
-
var
|
|
846
|
+
function v(u) {
|
|
847
|
+
var d;
|
|
845
848
|
const r = [...l.value];
|
|
846
|
-
(
|
|
849
|
+
(d = a.value) == null || d.showSheet(!0, r[u], u);
|
|
847
850
|
}
|
|
848
|
-
function
|
|
851
|
+
function C(u) {
|
|
849
852
|
const r = [...l.value];
|
|
850
|
-
r.splice(
|
|
853
|
+
r.splice(u, 1), c("update:model-value", r);
|
|
851
854
|
}
|
|
852
|
-
function
|
|
853
|
-
var
|
|
854
|
-
(
|
|
855
|
+
function b() {
|
|
856
|
+
var u;
|
|
857
|
+
(u = a.value) == null || u.showSheet(
|
|
855
858
|
!0,
|
|
856
859
|
{
|
|
857
860
|
type: "NO_REWARD",
|
|
@@ -861,47 +864,47 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
861
864
|
l.value.length
|
|
862
865
|
);
|
|
863
866
|
}
|
|
864
|
-
return (
|
|
865
|
-
const
|
|
867
|
+
return (u, r) => {
|
|
868
|
+
const d = resolveComponent("FmButton"), g = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
866
869
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
867
|
-
|
|
868
|
-
createVNode(
|
|
869
|
-
label: "
|
|
870
|
-
onClick: r[0] || (r[0] = (
|
|
870
|
+
createElementVNode("div", _hoisted_2$7, toDisplayString(unref(p)("connect.template.configure_reward_type")), 1),
|
|
871
|
+
createVNode(d, {
|
|
872
|
+
label: unref(p)("connect.campaign.rewardPool.addReward"),
|
|
873
|
+
onClick: r[0] || (r[0] = (V) => b()),
|
|
871
874
|
variant: "plain",
|
|
872
875
|
icon: "add"
|
|
873
|
-
}),
|
|
874
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (
|
|
875
|
-
key:
|
|
876
|
+
}, null, 8, ["label"]),
|
|
877
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (V, x) => (openBlock(), createBlock(g, {
|
|
878
|
+
key: x,
|
|
876
879
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
877
880
|
variant: "outlined",
|
|
878
|
-
onClick: (
|
|
881
|
+
onClick: (B) => v(x)
|
|
879
882
|
}, {
|
|
880
883
|
default: withCtx(() => {
|
|
881
|
-
var
|
|
884
|
+
var B;
|
|
882
885
|
return [
|
|
883
886
|
createElementVNode("div", null, [
|
|
884
|
-
createElementVNode("div",
|
|
885
|
-
createElementVNode("div",
|
|
887
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(V.type == "LOYALTY" ? (B = V == null ? void 0 : V.earningOption) == null ? void 0 : B.amount : "") + " " + toDisplayString(y(V).label), 1),
|
|
888
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(y(V).sublabel), 1)
|
|
886
889
|
]),
|
|
887
|
-
createVNode(
|
|
890
|
+
createVNode(d, {
|
|
888
891
|
icon: "delete",
|
|
889
892
|
variant: "tertiary",
|
|
890
|
-
onClick: (
|
|
893
|
+
onClick: (h) => (h.stopPropagation(), C(x))
|
|
891
894
|
}, null, 8, ["onClick"])
|
|
892
895
|
];
|
|
893
896
|
}),
|
|
894
897
|
_: 2
|
|
895
898
|
}, 1032, ["onClick"]))), 128)),
|
|
896
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
897
|
-
key:
|
|
898
|
-
text:
|
|
899
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(k, {
|
|
900
|
+
key: V.message,
|
|
901
|
+
text: V.message,
|
|
899
902
|
state: "error"
|
|
900
903
|
}, null, 8, ["text"]))), 128)),
|
|
901
904
|
createVNode(_sfc_main$b, {
|
|
902
905
|
ref_key: "sheetRef",
|
|
903
|
-
ref:
|
|
904
|
-
"onUpdate:modelValue":
|
|
906
|
+
ref: a,
|
|
907
|
+
"onUpdate:modelValue": f
|
|
905
908
|
}, null, 512)
|
|
906
909
|
]);
|
|
907
910
|
};
|
|
@@ -918,55 +921,55 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
918
921
|
},
|
|
919
922
|
emits: ["update:model-value"],
|
|
920
923
|
setup(e, { emit: m }) {
|
|
921
|
-
const
|
|
924
|
+
const { t: o } = useI18n(), c = e, s = m, p = computed(() => [
|
|
922
925
|
{
|
|
923
|
-
label: "
|
|
924
|
-
description: "
|
|
926
|
+
label: o("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
927
|
+
description: o("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
925
928
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
926
929
|
}
|
|
927
930
|
]);
|
|
928
|
-
return (
|
|
929
|
-
var y, v,
|
|
930
|
-
const
|
|
931
|
+
return (n, l) => {
|
|
932
|
+
var y, v, C;
|
|
933
|
+
const i = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
|
|
931
934
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
932
|
-
createVNode(
|
|
933
|
-
label: "
|
|
935
|
+
createVNode(i, {
|
|
936
|
+
label: unref(o)("connect.template.promotion_game.enable"),
|
|
934
937
|
"model-value": !!((y = e.modelValue) != null && y.gameType),
|
|
935
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
936
|
-
}, null, 8, ["model-value"]),
|
|
938
|
+
"onUpdate:modelValue": l[0] || (l[0] = (b) => b ? s("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : s("update:model-value", null))
|
|
939
|
+
}, null, 8, ["label", "model-value"]),
|
|
937
940
|
((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
938
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
939
|
-
var
|
|
940
|
-
return openBlock(), createBlock(
|
|
941
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (b) => {
|
|
942
|
+
var u, r;
|
|
943
|
+
return openBlock(), createBlock(a, {
|
|
941
944
|
variant: "outlined",
|
|
942
945
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
943
|
-
"col-span-2": unref(
|
|
944
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
945
|
-
"hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) !=
|
|
946
|
+
"col-span-2": unref(p).length == 1,
|
|
947
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((u = e.modelValue) == null ? void 0 : u.gameType) == b.value,
|
|
948
|
+
"hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != b.value
|
|
946
949
|
}]),
|
|
947
950
|
onClick: () => {
|
|
948
|
-
var
|
|
949
|
-
((
|
|
951
|
+
var d;
|
|
952
|
+
((d = c.modelValue) == null ? void 0 : d.gameType) != b.value && s("update:model-value", { gameType: b.value });
|
|
950
953
|
},
|
|
951
|
-
key:
|
|
954
|
+
key: b.value
|
|
952
955
|
}, {
|
|
953
956
|
default: withCtx(() => [
|
|
954
|
-
createElementVNode("div", _hoisted_3$5, toDisplayString(
|
|
955
|
-
createElementVNode("div", _hoisted_4$4, toDisplayString(
|
|
957
|
+
createElementVNode("div", _hoisted_3$5, toDisplayString(b.label), 1),
|
|
958
|
+
createElementVNode("div", _hoisted_4$4, toDisplayString(b.description), 1)
|
|
956
959
|
]),
|
|
957
960
|
_: 2
|
|
958
961
|
}, 1032, ["class", "onClick"]);
|
|
959
962
|
}), 128))
|
|
960
963
|
])) : createCommentVNode("", !0),
|
|
961
|
-
((
|
|
964
|
+
((C = e.modelValue) == null ? void 0 : C.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(f, {
|
|
962
965
|
key: 1,
|
|
963
|
-
text: "
|
|
966
|
+
text: unref(o)("connect.template.promotion_game.rock_paper_scissors.warning"),
|
|
964
967
|
state: "warning"
|
|
965
|
-
})) : createCommentVNode("", !0)
|
|
968
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
966
969
|
]);
|
|
967
970
|
};
|
|
968
971
|
}
|
|
969
|
-
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "grid grid-cols-2 gap-16" },
|
|
972
|
+
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$4 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
970
973
|
__name: "MissionTypeInput",
|
|
971
974
|
props: {
|
|
972
975
|
modelValue: {
|
|
@@ -975,38 +978,38 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
975
978
|
},
|
|
976
979
|
emits: ["update:model-value"],
|
|
977
980
|
setup(e, { emit: m }) {
|
|
978
|
-
const
|
|
981
|
+
const { t: o } = useI18n(), c = e, s = m, p = computed(() => [
|
|
979
982
|
{
|
|
980
|
-
label: "
|
|
981
|
-
description: "
|
|
983
|
+
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
984
|
+
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
982
985
|
value: F_MISSION_TYPE.enum.STAMP
|
|
983
986
|
},
|
|
984
987
|
{
|
|
985
|
-
label: "
|
|
986
|
-
description: "
|
|
988
|
+
label: o("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
|
|
989
|
+
description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
|
|
987
990
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
988
991
|
}
|
|
989
992
|
]);
|
|
990
|
-
return (
|
|
991
|
-
const
|
|
993
|
+
return (n, l) => {
|
|
994
|
+
const i = resolveComponent("FmCard");
|
|
992
995
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
993
|
-
|
|
994
|
-
createElementVNode("div",
|
|
995
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
996
|
+
createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
997
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
998
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(i, {
|
|
996
999
|
variant: "outlined",
|
|
997
1000
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
998
|
-
"col-span-2": unref(
|
|
999
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1000
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1001
|
+
"col-span-2": unref(p).length == 1,
|
|
1002
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
1003
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
1001
1004
|
}]),
|
|
1002
1005
|
onClick: () => {
|
|
1003
|
-
|
|
1006
|
+
c.modelValue != a.value && s("update:model-value", a.value);
|
|
1004
1007
|
},
|
|
1005
|
-
key:
|
|
1008
|
+
key: a.value
|
|
1006
1009
|
}, {
|
|
1007
1010
|
default: withCtx(() => [
|
|
1008
|
-
createElementVNode("div",
|
|
1009
|
-
createElementVNode("div",
|
|
1011
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(a.label), 1),
|
|
1012
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(a.description), 1)
|
|
1010
1013
|
]),
|
|
1011
1014
|
_: 2
|
|
1012
1015
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1029,15 +1032,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1029
1032
|
},
|
|
1030
1033
|
emits: ["update:model-value"],
|
|
1031
1034
|
setup(e, { emit: m }) {
|
|
1032
|
-
const
|
|
1033
|
-
return (
|
|
1034
|
-
const
|
|
1035
|
+
const o = m;
|
|
1036
|
+
return (c, s) => {
|
|
1037
|
+
const p = resolveComponent("FmStepperField");
|
|
1035
1038
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1036
|
-
|
|
1037
|
-
createVNode(
|
|
1039
|
+
s[1] || (s[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)),
|
|
1040
|
+
createVNode(p, {
|
|
1038
1041
|
label: "Maximum to collect",
|
|
1039
1042
|
"model-value": e.modelValue || null,
|
|
1040
|
-
"onUpdate:modelValue":
|
|
1043
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => o("update:model-value", n)),
|
|
1041
1044
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1042
1045
|
"helper-state": e.helperState || "none"
|
|
1043
1046
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -1053,49 +1056,49 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1053
1056
|
}
|
|
1054
1057
|
},
|
|
1055
1058
|
emits: ["update:model-value"],
|
|
1056
|
-
setup(e, { expose: m, emit:
|
|
1057
|
-
const
|
|
1058
|
-
var
|
|
1059
|
-
return ((
|
|
1060
|
-
(
|
|
1061
|
-
var
|
|
1062
|
-
return
|
|
1059
|
+
setup(e, { expose: m, emit: o }) {
|
|
1060
|
+
const c = e, s = useMembershipStore(), { minor: p } = useLoading, n = ref(!1), l = ref(), i = ref(), a = ref(0), f = computed(() => {
|
|
1061
|
+
var d;
|
|
1062
|
+
return ((d = s.loyaltyRewards.items.find(
|
|
1063
|
+
(g) => {
|
|
1064
|
+
var k;
|
|
1065
|
+
return g.value === ((k = l.value) == null ? void 0 : k.collectible);
|
|
1063
1066
|
}
|
|
1064
|
-
)) == null ? void 0 :
|
|
1065
|
-
}),
|
|
1066
|
-
const
|
|
1067
|
-
return
|
|
1067
|
+
)) == null ? void 0 : d.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1068
|
+
}), y = computed(() => {
|
|
1069
|
+
const r = f.value.safeParse(l.value);
|
|
1070
|
+
return r.success ? [] : r.error.errors;
|
|
1068
1071
|
});
|
|
1069
|
-
function
|
|
1070
|
-
|
|
1072
|
+
function v(r, d, g) {
|
|
1073
|
+
r && (l.value = d, a.value = g), n.value = r;
|
|
1071
1074
|
}
|
|
1072
|
-
const
|
|
1073
|
-
async function
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1075
|
+
const C = o;
|
|
1076
|
+
async function b() {
|
|
1077
|
+
const r = f.value.safeParse(l.value);
|
|
1078
|
+
r.success && (await p(
|
|
1076
1079
|
async () => {
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
+
r.data.type === "VOUCHER" && i.value && (r.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1081
|
+
r.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, i.value),
|
|
1082
|
+
i.value
|
|
1080
1083
|
));
|
|
1081
1084
|
},
|
|
1082
1085
|
{
|
|
1083
1086
|
message: "Uploading reward image",
|
|
1084
1087
|
successMessage: "Reward image updated"
|
|
1085
1088
|
}
|
|
1086
|
-
),
|
|
1089
|
+
), C("update:model-value", r.data, a.value));
|
|
1087
1090
|
}
|
|
1088
|
-
const
|
|
1091
|
+
const u = ref();
|
|
1089
1092
|
return m({
|
|
1090
|
-
showSheet:
|
|
1091
|
-
}), (
|
|
1092
|
-
const
|
|
1093
|
-
return openBlock(), createBlock(
|
|
1093
|
+
showSheet: v
|
|
1094
|
+
}), (r, d) => {
|
|
1095
|
+
const g = resolveComponent("FmStepperField"), k = resolveComponent("FmSelect"), V = resolveComponent("FmForm"), x = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1096
|
+
return openBlock(), createBlock(B, {
|
|
1094
1097
|
"max-width": 560,
|
|
1095
|
-
modelValue: unref(
|
|
1098
|
+
modelValue: unref(n),
|
|
1096
1099
|
"onUpdate:modelValue": [
|
|
1097
|
-
|
|
1098
|
-
|
|
1100
|
+
d[10] || (d[10] = (h) => isRef(n) ? n.value = h : null),
|
|
1101
|
+
d[11] || (d[11] = (h) => n.value = h)
|
|
1099
1102
|
],
|
|
1100
1103
|
header: "Edit reward",
|
|
1101
1104
|
"dismiss-away": ""
|
|
@@ -1106,59 +1109,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1106
1109
|
variant: "primary",
|
|
1107
1110
|
type: "button",
|
|
1108
1111
|
label: "Confirm",
|
|
1109
|
-
disabled: unref(
|
|
1110
|
-
onClick:
|
|
1111
|
-
var
|
|
1112
|
-
return (
|
|
1112
|
+
disabled: unref(y).length > 0,
|
|
1113
|
+
onClick: d[8] || (d[8] = async () => {
|
|
1114
|
+
var h;
|
|
1115
|
+
return (h = unref(u)) == null ? void 0 : h.validateInputs();
|
|
1113
1116
|
})
|
|
1114
1117
|
}, null, 8, ["disabled"]),
|
|
1115
1118
|
createVNode(x, {
|
|
1116
1119
|
variant: "secondary",
|
|
1117
1120
|
type: "button",
|
|
1118
1121
|
label: "Cancel",
|
|
1119
|
-
onClick:
|
|
1122
|
+
onClick: d[9] || (d[9] = (h) => n.value = !1)
|
|
1120
1123
|
})
|
|
1121
1124
|
])
|
|
1122
1125
|
]),
|
|
1123
1126
|
default: withCtx(() => [
|
|
1124
|
-
createVNode(JsonViewer, { json: unref(
|
|
1125
|
-
unref(
|
|
1127
|
+
createVNode(JsonViewer, { json: unref(l) }, null, 8, ["json"]),
|
|
1128
|
+
unref(l) ? (openBlock(), createBlock(V, {
|
|
1126
1129
|
key: 0,
|
|
1127
1130
|
class: "flex flex-col gap-y-24",
|
|
1128
1131
|
ref_key: "formRef",
|
|
1129
|
-
ref:
|
|
1130
|
-
onValidationSuccess:
|
|
1132
|
+
ref: u,
|
|
1133
|
+
onValidationSuccess: d[7] || (d[7] = (h) => b())
|
|
1131
1134
|
}, {
|
|
1132
1135
|
default: withCtx(() => {
|
|
1133
|
-
var
|
|
1136
|
+
var h, R;
|
|
1134
1137
|
return [
|
|
1135
|
-
unref(
|
|
1138
|
+
unref(l).type ? (openBlock(), createBlock(g, {
|
|
1136
1139
|
key: 0,
|
|
1137
1140
|
label: "Threshold",
|
|
1138
1141
|
rules: [
|
|
1139
1142
|
unref(ZodHelper).toRule(
|
|
1140
1143
|
unref(z).number().min(1).max(
|
|
1141
|
-
|
|
1142
|
-
`Number cannot be more than ${
|
|
1144
|
+
c.maxThreshold,
|
|
1145
|
+
`Number cannot be more than ${c.maxThreshold}`
|
|
1143
1146
|
)
|
|
1144
1147
|
)
|
|
1145
1148
|
],
|
|
1146
|
-
"model-value": unref(
|
|
1147
|
-
"onUpdate:modelValue":
|
|
1148
|
-
...unref(
|
|
1149
|
-
threshold:
|
|
1149
|
+
"model-value": unref(l).threshold,
|
|
1150
|
+
"onUpdate:modelValue": d[0] || (d[0] = (S) => l.value = {
|
|
1151
|
+
...unref(l),
|
|
1152
|
+
threshold: S
|
|
1150
1153
|
})
|
|
1151
1154
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1152
|
-
createVNode(
|
|
1155
|
+
createVNode(k, {
|
|
1153
1156
|
label: "Reward Type",
|
|
1154
1157
|
items: [
|
|
1155
1158
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1156
1159
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1157
1160
|
],
|
|
1158
|
-
"model-value": unref(
|
|
1159
|
-
"onUpdate:modelValue":
|
|
1160
|
-
var
|
|
1161
|
-
|
|
1161
|
+
"model-value": unref(l).type,
|
|
1162
|
+
"onUpdate:modelValue": d[1] || (d[1] = (S) => {
|
|
1163
|
+
var E, $;
|
|
1164
|
+
S === "VOUCHER" ? l.value = {
|
|
1162
1165
|
collectible: null,
|
|
1163
1166
|
type: "VOUCHER",
|
|
1164
1167
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1171,9 +1174,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1171
1174
|
validityOption: {
|
|
1172
1175
|
validForDay: 7
|
|
1173
1176
|
},
|
|
1174
|
-
threshold: (
|
|
1175
|
-
} :
|
|
1176
|
-
collectible: unref(
|
|
1177
|
+
threshold: (E = unref(l)) == null ? void 0 : E.threshold
|
|
1178
|
+
} : l.value = {
|
|
1179
|
+
collectible: unref(s).loyaltyRewards.raw[0]._id,
|
|
1177
1180
|
type: "LOYALTY",
|
|
1178
1181
|
earningOption: {
|
|
1179
1182
|
amount: 1,
|
|
@@ -1182,60 +1185,60 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1182
1185
|
validityOption: {
|
|
1183
1186
|
validForDay: 7
|
|
1184
1187
|
},
|
|
1185
|
-
threshold: (
|
|
1188
|
+
threshold: ($ = unref(l)) == null ? void 0 : $.threshold
|
|
1186
1189
|
};
|
|
1187
1190
|
})
|
|
1188
1191
|
}, null, 8, ["model-value"]),
|
|
1189
|
-
unref(
|
|
1192
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(k, {
|
|
1190
1193
|
key: 1,
|
|
1191
1194
|
label: "Loyalty type",
|
|
1192
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1193
|
-
items: unref(
|
|
1194
|
-
"model-value": unref(
|
|
1195
|
-
"onUpdate:modelValue":
|
|
1195
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(l).type])],
|
|
1196
|
+
items: unref(s).loyaltyRewards.items,
|
|
1197
|
+
"model-value": unref(l).collectible,
|
|
1198
|
+
"onUpdate:modelValue": d[2] || (d[2] = (S) => unref(l).collectible = S)
|
|
1196
1199
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1197
|
-
unref(
|
|
1198
|
-
|
|
1200
|
+
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1201
|
+
d[12] || (d[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
1199
1202
|
createVNode(_sfc_main$l, {
|
|
1200
1203
|
class: "mt-[-8px]",
|
|
1201
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1202
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1203
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1204
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(l).type])],
|
|
1205
|
+
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
1206
|
+
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
1204
1207
|
"fixed-type": !0,
|
|
1205
|
-
"model-value": unref(
|
|
1206
|
-
"onUpdate:modelValue":
|
|
1207
|
-
...unref(
|
|
1208
|
-
earningOption:
|
|
1208
|
+
"model-value": unref(l).earningOption,
|
|
1209
|
+
"onUpdate:modelValue": d[3] || (d[3] = (S) => l.value = {
|
|
1210
|
+
...unref(l),
|
|
1211
|
+
earningOption: S
|
|
1209
1212
|
})
|
|
1210
1213
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1211
1214
|
createVNode(_sfc_main$m, {
|
|
1212
1215
|
class: "!gap-24",
|
|
1213
|
-
type: unref(
|
|
1214
|
-
"for-credit": unref(
|
|
1215
|
-
(
|
|
1216
|
-
var
|
|
1217
|
-
return
|
|
1216
|
+
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1217
|
+
"for-credit": unref(l).type === "LOYALTY" && ((h = unref(s).loyaltyRewards.items.find(
|
|
1218
|
+
(S) => {
|
|
1219
|
+
var E;
|
|
1220
|
+
return S.value === ((E = unref(l)) == null ? void 0 : E.collectible);
|
|
1218
1221
|
}
|
|
1219
|
-
)) == null ? void 0 :
|
|
1220
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1221
|
-
"model-value": unref(
|
|
1222
|
-
"onUpdate:modelValue":
|
|
1223
|
-
...unref(
|
|
1224
|
-
validityOption:
|
|
1222
|
+
)) == null ? void 0 : h.raw.type) === "CREDIT",
|
|
1223
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(l).type])],
|
|
1224
|
+
"model-value": unref(l).validityOption,
|
|
1225
|
+
"onUpdate:modelValue": d[4] || (d[4] = (S) => l.value = {
|
|
1226
|
+
...unref(l),
|
|
1227
|
+
validityOption: S
|
|
1225
1228
|
})
|
|
1226
1229
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1227
1230
|
], 64)) : createCommentVNode("", !0),
|
|
1228
|
-
unref(
|
|
1231
|
+
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1229
1232
|
key: 3,
|
|
1230
|
-
"reward-image": unref(
|
|
1231
|
-
"model-value": ((
|
|
1232
|
-
"onUpdate:modelValue":
|
|
1233
|
-
...unref(
|
|
1234
|
-
collectibleConfig:
|
|
1233
|
+
"reward-image": unref(i),
|
|
1234
|
+
"model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
1235
|
+
"onUpdate:modelValue": d[5] || (d[5] = (S) => l.value = {
|
|
1236
|
+
...unref(l),
|
|
1237
|
+
collectibleConfig: S
|
|
1235
1238
|
}),
|
|
1236
|
-
"onUpdate:rewardImage":
|
|
1239
|
+
"onUpdate:rewardImage": d[6] || (d[6] = (S) => i.value = S)
|
|
1237
1240
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1238
|
-
createVNode(JsonViewer, { json: unref(
|
|
1241
|
+
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
1239
1242
|
];
|
|
1240
1243
|
}),
|
|
1241
1244
|
_: 1
|
|
@@ -1269,19 +1272,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1269
1272
|
}
|
|
1270
1273
|
},
|
|
1271
1274
|
setup(e) {
|
|
1272
|
-
const m = e, { maxRange:
|
|
1273
|
-
() => Math.min(
|
|
1274
|
-
),
|
|
1275
|
-
return (
|
|
1276
|
-
const
|
|
1275
|
+
const m = e, { maxRange: o, currentRange: c, markers: s } = toRefs(m), p = computed(
|
|
1276
|
+
() => Math.min(c.value / o.value * 100, 100)
|
|
1277
|
+
), n = (l) => l / o.value * 100;
|
|
1278
|
+
return (l, i) => {
|
|
1279
|
+
const a = resolveComponent("FmIcon");
|
|
1277
1280
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1278
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(
|
|
1281
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (f) => (openBlock(), createBlock(a, {
|
|
1279
1282
|
class: normalizeClass(
|
|
1280
|
-
unref(
|
|
1283
|
+
unref(c) >= f ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1281
1284
|
),
|
|
1282
|
-
outline: unref(
|
|
1283
|
-
key:
|
|
1284
|
-
name: unref(
|
|
1285
|
+
outline: unref(c) < f,
|
|
1286
|
+
key: f,
|
|
1287
|
+
name: unref(s).some((y) => y === f) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
1285
1288
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
1286
1289
|
])) : (openBlock(), createElementBlock("div", {
|
|
1287
1290
|
key: 1,
|
|
@@ -1289,18 +1292,18 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1289
1292
|
}, [
|
|
1290
1293
|
createElementVNode("div", {
|
|
1291
1294
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
1292
|
-
style: normalizeStyle({ width: unref(
|
|
1295
|
+
style: normalizeStyle({ width: unref(p) + "%" })
|
|
1293
1296
|
}, null, 4),
|
|
1294
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1295
|
-
key:
|
|
1297
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (f, y) => (openBlock(), createElementBlock("div", {
|
|
1298
|
+
key: y,
|
|
1296
1299
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
1297
|
-
style: normalizeStyle({ left:
|
|
1300
|
+
style: normalizeStyle({ left: n(f) + "%" })
|
|
1298
1301
|
}, [
|
|
1299
1302
|
createElementVNode("div", _hoisted_2$4, [
|
|
1300
1303
|
createElementVNode("div", {
|
|
1301
1304
|
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
1302
1305
|
}),
|
|
1303
|
-
|
|
1306
|
+
i[0] || (i[0] = createElementVNode("div", null, "🎁", -1))
|
|
1304
1307
|
])
|
|
1305
1308
|
], 4))), 128))
|
|
1306
1309
|
]));
|
|
@@ -1308,19 +1311,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1308
1311
|
}
|
|
1309
1312
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1310
1313
|
function changeKeysFactory(e) {
|
|
1311
|
-
return function m(
|
|
1312
|
-
if (
|
|
1313
|
-
return
|
|
1314
|
-
if (Array.isArray(
|
|
1315
|
-
return
|
|
1316
|
-
const
|
|
1317
|
-
return Object.keys(
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1320
|
-
}),
|
|
1314
|
+
return function m(o, c = 1, s) {
|
|
1315
|
+
if (c === 0 || !isObject(o))
|
|
1316
|
+
return o;
|
|
1317
|
+
if (Array.isArray(o))
|
|
1318
|
+
return o.map((n) => m(n, c - 1, s));
|
|
1319
|
+
const p = Object.create(Object.getPrototypeOf(o));
|
|
1320
|
+
return Object.keys(o).forEach((n) => {
|
|
1321
|
+
const l = o[n], i = e(n, s), a = m(l, c - 1, s);
|
|
1322
|
+
p[i] = a;
|
|
1323
|
+
}), p;
|
|
1321
1324
|
};
|
|
1322
1325
|
}
|
|
1323
|
-
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" },
|
|
1326
|
+
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$2 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1324
1327
|
__name: "MissionPoolInput",
|
|
1325
1328
|
props: {
|
|
1326
1329
|
modelValue: {
|
|
@@ -1334,42 +1337,49 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1334
1337
|
},
|
|
1335
1338
|
emits: ["update:model-value"],
|
|
1336
1339
|
setup(e, { emit: m }) {
|
|
1337
|
-
const
|
|
1338
|
-
() =>
|
|
1339
|
-
),
|
|
1340
|
-
const r =
|
|
1340
|
+
const { t: o } = useI18n(), c = e, s = m, p = useMembershipStore(), n = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1341
|
+
() => c.modelValue.sort((r, d) => r.threshold - d.threshold) ?? []
|
|
1342
|
+
), i = computed(() => {
|
|
1343
|
+
const r = n.safeParse(l.value);
|
|
1341
1344
|
return r.success ? [] : r.error.errors;
|
|
1342
|
-
}),
|
|
1343
|
-
function
|
|
1344
|
-
var
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1345
|
+
}), a = ref();
|
|
1346
|
+
function f(r, d) {
|
|
1347
|
+
var k;
|
|
1348
|
+
const g = [...l.value];
|
|
1349
|
+
g[d] = r, (k = a.value) == null || k.showSheet(!1), s("update:model-value", g);
|
|
1347
1350
|
}
|
|
1348
1351
|
function y(r) {
|
|
1349
|
-
const
|
|
1350
|
-
(
|
|
1351
|
-
),
|
|
1352
|
+
const d = r.type == "VOUCHER" ? r.collectibleConfig : p.collectibles.find(
|
|
1353
|
+
(V) => V._id.toString() == r.collectible
|
|
1354
|
+
), g = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), k = r.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
1355
|
+
threshold: r.threshold,
|
|
1356
|
+
amount: r.earningOption.amount
|
|
1357
|
+
}) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
1358
|
+
threshold: r.threshold,
|
|
1359
|
+
amount: r.earningOption.amount,
|
|
1360
|
+
every: r.earningOption.every
|
|
1361
|
+
});
|
|
1352
1362
|
return {
|
|
1353
|
-
label: isNullOrEmpty(
|
|
1354
|
-
sublabel:
|
|
1363
|
+
label: isNullOrEmpty(g) ? o("connect.template.mission_pool.no_reward") : g,
|
|
1364
|
+
sublabel: k
|
|
1355
1365
|
};
|
|
1356
1366
|
}
|
|
1357
1367
|
function v(r) {
|
|
1358
|
-
var
|
|
1359
|
-
const
|
|
1360
|
-
(
|
|
1368
|
+
var g;
|
|
1369
|
+
const d = [...l.value];
|
|
1370
|
+
(g = a.value) == null || g.showSheet(!0, d[r], r);
|
|
1361
1371
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1372
|
+
function C(r) {
|
|
1373
|
+
const d = [...l.value];
|
|
1374
|
+
d.splice(r, 1), s("update:model-value", d);
|
|
1365
1375
|
}
|
|
1366
|
-
function
|
|
1376
|
+
function b() {
|
|
1367
1377
|
var r;
|
|
1368
|
-
(r =
|
|
1378
|
+
(r = a.value) == null || r.showSheet(
|
|
1369
1379
|
!0,
|
|
1370
1380
|
{
|
|
1371
1381
|
type: "LOYALTY",
|
|
1372
|
-
collectible:
|
|
1382
|
+
collectible: p.loyaltyRewards.items[0].value,
|
|
1373
1383
|
threshold: null,
|
|
1374
1384
|
validityOption: {
|
|
1375
1385
|
validForDay: 7
|
|
@@ -1382,71 +1392,71 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1382
1392
|
l.value.length
|
|
1383
1393
|
);
|
|
1384
1394
|
}
|
|
1385
|
-
function
|
|
1386
|
-
var
|
|
1387
|
-
return r.type == "VOUCHER" ? (
|
|
1388
|
-
((
|
|
1389
|
-
(
|
|
1390
|
-
)) == null ? void 0 :
|
|
1395
|
+
function u(r) {
|
|
1396
|
+
var d, g;
|
|
1397
|
+
return r.type == "VOUCHER" ? (d = r.collectibleConfig) == null ? void 0 : d.name : sentenceCase(
|
|
1398
|
+
((g = p.loyaltyRewards.items.find(
|
|
1399
|
+
(k) => k.value == r.collectible
|
|
1400
|
+
)) == null ? void 0 : g.label) || ""
|
|
1391
1401
|
);
|
|
1392
1402
|
}
|
|
1393
|
-
return (r,
|
|
1394
|
-
const
|
|
1403
|
+
return (r, d) => {
|
|
1404
|
+
const g = resolveComponent("FmButton"), k = resolveComponent("FmCard"), V = resolveComponent("FmHelperText");
|
|
1395
1405
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1396
|
-
|
|
1397
|
-
createVNode(
|
|
1398
|
-
label: "
|
|
1399
|
-
onClick:
|
|
1406
|
+
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
|
|
1407
|
+
createVNode(g, {
|
|
1408
|
+
label: unref(o)("connect.template.mission_pool.add_reward"),
|
|
1409
|
+
onClick: d[0] || (d[0] = (x) => b()),
|
|
1400
1410
|
variant: "plain",
|
|
1401
1411
|
icon: "add"
|
|
1402
|
-
}),
|
|
1403
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (
|
|
1404
|
-
key:
|
|
1412
|
+
}, null, 8, ["label"]),
|
|
1413
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (x, B) => (openBlock(), createBlock(k, {
|
|
1414
|
+
key: B,
|
|
1405
1415
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1406
1416
|
variant: "outlined",
|
|
1407
|
-
onClick: (
|
|
1417
|
+
onClick: (h) => v(B)
|
|
1408
1418
|
}, {
|
|
1409
1419
|
default: withCtx(() => [
|
|
1410
1420
|
createElementVNode("div", null, [
|
|
1411
|
-
createElementVNode("div",
|
|
1412
|
-
createElementVNode("div",
|
|
1421
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(y(x).label), 1),
|
|
1422
|
+
createElementVNode("div", _hoisted_4$2, toDisplayString(y(x).sublabel), 1)
|
|
1413
1423
|
]),
|
|
1414
|
-
createVNode(
|
|
1424
|
+
createVNode(g, {
|
|
1415
1425
|
icon: "delete",
|
|
1416
1426
|
variant: "tertiary",
|
|
1417
|
-
onClick: (
|
|
1427
|
+
onClick: (h) => (h.stopPropagation(), C(B))
|
|
1418
1428
|
}, null, 8, ["onClick"])
|
|
1419
1429
|
]),
|
|
1420
1430
|
_: 2
|
|
1421
1431
|
}, 1032, ["onClick"]))), 128)),
|
|
1422
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1423
|
-
key:
|
|
1424
|
-
text:
|
|
1432
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(V, {
|
|
1433
|
+
key: x.message,
|
|
1434
|
+
text: x.message,
|
|
1425
1435
|
state: "error"
|
|
1426
1436
|
}, null, 8, ["text"]))), 128)),
|
|
1427
|
-
|
|
1428
|
-
(openBlock(), createBlock(
|
|
1437
|
+
createElementVNode("div", _hoisted_5$2, toDisplayString(unref(o)("connect.template.mission_pool.preview")), 1),
|
|
1438
|
+
(openBlock(), createBlock(k, {
|
|
1429
1439
|
key: 0,
|
|
1430
1440
|
variant: "outlined",
|
|
1431
1441
|
class: "p-24 space-y-16 w-fit"
|
|
1432
1442
|
}, {
|
|
1433
1443
|
default: withCtx(() => {
|
|
1434
|
-
var
|
|
1444
|
+
var x, B;
|
|
1435
1445
|
return [
|
|
1436
|
-
createElementVNode("div",
|
|
1446
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
1437
1447
|
createElementVNode("div", null, [
|
|
1438
|
-
createElementVNode("div",
|
|
1439
|
-
|
|
1448
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount) > 1 ? (B = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : B.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? u(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
1449
|
+
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
1440
1450
|
])
|
|
1441
1451
|
]),
|
|
1442
|
-
createElementVNode("div",
|
|
1452
|
+
createElementVNode("div", _hoisted_9$2, [
|
|
1443
1453
|
createVNode(_sfc_main$5, {
|
|
1444
1454
|
type: e.mission.type,
|
|
1445
1455
|
"max-range": e.mission.end,
|
|
1446
1456
|
currentRange: e.mission.end / 4,
|
|
1447
|
-
markers: e.modelValue.map((
|
|
1457
|
+
markers: e.modelValue.map((h) => h.threshold)
|
|
1448
1458
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
1449
|
-
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div",
|
|
1459
|
+
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
1450
1460
|
])
|
|
1451
1461
|
];
|
|
1452
1462
|
}),
|
|
@@ -1454,55 +1464,55 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1454
1464
|
})),
|
|
1455
1465
|
createVNode(_sfc_main$6, {
|
|
1456
1466
|
ref_key: "sheetRef",
|
|
1457
|
-
ref:
|
|
1458
|
-
"onUpdate:modelValue":
|
|
1467
|
+
ref: a,
|
|
1468
|
+
"onUpdate:modelValue": f,
|
|
1459
1469
|
"max-threshold": e.mission.end
|
|
1460
1470
|
}, null, 8, ["max-threshold"])
|
|
1461
1471
|
]);
|
|
1462
1472
|
};
|
|
1463
1473
|
}
|
|
1464
|
-
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "grid grid-cols-2 gap-16" },
|
|
1474
|
+
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_10$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1465
1475
|
__name: "MissionInput",
|
|
1466
1476
|
props: {
|
|
1467
1477
|
modelValue: Object
|
|
1468
1478
|
},
|
|
1469
1479
|
emits: ["update:model-value"],
|
|
1470
1480
|
setup(e, { emit: m }) {
|
|
1471
|
-
const
|
|
1472
|
-
const l = FdoMission.safeParse(
|
|
1481
|
+
const { t: o } = useI18n(), c = e, s = computed(() => {
|
|
1482
|
+
const l = FdoMission.safeParse(c.modelValue);
|
|
1473
1483
|
return l.success ? [] : l.error.errors;
|
|
1474
|
-
}),
|
|
1484
|
+
}), p = computed(() => [
|
|
1475
1485
|
{
|
|
1476
|
-
label: "
|
|
1477
|
-
description: "
|
|
1486
|
+
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
1487
|
+
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
1478
1488
|
value: F_MISSION_TYPE.enum.STAMP
|
|
1479
1489
|
},
|
|
1480
1490
|
{
|
|
1481
|
-
label: "
|
|
1482
|
-
description: "
|
|
1491
|
+
label: o("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
|
|
1492
|
+
description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
|
|
1483
1493
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1484
1494
|
}
|
|
1485
|
-
]),
|
|
1486
|
-
return (l,
|
|
1495
|
+
]), n = m;
|
|
1496
|
+
return (l, i) => {
|
|
1487
1497
|
var y;
|
|
1488
|
-
const
|
|
1498
|
+
const a = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
|
|
1489
1499
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1490
1500
|
createElementVNode("div", _hoisted_2$2, [
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
createElementVNode("div",
|
|
1494
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1495
|
-
var
|
|
1496
|
-
return openBlock(), createBlock(
|
|
1501
|
+
createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
|
|
1502
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
1503
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
1504
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (v) => {
|
|
1505
|
+
var C, b;
|
|
1506
|
+
return openBlock(), createBlock(a, {
|
|
1497
1507
|
variant: "outlined",
|
|
1498
1508
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1499
|
-
"col-span-2": unref(
|
|
1500
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
1501
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
1509
|
+
"col-span-2": unref(p).length == 1,
|
|
1510
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((C = e.modelValue) == null ? void 0 : C.type) == v.value,
|
|
1511
|
+
"hover:bg-fm-color-opacity-sm": ((b = e.modelValue) == null ? void 0 : b.type) != v.value
|
|
1502
1512
|
}]),
|
|
1503
1513
|
onClick: () => {
|
|
1504
|
-
var
|
|
1505
|
-
((
|
|
1514
|
+
var u, r;
|
|
1515
|
+
((u = e.modelValue) == null ? void 0 : u.type) != v.value && n("update:model-value", {
|
|
1506
1516
|
...e.modelValue,
|
|
1507
1517
|
type: v.value,
|
|
1508
1518
|
end: ((r = e.modelValue) == null ? void 0 : r.end) || 1
|
|
@@ -1511,36 +1521,44 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1511
1521
|
key: v.value
|
|
1512
1522
|
}, {
|
|
1513
1523
|
default: withCtx(() => [
|
|
1514
|
-
createElementVNode("div",
|
|
1515
|
-
createElementVNode("div",
|
|
1524
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(v.label), 1),
|
|
1525
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(v.description), 1)
|
|
1516
1526
|
]),
|
|
1517
1527
|
_: 2
|
|
1518
1528
|
}, 1032, ["class", "onClick"]);
|
|
1519
1529
|
}), 128))
|
|
1520
1530
|
])
|
|
1521
1531
|
]),
|
|
1522
|
-
createElementVNode("div",
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
createVNode(
|
|
1526
|
-
label: "
|
|
1532
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
1533
|
+
createElementVNode("div", _hoisted_9$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequired")), 1),
|
|
1534
|
+
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
1535
|
+
createVNode(f, {
|
|
1536
|
+
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
1527
1537
|
"model-value": ((y = e.modelValue) == null ? void 0 : y.end) || null,
|
|
1528
|
-
"onUpdate:modelValue":
|
|
1529
|
-
var
|
|
1530
|
-
return
|
|
1538
|
+
"onUpdate:modelValue": i[0] || (i[0] = (v) => {
|
|
1539
|
+
var C;
|
|
1540
|
+
return n("update:model-value", {
|
|
1531
1541
|
...e.modelValue,
|
|
1532
|
-
type: ((
|
|
1542
|
+
type: ((C = e.modelValue) == null ? void 0 : C.type) || "STAMP",
|
|
1533
1543
|
end: v
|
|
1534
1544
|
});
|
|
1535
1545
|
}),
|
|
1536
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
1537
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1538
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
1546
|
+
"helper-text": unref(ZodHelper).helperText(unref(s), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
|
|
1547
|
+
"helper-state": unref(ZodHelper).helperState(unref(s), "end") || "none"
|
|
1548
|
+
}, null, 8, ["label", "model-value", "helper-text", "helper-state"])
|
|
1539
1549
|
])
|
|
1540
1550
|
]);
|
|
1541
1551
|
};
|
|
1542
1552
|
}
|
|
1543
|
-
})
|
|
1553
|
+
});
|
|
1554
|
+
function useLocaleText() {
|
|
1555
|
+
const { locale: e, t: m } = useI18n();
|
|
1556
|
+
function o(c, s) {
|
|
1557
|
+
return c ? c[e.value] ?? c["en-US"] ?? m(s) : m(s);
|
|
1558
|
+
}
|
|
1559
|
+
return { getLocaleText: o };
|
|
1560
|
+
}
|
|
1561
|
+
const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1544
1562
|
__name: "TemplateInput",
|
|
1545
1563
|
props: {
|
|
1546
1564
|
field: { type: Object, required: !0 },
|
|
@@ -1567,12 +1585,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1567
1585
|
},
|
|
1568
1586
|
emits: ["update:model-value", "update:file"],
|
|
1569
1587
|
setup(e, { emit: m }) {
|
|
1570
|
-
const { t:
|
|
1571
|
-
function
|
|
1572
|
-
switch (
|
|
1588
|
+
const { t: o } = useI18n(), { getLocaleText: c } = useLocaleText(), s = e, p = m;
|
|
1589
|
+
function n(f) {
|
|
1590
|
+
switch (s.field.type) {
|
|
1573
1591
|
case "timeframe":
|
|
1574
|
-
const y =
|
|
1575
|
-
|
|
1592
|
+
const y = f.startDate ? hooks(f.startDate).startOf("day").toISOString() : void 0, v = f.endDate ? hooks(f.endDate).endOf("day").toISOString() : void 0;
|
|
1593
|
+
p("update:model-value", {
|
|
1576
1594
|
type: "timeframe",
|
|
1577
1595
|
property: "__now",
|
|
1578
1596
|
start: y,
|
|
@@ -1580,134 +1598,134 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1580
1598
|
});
|
|
1581
1599
|
break;
|
|
1582
1600
|
case "image": {
|
|
1583
|
-
|
|
1601
|
+
p(
|
|
1584
1602
|
"update:file",
|
|
1585
|
-
|
|
1586
|
-
l.value || firebaseStorage.collectibleImagePath(void 0,
|
|
1603
|
+
f,
|
|
1604
|
+
l.value || firebaseStorage.collectibleImagePath(void 0, f)
|
|
1587
1605
|
);
|
|
1588
1606
|
break;
|
|
1589
1607
|
}
|
|
1590
1608
|
default:
|
|
1591
|
-
|
|
1609
|
+
p("update:model-value", f);
|
|
1592
1610
|
break;
|
|
1593
1611
|
}
|
|
1594
1612
|
}
|
|
1595
1613
|
const l = computed(() => {
|
|
1596
|
-
switch (
|
|
1614
|
+
switch (s.field.type) {
|
|
1597
1615
|
case "timeframe": {
|
|
1598
|
-
const
|
|
1616
|
+
const f = s.modelValue;
|
|
1599
1617
|
return {
|
|
1600
|
-
startDate:
|
|
1601
|
-
endDate:
|
|
1618
|
+
startDate: f != null && f.start ? hooks(f == null ? void 0 : f.start).format("YYYY-MM-DD") : null,
|
|
1619
|
+
endDate: f != null && f.end ? hooks(f == null ? void 0 : f.end).format("YYYY-MM-DD") : null
|
|
1602
1620
|
};
|
|
1603
1621
|
}
|
|
1604
1622
|
default:
|
|
1605
|
-
return
|
|
1623
|
+
return s.modelValue;
|
|
1606
1624
|
}
|
|
1607
1625
|
});
|
|
1608
|
-
function
|
|
1609
|
-
if (!
|
|
1610
|
-
const
|
|
1611
|
-
return
|
|
1626
|
+
function i() {
|
|
1627
|
+
if (!a.value.schema) return [];
|
|
1628
|
+
const f = a.value.schema.safeParse(s.modelValue);
|
|
1629
|
+
return f.success ? [] : f.error.errors;
|
|
1612
1630
|
}
|
|
1613
|
-
const
|
|
1614
|
-
schema:
|
|
1615
|
-
unwrapped:
|
|
1616
|
-
rules:
|
|
1617
|
-
labelMark:
|
|
1618
|
-
zodLabel:
|
|
1631
|
+
const a = computed(() => ({
|
|
1632
|
+
schema: s.schema,
|
|
1633
|
+
unwrapped: s.schema ? ZodHelper.unwrap(s.schema) : void 0,
|
|
1634
|
+
rules: s.schema ? [ZodHelper.ruleAtPath(s.schema, "")] : void 0,
|
|
1635
|
+
labelMark: s.schema && ZodHelper.isRequired(s.schema) == !1 ? "optional" : void 0,
|
|
1636
|
+
zodLabel: s.schema ? ZodHelper.toInputLabel(s.schema, s.field.label) : void 0
|
|
1619
1637
|
}));
|
|
1620
|
-
return (
|
|
1621
|
-
var
|
|
1622
|
-
const v = resolveComponent("FmTextField"),
|
|
1638
|
+
return (f, y) => {
|
|
1639
|
+
var d, g, k, V, x;
|
|
1640
|
+
const v = resolveComponent("FmTextField"), C = resolveComponent("FmStepperField"), b = resolveComponent("FmTextarea"), u = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
|
|
1623
1641
|
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
1624
1642
|
key: 0,
|
|
1625
|
-
label: unref(
|
|
1626
|
-
"label-mark": unref(
|
|
1627
|
-
rules: unref(
|
|
1643
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
1644
|
+
"label-mark": unref(a).labelMark,
|
|
1645
|
+
rules: unref(a).rules,
|
|
1628
1646
|
"model-value": unref(l),
|
|
1629
|
-
"onUpdate:modelValue":
|
|
1647
|
+
"onUpdate:modelValue": n,
|
|
1630
1648
|
"helper-state": e.helperText ? "error" : void 0,
|
|
1631
1649
|
"helper-text": e.helperText
|
|
1632
1650
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1633
1651
|
createVNode(JsonViewer, {
|
|
1634
|
-
json: { schema: unref(
|
|
1652
|
+
json: { schema: unref(a).unwrapped, props: s }
|
|
1635
1653
|
}, null, 8, ["json"]),
|
|
1636
|
-
createVNode(
|
|
1637
|
-
label: unref(
|
|
1638
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(
|
|
1654
|
+
createVNode(C, {
|
|
1655
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
1656
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(a).labelMark,
|
|
1639
1657
|
"model-value": unref(l),
|
|
1640
|
-
rules: e.field.isRuleChildren ? [] : unref(
|
|
1641
|
-
"onUpdate:modelValue":
|
|
1658
|
+
rules: e.field.isRuleChildren ? [] : unref(a).rules,
|
|
1659
|
+
"onUpdate:modelValue": n,
|
|
1642
1660
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
1643
1661
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
1644
1662
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
1645
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
1663
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(b, {
|
|
1646
1664
|
key: 2,
|
|
1647
|
-
label: unref(
|
|
1648
|
-
"label-mark": unref(
|
|
1649
|
-
rules: unref(
|
|
1665
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
1666
|
+
"label-mark": unref(a).labelMark,
|
|
1667
|
+
rules: unref(a).rules,
|
|
1650
1668
|
"model-value": unref(l),
|
|
1651
|
-
"onUpdate:modelValue":
|
|
1669
|
+
"onUpdate:modelValue": n,
|
|
1652
1670
|
"show-word-count": "",
|
|
1653
|
-
"max-length": (
|
|
1671
|
+
"max-length": (x = (V = (k = (g = (d = unref(a)) == null ? void 0 : d.unwrapped) == null ? void 0 : g._def) == null ? void 0 : k.checks) == null ? void 0 : V.find((B) => B.kind == "max")) == null ? void 0 : x.value
|
|
1654
1672
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
1655
1673
|
key: 3,
|
|
1656
1674
|
"campaign-type": e.extras,
|
|
1657
1675
|
"model-value": unref(l),
|
|
1658
1676
|
disabled: e.disabled,
|
|
1659
|
-
"onUpdate:modelValue":
|
|
1677
|
+
"onUpdate:modelValue": n
|
|
1660
1678
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1661
1679
|
createVNode(_sfc_main$e, {
|
|
1662
1680
|
"model-value": unref(l),
|
|
1663
|
-
"onUpdate:modelValue":
|
|
1681
|
+
"onUpdate:modelValue": n
|
|
1664
1682
|
}, null, 8, ["model-value"]),
|
|
1665
|
-
createVNode(
|
|
1683
|
+
createVNode(u, {
|
|
1666
1684
|
class: "!mt-[8px]",
|
|
1667
|
-
text: unref(ZodHelper).helperText(
|
|
1668
|
-
state: unref(ZodHelper).helperState(
|
|
1685
|
+
text: unref(ZodHelper).helperText(i(), ""),
|
|
1686
|
+
state: unref(ZodHelper).helperState(i(), "")
|
|
1669
1687
|
}, null, 8, ["text", "state"])
|
|
1670
1688
|
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1671
1689
|
key: 5,
|
|
1672
1690
|
thumbnail: unref(l),
|
|
1673
1691
|
"aspect-ratio": "16 / 9",
|
|
1674
1692
|
class: "w-1/2 xs:w-2/3",
|
|
1675
|
-
"onUpdate:file":
|
|
1693
|
+
"onUpdate:file": n
|
|
1676
1694
|
}, {
|
|
1677
1695
|
label: withCtx(() => [
|
|
1678
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
1696
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(a).zodLabel)))
|
|
1679
1697
|
]),
|
|
1680
1698
|
_: 1
|
|
1681
1699
|
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(r, {
|
|
1682
1700
|
key: 6,
|
|
1683
|
-
label: unref(
|
|
1701
|
+
label: unref(c)(e.field.label_locale, e.field.label ?? ""),
|
|
1684
1702
|
"label-placement": "right",
|
|
1685
1703
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
1686
|
-
"label-mark": unref(
|
|
1687
|
-
rules: unref(
|
|
1704
|
+
"label-mark": unref(a).labelMark,
|
|
1705
|
+
rules: unref(a).rules,
|
|
1688
1706
|
"model-value": unref(l),
|
|
1689
|
-
"onUpdate:modelValue":
|
|
1707
|
+
"onUpdate:modelValue": n
|
|
1690
1708
|
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
|
|
1691
1709
|
key: 7,
|
|
1692
1710
|
"model-value": unref(l),
|
|
1693
|
-
"onUpdate:modelValue":
|
|
1711
|
+
"onUpdate:modelValue": n,
|
|
1694
1712
|
"no-campaign": !1,
|
|
1695
|
-
schema: unref(
|
|
1713
|
+
schema: unref(a).schema,
|
|
1696
1714
|
"is-mission": e.extras === "MISSION"
|
|
1697
1715
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
1698
1716
|
key: 8,
|
|
1699
1717
|
"model-value": unref(l),
|
|
1700
|
-
"onUpdate:modelValue":
|
|
1718
|
+
"onUpdate:modelValue": n
|
|
1701
1719
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
1702
1720
|
createVNode(_sfc_main$r, {
|
|
1703
1721
|
"model-value": unref(l),
|
|
1704
|
-
"onUpdate:modelValue":
|
|
1722
|
+
"onUpdate:modelValue": n,
|
|
1705
1723
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
1706
1724
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
1707
|
-
unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
1725
|
+
unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(u, {
|
|
1708
1726
|
key: 0,
|
|
1709
1727
|
class: "!mt-[8px]",
|
|
1710
|
-
text: unref(
|
|
1728
|
+
text: unref(o)("connect.campaign.common.effect_required"),
|
|
1711
1729
|
state: "error"
|
|
1712
1730
|
}, null, 8, ["text"]))
|
|
1713
1731
|
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$s, {
|
|
@@ -1715,58 +1733,58 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1715
1733
|
"allow-email": !0,
|
|
1716
1734
|
"allow-whatsapp": !0,
|
|
1717
1735
|
"model-value": unref(l),
|
|
1718
|
-
"onUpdate:modelValue":
|
|
1719
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1736
|
+
"onUpdate:modelValue": n,
|
|
1737
|
+
"helper-text": unref(ZodHelper).helperText(i(), ""),
|
|
1720
1738
|
"trigger-type": e.field.extras,
|
|
1721
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1739
|
+
"helper-state": unref(ZodHelper).helperState(i(), "")
|
|
1722
1740
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
|
|
1723
1741
|
key: 11,
|
|
1724
1742
|
"model-value": unref(l),
|
|
1725
|
-
"onUpdate:modelValue":
|
|
1743
|
+
"onUpdate:modelValue": n,
|
|
1726
1744
|
extras: e.extras,
|
|
1727
1745
|
"error-text": e.helperText
|
|
1728
1746
|
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
|
|
1729
1747
|
key: 12,
|
|
1730
1748
|
type: "custom",
|
|
1731
1749
|
"model-value": unref(l),
|
|
1732
|
-
"onUpdate:modelValue":
|
|
1733
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
1734
|
-
"for-credit":
|
|
1750
|
+
"onUpdate:modelValue": n,
|
|
1751
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(i(), ""),
|
|
1752
|
+
"for-credit": s.campaignType === "CREDIT"
|
|
1735
1753
|
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1736
1754
|
key: 13,
|
|
1737
1755
|
"model-value": unref(l),
|
|
1738
|
-
"onUpdate:modelValue":
|
|
1756
|
+
"onUpdate:modelValue": n
|
|
1739
1757
|
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
1740
1758
|
key: 14,
|
|
1741
1759
|
"model-value": unref(l),
|
|
1742
|
-
"onUpdate:modelValue":
|
|
1760
|
+
"onUpdate:modelValue": n
|
|
1743
1761
|
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
1744
1762
|
key: 15,
|
|
1745
1763
|
"model-value": unref(l),
|
|
1746
|
-
"onUpdate:modelValue":
|
|
1764
|
+
"onUpdate:modelValue": n
|
|
1747
1765
|
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
1748
1766
|
key: 16,
|
|
1749
1767
|
"model-value": unref(l),
|
|
1750
|
-
"onUpdate:modelValue":
|
|
1768
|
+
"onUpdate:modelValue": n
|
|
1751
1769
|
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
1752
1770
|
key: 17,
|
|
1753
1771
|
"model-value": unref(l),
|
|
1754
|
-
"onUpdate:modelValue":
|
|
1755
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1756
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1772
|
+
"onUpdate:modelValue": n,
|
|
1773
|
+
"helper-text": unref(ZodHelper).helperText(i(), ""),
|
|
1774
|
+
"helper-state": unref(ZodHelper).helperState(i(), "")
|
|
1757
1775
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1758
1776
|
key: 18,
|
|
1759
1777
|
"model-value": unref(l),
|
|
1760
|
-
"onUpdate:modelValue":
|
|
1778
|
+
"onUpdate:modelValue": n,
|
|
1761
1779
|
mission: e.extras.mission
|
|
1762
1780
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
1763
1781
|
createVNode(_sfc_main$d, {
|
|
1764
1782
|
"model-value": unref(l),
|
|
1765
|
-
"onUpdate:modelValue":
|
|
1783
|
+
"onUpdate:modelValue": n,
|
|
1766
1784
|
"start-date": e.extras.start,
|
|
1767
1785
|
"end-date": e.extras.end
|
|
1768
1786
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
1769
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1787
|
+
e.helperText ? (openBlock(), createBlock(u, {
|
|
1770
1788
|
key: 0,
|
|
1771
1789
|
class: "!mt-[8px]",
|
|
1772
1790
|
text: e.helperText,
|
|
@@ -1775,25 +1793,25 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1775
1793
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
1776
1794
|
createVNode(_sfc_main$t, {
|
|
1777
1795
|
"model-value": unref(l),
|
|
1778
|
-
"onUpdate:modelValue":
|
|
1796
|
+
"onUpdate:modelValue": n
|
|
1779
1797
|
}, null, 8, ["model-value"]),
|
|
1780
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1798
|
+
e.helperText ? (openBlock(), createBlock(u, {
|
|
1781
1799
|
key: 0,
|
|
1782
1800
|
class: "!mt-[8px]",
|
|
1783
1801
|
text: e.helperText,
|
|
1784
1802
|
state: "error"
|
|
1785
1803
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1786
1804
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
1787
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
1805
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(u, {
|
|
1788
1806
|
key: 0,
|
|
1789
1807
|
state: "warning",
|
|
1790
1808
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
1791
1809
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
1792
1810
|
createVNode(_sfc_main$i, {
|
|
1793
1811
|
"model-value": unref(l),
|
|
1794
|
-
"onUpdate:modelValue":
|
|
1812
|
+
"onUpdate:modelValue": n
|
|
1795
1813
|
}, null, 8, ["model-value"]),
|
|
1796
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1814
|
+
e.helperText ? (openBlock(), createBlock(u, {
|
|
1797
1815
|
key: 1,
|
|
1798
1816
|
class: "!mt-[8px]",
|
|
1799
1817
|
text: e.helperText,
|
|
@@ -1802,9 +1820,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1802
1820
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
1803
1821
|
createVNode(_sfc_main$u, {
|
|
1804
1822
|
"model-value": unref(l),
|
|
1805
|
-
"onUpdate:modelValue":
|
|
1823
|
+
"onUpdate:modelValue": n
|
|
1806
1824
|
}, null, 8, ["model-value"]),
|
|
1807
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1825
|
+
e.helperText ? (openBlock(), createBlock(u, {
|
|
1808
1826
|
key: 0,
|
|
1809
1827
|
class: "!mt-[8px]",
|
|
1810
1828
|
text: e.helperText,
|
|
@@ -1813,9 +1831,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1813
1831
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
1814
1832
|
createVNode(_sfc_main$v, {
|
|
1815
1833
|
"model-value": unref(l),
|
|
1816
|
-
"onUpdate:modelValue":
|
|
1834
|
+
"onUpdate:modelValue": n
|
|
1817
1835
|
}, null, 8, ["model-value"]),
|
|
1818
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1836
|
+
e.helperText ? (openBlock(), createBlock(u, {
|
|
1819
1837
|
key: 0,
|
|
1820
1838
|
class: "!mt-[8px]",
|
|
1821
1839
|
text: e.helperText,
|
|
@@ -1824,9 +1842,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1824
1842
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
1825
1843
|
createVNode(_sfc_main$h, {
|
|
1826
1844
|
"model-value": unref(l),
|
|
1827
|
-
"onUpdate:modelValue":
|
|
1845
|
+
"onUpdate:modelValue": n
|
|
1828
1846
|
}, null, 8, ["model-value"]),
|
|
1829
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1847
|
+
e.helperText ? (openBlock(), createBlock(u, {
|
|
1830
1848
|
key: 0,
|
|
1831
1849
|
class: "!mt-[8px]",
|
|
1832
1850
|
text: e.helperText,
|
|
@@ -1835,15 +1853,15 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1835
1853
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
1836
1854
|
createVNode(_sfc_main$9, {
|
|
1837
1855
|
"model-value": unref(l),
|
|
1838
|
-
"onUpdate:modelValue":
|
|
1856
|
+
"onUpdate:modelValue": n
|
|
1839
1857
|
}, null, 8, ["model-value"]),
|
|
1840
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1858
|
+
e.helperText ? (openBlock(), createBlock(u, {
|
|
1841
1859
|
key: 0,
|
|
1842
1860
|
class: "!mt-[8px]",
|
|
1843
1861
|
text: e.helperText,
|
|
1844
1862
|
state: "error"
|
|
1845
1863
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1846
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
1864
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(s.field), 1));
|
|
1847
1865
|
};
|
|
1848
1866
|
}
|
|
1849
1867
|
}), _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({
|
|
@@ -1855,23 +1873,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1855
1873
|
}
|
|
1856
1874
|
},
|
|
1857
1875
|
setup(e) {
|
|
1858
|
-
const { t: m, te:
|
|
1859
|
-
return (
|
|
1860
|
-
const
|
|
1861
|
-
return openBlock(), createBlock(
|
|
1876
|
+
const { t: m, te: o } = useI18n();
|
|
1877
|
+
return (c, s) => {
|
|
1878
|
+
const p = resolveComponent("FmCard");
|
|
1879
|
+
return openBlock(), createBlock(p, {
|
|
1862
1880
|
variant: "outlined",
|
|
1863
1881
|
class: "p-16 space-y-8"
|
|
1864
1882
|
}, {
|
|
1865
1883
|
default: withCtx(() => [
|
|
1866
1884
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
|
|
1867
|
-
|
|
1868
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
1885
|
+
s[0] || (s[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
1886
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (n, l) => (openBlock(), createElementBlock("div", {
|
|
1869
1887
|
class: "space-y-4",
|
|
1870
|
-
key:
|
|
1888
|
+
key: l
|
|
1871
1889
|
}, [
|
|
1872
|
-
|
|
1873
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${
|
|
1874
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(
|
|
1890
|
+
n ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1891
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${l}`)), 1),
|
|
1892
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(o)(`${n}`) ? unref(m)(`${n}`) : n), 1)
|
|
1875
1893
|
], 64)) : createCommentVNode("", !0)
|
|
1876
1894
|
]))), 128))
|
|
1877
1895
|
]),
|
|
@@ -1886,7 +1904,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1886
1904
|
__name: "EditCampaignSheet",
|
|
1887
1905
|
emits: ["submit:model-value"],
|
|
1888
1906
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1889
|
-
const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
1907
|
+
const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
1890
1908
|
TEMPLATES.VOUCHER
|
|
1891
1909
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
|
|
1892
1910
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
@@ -1896,19 +1914,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1896
1914
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
1897
1915
|
} catch {
|
|
1898
1916
|
} finally {
|
|
1899
|
-
await new Promise((
|
|
1917
|
+
await new Promise((o) => setTimeout(o, 120)), isLoading.value = !1;
|
|
1900
1918
|
}
|
|
1901
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
1902
|
-
|
|
1903
|
-
(
|
|
1904
|
-
) &&
|
|
1919
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((o, c) => {
|
|
1920
|
+
o.campaign.type === "VOUCHER" && o.campaign.code && useCampaignStore().campaigns.voucher.some(
|
|
1921
|
+
(s) => s.code === o.campaign.code && s._id.toString() !== o.campaign._id.toString()
|
|
1922
|
+
) && c.addIssue({
|
|
1905
1923
|
code: "custom",
|
|
1906
1924
|
message: "Code already exists, please use another code",
|
|
1907
1925
|
path: ["campaign", "code"]
|
|
1908
1926
|
});
|
|
1909
1927
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
1910
1928
|
...(m = template.value) == null ? void 0 : m.defaultValue
|
|
1911
|
-
}), "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 ?
|
|
1929
|
+
}), "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 ? t("connect.campaign.common.edit_campaign_title", {
|
|
1930
|
+
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
1931
|
+
}) : t("connect.campaign.common.create_campaign_title", {
|
|
1932
|
+
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
1933
|
+
});
|
|
1912
1934
|
}
|
|
1913
1935
|
}
|
|
1914
1936
|
async function hideSheet() {
|
|
@@ -1935,10 +1957,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1935
1957
|
});
|
|
1936
1958
|
function stepErrors(e = currentStep.value - 1) {
|
|
1937
1959
|
const m = template.value.steps[e].groups.flatMap(
|
|
1938
|
-
(
|
|
1960
|
+
(o) => o.fields.map((c) => c.property)
|
|
1939
1961
|
);
|
|
1940
1962
|
return errors.value.filter(
|
|
1941
|
-
(
|
|
1963
|
+
(o) => m.some((c) => o.path.join(".").includes(c))
|
|
1942
1964
|
);
|
|
1943
1965
|
}
|
|
1944
1966
|
__expose({ showSheet });
|
|
@@ -1952,16 +1974,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1952
1974
|
});
|
|
1953
1975
|
}
|
|
1954
1976
|
function onUpdateProperty(e, m) {
|
|
1955
|
-
var
|
|
1977
|
+
var o, c, s, p, n, l, i, a;
|
|
1956
1978
|
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
1957
|
-
const
|
|
1958
|
-
...(
|
|
1979
|
+
const y = ((p = (s = (c = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : c.campaign) == null ? void 0 : s.event) == null ? void 0 : p.rule) ? _.cloneDeep({
|
|
1980
|
+
...(a = (i = (l = (n = template.value) == null ? void 0 : n.defaultValue) == null ? void 0 : l.campaign) == null ? void 0 : i.event) == null ? void 0 : a.rule
|
|
1959
1981
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
1960
1982
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1961
1983
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
1962
1984
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
1963
1985
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
1964
|
-
]),
|
|
1986
|
+
]), v = RuleBuilder.setRuleToGroup(
|
|
1965
1987
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1966
1988
|
[
|
|
1967
1989
|
RuleBuilder.constructEntry(
|
|
@@ -1974,13 +1996,13 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1974
1996
|
"&&"
|
|
1975
1997
|
);
|
|
1976
1998
|
if (m != "SCHEDULE") {
|
|
1977
|
-
_.set(data.value, "campaign.event.rule",
|
|
1999
|
+
_.set(data.value, "campaign.event.rule", y);
|
|
1978
2000
|
return;
|
|
1979
2001
|
}
|
|
1980
2002
|
_.set(
|
|
1981
2003
|
data.value,
|
|
1982
2004
|
"campaign.event.rule",
|
|
1983
|
-
RuleBuilder.setRuleToGroup(
|
|
2005
|
+
RuleBuilder.setRuleToGroup(y, v)
|
|
1984
2006
|
);
|
|
1985
2007
|
}
|
|
1986
2008
|
e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -1992,10 +2014,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1992
2014
|
}) : "";
|
|
1993
2015
|
}
|
|
1994
2016
|
function isDisable(e) {
|
|
1995
|
-
var m,
|
|
2017
|
+
var m, o;
|
|
1996
2018
|
switch (e == null ? void 0 : e.property) {
|
|
1997
2019
|
case "campaign.event.type":
|
|
1998
|
-
return ((
|
|
2020
|
+
return ((o = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : o._id) || !1;
|
|
1999
2021
|
default:
|
|
2000
2022
|
return !1;
|
|
2001
2023
|
}
|
|
@@ -2005,25 +2027,25 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2005
2027
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2006
2028
|
}
|
|
2007
2029
|
return (e, m) => {
|
|
2008
|
-
const
|
|
2009
|
-
return openBlock(), createBlock(
|
|
2030
|
+
const o = resolveComponent("FmButton"), c = resolveComponent("FmStep"), s = resolveComponent("FmStepper"), p = resolveComponent("FmCard"), n = resolveComponent("FmTopSheet");
|
|
2031
|
+
return openBlock(), createBlock(n, {
|
|
2010
2032
|
"fullscreen-size": "lg",
|
|
2011
2033
|
modelValue: unref(sheetVisible),
|
|
2012
2034
|
"onUpdate:modelValue": [
|
|
2013
|
-
m[7] || (m[7] = (
|
|
2014
|
-
m[8] || (m[8] = (
|
|
2035
|
+
m[7] || (m[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
|
|
2036
|
+
m[8] || (m[8] = (l) => sheetVisible.value = l)
|
|
2015
2037
|
]
|
|
2016
2038
|
}, createSlots({
|
|
2017
2039
|
"top-sheet-header": withCtx(() => [
|
|
2018
2040
|
createElementVNode("div", _hoisted_1, [
|
|
2019
2041
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2020
2042
|
createElementVNode("div", _hoisted_2, [
|
|
2021
|
-
createVNode(
|
|
2022
|
-
onClick: m[0] || (m[0] = (
|
|
2043
|
+
createVNode(o, {
|
|
2044
|
+
onClick: m[0] || (m[0] = (l) => hideSheet()),
|
|
2023
2045
|
label: unref(t)("connect.campaign.common.cancel"),
|
|
2024
2046
|
variant: "tertiary"
|
|
2025
2047
|
}, null, 8, ["label"]),
|
|
2026
|
-
createVNode(
|
|
2048
|
+
createVNode(o, {
|
|
2027
2049
|
onClick: onSubmit,
|
|
2028
2050
|
label: unref(t)("connect.campaign.common.save"),
|
|
2029
2051
|
disabled: unref(errors).length > 0
|
|
@@ -2061,7 +2083,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2061
2083
|
])
|
|
2062
2084
|
])
|
|
2063
2085
|
], -1)),
|
|
2064
|
-
createVNode(
|
|
2086
|
+
createVNode(p, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2065
2087
|
])
|
|
2066
2088
|
])
|
|
2067
2089
|
])
|
|
@@ -2071,48 +2093,48 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2071
2093
|
name: "default",
|
|
2072
2094
|
fn: withCtx(() => [
|
|
2073
2095
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2074
|
-
createVNode(
|
|
2096
|
+
createVNode(s, {
|
|
2075
2097
|
modelValue: unref(currentStep),
|
|
2076
|
-
"onUpdate:modelValue": m[1] || (m[1] = (
|
|
2098
|
+
"onUpdate:modelValue": m[1] || (m[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
|
|
2077
2099
|
orientation: "horizontal",
|
|
2078
2100
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2079
2101
|
}, {
|
|
2080
2102
|
default: withCtx(() => [
|
|
2081
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2082
|
-
key:
|
|
2083
|
-
title: unref(
|
|
2084
|
-
value:
|
|
2085
|
-
error: () => stepErrors(
|
|
2086
|
-
complete: () =>
|
|
2103
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, i) => (openBlock(), createBlock(c, {
|
|
2104
|
+
key: l.name,
|
|
2105
|
+
title: unref(getLocaleText)(l.name_locale, l.name),
|
|
2106
|
+
value: i + 1,
|
|
2107
|
+
error: () => stepErrors(i).length > 0,
|
|
2108
|
+
complete: () => i + 1 <= unref(currentStep)
|
|
2087
2109
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
2088
2110
|
]),
|
|
2089
2111
|
_: 1
|
|
2090
2112
|
}, 8, ["modelValue"]),
|
|
2091
2113
|
createElementVNode("div", _hoisted_4, [
|
|
2092
|
-
createVNode(
|
|
2114
|
+
createVNode(o, {
|
|
2093
2115
|
icon: "close",
|
|
2094
2116
|
variant: "tertiary",
|
|
2095
|
-
onClick: m[2] || (m[2] = (
|
|
2117
|
+
onClick: m[2] || (m[2] = (l) => sheetVisible.value = !1)
|
|
2096
2118
|
}),
|
|
2097
|
-
createVNode(
|
|
2119
|
+
createVNode(s, {
|
|
2098
2120
|
modelValue: unref(currentStep),
|
|
2099
|
-
"onUpdate:modelValue": m[3] || (m[3] = (
|
|
2121
|
+
"onUpdate:modelValue": m[3] || (m[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
|
|
2100
2122
|
orientation: "horizontal",
|
|
2101
2123
|
class: "flex-1"
|
|
2102
2124
|
}, {
|
|
2103
2125
|
default: withCtx(() => [
|
|
2104
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2105
|
-
key:
|
|
2126
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, i) => (openBlock(), createBlock(c, {
|
|
2127
|
+
key: l.name,
|
|
2106
2128
|
title: unref(sheetTitle),
|
|
2107
|
-
description: unref(
|
|
2108
|
-
value:
|
|
2109
|
-
error: () => stepErrors(
|
|
2110
|
-
complete: () =>
|
|
2129
|
+
description: unref(getLocaleText)(l.name_locale, l.name),
|
|
2130
|
+
value: i + 1,
|
|
2131
|
+
error: () => stepErrors(i).length > 0,
|
|
2132
|
+
complete: () => i + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
2111
2133
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
2112
2134
|
]),
|
|
2113
2135
|
_: 1
|
|
2114
2136
|
}, 8, ["modelValue"]),
|
|
2115
|
-
createVNode(
|
|
2137
|
+
createVNode(o, {
|
|
2116
2138
|
icon: "info",
|
|
2117
2139
|
variant: "tertiary",
|
|
2118
2140
|
onClick: m[4] || (m[4] = () => showSummaryDialog())
|
|
@@ -2124,55 +2146,55 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2124
2146
|
json: {
|
|
2125
2147
|
data: unref(data),
|
|
2126
2148
|
errors: unref(errors).map(
|
|
2127
|
-
(
|
|
2149
|
+
(l) => `${l.path.join(".")} - ${l.message}`
|
|
2128
2150
|
),
|
|
2129
2151
|
stepErrors: stepErrors().map(
|
|
2130
|
-
(
|
|
2152
|
+
(l) => `${l.path.join(".")} - ${l.message}`
|
|
2131
2153
|
),
|
|
2132
2154
|
schema: unref(schema)
|
|
2133
2155
|
}
|
|
2134
2156
|
}, null, 8, ["json"]),
|
|
2135
2157
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2136
|
-
(
|
|
2137
|
-
), (
|
|
2138
|
-
key:
|
|
2158
|
+
(l) => l.fields.length && (!l.condition || (Array.isArray(l.condition) ? l.condition.every((i) => unref(_).get(unref(data), i.property) == i.value == (i.not != !0)) : unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0)))
|
|
2159
|
+
), (l, i) => (openBlock(), createElementBlock("div", {
|
|
2160
|
+
key: i,
|
|
2139
2161
|
class: "space-y-24"
|
|
2140
2162
|
}, [
|
|
2141
|
-
createElementVNode("div", _hoisted_7, toDisplayString(
|
|
2142
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2163
|
+
createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(l.name_locale, l.name ?? "")), 1),
|
|
2164
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (a, f) => (openBlock(), createElementBlock("div", { key: f }, [
|
|
2143
2165
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2144
|
-
key:
|
|
2145
|
-
field:
|
|
2146
|
-
modelValue: unref(_).get(unref(data),
|
|
2147
|
-
disabled: isDisable(
|
|
2166
|
+
key: f,
|
|
2167
|
+
field: a,
|
|
2168
|
+
modelValue: unref(_).get(unref(data), a.property),
|
|
2169
|
+
disabled: isDisable(a),
|
|
2148
2170
|
"campaign-type": unref(campaignType),
|
|
2149
|
-
"onUpdate:modelValue": (
|
|
2150
|
-
"onUpdate:file": async (
|
|
2151
|
-
const
|
|
2152
|
-
onUpdateProperty(
|
|
2171
|
+
"onUpdate:modelValue": (y) => onUpdateProperty(a.property, y),
|
|
2172
|
+
"onUpdate:file": async (y, v) => {
|
|
2173
|
+
const C = await onUpdateFile(y, v);
|
|
2174
|
+
onUpdateProperty(a.property, C || "");
|
|
2153
2175
|
},
|
|
2154
2176
|
schema: unref(ZodHelper).typeAtPath(
|
|
2155
2177
|
unref(schema),
|
|
2156
|
-
|
|
2178
|
+
a.property,
|
|
2157
2179
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2158
2180
|
),
|
|
2159
|
-
"helper-state": unref(ZodHelper).helperState(unref(errors),
|
|
2160
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2161
|
-
extras:
|
|
2181
|
+
"helper-state": unref(ZodHelper).helperState(unref(errors), a.property),
|
|
2182
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), a.property),
|
|
2183
|
+
extras: a.extras != null ? a.extras == "" ? unref(data) : unref(_).get(unref(data), a.extras) : void 0
|
|
2162
2184
|
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
2163
2185
|
]))), 128))
|
|
2164
2186
|
]))), 128)),
|
|
2165
2187
|
createElementVNode("div", _hoisted_8, [
|
|
2166
|
-
createVNode(
|
|
2167
|
-
label: "
|
|
2188
|
+
createVNode(o, {
|
|
2189
|
+
label: unref(t)("connect.common.back"),
|
|
2168
2190
|
variant: "tertiary",
|
|
2169
2191
|
disabled: unref(currentStep) == 1,
|
|
2170
|
-
onClick: m[5] || (m[5] = (
|
|
2171
|
-
}, null, 8, ["disabled"]),
|
|
2172
|
-
createVNode(
|
|
2192
|
+
onClick: m[5] || (m[5] = (l) => currentStep.value--)
|
|
2193
|
+
}, null, 8, ["label", "disabled"]),
|
|
2194
|
+
createVNode(o, {
|
|
2173
2195
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2174
|
-
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "
|
|
2175
|
-
onClick: m[6] || (m[6] = (
|
|
2196
|
+
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
|
|
2197
|
+
onClick: m[6] || (m[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2176
2198
|
}, null, 8, ["disabled", "label"])
|
|
2177
2199
|
])
|
|
2178
2200
|
]),
|
|
@@ -2190,5 +2212,6 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2190
2212
|
}
|
|
2191
2213
|
});
|
|
2192
2214
|
export {
|
|
2193
|
-
_sfc_main as _
|
|
2215
|
+
_sfc_main as _,
|
|
2216
|
+
useLocaleText as u
|
|
2194
2217
|
};
|