@feedmepos/mf-connect 0.1.98-beta.13 → 0.1.98-beta.15

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 (138) hide show
  1. package/package.json +1 -1
  2. package/dist/App-DQqZfak3.js +0 -4782
  3. package/dist/AuditLogs-C19m85wp.js +0 -2013
  4. package/dist/Bin-GjJ5Q2ae.js +0 -166
  5. package/dist/Broadcast-CVTBL0T0.js +0 -266
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6BYvVmq.js +0 -120
  7. package/dist/Card-DzYit3v6.js +0 -910
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-CaU7auvn.js +0 -540
  10. package/dist/Credit-B_eUMV0R.js +0 -260
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgcm1S_g.js +0 -3377
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CZLoCJM4.js +0 -351
  15. package/dist/Experience-B7kxE07l.js +0 -259
  16. package/dist/FileSaver.min-BBvy4uPh.js +0 -74
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  19. package/dist/Game-B98hcWvR.js +0 -330
  20. package/dist/Grab-RdxV7xhM.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBYekrJp.js +0 -145
  22. package/dist/Index-CvMVxCY5.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D4-wjMg6.js +0 -48
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Jir8zY8e.js +0 -18737
  26. package/dist/LoyaltyDashboard-B1OzFT4q.js +0 -1082
  27. package/dist/MainLayout-De_edc-D.js +0 -41
  28. package/dist/Marketing-B7-To3XF.js +0 -235
  29. package/dist/MarketingMaterialEdit-DGONncxn.js +0 -1035
  30. package/dist/Member-DEGCrqnh.js +0 -280
  31. package/dist/MemberList-vKYbpLVu.js +0 -1601
  32. package/dist/MemberOverview-wL_ailso.js +0 -58
  33. package/dist/MemberTransactions-CGC3vYKC.js +0 -45
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BP9YtuPA.js +0 -60802
  35. package/dist/Mission-hxf_AIGL.js +0 -334
  36. package/dist/Overview-NvgUuMYp.js +0 -949
  37. package/dist/Overview-iRLMLoAo.js +0 -1079
  38. package/dist/Point-tkUTXOCe.js +0 -262
  39. package/dist/Promotion-DNUcMKJQ.js +0 -397
  40. package/dist/Queue-5XYiIuG8.js +0 -260
  41. package/dist/Record-B5aYp7eF.js +0 -342
  42. package/dist/Review-BqaHlzXV.js +0 -45
  43. package/dist/ReviewFacebookCallback-BqlFkSB7.js +0 -248
  44. package/dist/ReviewGoogleCallback-ssKL4jh4.js +0 -213
  45. package/dist/Reward-1xOMowTW.js +0 -442
  46. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Db3FSfIc.js +0 -149
  47. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cmrp2Tia.js +0 -1911
  48. package/dist/Segment-BMBwsUug.js +0 -1014
  49. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DSfdei-h.js +0 -181
  50. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BJVeGJ5J.js +0 -188
  51. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-OBZubKUy.js +0 -226
  52. package/dist/Setting-DWygYkHW.js +0 -2047
  53. package/dist/SettingAdvertisements-TYB1b7dB.js +0 -264
  54. package/dist/Settings-DynjmCPL.js +0 -220
  55. package/dist/Store-DRYkmigC.js +0 -1996
  56. package/dist/StoreRewards-DU8eWbXE.js +0 -540
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BkqBjEFm.js +0 -1130
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l6KmXVBZ.js +0 -7007
  59. package/dist/Tier-4k8SxKtl.js +0 -969
  60. package/dist/Title-B9lWQ_jl.js +0 -566
  61. package/dist/Transaction-C38Yd0tf.js +0 -39
  62. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D6tgpKpc.js +0 -130
  63. package/dist/Voucher-BQbqC7RV.js +0 -421
  64. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-erwpbvYi.js +0 -421
  65. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Dt05b7fU.js +0 -56
  66. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  67. package/dist/app-BTm9mz0r.js +0 -59940
  68. package/dist/app-wDQR6dpb.js +0 -39
  69. package/dist/app.js +0 -7
  70. package/dist/business-B7GwHLce.js +0 -82
  71. package/dist/campaign-BCdKDHgz.js +0 -277
  72. package/dist/campaign-CpzFl8Vr.js +0 -4
  73. package/dist/campaign-DWlsbsKQ.js +0 -219
  74. package/dist/campaign.enum-BgK4maXz.js +0 -26
  75. package/dist/campaign.fn-DxnwGCB2.js +0 -776
  76. package/dist/collectible.enum-CdOSUDwG.js +0 -19
  77. package/dist/duplicateCampaign-BSHe0P-g.js +0 -51
  78. package/dist/effect-C7wkN_13.js +0 -89
  79. package/dist/email-addresses-DJycNI7L.js +0 -705
  80. package/dist/export-uIHWDxuh.js +0 -97
  81. package/dist/feedme.ico +0 -0
  82. package/dist/google-BQK68wbe.js +0 -5
  83. package/dist/helper-czpAhAIw.js +0 -86
  84. package/dist/index-5Sa4xS2m.js +0 -151
  85. package/dist/index-5WGEWCcI.js +0 -3
  86. package/dist/index-B2C7kc4z.js +0 -31
  87. package/dist/index-B5eb6_bi.js +0 -3678
  88. package/dist/index-B7nE1Pb2.js +0 -67
  89. package/dist/index-BFAHLexA.js +0 -32
  90. package/dist/index-BanxlNli.js +0 -8910
  91. package/dist/index-ByHoFriu.js +0 -85
  92. package/dist/index-Ca2bBJuR.js +0 -54
  93. package/dist/index-CuvNtC_M.js +0 -61
  94. package/dist/index-D-kYrDAi.js +0 -30289
  95. package/dist/index-D2gAYMIp.js +0 -28900
  96. package/dist/index-DWxmK2NJ.js +0 -61
  97. package/dist/index-U_rwkNKU.js +0 -2819
  98. package/dist/index-knizSLfz.js +0 -1157
  99. package/dist/index-vh86FiIQ.js +0 -10
  100. package/dist/index.esm2017-DFVkiPjd.js +0 -3069
  101. package/dist/loading-B3OgwEC8.js +0 -72
  102. package/dist/lodash-CiRTkvui.js +0 -3678
  103. package/dist/membership-s2VKnu_8.js +0 -255
  104. package/dist/moment-D7p2TMB-.js +0 -2583
  105. package/dist/money-DqxOXYd0.js +0 -15
  106. package/dist/number-Bt4sacaM.js +0 -12
  107. package/dist/object-BYyQ0PZp.js +0 -18
  108. package/dist/objectId-dwaoBfJX.js +0 -7
  109. package/dist/objectid-CxCupSWP.js +0 -145
  110. package/dist/plugins-CQ1JAqJB.js +0 -1788
  111. package/dist/reward-pjbal-XX.js +0 -36
  112. package/dist/rule-CzU2GAur.js +0 -1969
  113. package/dist/string-Gcy5IM_H.js +0 -32
  114. package/dist/style.css +0 -4
  115. package/dist/template-7yiMSL1f.js +0 -188
  116. package/dist/tier-BJDhpH6X.js +0 -4
  117. package/dist/tiers/tier=1.png +0 -0
  118. package/dist/tiers/tier=2.png +0 -0
  119. package/dist/tiers/tier=3.png +0 -0
  120. package/dist/tiers/tier=4.png +0 -0
  121. package/dist/titles/type=diamond.png +0 -0
  122. package/dist/titles/type=drinks.png +0 -0
  123. package/dist/titles/type=food.png +0 -0
  124. package/dist/titles/type=heart.png +0 -0
  125. package/dist/titles/type=medal.png +0 -0
  126. package/dist/titles/type=spend.png +0 -0
  127. package/dist/titles/type=thank-you.png +0 -0
  128. package/dist/titles/type=thumbs-up.png +0 -0
  129. package/dist/titles/type=years.png +0 -0
  130. package/dist/trigger-C5bqlYHn.js +0 -213
  131. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  132. package/dist/type_drinks-D6jnpvwV.js +0 -4
  133. package/dist/useMarketingMaterialActions-CW_QRtQb.js +0 -107
  134. package/dist/usePagination-D2pke4vy.js +0 -220
  135. package/dist/user-BcXrT_t5.js +0 -55
  136. package/dist/vue-i18n-CFNkj6JK.js +0 -2365
  137. package/dist/xlsx-DyVY5_Qx.js +0 -15491
  138. package/dist/zod-BD_8DRqQ.js +0 -91
@@ -1,166 +0,0 @@
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-B3OgwEC8.js";
4
- import { u as R } from "./business-B7GwHLce.js";
5
- import { C as A } from "./campaign-BCdKDHgz.js";
6
- import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgcm1S_g.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-OBZubKUy.js";
9
- import { u as D } from "./vue-i18n-CFNkj6JK.js";
10
- import { h as E } from "./moment-D7p2TMB-.js";
11
- import { p as I } from "./plugins-CQ1JAqJB.js";
12
- import { c as g } from "./campaign-DWlsbsKQ.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
- };
@@ -1,266 +0,0 @@
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-CQ1JAqJB.js";
5
- import { u as Z } from "./loading-B3OgwEC8.js";
6
- import { u as ee } from "./business-B7GwHLce.js";
7
- import { u as te, c as g } from "./campaign-DWlsbsKQ.js";
8
- import { b as V, c as R, a as ae } from "./campaign-BCdKDHgz.js";
9
- import { c as oe, p as ne } from "./duplicateCampaign-BSHe0P-g.js";
10
- import { u as se } from "./vue-i18n-CFNkj6JK.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-Bgcm1S_g.js";
13
- import { u as re } from "./template-7yiMSL1f.js";
14
- 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" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { 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" }, $e = /* @__PURE__ */ H({
15
- __name: "Broadcast",
16
- setup(Se) {
17
- const { t: s } = se(), O = {
18
- label: s("connect.campaign.common.createCampaign"),
19
- value: "create",
20
- isPrimary: !0,
21
- prependIcon: "add"
22
- }, T = re("BROADCAST", X()), I = ee(), p = te(), { global: K, minor: F } = Z, B = C((/* @__PURE__ */ new Date()).toISOString()), r = C({
23
- searchKey: "",
24
- location: []
25
- });
26
- function P(e) {
27
- const t = r.value.location;
28
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
29
- var c;
30
- return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
31
- }) : e.targetLocation.includes(t);
32
- }
33
- const f = q(
34
- () => p.campaigns.broadcast.filter((e) => P(e))
35
- ), $ = [
36
- {
37
- header: "Broadcast title",
38
- accessorFn: (e) => e.name
39
- },
40
- {
41
- header: "Status",
42
- accessorFn: (e) => ae(e),
43
- cell(e) {
44
- return V(e.row.original);
45
- }
46
- },
47
- {
48
- header: "Summary",
49
- accessorFn: (e) => R(e)
50
- },
51
- {
52
- header: "Message sent",
53
- accessorFn: (e) => e.currentReceive ?? "N/A"
54
- },
55
- {
56
- header: "Actions",
57
- cell(e) {
58
- return k("div", { class: "flex items-center gap-8 justify-end" }, [
59
- k(L.FmButton, {
60
- variant: "tertiary",
61
- icon: "content_copy",
62
- iconColor: "neutral-gray-400",
63
- onClick: async (t) => {
64
- t.stopPropagation(), await D(e.row.original);
65
- }
66
- }),
67
- k(L.FmButton, {
68
- variant: "tertiary",
69
- icon: "delete",
70
- iconColor: "neutral-gray-400",
71
- onClick: (t) => {
72
- t.stopPropagation(), A(e.row.original);
73
- }
74
- })
75
- ]);
76
- }
77
- }
78
- ], w = C();
79
- async function A(e) {
80
- await Y.remove(
81
- s("connect.campaign.common.remove.confirm", { name: e.name })
82
- ) && await F(
83
- async () => {
84
- await g.delete(e._id), await p.read("BROADCAST");
85
- },
86
- {
87
- message: s("connect.campaign.common.remove.removing", { name: e.name }),
88
- successMessage: s("connect.campaign.common.remove.removed", {
89
- name: e.name
90
- })
91
- }
92
- );
93
- }
94
- async function y(e) {
95
- B.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : T.open(async (l) => {
96
- await t(l);
97
- });
98
- async function t(l) {
99
- var c;
100
- (c = w.value) == null || c.showSheet(
101
- !0,
102
- "BROADCAST",
103
- e ? await g.readById(e._id) : void 0,
104
- l
105
- );
106
- }
107
- }
108
- async function D(e) {
109
- var c;
110
- if (!await oe(e.name))
111
- return;
112
- B.value = (/* @__PURE__ */ new Date()).toISOString();
113
- const t = await g.readById(e._id), l = ne(t);
114
- (c = w.value) == null || c.showSheet(
115
- !0,
116
- "BROADCAST",
117
- l,
118
- t.template
119
- );
120
- }
121
- async function j(e) {
122
- await F(
123
- async () => {
124
- e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await p.read("BROADCAST");
125
- },
126
- {
127
- message: s(
128
- `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
129
- ),
130
- successMessage: s("connect.campaign.broadcast.update.success", {
131
- action: e.campaign._id ? "updated" : "created"
132
- })
133
- }
134
- );
135
- }
136
- return z(async () => {
137
- await K(async () => {
138
- await p.read("BROADCAST");
139
- });
140
- }), (e, t) => {
141
- const l = m("FmPageHead"), c = m("FmSearch"), M = m("FmTable"), b = m("FmButton"), N = m("FmListItem"), U = m("FmList"), E = m("FmCard");
142
- return d(), h(v, null, [
143
- i(l, {
144
- title: a(s)("connect.campaign.broadcast.title"),
145
- actions: a(f).length > 0 ? [O] : [],
146
- "onClick:action": t[0] || (t[0] = () => y())
147
- }, null, 8, ["title", "actions"]),
148
- n("div", le, [
149
- i(c, {
150
- modelValue: a(r).searchKey,
151
- "onUpdate:modelValue": t[1] || (t[1] = (o) => a(r).searchKey = o),
152
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
153
- placeholder: a(s)("connect.campaign.common.search"),
154
- collapsible: ""
155
- }, null, 8, ["modelValue", "placeholder"]),
156
- a(p).campaigns.broadcast && a(p).campaigns.broadcast.length > 0 ? (d(), h(v, { key: 0 }, [
157
- n("div", me, [
158
- n("div", de, [
159
- i(ce, {
160
- label: `${a(s)("connect.campaign.common.location")}: `,
161
- "right-icon": "keyboard_arrow_down",
162
- modelValue: a(r).location,
163
- "onUpdate:modelValue": t[2] || (t[2] = (o) => a(r).location = o),
164
- icon: "storefront",
165
- "show-item-label": !0,
166
- items: a(I).locationOptions
167
- }, null, 8, ["label", "modelValue", "items"])
168
- ]),
169
- i(c, {
170
- modelValue: a(r).searchKey,
171
- "onUpdate:modelValue": t[3] || (t[3] = (o) => a(r).searchKey = o),
172
- class: "xs:hidden sm:hidden",
173
- placeholder: "search",
174
- collapsible: ""
175
- }, null, 8, ["modelValue"])
176
- ]),
177
- i(M, {
178
- class: "xs:hidden sm:hidden",
179
- "row-data": a(f),
180
- "column-defs": $,
181
- "search-value": a(r).searchKey,
182
- "column-filter": [],
183
- onRowClick: t[4] || (t[4] = (o) => y(o.original)),
184
- "hide-footer": !0
185
- }, null, 8, ["row-data", "search-value"]),
186
- i(U, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
187
- default: x(() => [
188
- (d(!0), h(v, null, G(a(f).filter(
189
- (o) => o.name.toLowerCase().includes(a(r).searchKey.toLowerCase())
190
- ), (o) => (d(), S(N, {
191
- key: o._id.toString(),
192
- onClick: (_) => y(o),
193
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
194
- }, {
195
- default: x(() => [
196
- n("div", pe, [
197
- n("div", ue, [
198
- (d(), S(J(a(V)(o)))),
199
- n("div", ge, u(o.currentReceive ?? 0) + " sent ", 1)
200
- ]),
201
- n("div", fe, [
202
- n("div", ye, u(o.name), 1),
203
- n("div", _e, u(a(R)(o)), 1)
204
- ])
205
- ]),
206
- n("div", he, [
207
- i(b, {
208
- icon: "content_copy",
209
- "icon-color": "neutral-gray-400",
210
- variant: "tertiary",
211
- onClick: async (_) => {
212
- _.stopPropagation(), await D(o);
213
- }
214
- }, null, 8, ["onClick"]),
215
- i(b, {
216
- icon: "delete",
217
- "icon-color": "neutral-gray-400",
218
- variant: "tertiary",
219
- onClick: (_) => (_.stopPropagation(), A(o))
220
- }, null, 8, ["onClick"])
221
- ])
222
- ]),
223
- _: 2
224
- }, 1032, ["onClick"]))), 128))
225
- ]),
226
- _: 1
227
- }),
228
- a(f).length == 0 ? (d(), h("div", we, [
229
- n("div", be, u(a(s)("connect.campaign.common.noResults")), 1)
230
- ])) : Q("", !0)
231
- ], 64)) : (d(), S(E, {
232
- key: 1,
233
- variant: "outlined",
234
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
235
- }, {
236
- default: x(() => [
237
- t[6] || (t[6] = n("img", {
238
- src: W,
239
- class: "aspect-square w-[150px]"
240
- }, null, -1)),
241
- n("div", Ce, [
242
- n("div", ve, u(a(s)("connect.campaign.broadcast.create.title")), 1),
243
- n("div", xe, u(a(s)("connect.campaign.broadcast.create.description")), 1)
244
- ]),
245
- i(b, {
246
- variant: "primary",
247
- label: a(s)("connect.campaign.broadcast.create.button"),
248
- icon: "add",
249
- onClick: t[5] || (t[5] = (o) => y())
250
- }, null, 8, ["label"])
251
- ]),
252
- _: 1
253
- })),
254
- i(ie, {
255
- ref_key: "sheetRef",
256
- ref: w,
257
- "onSubmit:modelValue": j
258
- }, null, 512)
259
- ])
260
- ], 64);
261
- };
262
- }
263
- });
264
- export {
265
- $e as default
266
- };
@@ -1,120 +0,0 @@
1
- import { R as RuleOperator, _ } from "./index-BanxlNli.js";
2
- import { i as isRuleGroup } from "./index-U_rwkNKU.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 { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-B5eb6_bi.js";
6
- import "./index-D-kYrDAi.js";
7
- import "./index-Ca2bBJuR.js";
8
- function validateRule(data, r, date) {
9
- const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
10
- function meetConditions(e) {
11
- return Object.entries(e.conditions ?? {}).reduce(
12
- (o, [n, t]) => {
13
- const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
14
- if (t == null)
15
- return console.log("Bad data, ignoring rule", {
16
- // property: r.property,
17
- // source,
18
- conditionKey: n,
19
- equator: t
20
- // raw: data,
21
- }), o;
22
- const i = rules[n](
23
- l,
24
- t
25
- );
26
- return o && i;
27
- },
28
- !0
29
- );
30
- }
31
- function evaluateRuleResult(rr, logic) {
32
- const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
33
- return !logic || !!eval(target);
34
- }
35
- function getRuleResults(e) {
36
- return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
37
- ...o,
38
- [n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
39
- }), {}) : {
40
- [e.name]: meetConditions(e)
41
- };
42
- }
43
- return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
44
- }
45
- 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({
46
- __name: "CampaignTypeDialog",
47
- props: {
48
- onSelect: {
49
- type: Function,
50
- required: !0
51
- }
52
- },
53
- setup(e) {
54
- const o = e, n = useDialog(), t = [
55
- {
56
- title: "Promotion",
57
- description: "Special offers or deals made available for a limited time",
58
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
59
- },
60
- {
61
- title: "Voucher",
62
- description: "A digital coupon that can be redeemed for a discounts on future purchases.",
63
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
64
- },
65
- {
66
- title: "Experience",
67
- description: "Experience points help customers gain membership tiers.",
68
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
69
- },
70
- {
71
- title: "Point",
72
- description: "Points allow customers to purchase bundle items.",
73
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
74
- },
75
- {
76
- title: "Game",
77
- description: "The game feature adds a fun and encourage customers to engage more.",
78
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
79
- },
80
- {
81
- title: "Credit",
82
- description: "Credits are virtual money that customers can use to pay for their purchases.",
83
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
84
- }
85
- ];
86
- function l(i) {
87
- n.close(), o.onSelect(i);
88
- }
89
- return (i, a) => {
90
- const c = resolveComponent("FmCard");
91
- return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
92
- default: withCtx(() => [
93
- a[0] || (a[0] = createElementVNode("div", { class: "" }, [
94
- createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
95
- 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. ")
96
- ], -1)),
97
- createElementVNode("div", _hoisted_1, [
98
- (openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
99
- variant: "outlined",
100
- key: s.value,
101
- onClick: (u) => l(s.value),
102
- class: "p-16 space-y-8 cursor-pointer"
103
- }, {
104
- default: withCtx(() => [
105
- createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
106
- createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
107
- ]),
108
- _: 2
109
- }, 1032, ["onClick"])), 64))
110
- ])
111
- ]),
112
- _: 1
113
- });
114
- };
115
- }
116
- });
117
- export {
118
- _sfc_main as _,
119
- validateRule as v
120
- };