@feedmepos/mf-connect 0.0.16-beta.10 → 0.0.16-beta.12

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 (85) hide show
  1. package/dist/{Analytic-BVk0jPDU.js → Analytic-DIc9BYb0.js} +32 -20
  2. package/dist/{App-BbAalq1k.js → App-BzzL9_Jw.js} +33 -27
  3. package/dist/Broadcast-dVPgK5QV.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TnEPvafD.js} +18 -11
  5. package/dist/{Card-B5in1RMa.js → Card-Bj2Yd2pr.js} +178 -158
  6. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  7. package/dist/Collections-Fkb_zzqZ.js +453 -0
  8. package/dist/{Credit-Bc9EzdsC.js → Credit-DHn9OkE8.js} +78 -69
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js +2788 -0
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D6mWny8y.js +344 -0
  11. package/dist/{Experience-CgKak5ik.js → Experience-DX3aJihS.js} +64 -55
  12. package/dist/{Game-QhfKqrN_.js → Game-CcVQvETd.js} +54 -45
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  14. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  15. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  16. package/dist/MainLayout-B1aJoR95.js +41 -0
  17. package/dist/{Marketing-CSx4N7UJ.js → Marketing-B9kykWEh.js} +79 -72
  18. package/dist/{Member-CY6WMD8D.js → Member-RoJSCSC5.js} +25 -22
  19. package/dist/{MemberList-8iRwm7Sz.js → MemberList-BUDxqMEK.js} +321 -307
  20. package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bh_tT1Rp.js} +1 -1
  21. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js +432 -0
  22. package/dist/{Mission-BTy1p7lU.js → Mission-DDvgCLy0.js} +50 -40
  23. package/dist/{Point-A6B_ggSy.js → Point-BbPkt4kF.js} +67 -58
  24. package/dist/Promotion-DEo-lxpX.js +221 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js +1751 -0
  26. package/dist/{Segment-CFVXtyEj.js → Segment-DAcpZWIN.js} +145 -130
  27. package/dist/{Setting-Jmtw-_DV.js → Setting-CgXohUPt.js} +167 -154
  28. package/dist/{Store-DQypT-7e.js → Store-BVyHbQ8o.js} +504 -489
  29. package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-sccMDbkj.js} +124 -108
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js} +131 -123
  31. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.js +139 -0
  32. package/dist/{Tier-D1jymeLK.js → Tier--P27XXbB.js} +144 -125
  33. package/dist/{Title-DN9DIP2k.js → Title-B27S3SxD.js} +107 -90
  34. package/dist/{Transaction-BAJvAoU6.js → Transaction-CYTtwwHY.js} +2 -2
  35. package/dist/Voucher-BZ8PKgO5.js +488 -0
  36. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
  37. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  38. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  39. package/dist/app-CnKzqAcN.js +53428 -0
  40. package/dist/app-FfENBuoE.js +5381 -0
  41. package/dist/app-wDQR6dpb.js +39 -0
  42. package/dist/app.js +2 -1
  43. package/dist/business-CXyP9G7A.js +78 -0
  44. package/dist/campaign-0aM2KYOy.js +96 -0
  45. package/dist/campaign-CpzFl8Vr.js +4 -0
  46. package/dist/collection.fn-FicQhH1t.js +26 -0
  47. package/dist/dto-BiYLkVdL.js +1169 -0
  48. package/dist/effect-Cg-eNEjg.js +61 -0
  49. package/dist/{export-DjeNY5Pc.js → export-D7BuObOL.js} +19 -16
  50. package/dist/helper-DvD-D7c7.js +71 -0
  51. package/dist/index-B1Q0GAWp.js +95 -0
  52. package/dist/index-B4UZgSB-.js +28058 -0
  53. package/dist/index-B6c-fUij.js +203 -0
  54. package/dist/index-BP_5cfKa.js +38 -0
  55. package/dist/index-BRXg5Si1.js +2071 -0
  56. package/dist/index-BuDwICBJ.js +761 -0
  57. package/dist/index-CDMC-8iO.js +94 -0
  58. package/dist/index-CcZt3OrE.js +73 -0
  59. package/dist/index-CuvNtC_M.js +61 -0
  60. package/dist/index-DA-fzkRR.js +1737 -0
  61. package/dist/index-Dbd4WA4r.js +61 -0
  62. package/dist/index-Dkeb_9ER.js +8832 -0
  63. package/dist/index-DmdKoKk_.js +298 -0
  64. package/dist/index-G-88ujCM.js +3 -0
  65. package/dist/loading-uCNeZibp.js +32697 -0
  66. package/dist/lodash-B5I3zXaY.js +3678 -0
  67. package/dist/membership-DFRO9TyM.js +221 -0
  68. package/dist/moment-BWErdI6_.js +2578 -0
  69. package/dist/money-OtkT4Pzp.js +15 -0
  70. package/dist/number-Cg3NCouc.js +12 -0
  71. package/dist/object-qECH92oz.js +26 -0
  72. package/dist/objectId-dwaoBfJX.js +7 -0
  73. package/dist/rule-Ch2HRiGw.js +1973 -0
  74. package/dist/rule-builder-B_M9yvEe.js +89 -0
  75. package/dist/template-1o0LbOoJ.js +190 -0
  76. package/dist/usePagination-BeF5K3M7.js +223 -0
  77. package/dist/vue-i18n-AtGIa4qH.js +2365 -0
  78. package/dist/xlsx-pChq0adn.js +15491 -0
  79. package/dist/zod-W_PvIofQ.js +90 -0
  80. package/package.json +3 -3
  81. package/dist/Collections-CFCZ9YIG.js +0 -4
  82. package/dist/MainLayout-JbHzENFy.js +0 -4
  83. package/dist/app-BpzzygYP.js +0 -87765
  84. package/dist/money-DKGIIplY.js +0 -15
  85. package/dist/number-tPodRxTN.js +0 -12
@@ -1,9 +1,21 @@
1
1
  import { defineComponent as D, openBlock as r, createElementBlock as R, Fragment as x, renderList as C, createElementVNode as e, toDisplayString as w, createCommentVNode as h, resolveComponent as X, createBlock as j, withCtx as g, createVNode as F, unref as o, ref as v, computed as O, onMounted as Z, watch as eo, isRef as Q, createSlots as io, createTextVNode as to, reactive as ao, onBeforeMount as ro, normalizeClass as G } from "vue";
2
- import { C as Ko, c as N, J as no, a as Ao, F as Uo, g as lo, d as Fo, Z as so, e as po, f as co, u as Ro, h as uo, i as mo, j as fo, m as Vo } from "./app-BpzzygYP.js";
3
- import { f as qo } from "./number-tPodRxTN.js";
2
+ import { _ as Ko } from "./campaign-CpzFl8Vr.js";
3
+ import { f as no } from "./number-Cg3NCouc.js";
4
+ import { C as Ao, F as Uo, a as lo } from "./dto-BiYLkVdL.js";
4
5
  import { useRouter as $ } from "vue-router";
5
- import { useSnackbar as vo } from "@feedmepos/ui-library";
6
- import { Config as Po } from "@feedmepos/core";
6
+ import { c as N } from "./index-CDMC-8iO.js";
7
+ import { _ as Fo } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js";
8
+ import { Z as so } from "./zod-W_PvIofQ.js";
9
+ import { J as po } from "./JsonViewer-v8_C7l5N.js";
10
+ import { u as co } from "./loading-uCNeZibp.js";
11
+ import { useSnackbar as Ro } from "@feedmepos/ui-library";
12
+ import { u as uo } from "./app-wDQR6dpb.js";
13
+ import { g as mo } from "./object-qECH92oz.js";
14
+ import { u as fo } from "./campaign-0aM2KYOy.js";
15
+ import { u as Vo } from "./membership-DFRO9TyM.js";
16
+ import { u as qo } from "./vue-i18n-AtGIa4qH.js";
17
+ import { c as vo } from "./index-B4UZgSB-.js";
18
+ import { m as Po } from "./index-CcZt3OrE.js";
7
19
  const Xo = { class: "divide-x flex flex-wrap" }, yo = { class: "fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, So = { class: "fm-typo-en-title-sm-800" }, zo = /* @__PURE__ */ D({
8
20
  __name: "CampaignStat",
9
21
  props: {
@@ -23,7 +35,7 @@ const Xo = { class: "divide-x flex flex-wrap" }, yo = { class: "fm-typo-en-body-
23
35
  ];
24
36
  function c(y) {
25
37
  var p;
26
- return qo((p = d.data) == null ? void 0 : p[y], 2, !0) || 0;
38
+ return no((p = d.data) == null ? void 0 : p[y], 2, !0) || 0;
27
39
  }
28
40
  return (y, p) => (r(), R("div", Xo, [
29
41
  (r(), R(x, null, C(s, (a) => (r(), R(x, null, [
@@ -51,7 +63,7 @@ const Xo = { class: "divide-x flex flex-wrap" }, yo = { class: "fm-typo-en-body-
51
63
  }
52
64
  },
53
65
  setup(u) {
54
- const s = Ko[u.type];
66
+ const s = Ao[u.type];
55
67
  return (c, y) => {
56
68
  const p = X("FmIcon"), a = X("FmTooltip");
57
69
  return r(), j(a, {
@@ -224,7 +236,7 @@ const Xo = { class: "divide-x flex flex-wrap" }, yo = { class: "fm-typo-en-body-
224
236
  }), (l, K) => {
225
237
  const m = X("FmTextField");
226
238
  return r(), R(x, null, [
227
- F(no, { json: u.campaigns }, null, 8, ["json"]),
239
+ F(po, { json: u.campaigns }, null, 8, ["json"]),
228
240
  e("div", bo, [
229
241
  e("div", No, [
230
242
  e("div", Do, w(o(c).length) + " campaign(s) linked ", 1),
@@ -255,13 +267,13 @@ const Xo = { class: "divide-x flex flex-wrap" }, yo = { class: "fm-typo-en-body-
255
267
  __name: "AnalyticSheet",
256
268
  emits: ["success"],
257
269
  setup(u, { expose: d, emit: s }) {
258
- const c = s, y = Ao();
259
- vo();
270
+ const c = s, y = uo();
271
+ Ro();
260
272
  const p = v(!1), a = v(!1), U = {
261
273
  name: "",
262
274
  campaigns: []
263
275
  }, l = v(""), K = v({ ...U }), m = Uo.superRefine((A, i) => {
264
- }), V = v([]), q = v(null), { global: J, minor: W } = po, L = O(() => {
276
+ }), V = v([]), q = v(null), { global: J, minor: W } = co, L = O(() => {
265
277
  const A = m.safeParse(K.value);
266
278
  return A.success ? [] : A.error.errors;
267
279
  });
@@ -292,9 +304,9 @@ const Xo = { class: "divide-x flex flex-wrap" }, yo = { class: "fm-typo-en-body-
292
304
  label: f.name,
293
305
  value: f._id
294
306
  }));
295
- return lo(
307
+ return mo(
296
308
  V.value,
297
- (t) => co.formattedType(t.type),
309
+ (t) => lo.formattedType(t.type),
298
310
  A
299
311
  );
300
312
  }), n = O(() => Object.entries(S.value).reduce(
@@ -462,15 +474,15 @@ var $o = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "ht
462
474
  const oe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ee = { class: "space-y-16" }, ie = { class: "flex items-center justify-end" }, te = { class: "fm-typo-en-body-lg-600" }, ae = { class: "grid grid-cols-4 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, re = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, Ke = { class: "fm-typo-en-title-sm-800" }, ne = { class: "flex-grow space-y-16 p-16" }, Ae = { class: "flex items-center justify-between" }, Ue = { class: "flex gap-16" }, le = ["src"], Fe = { class: "pb-16 gap-12 flex flex-col" }, se = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = {
463
475
  key: 0,
464
476
  class: "flex items-center gap-4"
465
- }, ue = ["src"], de = { class: "fm-typo-en-title-sm-800 text-center" }, me = { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, fe = { class: "flex gap-16 items-center" }, ze = /* @__PURE__ */ D({
477
+ }, ue = ["src"], de = { class: "fm-typo-en-title-sm-800 text-center" }, me = { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, fe = { class: "flex gap-16 items-center" }, be = /* @__PURE__ */ D({
466
478
  __name: "Analytic",
467
479
  setup(u) {
468
- const { t: d } = Ro(), s = {
480
+ const { t: d } = qo(), s = {
469
481
  label: d("connect.analytic.addGroup"),
470
482
  value: "create",
471
483
  isPrimary: !0,
472
484
  prependIcon: "add"
473
- }, c = uo(), y = v(), p = v([]), a = v(""), U = ao({
485
+ }, c = fo(), y = v(), p = v([]), a = v(""), U = ao({
474
486
  totalCampaign: 0,
475
487
  totalProgram: 0,
476
488
  totalMember: 0
@@ -505,7 +517,7 @@ const oe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ee = { class: "space
505
517
  }
506
518
  async function q() {
507
519
  var H, T;
508
- const S = await Vo.read({
520
+ const S = await Po.read({
509
521
  limit: 1,
510
522
  skip: 0,
511
523
  sortBy: "_id",
@@ -527,7 +539,7 @@ const oe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ee = { class: "space
527
539
  const J = O(() => p.value.filter((S) => {
528
540
  var n;
529
541
  return S.name.includes(a.value) || ((n = S.pf_campaigns) == null ? void 0 : n.filter((H) => H.name.includes(a.value)).length);
530
- })), W = mo(), L = $(), b = v(!0), k = O(() => {
542
+ })), W = Vo(), L = $(), b = v(!0), k = O(() => {
531
543
  var S, n, H, T;
532
544
  return !W.storeOption || !W.storeOption.company ? -1 : !W.payoutAccount || !W.payoutAccount.enable || W.payoutAccount.status != "APPROVED" ? 0 : (n = (S = W.store) == null ? void 0 : S.categories) != null && n.length ? (T = (H = W.store) == null ? void 0 : H.categories) != null && T.some(
533
545
  (z) => z.bundles.some((A) => A.isFeedvibe)
@@ -623,7 +635,7 @@ const oe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ee = { class: "space
623
635
  _: 1
624
636
  })
625
637
  ]),
626
- o(Po).getCountry().code == "MY" ? (r(), j(z, {
638
+ o(vo.Config).getCountry().code == "MY" ? (r(), j(z, {
627
639
  key: 0,
628
640
  variant: "outlined",
629
641
  class: "flex"
@@ -716,7 +728,7 @@ const oe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ee = { class: "space
716
728
  }, {
717
729
  default: g(() => [
718
730
  n[8] || (n[8] = e("img", {
719
- src: fo,
731
+ src: Ko,
720
732
  class: "w-[150px]"
721
733
  }, null, -1)),
722
734
  e("div", de, w(o(d)("connect.analytic.emptyState.title")), 1),
@@ -747,5 +759,5 @@ const oe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ee = { class: "space
747
759
  }
748
760
  });
749
761
  export {
750
- ze as default
762
+ be as default
751
763
  };
@@ -1,12 +1,18 @@
1
1
  import { defineComponent as M, ref as p, h as d, watch as N, resolveComponent as S, openBlock as g, createBlock as O, unref as l, computed as C, onMounted as B, createElementBlock as P, Fragment as G, createCommentVNode as $, createVNode as L, createElementVNode as w, nextTick as F } from "vue";
2
2
  import { useRouter as V, useRoute as k, RouterView as Y } from "vue-router";
3
3
  import { useCoreStore as E } from "@feedmepos/mf-common";
4
- import { u as U, R as n, a as H, b as x, S as y, J as D } from "./app-BpzzygYP.js";
5
- import { components as v, useSnackbar as X, useDialog as q } from "@feedmepos/ui-library";
4
+ import { u as U } from "./app-wDQR6dpb.js";
5
+ import { u as H } from "./business-CXyP9G7A.js";
6
+ import "./index-G-88ujCM.js";
7
+ import { components as v, useSnackbar as x, useDialog as D } from "@feedmepos/ui-library";
8
+ import { u as X } from "./vue-i18n-AtGIa4qH.js";
9
+ import { R as n } from "./app-FfENBuoE.js";
10
+ import { J as q } from "./JsonViewer-v8_C7l5N.js";
11
+ import { S as y } from "./index-B4UZgSB-.js";
6
12
  const j = /* @__PURE__ */ M({
7
13
  __name: "NavigationTab",
8
14
  setup(I) {
9
- const { t: e } = U(), m = p(), i = [
15
+ const { t: e } = X(), m = p(), s = [
10
16
  {
11
17
  label: e("connect.navigation.analytic"),
12
18
  value: n["$connect-ANALYTIC"]
@@ -101,25 +107,25 @@ const j = /* @__PURE__ */ M({
101
107
  label: e("connect.navigation.setting"),
102
108
  value: n["$connect-SETTING"]
103
109
  }
104
- ], b = V(), _ = k(), f = i.reduce((t, o) => [...(o.children ?? []).map((a) => a.value), ...t, o.value], []);
110
+ ], b = V(), f = k(), _ = s.reduce((a, o) => [...(o.children ?? []).map((t) => t.value), ...a, o.value], []);
105
111
  N(
106
- () => _,
107
- (t) => {
108
- const o = t.matched.map((a) => a.name).reverse();
109
- m.value = o.find((a) => f.includes(a));
112
+ () => f,
113
+ (a) => {
114
+ const o = a.matched.map((t) => t.name).reverse();
115
+ m.value = o.find((t) => _.includes(t));
110
116
  },
111
117
  { immediate: !0 }
112
118
  );
113
- async function R(t) {
114
- await b.push({ name: t });
119
+ async function R(a) {
120
+ await b.push({ name: a });
115
121
  }
116
- return (t, o) => {
122
+ return (a, o) => {
117
123
  var r;
118
- const a = S("FmCollapsibleTabs");
119
- return g(), O(a, {
124
+ const t = S("FmCollapsibleTabs");
125
+ return g(), O(t, {
120
126
  class: "border-fm-color-neutral-gray-100 border-r py-16 px-4",
121
127
  "model-value": (r = l(m)) == null ? void 0 : r.toString(),
122
- items: i,
128
+ items: s,
123
129
  "onUpdate:modelValue": R
124
130
  }, null, 8, ["model-value"]);
125
131
  };
@@ -129,19 +135,19 @@ var J = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "htt
129
135
  const z = {
130
136
  key: 1,
131
137
  class: "h-full w-full"
132
- }, K = ["src"], ae = /* @__PURE__ */ M({
138
+ }, K = ["src"], ie = /* @__PURE__ */ M({
133
139
  __name: "App",
134
140
  setup(I) {
135
- const e = E(), m = H(), i = x(), b = X(), _ = q(), f = k(), R = p(f.query.showHeader !== "false"), t = p(!1), { currentBusiness: o } = E(), a = p(!1), r = C(() => i.version), h = C(() => {
136
- const c = e.currentCountry.value || "MY", s = y.getIdToken(), u = o.value._id;
137
- return `${J.marketingV1Portal}/b/${u}/marketing/overview?showHeader=false&country=${c}&token=${s}`;
141
+ const e = E(), m = U(), s = H(), b = x(), f = D(), _ = k(), R = p(_.query.showHeader !== "false"), a = p(!1), { currentBusiness: o } = E(), t = p(!1), r = C(() => s.version), h = C(() => {
142
+ const c = e.currentCountry.value || "MY", i = y.getIdToken(), u = o.value._id;
143
+ return `${J.marketingV1Portal}/b/${u}/marketing/overview?showHeader=false&country=${c}&token=${i}`;
138
144
  }), A = async () => {
139
- a.value = !1, await F(), console.log("forceRerender"), y.setBusinessId(o.value._id), await i.readPremium(), !t.value && r.value === "v2" ? e.registerSidebarComponent(j) : e.hideSidebarToggle(!0), t.value = !0, a.value = !0;
145
+ t.value = !1, await F(), console.log("forceRerender"), y.setBusinessId(o.value._id), await s.readPremium(), !a.value && r.value === "v2" ? e.registerSidebarComponent(j) : e.hideSidebarToggle(!0), a.value = !0, t.value = !0;
140
146
  };
141
147
  return B(() => {
142
- if (m.initProvider(b, _), !R.value) {
143
- const c = document.getElementsByClassName("app-header")[0], s = document.getElementsByClassName("app-sidebar")[0], u = document.getElementsByClassName("app-container")[0], T = document.getElementsByTagName("main")[0];
144
- c == null || c.classList.add("!hidden"), s == null || s.classList.add("!pt-0"), u == null || u.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), e.hideSidebarToggle(!0);
148
+ if (m.initProvider(b, f), !R.value) {
149
+ const c = document.getElementsByClassName("app-header")[0], i = document.getElementsByClassName("app-sidebar")[0], u = document.getElementsByClassName("app-container")[0], T = document.getElementsByTagName("main")[0];
150
+ c == null || c.classList.add("!hidden"), i == null || i.classList.add("!pt-0"), u == null || u.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), e.hideSidebarToggle(!0);
145
151
  }
146
152
  o.value != null && A();
147
153
  }), N(
@@ -149,10 +155,10 @@ const z = {
149
155
  async (c) => {
150
156
  c != null && A();
151
157
  }
152
- ), (c, s) => (g(), P(G, null, [
153
- l(a) && l(r) === "v2" ? (g(), O(l(Y), { key: 0 })) : $("", !0),
154
- l(a) && l(r) !== "v2" ? (g(), P("div", z, [
155
- L(D, {
158
+ ), (c, i) => (g(), P(G, null, [
159
+ l(t) && l(r) === "v2" ? (g(), O(l(Y), { key: 0 })) : $("", !0),
160
+ l(t) && l(r) !== "v2" ? (g(), P("div", z, [
161
+ L(q, {
156
162
  json: { url: l(h) }
157
163
  }, null, 8, ["json"]),
158
164
  w("iframe", {
@@ -167,5 +173,5 @@ const z = {
167
173
  }
168
174
  });
169
175
  export {
170
- ae as default
176
+ ie as default
171
177
  };
@@ -0,0 +1,223 @@
1
+ import { defineComponent as N, ref as h, computed as U, onMounted as j, resolveComponent as r, openBlock as l, createElementBlock as y, Fragment as b, createVNode as i, unref as t, createElementVNode as n, withCtx as v, renderList as E, createBlock as w, resolveDynamicComponent as H, toDisplayString as d, createCommentVNode as q, h as z } from "vue";
2
+ import { _ as G } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
+ import { u as W, p as X } from "./loading-uCNeZibp.js";
5
+ import { u as Y } from "./business-CXyP9G7A.js";
6
+ import { u as Z } from "./campaign-0aM2KYOy.js";
7
+ import { g as B, b as A } from "./dto-BiYLkVdL.js";
8
+ import { u as ee } from "./vue-i18n-AtGIa4qH.js";
9
+ import { _ as te } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js";
11
+ import { u as oe } from "./template-1o0LbOoJ.js";
12
+ import { c as _ } from "./index-CDMC-8iO.js";
13
+ const ne = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ce = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { key: 0 }, fe = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = /* @__PURE__ */ N({
14
+ __name: "Broadcast",
15
+ setup(he) {
16
+ const { t: s } = ee(), V = {
17
+ label: s("connect.campaign.common.createCampaign"),
18
+ value: "create",
19
+ isPrimary: !0,
20
+ prependIcon: "add"
21
+ }, D = oe("BROADCAST", J()), R = Y(), m = Z(), { global: L, minor: x } = W, T = h((/* @__PURE__ */ new Date()).toISOString()), c = h({
22
+ searchKey: "",
23
+ location: null
24
+ }), f = U(
25
+ () => m.campaigns.broadcast.filter(
26
+ (e) => !c.value.location || !e.targetLocation || e.targetLocation.includes(c.value.location)
27
+ )
28
+ ), I = [
29
+ {
30
+ header: "Broadcast title",
31
+ accessorFn: (e) => e.name
32
+ },
33
+ {
34
+ header: "Status",
35
+ cell(e) {
36
+ return B(e.row.original);
37
+ }
38
+ },
39
+ {
40
+ header: "Summary",
41
+ accessorFn: (e) => A(e)
42
+ },
43
+ {
44
+ header: "Message sent",
45
+ accessorFn: (e) => e.currentReceive ?? "N/A"
46
+ },
47
+ {
48
+ header: "Actions",
49
+ cell(e) {
50
+ return z(Q.FmButton, {
51
+ variant: "tertiary",
52
+ icon: "delete",
53
+ iconColor: "neutral-gray-400",
54
+ onClick: (a) => {
55
+ a.stopPropagation(), S(e.row.original);
56
+ }
57
+ });
58
+ }
59
+ }
60
+ ], C = h();
61
+ async function S(e) {
62
+ await X.remove(
63
+ s("campaign.common.remove.confirm", { name: e.name })
64
+ ) && await x(
65
+ async () => {
66
+ await _.delete(e._id), await m.read("BROADCAST");
67
+ },
68
+ {
69
+ message: s("campaign.common.remove.removing", { name: e.name }),
70
+ successMessage: s("campaign.common.remove.removed", { name: e.name })
71
+ }
72
+ );
73
+ }
74
+ async function g(e) {
75
+ T.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await a() : D.open(async (p) => {
76
+ await a(p);
77
+ });
78
+ async function a(p) {
79
+ var u;
80
+ (u = C.value) == null || u.showSheet(
81
+ !0,
82
+ "BROADCAST",
83
+ e ? await _.readById(e._id) : void 0,
84
+ p
85
+ );
86
+ }
87
+ }
88
+ async function K(e) {
89
+ await x(
90
+ async () => {
91
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("BROADCAST");
92
+ },
93
+ {
94
+ message: s(
95
+ `campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
96
+ ),
97
+ successMessage: s("campaign.broadcast.update.success", {
98
+ action: e.campaign._id ? "updated" : "created"
99
+ })
100
+ }
101
+ );
102
+ }
103
+ return j(async () => {
104
+ await L(async () => {
105
+ await m.read("BROADCAST");
106
+ });
107
+ }), (e, a) => {
108
+ const p = r("FmPageHead"), u = r("FmSearch"), O = r("FmTable"), F = r("FmButton"), $ = r("FmListItem"), P = r("FmList"), M = r("FmCard");
109
+ return l(), y(b, null, [
110
+ i(p, {
111
+ title: t(s)("connect.campaign.broadcast.title"),
112
+ actions: t(f).length > 0 ? [V] : [],
113
+ "onClick:action": a[0] || (a[0] = () => g())
114
+ }, null, 8, ["title", "actions"]),
115
+ n("div", ne, [
116
+ i(u, {
117
+ modelValue: t(c).searchKey,
118
+ "onUpdate:modelValue": a[1] || (a[1] = (o) => t(c).searchKey = o),
119
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
120
+ placeholder: t(s)("connect.campaign.common.search"),
121
+ collapsible: ""
122
+ }, null, 8, ["modelValue", "placeholder"]),
123
+ t(m).campaigns.broadcast && t(m).campaigns.broadcast.length > 0 ? (l(), y(b, { key: 0 }, [
124
+ n("div", se, [
125
+ n("div", ce, [
126
+ i(te, {
127
+ modelValue: t(c).location,
128
+ "onUpdate:modelValue": a[2] || (a[2] = (o) => t(c).location = o),
129
+ label: `${t(s)("connect.campaign.common.location")}: `,
130
+ "show-item-label": !0,
131
+ icon: "storefront",
132
+ placement: "bottom-start",
133
+ items: t(R).locationItems
134
+ }, null, 8, ["modelValue", "label", "items"])
135
+ ]),
136
+ i(u, {
137
+ modelValue: t(c).searchKey,
138
+ "onUpdate:modelValue": a[3] || (a[3] = (o) => t(c).searchKey = o),
139
+ class: "xs:hidden",
140
+ placeholder: "search",
141
+ collapsible: ""
142
+ }, null, 8, ["modelValue"])
143
+ ]),
144
+ i(O, {
145
+ class: "xs:hidden",
146
+ "row-data": t(f),
147
+ "column-defs": I,
148
+ "search-value": t(c).searchKey,
149
+ "column-filter": [],
150
+ onRowClick: a[4] || (a[4] = (o) => g(o.original)),
151
+ "hide-footer": !0
152
+ }, null, 8, ["row-data", "search-value"]),
153
+ i(P, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
154
+ default: v(() => [
155
+ (l(!0), y(b, null, E(t(f).filter(
156
+ (o) => o.name.toLowerCase().includes(t(c).searchKey.toLowerCase())
157
+ ), (o) => (l(), w($, {
158
+ key: o._id.toString(),
159
+ onClick: (k) => g(o),
160
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
161
+ }, {
162
+ default: v(() => [
163
+ n("div", ie, [
164
+ n("div", re, [
165
+ (l(), w(H(t(B)(o)))),
166
+ n("div", le, d(o.currentReceive ?? 0) + " sent ", 1)
167
+ ]),
168
+ n("div", me, [
169
+ n("div", de, d(o.name), 1),
170
+ n("div", pe, d(t(A)(o)), 1)
171
+ ])
172
+ ]),
173
+ i(F, {
174
+ icon: "delete",
175
+ "icon-color": "neutral-gray-400",
176
+ variant: "tertiary",
177
+ onClick: (k) => (k.stopPropagation(), S(o))
178
+ }, null, 8, ["onClick"])
179
+ ]),
180
+ _: 2
181
+ }, 1032, ["onClick"]))), 128))
182
+ ]),
183
+ _: 1
184
+ }),
185
+ t(f).length == 0 ? (l(), y("div", ue, [
186
+ n("div", fe, d(t(s)("connect.campaign.common.noResults")), 1)
187
+ ])) : q("", !0)
188
+ ], 64)) : (l(), w(M, {
189
+ key: 1,
190
+ variant: "outlined",
191
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
192
+ }, {
193
+ default: v(() => [
194
+ a[6] || (a[6] = n("img", {
195
+ src: G,
196
+ class: "aspect-square w-[150px]"
197
+ }, null, -1)),
198
+ n("div", ge, [
199
+ n("div", ye, d(t(s)("connect.campaign.broadcast.create.title")), 1),
200
+ n("div", _e, d(t(s)("connect.campaign.broadcast.create.description")), 1)
201
+ ]),
202
+ i(F, {
203
+ variant: "primary",
204
+ label: t(s)("connect.campaign.broadcast.create.button"),
205
+ icon: "add",
206
+ onClick: a[5] || (a[5] = (o) => g())
207
+ }, null, 8, ["label"])
208
+ ]),
209
+ _: 1
210
+ })),
211
+ i(ae, {
212
+ ref_key: "sheetRef",
213
+ ref: C,
214
+ "onSubmit:modelValue": K
215
+ }, null, 512)
216
+ ])
217
+ ], 64);
218
+ };
219
+ }
220
+ });
221
+ export {
222
+ Re as default
223
+ };
@@ -1,6 +1,13 @@
1
- import { K as RuleOperator, z as isRuleGroup, L as _, E as F_RUNNABLE_CAMPAIGN_TYPE } from "./app-BpzzygYP.js";
1
+ import { R as RuleOperator, _ } from "./index-Dkeb_9ER.js";
2
+ import { i as isRuleGroup } from "./rule-builder-B_M9yvEe.js";
2
3
  import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, createVNode, toDisplayString } from "vue";
3
4
  import { useDialog } from "@feedmepos/ui-library";
5
+ import "./index-B6c-fUij.js";
6
+ import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-BuDwICBJ.js";
7
+ import "./index-DA-fzkRR.js";
8
+ import "./index-BRXg5Si1.js";
9
+ import "./index-DmdKoKk_.js";
10
+ import "./index-BP_5cfKa.js";
4
11
  function validateRule(data, r, date) {
5
12
  const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
6
13
  function meetConditions(e) {
@@ -9,11 +16,11 @@ function validateRule(data, r, date) {
9
16
  const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
10
17
  if (!t)
11
18
  return o;
12
- const s = rules[n](
19
+ const i = rules[n](
13
20
  l,
14
21
  t
15
22
  );
16
- return o && s;
23
+ return o && i;
17
24
  },
18
25
  !0
19
26
  );
@@ -73,10 +80,10 @@ const _hoisted_1 = { class: "flex flex-col h-full space-y-24" }, _hoisted_2 = {
73
80
  value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
74
81
  }
75
82
  ];
76
- function l(s) {
77
- n.close(), o.onSelect(s);
83
+ function l(i) {
84
+ n.close(), o.onSelect(i);
78
85
  }
79
- return (s, a) => {
86
+ return (i, a) => {
80
87
  const c = resolveComponent("FmCard");
81
88
  return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
82
89
  default: withCtx(() => [
@@ -85,15 +92,15 @@ const _hoisted_1 = { class: "flex flex-col h-full space-y-24" }, _hoisted_2 = {
85
92
  createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Select the benefit type that you want to reward the selected tier. ")
86
93
  ], -1)),
87
94
  createElementVNode("div", _hoisted_1, [
88
- (openBlock(), createElementBlock(Fragment, null, renderList(t, (i) => createVNode(c, {
95
+ (openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
89
96
  variant: "outlined",
90
- key: i.value,
91
- onClick: (u) => l(i.value),
97
+ key: s.value,
98
+ onClick: (u) => l(s.value),
92
99
  class: "p-16 space-y-8 cursor-pointer"
93
100
  }, {
94
101
  default: withCtx(() => [
95
- createElementVNode("div", _hoisted_2, toDisplayString(i.title), 1),
96
- createElementVNode("div", _hoisted_3, toDisplayString(i.description), 1)
102
+ createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
103
+ createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
97
104
  ]),
98
105
  _: 2
99
106
  }, 1032, ["onClick"])), 64))