@feedmepos/mf-connect 0.0.12-prod → 0.0.14-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-BM9j4mcq.js → Analytic-C-NSpVkC.js} +7 -7
- package/dist/{Broadcast-5a7_nlK2.js → Broadcast-BnCK20Da.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_Qo6Zw4.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBP4N34D.js} +8 -8
- package/dist/{Card-D2KXsf6D.js → Card-DcZoqwWC.js} +54 -54
- package/dist/{Collections-rsGMKAaE.js → Collections-5qKt3M_o.js} +6 -6
- package/dist/{Credit-BnHW4aAx.js → Credit-UabH7psr.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBbNUBWX.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-xaCymR_Z.js} +238 -256
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Bj3dHqjH.js → EffectSheet.vue_vue_type_style_index_0_lang-BCIqiH3f.js} +5 -5
- package/dist/{Experience-DZ3QmVqZ.js → Experience-Cc_d_vWP.js} +7 -7
- package/dist/{Game-DKCrkTue.js → Game-fR2icoz-.js} +7 -7
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-ChLUJK77.js → ImageInput.vue_vue_type_script_setup_true_lang-CRBQs0dR.js} +1 -1
- package/dist/{MainLayout-C4tOUQYb.js → MainLayout-yp-UCIb8.js} +1 -1
- package/dist/{Marketing-CgOPXO0b.js → Marketing-Ddd1Waj1.js} +4 -4
- package/dist/{Member-DgJzz-qV.js → Member-D7JKxv3J.js} +2 -2
- package/dist/{MemberList-BNIpWj0x.js → MemberList-BIatl6iH.js} +11 -11
- package/dist/{MemberTransactions-BEYEel4q.js → MemberTransactions-DCLbg6pX.js} +2 -2
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BJ1wLWMO.js → MessageInput.vue_vue_type_script_setup_true_lang-Qoq9t_1A.js} +2 -2
- package/dist/{Mission-V53rL7XT.js → Mission-zDHj4PKO.js} +7 -7
- package/dist/{Point-BE7sbUpv.js → Point-D6Imvjmz.js} +7 -7
- package/dist/{Promotion-A23HHyAW.js → Promotion-JQkZ-CoT.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CzOiRmO3.js → RuleGroup.vue_vue_type_script_setup_true_lang-HXSy728R.js} +13 -13
- package/dist/{Segment-OjThR8-l.js → Segment-BXuGD9rF.js} +9 -9
- package/dist/{Setting-Cv5FJWCG.js → Setting-41K5uvsD.js} +8 -8
- package/dist/{Store-DQoSb0vC.js → Store-Bg6zOtpl.js} +11 -11
- package/dist/{StoreRewards-DHdtRsdr.js → StoreRewards-BUo6VCGX.js} +9 -9
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-8BxMxOgb.js → StoreTransactions.vue_vue_type_script_setup_true_lang-NBJ-qxXq.js} +6 -6
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B6DvQL2O.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BbqFCQhz.js} +1 -1
- package/dist/{Tier-BWbAvEvT.js → Tier-PpTsCCIS.js} +16 -16
- package/dist/{Title-DuMvJSeo.js → Title-D8nhRqWZ.js} +15 -15
- package/dist/{Transaction-Dh9hUxxn.js → Transaction-qCmOHTBt.js} +1 -1
- package/dist/{Voucher-CDj33EVW.js → Voucher-aBz4DzGy.js} +9 -9
- package/dist/{app-C-JARJOh.js → app-B3H82b_Z.js} +1 -1
- package/dist/{app-CJmGoLdT.js → app-DIwQ689H.js} +4190 -4194
- package/dist/app.js +1 -1
- package/dist/{campaign-0ym0cymh.js → campaign-Bn9MqqMD.js} +2 -2
- package/dist/{dto-DHLYS7Rm.js → dto-Bd8UpNxj.js} +8 -8
- package/dist/{effect-lIau3gAr.js → effect-CL8DHBtc.js} +1 -1
- package/dist/{export-C2z8mAAK.js → export-DEHEjxEi.js} +3 -3
- package/dist/{helper-Dk7nQLD9.js → helper-DYP7y40e.js} +1 -1
- package/dist/{index-CoNWSPv-.js → index-BnjYA1qg.js} +1 -1
- package/dist/{index-BuYuArTc.js → index-BqTJ2YlJ.js} +2 -2
- package/dist/{index-jXbGzZIZ.js → index-C5X99_sc.js} +1 -1
- package/dist/{index-BacICqbE.js → index-CR_3nFTy.js} +2 -2
- package/dist/{index-BifZnXOd.js → index-CqwoQow2.js} +2 -2
- package/dist/{index-CwRopfKJ.js → index-CyGuwzal.js} +5 -5
- package/dist/{index-BiKKeruN.js → index-CyfgltAG.js} +1 -1
- package/dist/{index-DBs-f_OF.js → index-D315y0g3.js} +3 -3
- package/dist/{index-DrekSEPv.js → index-DAYdcWSH.js} +5 -5
- package/dist/{index-Dy-njFA-.js → index-DSWvFYsS.js} +1 -1
- package/dist/{loading-C0Im7NLc.js → loading-fMSGccvW.js} +4 -4
- package/dist/{lodash-DRiB9OLu.js → lodash-BkYkkFx7.js} +1 -1
- package/dist/membership-C3eZuYZq.js +216 -0
- package/dist/{money-CgXcfonm.js → money-C06Dpsaq.js} +1 -1
- package/dist/{number-B0SphtT-.js → number-EdjSvfo1.js} +1 -1
- package/dist/{rule-CWGFyRio.js → rule-CBjgikrn.js} +2 -2
- package/dist/{rule-builder-C484wKRf.js → rule-builder-CrlT-UI6.js} +1 -1
- package/dist/{template-DDHe5agw.js → template-jviJfdYE.js} +5 -5
- package/dist/{usePagination-D0-ih-vZ.js → usePagination-C7_w9Npf.js} +1 -1
- package/dist/{xlsx-D9dXZPK6.js → xlsx-DjN5U_w4.js} +1 -1
- package/package.json +1 -1
- package/dist/membership-BWDFt2D0.js +0 -221
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode,
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import { a as useBusinessStore, d as core, J as JsonViewer, z, S as SvcConfig } from "./app-
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
|
+
import { _ } from "./lodash-BkYkkFx7.js";
|
|
3
|
+
import { a as useBusinessStore, d as core, J as JsonViewer, z, S as SvcConfig } from "./app-DIwQ689H.js";
|
|
4
4
|
import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
5
|
-
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-
|
|
6
|
-
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-
|
|
7
|
-
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-
|
|
8
|
-
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
5
|
+
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-Bd8UpNxj.js";
|
|
6
|
+
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-C3eZuYZq.js";
|
|
7
|
+
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-CR_3nFTy.js";
|
|
8
|
+
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-CrlT-UI6.js";
|
|
9
9
|
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
10
|
-
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-
|
|
11
|
-
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
13
|
-
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
15
|
-
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-
|
|
16
|
-
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-
|
|
17
|
-
import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import "./index-
|
|
10
|
+
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-DAYdcWSH.js";
|
|
11
|
+
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-CRBQs0dR.js";
|
|
12
|
+
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-BCIqiH3f.js";
|
|
13
|
+
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BbqFCQhz.js";
|
|
14
|
+
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-HXSy728R.js";
|
|
15
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-fMSGccvW.js";
|
|
16
|
+
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-CyGuwzal.js";
|
|
17
|
+
import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-Qoq9t_1A.js";
|
|
18
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-CBjgikrn.js";
|
|
19
|
+
import "./index-BqTJ2YlJ.js";
|
|
20
|
+
import "./index-D315y0g3.js";
|
|
21
|
+
import "./index-CqwoQow2.js";
|
|
22
|
+
import "./index-C5X99_sc.js";
|
|
23
23
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
24
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
24
|
+
import { i as initCollectibleConfig } from "./helper-DYP7y40e.js";
|
|
25
25
|
import { C as CollectionUtils } from "./collection.fn-DHlfGYAC.js";
|
|
26
26
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
27
27
|
import { useDialog } from "@feedmepos/ui-library";
|
|
@@ -87,19 +87,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
87
87
|
if (t != "all_users" && t != l && RuleBuilder.getRules(
|
|
88
88
|
(a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
89
89
|
).length > 0) {
|
|
90
|
-
const
|
|
90
|
+
const p = await prompt.confirm(
|
|
91
91
|
"Are you sure you want to change the audience type? This will remove all the rules you have set."
|
|
92
92
|
);
|
|
93
|
-
|
|
93
|
+
p && r(
|
|
94
94
|
"update:model-value",
|
|
95
95
|
RuleBuilder.setRuleToGroup(
|
|
96
96
|
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
97
97
|
RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
98
98
|
)
|
|
99
|
-
), o.value =
|
|
99
|
+
), o.value = p ? l : t;
|
|
100
100
|
}
|
|
101
101
|
}), (l, t) => {
|
|
102
|
-
var
|
|
102
|
+
var p, v;
|
|
103
103
|
const a = resolveComponent("FmRadio");
|
|
104
104
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
105
105
|
createElementVNode("div", null, [
|
|
@@ -113,7 +113,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
113
113
|
]),
|
|
114
114
|
unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
115
115
|
createVNode(_sfc_main$p, {
|
|
116
|
-
modelValue: ((
|
|
116
|
+
modelValue: ((p = e.modelValue) == null ? void 0 : p.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
117
117
|
"onUpdate:modelValue": t[1] || (t[1] = (m) => r(
|
|
118
118
|
"update:model-value",
|
|
119
119
|
unref(RuleBuilder).setRuleToGroup(
|
|
@@ -158,16 +158,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
158
158
|
watch(o, async (l, t) => {
|
|
159
159
|
var a;
|
|
160
160
|
if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
161
|
-
const
|
|
161
|
+
const p = await prompt.confirm(
|
|
162
162
|
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
163
163
|
);
|
|
164
|
-
|
|
164
|
+
p && r(
|
|
165
165
|
"update:model-value",
|
|
166
166
|
RuleBuilder.setRuleToGroup(
|
|
167
167
|
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
168
168
|
RuleBuilder.scaffoldGroup("g_time")
|
|
169
169
|
)
|
|
170
|
-
), o.value =
|
|
170
|
+
), o.value = p ? l : t;
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
async function s(l) {
|
|
@@ -190,9 +190,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
190
190
|
}
|
|
191
191
|
return (l, t) => {
|
|
192
192
|
var v;
|
|
193
|
-
const a = resolveComponent("FmRadio"),
|
|
193
|
+
const a = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
|
|
194
194
|
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
195
|
-
createVNode(
|
|
195
|
+
createVNode(p, {
|
|
196
196
|
modelValue: unref(o),
|
|
197
197
|
"onUpdate:modelValue": [
|
|
198
198
|
t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
|
|
@@ -318,11 +318,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
318
318
|
label: "Days before birthday",
|
|
319
319
|
"show-steppers": !1,
|
|
320
320
|
"model-value": unref(o).equator.x,
|
|
321
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
321
|
+
"onUpdate:modelValue": l[2] || (l[2] = (p) => r(
|
|
322
322
|
"update:model-value",
|
|
323
323
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
324
324
|
op: "after",
|
|
325
|
-
x:
|
|
325
|
+
x: p,
|
|
326
326
|
ignoreYear: !0
|
|
327
327
|
})
|
|
328
328
|
))
|
|
@@ -544,7 +544,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
544
544
|
key: 0,
|
|
545
545
|
variant: "tertiary",
|
|
546
546
|
icon: "clear",
|
|
547
|
-
onClick: o[0] || (o[0] = (
|
|
547
|
+
onClick: o[0] || (o[0] = (p) => (p.stopPropagation(), n("update:model-value", null)))
|
|
548
548
|
})) : createCommentVNode("", !0)
|
|
549
549
|
]),
|
|
550
550
|
default: withCtx(() => [
|
|
@@ -647,7 +647,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
647
647
|
n.endDate ? new Date(n.endDate) : void 0
|
|
648
648
|
)
|
|
649
649
|
);
|
|
650
|
-
function
|
|
650
|
+
function p(m) {
|
|
651
651
|
const g = m.label.toLowerCase(), y = g == "fixed" ? [
|
|
652
652
|
RuleBuilder.constructEntry(
|
|
653
653
|
"trigger.date",
|
|
@@ -703,12 +703,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
703
703
|
);
|
|
704
704
|
}
|
|
705
705
|
return (m, g) => {
|
|
706
|
-
const y = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"),
|
|
706
|
+
const y = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), c = resolveComponent("FmTooltip"), f = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
|
|
707
707
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
708
708
|
createVNode(y, {
|
|
709
709
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
710
710
|
"model-value": { label: unref(cases).title(unref(s)) },
|
|
711
|
-
"onUpdate:modelValue":
|
|
711
|
+
"onUpdate:modelValue": p,
|
|
712
712
|
class: "mb-8"
|
|
713
713
|
}, null, 8, ["model-value"]),
|
|
714
714
|
createElementVNode("div", _hoisted_1$g, [
|
|
@@ -723,7 +723,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
723
723
|
unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
|
|
724
724
|
createElementVNode("div", _hoisted_4$b, [
|
|
725
725
|
_hoisted_5$7,
|
|
726
|
-
unref(t).date ? (openBlock(), createBlock(
|
|
726
|
+
unref(t).date ? (openBlock(), createBlock(c, {
|
|
727
727
|
key: 0,
|
|
728
728
|
"z-index": 9999,
|
|
729
729
|
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
|
|
@@ -802,7 +802,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
802
802
|
}
|
|
803
803
|
const s = d;
|
|
804
804
|
return (l, t) => {
|
|
805
|
-
const a = resolveComponent("FmField"),
|
|
805
|
+
const a = resolveComponent("FmField"), p = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
|
|
806
806
|
return openBlock(), createBlock(v, {
|
|
807
807
|
modelValue: r.value,
|
|
808
808
|
"onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
|
|
@@ -823,12 +823,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
823
823
|
]),
|
|
824
824
|
"side-sheet-footer": withCtx(() => [
|
|
825
825
|
createElementVNode("div", _hoisted_1$f, [
|
|
826
|
-
createVNode(
|
|
826
|
+
createVNode(p, {
|
|
827
827
|
variant: "tertiary",
|
|
828
828
|
onClick: t[0] || (t[0] = (m) => r.value = !1),
|
|
829
829
|
label: "Cancel"
|
|
830
830
|
}),
|
|
831
|
-
createVNode(
|
|
831
|
+
createVNode(p, {
|
|
832
832
|
variant: "primary",
|
|
833
833
|
onClick: o,
|
|
834
834
|
label: "Confirm"
|
|
@@ -852,22 +852,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
852
852
|
}, 8, ["modelValue"]);
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
|
-
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = {
|
|
856
|
-
key: 0,
|
|
857
|
-
class: "mr-32"
|
|
858
|
-
}, _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_8$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_9$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_10$3 = {
|
|
859
|
-
key: 0,
|
|
860
|
-
class: "xs:block flex gap-16 items-center pt-8"
|
|
861
|
-
}, _hoisted_11$1 = {
|
|
855
|
+
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_8$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
|
|
862
856
|
key: 0,
|
|
863
|
-
class: "
|
|
864
|
-
},
|
|
857
|
+
class: "xs:!block flex gap-16 items-center pt-8"
|
|
858
|
+
}, _hoisted_10$3 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _hoisted_11$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_13 = {
|
|
865
859
|
key: 0,
|
|
866
860
|
class: "pt-8 space-y-8"
|
|
867
|
-
},
|
|
868
|
-
key: 0,
|
|
869
|
-
class: "mr-32"
|
|
870
|
-
}, _hoisted_20 = /* @__PURE__ */ createElementVNode("div", { class: "xs:hidden text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
861
|
+
}, _hoisted_14 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_15 = { class: "xs:!block flex gap-16 items-center" }, _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
871
862
|
__name: "EarningOptionInput",
|
|
872
863
|
props: {
|
|
873
864
|
modelValue: {
|
|
@@ -922,54 +913,59 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
922
913
|
}
|
|
923
914
|
);
|
|
924
915
|
}
|
|
925
|
-
const
|
|
916
|
+
const p = ref(
|
|
926
917
|
((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
|
|
927
918
|
);
|
|
928
919
|
return (y, i) => {
|
|
929
|
-
var E,
|
|
930
|
-
const u = resolveComponent("FmCard"),
|
|
920
|
+
var E, V, N;
|
|
921
|
+
const u = resolveComponent("FmCard"), c = resolveComponent("FmStepperField"), f = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
|
|
931
922
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
932
923
|
createElementVNode("div", _hoisted_2$d, [
|
|
933
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (
|
|
924
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
|
|
934
925
|
var R, B;
|
|
935
926
|
return openBlock(), createBlock(u, {
|
|
936
927
|
variant: "outlined",
|
|
937
928
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
938
929
|
"col-span-2": unref(s).length == 1,
|
|
939
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) ===
|
|
940
|
-
"hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) !=
|
|
930
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) === h.value,
|
|
931
|
+
"hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != h.value
|
|
941
932
|
}]),
|
|
942
|
-
onClick: ($) => a(
|
|
943
|
-
key:
|
|
933
|
+
onClick: ($) => a(h.value),
|
|
934
|
+
key: h.value
|
|
944
935
|
}, {
|
|
945
936
|
default: withCtx(() => [
|
|
946
|
-
createElementVNode("div", _hoisted_3$b, toDisplayString(
|
|
947
|
-
createElementVNode("div", _hoisted_4$a, toDisplayString(
|
|
937
|
+
createElementVNode("div", _hoisted_3$b, toDisplayString(h.label), 1),
|
|
938
|
+
createElementVNode("div", _hoisted_4$a, toDisplayString(h.sublabel), 1)
|
|
948
939
|
]),
|
|
949
940
|
_: 2
|
|
950
941
|
}, 1032, ["class", "onClick"]);
|
|
951
942
|
}), 128))
|
|
952
943
|
]),
|
|
953
944
|
createElementVNode("div", _hoisted_5$6, [
|
|
954
|
-
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(
|
|
945
|
+
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(c, {
|
|
955
946
|
key: 0,
|
|
956
|
-
label:
|
|
947
|
+
label: `Receive ${unref(l)}(s)`,
|
|
957
948
|
class: "flex-1",
|
|
958
|
-
"model-value": ((
|
|
959
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
949
|
+
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
950
|
+
"onUpdate:modelValue": i[0] || (i[0] = (h) => o("update:model-value", {
|
|
960
951
|
...e.modelValue ?? { type: "FIXED" },
|
|
961
|
-
amount:
|
|
952
|
+
amount: h
|
|
962
953
|
}))
|
|
963
|
-
}, {
|
|
964
|
-
|
|
965
|
-
e.extras ? (openBlock(), createElementBlock("div", _hoisted_6$3, toDisplayString(unref(l)) + "(s)", 1)) : createCommentVNode("", !0)
|
|
966
|
-
]),
|
|
967
|
-
_: 1
|
|
968
|
-
}, 8, ["model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
969
|
-
_hoisted_7$3,
|
|
954
|
+
}, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
955
|
+
_hoisted_6$3,
|
|
970
956
|
createVNode(b, {
|
|
971
|
-
|
|
972
|
-
"onUpdate:modelValue": i[6] || (i[6] = (
|
|
957
|
+
"model-value": unref(p),
|
|
958
|
+
"onUpdate:modelValue": i[6] || (i[6] = (h) => {
|
|
959
|
+
unref(p) != h && (o("update:model-value", {
|
|
960
|
+
...e.modelValue ?? {
|
|
961
|
+
type: "PROPORTIONAL",
|
|
962
|
+
amount: 1,
|
|
963
|
+
every: 1
|
|
964
|
+
},
|
|
965
|
+
property: h ? [] : void 0,
|
|
966
|
+
every: 1
|
|
967
|
+
}), p.value = h);
|
|
968
|
+
})
|
|
973
969
|
}, {
|
|
974
970
|
default: withCtx(() => [
|
|
975
971
|
createVNode(f, {
|
|
@@ -978,43 +974,37 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
978
974
|
value: !1
|
|
979
975
|
}, {
|
|
980
976
|
label: withCtx(() => {
|
|
981
|
-
var
|
|
977
|
+
var h, R;
|
|
982
978
|
return [
|
|
983
|
-
|
|
984
|
-
createElementVNode("div",
|
|
985
|
-
unref(
|
|
986
|
-
createVNode(
|
|
987
|
-
label:
|
|
979
|
+
_hoisted_7$3,
|
|
980
|
+
createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
|
|
981
|
+
unref(p) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
982
|
+
createVNode(c, {
|
|
983
|
+
label: `Receive ${unref(l)}(s)`,
|
|
984
|
+
inputmode: "decimal",
|
|
988
985
|
class: "flex-1",
|
|
989
|
-
"model-value": ((
|
|
986
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
990
987
|
"onUpdate:modelValue": i[1] || (i[1] = (B) => o("update:model-value", {
|
|
991
988
|
...e.modelValue ?? { type: "FIXED" },
|
|
992
989
|
amount: B
|
|
993
990
|
}))
|
|
994
|
-
},
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
_: 1
|
|
999
|
-
}, 8, ["model-value"]),
|
|
1000
|
-
_hoisted_12$1,
|
|
1001
|
-
createVNode(p, {
|
|
1002
|
-
label: unref(c) ? "Item purchased" : `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
991
|
+
}, null, 8, ["label", "model-value"]),
|
|
992
|
+
_hoisted_10$3,
|
|
993
|
+
createVNode(c, {
|
|
994
|
+
label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
1003
995
|
class: "flex-1",
|
|
996
|
+
inputmode: "decimal",
|
|
1004
997
|
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1005
998
|
"onUpdate:modelValue": i[2] || (i[2] = (B) => o("update:model-value", {
|
|
1006
999
|
...e.modelValue,
|
|
1007
1000
|
every: B
|
|
1008
1001
|
}))
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
key: "0"
|
|
1016
|
-
}
|
|
1017
|
-
]), 1032, ["label", "model-value"])
|
|
1002
|
+
}, {
|
|
1003
|
+
prepend: withCtx(() => [
|
|
1004
|
+
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
1005
|
+
]),
|
|
1006
|
+
_: 1
|
|
1007
|
+
}, 8, ["label", "model-value"])
|
|
1018
1008
|
]))
|
|
1019
1009
|
];
|
|
1020
1010
|
}),
|
|
@@ -1027,15 +1017,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1027
1017
|
disabled: !unref(n).isPremium
|
|
1028
1018
|
}, {
|
|
1029
1019
|
label: withCtx(() => {
|
|
1030
|
-
var
|
|
1020
|
+
var h, R;
|
|
1031
1021
|
return [
|
|
1032
|
-
createElementVNode("div",
|
|
1022
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
1033
1023
|
createTextVNode(" Product bought "),
|
|
1034
1024
|
createVNode(k, { variant: "premium" })
|
|
1035
1025
|
]),
|
|
1036
|
-
createElementVNode("div",
|
|
1037
|
-
unref(
|
|
1038
|
-
createElementVNode("div",
|
|
1026
|
+
createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
|
|
1027
|
+
unref(p) ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
1028
|
+
createElementVNode("div", _hoisted_14, [
|
|
1039
1029
|
createVNode(_sfc_main$f, {
|
|
1040
1030
|
"model-value": r.modelValue.property || [],
|
|
1041
1031
|
onConfirm: i[3] || (i[3] = (B) => o("update:model-value", {
|
|
@@ -1043,50 +1033,42 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1043
1033
|
property: B
|
|
1044
1034
|
}))
|
|
1045
1035
|
}, {
|
|
1046
|
-
"side-sheet-button": withCtx(() =>
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1036
|
+
"side-sheet-button": withCtx(() => {
|
|
1037
|
+
var B, $;
|
|
1038
|
+
return [
|
|
1039
|
+
createVNode(C, {
|
|
1040
|
+
label: (B = r.modelValue.property) != null && B.length ? `${($ = r.modelValue.property) == null ? void 0 : $.length} product(s) selected` : "Select product",
|
|
1041
|
+
icon: "link",
|
|
1042
|
+
variant: "secondary"
|
|
1043
|
+
}, null, 8, ["label"])
|
|
1044
|
+
];
|
|
1045
|
+
}),
|
|
1053
1046
|
_: 1
|
|
1054
|
-
}, 8, ["model-value"])
|
|
1055
|
-
createElementVNode("div", _hoisted_17, toDisplayString((r.modelValue.property ?? []).length) + " product(s) selected ", 1)
|
|
1047
|
+
}, 8, ["model-value"])
|
|
1056
1048
|
]),
|
|
1057
|
-
createElementVNode("div",
|
|
1058
|
-
createVNode(
|
|
1059
|
-
|
|
1049
|
+
createElementVNode("div", _hoisted_15, [
|
|
1050
|
+
createVNode(c, {
|
|
1051
|
+
inputmode: "decimal",
|
|
1052
|
+
label: `Receive ${unref(l)}(s)`,
|
|
1060
1053
|
class: "flex-1",
|
|
1061
|
-
"model-value": ((
|
|
1054
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
1062
1055
|
"onUpdate:modelValue": i[4] || (i[4] = (B) => o("update:model-value", {
|
|
1063
1056
|
...e.modelValue ?? { type: "FIXED" },
|
|
1064
1057
|
amount: B
|
|
1065
1058
|
}))
|
|
1066
|
-
},
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
_: 1
|
|
1071
|
-
}, 8, ["model-value"]),
|
|
1072
|
-
_hoisted_20,
|
|
1073
|
-
createVNode(p, {
|
|
1074
|
-
label: unref(c) ? "Item purchased" : `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
1059
|
+
}, null, 8, ["label", "model-value"]),
|
|
1060
|
+
_hoisted_16,
|
|
1061
|
+
createVNode(c, {
|
|
1062
|
+
label: "Item purchased",
|
|
1075
1063
|
class: "flex-1",
|
|
1076
1064
|
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1065
|
+
inputmode: "numeric",
|
|
1066
|
+
"max-fraction-digits": 0,
|
|
1077
1067
|
"onUpdate:modelValue": i[5] || (i[5] = (B) => o("update:model-value", {
|
|
1078
1068
|
...e.modelValue,
|
|
1079
1069
|
every: B
|
|
1080
1070
|
}))
|
|
1081
|
-
},
|
|
1082
|
-
unref(c) ? void 0 : {
|
|
1083
|
-
name: "prepend",
|
|
1084
|
-
fn: withCtx(() => [
|
|
1085
|
-
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
1086
|
-
]),
|
|
1087
|
-
key: "0"
|
|
1088
|
-
}
|
|
1089
|
-
]), 1032, ["label", "model-value"])
|
|
1071
|
+
}, null, 8, ["model-value"])
|
|
1090
1072
|
])
|
|
1091
1073
|
])) : createCommentVNode("", !0)
|
|
1092
1074
|
];
|
|
@@ -1095,7 +1077,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1095
1077
|
}, 8, ["sublabel", "disabled"])
|
|
1096
1078
|
]),
|
|
1097
1079
|
_: 1
|
|
1098
|
-
}, 8, ["
|
|
1080
|
+
}, 8, ["model-value"])
|
|
1099
1081
|
], 64)) : createCommentVNode("", !0)
|
|
1100
1082
|
]),
|
|
1101
1083
|
e.errorText || unref(t).length > 0 ? (openBlock(), createBlock(x, {
|
|
@@ -1179,7 +1161,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1179
1161
|
), o = FdtoCollectibleConfig, s = d;
|
|
1180
1162
|
return (l, t) => {
|
|
1181
1163
|
var m, g, y;
|
|
1182
|
-
const a = resolveComponent("FmTextarea"),
|
|
1164
|
+
const a = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
|
|
1183
1165
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1184
1166
|
createVNode(_sfc_main$u, {
|
|
1185
1167
|
modelValue: unref(r).name,
|
|
@@ -1231,7 +1213,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1231
1213
|
"model-value": unref(r).extras.effect,
|
|
1232
1214
|
"onUpdate:modelValue": t[3] || (t[3] = (i) => unref(r).extras.effect = i)
|
|
1233
1215
|
}, null, 8, ["model-value"]),
|
|
1234
|
-
unref(r).extras.effect == null ? (openBlock(), createBlock(
|
|
1216
|
+
unref(r).extras.effect == null ? (openBlock(), createBlock(p, {
|
|
1235
1217
|
key: 0,
|
|
1236
1218
|
class: "!mt-8",
|
|
1237
1219
|
text: "Effect is required",
|
|
@@ -1271,24 +1253,24 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1271
1253
|
__name: "EditRewardPoolSheet",
|
|
1272
1254
|
emits: ["update:model-value"],
|
|
1273
1255
|
setup(e, { expose: d, emit: n }) {
|
|
1274
|
-
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0),
|
|
1256
|
+
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), p = computed(() => {
|
|
1275
1257
|
var u;
|
|
1276
1258
|
return ((u = r.loyaltyRewards.items.find(
|
|
1277
|
-
(
|
|
1259
|
+
(c) => {
|
|
1278
1260
|
var f;
|
|
1279
|
-
return
|
|
1261
|
+
return c.value === ((f = l.value) == null ? void 0 : f.collectible);
|
|
1280
1262
|
}
|
|
1281
1263
|
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1282
1264
|
}), v = computed(() => {
|
|
1283
|
-
const i =
|
|
1265
|
+
const i = p.value.safeParse(l.value);
|
|
1284
1266
|
return i.success ? [] : i.error.errors;
|
|
1285
1267
|
});
|
|
1286
|
-
function m(i, u,
|
|
1287
|
-
i && (l.value = u, a.value =
|
|
1268
|
+
function m(i, u, c) {
|
|
1269
|
+
i && (l.value = u, a.value = c), s.value = i;
|
|
1288
1270
|
}
|
|
1289
1271
|
const g = n;
|
|
1290
1272
|
async function y() {
|
|
1291
|
-
const i =
|
|
1273
|
+
const i = p.value.safeParse(l.value);
|
|
1292
1274
|
i.success && (await o(
|
|
1293
1275
|
async () => {
|
|
1294
1276
|
i.data.type === "VOUCHER" && t.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
|
|
@@ -1305,7 +1287,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1305
1287
|
return d({
|
|
1306
1288
|
showSheet: m
|
|
1307
1289
|
}), (i, u) => {
|
|
1308
|
-
const
|
|
1290
|
+
const c = resolveComponent("FmSelect"), f = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
1309
1291
|
return openBlock(), createBlock(C, {
|
|
1310
1292
|
"max-width": 560,
|
|
1311
1293
|
modelValue: unref(s),
|
|
@@ -1337,7 +1319,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1337
1319
|
var b, x, E;
|
|
1338
1320
|
return [
|
|
1339
1321
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1340
|
-
createVNode(
|
|
1322
|
+
createVNode(c, {
|
|
1341
1323
|
label: "Reward Type",
|
|
1342
1324
|
items: [
|
|
1343
1325
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -1345,12 +1327,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1345
1327
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1346
1328
|
],
|
|
1347
1329
|
"model-value": unref(l).type,
|
|
1348
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
1349
|
-
|
|
1330
|
+
"onUpdate:modelValue": u[0] || (u[0] = (V) => {
|
|
1331
|
+
V == "NO_REWARD" ? l.value = {
|
|
1350
1332
|
type: "NO_REWARD",
|
|
1351
1333
|
collectible: null,
|
|
1352
1334
|
weight: 1
|
|
1353
|
-
} :
|
|
1335
|
+
} : V === "VOUCHER" ? l.value = {
|
|
1354
1336
|
collectible: null,
|
|
1355
1337
|
type: "VOUCHER",
|
|
1356
1338
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1378,60 +1360,60 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1378
1360
|
};
|
|
1379
1361
|
})
|
|
1380
1362
|
}, null, 8, ["model-value"]),
|
|
1381
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
1363
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(c, {
|
|
1382
1364
|
key: 0,
|
|
1383
1365
|
label: "Loyalty type",
|
|
1384
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1366
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(l).type])],
|
|
1385
1367
|
items: unref(r).loyaltyRewards.items,
|
|
1386
1368
|
"model-value": unref(l).collectible,
|
|
1387
|
-
"onUpdate:modelValue": u[1] || (u[1] = (
|
|
1369
|
+
"onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
|
|
1388
1370
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1389
1371
|
createVNode(f, {
|
|
1390
1372
|
label: "Weight",
|
|
1391
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1373
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(p), "weight", [unref(l).type])],
|
|
1392
1374
|
"model-value": unref(l).weight,
|
|
1393
|
-
"onUpdate:modelValue": u[2] || (u[2] = (
|
|
1375
|
+
"onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
|
|
1394
1376
|
...unref(l),
|
|
1395
|
-
weight:
|
|
1377
|
+
weight: V
|
|
1396
1378
|
})
|
|
1397
1379
|
}, null, 8, ["rules", "model-value"]),
|
|
1398
1380
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1399
1381
|
((b = unref(r).loyaltyRewards.items.find(
|
|
1400
|
-
(
|
|
1382
|
+
(V) => {
|
|
1401
1383
|
var N;
|
|
1402
|
-
return
|
|
1384
|
+
return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1403
1385
|
}
|
|
1404
1386
|
)) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1405
1387
|
_hoisted_2$a,
|
|
1406
1388
|
createVNode(_sfc_main$e, {
|
|
1407
1389
|
class: "mt-[-8px]",
|
|
1408
1390
|
rules: [
|
|
1409
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
1391
|
+
unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(l).type])
|
|
1410
1392
|
],
|
|
1411
1393
|
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
1412
1394
|
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
1413
1395
|
"fixed-type": !0,
|
|
1414
1396
|
"model-value": unref(l).earningOption,
|
|
1415
|
-
"onUpdate:modelValue": u[3] || (u[3] = (
|
|
1397
|
+
"onUpdate:modelValue": u[3] || (u[3] = (V) => l.value = {
|
|
1416
1398
|
...unref(l),
|
|
1417
|
-
earningOption:
|
|
1399
|
+
earningOption: V
|
|
1418
1400
|
})
|
|
1419
1401
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1420
1402
|
], 64)) : createCommentVNode("", !0),
|
|
1421
1403
|
_hoisted_3$8,
|
|
1422
1404
|
createVNode(_sfc_main$z, {
|
|
1423
1405
|
"for-credit": unref(l).type === "LOYALTY" && ((x = unref(r).loyaltyRewards.items.find(
|
|
1424
|
-
(
|
|
1406
|
+
(V) => {
|
|
1425
1407
|
var N;
|
|
1426
|
-
return
|
|
1408
|
+
return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1427
1409
|
}
|
|
1428
1410
|
)) == null ? void 0 : x.raw.type) === "CREDIT",
|
|
1429
1411
|
class: "!gap-24",
|
|
1430
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1412
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(l).type])],
|
|
1431
1413
|
"model-value": unref(l).validityOption,
|
|
1432
|
-
"onUpdate:modelValue": u[4] || (u[4] = (
|
|
1414
|
+
"onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
|
|
1433
1415
|
...unref(l),
|
|
1434
|
-
validityOption:
|
|
1416
|
+
validityOption: V
|
|
1435
1417
|
})
|
|
1436
1418
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1437
1419
|
], 64)) : createCommentVNode("", !0),
|
|
@@ -1439,11 +1421,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1439
1421
|
key: 2,
|
|
1440
1422
|
"reward-image": unref(t),
|
|
1441
1423
|
"model-value": ((E = unref(l)) == null ? void 0 : E.collectibleConfig) ?? void 0,
|
|
1442
|
-
"onUpdate:modelValue": u[5] || (u[5] = (
|
|
1424
|
+
"onUpdate:modelValue": u[5] || (u[5] = (V) => l.value = {
|
|
1443
1425
|
...unref(l),
|
|
1444
|
-
collectibleConfig:
|
|
1426
|
+
collectibleConfig: V
|
|
1445
1427
|
}),
|
|
1446
|
-
"onUpdate:rewardImage": u[6] || (u[6] = (
|
|
1428
|
+
"onUpdate:rewardImage": u[6] || (u[6] = (V) => t.value = V)
|
|
1447
1429
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1448
1430
|
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
1449
1431
|
])) : createCommentVNode("", !0)
|
|
@@ -1477,24 +1459,24 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1477
1459
|
const i = s.safeParse(l.value);
|
|
1478
1460
|
return i.success ? [] : i.error.errors;
|
|
1479
1461
|
}), a = ref();
|
|
1480
|
-
function
|
|
1462
|
+
function p(i, u) {
|
|
1481
1463
|
var f;
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1464
|
+
const c = [...l.value];
|
|
1465
|
+
c[u] = i, (f = a.value) == null || f.showSheet(!1), r("update:model-value", c);
|
|
1484
1466
|
}
|
|
1485
1467
|
function v(i) {
|
|
1486
1468
|
const u = i.type == "VOUCHER" ? i.collectibleConfig : o.collectibles.find(
|
|
1487
1469
|
(k) => k._id.toString() == i.collectible
|
|
1488
|
-
),
|
|
1470
|
+
), c = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), f = i.weight;
|
|
1489
1471
|
return {
|
|
1490
|
-
label: isNullOrEmpty(
|
|
1472
|
+
label: isNullOrEmpty(c) ? "NO REWARD" : c,
|
|
1491
1473
|
sublabel: `${f} (${(f / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
|
|
1492
1474
|
};
|
|
1493
1475
|
}
|
|
1494
1476
|
function m(i) {
|
|
1495
|
-
var
|
|
1477
|
+
var c;
|
|
1496
1478
|
const u = [...l.value];
|
|
1497
|
-
(
|
|
1479
|
+
(c = a.value) == null || c.showSheet(!0, u[i], i);
|
|
1498
1480
|
}
|
|
1499
1481
|
function g(i) {
|
|
1500
1482
|
const u = [...l.value];
|
|
@@ -1513,10 +1495,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1513
1495
|
);
|
|
1514
1496
|
}
|
|
1515
1497
|
return (i, u) => {
|
|
1516
|
-
const
|
|
1498
|
+
const c = resolveComponent("FmButton"), f = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
1517
1499
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1518
1500
|
_hoisted_2$9,
|
|
1519
|
-
createVNode(
|
|
1501
|
+
createVNode(c, {
|
|
1520
1502
|
label: "Add Reward",
|
|
1521
1503
|
onClick: u[0] || (u[0] = (C) => y()),
|
|
1522
1504
|
variant: "plain",
|
|
@@ -1533,7 +1515,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1533
1515
|
createElementVNode("div", _hoisted_3$7, toDisplayString(v(C).label), 1),
|
|
1534
1516
|
createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
|
|
1535
1517
|
]),
|
|
1536
|
-
createVNode(
|
|
1518
|
+
createVNode(c, {
|
|
1537
1519
|
icon: "delete",
|
|
1538
1520
|
variant: "tertiary",
|
|
1539
1521
|
onClick: (x) => (x.stopPropagation(), g(b))
|
|
@@ -1549,7 +1531,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1549
1531
|
createVNode(_sfc_main$b, {
|
|
1550
1532
|
ref_key: "sheetRef",
|
|
1551
1533
|
ref: a,
|
|
1552
|
-
"onUpdate:modelValue":
|
|
1534
|
+
"onUpdate:modelValue": p
|
|
1553
1535
|
}, null, 512)
|
|
1554
1536
|
]);
|
|
1555
1537
|
};
|
|
@@ -1575,7 +1557,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1575
1557
|
]);
|
|
1576
1558
|
return (s, l) => {
|
|
1577
1559
|
var v, m, g;
|
|
1578
|
-
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"),
|
|
1560
|
+
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
|
|
1579
1561
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1580
1562
|
createVNode(t, {
|
|
1581
1563
|
label: "Enable game",
|
|
@@ -1593,8 +1575,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1593
1575
|
"hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != y.value
|
|
1594
1576
|
}]),
|
|
1595
1577
|
onClick: () => {
|
|
1596
|
-
var
|
|
1597
|
-
((
|
|
1578
|
+
var c;
|
|
1579
|
+
((c = n.modelValue) == null ? void 0 : c.gameType) != y.value && r("update:model-value", { gameType: y.value });
|
|
1598
1580
|
},
|
|
1599
1581
|
key: y.value
|
|
1600
1582
|
}, {
|
|
@@ -1606,7 +1588,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1606
1588
|
}, 1032, ["class", "onClick"]);
|
|
1607
1589
|
}), 128))
|
|
1608
1590
|
])) : createCommentVNode("", !0),
|
|
1609
|
-
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(
|
|
1591
|
+
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
|
|
1610
1592
|
key: 1,
|
|
1611
1593
|
text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
|
|
1612
1594
|
state: "warning"
|
|
@@ -1702,21 +1684,21 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1702
1684
|
},
|
|
1703
1685
|
emits: ["update:model-value"],
|
|
1704
1686
|
setup(e, { expose: d, emit: n }) {
|
|
1705
|
-
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(),
|
|
1706
|
-
const
|
|
1707
|
-
return
|
|
1687
|
+
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), p = ref(0), v = FdtoThresholdReward, m = computed(() => {
|
|
1688
|
+
const c = v.safeParse(t.value);
|
|
1689
|
+
return c.success ? [] : c.error.errors;
|
|
1708
1690
|
});
|
|
1709
|
-
function g(
|
|
1710
|
-
|
|
1691
|
+
function g(c, f, k) {
|
|
1692
|
+
c && (t.value = f, p.value = k), l.value = c;
|
|
1711
1693
|
}
|
|
1712
1694
|
const y = n;
|
|
1713
1695
|
async function i() {
|
|
1714
1696
|
console.log(t.value);
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1697
|
+
const c = v.safeParse(t.value);
|
|
1698
|
+
c.success && (await s(
|
|
1717
1699
|
async () => {
|
|
1718
|
-
|
|
1719
|
-
|
|
1700
|
+
c.data.type === "VOUCHER" && a.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1701
|
+
c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
1720
1702
|
a.value
|
|
1721
1703
|
));
|
|
1722
1704
|
},
|
|
@@ -1724,19 +1706,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1724
1706
|
message: "Uploading reward image",
|
|
1725
1707
|
successMessage: "Reward image updated"
|
|
1726
1708
|
}
|
|
1727
|
-
), y("update:model-value",
|
|
1709
|
+
), y("update:model-value", c.data, p.value));
|
|
1728
1710
|
}
|
|
1729
1711
|
const u = ref();
|
|
1730
1712
|
return d({
|
|
1731
1713
|
showSheet: g
|
|
1732
|
-
}), (
|
|
1714
|
+
}), (c, f) => {
|
|
1733
1715
|
const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
|
|
1734
1716
|
return openBlock(), createBlock(E, {
|
|
1735
1717
|
"max-width": 560,
|
|
1736
1718
|
modelValue: unref(l),
|
|
1737
1719
|
"onUpdate:modelValue": [
|
|
1738
|
-
f[10] || (f[10] = (
|
|
1739
|
-
f[11] || (f[11] = (
|
|
1720
|
+
f[10] || (f[10] = (V) => isRef(l) ? l.value = V : null),
|
|
1721
|
+
f[11] || (f[11] = (V) => l.value = V)
|
|
1740
1722
|
],
|
|
1741
1723
|
header: "Edit reward",
|
|
1742
1724
|
"dismiss-away": ""
|
|
@@ -1748,15 +1730,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1748
1730
|
type: "button",
|
|
1749
1731
|
label: "Confirm",
|
|
1750
1732
|
onClick: f[8] || (f[8] = async () => {
|
|
1751
|
-
var
|
|
1752
|
-
return (
|
|
1733
|
+
var V;
|
|
1734
|
+
return (V = unref(u)) == null ? void 0 : V.validateInputs();
|
|
1753
1735
|
})
|
|
1754
1736
|
}),
|
|
1755
1737
|
createVNode(x, {
|
|
1756
1738
|
variant: "secondary",
|
|
1757
1739
|
type: "button",
|
|
1758
1740
|
label: "Cancel",
|
|
1759
|
-
onClick: f[9] || (f[9] = (
|
|
1741
|
+
onClick: f[9] || (f[9] = (V) => l.value = !1)
|
|
1760
1742
|
})
|
|
1761
1743
|
])
|
|
1762
1744
|
]),
|
|
@@ -1766,10 +1748,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1766
1748
|
class: "flex flex-col gap-y-24",
|
|
1767
1749
|
ref_key: "formRef",
|
|
1768
1750
|
ref: u,
|
|
1769
|
-
onValidationSuccess: f[7] || (f[7] = (
|
|
1751
|
+
onValidationSuccess: f[7] || (f[7] = (V) => i())
|
|
1770
1752
|
}, {
|
|
1771
1753
|
default: withCtx(() => {
|
|
1772
|
-
var
|
|
1754
|
+
var V, N;
|
|
1773
1755
|
return [
|
|
1774
1756
|
unref(t).type ? (openBlock(), createBlock(k, {
|
|
1775
1757
|
key: 0,
|
|
@@ -1783,9 +1765,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1783
1765
|
)
|
|
1784
1766
|
],
|
|
1785
1767
|
"model-value": unref(t).threshold,
|
|
1786
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
1768
|
+
"onUpdate:modelValue": f[0] || (f[0] = (h) => t.value = {
|
|
1787
1769
|
...unref(t),
|
|
1788
|
-
threshold:
|
|
1770
|
+
threshold: h
|
|
1789
1771
|
})
|
|
1790
1772
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1791
1773
|
createVNode(C, {
|
|
@@ -1795,9 +1777,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1795
1777
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1796
1778
|
],
|
|
1797
1779
|
"model-value": unref(t).type,
|
|
1798
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
1780
|
+
"onUpdate:modelValue": f[1] || (f[1] = (h) => {
|
|
1799
1781
|
var R, B;
|
|
1800
|
-
|
|
1782
|
+
h === "VOUCHER" ? t.value = {
|
|
1801
1783
|
collectible: null,
|
|
1802
1784
|
type: "VOUCHER",
|
|
1803
1785
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1831,7 +1813,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1831
1813
|
rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
|
|
1832
1814
|
items: unref(o).loyaltyRewards.items,
|
|
1833
1815
|
"model-value": unref(t).collectible,
|
|
1834
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
1816
|
+
"onUpdate:modelValue": f[2] || (f[2] = (h) => unref(t).collectible = h)
|
|
1835
1817
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1836
1818
|
unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1837
1819
|
_hoisted_1$6,
|
|
@@ -1842,24 +1824,24 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1842
1824
|
"error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
|
|
1843
1825
|
"fixed-type": !0,
|
|
1844
1826
|
"model-value": unref(t).earningOption,
|
|
1845
|
-
"onUpdate:modelValue": f[3] || (f[3] = (
|
|
1827
|
+
"onUpdate:modelValue": f[3] || (f[3] = (h) => t.value = {
|
|
1846
1828
|
...unref(t),
|
|
1847
|
-
earningOption:
|
|
1829
|
+
earningOption: h
|
|
1848
1830
|
})
|
|
1849
1831
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1850
1832
|
createVNode(_sfc_main$z, {
|
|
1851
1833
|
class: "!gap-24",
|
|
1852
|
-
"for-credit": unref(t).type === "LOYALTY" && ((
|
|
1853
|
-
(
|
|
1834
|
+
"for-credit": unref(t).type === "LOYALTY" && ((V = unref(o).loyaltyRewards.items.find(
|
|
1835
|
+
(h) => {
|
|
1854
1836
|
var R;
|
|
1855
|
-
return
|
|
1837
|
+
return h.value === ((R = unref(t)) == null ? void 0 : R.collectible);
|
|
1856
1838
|
}
|
|
1857
|
-
)) == null ? void 0 :
|
|
1839
|
+
)) == null ? void 0 : V.raw.type) === "CREDIT",
|
|
1858
1840
|
rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
|
|
1859
1841
|
"model-value": unref(t).validityOption,
|
|
1860
|
-
"onUpdate:modelValue": f[4] || (f[4] = (
|
|
1842
|
+
"onUpdate:modelValue": f[4] || (f[4] = (h) => t.value = {
|
|
1861
1843
|
...unref(t),
|
|
1862
|
-
validityOption:
|
|
1844
|
+
validityOption: h
|
|
1863
1845
|
})
|
|
1864
1846
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1865
1847
|
], 64)) : createCommentVNode("", !0),
|
|
@@ -1867,11 +1849,11 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1867
1849
|
key: 3,
|
|
1868
1850
|
"reward-image": unref(a),
|
|
1869
1851
|
"model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
|
|
1870
|
-
"onUpdate:modelValue": f[5] || (f[5] = (
|
|
1852
|
+
"onUpdate:modelValue": f[5] || (f[5] = (h) => t.value = {
|
|
1871
1853
|
...unref(t),
|
|
1872
|
-
collectibleConfig:
|
|
1854
|
+
collectibleConfig: h
|
|
1873
1855
|
}),
|
|
1874
|
-
"onUpdate:rewardImage": f[6] || (f[6] = (
|
|
1856
|
+
"onUpdate:rewardImage": f[6] || (f[6] = (h) => a.value = h)
|
|
1875
1857
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1876
1858
|
createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
|
|
1877
1859
|
];
|
|
@@ -1911,9 +1893,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1911
1893
|
() => Math.min(r.value / n.value * 100, 100)
|
|
1912
1894
|
), l = (t) => t / n.value * 100;
|
|
1913
1895
|
return (t, a) => {
|
|
1914
|
-
const
|
|
1896
|
+
const p = resolveComponent("FmIcon");
|
|
1915
1897
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1916
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(
|
|
1898
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(p, {
|
|
1917
1899
|
class: normalizeClass(
|
|
1918
1900
|
unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1919
1901
|
),
|
|
@@ -1953,8 +1935,8 @@ function changeKeysFactory(e) {
|
|
|
1953
1935
|
return n.map((l) => d(l, r - 1, o));
|
|
1954
1936
|
const s = Object.create(Object.getPrototypeOf(n));
|
|
1955
1937
|
return Object.keys(n).forEach((l) => {
|
|
1956
|
-
const t = n[l], a = e(l, o),
|
|
1957
|
-
s[a] =
|
|
1938
|
+
const t = n[l], a = e(l, o), p = d(t, r - 1, o);
|
|
1939
|
+
s[a] = p;
|
|
1958
1940
|
}), s;
|
|
1959
1941
|
};
|
|
1960
1942
|
}
|
|
@@ -1973,20 +1955,20 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1973
1955
|
emits: ["update:model-value"],
|
|
1974
1956
|
setup(e, { emit: d }) {
|
|
1975
1957
|
const n = e, r = d, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1976
|
-
() => n.modelValue.sort((u,
|
|
1958
|
+
() => n.modelValue.sort((u, c) => u.threshold - c.threshold) ?? []
|
|
1977
1959
|
), t = computed(() => {
|
|
1978
1960
|
const u = s.safeParse(l.value);
|
|
1979
1961
|
return u.success ? [] : u.error.errors;
|
|
1980
1962
|
}), a = ref();
|
|
1981
|
-
function
|
|
1963
|
+
function p(u, c) {
|
|
1982
1964
|
var k;
|
|
1983
1965
|
const f = [...l.value];
|
|
1984
|
-
f[
|
|
1966
|
+
f[c] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", f);
|
|
1985
1967
|
}
|
|
1986
1968
|
function v(u) {
|
|
1987
|
-
const
|
|
1969
|
+
const c = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
|
|
1988
1970
|
(k) => k._id.toString() == u.collectible
|
|
1989
|
-
), f = CollectionUtils.formattedType((
|
|
1971
|
+
), f = CollectionUtils.formattedType((c == null ? void 0 : c.name) || "");
|
|
1990
1972
|
return {
|
|
1991
1973
|
label: isNullOrEmpty(f) ? "NO REWARD" : f,
|
|
1992
1974
|
sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
|
|
@@ -1994,12 +1976,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1994
1976
|
}
|
|
1995
1977
|
function m(u) {
|
|
1996
1978
|
var f;
|
|
1997
|
-
const
|
|
1998
|
-
(f = a.value) == null || f.showSheet(!0,
|
|
1979
|
+
const c = [...l.value];
|
|
1980
|
+
(f = a.value) == null || f.showSheet(!0, c[u], u);
|
|
1999
1981
|
}
|
|
2000
1982
|
function g(u) {
|
|
2001
|
-
const
|
|
2002
|
-
|
|
1983
|
+
const c = [...l.value];
|
|
1984
|
+
c.splice(u, 1), r("update:model-value", c);
|
|
2003
1985
|
}
|
|
2004
1986
|
function y() {
|
|
2005
1987
|
var u;
|
|
@@ -2021,20 +2003,20 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2021
2003
|
);
|
|
2022
2004
|
}
|
|
2023
2005
|
function i(u) {
|
|
2024
|
-
var
|
|
2025
|
-
return u.type == "VOUCHER" ? (
|
|
2006
|
+
var c, f;
|
|
2007
|
+
return u.type == "VOUCHER" ? (c = u.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
|
|
2026
2008
|
((f = o.loyaltyRewards.items.find(
|
|
2027
2009
|
(k) => k.value == u.collectible
|
|
2028
2010
|
)) == null ? void 0 : f.label) || ""
|
|
2029
2011
|
);
|
|
2030
2012
|
}
|
|
2031
|
-
return (u,
|
|
2013
|
+
return (u, c) => {
|
|
2032
2014
|
const f = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2033
2015
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2034
2016
|
_hoisted_2$3,
|
|
2035
2017
|
createVNode(f, {
|
|
2036
2018
|
label: "Add Reward",
|
|
2037
|
-
onClick:
|
|
2019
|
+
onClick: c[0] || (c[0] = (b) => y()),
|
|
2038
2020
|
variant: "plain",
|
|
2039
2021
|
icon: "add"
|
|
2040
2022
|
}),
|
|
@@ -2089,7 +2071,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2089
2071
|
createVNode(_sfc_main$6, {
|
|
2090
2072
|
ref_key: "sheetRef",
|
|
2091
2073
|
ref: a,
|
|
2092
|
-
"onUpdate:modelValue":
|
|
2074
|
+
"onUpdate:modelValue": p,
|
|
2093
2075
|
"max-threshold": e.mission.end
|
|
2094
2076
|
}, null, 8, ["max-threshold"])
|
|
2095
2077
|
]);
|
|
@@ -2119,7 +2101,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2119
2101
|
]), s = d;
|
|
2120
2102
|
return (l, t) => {
|
|
2121
2103
|
var v;
|
|
2122
|
-
const a = resolveComponent("FmCard"),
|
|
2104
|
+
const a = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
|
|
2123
2105
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2124
2106
|
createElementVNode("div", _hoisted_2$2, [
|
|
2125
2107
|
_hoisted_3$2,
|
|
@@ -2156,7 +2138,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2156
2138
|
createElementVNode("div", _hoisted_8$1, [
|
|
2157
2139
|
_hoisted_9$1,
|
|
2158
2140
|
_hoisted_10$1,
|
|
2159
|
-
createVNode(
|
|
2141
|
+
createVNode(p, {
|
|
2160
2142
|
label: "Maximum to collect",
|
|
2161
2143
|
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
2162
2144
|
"onUpdate:modelValue": t[0] || (t[0] = (m) => {
|
|
@@ -2201,11 +2183,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2201
2183
|
function o(a) {
|
|
2202
2184
|
switch (n.field.type) {
|
|
2203
2185
|
case "timeframe":
|
|
2204
|
-
const
|
|
2186
|
+
const p = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
|
|
2205
2187
|
r("update:model-value", {
|
|
2206
2188
|
type: "timeframe",
|
|
2207
2189
|
property: "__now",
|
|
2208
|
-
start:
|
|
2190
|
+
start: p,
|
|
2209
2191
|
end: v
|
|
2210
2192
|
});
|
|
2211
2193
|
break;
|
|
@@ -2247,8 +2229,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2247
2229
|
labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
|
|
2248
2230
|
zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
|
|
2249
2231
|
}));
|
|
2250
|
-
return (a,
|
|
2251
|
-
var u,
|
|
2232
|
+
return (a, p) => {
|
|
2233
|
+
var u, c, f, k, C;
|
|
2252
2234
|
const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), y = resolveComponent("FmHelperText"), i = resolveComponent("FmSwitch");
|
|
2253
2235
|
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
2254
2236
|
key: 0,
|
|
@@ -2278,7 +2260,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2278
2260
|
"model-value": unref(s),
|
|
2279
2261
|
"onUpdate:modelValue": o,
|
|
2280
2262
|
"show-word-count": "",
|
|
2281
|
-
"max-length": (C = (k = (f = (
|
|
2263
|
+
"max-length": (C = (k = (f = (c = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : c._def) == null ? void 0 : f.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
|
|
2282
2264
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2283
2265
|
key: 3,
|
|
2284
2266
|
"campaign-type": e.extras,
|
|
@@ -2747,24 +2729,24 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2747
2729
|
class: "space-y-24"
|
|
2748
2730
|
}, [
|
|
2749
2731
|
createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
|
|
2750
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (
|
|
2732
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (p, v) => (openBlock(), createElementBlock("div", { key: v }, [
|
|
2751
2733
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2752
2734
|
key: v,
|
|
2753
|
-
field:
|
|
2754
|
-
modelValue: unref(_).get(unref(data),
|
|
2755
|
-
disabled: isDisable(
|
|
2756
|
-
"onUpdate:modelValue": (m) => onUpdateProperty(
|
|
2735
|
+
field: p,
|
|
2736
|
+
modelValue: unref(_).get(unref(data), p.property),
|
|
2737
|
+
disabled: isDisable(p),
|
|
2738
|
+
"onUpdate:modelValue": (m) => onUpdateProperty(p.property, m),
|
|
2757
2739
|
"onUpdate:file": async (m, g) => {
|
|
2758
2740
|
const y = await onUpdateFile(m, g);
|
|
2759
|
-
onUpdateProperty(
|
|
2741
|
+
onUpdateProperty(p.property, y || "");
|
|
2760
2742
|
},
|
|
2761
2743
|
schema: unref(ZodHelper).typeAtPath(
|
|
2762
2744
|
unref(schema),
|
|
2763
|
-
|
|
2745
|
+
p.property,
|
|
2764
2746
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2765
2747
|
),
|
|
2766
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2767
|
-
extras:
|
|
2748
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), p.property),
|
|
2749
|
+
extras: p.extras != null ? p.extras == "" ? unref(data) : unref(_).get(unref(data), p.extras) : void 0
|
|
2768
2750
|
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
|
|
2769
2751
|
]))), 128))
|
|
2770
2752
|
]))), 128)),
|