@feedmepos/mf-connect 0.1.38-beta.6 → 0.1.38-beta.61

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 (148) hide show
  1. package/dist/{Analytic-NBx32reB.js → Analytic-CM7mh-iO.js} +16 -16
  2. package/dist/{App-CaK9PvMd.js → App-CeCzzsDu.js} +625 -619
  3. package/dist/AuditLogs-VWx8DFKA.js +1991 -0
  4. package/dist/{Bin-CL6o1JSs.js → Bin-vUuol_I9.js} +10 -10
  5. package/dist/Broadcast-6VXz4-IG.js +233 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BIySMYGP.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CV-zhJ15.js} +6 -6
  7. package/dist/{Card-DNdEjt6s.js → Card-CeIeGET1.js} +144 -140
  8. package/dist/Collections-CF_OcAL3.js +540 -0
  9. package/dist/Credit-BUqGOyp_.js +226 -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-0DMFuBoG.js +3150 -0
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BZfchHlT.js +347 -0
  14. package/dist/Experience-BxiFH_uV.js +225 -0
  15. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-lgg_oBvT.js} +1 -1
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  17. package/dist/Game-BzYW0LfY.js +300 -0
  18. package/dist/GenerateMaterial-B5A7mx2y.js +589 -0
  19. package/dist/Grab-BgiMqwvj.js +301 -0
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-DZ8DHrQ_.js} +49 -48
  21. package/dist/{Index-2wokhhFB.js → Index-B85ops8K.js} +54 -54
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-B5rIjxYd.js} +1 -1
  23. package/dist/{MainLayout-B1aJoR95.js → MainLayout-CXGVkD-W.js} +1 -1
  24. package/dist/Marketing-Bnijl7lA.js +145 -0
  25. package/dist/MarketingMaterialEdit-BlUKwSoP.js +746 -0
  26. package/dist/{Member-2xV4Izwa.js → Member-sT853g51.js} +38 -37
  27. package/dist/{MemberList-CYgBdyJt.js → MemberList-DYT5_fSP.js} +158 -159
  28. package/dist/{MemberTransactions-DWDV01N4.js → MemberTransactions-Cqce5ebe.js} +1 -1
  29. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Becsw31k.js → MessageInput.vue_vue_type_script_setup_true_lang-Dq0Hswj8.js} +5940 -5668
  30. package/dist/Mission-Q5_sGgrm.js +304 -0
  31. package/dist/{Overview-BZjto86d.js → Overview-B0rwrHR1.js} +24 -25
  32. package/dist/Point-BGYFMvev.js +228 -0
  33. package/dist/Promotion-0acd63nA.js +364 -0
  34. package/dist/{Queue-D62r2qjy.js → Queue-SVqRUlD_.js} +14 -15
  35. package/dist/{Record-0iF3dG7y.js → Record-BTjg4ihy.js} +10 -10
  36. package/dist/{Reward-C5IEJYu6.js → Reward-DW58VMRO.js} +16 -16
  37. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-S2Fd0qO8.js → RewardGroup.vue_vue_type_script_setup_true_lang-s1RI55Rc.js} +13 -14
  38. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Os17lXBX.js +1766 -0
  39. package/dist/{Segment-BknjBrUP.js → Segment-Dny8pxP1.js} +273 -274
  40. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BLQlkp-j.js → SelectItems.vue_vue_type_script_setup_true_lang-Czx7rqiq.js} +12 -12
  41. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CaPi4hYB.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-EgVxUG_N.js} +12 -12
  42. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BoZ0ZpNZ.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CO0fgI3K.js} +4 -4
  43. package/dist/Setting-CjcnxK34.js +1992 -0
  44. package/dist/SettingAdvertisements-CIyDF4C8.js +263 -0
  45. package/dist/Store-B8k5YVqU.js +1934 -0
  46. package/dist/StoreRewards-BW08rwpL.js +534 -0
  47. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BfFSfE2H.js +1034 -0
  48. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CZkKjUNQ.js +8093 -0
  49. package/dist/{Tier-B168DtFj.js → Tier-DKzu4tYw.js} +561 -480
  50. package/dist/{Title-uH0RI1N3.js → Title-BK-TXatJ.js} +149 -147
  51. package/dist/{Transaction-Bx-pmLrJ.js → Transaction-Duayg1jd.js} +2 -2
  52. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Ce_55V7l.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BAR9h1TV.js} +7 -7
  53. package/dist/{Voucher-Dzpz2AEB.js → Voucher-BEVAkNeJ.js} +140 -124
  54. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DvFy9Z6X.js +421 -0
  55. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CfLiUj9f.js → ZodTextField.vue_vue_type_script_setup_true_lang-CU_Sx2PM.js} +2 -2
  56. package/dist/app-IvbII0ql.js +45026 -0
  57. package/dist/app.js +1 -1
  58. package/dist/{business-B65OtB5B.js → business-BFIwFfkq.js} +11 -8
  59. package/dist/campaign-RuIwxc4y.js +253 -0
  60. package/dist/{campaign-qGy6uzrC.js → campaign-w9j4I4jn.js} +29 -25
  61. package/dist/{campaign.enum-CZp2DmXI.js → campaign.enum-IHLsfdik.js} +3 -2
  62. package/dist/campaign.fn-B_P1MkRV.js +776 -0
  63. package/dist/{collectible.enum-CN-lnG1m.js → collectible.enum-CUgSjO08.js} +1 -1
  64. package/dist/{collection.fn-mMwGQWce.js → collection.fn-CrfnNb41.js} +2 -2
  65. package/dist/dto-jwO_sX9I.js +222 -0
  66. package/dist/{effect-Bg3yb9T6.js → effect--0g8PNyt.js} +1 -1
  67. package/dist/{email-addresses-CQsN724N.js → email-addresses-HtsxvXw9.js} +2 -2
  68. package/dist/{export-BLf2dhFd.js → export-CFEwMRmd.js} +9 -10
  69. package/dist/{helper-CFaph16Q.js → helper-CCfb24PO.js} +22 -7
  70. package/dist/index-B-AMMFfT.js +3419 -0
  71. package/dist/{index-BPyac0fq.js → index-BR3UbZ0F.js} +1 -1
  72. package/dist/{index-Dy5p_b1S.js → index-BZEM0T2A.js} +1 -1
  73. package/dist/index-Bflu4Rft.js +8884 -0
  74. package/dist/{index-Dkmn0jmX.js → index-CR3f3BXQ.js} +2552 -2356
  75. package/dist/{index-BkySejFg.js → index-CZPcwcUo.js} +3 -3
  76. package/dist/{index-BPZtjcTm.js → index-CkuPY85X.js} +1 -1
  77. package/dist/index-CppLPpqB.js +30933 -0
  78. package/dist/index-CuvNtC_M.js +61 -0
  79. package/dist/{index-BKOgzVx6.js → index-DDYH-IEX.js} +1 -1
  80. package/dist/{index-DaEQgaiW.js → index-DdZdHioZ.js} +455 -245
  81. package/dist/{index-BBPIZjw6.js → index-Dic_WcAL.js} +3 -3
  82. package/dist/{index-CH2d_B8c.js → index-DpjYgKTN.js} +4 -1
  83. package/dist/index-wzSeRJAd.js +36 -0
  84. package/dist/{index.esm2017-B9vJTKYg.js → index.esm2017-CUnjzfU-.js} +89 -89
  85. package/dist/loading-CivgDw5C.js +215 -0
  86. package/dist/{lodash-B5I3zXaY.js → lodash-BSbv_9TG.js} +1 -1
  87. package/dist/{membership-Du79A0Pl.js → membership-j2w1YUO-.js} +3 -3
  88. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  89. package/dist/{money-DXgYs2-R.js → money-DL-x8hiT.js} +1 -1
  90. package/dist/{number-CBMkNZvH.js → number-D1yoFGEr.js} +1 -1
  91. package/dist/objectid-CHab6j3r.js +145 -0
  92. package/dist/{campaign-iKI-L84v.js → plugins-P-V4XWmW.js} +784 -777
  93. package/dist/remy-D_Deb3ue.js +13 -0
  94. package/dist/{reward-ClX_lWcQ.js → reward-BqMlBQRu.js} +1 -1
  95. package/dist/{rule-BfidJ75Y.js → rule-CztsLdki.js} +4 -4
  96. package/dist/rule-builder-DANv7Rmz.js +102 -0
  97. package/dist/style.css +11 -2
  98. package/dist/template-Dbz3FhHK.js +188 -0
  99. package/dist/timezone-BgVqObBq.js +1151 -0
  100. package/dist/trigger-CbriUibd.js +213 -0
  101. package/dist/usePagination-DtNK7W0U.js +223 -0
  102. package/dist/user-CVapqHfr.js +55 -0
  103. package/dist/vue-i18n-tpDAnnmD.js +2365 -0
  104. package/dist/{xlsx-Be4bARvl.js → xlsx-EewcN2uY.js} +1 -1
  105. package/dist/{zod-Bg2FbC-D.js → zod-D-wiCQRJ.js} +32 -31
  106. package/package.json +13 -5
  107. package/dist/AuditLogs-C-gCCPvF.js +0 -1887
  108. package/dist/Broadcast-B2-itjvZ.js +0 -227
  109. package/dist/Collections-DepGq6WJ.js +0 -465
  110. package/dist/Credit-D7K0gFwc.js +0 -222
  111. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  112. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-HMjbuy2C.js +0 -2185
  113. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DrbMJlm5.js +0 -347
  114. package/dist/Experience-FlBX3eyN.js +0 -223
  115. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  116. package/dist/Game-Cc3D7lKV.js +0 -278
  117. package/dist/Marketing-D7PXYloN.js +0 -20073
  118. package/dist/Mission-BSGc9822.js +0 -296
  119. package/dist/Point-0U4TTdPW.js +0 -226
  120. package/dist/Promotion-DiUa0GcV.js +0 -289
  121. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CxlamGFP.js +0 -1751
  122. package/dist/Setting-RLI7RgmN.js +0 -1936
  123. package/dist/Store-gxmv8hWJ.js +0 -1842
  124. package/dist/StoreRewards-C_6gY_Nk.js +0 -423
  125. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B5uzSYM4.js +0 -1029
  126. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-yjI96ZL0.js +0 -139
  127. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-dbA6_6b9.js +0 -419
  128. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  129. package/dist/app-B90wINOO.js +0 -33357
  130. package/dist/app-DuUxQ1ZP.js +0 -7086
  131. package/dist/campaign.fn-DKScnmjX.js +0 -758
  132. package/dist/dto-C5ri8Nws.js +0 -214
  133. package/dist/index-BCGDOgxb.js +0 -38
  134. package/dist/index-BCPBmANe.js +0 -3120
  135. package/dist/index-BN2Uyvj4.js +0 -30038
  136. package/dist/index-CrbnfAk8.js +0 -8861
  137. package/dist/index-CsaQJMAR.js +0 -66
  138. package/dist/index-DJwQICyC.js +0 -146
  139. package/dist/loading-MEQuW9Xa.js +0 -71
  140. package/dist/objectid-BeZTZYqi.js +0 -145
  141. package/dist/plugins-KiMuDTPp.js +0 -208
  142. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  143. package/dist/rule-builder-BTcZx77a.js +0 -89
  144. package/dist/template-DPpMK30W.js +0 -190
  145. package/dist/trigger-DLp1bkZP.js +0 -144
  146. package/dist/usePagination-BeF5K3M7.js +0 -223
  147. package/dist/user-Cq9CGBHZ.js +0 -54
  148. package/dist/vue-i18n-COzqUgQy.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-DuUxQ1ZP.js";
2
+ import { F as e, i as o, r as p } from "./app-IvbII0ql.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-BN2Uyvj4.js";
5
- const A = {
4
+ import { a as I, g as r, A as b, S, b as D } from "./index-CppLPpqB.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,
@@ -0,0 +1,253 @@
1
+ import { h as s } from "./moment-D7p2TMB-.js";
2
+ import "./index-B-AMMFfT.js";
3
+ import { e as f } from "./effect--0g8PNyt.js";
4
+ import { components as l } from "@feedmepos/ui-library";
5
+ import { i as h } from "./rule-builder-DANv7Rmz.js";
6
+ import { c as O } from "./rule-CztsLdki.js";
7
+ import { u as C } from "./business-BFIwFfkq.js";
8
+ import { C as m } from "./campaign.fn-B_P1MkRV.js";
9
+ import { i as d, c as g } from "./plugins-P-V4XWmW.js";
10
+ import { h as p } from "vue";
11
+ import { F as a } from "./campaign.enum-IHLsfdik.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
+ };
@@ -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-CH2d_B8c.js";
4
- import { g as i, S as I, b as g } from "./index-BN2Uyvj4.js";
2
+ import { reactive as b, onMounted as f, ref as s } from "vue";
3
+ import { c } from "./index-DpjYgKTN.js";
4
+ import { g as i, S as g, b as h } from "./index-CppLPpqB.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
  };
@@ -1,4 +1,4 @@
1
- import { z as E } from "./index-Dkmn0jmX.js";
1
+ import { z as E } from "./index-CR3f3BXQ.js";
2
2
  const I = E.enum([
3
3
  "VOUCHER",
4
4
  "PROMOTION",
@@ -9,7 +9,8 @@ const I = E.enum([
9
9
  "COIN",
10
10
  "REWARD_POOL",
11
11
  "GAME",
12
- "MISSION"
12
+ "MISSION",
13
+ "GRAB"
13
14
  ]), O = E.enum(["TIME_BASED_PROMOTION", "GAME_PROMOTION"]), R = {
14
15
  [O.enum.TIME_BASED_PROMOTION]: "7.7.4",
15
16
  [O.enum.GAME_PROMOTION]: "7.7.4"