@feedmepos/mf-connect 0.1.38-beta.2 → 0.1.38-beta.21

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 (96) hide show
  1. package/dist/{Analytic-BjSfI2Ff.js → Analytic-CEd_WApy.js} +14 -14
  2. package/dist/{App-D11A2JY1.js → App-ulCtuU5o.js} +671 -661
  3. package/dist/{AuditLogs-DWCFYoRg.js → AuditLogs-BM1Np61K.js} +11 -11
  4. package/dist/{Bin-9wV4Ah3M.js → Bin-icbjnKXw.js} +9 -9
  5. package/dist/{Broadcast-I3BtSk8V.js → Broadcast-COQ3E8vI.js} +9 -9
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BbXEYOFK.js} +6 -6
  7. package/dist/{Card-CqALG5RM.js → Card-Cwh3GXi0.js} +142 -136
  8. package/dist/{Collections-rg3SzoUb.js → Collections-EuOjzpkL.js} +81 -75
  9. package/dist/{Credit-BNn1sYZv.js → Credit-BY2Fpdhh.js} +9 -9
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BbsLgUMQ.js} +678 -675
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js → EffectSheet.vue_vue_type_style_index_0_lang-BLw3-hI1.js} +6 -6
  13. package/dist/{Experience-D_Qm8SUj.js → Experience-rAH7zk71.js} +9 -9
  14. package/dist/{Game-CKXgXm6Q.js → Game-DlI0yNF0.js} +10 -10
  15. package/dist/{Index-D4DGfUHd.js → Index-DemXFS3d.js} +10 -10
  16. package/dist/{Marketing-Dn9A1vgH.js → Marketing-shNBO9Rc.js} +7 -7
  17. package/dist/{Member-B55vWHDd.js → Member-C19ZgpaL.js} +10 -10
  18. package/dist/{MemberList-BWTG9Ohy.js → MemberList-B2tNB4yg.js} +27 -27
  19. package/dist/{MemberTransactions-CP5EI-W0.js → MemberTransactions-BN3qaTVY.js} +1 -1
  20. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js → MessageInput.vue_vue_type_script_setup_true_lang-BY3j1h72.js} +5621 -5418
  21. package/dist/{Mission-CFvhROuB.js → Mission-j1KI0-hJ.js} +10 -10
  22. package/dist/{Overview-4273yNwL.js → Overview-BN2Vdu8Q.js} +18 -18
  23. package/dist/{Point-B_-_C919.js → Point-8zy7QcTk.js} +9 -9
  24. package/dist/{Promotion-D2S3COxk.js → Promotion-mcUcylXB.js} +10 -10
  25. package/dist/{Queue-BmS1Oi-C.js → Queue-BsNv4P8u.js} +11 -11
  26. package/dist/{Record-DRBl0M8g.js → Record-VA6Bdlnz.js} +9 -9
  27. package/dist/{Reward-8056NmfK.js → Reward-CVyO3Ga1.js} +15 -15
  28. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js → RewardGroup.vue_vue_type_script_setup_true_lang-BR9_a9bJ.js} +11 -11
  29. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js +1763 -0
  30. package/dist/{Segment-Bzq-pyhc.js → Segment-BMgcdIIS.js} +209 -209
  31. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js → SelectItems.vue_vue_type_script_setup_true_lang-CKRpWcn_.js} +2 -2
  32. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DZCNcdVW.js} +11 -11
  33. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BESF672g.js} +3 -3
  34. package/dist/{Setting-BrJfYoru.js → Setting-BMKKkZTD.js} +457 -442
  35. package/dist/{Store-Bpl_4yZW.js → Store-DdxMDtfL.js} +466 -459
  36. package/dist/{StoreRewards-Cu7n7Pjz.js → StoreRewards-CRyeHEMF.js} +13 -13
  37. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DS6-9WP9.js} +207 -221
  38. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BTKpclKX.js} +1 -1
  39. package/dist/{Tier-_LnXg3n6.js → Tier-D5Xmp5vV.js} +229 -226
  40. package/dist/{Title-B7AGStvx.js → Title-CsK2crqD.js} +141 -138
  41. package/dist/{Transaction-Chxv6V7u.js → Transaction-Dvfc9x4f.js} +2 -2
  42. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CqCxWltm.js} +6 -6
  43. package/dist/{Voucher-C5z2kOq9.js → Voucher-CPN7TMho.js} +13 -13
  44. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DMye9MS3.js} +10 -10
  45. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js → ZodTextField.vue_vue_type_script_setup_true_lang-CnaQAEKo.js} +1 -1
  46. package/dist/{app-BVojNX0w.js → app-DRBevJsF.js} +1 -1
  47. package/dist/{app-7cvPyHJ7.js → app-DteFjR9L.js} +459 -449
  48. package/dist/app.js +1 -1
  49. package/dist/{business-CmxV69wT.js → business-BqV9jK-p.js} +1 -1
  50. package/dist/{campaign-CT_cNJEL.js → campaign-BHDq-yx-.js} +10 -10
  51. package/dist/{campaign-Dq5C_no-.js → campaign-CsWoG6e_.js} +2 -2
  52. package/dist/{campaign.enum-dp7yHKzF.js → campaign.enum-Dfa96W5V.js} +1 -1
  53. package/dist/{campaign.fn-BYZgKDN7.js → campaign.fn-pLrwyHA_.js} +37 -37
  54. package/dist/{collectible.enum-DxbB4DxT.js → collectible.enum-BYTYWPsR.js} +1 -1
  55. package/dist/{collection.fn-CNZRdUgy.js → collection.fn-CYLIQJig.js} +2 -2
  56. package/dist/{dto-CT9zZbv9.js → dto-DBfDbpyb.js} +4 -4
  57. package/dist/{effect-FIlOEC4H.js → effect-D9pD5RCk.js} +1 -1
  58. package/dist/{email-addresses-Ba7xImfX.js → email-addresses-BApvdLkQ.js} +1 -1
  59. package/dist/{export-uzjZFNF9.js → export--EfmCiw0.js} +4 -4
  60. package/dist/{helper-D4sAZde0.js → helper-BHiK3pLT.js} +1 -1
  61. package/dist/{index-B9pl4zRZ.js → index-2dknXEFJ.js} +19 -9
  62. package/dist/{index-CNJLP3D5.js → index-B9_Tn8si.js} +1 -1
  63. package/dist/{index-BjU8LVUC.js → index-BSQXDDQY.js} +6347 -6305
  64. package/dist/{index-CwsMG2cV.js → index-Bqc7PV3K.js} +1 -1
  65. package/dist/{index-CONvJfKv.js → index-C1Vrltkc.js} +1 -1
  66. package/dist/{index-D5rvMvzx.js → index-CD2bkLo_.js} +1 -1
  67. package/dist/{index-DNxa8Rqx.js → index-CDLBLuYq.js} +69 -68
  68. package/dist/{index-BXz54M1s.js → index-COiVJ9pA.js} +1 -1
  69. package/dist/{index-CH3z92VV.js → index-CVxruvVB.js} +1 -1
  70. package/dist/{index-CS3Jmojj.js → index-Cc80pBYX.js} +573 -573
  71. package/dist/{index-l2F5MnLF.js → index-DXM3o6kl.js} +11 -4
  72. package/dist/{index-BI3m1Ehv.js → index-DYgdunxw.js} +3 -3
  73. package/dist/{index-CvBcve-r.js → index-Pd9RCQxn.js} +1 -1
  74. package/dist/{index-CUfS9Kp1.js → index-qd_dvZcw.js} +2 -2
  75. package/dist/{index.esm2017-ATcsD5N4.js → index.esm2017-DAWS_ALH.js} +34 -34
  76. package/dist/{loading-BWGQSrCB.js → loading-BVUeda4s.js} +1 -1
  77. package/dist/{membership-Cc4OZ8-U.js → membership-BL_43RJR.js} +3 -3
  78. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  79. package/dist/{money-D7p8nfun.js → money-Cd8hLiNc.js} +1 -1
  80. package/dist/{number-CMJjC4qz.js → number-DVb8PSrj.js} +1 -1
  81. package/dist/objectid-D33s3gxp.js +145 -0
  82. package/dist/{plugins-eQis66QR.js → plugins-BKtBkC9Q.js} +2 -2
  83. package/dist/{reward-DrnzbG20.js → reward-f41dJcaL.js} +1 -1
  84. package/dist/{rule-CtRxkYXB.js → rule-Cbux1-fC.js} +4 -4
  85. package/dist/rule-builder-BrZeF45Z.js +91 -0
  86. package/dist/style.css +4 -1
  87. package/dist/{template-C3UfY0v5.js → template-tqhgmIdT.js} +4 -4
  88. package/dist/timezone-DaTVH4y0.js +1150 -0
  89. package/dist/{trigger-C9U7Zgad.js → trigger-C34RfwrT.js} +4 -4
  90. package/dist/{user-D7n9yYmO.js → user-DgKhDLYr.js} +1 -1
  91. package/dist/{vue-i18n-Bz45zC04.js → vue-i18n-xo56wiwi.js} +410 -410
  92. package/dist/{xlsx-D4S4qbcZ.js → xlsx-D8ZZRjtf.js} +1 -1
  93. package/package.json +3 -2
  94. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js +0 -1728
  95. package/dist/objectid-D5T27iny.js +0 -145
  96. package/dist/rule-builder-Di9RIYHF.js +0 -89
@@ -1,42 +1,42 @@
1
- import { defineComponent as ee, ref as z, resolveComponent as b, openBlock as p, createElementBlock as k, 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";
1
+ import { defineComponent as ee, ref as z, resolveComponent as F, openBlock as p, createElementBlock as k, createElementVNode as i, createVNode as r, unref as t, createCommentVNode as le, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as R, 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 { p as Ae } from "./plugins-eQis66QR.js";
4
- import { u as De } from "./loading-BWGQSrCB.js";
3
+ import { n as Ae, p as De } from "./plugins-BKtBkC9Q.js";
4
+ import { u as $e } from "./loading-BVUeda4s.js";
5
5
  import { FmButtonVariant as ae, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
6
- import { u as we, _ as be } from "./usePagination-BeF5K3M7.js";
7
- import { u as Fe } from "./vue-i18n-Bz45zC04.js";
8
- import "./index-B9pl4zRZ.js";
9
- import { i as $e, j as R, c as fe } from "./index-DNxa8Rqx.js";
10
- import "./index-CUfS9Kp1.js";
11
- import "./index-CONvJfKv.js";
12
- import "./index-BI3m1Ehv.js";
13
- import { u as ne, w as he } from "./xlsx-D4S4qbcZ.js";
14
- import { e as Pe, M as Be } from "./email-addresses-Ba7xImfX.js";
15
- import { Z as Ne } from "./zod-Bg2FbC-D.js";
16
- import { u as Ve } from "./app-wDQR6dpb.js";
17
- import { F as ye, z as Ye } from "./index-CS3Jmojj.js";
18
- import { R as ge } from "./rule-builder-Di9RIYHF.js";
19
- import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js";
20
- import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js";
21
- import { u as ze, v as Oe, w as je } from "./index.esm2017-ATcsD5N4.js";
22
- import { F as qe } from "./FileSaver.min-NlMItPOc.js";
23
- import { h as H } from "./moment-BWErdI6_.js";
24
- import { s as B, u as Ge } from "./membership-Cc4OZ8-U.js";
25
- import { o as He } from "./objectId-dwaoBfJX.js";
26
- import { u as Ce } from "./business-CmxV69wT.js";
27
- import { f as Je } from "./number-CMJjC4qz.js";
28
- import { t as Qe } from "./money-D7p8nfun.js";
29
- import "./index-CNJLP3D5.js";
30
- import { useRouter as We } from "vue-router";
31
- import { m as ve } from "./index-CvBcve-r.js";
32
- import { R as _e } from "./app-7cvPyHJ7.js";
33
- const Ze = $e.extend({
6
+ import { u as we, _ as Fe } from "./usePagination-BeF5K3M7.js";
7
+ import { u as be } from "./vue-i18n-xo56wiwi.js";
8
+ import "./index-2dknXEFJ.js";
9
+ import { i as Pe, j as $, c as fe } from "./index-CDLBLuYq.js";
10
+ import "./index-qd_dvZcw.js";
11
+ import "./index-C1Vrltkc.js";
12
+ import "./index-DYgdunxw.js";
13
+ import { u as ne, w as he } from "./xlsx-D8ZZRjtf.js";
14
+ import { e as Be, M as Ne } from "./email-addresses-BApvdLkQ.js";
15
+ import { Z as Ve } from "./zod-Bg2FbC-D.js";
16
+ import { u as Ye } from "./app-wDQR6dpb.js";
17
+ import { F as ye, z as Ue } from "./index-Cc80pBYX.js";
18
+ import { R as ge } from "./rule-builder-BrZeF45Z.js";
19
+ import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CnaQAEKo.js";
20
+ import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js";
21
+ import { u as Oe, v as je, w as qe } from "./index.esm2017-DAWS_ALH.js";
22
+ import { F as Ge } from "./FileSaver.min-NlMItPOc.js";
23
+ import { h as H } from "./moment-D7p2TMB-.js";
24
+ import { s as B, u as He } from "./membership-BL_43RJR.js";
25
+ import { o as Je } from "./objectId-dwaoBfJX.js";
26
+ import { u as Ce } from "./business-BqV9jK-p.js";
27
+ import { f as Qe } from "./number-DVb8PSrj.js";
28
+ import { t as We } from "./money-Cd8hLiNc.js";
29
+ import "./index-B9_Tn8si.js";
30
+ import { useRouter as Ze } from "vue-router";
31
+ import { m as ve } from "./index-Pd9RCQxn.js";
32
+ import { R as _e } from "./app-DteFjR9L.js";
33
+ const Ke = Pe.extend({
34
34
  _id: ye.optional(),
35
35
  business: ye.optional(),
36
- file: Ye.any().nullish()
36
+ file: Ue.any().nullish()
37
37
  });
38
- var Ke = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" };
39
- const Xe = { class: "flex flex-col space-y-16" }, et = {
38
+ var Xe = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" };
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 Xe = { class: "flex flex-col space-y-16" }, et = {
44
44
  "flex items-center",
45
45
  "justify-between"
46
46
  ])
47
- }, tt = { class: "flex justify-end" }, ot = {
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
- }, at = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, nt = /* @__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
60
  setup(e, { emit: _ }) {
61
- const x = e, h = _, { t: m } = Fe(), y = z(null), f = z(null), F = ["Id"], i = [
61
+ const x = e, C = _, { t: m } = be(), y = z(null), f = z(null), b = ["Id"], s = [
62
62
  {
63
63
  label: "CSV",
64
64
  icon: "csv",
@@ -73,39 +73,39 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
73
73
  async function n() {
74
74
  if (x.importFile)
75
75
  try {
76
- const S = ze(void 0, Ke.importFilesBucketUrl), g = Oe(S, x.importFile), w = await je(g);
76
+ const S = Oe(void 0, Xe.importFilesBucketUrl), g = je(S, x.importFile), w = await qe(g);
77
77
  window.open(w, "_blank");
78
78
  } catch (S) {
79
- console.log(S);
79
+ console.log(S), Ae.error("Failed to download uploaded file");
80
80
  }
81
81
  }
82
82
  async function c(S) {
83
83
  switch (S) {
84
84
  case "csv":
85
- const g = new Blob([F.join(",")], {
85
+ const g = new Blob([b.join(",")], {
86
86
  type: "text/csv;charset=utf-8;"
87
87
  });
88
- qe.saveAs(g, "ImportSegmentTemplate.csv");
88
+ Ge.saveAs(g, "ImportSegmentTemplate.csv");
89
89
  break;
90
90
  case "xlsx":
91
- const w = ne.aoa_to_sheet([F]), I = ne.book_new();
91
+ const w = ne.aoa_to_sheet([b]), I = ne.book_new();
92
92
  ne.book_append_sheet(I, w, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
93
93
  break;
94
94
  }
95
95
  }
96
- function C(S) {
97
- y.value = S, h("update:file", y.value);
96
+ function h(S) {
97
+ y.value = S, C("update:file", y.value);
98
98
  }
99
99
  function A(S) {
100
100
  var w, I;
101
101
  const g = ((I = (w = S.target) == null ? void 0 : w.files) == null ? void 0 : I[0]) ?? null;
102
- C(g);
102
+ h(g);
103
103
  }
104
104
  return (S, g) => {
105
- const w = b("FmButton"), I = b("FmMenuItem"), u = b("FmMenu"), s = b("FmDropField");
106
- return p(), k("div", Xe, [
107
- g[2] || (g[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
108
- S.importFile ? (p(), k("div", et, [
105
+ const w = F("FmButton"), I = F("FmMenuItem"), d = F("FmMenu"), l = F("FmDropField");
106
+ return p(), k("div", et, [
107
+ g[2] || (g[2] = i("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
108
+ S.importFile ? (p(), k("div", tt, [
109
109
  r(w, {
110
110
  label: t(m)("View uploaded file"),
111
111
  variant: t(ae).Plain,
@@ -113,9 +113,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
113
113
  onClick: n
114
114
  }, null, 8, ["label", "variant"])
115
115
  ])) : le("", !0),
116
- l("div", null, [
117
- l("div", tt, [
118
- r(u, { class: "" }, {
116
+ i("div", null, [
117
+ i("div", ot, [
118
+ r(d, { class: "" }, {
119
119
  "menu-button": E(() => [
120
120
  r(w, {
121
121
  variant: "tertiary",
@@ -124,7 +124,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
124
124
  })
125
125
  ]),
126
126
  default: E(() => [
127
- (p(), k(O, null, ie(i, (v) => r(I, {
127
+ (p(), k(O, null, ie(s, (v) => r(I, {
128
128
  key: v.value,
129
129
  icon: v.icon,
130
130
  label: v.label,
@@ -135,13 +135,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
135
135
  _: 1
136
136
  })
137
137
  ]),
138
- y.value ? (p(), k("div", ot, [
138
+ y.value ? (p(), k("div", at, [
139
139
  r(w, {
140
140
  variant: t(ae).Tertiary,
141
141
  "prepend-icon": "attach_file"
142
142
  }, null, 8, ["variant"]),
143
- l("p", at, $(y.value.name), 1),
144
- l("label", {
143
+ i("p", nt, R(y.value.name), 1),
144
+ i("label", {
145
145
  ref_key: "fileLabelRef",
146
146
  ref: f,
147
147
  htmlFor: "file"
@@ -154,7 +154,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
154
154
  return (v = f.value) == null ? void 0 : v.click();
155
155
  })
156
156
  }, null, 8, ["variant", "label"]),
157
- l("input", {
157
+ i("input", {
158
158
  id: "file",
159
159
  accept: ".csv",
160
160
  class: "hidden",
@@ -163,9 +163,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
163
163
  onChange: A
164
164
  }, null, 32)
165
165
  ], 512)
166
- ])) : (p(), J(s, {
166
+ ])) : (p(), J(l, {
167
167
  key: 0,
168
- onFileUpload: g[0] || (g[0] = (v) => C(v)),
168
+ onFileUpload: g[0] || (g[0] = (v) => h(v)),
169
169
  accept: ".csv, .xlsx",
170
170
  "max-file-size": 2e7
171
171
  }))
@@ -173,7 +173,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
173
173
  ]);
174
174
  };
175
175
  }
176
- }), st = { class: "space-y-16 pr-12" }, lt = { class: "fm-typo-en-title-md-800" }, it = { class: "flex space-x-8" }, rt = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, ct = { class: "text-fm-color-typo-secondary" }, dt = /* @__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: {},
@@ -191,7 +191,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
191
191
  },
192
192
  {
193
193
  header: "Customer Since",
194
- accessorFn: (n) => H(He(n._id.toString())).format("DD MMM YYYY")
194
+ accessorFn: (n) => H(Je(n._id.toString())).format("DD MMM YYYY")
195
195
  },
196
196
  {
197
197
  header: "Phone",
@@ -206,7 +206,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
206
206
  accessorFn: (n) => H(n.stats.lastVisit).format("DD MMM YYYY")
207
207
  }
208
208
  ];
209
- async function h(n) {
209
+ async function C(n) {
210
210
  return _.segment._id ? (console.log(n), await B.paginateSegmentUsers(
211
211
  _.segment._id,
212
212
  n
@@ -221,19 +221,19 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
221
221
  }
222
222
  };
223
223
  }
224
- const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: F, onSearch: i } = we(h);
224
+ const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: b, onSearch: s } = we(C);
225
225
  return Se(async () => {
226
- await F();
227
- }), (n, c) => (p(), k("div", st, [
228
- l("div", lt, $(_.title), 1),
229
- l("div", it, [
230
- l("div", rt, $(n.segment.members.length), 1),
231
- l("div", ct, [
232
- c[1] || (c[1] = l("div", null, "contacts in your segment", -1)),
233
- l("div", null, "as of " + $(t(H)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
226
+ await b();
227
+ }), (n, c) => (p(), k("div", lt, [
228
+ i("div", it, R(_.title), 1),
229
+ i("div", rt, [
230
+ i("div", ct, R(n.segment.members.length), 1),
231
+ i("div", dt, [
232
+ c[1] || (c[1] = i("div", null, "contacts in your segment", -1)),
233
+ i("div", null, "as of " + R(t(H)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
234
234
  ])
235
235
  ]),
236
- r(be, {
236
+ r(Fe, {
237
237
  loading: t(m).isLoading,
238
238
  "row-data": t(y),
239
239
  "row-count": t(m).totalRows,
@@ -242,11 +242,11 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
242
242
  "page-count": t(m).pageCount,
243
243
  "page-index": t(m).pageIndex,
244
244
  onSortChange: t(f),
245
- onPageChange: c[0] || (c[0] = (C) => t(F)({ pageSize: C.pageSize, pageIndex: C.pageIndex }))
245
+ onPageChange: c[0] || (c[0] = (h) => t(b)({ pageSize: h.pageSize, pageIndex: h.pageIndex }))
246
246
  }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
247
247
  ]));
248
248
  }
249
- }), ut = { class: "space-y-24" }, pt = { class: "grid grid-cols-2 gap-16" }, mt = { class: "fm-typo-en-title-sm-800" }, ft = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, yt = /* @__PURE__ */ ee({
249
+ }), pt = { class: "space-y-24" }, mt = { 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: {},
@@ -254,38 +254,38 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
254
254
  },
255
255
  emits: ["update:model-value"],
256
256
  setup(e, { emit: _ }) {
257
- const x = e, h = _, m = [
257
+ const x = e, C = _, m = [
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: $.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: $.enum.STATIC
267
267
  }
268
268
  ];
269
269
  function y(f) {
270
- f !== x.modelValue && h("update:model-value", f);
270
+ f !== x.modelValue && C("update:model-value", f);
271
271
  }
272
- return (f, F) => {
273
- const i = b("FmCard"), n = b("FmHelperText");
274
- return p(), k("div", ut, [
275
- l("div", pt, [
276
- (p(), k(O, null, ie(m, (c) => r(i, {
272
+ return (f, b) => {
273
+ const s = F("FmCard"), n = F("FmHelperText");
274
+ return p(), k("div", pt, [
275
+ i("div", mt, [
276
+ (p(), k(O, null, ie(m, (c) => r(s, {
277
277
  variant: "outlined",
278
278
  class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
279
279
  "col-span-2": m.length == 1,
280
280
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
281
281
  "hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
282
282
  }]),
283
- onClick: (C) => y(c.value),
283
+ onClick: (h) => y(c.value),
284
284
  key: c.value
285
285
  }, {
286
286
  default: E(() => [
287
- l("div", mt, $(c.label), 1),
288
- l("div", ft, $(c.sublabel), 1)
287
+ i("div", ft, R(c.label), 1),
288
+ i("div", yt, R(c.sublabel), 1)
289
289
  ]),
290
290
  _: 2
291
291
  }, 1032, ["class", "onClick"])), 64))
@@ -299,93 +299,93 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
299
299
  ]);
300
300
  };
301
301
  }
302
- }), gt = { class: "flex items-center gap-x-8" }, vt = {
302
+ }), vt = { class: "flex items-center gap-x-8" }, _t = {
303
303
  key: 0,
304
304
  class: "space-y-16 pr-12"
305
- }, _t = { class: "flex flex-col space-y-16" }, xt = {
305
+ }, xt = { class: "flex flex-col space-y-16" }, St = {
306
306
  key: 0,
307
307
  class: "flex flex-col space-y-16"
308
- }, St = {
308
+ }, wt = {
309
309
  key: 1,
310
310
  class: "flex flex-col space-y-16"
311
- }, wt = {
311
+ }, Ft = {
312
312
  key: 2,
313
313
  class: "flex flex-col space-y-16"
314
- }, bt = { class: "flex items-center gap-8" }, Ft = /* @__PURE__ */ ee({
314
+ }, bt = { class: "flex items-center gap-8" }, ht = /* @__PURE__ */ ee({
315
315
  __name: "SegmentSheet",
316
316
  emits: ["update:model-value"],
317
317
  setup(e, { expose: _, emit: x }) {
318
- const h = Ve(), m = z(!1), y = z(!1), f = {
318
+ const C = Ye(), m = z(!1), y = z(!1), f = {
319
319
  name: "",
320
320
  isActive: !0,
321
- type: R.enum.DYNAMIC,
321
+ type: $.enum.DYNAMIC,
322
322
  rule: ge.scaffoldGroup(),
323
323
  members: []
324
- }, F = Ze, i = z(f), n = ce(() => {
325
- const u = F.safeParse(i.value);
326
- return u.success ? [] : u.error.errors;
324
+ }, b = Ke, s = z(f), n = ce(() => {
325
+ const d = b.safeParse(s.value);
326
+ return d.success ? [] : d.error.errors;
327
327
  });
328
- function c(u) {
329
- m.value = !0, y.value = !1, u ? i.value = {
330
- ...u,
331
- isActive: u.isActive !== !1,
332
- type: u.type ?? (u.importFile ? R.enum.STATIC : R.enum.DYNAMIC)
333
- } : i.value = { ...f };
328
+ function c(d) {
329
+ m.value = !0, y.value = !1, d ? s.value = {
330
+ ...d,
331
+ isActive: d.isActive !== !1,
332
+ type: d.type ?? (d.importFile ? $.enum.STATIC : $.enum.DYNAMIC)
333
+ } : s.value = { ...f };
334
334
  }
335
- function C() {
335
+ function h() {
336
336
  m.value = !1;
337
337
  }
338
338
  async function A() {
339
- F.safeParse(i.value).success && (y.value = !0);
339
+ b.safeParse(s.value).success && (y.value = !0);
340
340
  }
341
- function S() {
342
- y.value = !1;
341
+ function S(d) {
342
+ d === $.enum.STATIC ? h() : y.value = !1;
343
343
  }
344
344
  async function g() {
345
- i.value.type === R.enum.STATIC ? (i.value.rule = ge.scaffoldGroup(), i.value.isActive = !0) : i.value.file = void 0, I("update:model-value", i.value);
345
+ s.value.type === $.enum.STATIC ? (s.value.rule = ge.scaffoldGroup(), s.value.isActive = !0) : s.value.file = void 0, I("update:model-value", s.value);
346
346
  }
347
- async function w(u) {
348
- i.value.type = u;
347
+ async function w(d) {
348
+ s.value.type = d;
349
349
  }
350
350
  Se(async () => {
351
351
  });
352
352
  const I = x;
353
353
  return _({
354
354
  showSheet: c,
355
- hideSheet: C
356
- }), (u, s) => {
357
- const v = b("FmButton"), U = b("FmSwitch"), a = b("FmSideSheet");
355
+ hideSheet: h
356
+ }), (d, l) => {
357
+ const v = F("FmButton"), U = F("FmSwitch"), a = F("FmSideSheet");
358
358
  return p(), J(a, {
359
359
  modelValue: t(m),
360
- "onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(m) ? m.value = o : null),
360
+ "onUpdate:modelValue": l[8] || (l[8] = (o) => Ie(m) ? m.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", bt, [
368
- t(y) || t(i).type === t(R).enum.STATIC ? (p(), k(O, { key: 0 }, [
367
+ i("div", bt, [
368
+ t(y) || t(s).type === t($).enum.STATIC ? (p(), k(O, { key: 0 }, [
369
369
  r(v, {
370
370
  label: "Save Segment",
371
371
  onClick: g,
372
- loading: t(h).isLoading,
373
- disabled: t(n).length > 0 || t(h).isLoading
372
+ loading: t(C).isLoading,
373
+ disabled: t(n).length > 0 || t(C).isLoading
374
374
  }, null, 8, ["loading", "disabled"]),
375
375
  r(v, {
376
376
  label: "Cancel",
377
- onClick: s[6] || (s[6] = (o) => S()),
377
+ onClick: l[6] || (l[6] = (o) => S(t(s).type)),
378
378
  variant: "tertiary"
379
379
  })
380
380
  ], 64)) : (p(), k(O, { key: 1 }, [
381
381
  r(v, {
382
382
  label: "Review Segment",
383
- disabled: t(n).length > 0 || t(h).isLoading,
383
+ disabled: t(n).length > 0 || t(C).isLoading,
384
384
  onClick: A
385
385
  }, null, 8, ["disabled"]),
386
386
  r(v, {
387
387
  label: "Cancel",
388
- onClick: s[7] || (s[7] = (o) => C()),
388
+ onClick: l[7] || (l[7] = (o) => h()),
389
389
  variant: "tertiary"
390
390
  })
391
391
  ], 64))
@@ -394,49 +394,49 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
394
394
  default: E(() => {
395
395
  var o;
396
396
  return [
397
- t(y) ? (p(), J(dt, {
397
+ t(y) ? (p(), J(ut, {
398
398
  key: 1,
399
- title: t(i).name,
400
- segment: t(i)
401
- }, null, 8, ["title", "segment"])) : (p(), k("div", vt, [
402
- r(Ue, {
403
- modelValue: t(i).name,
404
- "onUpdate:modelValue": s[1] || (s[1] = (d) => t(i).name = d),
399
+ title: t(s).name,
400
+ segment: t(s)
401
+ }, null, 8, ["title", "segment"])) : (p(), k("div", _t, [
402
+ r(Le, {
403
+ modelValue: t(s).name,
404
+ "onUpdate:modelValue": l[1] || (l[1] = (u) => t(s).name = u),
405
405
  label: "Segment title",
406
- schema: t(Ne).typeAtPath(t(F), "name")
406
+ schema: t(Ve).typeAtPath(t(b), "name")
407
407
  }, null, 8, ["modelValue", "schema"]),
408
- l("div", _t, [
409
- s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
410
- r(yt, {
411
- "model-value": t(i).type,
412
- "onUpdate:modelValue": s[2] || (s[2] = (d) => {
413
- w(d);
408
+ i("div", xt, [
409
+ l[10] || (l[10] = i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
410
+ r(gt, {
411
+ "model-value": t(s).type,
412
+ "onUpdate:modelValue": l[2] || (l[2] = (u) => {
413
+ w(u);
414
414
  })
415
415
  }, null, 8, ["model-value"])
416
416
  ]),
417
- t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", xt, [
418
- s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
419
- r(Le, {
417
+ t(s).type === t($).enum.DYNAMIC ? (p(), k("div", St, [
418
+ l[11] || (l[11] = i("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": (o = t(i)) == null ? void 0 : o.rule,
423
- "onUpdate:modelValue": s[3] || (s[3] = (d) => {
424
- t(i).rule = d;
422
+ "model-value": (o = t(s)) == null ? void 0 : o.rule,
423
+ "onUpdate:modelValue": l[3] || (l[3] = (u) => {
424
+ t(s).rule = u;
425
425
  })
426
426
  }, null, 8, ["model-value"])
427
- ])) : (p(), k("div", St, [
428
- r(nt, {
429
- importFile: t(i).importFile,
430
- "onUpdate:file": s[4] || (s[4] = (d) => {
431
- t(i).file = d;
427
+ ])) : (p(), k("div", wt, [
428
+ r(st, {
429
+ importFile: t(s).importFile,
430
+ "onUpdate:file": l[4] || (l[4] = (u) => {
431
+ t(s).file = u;
432
432
  })
433
433
  }, null, 8, ["importFile"])
434
434
  ])),
435
- t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", wt, [
436
- s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
435
+ t(s).type === t($).enum.DYNAMIC ? (p(), k("div", Ft, [
436
+ l[12] || (l[12] = i("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
437
437
  r(U, {
438
- "model-value": t(i).isActive ?? !0,
439
- "onUpdate:modelValue": s[5] || (s[5] = (d) => t(i).isActive = d),
438
+ "model-value": t(s).isActive ?? !0,
439
+ "onUpdate:modelValue": l[5] || (l[5] = (u) => t(s).isActive = u),
440
440
  label: "Active",
441
441
  sublabel: "When enabled, this will recalculate the segment statistics daily.",
442
442
  "label-placement": "right"
@@ -450,13 +450,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
450
450
  t(y) ? {
451
451
  name: "side-sheet-header",
452
452
  fn: E(() => [
453
- l("div", gt, [
453
+ i("div", vt, [
454
454
  r(v, {
455
455
  icon: "arrow_back",
456
456
  variant: "tertiary",
457
- onClick: s[0] || (s[0] = (o) => y.value = !1)
457
+ onClick: l[0] || (l[0] = (o) => y.value = !1)
458
458
  }),
459
- s[9] || (s[9] = l("div", null, "Review segment", -1))
459
+ l[9] || (l[9] = i("div", null, "Review segment", -1))
460
460
  ])
461
461
  ]),
462
462
  key: "0"
@@ -464,20 +464,20 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
464
464
  ]), 1032, ["modelValue"]);
465
465
  };
466
466
  }
467
- }), xe = Ge(), ht = Ce();
467
+ }), xe = He(), Ct = Ce();
468
468
  function se(e) {
469
469
  const _ = H(e);
470
470
  return _.isValid() ? _.format("DD/MM/YYYY") : "";
471
471
  }
472
- const Ct = {
472
+ const kt = {
473
473
  mapMemberExportRow: (e) => {
474
- var n, c, C, A, S, g, w, I, u, s, v, U, a, o, d, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
475
- const _ = ce(() => ht.locations.map((T) => ({
474
+ var n, c, h, A, S, g, w, I, d, l, v, U, a, o, u, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
475
+ const _ = ce(() => Ct.locations.map((T) => ({
476
476
  label: T.name,
477
477
  value: T._id
478
- }))), x = (n = Pe.parseOneAddress(
478
+ }))), x = (n = Be.parseOneAddress(
479
479
  e == null ? void 0 : e.email
480
- )) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, h = (C = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : C.reduce(
480
+ )) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, C = (h = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : h.reduce(
481
481
  (T, L) => {
482
482
  var Z, K;
483
483
  const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
@@ -495,10 +495,10 @@ const Ct = {
495
495
  return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
496
496
  },
497
497
  {}
498
- ), y = ((g = (S = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : S.at(0)) == null ? void 0 : g.balance) || 0, f = ((s = (u = (I = (w = e.collection) == null ? void 0 : w.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : u.expiryBalance) == null ? void 0 : s.reduce(
498
+ ), y = ((g = (S = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : S.at(0)) == null ? void 0 : g.balance) || 0, f = ((l = (d = (I = (w = e.collection) == null ? void 0 : w.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : l.reduce(
499
499
  (T, L) => T + L.amount,
500
500
  0
501
- )) || 0, F = Je(y, 2);
501
+ )) || 0, b = Qe(y, 2);
502
502
  return {
503
503
  ID: e._id.toString(),
504
504
  Name: ((v = e.name) == null ? void 0 : v.trim()) || "",
@@ -507,17 +507,17 @@ const Ct = {
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(F) - Number(f)).toFixed(2)),
510
+ Credit: parseFloat((Number(b) - Number(f)).toFixed(2)),
511
511
  FreeCredit: Number(f.toFixed(2)),
512
- TotalCredit: Number(F),
513
- Exp: e != null && e.collection ? ((d = (o = (a = e.collection) == null ? void 0 : a.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : d.balance) ?? 0 : 0,
512
+ TotalCredit: Number(b),
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
514
  Point: e != null && e.collection ? ((N = (D = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : D.at(0)) == null ? void 0 : N.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 = (G = e.collection) == null ? void 0 : G.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
517
- Titles: h.join(","),
517
+ Titles: C.join(","),
518
518
  ...m,
519
519
  TotalTransaction: e.stats.visitCount,
520
- AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
520
+ AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
521
521
  !1
522
522
  ),
523
523
  TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
@@ -532,10 +532,10 @@ const Ct = {
532
532
  )}`
533
533
  };
534
534
  }
535
- }, kt = { class: "flex items-center" }, It = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Mt = { class: "px-24 flex flex-col gap-y-16" }, Tt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-md-600" }, At = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, uo = /* @__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" }, Dt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, po = /* @__PURE__ */ ee({
536
536
  __name: "Segment",
537
537
  setup(e) {
538
- const { minor: _ } = De, { t: x } = Fe(), h = Ce(), { mapMemberExportRow: m } = Ct, y = Re(), f = We(), F = z(0), i = [
538
+ const { minor: _ } = $e, { t: x } = be(), C = Ce(), { mapMemberExportRow: m } = kt, y = Re(), f = Ze(), b = z(0), s = [
539
539
  {
540
540
  header: x("connect.loyalty.segment.table.name"),
541
541
  accessorFn: (a) => a.name
@@ -558,7 +558,7 @@ const Ct = {
558
558
  },
559
559
  {
560
560
  header: x("connect.loyalty.segment.table.customer_percentage"),
561
- accessorFn: (a) => ((a.memberCount ?? 0) * 100 / F.value).toFixed(2)
561
+ accessorFn: (a) => ((a.memberCount ?? 0) * 100 / b.value).toFixed(2)
562
562
  },
563
563
  {
564
564
  header: x("connect.loyalty.segment.table.actions"),
@@ -622,7 +622,7 @@ const Ct = {
622
622
  ]);
623
623
  }
624
624
  }
625
- ], n = z(null), { tableMeta: c, rowData: C, debouncedFetchData: A } = we(
625
+ ], n = z(null), { tableMeta: c, rowData: h, debouncedFetchData: A } = we(
626
626
  B.readAll
627
627
  );
628
628
  async function S() {
@@ -634,7 +634,7 @@ const Ct = {
634
634
  );
635
635
  }
636
636
  async function g(a) {
637
- await Ae.remove(`Are you sure you want to remove ${a.name}?`) && await _(
637
+ await De.remove(`Are you sure you want to remove ${a.name}?`) && await _(
638
638
  async () => {
639
639
  await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
640
640
  },
@@ -651,7 +651,7 @@ const Ct = {
651
651
  rowsPerPage: 1e3,
652
652
  page: 1,
653
653
  rowsNumber: 0
654
- }, d = new Be(), P = (await ve.read({
654
+ }, u = new Ne(), P = (await ve.read({
655
655
  limit: 1,
656
656
  skip: 0,
657
657
  sortBy: o.sortBy,
@@ -672,12 +672,12 @@ const Ct = {
672
672
  );
673
673
  for (const q of j.resources) {
674
674
  const G = m(q);
675
- d.addRecord(G);
675
+ u.addRecord(G);
676
676
  }
677
677
  o.page++;
678
678
  }
679
679
  await he(
680
- d.buildExcel(),
680
+ u.buildExcel(),
681
681
  `[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
682
682
  {
683
683
  bookType: "xlsx",
@@ -696,14 +696,14 @@ const Ct = {
696
696
  await _(
697
697
  async () => {
698
698
  var o;
699
- if (a.type === R.enum.STATIC) {
700
- const d = new FormData();
701
- if (d.append("file", a.file), a._id) {
699
+ if (a.type === $.enum.STATIC) {
700
+ const u = new FormData();
701
+ if (u.append("file", a.file), a._id) {
702
702
  const { members: P, _id: D, file: N, ...V } = a;
703
- d.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, d);
703
+ u.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, u);
704
704
  } else {
705
705
  const { file: P, ...D } = a;
706
- d.append("segment", JSON.stringify(D)), await B.createStatic(d);
706
+ u.append("segment", JSON.stringify(D)), await B.createStatic(u);
707
707
  }
708
708
  a.file && y.open({
709
709
  type: "info",
@@ -717,7 +717,7 @@ const Ct = {
717
717
  }
718
718
  });
719
719
  } else if (a._id) {
720
- const { members: d, _id: P, ...D } = a;
720
+ const { members: u, _id: P, ...D } = a;
721
721
  await B.update(a._id, D);
722
722
  } else
723
723
  await B.create(a);
@@ -729,17 +729,17 @@ const Ct = {
729
729
  }
730
730
  );
731
731
  }
732
- function u(a) {
732
+ function d(a) {
733
733
  var o;
734
734
  (o = n.value) == null || o.showSheet(a);
735
735
  }
736
- const s = {
736
+ const l = {
737
737
  label: x("connect.navigation.queue"),
738
738
  value: "queue",
739
739
  isPrimary: !1,
740
740
  prependIcon: "work_history"
741
- }, v = ce(() => h.isPremium ? [
742
- s,
741
+ }, v = ce(() => C.isPremium ? [
742
+ l,
743
743
  {
744
744
  label: "Refresh segments",
745
745
  value: "refresh",
@@ -755,7 +755,7 @@ const Ct = {
755
755
  function U(a) {
756
756
  switch (a) {
757
757
  case "add":
758
- u();
758
+ d();
759
759
  break;
760
760
  case "refresh":
761
761
  S();
@@ -776,9 +776,9 @@ const Ct = {
776
776
  search: void 0,
777
777
  descending: !1
778
778
  });
779
- F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await h.readPremium(), await h.readLocations();
779
+ b.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await C.readPremium(), await C.readLocations();
780
780
  }), (a, o) => {
781
- const d = b("FmPill"), P = b("FmPageHead"), D = b("FmIcon"), N = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), G = b("FmButton"), te = b("FmCard");
781
+ const u = F("FmPill"), P = F("FmPageHead"), D = F("FmIcon"), N = F("FmMenuItem"), V = F("FmMenu"), j = F("FmListItem"), q = F("FmList"), G = F("FmButton"), te = F("FmCard");
782
782
  return p(), k(O, null, [
783
783
  r(P, {
784
784
  title: "Segments",
@@ -786,41 +786,41 @@ const Ct = {
786
786
  "onClick:action": o[0] || (o[0] = (M) => U(M))
787
787
  }, {
788
788
  title: E(() => [
789
- l("div", kt, [
790
- l("span", It, $(t(x)("connect.loyalty.segment.title")), 1),
791
- r(d, { variant: "premium" })
789
+ i("div", It, [
790
+ i("span", Mt, R(t(x)("connect.loyalty.segment.title")), 1),
791
+ r(u, { variant: "premium" })
792
792
  ])
793
793
  ]),
794
794
  _: 1
795
795
  }, 8, ["actions"]),
796
- l("div", Mt, [
797
- t(C).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
798
- r(be, {
796
+ i("div", Tt, [
797
+ t(h).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
798
+ r(Fe, {
799
799
  loading: t(c).isLoading,
800
- "row-data": t(C),
800
+ "row-data": t(h),
801
801
  "row-count": t(c).totalRows,
802
- "column-defs": i,
802
+ "column-defs": s,
803
803
  "shrink-at": !1,
804
804
  "page-count": t(c).pageCount,
805
805
  "page-index": t(c).pageIndex,
806
806
  "page-size": t(c).pageSize,
807
807
  onRowClick: o[1] || (o[1] = (M) => {
808
- u(M.original);
808
+ d(M.original);
809
809
  }),
810
810
  onPageChange: t(A)
811
811
  }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
812
812
  r(q, { class: "w-full hidden xs:block" }, {
813
813
  default: E(() => [
814
- (p(!0), k(O, null, ie(t(C), (M) => (p(), J(j, {
814
+ (p(!0), k(O, null, ie(t(h), (M) => (p(), J(j, {
815
815
  key: M._id.toString(),
816
816
  tag: "label",
817
- onClick: (Q) => u(M)
817
+ onClick: (Q) => d(M)
818
818
  }, {
819
819
  default: E(() => [
820
- l("div", null, [
821
- l("div", Tt, $((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
822
- l("div", Et, $(M.name), 1),
823
- l("div", At, $(((M.memberCount ?? 0) * 100 / t(F)).toFixed(2)) + "% of customers ", 1)
820
+ i("div", null, [
821
+ i("div", Et, R((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
822
+ i("div", At, R(M.name), 1),
823
+ i("div", Dt, R(((M.memberCount ?? 0) * 100 / t(b)).toFixed(2)) + "% of customers ", 1)
824
824
  ])
825
825
  ]),
826
826
  append: E(() => [
@@ -849,25 +849,25 @@ const Ct = {
849
849
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
850
850
  }, {
851
851
  default: E(() => [
852
- o[3] || (o[3] = l("img", {
852
+ o[3] || (o[3] = i("img", {
853
853
  src: Ee,
854
854
  class: "aspect-square w-[150px]"
855
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. ")
856
+ o[4] || (o[4] = i("div", { class: "flex flex-col gap-16 text-center" }, [
857
+ i("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
858
+ i("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
859
  ], -1)),
860
860
  r(G, {
861
861
  variant: "primary",
862
862
  label: "Create segment",
863
- disabled: !t(h).isPremium,
863
+ disabled: !t(C).isPremium,
864
864
  icon: "add",
865
- onClick: o[2] || (o[2] = (M) => u())
865
+ onClick: o[2] || (o[2] = (M) => d())
866
866
  }, null, 8, ["disabled"])
867
867
  ]),
868
868
  _: 1
869
869
  })),
870
- r(Ft, {
870
+ r(ht, {
871
871
  ref_key: "sheetRef",
872
872
  ref: n,
873
873
  "onUpdate:modelValue": I
@@ -878,5 +878,5 @@ const Ct = {
878
878
  }
879
879
  });
880
880
  export {
881
- uo as default
881
+ po as default
882
882
  };