@feedmepos/mf-connect 0.1.38-beta.7 → 0.1.38-beta.71

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 (153) hide show
  1. package/dist/{Analytic-NNi-22sK.js → Analytic-BY0xqCru.js} +16 -16
  2. package/dist/{App-Bu14Mro_.js → App-n6-XqhU7.js} +625 -619
  3. package/dist/AuditLogs-Dml3WjdH.js +1991 -0
  4. package/dist/{Bin-CnAQA85j.js → Bin-DaPZyWm-.js} +10 -10
  5. package/dist/Broadcast-hLmkBNne.js +267 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DC_fReu7.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BahnNhzD.js} +6 -6
  7. package/dist/{Card-DqAGiETA.js → Card-C_Fm3E0s.js} +144 -140
  8. package/dist/Collections-DAUsUa0c.js +540 -0
  9. package/dist/Credit-DklbckuQ.js +261 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-vpnaCdLI.js +3167 -0
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-e1ZWGrXS.js +351 -0
  14. package/dist/Experience-D3Ve8dCI.js +260 -0
  15. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-Bg15HHd0.js} +1 -1
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  17. package/dist/Game-BJzRdZNg.js +331 -0
  18. package/dist/GenerateMaterial-pDWgptXt.js +589 -0
  19. package/dist/Grab-B0D8SpcD.js +301 -0
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-DkI3qMHv.js} +49 -48
  21. package/dist/{Index-loHkiwyo.js → Index-ysSM8-pd.js} +54 -54
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C7bEzQ4b.js} +1 -1
  23. package/dist/{MainLayout-B1aJoR95.js → MainLayout-Kt1Wiz87.js} +1 -1
  24. package/dist/Marketing-CFS6ff03.js +145 -0
  25. package/dist/MarketingMaterialEdit-BDYr5Rlw.js +746 -0
  26. package/dist/{Member-BQjQQdoA.js → Member-Dgb3QBKF.js} +38 -37
  27. package/dist/{MemberList-WPsEUKf_.js → MemberList-CfcQUvN8.js} +158 -159
  28. package/dist/{MemberTransactions-BtM7dugy.js → MemberTransactions-BVwGdpXo.js} +1 -1
  29. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Bl9sFIwG.js → MessageInput.vue_vue_type_script_setup_true_lang-Dj3h51yH.js} +13463 -10597
  30. package/dist/Mission-B9K8-Wrt.js +335 -0
  31. package/dist/{Overview-Bsf5IPOg.js → Overview-DJgKxAvU.js} +24 -25
  32. package/dist/Point-lev1_Nit.js +263 -0
  33. package/dist/Promotion-De9e8yPj.js +397 -0
  34. package/dist/{Queue-XFVbSuDw.js → Queue-DH_F0Ekd.js} +14 -15
  35. package/dist/{Record-CQzujESE.js → Record-CH2AZqzF.js} +10 -10
  36. package/dist/{Reward-Dj_h_May.js → Reward-BUgOAjd4.js} +16 -16
  37. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Clxk-oYM.js → RewardGroup.vue_vue_type_script_setup_true_lang-KTaTLjjw.js} +13 -14
  38. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-rs5kKp_v.js +1912 -0
  39. package/dist/{Segment-D_DUu_Sp.js → Segment-DL6O--Aw.js} +273 -274
  40. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-D3C2mVlv.js → SelectItems.vue_vue_type_script_setup_true_lang-ZUGDMD5J.js} +23 -23
  41. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C0vsl8oV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CIeyrheH.js} +12 -12
  42. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-5HkJROSb.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BAtXxIjO.js} +4 -4
  43. package/dist/Setting-DOA80XlJ.js +1999 -0
  44. package/dist/SettingAdvertisements-Dl0eisXq.js +263 -0
  45. package/dist/Store-fni1Xblz.js +1995 -0
  46. package/dist/StoreRewards-CLMO-kNi.js +534 -0
  47. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BlBovyiT.js +1034 -0
  48. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jYcuAa.js +7005 -0
  49. package/dist/{Tier-YQsLRt06.js → Tier-B0_DiVNv.js} +561 -480
  50. package/dist/{Title-C5gxYNvh.js → Title-twptCzpk.js} +149 -147
  51. package/dist/{Transaction-CZ_QdIii.js → Transaction-CTX5I6gO.js} +2 -2
  52. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DqUu7wSt.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bp-rIgz4.js} +7 -7
  53. package/dist/Voucher-C7Kxmzjr.js +422 -0
  54. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-lZQTZUUU.js +421 -0
  55. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DCtdp-LK.js → ZodTextField.vue_vue_type_script_setup_true_lang-BlBEFfgu.js} +2 -2
  56. package/dist/app-D5GVWKxc.js +59071 -0
  57. package/dist/app.js +1 -1
  58. package/dist/{business-DZYFoAKz.js → business-BvNsRlY4.js} +11 -8
  59. package/dist/{campaign-Ca4l6UUg.js → campaign-DRErhSfb.js} +29 -25
  60. package/dist/campaign-MN_o01w6.js +253 -0
  61. package/dist/campaign.enum-BtfwwLCf.js +26 -0
  62. package/dist/campaign.fn-BgSGxLPo.js +776 -0
  63. package/dist/{collectible.enum-DnIeDAB-.js → collectible.enum-CV2tpD2C.js} +1 -1
  64. package/dist/{collection.fn-mQfXEwJv.js → collection.fn-BYjqObg7.js} +2 -2
  65. package/dist/dto-CyhnIGn-.js +222 -0
  66. package/dist/duplicateCampaign-jOZ1UznM.js +51 -0
  67. package/dist/effect-NKfquhhR.js +89 -0
  68. package/dist/{email-addresses-CQYqi2rN.js → email-addresses-EmFJeFmB.js} +2 -2
  69. package/dist/{export-BsikVZw2.js → export-B70Bp6s8.js} +9 -10
  70. package/dist/{helper-n74IteBU.js → helper-DiSstsUa.js} +22 -7
  71. package/dist/index-5FmmWAib.js +30289 -0
  72. package/dist/index-B09KKPb4.js +3419 -0
  73. package/dist/{index-CrHCbDIs.js → index-BgP5ZHK6.js} +3 -3
  74. package/dist/{index-DRrSsoqp.js → index-C46EHygk.js} +1 -1
  75. package/dist/{index-Bg3fAg5z.js → index-CD7Ji4Nw.js} +1 -1
  76. package/dist/{index-BJ-IAF-1.js → index-CHXlBh7-.js} +1 -1
  77. package/dist/{index-BpjT8Rx0.js → index-Cr2243n7.js} +455 -245
  78. package/dist/index-CrDg9PFk.js +8912 -0
  79. package/dist/index-CuvNtC_M.js +61 -0
  80. package/dist/{index-Dt6wui_L.js → index-DK45XoFG.js} +3 -3
  81. package/dist/{index-DTErPYrT.js → index-Qg_bzaF2.js} +1 -1
  82. package/dist/{index-Do7TcKmg.js → index-bAmlAkpk.js} +4 -1
  83. package/dist/index-nTpkh7pU.js +28897 -0
  84. package/dist/index-tvZKdKVU.js +36 -0
  85. package/dist/{index.esm2017-T7F54Aqa.js → index.esm2017-B8fYlj6l.js} +185 -185
  86. package/dist/loading-DVr3dbZ1.js +215 -0
  87. package/dist/{lodash-B5I3zXaY.js → lodash-BNr1VEn2.js} +1 -1
  88. package/dist/{membership-BRy4jMt2.js → membership-LEuPDIbe.js} +3 -3
  89. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  90. package/dist/{money-B9Auav5u.js → money-CogUwiv6.js} +1 -1
  91. package/dist/{number-BdhIBsUp.js → number-C5wGUTN5.js} +1 -1
  92. package/dist/objectid-DbUENFHd.js +145 -0
  93. package/dist/{campaign-162kZMje.js → plugins-BxKrsjEx.js} +784 -777
  94. package/dist/remy-D_Deb3ue.js +13 -0
  95. package/dist/{reward-UuqZUHsq.js → reward-CM4Wx2zA.js} +1 -1
  96. package/dist/{rule-D158NIpm.js → rule-CMMr2GMg.js} +505 -487
  97. package/dist/rule-builder-D5QsmOxi.js +102 -0
  98. package/dist/style.css +11 -2
  99. package/dist/template-BDKqBasy.js +188 -0
  100. package/dist/timezone-DuaWQsQ2.js +1154 -0
  101. package/dist/trigger-IcyZcRow.js +213 -0
  102. package/dist/usePagination-D8OEDsCt.js +223 -0
  103. package/dist/user-u3blYzG2.js +55 -0
  104. package/dist/vue-i18n-DfD8ZY6j.js +2365 -0
  105. package/dist/{xlsx-Ddqi5i8p.js → xlsx-Bgf4_JHr.js} +1 -1
  106. package/dist/{zod-Bg2FbC-D.js → zod-9J33xiFS.js} +32 -31
  107. package/package.json +14 -6
  108. package/dist/AuditLogs-Cai9CVBl.js +0 -1887
  109. package/dist/Broadcast-DskXjXn4.js +0 -227
  110. package/dist/Collections-DuaIQAk7.js +0 -465
  111. package/dist/Credit-D40Vzu2g.js +0 -222
  112. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  113. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsQ4iAsV.js +0 -2185
  114. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CDCX5B5k.js +0 -347
  115. package/dist/Experience-B9yHQPuj.js +0 -223
  116. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  117. package/dist/Game-e9-Q3qmO.js +0 -278
  118. package/dist/Marketing-CipbukIV.js +0 -20073
  119. package/dist/Mission-B_DJ3Yu_.js +0 -296
  120. package/dist/Point-DMphcWjy.js +0 -226
  121. package/dist/Promotion-B33A-Jwe.js +0 -289
  122. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CGAXTOLN.js +0 -1751
  123. package/dist/Setting-CtdC4G3W.js +0 -1936
  124. package/dist/Store-DCksWACh.js +0 -1842
  125. package/dist/StoreRewards-CHWKYKet.js +0 -423
  126. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D1TDyD6N.js +0 -1029
  127. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D59sGO3F.js +0 -139
  128. package/dist/Voucher-BzV8yZ3o.js +0 -384
  129. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DjBj_3EF.js +0 -419
  130. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  131. package/dist/app-FFOpPHwj.js +0 -33357
  132. package/dist/app-az9e8Yfl.js +0 -7086
  133. package/dist/campaign.enum-DWjyDV2D.js +0 -20
  134. package/dist/campaign.fn-DWWJ74z-.js +0 -758
  135. package/dist/dto-mKZIPV4o.js +0 -214
  136. package/dist/effect-B8UexeyG.js +0 -78
  137. package/dist/index-5ShiAY8U.js +0 -8861
  138. package/dist/index-Bf6AmJwX.js +0 -32260
  139. package/dist/index-C5gjIb5d.js +0 -146
  140. package/dist/index-C9YrDtDN.js +0 -38
  141. package/dist/index-CK-MAqWE.js +0 -3120
  142. package/dist/index-CsaQJMAR.js +0 -66
  143. package/dist/index-f4MzX8IY.js +0 -30038
  144. package/dist/loading-BEAayQS-.js +0 -71
  145. package/dist/objectid-K-JVTsfA.js +0 -145
  146. package/dist/plugins-CWlRYif_.js +0 -208
  147. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  148. package/dist/rule-builder-DNeViq0I.js +0 -89
  149. package/dist/template-B02wYF7G.js +0 -190
  150. package/dist/trigger-BDjnKHLI.js +0 -144
  151. package/dist/usePagination-BeF5K3M7.js +0 -223
  152. package/dist/user-DbP37Ohh.js +0 -54
  153. package/dist/vue-i18n-BbhkYWlk.js +0 -2365
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { F as e, i as o, r as p } from "./app-az9e8Yfl.js";
2
+ import { d as e, i as o, r as p } from "./app-D5GVWKxc.js";
3
3
  export {
4
4
  e as FmApp,
5
5
  o as i18nMessages,
@@ -1,8 +1,8 @@
1
1
  import { ref as i, computed as u } from "vue";
2
2
  import { defineStore as w } from "pinia";
3
3
  import { useCoreStore as y } from "@feedmepos/mf-common";
4
- import { a as I, g as r, A as b, S, b as D } from "./index-f4MzX8IY.js";
5
- const A = {
4
+ import { a as I, g as r, A as b, S, b as D } from "./index-nTpkh7pU.js";
5
+ const $ = {
6
6
  async readSettings(e) {
7
7
  try {
8
8
  return r(await I(`marketing-v2/${e}/setting`).get(""));
@@ -38,13 +38,13 @@ const A = {
38
38
  }, h = w("mf-connect-business", () => {
39
39
  const e = i("v2"), t = i(!1), a = i([]), c = i([]);
40
40
  async function v() {
41
- const n = y().currentBusiness.value, s = await A.readSettings(n == null ? void 0 : n.id);
41
+ const n = y().currentBusiness.value, s = await $.readSettings(n == null ? void 0 : n.id);
42
42
  return t.value = s && "business" in s && s.premium == !0 || !1, e.value = (s == null ? void 0 : s.apiVersion) || "v1", t.value;
43
43
  }
44
- async function p() {
44
+ async function d() {
45
45
  return a.value = await l.read(), a.value;
46
46
  }
47
- async function d() {
47
+ async function p() {
48
48
  return c.value = await l.readDevices(), c.value;
49
49
  }
50
50
  function m(n) {
@@ -56,7 +56,10 @@ const A = {
56
56
  label: n.name,
57
57
  value: n._id
58
58
  }))
59
- ]), g = u(() => a.value.map((n) => ({ label: n.name, value: n._id })));
59
+ ]), g = u(() => a.value.map((n) => ({
60
+ label: `${n.code ? `${n.code} - ` : ""} ${n.name}`,
61
+ value: n._id
62
+ })));
60
63
  return {
61
64
  // state
62
65
  version: e,
@@ -65,8 +68,8 @@ const A = {
65
68
  locationDevices: c,
66
69
  // actions
67
70
  readPremium: v,
68
- readLocations: p,
69
- readLocationDevices: d,
71
+ readLocations: d,
72
+ readLocationDevices: p,
70
73
  locationById: m,
71
74
  // getters
72
75
  locationItems: f,
@@ -1,14 +1,14 @@
1
1
  import { defineStore as d } from "pinia";
2
- import { reactive as f, onMounted as b, ref as a } from "vue";
3
- import { c } from "./index-Do7TcKmg.js";
4
- import { g as i, S as I, b as g } from "./index-f4MzX8IY.js";
2
+ import { reactive as b, onMounted as f, ref as s } from "vue";
3
+ import { c } from "./index-bAmlAkpk.js";
4
+ import { g as i, S as g, b as h } from "./index-nTpkh7pU.js";
5
5
  const p = () => {
6
- const e = I.getBusinessId();
6
+ const e = g.getBusinessId();
7
7
  if (!e) throw new Error("Invalid business ID");
8
- return g(`businesses/${e}/campaigns`, {
8
+ return h(`businesses/${e}/campaigns`, {
9
9
  noIdRequired: !0
10
10
  });
11
- }, h = {
11
+ }, I = {
12
12
  async readAll() {
13
13
  return i(await p().get("templates"));
14
14
  },
@@ -17,8 +17,8 @@ const p = () => {
17
17
  await p().get(`templates/${e}`)
18
18
  );
19
19
  }
20
- }, S = d("mf-connect-campaign", () => {
21
- const e = f({
20
+ }, A = d("mf-connect-campaign", () => {
21
+ const e = b({
22
22
  promotion: [],
23
23
  voucher: [],
24
24
  broadcast: [],
@@ -27,12 +27,13 @@ const p = () => {
27
27
  credit: [],
28
28
  token: [],
29
29
  mission: [],
30
+ grab: [],
30
31
  all: []
31
32
  });
32
- b(() => {
33
+ f(() => {
33
34
  console.log("🔧 CampaignStore Installed");
34
35
  });
35
- const t = a([]), r = a([]), n = a([]);
36
+ const t = s([]), r = s([]), n = s([]);
36
37
  async function u(k) {
37
38
  const o = await c.readAll({
38
39
  limit: 1e3,
@@ -40,36 +41,39 @@ const p = () => {
40
41
  sortBy: "_id",
41
42
  descending: !0
42
43
  });
43
- Object.keys(e).forEach((s) => {
44
- e[s] = [];
44
+ Object.keys(e).forEach((a) => {
45
+ e[a] = [];
45
46
  }), e.all = o.resources.filter(
46
- (s) => s.type !== "MEMBERSHIP"
47
+ (a) => a.type !== "MEMBERSHIP"
47
48
  );
48
- for (const s of o.resources)
49
- switch (s.type) {
49
+ for (const a of o.resources)
50
+ switch (a.type) {
50
51
  case "PROMOTION":
51
- e.promotion.push(s);
52
+ e.promotion.push(a);
52
53
  break;
53
54
  case "VOUCHER":
54
- e.voucher.push(s), n.value.push(s);
55
+ e.voucher.push(a), n.value.push(a);
55
56
  break;
56
57
  case "BROADCAST":
57
- ["SCHEDULE", "FEEDBACK"].includes(s.event.type) && e.broadcast.push(s);
58
+ ["SCHEDULE", "FEEDBACK"].includes(a.event.type) && e.broadcast.push(a);
58
59
  break;
59
60
  case "POINT":
60
- e.experience.push(s);
61
+ e.experience.push(a);
61
62
  break;
62
63
  case "COIN":
63
- e.point.push(s);
64
+ e.point.push(a);
64
65
  break;
65
66
  case "CREDIT":
66
- e.credit.push(s);
67
+ e.credit.push(a);
67
68
  break;
68
69
  case "GAME":
69
- e.token.push(s);
70
+ e.token.push(a);
70
71
  break;
71
72
  case "MISSION":
72
- e.mission.push(s);
73
+ e.mission.push(a);
74
+ break;
75
+ case "GRAB":
76
+ e.grab.push(a);
73
77
  break;
74
78
  }
75
79
  }
@@ -77,7 +81,7 @@ const p = () => {
77
81
  r.value = await c.readGroups();
78
82
  }
79
83
  async function m() {
80
- t.value = await h.readAll();
84
+ t.value = await I.readAll();
81
85
  }
82
86
  return {
83
87
  // State
@@ -92,5 +96,5 @@ const p = () => {
92
96
  };
93
97
  });
94
98
  export {
95
- S as u
99
+ A as u
96
100
  };
@@ -0,0 +1,253 @@
1
+ import { h as s } from "./moment-D7p2TMB-.js";
2
+ import "./index-B09KKPb4.js";
3
+ import { e as f } from "./effect-NKfquhhR.js";
4
+ import { components as l } from "@feedmepos/ui-library";
5
+ import { i as h } from "./rule-builder-D5QsmOxi.js";
6
+ import { c as O } from "./rule-CMMr2GMg.js";
7
+ import { u as C } from "./business-BvNsRlY4.js";
8
+ import { C as m } from "./campaign.fn-BgSGxLPo.js";
9
+ import { i as d, c as g } from "./plugins-BxKrsjEx.js";
10
+ import { h as p } from "vue";
11
+ import { F as a } from "./campaign.enum-BtfwwLCf.js";
12
+ const o = d.global.t;
13
+ function E() {
14
+ const e = d.global.locale;
15
+ return typeof e == "string" ? e : e.value;
16
+ }
17
+ function u(e) {
18
+ return new Intl.DateTimeFormat(E(), {
19
+ day: "2-digit",
20
+ month: "short",
21
+ year: "numeric"
22
+ }).format(new Date(e));
23
+ }
24
+ function c(e) {
25
+ return p(
26
+ "div",
27
+ {
28
+ class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
29
+ },
30
+ [
31
+ p(l.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
32
+ p("span", { class: "fm-typo-en-body-md-600" }, e.name)
33
+ ]
34
+ );
35
+ }
36
+ const A = {
37
+ [a.enum.CREDIT]: {
38
+ chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
39
+ icon: "local_activity",
40
+ get name() {
41
+ return o("connect.campaign.common.typeName.CREDIT");
42
+ },
43
+ chip() {
44
+ return c(this);
45
+ }
46
+ },
47
+ [a.enum.PROMOTION]: {
48
+ chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
49
+ icon: "loyalty",
50
+ get name() {
51
+ return o("connect.campaign.common.typeName.PROMOTION");
52
+ },
53
+ chip() {
54
+ return c(this);
55
+ }
56
+ },
57
+ [a.enum.VOUCHER]: {
58
+ chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
59
+ icon: "sell",
60
+ get name() {
61
+ return o("connect.campaign.common.typeName.VOUCHER");
62
+ },
63
+ chip() {
64
+ return c(this);
65
+ }
66
+ },
67
+ [a.enum.POINT]: {
68
+ chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
69
+ icon: "award_star",
70
+ get name() {
71
+ return o("connect.campaign.common.typeName.POINT");
72
+ },
73
+ chip() {
74
+ return c(this);
75
+ }
76
+ },
77
+ [a.enum.BROADCAST]: {
78
+ chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
79
+ icon: "campaign",
80
+ get name() {
81
+ return o("connect.campaign.common.typeName.BROADCAST");
82
+ },
83
+ chip() {
84
+ return c(this);
85
+ }
86
+ },
87
+ [a.enum.GAME]: {
88
+ chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
89
+ icon: "database",
90
+ get name() {
91
+ return o("connect.campaign.common.typeName.GAME");
92
+ },
93
+ chip() {
94
+ return c(this);
95
+ }
96
+ },
97
+ [a.enum.REWARD_POOL]: {
98
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
99
+ icon: "editor_choice",
100
+ get name() {
101
+ return o("connect.campaign.common.typeName.REWARD_POOL");
102
+ },
103
+ chip() {
104
+ return c(this);
105
+ }
106
+ },
107
+ [a.enum.COIN]: {
108
+ chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
109
+ icon: "monetization_on",
110
+ get name() {
111
+ return o("connect.campaign.common.typeName.COIN");
112
+ },
113
+ chip() {
114
+ return c(this);
115
+ }
116
+ },
117
+ [a.enum.MEMBERSHIP]: {
118
+ chipClass: "",
119
+ icon: "",
120
+ get name() {
121
+ return o("connect.campaign.common.typeName.MEMBERSHIP");
122
+ },
123
+ chip() {
124
+ return c(this);
125
+ }
126
+ },
127
+ [a.enum.MISSION]: {
128
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
129
+ icon: "editor_choice",
130
+ get name() {
131
+ return o("connect.campaign.common.typeName.MISSION");
132
+ },
133
+ chip() {
134
+ return c(this);
135
+ }
136
+ },
137
+ [a.enum.GRAB]: {
138
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
139
+ icon: "editor_choice",
140
+ name: "Grab",
141
+ chip() {
142
+ return c(this);
143
+ }
144
+ }
145
+ };
146
+ function P(e) {
147
+ const t = b(e), r = {
148
+ active: "text-fm-color-typo-success bg-fm-color-system-success-100",
149
+ upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
150
+ expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
151
+ };
152
+ return e.type == "VOUCHER" ? p(l.FmChip, {
153
+ class: r[t],
154
+ label: g.title(o(`connect.campaign.common.status.${t}`)),
155
+ compact: !0
156
+ }) : p(l.FmChip, {
157
+ class: r[t],
158
+ label: g.title(o(`connect.campaign.common.status.${t}`)),
159
+ compact: !0
160
+ });
161
+ }
162
+ function L(e) {
163
+ const t = e.timeframeOptions;
164
+ if (!t || !t.start && !t.end)
165
+ return o("connect.campaign.common.always_active");
166
+ if (!t.start && t.end)
167
+ return o("connect.campaign.common.valid_until", {
168
+ date: u(t.end)
169
+ });
170
+ const r = u(t.start), n = t.end ? u(t.end) : o("connect.campaign.common.unlimited");
171
+ return `${r} -> ${n}`;
172
+ }
173
+ function w(e) {
174
+ const { campaign: t } = e;
175
+ function r(n) {
176
+ if (!n || !n.start && !n.end)
177
+ return "connect.campaign.common.always";
178
+ const i = n.start ? u(n.start) : "From campaign creation", y = n.end ? u(n.end) : "Never ends";
179
+ return `${i} - ${y}`;
180
+ }
181
+ return {
182
+ "connect.campaign.common.campaign_name": t.name,
183
+ "connect.campaign.common.campaign_period": r(
184
+ t.timeframeOptions
185
+ ),
186
+ get "connect.campaign.common.next_schedule_at"() {
187
+ if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !h(t.event.rule))
188
+ return;
189
+ const n = O(
190
+ t.event.rule.rules.g_schedule
191
+ );
192
+ return n ? s(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
193
+ },
194
+ get "connect.campaign.common.discount_type"() {
195
+ if (t.type == "PROMOTION") return f(t.effect);
196
+ if ("configs" in e && e.configs.type == "VOUCHER")
197
+ return f(e.configs.extras.effect);
198
+ },
199
+ get "connect.campaign.common.available_at"() {
200
+ return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
201
+ (n) => C().locationItems.find((i) => i.value == n).label
202
+ ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
203
+ }
204
+ };
205
+ }
206
+ function b(e) {
207
+ return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? s().isBetween(
208
+ e.timeframeOptions.start ?? s().subtract(1, "d"),
209
+ e.timeframeOptions.end ?? s().add(1, "d")
210
+ ) ? "active" : s().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
211
+ }
212
+ function B(e) {
213
+ var t, r;
214
+ switch (e.event.type) {
215
+ case "BILL_COMPLETED":
216
+ const n = `Spend to get ${m.formattedType(e.type)}`;
217
+ switch (e.type) {
218
+ case "POINT":
219
+ case "CREDIT":
220
+ case "COIN":
221
+ return e.earningOption.type == "FIXED" ? `Spend to get ${e.earningOption.amount} ${m.formattedType(e.type)}` : `Every ${e.earningOption.every} amount spent get ${e.earningOption.amount} ${m.formattedType(e.type)}`;
222
+ case "VOUCHER":
223
+ const i = (r = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : r.effect;
224
+ return i ? `${n} - ${f(i)}` : n;
225
+ default:
226
+ return n;
227
+ }
228
+ case "FEEDBACK":
229
+ return `Give feedback to receive ${m.formattedType(e.type)}`;
230
+ case "SCHEDULE":
231
+ return `Receive ${m.formattedType(e.type)} on scheduled time`;
232
+ case "SIMPLE_CLAIM":
233
+ return "Simple claim voucher";
234
+ case "TIER_UPGRADED":
235
+ return `Receive ${m.formattedType(e.type)} when member tier upgraded`;
236
+ case "MEMBERSHIP_JOINED":
237
+ return `Receive ${m.formattedType(e.type)} when member joined`;
238
+ case "MAKING_ORDER":
239
+ return e.type !== "PROMOTION" ? void 0 : f(e.effect);
240
+ default:
241
+ throw new Error(
242
+ `Not implemented ${JSON.stringify({ cause: e.event.type })}`
243
+ );
244
+ }
245
+ }
246
+ export {
247
+ A as C,
248
+ b as a,
249
+ P as b,
250
+ B as c,
251
+ w as d,
252
+ L as g
253
+ };
@@ -0,0 +1,26 @@
1
+ import { z as E } from "./index-5FmmWAib.js";
2
+ const M = E.enum([
3
+ "VOUCHER",
4
+ "PROMOTION",
5
+ "POINT",
6
+ "CREDIT",
7
+ "MEMBERSHIP",
8
+ "BROADCAST",
9
+ "COIN",
10
+ "REWARD_POOL",
11
+ "GAME",
12
+ "MISSION",
13
+ "GRAB"
14
+ ]), O = E.enum([
15
+ "TIME_BASED_PROMOTION",
16
+ "GAME_PROMOTION",
17
+ "PRICE_CHANGE_PROMOTION"
18
+ ]), R = {
19
+ [O.enum.TIME_BASED_PROMOTION]: "7.7.4",
20
+ [O.enum.GAME_PROMOTION]: "7.7.4",
21
+ [O.enum.PRICE_CHANGE_PROMOTION]: "7.12.18"
22
+ };
23
+ export {
24
+ M as F,
25
+ R as f
26
+ };