@feedmepos/mf-connect 0.1.0-beta.4 → 0.1.0-beta.41

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 (106) hide show
  1. package/dist/Analytic-C7iDpCvx.js +426 -0
  2. package/dist/{App-BnQwjxIr.js → App-rOEspgIk.js} +397 -384
  3. package/dist/{Broadcast-y1kP18mo.js → Broadcast-CI61-FqI.js} +32 -32
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dj0JUMOk.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BL_KxlIX.js} +6 -8
  5. package/dist/Card-CUzEZnUC.js +894 -0
  6. package/dist/{Collections-DPfbZMg1.js → Collections-zYhQfAph.js} +28 -34
  7. package/dist/{Credit-QleM_b6q.js → Credit-D6G2xUEu.js} +14 -14
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CxxmBzPu.js +2209 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-2hRTF1EJ.js → EffectSheet.vue_vue_type_style_index_0_lang-Drd0ZjdQ.js} +8 -8
  11. package/dist/{Experience-DGKj8ChY.js → Experience-Cqn6cpA4.js} +8 -8
  12. package/dist/{Game-BxRdzSma.js → Game-CGrL5xmK.js} +15 -15
  13. package/dist/Index-CCcuCcmL.js +255 -0
  14. package/dist/Marketing-DhZHedDV.js +20070 -0
  15. package/dist/{Member-CteeBDi2.js → Member-CB8o8wLL.js} +4 -4
  16. package/dist/MemberList-D6zRpcwU.js +1554 -0
  17. package/dist/MemberTransactions-HCaDl8dN.js +45 -0
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CZ2M8huU.js → MessageInput.vue_vue_type_script_setup_true_lang-CqlGFgwF.js} +2 -2
  19. package/dist/{Mission-CZgXBa09.js → Mission-CexuwCSV.js} +98 -86
  20. package/dist/Overview-CZk3IHyA.js +1063 -0
  21. package/dist/{Point-C2vzEfRP.js → Point-DJ_sLiid.js} +23 -23
  22. package/dist/{Promotion-337OT0sP.js → Promotion-CWBpjPXQ.js} +53 -47
  23. package/dist/Record-CwT9Pmjn.js +337 -0
  24. package/dist/Reward-DhOIXKAB.js +432 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-UP4KtCK2.js +149 -0
  26. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BNw-CED0.js +1637 -0
  27. package/dist/Segment-BE7Bt2tH.js +566 -0
  28. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CDyT_cSb.js +181 -0
  29. package/dist/{Setting-DVK2594u.js → Setting-D1k2xVYx.js} +609 -586
  30. package/dist/Store-BzoJ_ZBZ.js +1743 -0
  31. package/dist/{StoreRewards-BpEmNueE.js → StoreRewards-OAPmCssF.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BIr5Zzij.js +1099 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DT48bSiH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C2fU1byp.js} +1 -1
  34. package/dist/{Tier-BwvOhyXR.js → Tier-IHJ7dlTI.js} +325 -317
  35. package/dist/{Title-DRPdKYRO.js → Title-C4KcQWk_.js} +197 -183
  36. package/dist/{Transaction-BnLvacwW.js → Transaction-B7SWRleT.js} +2 -2
  37. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DOXLpM1y.js +130 -0
  38. package/dist/{Voucher-BQL8J_EA.js → Voucher-Dzh-oh1p.js} +40 -40
  39. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DeTWCZF1.js +419 -0
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B316b_ta.js → ZodTextField.vue_vue_type_script_setup_true_lang-rBa59HC1.js} +1 -1
  41. package/dist/{app-BVaQwBvq.js → app-BkSGMADw.js} +1 -1
  42. package/dist/{app-zO552-Dl.js → app-ZePrUEIY.js} +1183 -1154
  43. package/dist/app.js +1 -1
  44. package/dist/{business-BSl6NSdS.js → business-CG7GnAu5.js} +1 -1
  45. package/dist/campaign-BSH9FJHx.js +1810 -0
  46. package/dist/{campaign-CxN6mq_l.js → campaign-DFvmN5Ky.js} +2 -2
  47. package/dist/campaign.enum-CBlGXHp0.js +20 -0
  48. package/dist/campaign.fn-BszsH1EQ.js +758 -0
  49. package/dist/collectible.enum-Sd3QSyrd.js +19 -0
  50. package/dist/{collection.fn-C-2dyWp9.js → collection.fn-CIFllkyx.js} +2 -2
  51. package/dist/dto-DG2Ckvh4.js +214 -0
  52. package/dist/{effect-D8y0J47O.js → effect-CWSFIfZh.js} +9 -9
  53. package/dist/email-addresses-BCNsQNXA.js +705 -0
  54. package/dist/{export-BxTrifKO.js → export-DKe01mG4.js} +3 -3
  55. package/dist/{helper-bEmZlTwA.js → helper-Et1Q6YUA.js} +1 -1
  56. package/dist/{index-DHTYWfTs.js → index-Bk281EIF.js} +207 -195
  57. package/dist/{index-B2qriSSk.js → index-CHAvEqB_.js} +1 -1
  58. package/dist/index-CMEY40F9.js +32 -0
  59. package/dist/index-CsaQJMAR.js +66 -0
  60. package/dist/{index-C_WyKCqN.js → index-D4FT-dGm.js} +1 -1
  61. package/dist/{index-JBp0chol.js → index-D_sLK5cZ.js} +1500 -1479
  62. package/dist/{index-Dnv999nc.js → index-Dkl_Y2Ir.js} +1 -1
  63. package/dist/{index-Ckz-D_AP.js → index-Dlv6dpg5.js} +2188 -931
  64. package/dist/index-DrRQsR1a.js +44 -0
  65. package/dist/{index-DuYb25dY.js → index-DzZDUZ8E.js} +37 -4
  66. package/dist/index-F1sEdtX3.js +54 -0
  67. package/dist/index-RFzgIvoM.js +29000 -0
  68. package/dist/{index-BFWCbVq2.js → index-RhGXDJ8R.js} +1 -1
  69. package/dist/index-vh86FiIQ.js +10 -0
  70. package/dist/{index.esm2017-Tw7KabwI.js → index.esm2017-COLDuQQ-.js} +1 -1
  71. package/dist/{loading-60xYxow_.js → loading-DxppIZmv.js} +1714 -1720
  72. package/dist/{membership-43FU3EmV.js → membership-DIBN0bog.js} +52 -44
  73. package/dist/money-L7YJDctU.js +15 -0
  74. package/dist/number-BAUL1NQ9.js +12 -0
  75. package/dist/objectid-BXKVeU2w.js +145 -0
  76. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  77. package/dist/reward-Qjelc0jm.js +36 -0
  78. package/dist/{rule-DlHrKp8K.js → rule-BAqQRjqc.js} +180 -177
  79. package/dist/{rule-builder-CU8P8b8U.js → rule-builder-D2hQiWL6.js} +1 -1
  80. package/dist/style.css +1 -1
  81. package/dist/{template-9StyN-b7.js → template-NVFsa0l_.js} +5 -5
  82. package/dist/trigger-qeiGHLZs.js +114 -0
  83. package/dist/{xlsx-CrRvm5Vs.js → usePagination-De7j-UtU.js} +3183 -2962
  84. package/dist/user-CKVD-V1i.js +54 -0
  85. package/dist/{vue-i18n-UKlvivrG.js → vue-i18n-CTdcKDi0.js} +2 -2
  86. package/package.json +8 -7
  87. package/dist/Analytic-BtldByrt.js +0 -622
  88. package/dist/Card-kW7k8kOl.js +0 -825
  89. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BtI2rY4y.js +0 -2813
  90. package/dist/Marketing-CG4GQdax.js +0 -316
  91. package/dist/MemberList-CANkPyR0.js +0 -1733
  92. package/dist/MemberTransactions-CcCa21fY.js +0 -38
  93. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dh3naMXv.js +0 -1753
  94. package/dist/Segment-Clstp5D-.js +0 -437
  95. package/dist/Store-PnpBvIoo.js +0 -1511
  96. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CrDhK2dt.js +0 -890
  97. package/dist/dto-B20bsdh6.js +0 -2770
  98. package/dist/index-BUCjM4jq.js +0 -29193
  99. package/dist/index-Ceu2PcnH.js +0 -206
  100. package/dist/index-CuvNtC_M.js +0 -61
  101. package/dist/index-D3DAgTFI.js +0 -762
  102. package/dist/index-Kjelmo0Y.js +0 -298
  103. package/dist/money-CmR3-qMz.js +0 -15
  104. package/dist/number-CZlrO6Sq.js +0 -12
  105. package/dist/usePagination-BeF5K3M7.js +0 -223
  106. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,15 +1,15 @@
1
- import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as w, resolveDynamicComponent as q } from "vue";
1
+ import { defineComponent as j, ref as P, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as w, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as x, resolveDynamicComponent as q } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q, u as W } from "./loading-60xYxow_.js";
5
- import { u as X } from "./business-BSl6NSdS.js";
6
- import { u as Y } from "./campaign-CxN6mq_l.js";
7
- import { g as I, b as P } from "./dto-B20bsdh6.js";
4
+ import { p as Q, u as W } from "./loading-DxppIZmv.js";
5
+ import { u as X } from "./business-CG7GnAu5.js";
6
+ import { u as Y } from "./campaign-DFvmN5Ky.js";
7
+ import { g as V, a as I } from "./campaign-BSH9FJHx.js";
8
8
  import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BtI2rY4y.js";
10
- import { u as te } from "./template-9StyN-b7.js";
11
- import { u as oe } from "./vue-i18n-UKlvivrG.js";
12
- import { c as _ } from "./index-C_WyKCqN.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CxxmBzPu.js";
10
+ import { u as te } from "./template-NVFsa0l_.js";
11
+ import { u as oe } from "./vue-i18n-CTdcKDi0.js";
12
+ import { c as _ } from "./index-D4FT-dGm.js";
13
13
  const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
14
14
  __name: "Point",
15
15
  setup(he) {
@@ -20,7 +20,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
20
20
  value: "create",
21
21
  isPrimary: !0,
22
22
  prependIcon: "add"
23
- }, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
23
+ }, $ = te("COIN", G()), h = X(), m = Y(), { global: K, minor: C } = W, i = P({
24
24
  searchKey: "",
25
25
  location: null
26
26
  }), u = A(
@@ -35,12 +35,12 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
35
35
  {
36
36
  header: s("connect.program.common.table.status"),
37
37
  cell(e) {
38
- return I(e.row.original);
38
+ return V(e.row.original);
39
39
  }
40
40
  },
41
41
  {
42
42
  header: s("connect.program.common.table.summary"),
43
- accessorFn: (e) => P(e)
43
+ accessorFn: (e) => I(e)
44
44
  },
45
45
  {
46
46
  header: s("connect.program.common.table.actions"),
@@ -55,7 +55,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
55
55
  });
56
56
  }
57
57
  }
58
- ], v = V();
58
+ ], v = P();
59
59
  async function F(e) {
60
60
  await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
61
61
  async () => {
@@ -98,10 +98,10 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
98
98
  });
99
99
  }), (e, o) => {
100
100
  const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
101
- return d(), h(b, null, [
101
+ return d(), w(b, null, [
102
102
  r(y, {
103
103
  title: t(s)("connect.program.point.title"),
104
- actions: t(u).length > 0 ? [B] : [],
104
+ actions: t(u).length > 0 && t(h).isPremium ? [B] : [],
105
105
  "onClick:action": o[0] || (o[0] = () => f())
106
106
  }, {
107
107
  title: g(() => [
@@ -120,7 +120,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
120
120
  placeholder: "search",
121
121
  collapsible: ""
122
122
  }, null, 8, ["modelValue"]),
123
- t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(b, { key: 0 }, [
123
+ t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), w(b, { key: 0 }, [
124
124
  n("div", ie, [
125
125
  n("div", re, [
126
126
  r(Z, {
@@ -130,7 +130,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
130
130
  "show-item-label": !0,
131
131
  icon: "storefront",
132
132
  placement: "bottom-start",
133
- items: t(x).locationItems
133
+ items: t(h).locationItems
134
134
  }, null, 8, ["modelValue", "items"])
135
135
  ]),
136
136
  r(k, {
@@ -152,9 +152,9 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
152
152
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
153
153
  r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
154
154
  default: g(() => [
155
- (d(!0), h(b, null, H(t(u).filter(
155
+ (d(!0), w(b, null, H(t(u).filter(
156
156
  (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
157
- ), (a) => (d(), w(U, {
157
+ ), (a) => (d(), x(U, {
158
158
  key: a._id.toString(),
159
159
  onClick: (L) => f(a),
160
160
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
@@ -162,12 +162,12 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
162
162
  default: g(() => [
163
163
  n("div", le, [
164
164
  n("div", ce, [
165
- (d(), w(q(t(I)(a)))),
165
+ (d(), x(q(t(V)(a)))),
166
166
  n("div", me, c(t(s)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
167
167
  ]),
168
168
  n("div", de, [
169
169
  n("div", pe, c(a.name), 1),
170
- n("div", ue, c(t(P)(a)), 1)
170
+ n("div", ue, c(t(I)(a)), 1)
171
171
  ]),
172
172
  n("div", fe, " Point received: " + c(a.currentReceive ?? 0), 1)
173
173
  ]),
@@ -183,7 +183,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
183
183
  ]),
184
184
  _: 1
185
185
  })
186
- ], 64)) : (d(), w(T, {
186
+ ], 64)) : (d(), x(T, {
187
187
  key: 1,
188
188
  variant: "outlined",
189
189
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
@@ -200,7 +200,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
200
200
  r(S, {
201
201
  variant: "primary",
202
202
  label: "Create point program",
203
- disabled: !t(x).isPremium,
203
+ disabled: !t(h).isPremium,
204
204
  icon: "add",
205
205
  onClick: o[5] || (o[5] = (a) => f())
206
206
  }, null, 8, ["disabled"])
@@ -1,17 +1,17 @@
1
- import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as l, openBlock as m, createElementBlock as h, Fragment as w, createVNode as r, unref as a, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
1
+ import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as r, openBlock as m, createElementBlock as h, Fragment as w, createVNode as i, unref as a, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
2
2
  import { _ as W } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as X, components as Y } from "@feedmepos/ui-library";
4
- import { c as O, p as I, u as Z } from "./loading-60xYxow_.js";
5
- import { u as ee } from "./business-BSl6NSdS.js";
6
- import { u as oe } from "./campaign-CxN6mq_l.js";
7
- import { u as te } from "./vue-i18n-UKlvivrG.js";
8
- import { g as V } from "./dto-B20bsdh6.js";
9
- import { e as L } from "./effect-D8y0J47O.js";
4
+ import { c as O, p as I, u as Z } from "./loading-DxppIZmv.js";
5
+ import { u as ee } from "./business-CG7GnAu5.js";
6
+ import { u as oe } from "./campaign-DFvmN5Ky.js";
7
+ import { u as te } from "./vue-i18n-CTdcKDi0.js";
8
+ import { g as V } from "./campaign-BSH9FJHx.js";
9
+ import { e as L } from "./effect-CWSFIfZh.js";
10
10
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BtI2rY4y.js";
12
- import { u as se } from "./template-9StyN-b7.js";
13
- import { c as u } from "./index-C_WyKCqN.js";
14
- const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = /* @__PURE__ */ H({
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CxxmBzPu.js";
12
+ import { u as se } from "./template-NVFsa0l_.js";
13
+ import { c as u } from "./index-D4FT-dGm.js";
14
+ const ce = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = /* @__PURE__ */ H({
15
15
  __name: "Promotion",
16
16
  setup(_e) {
17
17
  const { t } = te(), T = {
@@ -24,12 +24,12 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
24
24
  value: "sync",
25
25
  isPrimary: !1,
26
26
  prependIcon: "refresh"
27
- }, M = se("PROMOTION", X()), x = ee(), f = oe(), { global: R, minor: _ } = Z, i = S({
27
+ }, M = se("PROMOTION", X()), x = ee(), f = oe(), { global: R, minor: _ } = Z, c = S({
28
28
  searchKey: "",
29
29
  location: null
30
- }), c = q(
30
+ }), l = q(
31
31
  () => f.campaigns.promotion.filter(
32
- (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
32
+ (e) => !c.value.location || !e.targetLocation || e.targetLocation.includes(c.value.location)
33
33
  )
34
34
  ), K = [
35
35
  {
@@ -65,13 +65,17 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
65
65
  }
66
66
  ], C = S();
67
67
  async function F(e) {
68
- await I.remove(t("promotion.confirmRemove", { name: e.name })) && await _(
68
+ await I.remove(
69
+ t("connect.promotion.confirmRemove", { name: e.name })
70
+ ) && await _(
69
71
  async () => {
70
72
  await u.delete(e._id), await f.read("PROMOTION");
71
73
  },
72
74
  {
73
- message: t("promotion.removing", { name: e.name }),
74
- successMessage: t("promotion.removedSuccessfully", { name: e.name })
75
+ message: t("connect.promotion.removing", { name: e.name }),
76
+ successMessage: t("connect.promotion.removedSuccessfully", {
77
+ name: e.name
78
+ })
75
79
  }
76
80
  );
77
81
  }
@@ -95,9 +99,11 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
95
99
  e.campaign._id ? await u.update(e.campaign._id, e) : await u.create(e), await f.read("PROMOTION");
96
100
  },
97
101
  {
98
- message: t(e.campaign._id ? "promotion.updating" : "promotion.creating"),
102
+ message: t(
103
+ e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
104
+ ),
99
105
  successMessage: t(
100
- e.campaign._id ? "promotion.updatedSuccessfully" : "promotion.createdSuccessfully"
106
+ e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
101
107
  )
102
108
  }
103
109
  );
@@ -128,27 +134,27 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
128
134
  await x.readLocations(), await f.read("PROMOTION");
129
135
  });
130
136
  }), (e, n) => {
131
- const p = l("FmPageHead"), d = l("FmSearch"), $ = l("FmTable"), D = l("FmChip"), k = l("FmButton"), U = l("FmListItem"), j = l("FmList"), E = l("FmCard");
137
+ const p = r("FmPageHead"), d = r("FmSearch"), $ = r("FmTable"), D = r("FmChip"), k = r("FmButton"), U = r("FmListItem"), j = r("FmList"), E = r("FmCard");
132
138
  return m(), h(w, null, [
133
- r(p, {
139
+ i(p, {
134
140
  title: a(t)("connect.promotion.title"),
135
- actions: a(c).length > 0 ? [T, B] : [],
141
+ actions: a(l).length > 0 ? [T, B] : [],
136
142
  "onClick:action": A
137
143
  }, null, 8, ["title", "actions"]),
138
- s("div", ie, [
139
- r(d, {
140
- modelValue: i.value.searchKey,
141
- "onUpdate:modelValue": n[0] || (n[0] = (o) => i.value.searchKey = o),
144
+ s("div", ce, [
145
+ i(d, {
146
+ modelValue: c.value.searchKey,
147
+ "onUpdate:modelValue": n[0] || (n[0] = (o) => c.value.searchKey = o),
142
148
  class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
143
149
  placeholder: a(t)("connect.promotion.search"),
144
150
  collapsible: ""
145
151
  }, null, 8, ["modelValue", "placeholder"]),
146
- a(c) && a(c).length > 0 ? (m(), h(w, { key: 0 }, [
147
- s("div", re, [
148
- s("div", le, [
149
- r(ne, {
150
- modelValue: i.value.location,
151
- "onUpdate:modelValue": n[1] || (n[1] = (o) => i.value.location = o),
152
+ a(l) && a(l).length > 0 ? (m(), h(w, { key: 0 }, [
153
+ s("div", ie, [
154
+ s("div", re, [
155
+ i(ne, {
156
+ modelValue: c.value.location,
157
+ "onUpdate:modelValue": n[1] || (n[1] = (o) => c.value.location = o),
152
158
  label: a(t)("connect.promotion.location"),
153
159
  "show-item-label": !0,
154
160
  icon: "storefront",
@@ -156,37 +162,37 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
156
162
  items: a(x).locationItems
157
163
  }, null, 8, ["modelValue", "label", "items"])
158
164
  ]),
159
- r(d, {
160
- modelValue: i.value.searchKey,
161
- "onUpdate:modelValue": n[2] || (n[2] = (o) => i.value.searchKey = o),
165
+ i(d, {
166
+ modelValue: c.value.searchKey,
167
+ "onUpdate:modelValue": n[2] || (n[2] = (o) => c.value.searchKey = o),
162
168
  class: "xs:hidden",
163
169
  placeholder: "search",
164
170
  collapsible: ""
165
171
  }, null, 8, ["modelValue"])
166
172
  ]),
167
- r($, {
173
+ i($, {
168
174
  class: "xs:hidden",
169
- "row-data": a(c),
175
+ "row-data": a(l),
170
176
  "column-defs": K,
171
- "search-value": i.value.searchKey,
177
+ "search-value": c.value.searchKey,
172
178
  "column-filter": [],
173
179
  onRowClick: n[3] || (n[3] = (o) => y(o.original)),
174
- "hide-footer": a(c).length < 10
180
+ "hide-footer": a(l).length < 10
175
181
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
176
- r(j, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
182
+ i(j, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
177
183
  default: v(() => [
178
- (m(!0), h(w, null, J(a(c).filter(
179
- (o) => o.name.toLowerCase().includes(i.value.searchKey.toLowerCase())
184
+ (m(!0), h(w, null, J(a(l).filter(
185
+ (o) => o.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
180
186
  ), (o) => (m(), b(U, {
181
187
  key: o._id.toString(),
182
188
  onClick: (P) => y(o),
183
189
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
184
190
  }, {
185
191
  default: v(() => [
186
- s("div", ce, [
192
+ s("div", le, [
187
193
  s("div", me, [
188
194
  (m(), b(Q(a(V)(o)))),
189
- r(D, {
195
+ i(D, {
190
196
  class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
191
197
  compact: !0,
192
198
  label: `${a(O).title(o.effect.options.target)} promotion`
@@ -197,7 +203,7 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
197
203
  s("div", ue, g(a(L)(o.effect)), 1)
198
204
  ])
199
205
  ]),
200
- r(k, {
206
+ i(k, {
201
207
  icon: "delete",
202
208
  "icon-color": "neutral-gray-400",
203
209
  variant: "tertiary",
@@ -223,7 +229,7 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
223
229
  s("div", ye, g(a(t)("connect.promotion.createPromotionCampaign")), 1),
224
230
  s("div", ge, g(a(t)("connect.promotion.description")), 1)
225
231
  ]),
226
- r(k, {
232
+ i(k, {
227
233
  variant: "primary",
228
234
  label: a(t)("connect.promotion.createPromotionCampaign"),
229
235
  icon: "add",
@@ -233,7 +239,7 @@ const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-
233
239
  _: 1
234
240
  }))
235
241
  ]),
236
- r(ae, {
242
+ i(ae, {
237
243
  ref_key: "sheetRef",
238
244
  ref: C,
239
245
  "onSubmit:modelValue": N
@@ -0,0 +1,337 @@
1
+ var K = Object.defineProperty;
2
+ var W = (g, i, m) => i in g ? K(g, i, { enumerable: !0, configurable: !0, writable: !0, value: m }) : g[i] = m;
3
+ var $ = (g, i, m) => W(g, typeof i != "symbol" ? i + "" : i, m);
4
+ import { defineComponent as A, ref as V, computed as q, resolveComponent as x, openBlock as B, createBlock as G, unref as s, isRef as H, withCtx as J, createElementBlock as T, createVNode as C, withModifiers as Q, createCommentVNode as X, createElementVNode as I, h as S, onMounted as Z, Fragment as ee } from "vue";
5
+ import { u as D, a as re, _ as te, w as oe } from "./usePagination-De7j-UtU.js";
6
+ import { g as z } from "./user-CKVD-V1i.js";
7
+ import { components as v } from "@feedmepos/ui-library";
8
+ import { u as U, a as ae, c as se } from "./loading-DxppIZmv.js";
9
+ import { u as ie } from "./vue-i18n-CTdcKDi0.js";
10
+ import { useCoreStore as ne } from "@feedmepos/mf-common";
11
+ import { r as R } from "./index-CMEY40F9.js";
12
+ import { c as ce, a as le } from "./object-qECH92oz.js";
13
+ import { u as de } from "./membership-DIBN0bog.js";
14
+ import { e as f } from "./index-vh86FiIQ.js";
15
+ import { h as me } from "./moment-BWErdI6_.js";
16
+ import { o as ue } from "./objectId-dwaoBfJX.js";
17
+ const pe = {
18
+ key: 0,
19
+ class: "flex justify-end mb-16"
20
+ }, fe = { class: "flex flex-col space-y-16 pr-12" }, ge = /* @__PURE__ */ A({
21
+ __name: "UpdateCriteriaProgressSheet",
22
+ emits: ["refresh"],
23
+ setup(g, { expose: i, emit: m }) {
24
+ const k = m;
25
+ ie();
26
+ const { minor: u } = U, h = V(!1), n = V({}), y = ne(), F = [
27
+ {
28
+ header: "Criteria title",
29
+ accessorFn: (t) => t.name
30
+ },
31
+ {
32
+ header: "Status",
33
+ cell(t) {
34
+ var p;
35
+ const e = t.row.original, o = (p = n.value.criteria_progress) == null ? void 0 : p.find(
36
+ (w) => w.criteria === e._id
37
+ ), c = o ? "Completed" : "Pending", l = o ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100";
38
+ return [
39
+ S(v.FmChip, {
40
+ label: c,
41
+ compact: !0,
42
+ class: l
43
+ })
44
+ ];
45
+ }
46
+ },
47
+ {
48
+ id: "actions",
49
+ cell(t) {
50
+ var c;
51
+ const e = t.row.original;
52
+ return [
53
+ !((c = n.value.criteria_progress) == null ? void 0 : c.some(
54
+ (l) => l.criteria === e._id
55
+ )) && e.type == "MANUAL" ? S(v.FmButton, {
56
+ variant: "secondary",
57
+ label: "Mark as completed",
58
+ size: "md",
59
+ onClick: (l) => {
60
+ l.stopPropagation(), r(e._id.toString());
61
+ }
62
+ }) : null
63
+ ];
64
+ }
65
+ }
66
+ ], M = q(() => {
67
+ var e, o, c, l;
68
+ return (((o = (e = n.value) == null ? void 0 : e.criteria_progress) == null ? void 0 : o.filter(
69
+ (p) => {
70
+ var w;
71
+ return (w = n.value) == null ? void 0 : w.criteria.some(
72
+ (d) => d._id.toString() === p.criteria.toString()
73
+ );
74
+ }
75
+ )) || []).length == ((c = n.value) == null ? void 0 : c.criteria.length) && ((l = n.value) == null ? void 0 : l.status) != "COMPLETED";
76
+ });
77
+ async function r(t) {
78
+ var o;
79
+ const e = ce(le(n.value));
80
+ e.criteria_progress = [
81
+ {
82
+ criteria: t,
83
+ ref: `ADMIN:${(o = y.user) == null ? void 0 : o.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
84
+ completedAt: /* @__PURE__ */ new Date()
85
+ }
86
+ ], u(
87
+ async () => {
88
+ await R.updateCriteriaProgress(
89
+ n.value._id,
90
+ e
91
+ ), h.value = !1, k("refresh");
92
+ },
93
+ {
94
+ message: "Updating criteria progress",
95
+ successMessage: "Criteria progress updated successfully"
96
+ }
97
+ );
98
+ }
99
+ function a(t, e) {
100
+ h.value = t, n.value = e;
101
+ }
102
+ function _() {
103
+ h.value = !1;
104
+ }
105
+ return i({
106
+ showSheet: a,
107
+ hideSheet: _,
108
+ data: n
109
+ }), (t, e) => {
110
+ const o = x("FmButton"), c = x("FmTable"), l = x("FmSideSheet");
111
+ return B(), G(l, {
112
+ "max-width": 768,
113
+ modelValue: s(h),
114
+ "onUpdate:modelValue": e[1] || (e[1] = (p) => H(h) ? h.value = p : null),
115
+ header: "Referee Criteria"
116
+ }, {
117
+ default: J(() => [
118
+ s(M) ? (B(), T("div", pe, [
119
+ C(o, {
120
+ icon: "refresh",
121
+ label: "Refresh",
122
+ onClick: e[0] || (e[0] = Q((p) => r(s(n)._id), ["stop"]))
123
+ })
124
+ ])) : X("", !0),
125
+ I("div", fe, [
126
+ C(c, {
127
+ "row-data": s(n).criteria,
128
+ "hide-footer": !0,
129
+ "page-size": 100,
130
+ "column-defs": F
131
+ }, null, 8, ["row-data"])
132
+ ])
133
+ ]),
134
+ _: 1
135
+ }, 8, ["modelValue"]);
136
+ };
137
+ }
138
+ });
139
+ class he {
140
+ constructor() {
141
+ $(this, "data", []);
142
+ }
143
+ addRecord(i) {
144
+ this.data.push(i);
145
+ }
146
+ buildExcel() {
147
+ const i = D.book_new(), m = D.json_to_sheet(this.data);
148
+ return D.book_append_sheet(i, m, "Referrals"), i;
149
+ }
150
+ }
151
+ const _e = { class: "flex items-center justify-end" }, Be = /* @__PURE__ */ A({
152
+ __name: "Record",
153
+ setup(g) {
154
+ de();
155
+ const { minor: i } = U, m = V(null), k = [
156
+ {
157
+ header: "ID",
158
+ meta: {
159
+ maxWidth: "100px"
160
+ },
161
+ cell(r) {
162
+ return S("div", { class: "flex items-center" }, [
163
+ S(v.FmIcon, {
164
+ name: "content_copy",
165
+ outline: !0,
166
+ size: "sm",
167
+ class: "cursor-pointer mr-4",
168
+ onClick: (a) => {
169
+ a.preventDefault(), a.stopPropagation(), ae(r.row.original._id.toString());
170
+ }
171
+ }),
172
+ S(
173
+ "div",
174
+ { class: "pr-2 text-ellipsis overflow-hidden" },
175
+ r.row.original._id.toString()
176
+ )
177
+ ]);
178
+ },
179
+ enableSorting: !1
180
+ },
181
+ {
182
+ header: "Referer info",
183
+ enableSorting: !0,
184
+ cell(r) {
185
+ return r.row.original.pf_referer ? z(r.row.original.pf_referer, !0) : "N/A";
186
+ }
187
+ },
188
+ {
189
+ header: "Referee info",
190
+ enableSorting: !0,
191
+ cell(r) {
192
+ return r.row.original.pf_referee ? z(r.row.original.pf_referee, !0) : "N/A";
193
+ }
194
+ },
195
+ {
196
+ header: "Referee criteria",
197
+ accessorKey: "criteria",
198
+ id: "criteria",
199
+ cell(r) {
200
+ var e;
201
+ const _ = (((e = r.row.original.criteria_progress) == null ? void 0 : e.filter(
202
+ (o) => r.row.original.criteria.some(
203
+ (c) => c._id.toString() === o.criteria.toString()
204
+ )
205
+ )) || []).length, t = r.row.original.criteria.length;
206
+ return t === 0 ? S("div", "No criteria") : S("div", `${_}/${t} completed criteria`);
207
+ }
208
+ },
209
+ {
210
+ header: "Status",
211
+ id: "status",
212
+ cell(r) {
213
+ const a = r.row.original.status;
214
+ return S(v.FmChip, {
215
+ label: se.title(a.replace("_", " ")),
216
+ compact: !0,
217
+ class: a == "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-primary bg-fm-color-system-primary-100"
218
+ });
219
+ }
220
+ }
221
+ ], { tableMeta: u, rowData: h, onSort: n, debouncedFetchData: y, onSearch: F } = re(R.readRecords);
222
+ async function M() {
223
+ const r = new he(), a = (await R.readRecords({
224
+ limit: 1,
225
+ skip: 0,
226
+ sortBy: f.sortBy,
227
+ descending: f.descending
228
+ })).meta.totalResources ?? 0, _ = f.rowsPerPage;
229
+ await i(
230
+ async () => {
231
+ var t, e, o, c;
232
+ for (let l = 0; l < a; l += _) {
233
+ const p = {
234
+ ...f,
235
+ limit: _,
236
+ skip: f.page - 1,
237
+ sortBy: f.sortBy,
238
+ descending: f.descending
239
+ }, w = await R.readRecords(p);
240
+ for (const d of w.resources) {
241
+ const N = (d.criteria || []).reduce(
242
+ (b, P) => {
243
+ var E;
244
+ const L = ((E = d.criteria_progress) == null ? void 0 : E.filter(
245
+ (O) => d.criteria.some(
246
+ (Y) => Y._id.toString() === O.criteria.toString()
247
+ )
248
+ )) || [];
249
+ return b[P.name] = L.length > 0 ? "Completed" : "In Progress", b;
250
+ },
251
+ {}
252
+ );
253
+ console.log(N);
254
+ const j = {
255
+ ID: d._id.toString(),
256
+ RefererName: ((t = d.pf_referer) == null ? void 0 : t.name) ?? "",
257
+ RefererPhone: ((e = d.pf_referer) == null ? void 0 : e.phoneNumber) ?? "",
258
+ RefereeName: ((o = d.pf_referee) == null ? void 0 : o.name) ?? "",
259
+ RefereePhone: ((c = d.pf_referee) == null ? void 0 : c.phoneNumber) ?? "",
260
+ ReferredAt: me(ue(d._id)).format(
261
+ "DD/MM/YYYY"
262
+ ),
263
+ Status: d.status,
264
+ Criteria: Object.entries(N).map(([b, P]) => `${b}: ${P}`).join(", ")
265
+ };
266
+ r.addRecord(j);
267
+ }
268
+ f.page++;
269
+ }
270
+ await oe(
271
+ r.buildExcel(),
272
+ `referrals-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
273
+ {
274
+ bookType: "xlsx",
275
+ bookSST: !1,
276
+ type: "array"
277
+ }
278
+ ), f.page = 1;
279
+ },
280
+ {
281
+ message: "Exporting referral records...",
282
+ successMessage: "Referral record exported successfully"
283
+ }
284
+ );
285
+ }
286
+ return Z(async () => {
287
+ await y();
288
+ }), (r, a) => {
289
+ const _ = x("FmSearch"), t = x("FmButton");
290
+ return B(), T(ee, null, [
291
+ I("div", null, [
292
+ I("div", _e, [
293
+ C(_, {
294
+ class: "mt-4",
295
+ modelValue: s(u).searchValue,
296
+ "onUpdate:modelValue": [
297
+ a[0] || (a[0] = (e) => s(u).searchValue = e),
298
+ s(F)
299
+ ],
300
+ placeholder: "Search",
301
+ collapsible: ""
302
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
303
+ C(t, {
304
+ icon: "ios_share",
305
+ variant: "tertiary",
306
+ onClick: M
307
+ })
308
+ ]),
309
+ C(te, {
310
+ loading: s(u).isLoading,
311
+ "row-data": s(h),
312
+ "row-count": s(u).totalRows,
313
+ "column-defs": k,
314
+ "shrink-at": !1,
315
+ "page-count": s(u).pageCount,
316
+ "page-index": s(u).pageIndex,
317
+ "page-size": s(u).pageSize,
318
+ onSortChange: s(n),
319
+ onPageChange: a[1] || (a[1] = (e) => s(y)({ pageSize: e.pageSize, pageIndex: e.pageIndex })),
320
+ onRowClick: a[2] || (a[2] = (e) => {
321
+ var o;
322
+ return (o = s(m)) == null ? void 0 : o.showSheet(!0, e.original);
323
+ })
324
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
325
+ ]),
326
+ C(ge, {
327
+ ref_key: "updateCriteriaProgressSheetRef",
328
+ ref: m,
329
+ onRefresh: s(y)
330
+ }, null, 8, ["onRefresh"])
331
+ ], 64);
332
+ };
333
+ }
334
+ });
335
+ export {
336
+ Be as default
337
+ };