@feedmepos/mf-connect 0.1.38-beta.8 → 0.1.38-beta.80

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 (159) hide show
  1. package/dist/{Analytic-CJap-Cat.js → Analytic-LOK5TzX0.js} +31 -32
  2. package/dist/{App-CLTtX1QT.js → App-Bk5Z5u5_.js} +617 -607
  3. package/dist/AuditLogs-Rezf9EeA.js +1991 -0
  4. package/dist/{Bin-C2xMLxoE.js → Bin-B8yzS5bD.js} +10 -10
  5. package/dist/Broadcast-CZ0QCvua.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCkD7Xfn.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-iJQS2Ck9.js} +6 -6
  7. package/dist/{Card-BPrCNLQy.js → Card-BQOv5yB9.js} +145 -140
  8. package/dist/Collections-qenPlCd2.js +540 -0
  9. package/dist/Credit-BJLskbVu.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DKWCWOU_.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dw1qQfnG.js +351 -0
  15. package/dist/Experience-BjfEiGT8.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-C013Tr1o.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-Gw_tFjen.js +330 -0
  20. package/dist/Grab-Bdv7SaB9.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-Ba4L39GL.js} +49 -48
  22. package/dist/{Index-DMdNgISh.js → Index-C67U3YDJ.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-pQ8sF5KW.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-o-eN3J4i.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-DPjqCyJ5.js} +1 -1
  26. package/dist/Marketing-DtEooXof.js +166 -0
  27. package/dist/MarketingMaterialEdit-Balw055Y.js +1065 -0
  28. package/dist/{Member-CnSXGQi_.js → Member-QA7TQnyw.js} +38 -37
  29. package/dist/{MemberList-DcpEKV1D.js → MemberList-CSJQFYlh.js} +486 -491
  30. package/dist/{MemberTransactions-DeuuEcO5.js → MemberTransactions-D-46vda_.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DLAEPNsq.js → MessageInput.vue_vue_type_script_setup_true_lang-6a7_lw74.js} +13443 -10607
  32. package/dist/Mission-DJVxFbX5.js +334 -0
  33. package/dist/{Overview-elpi-jpI.js → Overview-Btkh3oiI.js} +24 -25
  34. package/dist/Point-CVdF9GtN.js +262 -0
  35. package/dist/Promotion-BtmlvUd3.js +396 -0
  36. package/dist/{Queue-GvBhNEFe.js → Queue-BfiCMsLC.js} +23 -24
  37. package/dist/{Record-CbSxgo8i.js → Record-B07QGPli.js} +10 -10
  38. package/dist/Review-BeZ90jW9.js +621 -0
  39. package/dist/ReviewFacebookCallback-CwAcKaib.js +243 -0
  40. package/dist/ReviewGoogleCallback-CVK6Yc5E.js +213 -0
  41. package/dist/{Reward-QCGlrq89.js → Reward-CyXqNpAa.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSRvoo9z.js → RewardGroup.vue_vue_type_script_setup_true_lang-BICsdgSh.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BgKGNK7y.js +1912 -0
  44. package/dist/{Segment-5PndnEUa.js → Segment-B9g57O7g.js} +273 -274
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DXR7bpzY.js → SelectItems.vue_vue_type_script_setup_true_lang-BwDOXE87.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmITlNtt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DXDcJLYF.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CROBk6cD.js +226 -0
  48. package/dist/Setting-BHteqZv6.js +2039 -0
  49. package/dist/SettingAdvertisements-CubrbuSL.js +264 -0
  50. package/dist/Store-u6LYUnmp.js +1996 -0
  51. package/dist/StoreRewards-D9h0YnEx.js +535 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-vrYqDGOa.js +1129 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-WgNstmNx.js +7007 -0
  54. package/dist/{Tier-BKKxG29r.js → Tier-CBdi4sPT.js} +561 -480
  55. package/dist/{Title-CReZgw8V.js → Title-BegmN7hs.js} +151 -149
  56. package/dist/{Transaction-HWCmSVaJ.js → Transaction-C6XMd9_r.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D00AchXo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BBf4BP4m.js} +7 -7
  58. package/dist/Voucher-D6hSas_z.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-ZOlAZ_q5.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bs8TNiCY.js} +2 -2
  61. package/dist/app-Duwed9mD.js +59309 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-Bc-EMd2p.js → business-6oZ8Rgui.js} +11 -8
  64. package/dist/campaign-CzenWLhs.js +219 -0
  65. package/dist/campaign-PYce7g0o.js +253 -0
  66. package/dist/campaign.enum-KHniCp5a.js +26 -0
  67. package/dist/campaign.fn-dOSgHJcU.js +776 -0
  68. package/dist/{collectible.enum-C4dM8khp.js → collectible.enum-BZA1DKIB.js} +1 -1
  69. package/dist/{collection.fn-AjDNdFe1.js → collection.fn-CyfrdKBf.js} +2 -2
  70. package/dist/dto-DYmM2ud_.js +222 -0
  71. package/dist/duplicateCampaign-BXaDK8Q6.js +51 -0
  72. package/dist/effect-DBI_JHbP.js +89 -0
  73. package/dist/{email-addresses-B0SzUCQM.js → email-addresses-BNs-WN79.js} +2 -2
  74. package/dist/{export-Bgz6WcNZ.js → export-DTCCKE2m.js} +4 -4
  75. package/dist/{helper-B1vFwohM.js → helper-CeYr7Anh.js} +22 -7
  76. package/dist/index-38u-cCwD.js +3431 -0
  77. package/dist/{index-Cm2sBagk.js → index-BdjY7GRO.js} +1 -1
  78. package/dist/index-CGMiuxyf.js +85 -0
  79. package/dist/index-CQZbm9P5.js +8912 -0
  80. package/dist/index-Cal60fAm.js +48 -0
  81. package/dist/{index-DT2viYsL.js → index-CnRLkzpg.js} +617 -191
  82. package/dist/index-CuvNtC_M.js +61 -0
  83. package/dist/{index-CSQY21Zb.js → index-D-kPBF9C.js} +3 -3
  84. package/dist/{index-DVQnrex_.js → index-DcFYm1fy.js} +3 -3
  85. package/dist/index-DjONNxbl.js +30289 -0
  86. package/dist/{index-26SopNpv.js → index-ItaoypTr.js} +1 -1
  87. package/dist/index-_jxXI4_v.js +28899 -0
  88. package/dist/{index-DwT9RLst.js → index-nXfjG8UQ.js} +23 -12
  89. package/dist/{index-BIRmS75g.js → index-pHQfP2e7.js} +1 -1
  90. package/dist/{index.esm2017-BAIN70_n.js → index.esm2017-CokFPnqn.js} +185 -185
  91. package/dist/{loading-C6Ouh0mG.js → loading-fZQi5zP8.js} +1 -1
  92. package/dist/{lodash-B5I3zXaY.js → lodash-R-DIRmbj.js} +1 -1
  93. package/dist/{membership-DU0BwIj8.js → membership-CApN5ZJ1.js} +3 -3
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-Bg7GuE5s.js → money-C6I6vVy2.js} +1 -1
  96. package/dist/{number-Ddmqo5D_.js → number-Dq4d381U.js} +1 -1
  97. package/dist/objectid-Kv5GREBk.js +145 -0
  98. package/dist/{campaign-BeF8kTyg.js → plugins-9_UvAdJ2.js} +784 -777
  99. package/dist/remy-NLAa-9Qg.js +46 -0
  100. package/dist/{reward-CN4gvn4c.js → reward-DXHGeGYY.js} +1 -1
  101. package/dist/{rule-CpiqqR0c.js → rule-B_XgRDr-.js} +505 -487
  102. package/dist/rule-builder-BMXyzu8k.js +102 -0
  103. package/dist/style.css +11 -2
  104. package/dist/template-CnyTUzQU.js +188 -0
  105. package/dist/timezone-Izs3ibB-.js +1156 -0
  106. package/dist/trigger-Dda3NmaE.js +213 -0
  107. package/dist/usePagination-Byxk4XVn.js +220 -0
  108. package/dist/user-BZxO8qdh.js +55 -0
  109. package/dist/{vue-i18n-DVmD9I_o.js → vue-i18n-DDbkmbSf.js} +433 -433
  110. package/dist/{xlsx-qJHsnW7k.js → xlsx-D8yNl8dN.js} +1 -1
  111. package/dist/{zod-Bg2FbC-D.js → zod-Xp7TePRP.js} +32 -31
  112. package/package.json +14 -6
  113. package/dist/AuditLogs-DW4rwNOn.js +0 -1887
  114. package/dist/Broadcast-Dhc0j16O.js +0 -227
  115. package/dist/Collections-CsUJEmqz.js +0 -465
  116. package/dist/Credit-Mqa-0XJd.js +0 -222
  117. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  118. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js +0 -2185
  119. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js +0 -347
  120. package/dist/Experience-BD5C3old.js +0 -223
  121. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  122. package/dist/Game-D4xsi8Ym.js +0 -278
  123. package/dist/Marketing-axcQYl8k.js +0 -20073
  124. package/dist/Mission-BHZiL-GH.js +0 -296
  125. package/dist/Point-gKvdggAl.js +0 -226
  126. package/dist/Promotion-7x2F_sFX.js +0 -289
  127. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js +0 -1751
  128. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DTlv8ZAn.js +0 -147
  129. package/dist/Setting-Cab47wfH.js +0 -1936
  130. package/dist/Store-BFL3T9B5.js +0 -1842
  131. package/dist/StoreRewards-C43dCJtM.js +0 -423
  132. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-aAj5-nzZ.js +0 -1029
  133. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js +0 -139
  134. package/dist/Voucher-BhUAcPZg.js +0 -384
  135. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-C0YNez2L.js +0 -419
  136. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  137. package/dist/app-BGaUIdCr.js +0 -7086
  138. package/dist/app-DccKBdW_.js +0 -33357
  139. package/dist/campaign-DbJZEU7P.js +0 -96
  140. package/dist/campaign.enum-PBKYGUQY.js +0 -20
  141. package/dist/campaign.fn-Cq-4LfQj.js +0 -758
  142. package/dist/dto-8NvMMYAb.js +0 -214
  143. package/dist/effect-DZhcEQ5g.js +0 -78
  144. package/dist/index-CQQedv0M.js +0 -32260
  145. package/dist/index-CTgQRqQR.js +0 -30038
  146. package/dist/index-CsaQJMAR.js +0 -66
  147. package/dist/index-DGaywhpY.js +0 -76
  148. package/dist/index-DOfLDlI8.js +0 -8861
  149. package/dist/index-DVpAocyR.js +0 -3120
  150. package/dist/index-DlJGd8RC.js +0 -121
  151. package/dist/index-Dm65CTdy.js +0 -38
  152. package/dist/objectid-MCaJXAgq.js +0 -145
  153. package/dist/plugins-C-CRzeyC.js +0 -208
  154. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  155. package/dist/rule-builder-DmkJng-x.js +0 -89
  156. package/dist/template-DTZgnkl5.js +0 -190
  157. package/dist/trigger-CPjJ73Rc.js +0 -144
  158. package/dist/usePagination-BeF5K3M7.js +0 -223
  159. package/dist/user-8VIt8A1x.js +0 -54
@@ -1,42 +1,41 @@
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 S, 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 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-C-CRzeyC.js";
4
- import { u as De } from "./loading-C6Ouh0mG.js";
3
+ import { n as Ae, p as De } from "./plugins-9_UvAdJ2.js";
4
+ import { u as $e } from "./loading-fZQi5zP8.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-DVmD9I_o.js";
8
- import "./index-DT2viYsL.js";
9
- import { i as $e, j as R, c as fe } from "./index-DVpAocyR.js";
10
- import "./index-DOfLDlI8.js";
11
- import "./index-Dm65CTdy.js";
12
- import "./index-CSQY21Zb.js";
13
- import { u as ne, w as he } from "./xlsx-qJHsnW7k.js";
14
- import { e as Pe, M as Be } from "./email-addresses-B0SzUCQM.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-CQQedv0M.js";
18
- import { R as ge } from "./rule-builder-DmkJng-x.js";
19
- import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js";
20
- import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js";
21
- import { u as ze, v as Oe, w as je } from "./index.esm2017-BAIN70_n.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-DU0BwIj8.js";
25
- import { o as He } from "./objectId-dwaoBfJX.js";
26
- import { u as Ce } from "./business-Bc-EMd2p.js";
27
- import { f as Je } from "./number-Ddmqo5D_.js";
28
- import { t as Qe } from "./money-Bg7GuE5s.js";
29
- import "./index-Cm2sBagk.js";
30
- import { useRouter as We } from "vue-router";
31
- import { m as ve } from "./index-DGaywhpY.js";
32
- import { R as _e } from "./app-BGaUIdCr.js";
33
- const Ze = $e.extend({
6
+ import { u as we, _ as Fe } from "./usePagination-Byxk4XVn.js";
7
+ import { u as be } from "./vue-i18n-DDbkmbSf.js";
8
+ import "./index-CnRLkzpg.js";
9
+ import { i as Pe, j as $, c as fe } from "./index-38u-cCwD.js";
10
+ import "./index-CQZbm9P5.js";
11
+ import { F as ye, z as Be } from "./index-DjONNxbl.js";
12
+ import "./index-D-kPBF9C.js";
13
+ import { u as ne, w as he } from "./xlsx-D8yNl8dN.js";
14
+ import { e as Ne, M as Ve } from "./email-addresses-BNs-WN79.js";
15
+ import { Z as Ye } from "./zod-Xp7TePRP.js";
16
+ import { u as Ue } from "./app-wDQR6dpb.js";
17
+ import { R as ge } from "./rule-builder-BMXyzu8k.js";
18
+ import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bs8TNiCY.js";
19
+ import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BgKGNK7y.js";
20
+ import { u as Oe, v as je, w as qe } from "./index.esm2017-CokFPnqn.js";
21
+ import { F as Ge } from "./FileSaver.min-C013Tr1o.js";
22
+ import { h as H } from "./moment-D7p2TMB-.js";
23
+ import { s as B, u as He } from "./membership-CApN5ZJ1.js";
24
+ import { o as Je } from "./objectId-dwaoBfJX.js";
25
+ import { u as Ce } from "./business-6oZ8Rgui.js";
26
+ import { f as Qe } from "./number-Dq4d381U.js";
27
+ import { t as We } from "./money-C6I6vVy2.js";
28
+ import "./index-BdjY7GRO.js";
29
+ import { useRouter as Ze } from "vue-router";
30
+ import { m as ve } from "./index-CGMiuxyf.js";
31
+ import { R as _e } from "./app-Duwed9mD.js";
32
+ const Ke = Pe.extend({
34
33
  _id: ye.optional(),
35
34
  business: ye.optional(),
36
- file: Ye.any().nullish()
35
+ file: Be.any().nullish()
37
36
  });
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 = {
37
+ 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" };
38
+ const et = { class: "flex flex-col space-y-16" }, tt = {
40
39
  key: 0,
41
40
  class: /* @__PURE__ */ re([
42
41
  "p-16 pl-24 space-x-8",
@@ -44,21 +43,21 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
44
43
  "flex items-center",
45
44
  "justify-between"
46
45
  ])
47
- }, tt = { class: "flex justify-end" }, ot = {
46
+ }, ot = { class: "flex justify-end" }, at = {
48
47
  key: 1,
49
48
  class: /* @__PURE__ */ re([
50
49
  "flex items-center",
51
50
  "border border-fm-color-neutral-gray-300",
52
51
  "p-16 space-x-16 rounded-md"
53
52
  ])
54
- }, at = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, nt = /* @__PURE__ */ ee({
53
+ }, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
55
54
  __name: "ImportSegment",
56
55
  props: {
57
56
  importFile: {}
58
57
  },
59
58
  emits: ["update:file"],
60
- setup(e, { emit: _ }) {
61
- const x = e, h = _, { t: m } = Fe(), y = z(null), f = z(null), F = ["Id"], i = [
59
+ setup(e, { emit: v }) {
60
+ const _ = e, C = v, { t: m } = be(), f = z(null), w = z(null), F = ["Id"], n = [
62
61
  {
63
62
  label: "CSV",
64
63
  icon: "csv",
@@ -70,88 +69,88 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
70
69
  value: "xlsx"
71
70
  }
72
71
  ];
73
- async function n() {
74
- if (x.importFile)
72
+ async function i() {
73
+ if (_.importFile)
75
74
  try {
76
- const S = ze(void 0, Ke.importFilesBucketUrl), g = Oe(S, x.importFile), w = await je(g);
77
- window.open(w, "_blank");
78
- } catch (S) {
79
- console.log(S);
75
+ const h = Oe(void 0, Xe.importFilesBucketUrl), y = je(h, _.importFile), x = await qe(y);
76
+ window.open(x, "_blank");
77
+ } catch (h) {
78
+ console.log(h), Ae.error("Failed to download uploaded file");
80
79
  }
81
80
  }
82
- async function c(S) {
83
- switch (S) {
81
+ async function c(h) {
82
+ switch (h) {
84
83
  case "csv":
85
- const g = new Blob([F.join(",")], {
84
+ const y = new Blob([F.join(",")], {
86
85
  type: "text/csv;charset=utf-8;"
87
86
  });
88
- qe.saveAs(g, "ImportSegmentTemplate.csv");
87
+ Ge.saveAs(y, "ImportSegmentTemplate.csv");
89
88
  break;
90
89
  case "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");
90
+ const x = ne.aoa_to_sheet([F]), I = ne.book_new();
91
+ ne.book_append_sheet(I, x, "Sheet1"), he(I, "ImportSegmentTemplate.xlsx");
93
92
  break;
94
93
  }
95
94
  }
96
- function C(S) {
97
- y.value = S, h("update:file", y.value);
95
+ function b(h) {
96
+ f.value = h, C("update:file", f.value);
98
97
  }
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;
102
- C(g);
98
+ function A(h) {
99
+ var x, I;
100
+ const y = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
101
+ b(y);
103
102
  }
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, [
109
- r(w, {
103
+ return (h, y) => {
104
+ const x = S("FmButton"), I = S("FmMenuItem"), d = S("FmMenu"), s = S("FmDropField");
105
+ return p(), k("div", et, [
106
+ y[2] || (y[2] = l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1)),
107
+ e.importFile ? (p(), k("div", tt, [
108
+ r(x, {
110
109
  label: t(m)("View uploaded file"),
111
110
  variant: t(ae).Plain,
112
111
  icon: "file_present",
113
- onClick: n
112
+ onClick: i
114
113
  }, null, 8, ["label", "variant"])
115
114
  ])) : le("", !0),
116
115
  l("div", null, [
117
- l("div", tt, [
118
- r(u, { class: "" }, {
116
+ l("div", ot, [
117
+ r(d, { class: "" }, {
119
118
  "menu-button": E(() => [
120
- r(w, {
119
+ r(x, {
121
120
  variant: "tertiary",
122
121
  icon: "download",
123
122
  label: "Download Template"
124
123
  })
125
124
  ]),
126
125
  default: E(() => [
127
- (p(), k(O, null, ie(i, (v) => r(I, {
128
- key: v.value,
129
- icon: v.icon,
130
- label: v.label,
131
- onClick: (U) => c(v.value),
126
+ (p(), k(O, null, ie(n, (g) => r(I, {
127
+ key: g.value,
128
+ icon: g.icon,
129
+ label: g.label,
130
+ onClick: (U) => c(g.value),
132
131
  selectable: ""
133
132
  }, null, 8, ["icon", "label", "onClick"])), 64))
134
133
  ]),
135
134
  _: 1
136
135
  })
137
136
  ]),
138
- y.value ? (p(), k("div", ot, [
139
- r(w, {
137
+ f.value ? (p(), k("div", at, [
138
+ r(x, {
140
139
  variant: t(ae).Tertiary,
141
140
  "prepend-icon": "attach_file"
142
141
  }, null, 8, ["variant"]),
143
- l("p", at, $(y.value.name), 1),
142
+ l("p", nt, R(f.value.name), 1),
144
143
  l("label", {
145
144
  ref_key: "fileLabelRef",
146
- ref: f,
145
+ ref: w,
147
146
  htmlFor: "file"
148
147
  }, [
149
- r(w, {
148
+ r(x, {
150
149
  variant: t(ae).Plain,
151
150
  label: t(m)("Replace File"),
152
- onClick: g[1] || (g[1] = () => {
153
- var v;
154
- return (v = f.value) == null ? void 0 : v.click();
151
+ onClick: y[1] || (y[1] = () => {
152
+ var g;
153
+ return (g = w.value) == null ? void 0 : g.click();
155
154
  })
156
155
  }, null, 8, ["variant", "label"]),
157
156
  l("input", {
@@ -165,7 +164,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
165
164
  ], 512)
166
165
  ])) : (p(), J(s, {
167
166
  key: 0,
168
- onFileUpload: g[0] || (g[0] = (v) => C(v)),
167
+ onFileUpload: y[0] || (y[0] = (g) => b(g)),
169
168
  accept: ".csv, .xlsx",
170
169
  "max-file-size": 2e7
171
170
  }))
@@ -173,188 +172,188 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
173
172
  ]);
174
173
  };
175
174
  }
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
+ }), 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
176
  __name: "ReviewSegment",
178
177
  props: {
179
178
  title: {},
180
179
  segment: {}
181
180
  },
182
181
  setup(e) {
183
- const _ = e, x = [
182
+ const v = e, _ = [
184
183
  {
185
184
  header: "Name",
186
- accessorFn: (n) => n.name
185
+ accessorFn: (i) => i.name
187
186
  },
188
187
  {
189
188
  header: "Id",
190
- accessorFn: (n) => n._id
189
+ accessorFn: (i) => i._id
191
190
  },
192
191
  {
193
192
  header: "Customer Since",
194
- accessorFn: (n) => H(He(n._id.toString())).format("DD MMM YYYY")
193
+ accessorFn: (i) => H(Je(i._id.toString())).format("DD MMM YYYY")
195
194
  },
196
195
  {
197
196
  header: "Phone",
198
- accessorFn: (n) => n.phoneNumber
197
+ accessorFn: (i) => i.phoneNumber
199
198
  },
200
199
  {
201
200
  header: "Birthday",
202
- accessorFn: (n) => H(n.birthday).format("DD MMM YYYY")
201
+ accessorFn: (i) => H(i.birthday).format("DD MMM YYYY")
203
202
  },
204
203
  {
205
204
  header: "Last Visit",
206
- accessorFn: (n) => H(n.stats.lastVisit).format("DD MMM YYYY")
205
+ accessorFn: (i) => H(i.stats.lastVisit).format("DD MMM YYYY")
207
206
  }
208
207
  ];
209
- async function h(n) {
210
- return _.segment._id ? (console.log(n), await B.paginateSegmentUsers(
211
- _.segment._id,
212
- n
208
+ async function C(i) {
209
+ return v.segment._id ? (console.log(i), await B.paginateSegmentUsers(
210
+ v.segment._id,
211
+ i
213
212
  )) : {
214
213
  resources: [],
215
214
  meta: {
216
215
  totalResources: 0,
217
216
  totalPages: 0,
218
- skip: n.skip,
219
- limit: n.limit,
220
- sortBy: n.sortBy
217
+ skip: i.skip,
218
+ limit: i.limit,
219
+ sortBy: i.sortBy
221
220
  }
222
221
  };
223
222
  }
224
- const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: F, onSearch: i } = we(h);
223
+ const { tableMeta: m, rowData: f, onSort: w, debouncedFetchData: F, onSearch: n } = we(C);
225
224
  return Se(async () => {
226
225
  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, [
226
+ }), (i, c) => (p(), k("div", lt, [
227
+ l("div", it, R(v.title), 1),
228
+ l("div", rt, [
229
+ l("div", ct, R(e.segment.members.length), 1),
230
+ l("div", dt, [
232
231
  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)
232
+ l("div", null, "as of " + R(t(H)(e.segment.lastUpdated).format("DD MMM YYYY")), 1)
234
233
  ])
235
234
  ]),
236
- r(be, {
235
+ r(Fe, {
237
236
  loading: t(m).isLoading,
238
- "row-data": t(y),
237
+ "row-data": t(f),
239
238
  "row-count": t(m).totalRows,
240
- "column-defs": x,
239
+ "column-defs": _,
241
240
  "page-size": t(m).pageSize,
242
241
  "page-count": t(m).pageCount,
243
242
  "page-index": t(m).pageIndex,
244
- onSortChange: t(f),
245
- onPageChange: c[0] || (c[0] = (C) => t(F)({ pageSize: C.pageSize, pageIndex: C.pageIndex }))
243
+ onSortChange: t(w),
244
+ onPageChange: c[0] || (c[0] = (b) => t(F)({ pageSize: b.pageSize, pageIndex: b.pageIndex }))
246
245
  }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
247
246
  ]));
248
247
  }
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
+ }), 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
249
  __name: "SegmentTypeOption",
251
250
  props: {
252
251
  modelValue: {},
253
252
  errorText: {}
254
253
  },
255
254
  emits: ["update:model-value"],
256
- setup(e, { emit: _ }) {
257
- const x = e, h = _, m = [
255
+ setup(e, { emit: v }) {
256
+ const _ = e, C = v, m = [
258
257
  {
259
258
  label: "Dynamic",
260
259
  sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
261
- value: R.enum.DYNAMIC
260
+ value: $.enum.DYNAMIC
262
261
  },
263
262
  {
264
263
  label: "Static",
265
264
  sublabel: "Segment statistics are based on imported data and will not be recalculated.",
266
- value: R.enum.STATIC
265
+ value: $.enum.STATIC
267
266
  }
268
267
  ];
269
- function y(f) {
270
- f !== x.modelValue && h("update:model-value", f);
268
+ function f(w) {
269
+ w !== _.modelValue && C("update:model-value", w);
271
270
  }
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, {
271
+ return (w, F) => {
272
+ const n = S("FmCard"), i = S("FmHelperText");
273
+ return p(), k("div", pt, [
274
+ l("div", mt, [
275
+ (p(), k(O, null, ie(m, (c) => r(n, {
277
276
  variant: "outlined",
278
277
  class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
279
278
  "col-span-2": m.length == 1,
280
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
281
- "hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
279
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue === c.value,
280
+ "hover:bg-fm-color-opacity-sm": e.modelValue !== c.value
282
281
  }]),
283
- onClick: (C) => y(c.value),
282
+ onClick: (b) => f(c.value),
284
283
  key: c.value
285
284
  }, {
286
285
  default: E(() => [
287
- l("div", mt, $(c.label), 1),
288
- l("div", ft, $(c.sublabel), 1)
286
+ l("div", ft, R(c.label), 1),
287
+ l("div", yt, R(c.sublabel), 1)
289
288
  ]),
290
289
  _: 2
291
290
  }, 1032, ["class", "onClick"])), 64))
292
291
  ]),
293
- f.errorText ? (p(), J(n, {
292
+ e.errorText ? (p(), J(i, {
294
293
  key: 0,
295
294
  class: "!mt-4",
296
- text: f.errorText,
295
+ text: e.errorText,
297
296
  state: "error"
298
297
  }, null, 8, ["text"])) : le("", !0)
299
298
  ]);
300
299
  };
301
300
  }
302
- }), gt = { class: "flex items-center gap-x-8" }, vt = {
301
+ }), vt = { class: "flex items-center gap-x-8" }, _t = {
303
302
  key: 0,
304
303
  class: "space-y-16 pr-12"
305
- }, _t = { class: "flex flex-col space-y-16" }, xt = {
304
+ }, xt = { class: "flex flex-col space-y-16" }, St = {
306
305
  key: 0,
307
306
  class: "flex flex-col space-y-16"
308
- }, St = {
307
+ }, wt = {
309
308
  key: 1,
310
309
  class: "flex flex-col space-y-16"
311
- }, wt = {
310
+ }, Ft = {
312
311
  key: 2,
313
312
  class: "flex flex-col space-y-16"
314
- }, bt = { class: "flex items-center gap-8" }, Ft = /* @__PURE__ */ ee({
313
+ }, bt = { class: "flex items-center gap-8" }, ht = /* @__PURE__ */ ee({
315
314
  __name: "SegmentSheet",
316
315
  emits: ["update:model-value"],
317
- setup(e, { expose: _, emit: x }) {
318
- const h = Ve(), m = z(!1), y = z(!1), f = {
316
+ setup(e, { expose: v, emit: _ }) {
317
+ const C = Ue(), m = z(!1), f = z(!1), w = {
319
318
  name: "",
320
319
  isActive: !0,
321
- type: R.enum.DYNAMIC,
320
+ type: $.enum.DYNAMIC,
322
321
  rule: ge.scaffoldGroup(),
323
322
  members: []
324
- }, F = Ze, i = z(f), n = ce(() => {
325
- const u = F.safeParse(i.value);
326
- return u.success ? [] : u.error.errors;
323
+ }, F = Ke, n = z(w), i = ce(() => {
324
+ const d = F.safeParse(n.value);
325
+ return d.success ? [] : d.error.errors;
327
326
  });
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 };
327
+ function c(d) {
328
+ m.value = !0, f.value = !1, d ? n.value = {
329
+ ...d,
330
+ isActive: d.isActive !== !1,
331
+ type: d.type ?? (d.importFile ? $.enum.STATIC : $.enum.DYNAMIC)
332
+ } : n.value = { ...w };
334
333
  }
335
- function C() {
334
+ function b() {
336
335
  m.value = !1;
337
336
  }
338
337
  async function A() {
339
- F.safeParse(i.value).success && (y.value = !0);
338
+ F.safeParse(n.value).success && (f.value = !0);
340
339
  }
341
- function S() {
342
- y.value = !1;
340
+ function h(d) {
341
+ d === $.enum.STATIC ? b() : f.value = !1;
343
342
  }
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);
343
+ async function y() {
344
+ n.value.type === $.enum.STATIC ? (n.value.rule = ge.scaffoldGroup(), n.value.isActive = !0) : n.value.file = void 0, I("update:model-value", n.value);
346
345
  }
347
- async function w(u) {
348
- i.value.type = u;
346
+ async function x(d) {
347
+ n.value.type = d;
349
348
  }
350
349
  Se(async () => {
351
350
  });
352
- const I = x;
353
- return _({
351
+ const I = _;
352
+ return v({
354
353
  showSheet: c,
355
- hideSheet: C
356
- }), (u, s) => {
357
- const v = b("FmButton"), U = b("FmSwitch"), a = b("FmSideSheet");
354
+ hideSheet: b
355
+ }), (d, s) => {
356
+ const g = S("FmButton"), U = S("FmSwitch"), a = S("FmSideSheet");
358
357
  return p(), J(a, {
359
358
  modelValue: t(m),
360
359
  "onUpdate:modelValue": s[8] || (s[8] = (o) => Ie(m) ? m.value = o : null),
@@ -365,27 +364,27 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
365
364
  }, Me({
366
365
  "side-sheet-footer": E(() => [
367
366
  l("div", bt, [
368
- t(y) || t(i).type === t(R).enum.STATIC ? (p(), k(O, { key: 0 }, [
369
- r(v, {
367
+ t(f) || t(n).type === t($).enum.STATIC ? (p(), k(O, { key: 0 }, [
368
+ r(g, {
370
369
  label: "Save Segment",
371
- onClick: g,
372
- loading: t(h).isLoading,
373
- disabled: t(n).length > 0 || t(h).isLoading
370
+ onClick: y,
371
+ loading: t(C).isLoading,
372
+ disabled: t(i).length > 0 || t(C).isLoading
374
373
  }, null, 8, ["loading", "disabled"]),
375
- r(v, {
374
+ r(g, {
376
375
  label: "Cancel",
377
- onClick: s[6] || (s[6] = (o) => S()),
376
+ onClick: s[6] || (s[6] = (o) => h(t(n).type)),
378
377
  variant: "tertiary"
379
378
  })
380
379
  ], 64)) : (p(), k(O, { key: 1 }, [
381
- r(v, {
380
+ r(g, {
382
381
  label: "Review Segment",
383
- disabled: t(n).length > 0 || t(h).isLoading,
382
+ disabled: t(i).length > 0 || t(C).isLoading,
384
383
  onClick: A
385
384
  }, null, 8, ["disabled"]),
386
- r(v, {
385
+ r(g, {
387
386
  label: "Cancel",
388
- onClick: s[7] || (s[7] = (o) => C()),
387
+ onClick: s[7] || (s[7] = (o) => b()),
389
388
  variant: "tertiary"
390
389
  })
391
390
  ], 64))
@@ -394,49 +393,49 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
394
393
  default: E(() => {
395
394
  var o;
396
395
  return [
397
- t(y) ? (p(), J(dt, {
396
+ t(f) ? (p(), J(ut, {
398
397
  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),
398
+ title: t(n).name,
399
+ segment: t(n)
400
+ }, null, 8, ["title", "segment"])) : (p(), k("div", _t, [
401
+ r(Le, {
402
+ modelValue: t(n).name,
403
+ "onUpdate:modelValue": s[1] || (s[1] = (u) => t(n).name = u),
405
404
  label: "Segment title",
406
- schema: t(Ne).typeAtPath(t(F), "name")
405
+ schema: t(Ye).typeAtPath(t(F), "name")
407
406
  }, null, 8, ["modelValue", "schema"]),
408
- l("div", _t, [
407
+ l("div", xt, [
409
408
  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);
409
+ r(gt, {
410
+ "model-value": t(n).type,
411
+ "onUpdate:modelValue": s[2] || (s[2] = (u) => {
412
+ x(u);
414
413
  })
415
414
  }, null, 8, ["model-value"])
416
415
  ]),
417
- t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", xt, [
416
+ t(n).type === t($).enum.DYNAMIC ? (p(), k("div", St, [
418
417
  s[11] || (s[11] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
419
- r(Le, {
418
+ r(ze, {
420
419
  "trigger-type": "MEMBERSHIP_JOINED",
421
420
  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;
421
+ "model-value": (o = t(n)) == null ? void 0 : o.rule,
422
+ "onUpdate:modelValue": s[3] || (s[3] = (u) => {
423
+ t(n).rule = u;
425
424
  })
426
425
  }, 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;
426
+ ])) : (p(), k("div", wt, [
427
+ r(st, {
428
+ importFile: t(n).importFile,
429
+ "onUpdate:file": s[4] || (s[4] = (u) => {
430
+ t(n).file = u;
432
431
  })
433
432
  }, null, 8, ["importFile"])
434
433
  ])),
435
- t(i).type === t(R).enum.DYNAMIC ? (p(), k("div", wt, [
434
+ t(n).type === t($).enum.DYNAMIC ? (p(), k("div", Ft, [
436
435
  s[12] || (s[12] = l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1)),
437
436
  r(U, {
438
- "model-value": t(i).isActive ?? !0,
439
- "onUpdate:modelValue": s[5] || (s[5] = (d) => t(i).isActive = d),
437
+ "model-value": t(n).isActive ?? !0,
438
+ "onUpdate:modelValue": s[5] || (s[5] = (u) => t(n).isActive = u),
440
439
  label: "Active",
441
440
  sublabel: "When enabled, this will recalculate the segment statistics daily.",
442
441
  "label-placement": "right"
@@ -447,14 +446,14 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
447
446
  }),
448
447
  _: 2
449
448
  }, [
450
- t(y) ? {
449
+ t(f) ? {
451
450
  name: "side-sheet-header",
452
451
  fn: E(() => [
453
- l("div", gt, [
454
- r(v, {
452
+ l("div", vt, [
453
+ r(g, {
455
454
  icon: "arrow_back",
456
455
  variant: "tertiary",
457
- onClick: s[0] || (s[0] = (o) => y.value = !1)
456
+ onClick: s[0] || (s[0] = (o) => f.value = !1)
458
457
  }),
459
458
  s[9] || (s[9] = l("div", null, "Review segment", -1))
460
459
  ])
@@ -464,20 +463,20 @@ const Xe = { class: "flex flex-col space-y-16" }, et = {
464
463
  ]), 1032, ["modelValue"]);
465
464
  };
466
465
  }
467
- }), xe = Ge(), ht = Ce();
466
+ }), xe = He(), Ct = Ce();
468
467
  function se(e) {
469
- const _ = H(e);
470
- return _.isValid() ? _.format("DD/MM/YYYY") : "";
468
+ const v = H(e);
469
+ return v.isValid() ? v.format("DD/MM/YYYY") : "";
471
470
  }
472
- const Ct = {
471
+ const kt = {
473
472
  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) => ({
473
+ var i, c, b, A, h, y, x, I, d, s, g, U, a, o, u, P, D, N, V, j, q, G, te, M, Q, de, ue, pe;
474
+ const v = ce(() => Ct.locations.map((T) => ({
476
475
  label: T.name,
477
476
  value: T._id
478
- }))), x = (n = Pe.parseOneAddress(
477
+ }))), _ = (i = Ne.parseOneAddress(
479
478
  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(
479
+ )) != null && i.domain.includes("feedmepos.com") ? void 0 : e.email, C = (b = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : b.reduce(
481
480
  (T, L) => {
482
481
  var Z, K;
483
482
  const W = (K = (Z = xe.sortedTitles) == null ? void 0 : Z.find(
@@ -495,29 +494,29 @@ const Ct = {
495
494
  return T[L.name] = W ? H(W).format("DD/MM/YYYY") : "", T;
496
495
  },
497
496
  {}
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(
497
+ ), f = ((y = (h = (A = e.collection) == null ? void 0 : A.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : y.balance) || 0, w = ((s = (d = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : s.reduce(
499
498
  (T, L) => T + L.amount,
500
499
  0
501
- )) || 0, F = Je(y, 2);
500
+ )) || 0, F = Qe(f, 2);
502
501
  return {
503
502
  ID: e._id.toString(),
504
- Name: ((v = e.name) == null ? void 0 : v.trim()) || "",
503
+ Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
505
504
  Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
506
- Email: x || "",
505
+ Email: _ || "",
507
506
  Gender: e.gender || "",
508
507
  CardNo: e.cardNo || "",
509
508
  Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
510
- Credit: parseFloat((Number(F) - Number(f)).toFixed(2)),
511
- FreeCredit: Number(f.toFixed(2)),
509
+ Credit: parseFloat((Number(F) - Number(w)).toFixed(2)),
510
+ FreeCredit: Number(w.toFixed(2)),
512
511
  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
+ 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
513
  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
514
  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
515
  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
+ Titles: C.join(","),
518
517
  ...m,
519
518
  TotalTransaction: e.stats.visitCount,
520
- AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
519
+ AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
521
520
  !1
522
521
  ),
523
522
  TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
@@ -526,22 +525,22 @@ const Ct = {
526
525
  LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
527
526
  LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
528
527
  JoinedAt: se(e.joinAt || void 0),
529
- JoinedAtLocation: e.location && ((pe = _.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
528
+ JoinedAtLocation: e.location && ((pe = v.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
530
529
  VisitFrequency: `${Number(
531
530
  Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
532
531
  )}`
533
532
  };
534
533
  }
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
+ }, 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" }, uo = /* @__PURE__ */ ee({
536
535
  __name: "Segment",
537
536
  setup(e) {
538
- const { minor: _ } = De, { t: x } = Fe(), h = Ce(), { mapMemberExportRow: m } = Ct, y = Re(), f = We(), F = z(0), i = [
537
+ const { minor: v } = $e, { t: _ } = be(), C = Ce(), { mapMemberExportRow: m } = kt, f = Re(), w = Ze(), F = z(0), n = [
539
538
  {
540
- header: x("connect.loyalty.segment.table.name"),
539
+ header: _("connect.loyalty.segment.table.name"),
541
540
  accessorFn: (a) => a.name
542
541
  },
543
542
  {
544
- header: x("connect.loyalty.segment.table.status"),
543
+ header: _("connect.loyalty.segment.table.status"),
545
544
  enableSorting: !1,
546
545
  cell(a) {
547
546
  const o = a.row.original.isActive === !1 ? "Inactive" : "Active";
@@ -553,15 +552,15 @@ const Ct = {
553
552
  }
554
553
  },
555
554
  {
556
- header: x("connect.loyalty.segment.table.total_customers"),
555
+ header: _("connect.loyalty.segment.table.total_customers"),
557
556
  accessorFn: (a) => a.memberCount ?? 0
558
557
  },
559
558
  {
560
- header: x("connect.loyalty.segment.table.customer_percentage"),
559
+ header: _("connect.loyalty.segment.table.customer_percentage"),
561
560
  accessorFn: (a) => ((a.memberCount ?? 0) * 100 / F.value).toFixed(2)
562
561
  },
563
562
  {
564
- header: x("connect.loyalty.segment.table.actions"),
563
+ header: _("connect.loyalty.segment.table.actions"),
565
564
  meta: {
566
565
  maxWidth: "100px"
567
566
  },
@@ -586,7 +585,7 @@ const Ct = {
586
585
  X.FmMenuItem,
587
586
  {
588
587
  onClick: async (o) => {
589
- o.stopPropagation(), w(a.row.original);
588
+ o.stopPropagation(), x(a.row.original);
590
589
  }
591
590
  },
592
591
  {
@@ -603,7 +602,7 @@ const Ct = {
603
602
  X.FmMenuItem,
604
603
  {
605
604
  onClick: async (o) => {
606
- o.stopPropagation(), g(a.row.original);
605
+ o.stopPropagation(), y(a.row.original);
607
606
  }
608
607
  },
609
608
  {
@@ -622,19 +621,19 @@ const Ct = {
622
621
  ]);
623
622
  }
624
623
  }
625
- ], n = z(null), { tableMeta: c, rowData: C, debouncedFetchData: A } = we(
624
+ ], i = z(null), { tableMeta: c, rowData: b, debouncedFetchData: A } = we(
626
625
  B.readAll
627
626
  );
628
- async function S() {
629
- await _(
627
+ async function h() {
628
+ await v(
630
629
  async () => {
631
630
  await B.refreshSegments(), await A({ pageSize: 10, pageIndex: 0 });
632
631
  },
633
632
  { message: "Refreshing segmentations" }
634
633
  );
635
634
  }
636
- async function g(a) {
637
- await Ae.remove(`Are you sure you want to remove ${a.name}?`) && await _(
635
+ async function y(a) {
636
+ await De.remove(`Are you sure you want to remove ${a.name}?`) && await v(
638
637
  async () => {
639
638
  await B.delete(a._id), await A({ pageSize: 10, pageIndex: 0 });
640
639
  },
@@ -644,20 +643,20 @@ const Ct = {
644
643
  }
645
644
  );
646
645
  }
647
- async function w(a) {
646
+ async function x(a) {
648
647
  const o = {
649
648
  sortBy: "_id",
650
649
  descending: !1,
651
650
  rowsPerPage: 1e3,
652
651
  page: 1,
653
652
  rowsNumber: 0
654
- }, d = new Be(), P = (await ve.read({
653
+ }, u = new Ve(), P = (await ve.read({
655
654
  limit: 1,
656
655
  skip: 0,
657
656
  sortBy: o.sortBy,
658
657
  descending: o.descending
659
658
  })).meta.totalResources ?? 0, D = o.rowsPerPage;
660
- await _(
659
+ await v(
661
660
  async () => {
662
661
  for (let N = 0; N < P; N += D) {
663
662
  const V = {
@@ -672,12 +671,12 @@ const Ct = {
672
671
  );
673
672
  for (const q of j.resources) {
674
673
  const G = m(q);
675
- d.addRecord(G);
674
+ u.addRecord(G);
676
675
  }
677
676
  o.page++;
678
677
  }
679
678
  await he(
680
- d.buildExcel(),
679
+ u.buildExcel(),
681
680
  `[${a.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
682
681
  {
683
682
  bookType: "xlsx",
@@ -693,35 +692,35 @@ const Ct = {
693
692
  );
694
693
  }
695
694
  async function I(a) {
696
- await _(
695
+ await v(
697
696
  async () => {
698
697
  var o;
699
- if (a.type === R.enum.STATIC) {
700
- const d = new FormData();
701
- if (d.append("file", a.file), a._id) {
698
+ if (a.type === $.enum.STATIC) {
699
+ const u = new FormData();
700
+ if (u.append("file", a.file), a._id) {
702
701
  const { members: P, _id: D, file: N, ...V } = a;
703
- d.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, d);
702
+ u.append("segment", JSON.stringify(V)), await B.updateStatic(a._id, u);
704
703
  } else {
705
704
  const { file: P, ...D } = a;
706
- d.append("segment", JSON.stringify(D)), await B.createStatic(d);
705
+ u.append("segment", JSON.stringify(D)), await B.createStatic(u);
707
706
  }
708
- a.file && y.open({
707
+ a.file && f.open({
709
708
  type: "info",
710
709
  title: "Import begins soon. Check Queue for updates.",
711
710
  action: "View",
712
711
  onAction: async () => {
713
- await f.push({
712
+ await w.push({
714
713
  name: _e["$connect-QUEUE"],
715
714
  query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
716
715
  });
717
716
  }
718
717
  });
719
718
  } else if (a._id) {
720
- const { members: d, _id: P, ...D } = a;
719
+ const { members: u, _id: P, ...D } = a;
721
720
  await B.update(a._id, D);
722
721
  } else
723
722
  await B.create(a);
724
- await A({ pageSize: 10, pageIndex: 0 }), (o = n.value) == null || o.hideSheet();
723
+ await A({ pageSize: 10, pageIndex: 0 }), (o = i.value) == null || o.hideSheet();
725
724
  },
726
725
  {
727
726
  message: "Saving segment",
@@ -729,16 +728,16 @@ const Ct = {
729
728
  }
730
729
  );
731
730
  }
732
- function u(a) {
731
+ function d(a) {
733
732
  var o;
734
- (o = n.value) == null || o.showSheet(a);
733
+ (o = i.value) == null || o.showSheet(a);
735
734
  }
736
735
  const s = {
737
- label: x("connect.navigation.queue"),
736
+ label: _("connect.navigation.queue"),
738
737
  value: "queue",
739
738
  isPrimary: !1,
740
739
  prependIcon: "work_history"
741
- }, v = ce(() => h.isPremium ? [
740
+ }, g = ce(() => C.isPremium ? [
742
741
  s,
743
742
  {
744
743
  label: "Refresh segments",
@@ -755,13 +754,13 @@ const Ct = {
755
754
  function U(a) {
756
755
  switch (a) {
757
756
  case "add":
758
- u();
757
+ d();
759
758
  break;
760
759
  case "refresh":
761
- S();
760
+ h();
762
761
  break;
763
762
  case "queue":
764
- f.push({
763
+ w.push({
765
764
  name: _e["$connect-QUEUE"],
766
765
  query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
767
766
  });
@@ -776,51 +775,51 @@ const Ct = {
776
775
  search: void 0,
777
776
  descending: !1
778
777
  });
779
- F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await h.readPremium(), await h.readLocations();
778
+ F.value = a.totalResources ?? 0, await A({ pageSize: 10, pageIndex: 0 }), await C.readPremium(), await C.readLocations();
780
779
  }), (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
+ const u = S("FmPill"), P = S("FmPageHead"), D = S("FmIcon"), N = S("FmMenuItem"), V = S("FmMenu"), j = S("FmListItem"), q = S("FmList"), G = S("FmButton"), te = S("FmCard");
782
781
  return p(), k(O, null, [
783
782
  r(P, {
784
783
  title: "Segments",
785
- actions: t(v),
784
+ actions: t(g),
786
785
  "onClick:action": o[0] || (o[0] = (M) => U(M))
787
786
  }, {
788
787
  title: E(() => [
789
- l("div", kt, [
790
- l("span", It, $(t(x)("connect.loyalty.segment.title")), 1),
791
- r(d, { variant: "premium" })
788
+ l("div", It, [
789
+ l("span", Mt, R(t(_)("connect.loyalty.segment.title")), 1),
790
+ r(u, { variant: "premium" })
792
791
  ])
793
792
  ]),
794
793
  _: 1
795
794
  }, 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, {
795
+ l("div", Tt, [
796
+ t(b).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
797
+ r(Fe, {
799
798
  loading: t(c).isLoading,
800
- "row-data": t(C),
799
+ "row-data": t(b),
801
800
  "row-count": t(c).totalRows,
802
- "column-defs": i,
801
+ "column-defs": n,
803
802
  "shrink-at": !1,
804
803
  "page-count": t(c).pageCount,
805
804
  "page-index": t(c).pageIndex,
806
805
  "page-size": t(c).pageSize,
807
806
  onRowClick: o[1] || (o[1] = (M) => {
808
- u(M.original);
807
+ d(M.original);
809
808
  }),
810
809
  onPageChange: t(A)
811
810
  }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
812
- r(q, { class: "w-full hidden xs:block" }, {
811
+ r(q, { class: "w-full hidden xs:!block" }, {
813
812
  default: E(() => [
814
- (p(!0), k(O, null, ie(t(C), (M) => (p(), J(j, {
813
+ (p(!0), k(O, null, ie(t(b), (M) => (p(), J(j, {
815
814
  key: M._id.toString(),
816
815
  tag: "label",
817
- onClick: (Q) => u(M)
816
+ onClick: (Q) => d(M)
818
817
  }, {
819
818
  default: E(() => [
820
819
  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
+ l("div", Et, R((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
821
+ l("div", At, R(M.name), 1),
822
+ l("div", Dt, R(((M.memberCount ?? 0) * 100 / t(F)).toFixed(2)) + "% of customers ", 1)
824
823
  ])
825
824
  ]),
826
825
  append: E(() => [
@@ -832,7 +831,7 @@ const Ct = {
832
831
  r(N, {
833
832
  class: "text-fm-color-typo-error fm-typo-en-body-md-400",
834
833
  label: "Remove",
835
- "onUpdate:modelValue": (Q) => Q && g(M)
834
+ "onUpdate:modelValue": (Q) => Q && y(M)
836
835
  }, null, 8, ["onUpdate:modelValue"])
837
836
  ]),
838
837
  _: 2
@@ -860,16 +859,16 @@ const Ct = {
860
859
  r(G, {
861
860
  variant: "primary",
862
861
  label: "Create segment",
863
- disabled: !t(h).isPremium,
862
+ disabled: !t(C).isPremium,
864
863
  icon: "add",
865
- onClick: o[2] || (o[2] = (M) => u())
864
+ onClick: o[2] || (o[2] = (M) => d())
866
865
  }, null, 8, ["disabled"])
867
866
  ]),
868
867
  _: 1
869
868
  })),
870
- r(Ft, {
869
+ r(ht, {
871
870
  ref_key: "sheetRef",
872
- ref: n,
871
+ ref: i,
873
872
  "onUpdate:modelValue": I
874
873
  }, null, 512)
875
874
  ])