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