@feedmepos/mf-connect 0.1.112-prod → 0.1.113-beta.3

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 (158) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-CFJcQZEE.js → App-YfpYV7C0.js} +700 -654
  3. package/dist/AuditLogs-kD0_HO_p.js +2016 -0
  4. package/dist/{Bin-DaqUNsSV.js → Bin-Dr-Xp3pn.js} +8 -8
  5. package/dist/Broadcast-CEbHu2xA.js +306 -0
  6. package/dist/{CampaignAnalytic-CpP7lgTX.js → CampaignAnalytic-DDiGxPwp.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BQiQVQBN.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js} +9 -9
  8. package/dist/{Card-Bmz5p5Pq.js → Card-BUnwg0eM.js} +25 -24
  9. package/dist/{Collections-BKND60cK.js → Collections-CKyBkKq2.js} +197 -185
  10. package/dist/{Credit-DQ_tDm8l.js → Credit-CJOXWLV1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CCwpsEWf.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-wUV_beN0.js → EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js} +32 -32
  14. package/dist/{Experience-BOE6jLIS.js → Experience-C_Am5CTY.js} +32 -31
  15. package/dist/{FileSaver.min-D0CP0E3N.js → FileSaver.min-CueAGbjq.js} +1 -1
  16. package/dist/{Game-B-8by2dp.js → Game-B6GO_LVU.js} +19 -18
  17. package/dist/{GiftCardSetup-CdqZd1ee.js → GiftCardSetup-CVLDDpI2.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BVTu4uTR.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js} +7 -7
  19. package/dist/{Goals-xFHNbwt7.js → Goals-BX-sMV2V.js} +4 -4
  20. package/dist/Grab-Bh335Srh.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B5Z1AZRV.js → ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js} +1 -1
  22. package/dist/{Index-t6veJ0lU.js → Index-CyXRbwcm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Deeanc8z.js → LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-B8qOJYoS.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-DXNBsnM5.js → LoyaltyDashboard-DrTq8oiu.js} +15 -15
  26. package/dist/MainLayout-KbKkpX5n.js +4 -0
  27. package/dist/{MainLayout-CmCboaEn.js → MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js} +5 -4
  28. package/dist/{Marketing-DCq9O5eb.js → Marketing-DQT1MWQg.js} +4 -4
  29. package/dist/MarketingMaterialEdit-fSqr53-M.js +1037 -0
  30. package/dist/{Member-BCYmEmhD.js → Member-DwDUCzlv.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-Djrfmj9g.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js} +43 -50
  32. package/dist/{MemberImportHistory-D-5NAOfo.js → MemberImportHistory-D4ezvJGZ.js} +7 -7
  33. package/dist/{MemberList-IySTKOT_.js → MemberList-DFieV7Qk.js} +103 -105
  34. package/dist/{MemberTransactions-BgQZvc5O.js → MemberTransactions-BPOXyAuC.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-N8PCSKBx.js → MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js} +4228 -4176
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-_JNdYsBu.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js} +1 -1
  37. package/dist/{Mission-DtaTKWE2.js → Mission-nErb05Es.js} +22 -21
  38. package/dist/{Overview-DVMdPa97.js → Overview-7G31a7B-.js} +23 -22
  39. package/dist/{Overview-D-uC2-Pi.js → Overview-DuJr_hAg.js} +145 -144
  40. package/dist/{Point-jnPIgHMZ.js → Point-PWDLemD4.js} +22 -21
  41. package/dist/{Promotion-mdQg-RSh.js → Promotion-N80Tj8M6.js} +137 -131
  42. package/dist/{Queue-D8YY1lbn.js → Queue-M7ZpgiMT.js} +47 -46
  43. package/dist/{Record-Dh-rN7a0.js → Record-NhxrdvWv.js} +9 -9
  44. package/dist/{Review-C8B-SIR8.js → Review-DiAaAzIG.js} +2 -2
  45. package/dist/ReviewFacebookCallback-JdyxFbNl.js +225 -0
  46. package/dist/{ReviewGoogleCallback-pNF2ICvQ.js → ReviewGoogleCallback-BXbI3Bsh.js} +5 -5
  47. package/dist/{Reward-D7KPnzXt.js → Reward-yTaOqOT8.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C87CDjxP.js → RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js +1923 -0
  50. package/dist/{Segment-Ct8JRTjV.js → Segment-DE9Bcd6R.js} +290 -291
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-w-UpWetC.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbEX2h2u.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js} +4 -4
  53. package/dist/Setting-C0JAxIRT.js +574 -0
  54. package/dist/{SettingAdvertisements-BrB-dGPs.js → SettingAdvertisements-DxueyKU8.js} +12 -12
  55. package/dist/Settings-Cs46AcxZ.js +286 -0
  56. package/dist/{Store-EKPfHEmY.js → Store-DqQae9nE.js} +661 -654
  57. package/dist/{StoreRewards-B208ENOi.js → StoreRewards-JxSUsOzJ.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js +7007 -0
  60. package/dist/{Tier-CjYiCZy_.js → Tier-DWhgWush.js} +2576 -687
  61. package/dist/{Title-BXkVolaL.js → Title-DUNeMdz8.js} +94 -92
  62. package/dist/{Transaction-D1T3aIC3.js → Transaction-DAv-LVhC.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-flUDCSA5.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js} +26 -26
  64. package/dist/{Voucher-DnQ8jNjI.js → Voucher-uLTq9RSK.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Z9GDpO4z.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js} +16 -16
  66. package/dist/WhatsappAccount-BpXQ4q0P.js +158 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js +39 -0
  68. package/dist/WhatsappBot-DB4NRZMd.js +589 -0
  69. package/dist/WhatsappBotLogs-DDN4H_bv.js +372 -0
  70. package/dist/WhatsappBotSettings-Bkv1VNwF.js +387 -0
  71. package/dist/WhatsappBotTickets-DAKgnE6T.js +162 -0
  72. package/dist/WhatsappLayout-DSnq84Uo.js +21 -0
  73. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +195 -0
  74. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Dcw8Oi-t.js → ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js} +2 -2
  75. package/dist/{app-BtGohMqA.js → app-Devzv4gO.js} +10468 -8156
  76. package/dist/app.js +4 -3
  77. package/dist/{base.export-DulNMo7e.js → base.export-CCSMkvAm.js} +2 -2
  78. package/dist/browser-BSAOEeIM.js +1478 -0
  79. package/dist/{business-Bla8vvZH.js → business-BjAmUqNA.js} +1 -1
  80. package/dist/campaign-C5c47GqT.js +400 -0
  81. package/dist/{campaign-BIPNFBY5.js → campaign-CTe-T5Gd.js} +31 -25
  82. package/dist/{campaign.enum-liUaxkcy.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  83. package/dist/campaign.fn-DxAO8A5b.js +776 -0
  84. package/dist/{collectible.enum-C0FfRMrW.js → collectible.enum-Liy2wH3s.js} +1 -1
  85. package/dist/{collection.fn-DdDMfaFO.js → collection.fn-C9l-OtNt.js} +2 -2
  86. package/dist/{currency-BrVnqxQ1.js → currency-mwm4AWXK.js} +1 -1
  87. package/dist/duplicateCampaign-BbC4AwQ1.js +51 -0
  88. package/dist/{effect-gfVmfrm9.js → effect-D8ba9z0K.js} +1 -1
  89. package/dist/{email-addresses-Dy8NFNBw.js → email-addresses-BR5J6_Jz.js} +2 -2
  90. package/dist/feature-flag-C-5NdFW8.js +868 -0
  91. package/dist/feature-flag-CNcU4_3r.js +50 -0
  92. package/dist/google-BQK68wbe.js +5 -0
  93. package/dist/{helper-CMhQctQK.js → helper-D9cEaMIv.js} +1 -1
  94. package/dist/index-0H82-X0n.js +80 -0
  95. package/dist/{index-D6RDVy95.js → index-B1jP-_Z_.js} +691 -230
  96. package/dist/{index-Dalmv1m4.js → index-B7HH6vKF.js} +8 -7
  97. package/dist/{index-v1exQSyU.js → index-BFaZp6Et.js} +29 -15
  98. package/dist/{index-DKmtDBKS.js → index-B_gzo75q.js} +1 -1
  99. package/dist/{index-qJOEwQ_z.js → index-BfoDdVQS.js} +19 -6
  100. package/dist/{index-C5rRuwhC.js → index-BvY2hQac.js} +1 -1
  101. package/dist/{index-CZqwIQXi.js → index-Byg4ztr-.js} +396 -232
  102. package/dist/{index-otcusTFM.js → index-CZfqqrVu.js} +4 -3
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-CUFuU2eJ.js → index-CmzjBrHR.js} +11 -10
  105. package/dist/{index-CLiJUFmJ.js → index-Ct6YjTIW.js} +2 -2
  106. package/dist/{index-B6x6s8mu.js → index-D34iYRdc.js} +683 -581
  107. package/dist/{index-dyMdi0Rt.js → index-D4k1G2oE.js} +4 -4
  108. package/dist/{index-DvW-3flw.js → index-DnepoNWn.js} +8028 -10767
  109. package/dist/index-Drmh0FT-.js +14571 -0
  110. package/dist/{index-BqKrePY8.js → index-DtcUCknS.js} +2700 -2613
  111. package/dist/{index-D1T4Yf4t.js → index-DwTBiVts.js} +1 -1
  112. package/dist/{index-BOZ3oVHd.js → index-OvnHt5x5.js} +800 -793
  113. package/dist/index-RwNlbTO8.js +115 -0
  114. package/dist/{index-C67-z1uf.js → index-VqAbYyHH.js} +2 -2
  115. package/dist/{index-CghtzuVO.js → index-yGSko6Eq.js} +1 -1
  116. package/dist/{index.esm2017-BLKRIlb9.js → index.esm2017-DLb2VyCT.js} +156 -156
  117. package/dist/{loading-BkJ3h_4U.js → loading-CUNk5u1d.js} +1 -1
  118. package/dist/{lodash-C0Kbs8lQ.js → lodash-BJXravls.js} +1 -1
  119. package/dist/{member-import-trpK8l8R.js → member-import-DjYoddBi.js} +6 -5
  120. package/dist/{membership-TV1CoyKQ.js → membership-ByJUFP8f.js} +3 -3
  121. package/dist/{money-BM-DK9iD.js → money-Bf2IEMJJ.js} +1 -1
  122. package/dist/{number-BclgE86R.js → number-CRBHrRUL.js} +1 -1
  123. package/dist/objectid-58gyOvdR.js +145 -0
  124. package/dist/{onboarding-BLuoXyCY.js → onboarding-CQ3lw7eY.js} +25 -25
  125. package/dist/{onboardingSetup-BLmLAgIV.js → onboardingSetup-CsdZKGFk.js} +2 -2
  126. package/dist/{plugins-3_mD58dh.js → plugins-iTZLbJGy.js} +3 -3
  127. package/dist/{MarketingMaterialEdit-CGLxanxm.js → remy-icon-BhUGu2NI.js} +2 -1031
  128. package/dist/{reward-Bo4szVCU.js → reward-DTN6JpEd.js} +1 -1
  129. package/dist/{rule-Bwy5-zD7.js → rule-BYACNQOL.js} +572 -492
  130. package/dist/style.css +1 -1
  131. package/dist/template--Vr0PCjB.js +188 -0
  132. package/dist/{timezone-DQ7TNXmV.js → timezone-DwzjOED-.js} +1 -1
  133. package/dist/{transaction.fn-OT7ucfCB.js → transaction.fn-DapYe3n7.js} +2 -2
  134. package/dist/{trigger-BJKHGcNG.js → trigger-D8r76yb0.js} +9 -9
  135. package/dist/{useMarketingMaterialActions-BX3C1Gga.js → useMarketingMaterialActions-CdMmibPE.js} +3 -3
  136. package/dist/{usePagination-Qp0qoWBj.js → usePagination-BRcQJkO1.js} +1 -1
  137. package/dist/useWhatsappAccount-BOJ8fz84.js +62 -0
  138. package/dist/{user-BcE3fiEa.js → user-vBZFKqXQ.js} +1 -1
  139. package/dist/vue-i18n-Cw6fF11e.js +2365 -0
  140. package/dist/{xlsx-DYZ421PG.js → xlsx-Muy_Rjhk.js} +1 -1
  141. package/dist/{zod-DestzeIp.js → zod-CCPTOeUz.js} +1 -1
  142. package/package.json +12 -3
  143. package/dist/Broadcast-CdAN6JCa.js +0 -271
  144. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bn-lauCv.js +0 -2431
  145. package/dist/ReviewFacebookCallback-C3eyH0pS.js +0 -238
  146. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1S2sLOK.js +0 -1883
  147. package/dist/Setting-C3Binnn_.js +0 -2036
  148. package/dist/Settings-D6h2QM6X.js +0 -179
  149. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dy7_GFoi.js +0 -1264
  150. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-B2KJeL5Y.js +0 -142
  151. package/dist/campaign-DYqAyRCY.js +0 -228
  152. package/dist/campaign.fn-J7hYcX_7.js +0 -776
  153. package/dist/google-C3S8u0mT.js +0 -4
  154. package/dist/index-Culx-Z9v.js +0 -51
  155. package/dist/objectid-C2XvpEgx.js +0 -145
  156. package/dist/rule-builder-Co_1uuj4.js +0 -102
  157. package/dist/template-fImyGLa7.js +0 -236
  158. package/dist/vue-i18n-BQmB8Ex1.js +0 -2365
@@ -1,142 +0,0 @@
1
- import { defineComponent as N, ref as U, computed as w, watch as M, resolveComponent as v, openBlock as a, createElementBlock as i, Fragment as p, toDisplayString as F, createCommentVNode as T, createElementVNode as j, createVNode as h, unref as n, renderList as S, createBlock as k, isRef as $, withCtx as C } from "vue";
2
- import { u as q } from "./business-Bla8vvZH.js";
3
- import { u as D } from "./vue-i18n-BQmB8Ex1.js";
4
- function K(l, s, o) {
5
- return l.some(
6
- o instanceof Function ? o : (u) => u === s
7
- ) || l.push(s), l;
8
- }
9
- function O(l, s, o) {
10
- return l.filter(
11
- o instanceof Function ? (u) => !o(u) : (u) => u !== s
12
- );
13
- }
14
- const R = {
15
- key: 0,
16
- class: "fm-typo-en-body-lg-400"
17
- }, z = {
18
- key: 1,
19
- class: "space-y-4"
20
- }, A = { key: 0 }, G = { key: 1 }, H = { key: 2 }, W = /* @__PURE__ */ N({
21
- __name: "TargetLocationInput",
22
- props: {
23
- label: {
24
- type: String
25
- },
26
- type: {
27
- type: String,
28
- default: "select"
29
- },
30
- modelValue: {
31
- type: Object,
32
- required: !0
33
- }
34
- },
35
- emits: ["update:model-value"],
36
- setup(l, { emit: s }) {
37
- const o = q(), { t: u } = D(), c = l, r = U(""), B = w(() => o.locations.filter(
38
- (d) => {
39
- var t;
40
- return d.name.toLowerCase().includes(r.value.toLowerCase()) || ((t = d == null ? void 0 : d.code) == null ? void 0 : t.toLowerCase().includes(r.value.toLowerCase()));
41
- }
42
- )), b = s;
43
- function L(d, t) {
44
- const m = d ? K(c.modelValue || [], t.toString()) : O(
45
- c.modelValue || o.locations.map((g) => g._id.toString()),
46
- t.toString()
47
- );
48
- return b("update:model-value", m);
49
- }
50
- const V = U(!1), I = w(() => {
51
- var m, g;
52
- const t = ((m = c.modelValue) == null ? void 0 : m.slice(0, 5).map((f) => {
53
- var y;
54
- return ((y = o.locationById(f)) == null ? void 0 : y.name) || f;
55
- })) || [];
56
- return c.modelValue && ((g = c.modelValue) == null ? void 0 : g.length) > 5 && t.push(`+${c.modelValue.length - 5} more`), t;
57
- });
58
- return M(V, (d) => {
59
- d && (r.value = "");
60
- }), (d, t) => {
61
- const m = v("FmCheckbox"), g = v("FmChip"), f = v("FmField"), y = v("FmTextField"), E = v("FmMenu");
62
- return a(), i(p, null, [
63
- l.label ? (a(), i("div", R, F(l.label), 1)) : T("", !0),
64
- l.type === "checkbox" ? (a(), i("div", z, [
65
- j("div", null, [
66
- h(m, {
67
- value: null,
68
- indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < n(o).locations.length,
69
- label: n(u)("connect.setting.location.allLocations"),
70
- "model-value": l.modelValue == null || l.modelValue.length === n(o).locations.length,
71
- "onUpdate:modelValue": t[0] || (t[0] = (e) => b("update:model-value", e ? null : []))
72
- }, null, 8, ["indeterminate", "label", "model-value"])
73
- ]),
74
- (a(!0), i(p, null, S(n(o).locations, (e) => (a(), i("div", {
75
- key: e._id.toString()
76
- }, [
77
- h(m, {
78
- value: e._id.toString(),
79
- label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
80
- "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
81
- "onUpdate:modelValue": (x) => L(x, e._id.toString())
82
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"])
83
- ]))), 128))
84
- ])) : (a(), k(E, {
85
- key: 2,
86
- modelValue: n(V),
87
- "onUpdate:modelValue": t[3] || (t[3] = (e) => $(V) ? V.value = e : null),
88
- onMenuChanged: t[4] || (t[4] = (e) => V.value = e),
89
- placement: "top-end"
90
- }, {
91
- "menu-button": C(() => [
92
- h(f, {
93
- "append-icon": n(V) ? "expand_more" : "expand_less",
94
- class: "!h-auto"
95
- }, {
96
- default: C(() => [
97
- !l.modelValue || l.modelValue.length == n(o).locations.length ? (a(), i("div", A, F(n(u)("connect.setting.location.allLocations")), 1)) : l.modelValue.length ? (a(), i("div", H, [
98
- (a(!0), i(p, null, S(n(I), (e) => (a(), k(g, {
99
- key: e,
100
- label: e,
101
- class: "max-w-[130px] text-ellipsis"
102
- }, null, 8, ["label"]))), 128))
103
- ])) : (a(), i("div", G, F(n(u)("connect.setting.location.noLocations")), 1))
104
- ]),
105
- _: 1
106
- }, 8, ["append-icon"])
107
- ]),
108
- default: C(() => [
109
- h(y, {
110
- modelValue: n(r),
111
- "onUpdate:modelValue": t[1] || (t[1] = (e) => $(r) ? r.value = e : null),
112
- placeholder: n(u)("connect.setting.location.searchLocations"),
113
- class: "my-8"
114
- }, null, 8, ["modelValue", "placeholder"]),
115
- h(m, {
116
- class: "my-8",
117
- value: null,
118
- indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < n(o).locations.length,
119
- label: n(u)("connect.setting.location.allLocations"),
120
- "model-value": l.modelValue == null || l.modelValue.length === n(o).locations.length,
121
- "onUpdate:modelValue": t[2] || (t[2] = (e) => b("update:model-value", e ? null : []))
122
- }, null, 8, ["indeterminate", "label", "model-value"]),
123
- (a(!0), i(p, null, S(n(B), (e) => (a(), k(m, {
124
- class: "my-8",
125
- key: e._id.toString(),
126
- value: e._id.toString(),
127
- label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
128
- "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
129
- "onUpdate:modelValue": (x) => L(x, e._id.toString())
130
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
131
- ]),
132
- _: 1
133
- }, 8, ["modelValue"]))
134
- ], 64);
135
- };
136
- }
137
- });
138
- export {
139
- W as _,
140
- K as p,
141
- O as r
142
- };
@@ -1,228 +0,0 @@
1
- import { h as r } from "./moment-D7p2TMB-.js";
2
- import "./index-CZqwIQXi.js";
3
- import { e as p } from "./effect-gfVmfrm9.js";
4
- import { components as u } from "@feedmepos/ui-library";
5
- import { i as g } from "./rule-builder-Co_1uuj4.js";
6
- import { c as y } from "./rule-Bwy5-zD7.js";
7
- import { u as d } from "./business-Bla8vvZH.js";
8
- import { C as m } from "./campaign.fn-J7hYcX_7.js";
9
- import { c as f } from "./string-Gcy5IM_H.js";
10
- import { i as o } from "./plugins-3_mD58dh.js";
11
- import { h as s } from "vue";
12
- import { F as a } from "./campaign.enum-liUaxkcy.js";
13
- function c(e) {
14
- return s(
15
- "div",
16
- {
17
- class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
18
- },
19
- [
20
- s(u.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
21
- s("span", { class: "fm-typo-en-body-md-600" }, e.name)
22
- ]
23
- );
24
- }
25
- const D = {
26
- [a.enum.CREDIT]: {
27
- chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
28
- icon: "local_activity",
29
- get name() {
30
- return o.global.t("connect.campaign.common.typeName.CREDIT");
31
- },
32
- chip() {
33
- return c(this);
34
- }
35
- },
36
- [a.enum.PROMOTION]: {
37
- chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
38
- icon: "loyalty",
39
- get name() {
40
- return o.global.t("connect.campaign.common.typeName.PROMOTION");
41
- },
42
- chip() {
43
- return c(this);
44
- }
45
- },
46
- [a.enum.VOUCHER]: {
47
- chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
48
- icon: "sell",
49
- get name() {
50
- return o.global.t("connect.campaign.common.typeName.VOUCHER");
51
- },
52
- chip() {
53
- return c(this);
54
- }
55
- },
56
- [a.enum.POINT]: {
57
- chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
58
- icon: "award_star",
59
- get name() {
60
- return o.global.t("connect.campaign.common.typeName.POINT");
61
- },
62
- chip() {
63
- return c(this);
64
- }
65
- },
66
- [a.enum.BROADCAST]: {
67
- chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
68
- icon: "campaign",
69
- get name() {
70
- return o.global.t("connect.campaign.common.typeName.BROADCAST");
71
- },
72
- chip() {
73
- return c(this);
74
- }
75
- },
76
- [a.enum.GAME]: {
77
- chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
78
- icon: "database",
79
- get name() {
80
- return o.global.t("connect.campaign.common.typeName.GAME");
81
- },
82
- chip() {
83
- return c(this);
84
- }
85
- },
86
- [a.enum.REWARD_POOL]: {
87
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
88
- icon: "editor_choice",
89
- get name() {
90
- return o.global.t("connect.campaign.common.typeName.REWARD_POOL");
91
- },
92
- chip() {
93
- return c(this);
94
- }
95
- },
96
- [a.enum.COIN]: {
97
- chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
98
- icon: "monetization_on",
99
- get name() {
100
- return o.global.t("connect.campaign.common.typeName.COIN");
101
- },
102
- chip() {
103
- return c(this);
104
- }
105
- },
106
- [a.enum.MEMBERSHIP]: {
107
- chipClass: "",
108
- icon: "",
109
- get name() {
110
- return o.global.t("connect.campaign.common.typeName.MEMBERSHIP");
111
- },
112
- chip() {
113
- return c(this);
114
- }
115
- },
116
- // TODO: confirm color
117
- [a.enum.MISSION]: {
118
- chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
119
- icon: "editor_choice",
120
- get name() {
121
- return o.global.t("connect.campaign.common.typeName.MISSION");
122
- },
123
- chip() {
124
- return c(this);
125
- }
126
- }
127
- };
128
- function A(e) {
129
- const t = O(e), n = {
130
- active: "text-fm-color-typo-success bg-fm-color-system-success-100",
131
- upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
132
- expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
133
- };
134
- return e.type == "VOUCHER" ? s(u.FmChip, {
135
- class: n[t],
136
- label: f.title(
137
- o.global.t(`connect.campaign.common.status.${t}`)
138
- ),
139
- compact: !0
140
- }) : s(u.FmChip, {
141
- class: n[t],
142
- label: f.title(
143
- o.global.t(`connect.campaign.common.status.${t}`)
144
- ),
145
- compact: !0
146
- });
147
- }
148
- function h(e) {
149
- if (!e || !e.start && !e.end)
150
- return "connect.campaign.common.always";
151
- const t = e.start ? r(e.start).format("DD MMM YYYY") : "From campaign creation", n = e.end ? r(e.end).format("DD MMM YYYY") : "Never ends";
152
- return `${t} - ${n}`;
153
- }
154
- function $(e) {
155
- const { campaign: t } = e;
156
- return {
157
- "connect.campaign.common.campaign_name": t.name,
158
- "connect.campaign.common.campaign_period": h(
159
- t.timeframeOptions
160
- ),
161
- get "connect.campaign.common.next_schedule_at"() {
162
- if (t.event.type != "SCHEDULE" || !t.event.rule || !g(t.event.rule))
163
- return;
164
- const n = y(
165
- t.event.rule.rules.g_schedule
166
- );
167
- return n ? r(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
168
- },
169
- get "connect.campaign.common.discount_type"() {
170
- if (t.type == "PROMOTION") return p(t.effect);
171
- if ("configs" in e && e.configs.type == "VOUCHER")
172
- return p(e.configs.extras.effect);
173
- },
174
- get "connect.campaign.common.available_at"() {
175
- return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
176
- (n) => d().locationItems.find((i) => i.value == n).label
177
- ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
178
- }
179
- };
180
- }
181
- function O(e) {
182
- return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? r().isBetween(
183
- e.timeframeOptions.start ?? r().subtract(1, "d"),
184
- e.timeframeOptions.end ?? r().add(1, "d")
185
- ) ? "active" : r().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
186
- }
187
- function P(e) {
188
- var t, n;
189
- switch (e.event.type) {
190
- case "BILL_COMPLETED":
191
- const i = `Spend to get ${m.formattedType(e.type)}`;
192
- switch (e.type) {
193
- case "POINT":
194
- case "CREDIT":
195
- case "COIN":
196
- 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)}`;
197
- case "VOUCHER":
198
- const l = (n = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : n.effect;
199
- return l ? `${i} - ${p(l)}` : i;
200
- default:
201
- return i;
202
- }
203
- case "FEEDBACK":
204
- return `Give feedback to receive ${m.formattedType(e.type)}`;
205
- case "SCHEDULE":
206
- return `Receive ${m.formattedType(e.type)} on scheduled time`;
207
- case "SIMPLE_CLAIM":
208
- return "Simple claim voucher";
209
- case "TIER_UPGRADED":
210
- return `Receive ${m.formattedType(e.type)} when member tier upgraded`;
211
- case "MEMBERSHIP_JOINED":
212
- return `Receive ${m.formattedType(e.type)} when member joined`;
213
- case "MAKING_ORDER":
214
- return e.type !== "PROMOTION" ? void 0 : p(e.effect);
215
- default:
216
- throw new Error(
217
- `Not implemented ${JSON.stringify({ cause: e.event.type })}`
218
- );
219
- }
220
- }
221
- export {
222
- D as C,
223
- A as a,
224
- P as b,
225
- $ as c,
226
- O as g,
227
- h as s
228
- };