@feedmepos/mf-connect 0.1.38-beta.8 → 0.1.38-beta.80

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 (159) hide show
  1. package/dist/{Analytic-CJap-Cat.js → Analytic-LOK5TzX0.js} +31 -32
  2. package/dist/{App-CLTtX1QT.js → App-Bk5Z5u5_.js} +617 -607
  3. package/dist/AuditLogs-Rezf9EeA.js +1991 -0
  4. package/dist/{Bin-C2xMLxoE.js → Bin-B8yzS5bD.js} +10 -10
  5. package/dist/Broadcast-CZ0QCvua.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCkD7Xfn.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-iJQS2Ck9.js} +6 -6
  7. package/dist/{Card-BPrCNLQy.js → Card-BQOv5yB9.js} +145 -140
  8. package/dist/Collections-qenPlCd2.js +540 -0
  9. package/dist/Credit-BJLskbVu.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DKWCWOU_.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dw1qQfnG.js +351 -0
  15. package/dist/Experience-BjfEiGT8.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-C013Tr1o.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-Gw_tFjen.js +330 -0
  20. package/dist/Grab-Bdv7SaB9.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-Ba4L39GL.js} +49 -48
  22. package/dist/{Index-DMdNgISh.js → Index-C67U3YDJ.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-pQ8sF5KW.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-o-eN3J4i.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-DPjqCyJ5.js} +1 -1
  26. package/dist/Marketing-DtEooXof.js +166 -0
  27. package/dist/MarketingMaterialEdit-Balw055Y.js +1065 -0
  28. package/dist/{Member-CnSXGQi_.js → Member-QA7TQnyw.js} +38 -37
  29. package/dist/{MemberList-DcpEKV1D.js → MemberList-CSJQFYlh.js} +486 -491
  30. package/dist/{MemberTransactions-DeuuEcO5.js → MemberTransactions-D-46vda_.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DLAEPNsq.js → MessageInput.vue_vue_type_script_setup_true_lang-6a7_lw74.js} +13443 -10607
  32. package/dist/Mission-DJVxFbX5.js +334 -0
  33. package/dist/{Overview-elpi-jpI.js → Overview-Btkh3oiI.js} +24 -25
  34. package/dist/Point-CVdF9GtN.js +262 -0
  35. package/dist/Promotion-BtmlvUd3.js +396 -0
  36. package/dist/{Queue-GvBhNEFe.js → Queue-BfiCMsLC.js} +23 -24
  37. package/dist/{Record-CbSxgo8i.js → Record-B07QGPli.js} +10 -10
  38. package/dist/Review-BeZ90jW9.js +621 -0
  39. package/dist/ReviewFacebookCallback-CwAcKaib.js +243 -0
  40. package/dist/ReviewGoogleCallback-CVK6Yc5E.js +213 -0
  41. package/dist/{Reward-QCGlrq89.js → Reward-CyXqNpAa.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSRvoo9z.js → RewardGroup.vue_vue_type_script_setup_true_lang-BICsdgSh.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BgKGNK7y.js +1912 -0
  44. package/dist/{Segment-5PndnEUa.js → Segment-B9g57O7g.js} +273 -274
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DXR7bpzY.js → SelectItems.vue_vue_type_script_setup_true_lang-BwDOXE87.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmITlNtt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DXDcJLYF.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CROBk6cD.js +226 -0
  48. package/dist/Setting-BHteqZv6.js +2039 -0
  49. package/dist/SettingAdvertisements-CubrbuSL.js +264 -0
  50. package/dist/Store-u6LYUnmp.js +1996 -0
  51. package/dist/StoreRewards-D9h0YnEx.js +535 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-vrYqDGOa.js +1129 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-WgNstmNx.js +7007 -0
  54. package/dist/{Tier-BKKxG29r.js → Tier-CBdi4sPT.js} +561 -480
  55. package/dist/{Title-CReZgw8V.js → Title-BegmN7hs.js} +151 -149
  56. package/dist/{Transaction-HWCmSVaJ.js → Transaction-C6XMd9_r.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D00AchXo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BBf4BP4m.js} +7 -7
  58. package/dist/Voucher-D6hSas_z.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-ZOlAZ_q5.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bs8TNiCY.js} +2 -2
  61. package/dist/app-Duwed9mD.js +59309 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-Bc-EMd2p.js → business-6oZ8Rgui.js} +11 -8
  64. package/dist/campaign-CzenWLhs.js +219 -0
  65. package/dist/campaign-PYce7g0o.js +253 -0
  66. package/dist/campaign.enum-KHniCp5a.js +26 -0
  67. package/dist/campaign.fn-dOSgHJcU.js +776 -0
  68. package/dist/{collectible.enum-C4dM8khp.js → collectible.enum-BZA1DKIB.js} +1 -1
  69. package/dist/{collection.fn-AjDNdFe1.js → collection.fn-CyfrdKBf.js} +2 -2
  70. package/dist/dto-DYmM2ud_.js +222 -0
  71. package/dist/duplicateCampaign-BXaDK8Q6.js +51 -0
  72. package/dist/effect-DBI_JHbP.js +89 -0
  73. package/dist/{email-addresses-B0SzUCQM.js → email-addresses-BNs-WN79.js} +2 -2
  74. package/dist/{export-Bgz6WcNZ.js → export-DTCCKE2m.js} +4 -4
  75. package/dist/{helper-B1vFwohM.js → helper-CeYr7Anh.js} +22 -7
  76. package/dist/index-38u-cCwD.js +3431 -0
  77. package/dist/{index-Cm2sBagk.js → index-BdjY7GRO.js} +1 -1
  78. package/dist/index-CGMiuxyf.js +85 -0
  79. package/dist/index-CQZbm9P5.js +8912 -0
  80. package/dist/index-Cal60fAm.js +48 -0
  81. package/dist/{index-DT2viYsL.js → index-CnRLkzpg.js} +617 -191
  82. package/dist/index-CuvNtC_M.js +61 -0
  83. package/dist/{index-CSQY21Zb.js → index-D-kPBF9C.js} +3 -3
  84. package/dist/{index-DVQnrex_.js → index-DcFYm1fy.js} +3 -3
  85. package/dist/index-DjONNxbl.js +30289 -0
  86. package/dist/{index-26SopNpv.js → index-ItaoypTr.js} +1 -1
  87. package/dist/index-_jxXI4_v.js +28899 -0
  88. package/dist/{index-DwT9RLst.js → index-nXfjG8UQ.js} +23 -12
  89. package/dist/{index-BIRmS75g.js → index-pHQfP2e7.js} +1 -1
  90. package/dist/{index.esm2017-BAIN70_n.js → index.esm2017-CokFPnqn.js} +185 -185
  91. package/dist/{loading-C6Ouh0mG.js → loading-fZQi5zP8.js} +1 -1
  92. package/dist/{lodash-B5I3zXaY.js → lodash-R-DIRmbj.js} +1 -1
  93. package/dist/{membership-DU0BwIj8.js → membership-CApN5ZJ1.js} +3 -3
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-Bg7GuE5s.js → money-C6I6vVy2.js} +1 -1
  96. package/dist/{number-Ddmqo5D_.js → number-Dq4d381U.js} +1 -1
  97. package/dist/objectid-Kv5GREBk.js +145 -0
  98. package/dist/{campaign-BeF8kTyg.js → plugins-9_UvAdJ2.js} +784 -777
  99. package/dist/remy-NLAa-9Qg.js +46 -0
  100. package/dist/{reward-CN4gvn4c.js → reward-DXHGeGYY.js} +1 -1
  101. package/dist/{rule-CpiqqR0c.js → rule-B_XgRDr-.js} +505 -487
  102. package/dist/rule-builder-BMXyzu8k.js +102 -0
  103. package/dist/style.css +11 -2
  104. package/dist/template-CnyTUzQU.js +188 -0
  105. package/dist/timezone-Izs3ibB-.js +1156 -0
  106. package/dist/trigger-Dda3NmaE.js +213 -0
  107. package/dist/usePagination-Byxk4XVn.js +220 -0
  108. package/dist/user-BZxO8qdh.js +55 -0
  109. package/dist/{vue-i18n-DVmD9I_o.js → vue-i18n-DDbkmbSf.js} +433 -433
  110. package/dist/{xlsx-qJHsnW7k.js → xlsx-D8yNl8dN.js} +1 -1
  111. package/dist/{zod-Bg2FbC-D.js → zod-Xp7TePRP.js} +32 -31
  112. package/package.json +14 -6
  113. package/dist/AuditLogs-DW4rwNOn.js +0 -1887
  114. package/dist/Broadcast-Dhc0j16O.js +0 -227
  115. package/dist/Collections-CsUJEmqz.js +0 -465
  116. package/dist/Credit-Mqa-0XJd.js +0 -222
  117. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  118. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js +0 -2185
  119. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js +0 -347
  120. package/dist/Experience-BD5C3old.js +0 -223
  121. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  122. package/dist/Game-D4xsi8Ym.js +0 -278
  123. package/dist/Marketing-axcQYl8k.js +0 -20073
  124. package/dist/Mission-BHZiL-GH.js +0 -296
  125. package/dist/Point-gKvdggAl.js +0 -226
  126. package/dist/Promotion-7x2F_sFX.js +0 -289
  127. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js +0 -1751
  128. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DTlv8ZAn.js +0 -147
  129. package/dist/Setting-Cab47wfH.js +0 -1936
  130. package/dist/Store-BFL3T9B5.js +0 -1842
  131. package/dist/StoreRewards-C43dCJtM.js +0 -423
  132. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-aAj5-nzZ.js +0 -1029
  133. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js +0 -139
  134. package/dist/Voucher-BhUAcPZg.js +0 -384
  135. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-C0YNez2L.js +0 -419
  136. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  137. package/dist/app-BGaUIdCr.js +0 -7086
  138. package/dist/app-DccKBdW_.js +0 -33357
  139. package/dist/campaign-DbJZEU7P.js +0 -96
  140. package/dist/campaign.enum-PBKYGUQY.js +0 -20
  141. package/dist/campaign.fn-Cq-4LfQj.js +0 -758
  142. package/dist/dto-8NvMMYAb.js +0 -214
  143. package/dist/effect-DZhcEQ5g.js +0 -78
  144. package/dist/index-CQQedv0M.js +0 -32260
  145. package/dist/index-CTgQRqQR.js +0 -30038
  146. package/dist/index-CsaQJMAR.js +0 -66
  147. package/dist/index-DGaywhpY.js +0 -76
  148. package/dist/index-DOfLDlI8.js +0 -8861
  149. package/dist/index-DVpAocyR.js +0 -3120
  150. package/dist/index-DlJGd8RC.js +0 -121
  151. package/dist/index-Dm65CTdy.js +0 -38
  152. package/dist/objectid-MCaJXAgq.js +0 -145
  153. package/dist/plugins-C-CRzeyC.js +0 -208
  154. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  155. package/dist/rule-builder-DmkJng-x.js +0 -89
  156. package/dist/template-DTZgnkl5.js +0 -190
  157. package/dist/trigger-CPjJ73Rc.js +0 -144
  158. package/dist/usePagination-BeF5K3M7.js +0 -223
  159. package/dist/user-8VIt8A1x.js +0 -54
@@ -1,4 +1,4 @@
1
- import { z as e } from "./index-CQQedv0M.js";
1
+ import { z as e } from "./index-DjONNxbl.js";
2
2
  const E = e.enum([
3
3
  "VOUCHER",
4
4
  "CREDIT",
@@ -1,5 +1,5 @@
1
- import "./index-DOfLDlI8.js";
2
- import "./index-CQQedv0M.js";
1
+ import "./index-CQZbm9P5.js";
2
+ import "./index-DjONNxbl.js";
3
3
  function r(e) {
4
4
  switch (e) {
5
5
  case "PROMOTION":
@@ -0,0 +1,222 @@
1
+ import { F as o, z as a } from "./index-DjONNxbl.js";
2
+ import { s as R, a as r, t as h } from "./index-38u-cCwD.js";
3
+ import { F as u } from "./index-CQZbm9P5.js";
4
+ import { i as f, R as d } from "./rule-builder-BMXyzu8k.js";
5
+ function A(n, e) {
6
+ var p, l;
7
+ if (console.log(n, e), !n) return;
8
+ const t = n.campaign;
9
+ if (!t) return;
10
+ const i = t.event.rule;
11
+ if (!i || !f(i)) {
12
+ e.addIssue({
13
+ code: "custom",
14
+ path: ["campaign", "event", "rule"],
15
+ params: {
16
+ i18n: "connectZodCustom:campaign.rule_required",
17
+ type: t.event.type
18
+ }
19
+ });
20
+ return;
21
+ }
22
+ switch (t.type) {
23
+ case "MISSION": {
24
+ t.earningOption.amount > t.mission.end && e.addIssue({
25
+ code: "custom",
26
+ path: ["campaign", "earningOption"],
27
+ params: {
28
+ i18n: "connectZodCustom:campaign.earning_amount_exceed",
29
+ max: t.mission.end
30
+ }
31
+ });
32
+ break;
33
+ }
34
+ case "CREDIT": {
35
+ const c = (p = t.config) == null ? void 0 : p.validityOption;
36
+ (!c || ["validForDay", "validBefore"].every((g) => c[g] == null)) && e.addIssue({
37
+ code: "custom",
38
+ path: ["campaign", "config", "validityOption"],
39
+ params: {
40
+ i18n: "connectZodCustom:campaign.credit_validity_required"
41
+ }
42
+ });
43
+ }
44
+ }
45
+ switch (t.event.type) {
46
+ case "BILL_COMPLETED":
47
+ t.type === "MISSION" && t.rewards.length && (t.rewards.forEach((c, m) => {
48
+ (c.threshold < 0 || c.threshold > t.mission.end) && e.addIssue({
49
+ code: "custom",
50
+ path: ["campaign", "rewards", m, "threshold"],
51
+ params: {
52
+ i18n: "connectZodCustom:campaign.reward_threshold_range"
53
+ }
54
+ });
55
+ }), (l = t.config) != null && l.validityOption.followFirstReceive || e.addIssue({
56
+ code: "custom",
57
+ path: ["campaign", "config", "validityOption"],
58
+ params: {
59
+ i18n: "connectZodCustom:campaign.mission_first_receive"
60
+ }
61
+ }));
62
+ break;
63
+ case "SCHEDULE": {
64
+ if (!i.rules.g_schedule) {
65
+ e.addIssue({
66
+ code: "custom",
67
+ path: ["campaign", "event", "rule"],
68
+ params: {
69
+ i18n: "connectZodCustom:campaign.schedule_period_required"
70
+ },
71
+ fatal: !0
72
+ });
73
+ return;
74
+ }
75
+ const c = d.getRules(
76
+ i.rules.g_schedule
77
+ ), m = [
78
+ {
79
+ property: "trigger.date",
80
+ operator: ["_isOnDate", "_rrule"]
81
+ },
82
+ {
83
+ property: "trigger.time",
84
+ operator: ["_isOnTime"]
85
+ }
86
+ ];
87
+ m.length == c.length && m.every((O) => c.some((C) => {
88
+ const I = d.simplify(C);
89
+ return I.property === O.property && O.operator.includes(I.operator);
90
+ })) || e.addIssue({
91
+ code: "custom",
92
+ path: ["campaign", "event", "rule"],
93
+ params: {
94
+ i18n: "connectZodCustom:campaign.active_period_invalid"
95
+ }
96
+ });
97
+ break;
98
+ }
99
+ default: {
100
+ "earningOption" in t && t.earningOption.type != "FIXED" && e.addIssue({
101
+ code: "custom",
102
+ path: ["campaign", "earningOption"],
103
+ params: {
104
+ i18n: "connectZodCustom:campaign.fixed_earning_required"
105
+ }
106
+ });
107
+ break;
108
+ }
109
+ }
110
+ }
111
+ function N(n) {
112
+ var t;
113
+ if (n.campaign.type === "VOUCHER" && "configs" in n) {
114
+ const i = n.configs;
115
+ i.extras.targetLocation = n.campaign.targetLocation;
116
+ const p = Math.max(
117
+ n.campaign.earningOption.amount,
118
+ i.options.maxUse ?? 1
119
+ );
120
+ n.campaign.earningOption.amount = p, i.options.maxUse = p, n.campaign.earningOption = {
121
+ type: "FIXED",
122
+ amount: 1
123
+ };
124
+ }
125
+ if (n.campaign.type == "MISSION" && "configs" in n) {
126
+ const i = n.configs;
127
+ i.options.validityOption = (t = n.campaign.config) == null ? void 0 : t.validityOption;
128
+ }
129
+ const e = n.campaign.event;
130
+ return e.type != "BILL_COMPLETED" && e.rule && f(e.rule) && (e.rule = d.removeEntry(e.rule, "g_bill"), n.campaign.event = e), n;
131
+ }
132
+ function s(n) {
133
+ const e = h.optionsMap.get(n).extend({
134
+ _id: o.optional(),
135
+ collectible: a.string().nullish()
136
+ });
137
+ switch (n) {
138
+ case "VOUCHER":
139
+ return a.object({
140
+ campaign: e,
141
+ templateId: o,
142
+ configs: u,
143
+ updateCollections: a.boolean().optional(),
144
+ code: a.string().optional()
145
+ });
146
+ case "PROMOTION":
147
+ return a.object({
148
+ campaign: e,
149
+ templateId: o
150
+ });
151
+ case "POINT":
152
+ return a.object({
153
+ campaign: e,
154
+ templateId: o
155
+ });
156
+ case "CREDIT":
157
+ return a.object({
158
+ campaign: e,
159
+ templateId: o
160
+ });
161
+ case "BROADCAST":
162
+ return a.object({
163
+ campaign: e,
164
+ templateId: o
165
+ });
166
+ case "COIN":
167
+ return a.object({
168
+ campaign: e,
169
+ templateId: o
170
+ });
171
+ case "REWARD_POOL":
172
+ return a.object({
173
+ campaign: e,
174
+ templateId: o,
175
+ updateCollections: a.boolean().optional()
176
+ });
177
+ case "GAME":
178
+ return a.object({
179
+ campaign: e,
180
+ configs: u,
181
+ templateId: o,
182
+ updateCollections: a.boolean().optional()
183
+ });
184
+ case "MISSION":
185
+ return a.object({
186
+ campaign: e,
187
+ configs: u,
188
+ templateId: o,
189
+ updateCollections: a.boolean().optional()
190
+ });
191
+ case "GRAB":
192
+ return a.object({
193
+ campaign: e,
194
+ templateId: o
195
+ });
196
+ default:
197
+ throw new Error("Not implemented");
198
+ }
199
+ }
200
+ const D = R.extend({
201
+ _id: o.optional(),
202
+ name: a.string().min(1).max(300),
203
+ business: o.optional(),
204
+ campaigns: a.array(o).optional()
205
+ }), T = {
206
+ [r.enum.VOUCHER]: s("VOUCHER"),
207
+ [r.enum.PROMOTION]: s("PROMOTION"),
208
+ [r.enum.POINT]: s("POINT"),
209
+ [r.enum.CREDIT]: s("CREDIT"),
210
+ [r.enum.BROADCAST]: s("BROADCAST"),
211
+ [r.enum.COIN]: s("COIN"),
212
+ [r.enum.REWARD_POOL]: s("REWARD_POOL"),
213
+ [r.enum.GAME]: s("GAME"),
214
+ [r.enum.MISSION]: s("MISSION"),
215
+ [r.enum.GRAB]: s("GRAB")
216
+ };
217
+ export {
218
+ T as C,
219
+ D as F,
220
+ N as a,
221
+ A as c
222
+ };
@@ -0,0 +1,51 @@
1
+ import { p as l, i } from "./plugins-9_UvAdJ2.js";
2
+ import { _ as r } from "./lodash-R-DIRmbj.js";
3
+ function A(e) {
4
+ return l.confirm(
5
+ i.global.t("connect.common.duplicate.confirmMessage", { name: e }),
6
+ i.global.t("connect.common.duplicate.title"),
7
+ i.global.t("connect.common.duplicate.proceed")
8
+ );
9
+ }
10
+ const f = ["LOYALTY", "NO_REWARD"], s = {
11
+ GAME: [(e) => {
12
+ var o;
13
+ return (o = e == null ? void 0 : e.game) == null ? void 0 : o.rewards;
14
+ }],
15
+ MISSION: [
16
+ (e) => e == null ? void 0 : e.rewards,
17
+ (e) => {
18
+ var o;
19
+ return (o = e == null ? void 0 : e.mission) == null ? void 0 : o.rewards;
20
+ }
21
+ ],
22
+ REWARD_POOL: [(e) => e == null ? void 0 : e.rewards]
23
+ };
24
+ function u(e, o) {
25
+ e && e.forEach((t) => {
26
+ o.includes(t.type ?? "") || (t.collectible = null, t.type === "VOUCHER" && t.collectibleConfig && (t.collectibleConfig._id = void 0));
27
+ });
28
+ }
29
+ function d(e) {
30
+ e._id = void 0;
31
+ }
32
+ function R(e, o) {
33
+ e.campaign && (e.campaign._id = void 0, e.campaign.currentReceive = void 0, o || (e.campaign.collectible = void 0));
34
+ }
35
+ function C(e, o) {
36
+ e.configs && (e.configs.currentReceive = void 0, o || (e.configs._id = void 0));
37
+ }
38
+ function E(e) {
39
+ const o = s[(e == null ? void 0 : e.type) ?? ""];
40
+ o && o.forEach((t) => {
41
+ u(t(e), f);
42
+ });
43
+ }
44
+ function v(e, o = {}) {
45
+ const t = r.cloneDeep(e), { keepCollectible: c = !1 } = o, n = t.campaign;
46
+ return d(t), R(t, c), C(t, c), E(n), t;
47
+ }
48
+ export {
49
+ A as c,
50
+ v as p
51
+ };
@@ -0,0 +1,89 @@
1
+ import { c as r } from "./index-_jxXI4_v.js";
2
+ function p(n) {
3
+ if (!n)
4
+ return null;
5
+ const o = r.Config.getCountry().currency.symbol;
6
+ function s(t) {
7
+ if (t.options.target === "ITEM" && t.options.strategy.type === "PRICE_CHANGE")
8
+ return null;
9
+ const e = r.Dinero.fromFdoDecimal({ decimal: t.adjustment.amount });
10
+ switch (t.adjustment.type) {
11
+ case "BY_PERCENTAGE":
12
+ return `${e.toObject().amount}% discount`;
13
+ case "BY_AMOUNT":
14
+ return `${o}${e.toUnit()} discount`;
15
+ case "TO_AMOUNT":
16
+ return `to ${o}${e.toUnit()}`;
17
+ }
18
+ }
19
+ function u(t) {
20
+ switch (t.options.target) {
21
+ case "BILL":
22
+ return "Bill Discount";
23
+ case "ITEM":
24
+ if (t.options.strategy.type === "PRICE_CHANGE") {
25
+ const e = t.options.strategy.key;
26
+ return e ? `Use ${e} price` : "Use different price";
27
+ } else {
28
+ if (t.options.strategy.type === "SIMPLE")
29
+ return "Item Discount";
30
+ if (t.options.strategy.type === "BUY_X_GET_Y")
31
+ return "Buy X Get Y (same product set)";
32
+ if (t.options.strategy.type === "BUY_X_GET_Y_V2")
33
+ return "Buy X Get Y (mixed product set)";
34
+ if (t.options.strategy.type === "BUY_X_ITEM_A_GET_Y_ITEM_B")
35
+ return "Buy X Get Y (different product set)";
36
+ if (t.options.strategy.type === "COMBO")
37
+ return "Combo";
38
+ }
39
+ break;
40
+ case "PAYMENT":
41
+ return "Payment";
42
+ default:
43
+ throw new Error("Invalid effect target");
44
+ }
45
+ }
46
+ function a(t) {
47
+ return t.options.target === "ITEM" && t.options.strategy.type === "PRICE_CHANGE" ? "Requires POS 7.12.18 or above" : null;
48
+ }
49
+ function c(t) {
50
+ if (t.options.target === "BILL" || t.options.target === "PAYMENT") {
51
+ const e = r.Dinero.fromFdoDecimal({
52
+ decimal: t.options.minPurchase
53
+ });
54
+ return e.toUnit() > 0 ? `min spend ${o}${e.toUnit()}` : "no min spend";
55
+ }
56
+ if (t.options.target === "ITEM" && t.options.minPurchase) {
57
+ const e = r.Dinero.fromFdoDecimal({
58
+ decimal: t.options.minPurchase
59
+ });
60
+ return e.toUnit() > 0 ? `min spend ${o}${e.toUnit()}` : "no min spend";
61
+ }
62
+ return "no min spend";
63
+ }
64
+ function m(t) {
65
+ var e;
66
+ if (((e = t.adjustmentRule) == null ? void 0 : e.type) == "CAPPED_AT") {
67
+ const i = r.Dinero.fromFdoDecimal({
68
+ decimal: t.adjustmentRule.amount
69
+ }).toPositive();
70
+ return i.toUnit() > 0 ? `cap at ${o}${i.toUnit()}` : null;
71
+ }
72
+ return null;
73
+ }
74
+ return {
75
+ type: u(n),
76
+ adjustment: s(n),
77
+ requirements: c(n),
78
+ maxCap: m(n),
79
+ posHint: a(n)
80
+ };
81
+ }
82
+ function l(n) {
83
+ const o = p(n);
84
+ return !n || !o ? null : Object.values(o).filter(Boolean).join(" | ");
85
+ }
86
+ export {
87
+ l as e,
88
+ p as s
89
+ };
@@ -1,8 +1,8 @@
1
1
  var ur = Object.defineProperty;
2
2
  var ir = (S, b, h) => b in S ? ur(S, b, { enumerable: !0, configurable: !0, writable: !0, value: h }) : S[b] = h;
3
3
  var pn = (S, b, h) => ir(S, typeof b != "symbol" ? b + "" : b, h);
4
- import { u as V } from "./xlsx-qJHsnW7k.js";
5
- import { g as ar } from "./_commonjsHelpers-BkfeUUK-.js";
4
+ import { u as V } from "./xlsx-D8yNl8dN.js";
5
+ import { g as ar } from "./app-Duwed9mD.js";
6
6
  class fr {
7
7
  constructor() {
8
8
  pn(this, "data", []);
@@ -1,10 +1,10 @@
1
1
  var g = Object.defineProperty;
2
2
  var b = (s, e, o) => e in s ? g(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o;
3
3
  var d = (s, e, o) => b(s, typeof e != "symbol" ? e + "" : e, o);
4
- import { u as a, w as f } from "./xlsx-qJHsnW7k.js";
5
- import { u as h } from "./loading-C6Ouh0mG.js";
6
- import { h as x } from "./moment-BWErdI6_.js";
7
- import { m as w } from "./index-BIRmS75g.js";
4
+ import { u as a, w as f } from "./xlsx-D8yNl8dN.js";
5
+ import { u as h } from "./loading-fZQi5zP8.js";
6
+ import { h as x } from "./moment-D7p2TMB-.js";
7
+ import { m as w } from "./index-pHQfP2e7.js";
8
8
  class y {
9
9
  constructor() {
10
10
  d(this, "records", []);
@@ -1,5 +1,5 @@
1
- import { o as i } from "./index-DOfLDlI8.js";
2
- function o(t, e) {
1
+ import { k as l } from "./index-CQZbm9P5.js";
2
+ function u(t, e) {
3
3
  switch (t) {
4
4
  case "COIN":
5
5
  case "CREDIT":
@@ -61,11 +61,26 @@ function o(t, e) {
61
61
  throw new Error("Invalid collectible type");
62
62
  }
63
63
  }
64
- function u(t) {
65
- const { validAfter: e, validBefore: a } = t, { validForDay: s } = t, n = i(e).toDate(), r = i(a).toDate();
66
- return e && a ? `${n.toLocaleDateString()} - ${r.toLocaleDateString()}` : e ? `Starts from ${n.toLocaleDateString()}` : a ? `Ends at ${r.toLocaleDateString()}` : s != null ? `Expires in ${s || "the same"} day${s > 1 ? "s" : ""} after claim` : "Always valid";
64
+ function c(t) {
65
+ const { validAfter: e, validBefore: s } = t, { validForDay: a } = t, n = l(e).toDate(), r = l(s).toDate();
66
+ return e && s ? `${n.toLocaleDateString()} - ${r.toLocaleDateString()}` : e ? `Starts from ${n.toLocaleDateString()}` : s ? `Ends at ${r.toLocaleDateString()}` : a != null ? `Expires in ${a || "the same"} day${a > 1 ? "s" : ""} after claim` : "Always valid";
67
67
  }
68
+ function i(t, e, s, a = !0) {
69
+ if (!t) return a;
70
+ const n = t[e];
71
+ return n ? n[s] ?? a : a;
72
+ }
73
+ function E(t, e) {
74
+ return t ? i(t, e, "selectable", !1) : e === "STORE_BUNDLE:DEFAULT";
75
+ }
76
+ const b = {
77
+ "STORE_BUNDLE:DEFAULT": { selectable: !1 },
78
+ "STORE_BUNDLE:FEEDVIBE": { selectable: !0, editable: !1, deletable: !1 }
79
+ };
68
80
  export {
69
- o as i,
70
- u as t
81
+ b as F,
82
+ E as a,
83
+ i as h,
84
+ u as i,
85
+ c as t
71
86
  };