@feedmepos/mf-connect 0.1.47-prod → 0.1.49-prod

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 (109) hide show
  1. package/dist/{Analytic-AnuRQDA4.js → Analytic-ibBD_21m.js} +113 -113
  2. package/dist/{App-DP_jCyej.js → App-CDjwWK8a.js} +632 -622
  3. package/dist/{Bin-tL4lF6PB.js → Bin-DCaG0YGW.js} +9 -9
  4. package/dist/Broadcast-CbF3d_N7.js +233 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BgPJCH02.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BqYusgBO.js} +18 -18
  6. package/dist/{Card-Bi-ODgCc.js → Card-CDNE85po.js} +239 -239
  7. package/dist/{Collections-JHWotZ1I.js → Collections-DHn__E9U.js} +31 -31
  8. package/dist/Credit-DiTnwnFe.js +228 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-hxuYl-OQ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJEAsRON.js} +756 -753
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js → EffectSheet.vue_vue_type_style_index_0_lang-CU9XpMjd.js} +96 -96
  11. package/dist/Experience-CjMVeGsX.js +229 -0
  12. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  13. package/dist/{Game-DUCx2Dl9.js → Game-D3gANFAo.js} +98 -92
  14. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
  15. package/dist/{Index-zynxjOOr.js → Index-DEF_a5Mu.js} +54 -54
  16. package/dist/{Marketing-BBHDVRkR.js → Marketing-BeED4Y7H.js} +24 -24
  17. package/dist/{Member-B09bj6C3.js → Member-CA4hnHJY.js} +63 -63
  18. package/dist/MemberList-CZtriA_Q.js +1606 -0
  19. package/dist/MemberOverview-wL_ailso.js +58 -0
  20. package/dist/{MemberTransactions-DERMSs7o.js → MemberTransactions-BVrvf4AM.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js → MessageInput.vue_vue_type_script_setup_true_lang-BqTDGnOG.js} +2286 -2220
  22. package/dist/{Mission-DAv0e_ZH.js → Mission-CDSMpqnG.js} +113 -107
  23. package/dist/{Overview-D0rBTEtP.js → Overview-ArineqY4.js} +337 -337
  24. package/dist/Point-51MD49EM.js +232 -0
  25. package/dist/{Promotion-BSPU5hP9.js → Promotion-BVrofYd6.js} +43 -43
  26. package/dist/{Queue-C5IFJ3iE.js → Queue-Q-aEeZ8w.js} +13 -13
  27. package/dist/{Record-CoFSrv7j.js → Record-DaVcschI.js} +10 -10
  28. package/dist/{Reward-COIOBOl-.js → Reward-DTtFuqOZ.js} +173 -173
  29. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B9Tl7hqv.js → RewardGroup.vue_vue_type_script_setup_true_lang-P_gNd6ZP.js} +11 -11
  30. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js → RuleGroup.vue_vue_type_script_setup_true_lang-CVy_kDmy.js} +381 -381
  31. package/dist/{Segment-DF5SrucQ.js → Segment-DIy4RERw.js} +327 -327
  32. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js → SelectItems.vue_vue_type_script_setup_true_lang-D3KIZJLo.js} +14 -14
  33. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoL_gTKy.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-bSi6_uqi.js} +11 -11
  34. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cijyol1Q.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BsNLkA2v.js} +3 -3
  35. package/dist/Setting-DGDgmP84.js +1936 -0
  36. package/dist/{Store-E2_0EIy8.js → Store-Dh2uVHGY.js} +238 -238
  37. package/dist/StoreRewards-DFF_0g59.js +423 -0
  38. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DuatzcJ8.js → StoreTransactions.vue_vue_type_script_setup_true_lang-PrFhYJXc.js} +186 -186
  39. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-VcU2Asjy.js} +1 -1
  40. package/dist/{Tier-CEEHsXkC.js → Tier-yKvE4mRW.js} +106 -106
  41. package/dist/{Title-BMAWlGeW.js → Title-DWWSC02W.js} +95 -95
  42. package/dist/{Transaction-CLsceq-O.js → Transaction-ru7M0PKE.js} +2 -2
  43. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CFLekn9O.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BSkv6hMH.js} +6 -6
  44. package/dist/{Voucher-Cd293WYY.js → Voucher-DmuaThKv.js} +37 -37
  45. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Db_aeyc1.js +419 -0
  46. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js → ZodTextField.vue_vue_type_script_setup_true_lang-B5co0F__.js} +1 -1
  47. package/dist/app-DaFoFS2V.js +57962 -0
  48. package/dist/{app-aVXsWATU.js → app-ja_XST5q.js} +31 -31
  49. package/dist/app.js +1 -1
  50. package/dist/{business-DVlHPzaL.js → business-BSP_3iNl.js} +11 -8
  51. package/dist/{campaign-D9KeUWA7.js → campaign-C1hWNRWr.js} +2 -2
  52. package/dist/{campaign-l-u9A514.js → campaign-DMZnXtyb.js} +10 -10
  53. package/dist/{campaign.enum-Cud82tES.js → campaign.enum-Bfsz7Aon.js} +1 -1
  54. package/dist/campaign.fn-B-xvcbEb.js +758 -0
  55. package/dist/{collectible.enum-PrlUDScv.js → collectible.enum-BRkrN4Bi.js} +1 -1
  56. package/dist/{collection.fn-yR-xnV4g.js → collection.fn-D03AXdUn.js} +2 -2
  57. package/dist/{dto-Cua1OHMY.js → dto-DpRkSGg6.js} +4 -4
  58. package/dist/{effect-B5-eXNEr.js → effect-BW1-I1J4.js} +1 -1
  59. package/dist/{email-addresses-BeYh5fr5.js → email-addresses-BLVkwSkP.js} +1 -1
  60. package/dist/{export-BUF4_DUz.js → export-DOfDownW.js} +4 -4
  61. package/dist/{helper-CGwOThAl.js → helper-BzfjLXgi.js} +1 -1
  62. package/dist/{index-DlFVLRKG.js → index-BBi9jDD1.js} +3 -3
  63. package/dist/{index-Cx8-ipee.js → index-BJl_HxaB.js} +6 -6
  64. package/dist/{index-1BGPM6Uy.js → index-Ba5-z1MU.js} +1 -1
  65. package/dist/{index-BmL_b0IR.js → index-Bp8F6U9V.js} +1 -1
  66. package/dist/{index-C-d_4n-1.js → index-C6fpU8-G.js} +1 -1
  67. package/dist/{index-knuJv0ti.js → index-COoQSeE7.js} +4 -4
  68. package/dist/{index-aMDi62-C.js → index-DTnzjEWu.js} +1 -1
  69. package/dist/{index-BLdVWQId.js → index-DWBeauin.js} +3 -3
  70. package/dist/{index-Cl2iYM2F.js → index-Da1qz9oA.js} +1 -1
  71. package/dist/{index-CB8iWT_p.js → index-Dve1-uYX.js} +1 -1
  72. package/dist/{index-ng2IXlL1.js → index-P6ISAxfQ.js} +1 -1
  73. package/dist/{index-hX2mE0gQ.js → index-cpWgtd-c.js} +1 -1
  74. package/dist/{index-D5KIp8ZB.js → index-sFyvCun2.js} +1023 -1023
  75. package/dist/{index-DNTd-FNx.js → index-zyVYgteg.js} +2 -2
  76. package/dist/{index.esm2017-D8stWFci.js → index.esm2017-DT0awUwa.js} +40 -40
  77. package/dist/{loading-c4b7n9Xp.js → loading-CZH88Duq.js} +1 -1
  78. package/dist/{membership-oBIs4sbL.js → membership-GNRX1fEK.js} +3 -3
  79. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  80. package/dist/{money-AP24H0gk.js → money-Xe5mDYRC.js} +1 -1
  81. package/dist/{number-CwsAYC_2.js → number-CAjqc2Pu.js} +1 -1
  82. package/dist/objectid-BQJRv_jX.js +145 -0
  83. package/dist/{plugins-Dn7JDHi7.js → plugins-Z2YcDTj8.js} +2 -2
  84. package/dist/{reward-4wdoZeXw.js → reward-G656rbLJ.js} +1 -1
  85. package/dist/{rule-_OJza6tn.js → rule-BJ5blBZp.js} +4 -4
  86. package/dist/{rule-builder-DmlhHAED.js → rule-builder-CursBigG.js} +1 -1
  87. package/dist/{template-BSQLFHf4.js → template-BnyUm8is.js} +63 -63
  88. package/dist/timezone-B64-HrWi.js +1150 -0
  89. package/dist/{trigger-DC9tDnI2.js → trigger-C_ih51ky.js} +4 -4
  90. package/dist/usePagination-Ds-cuHop.js +223 -0
  91. package/dist/{user-CCVOptFD.js → user-BZc_OAUj.js} +1 -1
  92. package/dist/{vue-i18n--_Wu1nMj.js → vue-i18n-2D47GxQX.js} +401 -401
  93. package/dist/{xlsx-BVMaOi8M.js → xlsx-BEk5qawh.js} +226 -226
  94. package/package.json +5 -4
  95. package/dist/Broadcast-T2a5tN8R.js +0 -227
  96. package/dist/Credit-DQQCXqS0.js +0 -222
  97. package/dist/Experience-DzTV21vX.js +0 -223
  98. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  99. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  100. package/dist/MemberList-DLSLGQ02.js +0 -1606
  101. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  102. package/dist/Point-BeBYi1BT.js +0 -226
  103. package/dist/Setting-Dt0sG_hk.js +0 -1936
  104. package/dist/StoreRewards-DuSsWnTE.js +0 -423
  105. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Qc5cCqh5.js +0 -419
  106. package/dist/app-jRT7vsk_.js +0 -33357
  107. package/dist/campaign.fn-C-UojhHv.js +0 -758
  108. package/dist/objectid-CVDLTdni.js +0 -145
  109. package/dist/usePagination-JoYaROkV.js +0 -223
@@ -1,42 +1,42 @@
1
- import { defineComponent as ee, ref as z, resolveComponent as b, openBlock as p, createElementBlock as C, createVNode as i, unref as t, createCommentVNode as le, createElementVNode as l, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as D, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
1
+ import { defineComponent as ee, ref as z, resolveComponent as S, openBlock as m, createElementBlock as C, createElementVNode as l, createVNode as r, unref as t, createCommentVNode as le, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as $, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
2
2
  import { _ as Ee } from "./campaign-CpzFl8Vr.js";
3
- import { n as $e, p as Ae } from "./plugins-Dn7JDHi7.js";
4
- import { u as Re } from "./loading-c4b7n9Xp.js";
5
- import { FmButtonVariant as ae, useSnackbar as De, components as X } from "@feedmepos/ui-library";
6
- import { u as xe, _ as be } from "./usePagination-JoYaROkV.js";
7
- import { u as we } from "./vue-i18n--_Wu1nMj.js";
8
- import { i as Pe, j as R, c as fe } from "./index-knuJv0ti.js";
9
- import "./index-DNTd-FNx.js";
10
- import "./index-Cx8-ipee.js";
11
- import "./index-ng2IXlL1.js";
12
- import "./index-DlFVLRKG.js";
13
- import { u as ne, w as Fe } from "./xlsx-BVMaOi8M.js";
14
- import { e as Ne, M as Be } from "./email-addresses-BeYh5fr5.js";
3
+ import { n as Ae, p as Re } from "./plugins-Z2YcDTj8.js";
4
+ import { u as De } from "./loading-CZH88Duq.js";
5
+ import { FmButtonVariant as ae, useSnackbar as $e, components as X } from "@feedmepos/ui-library";
6
+ import { u as be, _ as we } from "./usePagination-Ds-cuHop.js";
7
+ import { u as Fe } from "./vue-i18n-2D47GxQX.js";
8
+ import { i as Pe, j as D, c as fe } from "./index-COoQSeE7.js";
9
+ import "./index-zyVYgteg.js";
10
+ import "./index-BJl_HxaB.js";
11
+ import "./index-P6ISAxfQ.js";
12
+ import "./index-BBi9jDD1.js";
13
+ import { u as ne, w as he } from "./xlsx-BEk5qawh.js";
14
+ import { e as Ne, M as Be } from "./email-addresses-BLVkwSkP.js";
15
15
  import { Z as Ve } from "./zod-Bg2FbC-D.js";
16
16
  import { u as Ye } from "./app-wDQR6dpb.js";
17
- import { F as ye, z as Ue } from "./index-D5KIp8ZB.js";
18
- import { R as ge } from "./rule-builder-DmlhHAED.js";
19
- import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js";
20
- import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js";
21
- import { u as Oe, v as je, w as qe } from "./index.esm2017-D8stWFci.js";
17
+ import { F as ye, z as Ue } from "./index-sFyvCun2.js";
18
+ import { R as ge } from "./rule-builder-CursBigG.js";
19
+ import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B5co0F__.js";
20
+ import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CVy_kDmy.js";
21
+ import { u as Oe, v as je, w as qe } from "./index.esm2017-DT0awUwa.js";
22
22
  import { F as He } from "./FileSaver.min-NlMItPOc.js";
23
- import { h as G } from "./moment-BWErdI6_.js";
24
- import { s as N, u as Ge } from "./membership-oBIs4sbL.js";
23
+ import { h as G } from "./moment-D7p2TMB-.js";
24
+ import { s as N, u as Ge } from "./membership-GNRX1fEK.js";
25
25
  import { o as Je } from "./objectId-dwaoBfJX.js";
26
- import { u as ke } from "./business-DVlHPzaL.js";
27
- import { f as Qe } from "./number-CwsAYC_2.js";
28
- import { t as We } from "./money-AP24H0gk.js";
29
- import "./index-Cl2iYM2F.js";
26
+ import { u as ke } from "./business-BSP_3iNl.js";
27
+ import { f as Qe } from "./number-CAjqc2Pu.js";
28
+ import { t as We } from "./money-Xe5mDYRC.js";
29
+ import "./index-Da1qz9oA.js";
30
30
  import { useRouter as Ke } from "vue-router";
31
- import { m as _e } from "./index-C-d_4n-1.js";
32
- import { R as ve } from "./app-aVXsWATU.js";
31
+ import { m as ve } from "./index-C6fpU8-G.js";
32
+ import { R as _e } from "./app-ja_XST5q.js";
33
33
  const Ze = Pe.extend({
34
34
  _id: ye.optional(),
35
35
  business: ye.optional(),
36
36
  file: Ue.any().nullish()
37
37
  });
38
38
  var Xe = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" };
39
- const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1), ot = {
39
+ const et = { class: "flex flex-col space-y-16" }, tt = {
40
40
  key: 0,
41
41
  class: /* @__PURE__ */ re([
42
42
  "p-16 pl-24 space-x-8",
@@ -44,21 +44,21 @@ const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div",
44
44
  "flex items-center",
45
45
  "justify-between"
46
46
  ])
47
- }, at = { class: "flex justify-end" }, nt = {
47
+ }, ot = { class: "flex justify-end" }, at = {
48
48
  key: 1,
49
49
  class: /* @__PURE__ */ re([
50
50
  "flex items-center",
51
51
  "border border-fm-color-neutral-gray-300",
52
52
  "p-16 space-x-16 rounded-md"
53
53
  ])
54
- }, st = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, lt = /* @__PURE__ */ ee({
54
+ }, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
55
55
  __name: "ImportSegment",
56
56
  props: {
57
57
  importFile: {}
58
58
  },
59
59
  emits: ["update:file"],
60
- setup(e, { emit: _ }) {
61
- const v = e, k = _, { t: m } = we(), y = z(null), f = z(null), w = ["Id"], s = [
60
+ setup(e, { emit: v }) {
61
+ const _ = e, k = v, { t: p } = Fe(), f = z(null), b = z(null), w = ["Id"], n = [
62
62
  {
63
63
  label: "CSV",
64
64
  icon: "csv",
@@ -70,61 +70,61 @@ const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div",
70
70
  value: "xlsx"
71
71
  }
72
72
  ];
73
- async function n() {
74
- if (v.importFile)
73
+ async function i() {
74
+ if (_.importFile)
75
75
  try {
76
- const h = Oe(void 0, Xe.importFilesBucketUrl), S = je(h, v.importFile), x = await qe(S);
76
+ const h = Oe(void 0, Xe.importFilesBucketUrl), y = je(h, _.importFile), x = await qe(y);
77
77
  window.open(x, "_blank");
78
78
  } catch (h) {
79
- console.log(h), $e.error("Failed to download uploaded file");
79
+ console.log(h), Ae.error("Failed to download uploaded file");
80
80
  }
81
81
  }
82
82
  async function c(h) {
83
83
  switch (h) {
84
84
  case "csv":
85
- const S = new Blob([w.join(",")], {
85
+ const y = new Blob([w.join(",")], {
86
86
  type: "text/csv;charset=utf-8;"
87
87
  });
88
- He.saveAs(S, "ImportSegmentTemplate.csv");
88
+ He.saveAs(y, "ImportSegmentTemplate.csv");
89
89
  break;
90
90
  case "xlsx":
91
91
  const x = ne.aoa_to_sheet([w]), I = ne.book_new();
92
- ne.book_append_sheet(I, x, "Sheet1"), Fe(I, "ImportSegmentTemplate.xlsx");
92
+ ne.book_append_sheet(I, x, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
93
93
  break;
94
94
  }
95
95
  }
96
96
  function F(h) {
97
- y.value = h, k("update:file", y.value);
97
+ f.value = h, k("update:file", f.value);
98
98
  }
99
- function $(h) {
99
+ function A(h) {
100
100
  var x, I;
101
- const S = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
102
- F(S);
101
+ const y = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
102
+ F(y);
103
103
  }
104
- return (h, S) => {
105
- const x = b("FmButton"), I = b("FmMenuItem"), d = b("FmMenu"), r = b("FmDropField");
106
- return p(), C("div", et, [
107
- tt,
108
- h.importFile ? (p(), C("div", ot, [
109
- i(x, {
110
- label: t(m)("View uploaded file"),
104
+ return (h, y) => {
105
+ const x = S("FmButton"), I = S("FmMenuItem"), d = S("FmMenu"), s = S("FmDropField");
106
+ return m(), C("div", et, [
107
+ y[2] || (y[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
108
+ e.importFile ? (m(), C("div", tt, [
109
+ r(x, {
110
+ label: t(p)("View uploaded file"),
111
111
  variant: t(ae).Plain,
112
112
  icon: "file_present",
113
- onClick: n
113
+ onClick: i
114
114
  }, null, 8, ["label", "variant"])
115
115
  ])) : le("", !0),
116
116
  l("div", null, [
117
- l("div", at, [
118
- i(d, { class: "" }, {
117
+ l("div", ot, [
118
+ r(d, { class: "" }, {
119
119
  "menu-button": E(() => [
120
- i(x, {
120
+ r(x, {
121
121
  variant: "tertiary",
122
122
  icon: "download",
123
123
  label: "Download Template"
124
124
  })
125
125
  ]),
126
126
  default: E(() => [
127
- (p(), C(O, null, ie(s, (g) => i(I, {
127
+ (m(), C(O, null, ie(n, (g) => r(I, {
128
128
  key: g.value,
129
129
  icon: g.icon,
130
130
  label: g.label,
@@ -135,23 +135,23 @@ const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div",
135
135
  _: 1
136
136
  })
137
137
  ]),
138
- y.value ? (p(), C("div", nt, [
139
- i(x, {
138
+ f.value ? (m(), C("div", at, [
139
+ r(x, {
140
140
  variant: t(ae).Tertiary,
141
141
  "prepend-icon": "attach_file"
142
142
  }, null, 8, ["variant"]),
143
- l("p", st, D(y.value.name), 1),
143
+ l("p", nt, $(f.value.name), 1),
144
144
  l("label", {
145
145
  ref_key: "fileLabelRef",
146
- ref: f,
146
+ ref: b,
147
147
  htmlFor: "file"
148
148
  }, [
149
- i(x, {
149
+ r(x, {
150
150
  variant: t(ae).Plain,
151
- label: t(m)("Replace File"),
152
- onClick: S[1] || (S[1] = () => {
151
+ label: t(p)("Replace File"),
152
+ onClick: y[1] || (y[1] = () => {
153
153
  var g;
154
- return (g = f.value) == null ? void 0 : g.click();
154
+ return (g = b.value) == null ? void 0 : g.click();
155
155
  })
156
156
  }, null, 8, ["variant", "label"]),
157
157
  l("input", {
@@ -160,12 +160,12 @@ const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div",
160
160
  class: "hidden",
161
161
  type: "file",
162
162
  multiple: "",
163
- onChange: $
163
+ onChange: A
164
164
  }, null, 32)
165
165
  ], 512)
166
- ])) : (p(), J(r, {
166
+ ])) : (m(), J(s, {
167
167
  key: 0,
168
- onFileUpload: S[0] || (S[0] = (g) => F(g)),
168
+ onFileUpload: y[0] || (y[0] = (g) => F(g)),
169
169
  accept: ".csv, .xlsx",
170
170
  "max-file-size": 2e7
171
171
  }))
@@ -173,270 +173,270 @@ const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div",
173
173
  ]);
174
174
  };
175
175
  }
176
- }), it = { class: "space-y-16 pr-12" }, rt = { class: "fm-typo-en-title-md-800" }, ct = { class: "flex space-x-8" }, dt = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, ut = { class: "text-fm-color-typo-secondary" }, pt = /* @__PURE__ */ l("div", null, "contacts in your segment", -1), mt = /* @__PURE__ */ ee({
176
+ }), lt = { class: "space-y-16 pr-12" }, it = { class: "fm-typo-en-title-md-800" }, rt = { class: "flex space-x-8" }, ct = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, dt = { class: "text-fm-color-typo-secondary" }, ut = /* @__PURE__ */ ee({
177
177
  __name: "ReviewSegment",
178
178
  props: {
179
179
  title: {},
180
180
  segment: {}
181
181
  },
182
182
  setup(e) {
183
- const _ = e, v = [
183
+ const v = e, _ = [
184
184
  {
185
185
  header: "Name",
186
- accessorFn: (n) => n.name
186
+ accessorFn: (i) => i.name
187
187
  },
188
188
  {
189
189
  header: "Id",
190
- accessorFn: (n) => n._id
190
+ accessorFn: (i) => i._id
191
191
  },
192
192
  {
193
193
  header: "Customer Since",
194
- accessorFn: (n) => G(Je(n._id.toString())).format("DD MMM YYYY")
194
+ accessorFn: (i) => G(Je(i._id.toString())).format("DD MMM YYYY")
195
195
  },
196
196
  {
197
197
  header: "Phone",
198
- accessorFn: (n) => n.phoneNumber
198
+ accessorFn: (i) => i.phoneNumber
199
199
  },
200
200
  {
201
201
  header: "Birthday",
202
- accessorFn: (n) => G(n.birthday).format("DD MMM YYYY")
202
+ accessorFn: (i) => G(i.birthday).format("DD MMM YYYY")
203
203
  },
204
204
  {
205
205
  header: "Last Visit",
206
- accessorFn: (n) => G(n.stats.lastVisit).format("DD MMM YYYY")
206
+ accessorFn: (i) => G(i.stats.lastVisit).format("DD MMM YYYY")
207
207
  }
208
208
  ];
209
- async function k(n) {
210
- return _.segment._id ? (console.log(n), await N.paginateSegmentUsers(
211
- _.segment._id,
212
- n
209
+ async function k(i) {
210
+ return v.segment._id ? (console.log(i), await N.paginateSegmentUsers(
211
+ v.segment._id,
212
+ i
213
213
  )) : {
214
214
  resources: [],
215
215
  meta: {
216
216
  totalResources: 0,
217
217
  totalPages: 0,
218
- skip: n.skip,
219
- limit: n.limit,
220
- sortBy: n.sortBy
218
+ skip: i.skip,
219
+ limit: i.limit,
220
+ sortBy: i.sortBy
221
221
  }
222
222
  };
223
223
  }
224
- const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: w, onSearch: s } = xe(k);
224
+ const { tableMeta: p, rowData: f, onSort: b, debouncedFetchData: w, onSearch: n } = be(k);
225
225
  return Se(async () => {
226
226
  await w();
227
- }), (n, c) => (p(), C("div", it, [
228
- l("div", rt, D(_.title), 1),
229
- l("div", ct, [
230
- l("div", dt, D(n.segment.members.length), 1),
231
- l("div", ut, [
232
- pt,
233
- l("div", null, "as of " + D(t(G)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
227
+ }), (i, c) => (m(), C("div", lt, [
228
+ l("div", it, $(v.title), 1),
229
+ l("div", rt, [
230
+ l("div", ct, $(e.segment.members.length), 1),
231
+ l("div", dt, [
232
+ c[1] || (c[1] = l("div", null, "contacts in your segment", -1)),
233
+ l("div", null, "as of " + $(t(G)(e.segment.lastUpdated).format("DD MMM YYYY")), 1)
234
234
  ])
235
235
  ]),
236
- i(be, {
237
- loading: t(m).isLoading,
238
- "row-data": t(y),
239
- "row-count": t(m).totalRows,
240
- "column-defs": v,
241
- "page-size": t(m).pageSize,
242
- "page-count": t(m).pageCount,
243
- "page-index": t(m).pageIndex,
244
- onSortChange: t(f),
236
+ r(we, {
237
+ loading: t(p).isLoading,
238
+ "row-data": t(f),
239
+ "row-count": t(p).totalRows,
240
+ "column-defs": _,
241
+ "page-size": t(p).pageSize,
242
+ "page-count": t(p).pageCount,
243
+ "page-index": t(p).pageIndex,
244
+ onSortChange: t(b),
245
245
  onPageChange: c[0] || (c[0] = (F) => t(w)({ pageSize: F.pageSize, pageIndex: F.pageIndex }))
246
246
  }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
247
247
  ]));
248
248
  }
249
- }), ft = { class: "space-y-24" }, yt = { class: "grid grid-cols-2 gap-16" }, gt = { class: "fm-typo-en-title-sm-800" }, _t = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ ee({
249
+ }), mt = { class: "space-y-24" }, pt = { class: "grid grid-cols-2 gap-16" }, ft = { class: "fm-typo-en-title-sm-800" }, yt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, gt = /* @__PURE__ */ ee({
250
250
  __name: "SegmentTypeOption",
251
251
  props: {
252
252
  modelValue: {},
253
253
  errorText: {}
254
254
  },
255
255
  emits: ["update:model-value"],
256
- setup(e, { emit: _ }) {
257
- const v = e, k = _, m = [
256
+ setup(e, { emit: v }) {
257
+ const _ = e, k = v, p = [
258
258
  {
259
259
  label: "Dynamic",
260
260
  sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
261
- value: R.enum.DYNAMIC
261
+ value: D.enum.DYNAMIC
262
262
  },
263
263
  {
264
264
  label: "Static",
265
265
  sublabel: "Segment statistics are based on imported data and will not be recalculated.",
266
- value: R.enum.STATIC
266
+ value: D.enum.STATIC
267
267
  }
268
268
  ];
269
- function y(f) {
270
- f !== v.modelValue && k("update:model-value", f);
269
+ function f(b) {
270
+ b !== _.modelValue && k("update:model-value", b);
271
271
  }
272
- return (f, w) => {
273
- const s = b("FmCard"), n = b("FmHelperText");
274
- return p(), C("div", ft, [
275
- l("div", yt, [
276
- (p(), C(O, null, ie(m, (c) => i(s, {
272
+ return (b, w) => {
273
+ const n = S("FmCard"), i = S("FmHelperText");
274
+ return m(), C("div", mt, [
275
+ l("div", pt, [
276
+ (m(), C(O, null, ie(p, (c) => r(n, {
277
277
  variant: "outlined",
278
278
  class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
279
- "col-span-2": m.length == 1,
280
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
281
- "hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
279
+ "col-span-2": p.length == 1,
280
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue === c.value,
281
+ "hover:bg-fm-color-opacity-sm": e.modelValue !== c.value
282
282
  }]),
283
- onClick: (F) => y(c.value),
283
+ onClick: (F) => f(c.value),
284
284
  key: c.value
285
285
  }, {
286
286
  default: E(() => [
287
- l("div", gt, D(c.label), 1),
288
- l("div", _t, D(c.sublabel), 1)
287
+ l("div", ft, $(c.label), 1),
288
+ l("div", yt, $(c.sublabel), 1)
289
289
  ]),
290
290
  _: 2
291
291
  }, 1032, ["class", "onClick"])), 64))
292
292
  ]),
293
- f.errorText ? (p(), J(n, {
293
+ e.errorText ? (m(), J(i, {
294
294
  key: 0,
295
295
  class: "!mt-4",
296
- text: f.errorText,
296
+ text: e.errorText,
297
297
  state: "error"
298
298
  }, null, 8, ["text"])) : le("", !0)
299
299
  ]);
300
300
  };
301
301
  }
302
- }), ht = { class: "flex items-center gap-x-8" }, St = /* @__PURE__ */ l("div", null, "Review segment", -1), xt = {
302
+ }), vt = { class: "flex items-center gap-x-8" }, _t = {
303
303
  key: 0,
304
304
  class: "space-y-16 pr-12"
305
- }, bt = { class: "flex flex-col space-y-16" }, wt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1), Ft = {
305
+ }, xt = { class: "flex flex-col space-y-16" }, St = {
306
306
  key: 0,
307
307
  class: "flex flex-col space-y-16"
308
- }, kt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), Ct = {
308
+ }, bt = {
309
309
  key: 1,
310
310
  class: "flex flex-col space-y-16"
311
- }, It = {
311
+ }, wt = {
312
312
  key: 2,
313
313
  class: "flex flex-col space-y-16"
314
- }, Mt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1), Tt = { class: "flex items-center gap-8" }, Et = /* @__PURE__ */ ee({
314
+ }, Ft = { class: "flex items-center gap-8" }, ht = /* @__PURE__ */ ee({
315
315
  __name: "SegmentSheet",
316
316
  emits: ["update:model-value"],
317
- setup(e, { expose: _, emit: v }) {
318
- const k = Ye(), m = z(!1), y = z(!1), f = {
317
+ setup(e, { expose: v, emit: _ }) {
318
+ const k = Ye(), p = z(!1), f = z(!1), b = {
319
319
  name: "",
320
320
  isActive: !0,
321
- type: R.enum.DYNAMIC,
321
+ type: D.enum.DYNAMIC,
322
322
  rule: ge.scaffoldGroup(),
323
323
  members: []
324
- }, w = Ze, s = z(f), n = ce(() => {
325
- const d = w.safeParse(s.value);
324
+ }, w = Ze, n = z(b), i = ce(() => {
325
+ const d = w.safeParse(n.value);
326
326
  return d.success ? [] : d.error.errors;
327
327
  });
328
328
  function c(d) {
329
- m.value = !0, y.value = !1, d ? s.value = {
329
+ p.value = !0, f.value = !1, d ? n.value = {
330
330
  ...d,
331
331
  isActive: d.isActive !== !1,
332
- type: d.type ?? (d.importFile ? R.enum.STATIC : R.enum.DYNAMIC)
333
- } : s.value = { ...f };
332
+ type: d.type ?? (d.importFile ? D.enum.STATIC : D.enum.DYNAMIC)
333
+ } : n.value = { ...b };
334
334
  }
335
335
  function F() {
336
- m.value = !1;
336
+ p.value = !1;
337
337
  }
338
- async function $() {
339
- w.safeParse(s.value).success && (y.value = !0);
338
+ async function A() {
339
+ w.safeParse(n.value).success && (f.value = !0);
340
340
  }
341
341
  function h(d) {
342
- d === R.enum.STATIC ? F() : y.value = !1;
342
+ d === D.enum.STATIC ? F() : f.value = !1;
343
343
  }
344
- async function S() {
345
- s.value.type === R.enum.STATIC ? (s.value.rule = ge.scaffoldGroup(), s.value.isActive = !0) : s.value.file = void 0, I("update:model-value", s.value);
344
+ async function y() {
345
+ n.value.type === D.enum.STATIC ? (n.value.rule = ge.scaffoldGroup(), n.value.isActive = !0) : n.value.file = void 0, I("update:model-value", n.value);
346
346
  }
347
347
  async function x(d) {
348
- s.value.type = d;
348
+ n.value.type = d;
349
349
  }
350
350
  Se(async () => {
351
351
  });
352
- const I = v;
353
- return _({
352
+ const I = _;
353
+ return v({
354
354
  showSheet: c,
355
355
  hideSheet: F
356
- }), (d, r) => {
357
- const g = b("FmButton"), U = b("FmSwitch"), o = b("FmSideSheet");
358
- return p(), J(o, {
359
- modelValue: t(m),
360
- "onUpdate:modelValue": r[8] || (r[8] = (a) => Ie(m) ? m.value = a : null),
356
+ }), (d, s) => {
357
+ const g = S("FmButton"), U = S("FmSwitch"), a = S("FmSideSheet");
358
+ return m(), J(a, {
359
+ modelValue: t(p),
360
+ "onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(p) ? p.value = o : null),
361
361
  header: "Add segment",
362
362
  "dismiss-away": "",
363
363
  "close-button": !0,
364
364
  "max-width": 1100
365
365
  }, Me({
366
366
  "side-sheet-footer": E(() => [
367
- l("div", Tt, [
368
- t(y) || t(s).type === t(R).enum.STATIC ? (p(), C(O, { key: 0 }, [
369
- i(g, {
367
+ l("div", Ft, [
368
+ t(f) || t(n).type === t(D).enum.STATIC ? (m(), C(O, { key: 0 }, [
369
+ r(g, {
370
370
  label: "Save Segment",
371
- onClick: S,
371
+ onClick: y,
372
372
  loading: t(k).isLoading,
373
- disabled: t(n).length > 0 || t(k).isLoading
373
+ disabled: t(i).length > 0 || t(k).isLoading
374
374
  }, null, 8, ["loading", "disabled"]),
375
- i(g, {
375
+ r(g, {
376
376
  label: "Cancel",
377
- onClick: r[6] || (r[6] = (a) => h(t(s).type)),
377
+ onClick: s[6] || (s[6] = (o) => h(t(n).type)),
378
378
  variant: "tertiary"
379
379
  })
380
- ], 64)) : (p(), C(O, { key: 1 }, [
381
- i(g, {
380
+ ], 64)) : (m(), C(O, { key: 1 }, [
381
+ r(g, {
382
382
  label: "Review Segment",
383
- disabled: t(n).length > 0 || t(k).isLoading,
384
- onClick: $
383
+ disabled: t(i).length > 0 || t(k).isLoading,
384
+ onClick: A
385
385
  }, null, 8, ["disabled"]),
386
- i(g, {
386
+ r(g, {
387
387
  label: "Cancel",
388
- onClick: r[7] || (r[7] = (a) => F()),
388
+ onClick: s[7] || (s[7] = (o) => F()),
389
389
  variant: "tertiary"
390
390
  })
391
391
  ], 64))
392
392
  ])
393
393
  ]),
394
394
  default: E(() => {
395
- var a;
395
+ var o;
396
396
  return [
397
- t(y) ? (p(), J(mt, {
397
+ t(f) ? (m(), J(ut, {
398
398
  key: 1,
399
- title: t(s).name,
400
- segment: t(s)
401
- }, null, 8, ["title", "segment"])) : (p(), C("div", xt, [
402
- i(Le, {
403
- modelValue: t(s).name,
404
- "onUpdate:modelValue": r[1] || (r[1] = (u) => t(s).name = u),
399
+ title: t(n).name,
400
+ segment: t(n)
401
+ }, null, 8, ["title", "segment"])) : (m(), C("div", _t, [
402
+ r(Le, {
403
+ modelValue: t(n).name,
404
+ "onUpdate:modelValue": s[1] || (s[1] = (u) => t(n).name = u),
405
405
  label: "Segment title",
406
406
  schema: t(Ve).typeAtPath(t(w), "name")
407
407
  }, null, 8, ["modelValue", "schema"]),
408
- l("div", bt, [
409
- wt,
410
- i(vt, {
411
- "model-value": t(s).type,
412
- "onUpdate:modelValue": r[2] || (r[2] = (u) => {
408
+ l("div", xt, [
409
+ s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
410
+ r(gt, {
411
+ "model-value": t(n).type,
412
+ "onUpdate:modelValue": s[2] || (s[2] = (u) => {
413
413
  x(u);
414
414
  })
415
415
  }, null, 8, ["model-value"])
416
416
  ]),
417
- t(s).type === t(R).enum.DYNAMIC ? (p(), C("div", Ft, [
418
- kt,
419
- i(ze, {
417
+ t(n).type === t(D).enum.DYNAMIC ? (m(), C("div", St, [
418
+ s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
419
+ r(ze, {
420
420
  "trigger-type": "MEMBERSHIP_JOINED",
421
421
  includeOnly: "user",
422
- "model-value": (a = t(s)) == null ? void 0 : a.rule,
423
- "onUpdate:modelValue": r[3] || (r[3] = (u) => {
424
- t(s).rule = u;
422
+ "model-value": (o = t(n)) == null ? void 0 : o.rule,
423
+ "onUpdate:modelValue": s[3] || (s[3] = (u) => {
424
+ t(n).rule = u;
425
425
  })
426
426
  }, null, 8, ["model-value"])
427
- ])) : (p(), C("div", Ct, [
428
- i(lt, {
429
- importFile: t(s).importFile,
430
- "onUpdate:file": r[4] || (r[4] = (u) => {
431
- t(s).file = u;
427
+ ])) : (m(), C("div", bt, [
428
+ r(st, {
429
+ importFile: t(n).importFile,
430
+ "onUpdate:file": s[4] || (s[4] = (u) => {
431
+ t(n).file = u;
432
432
  })
433
433
  }, null, 8, ["importFile"])
434
434
  ])),
435
- t(s).type === t(R).enum.DYNAMIC ? (p(), C("div", It, [
436
- Mt,
437
- i(U, {
438
- "model-value": t(s).isActive ?? !0,
439
- "onUpdate:modelValue": r[5] || (r[5] = (u) => t(s).isActive = u),
435
+ t(n).type === t(D).enum.DYNAMIC ? (m(), C("div", wt, [
436
+ s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
437
+ r(U, {
438
+ "model-value": t(n).isActive ?? !0,
439
+ "onUpdate:modelValue": s[5] || (s[5] = (u) => t(n).isActive = u),
440
440
  label: "Active",
441
441
  sublabel: "When enabled, this will recalculate the segment statistics daily.",
442
442
  "label-placement": "right"
@@ -447,16 +447,16 @@ const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div",
447
447
  }),
448
448
  _: 2
449
449
  }, [
450
- t(y) ? {
450
+ t(f) ? {
451
451
  name: "side-sheet-header",
452
452
  fn: E(() => [
453
- l("div", ht, [
454
- i(g, {
453
+ l("div", vt, [
454
+ r(g, {
455
455
  icon: "arrow_back",
456
456
  variant: "tertiary",
457
- onClick: r[0] || (r[0] = (a) => y.value = !1)
457
+ onClick: s[0] || (s[0] = (o) => f.value = !1)
458
458
  }),
459
- St
459
+ s[9] || (s[9] = l("div", null, "Review segment", -1))
460
460
  ])
461
461
  ]),
462
462
  key: "0"
@@ -464,58 +464,58 @@ const et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div",
464
464
  ]), 1032, ["modelValue"]);
465
465
  };
466
466
  }
467
- }), he = Ge(), $t = ke();
467
+ }), xe = Ge(), kt = ke();
468
468
  function se(e) {
469
- const _ = G(e);
470
- return _.isValid() ? _.format("DD/MM/YYYY") : "";
469
+ const v = G(e);
470
+ return v.isValid() ? v.format("DD/MM/YYYY") : "";
471
471
  }
472
- const At = {
472
+ const Ct = {
473
473
  mapMemberExportRow: (e) => {
474
- var n, c, F, $, h, S, x, I, d, r, g, U, o, a, u, P, A, B, V, j, q, H, te, M, Q, de, ue, pe;
475
- const _ = ce(() => $t.locations.map((T) => ({
474
+ var i, c, F, A, h, y, x, I, d, s, g, U, a, o, u, P, R, B, V, j, q, H, te, M, Q, de, ue, me;
475
+ const v = ce(() => kt.locations.map((T) => ({
476
476
  label: T.name,
477
477
  value: T._id
478
- }))), v = (n = Ne.parseOneAddress(
478
+ }))), _ = (i = Ne.parseOneAddress(
479
479
  e == null ? void 0 : e.email
480
- )) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, k = (F = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : F.reduce(
480
+ )) != null && i.domain.includes("feedmepos.com") ? void 0 : e.email, k = (F = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : F.reduce(
481
481
  (T, L) => {
482
482
  var K, Z;
483
- const W = (Z = (K = he.sortedTitles) == null ? void 0 : K.find(
483
+ const W = (Z = (K = xe.sortedTitles) == null ? void 0 : K.find(
484
484
  (oe) => oe._id === L.collectible
485
485
  )) == null ? void 0 : Z.name;
486
486
  return !W || L.balance <= 0 || T.push(W), T;
487
487
  },
488
488
  []
489
- ), m = (he.sortedTitles || []).reduce(
489
+ ), p = (xe.sortedTitles || []).reduce(
490
490
  (T, L) => {
491
- var K, Z, oe, me;
492
- const W = (me = (oe = (Z = (((K = e == null ? void 0 : e.collection) == null ? void 0 : K.TITLE) || []).find(
491
+ var K, Z, oe, pe;
492
+ const W = (pe = (oe = (Z = (((K = e == null ? void 0 : e.collection) == null ? void 0 : K.TITLE) || []).find(
493
493
  (Ce) => Ce.collectible === L._id
494
- )) == null ? void 0 : Z.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : me.expiredAt;
494
+ )) == null ? void 0 : Z.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : pe.expiredAt;
495
495
  return T[L.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
496
496
  },
497
497
  {}
498
- ), y = ((S = (h = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : S.balance) || 0, f = ((r = (d = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : r.reduce(
498
+ ), f = ((y = (h = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : y.balance) || 0, b = ((s = (d = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : s.reduce(
499
499
  (T, L) => T + L.amount,
500
500
  0
501
- )) || 0, w = Qe(y, 2);
501
+ )) || 0, w = Qe(f, 2);
502
502
  return {
503
503
  ID: e._id.toString(),
504
504
  Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
505
505
  Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
506
- Email: v || "",
506
+ Email: _ || "",
507
507
  Gender: e.gender || "",
508
508
  CardNo: e.cardNo || "",
509
509
  Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
510
- Credit: parseFloat((Number(w) - Number(f)).toFixed(2)),
511
- FreeCredit: Number(f.toFixed(2)),
510
+ Credit: parseFloat((Number(w) - Number(b)).toFixed(2)),
511
+ FreeCredit: Number(b.toFixed(2)),
512
512
  TotalCredit: Number(w),
513
- Exp: e != null && e.collection ? ((u = (a = (o = e.collection) == null ? void 0 : o.POINT) == null ? void 0 : a.at(0)) == null ? void 0 : u.balance) ?? 0 : 0,
514
- Point: e != null && e.collection ? ((B = (A = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : A.at(0)) == null ? void 0 : B.balance) ?? 0 : 0,
513
+ Exp: e != null && e.collection ? ((u = (o = (a = e.collection) == null ? void 0 : a.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : u.balance) ?? 0 : 0,
514
+ Point: e != null && e.collection ? ((B = (R = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : R.at(0)) == null ? void 0 : B.balance) ?? 0 : 0,
515
515
  Level: e != null && e.collection ? ((q = (j = (V = e.collection) == null ? void 0 : V.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : q.balance) ?? 0 : 0,
516
516
  Tier: e != null && e.collection ? ((M = (te = (H = e.collection) == null ? void 0 : H.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
517
517
  Titles: k.join(","),
518
- ...m,
518
+ ...p,
519
519
  TotalTransaction: e.stats.visitCount,
520
520
  AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
521
521
  !1
@@ -526,59 +526,53 @@ const At = {
526
526
  LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
527
527
  LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
528
528
  JoinedAt: se(e.joinAt || void 0),
529
- JoinedAtLocation: e.location && ((pe = _.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
529
+ JoinedAtLocation: e.location && ((me = v.value.find((T) => T.value == e.location)) == null ? void 0 : me.label) || "-",
530
530
  VisitFrequency: `${Number(
531
531
  Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
532
532
  )}`
533
533
  };
534
534
  }
535
- }, Rt = { class: "flex items-center" }, Dt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Pt = { class: "px-24 flex flex-col gap-y-16" }, Nt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-md-600" }, Vt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Yt = /* @__PURE__ */ l("img", {
536
- src: Ee,
537
- class: "aspect-square w-[150px]"
538
- }, null, -1), Ut = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
539
- /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
540
- /* @__PURE__ */ l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
541
- ], -1), So = /* @__PURE__ */ ee({
535
+ }, It = { class: "flex items-center" }, Mt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Tt = { class: "px-24 flex flex-col gap-y-16" }, Et = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, At = { class: "fm-typo-en-body-md-600" }, Rt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, mo = /* @__PURE__ */ ee({
542
536
  __name: "Segment",
543
537
  setup(e) {
544
- const { minor: _ } = Re, { t: v } = we(), k = ke(), { mapMemberExportRow: m } = At, y = De(), f = Ke(), w = z(0), s = [
538
+ const { minor: v } = De, { t: _ } = Fe(), k = ke(), { mapMemberExportRow: p } = Ct, f = $e(), b = Ke(), w = z(0), n = [
545
539
  {
546
- header: v("connect.loyalty.segment.table.name"),
547
- accessorFn: (o) => o.name
540
+ header: _("connect.loyalty.segment.table.name"),
541
+ accessorFn: (a) => a.name
548
542
  },
549
543
  {
550
- header: v("connect.loyalty.segment.table.status"),
544
+ header: _("connect.loyalty.segment.table.status"),
551
545
  enableSorting: !1,
552
- cell(o) {
553
- const a = o.row.original.isActive === !1 ? "Inactive" : "Active";
546
+ cell(a) {
547
+ const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
554
548
  return Y(X.FmChip, {
555
- class: o.row.original.isActive === !1 ? "text-fm-color-typo-error bg-fm-color-system-error-100" : "text-fm-color-typo-success bg-fm-color-system-success-100",
556
- label: a,
549
+ class: a.row.original.isActive === !1 ? "text-fm-color-typo-error bg-fm-color-system-error-100" : "text-fm-color-typo-success bg-fm-color-system-success-100",
550
+ label: o,
557
551
  compact: !0
558
552
  });
559
553
  }
560
554
  },
561
555
  {
562
- header: v("connect.loyalty.segment.table.total_customers"),
563
- accessorFn: (o) => o.memberCount ?? 0
556
+ header: _("connect.loyalty.segment.table.total_customers"),
557
+ accessorFn: (a) => a.memberCount ?? 0
564
558
  },
565
559
  {
566
- header: v("connect.loyalty.segment.table.customer_percentage"),
567
- accessorFn: (o) => ((o.memberCount ?? 0) * 100 / w.value).toFixed(2)
560
+ header: _("connect.loyalty.segment.table.customer_percentage"),
561
+ accessorFn: (a) => ((a.memberCount ?? 0) * 100 / w.value).toFixed(2)
568
562
  },
569
563
  {
570
- header: v("connect.loyalty.segment.table.actions"),
564
+ header: _("connect.loyalty.segment.table.actions"),
571
565
  meta: {
572
566
  maxWidth: "100px"
573
567
  },
574
- cell(o) {
568
+ cell(a) {
575
569
  return Y("div", { class: "flex items-center justify-end" }, [
576
570
  Y(
577
571
  X.FmMenu,
578
572
  {
579
573
  placement: "bottom-end",
580
- onClick: (a) => {
581
- a.stopPropagation();
574
+ onClick: (o) => {
575
+ o.stopPropagation();
582
576
  }
583
577
  },
584
578
  {
@@ -591,8 +585,8 @@ const At = {
591
585
  Y(
592
586
  X.FmMenuItem,
593
587
  {
594
- onClick: async (a) => {
595
- a.stopPropagation(), x(o.row.original);
588
+ onClick: async (o) => {
589
+ o.stopPropagation(), x(a.row.original);
596
590
  }
597
591
  },
598
592
  {
@@ -608,8 +602,8 @@ const At = {
608
602
  Y(
609
603
  X.FmMenuItem,
610
604
  {
611
- onClick: async (a) => {
612
- a.stopPropagation(), S(o.row.original);
605
+ onClick: async (o) => {
606
+ o.stopPropagation(), y(a.row.original);
613
607
  }
614
608
  },
615
609
  {
@@ -628,69 +622,69 @@ const At = {
628
622
  ]);
629
623
  }
630
624
  }
631
- ], n = z(null), { tableMeta: c, rowData: F, debouncedFetchData: $ } = xe(
625
+ ], i = z(null), { tableMeta: c, rowData: F, debouncedFetchData: A } = be(
632
626
  N.readAll
633
627
  );
634
628
  async function h() {
635
- await _(
629
+ await v(
636
630
  async () => {
637
- await N.refreshSegments(), await $({ pageSize: 10, pageIndex: 0 });
631
+ await N.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
638
632
  },
639
633
  { message: "Refreshing segmentations" }
640
634
  );
641
635
  }
642
- async function S(o) {
643
- await Ae.remove(`Are you sure you want to remove ${o.name}?`) && await _(
636
+ async function y(a) {
637
+ await Re.remove(`Are you sure you want to remove ${a.name}?`) && await v(
644
638
  async () => {
645
- await N.delete(o._id), await $({ pageSize: 10, pageIndex: 0 });
639
+ await N.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
646
640
  },
647
641
  {
648
- message: `Removing ${o.name}`,
649
- successMessage: `Removed ${o.name} successfully`
642
+ message: `Removing ${a.name}`,
643
+ successMessage: `Removed ${a.name} successfully`
650
644
  }
651
645
  );
652
646
  }
653
- async function x(o) {
654
- const a = {
647
+ async function x(a) {
648
+ const o = {
655
649
  sortBy: "_id",
656
650
  descending: !1,
657
651
  rowsPerPage: 1e3,
658
652
  page: 1,
659
653
  rowsNumber: 0
660
- }, u = new Be(), P = (await _e.read({
654
+ }, u = new Be(), P = (await ve.read({
661
655
  limit: 1,
662
656
  skip: 0,
663
- sortBy: a.sortBy,
664
- descending: a.descending
665
- })).meta.totalResources ?? 0, A = a.rowsPerPage;
666
- await _(
657
+ sortBy: o.sortBy,
658
+ descending: o.descending
659
+ })).meta.totalResources ?? 0, R = o.rowsPerPage;
660
+ await v(
667
661
  async () => {
668
- for (let B = 0; B < P; B += A) {
662
+ for (let B = 0; B < P; B += R) {
669
663
  const V = {
670
- ...a,
671
- limit: A,
672
- skip: a.page - 1,
673
- sortBy: a.sortBy,
674
- descending: a.descending
664
+ ...o,
665
+ limit: R,
666
+ skip: o.page - 1,
667
+ sortBy: o.sortBy,
668
+ descending: o.descending
675
669
  }, j = await N.paginateSegmentUsers(
676
- o._id,
670
+ a._id,
677
671
  V
678
672
  );
679
673
  for (const q of j.resources) {
680
- const H = m(q);
674
+ const H = p(q);
681
675
  u.addRecord(H);
682
676
  }
683
- a.page++;
677
+ o.page++;
684
678
  }
685
- await Fe(
679
+ await he(
686
680
  u.buildExcel(),
687
- `[${o.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
681
+ `[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
688
682
  {
689
683
  bookType: "xlsx",
690
684
  bookSST: !1,
691
685
  type: "array"
692
686
  }
693
- ), a.page = 1;
687
+ ), o.page = 1;
694
688
  },
695
689
  {
696
690
  message: "Exporting member...",
@@ -698,36 +692,36 @@ const At = {
698
692
  }
699
693
  );
700
694
  }
701
- async function I(o) {
702
- await _(
695
+ async function I(a) {
696
+ await v(
703
697
  async () => {
704
- var a;
705
- if (o.type === R.enum.STATIC) {
698
+ var o;
699
+ if (a.type === D.enum.STATIC) {
706
700
  const u = new FormData();
707
- if (u.append("file", o.file), o._id) {
708
- const { members: P, _id: A, file: B, ...V } = o;
709
- u.append("segment", JSON.stringify(V)), await N.updateStatic(o._id, u);
701
+ if (u.append("file", a.file), a._id) {
702
+ const { members: P, _id: R, file: B, ...V } = a;
703
+ u.append("segment", JSON.stringify(V)), await N.updateStatic(a._id, u);
710
704
  } else {
711
- const { file: P, ...A } = o;
712
- u.append("segment", JSON.stringify(A)), await N.createStatic(u);
705
+ const { file: P, ...R } = a;
706
+ u.append("segment", JSON.stringify(R)), await N.createStatic(u);
713
707
  }
714
- o.file && y.open({
708
+ a.file && f.open({
715
709
  type: "info",
716
710
  title: "Import begins soon. Check Queue for updates.",
717
711
  action: "View",
718
712
  onAction: async () => {
719
- await f.push({
720
- name: ve["$connect-QUEUE"],
713
+ await b.push({
714
+ name: _e["$connect-QUEUE"],
721
715
  query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
722
716
  });
723
717
  }
724
718
  });
725
- } else if (o._id) {
726
- const { members: u, _id: P, ...A } = o;
727
- await N.update(o._id, A);
719
+ } else if (a._id) {
720
+ const { members: u, _id: P, ...R } = a;
721
+ await N.update(a._id, R);
728
722
  } else
729
- await N.create(o);
730
- await $({ pageSize: 10, pageIndex: 0 }), (a = n.value) == null || a.hideSheet();
723
+ await N.create(a);
724
+ await A({ pageSize: 10, pageIndex: 0 }), (o = i.value) == null || o.hideSheet();
731
725
  },
732
726
  {
733
727
  message: "Saving segment",
@@ -735,17 +729,17 @@ const At = {
735
729
  }
736
730
  );
737
731
  }
738
- function d(o) {
739
- var a;
740
- (a = n.value) == null || a.showSheet(o);
732
+ function d(a) {
733
+ var o;
734
+ (o = i.value) == null || o.showSheet(a);
741
735
  }
742
- const r = {
743
- label: v("connect.navigation.queue"),
736
+ const s = {
737
+ label: _("connect.navigation.queue"),
744
738
  value: "queue",
745
739
  isPrimary: !1,
746
740
  prependIcon: "work_history"
747
741
  }, g = ce(() => k.isPremium ? [
748
- r,
742
+ s,
749
743
  {
750
744
  label: "Refresh segments",
751
745
  value: "refresh",
@@ -758,8 +752,8 @@ const At = {
758
752
  prependIcon: "add"
759
753
  }
760
754
  ] : []);
761
- function U(o) {
762
- switch (o) {
755
+ function U(a) {
756
+ switch (a) {
763
757
  case "add":
764
758
  d();
765
759
  break;
@@ -767,78 +761,78 @@ const At = {
767
761
  h();
768
762
  break;
769
763
  case "queue":
770
- f.push({
771
- name: ve["$connect-QUEUE"],
764
+ b.push({
765
+ name: _e["$connect-QUEUE"],
772
766
  query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
773
767
  });
774
768
  break;
775
769
  }
776
770
  }
777
771
  return Te(async () => {
778
- const { meta: o } = await _e.read({
772
+ const { meta: a } = await ve.read({
779
773
  limit: 1,
780
774
  skip: 0,
781
775
  sortBy: "_id",
782
776
  search: void 0,
783
777
  descending: !1
784
778
  });
785
- w.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await k.readPremium(), await k.readLocations();
786
- }), (o, a) => {
787
- const u = b("FmPill"), P = b("FmPageHead"), A = b("FmIcon"), B = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), H = b("FmButton"), te = b("FmCard");
788
- return p(), C(O, null, [
789
- i(P, {
779
+ w.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await k.readPremium(), await k.readLocations();
780
+ }), (a, o) => {
781
+ const u = S("FmPill"), P = S("FmPageHead"), R = S("FmIcon"), B = S("FmMenuItem"), V = S("FmMenu"), j = S("FmListItem"), q = S("FmList"), H = S("FmButton"), te = S("FmCard");
782
+ return m(), C(O, null, [
783
+ r(P, {
790
784
  title: "Segments",
791
785
  actions: t(g),
792
- "onClick:action": a[0] || (a[0] = (M) => U(M))
786
+ "onClick:action": o[0] || (o[0] = (M) => U(M))
793
787
  }, {
794
788
  title: E(() => [
795
- l("div", Rt, [
796
- l("span", Dt, D(t(v)("connect.loyalty.segment.title")), 1),
797
- i(u, { variant: "premium" })
789
+ l("div", It, [
790
+ l("span", Mt, $(t(_)("connect.loyalty.segment.title")), 1),
791
+ r(u, { variant: "premium" })
798
792
  ])
799
793
  ]),
800
794
  _: 1
801
795
  }, 8, ["actions"]),
802
- l("div", Pt, [
803
- t(F).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), C(O, { key: 0 }, [
804
- i(be, {
796
+ l("div", Tt, [
797
+ t(F).length > 0 || t(c).searchValue || t(c).isLoading ? (m(), C(O, { key: 0 }, [
798
+ r(we, {
805
799
  loading: t(c).isLoading,
806
800
  "row-data": t(F),
807
801
  "row-count": t(c).totalRows,
808
- "column-defs": s,
802
+ "column-defs": n,
809
803
  "shrink-at": !1,
810
804
  "page-count": t(c).pageCount,
811
805
  "page-index": t(c).pageIndex,
812
806
  "page-size": t(c).pageSize,
813
- onRowClick: a[1] || (a[1] = (M) => {
807
+ onRowClick: o[1] || (o[1] = (M) => {
814
808
  d(M.original);
815
809
  }),
816
- onPageChange: t($)
810
+ onPageChange: t(A)
817
811
  }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
818
- i(q, { class: "w-full hidden xs:block" }, {
812
+ r(q, { class: "w-full hidden xs:block" }, {
819
813
  default: E(() => [
820
- (p(!0), C(O, null, ie(t(F), (M) => (p(), J(j, {
814
+ (m(!0), C(O, null, ie(t(F), (M) => (m(), J(j, {
821
815
  key: M._id.toString(),
822
816
  tag: "label",
823
817
  onClick: (Q) => d(M)
824
818
  }, {
825
819
  default: E(() => [
826
820
  l("div", null, [
827
- l("div", Nt, D((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
828
- l("div", Bt, D(M.name), 1),
829
- l("div", Vt, D(((M.memberCount ?? 0) * 100 / t(w)).toFixed(2)) + "% of customers ", 1)
821
+ l("div", Et, $((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
822
+ l("div", At, $(M.name), 1),
823
+ l("div", Rt, $(((M.memberCount ?? 0) * 100 / t(w)).toFixed(2)) + "% of customers ", 1)
830
824
  ])
831
825
  ]),
832
826
  append: E(() => [
833
- i(V, { "stop-click-propagation": !0 }, {
827
+ r(V, { "stop-click-propagation": !0 }, {
834
828
  "menu-button": E(() => [
835
- i(A, { name: "more_vert" })
829
+ r(R, { name: "more_vert" })
836
830
  ]),
837
831
  default: E(() => [
838
- i(B, {
832
+ r(B, {
839
833
  class: "text-fm-color-typo-error fm-typo-en-body-md-400",
840
834
  label: "Remove",
841
- "onUpdate:modelValue": (Q) => Q && S(M)
835
+ "onUpdate:modelValue": (Q) => Q && y(M)
842
836
  }, null, 8, ["onUpdate:modelValue"])
843
837
  ]),
844
838
  _: 2
@@ -849,27 +843,33 @@ const At = {
849
843
  ]),
850
844
  _: 1
851
845
  })
852
- ], 64)) : (p(), J(te, {
846
+ ], 64)) : (m(), J(te, {
853
847
  key: 1,
854
848
  variant: "outlined",
855
849
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
856
850
  }, {
857
851
  default: E(() => [
858
- Yt,
859
- Ut,
860
- i(H, {
852
+ o[3] || (o[3] = l("img", {
853
+ src: Ee,
854
+ class: "aspect-square w-[150px]"
855
+ }, null, -1)),
856
+ o[4] || (o[4] = l("div", { class: "flex flex-col gap-16 text-center" }, [
857
+ l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
858
+ l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
859
+ ], -1)),
860
+ r(H, {
861
861
  variant: "primary",
862
862
  label: "Create segment",
863
863
  disabled: !t(k).isPremium,
864
864
  icon: "add",
865
- onClick: a[2] || (a[2] = (M) => d())
865
+ onClick: o[2] || (o[2] = (M) => d())
866
866
  }, null, 8, ["disabled"])
867
867
  ]),
868
868
  _: 1
869
869
  })),
870
- i(Et, {
870
+ r(ht, {
871
871
  ref_key: "sheetRef",
872
- ref: n,
872
+ ref: i,
873
873
  "onUpdate:modelValue": I
874
874
  }, null, 512)
875
875
  ])
@@ -878,5 +878,5 @@ const At = {
878
878
  }
879
879
  });
880
880
  export {
881
- So as default
881
+ mo as default
882
882
  };