@feedmepos/mf-connect 0.1.2-prod → 0.1.4-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 (87) hide show
  1. package/dist/Analytic-07T9poLx.js +423 -0
  2. package/dist/{App-CRTD0U-N.js → App-C6MukSCT.js} +276 -275
  3. package/dist/Broadcast-CzsgeZNO.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5zUv0Zx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BirunpzI.js} +8 -8
  5. package/dist/Card-DQnyWZZf.js +824 -0
  6. package/dist/{Collections-BgbWoLWI.js → Collections-BV7CSqRw.js} +4 -4
  7. package/dist/Credit-CxsbYGLZ.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKSZYxvb.js} +918 -901
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DpsrI-Z3.js +345 -0
  10. package/dist/Experience-eMUbhq7h.js +221 -0
  11. package/dist/Game-CxAG2ViS.js +255 -0
  12. package/dist/Marketing-CozMj2Y5.js +316 -0
  13. package/dist/Member-DM1dj3F5.js +69 -0
  14. package/dist/{MemberList-ISy05wGZ.js → MemberList-DNjK9BbG.js} +14 -14
  15. package/dist/{MemberTransactions-CXvhJngX.js → MemberTransactions-CsjN3LZA.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js → MessageInput.vue_vue_type_script_setup_true_lang-DVQE9v2R.js} +2 -2
  17. package/dist/Mission-BugvTPPH.js +261 -0
  18. package/dist/Point-D8BjGtqT.js +222 -0
  19. package/dist/Promotion-mc9KBzoJ.js +253 -0
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js → RuleGroup.vue_vue_type_script_setup_true_lang-B2H3D_kZ.js} +15 -15
  21. package/dist/Segment-DZRFA-Pb.js +565 -0
  22. package/dist/Setting-DxNhR44e.js +1871 -0
  23. package/dist/Store-CdkJWpjV.js +1530 -0
  24. package/dist/StoreRewards-Cdturia8.js +400 -0
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D7GcOiUM.js} +10 -10
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js} +1 -1
  27. package/dist/{Tier-DLrOmrnK.js → Tier-I_MMd39Y.js} +470 -445
  28. package/dist/{Title-MHQuel7h.js → Title-DK5gmUvo.js} +298 -282
  29. package/dist/Transaction-BXpTIMS_.js +39 -0
  30. package/dist/Voucher-BQ5h2G0I.js +490 -0
  31. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-eAP99wyg.js +141 -0
  32. package/dist/app-CL2Wxzv5.js +5639 -0
  33. package/dist/{app-BjOpRVdv.js → app-DTAyCT-G.js} +1 -1
  34. package/dist/app.js +4 -3
  35. package/dist/{business-DveMDDHY.js → business-B9OUlaFZ.js} +1 -1
  36. package/dist/{campaign-CMb05XLt.js → campaign-CNbUA51l.js} +2 -2
  37. package/dist/{collection.fn-BjaBPYMU.js → collection.fn-D_i45T4Q.js} +2 -2
  38. package/dist/dto-B4208_es.js +2770 -0
  39. package/dist/{effect-CxAdSlyD.js → effect-Ye_yr8et.js} +1 -1
  40. package/dist/{email-addresses-Dtr5OALQ.js → email-addresses-Gm7Dyaxy.js} +1 -1
  41. package/dist/{export-DuBekrcg.js → export-Buee5oUV.js} +3 -3
  42. package/dist/{helper-DL6hnmtJ.js → helper-BBlHhMFc.js} +1 -1
  43. package/dist/{index-raYm7Ew2.js → index-BxJgFvym.js} +2 -2
  44. package/dist/{index-gcsOy_cD.js → index-ByaM-yoc.js} +91 -86
  45. package/dist/{index-DISwCnfH.js → index-C0QHb5SL.js} +2 -2
  46. package/dist/{index-Cibwzgac.js → index-C363BG5A.js} +3 -3
  47. package/dist/{index-BZAlqAaJ.js → index-CLL3no-v.js} +1 -1
  48. package/dist/{index-CAQpU5Rv.js → index-ChSVaFk3.js} +1 -1
  49. package/dist/{index-BSIUoSG3.js → index-Co9n8I_5.js} +3 -3
  50. package/dist/index-CoGNKU8v.js +3 -0
  51. package/dist/{index-Dx4pkNRc.js → index-DHGcUMVN.js} +1 -1
  52. package/dist/{index-CgPlJqkX.js → index-DWWtZSrm.js} +1 -1
  53. package/dist/{index-CGHNWhkM.js → index-DdVZgYE4.js} +258 -256
  54. package/dist/{index-BBBytzpn.js → index-Dx3HwWcb.js} +1 -1
  55. package/dist/{index.esm2017-Bs9CWbrs.js → index.esm2017-Dd02dg_O.js} +38 -38
  56. package/dist/{loading-Dj5bx8fg.js → loading-Or1ZDzDS.js} +11 -11
  57. package/dist/{membership-B2avlZoN.js → membership-B8h5ku-v.js} +3 -3
  58. package/dist/{money-CNSWtAf-.js → money-CmsKAJBT.js} +1 -1
  59. package/dist/{number-BA58pjU6.js → number-iEhp7Uai.js} +1 -1
  60. package/dist/{rule-BWazFYuZ.js → rule-BORkgSMK.js} +3 -3
  61. package/dist/{rule-builder-RIloDQBn.js → rule-builder-DEfkSr68.js} +1 -1
  62. package/dist/{template-u01r84LY.js → template-C_Y7bhlI.js} +4 -4
  63. package/dist/{usePagination--B6Wt7C1.js → usePagination-Ci8-uZvb.js} +1 -1
  64. package/dist/vue-i18n-BXzrZRP6.js +2365 -0
  65. package/package.json +7 -4
  66. package/dist/Analytic-AqWU_lJy.js +0 -620
  67. package/dist/Broadcast-utWSrzP9.js +0 -216
  68. package/dist/Card-x6qnEaIt.js +0 -823
  69. package/dist/Credit-CojzmUnh.js +0 -214
  70. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js +0 -344
  71. package/dist/Experience-CPjovKWF.js +0 -211
  72. package/dist/Game-DWcjPfZP.js +0 -250
  73. package/dist/Marketing-CwoI0pFF.js +0 -309
  74. package/dist/Member-oRcVGr20.js +0 -92
  75. package/dist/Mission-Y8s5MQIC.js +0 -248
  76. package/dist/Point-0Fw3qLIW.js +0 -220
  77. package/dist/Promotion-vqM23NPX.js +0 -244
  78. package/dist/Segment-lgzMRCyd.js +0 -564
  79. package/dist/Setting-CFGB53S0.js +0 -1870
  80. package/dist/Store-fJlew3HJ.js +0 -1533
  81. package/dist/StoreRewards-DWq34E4p.js +0 -429
  82. package/dist/Transaction-CYqMFEzc.js +0 -36
  83. package/dist/Voucher-B0QCX_nG.js +0 -485
  84. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  85. package/dist/app-SOHUUM08.js +0 -2974
  86. package/dist/dto-CY7JrHkZ.js +0 -1145
  87. package/dist/index-BMxu_XL-.js +0 -11
@@ -1,34 +1,35 @@
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
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-SOHUUM08.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-CY7JrHkZ.js";
6
- import { u as useMembershipStore, C as CollectibleOptions } from "./membership-B2avlZoN.js";
7
- import { u as useBusinessStore } from "./business-DveMDDHY.js";
8
- import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-CAQpU5Rv.js";
9
- import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-RIloDQBn.js";
3
+ import { z } from "./app-CL2Wxzv5.js";
4
+ import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-eAP99wyg.js";
5
+ import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, b as CampaignOptions, f as campaignTransform } from "./dto-B4208_es.js";
6
+ import { u as useMembershipStore, C as CollectibleOptions } from "./membership-B8h5ku-v.js";
7
+ import { u as useBusinessStore } from "./business-B9OUlaFZ.js";
8
+ import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-ChSVaFk3.js";
9
+ import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DEfkSr68.js";
10
10
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
11
11
  import { h as hooks } from "./moment-BWErdI6_.js";
12
- 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-gcsOy_cD.js";
12
+ 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-ByaM-yoc.js";
13
13
  import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
14
- import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js";
15
- import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js";
16
- import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js";
17
- import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-Dj5bx8fg.js";
18
- import { _ as _sfc_main$q, T as TEMPLATES } from "./index-CGHNWhkM.js";
19
- import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js";
20
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BWazFYuZ.js";
21
- import { c as core, S as SvcConfig } from "./index-BSIUoSG3.js";
22
- import "./index-raYm7Ew2.js";
23
- import "./index-Cibwzgac.js";
24
- import "./index-DISwCnfH.js";
25
- import "./index-BZAlqAaJ.js";
14
+ import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-DpsrI-Z3.js";
15
+ import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js";
16
+ import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-B2H3D_kZ.js";
17
+ import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-Or1ZDzDS.js";
18
+ import { _ as _sfc_main$q, T as TEMPLATES } from "./index-DdVZgYE4.js";
19
+ import { u as useI18n } from "./vue-i18n-BXzrZRP6.js";
20
+ import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-DVQE9v2R.js";
21
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BORkgSMK.js";
22
+ import { c as core, S as SvcConfig } from "./index-Co9n8I_5.js";
23
+ import "./index-BxJgFvym.js";
24
+ import "./index-C363BG5A.js";
25
+ import "./index-C0QHb5SL.js";
26
+ import "./index-CLL3no-v.js";
26
27
  import { useCoreStore } from "@feedmepos/mf-common";
27
- import { i as initCollectibleConfig } from "./helper-DL6hnmtJ.js";
28
- import { C as CollectionUtils } from "./collection.fn-BjaBPYMU.js";
28
+ import { i as initCollectibleConfig } from "./helper-BBlHhMFc.js";
29
+ import { C as CollectionUtils } from "./collection.fn-D_i45T4Q.js";
29
30
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
30
31
  import { useDialog } from "@feedmepos/ui-library";
31
- import { u as useCampaignStore } from "./campaign-CMb05XLt.js";
32
+ import { u as useCampaignStore } from "./campaign-CNbUA51l.js";
32
33
  import { a as cleanPF } from "./object-qECH92oz.js";
33
34
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
34
35
  __name: "SegmentConfigurator",
@@ -39,21 +40,21 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
39
40
  }
40
41
  },
41
42
  emits: ["update:model-value"],
42
- setup(e, { emit: i }) {
43
- const n = e, r = computed(() => {
44
- var t;
45
- const [s] = isRuleGroup(n.modelValue) ? Object.values(((t = n.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
46
- return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
47
- }), o = i;
48
- return (s, l) => (openBlock(), createBlock(_sfc_main$q, {
43
+ setup(e, { emit: d }) {
44
+ const a = e, s = computed(() => {
45
+ var l;
46
+ const [u] = isRuleGroup(a.modelValue) ? Object.values(((l = a.modelValue) == null ? void 0 : l.rules) ?? {}) : [null];
47
+ return (u ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
48
+ }), r = d;
49
+ return (u, o) => (openBlock(), createBlock(_sfc_main$q, {
49
50
  multiselect: !0,
50
51
  items: unref(useMembershipStore)().segmentOptions,
51
- "model-value": unref(r),
52
- "onUpdate:modelValue": l[0] || (l[0] = (t) => o(
52
+ "model-value": unref(s),
53
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => r(
53
54
  "update:model-value",
54
55
  unref(RuleBuilder).setRuleToGroup(
55
56
  unref(RuleBuilder).scaffoldGroup("g_segment"),
56
- unref(RuleBuilder).constructEntry("user.segment", "_hasAny", t)
57
+ unref(RuleBuilder).constructEntry("user.segment", "_hasAny", l)
57
58
  )
58
59
  )),
59
60
  label: "Select segment(s) to match"
@@ -69,75 +70,78 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
69
70
  }
70
71
  },
71
72
  emits: ["update:model-value"],
72
- setup(e, { emit: i }) {
73
- const n = e, r = i, o = ref(
74
- 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"
75
- ), s = [
73
+ setup(e, { emit: d }) {
74
+ const { t: a } = useI18n(), s = e, r = d, u = ref(
75
+ s.modelValue ? RuleBuilder.getRules(s.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(s.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
76
+ ), o = [
76
77
  {
77
78
  value: "all_users",
78
- label: "All audience"
79
+ label: a("connect.template.rule.audience.all")
79
80
  },
80
81
  {
81
82
  value: "segment",
82
- label: "Member segment"
83
+ label: a("connect.template.rule.audience.member_segment")
83
84
  },
84
85
  {
85
86
  value: "custom",
86
- label: "Custom audience"
87
+ label: a("connect.template.rule.audience.custom_audience")
87
88
  }
88
89
  ];
89
- return watch(o, async (l, t) => {
90
- var a;
91
- if (t != "all_users" && t != l && RuleBuilder.getRules(
92
- (a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
90
+ return watch(u, async (l, n) => {
91
+ var c;
92
+ if (n != "all_users" && n != l && RuleBuilder.getRules(
93
+ (c = s.modelValue) == null ? void 0 : c.rules[n == "custom" ? "g_user" : "g_segment"]
93
94
  ).length > 0) {
94
- const c = await prompt.confirm(
95
- "Are you sure you want to change the audience type? This will remove all the rules you have set."
95
+ const g = await prompt.confirm(
96
+ a("connect.template.rule.audience.confirm_remove"),
97
+ a("connect.common.confirm"),
98
+ a("connect.common.confirm"),
99
+ a("connect.common.cancel")
96
100
  );
97
- c && r(
101
+ g && r(
98
102
  "update:model-value",
99
103
  RuleBuilder.setRuleToGroup(
100
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
101
- RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
104
+ s.modelValue ?? RuleBuilder.scaffoldGroup(),
105
+ RuleBuilder.scaffoldGroup(n == "custom" ? "g_user" : "g_segment")
102
106
  )
103
- ), o.value = c ? l : t;
107
+ ), u.value = g ? l : n;
104
108
  }
105
- }), (l, t) => {
106
- var c, v;
107
- const a = resolveComponent("FmRadio");
109
+ }), (l, n) => {
110
+ var g, p;
111
+ const c = resolveComponent("FmRadio");
108
112
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
109
113
  createElementVNode("div", null, [
110
- (openBlock(), createElementBlock(Fragment, null, renderList(s, (m) => createVNode(a, {
111
- key: m.value,
112
- value: m.value,
113
- label: m.label,
114
- modelValue: unref(o),
115
- "onUpdate:modelValue": t[0] || (t[0] = (g) => isRef(o) ? o.value = g : null)
114
+ (openBlock(), createElementBlock(Fragment, null, renderList(o, (v) => createVNode(c, {
115
+ key: v.value,
116
+ value: v.value,
117
+ label: v.label,
118
+ modelValue: unref(u),
119
+ "onUpdate:modelValue": n[0] || (n[0] = (h) => isRef(u) ? u.value = h : null)
116
120
  }, null, 8, ["value", "label", "modelValue"])), 64))
117
121
  ]),
118
- unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
122
+ unref(u) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
119
123
  createVNode(_sfc_main$p, {
120
- modelValue: ((c = e.modelValue) == null ? void 0 : c.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
121
- "onUpdate:modelValue": t[1] || (t[1] = (m) => r(
124
+ modelValue: ((g = e.modelValue) == null ? void 0 : g.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
125
+ "onUpdate:modelValue": n[1] || (n[1] = (v) => r(
122
126
  "update:model-value",
123
127
  unref(RuleBuilder).setRuleToGroup(
124
128
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
125
- m,
129
+ v,
126
130
  "&&"
127
131
  )
128
132
  ))
129
133
  }, null, 8, ["modelValue"])
130
134
  ])) : createCommentVNode("", !0),
131
- unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
135
+ unref(u) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
132
136
  key: 1,
133
137
  "include-only": "user",
134
138
  "trigger-type": "MEMBERSHIP_JOINED",
135
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
136
- "onUpdate:modelValue": t[2] || (t[2] = (m) => r(
139
+ "model-value": ((p = e.modelValue) == null ? void 0 : p.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
140
+ "onUpdate:modelValue": n[2] || (n[2] = (v) => r(
137
141
  "update:model-value",
138
142
  unref(RuleBuilder).setRuleToGroup(
139
143
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
140
- m,
144
+ v,
141
145
  "&&"
142
146
  )
143
147
  ))
@@ -155,77 +159,83 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
155
159
  }
156
160
  },
157
161
  emits: ["update:model-value"],
158
- setup(e, { emit: i }) {
159
- const n = e, r = i, o = ref(
160
- !n.modelValue || !n.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(n.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
162
+ setup(e, { emit: d }) {
163
+ const { t: a } = useI18n(), s = e, r = d, u = ref(
164
+ !s.modelValue || !s.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(s.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
161
165
  );
162
- watch(o, async (l, t) => {
163
- var a;
164
- if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
165
- const c = await prompt.confirm(
166
- "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
166
+ watch(u, async (l, n) => {
167
+ var c;
168
+ if (n == "custom" && l == "all_time" && RuleBuilder.getRules((c = s.modelValue) == null ? void 0 : c.rules.g_time).length > 0) {
169
+ const g = await prompt.confirm(
170
+ a("connect.template.rule.time.confirm_remove"),
171
+ a("connect.common.confirm"),
172
+ a("connect.common.confirm"),
173
+ a("connect.common.cancel")
167
174
  );
168
- c && r(
175
+ g && r(
169
176
  "update:model-value",
170
177
  RuleBuilder.setRuleToGroup(
171
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
178
+ s.modelValue ?? RuleBuilder.scaffoldGroup(),
172
179
  RuleBuilder.scaffoldGroup("g_time")
173
180
  )
174
- ), o.value = c ? l : t;
181
+ ), u.value = g ? l : n;
175
182
  }
176
183
  });
177
- async function s(l) {
178
- var t;
179
- if (l == "custom" && RuleBuilder.getRules((t = n.modelValue) == null ? void 0 : t.rules.g_time).length > 0) {
184
+ async function o(l) {
185
+ var n;
186
+ if (l == "custom" && RuleBuilder.getRules((n = s.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
180
187
  if (!await prompt.confirm(
181
- "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
188
+ a("connect.template.rule.time.confirm_remove"),
189
+ a("connect.common.confirm"),
190
+ a("connect.common.confirm"),
191
+ a("connect.common.cancel")
182
192
  )) {
183
- o.value = "all_time";
193
+ u.value = "all_time";
184
194
  return;
185
195
  }
186
196
  r(
187
197
  "update:model-value",
188
198
  RuleBuilder.setRuleToGroup(
189
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
199
+ s.modelValue ?? RuleBuilder.scaffoldGroup(),
190
200
  RuleBuilder.scaffoldGroup("g_time")
191
201
  )
192
202
  );
193
203
  }
194
204
  }
195
- return (l, t) => {
196
- var v;
197
- const a = resolveComponent("FmRadio"), c = resolveComponent("FmRadioGroup");
205
+ return (l, n) => {
206
+ var p;
207
+ const c = resolveComponent("FmRadio"), g = resolveComponent("FmRadioGroup");
198
208
  return openBlock(), createElementBlock("div", _hoisted_1$j, [
199
- createVNode(c, {
200
- modelValue: unref(o),
209
+ createVNode(g, {
210
+ modelValue: unref(u),
201
211
  "onUpdate:modelValue": [
202
- t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
203
- t[1] || (t[1] = (m) => s(m))
212
+ n[0] || (n[0] = (v) => isRef(u) ? u.value = v : null),
213
+ n[1] || (n[1] = (v) => o(v))
204
214
  ]
205
215
  }, {
206
216
  default: withCtx(() => [
207
- createVNode(a, {
208
- label: "All time",
217
+ createVNode(c, {
218
+ label: unref(a)("connect.template.rule.time.all_time"),
209
219
  value: "all_time"
210
- }),
211
- createVNode(a, {
212
- label: "Custom date/time",
220
+ }, null, 8, ["label"]),
221
+ createVNode(c, {
222
+ label: unref(a)("connect.template.rule.time.custom"),
213
223
  value: "custom"
214
- })
224
+ }, null, 8, ["label"])
215
225
  ]),
216
226
  _: 1
217
227
  }, 8, ["modelValue"]),
218
- unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
228
+ unref(u) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
219
229
  key: 0,
220
230
  class: "!mt-[0px]",
221
231
  "include-only": "trigger",
222
232
  "trigger-type": "SCHEDULE",
223
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
224
- "onUpdate:modelValue": t[2] || (t[2] = (m) => r(
233
+ "model-value": ((p = e.modelValue) == null ? void 0 : p.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
234
+ "onUpdate:modelValue": n[2] || (n[2] = (v) => r(
225
235
  "update:model-value",
226
236
  unref(RuleBuilder).setRuleToGroup(
227
237
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
228
- m,
238
+ v,
229
239
  "&&"
230
240
  )
231
241
  ))
@@ -243,19 +253,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
243
253
  }
244
254
  },
245
255
  emits: ["update:model-value"],
246
- setup(e, { emit: i }) {
247
- const n = i;
248
- return (r, o) => {
249
- var s;
256
+ setup(e, { emit: d }) {
257
+ const a = d;
258
+ return (s, r) => {
259
+ var u;
250
260
  return openBlock(), createBlock(_sfc_main$r, {
251
261
  "include-only": "bill",
252
262
  "trigger-type": "BILL_COMPLETED",
253
- "model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
254
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n(
263
+ "model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
264
+ "onUpdate:modelValue": r[0] || (r[0] = (o) => a(
255
265
  "update:model-value",
256
266
  unref(RuleBuilder).setRuleToGroup(
257
267
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
258
- l,
268
+ o,
259
269
  "&&"
260
270
  )
261
271
  ))
@@ -270,29 +280,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
270
280
  }
271
281
  },
272
282
  emits: ["update:model-value"],
273
- setup(e, { emit: i }) {
274
- const n = e, r = i, o = computed(() => {
275
- const { property: s, operator: l, equator: t } = RuleBuilder.simplify(
276
- n.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
283
+ setup(e, { emit: d }) {
284
+ const a = e, s = d, r = computed(() => {
285
+ const { property: u, operator: o, equator: l } = RuleBuilder.simplify(
286
+ a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
277
287
  op: "before",
278
288
  x: 1
279
289
  })
280
290
  );
281
291
  return {
282
- property: s,
283
- operator: l,
284
- equator: t
292
+ property: u,
293
+ operator: o,
294
+ equator: l
285
295
  };
286
296
  });
287
- return (s, l) => {
288
- const t = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
297
+ return (u, o) => {
298
+ const l = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
289
299
  return openBlock(), createElementBlock("div", null, [
290
- createVNode(t, {
300
+ createVNode(l, {
291
301
  label: "On birthday",
292
302
  value: "_isRange-day",
293
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
294
- "onUpdate:modelValue": l[0] || (l[0] = () => {
295
- r(
303
+ "model-value": `${unref(r).operator}-${unref(r).equator.unit}`,
304
+ "onUpdate:modelValue": o[0] || (o[0] = () => {
305
+ s(
296
306
  "update:model-value",
297
307
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
298
308
  op: "this",
@@ -302,12 +312,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
302
312
  );
303
313
  })
304
314
  }, null, 8, ["model-value"]),
305
- createVNode(t, {
315
+ createVNode(l, {
306
316
  label: "N days before birthday",
307
317
  value: "_isDay",
308
- "model-value": unref(o).operator,
309
- "onUpdate:modelValue": l[1] || (l[1] = () => {
310
- r(
318
+ "model-value": unref(r).operator,
319
+ "onUpdate:modelValue": o[1] || (o[1] = () => {
320
+ s(
311
321
  "update:model-value",
312
322
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
313
323
  op: "after",
@@ -317,12 +327,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
317
327
  );
318
328
  })
319
329
  }, null, 8, ["model-value"]),
320
- unref(o).operator == "_isDay" ? (openBlock(), createBlock(a, {
330
+ unref(r).operator == "_isDay" ? (openBlock(), createBlock(n, {
321
331
  key: 0,
322
332
  label: "Days before birthday",
323
333
  "show-steppers": !1,
324
- "model-value": unref(o).equator.x,
325
- "onUpdate:modelValue": l[2] || (l[2] = (c) => r(
334
+ "model-value": unref(r).equator.x,
335
+ "onUpdate:modelValue": o[2] || (o[2] = (c) => s(
326
336
  "update:model-value",
327
337
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
328
338
  op: "after",
@@ -331,12 +341,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
331
341
  })
332
342
  ))
333
343
  }, null, 8, ["model-value"])) : createCommentVNode("", !0),
334
- createVNode(t, {
344
+ createVNode(l, {
335
345
  label: "In birthday week",
336
346
  value: "_isRange-week",
337
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
338
- "onUpdate:modelValue": l[3] || (l[3] = () => {
339
- r(
347
+ "model-value": `${unref(r).operator}-${unref(r).equator.unit}`,
348
+ "onUpdate:modelValue": o[3] || (o[3] = () => {
349
+ s(
340
350
  "update:model-value",
341
351
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
342
352
  op: "this",
@@ -346,12 +356,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
346
356
  );
347
357
  })
348
358
  }, null, 8, ["model-value"]),
349
- createVNode(t, {
359
+ createVNode(l, {
350
360
  label: "In birthday month",
351
361
  value: "_isRange-month",
352
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
353
- "onUpdate:modelValue": l[4] || (l[4] = () => {
354
- r(
362
+ "model-value": `${unref(r).operator}-${unref(r).equator.unit}`,
363
+ "onUpdate:modelValue": o[4] || (o[4] = () => {
364
+ s(
355
365
  "update:model-value",
356
366
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
357
367
  op: "this",
@@ -374,19 +384,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
374
384
  }
375
385
  },
376
386
  emits: ["update:model-value"],
377
- setup(e, { emit: i }) {
378
- const n = i;
379
- return (r, o) => {
380
- var s;
387
+ setup(e, { emit: d }) {
388
+ const a = d;
389
+ return (s, r) => {
390
+ var u;
381
391
  return openBlock(), createBlock(_sfc_main$r, {
382
392
  "include-only": "feedback",
383
393
  "trigger-type": "FEEDBACK",
384
- "model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
385
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n(
394
+ "model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
395
+ "onUpdate:modelValue": r[0] || (r[0] = (o) => a(
386
396
  "update:model-value",
387
397
  unref(RuleBuilder).setRuleToGroup(
388
398
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
389
- l,
399
+ o,
390
400
  "&&"
391
401
  )
392
402
  ))
@@ -461,10 +471,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
461
471
  "GAME",
462
472
  "MISSION"
463
473
  ].map((e) => {
464
- const i = CAMPAIGN_TRIGGER[e];
474
+ const d = CAMPAIGN_TRIGGER[e];
465
475
  return [
466
476
  e,
467
- (i == null ? void 0 : i.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
477
+ (d == null ? void 0 : d.map((a) => TriggerOptions[a]).filter((a) => !a.hidden)) ?? []
468
478
  ];
469
479
  })
470
480
  ), _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({
@@ -483,31 +493,31 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
483
493
  }
484
494
  },
485
495
  emits: ["update:model-value"],
486
- setup(e, { emit: i }) {
487
- const n = e, r = i, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
488
- (s) => s.value == n.modelValue
489
- ) : TypeToTriggerOptions[n.campaignType]);
490
- return (s, l) => {
491
- const t = resolveComponent("FmCard");
496
+ setup(e, { emit: d }) {
497
+ const a = e, s = d, r = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
498
+ (u) => u.value == a.modelValue
499
+ ) : TypeToTriggerOptions[a.campaignType]);
500
+ return (u, o) => {
501
+ const l = resolveComponent("FmCard");
492
502
  return openBlock(), createElementBlock("div", _hoisted_1$i, [
493
503
  _hoisted_2$g,
494
504
  createElementVNode("div", _hoisted_3$e, [
495
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
505
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (n) => (openBlock(), createBlock(l, {
496
506
  variant: "outlined",
497
- disabled: n.disabled,
507
+ disabled: a.disabled,
498
508
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
499
- "col-span-3": unref(o).length == 1,
500
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
501
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
509
+ "col-span-3": unref(r).length == 1,
510
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
511
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
502
512
  }]),
503
513
  onClick: () => {
504
- n.modelValue != a.value && !n.disabled && r("update:model-value", a.value);
514
+ a.modelValue != n.value && !a.disabled && s("update:model-value", n.value);
505
515
  },
506
- key: a.name
516
+ key: n.name
507
517
  }, {
508
518
  default: withCtx(() => [
509
- createElementVNode("div", _hoisted_4$d, toDisplayString(a.name), 1),
510
- createElementVNode("div", _hoisted_5$8, toDisplayString(a.description), 1)
519
+ createElementVNode("div", _hoisted_4$d, toDisplayString(n.name), 1),
520
+ createElementVNode("div", _hoisted_5$8, toDisplayString(n.description), 1)
511
521
  ]),
512
522
  _: 2
513
523
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -528,27 +538,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
528
538
  }
529
539
  },
530
540
  emits: ["update:model-value"],
531
- setup(e, { emit: i }) {
532
- const n = i;
533
- return (r, o) => {
534
- const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
535
- return openBlock(), createBlock(t, {
541
+ setup(e, { emit: d }) {
542
+ const a = d;
543
+ return (s, r) => {
544
+ const u = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
545
+ return openBlock(), createBlock(l, {
536
546
  label: e.label,
537
547
  "model-value": e.modelValue || "",
538
- "onUpdate:modelValue": o[1] || (o[1] = (a) => n("update:model-value", a))
548
+ "onUpdate:modelValue": r[1] || (r[1] = (n) => a("update:model-value", n))
539
549
  }, {
540
- "trigger-button": withCtx(({ opened: a }) => [
541
- createVNode(l, {
550
+ "trigger-button": withCtx(({ opened: n }) => [
551
+ createVNode(o, {
542
552
  class: "flex items-center",
543
553
  "prepend-icon": "calendar_month",
544
- "icon-outlined": !a
554
+ "icon-outlined": !n
545
555
  }, {
546
556
  append: withCtx(() => [
547
- e.modelValue ? (openBlock(), createBlock(s, {
557
+ e.modelValue ? (openBlock(), createBlock(u, {
548
558
  key: 0,
549
559
  variant: "tertiary",
550
560
  icon: "clear",
551
- onClick: o[0] || (o[0] = (c) => (c.stopPropagation(), n("update:model-value", null)))
561
+ onClick: r[0] || (r[0] = (c) => (c.stopPropagation(), a("update:model-value", null)))
552
562
  })) : createCommentVNode("", !0)
553
563
  ]),
554
564
  default: withCtx(() => [
@@ -572,20 +582,20 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
572
582
  }
573
583
  },
574
584
  emits: ["update:model-value"],
575
- setup(e, { emit: i }) {
576
- const n = i;
577
- return (r, o) => {
578
- var s, l;
585
+ setup(e, { emit: d }) {
586
+ const a = d;
587
+ return (s, r) => {
588
+ var u, o;
579
589
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
580
590
  createElementVNode("div", _hoisted_2$f, [
581
591
  createVNode(_sfc_main$i, {
582
- "model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
592
+ "model-value": ((u = e.modelValue) == null ? void 0 : u.startDate) ?? null,
583
593
  label: "Start date",
584
- "onUpdate:modelValue": o[0] || (o[0] = (t) => {
585
- var a;
586
- return n("update:model-value", {
587
- startDate: t,
588
- endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
594
+ "onUpdate:modelValue": r[0] || (r[0] = (l) => {
595
+ var n;
596
+ return a("update:model-value", {
597
+ startDate: l,
598
+ endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
589
599
  });
590
600
  })
591
601
  }, null, 8, ["model-value"])
@@ -593,13 +603,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
593
603
  _hoisted_3$d,
594
604
  createElementVNode("div", _hoisted_4$c, [
595
605
  createVNode(_sfc_main$i, {
596
- "model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
606
+ "model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
597
607
  label: "End date",
598
- "onUpdate:modelValue": o[1] || (o[1] = (t) => {
599
- var a;
600
- return n("update:model-value", {
601
- startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
602
- endDate: t
608
+ "onUpdate:modelValue": r[1] || (r[1] = (l) => {
609
+ var n;
610
+ return a("update:model-value", {
611
+ startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
612
+ endDate: l
603
613
  });
604
614
  })
605
615
  }, null, 8, ["model-value"])
@@ -625,34 +635,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
625
635
  }
626
636
  },
627
637
  emits: ["update:model-value"],
628
- setup(e, { emit: i }) {
629
- const n = e, r = i;
630
- function o() {
631
- const m = RuleBuilder.getRules(n.modelValue);
632
- return m.length == 0 ? "fixed" : m.some(
633
- (g) => isRuleEntry(g) && RuleBuilder.simplify(g).operator == "_rrule"
638
+ setup(e, { emit: d }) {
639
+ const a = e, s = d;
640
+ function r() {
641
+ const p = RuleBuilder.getRules(a.modelValue);
642
+ return p.length == 0 ? "fixed" : p.some(
643
+ (v) => isRuleEntry(v) && RuleBuilder.simplify(v).operator == "_rrule"
634
644
  ) ? "repeating" : "fixed";
635
645
  }
636
- const s = ref(o()), l = ref(!1), t = computed(() => {
637
- const m = RuleBuilder.getRules(n.modelValue), g = m.find(
638
- (d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.date"
639
- ), p = m.find(
640
- (d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.time"
646
+ const u = ref(r()), o = ref(!1), l = computed(() => {
647
+ const p = RuleBuilder.getRules(a.modelValue), v = p.find(
648
+ (i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.date"
649
+ ), h = p.find(
650
+ (i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.time"
641
651
  );
642
652
  return {
643
- date: g ? RuleBuilder.simplify(g).equator : null,
644
- time: p ? RuleBuilder.simplify(p).equator : null
653
+ date: v ? RuleBuilder.simplify(v).equator : null,
654
+ time: h ? RuleBuilder.simplify(h).equator : null
645
655
  };
646
- }), a = computed(
656
+ }), n = computed(
647
657
  () => calculateNextScheduleAt(
648
- n.modelValue,
658
+ a.modelValue,
649
659
  /* @__PURE__ */ new Date(),
650
- n.startDate ? new Date(n.startDate) : void 0,
651
- n.endDate ? new Date(n.endDate) : void 0
660
+ a.startDate ? new Date(a.startDate) : void 0,
661
+ a.endDate ? new Date(a.endDate) : void 0
652
662
  )
653
663
  );
654
- function c(m) {
655
- const g = m.label.toLowerCase(), p = g == "fixed" ? [
664
+ function c(p) {
665
+ const v = p.label.toLowerCase(), h = v == "fixed" ? [
656
666
  RuleBuilder.constructEntry(
657
667
  "trigger.date",
658
668
  "_isOnDate",
@@ -667,73 +677,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
667
677
  ),
668
678
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
669
679
  ];
670
- r(
680
+ s(
671
681
  "update:model-value",
672
682
  RuleBuilder.setRuleToGroup(
673
683
  RuleBuilder.scaffoldGroup("g_schedule"),
674
- p
684
+ h
675
685
  )
676
- ), s.value = g;
686
+ ), u.value = v;
677
687
  }
678
- function v(m) {
679
- s.value == "fixed" ? r(
688
+ function g(p) {
689
+ u.value == "fixed" ? s(
680
690
  "update:model-value",
681
691
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
682
692
  RuleBuilder.constructEntry(
683
693
  "trigger.date",
684
694
  "_isOnDate",
685
- m.date
695
+ p.date
686
696
  ),
687
697
  RuleBuilder.constructEntry(
688
698
  "trigger.time",
689
699
  "_isOnTime",
690
- m.time
700
+ p.time
691
701
  )
692
702
  ])
693
- ) : r(
703
+ ) : s(
694
704
  "update:model-value",
695
705
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
696
706
  RuleBuilder.constructEntry(
697
707
  "trigger.date",
698
708
  "_rrule",
699
- m.date
709
+ p.date
700
710
  ),
701
711
  RuleBuilder.constructEntry(
702
712
  "trigger.time",
703
713
  "_isOnTime",
704
- m.time
714
+ p.time
705
715
  )
706
716
  ])
707
717
  );
708
718
  }
709
- return (m, g) => {
710
- const p = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
719
+ return (p, v) => {
720
+ const h = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), m = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), C = resolveComponent("FmCard"), E = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), B = resolveComponent("FmHelperText");
711
721
  return openBlock(), createElementBlock(Fragment, null, [
712
- createVNode(p, {
722
+ createVNode(h, {
713
723
  items: [{ label: "Fixed" }, { label: "Repeating" }],
714
- "model-value": { label: unref(cases).title(unref(s)) },
724
+ "model-value": { label: unref(cases).title(unref(u)) },
715
725
  "onUpdate:modelValue": c,
716
726
  class: "mb-8"
717
727
  }, null, 8, ["model-value"]),
718
728
  createElementVNode("div", _hoisted_1$g, [
719
729
  createElementVNode("div", _hoisted_2$e, [
720
- createVNode(d, {
730
+ createVNode(i, {
721
731
  label: "Notify time",
722
- "model-value": unref(t).time,
723
- "onUpdate:modelValue": g[0] || (g[0] = (E) => v({ date: unref(t).date, time: E })),
724
- "helper-text": unref(t).time ? void 0 : "Time is required",
725
- "helper-state": unref(t).time ? void 0 : "error"
732
+ "model-value": unref(l).time,
733
+ "onUpdate:modelValue": v[0] || (v[0] = (x) => g({ date: unref(l).date, time: x })),
734
+ "helper-text": unref(l).time ? void 0 : "Time is required",
735
+ "helper-state": unref(l).time ? void 0 : "error"
726
736
  }, null, 8, ["model-value", "helper-text", "helper-state"]),
727
- unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
737
+ unref(u) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
728
738
  createElementVNode("div", _hoisted_4$b, [
729
739
  _hoisted_5$7,
730
- unref(t).date ? (openBlock(), createBlock(f, {
740
+ unref(l).date ? (openBlock(), createBlock(f, {
731
741
  key: 0,
732
742
  "z-index": 9999,
733
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
743
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options)
734
744
  }, {
735
745
  default: withCtx(() => [
736
- createVNode(u, {
746
+ createVNode(m, {
737
747
  name: "info",
738
748
  size: "sm",
739
749
  outline: !0
@@ -742,30 +752,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
742
752
  _: 1
743
753
  }, 8, ["content"])) : createCommentVNode("", !0)
744
754
  ]),
745
- createVNode(C, {
746
- "show-popover": unref(l),
747
- onPopoverChanged: g[3] || (g[3] = (E) => l.value = E)
755
+ createVNode(E, {
756
+ "show-popover": unref(o),
757
+ onPopoverChanged: v[3] || (v[3] = (x) => o.value = x)
748
758
  }, {
749
759
  "popover-button": withCtx(() => [
750
760
  createVNode(y, {
751
761
  class: "cursor-pointer",
752
- "helper-text": unref(t).date ? void 0 : "Date is required",
753
- "helper-state": unref(t).date ? void 0 : "error"
762
+ "helper-text": unref(l).date ? void 0 : "Date is required",
763
+ "helper-state": unref(l).date ? void 0 : "error"
754
764
  }, {
755
765
  default: withCtx(() => [
756
- createElementVNode("div", _hoisted_6$4, toDisplayString(unref(t).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options) : "Set a repeating date"), 1)
766
+ createElementVNode("div", _hoisted_6$4, toDisplayString(unref(l).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options) : "Set a repeating date"), 1)
757
767
  ]),
758
768
  _: 1
759
769
  }, 8, ["helper-text", "helper-state"])
760
770
  ]),
761
771
  default: withCtx(() => [
762
- createVNode(k, { class: "elevated p-8 w-[450px]" }, {
772
+ createVNode(C, { class: "elevated p-8 w-[450px]" }, {
763
773
  default: withCtx(() => [
764
774
  createVNode(_sfc_main$s, {
765
775
  "apply-button": !0,
766
- "model-value": unref(t).date || "",
767
- onCancel: g[1] || (g[1] = (E) => l.value = !1),
768
- "onUpdate:modelValue": g[2] || (g[2] = (E) => (v({ date: E, time: unref(t).time }), l.value = !1))
776
+ "model-value": unref(l).date || "",
777
+ onCancel: v[1] || (v[1] = (x) => o.value = !1),
778
+ "onUpdate:modelValue": v[2] || (v[2] = (x) => (g({ date: x, time: unref(l).time }), o.value = !1))
769
779
  }, null, 8, ["model-value"])
770
780
  ]),
771
781
  _: 1
@@ -776,16 +786,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
776
786
  ])) : (openBlock(), createBlock(b, {
777
787
  key: 1,
778
788
  label: "Notify date",
779
- "model-value": unref(t).date || "",
780
- "onUpdate:modelValue": g[4] || (g[4] = (E) => v({ date: E, time: unref(t).time })),
781
- "helper-text": unref(t).date ? void 0 : "Date is required",
782
- "helper-state": unref(t).date ? void 0 : "error"
789
+ "model-value": unref(l).date || "",
790
+ "onUpdate:modelValue": v[4] || (v[4] = (x) => g({ date: x, time: unref(l).time })),
791
+ "helper-text": unref(l).date ? void 0 : "Date is required",
792
+ "helper-state": unref(l).date ? void 0 : "error"
783
793
  }, null, 8, ["model-value", "helper-text", "helper-state"]))
784
794
  ]),
785
- unref(t).date && unref(t).time && unref(a) ? (openBlock(), createBlock(x, {
795
+ unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(B, {
786
796
  key: 0,
787
- 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
788
- ${unref(hooks)(unref(a)).format("hh:mmA")} (${unref(hooks)(unref(a)).fromNow()})`
797
+ text: `${unref(hooks)(unref(n)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(n)).format("dddd, DD MMM YYYY")} at
798
+ ${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
789
799
  }, null, 8, ["text"])) : createCommentVNode("", !0)
790
800
  ])
791
801
  ], 64);
@@ -798,28 +808,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
798
808
  filterItems: { type: Function }
799
809
  },
800
810
  emits: ["confirm"],
801
- setup(e, { emit: i }) {
802
- const n = ref(), r = ref(!1);
803
- function o() {
804
- var l;
805
- (l = n.value) == null || l.onConfirm();
811
+ setup(e, { emit: d }) {
812
+ const a = ref(), s = ref(!1);
813
+ function r() {
814
+ var o;
815
+ (o = a.value) == null || o.onConfirm();
806
816
  }
807
- const s = i;
808
- return (l, t) => {
809
- const a = resolveComponent("FmField"), c = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
810
- return openBlock(), createBlock(v, {
811
- modelValue: r.value,
812
- "onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
817
+ const u = d;
818
+ return (o, l) => {
819
+ const n = resolveComponent("FmField"), c = resolveComponent("FmButton"), g = resolveComponent("FmSideSheet");
820
+ return openBlock(), createBlock(g, {
821
+ modelValue: s.value,
822
+ "onUpdate:modelValue": l[1] || (l[1] = (p) => s.value = p),
813
823
  title: "Select Items",
814
824
  "close-button": !1,
815
825
  "dismiss-away": !0,
816
826
  "max-width": 560
817
827
  }, {
818
828
  "side-sheet-button": withCtx(() => [
819
- renderSlot(l.$slots, "side-sheet-button", {}, () => [
820
- createVNode(a, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
829
+ renderSlot(o.$slots, "side-sheet-button", {}, () => [
830
+ createVNode(n, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
821
831
  default: withCtx(() => [
822
- createTextVNode(toDisplayString(l.modelValue.length) + " item(s) selected ", 1)
832
+ createTextVNode(toDisplayString(o.modelValue.length) + " item(s) selected ", 1)
823
833
  ]),
824
834
  _: 1
825
835
  })
@@ -829,12 +839,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
829
839
  createElementVNode("div", _hoisted_1$f, [
830
840
  createVNode(c, {
831
841
  variant: "tertiary",
832
- onClick: t[0] || (t[0] = (m) => r.value = !1),
842
+ onClick: l[0] || (l[0] = (p) => s.value = !1),
833
843
  label: "Cancel"
834
844
  }),
835
845
  createVNode(c, {
836
846
  variant: "primary",
837
- onClick: o,
847
+ onClick: r,
838
848
  label: "Confirm"
839
849
  })
840
850
  ])
@@ -844,11 +854,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
844
854
  class: "h-full",
845
855
  "max-height": 0,
846
856
  ref_key: "selectItemRef",
847
- ref: n,
848
- "initial-value": l.modelValue,
849
- "filter-items": l.filterItems,
850
- "on-complete": (m) => {
851
- s("confirm", m), r.value = !1;
857
+ ref: a,
858
+ "initial-value": o.modelValue,
859
+ "filter-items": o.filterItems,
860
+ "on-complete": (p) => {
861
+ u("confirm", p), s.value = !1;
852
862
  }
853
863
  }, null, 8, ["initial-value", "filter-items", "on-complete"])
854
864
  ]),
@@ -879,9 +889,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
879
889
  }
880
890
  },
881
891
  emits: ["update:model-value"],
882
- setup(e, { emit: i }) {
883
- var v, m, g;
884
- const n = useBusinessStore(), r = e, o = i, s = [
892
+ setup(e, { emit: d }) {
893
+ var g, p, v;
894
+ const a = useBusinessStore(), s = e, r = d, u = [
885
895
  {
886
896
  label: "Based on spending",
887
897
  sublabel: "Customers earn rewards based on how much they spend.",
@@ -892,22 +902,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
892
902
  sublabel: "Customers earn a set amount of rewards for specific actions.",
893
903
  value: "FIXED"
894
904
  }
895
- ].filter((p) => {
896
- var d, u;
897
- return r.fixedType || ((u = (d = r.extras) == null ? void 0 : d.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? p.value == "FIXED" : !0;
905
+ ].filter((h) => {
906
+ var i, m;
907
+ return s.fixedType || ((m = (i = s.extras) == null ? void 0 : i.campaign) == null ? void 0 : m.event.type) != "BILL_COMPLETED" ? h.value == "FIXED" : !0;
908
+ }), o = computed(() => {
909
+ var i, m;
910
+ const h = s.extras && "configs" in s.extras ? s.extras.configs.type : (i = s.extras) == null ? void 0 : i.campaign.type;
911
+ return (((m = CollectibleOptions[h]) == null ? void 0 : m.name) || "reward").toLowerCase();
898
912
  }), l = computed(() => {
899
- var d, u;
900
- const p = r.extras && "configs" in r.extras ? r.extras.configs.type : (d = r.extras) == null ? void 0 : d.campaign.type;
901
- return (((u = CollectibleOptions[p]) == null ? void 0 : u.name) || "reward").toLowerCase();
902
- }), t = computed(() => {
903
- const p = FdoEarningOption.safeParse(r.modelValue);
904
- return p.success ? [] : p.error.errors;
913
+ const h = FdoEarningOption.safeParse(s.modelValue);
914
+ return h.success ? [] : h.error.errors;
905
915
  });
906
- function a(p) {
907
- var d;
908
- p != ((d = r.modelValue) == null ? void 0 : d.type) && o(
916
+ function n(h) {
917
+ var i;
918
+ h != ((i = s.modelValue) == null ? void 0 : i.type) && r(
909
919
  "update:model-value",
910
- p === "FIXED" ? {
920
+ h === "FIXED" ? {
911
921
  type: "FIXED",
912
922
  amount: 1
913
923
  } : {
@@ -918,79 +928,79 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
918
928
  );
919
929
  }
920
930
  const c = ref(
921
- ((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
931
+ ((g = s.modelValue) == null ? void 0 : g.type) === "PROPORTIONAL" && !!((v = (p = s.modelValue) == null ? void 0 : p.property) != null && v.length) || !1
922
932
  );
923
- return (p, d) => {
924
- var E, V, N;
925
- const u = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
933
+ return (h, i) => {
934
+ var x, k, N;
935
+ const m = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), C = resolveComponent("FmPill"), E = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), B = resolveComponent("FmHelperText");
926
936
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
927
937
  createElementVNode("div", _hoisted_2$d, [
928
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
929
- var R, B;
930
- return openBlock(), createBlock(u, {
938
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (V) => {
939
+ var $, R;
940
+ return openBlock(), createBlock(m, {
931
941
  variant: "outlined",
932
942
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
933
- "col-span-2": unref(s).length == 1,
934
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) === h.value,
935
- "hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != h.value
943
+ "col-span-2": unref(u).length == 1,
944
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": (($ = e.modelValue) == null ? void 0 : $.type) === V.value,
945
+ "hover:bg-fm-color-opacity-sm": ((R = e.modelValue) == null ? void 0 : R.type) != V.value
936
946
  }]),
937
- onClick: ($) => a(h.value),
938
- key: h.value
947
+ onClick: (S) => n(V.value),
948
+ key: V.value
939
949
  }, {
940
950
  default: withCtx(() => [
941
- createElementVNode("div", _hoisted_3$b, toDisplayString(h.label), 1),
942
- createElementVNode("div", _hoisted_4$a, toDisplayString(h.sublabel), 1)
951
+ createElementVNode("div", _hoisted_3$b, toDisplayString(V.label), 1),
952
+ createElementVNode("div", _hoisted_4$a, toDisplayString(V.sublabel), 1)
943
953
  ]),
944
954
  _: 2
945
955
  }, 1032, ["class", "onClick"]);
946
956
  }), 128))
947
957
  ]),
948
958
  createElementVNode("div", _hoisted_5$6, [
949
- ((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(f, {
959
+ ((x = e.modelValue) == null ? void 0 : x.type) === "FIXED" ? (openBlock(), createBlock(f, {
950
960
  key: 0,
951
- label: `Receive ${unref(l)}(s)`,
961
+ label: `Receive ${unref(o)}(s)`,
952
962
  class: "flex-1",
953
- "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
954
- "onUpdate:modelValue": d[0] || (d[0] = (h) => o("update:model-value", {
963
+ "model-value": ((k = e.modelValue) == null ? void 0 : k.amount) ?? null,
964
+ "onUpdate:modelValue": i[0] || (i[0] = (V) => r("update:model-value", {
955
965
  ...e.modelValue ?? { type: "FIXED" },
956
- amount: h
966
+ amount: V
957
967
  }))
958
968
  }, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
959
969
  _hoisted_6$3,
960
970
  createVNode(b, {
961
971
  "model-value": unref(c),
962
- "onUpdate:modelValue": d[6] || (d[6] = (h) => {
963
- unref(c) != h && (o("update:model-value", {
972
+ "onUpdate:modelValue": i[6] || (i[6] = (V) => {
973
+ unref(c) != V && (r("update:model-value", {
964
974
  ...e.modelValue ?? {
965
975
  type: "PROPORTIONAL",
966
976
  amount: 1,
967
977
  every: 1
968
978
  },
969
- property: h ? [] : void 0,
979
+ property: V ? [] : void 0,
970
980
  every: 1
971
- }), c.value = h);
981
+ }), c.value = V);
972
982
  })
973
983
  }, {
974
984
  default: withCtx(() => [
975
985
  createVNode(y, {
976
986
  label: "Amount spent",
977
- sublabel: `Receive ${unref(l)} by amount spent`,
987
+ sublabel: `Receive ${unref(o)} by amount spent`,
978
988
  value: !1
979
989
  }, {
980
990
  label: withCtx(() => {
981
- var h, R;
991
+ var V, $;
982
992
  return [
983
993
  _hoisted_7$3,
984
- createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
994
+ createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(o)) + " by amount spent ", 1),
985
995
  unref(c) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
986
996
  createVNode(f, {
987
- label: `Receive ${unref(l)}(s)`,
997
+ label: `Receive ${unref(o)}(s)`,
988
998
  inputmode: "decimal",
989
999
  class: "flex-1",
990
- "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
991
- "onUpdate:modelValue": d[1] || (d[1] = (B) => o("update:model-value", {
1000
+ "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
1001
+ "onUpdate:modelValue": i[1] || (i[1] = (R) => r("update:model-value", {
992
1002
  ...e.modelValue ?? { type: "FIXED" },
993
- amount: B
1003
+ amount: R
994
1004
  }))
995
1005
  }, null, 8, ["label", "model-value"]),
996
1006
  _hoisted_10$3,
@@ -998,10 +1008,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
998
1008
  label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
999
1009
  class: "flex-1",
1000
1010
  inputmode: "decimal",
1001
- "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
1002
- "onUpdate:modelValue": d[2] || (d[2] = (B) => o("update:model-value", {
1011
+ "model-value": (($ = e.modelValue) == null ? void 0 : $.every) ?? null,
1012
+ "onUpdate:modelValue": i[2] || (i[2] = (R) => r("update:model-value", {
1003
1013
  ...e.modelValue,
1004
- every: B
1014
+ every: R
1005
1015
  }))
1006
1016
  }, {
1007
1017
  prepend: withCtx(() => [
@@ -1016,32 +1026,32 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1016
1026
  }, 8, ["sublabel"]),
1017
1027
  createVNode(y, {
1018
1028
  label: "Product bought",
1019
- sublabel: `Receive ${unref(l)} by product bought`,
1029
+ sublabel: `Receive ${unref(o)} by product bought`,
1020
1030
  value: !0,
1021
- disabled: !unref(n).isPremium
1031
+ disabled: !unref(a).isPremium
1022
1032
  }, {
1023
1033
  label: withCtx(() => {
1024
- var h, R;
1034
+ var V, $;
1025
1035
  return [
1026
1036
  createElementVNode("div", _hoisted_11$1, [
1027
1037
  createTextVNode(" Product bought "),
1028
- createVNode(k, { variant: "premium" })
1038
+ createVNode(C, { variant: "premium" })
1029
1039
  ]),
1030
- createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
1040
+ createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(o)) + " by product bought ", 1),
1031
1041
  unref(c) ? (openBlock(), createElementBlock("div", _hoisted_13, [
1032
1042
  createElementVNode("div", _hoisted_14, [
1033
1043
  createVNode(_sfc_main$f, {
1034
- "model-value": r.modelValue.property || [],
1035
- onConfirm: d[3] || (d[3] = (B) => o("update:model-value", {
1044
+ "model-value": s.modelValue.property || [],
1045
+ onConfirm: i[3] || (i[3] = (R) => r("update:model-value", {
1036
1046
  ...e.modelValue,
1037
- property: B
1047
+ property: R
1038
1048
  }))
1039
1049
  }, {
1040
1050
  "side-sheet-button": withCtx(() => {
1041
- var B, $;
1051
+ var R, S;
1042
1052
  return [
1043
- createVNode(C, {
1044
- label: (B = r.modelValue.property) != null && B.length ? `${($ = r.modelValue.property) == null ? void 0 : $.length} product(s) selected` : "Select product",
1053
+ createVNode(E, {
1054
+ label: (R = s.modelValue.property) != null && R.length ? `${(S = s.modelValue.property) == null ? void 0 : S.length} product(s) selected` : "Select product",
1045
1055
  icon: "link",
1046
1056
  variant: "secondary"
1047
1057
  }, null, 8, ["label"])
@@ -1053,24 +1063,24 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1053
1063
  createElementVNode("div", _hoisted_15, [
1054
1064
  createVNode(f, {
1055
1065
  inputmode: "decimal",
1056
- label: `Receive ${unref(l)}(s)`,
1066
+ label: `Receive ${unref(o)}(s)`,
1057
1067
  class: "flex-1",
1058
- "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
1059
- "onUpdate:modelValue": d[4] || (d[4] = (B) => o("update:model-value", {
1068
+ "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
1069
+ "onUpdate:modelValue": i[4] || (i[4] = (R) => r("update:model-value", {
1060
1070
  ...e.modelValue ?? { type: "FIXED" },
1061
- amount: B
1071
+ amount: R
1062
1072
  }))
1063
1073
  }, null, 8, ["label", "model-value"]),
1064
1074
  _hoisted_16,
1065
1075
  createVNode(f, {
1066
1076
  label: "Item purchased",
1067
1077
  class: "flex-1",
1068
- "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
1078
+ "model-value": (($ = e.modelValue) == null ? void 0 : $.every) ?? null,
1069
1079
  inputmode: "numeric",
1070
1080
  "max-fraction-digits": 0,
1071
- "onUpdate:modelValue": d[5] || (d[5] = (B) => o("update:model-value", {
1081
+ "onUpdate:modelValue": i[5] || (i[5] = (R) => r("update:model-value", {
1072
1082
  ...e.modelValue,
1073
- every: B
1083
+ every: R
1074
1084
  }))
1075
1085
  }, null, 8, ["model-value"])
1076
1086
  ])
@@ -1084,10 +1094,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1084
1094
  }, 8, ["model-value"])
1085
1095
  ], 64)) : createCommentVNode("", !0)
1086
1096
  ]),
1087
- e.errorText || unref(t).length > 0 ? (openBlock(), createBlock(x, {
1097
+ e.errorText || unref(l).length > 0 ? (openBlock(), createBlock(B, {
1088
1098
  key: 0,
1089
1099
  class: "!mt-4",
1090
- text: e.errorText || unref(ZodHelper).helperText(unref(t), ""),
1100
+ text: e.errorText || unref(ZodHelper).helperText(unref(l), ""),
1091
1101
  state: "error"
1092
1102
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1093
1103
  ]);
@@ -1101,8 +1111,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1101
1111
  }
1102
1112
  },
1103
1113
  emits: ["update:model-value"],
1104
- setup(e, { emit: i }) {
1105
- const n = e, r = i, o = computed(
1114
+ setup(e, { emit: d }) {
1115
+ const a = e, s = d, r = computed(
1106
1116
  () => [
1107
1117
  {
1108
1118
  label: "Fortune Wheel",
@@ -1116,28 +1126,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1116
1126
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
1117
1127
  hidden: !0
1118
1128
  }
1119
- ].filter((s) => !s.hidden)
1129
+ ].filter((u) => !u.hidden)
1120
1130
  );
1121
- return (s, l) => {
1122
- const t = resolveComponent("FmCard");
1131
+ return (u, o) => {
1132
+ const l = resolveComponent("FmCard");
1123
1133
  return openBlock(), createElementBlock("div", _hoisted_1$d, [
1124
1134
  _hoisted_2$c,
1125
1135
  createElementVNode("div", _hoisted_3$a, [
1126
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
1136
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (n) => (openBlock(), createBlock(l, {
1127
1137
  variant: "outlined",
1128
1138
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1129
- "col-span-2": unref(o).length == 1,
1130
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
1131
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
1139
+ "col-span-2": unref(r).length == 1,
1140
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1141
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1132
1142
  }]),
1133
1143
  onClick: () => {
1134
- n.modelValue != a.value && r("update:model-value", a.value);
1144
+ a.modelValue != n.value && s("update:model-value", n.value);
1135
1145
  },
1136
- key: a.value
1146
+ key: n.value
1137
1147
  }, {
1138
1148
  default: withCtx(() => [
1139
- createElementVNode("div", _hoisted_4$9, toDisplayString(a.label), 1),
1140
- createElementVNode("div", _hoisted_5$5, toDisplayString(a.description), 1)
1149
+ createElementVNode("div", _hoisted_4$9, toDisplayString(n.label), 1),
1150
+ createElementVNode("div", _hoisted_5$5, toDisplayString(n.description), 1)
1141
1151
  ]),
1142
1152
  _: 2
1143
1153
  }, 1032, ["class", "onClick"]))), 128))
@@ -1156,33 +1166,33 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1156
1166
  }
1157
1167
  },
1158
1168
  emits: ["update:model-value", "update:reward-image"],
1159
- setup(e, { emit: i }) {
1160
- const r = ref(
1169
+ setup(e, { emit: d }) {
1170
+ const { t: a } = useI18n(), r = ref(
1161
1171
  e.modelValue ?? initCollectibleConfig("VOUCHER", {
1162
1172
  business: useCoreStore().currentBusiness.value._id,
1163
1173
  name: ""
1164
1174
  })
1165
- ), o = FdtoCollectibleConfig, s = i;
1166
- return (l, t) => {
1167
- var v, m, g;
1168
- const a = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText");
1175
+ ), u = FdtoCollectibleConfig, o = d;
1176
+ return (l, n) => {
1177
+ var p, v, h;
1178
+ const c = resolveComponent("FmTextarea"), g = resolveComponent("FmHelperText");
1169
1179
  return openBlock(), createElementBlock(Fragment, null, [
1170
1180
  createVNode(_sfc_main$u, {
1171
1181
  modelValue: unref(r).name,
1172
- "onUpdate:modelValue": t[0] || (t[0] = (p) => unref(r).name = p),
1182
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => unref(r).name = i),
1173
1183
  label: "Voucher name",
1174
- schema: unref(ZodHelper).typeAtPath(unref(o), "name", [unref(r).type])
1184
+ schema: unref(ZodHelper).typeAtPath(unref(u), "name", [unref(r).type])
1175
1185
  }, null, 8, ["modelValue", "schema"]),
1176
- createVNode(a, {
1186
+ createVNode(c, {
1177
1187
  class: "!mb-[-16px]",
1178
1188
  modelValue: unref(r).description,
1179
- "onUpdate:modelValue": t[1] || (t[1] = (p) => unref(r).description = p),
1180
- rules: [unref(ZodHelper).ruleAtPath(unref(o), "description", [unref(r).type])]
1189
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => unref(r).description = i),
1190
+ rules: [unref(ZodHelper).ruleAtPath(unref(u), "description", [unref(r).type])]
1181
1191
  }, {
1182
1192
  label: withCtx(() => [
1183
1193
  (openBlock(), createBlock(resolveDynamicComponent(
1184
1194
  unref(ZodHelper).toInputLabel(
1185
- unref(ZodHelper).typeAtPath(unref(o), "description", [unref(r).type]),
1195
+ unref(ZodHelper).typeAtPath(unref(u), "description", [unref(r).type]),
1186
1196
  "Voucher description"
1187
1197
  )
1188
1198
  )))
@@ -1191,21 +1201,21 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1191
1201
  }, 8, ["modelValue", "rules"]),
1192
1202
  createElementVNode("div", _hoisted_1$c, [
1193
1203
  _hoisted_2$b,
1194
- createElementVNode("div", null, toDisplayString(((v = unref(r).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
1204
+ createElementVNode("div", null, toDisplayString(((p = unref(r).description) == null ? void 0 : p.length) ?? 0) + "/200", 1)
1195
1205
  ]),
1196
1206
  createVNode(_sfc_main$v, {
1197
1207
  class: "w-1/2 xs:w-2/3",
1198
1208
  "aspect-ratio": "16/9",
1199
1209
  file: e.rewardImage ?? void 0,
1200
1210
  thumbnail: unref(r).image ?? void 0,
1201
- "onUpdate:file": t[2] || (t[2] = async (p) => {
1202
- s("update:reward-image", p), p || (unref(r).image = null);
1211
+ "onUpdate:file": n[2] || (n[2] = async (i) => {
1212
+ o("update:reward-image", i), i || (unref(r).image = null);
1203
1213
  })
1204
1214
  }, {
1205
1215
  label: withCtx(() => [
1206
1216
  (openBlock(), createBlock(resolveDynamicComponent(
1207
1217
  unref(ZodHelper).toInputLabel(
1208
- unref(ZodHelper).typeAtPath(unref(o), "image", [unref(r).type]),
1218
+ unref(ZodHelper).typeAtPath(unref(u), "image", [unref(r).type]),
1209
1219
  "Voucher image"
1210
1220
  )
1211
1221
  )))
@@ -1215,30 +1225,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1215
1225
  _hoisted_3$9,
1216
1226
  createVNode(_sfc_main$w, {
1217
1227
  "model-value": unref(r).extras.effect,
1218
- "onUpdate:modelValue": t[3] || (t[3] = (p) => unref(r).extras.effect = p)
1228
+ "onUpdate:modelValue": n[3] || (n[3] = (i) => unref(r).extras.effect = i)
1219
1229
  }, null, 8, ["model-value"]),
1220
- unref(r).extras.effect == null ? (openBlock(), createBlock(c, {
1230
+ unref(r).extras.effect == null ? (openBlock(), createBlock(g, {
1221
1231
  key: 0,
1222
1232
  class: "!mt-8",
1223
- text: "Effect is required",
1233
+ text: unref(a)("connect.campaign.common.effect_required"),
1224
1234
  state: "error"
1225
- })) : createCommentVNode("", !0),
1235
+ }, null, 8, ["text"])) : createCommentVNode("", !0),
1226
1236
  _hoisted_4$8,
1227
1237
  createVNode(_sfc_main$x, {
1228
1238
  "model-value": unref(r).options,
1229
1239
  "no-campaign": unref(r).noCampaign,
1230
- "onUpdate:modelValue": t[4] || (t[4] = (p) => unref(r).options = p),
1231
- schema: unref(ZodHelper).typeAtPath(unref(o), "options", ["VOUCHER"])
1240
+ "onUpdate:modelValue": n[4] || (n[4] = (i) => unref(r).options = i),
1241
+ schema: unref(ZodHelper).typeAtPath(unref(u), "options", ["VOUCHER"])
1232
1242
  }, null, 8, ["model-value", "no-campaign", "schema"]),
1233
1243
  _hoisted_5$4,
1234
1244
  unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1235
1245
  key: 1,
1236
- "model-value": ((g = (m = unref(r).extras) == null ? void 0 : m.targetLocation) == null ? void 0 : g.map(String)) ?? null,
1246
+ "model-value": ((h = (v = unref(r).extras) == null ? void 0 : v.targetLocation) == null ? void 0 : h.map(String)) ?? null,
1237
1247
  type: "select",
1238
- "onUpdate:modelValue": t[5] || (t[5] = (p) => {
1239
- unref(r).extras.targetLocation = p;
1248
+ "onUpdate:modelValue": n[5] || (n[5] = (i) => {
1249
+ unref(r).extras.targetLocation = i;
1240
1250
  }),
1241
- rules: [unref(ZodHelper).ruleAtPath(unref(o), "extras.targetLocation")]
1251
+ rules: [unref(ZodHelper).ruleAtPath(unref(u), "extras.targetLocation")]
1242
1252
  }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
1243
1253
  ], 64);
1244
1254
  };
@@ -1249,73 +1259,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1249
1259
  }, _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({
1250
1260
  __name: "EditRewardPoolSheet",
1251
1261
  emits: ["update:model-value"],
1252
- setup(e, { expose: i, emit: n }) {
1253
- const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), c = computed(() => {
1254
- var u;
1255
- return ((u = r.loyaltyRewards.items.find(
1262
+ setup(e, { expose: d, emit: a }) {
1263
+ const s = useMembershipStore(), { minor: r } = useLoading, u = ref(!1), o = ref(), l = ref(), n = ref(0), c = computed(() => {
1264
+ var m;
1265
+ return ((m = s.loyaltyRewards.items.find(
1256
1266
  (f) => {
1257
1267
  var y;
1258
- return f.value === ((y = l.value) == null ? void 0 : y.collectible);
1268
+ return f.value === ((y = o.value) == null ? void 0 : y.collectible);
1259
1269
  }
1260
- )) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1261
- }), v = computed(() => {
1262
- const d = c.value.safeParse(l.value);
1263
- return d.success ? [] : d.error.errors;
1270
+ )) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1271
+ }), g = computed(() => {
1272
+ const i = c.value.safeParse(o.value);
1273
+ return i.success ? [] : i.error.errors;
1264
1274
  });
1265
- function m(d, u, f) {
1266
- d && (l.value = u, a.value = f), s.value = d;
1275
+ function p(i, m, f) {
1276
+ i && (o.value = m, n.value = f), u.value = i;
1267
1277
  }
1268
- const g = n;
1269
- async function p() {
1270
- const d = c.value.safeParse(l.value);
1271
- d.success && (await o(
1278
+ const v = a;
1279
+ async function h() {
1280
+ const i = c.value.safeParse(o.value);
1281
+ i.success && (await r(
1272
1282
  async () => {
1273
- d.data.type === "VOUCHER" && t.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
1274
- d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
1275
- t.value
1283
+ i.data.type === "VOUCHER" && l.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
1284
+ i.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
1285
+ l.value
1276
1286
  ));
1277
1287
  },
1278
1288
  {
1279
1289
  message: "Uploading reward image",
1280
1290
  successMessage: "Reward image updated"
1281
1291
  }
1282
- ), g("update:model-value", d.data, a.value));
1292
+ ), v("update:model-value", i.data, n.value));
1283
1293
  }
1284
- return i({
1285
- showSheet: m
1286
- }), (d, u) => {
1287
- const f = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
1288
- return openBlock(), createBlock(C, {
1294
+ return d({
1295
+ showSheet: p
1296
+ }), (i, m) => {
1297
+ const f = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), C = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
1298
+ return openBlock(), createBlock(E, {
1289
1299
  "max-width": 560,
1290
- modelValue: unref(s),
1300
+ modelValue: unref(u),
1291
1301
  "onUpdate:modelValue": [
1292
- u[9] || (u[9] = (b) => isRef(s) ? s.value = b : null),
1293
- u[10] || (u[10] = (b) => s.value = b)
1302
+ m[9] || (m[9] = (b) => isRef(u) ? u.value = b : null),
1303
+ m[10] || (m[10] = (b) => u.value = b)
1294
1304
  ],
1295
1305
  header: "Edit reward",
1296
1306
  "dismiss-away": ""
1297
1307
  }, {
1298
1308
  "side-sheet-footer": withCtx(() => [
1299
1309
  createElementVNode("div", _hoisted_4$7, [
1300
- createVNode(k, {
1310
+ createVNode(C, {
1301
1311
  variant: "primary",
1302
1312
  type: "button",
1303
- disabled: unref(v).length > 0,
1313
+ disabled: unref(g).length > 0,
1304
1314
  label: "Confirm",
1305
- onClick: u[7] || (u[7] = (b) => p())
1315
+ onClick: m[7] || (m[7] = (b) => h())
1306
1316
  }, null, 8, ["disabled"]),
1307
- createVNode(k, {
1317
+ createVNode(C, {
1308
1318
  variant: "secondary",
1309
1319
  type: "button",
1310
1320
  label: "Cancel",
1311
- onClick: u[8] || (u[8] = (b) => s.value = !1)
1321
+ onClick: m[8] || (m[8] = (b) => u.value = !1)
1312
1322
  })
1313
1323
  ])
1314
1324
  ]),
1315
1325
  default: withCtx(() => {
1316
- var b, x, E;
1326
+ var b, B, x;
1317
1327
  return [
1318
- unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1328
+ unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1319
1329
  createVNode(f, {
1320
1330
  label: "Reward Type",
1321
1331
  items: [
@@ -1323,13 +1333,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1323
1333
  { label: "Voucher", value: "VOUCHER" },
1324
1334
  { label: "Loyalty", value: "LOYALTY" }
1325
1335
  ],
1326
- "model-value": unref(l).type,
1327
- "onUpdate:modelValue": u[0] || (u[0] = (V) => {
1328
- V == "NO_REWARD" ? l.value = {
1336
+ "model-value": unref(o).type,
1337
+ "onUpdate:modelValue": m[0] || (m[0] = (k) => {
1338
+ k == "NO_REWARD" ? o.value = {
1329
1339
  type: "NO_REWARD",
1330
1340
  collectible: null,
1331
1341
  weight: 1
1332
- } : V === "VOUCHER" ? l.value = {
1342
+ } : k === "VOUCHER" ? o.value = {
1333
1343
  collectible: null,
1334
1344
  type: "VOUCHER",
1335
1345
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1343,8 +1353,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1343
1353
  validForDay: 7
1344
1354
  },
1345
1355
  weight: 1
1346
- } : l.value = {
1347
- collectible: unref(r).loyaltyRewards.raw[0]._id,
1356
+ } : o.value = {
1357
+ collectible: unref(s).loyaltyRewards.raw[0]._id,
1348
1358
  type: "LOYALTY",
1349
1359
  earningOption: {
1350
1360
  amount: 1,
@@ -1357,74 +1367,74 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1357
1367
  };
1358
1368
  })
1359
1369
  }, null, 8, ["model-value"]),
1360
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
1370
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(f, {
1361
1371
  key: 0,
1362
1372
  label: "Loyalty type",
1363
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(l).type])],
1364
- items: unref(r).loyaltyRewards.items,
1365
- "model-value": unref(l).collectible,
1366
- "onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
1373
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(o).type])],
1374
+ items: unref(s).loyaltyRewards.items,
1375
+ "model-value": unref(o).collectible,
1376
+ "onUpdate:modelValue": m[1] || (m[1] = (k) => unref(o).collectible = k)
1367
1377
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1368
1378
  createVNode(y, {
1369
1379
  label: "Weight",
1370
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(l).type])],
1371
- "model-value": unref(l).weight,
1372
- "onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
1373
- ...unref(l),
1374
- weight: V
1380
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(o).type])],
1381
+ "model-value": unref(o).weight,
1382
+ "onUpdate:modelValue": m[2] || (m[2] = (k) => o.value = {
1383
+ ...unref(o),
1384
+ weight: k
1375
1385
  })
1376
1386
  }, null, 8, ["rules", "model-value"]),
1377
- unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1378
- ((b = unref(r).loyaltyRewards.items.find(
1379
- (V) => {
1387
+ unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1388
+ ((b = unref(s).loyaltyRewards.items.find(
1389
+ (k) => {
1380
1390
  var N;
1381
- return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
1391
+ return k.value === ((N = unref(o)) == null ? void 0 : N.collectible);
1382
1392
  }
1383
1393
  )) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1384
1394
  _hoisted_2$a,
1385
1395
  createVNode(_sfc_main$e, {
1386
1396
  class: "mt-[-8px]",
1387
1397
  rules: [
1388
- unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(l).type])
1398
+ unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(o).type])
1389
1399
  ],
1390
- "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
1391
- "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
1400
+ "helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
1401
+ "error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
1392
1402
  "fixed-type": !0,
1393
- "model-value": unref(l).earningOption,
1394
- "onUpdate:modelValue": u[3] || (u[3] = (V) => l.value = {
1395
- ...unref(l),
1396
- earningOption: V
1403
+ "model-value": unref(o).earningOption,
1404
+ "onUpdate:modelValue": m[3] || (m[3] = (k) => o.value = {
1405
+ ...unref(o),
1406
+ earningOption: k
1397
1407
  })
1398
1408
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
1399
1409
  ], 64)) : createCommentVNode("", !0),
1400
1410
  _hoisted_3$8,
1401
1411
  createVNode(_sfc_main$z, {
1402
- "for-credit": unref(l).type === "LOYALTY" && ((x = unref(r).loyaltyRewards.items.find(
1403
- (V) => {
1412
+ "for-credit": unref(o).type === "LOYALTY" && ((B = unref(s).loyaltyRewards.items.find(
1413
+ (k) => {
1404
1414
  var N;
1405
- return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
1415
+ return k.value === ((N = unref(o)) == null ? void 0 : N.collectible);
1406
1416
  }
1407
- )) == null ? void 0 : x.raw.type) === "CREDIT",
1417
+ )) == null ? void 0 : B.raw.type) === "CREDIT",
1408
1418
  class: "!gap-24",
1409
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(l).type])],
1410
- "model-value": unref(l).validityOption,
1411
- "onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
1412
- ...unref(l),
1413
- validityOption: V
1419
+ rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(o).type])],
1420
+ "model-value": unref(o).validityOption,
1421
+ "onUpdate:modelValue": m[4] || (m[4] = (k) => o.value = {
1422
+ ...unref(o),
1423
+ validityOption: k
1414
1424
  })
1415
1425
  }, null, 8, ["for-credit", "rules", "model-value"])
1416
1426
  ], 64)) : createCommentVNode("", !0),
1417
- unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1427
+ unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1418
1428
  key: 2,
1419
- "reward-image": unref(t),
1420
- "model-value": ((E = unref(l)) == null ? void 0 : E.collectibleConfig) ?? void 0,
1421
- "onUpdate:modelValue": u[5] || (u[5] = (V) => l.value = {
1422
- ...unref(l),
1423
- collectibleConfig: V
1429
+ "reward-image": unref(l),
1430
+ "model-value": ((x = unref(o)) == null ? void 0 : x.collectibleConfig) ?? void 0,
1431
+ "onUpdate:modelValue": m[5] || (m[5] = (k) => o.value = {
1432
+ ...unref(o),
1433
+ collectibleConfig: k
1424
1434
  }),
1425
- "onUpdate:rewardImage": u[6] || (u[6] = (V) => t.value = V)
1435
+ "onUpdate:rewardImage": m[6] || (m[6] = (k) => l.value = k)
1426
1436
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1427
- createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
1437
+ createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
1428
1438
  ])) : createCommentVNode("", !0)
1429
1439
  ];
1430
1440
  }),
@@ -1451,86 +1461,86 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1451
1461
  }
1452
1462
  },
1453
1463
  emits: ["update:model-value"],
1454
- setup(e, { emit: i }) {
1455
- 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(() => {
1456
- const d = s.safeParse(l.value);
1457
- return d.success ? [] : d.error.errors;
1458
- }), a = ref();
1459
- function c(d, u) {
1464
+ setup(e, { emit: d }) {
1465
+ const a = e, s = d, r = useMembershipStore(), u = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), l = computed(() => {
1466
+ const i = u.safeParse(o.value);
1467
+ return i.success ? [] : i.error.errors;
1468
+ }), n = ref();
1469
+ function c(i, m) {
1460
1470
  var y;
1461
- const f = [...l.value];
1462
- f[u] = d, (y = a.value) == null || y.showSheet(!1), r("update:model-value", f);
1471
+ const f = [...o.value];
1472
+ f[m] = i, (y = n.value) == null || y.showSheet(!1), s("update:model-value", f);
1463
1473
  }
1464
- function v(d) {
1465
- const u = d.type == "VOUCHER" ? d.collectibleConfig : o.collectibles.find(
1466
- (k) => k._id.toString() == d.collectible
1467
- ), f = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), y = d.weight;
1474
+ function g(i) {
1475
+ const m = i.type == "VOUCHER" ? i.collectibleConfig : r.collectibles.find(
1476
+ (C) => C._id.toString() == i.collectible
1477
+ ), f = CollectionUtils.formattedType((m == null ? void 0 : m.name) || ""), y = i.weight;
1468
1478
  return {
1469
1479
  label: isNullOrEmpty(f) ? "NO REWARD" : f,
1470
- sublabel: `${y} (${(y / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
1480
+ sublabel: `${y} (${(y / o.value.reduce((C, E) => C + E.weight, 0) * 100).toFixed(2)}%)`
1471
1481
  };
1472
1482
  }
1473
- function m(d) {
1483
+ function p(i) {
1474
1484
  var f;
1475
- const u = [...l.value];
1476
- (f = a.value) == null || f.showSheet(!0, u[d], d);
1485
+ const m = [...o.value];
1486
+ (f = n.value) == null || f.showSheet(!0, m[i], i);
1477
1487
  }
1478
- function g(d) {
1479
- const u = [...l.value];
1480
- u.splice(d, 1), r("update:model-value", u);
1488
+ function v(i) {
1489
+ const m = [...o.value];
1490
+ m.splice(i, 1), s("update:model-value", m);
1481
1491
  }
1482
- function p() {
1483
- var d;
1484
- (d = a.value) == null || d.showSheet(
1492
+ function h() {
1493
+ var i;
1494
+ (i = n.value) == null || i.showSheet(
1485
1495
  !0,
1486
1496
  {
1487
1497
  type: "NO_REWARD",
1488
1498
  collectible: null,
1489
1499
  weight: 1
1490
1500
  },
1491
- l.value.length
1501
+ o.value.length
1492
1502
  );
1493
1503
  }
1494
- return (d, u) => {
1495
- const f = resolveComponent("FmButton"), y = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
1504
+ return (i, m) => {
1505
+ const f = resolveComponent("FmButton"), y = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
1496
1506
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
1497
1507
  _hoisted_2$9,
1498
1508
  createVNode(f, {
1499
1509
  label: "Add Reward",
1500
- onClick: u[0] || (u[0] = (C) => p()),
1510
+ onClick: m[0] || (m[0] = (E) => h()),
1501
1511
  variant: "plain",
1502
1512
  icon: "add"
1503
1513
  }),
1504
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(y, {
1514
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, b) => (openBlock(), createBlock(y, {
1505
1515
  key: b,
1506
1516
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1507
1517
  variant: "outlined",
1508
- onClick: (x) => m(b)
1518
+ onClick: (B) => p(b)
1509
1519
  }, {
1510
1520
  default: withCtx(() => {
1511
- var x;
1521
+ var B;
1512
1522
  return [
1513
1523
  createElementVNode("div", null, [
1514
- createElementVNode("div", _hoisted_3$7, toDisplayString(C.type == "LOYALTY" ? (x = C == null ? void 0 : C.earningOption) == null ? void 0 : x.amount : "") + " " + toDisplayString(v(C).label), 1),
1515
- createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
1524
+ createElementVNode("div", _hoisted_3$7, toDisplayString(E.type == "LOYALTY" ? (B = E == null ? void 0 : E.earningOption) == null ? void 0 : B.amount : "") + " " + toDisplayString(g(E).label), 1),
1525
+ createElementVNode("div", _hoisted_4$6, toDisplayString(g(E).sublabel), 1)
1516
1526
  ]),
1517
1527
  createVNode(f, {
1518
1528
  icon: "delete",
1519
1529
  variant: "tertiary",
1520
- onClick: (E) => (E.stopPropagation(), g(b))
1530
+ onClick: (x) => (x.stopPropagation(), v(b))
1521
1531
  }, null, 8, ["onClick"])
1522
1532
  ];
1523
1533
  }),
1524
1534
  _: 2
1525
1535
  }, 1032, ["onClick"]))), 128)),
1526
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(k, {
1527
- key: C.message,
1528
- text: C.message,
1536
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((E) => E.path.join(".") == ""), (E) => (openBlock(), createBlock(C, {
1537
+ key: E.message,
1538
+ text: E.message,
1529
1539
  state: "error"
1530
1540
  }, null, 8, ["text"]))), 128)),
1531
1541
  createVNode(_sfc_main$b, {
1532
1542
  ref_key: "sheetRef",
1533
- ref: a,
1543
+ ref: n,
1534
1544
  "onUpdate:modelValue": c
1535
1545
  }, null, 512)
1536
1546
  ]);
@@ -1547,48 +1557,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1547
1557
  }
1548
1558
  },
1549
1559
  emits: ["update:model-value"],
1550
- setup(e, { emit: i }) {
1551
- const n = e, r = i, o = computed(() => [
1560
+ setup(e, { emit: d }) {
1561
+ const a = e, s = d, r = computed(() => [
1552
1562
  {
1553
1563
  label: "Rock paper scissor",
1554
1564
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
1555
1565
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
1556
1566
  }
1557
1567
  ]);
1558
- return (s, l) => {
1559
- var v, m, g;
1560
- const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
1568
+ return (u, o) => {
1569
+ var g, p, v;
1570
+ const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
1561
1571
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
1562
- createVNode(t, {
1572
+ createVNode(l, {
1563
1573
  label: "Enable game",
1564
- "model-value": !!((v = e.modelValue) != null && v.gameType),
1565
- "onUpdate:modelValue": l[0] || (l[0] = (p) => p ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
1574
+ "model-value": !!((g = e.modelValue) != null && g.gameType),
1575
+ "onUpdate:modelValue": o[0] || (o[0] = (h) => h ? s("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : s("update:model-value", null))
1566
1576
  }, null, 8, ["model-value"]),
1567
- ((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), (p) => {
1569
- var d, u;
1570
- return openBlock(), createBlock(a, {
1577
+ ((p = e.modelValue) == null ? void 0 : p.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1578
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (h) => {
1579
+ var i, m;
1580
+ return openBlock(), createBlock(n, {
1571
1581
  variant: "outlined",
1572
1582
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1573
- "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)]": ((d = e.modelValue) == null ? void 0 : d.gameType) == p.value,
1575
- "hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != p.value
1583
+ "col-span-2": unref(r).length == 1,
1584
+ "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) == h.value,
1585
+ "hover:bg-fm-color-opacity-sm": ((m = e.modelValue) == null ? void 0 : m.gameType) != h.value
1576
1586
  }]),
1577
1587
  onClick: () => {
1578
1588
  var f;
1579
- ((f = n.modelValue) == null ? void 0 : f.gameType) != p.value && r("update:model-value", { gameType: p.value });
1589
+ ((f = a.modelValue) == null ? void 0 : f.gameType) != h.value && s("update:model-value", { gameType: h.value });
1580
1590
  },
1581
- key: p.value
1591
+ key: h.value
1582
1592
  }, {
1583
1593
  default: withCtx(() => [
1584
- createElementVNode("div", _hoisted_3$6, toDisplayString(p.label), 1),
1585
- createElementVNode("div", _hoisted_4$5, toDisplayString(p.description), 1)
1594
+ createElementVNode("div", _hoisted_3$6, toDisplayString(h.label), 1),
1595
+ createElementVNode("div", _hoisted_4$5, toDisplayString(h.description), 1)
1586
1596
  ]),
1587
1597
  _: 2
1588
1598
  }, 1032, ["class", "onClick"]);
1589
1599
  }), 128))
1590
1600
  ])) : createCommentVNode("", !0),
1591
- ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
1601
+ ((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
1592
1602
  key: 1,
1593
1603
  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
1604
  state: "warning"
@@ -1604,8 +1614,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1604
1614
  }
1605
1615
  },
1606
1616
  emits: ["update:model-value"],
1607
- setup(e, { emit: i }) {
1608
- const n = e, r = i, o = computed(() => [
1617
+ setup(e, { emit: d }) {
1618
+ const a = e, s = d, r = computed(() => [
1609
1619
  {
1610
1620
  label: "Stamp",
1611
1621
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -1617,26 +1627,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1617
1627
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1618
1628
  }
1619
1629
  ]);
1620
- return (s, l) => {
1621
- const t = resolveComponent("FmCard");
1630
+ return (u, o) => {
1631
+ const l = resolveComponent("FmCard");
1622
1632
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
1623
1633
  _hoisted_2$7,
1624
1634
  createElementVNode("div", _hoisted_3$5, [
1625
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
1635
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (n) => (openBlock(), createBlock(l, {
1626
1636
  variant: "outlined",
1627
1637
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1628
- "col-span-2": unref(o).length == 1,
1629
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
1630
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
1638
+ "col-span-2": unref(r).length == 1,
1639
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1640
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1631
1641
  }]),
1632
1642
  onClick: () => {
1633
- n.modelValue != a.value && r("update:model-value", a.value);
1643
+ a.modelValue != n.value && s("update:model-value", n.value);
1634
1644
  },
1635
- key: a.value
1645
+ key: n.value
1636
1646
  }, {
1637
1647
  default: withCtx(() => [
1638
- createElementVNode("div", _hoisted_4$4, toDisplayString(a.label), 1),
1639
- createElementVNode("div", _hoisted_5$3, toDisplayString(a.description), 1)
1648
+ createElementVNode("div", _hoisted_4$4, toDisplayString(n.label), 1),
1649
+ createElementVNode("div", _hoisted_5$3, toDisplayString(n.description), 1)
1640
1650
  ]),
1641
1651
  _: 2
1642
1652
  }, 1032, ["class", "onClick"]))), 128))
@@ -1658,16 +1668,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1658
1668
  }
1659
1669
  },
1660
1670
  emits: ["update:model-value"],
1661
- setup(e, { emit: i }) {
1662
- const n = i;
1663
- return (r, o) => {
1664
- const s = resolveComponent("FmStepperField");
1671
+ setup(e, { emit: d }) {
1672
+ const a = d;
1673
+ return (s, r) => {
1674
+ const u = resolveComponent("FmStepperField");
1665
1675
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1666
1676
  _hoisted_2$6,
1667
- createVNode(s, {
1677
+ createVNode(u, {
1668
1678
  label: "Maximum to collect",
1669
1679
  "model-value": e.modelValue || null,
1670
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n("update:model-value", l)),
1680
+ "onUpdate:modelValue": r[0] || (r[0] = (o) => a("update:model-value", o)),
1671
1681
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1672
1682
  "helper-state": e.helperState || "none"
1673
1683
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -1683,103 +1693,103 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1683
1693
  }
1684
1694
  },
1685
1695
  emits: ["update:model-value"],
1686
- setup(e, { expose: i, emit: n }) {
1687
- const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), c = ref(0), v = FdtoThresholdReward, m = computed(() => {
1688
- const f = v.safeParse(t.value);
1696
+ setup(e, { expose: d, emit: a }) {
1697
+ const s = e, r = useMembershipStore(), { minor: u } = useLoading, o = ref(!1), l = ref(), n = ref(), c = ref(0), g = FdtoThresholdReward, p = computed(() => {
1698
+ const f = g.safeParse(l.value);
1689
1699
  return f.success ? [] : f.error.errors;
1690
1700
  });
1691
- function g(f, y, k) {
1692
- f && (t.value = y, c.value = k), l.value = f;
1701
+ function v(f, y, C) {
1702
+ f && (l.value = y, c.value = C), o.value = f;
1693
1703
  }
1694
- const p = n;
1695
- async function d() {
1696
- console.log(t.value);
1697
- const f = v.safeParse(t.value);
1698
- f.success && (await s(
1704
+ const h = a;
1705
+ async function i() {
1706
+ console.log(l.value);
1707
+ const f = g.safeParse(l.value);
1708
+ f.success && (await u(
1699
1709
  async () => {
1700
- f.data.type === "VOUCHER" && a.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
1701
- f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
1702
- a.value
1710
+ f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
1711
+ f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1712
+ n.value
1703
1713
  ));
1704
1714
  },
1705
1715
  {
1706
1716
  message: "Uploading reward image",
1707
1717
  successMessage: "Reward image updated"
1708
1718
  }
1709
- ), p("update:model-value", f.data, c.value));
1719
+ ), h("update:model-value", f.data, c.value));
1710
1720
  }
1711
- const u = ref();
1712
- return i({
1713
- showSheet: g
1721
+ const m = ref();
1722
+ return d({
1723
+ showSheet: v
1714
1724
  }), (f, y) => {
1715
- const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
1716
- return openBlock(), createBlock(E, {
1725
+ const C = resolveComponent("FmStepperField"), E = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), B = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
1726
+ return openBlock(), createBlock(x, {
1717
1727
  "max-width": 560,
1718
- modelValue: unref(l),
1728
+ modelValue: unref(o),
1719
1729
  "onUpdate:modelValue": [
1720
- y[10] || (y[10] = (V) => isRef(l) ? l.value = V : null),
1721
- y[11] || (y[11] = (V) => l.value = V)
1730
+ y[10] || (y[10] = (k) => isRef(o) ? o.value = k : null),
1731
+ y[11] || (y[11] = (k) => o.value = k)
1722
1732
  ],
1723
1733
  header: "Edit reward",
1724
1734
  "dismiss-away": ""
1725
1735
  }, {
1726
1736
  "side-sheet-footer": withCtx(() => [
1727
1737
  createElementVNode("div", _hoisted_2$5, [
1728
- createVNode(x, {
1738
+ createVNode(B, {
1729
1739
  variant: "primary",
1730
1740
  type: "button",
1731
1741
  label: "Confirm",
1732
1742
  onClick: y[8] || (y[8] = async () => {
1733
- var V;
1734
- return (V = unref(u)) == null ? void 0 : V.validateInputs();
1743
+ var k;
1744
+ return (k = unref(m)) == null ? void 0 : k.validateInputs();
1735
1745
  })
1736
1746
  }),
1737
- createVNode(x, {
1747
+ createVNode(B, {
1738
1748
  variant: "secondary",
1739
1749
  type: "button",
1740
1750
  label: "Cancel",
1741
- onClick: y[9] || (y[9] = (V) => l.value = !1)
1751
+ onClick: y[9] || (y[9] = (k) => o.value = !1)
1742
1752
  })
1743
1753
  ])
1744
1754
  ]),
1745
1755
  default: withCtx(() => [
1746
- unref(t) ? (openBlock(), createBlock(b, {
1756
+ unref(l) ? (openBlock(), createBlock(b, {
1747
1757
  key: 0,
1748
1758
  class: "flex flex-col gap-y-24",
1749
1759
  ref_key: "formRef",
1750
- ref: u,
1751
- onValidationSuccess: y[7] || (y[7] = (V) => d())
1760
+ ref: m,
1761
+ onValidationSuccess: y[7] || (y[7] = (k) => i())
1752
1762
  }, {
1753
1763
  default: withCtx(() => {
1754
- var V, N;
1764
+ var k, N;
1755
1765
  return [
1756
- unref(t).type ? (openBlock(), createBlock(k, {
1766
+ unref(l).type ? (openBlock(), createBlock(C, {
1757
1767
  key: 0,
1758
1768
  label: "Threshold",
1759
1769
  rules: [
1760
1770
  unref(ZodHelper).toRule(
1761
1771
  unref(z).number().min(1).max(
1762
- r.maxThreshold,
1763
- `Number cannot be more than ${r.maxThreshold}`
1772
+ s.maxThreshold,
1773
+ `Number cannot be more than ${s.maxThreshold}`
1764
1774
  )
1765
1775
  )
1766
1776
  ],
1767
- "model-value": unref(t).threshold,
1768
- "onUpdate:modelValue": y[0] || (y[0] = (h) => t.value = {
1769
- ...unref(t),
1770
- threshold: h
1777
+ "model-value": unref(l).threshold,
1778
+ "onUpdate:modelValue": y[0] || (y[0] = (V) => l.value = {
1779
+ ...unref(l),
1780
+ threshold: V
1771
1781
  })
1772
1782
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
1773
- createVNode(C, {
1783
+ createVNode(E, {
1774
1784
  label: "Reward Type",
1775
1785
  items: [
1776
1786
  { label: "Voucher", value: "VOUCHER" },
1777
1787
  { label: "Loyalty", value: "LOYALTY" }
1778
1788
  ],
1779
- "model-value": unref(t).type,
1780
- "onUpdate:modelValue": y[1] || (y[1] = (h) => {
1781
- var R, B;
1782
- h === "VOUCHER" ? t.value = {
1789
+ "model-value": unref(l).type,
1790
+ "onUpdate:modelValue": y[1] || (y[1] = (V) => {
1791
+ var $, R;
1792
+ V === "VOUCHER" ? l.value = {
1783
1793
  collectible: null,
1784
1794
  type: "VOUCHER",
1785
1795
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1792,9 +1802,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1792
1802
  validityOption: {
1793
1803
  validForDay: 7
1794
1804
  },
1795
- threshold: (R = unref(t)) == null ? void 0 : R.threshold
1796
- } : t.value = {
1797
- collectible: unref(o).loyaltyRewards.raw[0]._id,
1805
+ threshold: ($ = unref(l)) == null ? void 0 : $.threshold
1806
+ } : l.value = {
1807
+ collectible: unref(r).loyaltyRewards.raw[0]._id,
1798
1808
  type: "LOYALTY",
1799
1809
  earningOption: {
1800
1810
  amount: 1,
@@ -1803,59 +1813,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1803
1813
  validityOption: {
1804
1814
  validForDay: 7
1805
1815
  },
1806
- threshold: (B = unref(t)) == null ? void 0 : B.threshold
1816
+ threshold: (R = unref(l)) == null ? void 0 : R.threshold
1807
1817
  };
1808
1818
  })
1809
1819
  }, null, 8, ["model-value"]),
1810
- unref(t).type == "LOYALTY" ? (openBlock(), createBlock(C, {
1820
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(E, {
1811
1821
  key: 1,
1812
1822
  label: "Loyalty type",
1813
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
1814
- items: unref(o).loyaltyRewards.items,
1815
- "model-value": unref(t).collectible,
1816
- "onUpdate:modelValue": y[2] || (y[2] = (h) => unref(t).collectible = h)
1823
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(l).type])],
1824
+ items: unref(r).loyaltyRewards.items,
1825
+ "model-value": unref(l).collectible,
1826
+ "onUpdate:modelValue": y[2] || (y[2] = (V) => unref(l).collectible = V)
1817
1827
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1818
- unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1828
+ unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1819
1829
  _hoisted_1$6,
1820
1830
  createVNode(_sfc_main$e, {
1821
1831
  class: "mt-[-8px]",
1822
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "earningOption", [unref(t).type])],
1823
- "helper-state": unref(ZodHelper).helperState(unref(m), "earningOption"),
1824
- "error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
1832
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(l).type])],
1833
+ "helper-state": unref(ZodHelper).helperState(unref(p), "earningOption"),
1834
+ "error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
1825
1835
  "fixed-type": !0,
1826
- "model-value": unref(t).earningOption,
1827
- "onUpdate:modelValue": y[3] || (y[3] = (h) => t.value = {
1828
- ...unref(t),
1829
- earningOption: h
1836
+ "model-value": unref(l).earningOption,
1837
+ "onUpdate:modelValue": y[3] || (y[3] = (V) => l.value = {
1838
+ ...unref(l),
1839
+ earningOption: V
1830
1840
  })
1831
1841
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1832
1842
  createVNode(_sfc_main$z, {
1833
1843
  class: "!gap-24",
1834
- "for-credit": unref(t).type === "LOYALTY" && ((V = unref(o).loyaltyRewards.items.find(
1835
- (h) => {
1836
- var R;
1837
- return h.value === ((R = unref(t)) == null ? void 0 : R.collectible);
1844
+ "for-credit": unref(l).type === "LOYALTY" && ((k = unref(r).loyaltyRewards.items.find(
1845
+ (V) => {
1846
+ var $;
1847
+ return V.value === (($ = unref(l)) == null ? void 0 : $.collectible);
1838
1848
  }
1839
- )) == null ? void 0 : V.raw.type) === "CREDIT",
1840
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
1841
- "model-value": unref(t).validityOption,
1842
- "onUpdate:modelValue": y[4] || (y[4] = (h) => t.value = {
1843
- ...unref(t),
1844
- validityOption: h
1849
+ )) == null ? void 0 : k.raw.type) === "CREDIT",
1850
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(l).type])],
1851
+ "model-value": unref(l).validityOption,
1852
+ "onUpdate:modelValue": y[4] || (y[4] = (V) => l.value = {
1853
+ ...unref(l),
1854
+ validityOption: V
1845
1855
  })
1846
1856
  }, null, 8, ["for-credit", "rules", "model-value"])
1847
1857
  ], 64)) : createCommentVNode("", !0),
1848
- unref(t).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1858
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1849
1859
  key: 3,
1850
- "reward-image": unref(a),
1851
- "model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
1852
- "onUpdate:modelValue": y[5] || (y[5] = (h) => t.value = {
1853
- ...unref(t),
1854
- collectibleConfig: h
1860
+ "reward-image": unref(n),
1861
+ "model-value": ((N = unref(l)) == null ? void 0 : N.collectibleConfig) ?? void 0,
1862
+ "onUpdate:modelValue": y[5] || (y[5] = (V) => l.value = {
1863
+ ...unref(l),
1864
+ collectibleConfig: V
1855
1865
  }),
1856
- "onUpdate:rewardImage": y[6] || (y[6] = (h) => a.value = h)
1866
+ "onUpdate:rewardImage": y[6] || (y[6] = (V) => n.value = V)
1857
1867
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1858
- createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
1868
+ createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
1859
1869
  ];
1860
1870
  }),
1861
1871
  _: 1
@@ -1889,19 +1899,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1889
1899
  }
1890
1900
  },
1891
1901
  setup(e) {
1892
- const i = e, { maxRange: n, currentRange: r, markers: o } = toRefs(i), s = computed(
1893
- () => Math.min(r.value / n.value * 100, 100)
1894
- ), l = (t) => t / n.value * 100;
1895
- return (t, a) => {
1902
+ const d = e, { maxRange: a, currentRange: s, markers: r } = toRefs(d), u = computed(
1903
+ () => Math.min(s.value / a.value * 100, 100)
1904
+ ), o = (l) => l / a.value * 100;
1905
+ return (l, n) => {
1896
1906
  const c = resolveComponent("FmIcon");
1897
1907
  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(c, {
1908
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(c, {
1899
1909
  class: normalizeClass(
1900
- unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1910
+ unref(s) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1901
1911
  ),
1902
- outline: unref(r) < v,
1903
- key: v,
1904
- name: unref(o).some((m) => m === v) ? "featured_seasonal_and_gifts" : "check_circle"
1912
+ outline: unref(s) < g,
1913
+ key: g,
1914
+ name: unref(r).some((p) => p === g) ? "featured_seasonal_and_gifts" : "check_circle"
1905
1915
  }, null, 8, ["class", "outline", "name"]))), 128))
1906
1916
  ])) : (openBlock(), createElementBlock("div", {
1907
1917
  key: 1,
@@ -1909,12 +1919,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1909
1919
  }, [
1910
1920
  createElementVNode("div", {
1911
1921
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1912
- style: normalizeStyle({ width: unref(s) + "%" })
1922
+ style: normalizeStyle({ width: unref(u) + "%" })
1913
1923
  }, null, 4),
1914
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (v, m) => (openBlock(), createElementBlock("div", {
1915
- key: m,
1924
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (g, p) => (openBlock(), createElementBlock("div", {
1925
+ key: p,
1916
1926
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1917
- style: normalizeStyle({ left: l(v) + "%" })
1927
+ style: normalizeStyle({ left: o(g) + "%" })
1918
1928
  }, [
1919
1929
  createElementVNode("div", _hoisted_2$4, [
1920
1930
  createElementVNode("div", {
@@ -1928,16 +1938,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1928
1938
  }
1929
1939
  }), isObject = (e) => e !== null && typeof e == "object";
1930
1940
  function changeKeysFactory(e) {
1931
- return function i(n, r = 1, o) {
1932
- if (r === 0 || !isObject(n))
1933
- return n;
1934
- if (Array.isArray(n))
1935
- return n.map((l) => i(l, r - 1, o));
1936
- const s = Object.create(Object.getPrototypeOf(n));
1937
- return Object.keys(n).forEach((l) => {
1938
- const t = n[l], a = e(l, o), c = i(t, r - 1, o);
1939
- s[a] = c;
1940
- }), s;
1941
+ return function d(a, s = 1, r) {
1942
+ if (s === 0 || !isObject(a))
1943
+ return a;
1944
+ if (Array.isArray(a))
1945
+ return a.map((o) => d(o, s - 1, r));
1946
+ const u = Object.create(Object.getPrototypeOf(a));
1947
+ return Object.keys(a).forEach((o) => {
1948
+ const l = a[o], n = e(o, r), c = d(l, s - 1, r);
1949
+ u[n] = c;
1950
+ }), u;
1941
1951
  };
1942
1952
  }
1943
1953
  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({
@@ -1953,43 +1963,43 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1953
1963
  }
1954
1964
  },
1955
1965
  emits: ["update:model-value"],
1956
- setup(e, { emit: i }) {
1957
- const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1958
- () => n.modelValue.sort((u, f) => u.threshold - f.threshold) ?? []
1959
- ), t = computed(() => {
1960
- const u = s.safeParse(l.value);
1961
- return u.success ? [] : u.error.errors;
1962
- }), a = ref();
1963
- function c(u, f) {
1964
- var k;
1965
- const y = [...l.value];
1966
- y[f] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", y);
1966
+ setup(e, { emit: d }) {
1967
+ const a = e, s = d, r = useMembershipStore(), u = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
1968
+ () => a.modelValue.sort((m, f) => m.threshold - f.threshold) ?? []
1969
+ ), l = computed(() => {
1970
+ const m = u.safeParse(o.value);
1971
+ return m.success ? [] : m.error.errors;
1972
+ }), n = ref();
1973
+ function c(m, f) {
1974
+ var C;
1975
+ const y = [...o.value];
1976
+ y[f] = m, (C = n.value) == null || C.showSheet(!1), s("update:model-value", y);
1967
1977
  }
1968
- function v(u) {
1969
- const f = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
1970
- (k) => k._id.toString() == u.collectible
1978
+ function g(m) {
1979
+ const f = m.type == "VOUCHER" ? m.collectibleConfig : r.collectibles.find(
1980
+ (C) => C._id.toString() == m.collectible
1971
1981
  ), y = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
1972
1982
  return {
1973
1983
  label: isNullOrEmpty(y) ? "NO REWARD" : y,
1974
- sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
1984
+ sublabel: `Reward at ${m.threshold} | Amount: ${m.earningOption.type == "FIXED" ? m.earningOption.amount : `${m.earningOption.amount} for every RM${m.earningOption.every} spent`} `
1975
1985
  };
1976
1986
  }
1977
- function m(u) {
1987
+ function p(m) {
1978
1988
  var y;
1979
- const f = [...l.value];
1980
- (y = a.value) == null || y.showSheet(!0, f[u], u);
1989
+ const f = [...o.value];
1990
+ (y = n.value) == null || y.showSheet(!0, f[m], m);
1981
1991
  }
1982
- function g(u) {
1983
- const f = [...l.value];
1984
- f.splice(u, 1), r("update:model-value", f);
1992
+ function v(m) {
1993
+ const f = [...o.value];
1994
+ f.splice(m, 1), s("update:model-value", f);
1985
1995
  }
1986
- function p() {
1987
- var u;
1988
- (u = a.value) == null || u.showSheet(
1996
+ function h() {
1997
+ var m;
1998
+ (m = n.value) == null || m.showSheet(
1989
1999
  !0,
1990
2000
  {
1991
2001
  type: "LOYALTY",
1992
- collectible: o.loyaltyRewards.items[0].value,
2002
+ collectible: r.loyaltyRewards.items[0].value,
1993
2003
  threshold: null,
1994
2004
  validityOption: {
1995
2005
  validForDay: 7
@@ -1999,63 +2009,63 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1999
2009
  amount: 1
2000
2010
  }
2001
2011
  },
2002
- l.value.length
2012
+ o.value.length
2003
2013
  );
2004
2014
  }
2005
- function d(u) {
2015
+ function i(m) {
2006
2016
  var f, y;
2007
- return u.type == "VOUCHER" ? (f = u.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
2008
- ((y = o.loyaltyRewards.items.find(
2009
- (k) => k.value == u.collectible
2017
+ return m.type == "VOUCHER" ? (f = m.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
2018
+ ((y = r.loyaltyRewards.items.find(
2019
+ (C) => C.value == m.collectible
2010
2020
  )) == null ? void 0 : y.label) || ""
2011
2021
  );
2012
2022
  }
2013
- return (u, f) => {
2014
- const y = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
2023
+ return (m, f) => {
2024
+ const y = resolveComponent("FmButton"), C = resolveComponent("FmCard"), E = resolveComponent("FmHelperText");
2015
2025
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
2016
2026
  _hoisted_2$3,
2017
2027
  createVNode(y, {
2018
2028
  label: "Add Reward",
2019
- onClick: f[0] || (f[0] = (b) => p()),
2029
+ onClick: f[0] || (f[0] = (b) => h()),
2020
2030
  variant: "plain",
2021
2031
  icon: "add"
2022
2032
  }),
2023
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (b, x) => (openBlock(), createBlock(k, {
2024
- key: x,
2033
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b, B) => (openBlock(), createBlock(C, {
2034
+ key: B,
2025
2035
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2026
2036
  variant: "outlined",
2027
- onClick: (E) => m(x)
2037
+ onClick: (x) => p(B)
2028
2038
  }, {
2029
2039
  default: withCtx(() => [
2030
2040
  createElementVNode("div", null, [
2031
- createElementVNode("div", _hoisted_3$3, toDisplayString(v(b).label), 1),
2032
- createElementVNode("div", _hoisted_4$3, toDisplayString(v(b).sublabel), 1)
2041
+ createElementVNode("div", _hoisted_3$3, toDisplayString(g(b).label), 1),
2042
+ createElementVNode("div", _hoisted_4$3, toDisplayString(g(b).sublabel), 1)
2033
2043
  ]),
2034
2044
  createVNode(y, {
2035
2045
  icon: "delete",
2036
2046
  variant: "tertiary",
2037
- onClick: (E) => (E.stopPropagation(), g(x))
2047
+ onClick: (x) => (x.stopPropagation(), v(B))
2038
2048
  }, null, 8, ["onClick"])
2039
2049
  ]),
2040
2050
  _: 2
2041
2051
  }, 1032, ["onClick"]))), 128)),
2042
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(C, {
2052
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(E, {
2043
2053
  key: b.message,
2044
2054
  text: b.message,
2045
2055
  state: "error"
2046
2056
  }, null, 8, ["text"]))), 128)),
2047
2057
  _hoisted_5$2,
2048
- (openBlock(), createBlock(k, {
2058
+ (openBlock(), createBlock(C, {
2049
2059
  key: 0,
2050
2060
  variant: "outlined",
2051
2061
  class: "p-24 space-y-16 w-fit"
2052
2062
  }, {
2053
2063
  default: withCtx(() => {
2054
- var b, x;
2064
+ var b, B;
2055
2065
  return [
2056
2066
  createElementVNode("div", _hoisted_6$2, [
2057
2067
  createElementVNode("div", null, [
2058
- createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((b = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : b.earningOption.amount) > 1 ? (x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? d(e.modelValue[e.modelValue.length - 1]) : ""), 1),
2068
+ createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((b = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : b.earningOption.amount) > 1 ? (B = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : B.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? i(e.modelValue[e.modelValue.length - 1]) : ""), 1),
2059
2069
  _hoisted_8$2
2060
2070
  ])
2061
2071
  ]),
@@ -2064,7 +2074,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2064
2074
  type: e.mission.type,
2065
2075
  "max-range": e.mission.end,
2066
2076
  currentRange: e.mission.end / 4,
2067
- markers: e.modelValue.map((E) => E.threshold)
2077
+ markers: e.modelValue.map((x) => x.threshold)
2068
2078
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
2069
2079
  e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2070
2080
  ])
@@ -2074,7 +2084,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2074
2084
  })),
2075
2085
  createVNode(_sfc_main$6, {
2076
2086
  ref_key: "sheetRef",
2077
- ref: a,
2087
+ ref: n,
2078
2088
  "onUpdate:modelValue": c,
2079
2089
  "max-threshold": e.mission.end
2080
2090
  }, null, 8, ["max-threshold"])
@@ -2087,11 +2097,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2087
2097
  modelValue: Object
2088
2098
  },
2089
2099
  emits: ["update:model-value"],
2090
- setup(e, { emit: i }) {
2091
- const n = e, r = computed(() => {
2092
- const l = FdoMission.safeParse(n.modelValue);
2093
- return l.success ? [] : l.error.errors;
2094
- }), o = computed(() => [
2100
+ setup(e, { emit: d }) {
2101
+ const a = e, s = computed(() => {
2102
+ const o = FdoMission.safeParse(a.modelValue);
2103
+ return o.success ? [] : o.error.errors;
2104
+ }), r = computed(() => [
2095
2105
  {
2096
2106
  label: "Stamp",
2097
2107
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -2102,37 +2112,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2102
2112
  description: "Reward customers when they reach a cumulative spending goal.",
2103
2113
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2104
2114
  }
2105
- ]), s = i;
2106
- return (l, t) => {
2107
- var v;
2108
- const a = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
2115
+ ]), u = d;
2116
+ return (o, l) => {
2117
+ var g;
2118
+ const n = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
2109
2119
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2110
2120
  createElementVNode("div", _hoisted_2$2, [
2111
2121
  _hoisted_3$2,
2112
2122
  _hoisted_4$2,
2113
2123
  createElementVNode("div", _hoisted_5$1, [
2114
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (m) => {
2115
- var g, p;
2116
- return openBlock(), createBlock(a, {
2124
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (p) => {
2125
+ var v, h;
2126
+ return openBlock(), createBlock(n, {
2117
2127
  variant: "outlined",
2118
2128
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2119
- "col-span-2": unref(o).length == 1,
2120
- "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,
2121
- "hover:bg-fm-color-opacity-sm": ((p = e.modelValue) == null ? void 0 : p.type) != m.value
2129
+ "col-span-2": unref(r).length == 1,
2130
+ "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) == p.value,
2131
+ "hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != p.value
2122
2132
  }]),
2123
2133
  onClick: () => {
2124
- var d, u;
2125
- ((d = e.modelValue) == null ? void 0 : d.type) != m.value && s("update:model-value", {
2134
+ var i, m;
2135
+ ((i = e.modelValue) == null ? void 0 : i.type) != p.value && u("update:model-value", {
2126
2136
  ...e.modelValue,
2127
- type: m.value,
2128
- end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
2137
+ type: p.value,
2138
+ end: ((m = e.modelValue) == null ? void 0 : m.end) || 1
2129
2139
  });
2130
2140
  },
2131
- key: m.value
2141
+ key: p.value
2132
2142
  }, {
2133
2143
  default: withCtx(() => [
2134
- createElementVNode("div", _hoisted_6$1, toDisplayString(m.label), 1),
2135
- createElementVNode("div", _hoisted_7$1, toDisplayString(m.description), 1)
2144
+ createElementVNode("div", _hoisted_6$1, toDisplayString(p.label), 1),
2145
+ createElementVNode("div", _hoisted_7$1, toDisplayString(p.description), 1)
2136
2146
  ]),
2137
2147
  _: 2
2138
2148
  }, 1032, ["class", "onClick"]);
@@ -2144,17 +2154,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2144
2154
  _hoisted_10$1,
2145
2155
  createVNode(c, {
2146
2156
  label: "Maximum to collect",
2147
- "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
2148
- "onUpdate:modelValue": t[0] || (t[0] = (m) => {
2149
- var g;
2150
- return s("update:model-value", {
2157
+ "model-value": ((g = e.modelValue) == null ? void 0 : g.end) || null,
2158
+ "onUpdate:modelValue": l[0] || (l[0] = (p) => {
2159
+ var v;
2160
+ return u("update:model-value", {
2151
2161
  ...e.modelValue,
2152
- type: ((g = e.modelValue) == null ? void 0 : g.type) || "STAMP",
2153
- end: m
2162
+ type: ((v = e.modelValue) == null ? void 0 : v.type) || "STAMP",
2163
+ end: p
2154
2164
  });
2155
2165
  }),
2156
- "helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
2157
- "helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
2166
+ "helper-text": unref(ZodHelper).helperText(unref(s), "end") || "Set the threshold required for reward eligibility",
2167
+ "helper-state": unref(ZodHelper).helperState(unref(s), "end") || "none"
2158
2168
  }, null, 8, ["model-value", "helper-text", "helper-state"])
2159
2169
  ])
2160
2170
  ]);
@@ -2182,204 +2192,204 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2182
2192
  }
2183
2193
  },
2184
2194
  emits: ["update:model-value", "update:file"],
2185
- setup(e, { emit: i }) {
2186
- const n = e, r = i;
2187
- function o(a) {
2188
- switch (n.field.type) {
2195
+ setup(e, { emit: d }) {
2196
+ const { t: a } = useI18n(), s = e, r = d;
2197
+ function u(c) {
2198
+ switch (s.field.type) {
2189
2199
  case "timeframe":
2190
- const c = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
2200
+ const g = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0, p = c.endDate ? hooks(c.endDate).endOf("day").toISOString() : void 0;
2191
2201
  r("update:model-value", {
2192
2202
  type: "timeframe",
2193
2203
  property: "__now",
2194
- start: c,
2195
- end: v
2204
+ start: g,
2205
+ end: p
2196
2206
  });
2197
2207
  break;
2198
2208
  case "image": {
2199
2209
  r(
2200
2210
  "update:file",
2201
- a,
2202
- s.value || firebaseStorage.collectibleImagePath(void 0, a)
2211
+ c,
2212
+ o.value || firebaseStorage.collectibleImagePath(void 0, c)
2203
2213
  );
2204
2214
  break;
2205
2215
  }
2206
2216
  default:
2207
- r("update:model-value", a);
2217
+ r("update:model-value", c);
2208
2218
  break;
2209
2219
  }
2210
2220
  }
2211
- const s = computed(() => {
2212
- switch (n.field.type) {
2221
+ const o = computed(() => {
2222
+ switch (s.field.type) {
2213
2223
  case "timeframe": {
2214
- const a = n.modelValue;
2224
+ const c = s.modelValue;
2215
2225
  return {
2216
- startDate: a != null && a.start ? hooks(a == null ? void 0 : a.start).format("YYYY-MM-DD") : null,
2217
- endDate: a != null && a.end ? hooks(a == null ? void 0 : a.end).format("YYYY-MM-DD") : null
2226
+ startDate: c != null && c.start ? hooks(c == null ? void 0 : c.start).format("YYYY-MM-DD") : null,
2227
+ endDate: c != null && c.end ? hooks(c == null ? void 0 : c.end).format("YYYY-MM-DD") : null
2218
2228
  };
2219
2229
  }
2220
2230
  default:
2221
- return n.modelValue;
2231
+ return s.modelValue;
2222
2232
  }
2223
2233
  });
2224
2234
  function l() {
2225
- if (!t.value.schema) return [];
2226
- const a = t.value.schema.safeParse(n.modelValue);
2227
- return a.success ? [] : a.error.errors;
2235
+ if (!n.value.schema) return [];
2236
+ const c = n.value.schema.safeParse(s.modelValue);
2237
+ return c.success ? [] : c.error.errors;
2228
2238
  }
2229
- const t = computed(() => ({
2230
- schema: n.schema,
2231
- unwrapped: n.schema ? ZodHelper.unwrap(n.schema) : void 0,
2232
- rules: n.schema ? [ZodHelper.ruleAtPath(n.schema, "")] : void 0,
2233
- labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
2234
- zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
2239
+ const n = computed(() => ({
2240
+ schema: s.schema,
2241
+ unwrapped: s.schema ? ZodHelper.unwrap(s.schema) : void 0,
2242
+ rules: s.schema ? [ZodHelper.ruleAtPath(s.schema, "")] : void 0,
2243
+ labelMark: s.schema && ZodHelper.isRequired(s.schema) == !1 ? "optional" : void 0,
2244
+ zodLabel: s.schema ? ZodHelper.toInputLabel(s.schema, s.field.label) : void 0
2235
2245
  }));
2236
- return (a, c) => {
2237
- var u, f, y, k, C;
2238
- const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
2239
- return e.field.type === "text" ? (openBlock(), createBlock(v, {
2246
+ return (c, g) => {
2247
+ var f, y, C, E, b;
2248
+ const p = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), i = resolveComponent("FmHelperText"), m = resolveComponent("FmSwitch");
2249
+ return e.field.type === "text" ? (openBlock(), createBlock(p, {
2240
2250
  key: 0,
2241
- label: e.field.label,
2242
- "label-mark": unref(t).labelMark,
2243
- rules: unref(t).rules,
2244
- "model-value": unref(s),
2245
- "onUpdate:modelValue": o,
2251
+ label: unref(a)(e.field.label),
2252
+ "label-mark": unref(n).labelMark,
2253
+ rules: unref(n).rules,
2254
+ "model-value": unref(o),
2255
+ "onUpdate:modelValue": u,
2246
2256
  "helper-state": e.helperText ? "error" : void 0,
2247
2257
  "helper-text": e.helperText
2248
2258
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2249
2259
  createVNode(JsonViewer, {
2250
- json: { schema: unref(t).unwrapped, props: n }
2260
+ json: { schema: unref(n).unwrapped, props: s }
2251
2261
  }, null, 8, ["json"]),
2252
- createVNode(m, {
2253
- label: e.field.label,
2254
- "label-mark": e.field.isRuleChildren ? void 0 : unref(t).labelMark,
2255
- "model-value": unref(s),
2256
- rules: e.field.isRuleChildren ? [] : unref(t).rules,
2257
- "onUpdate:modelValue": o,
2262
+ createVNode(v, {
2263
+ label: unref(a)(e.field.label),
2264
+ "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
2265
+ "model-value": unref(o),
2266
+ rules: e.field.isRuleChildren ? [] : unref(n).rules,
2267
+ "onUpdate:modelValue": u,
2258
2268
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
2259
2269
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
2260
2270
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
2261
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
2271
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(h, {
2262
2272
  key: 2,
2263
- label: e.field.label,
2264
- "label-mark": unref(t).labelMark,
2265
- rules: unref(t).rules,
2266
- "model-value": unref(s),
2267
- "onUpdate:modelValue": o,
2273
+ label: unref(a)(e.field.label),
2274
+ "label-mark": unref(n).labelMark,
2275
+ rules: unref(n).rules,
2276
+ "model-value": unref(o),
2277
+ "onUpdate:modelValue": u,
2268
2278
  "show-word-count": "",
2269
- "max-length": (C = (k = (y = (f = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : f._def) == null ? void 0 : y.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
2279
+ "max-length": (b = (E = (C = (y = (f = unref(n)) == null ? void 0 : f.unwrapped) == null ? void 0 : y._def) == null ? void 0 : C.checks) == null ? void 0 : E.find((B) => B.kind == "max")) == null ? void 0 : b.value
2270
2280
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
2271
2281
  key: 3,
2272
2282
  "campaign-type": e.extras,
2273
- "model-value": unref(s),
2283
+ "model-value": unref(o),
2274
2284
  disabled: e.disabled,
2275
- "onUpdate:modelValue": o
2285
+ "onUpdate:modelValue": u
2276
2286
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2277
2287
  createVNode(_sfc_main$h, {
2278
- "model-value": unref(s),
2279
- "onUpdate:modelValue": o
2288
+ "model-value": unref(o),
2289
+ "onUpdate:modelValue": u
2280
2290
  }, null, 8, ["model-value"]),
2281
- createVNode(p, {
2291
+ createVNode(i, {
2282
2292
  class: "!mt-[8px]",
2283
2293
  text: unref(ZodHelper).helperText(l(), ""),
2284
2294
  state: unref(ZodHelper).helperState(l(), "")
2285
2295
  }, null, 8, ["text", "state"])
2286
2296
  ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$v, {
2287
2297
  key: 5,
2288
- thumbnail: unref(s),
2298
+ thumbnail: unref(o),
2289
2299
  "aspect-ratio": "16 / 9",
2290
2300
  class: "w-1/2 xs:w-2/3",
2291
- "onUpdate:file": o
2301
+ "onUpdate:file": u
2292
2302
  }, {
2293
2303
  label: withCtx(() => [
2294
- (openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
2304
+ (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
2295
2305
  ]),
2296
2306
  _: 1
2297
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
2307
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(m, {
2298
2308
  key: 6,
2299
- label: e.field.label,
2309
+ label: unref(a)(e.field.label),
2300
2310
  "label-placement": "right",
2301
2311
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
2302
- "label-mark": unref(t).labelMark,
2303
- rules: unref(t).rules,
2304
- "model-value": unref(s),
2305
- "onUpdate:modelValue": o
2312
+ "label-mark": unref(n).labelMark,
2313
+ rules: unref(n).rules,
2314
+ "model-value": unref(o),
2315
+ "onUpdate:modelValue": u
2306
2316
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$x, {
2307
2317
  key: 7,
2308
- "model-value": unref(s),
2309
- "onUpdate:modelValue": o,
2318
+ "model-value": unref(o),
2319
+ "onUpdate:modelValue": u,
2310
2320
  "no-campaign": !1,
2311
- schema: unref(t).schema,
2321
+ schema: unref(n).schema,
2312
2322
  "is-mission": e.extras === "MISSION"
2313
2323
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$y, {
2314
2324
  key: 8,
2315
- "model-value": unref(s),
2316
- "onUpdate:modelValue": o
2325
+ "model-value": unref(o),
2326
+ "onUpdate:modelValue": u
2317
2327
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
2318
2328
  createVNode(_sfc_main$w, {
2319
- "model-value": unref(s),
2320
- "onUpdate:modelValue": o,
2329
+ "model-value": unref(o),
2330
+ "onUpdate:modelValue": u,
2321
2331
  "can-set-auto-apply": e.field.property == "campaign.effect"
2322
2332
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2323
- unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
2333
+ unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(i, {
2324
2334
  key: 0,
2325
2335
  class: "!mt-[8px]",
2326
- text: "Effect is required",
2336
+ text: unref(a)("connect.campaign.common.effect_required"),
2327
2337
  state: "error"
2328
- }))
2338
+ }, null, 8, ["text"]))
2329
2339
  ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
2330
2340
  key: 10,
2331
- "model-value": unref(s),
2332
- "onUpdate:modelValue": o,
2341
+ "model-value": unref(o),
2342
+ "onUpdate:modelValue": u,
2333
2343
  "helper-text": unref(ZodHelper).helperText(l(), ""),
2334
2344
  "trigger-type": e.field.extras,
2335
2345
  "helper-state": unref(ZodHelper).helperState(l(), "")
2336
2346
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
2337
2347
  key: 11,
2338
- "model-value": unref(s),
2339
- "onUpdate:modelValue": o,
2348
+ "model-value": unref(o),
2349
+ "onUpdate:modelValue": u,
2340
2350
  extras: e.extras,
2341
2351
  "error-text": e.helperText
2342
2352
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$z, {
2343
2353
  key: 12,
2344
2354
  type: "custom",
2345
- "model-value": unref(s),
2346
- "onUpdate:modelValue": o,
2355
+ "model-value": unref(o),
2356
+ "onUpdate:modelValue": u,
2347
2357
  "helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
2348
2358
  }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
2349
2359
  key: 13,
2350
- "model-value": unref(s),
2351
- "onUpdate:modelValue": o
2360
+ "model-value": unref(o),
2361
+ "onUpdate:modelValue": u
2352
2362
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
2353
2363
  key: 14,
2354
- "model-value": unref(s),
2355
- "onUpdate:modelValue": o
2364
+ "model-value": unref(o),
2365
+ "onUpdate:modelValue": u
2356
2366
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
2357
2367
  key: 15,
2358
- "model-value": unref(s),
2359
- "onUpdate:modelValue": o
2368
+ "model-value": unref(o),
2369
+ "onUpdate:modelValue": u
2360
2370
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
2361
2371
  key: 16,
2362
- "model-value": unref(s),
2363
- "onUpdate:modelValue": o
2372
+ "model-value": unref(o),
2373
+ "onUpdate:modelValue": u
2364
2374
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
2365
2375
  key: 17,
2366
- "model-value": unref(s),
2367
- "onUpdate:modelValue": o,
2376
+ "model-value": unref(o),
2377
+ "onUpdate:modelValue": u,
2368
2378
  "helper-text": unref(ZodHelper).helperText(l(), ""),
2369
2379
  "helper-state": unref(ZodHelper).helperState(l(), "")
2370
2380
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
2371
2381
  key: 18,
2372
- "model-value": unref(s),
2373
- "onUpdate:modelValue": o,
2382
+ "model-value": unref(o),
2383
+ "onUpdate:modelValue": u,
2374
2384
  mission: e.extras.mission
2375
2385
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
2376
2386
  createVNode(_sfc_main$g, {
2377
- "model-value": unref(s),
2378
- "onUpdate:modelValue": o,
2387
+ "model-value": unref(o),
2388
+ "onUpdate:modelValue": u,
2379
2389
  "start-date": e.extras.start,
2380
2390
  "end-date": e.extras.end
2381
2391
  }, null, 8, ["model-value", "start-date", "end-date"]),
2382
- e.helperText ? (openBlock(), createBlock(p, {
2392
+ e.helperText ? (openBlock(), createBlock(i, {
2383
2393
  key: 0,
2384
2394
  class: "!mt-[8px]",
2385
2395
  text: e.helperText,
@@ -2387,26 +2397,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2387
2397
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2388
2398
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
2389
2399
  createVNode(_sfc_main$o, {
2390
- "model-value": unref(s),
2391
- "onUpdate:modelValue": o
2400
+ "model-value": unref(o),
2401
+ "onUpdate:modelValue": u
2392
2402
  }, null, 8, ["model-value"]),
2393
- e.helperText ? (openBlock(), createBlock(p, {
2403
+ e.helperText ? (openBlock(), createBlock(i, {
2394
2404
  key: 0,
2395
2405
  class: "!mt-[8px]",
2396
2406
  text: e.helperText,
2397
2407
  state: "error"
2398
2408
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2399
2409
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
2400
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
2410
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(i, {
2401
2411
  key: 0,
2402
2412
  state: "warning",
2403
2413
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
2404
2414
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2405
2415
  createVNode(_sfc_main$n, {
2406
- "model-value": unref(s),
2407
- "onUpdate:modelValue": o
2416
+ "model-value": unref(o),
2417
+ "onUpdate:modelValue": u
2408
2418
  }, null, 8, ["model-value"]),
2409
- e.helperText ? (openBlock(), createBlock(p, {
2419
+ e.helperText ? (openBlock(), createBlock(i, {
2410
2420
  key: 1,
2411
2421
  class: "!mt-[8px]",
2412
2422
  text: e.helperText,
@@ -2414,10 +2424,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2414
2424
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2415
2425
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
2416
2426
  createVNode(_sfc_main$m, {
2417
- "model-value": unref(s),
2418
- "onUpdate:modelValue": o
2427
+ "model-value": unref(o),
2428
+ "onUpdate:modelValue": u
2419
2429
  }, null, 8, ["model-value"]),
2420
- e.helperText ? (openBlock(), createBlock(p, {
2430
+ e.helperText ? (openBlock(), createBlock(i, {
2421
2431
  key: 0,
2422
2432
  class: "!mt-[8px]",
2423
2433
  text: e.helperText,
@@ -2425,10 +2435,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2425
2435
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2426
2436
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
2427
2437
  createVNode(_sfc_main$k, {
2428
- "model-value": unref(s),
2429
- "onUpdate:modelValue": o
2438
+ "model-value": unref(o),
2439
+ "onUpdate:modelValue": u
2430
2440
  }, null, 8, ["model-value"]),
2431
- e.helperText ? (openBlock(), createBlock(p, {
2441
+ e.helperText ? (openBlock(), createBlock(i, {
2432
2442
  key: 0,
2433
2443
  class: "!mt-[8px]",
2434
2444
  text: e.helperText,
@@ -2436,10 +2446,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2436
2446
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2437
2447
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
2438
2448
  createVNode(_sfc_main$l, {
2439
- "model-value": unref(s),
2440
- "onUpdate:modelValue": o
2449
+ "model-value": unref(o),
2450
+ "onUpdate:modelValue": u
2441
2451
  }, null, 8, ["model-value"]),
2442
- e.helperText ? (openBlock(), createBlock(p, {
2452
+ e.helperText ? (openBlock(), createBlock(i, {
2443
2453
  key: 0,
2444
2454
  class: "!mt-[8px]",
2445
2455
  text: e.helperText,
@@ -2447,19 +2457,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2447
2457
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2448
2458
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
2449
2459
  createVNode(_sfc_main$9, {
2450
- "model-value": unref(s),
2451
- "onUpdate:modelValue": o
2460
+ "model-value": unref(o),
2461
+ "onUpdate:modelValue": u
2452
2462
  }, null, 8, ["model-value"]),
2453
- e.helperText ? (openBlock(), createBlock(p, {
2463
+ e.helperText ? (openBlock(), createBlock(i, {
2454
2464
  key: 0,
2455
2465
  class: "!mt-[8px]",
2456
2466
  text: e.helperText,
2457
2467
  state: "error"
2458
2468
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2459
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(n.field), 1));
2469
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(s.field), 1));
2460
2470
  };
2461
2471
  }
2462
- }), _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({
2472
+ }), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _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({
2463
2473
  __name: "CampaignSummary",
2464
2474
  props: {
2465
2475
  data: {
@@ -2468,22 +2478,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2468
2478
  }
2469
2479
  },
2470
2480
  setup(e) {
2471
- return (i, n) => {
2472
- const r = resolveComponent("FmCard");
2473
- return openBlock(), createBlock(r, {
2481
+ const { t: d, te: a } = useI18n();
2482
+ return (s, r) => {
2483
+ const u = resolveComponent("FmCard");
2484
+ return openBlock(), createBlock(u, {
2474
2485
  variant: "outlined",
2475
2486
  class: "p-16 space-y-8"
2476
2487
  }, {
2477
2488
  default: withCtx(() => [
2478
- _hoisted_1$1,
2489
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(d)("connect.campaign.common.summary")), 1),
2479
2490
  _hoisted_2$1,
2480
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, s) => (openBlock(), createElementBlock("div", {
2491
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, l) => (openBlock(), createElementBlock("div", {
2481
2492
  class: "space-y-4",
2482
- key: s
2493
+ key: l
2483
2494
  }, [
2484
2495
  o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2485
- createElementVNode("div", _hoisted_3$1, toDisplayString(s), 1),
2486
- createElementVNode("div", _hoisted_4$1, toDisplayString(o), 1)
2496
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(d)(`${l}`)), 1),
2497
+ createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${o}`) ? unref(d)(`${o}`) : o), 1)
2487
2498
  ], 64)) : createCommentVNode("", !0)
2488
2499
  ]))), 128))
2489
2500
  ]),
@@ -2519,37 +2530,43 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2519
2530
  __name: "EditCampaignSheet",
2520
2531
  emits: ["submit:model-value"],
2521
2532
  setup(__props, { expose: __expose, emit: __emit }) {
2522
- const Dialog = useDialog(), sheetVisible = ref(!1), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2533
+ const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2523
2534
  TEMPLATES.VOUCHER
2524
2535
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
2525
2536
  async function showSheet(visible, type, campaign, selectedTemplate) {
2526
- var e, i;
2537
+ var e, d;
2527
2538
  if (sheetVisible.value = visible, visible == !0) {
2528
2539
  try {
2529
2540
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
2530
2541
  } catch {
2531
2542
  } finally {
2532
- await new Promise((n) => setTimeout(n, 120)), isLoading.value = !1;
2543
+ await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
2533
2544
  }
2534
- template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((n, r) => {
2535
- n.campaign.type === "VOUCHER" && n.campaign.code && useCampaignStore().campaigns.voucher.some(
2536
- (o) => o.code === n.campaign.code && o._id.toString() !== n.campaign._id.toString()
2537
- ) && r.addIssue({
2545
+ template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, s) => {
2546
+ a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
2547
+ (r) => r.code === a.campaign.code && r._id.toString() !== a.campaign._id.toString()
2548
+ ) && s.addIssue({
2538
2549
  code: "custom",
2539
2550
  message: "Code already exists, please use another code",
2540
2551
  path: ["campaign", "code"]
2541
2552
  });
2542
2553
  })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
2543
- ...(i = template.value) == null ? void 0 : i.defaultValue
2554
+ ...(d = template.value) == null ? void 0 : d.defaultValue
2544
2555
  }), "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`;
2545
2556
  }
2546
2557
  }
2547
2558
  async function hideSheet() {
2548
2559
  Dialog.open({
2549
- title: "Unsaved Changes",
2550
- message: "Are you sure you want to discard this changes?",
2551
- primaryActions: { text: "Discard", close: !0 },
2552
- secondaryActions: { text: "Cancel", close: !1 }
2560
+ title: t("connect.campaign.common.unsaved_changes"),
2561
+ message: t("connect.campaign.common.unsaved_changes"),
2562
+ primaryActions: {
2563
+ text: t("connect.campaign.common.unsaved_changes_confirm"),
2564
+ close: !0
2565
+ },
2566
+ secondaryActions: {
2567
+ text: t("connect.campaign.common.unsaved_changes_cancel"),
2568
+ close: !1
2569
+ }
2553
2570
  }).onPrimary(() => {
2554
2571
  sheetVisible.value = !1;
2555
2572
  }).onSecondary(() => {
@@ -2561,10 +2578,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2561
2578
  return e.success ? [] : e.error.errors;
2562
2579
  });
2563
2580
  function stepErrors(e = currentStep.value - 1) {
2564
- const i = template.value.steps[e].groups.flatMap(
2565
- (n) => n.fields.map((r) => r.property)
2581
+ const d = template.value.steps[e].groups.flatMap(
2582
+ (a) => a.fields.map((s) => s.property)
2566
2583
  );
2567
- return errors.value.filter((n) => i.includes(n.path.join(".")));
2584
+ return errors.value.filter((a) => d.includes(a.path.join(".")));
2568
2585
  }
2569
2586
  __expose({ showSheet });
2570
2587
  function showSummaryDialog() {
@@ -2576,9 +2593,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2576
2593
  }
2577
2594
  });
2578
2595
  }
2579
- function onUpdateProperty(e, i) {
2580
- if (_.set(data.value, e, i), e == "campaign.event.type") {
2581
- const n = RuleBuilder.setRuleToGroup(
2596
+ function onUpdateProperty(e, d) {
2597
+ if (_.set(data.value, e, d), e == "campaign.event.type") {
2598
+ const a = RuleBuilder.setRuleToGroup(
2582
2599
  RuleBuilder.scaffoldGroup(),
2583
2600
  [
2584
2601
  RuleBuilder.scaffoldGroup("g_schedule"),
@@ -2586,7 +2603,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2586
2603
  RuleBuilder.scaffoldGroup("g_user"),
2587
2604
  RuleBuilder.scaffoldGroup("g_bill")
2588
2605
  ]
2589
- ), r = RuleBuilder.setRuleToGroup(
2606
+ ), s = RuleBuilder.setRuleToGroup(
2590
2607
  RuleBuilder.scaffoldGroup("g_schedule"),
2591
2608
  [
2592
2609
  RuleBuilder.constructEntry(
@@ -2598,29 +2615,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2598
2615
  ],
2599
2616
  "&&"
2600
2617
  );
2601
- if (i != "SCHEDULE") {
2602
- _.set(data.value, "campaign.event.rule", n);
2618
+ if (d != "SCHEDULE") {
2619
+ _.set(data.value, "campaign.event.rule", a);
2603
2620
  return;
2604
2621
  }
2605
2622
  _.set(
2606
2623
  data.value,
2607
2624
  "campaign.event.rule",
2608
- RuleBuilder.setRuleToGroup(n, r)
2625
+ RuleBuilder.setRuleToGroup(a, s)
2609
2626
  );
2610
2627
  }
2611
- e == "campaign.notify" && i == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2628
+ e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2612
2629
  }
2613
- async function onUpdateFile(e, i) {
2614
- return e ? await minor(async () => firebaseStorage.update(i, e), {
2630
+ async function onUpdateFile(e, d) {
2631
+ return e ? await minor(async () => firebaseStorage.update(d, e), {
2615
2632
  message: `${e ? "Uploading" : "Removing"} file`,
2616
2633
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
2617
2634
  }) : "";
2618
2635
  }
2619
2636
  function isDisable(e) {
2620
- var i, n;
2637
+ var d, a;
2621
2638
  switch (e == null ? void 0 : e.property) {
2622
2639
  case "campaign.event.type":
2623
- return ((n = (i = data.value) == null ? void 0 : i.campaign) == null ? void 0 : n._id) || !1;
2640
+ return ((a = (d = data.value) == null ? void 0 : d.campaign) == null ? void 0 : a._id) || !1;
2624
2641
  default:
2625
2642
  return !1;
2626
2643
  }
@@ -2629,30 +2646,30 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2629
2646
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
2630
2647
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2631
2648
  }
2632
- return (e, i) => {
2633
- const n = resolveComponent("FmButton"), r = resolveComponent("FmStep"), o = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2634
- return openBlock(), createBlock(l, {
2649
+ return (e, d) => {
2650
+ const a = resolveComponent("FmButton"), s = resolveComponent("FmStep"), r = resolveComponent("FmStepper"), u = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2651
+ return openBlock(), createBlock(o, {
2635
2652
  "fullscreen-size": "lg",
2636
2653
  modelValue: unref(sheetVisible),
2637
2654
  "onUpdate:modelValue": [
2638
- i[7] || (i[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
2639
- i[8] || (i[8] = (t) => sheetVisible.value = t)
2655
+ d[7] || (d[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2656
+ d[8] || (d[8] = (l) => sheetVisible.value = l)
2640
2657
  ]
2641
2658
  }, createSlots({
2642
2659
  "top-sheet-header": withCtx(() => [
2643
2660
  createElementVNode("div", _hoisted_1, [
2644
2661
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2645
2662
  createElementVNode("div", _hoisted_2, [
2646
- createVNode(n, {
2647
- onClick: i[0] || (i[0] = (t) => hideSheet()),
2648
- label: "Cancel",
2663
+ createVNode(a, {
2664
+ onClick: d[0] || (d[0] = (l) => hideSheet()),
2665
+ label: unref(t)("connect.campaign.common.cancel"),
2649
2666
  variant: "tertiary"
2650
- }),
2651
- createVNode(n, {
2667
+ }, null, 8, ["label"]),
2668
+ createVNode(a, {
2652
2669
  onClick: onSubmit,
2653
- label: "Save",
2670
+ label: unref(t)("connect.campaign.common.save"),
2654
2671
  disabled: unref(errors).length > 0
2655
- }, null, 8, ["disabled"])
2672
+ }, null, 8, ["label", "disabled"])
2656
2673
  ])
2657
2674
  ])
2658
2675
  ]),
@@ -2665,7 +2682,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2665
2682
  createElementVNode("div", _hoisted_10, [
2666
2683
  createElementVNode("div", _hoisted_11, [
2667
2684
  _hoisted_12,
2668
- createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2685
+ createVNode(u, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2669
2686
  ])
2670
2687
  ])
2671
2688
  ])
@@ -2675,51 +2692,51 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2675
2692
  name: "default",
2676
2693
  fn: withCtx(() => [
2677
2694
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2678
- createVNode(o, {
2695
+ createVNode(r, {
2679
2696
  modelValue: unref(currentStep),
2680
- "onUpdate:modelValue": i[1] || (i[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2697
+ "onUpdate:modelValue": d[1] || (d[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2681
2698
  orientation: "horizontal",
2682
2699
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2683
2700
  }, {
2684
2701
  default: withCtx(() => [
2685
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
2686
- key: t.name,
2687
- title: t.name,
2688
- value: a + 1,
2689
- error: () => stepErrors(a).length > 0,
2690
- complete: () => a + 1 <= unref(currentStep)
2702
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(s, {
2703
+ key: l.name,
2704
+ title: unref(t)(l.name),
2705
+ value: n + 1,
2706
+ error: () => stepErrors(n).length > 0,
2707
+ complete: () => n + 1 <= unref(currentStep)
2691
2708
  }, null, 8, ["title", "value", "error", "complete"]))), 128))
2692
2709
  ]),
2693
2710
  _: 1
2694
2711
  }, 8, ["modelValue"]),
2695
2712
  createElementVNode("div", _hoisted_4, [
2696
- createVNode(n, {
2713
+ createVNode(a, {
2697
2714
  icon: "close",
2698
2715
  variant: "tertiary",
2699
- onClick: i[2] || (i[2] = (t) => sheetVisible.value = !1)
2716
+ onClick: d[2] || (d[2] = (l) => sheetVisible.value = !1)
2700
2717
  }),
2701
- createVNode(o, {
2718
+ createVNode(r, {
2702
2719
  modelValue: unref(currentStep),
2703
- "onUpdate:modelValue": i[3] || (i[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2720
+ "onUpdate:modelValue": d[3] || (d[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2704
2721
  orientation: "horizontal",
2705
2722
  class: "flex-1"
2706
2723
  }, {
2707
2724
  default: withCtx(() => [
2708
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
2709
- key: t.name,
2725
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(s, {
2726
+ key: l.name,
2710
2727
  title: unref(sheetTitle),
2711
- description: t.name,
2712
- value: a + 1,
2713
- error: () => stepErrors(a).length > 0,
2714
- complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2728
+ description: l.name,
2729
+ value: n + 1,
2730
+ error: () => stepErrors(n).length > 0,
2731
+ complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2715
2732
  }, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
2716
2733
  ]),
2717
2734
  _: 1
2718
2735
  }, 8, ["modelValue"]),
2719
- createVNode(n, {
2736
+ createVNode(a, {
2720
2737
  icon: "info",
2721
2738
  variant: "tertiary",
2722
- onClick: i[4] || (i[4] = () => showSummaryDialog())
2739
+ onClick: d[4] || (d[4] = () => showSummaryDialog())
2723
2740
  })
2724
2741
  ]),
2725
2742
  createElementVNode("div", _hoisted_5, [
@@ -2728,31 +2745,31 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2728
2745
  json: {
2729
2746
  data: unref(data),
2730
2747
  errors: unref(errors).map(
2731
- (t) => `${t.path.join(".")} - ${t.message}`
2748
+ (l) => `${l.path.join(".")} - ${l.message}`
2732
2749
  ),
2733
2750
  stepErrors: stepErrors().map(
2734
- (t) => `${t.path.join(".")} - ${t.message}`
2751
+ (l) => `${l.path.join(".")} - ${l.message}`
2735
2752
  ),
2736
2753
  schema: unref(schema)
2737
2754
  }
2738
2755
  }, null, 8, ["json"]),
2739
2756
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
2740
- (t) => t.fields.length && (!t.condition || unref(_).get(unref(data), t.condition.property) == t.condition.value == (t.condition.not != !0))
2741
- ), (t, a) => (openBlock(), createElementBlock("div", {
2742
- key: a,
2757
+ (l) => l.fields.length && (!l.condition || unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0))
2758
+ ), (l, n) => (openBlock(), createElementBlock("div", {
2759
+ key: n,
2743
2760
  class: "space-y-24"
2744
2761
  }, [
2745
- createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
2746
- (openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (c, v) => (openBlock(), createElementBlock("div", { key: v }, [
2762
+ createElementVNode("div", _hoisted_7, toDisplayString(l.name ? unref(t)(l.name) : ""), 1),
2763
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (c, g) => (openBlock(), createElementBlock("div", { key: g }, [
2747
2764
  (openBlock(), createBlock(_sfc_main$2, {
2748
- key: v,
2765
+ key: g,
2749
2766
  field: c,
2750
2767
  modelValue: unref(_).get(unref(data), c.property),
2751
2768
  disabled: isDisable(c),
2752
- "onUpdate:modelValue": (m) => onUpdateProperty(c.property, m),
2753
- "onUpdate:file": async (m, g) => {
2754
- const p = await onUpdateFile(m, g);
2755
- onUpdateProperty(c.property, p || "");
2769
+ "onUpdate:modelValue": (p) => onUpdateProperty(c.property, p),
2770
+ "onUpdate:file": async (p, v) => {
2771
+ const h = await onUpdateFile(p, v);
2772
+ onUpdateProperty(c.property, h || "");
2756
2773
  },
2757
2774
  schema: unref(ZodHelper).typeAtPath(
2758
2775
  unref(schema),
@@ -2766,16 +2783,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2766
2783
  ]))), 128))
2767
2784
  ]))), 128)),
2768
2785
  createElementVNode("div", _hoisted_8, [
2769
- createVNode(n, {
2786
+ createVNode(a, {
2770
2787
  label: "Back",
2771
2788
  variant: "tertiary",
2772
2789
  disabled: unref(currentStep) == 1,
2773
- onClick: i[5] || (i[5] = (t) => currentStep.value--)
2790
+ onClick: d[5] || (d[5] = (l) => currentStep.value--)
2774
2791
  }, null, 8, ["disabled"]),
2775
- createVNode(n, {
2792
+ createVNode(a, {
2776
2793
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2777
2794
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2778
- onClick: i[6] || (i[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2795
+ onClick: d[6] || (d[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2779
2796
  }, null, 8, ["disabled", "label"])
2780
2797
  ])
2781
2798
  ]),