@feedmepos/mf-connect 0.1.0-beta.81 → 0.1.0-beta.83

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 (89) hide show
  1. package/dist/{Analytic-C9JWdPcg.js → Analytic-Cibsck1I.js} +13 -13
  2. package/dist/{App-BVEfQEjU.js → App-SoAq8GOG.js} +6 -6
  3. package/dist/{AuditLogs-qbqxB_Oz.js → AuditLogs-DA_mWKzc.js} +9 -9
  4. package/dist/{Bin-DPfStHeL.js → Bin-xS1gq6Ef.js} +8 -8
  5. package/dist/{Broadcast-CrQZDeiZ.js → Broadcast-B4_G3Nxl.js} +9 -9
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Fpcw9NWs.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cdvzy8SW.js} +6 -6
  7. package/dist/{Card-d7rnO53X.js → Card-k37p6E9f.js} +16 -16
  8. package/dist/{Collections-5rEy2lvX.js → Collections-BiCsEdHI.js} +6 -6
  9. package/dist/{Credit-CHyEsV7R.js → Credit-BmH_1y4-.js} +9 -9
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CLqubY_R.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-hTew1on4.js} +29 -29
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DEmIYpS6.js → EffectSheet.vue_vue_type_style_index_0_lang-D66o4jLh.js} +6 -6
  12. package/dist/{Experience-DhDLyUFN.js → Experience-DWCOxkKu.js} +9 -9
  13. package/dist/{Game-CoOZBnN-.js → Game-DvnIVWoe.js} +10 -10
  14. package/dist/{Index-BxzvptzX.js → Index-BburQLx3.js} +10 -10
  15. package/dist/{Marketing-CwxJ5Upf.js → Marketing-6gOsFqD0.js} +6 -6
  16. package/dist/{Member-D1SRjLZd.js → Member-DsaeuO7g.js} +10 -10
  17. package/dist/{MemberList-C-8mcfuk.js → MemberList-BQbjU034.js} +25 -25
  18. package/dist/{MemberTransactions-C7uwJdn8.js → MemberTransactions-CL2MjorK.js} +1 -1
  19. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-ChQ3zuj7.js → MessageInput.vue_vue_type_script_setup_true_lang-CK19Rthj.js} +136 -128
  20. package/dist/{Mission-CtF_zohU.js → Mission-CWffZPBc.js} +10 -10
  21. package/dist/{Overview-g9HqRUmv.js → Overview-D5XuLyMY.js} +18 -18
  22. package/dist/{Point-BrifiJTO.js → Point-CZu6bfKl.js} +9 -9
  23. package/dist/{Promotion-D-VpO9Y1.js → Promotion-Bu0iaUjf.js} +10 -10
  24. package/dist/{Queue-V6tLLO52.js → Queue-TxsPN8pg.js} +10 -10
  25. package/dist/{Record-C_eSy9Pl.js → Record-ByXR_2W8.js} +8 -8
  26. package/dist/{Reward-BcS5W2o6.js → Reward-DVhbmwtO.js} +15 -15
  27. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B_g46hrr.js → RewardGroup.vue_vue_type_script_setup_true_lang-yrRqQFP5.js} +11 -11
  28. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CFvxrx8L.js → RuleGroup.vue_vue_type_script_setup_true_lang-eV4cGyPO.js} +13 -13
  29. package/dist/{Segment-B7JtvneQ.js → Segment-CEaCc68W.js} +219 -217
  30. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BX-E0sDn.js → SelectItems.vue_vue_type_script_setup_true_lang-DsMoG__V.js} +2 -2
  31. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPByAnL2.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-KCFSf3iO.js} +24 -24
  32. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DE7ROhd5.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bhd9c8Fj.js} +3 -3
  33. package/dist/{Setting-1KOQwRHn.js → Setting-BZIexU1r.js} +11 -11
  34. package/dist/{Store-Dj84K8ZK.js → Store-D4nW0QZw.js} +20 -20
  35. package/dist/{StoreRewards-7rXn3J0B.js → StoreRewards-mlbS9GMt.js} +13 -13
  36. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D7zdyg9d.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BUmnBgzt.js} +19 -19
  37. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D6T7vFXj.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CHDdwrgb.js} +1 -1
  38. package/dist/{Tier-CwS_A8F5.js → Tier-BwrWurfH.js} +20 -20
  39. package/dist/{Title-YAj_vykl.js → Title-PrHbpiRu.js} +19 -19
  40. package/dist/{Transaction-CvbHHpIT.js → Transaction-5Tf08q5c.js} +2 -2
  41. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CYXM679D.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BAMDhiVR.js} +6 -6
  42. package/dist/{Voucher-C0V9koK8.js → Voucher-C9b6l8Nz.js} +12 -12
  43. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DwfF_8uQ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CVKmmjgI.js} +10 -10
  44. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D3mmtmvI.js → ZodTextField.vue_vue_type_script_setup_true_lang-C_pkz5HN.js} +1 -1
  45. package/dist/{app-TANcLG-R.js → app-BYPSPDqq.js} +1 -1
  46. package/dist/{app-D5BiHqr1.js → app-CF6qrgbf.js} +31 -31
  47. package/dist/app.js +1 -1
  48. package/dist/{business-DxNWLRXa.js → business-mXwIv1Tk.js} +1 -1
  49. package/dist/{campaign-DhEbMRyc.js → campaign-3ZIlabCM.js} +2 -2
  50. package/dist/{campaign-DqFW5qoE.js → campaign-BRtfNz4N.js} +9 -9
  51. package/dist/{campaign.enum-DGpeHkL2.js → campaign.enum-CynkbMYa.js} +1 -1
  52. package/dist/{campaign.fn-BqP9eKCL.js → campaign.fn-Drbvc3as.js} +79 -79
  53. package/dist/{collectible.enum-CSFqER3H.js → collectible.enum-C2OtYUr8.js} +1 -1
  54. package/dist/{collection.fn-CA112Q3U.js → collection.fn-B-8JrHXm.js} +2 -2
  55. package/dist/{dto-UeacqOxr.js → dto-DafJD1UU.js} +4 -4
  56. package/dist/{effect-CEB8v8KY.js → effect-DelgHXLV.js} +1 -1
  57. package/dist/{email-addresses-DLDeL77c.js → email-addresses-DJOQGvhY.js} +1 -1
  58. package/dist/{export-B_8_zEGl.js → export-B5zyYKA4.js} +3 -3
  59. package/dist/{helper-BN4JZQLv.js → helper-CZ5y5f8x.js} +1 -1
  60. package/dist/{index-B-WW-LtM.js → index-BGgGjSMf.js} +1 -1
  61. package/dist/{index-Dtvx0B0f.js → index-BLJQJJpG.js} +1 -1
  62. package/dist/{index-Cv54KpqR.js → index-C1TFVEid.js} +1 -1
  63. package/dist/{index-D-9zLobO.js → index-C27FGDKl.js} +6 -6
  64. package/dist/{index-CsU66Lo8.js → index-C5gy-Mrl.js} +9 -3
  65. package/dist/{index-BOQonmqm.js → index-CdzKALkl.js} +1 -1
  66. package/dist/{index-DLEuoM6n.js → index-D6iARrXd.js} +1 -1
  67. package/dist/{index-B-O8sm9u.js → index-DIj1y1ql.js} +3 -3
  68. package/dist/{index-Csb4GQq-.js → index-DOHEErmn.js} +11462 -10984
  69. package/dist/{index-CjJOf_Ko.js → index-DtY7OWdm.js} +4 -4
  70. package/dist/{index-CboHpXNN.js → index-NmKUUV-n.js} +2 -2
  71. package/dist/index-m_sYTNL4.js +32260 -0
  72. package/dist/{index-DX1pCi2M.js → index-pB_UPDXB.js} +1 -1
  73. package/dist/{index.esm2017-B8lg2TL9.js → index.esm2017-Dz5wgmrr.js} +1 -1
  74. package/dist/{loading-C7yV_Gjh.js → loading-CDyMmWrV.js} +1 -1
  75. package/dist/{membership-DVqBNqdx.js → membership-CzWcmaRa.js} +3 -3
  76. package/dist/{money-DlG5z_tl.js → money-CSkaYOR8.js} +1 -1
  77. package/dist/{number-CEbwCzov.js → number-Ba8nXwRs.js} +1 -1
  78. package/dist/{objectid-Du3yg6Vv.js → objectid-C6acOwBF.js} +12 -12
  79. package/dist/{plugins-D_RKZlC6.js → plugins-D4DLyZOD.js} +2 -2
  80. package/dist/{reward-Bv14VitO.js → reward-JNYFh1VU.js} +1 -1
  81. package/dist/{rule-BR5ZUIKH.js → rule-Rb07vcPX.js} +3 -3
  82. package/dist/{rule-builder-CITle0qo.js → rule-builder-BZhVDn3O.js} +1 -1
  83. package/dist/{template-ybPO7TWN.js → template-BnIs2YDg.js} +4 -4
  84. package/dist/{trigger-5C6n0ORq.js → trigger-CKGpvx3W.js} +4 -4
  85. package/dist/{user-CP3tloTS.js → user-JklnhTUu.js} +1 -1
  86. package/dist/{vue-i18n-DGew8_SZ.js → vue-i18n-6805g0Ok.js} +201 -201
  87. package/dist/{xlsx-CsBnmxHp.js → xlsx-_pkp206G.js} +1 -1
  88. package/package.json +2 -2
  89. package/dist/index-wwxalEHE.js +0 -29566
@@ -1,40 +1,42 @@
1
- import { defineComponent as ee, ref as z, resolveComponent as F, 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 D, normalizeClass as re, onMounted as Se, computed as ce, isRef as Me, createSlots as Ie, h as Y, onBeforeMount as Te } from "vue";
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";
2
2
  import { _ as Ee } from "./campaign-CpzFl8Vr.js";
3
- import { p as $e } from "./plugins-D_RKZlC6.js";
4
- import { u as Ae } from "./loading-C7yV_Gjh.js";
5
- import { FmButtonVariant as ne, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
6
- import { u as we, _ as Fe } from "./usePagination-BeF5K3M7.js";
7
- import { u as he } from "./vue-i18n-DGew8_SZ.js";
8
- import "./index-D-9zLobO.js";
9
- import { i as De, j as R, c as fe } from "./index-CjJOf_Ko.js";
10
- import "./index-CboHpXNN.js";
11
- import "./index-Cv54KpqR.js";
12
- import "./index-B-O8sm9u.js";
13
- import { u as ae, w as be } from "./xlsx-CsBnmxHp.js";
14
- import { e as Pe, M as Ne } from "./email-addresses-DLDeL77c.js";
15
- import { Z as Be } from "./zod-Bg2FbC-D.js";
3
+ import { p as Ae } from "./plugins-D4DLyZOD.js";
4
+ import { u as De } from "./loading-CDyMmWrV.js";
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-6805g0Ok.js";
8
+ import "./index-C27FGDKl.js";
9
+ import { i as $e, j as R, c as fe } from "./index-DtY7OWdm.js";
10
+ import "./index-NmKUUV-n.js";
11
+ import "./index-C1TFVEid.js";
12
+ import "./index-DIj1y1ql.js";
13
+ import { u as ne, w as he } from "./xlsx-_pkp206G.js";
14
+ import { e as Pe, M as Be } from "./email-addresses-DJOQGvhY.js";
15
+ import { Z as Ne } from "./zod-Bg2FbC-D.js";
16
16
  import { u as Ve } from "./app-wDQR6dpb.js";
17
- import { F as ye, z as Ye } from "./index-wwxalEHE.js";
18
- import { R as ge } from "./rule-builder-CITle0qo.js";
19
- import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-D3mmtmvI.js";
20
- import { _ as Ue } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CFvxrx8L.js";
21
- import { u as ze, v as Oe, w as je } from "./index.esm2017-B8lg2TL9.js";
17
+ import { F as ye, z as Ye } from "./index-m_sYTNL4.js";
18
+ import { R as ge } from "./rule-builder-BZhVDn3O.js";
19
+ import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-C_pkz5HN.js";
20
+ import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-eV4cGyPO.js";
21
+ import { u as ze, v as Oe, w as je } from "./index.esm2017-Dz5wgmrr.js";
22
22
  import { F as qe } from "./FileSaver.min-NlMItPOc.js";
23
- import { h as G } from "./moment-BWErdI6_.js";
24
- import { s as N, u as He } from "./membership-DVqBNqdx.js";
25
- import { o as Ge } from "./objectId-dwaoBfJX.js";
26
- import { u as Ce } from "./business-DxNWLRXa.js";
27
- import { f as Je } from "./number-CEbwCzov.js";
28
- import { t as Qe } from "./money-DlG5z_tl.js";
29
- import "./index-DX1pCi2M.js";
23
+ import { h as H } from "./moment-BWErdI6_.js";
24
+ import { s as B, u as Ge } from "./membership-CzWcmaRa.js";
25
+ import { o as He } from "./objectId-dwaoBfJX.js";
26
+ import { u as Ce } from "./business-mXwIv1Tk.js";
27
+ import { f as Je } from "./number-Ba8nXwRs.js";
28
+ import { t as Qe } from "./money-CSkaYOR8.js";
29
+ import "./index-pB_UPDXB.js";
30
30
  import { useRouter as We } from "vue-router";
31
- import { m as ve } from "./index-Dtvx0B0f.js";
32
- import { R as _e } from "./app-D5BiHqr1.js";
33
- const Ze = De.extend({
31
+ import { m as ve } from "./index-BLJQJJpG.js";
32
+ import { R as _e } from "./app-CF6qrgbf.js";
33
+ const Ze = $e.extend({
34
34
  _id: ye.optional(),
35
35
  business: ye.optional(),
36
36
  file: Ye.any().nullish()
37
- }), Ke = { class: "flex flex-col space-y-16" }, Xe = {
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
40
  key: 0,
39
41
  class: /* @__PURE__ */ re([
40
42
  "p-16 pl-24 space-x-8",
@@ -42,21 +44,21 @@ const Ze = De.extend({
42
44
  "flex items-center",
43
45
  "justify-between"
44
46
  ])
45
- }, et = { class: "flex justify-end" }, tt = {
47
+ }, tt = { class: "flex justify-end" }, ot = {
46
48
  key: 1,
47
49
  class: /* @__PURE__ */ re([
48
50
  "flex items-center",
49
51
  "border border-fm-color-neutral-gray-300",
50
52
  "p-16 space-x-16 rounded-md"
51
53
  ])
52
- }, ot = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, nt = /* @__PURE__ */ ee({
54
+ }, at = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, nt = /* @__PURE__ */ ee({
53
55
  __name: "ImportSegment",
54
56
  props: {
55
57
  importFile: {}
56
58
  },
57
59
  emits: ["update:file"],
58
60
  setup(e, { emit: _ }) {
59
- const x = e, b = _, { t: m } = he(), y = z(null), f = z(null), h = ["Id"], i = [
61
+ const x = e, h = _, { t: m } = Fe(), y = z(null), f = z(null), F = ["Id"], i = [
60
62
  {
61
63
  label: "CSV",
62
64
  icon: "csv",
@@ -68,10 +70,10 @@ const Ze = De.extend({
68
70
  value: "xlsx"
69
71
  }
70
72
  ];
71
- async function a() {
73
+ async function n() {
72
74
  if (x.importFile)
73
75
  try {
74
- const S = ze(), g = Oe(S, x.importFile), w = await je(g);
76
+ const S = ze(void 0, Ke.importFilesBucketUrl), g = Oe(S, x.importFile), w = await je(g);
75
77
  window.open(w, "_blank");
76
78
  } catch (S) {
77
79
  console.log(S);
@@ -80,39 +82,39 @@ const Ze = De.extend({
80
82
  async function c(S) {
81
83
  switch (S) {
82
84
  case "csv":
83
- const g = new Blob([h.join(",")], {
85
+ const g = new Blob([F.join(",")], {
84
86
  type: "text/csv;charset=utf-8;"
85
87
  });
86
88
  qe.saveAs(g, "ImportSegmentTemplate.csv");
87
89
  break;
88
90
  case "xlsx":
89
- const w = ae.aoa_to_sheet([h]), M = ae.book_new();
90
- ae.book_append_sheet(M, w, "Sheet1"), be(M, "ImportSegmentTemplate.xlsx");
91
+ const w = ne.aoa_to_sheet([F]), I = ne.book_new();
92
+ ne.book_append_sheet(I, w, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
91
93
  break;
92
94
  }
93
95
  }
94
96
  function C(S) {
95
- y.value = S, b("update:file", y.value);
97
+ y.value = S, h("update:file", y.value);
96
98
  }
97
- function $(S) {
98
- var w, M;
99
- const g = ((M = (w = S.target) == null ? void 0 : w.files) == null ? void 0 : M[0]) ?? null;
99
+ function A(S) {
100
+ var w, I;
101
+ const g = ((I = (w = S.target) == null ? void 0 : w.files) == null ? void 0 : I[0]) ?? null;
100
102
  C(g);
101
103
  }
102
104
  return (S, g) => {
103
- const w = F("FmButton"), M = F("FmMenuItem"), u = F("FmMenu"), s = F("FmDropField");
104
- return p(), k("div", Ke, [
105
+ const w = b("FmButton"), I = b("FmMenuItem"), u = b("FmMenu"), s = b("FmDropField");
106
+ return p(), k("div", Xe, [
105
107
  g[2] || (g[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
106
- S.importFile ? (p(), k("div", Xe, [
108
+ S.importFile ? (p(), k("div", et, [
107
109
  r(w, {
108
110
  label: t(m)("View uploaded file"),
109
- variant: t(ne).Plain,
111
+ variant: t(ae).Plain,
110
112
  icon: "file_present",
111
- onClick: a
113
+ onClick: n
112
114
  }, null, 8, ["label", "variant"])
113
115
  ])) : le("", !0),
114
116
  l("div", null, [
115
- l("div", et, [
117
+ l("div", tt, [
116
118
  r(u, { class: "" }, {
117
119
  "menu-button": E(() => [
118
120
  r(w, {
@@ -122,30 +124,30 @@ const Ze = De.extend({
122
124
  })
123
125
  ]),
124
126
  default: E(() => [
125
- (p(), k(O, null, ie(i, (v) => r(M, {
127
+ (p(), k(O, null, ie(i, (v) => r(I, {
126
128
  key: v.value,
127
129
  icon: v.icon,
128
130
  label: v.label,
129
- onClick: (L) => c(v.value),
131
+ onClick: (U) => c(v.value),
130
132
  selectable: ""
131
133
  }, null, 8, ["icon", "label", "onClick"])), 64))
132
134
  ]),
133
135
  _: 1
134
136
  })
135
137
  ]),
136
- y.value ? (p(), k("div", tt, [
138
+ y.value ? (p(), k("div", ot, [
137
139
  r(w, {
138
- variant: t(ne).Tertiary,
140
+ variant: t(ae).Tertiary,
139
141
  "prepend-icon": "attach_file"
140
142
  }, null, 8, ["variant"]),
141
- l("p", ot, D(y.value.name), 1),
143
+ l("p", at, $(y.value.name), 1),
142
144
  l("label", {
143
145
  ref_key: "fileLabelRef",
144
146
  ref: f,
145
147
  htmlFor: "file"
146
148
  }, [
147
149
  r(w, {
148
- variant: t(ne).Plain,
150
+ variant: t(ae).Plain,
149
151
  label: t(m)("Replace File"),
150
152
  onClick: g[1] || (g[1] = () => {
151
153
  var v;
@@ -158,7 +160,7 @@ const Ze = De.extend({
158
160
  class: "hidden",
159
161
  type: "file",
160
162
  multiple: "",
161
- onChange: $
163
+ onChange: A
162
164
  }, null, 32)
163
165
  ], 512)
164
166
  ])) : (p(), J(s, {
@@ -171,7 +173,7 @@ const Ze = De.extend({
171
173
  ]);
172
174
  };
173
175
  }
174
- }), at = { class: "space-y-16 pr-12" }, st = { class: "fm-typo-en-title-md-800" }, lt = { class: "flex space-x-8" }, it = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, rt = { class: "text-fm-color-typo-secondary" }, ct = /* @__PURE__ */ ee({
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({
175
177
  __name: "ReviewSegment",
176
178
  props: {
177
179
  title: {},
@@ -181,57 +183,57 @@ const Ze = De.extend({
181
183
  const _ = e, x = [
182
184
  {
183
185
  header: "Name",
184
- accessorFn: (a) => a.name
186
+ accessorFn: (n) => n.name
185
187
  },
186
188
  {
187
189
  header: "Id",
188
- accessorFn: (a) => a._id
190
+ accessorFn: (n) => n._id
189
191
  },
190
192
  {
191
193
  header: "Customer Since",
192
- accessorFn: (a) => G(Ge(a._id.toString())).format("DD MMM YYYY")
194
+ accessorFn: (n) => H(He(n._id.toString())).format("DD MMM YYYY")
193
195
  },
194
196
  {
195
197
  header: "Phone",
196
- accessorFn: (a) => a.phoneNumber
198
+ accessorFn: (n) => n.phoneNumber
197
199
  },
198
200
  {
199
201
  header: "Birthday",
200
- accessorFn: (a) => G(a.birthday).format("DD MMM YYYY")
202
+ accessorFn: (n) => H(n.birthday).format("DD MMM YYYY")
201
203
  },
202
204
  {
203
205
  header: "Last Visit",
204
- accessorFn: (a) => G(a.stats.lastVisit).format("DD MMM YYYY")
206
+ accessorFn: (n) => H(n.stats.lastVisit).format("DD MMM YYYY")
205
207
  }
206
208
  ];
207
- async function b(a) {
208
- return _.segment._id ? (console.log(a), await N.paginateSegmentUsers(
209
+ async function h(n) {
210
+ return _.segment._id ? (console.log(n), await B.paginateSegmentUsers(
209
211
  _.segment._id,
210
- a
212
+ n
211
213
  )) : {
212
214
  resources: [],
213
215
  meta: {
214
216
  totalResources: 0,
215
217
  totalPages: 0,
216
- skip: a.skip,
217
- limit: a.limit,
218
- sortBy: a.sortBy
218
+ skip: n.skip,
219
+ limit: n.limit,
220
+ sortBy: n.sortBy
219
221
  }
220
222
  };
221
223
  }
222
- const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: h, onSearch: i } = we(b);
224
+ const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: F, onSearch: i } = we(h);
223
225
  return Se(async () => {
224
- await h();
225
- }), (a, c) => (p(), k("div", at, [
226
- l("div", st, D(_.title), 1),
227
- l("div", lt, [
228
- l("div", it, D(a.segment.members.length), 1),
229
- l("div", rt, [
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, [
230
232
  c[1] || (c[1] = l("div", null, "contacts in your segment", -1)),
231
- l("div", null, "as of " + D(t(G)(a.segment.lastUpdated).format("DD MMM YYYY")), 1)
233
+ l("div", null, "as of " + $(t(H)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
232
234
  ])
233
235
  ]),
234
- r(Fe, {
236
+ r(be, {
235
237
  loading: t(m).isLoading,
236
238
  "row-data": t(y),
237
239
  "row-count": t(m).totalRows,
@@ -240,11 +242,11 @@ const Ze = De.extend({
240
242
  "page-count": t(m).pageCount,
241
243
  "page-index": t(m).pageIndex,
242
244
  onSortChange: t(f),
243
- onPageChange: c[0] || (c[0] = (C) => t(h)({ pageSize: C.pageSize, pageIndex: C.pageIndex }))
245
+ onPageChange: c[0] || (c[0] = (C) => t(F)({ pageSize: C.pageSize, pageIndex: C.pageIndex }))
244
246
  }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
245
247
  ]));
246
248
  }
247
- }), dt = { class: "space-y-24" }, ut = { class: "grid grid-cols-2 gap-16" }, pt = { class: "fm-typo-en-title-sm-800" }, mt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ft = /* @__PURE__ */ ee({
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({
248
250
  __name: "SegmentTypeOption",
249
251
  props: {
250
252
  modelValue: {},
@@ -252,7 +254,7 @@ const Ze = De.extend({
252
254
  },
253
255
  emits: ["update:model-value"],
254
256
  setup(e, { emit: _ }) {
255
- const x = e, b = _, m = [
257
+ const x = e, h = _, m = [
256
258
  {
257
259
  label: "Dynamic",
258
260
  sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
@@ -265,12 +267,12 @@ const Ze = De.extend({
265
267
  }
266
268
  ];
267
269
  function y(f) {
268
- f !== x.modelValue && b("update:model-value", f);
270
+ f !== x.modelValue && h("update:model-value", f);
269
271
  }
270
- return (f, h) => {
271
- const i = F("FmCard"), a = F("FmHelperText");
272
- return p(), k("div", dt, [
273
- l("div", ut, [
272
+ return (f, F) => {
273
+ const i = b("FmCard"), n = b("FmHelperText");
274
+ return p(), k("div", ut, [
275
+ l("div", pt, [
274
276
  (p(), k(O, null, ie(m, (c) => r(i, {
275
277
  variant: "outlined",
276
278
  class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
@@ -282,13 +284,13 @@ const Ze = De.extend({
282
284
  key: c.value
283
285
  }, {
284
286
  default: E(() => [
285
- l("div", pt, D(c.label), 1),
286
- l("div", mt, D(c.sublabel), 1)
287
+ l("div", mt, $(c.label), 1),
288
+ l("div", ft, $(c.sublabel), 1)
287
289
  ]),
288
290
  _: 2
289
291
  }, 1032, ["class", "onClick"])), 64))
290
292
  ]),
291
- f.errorText ? (p(), J(a, {
293
+ f.errorText ? (p(), J(n, {
292
294
  key: 0,
293
295
  class: "!mt-4",
294
296
  text: f.errorText,
@@ -297,30 +299,30 @@ const Ze = De.extend({
297
299
  ]);
298
300
  };
299
301
  }
300
- }), yt = { class: "flex items-center gap-x-8" }, gt = {
302
+ }), gt = { class: "flex items-center gap-x-8" }, vt = {
301
303
  key: 0,
302
304
  class: "space-y-16 pr-12"
303
- }, vt = { class: "flex flex-col space-y-16" }, _t = {
305
+ }, _t = { class: "flex flex-col space-y-16" }, xt = {
304
306
  key: 0,
305
307
  class: "flex flex-col space-y-16"
306
- }, xt = {
308
+ }, St = {
307
309
  key: 1,
308
310
  class: "flex flex-col space-y-16"
309
- }, St = {
311
+ }, wt = {
310
312
  key: 2,
311
313
  class: "flex flex-col space-y-16"
312
- }, wt = { class: "flex items-center gap-8" }, Ft = /* @__PURE__ */ ee({
314
+ }, bt = { class: "flex items-center gap-8" }, Ft = /* @__PURE__ */ ee({
313
315
  __name: "SegmentSheet",
314
316
  emits: ["update:model-value"],
315
317
  setup(e, { expose: _, emit: x }) {
316
- const b = Ve(), m = z(!1), y = z(!1), f = {
318
+ const h = Ve(), m = z(!1), y = z(!1), f = {
317
319
  name: "",
318
320
  isActive: !0,
319
321
  type: R.enum.DYNAMIC,
320
322
  rule: ge.scaffoldGroup(),
321
323
  members: []
322
- }, h = Ze, i = z(f), a = ce(() => {
323
- const u = h.safeParse(i.value);
324
+ }, F = Ze, i = z(f), n = ce(() => {
325
+ const u = F.safeParse(i.value);
324
326
  return u.success ? [] : u.error.errors;
325
327
  });
326
328
  function c(u) {
@@ -333,42 +335,42 @@ const Ze = De.extend({
333
335
  function C() {
334
336
  m.value = !1;
335
337
  }
336
- async function $() {
337
- h.safeParse(i.value).success && (y.value = !0);
338
+ async function A() {
339
+ F.safeParse(i.value).success && (y.value = !0);
338
340
  }
339
341
  function S() {
340
342
  y.value = !1;
341
343
  }
342
344
  async function g() {
343
- i.value.type === R.enum.STATIC ? (i.value.rule = ge.scaffoldGroup(), i.value.isActive = !0) : i.value.file = void 0, M("update:model-value", i.value);
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);
344
346
  }
345
347
  async function w(u) {
346
348
  i.value.type = u;
347
349
  }
348
350
  Se(async () => {
349
351
  });
350
- const M = x;
352
+ const I = x;
351
353
  return _({
352
354
  showSheet: c,
353
355
  hideSheet: C
354
356
  }), (u, s) => {
355
- const v = F("FmButton"), L = F("FmSwitch"), n = F("FmSideSheet");
356
- return p(), J(n, {
357
+ const v = b("FmButton"), U = b("FmSwitch"), a = b("FmSideSheet");
358
+ return p(), J(a, {
357
359
  modelValue: t(m),
358
- "onUpdate:modelValue": s[8] || (s[8] = (o) => Me(m) ? m.value = o : null),
360
+ "onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(m) ? m.value = o : null),
359
361
  header: "Add segment",
360
362
  "dismiss-away": "",
361
363
  "close-button": !0,
362
364
  "max-width": 1100
363
- }, Ie({
365
+ }, Me({
364
366
  "side-sheet-footer": E(() => [
365
- l("div", wt, [
367
+ l("div", bt, [
366
368
  t(y) || t(i).type === t(R).enum.STATIC ? (p(), k(O, { key: 0 }, [
367
369
  r(v, {
368
370
  label: "Save Segment",
369
371
  onClick: g,
370
- loading: t(b).isLoading,
371
- disabled: t(a).length > 0 || t(b).isLoading
372
+ loading: t(h).isLoading,
373
+ disabled: t(n).length > 0 || t(h).isLoading
372
374
  }, null, 8, ["loading", "disabled"]),
373
375
  r(v, {
374
376
  label: "Cancel",
@@ -378,8 +380,8 @@ const Ze = De.extend({
378
380
  ], 64)) : (p(), k(O, { key: 1 }, [
379
381
  r(v, {
380
382
  label: "Review Segment",
381
- disabled: t(a).length > 0 || t(b).isLoading,
382
- onClick: $
383
+ disabled: t(n).length > 0 || t(h).isLoading,
384
+ onClick: A
383
385
  }, null, 8, ["disabled"]),
384
386
  r(v, {
385
387
  label: "Cancel",
@@ -392,29 +394,29 @@ const Ze = De.extend({
392
394
  default: E(() => {
393
395
  var o;
394
396
  return [
395
- t(y) ? (p(), J(ct, {
397
+ t(y) ? (p(), J(dt, {
396
398
  key: 1,
397
399
  title: t(i).name,
398
400
  segment: t(i)
399
- }, null, 8, ["title", "segment"])) : (p(), k("div", gt, [
400
- r(Le, {
401
+ }, null, 8, ["title", "segment"])) : (p(), k("div", vt, [
402
+ r(Ue, {
401
403
  modelValue: t(i).name,
402
404
  "onUpdate:modelValue": s[1] || (s[1] = (d) => t(i).name = d),
403
405
  label: "Segment title",
404
- schema: t(Be).typeAtPath(t(h), "name")
406
+ schema: t(Ne).typeAtPath(t(F), "name")
405
407
  }, null, 8, ["modelValue", "schema"]),
406
- l("div", vt, [
408
+ l("div", _t, [
407
409
  s[10] || (s[10] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1)),
408
- r(ft, {
410
+ r(yt, {
409
411
  "model-value": t(i).type,
410
412
  "onUpdate:modelValue": s[2] || (s[2] = (d) => {
411
413
  w(d);
412
414
  })
413
415
  }, null, 8, ["model-value"])
414
416
  ]),
415
- t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", _t, [
417
+ t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", xt, [
416
418
  s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
417
- r(Ue, {
419
+ r(Le, {
418
420
  "trigger-type": "MEMBERSHIP_JOINED",
419
421
  includeOnly: "user",
420
422
  "model-value": (o = t(i)) == null ? void 0 : o.rule,
@@ -422,7 +424,7 @@ const Ze = De.extend({
422
424
  t(i).rule = d;
423
425
  })
424
426
  }, null, 8, ["model-value"])
425
- ])) : (p(), k("div", xt, [
427
+ ])) : (p(), k("div", St, [
426
428
  r(nt, {
427
429
  importFile: t(i).importFile,
428
430
  "onUpdate:file": s[4] || (s[4] = (d) => {
@@ -430,9 +432,9 @@ const Ze = De.extend({
430
432
  })
431
433
  }, null, 8, ["importFile"])
432
434
  ])),
433
- t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", St, [
435
+ t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", wt, [
434
436
  s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
435
- r(L, {
437
+ r(U, {
436
438
  "model-value": t(i).isActive ?? !0,
437
439
  "onUpdate:modelValue": s[5] || (s[5] = (d) => t(i).isActive = d),
438
440
  label: "Active",
@@ -448,7 +450,7 @@ const Ze = De.extend({
448
450
  t(y) ? {
449
451
  name: "side-sheet-header",
450
452
  fn: E(() => [
451
- l("div", yt, [
453
+ l("div", gt, [
452
454
  r(v, {
453
455
  icon: "arrow_back",
454
456
  variant: "tertiary",
@@ -462,57 +464,57 @@ const Ze = De.extend({
462
464
  ]), 1032, ["modelValue"]);
463
465
  };
464
466
  }
465
- }), xe = He(), ht = Ce();
467
+ }), xe = Ge(), ht = Ce();
466
468
  function se(e) {
467
- const _ = G(e);
469
+ const _ = H(e);
468
470
  return _.isValid() ? _.format("DD/MM/YYYY") : "";
469
471
  }
470
- const bt = {
472
+ const Ct = {
471
473
  mapMemberExportRow: (e) => {
472
- var a, c, C, $, S, g, w, M, u, s, v, L, n, o, d, P, A, B, V, j, q, H, te, I, Q, de, ue, pe;
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;
473
475
  const _ = ce(() => ht.locations.map((T) => ({
474
476
  label: T.name,
475
477
  value: T._id
476
- }))), x = (a = Pe.parseOneAddress(
478
+ }))), x = (n = Pe.parseOneAddress(
477
479
  e == null ? void 0 : e.email
478
- )) != null && a.domain.includes("feedmepos.com") ? void 0 : e.email, b = (C = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : C.reduce(
479
- (T, U) => {
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(
481
+ (T, L) => {
480
482
  var Z, K;
481
483
  const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
482
- (oe) => oe._id === U.collectible
484
+ (oe) => oe._id === L.collectible
483
485
  )) == null ? void 0 : K.name;
484
- return !W || U.balance <= 0 || T.push(W), T;
486
+ return !W || L.balance <= 0 || T.push(W), T;
485
487
  },
486
488
  []
487
489
  ), m = (xe.sortedTitles || []).reduce(
488
- (T, U) => {
490
+ (T, L) => {
489
491
  var Z, K, oe, me;
490
492
  const W = (me = (oe = (K = (((Z = e == null ? void 0 : e.collection) == null ? void 0 : Z.TITLE) || []).find(
491
- (ke) => ke.collectible === U._id
493
+ (ke) => ke.collectible === L._id
492
494
  )) == null ? void 0 : K.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : me.expiredAt;
493
- return T[U.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
495
+ return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
494
496
  },
495
497
  {}
496
- ), y = ((g = (S = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : S.at(0)) == null ? void 0 : g.balance) || 0, f = ((s = (u = (M = (w = e.collection) == null ? void 0 : w.CREDIT) == null ? void 0 : M.at(0)) == null ? void 0 : u.expiryBalance) == null ? void 0 : s.reduce(
497
- (T, U) => T + U.amount,
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(
499
+ (T, L) => T + L.amount,
498
500
  0
499
- )) || 0, h = Je(y, 2);
501
+ )) || 0, F = Je(y, 2);
500
502
  return {
501
503
  ID: e._id.toString(),
502
504
  Name: ((v = e.name) == null ? void 0 : v.trim()) || "",
503
- Phone: ((L = e == null ? void 0 : e.phoneNumber) == null ? void 0 : L.trim()) || "",
505
+ Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
504
506
  Email: x || "",
505
507
  Gender: e.gender || "",
506
508
  CardNo: e.cardNo || "",
507
509
  Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
508
- Credit: parseFloat((Number(h) - Number(f)).toFixed(2)),
510
+ Credit: parseFloat((Number(F) - Number(f)).toFixed(2)),
509
511
  FreeCredit: Number(f.toFixed(2)),
510
- TotalCredit: Number(h),
511
- Exp: e != null && e.collection ? ((d = (o = (n = e.collection) == null ? void 0 : n.POINT) == null ? void 0 : o.at(0)) == null ? void 0 : d.balance) ?? 0 : 0,
512
- 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,
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,
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,
513
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,
514
- Tier: e != null && e.collection ? ((I = (te = (H = e.collection) == null ? void 0 : H.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : I.balance) ?? 0 : 0,
515
- Titles: b.join(","),
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(","),
516
518
  ...m,
517
519
  TotalTransaction: e.stats.visitCount,
518
520
  AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
@@ -530,21 +532,21 @@ const bt = {
530
532
  )}`
531
533
  };
532
534
  }
533
- }, Ct = { class: "flex items-center" }, kt = { 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" }, It = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Tt = { class: "fm-typo-en-body-md-600" }, Et = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, co = /* @__PURE__ */ ee({
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({
534
536
  __name: "Segment",
535
537
  setup(e) {
536
- const { minor: _ } = Ae, { t: x } = he(), b = Ce(), { mapMemberExportRow: m } = bt, y = Re(), f = We(), h = z(0), i = [
538
+ const { minor: _ } = De, { t: x } = Fe(), h = Ce(), { mapMemberExportRow: m } = Ct, y = Re(), f = We(), F = z(0), i = [
537
539
  {
538
540
  header: x("connect.loyalty.segment.table.name"),
539
- accessorFn: (n) => n.name
541
+ accessorFn: (a) => a.name
540
542
  },
541
543
  {
542
544
  header: x("connect.loyalty.segment.table.status"),
543
545
  enableSorting: !1,
544
- cell(n) {
545
- const o = n.row.original.isActive === !1 ? "Inactive" : "Active";
546
+ cell(a) {
547
+ const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
546
548
  return Y(X.FmChip, {
547
- class: n.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",
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",
548
550
  label: o,
549
551
  compact: !0
550
552
  });
@@ -552,18 +554,18 @@ const bt = {
552
554
  },
553
555
  {
554
556
  header: x("connect.loyalty.segment.table.total_customers"),
555
- accessorFn: (n) => n.memberCount ?? 0
557
+ accessorFn: (a) => a.memberCount ?? 0
556
558
  },
557
559
  {
558
560
  header: x("connect.loyalty.segment.table.customer_percentage"),
559
- accessorFn: (n) => ((n.memberCount ?? 0) * 100 / h.value).toFixed(2)
561
+ accessorFn: (a) => ((a.memberCount ?? 0) * 100 / F.value).toFixed(2)
560
562
  },
561
563
  {
562
564
  header: x("connect.loyalty.segment.table.actions"),
563
565
  meta: {
564
566
  maxWidth: "100px"
565
567
  },
566
- cell(n) {
568
+ cell(a) {
567
569
  return Y("div", { class: "flex items-center justify-end" }, [
568
570
  Y(
569
571
  X.FmMenu,
@@ -584,7 +586,7 @@ const bt = {
584
586
  X.FmMenuItem,
585
587
  {
586
588
  onClick: async (o) => {
587
- o.stopPropagation(), w(n.row.original);
589
+ o.stopPropagation(), w(a.row.original);
588
590
  }
589
591
  },
590
592
  {
@@ -601,7 +603,7 @@ const bt = {
601
603
  X.FmMenuItem,
602
604
  {
603
605
  onClick: async (o) => {
604
- o.stopPropagation(), g(n.row.original);
606
+ o.stopPropagation(), g(a.row.original);
605
607
  }
606
608
  },
607
609
  {
@@ -620,63 +622,63 @@ const bt = {
620
622
  ]);
621
623
  }
622
624
  }
623
- ], a = z(null), { tableMeta: c, rowData: C, debouncedFetchData: $ } = we(
624
- N.readAll
625
+ ], n = z(null), { tableMeta: c, rowData: C, debouncedFetchData: A } = we(
626
+ B.readAll
625
627
  );
626
628
  async function S() {
627
629
  await _(
628
630
  async () => {
629
- await N.refreshSegments(), await $({ pageSize: 10, pageIndex: 0 });
631
+ await B.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
630
632
  },
631
633
  { message: "Refreshing segmentations" }
632
634
  );
633
635
  }
634
- async function g(n) {
635
- await $e.remove(`Are you sure you want to remove ${n.name}?`) && await _(
636
+ async function g(a) {
637
+ await Ae.remove(`Are you sure you want to remove ${a.name}?`) && await _(
636
638
  async () => {
637
- await N.delete(n._id), await $({ pageSize: 10, pageIndex: 0 });
639
+ await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
638
640
  },
639
641
  {
640
- message: `Removing ${n.name}`,
641
- successMessage: `Removed ${n.name} successfully`
642
+ message: `Removing ${a.name}`,
643
+ successMessage: `Removed ${a.name} successfully`
642
644
  }
643
645
  );
644
646
  }
645
- async function w(n) {
647
+ async function w(a) {
646
648
  const o = {
647
649
  sortBy: "_id",
648
650
  descending: !1,
649
651
  rowsPerPage: 1e3,
650
652
  page: 1,
651
653
  rowsNumber: 0
652
- }, d = new Ne(), P = (await ve.read({
654
+ }, d = new Be(), P = (await ve.read({
653
655
  limit: 1,
654
656
  skip: 0,
655
657
  sortBy: o.sortBy,
656
658
  descending: o.descending
657
- })).meta.totalResources ?? 0, A = o.rowsPerPage;
659
+ })).meta.totalResources ?? 0, D = o.rowsPerPage;
658
660
  await _(
659
661
  async () => {
660
- for (let B = 0; B < P; B += A) {
662
+ for (let N = 0; N < P; N += D) {
661
663
  const V = {
662
664
  ...o,
663
- limit: A,
665
+ limit: D,
664
666
  skip: o.page - 1,
665
667
  sortBy: o.sortBy,
666
668
  descending: o.descending
667
- }, j = await N.paginateSegmentUsers(
668
- n._id,
669
+ }, j = await B.paginateSegmentUsers(
670
+ a._id,
669
671
  V
670
672
  );
671
673
  for (const q of j.resources) {
672
- const H = m(q);
673
- d.addRecord(H);
674
+ const G = m(q);
675
+ d.addRecord(G);
674
676
  }
675
677
  o.page++;
676
678
  }
677
- await be(
679
+ await he(
678
680
  d.buildExcel(),
679
- `[${n.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
681
+ `[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
680
682
  {
681
683
  bookType: "xlsx",
682
684
  bookSST: !1,
@@ -690,20 +692,20 @@ const bt = {
690
692
  }
691
693
  );
692
694
  }
693
- async function M(n) {
695
+ async function I(a) {
694
696
  await _(
695
697
  async () => {
696
698
  var o;
697
- if (n.type === R.enum.STATIC) {
699
+ if (a.type === R.enum.STATIC) {
698
700
  const d = new FormData();
699
- if (d.append("file", n.file), n._id) {
700
- const { members: P, _id: A, file: B, ...V } = n;
701
- d.append("segment", JSON.stringify(V)), await N.updateStatic(n._id, d);
701
+ if (d.append("file", a.file), a._id) {
702
+ const { members: P, _id: D, file: N, ...V } = a;
703
+ d.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, d);
702
704
  } else {
703
- const { file: P, ...A } = n;
704
- d.append("segment", JSON.stringify(A)), await N.createStatic(d);
705
+ const { file: P, ...D } = a;
706
+ d.append("segment", JSON.stringify(D)), await B.createStatic(d);
705
707
  }
706
- n.file && y.open({
708
+ a.file && y.open({
707
709
  type: "info",
708
710
  title: "Import begins soon. Check Queue for updates.",
709
711
  action: "View",
@@ -714,12 +716,12 @@ const bt = {
714
716
  });
715
717
  }
716
718
  });
717
- } else if (n._id) {
718
- const { members: d, _id: P, ...A } = n;
719
- await N.update(n._id, A);
719
+ } else if (a._id) {
720
+ const { members: d, _id: P, ...D } = a;
721
+ await B.update(a._id, D);
720
722
  } else
721
- await N.create(n);
722
- await $({ pageSize: 10, pageIndex: 0 }), (o = a.value) == null || o.hideSheet();
723
+ await B.create(a);
724
+ await A({ pageSize: 10, pageIndex: 0 }), (o = n.value) == null || o.hideSheet();
723
725
  },
724
726
  {
725
727
  message: "Saving segment",
@@ -727,16 +729,16 @@ const bt = {
727
729
  }
728
730
  );
729
731
  }
730
- function u(n) {
732
+ function u(a) {
731
733
  var o;
732
- (o = a.value) == null || o.showSheet(n);
734
+ (o = n.value) == null || o.showSheet(a);
733
735
  }
734
736
  const s = {
735
737
  label: x("connect.navigation.queue"),
736
738
  value: "queue",
737
739
  isPrimary: !1,
738
740
  prependIcon: "work_history"
739
- }, v = ce(() => b.isPremium ? [
741
+ }, v = ce(() => h.isPremium ? [
740
742
  s,
741
743
  {
742
744
  label: "Refresh segments",
@@ -750,8 +752,8 @@ const bt = {
750
752
  prependIcon: "add"
751
753
  }
752
754
  ] : []);
753
- function L(n) {
754
- switch (n) {
755
+ function U(a) {
756
+ switch (a) {
755
757
  case "add":
756
758
  u();
757
759
  break;
@@ -767,25 +769,25 @@ const bt = {
767
769
  }
768
770
  }
769
771
  return Te(async () => {
770
- const { meta: n } = await ve.read({
772
+ const { meta: a } = await ve.read({
771
773
  limit: 1,
772
774
  skip: 0,
773
775
  sortBy: "_id",
774
776
  search: void 0,
775
777
  descending: !1
776
778
  });
777
- h.value = n.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await b.readPremium(), await b.readLocations();
778
- }), (n, o) => {
779
- const d = F("FmPill"), P = F("FmPageHead"), A = F("FmIcon"), B = F("FmMenuItem"), V = F("FmMenu"), j = F("FmListItem"), q = F("FmList"), H = F("FmButton"), te = F("FmCard");
779
+ F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await h.readPremium(), await h.readLocations();
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");
780
782
  return p(), k(O, null, [
781
783
  r(P, {
782
784
  title: "Segments",
783
785
  actions: t(v),
784
- "onClick:action": o[0] || (o[0] = (I) => L(I))
786
+ "onClick:action": o[0] || (o[0] = (M) => U(M))
785
787
  }, {
786
788
  title: E(() => [
787
- l("div", Ct, [
788
- l("span", kt, D(t(x)("connect.loyalty.segment.title")), 1),
789
+ l("div", kt, [
790
+ l("span", It, $(t(x)("connect.loyalty.segment.title")), 1),
789
791
  r(d, { variant: "premium" })
790
792
  ])
791
793
  ]),
@@ -793,7 +795,7 @@ const bt = {
793
795
  }, 8, ["actions"]),
794
796
  l("div", Mt, [
795
797
  t(C).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
796
- r(Fe, {
798
+ r(be, {
797
799
  loading: t(c).isLoading,
798
800
  "row-data": t(C),
799
801
  "row-count": t(c).totalRows,
@@ -802,35 +804,35 @@ const bt = {
802
804
  "page-count": t(c).pageCount,
803
805
  "page-index": t(c).pageIndex,
804
806
  "page-size": t(c).pageSize,
805
- onRowClick: o[1] || (o[1] = (I) => {
806
- u(I.original);
807
+ onRowClick: o[1] || (o[1] = (M) => {
808
+ u(M.original);
807
809
  }),
808
- onPageChange: t($)
810
+ onPageChange: t(A)
809
811
  }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
810
812
  r(q, { class: "w-full hidden xs:block" }, {
811
813
  default: E(() => [
812
- (p(!0), k(O, null, ie(t(C), (I) => (p(), J(j, {
813
- key: I._id.toString(),
814
+ (p(!0), k(O, null, ie(t(C), (M) => (p(), J(j, {
815
+ key: M._id.toString(),
814
816
  tag: "label",
815
- onClick: (Q) => u(I)
817
+ onClick: (Q) => u(M)
816
818
  }, {
817
819
  default: E(() => [
818
820
  l("div", null, [
819
- l("div", It, D((I.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
820
- l("div", Tt, D(I.name), 1),
821
- l("div", Et, D(((I.memberCount ?? 0) * 100 / t(h)).toFixed(2)) + "% of customers ", 1)
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)
822
824
  ])
823
825
  ]),
824
826
  append: E(() => [
825
827
  r(V, { "stop-click-propagation": !0 }, {
826
828
  "menu-button": E(() => [
827
- r(A, { name: "more_vert" })
829
+ r(D, { name: "more_vert" })
828
830
  ]),
829
831
  default: E(() => [
830
- r(B, {
832
+ r(N, {
831
833
  class: "text-fm-color-typo-error fm-typo-en-body-md-400",
832
834
  label: "Remove",
833
- "onUpdate:modelValue": (Q) => Q && g(I)
835
+ "onUpdate:modelValue": (Q) => Q && g(M)
834
836
  }, null, 8, ["onUpdate:modelValue"])
835
837
  ]),
836
838
  _: 2
@@ -855,20 +857,20 @@ const bt = {
855
857
  l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
856
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. ")
857
859
  ], -1)),
858
- r(H, {
860
+ r(G, {
859
861
  variant: "primary",
860
862
  label: "Create segment",
861
- disabled: !t(b).isPremium,
863
+ disabled: !t(h).isPremium,
862
864
  icon: "add",
863
- onClick: o[2] || (o[2] = (I) => u())
865
+ onClick: o[2] || (o[2] = (M) => u())
864
866
  }, null, 8, ["disabled"])
865
867
  ]),
866
868
  _: 1
867
869
  })),
868
870
  r(Ft, {
869
871
  ref_key: "sheetRef",
870
- ref: a,
871
- "onUpdate:modelValue": M
872
+ ref: n,
873
+ "onUpdate:modelValue": I
872
874
  }, null, 512)
873
875
  ])
874
876
  ], 64);
@@ -876,5 +878,5 @@ const bt = {
876
878
  }
877
879
  });
878
880
  export {
879
- co as default
881
+ uo as default
880
882
  };