@feedmepos/mf-connect 0.1.82-prod → 0.1.84-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-D850nvXy.js → Analytic---kwMsJh.js} +11 -11
- package/dist/{App-Dwp2SQFt.js → App-Dz1QFoj1.js} +7 -7
- package/dist/{Bin-t3dMVk18.js → Bin-CRYowBLt.js} +8 -8
- package/dist/Broadcast-C8_buAc0.js +265 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CFa7asTL.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYY2JwZP.js} +6 -6
- package/dist/{Card-DueuT99c.js → Card-DePqhNID.js} +19 -19
- package/dist/{Collections-D50oEyeZ.js → Collections-RwrRqA0j.js} +8 -8
- package/dist/Credit-C8PUzFqm.js +259 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CgUd84nn.js} +245 -241
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-L0-aFhRw.js → EffectSheet.vue_vue_type_style_index_0_lang-DnPaODeO.js} +6 -6
- package/dist/Experience-DhtTPHu-.js +258 -0
- package/dist/{FileSaver.min-DH3eS7yi.js → FileSaver.min-BWjfwA9o.js} +1 -1
- package/dist/Game-CYj7LBJv.js +329 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BIKcbIag.js → ImageInput.vue_vue_type_script_setup_true_lang-CUltj6id.js} +1 -1
- package/dist/{Index-BucLJQqP.js → Index-D8AcIz6r.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CIoZurPE.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CpUmN6FR.js} +1 -1
- package/dist/{MainLayout-DYGrSfgc.js → MainLayout-DkxA5idl.js} +1 -1
- package/dist/{Marketing-CsAIdNjF.js → Marketing-4h6RtJ9w.js} +6 -6
- package/dist/{Member-D4HF_VGN.js → Member-Mi1lEgxG.js} +11 -11
- package/dist/{MemberList-CPoA4ovd.js → MemberList-Cd7SXI7d.js} +27 -27
- package/dist/{MemberTransactions-AMv9NeIb.js → MemberTransactions-aM_CTN3-.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhhSwnK0.js → MessageInput.vue_vue_type_script_setup_true_lang-LkKXfpQ8.js} +9864 -9759
- package/dist/Mission-BbZXMfe2.js +333 -0
- package/dist/{Overview-ByO2p2Wx.js → Overview-tjz1RxkD.js} +19 -19
- package/dist/Point-DqSlh8lv.js +261 -0
- package/dist/Promotion-FNZOyKDM.js +390 -0
- package/dist/{Queue-BD29Mmbf.js → Queue-BGr-V2dv.js} +11 -11
- package/dist/{Record-CNLiN6YR.js → Record-YSp6Ra7G.js} +9 -9
- package/dist/{Reward-Ceo3M1yD.js → Reward-CfWeF_XY.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJWQEL9W.js → RewardGroup.vue_vue_type_script_setup_true_lang-BdT11T69.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CWuWGs6r.js → RuleGroup.vue_vue_type_script_setup_true_lang-D7pC5cM-.js} +15 -15
- package/dist/{Segment-BOQUlP-m.js → Segment-B8kCEI6G.js} +25 -25
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BcXeiz0p.js → SelectItems.vue_vue_type_script_setup_true_lang-iK1tNyZN.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CJ--FC-i.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cd9_IVCK.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-9emjG6Nc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CDNCuGzR.js} +4 -4
- package/dist/{Setting-CWapXD31.js → Setting-DRK1-tm8.js} +14 -14
- package/dist/{SettingAdvertisements-QEf2eyem.js → SettingAdvertisements-CPBFpIuM.js} +12 -12
- package/dist/{Store-Bfm2olbH.js → Store-CF55C7mv.js} +22 -22
- package/dist/{StoreRewards-DNDkyxxn.js → StoreRewards-hF8rcPIS.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-zKLbY4Qb.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BYugGARP.js} +20 -20
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D3-wIOQ7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BSOpqCbD.js} +1 -1
- package/dist/{Tier-uC45o2AK.js → Tier-RKT4ClDE.js} +22 -22
- package/dist/{Title-zDjlDJCB.js → Title-vFFh4BdE.js} +20 -20
- package/dist/{Transaction-Bo9FEjMQ.js → Transaction-BHeWenhg.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BR5F0bWS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-iKbV9AAj.js} +6 -6
- package/dist/{Voucher-B7BTa4Vt.js → Voucher-C6ywMiLW.js} +162 -141
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjrjJW7x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DHlpDIkL.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DeAkLgaX.js → ZodTextField.vue_vue_type_script_setup_true_lang-BHhDgBiv.js} +2 -2
- package/dist/{app-CkUBXnib.js → app-P5wZqN7K.js} +961 -875
- package/dist/app.js +1 -1
- package/dist/{business-C8P05bjQ.js → business-B35Wh7fa.js} +1 -1
- package/dist/{campaign-DcLhSQVQ.js → campaign-CdGwiufg.js} +1 -1
- package/dist/{campaign-CyYAvl3p.js → campaign-CxeRf6Kf.js} +8 -8
- package/dist/{campaign.enum-h6B-mP82.js → campaign.enum-G61yFqyz.js} +1 -1
- package/dist/{campaign.fn-CStjDAoU.js → campaign.fn-DBGVgh7k.js} +128 -128
- package/dist/{collectible.enum-DT-wjl-a.js → collectible.enum-CmO4wF4e.js} +1 -1
- package/dist/{collection.fn-14o3RW2e.js → collection.fn-BZtvtGPA.js} +2 -2
- package/dist/{dto-Bv09Baex.js → dto-BmjMkp1Z.js} +4 -4
- package/dist/{effect-CF0s7QWQ.js → effect-eEYO0AvV.js} +1 -1
- package/dist/{email-addresses-B5qrHbxg.js → email-addresses-sloQNBJG.js} +2 -2
- package/dist/{export-B6nvdBmg.js → export-CmGCO7dx.js} +3 -3
- package/dist/{helper-B4-2ut7E.js → helper-CW7xMPjC.js} +1 -1
- package/dist/{index-D5xt8OjL.js → index-639mCQ6J.js} +1 -1
- package/dist/{index-CR8brl_k.js → index-B5KXKlhV.js} +1 -1
- package/dist/{index-DG_Ej3ec.js → index-B6dK27Ud.js} +3 -3
- package/dist/{index-B-y0UTZw.js → index-BD00XsAg.js} +6 -6
- package/dist/{index-DesSizn4.js → index-C7X2wMHZ.js} +3 -3
- package/dist/{index-BebGg-0n.js → index-CK4IRu1N.js} +1 -1
- package/dist/{index-Ct90ybe0.js → index-CLoMa41m.js} +1 -1
- package/dist/{index-DVb99_67.js → index-CmdjTQSX.js} +1 -1
- package/dist/{index-DzQjej5Y.js → index-CqtPReHP.js} +4 -4
- package/dist/{index-DIQ2MyWF.js → index-DCzBwaDb.js} +4 -4
- package/dist/{index-HhVIn4Bn.js → index-DF11MBlC.js} +1 -1
- package/dist/{index-DRX9TTMn.js → index-DzgPdiHK.js} +3 -3
- package/dist/{index-XDg25M5a.js → index-INxinXgP.js} +1 -1
- package/dist/{index.esm2017-1A2eV8x_.js → index.esm2017-CFPCtvwG.js} +1 -1
- package/dist/{loading-B0_BwPgo.js → loading-D77DfZBP.js} +1 -1
- package/dist/{lodash-DxIglhqk.js → lodash-B8BR1gR7.js} +1 -1
- package/dist/{membership-H_whlbUP.js → membership-B5p556SC.js} +3 -3
- package/dist/{money-DEE8QW6m.js → money-CRPmLrb_.js} +1 -1
- package/dist/{number-BmN5A4Cu.js → number-bJoTVZNO.js} +1 -1
- package/dist/objectid-DCHsjF9h.js +145 -0
- package/dist/{plugins-DTrOHd7d.js → plugins-DQdMt5nO.js} +3 -3
- package/dist/{reward-CsJhkkaT.js → reward-DeTD3TQ1.js} +1 -1
- package/dist/{rule-ByMxYH4c.js → rule-DSuuXRg3.js} +3 -3
- package/dist/{rule-builder-DwGwUlV1.js → rule-builder-D8rRlIOO.js} +1 -1
- package/dist/template-HTjC1_ed.js +236 -0
- package/dist/{timezone-Bpe-fhwZ.js → timezone-CWcYmamV.js} +2 -2
- package/dist/{trigger-CEprJYiD.js → trigger-BZa0mW7v.js} +5 -5
- package/dist/{usePagination-Du6qS5aj.js → usePagination-Abs8KbO-.js} +1 -1
- package/dist/{user-Be8HNWuo.js → user-B94fPQnM.js} +1 -1
- package/dist/{vue-i18n-fg0FtbNR.js → vue-i18n-D5HHFPRa.js} +296 -296
- package/dist/{xlsx-CSQJ3YWk.js → xlsx-BsqWVudt.js} +1 -1
- package/dist/{zod-BB7zZ5ec.js → zod-Bp867gMI.js} +1 -1
- package/package.json +1 -1
- package/dist/Broadcast-DORnkgZc.js +0 -232
- package/dist/Credit-CIWSRGuJ.js +0 -225
- package/dist/Experience-qABtjxNP.js +0 -224
- package/dist/Game-D67q1zKd.js +0 -299
- package/dist/Mission-CRinLn7e.js +0 -303
- package/dist/Point-4JqzbNgP.js +0 -227
- package/dist/Promotion-DlWVF6hF.js +0 -358
- package/dist/objectid-B8LZDZOt.js +0 -145
- package/dist/template-Bdwy6QXF.js +0 -188
|
@@ -1,42 +1,42 @@
|
|
|
1
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
|
-
import { _ } from "./lodash-
|
|
3
|
-
import { z } from "./app-
|
|
4
|
-
import { Z as ZodHelper } from "./zod-
|
|
5
|
-
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-
|
|
6
|
-
import { u as useMembershipStore } from "./membership-
|
|
7
|
-
import { u as useBusinessStore } from "./business-
|
|
8
|
-
import "./index-
|
|
9
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
2
|
+
import { _ } from "./lodash-B8BR1gR7.js";
|
|
3
|
+
import { z } from "./app-P5wZqN7K.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-Bp867gMI.js";
|
|
5
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-BmjMkp1Z.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-B5p556SC.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-B35Wh7fa.js";
|
|
8
|
+
import "./index-C7X2wMHZ.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-D8rRlIOO.js";
|
|
10
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
11
11
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
12
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
13
|
-
import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
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-
|
|
15
|
-
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { p as prompt, f as firebaseStorage } from "./plugins-
|
|
19
|
-
import { u as useI18n } from "./vue-i18n-
|
|
20
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-
|
|
21
|
-
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
22
|
-
import { C as CountryTimezone, m as moment } from "./timezone-
|
|
23
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-G61yFqyz.js";
|
|
13
|
+
import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-CUltj6id.js";
|
|
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-DnPaODeO.js";
|
|
15
|
+
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BSOpqCbD.js";
|
|
16
|
+
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-iKbV9AAj.js";
|
|
17
|
+
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-D7pC5cM-.js";
|
|
18
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-DQdMt5nO.js";
|
|
19
|
+
import { u as useI18n } from "./vue-i18n-D5HHFPRa.js";
|
|
20
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-BZa0mW7v.js";
|
|
21
|
+
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-LkKXfpQ8.js";
|
|
22
|
+
import { C as CountryTimezone, m as moment } from "./timezone-CWcYmamV.js";
|
|
23
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-DSuuXRg3.js";
|
|
24
24
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
25
|
-
import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
26
|
-
import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-
|
|
27
|
-
import { T as TEMPLATES } from "./index-
|
|
28
|
-
import "./index-
|
|
29
|
-
import "./index-
|
|
30
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
31
|
-
import { u as useLoading } from "./loading-
|
|
32
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
33
|
-
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-DHlpDIkL.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-CqtPReHP.js";
|
|
27
|
+
import { T as TEMPLATES } from "./index-BD00XsAg.js";
|
|
28
|
+
import "./index-CLoMa41m.js";
|
|
29
|
+
import "./index-B6dK27Ud.js";
|
|
30
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-CmO4wF4e.js";
|
|
31
|
+
import { u as useLoading } from "./loading-D77DfZBP.js";
|
|
32
|
+
import { i as initCollectibleConfig } from "./helper-CW7xMPjC.js";
|
|
33
|
+
import { C as CollectionUtils } from "./collection.fn-BZtvtGPA.js";
|
|
34
34
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
35
|
-
import { c as getCampaignSummaryObject } from "./campaign-
|
|
36
|
-
import "./index-
|
|
35
|
+
import { c as getCampaignSummaryObject } from "./campaign-CxeRf6Kf.js";
|
|
36
|
+
import "./index-DCzBwaDb.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-CdGwiufg.js";
|
|
39
|
+
import { S as SvcConfig } from "./index-DzgPdiHK.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,12 +49,12 @@ 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: o } = useI18n(),
|
|
53
|
-
!
|
|
52
|
+
const { t: o } = useI18n(), i = e, s = m, p = ref(
|
|
53
|
+
!i.modelValue || !i.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(i.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
54
54
|
);
|
|
55
|
-
watch(p, async (l,
|
|
55
|
+
watch(p, async (l, u) => {
|
|
56
56
|
var a;
|
|
57
|
-
if (
|
|
57
|
+
if (u == "custom" && l == "all_time" && RuleBuilder.getRules((a = i.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
58
58
|
const f = await prompt.confirm(
|
|
59
59
|
o("connect.template.rule.time.confirm_remove"),
|
|
60
60
|
o("connect.common.confirm"),
|
|
@@ -64,15 +64,15 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
64
64
|
f && s(
|
|
65
65
|
"update:model-value",
|
|
66
66
|
RuleBuilder.setRuleToGroup(
|
|
67
|
-
|
|
67
|
+
i.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
68
68
|
RuleBuilder.scaffoldGroup("g_time")
|
|
69
69
|
)
|
|
70
|
-
), p.value = f ? l :
|
|
70
|
+
), p.value = f ? l : u;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
async function n(l) {
|
|
74
|
-
var
|
|
75
|
-
if (l == "custom" && RuleBuilder.getRules((
|
|
74
|
+
var u;
|
|
75
|
+
if (l == "custom" && RuleBuilder.getRules((u = i.modelValue) == null ? void 0 : u.rules.g_time).length > 0) {
|
|
76
76
|
if (!await prompt.confirm(
|
|
77
77
|
o("connect.template.rule.time.confirm_remove"),
|
|
78
78
|
o("connect.common.confirm"),
|
|
@@ -85,21 +85,21 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
85
85
|
s(
|
|
86
86
|
"update:model-value",
|
|
87
87
|
RuleBuilder.setRuleToGroup(
|
|
88
|
-
|
|
88
|
+
i.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
89
89
|
RuleBuilder.scaffoldGroup("g_time")
|
|
90
90
|
)
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
return (l,
|
|
94
|
+
return (l, u) => {
|
|
95
95
|
var y;
|
|
96
96
|
const a = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
|
|
97
97
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
98
98
|
createVNode(f, {
|
|
99
99
|
modelValue: unref(p),
|
|
100
100
|
"onUpdate:modelValue": [
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
u[0] || (u[0] = (v) => isRef(p) ? p.value = v : null),
|
|
102
|
+
u[1] || (u[1] = (v) => n(v))
|
|
103
103
|
]
|
|
104
104
|
}, {
|
|
105
105
|
default: withCtx(() => [
|
|
@@ -120,7 +120,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
120
120
|
"include-only": "trigger",
|
|
121
121
|
"trigger-type": "SCHEDULE",
|
|
122
122
|
"model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
123
|
-
"onUpdate:modelValue":
|
|
123
|
+
"onUpdate:modelValue": u[2] || (u[2] = (v) => s(
|
|
124
124
|
"update:model-value",
|
|
125
125
|
unref(RuleBuilder).setRuleToGroup(
|
|
126
126
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -141,9 +141,9 @@ 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 { t: o } = useI18n(),
|
|
145
|
-
const { property: n, operator: l, equator:
|
|
146
|
-
|
|
144
|
+
const { t: o } = useI18n(), i = e, s = m, p = computed(() => {
|
|
145
|
+
const { property: n, operator: l, equator: u } = RuleBuilder.simplify(
|
|
146
|
+
i.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
147
147
|
op: "before",
|
|
148
148
|
x: 1
|
|
149
149
|
})
|
|
@@ -151,13 +151,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
151
151
|
return {
|
|
152
152
|
property: n,
|
|
153
153
|
operator: l,
|
|
154
|
-
equator:
|
|
154
|
+
equator: u
|
|
155
155
|
};
|
|
156
156
|
});
|
|
157
157
|
return (n, l) => {
|
|
158
|
-
const
|
|
158
|
+
const u = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
|
|
159
159
|
return openBlock(), createElementBlock("div", null, [
|
|
160
|
-
createVNode(
|
|
160
|
+
createVNode(u, {
|
|
161
161
|
label: unref(o)("connect.template.rule.birthday.on_birthday"),
|
|
162
162
|
value: "_isRange-day",
|
|
163
163
|
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
@@ -172,7 +172,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
172
172
|
);
|
|
173
173
|
})
|
|
174
174
|
}, null, 8, ["label", "model-value"]),
|
|
175
|
-
createVNode(
|
|
175
|
+
createVNode(u, {
|
|
176
176
|
label: unref(o)("connect.template.rule.birthday.days_before"),
|
|
177
177
|
value: "_isDay",
|
|
178
178
|
"model-value": unref(p).operator,
|
|
@@ -201,7 +201,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
201
201
|
})
|
|
202
202
|
))
|
|
203
203
|
}, null, 8, ["label", "model-value"])) : createCommentVNode("", !0),
|
|
204
|
-
createVNode(
|
|
204
|
+
createVNode(u, {
|
|
205
205
|
label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
|
|
206
206
|
value: "_isRange-week",
|
|
207
207
|
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
@@ -216,7 +216,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
216
216
|
);
|
|
217
217
|
})
|
|
218
218
|
}, null, 8, ["label", "model-value"]),
|
|
219
|
-
createVNode(
|
|
219
|
+
createVNode(u, {
|
|
220
220
|
label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
|
|
221
221
|
value: "_isRange-month",
|
|
222
222
|
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
@@ -251,24 +251,24 @@ 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 { t: o } = useI18n(),
|
|
255
|
-
(n) => n.value ==
|
|
256
|
-
) : TypeToTriggerOptions[
|
|
254
|
+
const { t: o } = useI18n(), i = e, s = m, p = computed(() => i.disabled ? TypeToTriggerOptions[i.campaignType].filter(
|
|
255
|
+
(n) => n.value == i.modelValue
|
|
256
|
+
) : TypeToTriggerOptions[i.campaignType]);
|
|
257
257
|
return (n, l) => {
|
|
258
|
-
const
|
|
258
|
+
const u = resolveComponent("FmCard");
|
|
259
259
|
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
260
260
|
createElementVNode("div", _hoisted_2$c, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
|
|
261
261
|
createElementVNode("div", _hoisted_3$a, [
|
|
262
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(
|
|
262
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(u, {
|
|
263
263
|
variant: "outlined",
|
|
264
|
-
disabled:
|
|
264
|
+
disabled: i.disabled,
|
|
265
265
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
266
266
|
"col-span-3": unref(p).length == 1,
|
|
267
267
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
268
268
|
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
269
269
|
}]),
|
|
270
270
|
onClick: () => {
|
|
271
|
-
|
|
271
|
+
i.modelValue != a.value && !i.disabled && s("update:model-value", a.value);
|
|
272
272
|
},
|
|
273
273
|
key: a.name
|
|
274
274
|
}, {
|
|
@@ -297,18 +297,18 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
297
297
|
emits: ["update:model-value"],
|
|
298
298
|
setup(e, { emit: m }) {
|
|
299
299
|
const o = m;
|
|
300
|
-
return (
|
|
300
|
+
return (i, s) => {
|
|
301
301
|
const p = resolveComponent("FmButton"), n = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
|
|
302
302
|
return openBlock(), createBlock(l, {
|
|
303
303
|
label: e.label,
|
|
304
304
|
"model-value": e.modelValue || "",
|
|
305
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
305
|
+
"onUpdate:modelValue": s[1] || (s[1] = (u) => o("update:model-value", u))
|
|
306
306
|
}, {
|
|
307
|
-
"trigger-button": withCtx(({ opened:
|
|
307
|
+
"trigger-button": withCtx(({ opened: u }) => [
|
|
308
308
|
createVNode(n, {
|
|
309
309
|
class: "flex items-center",
|
|
310
310
|
"prepend-icon": "calendar_month",
|
|
311
|
-
"icon-outlined": !
|
|
311
|
+
"icon-outlined": !u
|
|
312
312
|
}, {
|
|
313
313
|
append: withCtx(() => [
|
|
314
314
|
e.modelValue ? (openBlock(), createBlock(p, {
|
|
@@ -340,7 +340,7 @@ 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 { t: o } = useI18n(),
|
|
343
|
+
const { t: o } = useI18n(), i = m;
|
|
344
344
|
return (s, p) => {
|
|
345
345
|
var n, l;
|
|
346
346
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
@@ -348,10 +348,10 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
348
348
|
createVNode(_sfc_main$f, {
|
|
349
349
|
"model-value": ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
|
|
350
350
|
label: unref(o)("connect.common.startDate"),
|
|
351
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
351
|
+
"onUpdate:modelValue": p[0] || (p[0] = (u) => {
|
|
352
352
|
var a;
|
|
353
|
-
return
|
|
354
|
-
startDate:
|
|
353
|
+
return i("update:model-value", {
|
|
354
|
+
startDate: u,
|
|
355
355
|
endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
|
|
356
356
|
});
|
|
357
357
|
})
|
|
@@ -362,11 +362,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
362
362
|
createVNode(_sfc_main$f, {
|
|
363
363
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
|
|
364
364
|
label: unref(o)("connect.common.endDate"),
|
|
365
|
-
"onUpdate:modelValue": p[1] || (p[1] = (
|
|
365
|
+
"onUpdate:modelValue": p[1] || (p[1] = (u) => {
|
|
366
366
|
var a;
|
|
367
|
-
return
|
|
367
|
+
return i("update:model-value", {
|
|
368
368
|
startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
|
|
369
|
-
endDate:
|
|
369
|
+
endDate: u
|
|
370
370
|
});
|
|
371
371
|
})
|
|
372
372
|
}, null, 8, ["model-value", "label"])
|
|
@@ -393,22 +393,22 @@ 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 { t: o } = useI18n(),
|
|
396
|
+
const { t: o } = useI18n(), i = e, s = m, p = useCoreStore(), n = computed(
|
|
397
397
|
() => CountryTimezone[p.currentCountry.value || "MY"]
|
|
398
398
|
);
|
|
399
399
|
function l() {
|
|
400
|
-
const
|
|
401
|
-
return
|
|
400
|
+
const c = RuleBuilder.getRules(i.modelValue);
|
|
401
|
+
return c.length == 0 ? "fixed" : c.some(
|
|
402
402
|
(r) => isRuleEntry(r) && RuleBuilder.simplify(r).operator == "_rrule"
|
|
403
403
|
) ? "repeating" : "fixed";
|
|
404
404
|
}
|
|
405
|
-
const
|
|
405
|
+
const u = ref(l()), a = ref(!1), f = computed(() => [
|
|
406
406
|
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
407
407
|
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
408
408
|
]), y = computed(() => {
|
|
409
|
-
const
|
|
409
|
+
const c = RuleBuilder.getRules(i.modelValue), r = c.find(
|
|
410
410
|
(g) => isRuleEntry(g) && RuleBuilder.simplify(g).property == "trigger.date"
|
|
411
|
-
), d =
|
|
411
|
+
), d = c.find(
|
|
412
412
|
(g) => isRuleEntry(g) && RuleBuilder.simplify(g).property == "trigger.time"
|
|
413
413
|
);
|
|
414
414
|
return {
|
|
@@ -417,14 +417,14 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
417
417
|
};
|
|
418
418
|
}), v = computed(
|
|
419
419
|
() => calculateNextScheduleAt(
|
|
420
|
-
|
|
420
|
+
i.modelValue,
|
|
421
421
|
/* @__PURE__ */ new Date(),
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
i.startDate ? new Date(i.startDate) : void 0,
|
|
423
|
+
i.endDate ? new Date(i.endDate) : void 0
|
|
424
424
|
)
|
|
425
425
|
);
|
|
426
|
-
function C(
|
|
427
|
-
const r =
|
|
426
|
+
function C(c) {
|
|
427
|
+
const r = c.value, d = r == "fixed" ? [
|
|
428
428
|
RuleBuilder.constructEntry(
|
|
429
429
|
"trigger.date",
|
|
430
430
|
"_isOnDate",
|
|
@@ -445,21 +445,21 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
445
445
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
446
446
|
d
|
|
447
447
|
)
|
|
448
|
-
),
|
|
448
|
+
), u.value = r;
|
|
449
449
|
}
|
|
450
|
-
function b(
|
|
451
|
-
|
|
450
|
+
function b(c) {
|
|
451
|
+
u.value == "fixed" ? s(
|
|
452
452
|
"update:model-value",
|
|
453
453
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
454
454
|
RuleBuilder.constructEntry(
|
|
455
455
|
"trigger.date",
|
|
456
456
|
"_isOnDate",
|
|
457
|
-
|
|
457
|
+
c.date
|
|
458
458
|
),
|
|
459
459
|
RuleBuilder.constructEntry(
|
|
460
460
|
"trigger.time",
|
|
461
461
|
"_isOnTime",
|
|
462
|
-
|
|
462
|
+
c.time
|
|
463
463
|
)
|
|
464
464
|
])
|
|
465
465
|
) : s(
|
|
@@ -468,22 +468,22 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
468
468
|
RuleBuilder.constructEntry(
|
|
469
469
|
"trigger.date",
|
|
470
470
|
"_rrule",
|
|
471
|
-
|
|
471
|
+
c.date
|
|
472
472
|
),
|
|
473
473
|
RuleBuilder.constructEntry(
|
|
474
474
|
"trigger.time",
|
|
475
475
|
"_isOnTime",
|
|
476
|
-
|
|
476
|
+
c.time
|
|
477
477
|
)
|
|
478
478
|
])
|
|
479
479
|
);
|
|
480
480
|
}
|
|
481
|
-
return (
|
|
481
|
+
return (c, r) => {
|
|
482
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");
|
|
483
483
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
484
484
|
createVNode(d, {
|
|
485
485
|
items: unref(f),
|
|
486
|
-
"model-value": unref(f).find((E) => E.value === unref(
|
|
486
|
+
"model-value": unref(f).find((E) => E.value === unref(u)) ?? null,
|
|
487
487
|
"onUpdate:modelValue": C,
|
|
488
488
|
class: "mb-8"
|
|
489
489
|
}, null, 8, ["items", "model-value"]),
|
|
@@ -496,7 +496,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
496
496
|
"helper-text": unref(y).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
|
|
497
497
|
"helper-state": unref(y).time ? void 0 : "error"
|
|
498
498
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
499
|
-
unref(
|
|
499
|
+
unref(u) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
|
|
500
500
|
createElementVNode("div", _hoisted_4$7, [
|
|
501
501
|
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
502
502
|
unref(y).date ? (openBlock(), createBlock(V, {
|
|
@@ -572,7 +572,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
572
572
|
},
|
|
573
573
|
emits: ["update:model-value"],
|
|
574
574
|
setup(e, { emit: m }) {
|
|
575
|
-
const { t: o } = useI18n(),
|
|
575
|
+
const { t: o } = useI18n(), i = e, s = m, p = computed(
|
|
576
576
|
() => [
|
|
577
577
|
{
|
|
578
578
|
label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -589,11 +589,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
589
589
|
].filter((n) => !n.hidden)
|
|
590
590
|
);
|
|
591
591
|
return (n, l) => {
|
|
592
|
-
const
|
|
592
|
+
const u = resolveComponent("FmCard");
|
|
593
593
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
594
594
|
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
595
595
|
createElementVNode("div", _hoisted_3$7, [
|
|
596
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(
|
|
596
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(u, {
|
|
597
597
|
variant: "outlined",
|
|
598
598
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
599
599
|
"col-span-2": unref(p).length == 1,
|
|
@@ -601,7 +601,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
601
601
|
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
602
602
|
}]),
|
|
603
603
|
onClick: () => {
|
|
604
|
-
|
|
604
|
+
i.modelValue != a.value && s("update:model-value", a.value);
|
|
605
605
|
},
|
|
606
606
|
key: a.value
|
|
607
607
|
}, {
|
|
@@ -622,20 +622,20 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
622
622
|
__name: "EditRewardPoolSheet",
|
|
623
623
|
emits: ["update:model-value"],
|
|
624
624
|
setup(e, { expose: m, emit: o }) {
|
|
625
|
-
const
|
|
626
|
-
var
|
|
627
|
-
return ((
|
|
625
|
+
const i = useMembershipStore(), { minor: s } = useLoading, p = ref(!1), n = ref(), l = ref(), u = ref(0), a = computed(() => {
|
|
626
|
+
var c;
|
|
627
|
+
return ((c = i.loyaltyRewards.items.find(
|
|
628
628
|
(r) => {
|
|
629
629
|
var d;
|
|
630
630
|
return r.value === ((d = n.value) == null ? void 0 : d.collectible);
|
|
631
631
|
}
|
|
632
|
-
)) == null ? void 0 :
|
|
632
|
+
)) == null ? void 0 : c.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
633
633
|
}), f = computed(() => {
|
|
634
634
|
const b = a.value.safeParse(n.value);
|
|
635
635
|
return b.success ? [] : b.error.errors;
|
|
636
636
|
});
|
|
637
|
-
function y(b,
|
|
638
|
-
b && (n.value =
|
|
637
|
+
function y(b, c, r) {
|
|
638
|
+
b && (n.value = c, u.value = r), p.value = b;
|
|
639
639
|
}
|
|
640
640
|
const v = o;
|
|
641
641
|
async function C() {
|
|
@@ -651,18 +651,18 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
651
651
|
message: "Uploading reward image",
|
|
652
652
|
successMessage: "Reward image updated"
|
|
653
653
|
}
|
|
654
|
-
), v("update:model-value", b.data,
|
|
654
|
+
), v("update:model-value", b.data, u.value));
|
|
655
655
|
}
|
|
656
656
|
return m({
|
|
657
657
|
showSheet: y
|
|
658
|
-
}), (b,
|
|
658
|
+
}), (b, c) => {
|
|
659
659
|
const r = resolveComponent("FmSelect"), d = resolveComponent("FmStepperField"), g = resolveComponent("FmButton"), k = resolveComponent("FmSideSheet");
|
|
660
660
|
return openBlock(), createBlock(k, {
|
|
661
661
|
"max-width": 560,
|
|
662
662
|
modelValue: unref(p),
|
|
663
663
|
"onUpdate:modelValue": [
|
|
664
|
-
|
|
665
|
-
|
|
664
|
+
c[9] || (c[9] = (V) => isRef(p) ? p.value = V : null),
|
|
665
|
+
c[10] || (c[10] = (V) => p.value = V)
|
|
666
666
|
],
|
|
667
667
|
header: "Edit reward",
|
|
668
668
|
"dismiss-away": ""
|
|
@@ -674,13 +674,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
674
674
|
type: "button",
|
|
675
675
|
disabled: unref(f).length > 0,
|
|
676
676
|
label: "Confirm",
|
|
677
|
-
onClick:
|
|
677
|
+
onClick: c[7] || (c[7] = (V) => C())
|
|
678
678
|
}, null, 8, ["disabled"]),
|
|
679
679
|
createVNode(g, {
|
|
680
680
|
variant: "secondary",
|
|
681
681
|
type: "button",
|
|
682
682
|
label: "Cancel",
|
|
683
|
-
onClick:
|
|
683
|
+
onClick: c[8] || (c[8] = (V) => p.value = !1)
|
|
684
684
|
})
|
|
685
685
|
])
|
|
686
686
|
]),
|
|
@@ -696,7 +696,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
696
696
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
697
697
|
],
|
|
698
698
|
"model-value": unref(n).type,
|
|
699
|
-
"onUpdate:modelValue":
|
|
699
|
+
"onUpdate:modelValue": c[0] || (c[0] = (h) => {
|
|
700
700
|
h == "NO_REWARD" ? n.value = {
|
|
701
701
|
type: "NO_REWARD",
|
|
702
702
|
collectible: null,
|
|
@@ -716,7 +716,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
716
716
|
},
|
|
717
717
|
weight: 1
|
|
718
718
|
} : n.value = {
|
|
719
|
-
collectible: unref(
|
|
719
|
+
collectible: unref(i).loyaltyRewards.raw[0]._id,
|
|
720
720
|
type: "LOYALTY",
|
|
721
721
|
earningOption: {
|
|
722
722
|
amount: 1,
|
|
@@ -733,27 +733,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
733
733
|
key: 0,
|
|
734
734
|
label: "Loyalty type",
|
|
735
735
|
rules: [unref(ZodHelper).ruleAtPath(unref(a), "collectible", [unref(n).type])],
|
|
736
|
-
items: unref(
|
|
736
|
+
items: unref(i).loyaltyRewards.items,
|
|
737
737
|
"model-value": unref(n).collectible,
|
|
738
|
-
"onUpdate:modelValue":
|
|
738
|
+
"onUpdate:modelValue": c[1] || (c[1] = (h) => unref(n).collectible = h)
|
|
739
739
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
740
740
|
createVNode(d, {
|
|
741
741
|
label: "Weight",
|
|
742
742
|
rules: [unref(ZodHelper).ruleAtPath(unref(a), "weight", [unref(n).type])],
|
|
743
743
|
"model-value": unref(n).weight,
|
|
744
|
-
"onUpdate:modelValue":
|
|
744
|
+
"onUpdate:modelValue": c[2] || (c[2] = (h) => n.value = {
|
|
745
745
|
...unref(n),
|
|
746
746
|
weight: h
|
|
747
747
|
})
|
|
748
748
|
}, null, 8, ["rules", "model-value"]),
|
|
749
749
|
unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
750
|
-
((V = unref(
|
|
750
|
+
((V = unref(i).loyaltyRewards.items.find(
|
|
751
751
|
(h) => {
|
|
752
752
|
var R;
|
|
753
753
|
return h.value === ((R = unref(n)) == null ? void 0 : R.collectible);
|
|
754
754
|
}
|
|
755
755
|
)) == null ? void 0 : V.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
756
|
-
|
|
756
|
+
c[11] || (c[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
757
757
|
createVNode(_sfc_main$l, {
|
|
758
758
|
class: "mt-[-8px]",
|
|
759
759
|
rules: [
|
|
@@ -763,16 +763,16 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
763
763
|
"error-text": unref(ZodHelper).helperText(unref(f), "earningOption"),
|
|
764
764
|
"fixed-type": !0,
|
|
765
765
|
"model-value": unref(n).earningOption,
|
|
766
|
-
"onUpdate:modelValue":
|
|
766
|
+
"onUpdate:modelValue": c[3] || (c[3] = (h) => n.value = {
|
|
767
767
|
...unref(n),
|
|
768
768
|
earningOption: h
|
|
769
769
|
})
|
|
770
770
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
771
771
|
], 64)) : createCommentVNode("", !0),
|
|
772
|
-
|
|
772
|
+
c[12] || (c[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
773
773
|
createVNode(_sfc_main$m, {
|
|
774
774
|
type: unref(n).type === "LOYALTY" ? "custom" : "range",
|
|
775
|
-
"for-credit": unref(n).type === "LOYALTY" && ((x = unref(
|
|
775
|
+
"for-credit": unref(n).type === "LOYALTY" && ((x = unref(i).loyaltyRewards.items.find(
|
|
776
776
|
(h) => {
|
|
777
777
|
var R;
|
|
778
778
|
return h.value === ((R = unref(n)) == null ? void 0 : R.collectible);
|
|
@@ -781,7 +781,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
781
781
|
class: "!gap-24",
|
|
782
782
|
rules: [unref(ZodHelper).ruleAtPath(unref(a), "validityOption", [unref(n).type])],
|
|
783
783
|
"model-value": unref(n).validityOption,
|
|
784
|
-
"onUpdate:modelValue":
|
|
784
|
+
"onUpdate:modelValue": c[4] || (c[4] = (h) => n.value = {
|
|
785
785
|
...unref(n),
|
|
786
786
|
validityOption: h
|
|
787
787
|
})
|
|
@@ -791,11 +791,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
791
791
|
key: 2,
|
|
792
792
|
"reward-image": unref(l),
|
|
793
793
|
"model-value": ((B = unref(n)) == null ? void 0 : B.collectibleConfig) ?? void 0,
|
|
794
|
-
"onUpdate:modelValue":
|
|
794
|
+
"onUpdate:modelValue": c[5] || (c[5] = (h) => n.value = {
|
|
795
795
|
...unref(n),
|
|
796
796
|
collectibleConfig: h
|
|
797
797
|
}),
|
|
798
|
-
"onUpdate:rewardImage":
|
|
798
|
+
"onUpdate:rewardImage": c[6] || (c[6] = (h) => l.value = h)
|
|
799
799
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
800
800
|
createVNode(JsonViewer, { json: unref(f) }, null, 8, ["json"])
|
|
801
801
|
])) : createCommentVNode("", !0)
|
|
@@ -825,36 +825,36 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
825
825
|
},
|
|
826
826
|
emits: ["update:model-value"],
|
|
827
827
|
setup(e, { emit: m }) {
|
|
828
|
-
const o = e,
|
|
829
|
-
const
|
|
830
|
-
return
|
|
828
|
+
const o = e, i = m, s = useMembershipStore(), { t: p } = useI18n(), n = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => o.modelValue ?? []), u = computed(() => {
|
|
829
|
+
const c = n.safeParse(l.value);
|
|
830
|
+
return c.success ? [] : c.error.errors;
|
|
831
831
|
}), a = ref();
|
|
832
|
-
function f(
|
|
832
|
+
function f(c, r) {
|
|
833
833
|
var g;
|
|
834
834
|
const d = [...l.value];
|
|
835
|
-
d[r] =
|
|
835
|
+
d[r] = c, (g = a.value) == null || g.showSheet(!1), i("update:model-value", d);
|
|
836
836
|
}
|
|
837
|
-
function y(
|
|
838
|
-
const r =
|
|
839
|
-
(k) => k._id.toString() ==
|
|
840
|
-
), d = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), g =
|
|
837
|
+
function y(c) {
|
|
838
|
+
const r = c.type == "VOUCHER" ? c.collectibleConfig : s.collectibles.find(
|
|
839
|
+
(k) => k._id.toString() == c.collectible
|
|
840
|
+
), d = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), g = c.weight;
|
|
841
841
|
return {
|
|
842
842
|
label: isNullOrEmpty(d) ? "NO REWARD" : d,
|
|
843
843
|
sublabel: `${g} (${(g / l.value.reduce((k, V) => k + V.weight, 0) * 100).toFixed(2)}%)`
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
|
-
function v(
|
|
846
|
+
function v(c) {
|
|
847
847
|
var d;
|
|
848
848
|
const r = [...l.value];
|
|
849
|
-
(d = a.value) == null || d.showSheet(!0, r[
|
|
849
|
+
(d = a.value) == null || d.showSheet(!0, r[c], c);
|
|
850
850
|
}
|
|
851
|
-
function C(
|
|
851
|
+
function C(c) {
|
|
852
852
|
const r = [...l.value];
|
|
853
|
-
r.splice(
|
|
853
|
+
r.splice(c, 1), i("update:model-value", r);
|
|
854
854
|
}
|
|
855
855
|
function b() {
|
|
856
|
-
var
|
|
857
|
-
(
|
|
856
|
+
var c;
|
|
857
|
+
(c = a.value) == null || c.showSheet(
|
|
858
858
|
!0,
|
|
859
859
|
{
|
|
860
860
|
type: "NO_REWARD",
|
|
@@ -864,7 +864,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
864
864
|
l.value.length
|
|
865
865
|
);
|
|
866
866
|
}
|
|
867
|
-
return (
|
|
867
|
+
return (c, r) => {
|
|
868
868
|
const d = resolveComponent("FmButton"), g = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
869
869
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
870
870
|
createElementVNode("div", _hoisted_2$7, toDisplayString(unref(p)("connect.template.configure_reward_type")), 1),
|
|
@@ -896,7 +896,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
896
896
|
}),
|
|
897
897
|
_: 2
|
|
898
898
|
}, 1032, ["onClick"]))), 128)),
|
|
899
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
899
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(k, {
|
|
900
900
|
key: V.message,
|
|
901
901
|
text: V.message,
|
|
902
902
|
state: "error"
|
|
@@ -921,7 +921,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
921
921
|
},
|
|
922
922
|
emits: ["update:model-value"],
|
|
923
923
|
setup(e, { emit: m }) {
|
|
924
|
-
const { t: o } = useI18n(),
|
|
924
|
+
const { t: o } = useI18n(), i = e, s = m, p = computed(() => [
|
|
925
925
|
{
|
|
926
926
|
label: o("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
927
927
|
description: o("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -930,26 +930,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
930
930
|
]);
|
|
931
931
|
return (n, l) => {
|
|
932
932
|
var y, v, C;
|
|
933
|
-
const
|
|
933
|
+
const u = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
|
|
934
934
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
935
|
-
createVNode(
|
|
935
|
+
createVNode(u, {
|
|
936
936
|
label: unref(o)("connect.template.promotion_game.enable"),
|
|
937
937
|
"model-value": !!((y = e.modelValue) != null && y.gameType),
|
|
938
938
|
"onUpdate:modelValue": l[0] || (l[0] = (b) => b ? s("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : s("update:model-value", null))
|
|
939
939
|
}, null, 8, ["label", "model-value"]),
|
|
940
940
|
((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
941
941
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (b) => {
|
|
942
|
-
var
|
|
942
|
+
var c, r;
|
|
943
943
|
return openBlock(), createBlock(a, {
|
|
944
944
|
variant: "outlined",
|
|
945
945
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
946
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)]": ((
|
|
947
|
+
"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.gameType) == b.value,
|
|
948
948
|
"hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != b.value
|
|
949
949
|
}]),
|
|
950
950
|
onClick: () => {
|
|
951
951
|
var d;
|
|
952
|
-
((d =
|
|
952
|
+
((d = i.modelValue) == null ? void 0 : d.gameType) != b.value && s("update:model-value", { gameType: b.value });
|
|
953
953
|
},
|
|
954
954
|
key: b.value
|
|
955
955
|
}, {
|
|
@@ -978,7 +978,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
978
978
|
},
|
|
979
979
|
emits: ["update:model-value"],
|
|
980
980
|
setup(e, { emit: m }) {
|
|
981
|
-
const { t: o } = useI18n(),
|
|
981
|
+
const { t: o } = useI18n(), i = e, s = m, p = computed(() => [
|
|
982
982
|
{
|
|
983
983
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
984
984
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -991,11 +991,11 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
991
991
|
}
|
|
992
992
|
]);
|
|
993
993
|
return (n, l) => {
|
|
994
|
-
const
|
|
994
|
+
const u = resolveComponent("FmCard");
|
|
995
995
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
996
996
|
createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
997
997
|
createElementVNode("div", _hoisted_3$4, [
|
|
998
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(
|
|
998
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(u, {
|
|
999
999
|
variant: "outlined",
|
|
1000
1000
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1001
1001
|
"col-span-2": unref(p).length == 1,
|
|
@@ -1003,7 +1003,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1003
1003
|
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
1004
1004
|
}]),
|
|
1005
1005
|
onClick: () => {
|
|
1006
|
-
|
|
1006
|
+
i.modelValue != a.value && s("update:model-value", a.value);
|
|
1007
1007
|
},
|
|
1008
1008
|
key: a.value
|
|
1009
1009
|
}, {
|
|
@@ -1033,7 +1033,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1033
1033
|
emits: ["update:model-value"],
|
|
1034
1034
|
setup(e, { emit: m }) {
|
|
1035
1035
|
const o = m;
|
|
1036
|
-
return (
|
|
1036
|
+
return (i, s) => {
|
|
1037
1037
|
const p = resolveComponent("FmStepperField");
|
|
1038
1038
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1039
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)),
|
|
@@ -1057,7 +1057,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1057
1057
|
},
|
|
1058
1058
|
emits: ["update:model-value"],
|
|
1059
1059
|
setup(e, { expose: m, emit: o }) {
|
|
1060
|
-
const
|
|
1060
|
+
const i = e, s = useMembershipStore(), { minor: p } = useLoading, n = ref(!1), l = ref(), u = ref(), a = ref(0), f = computed(() => {
|
|
1061
1061
|
var d;
|
|
1062
1062
|
return ((d = s.loyaltyRewards.items.find(
|
|
1063
1063
|
(g) => {
|
|
@@ -1077,9 +1077,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1077
1077
|
const r = f.value.safeParse(l.value);
|
|
1078
1078
|
r.success && (await p(
|
|
1079
1079
|
async () => {
|
|
1080
|
-
r.data.type === "VOUCHER" &&
|
|
1081
|
-
r.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0,
|
|
1082
|
-
|
|
1080
|
+
r.data.type === "VOUCHER" && u.value && (r.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1081
|
+
r.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, u.value),
|
|
1082
|
+
u.value
|
|
1083
1083
|
));
|
|
1084
1084
|
},
|
|
1085
1085
|
{
|
|
@@ -1088,7 +1088,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1088
1088
|
}
|
|
1089
1089
|
), C("update:model-value", r.data, a.value));
|
|
1090
1090
|
}
|
|
1091
|
-
const
|
|
1091
|
+
const c = ref();
|
|
1092
1092
|
return m({
|
|
1093
1093
|
showSheet: v
|
|
1094
1094
|
}), (r, d) => {
|
|
@@ -1112,7 +1112,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1112
1112
|
disabled: unref(y).length > 0,
|
|
1113
1113
|
onClick: d[8] || (d[8] = async () => {
|
|
1114
1114
|
var h;
|
|
1115
|
-
return (h = unref(
|
|
1115
|
+
return (h = unref(c)) == null ? void 0 : h.validateInputs();
|
|
1116
1116
|
})
|
|
1117
1117
|
}, null, 8, ["disabled"]),
|
|
1118
1118
|
createVNode(x, {
|
|
@@ -1129,7 +1129,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1129
1129
|
key: 0,
|
|
1130
1130
|
class: "flex flex-col gap-y-24",
|
|
1131
1131
|
ref_key: "formRef",
|
|
1132
|
-
ref:
|
|
1132
|
+
ref: c,
|
|
1133
1133
|
onValidationSuccess: d[7] || (d[7] = (h) => b())
|
|
1134
1134
|
}, {
|
|
1135
1135
|
default: withCtx(() => {
|
|
@@ -1141,8 +1141,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1141
1141
|
rules: [
|
|
1142
1142
|
unref(ZodHelper).toRule(
|
|
1143
1143
|
unref(z).number().min(1).max(
|
|
1144
|
-
|
|
1145
|
-
`Number cannot be more than ${
|
|
1144
|
+
i.maxThreshold,
|
|
1145
|
+
`Number cannot be more than ${i.maxThreshold}`
|
|
1146
1146
|
)
|
|
1147
1147
|
)
|
|
1148
1148
|
],
|
|
@@ -1230,13 +1230,13 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1230
1230
|
], 64)) : createCommentVNode("", !0),
|
|
1231
1231
|
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1232
1232
|
key: 3,
|
|
1233
|
-
"reward-image": unref(
|
|
1233
|
+
"reward-image": unref(u),
|
|
1234
1234
|
"model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
1235
1235
|
"onUpdate:modelValue": d[5] || (d[5] = (S) => l.value = {
|
|
1236
1236
|
...unref(l),
|
|
1237
1237
|
collectibleConfig: S
|
|
1238
1238
|
}),
|
|
1239
|
-
"onUpdate:rewardImage": d[6] || (d[6] = (S) =>
|
|
1239
|
+
"onUpdate:rewardImage": d[6] || (d[6] = (S) => u.value = S)
|
|
1240
1240
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1241
1241
|
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
1242
1242
|
];
|
|
@@ -1272,17 +1272,17 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1272
1272
|
}
|
|
1273
1273
|
},
|
|
1274
1274
|
setup(e) {
|
|
1275
|
-
const m = e, { maxRange: o, currentRange:
|
|
1276
|
-
() => Math.min(
|
|
1275
|
+
const m = e, { maxRange: o, currentRange: i, markers: s } = toRefs(m), p = computed(
|
|
1276
|
+
() => Math.min(i.value / o.value * 100, 100)
|
|
1277
1277
|
), n = (l) => l / o.value * 100;
|
|
1278
|
-
return (l,
|
|
1278
|
+
return (l, u) => {
|
|
1279
1279
|
const a = resolveComponent("FmIcon");
|
|
1280
1280
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1281
1281
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (f) => (openBlock(), createBlock(a, {
|
|
1282
1282
|
class: normalizeClass(
|
|
1283
|
-
unref(
|
|
1283
|
+
unref(i) >= f ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1284
1284
|
),
|
|
1285
|
-
outline: unref(
|
|
1285
|
+
outline: unref(i) < f,
|
|
1286
1286
|
key: f,
|
|
1287
1287
|
name: unref(s).some((y) => y === f) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
1288
1288
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
@@ -1303,7 +1303,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1303
1303
|
createElementVNode("div", {
|
|
1304
1304
|
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
1305
1305
|
}),
|
|
1306
|
-
|
|
1306
|
+
u[0] || (u[0] = createElementVNode("div", null, "🎁", -1))
|
|
1307
1307
|
])
|
|
1308
1308
|
], 4))), 128))
|
|
1309
1309
|
]));
|
|
@@ -1311,15 +1311,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1311
1311
|
}
|
|
1312
1312
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1313
1313
|
function changeKeysFactory(e) {
|
|
1314
|
-
return function m(o,
|
|
1315
|
-
if (
|
|
1314
|
+
return function m(o, i = 1, s) {
|
|
1315
|
+
if (i === 0 || !isObject(o))
|
|
1316
1316
|
return o;
|
|
1317
1317
|
if (Array.isArray(o))
|
|
1318
|
-
return o.map((n) => m(n,
|
|
1318
|
+
return o.map((n) => m(n, i - 1, s));
|
|
1319
1319
|
const p = Object.create(Object.getPrototypeOf(o));
|
|
1320
1320
|
return Object.keys(o).forEach((n) => {
|
|
1321
|
-
const l = o[n],
|
|
1322
|
-
p[
|
|
1321
|
+
const l = o[n], u = e(n, s), a = m(l, i - 1, s);
|
|
1322
|
+
p[u] = a;
|
|
1323
1323
|
}), p;
|
|
1324
1324
|
};
|
|
1325
1325
|
}
|
|
@@ -1337,9 +1337,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1337
1337
|
},
|
|
1338
1338
|
emits: ["update:model-value"],
|
|
1339
1339
|
setup(e, { emit: m }) {
|
|
1340
|
-
const { t: o } = useI18n(),
|
|
1341
|
-
() =>
|
|
1342
|
-
),
|
|
1340
|
+
const { t: o } = useI18n(), i = e, s = m, p = useMembershipStore(), n = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1341
|
+
() => i.modelValue.sort((r, d) => r.threshold - d.threshold) ?? []
|
|
1342
|
+
), u = computed(() => {
|
|
1343
1343
|
const r = n.safeParse(l.value);
|
|
1344
1344
|
return r.success ? [] : r.error.errors;
|
|
1345
1345
|
}), a = ref();
|
|
@@ -1392,7 +1392,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1392
1392
|
l.value.length
|
|
1393
1393
|
);
|
|
1394
1394
|
}
|
|
1395
|
-
function
|
|
1395
|
+
function c(r) {
|
|
1396
1396
|
var d, g;
|
|
1397
1397
|
return r.type == "VOUCHER" ? (d = r.collectibleConfig) == null ? void 0 : d.name : sentenceCase(
|
|
1398
1398
|
((g = p.loyaltyRewards.items.find(
|
|
@@ -1429,7 +1429,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1429
1429
|
]),
|
|
1430
1430
|
_: 2
|
|
1431
1431
|
}, 1032, ["onClick"]))), 128)),
|
|
1432
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1432
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(V, {
|
|
1433
1433
|
key: x.message,
|
|
1434
1434
|
text: x.message,
|
|
1435
1435
|
state: "error"
|
|
@@ -1445,7 +1445,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1445
1445
|
return [
|
|
1446
1446
|
createElementVNode("div", _hoisted_6$2, [
|
|
1447
1447
|
createElementVNode("div", null, [
|
|
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] ?
|
|
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] ? c(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
1449
1449
|
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
1450
1450
|
])
|
|
1451
1451
|
]),
|
|
@@ -1478,8 +1478,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1478
1478
|
},
|
|
1479
1479
|
emits: ["update:model-value"],
|
|
1480
1480
|
setup(e, { emit: m }) {
|
|
1481
|
-
const { t: o } = useI18n(),
|
|
1482
|
-
const l = FdoMission.safeParse(
|
|
1481
|
+
const { t: o } = useI18n(), i = e, s = computed(() => {
|
|
1482
|
+
const l = FdoMission.safeParse(i.modelValue);
|
|
1483
1483
|
return l.success ? [] : l.error.errors;
|
|
1484
1484
|
}), p = computed(() => [
|
|
1485
1485
|
{
|
|
@@ -1493,7 +1493,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1493
1493
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1494
1494
|
}
|
|
1495
1495
|
]), n = m;
|
|
1496
|
-
return (l,
|
|
1496
|
+
return (l, u) => {
|
|
1497
1497
|
var y;
|
|
1498
1498
|
const a = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
|
|
1499
1499
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
@@ -1511,8 +1511,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1511
1511
|
"hover:bg-fm-color-opacity-sm": ((b = e.modelValue) == null ? void 0 : b.type) != v.value
|
|
1512
1512
|
}]),
|
|
1513
1513
|
onClick: () => {
|
|
1514
|
-
var
|
|
1515
|
-
((
|
|
1514
|
+
var c, r;
|
|
1515
|
+
((c = e.modelValue) == null ? void 0 : c.type) != v.value && n("update:model-value", {
|
|
1516
1516
|
...e.modelValue,
|
|
1517
1517
|
type: v.value,
|
|
1518
1518
|
end: ((r = e.modelValue) == null ? void 0 : r.end) || 1
|
|
@@ -1535,7 +1535,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1535
1535
|
createVNode(f, {
|
|
1536
1536
|
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
1537
1537
|
"model-value": ((y = e.modelValue) == null ? void 0 : y.end) || null,
|
|
1538
|
-
"onUpdate:modelValue":
|
|
1538
|
+
"onUpdate:modelValue": u[0] || (u[0] = (v) => {
|
|
1539
1539
|
var C;
|
|
1540
1540
|
return n("update:model-value", {
|
|
1541
1541
|
...e.modelValue,
|
|
@@ -1553,8 +1553,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1553
1553
|
});
|
|
1554
1554
|
function useLocaleText() {
|
|
1555
1555
|
const { locale: e, t: m } = useI18n();
|
|
1556
|
-
function o(
|
|
1557
|
-
return
|
|
1556
|
+
function o(i, s) {
|
|
1557
|
+
return i ? i[e.value] ?? i["en-US"] ?? m(s) : m(s);
|
|
1558
1558
|
}
|
|
1559
1559
|
return { getLocaleText: o };
|
|
1560
1560
|
}
|
|
@@ -1585,7 +1585,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1585
1585
|
},
|
|
1586
1586
|
emits: ["update:model-value", "update:file"],
|
|
1587
1587
|
setup(e, { emit: m }) {
|
|
1588
|
-
const { t: o } = useI18n(), { getLocaleText:
|
|
1588
|
+
const { t: o } = useI18n(), { getLocaleText: i } = useLocaleText(), s = e, p = m;
|
|
1589
1589
|
function n(f) {
|
|
1590
1590
|
switch (s.field.type) {
|
|
1591
1591
|
case "timeframe":
|
|
@@ -1623,7 +1623,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1623
1623
|
return s.modelValue;
|
|
1624
1624
|
}
|
|
1625
1625
|
});
|
|
1626
|
-
function
|
|
1626
|
+
function u() {
|
|
1627
1627
|
if (!a.value.schema) return [];
|
|
1628
1628
|
const f = a.value.schema.safeParse(s.modelValue);
|
|
1629
1629
|
return f.success ? [] : f.error.errors;
|
|
@@ -1635,15 +1635,15 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1635
1635
|
labelMark: s.schema && ZodHelper.isRequired(s.schema) == !1 ? "optional" : void 0,
|
|
1636
1636
|
zodLabel: s.schema ? ZodHelper.toInputLabel(
|
|
1637
1637
|
s.schema,
|
|
1638
|
-
|
|
1638
|
+
i(s.field.label_locale, s.field.label ?? "")
|
|
1639
1639
|
) : void 0
|
|
1640
1640
|
}));
|
|
1641
1641
|
return (f, y) => {
|
|
1642
1642
|
var d, g, k, V, x;
|
|
1643
|
-
const v = resolveComponent("FmTextField"), C = resolveComponent("FmStepperField"), b = resolveComponent("FmTextarea"),
|
|
1643
|
+
const v = resolveComponent("FmTextField"), C = resolveComponent("FmStepperField"), b = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
|
|
1644
1644
|
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
1645
1645
|
key: 0,
|
|
1646
|
-
label: unref(
|
|
1646
|
+
label: unref(i)(e.field.label_locale, e.field.label ?? ""),
|
|
1647
1647
|
"label-mark": unref(a).labelMark,
|
|
1648
1648
|
rules: unref(a).rules,
|
|
1649
1649
|
"model-value": unref(l),
|
|
@@ -1655,7 +1655,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1655
1655
|
json: { schema: unref(a).unwrapped, props: s }
|
|
1656
1656
|
}, null, 8, ["json"]),
|
|
1657
1657
|
createVNode(C, {
|
|
1658
|
-
label: unref(
|
|
1658
|
+
label: unref(i)(e.field.label_locale, e.field.label ?? ""),
|
|
1659
1659
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(a).labelMark,
|
|
1660
1660
|
"model-value": unref(l),
|
|
1661
1661
|
rules: e.field.isRuleChildren ? [] : unref(a).rules,
|
|
@@ -1665,7 +1665,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1665
1665
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
1666
1666
|
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(b, {
|
|
1667
1667
|
key: 2,
|
|
1668
|
-
label: unref(
|
|
1668
|
+
label: unref(i)(e.field.label_locale, e.field.label ?? ""),
|
|
1669
1669
|
"label-mark": unref(a).labelMark,
|
|
1670
1670
|
rules: unref(a).rules,
|
|
1671
1671
|
"model-value": unref(l),
|
|
@@ -1683,10 +1683,10 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1683
1683
|
"model-value": unref(l),
|
|
1684
1684
|
"onUpdate:modelValue": n
|
|
1685
1685
|
}, null, 8, ["model-value"]),
|
|
1686
|
-
createVNode(
|
|
1686
|
+
createVNode(c, {
|
|
1687
1687
|
class: "!mt-[8px]",
|
|
1688
|
-
text: unref(ZodHelper).helperText(
|
|
1689
|
-
state: unref(ZodHelper).helperState(
|
|
1688
|
+
text: unref(ZodHelper).helperText(u(), ""),
|
|
1689
|
+
state: unref(ZodHelper).helperState(u(), "")
|
|
1690
1690
|
}, null, 8, ["text", "state"])
|
|
1691
1691
|
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1692
1692
|
key: 5,
|
|
@@ -1701,7 +1701,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1701
1701
|
_: 1
|
|
1702
1702
|
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(r, {
|
|
1703
1703
|
key: 6,
|
|
1704
|
-
label: unref(
|
|
1704
|
+
label: unref(i)(e.field.label_locale, e.field.label ?? ""),
|
|
1705
1705
|
"label-placement": "right",
|
|
1706
1706
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
1707
1707
|
"label-mark": unref(a).labelMark,
|
|
@@ -1725,7 +1725,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1725
1725
|
"onUpdate:modelValue": n,
|
|
1726
1726
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
1727
1727
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
1728
|
-
unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
1728
|
+
unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
|
|
1729
1729
|
key: 0,
|
|
1730
1730
|
class: "!mt-[8px]",
|
|
1731
1731
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -1737,9 +1737,9 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1737
1737
|
"allow-whatsapp": !0,
|
|
1738
1738
|
"model-value": unref(l),
|
|
1739
1739
|
"onUpdate:modelValue": n,
|
|
1740
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1740
|
+
"helper-text": unref(ZodHelper).helperText(u(), ""),
|
|
1741
1741
|
"trigger-type": e.field.extras,
|
|
1742
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1742
|
+
"helper-state": unref(ZodHelper).helperState(u(), "")
|
|
1743
1743
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
|
|
1744
1744
|
key: 11,
|
|
1745
1745
|
"model-value": unref(l),
|
|
@@ -1751,7 +1751,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1751
1751
|
type: "custom",
|
|
1752
1752
|
"model-value": unref(l),
|
|
1753
1753
|
"onUpdate:modelValue": n,
|
|
1754
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
1754
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(u(), ""),
|
|
1755
1755
|
"for-credit": s.campaignType === "CREDIT"
|
|
1756
1756
|
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1757
1757
|
key: 13,
|
|
@@ -1773,8 +1773,8 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1773
1773
|
key: 17,
|
|
1774
1774
|
"model-value": unref(l),
|
|
1775
1775
|
"onUpdate:modelValue": n,
|
|
1776
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1777
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1776
|
+
"helper-text": unref(ZodHelper).helperText(u(), ""),
|
|
1777
|
+
"helper-state": unref(ZodHelper).helperState(u(), "")
|
|
1778
1778
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1779
1779
|
key: 18,
|
|
1780
1780
|
"model-value": unref(l),
|
|
@@ -1787,7 +1787,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1787
1787
|
"start-date": e.extras.start,
|
|
1788
1788
|
"end-date": e.extras.end
|
|
1789
1789
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
1790
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1790
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1791
1791
|
key: 0,
|
|
1792
1792
|
class: "!mt-[8px]",
|
|
1793
1793
|
text: e.helperText,
|
|
@@ -1798,14 +1798,14 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1798
1798
|
"model-value": unref(l),
|
|
1799
1799
|
"onUpdate:modelValue": n
|
|
1800
1800
|
}, null, 8, ["model-value"]),
|
|
1801
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1801
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1802
1802
|
key: 0,
|
|
1803
1803
|
class: "!mt-[8px]",
|
|
1804
1804
|
text: e.helperText,
|
|
1805
1805
|
state: "error"
|
|
1806
1806
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1807
1807
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
1808
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
1808
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(c, {
|
|
1809
1809
|
key: 0,
|
|
1810
1810
|
state: "warning",
|
|
1811
1811
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
@@ -1814,7 +1814,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1814
1814
|
"model-value": unref(l),
|
|
1815
1815
|
"onUpdate:modelValue": n
|
|
1816
1816
|
}, null, 8, ["model-value"]),
|
|
1817
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1817
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1818
1818
|
key: 1,
|
|
1819
1819
|
class: "!mt-[8px]",
|
|
1820
1820
|
text: e.helperText,
|
|
@@ -1825,7 +1825,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1825
1825
|
"model-value": unref(l),
|
|
1826
1826
|
"onUpdate:modelValue": n
|
|
1827
1827
|
}, null, 8, ["model-value"]),
|
|
1828
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1828
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1829
1829
|
key: 0,
|
|
1830
1830
|
class: "!mt-[8px]",
|
|
1831
1831
|
text: e.helperText,
|
|
@@ -1836,7 +1836,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1836
1836
|
"model-value": unref(l),
|
|
1837
1837
|
"onUpdate:modelValue": n
|
|
1838
1838
|
}, null, 8, ["model-value"]),
|
|
1839
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1839
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1840
1840
|
key: 0,
|
|
1841
1841
|
class: "!mt-[8px]",
|
|
1842
1842
|
text: e.helperText,
|
|
@@ -1847,7 +1847,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1847
1847
|
"model-value": unref(l),
|
|
1848
1848
|
"onUpdate:modelValue": n
|
|
1849
1849
|
}, null, 8, ["model-value"]),
|
|
1850
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1850
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1851
1851
|
key: 0,
|
|
1852
1852
|
class: "!mt-[8px]",
|
|
1853
1853
|
text: e.helperText,
|
|
@@ -1858,7 +1858,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1858
1858
|
"model-value": unref(l),
|
|
1859
1859
|
"onUpdate:modelValue": n
|
|
1860
1860
|
}, null, 8, ["model-value"]),
|
|
1861
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1861
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1862
1862
|
key: 0,
|
|
1863
1863
|
class: "!mt-[8px]",
|
|
1864
1864
|
text: e.helperText,
|
|
@@ -1877,7 +1877,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1877
1877
|
},
|
|
1878
1878
|
setup(e) {
|
|
1879
1879
|
const { t: m, te: o } = useI18n();
|
|
1880
|
-
return (
|
|
1880
|
+
return (i, s) => {
|
|
1881
1881
|
const p = resolveComponent("FmCard");
|
|
1882
1882
|
return openBlock(), createBlock(p, {
|
|
1883
1883
|
variant: "outlined",
|
|
@@ -1911,25 +1911,29 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1911
1911
|
TEMPLATES.VOUCHER
|
|
1912
1912
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
|
|
1913
1913
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
1914
|
-
var e, m;
|
|
1914
|
+
var e, m, o;
|
|
1915
1915
|
if (sheetVisible.value = visible, campaignType.value = type, visible == !0) {
|
|
1916
1916
|
try {
|
|
1917
1917
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
1918
1918
|
} catch {
|
|
1919
1919
|
} finally {
|
|
1920
|
-
await new Promise((
|
|
1920
|
+
await new Promise((i) => setTimeout(i, 120)), isLoading.value = !1;
|
|
1921
1921
|
}
|
|
1922
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1922
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((i, s) => {
|
|
1923
|
+
var p;
|
|
1924
|
+
if (i.campaign.type === "VOUCHER" && i.campaign.code) {
|
|
1925
|
+
const n = (p = i.campaign._id) == null ? void 0 : p.toString();
|
|
1926
|
+
useCampaignStore().campaigns.voucher.some(
|
|
1927
|
+
(l) => l.code === i.campaign.code && l._id.toString() !== n
|
|
1928
|
+
) && s.addIssue({
|
|
1929
|
+
code: "custom",
|
|
1930
|
+
message: "Code already exists, please use another code",
|
|
1931
|
+
path: ["campaign", "code"]
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1930
1934
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
1931
1935
|
...(m = template.value) == null ? void 0 : m.defaultValue
|
|
1932
|
-
}), "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", {
|
|
1936
|
+
}), "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 = (o = campaign == null ? void 0 : campaign.campaign) != null && o._id ? t("connect.campaign.common.edit_campaign_title", {
|
|
1933
1937
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
1934
1938
|
}) : t("connect.campaign.common.create_campaign_title", {
|
|
1935
1939
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
@@ -1960,10 +1964,10 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1960
1964
|
});
|
|
1961
1965
|
function stepErrors(e = currentStep.value - 1) {
|
|
1962
1966
|
const m = template.value.steps[e].groups.flatMap(
|
|
1963
|
-
(o) => o.fields.map((
|
|
1967
|
+
(o) => o.fields.map((i) => i.property)
|
|
1964
1968
|
);
|
|
1965
1969
|
return errors.value.filter(
|
|
1966
|
-
(o) => m.some((
|
|
1970
|
+
(o) => m.some((i) => o.path.join(".").includes(i))
|
|
1967
1971
|
);
|
|
1968
1972
|
}
|
|
1969
1973
|
__expose({ showSheet });
|
|
@@ -1977,10 +1981,10 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
1977
1981
|
});
|
|
1978
1982
|
}
|
|
1979
1983
|
function onUpdateProperty(e, m) {
|
|
1980
|
-
var o,
|
|
1984
|
+
var o, i, s, p, n, l, u, a;
|
|
1981
1985
|
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
1982
|
-
const y = ((p = (s = (
|
|
1983
|
-
...(a = (
|
|
1986
|
+
const y = ((p = (s = (i = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : i.campaign) == null ? void 0 : s.event) == null ? void 0 : p.rule) ? _.cloneDeep({
|
|
1987
|
+
...(a = (u = (l = (n = template.value) == null ? void 0 : n.defaultValue) == null ? void 0 : l.campaign) == null ? void 0 : u.event) == null ? void 0 : a.rule
|
|
1984
1988
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
1985
1989
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1986
1990
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
@@ -2030,7 +2034,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2030
2034
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2031
2035
|
}
|
|
2032
2036
|
return (e, m) => {
|
|
2033
|
-
const o = resolveComponent("FmButton"),
|
|
2037
|
+
const o = resolveComponent("FmButton"), i = resolveComponent("FmStep"), s = resolveComponent("FmStepper"), p = resolveComponent("FmCard"), n = resolveComponent("FmTopSheet");
|
|
2034
2038
|
return openBlock(), createBlock(n, {
|
|
2035
2039
|
"fullscreen-size": "lg",
|
|
2036
2040
|
modelValue: unref(sheetVisible),
|
|
@@ -2103,12 +2107,12 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2103
2107
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2104
2108
|
}, {
|
|
2105
2109
|
default: withCtx(() => [
|
|
2106
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l,
|
|
2110
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, u) => (openBlock(), createBlock(i, {
|
|
2107
2111
|
key: l.name,
|
|
2108
2112
|
title: unref(getLocaleText)(l.name_locale, l.name),
|
|
2109
|
-
value:
|
|
2110
|
-
error: () => stepErrors(
|
|
2111
|
-
complete: () =>
|
|
2113
|
+
value: u + 1,
|
|
2114
|
+
error: () => stepErrors(u).length > 0,
|
|
2115
|
+
complete: () => u + 1 <= unref(currentStep)
|
|
2112
2116
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
2113
2117
|
]),
|
|
2114
2118
|
_: 1
|
|
@@ -2126,13 +2130,13 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2126
2130
|
class: "flex-1"
|
|
2127
2131
|
}, {
|
|
2128
2132
|
default: withCtx(() => [
|
|
2129
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l,
|
|
2133
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, u) => (openBlock(), createBlock(i, {
|
|
2130
2134
|
key: l.name,
|
|
2131
2135
|
title: unref(sheetTitle),
|
|
2132
2136
|
description: unref(getLocaleText)(l.name_locale, l.name),
|
|
2133
|
-
value:
|
|
2134
|
-
error: () => stepErrors(
|
|
2135
|
-
complete: () =>
|
|
2137
|
+
value: u + 1,
|
|
2138
|
+
error: () => stepErrors(u).length > 0,
|
|
2139
|
+
complete: () => u + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
2136
2140
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
2137
2141
|
]),
|
|
2138
2142
|
_: 1
|
|
@@ -2158,9 +2162,9 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2158
2162
|
}
|
|
2159
2163
|
}, null, 8, ["json"]),
|
|
2160
2164
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2161
|
-
(l) => l.fields.length && (!l.condition || (Array.isArray(l.condition) ? l.condition.every((
|
|
2162
|
-
), (l,
|
|
2163
|
-
key:
|
|
2165
|
+
(l) => l.fields.length && (!l.condition || (Array.isArray(l.condition) ? l.condition.every((u) => unref(_).get(unref(data), u.property) == u.value == (u.not != !0)) : unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0)))
|
|
2166
|
+
), (l, u) => (openBlock(), createElementBlock("div", {
|
|
2167
|
+
key: u,
|
|
2164
2168
|
class: "space-y-24"
|
|
2165
2169
|
}, [
|
|
2166
2170
|
createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(l.name_locale, l.name ?? "")), 1),
|