@feedmepos/mf-connect 0.0.19-prod → 0.0.21-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 (60) hide show
  1. package/dist/{Analytic-Ch5vd0M4.js → Analytic-C6F4G25g.js} +8 -8
  2. package/dist/{Broadcast-3I89gcxD.js → Broadcast-DO2VP__g.js} +7 -7
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CXjLvOFM.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0aQTASM.js} +8 -8
  4. package/dist/{Card-BEJ03OCX.js → Card-DZyOKMh6.js} +67 -67
  5. package/dist/{Collections-DOvO-cyf.js → Collections-DLyCIlvd.js} +6 -6
  6. package/dist/{Credit-CS_f8MWQ.js → Credit-DRdsjXky.js} +7 -7
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-4EqJZVlT.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-733A3xAJ.js} +321 -328
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CEf5oXj2.js → EffectSheet.vue_vue_type_style_index_0_lang-CvtX7ULa.js} +5 -5
  9. package/dist/{Experience-BMRDA9az.js → Experience-D33O1vby.js} +7 -7
  10. package/dist/{Game-jajGoiRD.js → Game-BrYvnjMK.js} +7 -7
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D1HZobOu.js → ImageInput.vue_vue_type_script_setup_true_lang-Dby96cpu.js} +1 -1
  12. package/dist/{MainLayout-B2So6_3h.js → MainLayout-Cex8qsGf.js} +1 -1
  13. package/dist/{Marketing-B7ep8HRJ.js → Marketing-6ATQUGoF.js} +4 -4
  14. package/dist/{Member-dh5AwXCY.js → Member-CCIVIzDM.js} +2 -2
  15. package/dist/{MemberList-BG8RU-_z.js → MemberList-Cs0LD8gi.js} +11 -11
  16. package/dist/{MemberTransactions-CQVgmcp5.js → MemberTransactions-CLE7hYWY.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CEdItTM7.js → MessageInput.vue_vue_type_script_setup_true_lang-DcKMh_2f.js} +2 -2
  18. package/dist/{Mission-BRHhSI6-.js → Mission-BHI8zTMK.js} +7 -7
  19. package/dist/{Point-Ckemk8sq.js → Point-CHxmW_O8.js} +7 -7
  20. package/dist/{Promotion-BZLQARR5.js → Promotion-C8CqdNGj.js} +8 -8
  21. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D0qw6tOD.js → RuleGroup.vue_vue_type_script_setup_true_lang-C9C8o4ON.js} +13 -13
  22. package/dist/{Segment-DNuB8-_e.js → Segment-CvNLrjIH.js} +9 -9
  23. package/dist/{Setting-CSHcFTQc.js → Setting-oXiZZAub.js} +8 -8
  24. package/dist/{Store-BOqFpaYd.js → Store-WLcxJNzp.js} +11 -11
  25. package/dist/{StoreRewards-BNxVa94v.js → StoreRewards-CMrnEHsB.js} +138 -145
  26. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CKZJmSBk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-bgEBVCXH.js} +6 -6
  27. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DTfuVmSz.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-B6gZzsja.js} +1 -1
  28. package/dist/{Tier-pYkfcAIL.js → Tier-BwXb3Pk1.js} +16 -16
  29. package/dist/{Title-L7b7bGBO.js → Title-BOyT9mEy.js} +15 -15
  30. package/dist/{Transaction-BYb73ORt.js → Transaction-wwnoXk9w.js} +1 -1
  31. package/dist/{Voucher-DjGB0Ajs.js → Voucher-BbpSPfL0.js} +9 -9
  32. package/dist/{app-CYp3yPPw.js → app-Bw4vX2Xq.js} +1 -1
  33. package/dist/{app-vzsH1VQf.js → app-CzpQo8NQ.js} +34 -34
  34. package/dist/app.js +1 -1
  35. package/dist/{campaign-Byj6dpxX.js → campaign-BAxYqkWK.js} +2 -2
  36. package/dist/{dto-CVEezNuM.js → dto-CwGNrCVP.js} +8 -8
  37. package/dist/{effect-ueqMoqiZ.js → effect-OIGvEMnu.js} +1 -1
  38. package/dist/{export-B1vfJQ_D.js → export-pnyF_Nqa.js} +3 -3
  39. package/dist/{helper-DeFgiHSS.js → helper-1r9zsTyt.js} +1 -1
  40. package/dist/{index-B-FWvOVj.js → index-6xeKaiuc.js} +1 -1
  41. package/dist/{index-m6PFUpwd.js → index-AeZIrHi3.js} +2 -2
  42. package/dist/{index-BehSlDVX.js → index-BULhetR6.js} +1 -1
  43. package/dist/{index-C-RRKtNp.js → index-C33oGCbQ.js} +5 -5
  44. package/dist/{index-Cwmk_EmE.js → index-C9XT87dh.js} +5 -5
  45. package/dist/{index-BqH31bb7.js → index-CFW6MW-j.js} +2 -2
  46. package/dist/{index-DdEBZ4p_.js → index-COXwd1ca.js} +3 -3
  47. package/dist/{index-BrA2zACe.js → index-DdgrIdtX.js} +2 -2
  48. package/dist/{index-B5m-noV5.js → index-Shw3boHM.js} +1 -1
  49. package/dist/{index-D4MN0F2_.js → index-s63kYMDU.js} +1 -1
  50. package/dist/{loading-C7UDAIcq.js → loading-D7uTV0-9.js} +4 -4
  51. package/dist/{lodash-Cc-nE72h.js → lodash-O836mjN1.js} +1 -1
  52. package/dist/{membership-D-jW62pj.js → membership-BRlmOhUi.js} +3 -3
  53. package/dist/{money-gDtjN552.js → money-BdNZ4vMR.js} +1 -1
  54. package/dist/{number-Cg9DyGBY.js → number-CNiMHNNi.js} +1 -1
  55. package/dist/{rule-BVqVI-WL.js → rule-2GUvtk01.js} +2 -2
  56. package/dist/{rule-builder-o8Axr-t4.js → rule-builder-B3FwMkHG.js} +1 -1
  57. package/dist/{template-ARPGA10Y.js → template-COZoDCgl.js} +5 -5
  58. package/dist/{usePagination-DTsDtrYI.js → usePagination-CwZ7gv3m.js} +1 -1
  59. package/dist/{xlsx-DHfAWgSM.js → xlsx-B2_kvHAq.js} +1 -1
  60. package/package.json +1 -1
@@ -1,27 +1,27 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
2
- import { _ } from "./lodash-Cc-nE72h.js";
3
- import { b as useBusinessStore, a as core, J as JsonViewer, z, S as SvcConfig } from "./app-vzsH1VQf.js";
2
+ import { _ } from "./lodash-O836mjN1.js";
3
+ import { b as useBusinessStore, a as core, J as JsonViewer, z, S as SvcConfig } from "./app-CzpQo8NQ.js";
4
4
  import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
5
- import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-CVEezNuM.js";
6
- import { u as useMembershipStore, C as CollectibleOptions } from "./membership-D-jW62pj.js";
7
- import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-BrA2zACe.js";
8
- import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-o8Axr-t4.js";
5
+ import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-CwGNrCVP.js";
6
+ import { u as useMembershipStore, C as CollectibleOptions } from "./membership-BRlmOhUi.js";
7
+ import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-DdgrIdtX.js";
8
+ import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-B3FwMkHG.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-Cwmk_EmE.js";
11
- import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1HZobOu.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-CEf5oXj2.js";
13
- import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DTfuVmSz.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-D0qw6tOD.js";
15
- import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-C7UDAIcq.js";
16
- import { _ as _sfc_main$q, T as TEMPLATES } from "./index-C-RRKtNp.js";
17
- import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-CEdItTM7.js";
18
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BVqVI-WL.js";
19
- import "./index-m6PFUpwd.js";
20
- import "./index-DdEBZ4p_.js";
21
- import "./index-BqH31bb7.js";
22
- import "./index-D4MN0F2_.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-C9XT87dh.js";
11
+ import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-Dby96cpu.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-CvtX7ULa.js";
13
+ import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-B6gZzsja.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-C9C8o4ON.js";
15
+ import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-D7uTV0-9.js";
16
+ import { _ as _sfc_main$q, T as TEMPLATES } from "./index-C33oGCbQ.js";
17
+ import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-DcKMh_2f.js";
18
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-2GUvtk01.js";
19
+ import "./index-AeZIrHi3.js";
20
+ import "./index-COXwd1ca.js";
21
+ import "./index-CFW6MW-j.js";
22
+ import "./index-s63kYMDU.js";
23
23
  import { useCoreStore } from "@feedmepos/mf-common";
24
- import { i as initCollectibleConfig } from "./helper-DeFgiHSS.js";
24
+ import { i as initCollectibleConfig } from "./helper-1r9zsTyt.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";
@@ -35,12 +35,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
35
35
  }
36
36
  },
37
37
  emits: ["update:model-value"],
38
- setup(e, { emit: d }) {
38
+ setup(e, { emit: i }) {
39
39
  const n = e, r = computed(() => {
40
40
  var t;
41
41
  const [s] = isRuleGroup(n.modelValue) ? Object.values(((t = n.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
42
42
  return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
43
- }), o = d;
43
+ }), o = i;
44
44
  return (s, l) => (openBlock(), createBlock(_sfc_main$q, {
45
45
  multiselect: !0,
46
46
  items: unref(useMembershipStore)().segmentOptions,
@@ -65,8 +65,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
65
65
  }
66
66
  },
67
67
  emits: ["update:model-value"],
68
- setup(e, { emit: d }) {
69
- const n = e, r = d, o = ref(
68
+ setup(e, { emit: i }) {
69
+ const n = e, r = i, o = ref(
70
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
71
  ), s = [
72
72
  {
@@ -87,19 +87,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
87
87
  if (t != "all_users" && t != l && RuleBuilder.getRules(
88
88
  (a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
89
89
  ).length > 0) {
90
- const p = await prompt.confirm(
90
+ const f = 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
- p && r(
93
+ f && r(
94
94
  "update:model-value",
95
95
  RuleBuilder.setRuleToGroup(
96
96
  n.modelValue ?? RuleBuilder.scaffoldGroup(),
97
97
  RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
98
98
  )
99
- ), o.value = p ? l : t;
99
+ ), o.value = f ? l : t;
100
100
  }
101
101
  }), (l, t) => {
102
- var p, v;
102
+ var f, v;
103
103
  const a = resolveComponent("FmRadio");
104
104
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
105
105
  createElementVNode("div", null, [
@@ -113,7 +113,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
113
113
  ]),
114
114
  unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
115
115
  createVNode(_sfc_main$p, {
116
- modelValue: ((p = e.modelValue) == null ? void 0 : p.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
116
+ modelValue: ((f = e.modelValue) == null ? void 0 : f.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(
@@ -151,23 +151,23 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
151
151
  }
152
152
  },
153
153
  emits: ["update:model-value"],
154
- setup(e, { emit: d }) {
155
- const n = e, r = d, o = ref(
154
+ setup(e, { emit: i }) {
155
+ const n = e, r = i, o = ref(
156
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
158
  watch(o, async (l, t) => {
159
159
  var a;
160
160
  if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
161
- const p = await prompt.confirm(
161
+ const f = 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
- p && r(
164
+ f && r(
165
165
  "update:model-value",
166
166
  RuleBuilder.setRuleToGroup(
167
167
  n.modelValue ?? RuleBuilder.scaffoldGroup(),
168
168
  RuleBuilder.scaffoldGroup("g_time")
169
169
  )
170
- ), o.value = p ? l : t;
170
+ ), o.value = f ? l : t;
171
171
  }
172
172
  });
173
173
  async function s(l) {
@@ -190,9 +190,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
190
190
  }
191
191
  return (l, t) => {
192
192
  var v;
193
- const a = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
193
+ const a = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
194
194
  return openBlock(), createElementBlock("div", _hoisted_1$j, [
195
- createVNode(p, {
195
+ createVNode(f, {
196
196
  modelValue: unref(o),
197
197
  "onUpdate:modelValue": [
198
198
  t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
@@ -239,8 +239,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
239
239
  }
240
240
  },
241
241
  emits: ["update:model-value"],
242
- setup(e, { emit: d }) {
243
- const n = d;
242
+ setup(e, { emit: i }) {
243
+ const n = i;
244
244
  return (r, o) => {
245
245
  var s;
246
246
  return openBlock(), createBlock(_sfc_main$r, {
@@ -266,8 +266,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
266
266
  }
267
267
  },
268
268
  emits: ["update:model-value"],
269
- setup(e, { emit: d }) {
270
- const n = e, r = d, o = computed(() => {
269
+ setup(e, { emit: i }) {
270
+ const n = e, r = i, o = computed(() => {
271
271
  const { property: s, operator: l, equator: t } = RuleBuilder.simplify(
272
272
  n.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
273
273
  op: "before",
@@ -318,11 +318,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
318
318
  label: "Days before birthday",
319
319
  "show-steppers": !1,
320
320
  "model-value": unref(o).equator.x,
321
- "onUpdate:modelValue": l[2] || (l[2] = (p) => r(
321
+ "onUpdate:modelValue": l[2] || (l[2] = (f) => r(
322
322
  "update:model-value",
323
323
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
324
324
  op: "after",
325
- x: p,
325
+ x: f,
326
326
  ignoreYear: !0
327
327
  })
328
328
  ))
@@ -370,8 +370,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
370
370
  }
371
371
  },
372
372
  emits: ["update:model-value"],
373
- setup(e, { emit: d }) {
374
- const n = d;
373
+ setup(e, { emit: i }) {
374
+ const n = i;
375
375
  return (r, o) => {
376
376
  var s;
377
377
  return openBlock(), createBlock(_sfc_main$r, {
@@ -457,10 +457,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
457
457
  "GAME",
458
458
  "MISSION"
459
459
  ].map((e) => {
460
- const d = CAMPAIGN_TRIGGER[e];
460
+ const i = CAMPAIGN_TRIGGER[e];
461
461
  return [
462
462
  e,
463
- (d == null ? void 0 : d.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
463
+ (i == null ? void 0 : i.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
464
464
  ];
465
465
  })
466
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({
@@ -479,8 +479,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
479
479
  }
480
480
  },
481
481
  emits: ["update:model-value"],
482
- setup(e, { emit: d }) {
483
- const n = e, r = d, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
482
+ setup(e, { emit: i }) {
483
+ const n = e, r = i, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
484
484
  (s) => s.value == n.modelValue
485
485
  ) : TypeToTriggerOptions[n.campaignType]);
486
486
  return (s, l) => {
@@ -524,8 +524,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
524
524
  }
525
525
  },
526
526
  emits: ["update:model-value"],
527
- setup(e, { emit: d }) {
528
- const n = d;
527
+ setup(e, { emit: i }) {
528
+ const n = i;
529
529
  return (r, o) => {
530
530
  const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
531
531
  return openBlock(), createBlock(t, {
@@ -544,7 +544,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
544
544
  key: 0,
545
545
  variant: "tertiary",
546
546
  icon: "clear",
547
- onClick: o[0] || (o[0] = (p) => (p.stopPropagation(), n("update:model-value", null)))
547
+ onClick: o[0] || (o[0] = (f) => (f.stopPropagation(), n("update:model-value", null)))
548
548
  })) : createCommentVNode("", !0)
549
549
  ]),
550
550
  default: withCtx(() => [
@@ -568,8 +568,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
568
568
  }
569
569
  },
570
570
  emits: ["update:model-value"],
571
- setup(e, { emit: d }) {
572
- const n = d;
571
+ setup(e, { emit: i }) {
572
+ const n = i;
573
573
  return (r, o) => {
574
574
  var s, l;
575
575
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
@@ -621,8 +621,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
621
621
  }
622
622
  },
623
623
  emits: ["update:model-value"],
624
- setup(e, { emit: d }) {
625
- const n = e, r = d;
624
+ setup(e, { emit: i }) {
625
+ const n = e, r = i;
626
626
  function o() {
627
627
  const m = RuleBuilder.getRules(n.modelValue);
628
628
  return m.length == 0 ? "fixed" : m.some(
@@ -631,13 +631,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
631
631
  }
632
632
  const s = ref(o()), l = ref(!1), t = computed(() => {
633
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"
634
+ (d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.date"
635
+ ), c = m.find(
636
+ (d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.time"
637
637
  );
638
638
  return {
639
639
  date: g ? RuleBuilder.simplify(g).equator : null,
640
- time: y ? RuleBuilder.simplify(y).equator : null
640
+ time: c ? RuleBuilder.simplify(c).equator : null
641
641
  };
642
642
  }), a = computed(
643
643
  () => calculateNextScheduleAt(
@@ -647,8 +647,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
647
647
  n.endDate ? new Date(n.endDate) : void 0
648
648
  )
649
649
  );
650
- function p(m) {
651
- const g = m.label.toLowerCase(), y = g == "fixed" ? [
650
+ function f(m) {
651
+ const g = m.label.toLowerCase(), c = g == "fixed" ? [
652
652
  RuleBuilder.constructEntry(
653
653
  "trigger.date",
654
654
  "_isOnDate",
@@ -667,7 +667,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
667
667
  "update:model-value",
668
668
  RuleBuilder.setRuleToGroup(
669
669
  RuleBuilder.scaffoldGroup("g_schedule"),
670
- y
670
+ c
671
671
  )
672
672
  ), s.value = g;
673
673
  }
@@ -703,17 +703,17 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
703
703
  );
704
704
  }
705
705
  return (m, g) => {
706
- const y = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), c = resolveComponent("FmTooltip"), f = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
706
+ const c = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), p = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
707
707
  return openBlock(), createElementBlock(Fragment, null, [
708
- createVNode(y, {
708
+ createVNode(c, {
709
709
  items: [{ label: "Fixed" }, { label: "Repeating" }],
710
710
  "model-value": { label: unref(cases).title(unref(s)) },
711
- "onUpdate:modelValue": p,
711
+ "onUpdate:modelValue": f,
712
712
  class: "mb-8"
713
713
  }, null, 8, ["model-value"]),
714
714
  createElementVNode("div", _hoisted_1$g, [
715
715
  createElementVNode("div", _hoisted_2$e, [
716
- createVNode(i, {
716
+ createVNode(d, {
717
717
  label: "Notify time",
718
718
  "model-value": unref(t).time,
719
719
  "onUpdate:modelValue": g[0] || (g[0] = (E) => v({ date: unref(t).date, time: E })),
@@ -723,7 +723,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
723
723
  unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
724
724
  createElementVNode("div", _hoisted_4$b, [
725
725
  _hoisted_5$7,
726
- unref(t).date ? (openBlock(), createBlock(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)
@@ -743,7 +743,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
743
743
  onPopoverChanged: g[3] || (g[3] = (E) => l.value = E)
744
744
  }, {
745
745
  "popover-button": withCtx(() => [
746
- createVNode(f, {
746
+ createVNode(y, {
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"
@@ -794,15 +794,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
794
794
  filterItems: { type: Function }
795
795
  },
796
796
  emits: ["confirm"],
797
- setup(e, { emit: d }) {
797
+ setup(e, { emit: i }) {
798
798
  const n = ref(), r = ref(!1);
799
799
  function o() {
800
800
  var l;
801
801
  (l = n.value) == null || l.onConfirm();
802
802
  }
803
- const s = d;
803
+ const s = i;
804
804
  return (l, t) => {
805
- const a = resolveComponent("FmField"), p = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
805
+ const a = resolveComponent("FmField"), f = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
806
806
  return openBlock(), createBlock(v, {
807
807
  modelValue: r.value,
808
808
  "onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
@@ -823,12 +823,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
823
823
  ]),
824
824
  "side-sheet-footer": withCtx(() => [
825
825
  createElementVNode("div", _hoisted_1$f, [
826
- createVNode(p, {
826
+ createVNode(f, {
827
827
  variant: "tertiary",
828
828
  onClick: t[0] || (t[0] = (m) => r.value = !1),
829
829
  label: "Cancel"
830
830
  }),
831
- createVNode(p, {
831
+ createVNode(f, {
832
832
  variant: "primary",
833
833
  onClick: o,
834
834
  label: "Confirm"
@@ -875,9 +875,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
875
875
  }
876
876
  },
877
877
  emits: ["update:model-value"],
878
- setup(e, { emit: d }) {
878
+ setup(e, { emit: i }) {
879
879
  var v, m, g;
880
- const n = useBusinessStore(), r = e, o = d, s = [
880
+ const n = useBusinessStore(), r = e, o = i, s = [
881
881
  {
882
882
  label: "Based on spending",
883
883
  sublabel: "Customers earn rewards based on how much they spend.",
@@ -888,22 +888,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
888
888
  sublabel: "Customers earn a set amount of rewards for specific actions.",
889
889
  value: "FIXED"
890
890
  }
891
- ].filter((y) => {
892
- var i, u;
893
- return r.fixedType || ((u = (i = r.extras) == null ? void 0 : i.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? y.value == "FIXED" : !0;
891
+ ].filter((c) => {
892
+ var d, u;
893
+ return r.fixedType || ((u = (d = r.extras) == null ? void 0 : d.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? c.value == "FIXED" : !0;
894
894
  }), l = computed(() => {
895
- var i, u;
896
- const y = r.extras && "configs" in r.extras ? r.extras.configs.type : (i = r.extras) == null ? void 0 : i.campaign.type;
897
- return (((u = CollectibleOptions[y]) == null ? void 0 : u.name) || "reward").toLowerCase();
895
+ var d, u;
896
+ const c = r.extras && "configs" in r.extras ? r.extras.configs.type : (d = r.extras) == null ? void 0 : d.campaign.type;
897
+ return (((u = CollectibleOptions[c]) == null ? void 0 : u.name) || "reward").toLowerCase();
898
898
  }), t = computed(() => {
899
- const y = FdoEarningOption.safeParse(r.modelValue);
900
- return y.success ? [] : y.error.errors;
899
+ const c = FdoEarningOption.safeParse(r.modelValue);
900
+ return c.success ? [] : c.error.errors;
901
901
  });
902
- function a(y) {
903
- var i;
904
- y != ((i = r.modelValue) == null ? void 0 : i.type) && o(
902
+ function a(c) {
903
+ var d;
904
+ c != ((d = r.modelValue) == null ? void 0 : d.type) && o(
905
905
  "update:model-value",
906
- y === "FIXED" ? {
906
+ c === "FIXED" ? {
907
907
  type: "FIXED",
908
908
  amount: 1
909
909
  } : {
@@ -913,12 +913,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
913
913
  }
914
914
  );
915
915
  }
916
- const p = ref(
916
+ const f = ref(
917
917
  ((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
918
918
  );
919
- return (y, i) => {
919
+ return (c, d) => {
920
920
  var E, V, N;
921
- const u = resolveComponent("FmCard"), c = resolveComponent("FmStepperField"), f = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
921
+ const u = resolveComponent("FmCard"), p = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
922
922
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
923
923
  createElementVNode("div", _hoisted_2$d, [
924
924
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
@@ -942,21 +942,21 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
942
942
  }), 128))
943
943
  ]),
944
944
  createElementVNode("div", _hoisted_5$6, [
945
- ((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(c, {
945
+ ((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(p, {
946
946
  key: 0,
947
947
  label: `Receive ${unref(l)}(s)`,
948
948
  class: "flex-1",
949
949
  "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
950
- "onUpdate:modelValue": i[0] || (i[0] = (h) => o("update:model-value", {
950
+ "onUpdate:modelValue": d[0] || (d[0] = (h) => o("update:model-value", {
951
951
  ...e.modelValue ?? { type: "FIXED" },
952
952
  amount: h
953
953
  }))
954
954
  }, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
955
955
  _hoisted_6$3,
956
956
  createVNode(b, {
957
- "model-value": unref(p),
958
- "onUpdate:modelValue": i[6] || (i[6] = (h) => {
959
- unref(p) != h && (o("update:model-value", {
957
+ "model-value": unref(f),
958
+ "onUpdate:modelValue": d[6] || (d[6] = (h) => {
959
+ unref(f) != h && (o("update:model-value", {
960
960
  ...e.modelValue ?? {
961
961
  type: "PROPORTIONAL",
962
962
  amount: 1,
@@ -964,11 +964,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
964
964
  },
965
965
  property: h ? [] : void 0,
966
966
  every: 1
967
- }), p.value = h);
967
+ }), f.value = h);
968
968
  })
969
969
  }, {
970
970
  default: withCtx(() => [
971
- createVNode(f, {
971
+ createVNode(y, {
972
972
  label: "Amount spent",
973
973
  sublabel: `Receive ${unref(l)} by amount spent`,
974
974
  value: !1
@@ -978,24 +978,24 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
978
978
  return [
979
979
  _hoisted_7$3,
980
980
  createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
981
- unref(p) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
982
- createVNode(c, {
981
+ unref(f) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
982
+ createVNode(p, {
983
983
  label: `Receive ${unref(l)}(s)`,
984
984
  inputmode: "decimal",
985
985
  class: "flex-1",
986
986
  "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
987
- "onUpdate:modelValue": i[1] || (i[1] = (B) => o("update:model-value", {
987
+ "onUpdate:modelValue": d[1] || (d[1] = (B) => o("update:model-value", {
988
988
  ...e.modelValue ?? { type: "FIXED" },
989
989
  amount: B
990
990
  }))
991
991
  }, null, 8, ["label", "model-value"]),
992
992
  _hoisted_10$3,
993
- createVNode(c, {
993
+ createVNode(p, {
994
994
  label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
995
995
  class: "flex-1",
996
996
  inputmode: "decimal",
997
997
  "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
998
- "onUpdate:modelValue": i[2] || (i[2] = (B) => o("update:model-value", {
998
+ "onUpdate:modelValue": d[2] || (d[2] = (B) => o("update:model-value", {
999
999
  ...e.modelValue,
1000
1000
  every: B
1001
1001
  }))
@@ -1010,7 +1010,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1010
1010
  }),
1011
1011
  _: 1
1012
1012
  }, 8, ["sublabel"]),
1013
- createVNode(f, {
1013
+ createVNode(y, {
1014
1014
  label: "Product bought",
1015
1015
  sublabel: `Receive ${unref(l)} by product bought`,
1016
1016
  value: !0,
@@ -1024,11 +1024,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1024
1024
  createVNode(k, { variant: "premium" })
1025
1025
  ]),
1026
1026
  createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
1027
- unref(p) ? (openBlock(), createElementBlock("div", _hoisted_13, [
1027
+ unref(f) ? (openBlock(), createElementBlock("div", _hoisted_13, [
1028
1028
  createElementVNode("div", _hoisted_14, [
1029
1029
  createVNode(_sfc_main$f, {
1030
1030
  "model-value": r.modelValue.property || [],
1031
- onConfirm: i[3] || (i[3] = (B) => o("update:model-value", {
1031
+ onConfirm: d[3] || (d[3] = (B) => o("update:model-value", {
1032
1032
  ...e.modelValue,
1033
1033
  property: B
1034
1034
  }))
@@ -1047,24 +1047,24 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1047
1047
  }, 8, ["model-value"])
1048
1048
  ]),
1049
1049
  createElementVNode("div", _hoisted_15, [
1050
- createVNode(c, {
1050
+ createVNode(p, {
1051
1051
  inputmode: "decimal",
1052
1052
  label: `Receive ${unref(l)}(s)`,
1053
1053
  class: "flex-1",
1054
1054
  "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
1055
- "onUpdate:modelValue": i[4] || (i[4] = (B) => o("update:model-value", {
1055
+ "onUpdate:modelValue": d[4] || (d[4] = (B) => o("update:model-value", {
1056
1056
  ...e.modelValue ?? { type: "FIXED" },
1057
1057
  amount: B
1058
1058
  }))
1059
1059
  }, null, 8, ["label", "model-value"]),
1060
1060
  _hoisted_16,
1061
- createVNode(c, {
1061
+ createVNode(p, {
1062
1062
  label: "Item purchased",
1063
1063
  class: "flex-1",
1064
1064
  "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
1065
1065
  inputmode: "numeric",
1066
1066
  "max-fraction-digits": 0,
1067
- "onUpdate:modelValue": i[5] || (i[5] = (B) => o("update:model-value", {
1067
+ "onUpdate:modelValue": d[5] || (d[5] = (B) => o("update:model-value", {
1068
1068
  ...e.modelValue,
1069
1069
  every: B
1070
1070
  }))
@@ -1097,8 +1097,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1097
1097
  }
1098
1098
  },
1099
1099
  emits: ["update:model-value"],
1100
- setup(e, { emit: d }) {
1101
- const n = e, r = d, o = computed(
1100
+ setup(e, { emit: i }) {
1101
+ const n = e, r = i, o = computed(
1102
1102
  () => [
1103
1103
  {
1104
1104
  label: "Fortune Wheel",
@@ -1152,27 +1152,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1152
1152
  }
1153
1153
  },
1154
1154
  emits: ["update:model-value", "update:reward-image"],
1155
- setup(e, { emit: d }) {
1155
+ setup(e, { emit: i }) {
1156
1156
  const r = ref(
1157
1157
  e.modelValue ?? initCollectibleConfig("VOUCHER", {
1158
1158
  business: useCoreStore().currentBusiness.value._id,
1159
1159
  name: ""
1160
1160
  })
1161
- ), o = FdtoCollectibleConfig, s = d;
1161
+ ), o = FdtoCollectibleConfig, s = i;
1162
1162
  return (l, t) => {
1163
- var m, g, y;
1164
- const a = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
1163
+ var v, m, g;
1164
+ const a = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText");
1165
1165
  return openBlock(), createElementBlock(Fragment, null, [
1166
1166
  createVNode(_sfc_main$u, {
1167
1167
  modelValue: unref(r).name,
1168
- "onUpdate:modelValue": t[0] || (t[0] = (i) => unref(r).name = i),
1168
+ "onUpdate:modelValue": t[0] || (t[0] = (c) => unref(r).name = c),
1169
1169
  label: "Voucher name",
1170
1170
  schema: unref(ZodHelper).typeAtPath(unref(o), "name", [unref(r).type])
1171
1171
  }, null, 8, ["modelValue", "schema"]),
1172
1172
  createVNode(a, {
1173
1173
  class: "!mb-[-16px]",
1174
1174
  modelValue: unref(r).description,
1175
- "onUpdate:modelValue": t[1] || (t[1] = (i) => unref(r).description = i),
1175
+ "onUpdate:modelValue": t[1] || (t[1] = (c) => unref(r).description = c),
1176
1176
  rules: [unref(ZodHelper).ruleAtPath(unref(o), "description", [unref(r).type])]
1177
1177
  }, {
1178
1178
  label: withCtx(() => [
@@ -1187,15 +1187,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1187
1187
  }, 8, ["modelValue", "rules"]),
1188
1188
  createElementVNode("div", _hoisted_1$c, [
1189
1189
  _hoisted_2$b,
1190
- createElementVNode("div", null, toDisplayString(((m = unref(r).description) == null ? void 0 : m.length) ?? 0) + "/200", 1)
1190
+ createElementVNode("div", null, toDisplayString(((v = unref(r).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
1191
1191
  ]),
1192
1192
  createVNode(_sfc_main$v, {
1193
1193
  class: "w-1/2 xs:w-2/3",
1194
1194
  "aspect-ratio": "16/9",
1195
1195
  file: e.rewardImage ?? void 0,
1196
1196
  thumbnail: unref(r).image ?? void 0,
1197
- "onUpdate:file": t[2] || (t[2] = async (i) => {
1198
- s("update:reward-image", i), i || (unref(r).image = null);
1197
+ "onUpdate:file": t[2] || (t[2] = async (c) => {
1198
+ s("update:reward-image", c), c || (unref(r).image = null);
1199
1199
  })
1200
1200
  }, {
1201
1201
  label: withCtx(() => [
@@ -1211,9 +1211,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1211
1211
  _hoisted_3$9,
1212
1212
  createVNode(_sfc_main$w, {
1213
1213
  "model-value": unref(r).extras.effect,
1214
- "onUpdate:modelValue": t[3] || (t[3] = (i) => unref(r).extras.effect = i)
1214
+ "onUpdate:modelValue": t[3] || (t[3] = (c) => unref(r).extras.effect = c)
1215
1215
  }, null, 8, ["model-value"]),
1216
- unref(r).extras.effect == null ? (openBlock(), createBlock(p, {
1216
+ unref(r).extras.effect == null ? (openBlock(), createBlock(f, {
1217
1217
  key: 0,
1218
1218
  class: "!mt-8",
1219
1219
  text: "Effect is required",
@@ -1223,26 +1223,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1223
1223
  createVNode(_sfc_main$x, {
1224
1224
  "model-value": unref(r).options,
1225
1225
  "no-campaign": unref(r).noCampaign,
1226
- "onUpdate:modelValue": t[4] || (t[4] = (i) => unref(r).options = i),
1226
+ "onUpdate:modelValue": t[4] || (t[4] = (c) => unref(r).options = c),
1227
1227
  schema: unref(ZodHelper).typeAtPath(unref(o), "options", ["VOUCHER"])
1228
1228
  }, null, 8, ["model-value", "no-campaign", "schema"]),
1229
1229
  _hoisted_5$4,
1230
1230
  unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1231
1231
  key: 1,
1232
- "model-value": ((y = (g = unref(r).extras) == null ? void 0 : g.targetLocation) == null ? void 0 : y.map(String)) ?? null,
1232
+ "model-value": ((g = (m = unref(r).extras) == null ? void 0 : m.targetLocation) == null ? void 0 : g.map(String)) ?? null,
1233
1233
  type: "select",
1234
- "onUpdate:modelValue": t[5] || (t[5] = (i) => {
1235
- unref(r).extras.targetLocation = i;
1234
+ "onUpdate:modelValue": t[5] || (t[5] = (c) => {
1235
+ unref(r).extras.targetLocation = c;
1236
1236
  }),
1237
1237
  rules: [unref(ZodHelper).ruleAtPath(unref(o), "extras.targetLocation")]
1238
- }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0),
1239
- createVNode(v, {
1240
- modelValue: unref(r).internal,
1241
- "onUpdate:modelValue": t[6] || (t[6] = (i) => unref(r).internal = i),
1242
- "label-placement": "right",
1243
- label: "Internal only",
1244
- sublabel: "Voucher will not be shown to customer"
1245
- }, null, 8, ["modelValue"])
1238
+ }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
1246
1239
  ], 64);
1247
1240
  };
1248
1241
  }
@@ -1252,29 +1245,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1252
1245
  }, _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({
1253
1246
  __name: "EditRewardPoolSheet",
1254
1247
  emits: ["update:model-value"],
1255
- setup(e, { expose: d, emit: n }) {
1256
- const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), p = computed(() => {
1248
+ setup(e, { expose: i, emit: n }) {
1249
+ const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), f = computed(() => {
1257
1250
  var u;
1258
1251
  return ((u = r.loyaltyRewards.items.find(
1259
- (c) => {
1260
- var f;
1261
- return c.value === ((f = l.value) == null ? void 0 : f.collectible);
1252
+ (p) => {
1253
+ var y;
1254
+ return p.value === ((y = l.value) == null ? void 0 : y.collectible);
1262
1255
  }
1263
1256
  )) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1264
1257
  }), v = computed(() => {
1265
- const i = p.value.safeParse(l.value);
1266
- return i.success ? [] : i.error.errors;
1258
+ const d = f.value.safeParse(l.value);
1259
+ return d.success ? [] : d.error.errors;
1267
1260
  });
1268
- function m(i, u, c) {
1269
- i && (l.value = u, a.value = c), s.value = i;
1261
+ function m(d, u, p) {
1262
+ d && (l.value = u, a.value = p), s.value = d;
1270
1263
  }
1271
1264
  const g = n;
1272
- async function y() {
1273
- const i = p.value.safeParse(l.value);
1274
- i.success && (await o(
1265
+ async function c() {
1266
+ const d = f.value.safeParse(l.value);
1267
+ d.success && (await o(
1275
1268
  async () => {
1276
- i.data.type === "VOUCHER" && t.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
1277
- i.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
1269
+ d.data.type === "VOUCHER" && t.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
1270
+ d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
1278
1271
  t.value
1279
1272
  ));
1280
1273
  },
@@ -1282,12 +1275,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1282
1275
  message: "Uploading reward image",
1283
1276
  successMessage: "Reward image updated"
1284
1277
  }
1285
- ), g("update:model-value", i.data, a.value));
1278
+ ), g("update:model-value", d.data, a.value));
1286
1279
  }
1287
- return d({
1280
+ return i({
1288
1281
  showSheet: m
1289
- }), (i, u) => {
1290
- const c = resolveComponent("FmSelect"), f = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
1282
+ }), (d, u) => {
1283
+ const p = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
1291
1284
  return openBlock(), createBlock(C, {
1292
1285
  "max-width": 560,
1293
1286
  modelValue: unref(s),
@@ -1305,7 +1298,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1305
1298
  type: "button",
1306
1299
  disabled: unref(v).length > 0,
1307
1300
  label: "Confirm",
1308
- onClick: u[7] || (u[7] = (b) => y())
1301
+ onClick: u[7] || (u[7] = (b) => c())
1309
1302
  }, null, 8, ["disabled"]),
1310
1303
  createVNode(k, {
1311
1304
  variant: "secondary",
@@ -1319,7 +1312,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1319
1312
  var b, x, E;
1320
1313
  return [
1321
1314
  unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1322
- createVNode(c, {
1315
+ createVNode(p, {
1323
1316
  label: "Reward Type",
1324
1317
  items: [
1325
1318
  { label: "No Reward", value: "NO_REWARD" },
@@ -1360,17 +1353,17 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1360
1353
  };
1361
1354
  })
1362
1355
  }, null, 8, ["model-value"]),
1363
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(c, {
1356
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(p, {
1364
1357
  key: 0,
1365
1358
  label: "Loyalty type",
1366
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(l).type])],
1359
+ rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(l).type])],
1367
1360
  items: unref(r).loyaltyRewards.items,
1368
1361
  "model-value": unref(l).collectible,
1369
1362
  "onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
1370
1363
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1371
- createVNode(f, {
1364
+ createVNode(y, {
1372
1365
  label: "Weight",
1373
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "weight", [unref(l).type])],
1366
+ rules: [unref(ZodHelper).ruleAtPath(unref(f), "weight", [unref(l).type])],
1374
1367
  "model-value": unref(l).weight,
1375
1368
  "onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
1376
1369
  ...unref(l),
@@ -1388,7 +1381,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1388
1381
  createVNode(_sfc_main$e, {
1389
1382
  class: "mt-[-8px]",
1390
1383
  rules: [
1391
- unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(l).type])
1384
+ unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(l).type])
1392
1385
  ],
1393
1386
  "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
1394
1387
  "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
@@ -1409,7 +1402,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1409
1402
  }
1410
1403
  )) == null ? void 0 : x.raw.type) === "CREDIT",
1411
1404
  class: "!gap-24",
1412
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(l).type])],
1405
+ rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(l).type])],
1413
1406
  "model-value": unref(l).validityOption,
1414
1407
  "onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
1415
1408
  ...unref(l),
@@ -1454,37 +1447,37 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1454
1447
  }
1455
1448
  },
1456
1449
  emits: ["update:model-value"],
1457
- setup(e, { emit: d }) {
1458
- 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(() => {
1459
- const i = s.safeParse(l.value);
1460
- return i.success ? [] : i.error.errors;
1450
+ setup(e, { emit: i }) {
1451
+ const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => n.modelValue ?? []), t = computed(() => {
1452
+ const d = s.safeParse(l.value);
1453
+ return d.success ? [] : d.error.errors;
1461
1454
  }), a = ref();
1462
- function p(i, u) {
1463
- var f;
1464
- const c = [...l.value];
1465
- c[u] = i, (f = a.value) == null || f.showSheet(!1), r("update:model-value", c);
1455
+ function f(d, u) {
1456
+ var y;
1457
+ const p = [...l.value];
1458
+ p[u] = d, (y = a.value) == null || y.showSheet(!1), r("update:model-value", p);
1466
1459
  }
1467
- function v(i) {
1468
- const u = i.type == "VOUCHER" ? i.collectibleConfig : o.collectibles.find(
1469
- (k) => k._id.toString() == i.collectible
1470
- ), c = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), f = i.weight;
1460
+ function v(d) {
1461
+ const u = d.type == "VOUCHER" ? d.collectibleConfig : o.collectibles.find(
1462
+ (k) => k._id.toString() == d.collectible
1463
+ ), p = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), y = d.weight;
1471
1464
  return {
1472
- label: isNullOrEmpty(c) ? "NO REWARD" : c,
1473
- sublabel: `${f} (${(f / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
1465
+ label: isNullOrEmpty(p) ? "NO REWARD" : p,
1466
+ sublabel: `${y} (${(y / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
1474
1467
  };
1475
1468
  }
1476
- function m(i) {
1477
- var c;
1469
+ function m(d) {
1470
+ var p;
1478
1471
  const u = [...l.value];
1479
- (c = a.value) == null || c.showSheet(!0, u[i], i);
1472
+ (p = a.value) == null || p.showSheet(!0, u[d], d);
1480
1473
  }
1481
- function g(i) {
1474
+ function g(d) {
1482
1475
  const u = [...l.value];
1483
- u.splice(i, 1), r("update:model-value", u);
1476
+ u.splice(d, 1), r("update:model-value", u);
1484
1477
  }
1485
- function y() {
1486
- var i;
1487
- (i = a.value) == null || i.showSheet(
1478
+ function c() {
1479
+ var d;
1480
+ (d = a.value) == null || d.showSheet(
1488
1481
  !0,
1489
1482
  {
1490
1483
  type: "NO_REWARD",
@@ -1494,17 +1487,17 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1494
1487
  l.value.length
1495
1488
  );
1496
1489
  }
1497
- return (i, u) => {
1498
- const c = resolveComponent("FmButton"), f = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
1490
+ return (d, u) => {
1491
+ const p = resolveComponent("FmButton"), y = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
1499
1492
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
1500
1493
  _hoisted_2$9,
1501
- createVNode(c, {
1494
+ createVNode(p, {
1502
1495
  label: "Add Reward",
1503
- onClick: u[0] || (u[0] = (C) => y()),
1496
+ onClick: u[0] || (u[0] = (C) => c()),
1504
1497
  variant: "plain",
1505
1498
  icon: "add"
1506
1499
  }),
1507
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(f, {
1500
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(y, {
1508
1501
  key: b,
1509
1502
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1510
1503
  variant: "outlined",
@@ -1515,7 +1508,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1515
1508
  createElementVNode("div", _hoisted_3$7, toDisplayString(v(C).label), 1),
1516
1509
  createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
1517
1510
  ]),
1518
- createVNode(c, {
1511
+ createVNode(p, {
1519
1512
  icon: "delete",
1520
1513
  variant: "tertiary",
1521
1514
  onClick: (x) => (x.stopPropagation(), g(b))
@@ -1531,7 +1524,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1531
1524
  createVNode(_sfc_main$b, {
1532
1525
  ref_key: "sheetRef",
1533
1526
  ref: a,
1534
- "onUpdate:modelValue": p
1527
+ "onUpdate:modelValue": f
1535
1528
  }, null, 512)
1536
1529
  ]);
1537
1530
  };
@@ -1547,8 +1540,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1547
1540
  }
1548
1541
  },
1549
1542
  emits: ["update:model-value"],
1550
- setup(e, { emit: d }) {
1551
- const n = e, r = d, o = computed(() => [
1543
+ setup(e, { emit: i }) {
1544
+ const n = e, r = i, o = computed(() => [
1552
1545
  {
1553
1546
  label: "Rock paper scissor",
1554
1547
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
@@ -1557,38 +1550,38 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1557
1550
  ]);
1558
1551
  return (s, l) => {
1559
1552
  var v, m, g;
1560
- const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
1553
+ const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
1561
1554
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
1562
1555
  createVNode(t, {
1563
1556
  label: "Enable game",
1564
1557
  "model-value": !!((v = e.modelValue) != null && v.gameType),
1565
- "onUpdate:modelValue": l[0] || (l[0] = (y) => y ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
1558
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => c ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
1566
1559
  }, null, 8, ["model-value"]),
1567
1560
  ((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1568
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (y) => {
1569
- var i, u;
1561
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (c) => {
1562
+ var d, u;
1570
1563
  return openBlock(), createBlock(a, {
1571
1564
  variant: "outlined",
1572
1565
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1573
1566
  "col-span-2": unref(o).length == 1,
1574
- "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,
1575
- "hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != y.value
1567
+ "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) == c.value,
1568
+ "hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != c.value
1576
1569
  }]),
1577
1570
  onClick: () => {
1578
- var c;
1579
- ((c = n.modelValue) == null ? void 0 : c.gameType) != y.value && r("update:model-value", { gameType: y.value });
1571
+ var p;
1572
+ ((p = n.modelValue) == null ? void 0 : p.gameType) != c.value && r("update:model-value", { gameType: c.value });
1580
1573
  },
1581
- key: y.value
1574
+ key: c.value
1582
1575
  }, {
1583
1576
  default: withCtx(() => [
1584
- createElementVNode("div", _hoisted_3$6, toDisplayString(y.label), 1),
1585
- createElementVNode("div", _hoisted_4$5, toDisplayString(y.description), 1)
1577
+ createElementVNode("div", _hoisted_3$6, toDisplayString(c.label), 1),
1578
+ createElementVNode("div", _hoisted_4$5, toDisplayString(c.description), 1)
1586
1579
  ]),
1587
1580
  _: 2
1588
1581
  }, 1032, ["class", "onClick"]);
1589
1582
  }), 128))
1590
1583
  ])) : createCommentVNode("", !0),
1591
- ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
1584
+ ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(f, {
1592
1585
  key: 1,
1593
1586
  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)",
1594
1587
  state: "warning"
@@ -1604,8 +1597,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1604
1597
  }
1605
1598
  },
1606
1599
  emits: ["update:model-value"],
1607
- setup(e, { emit: d }) {
1608
- const n = e, r = d, o = computed(() => [
1600
+ setup(e, { emit: i }) {
1601
+ const n = e, r = i, o = computed(() => [
1609
1602
  {
1610
1603
  label: "Stamp",
1611
1604
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -1658,8 +1651,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1658
1651
  }
1659
1652
  },
1660
1653
  emits: ["update:model-value"],
1661
- setup(e, { emit: d }) {
1662
- const n = d;
1654
+ setup(e, { emit: i }) {
1655
+ const n = i;
1663
1656
  return (r, o) => {
1664
1657
  const s = resolveComponent("FmStepperField");
1665
1658
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
@@ -1683,22 +1676,22 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1683
1676
  }
1684
1677
  },
1685
1678
  emits: ["update:model-value"],
1686
- setup(e, { expose: d, emit: n }) {
1687
- const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), p = ref(0), v = FdtoThresholdReward, m = computed(() => {
1688
- const c = v.safeParse(t.value);
1689
- return c.success ? [] : c.error.errors;
1679
+ setup(e, { expose: i, emit: n }) {
1680
+ const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), f = ref(0), v = FdtoThresholdReward, m = computed(() => {
1681
+ const p = v.safeParse(t.value);
1682
+ return p.success ? [] : p.error.errors;
1690
1683
  });
1691
- function g(c, f, k) {
1692
- c && (t.value = f, p.value = k), l.value = c;
1684
+ function g(p, y, k) {
1685
+ p && (t.value = y, f.value = k), l.value = p;
1693
1686
  }
1694
- const y = n;
1695
- async function i() {
1687
+ const c = n;
1688
+ async function d() {
1696
1689
  console.log(t.value);
1697
- const c = v.safeParse(t.value);
1698
- c.success && (await s(
1690
+ const p = v.safeParse(t.value);
1691
+ p.success && (await s(
1699
1692
  async () => {
1700
- c.data.type === "VOUCHER" && a.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
1701
- c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
1693
+ p.data.type === "VOUCHER" && a.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
1694
+ p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
1702
1695
  a.value
1703
1696
  ));
1704
1697
  },
@@ -1706,19 +1699,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1706
1699
  message: "Uploading reward image",
1707
1700
  successMessage: "Reward image updated"
1708
1701
  }
1709
- ), y("update:model-value", c.data, p.value));
1702
+ ), c("update:model-value", p.data, f.value));
1710
1703
  }
1711
1704
  const u = ref();
1712
- return d({
1705
+ return i({
1713
1706
  showSheet: g
1714
- }), (c, f) => {
1707
+ }), (p, y) => {
1715
1708
  const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
1716
1709
  return openBlock(), createBlock(E, {
1717
1710
  "max-width": 560,
1718
1711
  modelValue: unref(l),
1719
1712
  "onUpdate:modelValue": [
1720
- f[10] || (f[10] = (V) => isRef(l) ? l.value = V : null),
1721
- f[11] || (f[11] = (V) => l.value = V)
1713
+ y[10] || (y[10] = (V) => isRef(l) ? l.value = V : null),
1714
+ y[11] || (y[11] = (V) => l.value = V)
1722
1715
  ],
1723
1716
  header: "Edit reward",
1724
1717
  "dismiss-away": ""
@@ -1729,7 +1722,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1729
1722
  variant: "primary",
1730
1723
  type: "button",
1731
1724
  label: "Confirm",
1732
- onClick: f[8] || (f[8] = async () => {
1725
+ onClick: y[8] || (y[8] = async () => {
1733
1726
  var V;
1734
1727
  return (V = unref(u)) == null ? void 0 : V.validateInputs();
1735
1728
  })
@@ -1738,7 +1731,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1738
1731
  variant: "secondary",
1739
1732
  type: "button",
1740
1733
  label: "Cancel",
1741
- onClick: f[9] || (f[9] = (V) => l.value = !1)
1734
+ onClick: y[9] || (y[9] = (V) => l.value = !1)
1742
1735
  })
1743
1736
  ])
1744
1737
  ]),
@@ -1748,7 +1741,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1748
1741
  class: "flex flex-col gap-y-24",
1749
1742
  ref_key: "formRef",
1750
1743
  ref: u,
1751
- onValidationSuccess: f[7] || (f[7] = (V) => i())
1744
+ onValidationSuccess: y[7] || (y[7] = (V) => d())
1752
1745
  }, {
1753
1746
  default: withCtx(() => {
1754
1747
  var V, N;
@@ -1765,7 +1758,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1765
1758
  )
1766
1759
  ],
1767
1760
  "model-value": unref(t).threshold,
1768
- "onUpdate:modelValue": f[0] || (f[0] = (h) => t.value = {
1761
+ "onUpdate:modelValue": y[0] || (y[0] = (h) => t.value = {
1769
1762
  ...unref(t),
1770
1763
  threshold: h
1771
1764
  })
@@ -1777,7 +1770,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1777
1770
  { label: "Loyalty", value: "LOYALTY" }
1778
1771
  ],
1779
1772
  "model-value": unref(t).type,
1780
- "onUpdate:modelValue": f[1] || (f[1] = (h) => {
1773
+ "onUpdate:modelValue": y[1] || (y[1] = (h) => {
1781
1774
  var R, B;
1782
1775
  h === "VOUCHER" ? t.value = {
1783
1776
  collectible: null,
@@ -1813,7 +1806,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1813
1806
  rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
1814
1807
  items: unref(o).loyaltyRewards.items,
1815
1808
  "model-value": unref(t).collectible,
1816
- "onUpdate:modelValue": f[2] || (f[2] = (h) => unref(t).collectible = h)
1809
+ "onUpdate:modelValue": y[2] || (y[2] = (h) => unref(t).collectible = h)
1817
1810
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1818
1811
  unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1819
1812
  _hoisted_1$6,
@@ -1824,7 +1817,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1824
1817
  "error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
1825
1818
  "fixed-type": !0,
1826
1819
  "model-value": unref(t).earningOption,
1827
- "onUpdate:modelValue": f[3] || (f[3] = (h) => t.value = {
1820
+ "onUpdate:modelValue": y[3] || (y[3] = (h) => t.value = {
1828
1821
  ...unref(t),
1829
1822
  earningOption: h
1830
1823
  })
@@ -1839,7 +1832,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1839
1832
  )) == null ? void 0 : V.raw.type) === "CREDIT",
1840
1833
  rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
1841
1834
  "model-value": unref(t).validityOption,
1842
- "onUpdate:modelValue": f[4] || (f[4] = (h) => t.value = {
1835
+ "onUpdate:modelValue": y[4] || (y[4] = (h) => t.value = {
1843
1836
  ...unref(t),
1844
1837
  validityOption: h
1845
1838
  })
@@ -1849,11 +1842,11 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1849
1842
  key: 3,
1850
1843
  "reward-image": unref(a),
1851
1844
  "model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
1852
- "onUpdate:modelValue": f[5] || (f[5] = (h) => t.value = {
1845
+ "onUpdate:modelValue": y[5] || (y[5] = (h) => t.value = {
1853
1846
  ...unref(t),
1854
1847
  collectibleConfig: h
1855
1848
  }),
1856
- "onUpdate:rewardImage": f[6] || (f[6] = (h) => a.value = h)
1849
+ "onUpdate:rewardImage": y[6] || (y[6] = (h) => a.value = h)
1857
1850
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1858
1851
  createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
1859
1852
  ];
@@ -1889,13 +1882,13 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1889
1882
  }
1890
1883
  },
1891
1884
  setup(e) {
1892
- const d = e, { maxRange: n, currentRange: r, markers: o } = toRefs(d), s = computed(
1885
+ const i = e, { maxRange: n, currentRange: r, markers: o } = toRefs(i), s = computed(
1893
1886
  () => Math.min(r.value / n.value * 100, 100)
1894
1887
  ), l = (t) => t / n.value * 100;
1895
1888
  return (t, a) => {
1896
- const p = resolveComponent("FmIcon");
1889
+ const f = resolveComponent("FmIcon");
1897
1890
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1898
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(p, {
1891
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(f, {
1899
1892
  class: normalizeClass(
1900
1893
  unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1901
1894
  ),
@@ -1928,15 +1921,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1928
1921
  }
1929
1922
  }), isObject = (e) => e !== null && typeof e == "object";
1930
1923
  function changeKeysFactory(e) {
1931
- return function d(n, r = 1, o) {
1924
+ return function i(n, r = 1, o) {
1932
1925
  if (r === 0 || !isObject(n))
1933
1926
  return n;
1934
1927
  if (Array.isArray(n))
1935
- return n.map((l) => d(l, r - 1, o));
1928
+ return n.map((l) => i(l, r - 1, o));
1936
1929
  const s = Object.create(Object.getPrototypeOf(n));
1937
1930
  return Object.keys(n).forEach((l) => {
1938
- const t = n[l], a = e(l, o), p = d(t, r - 1, o);
1939
- s[a] = p;
1931
+ const t = n[l], a = e(l, o), f = i(t, r - 1, o);
1932
+ s[a] = f;
1940
1933
  }), s;
1941
1934
  };
1942
1935
  }
@@ -1953,37 +1946,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1953
1946
  }
1954
1947
  },
1955
1948
  emits: ["update:model-value"],
1956
- setup(e, { emit: d }) {
1957
- const n = e, r = d, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1958
- () => n.modelValue.sort((u, c) => u.threshold - c.threshold) ?? []
1949
+ setup(e, { emit: i }) {
1950
+ const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1951
+ () => n.modelValue.sort((u, p) => u.threshold - p.threshold) ?? []
1959
1952
  ), t = computed(() => {
1960
1953
  const u = s.safeParse(l.value);
1961
1954
  return u.success ? [] : u.error.errors;
1962
1955
  }), a = ref();
1963
- function p(u, c) {
1956
+ function f(u, p) {
1964
1957
  var k;
1965
- const f = [...l.value];
1966
- f[c] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", f);
1958
+ const y = [...l.value];
1959
+ y[p] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", y);
1967
1960
  }
1968
1961
  function v(u) {
1969
- const c = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
1962
+ const p = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
1970
1963
  (k) => k._id.toString() == u.collectible
1971
- ), f = CollectionUtils.formattedType((c == null ? void 0 : c.name) || "");
1964
+ ), y = CollectionUtils.formattedType((p == null ? void 0 : p.name) || "");
1972
1965
  return {
1973
- label: isNullOrEmpty(f) ? "NO REWARD" : f,
1966
+ label: isNullOrEmpty(y) ? "NO REWARD" : y,
1974
1967
  sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
1975
1968
  };
1976
1969
  }
1977
1970
  function m(u) {
1978
- var f;
1979
- const c = [...l.value];
1980
- (f = a.value) == null || f.showSheet(!0, c[u], u);
1971
+ var y;
1972
+ const p = [...l.value];
1973
+ (y = a.value) == null || y.showSheet(!0, p[u], u);
1981
1974
  }
1982
1975
  function g(u) {
1983
- const c = [...l.value];
1984
- c.splice(u, 1), r("update:model-value", c);
1976
+ const p = [...l.value];
1977
+ p.splice(u, 1), r("update:model-value", p);
1985
1978
  }
1986
- function y() {
1979
+ function c() {
1987
1980
  var u;
1988
1981
  (u = a.value) == null || u.showSheet(
1989
1982
  !0,
@@ -2002,21 +1995,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2002
1995
  l.value.length
2003
1996
  );
2004
1997
  }
2005
- function i(u) {
2006
- var c, f;
2007
- return u.type == "VOUCHER" ? (c = u.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
2008
- ((f = o.loyaltyRewards.items.find(
1998
+ function d(u) {
1999
+ var p, y;
2000
+ return u.type == "VOUCHER" ? (p = u.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
2001
+ ((y = o.loyaltyRewards.items.find(
2009
2002
  (k) => k.value == u.collectible
2010
- )) == null ? void 0 : f.label) || ""
2003
+ )) == null ? void 0 : y.label) || ""
2011
2004
  );
2012
2005
  }
2013
- return (u, c) => {
2014
- const f = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
2006
+ return (u, p) => {
2007
+ const y = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
2015
2008
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
2016
2009
  _hoisted_2$3,
2017
- createVNode(f, {
2010
+ createVNode(y, {
2018
2011
  label: "Add Reward",
2019
- onClick: c[0] || (c[0] = (b) => y()),
2012
+ onClick: p[0] || (p[0] = (b) => c()),
2020
2013
  variant: "plain",
2021
2014
  icon: "add"
2022
2015
  }),
@@ -2031,7 +2024,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2031
2024
  createElementVNode("div", _hoisted_3$3, toDisplayString(v(b).label), 1),
2032
2025
  createElementVNode("div", _hoisted_4$3, toDisplayString(v(b).sublabel), 1)
2033
2026
  ]),
2034
- createVNode(f, {
2027
+ createVNode(y, {
2035
2028
  icon: "delete",
2036
2029
  variant: "tertiary",
2037
2030
  onClick: (E) => (E.stopPropagation(), g(x))
@@ -2052,7 +2045,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2052
2045
  default: withCtx(() => [
2053
2046
  createElementVNode("div", _hoisted_6$2, [
2054
2047
  createElementVNode("div", null, [
2055
- 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),
2048
+ 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),
2056
2049
  _hoisted_8$2
2057
2050
  ])
2058
2051
  ]),
@@ -2071,7 +2064,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2071
2064
  createVNode(_sfc_main$6, {
2072
2065
  ref_key: "sheetRef",
2073
2066
  ref: a,
2074
- "onUpdate:modelValue": p,
2067
+ "onUpdate:modelValue": f,
2075
2068
  "max-threshold": e.mission.end
2076
2069
  }, null, 8, ["max-threshold"])
2077
2070
  ]);
@@ -2083,7 +2076,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2083
2076
  modelValue: Object
2084
2077
  },
2085
2078
  emits: ["update:model-value"],
2086
- setup(e, { emit: d }) {
2079
+ setup(e, { emit: i }) {
2087
2080
  const n = e, r = computed(() => {
2088
2081
  const l = FdoMission.safeParse(n.modelValue);
2089
2082
  return l.success ? [] : l.error.errors;
@@ -2098,27 +2091,27 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2098
2091
  description: "Reward customers when they reach a cumulative spending goal.",
2099
2092
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2100
2093
  }
2101
- ]), s = d;
2094
+ ]), s = i;
2102
2095
  return (l, t) => {
2103
2096
  var v;
2104
- const a = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
2097
+ const a = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
2105
2098
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2106
2099
  createElementVNode("div", _hoisted_2$2, [
2107
2100
  _hoisted_3$2,
2108
2101
  _hoisted_4$2,
2109
2102
  createElementVNode("div", _hoisted_5$1, [
2110
2103
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (m) => {
2111
- var g, y;
2104
+ var g, c;
2112
2105
  return openBlock(), createBlock(a, {
2113
2106
  variant: "outlined",
2114
2107
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2115
2108
  "col-span-2": unref(o).length == 1,
2116
2109
  "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,
2117
- "hover:bg-fm-color-opacity-sm": ((y = e.modelValue) == null ? void 0 : y.type) != m.value
2110
+ "hover:bg-fm-color-opacity-sm": ((c = e.modelValue) == null ? void 0 : c.type) != m.value
2118
2111
  }]),
2119
2112
  onClick: () => {
2120
- var i, u;
2121
- ((i = e.modelValue) == null ? void 0 : i.type) != m.value && s("update:model-value", {
2113
+ var d, u;
2114
+ ((d = e.modelValue) == null ? void 0 : d.type) != m.value && s("update:model-value", {
2122
2115
  ...e.modelValue,
2123
2116
  type: m.value,
2124
2117
  end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
@@ -2138,7 +2131,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2138
2131
  createElementVNode("div", _hoisted_8$1, [
2139
2132
  _hoisted_9$1,
2140
2133
  _hoisted_10$1,
2141
- createVNode(p, {
2134
+ createVNode(f, {
2142
2135
  label: "Maximum to collect",
2143
2136
  "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
2144
2137
  "onUpdate:modelValue": t[0] || (t[0] = (m) => {
@@ -2178,16 +2171,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2178
2171
  }
2179
2172
  },
2180
2173
  emits: ["update:model-value", "update:file"],
2181
- setup(e, { emit: d }) {
2182
- const n = e, r = d;
2174
+ setup(e, { emit: i }) {
2175
+ const n = e, r = i;
2183
2176
  function o(a) {
2184
2177
  switch (n.field.type) {
2185
2178
  case "timeframe":
2186
- const p = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
2179
+ const f = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
2187
2180
  r("update:model-value", {
2188
2181
  type: "timeframe",
2189
2182
  property: "__now",
2190
- start: p,
2183
+ start: f,
2191
2184
  end: v
2192
2185
  });
2193
2186
  break;
@@ -2229,9 +2222,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2229
2222
  labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
2230
2223
  zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
2231
2224
  }));
2232
- return (a, p) => {
2233
- var u, c, f, k, C;
2234
- const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), y = resolveComponent("FmHelperText"), i = resolveComponent("FmSwitch");
2225
+ return (a, f) => {
2226
+ var u, p, y, k, C;
2227
+ const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
2235
2228
  return e.field.type === "text" ? (openBlock(), createBlock(v, {
2236
2229
  key: 0,
2237
2230
  label: e.field.label,
@@ -2260,7 +2253,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2260
2253
  "model-value": unref(s),
2261
2254
  "onUpdate:modelValue": o,
2262
2255
  "show-word-count": "",
2263
- "max-length": (C = (k = (f = (c = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : c._def) == null ? void 0 : f.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
2256
+ "max-length": (C = (k = (y = (p = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : p._def) == null ? void 0 : y.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
2264
2257
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
2265
2258
  key: 3,
2266
2259
  "campaign-type": e.extras,
@@ -2272,7 +2265,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2272
2265
  "model-value": unref(s),
2273
2266
  "onUpdate:modelValue": o
2274
2267
  }, null, 8, ["model-value"]),
2275
- createVNode(y, {
2268
+ createVNode(c, {
2276
2269
  class: "!mt-[8px]",
2277
2270
  text: unref(ZodHelper).helperText(l(), ""),
2278
2271
  state: unref(ZodHelper).helperState(l(), "")
@@ -2288,7 +2281,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2288
2281
  (openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
2289
2282
  ]),
2290
2283
  _: 1
2291
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(i, {
2284
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
2292
2285
  key: 6,
2293
2286
  label: e.field.label,
2294
2287
  "label-placement": "right",
@@ -2314,7 +2307,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2314
2307
  "onUpdate:modelValue": o,
2315
2308
  "can-set-auto-apply": e.field.property == "campaign.effect"
2316
2309
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2317
- unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
2310
+ unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
2318
2311
  key: 0,
2319
2312
  class: "!mt-[8px]",
2320
2313
  text: "Effect is required",
@@ -2373,7 +2366,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2373
2366
  "start-date": e.extras.start,
2374
2367
  "end-date": e.extras.end
2375
2368
  }, null, 8, ["model-value", "start-date", "end-date"]),
2376
- e.helperText ? (openBlock(), createBlock(y, {
2369
+ e.helperText ? (openBlock(), createBlock(c, {
2377
2370
  key: 0,
2378
2371
  class: "!mt-[8px]",
2379
2372
  text: e.helperText,
@@ -2384,14 +2377,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2384
2377
  "model-value": unref(s),
2385
2378
  "onUpdate:modelValue": o
2386
2379
  }, null, 8, ["model-value"]),
2387
- e.helperText ? (openBlock(), createBlock(y, {
2380
+ e.helperText ? (openBlock(), createBlock(c, {
2388
2381
  key: 0,
2389
2382
  class: "!mt-[8px]",
2390
2383
  text: e.helperText,
2391
2384
  state: "error"
2392
2385
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2393
2386
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
2394
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(y, {
2387
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(c, {
2395
2388
  key: 0,
2396
2389
  state: "warning",
2397
2390
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
@@ -2400,7 +2393,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2400
2393
  "model-value": unref(s),
2401
2394
  "onUpdate:modelValue": o
2402
2395
  }, null, 8, ["model-value"]),
2403
- e.helperText ? (openBlock(), createBlock(y, {
2396
+ e.helperText ? (openBlock(), createBlock(c, {
2404
2397
  key: 1,
2405
2398
  class: "!mt-[8px]",
2406
2399
  text: e.helperText,
@@ -2411,7 +2404,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2411
2404
  "model-value": unref(s),
2412
2405
  "onUpdate:modelValue": o
2413
2406
  }, null, 8, ["model-value"]),
2414
- e.helperText ? (openBlock(), createBlock(y, {
2407
+ e.helperText ? (openBlock(), createBlock(c, {
2415
2408
  key: 0,
2416
2409
  class: "!mt-[8px]",
2417
2410
  text: e.helperText,
@@ -2422,7 +2415,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2422
2415
  "model-value": unref(s),
2423
2416
  "onUpdate:modelValue": o
2424
2417
  }, null, 8, ["model-value"]),
2425
- e.helperText ? (openBlock(), createBlock(y, {
2418
+ e.helperText ? (openBlock(), createBlock(c, {
2426
2419
  key: 0,
2427
2420
  class: "!mt-[8px]",
2428
2421
  text: e.helperText,
@@ -2433,7 +2426,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2433
2426
  "model-value": unref(s),
2434
2427
  "onUpdate:modelValue": o
2435
2428
  }, null, 8, ["model-value"]),
2436
- e.helperText ? (openBlock(), createBlock(y, {
2429
+ e.helperText ? (openBlock(), createBlock(c, {
2437
2430
  key: 0,
2438
2431
  class: "!mt-[8px]",
2439
2432
  text: e.helperText,
@@ -2444,7 +2437,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2444
2437
  "model-value": unref(s),
2445
2438
  "onUpdate:modelValue": o
2446
2439
  }, null, 8, ["model-value"]),
2447
- e.helperText ? (openBlock(), createBlock(y, {
2440
+ e.helperText ? (openBlock(), createBlock(c, {
2448
2441
  key: 0,
2449
2442
  class: "!mt-[8px]",
2450
2443
  text: e.helperText,
@@ -2462,7 +2455,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2462
2455
  }
2463
2456
  },
2464
2457
  setup(e) {
2465
- return (d, n) => {
2458
+ return (i, n) => {
2466
2459
  const r = resolveComponent("FmCard");
2467
2460
  return openBlock(), createBlock(r, {
2468
2461
  variant: "outlined",
@@ -2517,7 +2510,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2517
2510
  TEMPLATES.VOUCHER
2518
2511
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
2519
2512
  async function showSheet(visible, type, campaign, selectedTemplate) {
2520
- var e, d;
2513
+ var e, i;
2521
2514
  if (sheetVisible.value = visible, visible == !0) {
2522
2515
  try {
2523
2516
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
@@ -2526,7 +2519,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2526
2519
  await new Promise((n) => setTimeout(n, 120)), isLoading.value = !1;
2527
2520
  }
2528
2521
  template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
2529
- ...(d = template.value) == null ? void 0 : d.defaultValue
2522
+ ...(i = template.value) == null ? void 0 : i.defaultValue
2530
2523
  }), "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`;
2531
2524
  }
2532
2525
  }
@@ -2547,10 +2540,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2547
2540
  return e.success ? [] : e.error.errors;
2548
2541
  });
2549
2542
  function stepErrors(e = currentStep.value - 1) {
2550
- const d = template.value.steps[e].groups.flatMap(
2543
+ const i = template.value.steps[e].groups.flatMap(
2551
2544
  (n) => n.fields.map((r) => r.property)
2552
2545
  );
2553
- return errors.value.filter((n) => d.includes(n.path.join(".")));
2546
+ return errors.value.filter((n) => i.includes(n.path.join(".")));
2554
2547
  }
2555
2548
  __expose({ showSheet });
2556
2549
  function showSummaryDialog() {
@@ -2562,8 +2555,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2562
2555
  }
2563
2556
  });
2564
2557
  }
2565
- function onUpdateProperty(e, d) {
2566
- if (_.set(data.value, e, d), e == "campaign.event.type") {
2558
+ function onUpdateProperty(e, i) {
2559
+ if (_.set(data.value, e, i), e == "campaign.event.type") {
2567
2560
  const n = RuleBuilder.setRuleToGroup(
2568
2561
  RuleBuilder.scaffoldGroup(),
2569
2562
  [
@@ -2584,7 +2577,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2584
2577
  ],
2585
2578
  "&&"
2586
2579
  );
2587
- if (d != "SCHEDULE") {
2580
+ if (i != "SCHEDULE") {
2588
2581
  _.set(data.value, "campaign.event.rule", n);
2589
2582
  return;
2590
2583
  }
@@ -2594,19 +2587,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2594
2587
  RuleBuilder.setRuleToGroup(n, r)
2595
2588
  );
2596
2589
  }
2597
- e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2590
+ e == "campaign.notify" && i == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2598
2591
  }
2599
- async function onUpdateFile(e, d) {
2600
- return e ? await minor(async () => firebaseStorage.update(d, e), {
2592
+ async function onUpdateFile(e, i) {
2593
+ return e ? await minor(async () => firebaseStorage.update(i, e), {
2601
2594
  message: `${e ? "Uploading" : "Removing"} file`,
2602
2595
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
2603
2596
  }) : "";
2604
2597
  }
2605
2598
  function isDisable(e) {
2606
- var d, n;
2599
+ var i, n;
2607
2600
  switch (e == null ? void 0 : e.property) {
2608
2601
  case "campaign.event.type":
2609
- return ((n = (d = data.value) == null ? void 0 : d.campaign) == null ? void 0 : n._id) || !1;
2602
+ return ((n = (i = data.value) == null ? void 0 : i.campaign) == null ? void 0 : n._id) || !1;
2610
2603
  default:
2611
2604
  return !1;
2612
2605
  }
@@ -2615,14 +2608,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2615
2608
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
2616
2609
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2617
2610
  }
2618
- return (e, d) => {
2611
+ return (e, i) => {
2619
2612
  const n = resolveComponent("FmButton"), r = resolveComponent("FmStep"), o = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2620
2613
  return openBlock(), createBlock(l, {
2621
2614
  "fullscreen-size": "lg",
2622
2615
  modelValue: unref(sheetVisible),
2623
2616
  "onUpdate:modelValue": [
2624
- d[7] || (d[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
2625
- d[8] || (d[8] = (t) => sheetVisible.value = t)
2617
+ i[7] || (i[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
2618
+ i[8] || (i[8] = (t) => sheetVisible.value = t)
2626
2619
  ]
2627
2620
  }, createSlots({
2628
2621
  "top-sheet-header": withCtx(() => [
@@ -2630,7 +2623,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2630
2623
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2631
2624
  createElementVNode("div", _hoisted_2, [
2632
2625
  createVNode(n, {
2633
- onClick: d[0] || (d[0] = (t) => hideSheet()),
2626
+ onClick: i[0] || (i[0] = (t) => hideSheet()),
2634
2627
  label: "Cancel",
2635
2628
  variant: "tertiary"
2636
2629
  }),
@@ -2663,7 +2656,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2663
2656
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2664
2657
  createVNode(o, {
2665
2658
  modelValue: unref(currentStep),
2666
- "onUpdate:modelValue": d[1] || (d[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2659
+ "onUpdate:modelValue": i[1] || (i[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2667
2660
  orientation: "horizontal",
2668
2661
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2669
2662
  }, {
@@ -2682,11 +2675,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2682
2675
  createVNode(n, {
2683
2676
  icon: "close",
2684
2677
  variant: "tertiary",
2685
- onClick: d[2] || (d[2] = (t) => sheetVisible.value = !1)
2678
+ onClick: i[2] || (i[2] = (t) => sheetVisible.value = !1)
2686
2679
  }),
2687
2680
  createVNode(o, {
2688
2681
  modelValue: unref(currentStep),
2689
- "onUpdate:modelValue": d[3] || (d[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2682
+ "onUpdate:modelValue": i[3] || (i[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2690
2683
  orientation: "horizontal",
2691
2684
  class: "flex-1"
2692
2685
  }, {
@@ -2705,7 +2698,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2705
2698
  createVNode(n, {
2706
2699
  icon: "info",
2707
2700
  variant: "tertiary",
2708
- onClick: d[4] || (d[4] = () => showSummaryDialog())
2701
+ onClick: i[4] || (i[4] = () => showSummaryDialog())
2709
2702
  })
2710
2703
  ]),
2711
2704
  createElementVNode("div", _hoisted_5, [
@@ -2729,24 +2722,24 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2729
2722
  class: "space-y-24"
2730
2723
  }, [
2731
2724
  createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
2732
- (openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (p, v) => (openBlock(), createElementBlock("div", { key: v }, [
2725
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (f, v) => (openBlock(), createElementBlock("div", { key: v }, [
2733
2726
  (openBlock(), createBlock(_sfc_main$2, {
2734
2727
  key: v,
2735
- field: p,
2736
- modelValue: unref(_).get(unref(data), p.property),
2737
- disabled: isDisable(p),
2738
- "onUpdate:modelValue": (m) => onUpdateProperty(p.property, m),
2728
+ field: f,
2729
+ modelValue: unref(_).get(unref(data), f.property),
2730
+ disabled: isDisable(f),
2731
+ "onUpdate:modelValue": (m) => onUpdateProperty(f.property, m),
2739
2732
  "onUpdate:file": async (m, g) => {
2740
- const y = await onUpdateFile(m, g);
2741
- onUpdateProperty(p.property, y || "");
2733
+ const c = await onUpdateFile(m, g);
2734
+ onUpdateProperty(f.property, c || "");
2742
2735
  },
2743
2736
  schema: unref(ZodHelper).typeAtPath(
2744
2737
  unref(schema),
2745
- p.property,
2738
+ f.property,
2746
2739
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
2747
2740
  ),
2748
- "helper-text": unref(ZodHelper).helperText(unref(errors), p.property),
2749
- extras: p.extras != null ? p.extras == "" ? unref(data) : unref(_).get(unref(data), p.extras) : void 0
2741
+ "helper-text": unref(ZodHelper).helperText(unref(errors), f.property),
2742
+ extras: f.extras != null ? f.extras == "" ? unref(data) : unref(_).get(unref(data), f.extras) : void 0
2750
2743
  }, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
2751
2744
  ]))), 128))
2752
2745
  ]))), 128)),
@@ -2755,12 +2748,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2755
2748
  label: "Back",
2756
2749
  variant: "tertiary",
2757
2750
  disabled: unref(currentStep) == 1,
2758
- onClick: d[5] || (d[5] = (t) => currentStep.value--)
2751
+ onClick: i[5] || (i[5] = (t) => currentStep.value--)
2759
2752
  }, null, 8, ["disabled"]),
2760
2753
  createVNode(n, {
2761
2754
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2762
2755
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2763
- onClick: d[6] || (d[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2756
+ onClick: i[6] || (i[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2764
2757
  }, null, 8, ["disabled", "label"])
2765
2758
  ])
2766
2759
  ]),