@feedmepos/mf-connect 0.1.126-dev → 0.1.127-dev

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 (141) hide show
  1. package/dist/{App-B_Yp6cvN.js → App-CLrxVFgX.js} +10 -10
  2. package/dist/{AuditLogs-C1U17evK.js → AuditLogs-DYlfToAk.js} +13 -13
  3. package/dist/{Bin-CmIpEIwe.js → Bin-C0CugBW4.js} +8 -8
  4. package/dist/{Broadcast-DkV4BdU_.js → Broadcast-DhVQa_WW.js} +12 -12
  5. package/dist/{CampaignAnalytic-Dkwo_lpB.js → CampaignAnalytic-6jeG5U90.js} +97 -97
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Ch8Gblw6.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cxydrkof.js} +9 -9
  7. package/dist/{Card-DXCkG34M.js → Card-cpLj34Oy.js} +23 -23
  8. package/dist/{Collections-CybPfSO4.js → Collections-CdRpJuHO.js} +8 -8
  9. package/dist/{Credit-B-KUzWsX.js → Credit-E_N_yfnJ.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CWHYeYVD.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Dq-2vUqT.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C86llTFR.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSXO2bYC.js} +1285 -1140
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-nMcH6y5e.js → EffectSheet.vue_vue_type_style_index_0_lang-BeQZjLIw.js} +6 -6
  13. package/dist/{Experience-Q2NHpa-V.js → Experience-D9i0ax4C.js} +13 -13
  14. package/dist/{FileSaver.min-CKw2rn-J.js → FileSaver.min-BOE2RBne.js} +1 -1
  15. package/dist/{Game-lZvkg04z.js → Game-CirwX_l1.js} +13 -13
  16. package/dist/{GiftCardSetup-CPRju80_.js → GiftCardSetup-DpJb_azW.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Ci686UoB.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-ff6Nfvxe.js} +140 -128
  18. package/dist/{Goals-asGsUeVv.js → Goals-TejbPs-I.js} +4 -4
  19. package/dist/{Grab-BjFLSMpE.js → Grab-CeUX-LlF.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-nk87zPWH.js → ImageInput.vue_vue_type_script_setup_true_lang-CnZzRDGS.js} +1 -1
  21. package/dist/{Index-DIasPS4Y.js → Index-gqWBDZBN.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DkOn8p1v.js → LocationPicker.vue_vue_type_script_setup_true_lang-CzobgD7L.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BdSkxiP-.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DgeD1RQq.js} +1 -1
  24. package/dist/{LoyaltyDashboard-DlCsZ3YX.js → LoyaltyDashboard-R22oQHTd.js} +82 -82
  25. package/dist/{MainLayout-DLObnTAA.js → MainLayout-pJBEBaM-.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DigSZKt1.js → MainLayout.vue_vue_type_script_setup_true_lang-IX_utv2Z.js} +3 -3
  27. package/dist/{Marketing-JflPW-w9.js → Marketing-5gMwO1jV.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-fSAB3YVb.js → MarketingMaterialEdit-BaHNX_qE.js} +6 -6
  29. package/dist/{Member-CzNahXTj.js → Member-Cd0oraEq.js} +7 -7
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DzyM1fW_.js +1322 -0
  31. package/dist/{MemberImportHistory--r_A_2Es.js → MemberImportHistory-C_RkY3fg.js} +7 -7
  32. package/dist/{MemberList-CQZQ4sN8.js → MemberList-CJK1akUC.js} +14 -14
  33. package/dist/{MemberTransactions-BPg9JaUA.js → MemberTransactions-DP6schuy.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BhIFChx-.js → MessageInput.vue_vue_type_script_setup_true_lang-BaivunRx.js} +10 -10
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CdGSNqEp.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DOdYyPp2.js} +1 -1
  36. package/dist/{Mission-CYCB3YQc.js → Mission-DJ40IcG9.js} +14 -14
  37. package/dist/{Overview-B5ylMBHT.js → Overview-CaQlLSBg.js} +4 -4
  38. package/dist/{Overview-DuNuUYYq.js → Overview-DXHjNmIO.js} +21 -21
  39. package/dist/{Point-DG-Uwj25.js → Point-D0Qqmgai.js} +14 -14
  40. package/dist/{Promotion-DqxBQ1yO.js → Promotion-CQU2-tpG.js} +14 -14
  41. package/dist/{Queue-Cy8LGt_Y.js → Queue-B-Uki3qh.js} +13 -13
  42. package/dist/{Record-CzXbu41w.js → Record-BvQ0nVja.js} +9 -9
  43. package/dist/{Review-7VL6gIqp.js → Review-DMfBPU_D.js} +2 -2
  44. package/dist/{ReviewFacebookCallback-BwzuPmrz.js → ReviewFacebookCallback-Bq6JQ7LR.js} +5 -5
  45. package/dist/{ReviewGoogleCallback-1JXR_f5O.js → ReviewGoogleCallback-Bg9PFxog.js} +5 -5
  46. package/dist/{Reward-BKhUDEu3.js → Reward-CNC0z98e.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DjjCytWF.js → RewardGroup.vue_vue_type_script_setup_true_lang-DXr-5wJE.js} +14 -14
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Vg7pRGIz.js → RuleGroup.vue_vue_type_script_setup_true_lang-OznhirAU.js} +15 -15
  49. package/dist/{Segment-DdHDJhaS.js → Segment-V0ZQJkN-.js} +27 -27
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-9kGUkHMi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BmFp2pst.js} +15 -15
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DeFw0px7.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C0IbEZMG.js} +4 -4
  52. package/dist/{Setting-DZKGXw-i.js → Setting-DCb6IIrk.js} +15 -15
  53. package/dist/{SettingAdvertisements-BBNs8tCw.js → SettingAdvertisements-Dc9XfzVl.js} +12 -12
  54. package/dist/{Settings-9v0hnBJZ.js → Settings-BIjIfmFI.js} +5 -5
  55. package/dist/{Store-C8IlE4IH.js → Store-DkoB_5IF.js} +27 -27
  56. package/dist/{StoreRewards-DWygRLR1.js → StoreRewards-a4ujLMfY.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CeYYws6P.js → StoreTransactions.vue_vue_type_script_setup_true_lang-UbMY0RzG.js} +25 -25
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BiN3uRJ_.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BWjb1wHV.js} +2 -2
  59. package/dist/{Tier-7RoxGHsP.js → Tier-1WKuUirS.js} +28 -28
  60. package/dist/{Title-0q2Z4HIe.js → Title-CznZg4jL.js} +23 -23
  61. package/dist/{Transaction-CFasERdg.js → Transaction-DBRQDmA3.js} +2 -2
  62. package/dist/{Upselling-DM9R6pYw.js → Upselling-CjZvUUqn.js} +3 -3
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BDjwcgnc.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DS4hdSE9.js} +6 -6
  64. package/dist/{Voucher-BkzW2hVV.js → Voucher-Di6VhoSM.js} +18 -18
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DaE4xa3x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BjSzCnBw.js} +12 -12
  66. package/dist/{WhatsappAccount-C3WpDF9O.js → WhatsappAccount-DdXadlHI.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BxC_3h52.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Cnlvi-GG.js} +1 -1
  68. package/dist/WhatsappBot-DwhQmZLJ.js +882 -0
  69. package/dist/{WhatsappBotLogs--KskC32Z.js → WhatsappBotLogs-BAglKUAZ.js} +66 -66
  70. package/dist/{WhatsappBotSettings-Dns_PqVE.js → WhatsappBotSettings-DslJTj2X.js} +5 -5
  71. package/dist/{WhatsappLayout-NIrFGbId.js → WhatsappLayout-14847AOz.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BfD5hHc7.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-otzgv6Jh.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CJGxy7gf.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEY-LOVu.js} +2 -2
  74. package/dist/{app-B9nLnoBt.js → app-KbxCI4gY.js} +107 -91
  75. package/dist/app.js +1 -1
  76. package/dist/{base.export-CBzNea0v.js → base.export-DH8OxNrx.js} +2 -2
  77. package/dist/business-DuKNr9P7.js +83 -0
  78. package/dist/{campaign-BDCLKFwN.js → campaign-DR5xHhgA.js} +2 -2
  79. package/dist/{campaign-B6nTwt17.js → campaign-Ddv-RZgo.js} +113 -99
  80. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-DsaSpHDQ.js} +1 -1
  81. package/dist/{campaign.fn-Ck1t5C1T.js → campaign.fn-CJlEovlZ.js} +142 -142
  82. package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-CDHT9uk3.js} +1 -1
  83. package/dist/{collection.fn-CDna_VLD.js → collection.fn-DTZs-hUX.js} +2 -2
  84. package/dist/{currency-Baum67Wz.js → currency-1-Yhpyv5.js} +1 -1
  85. package/dist/{duplicateCampaign-BwrMZgaV.js → duplicateCampaign-BncSxYSg.js} +2 -2
  86. package/dist/{effect-CeJbflOK.js → effect-TTD5--LN.js} +1 -1
  87. package/dist/{email-addresses-Y3vF73J0.js → email-addresses-pxXp67Al.js} +2 -2
  88. package/dist/{feature-flag-zn6Ql9tv.js → feature-flag-CFVZl4ed.js} +1 -1
  89. package/dist/{helper-DZvnn-yx.js → helper-BC_Cl5VR.js} +1 -1
  90. package/dist/{index-Da0-7h2j.js → index-42Wl_5UE.js} +1 -1
  91. package/dist/{index-BYUEPfbP.js → index-BRl7Besd.js} +2 -2
  92. package/dist/{index-CPi3Qwmj.js → index-BxUMqeaY.js} +4 -4
  93. package/dist/{index-DHNhIloU.js → index-ByFFDLTo.js} +1 -1
  94. package/dist/{index-njg4JLa-.js → index-CBKbnJRo.js} +9 -9
  95. package/dist/index-CGtlXLTG.js +10767 -0
  96. package/dist/{index-B3LCTMwV.js → index-CRKdLbXL.js} +68 -60
  97. package/dist/{index-CMs3aIA6.js → index-CaHkqz0W.js} +3 -3
  98. package/dist/{index-DkBOM8za.js → index-CcXMYJxc.js} +8 -8
  99. package/dist/{index-DXyOBtgF.js → index-CkiP4iG6.js} +1 -1
  100. package/dist/{index-CDRTiAEu.js → index-D1iOPNg3.js} +1 -1
  101. package/dist/{index-DCR1GFCA.js → index-D2Nq0UoL.js} +6 -6
  102. package/dist/index-D4nA0Z7e.js +19528 -0
  103. package/dist/{index-r_T5o_hF.js → index-DHw8wo7T.js} +2 -2
  104. package/dist/{index-FgM7b2Sw.js → index-DKOoRHPf.js} +4 -4
  105. package/dist/{index-B20FfbEE.js → index-DcbPYZkw.js} +26 -19
  106. package/dist/{index-DXKJsqgW.js → index-DjwrfZk3.js} +18 -18
  107. package/dist/{index-DJIt5tXC.js → index-EuZfRdBT.js} +5 -5
  108. package/dist/{index-juXxYQ_a.js → index-H4XJDOoT.js} +6 -6
  109. package/dist/{index-B5H4znfe.js → index-ImU7YXN7.js} +1 -1
  110. package/dist/{index-B22ojkMy.js → index-N4EzkcEu.js} +2 -2
  111. package/dist/{index-BqniSMV6.js → index-j7eLKJK3.js} +4 -4
  112. package/dist/{index.esm2017-Dtk7BscN.js → index.esm2017-CBo4j3U1.js} +1 -1
  113. package/dist/{loading-PoODMkQD.js → loading-COAu2l7W.js} +1 -1
  114. package/dist/{lodash-TthNgH98.js → lodash-Bu1ipIkR.js} +1 -1
  115. package/dist/{member-import-D7zs0Jvh.js → member-import-CkiTJIqy.js} +2 -2
  116. package/dist/{membership-Cab-iWQ1.js → membership-BSEeYyiz.js} +3 -3
  117. package/dist/{money-9Q306M3g.js → money-BOaGQSGa.js} +1 -1
  118. package/dist/{number-D9M3D435.js → number-B2AC2EMT.js} +1 -1
  119. package/dist/{objectid-DKvQl6FD.js → objectid-BKw48v5L.js} +2 -2
  120. package/dist/{onboarding-D5LKUHVI.js → onboarding-ClA8xAnH.js} +3 -3
  121. package/dist/{onboardingSetup-D0jsS6w5.js → onboardingSetup-DHjnq0H1.js} +2 -2
  122. package/dist/{plugins-CDTKQ1Pg.js → plugins-DewN43sP.js} +3 -3
  123. package/dist/{reward-De3e9vYS.js → reward-deDdPQiR.js} +1 -1
  124. package/dist/{rule-trVJgEOe.js → rule-B8ifutnO.js} +10 -10
  125. package/dist/{template-Bj3Tb6bP.js → template-z3VMmWei.js} +6 -6
  126. package/dist/timezone-BxJDy-bY.js +19 -0
  127. package/dist/{transaction.fn-CPE-oQhA.js → transaction.fn-CBBhq01K.js} +2 -2
  128. package/dist/{trigger-C6oM-8pe.js → trigger-B_quLwWr.js} +5 -5
  129. package/dist/{useMarketingMaterialActions-C5scdJQp.js → useMarketingMaterialActions-DqoRLx1M.js} +4 -4
  130. package/dist/{usePagination-CIuTHSSG.js → usePagination-Q1fPttcp.js} +1 -1
  131. package/dist/{user-Bdlgn2yo.js → user-Bw6h9xn-.js} +1 -1
  132. package/dist/{vue-i18n-DEpDI-dt.js → vue-i18n-DpCS1FnK.js} +109 -109
  133. package/dist/{xlsx-CvecxUOG.js → xlsx--toeD6hC.js} +1 -1
  134. package/dist/{zod-bniyeWdY.js → zod-BkNAcpay.js} +1 -1
  135. package/package.json +1 -1
  136. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-bqWUIbMG.js +0 -1300
  137. package/dist/WhatsappBot-DZb-Dn3s.js +0 -878
  138. package/dist/business-aT2zslwu.js +0 -82
  139. package/dist/index-BL2zQnXK.js +0 -27551
  140. package/dist/index-C_H8jFYf.js +0 -2743
  141. package/dist/timezone-DkuByUmb.js +0 -20
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-B9nLnoBt.js";
2
+ import { F as e, i as o, r as p } from "./app-KbxCI4gY.js";
3
3
  export {
4
4
  e as FmApp,
5
5
  o as i18nMessages,
@@ -1,8 +1,8 @@
1
1
  var w = Object.defineProperty;
2
2
  var y = (e, s, o) => s in e ? w(e, s, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[s] = o;
3
3
  var n = (e, s, o) => y(e, typeof s != "symbol" ? s + "" : s, o);
4
- import { u as x } from "./loading-PoODMkQD.js";
5
- import { w as h, u as a } from "./xlsx-CvecxUOG.js";
4
+ import { u as x } from "./loading-COAu2l7W.js";
5
+ import { w as h, u as a } from "./xlsx--toeD6hC.js";
6
6
  const t = {
7
7
  sortBy: "_id",
8
8
  descending: !1,
@@ -0,0 +1,83 @@
1
+ import { ref as r, computed as l } from "vue";
2
+ import { defineStore as y } from "pinia";
3
+ import { useCoreStore as I } from "@feedmepos/mf-common";
4
+ import { d as b, g as i, A as S, S as C, b as D } from "./index-EuZfRdBT.js";
5
+ const $ = {
6
+ async readSettings(e) {
7
+ try {
8
+ return i(await b(`marketing-v2/${e}/setting`).get(""));
9
+ } catch (s) {
10
+ if (console.error(JSON.stringify(s)), s instanceof S)
11
+ return {
12
+ _id: e,
13
+ business: e,
14
+ apiVersion: "v1"
15
+ };
16
+ throw s;
17
+ }
18
+ }
19
+ }, o = () => {
20
+ const e = C.getBusinessId();
21
+ if (!e) throw new Error("Invalid business ID");
22
+ return D(`businesses/${e}/location`, {
23
+ noIdRequired: !0
24
+ });
25
+ }, v = {
26
+ async read() {
27
+ return i(await o().get(""));
28
+ },
29
+ async readDevices() {
30
+ return i(await o().get("devices"));
31
+ },
32
+ async unregisterDevice(e) {
33
+ await i(await o().delete(`devices/${e}`));
34
+ },
35
+ async getOtp(e) {
36
+ return i(await o().post(`${e}/otp`));
37
+ }
38
+ }, E = y("mf-connect-business", () => {
39
+ const e = r("v2"), s = r(!1), c = r(!1), a = r([]), u = r([]);
40
+ async function d() {
41
+ const n = I().currentBusiness.value, t = await $.readSettings(n == null ? void 0 : n.id);
42
+ return c.value = t && "business" in t && t.premium == !0 || !1, s.value = t && "profileSource" in t && t.profileSource === "CRM" || !1, e.value = (t == null ? void 0 : t.apiVersion) || "v1", c.value;
43
+ }
44
+ async function p() {
45
+ return a.value = await v.read(), a.value;
46
+ }
47
+ async function f() {
48
+ return u.value = await v.readDevices(), u.value;
49
+ }
50
+ function m(n) {
51
+ return a.value.find((t) => t._id === n);
52
+ }
53
+ const g = l(() => [
54
+ { label: "All", value: null },
55
+ ...a.value.map((n) => ({
56
+ label: n.name,
57
+ value: n._id
58
+ }))
59
+ ]), w = l(() => a.value.map((n) => ({
60
+ label: `${n.code ? `${n.code} - ` : ""} ${n.name}`,
61
+ value: n._id
62
+ })));
63
+ return {
64
+ // state
65
+ version: e,
66
+ isCrmProfile: s,
67
+ isPremium: c,
68
+ locations: a,
69
+ locationDevices: u,
70
+ // actions
71
+ readPremium: d,
72
+ readLocations: p,
73
+ readLocationDevices: f,
74
+ locationById: m,
75
+ // getters
76
+ locationItems: g,
77
+ locationOptions: w
78
+ };
79
+ });
80
+ export {
81
+ v as l,
82
+ E as u
83
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineStore as d } from "pinia";
2
2
  import { reactive as b, onMounted as f, ref as s } from "vue";
3
- import { c } from "./index-r_T5o_hF.js";
4
- import { g as i, S as g, b as h } from "./index-DJIt5tXC.js";
3
+ import { c } from "./index-DHw8wo7T.js";
4
+ import { g as i, S as g, b as h } from "./index-EuZfRdBT.js";
5
5
  const p = () => {
6
6
  const e = g.getBusinessId();
7
7
  if (!e) throw new Error("Invalid business ID");
@@ -1,27 +1,27 @@
1
1
  import { h as u } from "./moment-D7p2TMB-.js";
2
- import "./index-DCR1GFCA.js";
3
- import { e as l } from "./effect-CeJbflOK.js";
4
- import { components as d } from "@feedmepos/ui-library";
5
- import { a as E } from "./index-DkBOM8za.js";
6
- import { c as N } from "./rule-trVJgEOe.js";
7
- import { u as I } from "./business-aT2zslwu.js";
8
- import { C as m } from "./campaign.fn-Ck1t5C1T.js";
9
- import { g as y, t as h } from "./index-BqniSMV6.js";
10
- import { c as C } from "./string-Gcy5IM_H.js";
11
- import { i as f } from "./plugins-CDTKQ1Pg.js";
12
- import { h as p } from "vue";
13
- import { F as s } from "./campaign.enum-Dx-Zo68Q.js";
14
- const R = [
2
+ import "./index-D2Nq0UoL.js";
3
+ import { e as f } from "./effect-TTD5--LN.js";
4
+ import { components as h } from "@feedmepos/ui-library";
5
+ import { a as E } from "./index-CcXMYJxc.js";
6
+ import { c as N } from "./rule-B8ifutnO.js";
7
+ import { u as I } from "./business-DuKNr9P7.js";
8
+ import { C as m } from "./campaign.fn-CJlEovlZ.js";
9
+ import { g as C, t as y } from "./index-j7eLKJK3.js";
10
+ import { c as O } from "./string-Gcy5IM_H.js";
11
+ import { i as g } from "./plugins-DewN43sP.js";
12
+ import { h as l } from "vue";
13
+ import { F as s } from "./campaign.enum-DsaSpHDQ.js";
14
+ const S = [
15
15
  "APP_INBOX",
16
16
  "PUSH",
17
17
  "SMS",
18
18
  "EMAIL",
19
19
  "WHATSAPP"
20
- ], S = [...R];
21
- function j(t) {
22
- return S.includes(t);
20
+ ], R = [...S];
21
+ function X(t) {
22
+ return R.includes(t);
23
23
  }
24
- function O(t, e) {
24
+ function b(t, e) {
25
25
  return t === "APP_INBOX" ? {
26
26
  title: "",
27
27
  previewText: "",
@@ -40,17 +40,17 @@ function O(t, e) {
40
40
  variables: e
41
41
  };
42
42
  }
43
- function V(t, e, n = []) {
43
+ function z(t, e, n = []) {
44
44
  return t.channels.includes(e) ? t : {
45
45
  ...t,
46
46
  channels: [...t.channels, e],
47
47
  content: {
48
48
  ...t.content,
49
- [e]: t.content[e] ?? O(e, n)
49
+ [e]: t.content[e] ?? b(e, n)
50
50
  }
51
51
  };
52
52
  }
53
- function X(t, e) {
53
+ function W(t, e) {
54
54
  const n = { ...t.content };
55
55
  return delete n[e], {
56
56
  ...t,
@@ -58,94 +58,106 @@ function X(t, e) {
58
58
  content: n
59
59
  };
60
60
  }
61
- function z(t, e, n) {
61
+ function J(t, e, n) {
62
62
  return {
63
63
  ...t,
64
64
  content: { ...t.content, [e]: n }
65
65
  };
66
66
  }
67
- function W(t, e, n) {
68
- const o = t.channels.indexOf(e), a = o + n;
69
- if (o < 0 || a < 0 || a >= t.channels.length) return t;
70
- const r = [...t.channels];
71
- return [r[o], r[a]] = [r[a], r[o]], { ...t, channels: r };
67
+ function K(t, e, n) {
68
+ const o = t.channels.indexOf(e), r = o + n;
69
+ if (o < 0 || r < 0 || r >= t.channels.length) return t;
70
+ const a = [...t.channels];
71
+ return [a[o], a[r]] = [a[r], a[o]], { ...t, channels: a };
72
72
  }
73
- function J(t, e, n = []) {
74
- const [o, ...a] = t.channels;
73
+ function q(t, e, n = []) {
74
+ const [o, ...r] = t.channels;
75
75
  if (o === e) return t;
76
- const r = {
76
+ const a = {
77
77
  ...t.content,
78
- [e]: t.content[e] ?? O(e, n)
78
+ [e]: t.content[e] ?? b(e, n)
79
79
  };
80
- return o && delete r[o], {
80
+ return o && delete a[o], {
81
81
  ...t,
82
- channels: [e, ...a.filter((b) => b !== e)],
83
- content: r
82
+ channels: [e, ...r.filter((p) => p !== e)],
83
+ content: a
84
84
  };
85
85
  }
86
- function K(t, e) {
86
+ function Q(t, e) {
87
87
  if (!e) return !1;
88
88
  const n = t.content[e];
89
89
  return n ? ["title", "previewText", "content", "body"].some(
90
90
  (o) => typeof n[o] == "string" && !!n[o].trim()
91
91
  ) : !1;
92
92
  }
93
- function q(t, e) {
93
+ function Z(t, e) {
94
94
  return { ...t, mode: e };
95
95
  }
96
- function Q(t, e) {
96
+ function tt(t, e) {
97
97
  const n = t.content[e];
98
98
  if (!n) return !1;
99
99
  if (e === "APP_INBOX") {
100
- const o = n, a = (o.buttons ?? []).every(
101
- (r) => r.label.trim().length > 0 && y.safeParse(r.url ?? "").success
100
+ const o = n, r = (o.buttons ?? []).every(
101
+ (a) => a.label.trim().length > 0 && C.safeParse(a.url ?? "").success
102
102
  );
103
- return o.title.trim().length > 0 && o.previewText.trim().length > 0 && a;
103
+ return o.title.trim().length > 0 && o.previewText.trim().length > 0 && r;
104
104
  }
105
105
  if (e === "PUSH") {
106
- const o = n, a = o.title.trim().length > 0 && o.body.trim().length > 0, r = o.destination !== "EXTERNAL" || y.safeParse(o.url ?? "").success;
107
- return a && r;
106
+ const o = n, r = o.title.trim().length > 0 && o.body.trim().length > 0, a = o.destination !== "EXTERNAL" || C.safeParse(o.url ?? "").success;
107
+ return r && a;
108
108
  }
109
109
  return n.content.trim().length > 0;
110
110
  }
111
111
  function A(t, e) {
112
112
  return t.channels.map(e).join(t.mode === "fallback" ? " → " : " + ");
113
113
  }
114
- function Z(t) {
114
+ function et(t) {
115
115
  var e, n;
116
116
  if (!(!t || t.delivery)) {
117
117
  if ((n = (e = t.message) == null ? void 0 : e.content) != null && n.trim()) {
118
- t.delivery = h(t);
118
+ t.delivery = y(t);
119
119
  return;
120
120
  }
121
121
  delete t.message, t.delivery = { mode: "fallback", channels: [], content: {} };
122
122
  }
123
123
  }
124
- const c = f.global.t;
125
- function D() {
126
- const t = f.global.locale;
124
+ const _ = 5;
125
+ function D(t, e) {
126
+ if (!t) return { kind: "all" };
127
+ const n = new Map(e.map((a) => [String(a._id), a])), o = [];
128
+ for (const a of t) {
129
+ const p = n.get(String(a));
130
+ p && o.push({ id: String(a), code: p.code, name: p.name });
131
+ }
132
+ if (t.length === 0) return { kind: "none" };
133
+ const r = t.length - o.length;
134
+ return r === 0 && o.length <= _ ? { kind: "names", names: o.map((a) => a.name) } : { kind: "count", rows: o, total: e.length, unavailable: r };
135
+ }
136
+ const c = g.global.t;
137
+ function P() {
138
+ const t = g.global.locale;
127
139
  return typeof t == "string" ? t : t.value;
128
140
  }
129
- function g(t) {
130
- return new Intl.DateTimeFormat(D(), {
141
+ function d(t) {
142
+ return new Intl.DateTimeFormat(P(), {
131
143
  day: "2-digit",
132
144
  month: "short",
133
145
  year: "numeric"
134
146
  }).format(new Date(t));
135
147
  }
136
148
  function i(t) {
137
- return p(
149
+ return l(
138
150
  "div",
139
151
  {
140
152
  class: `${t.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
141
153
  },
142
154
  [
143
- p(d.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
144
- p("span", { class: "fm-typo-en-body-md-600" }, t.name)
155
+ l(h.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
156
+ l("span", { class: "fm-typo-en-body-md-600" }, t.name)
145
157
  ]
146
158
  );
147
159
  }
148
- const tt = {
160
+ const nt = {
149
161
  [s.enum.CREDIT]: {
150
162
  chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
151
163
  icon: "local_activity",
@@ -255,44 +267,44 @@ const tt = {
255
267
  }
256
268
  }
257
269
  };
258
- function et(t) {
259
- const e = _(t), n = {
270
+ function ot(t) {
271
+ const e = M(t), n = {
260
272
  active: "text-fm-color-typo-success bg-fm-color-system-success-100",
261
273
  upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
262
274
  expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
263
275
  };
264
- return t.type == "VOUCHER" ? p(d.FmChip, {
276
+ return t.type == "VOUCHER" ? l(h.FmChip, {
265
277
  class: n[e],
266
- label: C.title(c(`connect.campaign.common.status.${e}`)),
278
+ label: O.title(c(`connect.campaign.common.status.${e}`)),
267
279
  compact: !0
268
- }) : p(d.FmChip, {
280
+ }) : l(h.FmChip, {
269
281
  class: n[e],
270
- label: C.title(c(`connect.campaign.common.status.${e}`)),
282
+ label: O.title(c(`connect.campaign.common.status.${e}`)),
271
283
  compact: !0
272
284
  });
273
285
  }
274
- function nt(t) {
286
+ function at(t) {
275
287
  const e = t.timeframeOptions;
276
288
  if (!e || !e.start && !e.end)
277
289
  return c("connect.campaign.common.always_active");
278
290
  if (!e.start && e.end)
279
291
  return c("connect.campaign.common.valid_until", {
280
- date: g(e.end)
292
+ date: d(e.end)
281
293
  });
282
- const n = g(e.start), o = e.end ? g(e.end) : c("connect.campaign.common.unlimited");
294
+ const n = d(e.start), o = e.end ? d(e.end) : c("connect.campaign.common.unlimited");
283
295
  return `${n} -> ${o}`;
284
296
  }
285
- function P(t) {
297
+ function T(t) {
286
298
  if (!t || !t.start && !t.end)
287
299
  return "connect.campaign.common.always";
288
300
  const e = t.start ? u(t.start).format("DD MMM YYYY") : "From campaign creation", n = t.end ? u(t.end).format("DD MMM YYYY") : "Never ends";
289
301
  return `${e} - ${n}`;
290
302
  }
291
- function ot(t) {
303
+ function rt(t) {
292
304
  const { campaign: e } = t;
293
305
  return {
294
306
  "connect.campaign.common.campaign_name": e.name,
295
- "connect.campaign.common.campaign_period": P(
307
+ "connect.campaign.common.campaign_period": T(
296
308
  e.timeframeOptions
297
309
  ),
298
310
  get "connect.campaign.common.next_schedule_at"() {
@@ -304,46 +316,48 @@ function ot(t) {
304
316
  return n ? u(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
305
317
  },
306
318
  get "connect.campaign.common.discount_type"() {
307
- if (e.type == "PROMOTION") return l(e.effect);
319
+ if (e.type == "PROMOTION") return f(e.effect);
308
320
  if ("configs" in t && t.configs.type == "VOUCHER")
309
- return l(t.configs.extras.effect);
321
+ return f(t.configs.extras.effect);
310
322
  },
311
323
  get "connect.campaign.broadcast.summary.delivery"() {
312
324
  if (e.type != "BROADCAST") return;
313
- const n = h(e);
325
+ const n = y(e);
314
326
  if (!(n.channels.length < 2))
315
327
  return `connect.campaign.broadcast.mode.${n.mode}.label`;
316
328
  },
317
329
  get "connect.campaign.broadcast.summary.channels"() {
318
330
  var n;
319
331
  if (e.type == "BROADCAST")
320
- return ((n = T(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
332
+ return ((n = x(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
321
333
  },
322
334
  get "connect.campaign.common.available_at"() {
323
- return e.targetLocation ? e.targetLocation.length > 0 ? e.targetLocation.map(
324
- (n) => I().locationItems.find((o) => o.value == n).label
325
- ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
335
+ const n = D(
336
+ e.targetLocation,
337
+ I().locations
338
+ );
339
+ return n.kind === "all" ? "connect.campaign.common.all_locations" : n.kind === "none" ? "connect.campaign.common.no_location" : n.kind === "names" ? n.names.join(", ") : n;
326
340
  }
327
341
  };
328
342
  }
329
- function _(t) {
343
+ function M(t) {
330
344
  return t.timeframeOptions && t.timeframeOptions.type == "timeframe" ? u().isBetween(
331
345
  t.timeframeOptions.start ?? u().subtract(1, "d"),
332
346
  t.timeframeOptions.end ?? u().add(1, "d")
333
347
  ) ? "active" : u().isAfter(t.timeframeOptions.end) ? "expired" : "upcoming" : "active";
334
348
  }
335
- function T(t) {
336
- const e = h(t);
349
+ function x(t) {
350
+ const e = y(t);
337
351
  if (!e.channels.length) return null;
338
- const o = A(e, (a) => f.global.t(`connect.campaign.broadcast.channel.${a}`));
352
+ const o = A(e, (r) => g.global.t(`connect.campaign.broadcast.channel.${r}`));
339
353
  return {
340
- strategy: e.channels.length > 1 ? f.global.t(
354
+ strategy: e.channels.length > 1 ? g.global.t(
341
355
  `connect.campaign.broadcast.strategy.${e.mode}`
342
356
  ) : null,
343
357
  route: o
344
358
  };
345
359
  }
346
- function at(t) {
360
+ function ct(t) {
347
361
  var e, n;
348
362
  switch (t.event.type) {
349
363
  case "BILL_COMPLETED":
@@ -354,8 +368,8 @@ function at(t) {
354
368
  case "COIN":
355
369
  return t.earningOption.type == "FIXED" ? `Spend to get ${t.earningOption.amount} ${m.formattedType(t.type)}` : `Every ${t.earningOption.every} amount spent get ${t.earningOption.amount} ${m.formattedType(t.type)}`;
356
370
  case "VOUCHER":
357
- const a = (n = (e = t == null ? void 0 : t.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : n.effect;
358
- return a ? `${o} - ${l(a)}` : o;
371
+ const r = (n = (e = t == null ? void 0 : t.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : n.effect;
372
+ return r ? `${o} - ${f(r)}` : o;
359
373
  default:
360
374
  return o;
361
375
  }
@@ -370,7 +384,7 @@ function at(t) {
370
384
  case "MEMBERSHIP_JOINED":
371
385
  return `Receive ${m.formattedType(t.type)} when member joined`;
372
386
  case "MAKING_ORDER":
373
- return t.type !== "PROMOTION" ? void 0 : l(t.effect);
387
+ return t.type !== "PROMOTION" ? void 0 : f(t.effect);
374
388
  default:
375
389
  throw new Error(
376
390
  `Not implemented ${JSON.stringify({ cause: t.event.type })}`
@@ -378,23 +392,23 @@ function at(t) {
378
392
  }
379
393
  }
380
394
  export {
381
- tt as C,
382
- _ as a,
383
- et as b,
384
- at as c,
385
- T as d,
386
- R as e,
387
- Q as f,
388
- nt as g,
389
- q as h,
390
- j as i,
391
- V as j,
392
- K as k,
393
- J as l,
394
- W as m,
395
- z as n,
396
- ot as o,
397
- Z as p,
398
- X as r,
399
- P as s
395
+ nt as C,
396
+ M as a,
397
+ ot as b,
398
+ ct as c,
399
+ x as d,
400
+ S as e,
401
+ tt as f,
402
+ at as g,
403
+ Z as h,
404
+ X as i,
405
+ z as j,
406
+ Q as k,
407
+ q as l,
408
+ K as m,
409
+ J as n,
410
+ rt as o,
411
+ et as p,
412
+ W as r,
413
+ T as s
400
414
  };
@@ -1,4 +1,4 @@
1
- import { z as E } from "./index-C_H8jFYf.js";
1
+ import { z as E } from "./index-CGtlXLTG.js";
2
2
  const M = E.enum([
3
3
  "VOUCHER",
4
4
  "PROMOTION",