@feedmepos/mf-connect 0.1.0-beta.38 → 0.1.0-beta.39
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-C4_MynWX.js → Analytic-tbjysVoc.js} +10 -10
- package/dist/{App-hlqZyd4R.js → App-Dr-1RLJq.js} +6 -6
- package/dist/{Broadcast-BqqsoThP.js → Broadcast-B2AjNRDr.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-P5nMPF4-.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BPWH_81G.js} +6 -6
- package/dist/{Card-oCKMHTar.js → Card-Z4NVL_6p.js} +14 -14
- package/dist/{Collections-DX_tY8Kf.js → Collections-CXWuYxyi.js} +4 -4
- package/dist/{Credit-BnUOjfjo.js → Credit-BA8yJq-d.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-MHFf8UAD.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D-5xL-yz.js} +155 -144
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DpsYYy14.js → EffectSheet.vue_vue_type_style_index_0_lang-DJxwB9AL.js} +6 -6
- package/dist/{Experience-Dc5Y-lES.js → Experience-3EuEDboG.js} +8 -8
- package/dist/{Game-r_sCITiE.js → Game-1w5OVytz.js} +8 -8
- package/dist/{Index-ppbyBBbU.js → Index-D2yEhrCg.js} +9 -9
- package/dist/{Marketing-MpsjOJXt.js → Marketing-zDiJh4vC.js} +5 -5
- package/dist/{Member-B8NQd2MB.js → Member-HD4Ohjje.js} +4 -4
- package/dist/{MemberList-CYokRc3j.js → MemberList-C3B3Kl5-.js} +23 -23
- package/dist/{MemberTransactions-DM6LBtNR.js → MemberTransactions-D9wN11r2.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BPn30LFE.js → MessageInput.vue_vue_type_script_setup_true_lang-DxLKpHwU.js} +2 -2
- package/dist/{Mission-CveIUM0n.js → Mission-Bbzysfcx.js} +8 -8
- package/dist/{Overview-B53mnhkL.js → Overview-BHc_1kvW.js} +16 -16
- package/dist/{Point-BuKZ_7_s.js → Point-CrYSj4fn.js} +8 -8
- package/dist/{Promotion-Bxeg_jHA.js → Promotion-D6YlAFsM.js} +9 -9
- package/dist/{Record-DGPwDG2x.js → Record-Dhi12eEr.js} +6 -6
- package/dist/{Reward-BIak3ZV2.js → Reward-un0rkJgF.js} +14 -14
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-RCTORBPH.js → RewardGroup.vue_vue_type_script_setup_true_lang-D-oXNVZ8.js} +10 -10
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BzF7Dg58.js → RuleGroup.vue_vue_type_script_setup_true_lang-CKS6bpIL.js} +12 -12
- package/dist/{Segment-CwFGTGmM.js → Segment-C2lDyZ7J.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DWW1BMiA.js → SelectItems.vue_vue_type_script_setup_true_lang-DalyhbAX.js} +2 -2
- package/dist/{Setting-BpU3V7FC.js → Setting-IUor_U9N.js} +8 -8
- package/dist/{Store-BmzQ5J94.js → Store-gVAvas6G.js} +17 -17
- package/dist/{StoreRewards-a4btCX5g.js → StoreRewards-CiZkkVDb.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-IlyXfny9.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DwN05jYx.js} +57 -57
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DhOWGk5q.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Bb2RdXQT.js} +1 -1
- package/dist/{Tier-BHOq6Aqg.js → Tier-8p_S9Lhy.js} +18 -18
- package/dist/{Title-DLESKXyK.js → Title-ChjU7SkB.js} +18 -18
- package/dist/{Transaction-C9dlvQgb.js → Transaction-C_Hrxhig.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-z4d8Q8Jy.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CCB37QTD.js} +6 -6
- package/dist/{Voucher-BTzc3xmh.js → Voucher-cAFBpcCO.js} +11 -11
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BBWktc_y.js → VoucherEditor.vue_vue_type_script_setup_true_lang-csXGZS4a.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D9YPGFAr.js → ZodTextField.vue_vue_type_script_setup_true_lang-6mbnMa53.js} +1 -1
- package/dist/{app-CRn8LdnG.js → app-BPqnKuNH.js} +1 -1
- package/dist/{app-BDUi969b.js → app-w0sMrp4G.js} +28 -28
- package/dist/app.js +1 -1
- package/dist/{business-X8rRPAfz.js → business-BdDm-WRW.js} +1 -1
- package/dist/{campaign-C8KDR1Eb.js → campaign-DcVpiLOT.js} +2 -2
- package/dist/{campaign-FXpP8n18.js → campaign-Dzzafws6.js} +9 -9
- package/dist/{campaign.enum-DpHc_AKY.js → campaign.enum-DR8RNtRc.js} +1 -1
- package/dist/{campaign.fn-CWbQSsaV.js → campaign.fn-CVZ8oLoR.js} +50 -50
- package/dist/{collectible.enum-Bc6yW99E.js → collectible.enum-M_C5hQMS.js} +1 -1
- package/dist/{collection.fn--L45oV4w.js → collection.fn-W8XnCG6t.js} +2 -2
- package/dist/{dto-pirGeUnW.js → dto-BobsXyZ6.js} +4 -4
- package/dist/{effect-YTFtNuVH.js → effect-CJ-Bt8VF.js} +1 -1
- package/dist/{email-addresses-B8bKFPN_.js → email-addresses-DNj0pXxB.js} +1 -1
- package/dist/{export-K8csYP6E.js → export-BhzhO6kk.js} +3 -3
- package/dist/{helper-mK6u9Bg8.js → helper-Xv_E9hJN.js} +1 -1
- package/dist/{index-6IGDKCf8.js → index-BZCORXzl.js} +1 -1
- package/dist/{index-C8mcPqGM.js → index-BiXCmng0.js} +6 -6
- package/dist/{index-CEZb4fna.js → index-CQehMouz.js} +3 -3
- package/dist/{index-DFLG_2P9.js → index-Cdkc17X_.js} +1 -1
- package/dist/{index-DE2MpHut.js → index-CzppmiuE.js} +2 -2
- package/dist/{index-CpxH7mdN.js → index-DtJUPEAo.js} +357 -353
- package/dist/{index-espwcMLv.js → index-HZvdmuOC.js} +1 -1
- package/dist/{index-F-pD5WRJ.js → index-LU3ujsFz.js} +1 -1
- package/dist/{index-C96irFRB.js → index-PnlxBXc-.js} +1 -1
- package/dist/{index-CYHgJwnc.js → index-QKKJ-rlf.js} +3 -3
- package/dist/{index-DP7HXEr9.js → index-SJO-9MLf.js} +1 -1
- package/dist/{index-C8ctZEra.js → index-qH4adrCJ.js} +1 -1
- package/dist/{index.esm2017-BG85b82Z.js → index.esm2017-BzpOVMeX.js} +1 -1
- package/dist/{loading-DNvnRgpP.js → loading-CpPa0n_p.js} +1195 -1195
- package/dist/{membership-Ja85Dtss.js → membership-CqV8o_dS.js} +3 -3
- package/dist/{money-hL_Dsbxu.js → money-DPJRF3TQ.js} +1 -1
- package/dist/{number-CwTwPu4r.js → number-DdUoQwss.js} +1 -1
- package/dist/{objectid-DbcihVwq.js → objectid-kFE2UkK7.js} +7 -7
- package/dist/{reward-1byDPYcc.js → reward-bCt8p8U5.js} +1 -1
- package/dist/{rule-BdWrXdvd.js → rule-8_C4TMt3.js} +3 -3
- package/dist/{rule-builder-i8OVsDJ3.js → rule-builder-BtMjYV62.js} +1 -1
- package/dist/{template-CGMDec1D.js → template-gLjzKe3q.js} +4 -4
- package/dist/{trigger-qTKI0OAW.js → trigger-C_yLCIjw.js} +6 -6
- package/dist/{usePagination-BGkqnwZO.js → usePagination-DuNPCd6d.js} +1 -1
- package/dist/{user-BG8vrTfB.js → user-DJmfEx6T.js} +1 -1
- package/dist/{vue-i18n-DXJ3bXfe.js → vue-i18n-D8EwXDiY.js} +256 -256
- package/package.json +1 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
|
|
2
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { z } from "./app-
|
|
3
|
+
import { z } from "./app-w0sMrp4G.js";
|
|
4
4
|
import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
|
|
5
|
-
import { b as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-
|
|
6
|
-
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-
|
|
7
|
-
import { u as useMembershipStore } from "./membership-
|
|
8
|
-
import { u as useBusinessStore } from "./business-
|
|
9
|
-
import "./index-
|
|
10
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
5
|
+
import { b as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-Dzzafws6.js";
|
|
6
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-BobsXyZ6.js";
|
|
7
|
+
import { u as useMembershipStore } from "./membership-CqV8o_dS.js";
|
|
8
|
+
import { u as useBusinessStore } from "./business-BdDm-WRW.js";
|
|
9
|
+
import "./index-CzppmiuE.js";
|
|
10
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BtMjYV62.js";
|
|
11
11
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
12
12
|
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
13
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
13
|
+
import { f as featureVersionMapping } from "./campaign.enum-DR8RNtRc.js";
|
|
14
14
|
import { _ as _sfc_main$p } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
|
|
15
|
-
import { _ as _sfc_main$n, a as _sfc_main$q, b as _sfc_main$s } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
16
|
-
import { _ as _sfc_main$r } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { _ as _sfc_main$u } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { _ as _sfc_main$k, a as _sfc_main$l } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-
|
|
20
|
-
import { u as useI18n } from "./vue-i18n-
|
|
21
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$v } from "./trigger-
|
|
22
|
-
import { _ as _sfc_main$t } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
24
|
-
import { _ as _sfc_main$m, a as _sfc_main$o } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
25
|
-
import { b as FdoCreditLoyaltyReward, c as FdtoRandomReward, d as F_MISSION_TYPE, e as
|
|
26
|
-
import { T as TEMPLATES } from "./index-
|
|
27
|
-
import "./index-
|
|
28
|
-
import "./index-
|
|
29
|
-
import { F as F_GAME_TYPE } from "./collectible.enum-
|
|
15
|
+
import { _ as _sfc_main$n, a as _sfc_main$q, b as _sfc_main$s } from "./EffectSheet.vue_vue_type_style_index_0_lang-DJxwB9AL.js";
|
|
16
|
+
import { _ as _sfc_main$r } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Bb2RdXQT.js";
|
|
17
|
+
import { _ as _sfc_main$u } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CCB37QTD.js";
|
|
18
|
+
import { _ as _sfc_main$k, a as _sfc_main$l } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CKS6bpIL.js";
|
|
19
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-CpPa0n_p.js";
|
|
20
|
+
import { u as useI18n } from "./vue-i18n-D8EwXDiY.js";
|
|
21
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$v } from "./trigger-C_yLCIjw.js";
|
|
22
|
+
import { _ as _sfc_main$t } from "./MessageInput.vue_vue_type_script_setup_true_lang-DxLKpHwU.js";
|
|
23
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-8_C4TMt3.js";
|
|
24
|
+
import { _ as _sfc_main$m, a as _sfc_main$o } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-csXGZS4a.js";
|
|
25
|
+
import { b as FdoCreditLoyaltyReward, c as FdtoRandomReward, d as F_MISSION_TYPE, e as FdoThresholdCreditReward, f as FdtoThresholdReward, g as FdoMission } from "./index-DtJUPEAo.js";
|
|
26
|
+
import { T as TEMPLATES } from "./index-BiXCmng0.js";
|
|
27
|
+
import "./index-Cdkc17X_.js";
|
|
28
|
+
import "./index-QKKJ-rlf.js";
|
|
29
|
+
import { F as F_GAME_TYPE } from "./collectible.enum-M_C5hQMS.js";
|
|
30
30
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
31
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
32
|
-
import { C as CollectionUtils } from "./collection.fn
|
|
31
|
+
import { i as initCollectibleConfig } from "./helper-Xv_E9hJN.js";
|
|
32
|
+
import { C as CollectionUtils } from "./collection.fn-W8XnCG6t.js";
|
|
33
33
|
import { s as sentenceCase$1 } from "./index-CsaQJMAR.js";
|
|
34
34
|
import { useDialog } from "@feedmepos/ui-library";
|
|
35
|
-
import { u as useCampaignStore } from "./campaign-
|
|
36
|
-
import { S as SvcConfig } from "./index-
|
|
35
|
+
import { u as useCampaignStore } from "./campaign-DcVpiLOT.js";
|
|
36
|
+
import { S as SvcConfig } from "./index-CQehMouz.js";
|
|
37
37
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
38
38
|
const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
39
39
|
__name: "TimeRuleGroup",
|
|
@@ -428,9 +428,9 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
428
428
|
}
|
|
429
429
|
const i = ref(u()), o = ref(!1), l = computed(() => {
|
|
430
430
|
const y = RuleBuilder.getRules(a.modelValue), v = y.find(
|
|
431
|
-
(
|
|
431
|
+
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.date"
|
|
432
432
|
), h = y.find(
|
|
433
|
-
(
|
|
433
|
+
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.time"
|
|
434
434
|
);
|
|
435
435
|
return {
|
|
436
436
|
date: v ? RuleBuilder.simplify(v).equator : null,
|
|
@@ -500,7 +500,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
500
500
|
);
|
|
501
501
|
}
|
|
502
502
|
return (y, v) => {
|
|
503
|
-
const h = resolveComponent("FmButtonGroup"),
|
|
503
|
+
const h = resolveComponent("FmButtonGroup"), f = resolveComponent("FmTimePicker"), r = resolveComponent("FmIcon"), c = resolveComponent("FmTooltip"), p = resolveComponent("FmField"), b = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), C = resolveComponent("FmHelperText");
|
|
504
504
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
505
505
|
createVNode(h, {
|
|
506
506
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
@@ -510,10 +510,10 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
510
510
|
}, null, 8, ["model-value"]),
|
|
511
511
|
createElementVNode("div", _hoisted_1$d, [
|
|
512
512
|
createElementVNode("div", _hoisted_2$a, [
|
|
513
|
-
createVNode(
|
|
513
|
+
createVNode(f, {
|
|
514
514
|
label: "Notify time",
|
|
515
515
|
"model-value": unref(l).time,
|
|
516
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
516
|
+
"onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(l).date, time: B })),
|
|
517
517
|
"helper-text": unref(l).time ? void 0 : "Time is required",
|
|
518
518
|
"helper-state": unref(l).time ? void 0 : "error"
|
|
519
519
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
@@ -537,10 +537,10 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
537
537
|
]),
|
|
538
538
|
createVNode(x, {
|
|
539
539
|
"show-popover": unref(o),
|
|
540
|
-
onPopoverChanged: v[3] || (v[3] = (
|
|
540
|
+
onPopoverChanged: v[3] || (v[3] = (B) => o.value = B)
|
|
541
541
|
}, {
|
|
542
542
|
"popover-button": withCtx(() => [
|
|
543
|
-
createVNode(
|
|
543
|
+
createVNode(p, {
|
|
544
544
|
class: "cursor-pointer",
|
|
545
545
|
"helper-text": unref(l).date ? void 0 : "Date is required",
|
|
546
546
|
"helper-state": unref(l).date ? void 0 : "error"
|
|
@@ -557,8 +557,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
557
557
|
createVNode(_sfc_main$l, {
|
|
558
558
|
"apply-button": !0,
|
|
559
559
|
"model-value": unref(l).date || "",
|
|
560
|
-
onCancel: v[1] || (v[1] = (
|
|
561
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
560
|
+
onCancel: v[1] || (v[1] = (B) => o.value = !1),
|
|
561
|
+
"onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(l).time }), o.value = !1))
|
|
562
562
|
}, null, 8, ["model-value"])
|
|
563
563
|
]),
|
|
564
564
|
_: 1
|
|
@@ -570,12 +570,12 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
570
570
|
key: 1,
|
|
571
571
|
label: "Notify date",
|
|
572
572
|
"model-value": unref(l).date || "",
|
|
573
|
-
"onUpdate:modelValue": v[4] || (v[4] = (
|
|
573
|
+
"onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(l).time })),
|
|
574
574
|
"helper-text": unref(l).date ? void 0 : "Date is required",
|
|
575
575
|
"helper-state": unref(l).date ? void 0 : "error"
|
|
576
576
|
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
577
577
|
]),
|
|
578
|
-
unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(
|
|
578
|
+
unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(C, {
|
|
579
579
|
key: 0,
|
|
580
580
|
text: `${unref(hooks)(unref(n)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(n)).format("dddd, DD MMM YYYY")} at
|
|
581
581
|
${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
|
|
@@ -647,24 +647,24 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
647
647
|
var r;
|
|
648
648
|
return ((r = s.loyaltyRewards.items.find(
|
|
649
649
|
(c) => {
|
|
650
|
-
var
|
|
651
|
-
return c.value === ((
|
|
650
|
+
var p;
|
|
651
|
+
return c.value === ((p = o.value) == null ? void 0 : p.collectible);
|
|
652
652
|
}
|
|
653
653
|
)) == null ? void 0 : r.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
654
654
|
}), g = computed(() => {
|
|
655
|
-
const
|
|
656
|
-
return
|
|
655
|
+
const f = m.value.safeParse(o.value);
|
|
656
|
+
return f.success ? [] : f.error.errors;
|
|
657
657
|
});
|
|
658
|
-
function y(
|
|
659
|
-
|
|
658
|
+
function y(f, r, c) {
|
|
659
|
+
f && (o.value = r, n.value = c), i.value = f;
|
|
660
660
|
}
|
|
661
661
|
const v = a;
|
|
662
662
|
async function h() {
|
|
663
|
-
const
|
|
664
|
-
|
|
663
|
+
const f = m.value.safeParse(o.value);
|
|
664
|
+
f.success && (await u(
|
|
665
665
|
async () => {
|
|
666
|
-
|
|
667
|
-
|
|
666
|
+
f.data.type === "VOUCHER" && l.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
|
|
667
|
+
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
|
|
668
668
|
l.value
|
|
669
669
|
));
|
|
670
670
|
},
|
|
@@ -672,12 +672,12 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
672
672
|
message: "Uploading reward image",
|
|
673
673
|
successMessage: "Reward image updated"
|
|
674
674
|
}
|
|
675
|
-
), v("update:model-value",
|
|
675
|
+
), v("update:model-value", f.data, n.value));
|
|
676
676
|
}
|
|
677
677
|
return d({
|
|
678
678
|
showSheet: y
|
|
679
|
-
}), (
|
|
680
|
-
const c = resolveComponent("FmSelect"),
|
|
679
|
+
}), (f, r) => {
|
|
680
|
+
const c = resolveComponent("FmSelect"), p = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
|
|
681
681
|
return openBlock(), createBlock(x, {
|
|
682
682
|
"max-width": 560,
|
|
683
683
|
modelValue: unref(i),
|
|
@@ -706,7 +706,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
706
706
|
])
|
|
707
707
|
]),
|
|
708
708
|
default: withCtx(() => {
|
|
709
|
-
var k,
|
|
709
|
+
var k, C, B;
|
|
710
710
|
return [
|
|
711
711
|
unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
712
712
|
createVNode(c, {
|
|
@@ -758,7 +758,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
758
758
|
"model-value": unref(o).collectible,
|
|
759
759
|
"onUpdate:modelValue": r[1] || (r[1] = (V) => unref(o).collectible = V)
|
|
760
760
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
761
|
-
createVNode(
|
|
761
|
+
createVNode(p, {
|
|
762
762
|
label: "Weight",
|
|
763
763
|
rules: [unref(ZodHelper).ruleAtPath(unref(m), "weight", [unref(o).type])],
|
|
764
764
|
"model-value": unref(o).weight,
|
|
@@ -792,12 +792,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
792
792
|
], 64)) : createCommentVNode("", !0),
|
|
793
793
|
r[12] || (r[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
794
794
|
createVNode(_sfc_main$n, {
|
|
795
|
-
|
|
795
|
+
type: unref(o).type === "LOYALTY" ? "custom" : "range",
|
|
796
|
+
"for-credit": unref(o).type === "LOYALTY" && ((C = unref(s).loyaltyRewards.items.find(
|
|
796
797
|
(V) => {
|
|
797
798
|
var R;
|
|
798
799
|
return V.value === ((R = unref(o)) == null ? void 0 : R.collectible);
|
|
799
800
|
}
|
|
800
|
-
)) == null ? void 0 :
|
|
801
|
+
)) == null ? void 0 : C.raw.type) === "CREDIT",
|
|
801
802
|
class: "!gap-24",
|
|
802
803
|
rules: [unref(ZodHelper).ruleAtPath(unref(m), "validityOption", [unref(o).type])],
|
|
803
804
|
"model-value": unref(o).validityOption,
|
|
@@ -805,12 +806,12 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$j = /* @__PURE__ */ defi
|
|
|
805
806
|
...unref(o),
|
|
806
807
|
validityOption: V
|
|
807
808
|
})
|
|
808
|
-
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
809
|
+
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
809
810
|
], 64)) : createCommentVNode("", !0),
|
|
810
811
|
unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
811
812
|
key: 2,
|
|
812
813
|
"reward-image": unref(l),
|
|
813
|
-
"model-value": ((
|
|
814
|
+
"model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
|
|
814
815
|
"onUpdate:modelValue": r[5] || (r[5] = (V) => o.value = {
|
|
815
816
|
...unref(o),
|
|
816
817
|
collectibleConfig: V
|
|
@@ -846,35 +847,35 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
846
847
|
emits: ["update:model-value"],
|
|
847
848
|
setup(e, { emit: d }) {
|
|
848
849
|
const a = e, s = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), l = computed(() => {
|
|
849
|
-
const
|
|
850
|
-
return
|
|
850
|
+
const f = i.safeParse(o.value);
|
|
851
|
+
return f.success ? [] : f.error.errors;
|
|
851
852
|
}), n = ref();
|
|
852
|
-
function m(
|
|
853
|
-
var
|
|
853
|
+
function m(f, r) {
|
|
854
|
+
var p;
|
|
854
855
|
const c = [...o.value];
|
|
855
|
-
c[r] =
|
|
856
|
+
c[r] = f, (p = n.value) == null || p.showSheet(!1), s("update:model-value", c);
|
|
856
857
|
}
|
|
857
|
-
function g(
|
|
858
|
-
const r =
|
|
859
|
-
(b) => b._id.toString() ==
|
|
860
|
-
), c = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""),
|
|
858
|
+
function g(f) {
|
|
859
|
+
const r = f.type == "VOUCHER" ? f.collectibleConfig : u.collectibles.find(
|
|
860
|
+
(b) => b._id.toString() == f.collectible
|
|
861
|
+
), c = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), p = f.weight;
|
|
861
862
|
return {
|
|
862
863
|
label: isNullOrEmpty(c) ? "NO REWARD" : c,
|
|
863
|
-
sublabel: `${
|
|
864
|
+
sublabel: `${p} (${(p / o.value.reduce((b, x) => b + x.weight, 0) * 100).toFixed(2)}%)`
|
|
864
865
|
};
|
|
865
866
|
}
|
|
866
|
-
function y(
|
|
867
|
+
function y(f) {
|
|
867
868
|
var c;
|
|
868
869
|
const r = [...o.value];
|
|
869
|
-
(c = n.value) == null || c.showSheet(!0, r[
|
|
870
|
+
(c = n.value) == null || c.showSheet(!0, r[f], f);
|
|
870
871
|
}
|
|
871
|
-
function v(
|
|
872
|
+
function v(f) {
|
|
872
873
|
const r = [...o.value];
|
|
873
|
-
r.splice(
|
|
874
|
+
r.splice(f, 1), s("update:model-value", r);
|
|
874
875
|
}
|
|
875
876
|
function h() {
|
|
876
|
-
var
|
|
877
|
-
(
|
|
877
|
+
var f;
|
|
878
|
+
(f = n.value) == null || f.showSheet(
|
|
878
879
|
!0,
|
|
879
880
|
{
|
|
880
881
|
type: "NO_REWARD",
|
|
@@ -884,8 +885,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
884
885
|
o.value.length
|
|
885
886
|
);
|
|
886
887
|
}
|
|
887
|
-
return (
|
|
888
|
-
const c = resolveComponent("FmButton"),
|
|
888
|
+
return (f, r) => {
|
|
889
|
+
const c = resolveComponent("FmButton"), p = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
889
890
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
890
891
|
r[1] || (r[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1)),
|
|
891
892
|
createVNode(c, {
|
|
@@ -894,23 +895,23 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
894
895
|
variant: "plain",
|
|
895
896
|
icon: "add"
|
|
896
897
|
}),
|
|
897
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (x, k) => (openBlock(), createBlock(
|
|
898
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (x, k) => (openBlock(), createBlock(p, {
|
|
898
899
|
key: k,
|
|
899
900
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
900
901
|
variant: "outlined",
|
|
901
|
-
onClick: (
|
|
902
|
+
onClick: (C) => y(k)
|
|
902
903
|
}, {
|
|
903
904
|
default: withCtx(() => {
|
|
904
|
-
var
|
|
905
|
+
var C;
|
|
905
906
|
return [
|
|
906
907
|
createElementVNode("div", null, [
|
|
907
|
-
createElementVNode("div", _hoisted_2$7, toDisplayString(x.type == "LOYALTY" ? (
|
|
908
|
+
createElementVNode("div", _hoisted_2$7, toDisplayString(x.type == "LOYALTY" ? (C = x == null ? void 0 : x.earningOption) == null ? void 0 : C.amount : "") + " " + toDisplayString(g(x).label), 1),
|
|
908
909
|
createElementVNode("div", _hoisted_3$6, toDisplayString(g(x).sublabel), 1)
|
|
909
910
|
]),
|
|
910
911
|
createVNode(c, {
|
|
911
912
|
icon: "delete",
|
|
912
913
|
variant: "tertiary",
|
|
913
|
-
onClick: (
|
|
914
|
+
onClick: (B) => (B.stopPropagation(), v(k))
|
|
914
915
|
}, null, 8, ["onClick"])
|
|
915
916
|
];
|
|
916
917
|
}),
|
|
@@ -959,12 +960,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
959
960
|
}, null, 8, ["model-value"]),
|
|
960
961
|
((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
961
962
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h) => {
|
|
962
|
-
var
|
|
963
|
+
var f, r;
|
|
963
964
|
return openBlock(), createBlock(n, {
|
|
964
965
|
variant: "outlined",
|
|
965
966
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
966
967
|
"col-span-2": unref(u).length == 1,
|
|
967
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
968
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((f = e.modelValue) == null ? void 0 : f.gameType) == h.value,
|
|
968
969
|
"hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != h.value
|
|
969
970
|
}]),
|
|
970
971
|
onClick: () => {
|
|
@@ -1077,17 +1078,24 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1077
1078
|
},
|
|
1078
1079
|
emits: ["update:model-value"],
|
|
1079
1080
|
setup(e, { expose: d, emit: a }) {
|
|
1080
|
-
const s = e, u = useMembershipStore(), { minor: i } = useLoading, o = ref(!1), l = ref(), n = ref(), m = ref(0), g =
|
|
1081
|
-
|
|
1081
|
+
const s = e, u = useMembershipStore(), { minor: i } = useLoading, o = ref(!1), l = ref(), n = ref(), m = ref(0), g = computed(() => {
|
|
1082
|
+
var p;
|
|
1083
|
+
return ((p = u.loyaltyRewards.items.find(
|
|
1084
|
+
(b) => {
|
|
1085
|
+
var x;
|
|
1086
|
+
return b.value === ((x = l.value) == null ? void 0 : x.collectible);
|
|
1087
|
+
}
|
|
1088
|
+
)) == null ? void 0 : p.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1089
|
+
}), y = computed(() => {
|
|
1090
|
+
const c = g.value.safeParse(l.value);
|
|
1082
1091
|
return c.success ? [] : c.error.errors;
|
|
1083
1092
|
});
|
|
1084
|
-
function v(c,
|
|
1085
|
-
c && (l.value =
|
|
1093
|
+
function v(c, p, b) {
|
|
1094
|
+
c && (l.value = p, m.value = b), o.value = c;
|
|
1086
1095
|
}
|
|
1087
1096
|
const h = a;
|
|
1088
|
-
async function
|
|
1089
|
-
|
|
1090
|
-
const c = g.safeParse(l.value);
|
|
1097
|
+
async function f() {
|
|
1098
|
+
const c = g.value.safeParse(l.value);
|
|
1091
1099
|
c.success && (await i(
|
|
1092
1100
|
async () => {
|
|
1093
1101
|
c.data.type === "VOUCHER" && n.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
|
|
@@ -1104,44 +1112,46 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1104
1112
|
const r = ref();
|
|
1105
1113
|
return d({
|
|
1106
1114
|
showSheet: v
|
|
1107
|
-
}), (c,
|
|
1108
|
-
const b = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), k = resolveComponent("FmForm"),
|
|
1109
|
-
return openBlock(), createBlock(
|
|
1115
|
+
}), (c, p) => {
|
|
1116
|
+
const b = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), C = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1117
|
+
return openBlock(), createBlock(B, {
|
|
1110
1118
|
"max-width": 560,
|
|
1111
1119
|
modelValue: unref(o),
|
|
1112
1120
|
"onUpdate:modelValue": [
|
|
1113
|
-
|
|
1114
|
-
|
|
1121
|
+
p[10] || (p[10] = (V) => isRef(o) ? o.value = V : null),
|
|
1122
|
+
p[11] || (p[11] = (V) => o.value = V)
|
|
1115
1123
|
],
|
|
1116
1124
|
header: "Edit reward",
|
|
1117
1125
|
"dismiss-away": ""
|
|
1118
1126
|
}, {
|
|
1119
1127
|
"side-sheet-footer": withCtx(() => [
|
|
1120
1128
|
createElementVNode("div", _hoisted_1$6, [
|
|
1121
|
-
createVNode(
|
|
1129
|
+
createVNode(C, {
|
|
1122
1130
|
variant: "primary",
|
|
1123
1131
|
type: "button",
|
|
1124
1132
|
label: "Confirm",
|
|
1125
|
-
|
|
1133
|
+
disabled: unref(y).length > 0,
|
|
1134
|
+
onClick: p[8] || (p[8] = async () => {
|
|
1126
1135
|
var V;
|
|
1127
1136
|
return (V = unref(r)) == null ? void 0 : V.validateInputs();
|
|
1128
1137
|
})
|
|
1129
|
-
}),
|
|
1130
|
-
createVNode(
|
|
1138
|
+
}, null, 8, ["disabled"]),
|
|
1139
|
+
createVNode(C, {
|
|
1131
1140
|
variant: "secondary",
|
|
1132
1141
|
type: "button",
|
|
1133
1142
|
label: "Cancel",
|
|
1134
|
-
onClick:
|
|
1143
|
+
onClick: p[9] || (p[9] = (V) => o.value = !1)
|
|
1135
1144
|
})
|
|
1136
1145
|
])
|
|
1137
1146
|
]),
|
|
1138
1147
|
default: withCtx(() => [
|
|
1148
|
+
createVNode(JsonViewer, { json: unref(l) }, null, 8, ["json"]),
|
|
1139
1149
|
unref(l) ? (openBlock(), createBlock(k, {
|
|
1140
1150
|
key: 0,
|
|
1141
1151
|
class: "flex flex-col gap-y-24",
|
|
1142
1152
|
ref_key: "formRef",
|
|
1143
1153
|
ref: r,
|
|
1144
|
-
onValidationSuccess:
|
|
1154
|
+
onValidationSuccess: p[7] || (p[7] = (V) => f())
|
|
1145
1155
|
}, {
|
|
1146
1156
|
default: withCtx(() => {
|
|
1147
1157
|
var V, R;
|
|
@@ -1158,7 +1168,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1158
1168
|
)
|
|
1159
1169
|
],
|
|
1160
1170
|
"model-value": unref(l).threshold,
|
|
1161
|
-
"onUpdate:modelValue":
|
|
1171
|
+
"onUpdate:modelValue": p[0] || (p[0] = (E) => l.value = {
|
|
1162
1172
|
...unref(l),
|
|
1163
1173
|
threshold: E
|
|
1164
1174
|
})
|
|
@@ -1170,7 +1180,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1170
1180
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1171
1181
|
],
|
|
1172
1182
|
"model-value": unref(l).type,
|
|
1173
|
-
"onUpdate:modelValue":
|
|
1183
|
+
"onUpdate:modelValue": p[1] || (p[1] = (E) => {
|
|
1174
1184
|
var S, w;
|
|
1175
1185
|
E === "VOUCHER" ? l.value = {
|
|
1176
1186
|
collectible: null,
|
|
@@ -1206,10 +1216,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1206
1216
|
rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(l).type])],
|
|
1207
1217
|
items: unref(u).loyaltyRewards.items,
|
|
1208
1218
|
"model-value": unref(l).collectible,
|
|
1209
|
-
"onUpdate:modelValue":
|
|
1219
|
+
"onUpdate:modelValue": p[2] || (p[2] = (E) => unref(l).collectible = E)
|
|
1210
1220
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1211
1221
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1212
|
-
|
|
1222
|
+
p[12] || (p[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
1213
1223
|
createVNode(_sfc_main$m, {
|
|
1214
1224
|
class: "mt-[-8px]",
|
|
1215
1225
|
rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(l).type])],
|
|
@@ -1217,13 +1227,14 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1217
1227
|
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
1218
1228
|
"fixed-type": !0,
|
|
1219
1229
|
"model-value": unref(l).earningOption,
|
|
1220
|
-
"onUpdate:modelValue":
|
|
1230
|
+
"onUpdate:modelValue": p[3] || (p[3] = (E) => l.value = {
|
|
1221
1231
|
...unref(l),
|
|
1222
1232
|
earningOption: E
|
|
1223
1233
|
})
|
|
1224
1234
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1225
1235
|
createVNode(_sfc_main$n, {
|
|
1226
1236
|
class: "!gap-24",
|
|
1237
|
+
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1227
1238
|
"for-credit": unref(l).type === "LOYALTY" && ((V = unref(u).loyaltyRewards.items.find(
|
|
1228
1239
|
(E) => {
|
|
1229
1240
|
var S;
|
|
@@ -1232,21 +1243,21 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1232
1243
|
)) == null ? void 0 : V.raw.type) === "CREDIT",
|
|
1233
1244
|
rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(l).type])],
|
|
1234
1245
|
"model-value": unref(l).validityOption,
|
|
1235
|
-
"onUpdate:modelValue":
|
|
1246
|
+
"onUpdate:modelValue": p[4] || (p[4] = (E) => l.value = {
|
|
1236
1247
|
...unref(l),
|
|
1237
1248
|
validityOption: E
|
|
1238
1249
|
})
|
|
1239
|
-
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1250
|
+
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1240
1251
|
], 64)) : createCommentVNode("", !0),
|
|
1241
1252
|
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1242
1253
|
key: 3,
|
|
1243
1254
|
"reward-image": unref(n),
|
|
1244
1255
|
"model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
1245
|
-
"onUpdate:modelValue":
|
|
1256
|
+
"onUpdate:modelValue": p[5] || (p[5] = (E) => l.value = {
|
|
1246
1257
|
...unref(l),
|
|
1247
1258
|
collectibleConfig: E
|
|
1248
1259
|
}),
|
|
1249
|
-
"onUpdate:rewardImage":
|
|
1260
|
+
"onUpdate:rewardImage": p[6] || (p[6] = (E) => n.value = E)
|
|
1250
1261
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1251
1262
|
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
1252
1263
|
];
|
|
@@ -1355,22 +1366,22 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1355
1366
|
}), n = ref();
|
|
1356
1367
|
function m(r, c) {
|
|
1357
1368
|
var b;
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1369
|
+
const p = [...o.value];
|
|
1370
|
+
p[c] = r, (b = n.value) == null || b.showSheet(!1), s("update:model-value", p);
|
|
1360
1371
|
}
|
|
1361
1372
|
function g(r) {
|
|
1362
1373
|
const c = r.type == "VOUCHER" ? r.collectibleConfig : u.collectibles.find(
|
|
1363
1374
|
(b) => b._id.toString() == r.collectible
|
|
1364
|
-
),
|
|
1375
|
+
), p = CollectionUtils.formattedType((c == null ? void 0 : c.name) || "");
|
|
1365
1376
|
return {
|
|
1366
|
-
label: isNullOrEmpty(
|
|
1377
|
+
label: isNullOrEmpty(p) ? "NO REWARD" : p,
|
|
1367
1378
|
sublabel: `Reward at ${r.threshold} | Amount: ${r.earningOption.type == "FIXED" ? r.earningOption.amount : `${r.earningOption.amount} for every RM${r.earningOption.every} spent`} `
|
|
1368
1379
|
};
|
|
1369
1380
|
}
|
|
1370
1381
|
function y(r) {
|
|
1371
|
-
var
|
|
1382
|
+
var p;
|
|
1372
1383
|
const c = [...o.value];
|
|
1373
|
-
(
|
|
1384
|
+
(p = n.value) == null || p.showSheet(!0, c[r], r);
|
|
1374
1385
|
}
|
|
1375
1386
|
function v(r) {
|
|
1376
1387
|
const c = [...o.value];
|
|
@@ -1395,39 +1406,39 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1395
1406
|
o.value.length
|
|
1396
1407
|
);
|
|
1397
1408
|
}
|
|
1398
|
-
function
|
|
1399
|
-
var c,
|
|
1409
|
+
function f(r) {
|
|
1410
|
+
var c, p;
|
|
1400
1411
|
return r.type == "VOUCHER" ? (c = r.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
|
|
1401
|
-
((
|
|
1412
|
+
((p = u.loyaltyRewards.items.find(
|
|
1402
1413
|
(b) => b.value == r.collectible
|
|
1403
|
-
)) == null ? void 0 :
|
|
1414
|
+
)) == null ? void 0 : p.label) || ""
|
|
1404
1415
|
);
|
|
1405
1416
|
}
|
|
1406
1417
|
return (r, c) => {
|
|
1407
|
-
const
|
|
1418
|
+
const p = resolveComponent("FmButton"), b = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
|
|
1408
1419
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1409
1420
|
c[2] || (c[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
|
|
1410
|
-
createVNode(
|
|
1421
|
+
createVNode(p, {
|
|
1411
1422
|
label: "Add Reward",
|
|
1412
1423
|
onClick: c[0] || (c[0] = (k) => h()),
|
|
1413
1424
|
variant: "plain",
|
|
1414
1425
|
icon: "add"
|
|
1415
1426
|
}),
|
|
1416
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (k,
|
|
1417
|
-
key:
|
|
1427
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (k, C) => (openBlock(), createBlock(b, {
|
|
1428
|
+
key: C,
|
|
1418
1429
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1419
1430
|
variant: "outlined",
|
|
1420
|
-
onClick: (
|
|
1431
|
+
onClick: (B) => y(C)
|
|
1421
1432
|
}, {
|
|
1422
1433
|
default: withCtx(() => [
|
|
1423
1434
|
createElementVNode("div", null, [
|
|
1424
1435
|
createElementVNode("div", _hoisted_2$3, toDisplayString(g(k).label), 1),
|
|
1425
1436
|
createElementVNode("div", _hoisted_3$3, toDisplayString(g(k).sublabel), 1)
|
|
1426
1437
|
]),
|
|
1427
|
-
createVNode(
|
|
1438
|
+
createVNode(p, {
|
|
1428
1439
|
icon: "delete",
|
|
1429
1440
|
variant: "tertiary",
|
|
1430
|
-
onClick: (
|
|
1441
|
+
onClick: (B) => (B.stopPropagation(), v(C))
|
|
1431
1442
|
}, null, 8, ["onClick"])
|
|
1432
1443
|
]),
|
|
1433
1444
|
_: 2
|
|
@@ -1444,11 +1455,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1444
1455
|
class: "p-24 space-y-16 w-fit"
|
|
1445
1456
|
}, {
|
|
1446
1457
|
default: withCtx(() => {
|
|
1447
|
-
var k,
|
|
1458
|
+
var k, C;
|
|
1448
1459
|
return [
|
|
1449
1460
|
createElementVNode("div", _hoisted_4$2, [
|
|
1450
1461
|
createElementVNode("div", null, [
|
|
1451
|
-
createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((k = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : k.earningOption.amount) > 1 ? (
|
|
1462
|
+
createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((k = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : k.earningOption.amount) > 1 ? (C = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : C.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? f(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
1452
1463
|
c[1] || (c[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
|
|
1453
1464
|
])
|
|
1454
1465
|
]),
|
|
@@ -1457,7 +1468,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1457
1468
|
type: e.mission.type,
|
|
1458
1469
|
"max-range": e.mission.end,
|
|
1459
1470
|
currentRange: e.mission.end / 4,
|
|
1460
|
-
markers: e.modelValue.map((
|
|
1471
|
+
markers: e.modelValue.map((B) => B.threshold)
|
|
1461
1472
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
1462
1473
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
1463
1474
|
])
|
|
@@ -1514,8 +1525,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1514
1525
|
"hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != y.value
|
|
1515
1526
|
}]),
|
|
1516
1527
|
onClick: () => {
|
|
1517
|
-
var
|
|
1518
|
-
((
|
|
1528
|
+
var f, r;
|
|
1529
|
+
((f = e.modelValue) == null ? void 0 : f.type) != y.value && i("update:model-value", {
|
|
1519
1530
|
...e.modelValue,
|
|
1520
1531
|
type: y.value,
|
|
1521
1532
|
end: ((r = e.modelValue) == null ? void 0 : r.end) || 1
|
|
@@ -1627,8 +1638,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1627
1638
|
zodLabel: s.schema ? ZodHelper.toInputLabel(s.schema, s.field.label) : void 0
|
|
1628
1639
|
}));
|
|
1629
1640
|
return (m, g) => {
|
|
1630
|
-
var c,
|
|
1631
|
-
const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"),
|
|
1641
|
+
var c, p, b, x, k;
|
|
1642
|
+
const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
|
|
1632
1643
|
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
1633
1644
|
key: 0,
|
|
1634
1645
|
label: unref(a)(e.field.label),
|
|
@@ -1659,7 +1670,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1659
1670
|
"model-value": unref(o),
|
|
1660
1671
|
"onUpdate:modelValue": i,
|
|
1661
1672
|
"show-word-count": "",
|
|
1662
|
-
"max-length": (k = (x = (b = (
|
|
1673
|
+
"max-length": (k = (x = (b = (p = (c = unref(n)) == null ? void 0 : c.unwrapped) == null ? void 0 : p._def) == null ? void 0 : b.checks) == null ? void 0 : x.find((C) => C.kind == "max")) == null ? void 0 : k.value
|
|
1663
1674
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
1664
1675
|
key: 3,
|
|
1665
1676
|
"campaign-type": e.extras,
|
|
@@ -1671,7 +1682,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1671
1682
|
"model-value": unref(o),
|
|
1672
1683
|
"onUpdate:modelValue": i
|
|
1673
1684
|
}, null, 8, ["model-value"]),
|
|
1674
|
-
createVNode(
|
|
1685
|
+
createVNode(f, {
|
|
1675
1686
|
class: "!mt-[8px]",
|
|
1676
1687
|
text: unref(ZodHelper).helperText(l(), ""),
|
|
1677
1688
|
state: unref(ZodHelper).helperState(l(), "")
|
|
@@ -1713,7 +1724,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1713
1724
|
"onUpdate:modelValue": i,
|
|
1714
1725
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
1715
1726
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
1716
|
-
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
1727
|
+
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(f, {
|
|
1717
1728
|
key: 0,
|
|
1718
1729
|
class: "!mt-[8px]",
|
|
1719
1730
|
text: unref(a)("connect.campaign.common.effect_required"),
|
|
@@ -1773,7 +1784,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1773
1784
|
"start-date": e.extras.start,
|
|
1774
1785
|
"end-date": e.extras.end
|
|
1775
1786
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
1776
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1787
|
+
e.helperText ? (openBlock(), createBlock(f, {
|
|
1777
1788
|
key: 0,
|
|
1778
1789
|
class: "!mt-[8px]",
|
|
1779
1790
|
text: e.helperText,
|
|
@@ -1784,14 +1795,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1784
1795
|
"model-value": unref(o),
|
|
1785
1796
|
"onUpdate:modelValue": i
|
|
1786
1797
|
}, null, 8, ["model-value"]),
|
|
1787
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1798
|
+
e.helperText ? (openBlock(), createBlock(f, {
|
|
1788
1799
|
key: 0,
|
|
1789
1800
|
class: "!mt-[8px]",
|
|
1790
1801
|
text: e.helperText,
|
|
1791
1802
|
state: "error"
|
|
1792
1803
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1793
1804
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
1794
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
1805
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(f, {
|
|
1795
1806
|
key: 0,
|
|
1796
1807
|
state: "warning",
|
|
1797
1808
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
@@ -1800,7 +1811,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1800
1811
|
"model-value": unref(o),
|
|
1801
1812
|
"onUpdate:modelValue": i
|
|
1802
1813
|
}, null, 8, ["model-value"]),
|
|
1803
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1814
|
+
e.helperText ? (openBlock(), createBlock(f, {
|
|
1804
1815
|
key: 1,
|
|
1805
1816
|
class: "!mt-[8px]",
|
|
1806
1817
|
text: e.helperText,
|
|
@@ -1811,7 +1822,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1811
1822
|
"model-value": unref(o),
|
|
1812
1823
|
"onUpdate:modelValue": i
|
|
1813
1824
|
}, null, 8, ["model-value"]),
|
|
1814
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1825
|
+
e.helperText ? (openBlock(), createBlock(f, {
|
|
1815
1826
|
key: 0,
|
|
1816
1827
|
class: "!mt-[8px]",
|
|
1817
1828
|
text: e.helperText,
|
|
@@ -1822,7 +1833,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1822
1833
|
"model-value": unref(o),
|
|
1823
1834
|
"onUpdate:modelValue": i
|
|
1824
1835
|
}, null, 8, ["model-value"]),
|
|
1825
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1836
|
+
e.helperText ? (openBlock(), createBlock(f, {
|
|
1826
1837
|
key: 0,
|
|
1827
1838
|
class: "!mt-[8px]",
|
|
1828
1839
|
text: e.helperText,
|
|
@@ -1833,7 +1844,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1833
1844
|
"model-value": unref(o),
|
|
1834
1845
|
"onUpdate:modelValue": i
|
|
1835
1846
|
}, null, 8, ["model-value"]),
|
|
1836
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1847
|
+
e.helperText ? (openBlock(), createBlock(f, {
|
|
1837
1848
|
key: 0,
|
|
1838
1849
|
class: "!mt-[8px]",
|
|
1839
1850
|
text: e.helperText,
|
|
@@ -1844,7 +1855,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1844
1855
|
"model-value": unref(o),
|
|
1845
1856
|
"onUpdate:modelValue": i
|
|
1846
1857
|
}, null, 8, ["model-value"]),
|
|
1847
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1858
|
+
e.helperText ? (openBlock(), createBlock(f, {
|
|
1848
1859
|
key: 0,
|
|
1849
1860
|
class: "!mt-[8px]",
|
|
1850
1861
|
text: e.helperText,
|