@feedmepos/mf-connect 0.1.38-beta.74 → 0.1.38-beta.76

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 (140) hide show
  1. package/dist/Analytic-BrBxRQue.js +761 -0
  2. package/dist/App-CE_19YJc.js +4642 -0
  3. package/dist/AuditLogs-CQtMmVIp.js +1991 -0
  4. package/dist/Bin-D9CHhiUb.js +166 -0
  5. package/dist/Broadcast-Dg6eBL_f.js +267 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CSv0R9XX.js +121 -0
  7. package/dist/Card-BTkf67i1.js +910 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-Czq4nsdu.js +541 -0
  10. package/dist/Credit-B3nX8aJA.js +261 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js +3120 -0
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-5U6cSZGZ.js +351 -0
  16. package/dist/Experience-B9Vn3NTH.js +260 -0
  17. package/dist/FileSaver.min-CJaOkSQt.js +74 -0
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  19. package/dist/Game-DTx_EsM3.js +331 -0
  20. package/dist/GenerateMaterial-C3J9_YHw.js +589 -0
  21. package/dist/Grab-B29W7rka.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DyegKNzM.js +145 -0
  23. package/dist/Index-Fk8EP5dG.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D2XPGgTM.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-K8qUYrPk.js +18737 -0
  27. package/dist/MainLayout-BFmqJkE_.js +41 -0
  28. package/dist/Marketing-BRHQHAWD.js +145 -0
  29. package/dist/MarketingMaterialEdit-7s3WEDyJ.js +746 -0
  30. package/dist/Member-DwPJNAo9.js +280 -0
  31. package/dist/MemberList-mS1W0qHY.js +1601 -0
  32. package/dist/MemberOverview-wL_ailso.js +58 -0
  33. package/dist/MemberTransactions-BV3xvFYS.js +45 -0
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DzKqVp2O.js +60799 -0
  35. package/dist/Mission-QmoURSu4.js +335 -0
  36. package/dist/Overview-CaTMLlq-.js +1078 -0
  37. package/dist/Point-CjG77Sma.js +263 -0
  38. package/dist/Promotion-C5I-1qPN.js +397 -0
  39. package/dist/Queue-BaIBCCaX.js +259 -0
  40. package/dist/Record-DqpGwZIU.js +341 -0
  41. package/dist/Review-Bq-edSOO.js +621 -0
  42. package/dist/ReviewFacebookCallback-yaC4rLki.js +243 -0
  43. package/dist/ReviewGoogleCallback-uxrrCQdu.js +213 -0
  44. package/dist/Reward-DGP65n5t.js +442 -0
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-bNMoMZOy.js +149 -0
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dgrc6vXF.js +1912 -0
  47. package/dist/Segment-CNz0sR3c.js +881 -0
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DLZEzpve.js +181 -0
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CLdIeyef.js +188 -0
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js +147 -0
  51. package/dist/Setting-BKDSGYBR.js +2000 -0
  52. package/dist/SettingAdvertisements-B2GMFfN9.js +264 -0
  53. package/dist/Store-C6uLl_Ue.js +1996 -0
  54. package/dist/StoreRewards-D4728UDf.js +535 -0
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CG09fJTP.js +1129 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-B0_bMK5u.js +7005 -0
  57. package/dist/Tier-BNzTa1_w.js +970 -0
  58. package/dist/Title-DY5knovF.js +568 -0
  59. package/dist/Transaction-Ct4yAJ9n.js +39 -0
  60. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CHnxi3XZ.js +130 -0
  61. package/dist/Voucher-DFTMRPT0.js +422 -0
  62. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DZU7XVlZ.js +421 -0
  63. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BndLHmHB.js +56 -0
  64. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  65. package/dist/app-6lG4w5PT.js +59396 -0
  66. package/dist/app-wDQR6dpb.js +39 -0
  67. package/dist/app.js +7 -0
  68. package/dist/business-CrfQ56D0.js +82 -0
  69. package/dist/campaign-B9fR7RwT.js +100 -0
  70. package/dist/campaign-B_iIaTKz.js +253 -0
  71. package/dist/campaign-CpzFl8Vr.js +4 -0
  72. package/dist/campaign.enum-BAHf0dSv.js +26 -0
  73. package/dist/campaign.fn-DDEgBzH2.js +776 -0
  74. package/dist/collectible.enum-9os2zr5a.js +19 -0
  75. package/dist/collection.fn-7qP_m2MW.js +26 -0
  76. package/dist/dto-C2hLQKuu.js +222 -0
  77. package/dist/duplicateCampaign-C6RXfeWE.js +51 -0
  78. package/dist/effect-DGVfWyIc.js +89 -0
  79. package/dist/email-addresses-BHa_qQBd.js +705 -0
  80. package/dist/export-CRPfo4hq.js +97 -0
  81. package/dist/feedme.ico +0 -0
  82. package/dist/helper-0_zrz4kj.js +86 -0
  83. package/dist/index-4Vl1VXum.js +2639 -0
  84. package/dist/index-4bX0ewBJ.js +31 -0
  85. package/dist/index-Bj0TV_D5.js +36 -0
  86. package/dist/index-BpdSswT6.js +48 -0
  87. package/dist/index-By2wenzb.js +32 -0
  88. package/dist/index-C8L2jQ_6.js +28897 -0
  89. package/dist/index-CO5kQMIK.js +85 -0
  90. package/dist/index-CW_ub4cF.js +8912 -0
  91. package/dist/index-Cp8wkBus.js +124 -0
  92. package/dist/index-CuvNtC_M.js +61 -0
  93. package/dist/index-D6Te1BQZ.js +54 -0
  94. package/dist/index-DbJGJ2fB.js +146 -0
  95. package/dist/index-DeaGdUSH.js +30289 -0
  96. package/dist/index-Dp1J9Fxa.js +3 -0
  97. package/dist/index-QUvYZydO.js +67 -0
  98. package/dist/index-lwxV5iX0.js +3431 -0
  99. package/dist/index-vh86FiIQ.js +10 -0
  100. package/dist/index.esm2017-ofRmIpjY.js +3069 -0
  101. package/dist/loading-8_73fcXo.js +71 -0
  102. package/dist/lodash-Bz_vrY3P.js +3678 -0
  103. package/dist/membership-CpB39vNW.js +235 -0
  104. package/dist/moment-D7p2TMB-.js +2583 -0
  105. package/dist/money-DALHjzjF.js +15 -0
  106. package/dist/number-D_GJahxw.js +12 -0
  107. package/dist/object-qECH92oz.js +26 -0
  108. package/dist/objectId-dwaoBfJX.js +7 -0
  109. package/dist/objectid-BZSH63yc.js +145 -0
  110. package/dist/plugins-A4jDcmfS.js +1817 -0
  111. package/dist/remy-D_Deb3ue.js +13 -0
  112. package/dist/reward-BqFB2Yn2.js +36 -0
  113. package/dist/rule-DNylZfIG.js +1969 -0
  114. package/dist/rule-builder-2iT04EOj.js +102 -0
  115. package/dist/style.css +13 -0
  116. package/dist/template-D7rpG7FN.js +188 -0
  117. package/dist/tier-BJDhpH6X.js +4 -0
  118. package/dist/tiers/tier=1.png +0 -0
  119. package/dist/tiers/tier=2.png +0 -0
  120. package/dist/tiers/tier=3.png +0 -0
  121. package/dist/tiers/tier=4.png +0 -0
  122. package/dist/timezone-BW17tvi2.js +1154 -0
  123. package/dist/titles/type=diamond.png +0 -0
  124. package/dist/titles/type=drinks.png +0 -0
  125. package/dist/titles/type=food.png +0 -0
  126. package/dist/titles/type=heart.png +0 -0
  127. package/dist/titles/type=medal.png +0 -0
  128. package/dist/titles/type=spend.png +0 -0
  129. package/dist/titles/type=thank-you.png +0 -0
  130. package/dist/titles/type=thumbs-up.png +0 -0
  131. package/dist/titles/type=years.png +0 -0
  132. package/dist/trigger-CbVrS2i6.js +213 -0
  133. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  134. package/dist/type_drinks-D6jnpvwV.js +4 -0
  135. package/dist/usePagination-dXSoqxfG.js +266 -0
  136. package/dist/user-Ck-m3cB3.js +55 -0
  137. package/dist/vue-i18n-BvqmcBWZ.js +2365 -0
  138. package/dist/xlsx-CkqDfUNs.js +15491 -0
  139. package/dist/zod-B0YxCfoE.js +91 -0
  140. package/package.json +1 -1
@@ -0,0 +1,166 @@
1
+ import { defineComponent as C, ref as c, h as s, onMounted as x, resolveComponent as d, openBlock as S, createElementBlock as B, Fragment as M, createVNode as l, unref as o, createElementVNode as u } from "vue";
2
+ import { components as p } from "@feedmepos/ui-library";
3
+ import { u as K } from "./loading-8_73fcXo.js";
4
+ import { u as R } from "./business-CrfQ56D0.js";
5
+ import { C as A } from "./campaign-B_iIaTKz.js";
6
+ import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js";
7
+ import { _ as U } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
8
+ import { _ as Y } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js";
9
+ import { u as D } from "./vue-i18n-BvqmcBWZ.js";
10
+ import { h as E } from "./moment-D7p2TMB-.js";
11
+ import { p as I } from "./plugins-A4jDcmfS.js";
12
+ import { c as g } from "./index-Cp8wkBus.js";
13
+ const T = { class: "px-24 flex flex-col gap-y-16" }, $ = { class: "flex items-center justify-between w-full" }, j = { class: "flex gap-8 overflow-x-auto" }, oe = /* @__PURE__ */ C({
14
+ __name: "Bin",
15
+ setup(H) {
16
+ const { t: n } = D(), y = R(), { global: _, minor: b } = K, a = c({
17
+ searchKey: "",
18
+ location: null
19
+ }), m = c([]), w = [
20
+ {
21
+ header: n("connect.campaign.common.title"),
22
+ accessorFn: (e) => e.name
23
+ },
24
+ {
25
+ header: n("connect.campaign.common.campaignType"),
26
+ cell(e) {
27
+ return A[e.row.original.type].chip();
28
+ }
29
+ },
30
+ {
31
+ header: n("connect.campaign.common.deletedAt"),
32
+ cell(e) {
33
+ return E(e.row.original.deletedAt).format("D MMM YYYY, hh:mmA");
34
+ }
35
+ },
36
+ {
37
+ header: n("connect.voucher.actions"),
38
+ cell(e) {
39
+ return s("div", { class: "flex items-center justify-end" }, [
40
+ s(
41
+ p.FmMenu,
42
+ {
43
+ placement: "bottom-end",
44
+ onClick: (t) => {
45
+ t.stopPropagation();
46
+ }
47
+ },
48
+ {
49
+ "menu-button": () => s(p.FmButton, {
50
+ icon: "more_vert",
51
+ iconColor: "neutral-gray-400",
52
+ variant: "tertiary"
53
+ }),
54
+ default: () => [
55
+ s(
56
+ p.FmMenuItem,
57
+ {
58
+ icon: "restore",
59
+ onClick: async (i) => {
60
+ i.stopPropagation(), F(e.row.original);
61
+ }
62
+ },
63
+ {
64
+ label: s(
65
+ "div",
66
+ {
67
+ class: "fm-typo-en-body-md-400"
68
+ },
69
+ n("connect.campaign.common.actions.restore")
70
+ )
71
+ }
72
+ )
73
+ ]
74
+ }
75
+ )
76
+ ]);
77
+ }
78
+ }
79
+ ], v = c(), V = c();
80
+ async function F(e) {
81
+ await I.confirm(
82
+ n("connect.campaign.common.restore.confirm", { name: e.name })
83
+ ) && await b(
84
+ async () => {
85
+ await g.restore(e._id), await f();
86
+ },
87
+ {
88
+ message: n("connect.campaign.common.restore.restoring", { name: e.name }),
89
+ successMessage: n("connect.campaign.common.restore.restored", {
90
+ name: e.name
91
+ })
92
+ }
93
+ );
94
+ }
95
+ async function f() {
96
+ const e = await g.readAllDeleted({
97
+ limit: 1e3,
98
+ skip: 0,
99
+ sortBy: "_id",
100
+ descending: !0
101
+ });
102
+ m.value = e.resources;
103
+ }
104
+ return x(async () => {
105
+ await _(async () => {
106
+ await f();
107
+ });
108
+ }), (e, t) => {
109
+ const i = d("FmPageHead"), h = d("FmSearch"), k = d("FmTable");
110
+ return S(), B(M, null, [
111
+ l(i, {
112
+ title: o(n)("connect.bin.title")
113
+ }, null, 8, ["title"]),
114
+ u("div", T, [
115
+ l(h, {
116
+ modelValue: o(a).searchKey,
117
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => o(a).searchKey = r),
118
+ class: "hidden xs:!block border-b-2 border-fm-color-neutral-gray-100",
119
+ placeholder: o(n)("connect.voucher.search"),
120
+ collapsible: ""
121
+ }, null, 8, ["modelValue", "placeholder"]),
122
+ u("div", $, [
123
+ u("div", j, [
124
+ l(U, {
125
+ modelValue: o(a).location,
126
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => o(a).location = r),
127
+ label: o(n)("connect.voucher.location"),
128
+ "show-item-label": !0,
129
+ icon: "storefront",
130
+ placement: "bottom-start",
131
+ items: o(y).locationItems
132
+ }, null, 8, ["modelValue", "label", "items"])
133
+ ]),
134
+ l(h, {
135
+ modelValue: o(a).searchKey,
136
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => o(a).searchKey = r),
137
+ class: "xs:hidden",
138
+ placeholder: o(n)("connect.voucher.search"),
139
+ collapsible: ""
140
+ }, null, 8, ["modelValue", "placeholder"])
141
+ ]),
142
+ l(k, {
143
+ "row-data": o(m),
144
+ "column-defs": w,
145
+ "search-value": o(a).searchKey,
146
+ "column-filter": [],
147
+ onRowClick: t[3] || (t[3] = (r) => e.onEdit(r.original)),
148
+ "hide-footer": o(m).length < 10
149
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
150
+ l(P, {
151
+ ref_key: "sheetRef",
152
+ ref: v,
153
+ "onSubmit:modelValue": e.onUpdate
154
+ }, null, 8, ["onSubmit:modelValue"]),
155
+ l(Y, {
156
+ ref_key: "sendVoucherSheetRef",
157
+ ref: V
158
+ }, null, 512)
159
+ ])
160
+ ], 64);
161
+ };
162
+ }
163
+ });
164
+ export {
165
+ oe as default
166
+ };
@@ -0,0 +1,267 @@
1
+ import { defineComponent as H, ref as C, computed as q, onMounted as z, resolveComponent as m, openBlock as d, createElementBlock as h, Fragment as v, createVNode as i, unref as a, createElementVNode as n, withCtx as x, renderList as G, createBlock as S, resolveDynamicComponent as J, toDisplayString as u, createCommentVNode as Q, h as k } from "vue";
2
+ import { _ as W } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as X, components as L } from "@feedmepos/ui-library";
4
+ import { p as Y } from "./plugins-A4jDcmfS.js";
5
+ import { u as Z } from "./loading-8_73fcXo.js";
6
+ import { u as ee } from "./business-CrfQ56D0.js";
7
+ import { u as te } from "./campaign-B9fR7RwT.js";
8
+ import { b as V, c as R, a as ae } from "./campaign-B_iIaTKz.js";
9
+ import { c as oe, p as ne } from "./duplicateCampaign-C6RXfeWE.js";
10
+ import { u as se } from "./vue-i18n-BvqmcBWZ.js";
11
+ import { _ as ce } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
12
+ import { _ as ie } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js";
13
+ import { u as re } from "./template-D7rpG7FN.js";
14
+ import { c as f } from "./index-Cp8wkBus.js";
15
+ const le = { class: "px-24 flex flex-col gap-y-16" }, me = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, ue = { class: "flex w-full gap-4 items-center" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "space-y-4" }, ye = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "flex items-center gap-8" }, we = { key: 0 }, be = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, Ce = { class: "flex flex-col gap-16 text-center" }, ve = { class: "fm-typo-en-title-sm-800" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, je = /* @__PURE__ */ H({
16
+ __name: "Broadcast",
17
+ setup(Se) {
18
+ const { t: s } = se(), O = {
19
+ label: s("connect.campaign.common.createCampaign"),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, T = re("BROADCAST", X()), I = ee(), p = te(), { global: K, minor: F } = Z, B = C((/* @__PURE__ */ new Date()).toISOString()), r = C({
24
+ searchKey: "",
25
+ location: []
26
+ });
27
+ function P(e) {
28
+ const t = r.value.location;
29
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
30
+ var c;
31
+ return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
32
+ }) : e.targetLocation.includes(t);
33
+ }
34
+ const g = q(
35
+ () => p.campaigns.broadcast.filter((e) => P(e))
36
+ ), $ = [
37
+ {
38
+ header: "Broadcast title",
39
+ accessorFn: (e) => e.name
40
+ },
41
+ {
42
+ header: "Status",
43
+ accessorFn: (e) => ae(e),
44
+ cell(e) {
45
+ return V(e.row.original);
46
+ }
47
+ },
48
+ {
49
+ header: "Summary",
50
+ accessorFn: (e) => R(e)
51
+ },
52
+ {
53
+ header: "Message sent",
54
+ accessorFn: (e) => e.currentReceive ?? "N/A"
55
+ },
56
+ {
57
+ header: "Actions",
58
+ cell(e) {
59
+ return k("div", { class: "flex items-center gap-8 justify-end" }, [
60
+ k(L.FmButton, {
61
+ variant: "tertiary",
62
+ icon: "content_copy",
63
+ iconColor: "neutral-gray-400",
64
+ onClick: async (t) => {
65
+ t.stopPropagation(), await D(e.row.original);
66
+ }
67
+ }),
68
+ k(L.FmButton, {
69
+ variant: "tertiary",
70
+ icon: "delete",
71
+ iconColor: "neutral-gray-400",
72
+ onClick: (t) => {
73
+ t.stopPropagation(), A(e.row.original);
74
+ }
75
+ })
76
+ ]);
77
+ }
78
+ }
79
+ ], w = C();
80
+ async function A(e) {
81
+ await Y.remove(
82
+ s("connect.campaign.common.remove.confirm", { name: e.name })
83
+ ) && await F(
84
+ async () => {
85
+ await f.delete(e._id), await p.read("BROADCAST");
86
+ },
87
+ {
88
+ message: s("connect.campaign.common.remove.removing", { name: e.name }),
89
+ successMessage: s("connect.campaign.common.remove.removed", {
90
+ name: e.name
91
+ })
92
+ }
93
+ );
94
+ }
95
+ async function y(e) {
96
+ B.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : T.open(async (l) => {
97
+ await t(l);
98
+ });
99
+ async function t(l) {
100
+ var c;
101
+ (c = w.value) == null || c.showSheet(
102
+ !0,
103
+ "BROADCAST",
104
+ e ? await f.readById(e._id) : void 0,
105
+ l
106
+ );
107
+ }
108
+ }
109
+ async function D(e) {
110
+ var c;
111
+ if (!await oe(e.name))
112
+ return;
113
+ B.value = (/* @__PURE__ */ new Date()).toISOString();
114
+ const t = await f.readById(e._id), l = ne(t);
115
+ (c = w.value) == null || c.showSheet(
116
+ !0,
117
+ "BROADCAST",
118
+ l,
119
+ t.template
120
+ );
121
+ }
122
+ async function j(e) {
123
+ await F(
124
+ async () => {
125
+ e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("BROADCAST");
126
+ },
127
+ {
128
+ message: s(
129
+ `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
130
+ ),
131
+ successMessage: s("connect.campaign.broadcast.update.success", {
132
+ action: e.campaign._id ? "updated" : "created"
133
+ })
134
+ }
135
+ );
136
+ }
137
+ return z(async () => {
138
+ await K(async () => {
139
+ await p.read("BROADCAST");
140
+ });
141
+ }), (e, t) => {
142
+ const l = m("FmPageHead"), c = m("FmSearch"), M = m("FmTable"), b = m("FmButton"), N = m("FmListItem"), U = m("FmList"), E = m("FmCard");
143
+ return d(), h(v, null, [
144
+ i(l, {
145
+ title: a(s)("connect.campaign.broadcast.title"),
146
+ actions: a(g).length > 0 ? [O] : [],
147
+ "onClick:action": t[0] || (t[0] = () => y())
148
+ }, null, 8, ["title", "actions"]),
149
+ n("div", le, [
150
+ i(c, {
151
+ modelValue: a(r).searchKey,
152
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => a(r).searchKey = o),
153
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
154
+ placeholder: a(s)("connect.campaign.common.search"),
155
+ collapsible: ""
156
+ }, null, 8, ["modelValue", "placeholder"]),
157
+ a(p).campaigns.broadcast && a(p).campaigns.broadcast.length > 0 ? (d(), h(v, { key: 0 }, [
158
+ n("div", me, [
159
+ n("div", de, [
160
+ i(ce, {
161
+ label: `${a(s)("connect.campaign.common.location")}: `,
162
+ "right-icon": "keyboard_arrow_down",
163
+ modelValue: a(r).location,
164
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => a(r).location = o),
165
+ icon: "storefront",
166
+ "show-item-label": !0,
167
+ items: a(I).locationOptions
168
+ }, null, 8, ["label", "modelValue", "items"])
169
+ ]),
170
+ i(c, {
171
+ modelValue: a(r).searchKey,
172
+ "onUpdate:modelValue": t[3] || (t[3] = (o) => a(r).searchKey = o),
173
+ class: "xs:hidden sm:hidden",
174
+ placeholder: "search",
175
+ collapsible: ""
176
+ }, null, 8, ["modelValue"])
177
+ ]),
178
+ i(M, {
179
+ class: "xs:hidden sm:hidden",
180
+ "row-data": a(g),
181
+ "column-defs": $,
182
+ "search-value": a(r).searchKey,
183
+ "column-filter": [],
184
+ onRowClick: t[4] || (t[4] = (o) => y(o.original)),
185
+ "hide-footer": !0
186
+ }, null, 8, ["row-data", "search-value"]),
187
+ i(U, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
188
+ default: x(() => [
189
+ (d(!0), h(v, null, G(a(g).filter(
190
+ (o) => o.name.toLowerCase().includes(a(r).searchKey.toLowerCase())
191
+ ), (o) => (d(), S(N, {
192
+ key: o._id.toString(),
193
+ onClick: (_) => y(o),
194
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
195
+ }, {
196
+ default: x(() => [
197
+ n("div", pe, [
198
+ n("div", ue, [
199
+ (d(), S(J(a(V)(o)))),
200
+ n("div", fe, u(o.currentReceive ?? 0) + " sent ", 1)
201
+ ]),
202
+ n("div", ge, [
203
+ n("div", ye, u(o.name), 1),
204
+ n("div", _e, u(a(R)(o)), 1)
205
+ ])
206
+ ]),
207
+ n("div", he, [
208
+ i(b, {
209
+ icon: "content_copy",
210
+ "icon-color": "neutral-gray-400",
211
+ variant: "tertiary",
212
+ onClick: async (_) => {
213
+ _.stopPropagation(), await D(o);
214
+ }
215
+ }, null, 8, ["onClick"]),
216
+ i(b, {
217
+ icon: "delete",
218
+ "icon-color": "neutral-gray-400",
219
+ variant: "tertiary",
220
+ onClick: (_) => (_.stopPropagation(), A(o))
221
+ }, null, 8, ["onClick"])
222
+ ])
223
+ ]),
224
+ _: 2
225
+ }, 1032, ["onClick"]))), 128))
226
+ ]),
227
+ _: 1
228
+ }),
229
+ a(g).length == 0 ? (d(), h("div", we, [
230
+ n("div", be, u(a(s)("connect.campaign.common.noResults")), 1)
231
+ ])) : Q("", !0)
232
+ ], 64)) : (d(), S(E, {
233
+ key: 1,
234
+ variant: "outlined",
235
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
236
+ }, {
237
+ default: x(() => [
238
+ t[6] || (t[6] = n("img", {
239
+ src: W,
240
+ class: "aspect-square w-[150px]"
241
+ }, null, -1)),
242
+ n("div", Ce, [
243
+ n("div", ve, u(a(s)("connect.campaign.broadcast.create.title")), 1),
244
+ n("div", xe, u(a(s)("connect.campaign.broadcast.create.description")), 1)
245
+ ]),
246
+ i(b, {
247
+ variant: "primary",
248
+ label: a(s)("connect.campaign.broadcast.create.button"),
249
+ icon: "add",
250
+ onClick: t[5] || (t[5] = (o) => y())
251
+ }, null, 8, ["label"])
252
+ ]),
253
+ _: 1
254
+ })),
255
+ i(ie, {
256
+ ref_key: "sheetRef",
257
+ ref: w,
258
+ "onSubmit:modelValue": j
259
+ }, null, 512)
260
+ ])
261
+ ], 64);
262
+ };
263
+ }
264
+ });
265
+ export {
266
+ je as default
267
+ };
@@ -0,0 +1,121 @@
1
+ import { R as RuleOperator, _ } from "./index-CW_ub4cF.js";
2
+ import { i as isRuleGroup } from "./rule-builder-2iT04EOj.js";
3
+ import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, createVNode, toDisplayString } from "vue";
4
+ import { useDialog } from "@feedmepos/ui-library";
5
+ import "./index-4Vl1VXum.js";
6
+ import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-lwxV5iX0.js";
7
+ import "./index-DeaGdUSH.js";
8
+ import "./index-D6Te1BQZ.js";
9
+ function validateRule(data, r, date) {
10
+ const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
11
+ function meetConditions(e) {
12
+ return Object.entries(e.conditions ?? {}).reduce(
13
+ (o, [n, t]) => {
14
+ const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
15
+ if (t == null)
16
+ return console.log("Bad data, ignoring rule", {
17
+ // property: r.property,
18
+ // source,
19
+ conditionKey: n,
20
+ equator: t
21
+ // raw: data,
22
+ }), o;
23
+ const i = rules[n](
24
+ l,
25
+ t
26
+ );
27
+ return o && i;
28
+ },
29
+ !0
30
+ );
31
+ }
32
+ function evaluateRuleResult(rr, logic) {
33
+ const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
34
+ return !logic || !!eval(target);
35
+ }
36
+ function getRuleResults(e) {
37
+ return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
38
+ ...o,
39
+ [n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
40
+ }), {}) : {
41
+ [e.name]: meetConditions(e)
42
+ };
43
+ }
44
+ return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
45
+ }
46
+ const _hoisted_1 = { class: "flex flex-col h-full space-y-24" }, _hoisted_2 = { class: "fm-typo-en-title-sm-600" }, _hoisted_3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main = /* @__PURE__ */ defineComponent({
47
+ __name: "CampaignTypeDialog",
48
+ props: {
49
+ onSelect: {
50
+ type: Function,
51
+ required: !0
52
+ }
53
+ },
54
+ setup(e) {
55
+ const o = e, n = useDialog(), t = [
56
+ {
57
+ title: "Promotion",
58
+ description: "Special offers or deals made available for a limited time",
59
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
60
+ },
61
+ {
62
+ title: "Voucher",
63
+ description: "A digital coupon that can be redeemed for a discounts on future purchases.",
64
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
65
+ },
66
+ {
67
+ title: "Experience",
68
+ description: "Experience points help customers gain membership tiers.",
69
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
70
+ },
71
+ {
72
+ title: "Point",
73
+ description: "Points allow customers to purchase bundle items.",
74
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
75
+ },
76
+ {
77
+ title: "Game",
78
+ description: "The game feature adds a fun and encourage customers to engage more.",
79
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
80
+ },
81
+ {
82
+ title: "Credit",
83
+ description: "Credits are virtual money that customers can use to pay for their purchases.",
84
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
85
+ }
86
+ ];
87
+ function l(i) {
88
+ n.close(), o.onSelect(i);
89
+ }
90
+ return (i, a) => {
91
+ const c = resolveComponent("FmCard");
92
+ return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
93
+ default: withCtx(() => [
94
+ a[0] || (a[0] = createElementVNode("div", { class: "" }, [
95
+ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
96
+ 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. ")
97
+ ], -1)),
98
+ createElementVNode("div", _hoisted_1, [
99
+ (openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
100
+ variant: "outlined",
101
+ key: s.value,
102
+ onClick: (u) => l(s.value),
103
+ class: "p-16 space-y-8 cursor-pointer"
104
+ }, {
105
+ default: withCtx(() => [
106
+ createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
107
+ createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
108
+ ]),
109
+ _: 2
110
+ }, 1032, ["onClick"])), 64))
111
+ ])
112
+ ]),
113
+ _: 1
114
+ });
115
+ };
116
+ }
117
+ });
118
+ export {
119
+ _sfc_main as _,
120
+ validateRule as v
121
+ };