@feedmepos/mf-connect 0.1.98-beta.4 → 0.1.98-beta.40

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 (135) hide show
  1. package/package.json +3 -3
  2. package/dist/App-BGv_JihW.js +0 -4642
  3. package/dist/AuditLogs-53rnjCmD.js +0 -2013
  4. package/dist/Bin-B0Q_WpuY.js +0 -166
  5. package/dist/Broadcast-PiJE1Syl.js +0 -266
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dz2KsBZl.js +0 -120
  7. package/dist/Card-DlqMu3Sl.js +0 -910
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-BWcBlDDR.js +0 -540
  10. package/dist/Credit-CMfcuj5n.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-DCvH0lGA.js +0 -3377
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-B_FyeWq4.js +0 -351
  15. package/dist/Experience-DacFmPYy.js +0 -259
  16. package/dist/FileSaver.min-CMZKiGkX.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-DXKnGuhR.js +0 -330
  20. package/dist/Grab-DaBL5y3H.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BaY_nQio.js +0 -145
  22. package/dist/Index-2UrjF35w.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BuVBZsCN.js +0 -48
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-6wUxYqWe.js +0 -18737
  26. package/dist/LoyaltyDashboard-DIArPp71.js +0 -1082
  27. package/dist/MainLayout-BjvTxTPG.js +0 -41
  28. package/dist/Marketing-DEp--hFd.js +0 -235
  29. package/dist/MarketingMaterialEdit-BHL8Ptsu.js +0 -1035
  30. package/dist/Member-BU1YxoEV.js +0 -280
  31. package/dist/MemberList-zjvJBYf0.js +0 -1601
  32. package/dist/MemberOverview-wL_ailso.js +0 -58
  33. package/dist/MemberTransactions-BvyLV69V.js +0 -45
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-_YOM1SlS.js +0 -60802
  35. package/dist/Mission-BNYk_aPM.js +0 -334
  36. package/dist/Overview-BToUlbsH.js +0 -1079
  37. package/dist/Point-B-L2326L.js +0 -262
  38. package/dist/Promotion-sMKGkL4w.js +0 -397
  39. package/dist/Queue-D3vUkKN9.js +0 -260
  40. package/dist/Record-BViEbZZ8.js +0 -342
  41. package/dist/Review-CMBAk-Qu.js +0 -1067
  42. package/dist/ReviewFacebookCallback-BCJTFy3b.js +0 -243
  43. package/dist/ReviewGoogleCallback-DKUG075r.js +0 -208
  44. package/dist/Reward-CZsvsYW_.js +0 -442
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BASPLoRa.js +0 -149
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B90meAnV.js +0 -1911
  47. package/dist/Segment-CN8NEg8w.js +0 -1014
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BGyYQST4.js +0 -181
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BxW-Kc6t.js +0 -188
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-C9dwcEr5.js +0 -226
  51. package/dist/Setting-DLPbZW11.js +0 -2047
  52. package/dist/SettingAdvertisements-BIq8gS5g.js +0 -264
  53. package/dist/Store-DNB3gUIR.js +0 -1996
  54. package/dist/StoreRewards-BoEjVFk6.js +0 -540
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bv9ABH1K.js +0 -1130
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DNHgSfIg.js +0 -7007
  57. package/dist/Tier-kQ6X9h-t.js +0 -969
  58. package/dist/Title-XosVAF2Y.js +0 -566
  59. package/dist/Transaction-CO6oLPKR.js +0 -39
  60. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-McMR2Y7Y.js +0 -130
  61. package/dist/Voucher-CogaCxx2.js +0 -421
  62. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DjHwHFBq.js +0 -421
  63. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Dor9klZ8.js +0 -56
  64. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  65. package/dist/app-C9UPXbDs.js +0 -59737
  66. package/dist/app-wDQR6dpb.js +0 -39
  67. package/dist/app.js +0 -7
  68. package/dist/business-CYpW6-Ls.js +0 -82
  69. package/dist/campaign-BtLa7KeF.js +0 -277
  70. package/dist/campaign-CpzFl8Vr.js +0 -4
  71. package/dist/campaign-CtoHyXVT.js +0 -219
  72. package/dist/campaign.enum-DiLhS5il.js +0 -26
  73. package/dist/campaign.fn-CLB9gBHo.js +0 -776
  74. package/dist/collectible.enum-CmwWcfBh.js +0 -19
  75. package/dist/duplicateCampaign-DGhOBd5l.js +0 -51
  76. package/dist/effect-CY5Y6sxy.js +0 -89
  77. package/dist/email-addresses-BEnOHWj_.js +0 -705
  78. package/dist/export-BgYu7SCd.js +0 -97
  79. package/dist/feedme.ico +0 -0
  80. package/dist/helper-DTDgoyEh.js +0 -86
  81. package/dist/index-B4IAURA_.js +0 -3684
  82. package/dist/index-BZVhi3ZG.js +0 -28900
  83. package/dist/index-C8ehLvXG.js +0 -31
  84. package/dist/index-CDk0Itu1.js +0 -32
  85. package/dist/index-CLZnH782.js +0 -54
  86. package/dist/index-CNKP1_IW.js +0 -30289
  87. package/dist/index-CP-7qATP.js +0 -67
  88. package/dist/index-Ck3PeOQ5.js +0 -1157
  89. package/dist/index-CuvNtC_M.js +0 -61
  90. package/dist/index-DntoqWT_.js +0 -85
  91. package/dist/index-DtyWsBgg.js +0 -3
  92. package/dist/index-P8Qh2yIP.js +0 -52
  93. package/dist/index-goRooQn5.js +0 -2802
  94. package/dist/index-kS20rM5m.js +0 -8910
  95. package/dist/index-vh86FiIQ.js +0 -10
  96. package/dist/index-zF0gIg9H.js +0 -151
  97. package/dist/index.esm2017-C79fd6cz.js +0 -3069
  98. package/dist/loading-Dfr_97Ri.js +0 -72
  99. package/dist/lodash-BX2mJOxF.js +0 -3678
  100. package/dist/membership-ncNOUJwj.js +0 -255
  101. package/dist/moment-D7p2TMB-.js +0 -2583
  102. package/dist/money-vEtTzt04.js +0 -15
  103. package/dist/number-BjgTlMsp.js +0 -12
  104. package/dist/object-BYyQ0PZp.js +0 -18
  105. package/dist/objectId-dwaoBfJX.js +0 -7
  106. package/dist/objectid-C9DiLwge.js +0 -145
  107. package/dist/plugins-BVGqEmE1.js +0 -1788
  108. package/dist/reward-BGTLhhzT.js +0 -36
  109. package/dist/rule-BB2VX3Gy.js +0 -1969
  110. package/dist/string-Gcy5IM_H.js +0 -32
  111. package/dist/style.css +0 -4
  112. package/dist/template-DLiHnpjK.js +0 -188
  113. package/dist/tier-BJDhpH6X.js +0 -4
  114. package/dist/tiers/tier=1.png +0 -0
  115. package/dist/tiers/tier=2.png +0 -0
  116. package/dist/tiers/tier=3.png +0 -0
  117. package/dist/tiers/tier=4.png +0 -0
  118. package/dist/titles/type=diamond.png +0 -0
  119. package/dist/titles/type=drinks.png +0 -0
  120. package/dist/titles/type=food.png +0 -0
  121. package/dist/titles/type=heart.png +0 -0
  122. package/dist/titles/type=medal.png +0 -0
  123. package/dist/titles/type=spend.png +0 -0
  124. package/dist/titles/type=thank-you.png +0 -0
  125. package/dist/titles/type=thumbs-up.png +0 -0
  126. package/dist/titles/type=years.png +0 -0
  127. package/dist/trigger-DrKnfSoi.js +0 -213
  128. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  129. package/dist/type_drinks-D6jnpvwV.js +0 -4
  130. package/dist/useMarketingMaterialActions-B6zaDbNE.js +0 -107
  131. package/dist/usePagination-Dgd-onzU.js +0 -220
  132. package/dist/user-BcDUmNrZ.js +0 -55
  133. package/dist/vue-i18n-DNBGmwox.js +0 -2365
  134. package/dist/xlsx-BX-U0_Au.js +0 -15491
  135. package/dist/zod-Mx51GBPY.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-Dfr_97Ri.js";
4
- import { u as R } from "./business-CYpW6-Ls.js";
5
- import { C as A } from "./campaign-BtLa7KeF.js";
6
- import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCvH0lGA.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-C9dwcEr5.js";
9
- import { u as D } from "./vue-i18n-DNBGmwox.js";
10
- import { h as E } from "./moment-D7p2TMB-.js";
11
- import { p as I } from "./plugins-BVGqEmE1.js";
12
- import { c as g } from "./campaign-CtoHyXVT.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-BVGqEmE1.js";
5
- import { u as Z } from "./loading-Dfr_97Ri.js";
6
- import { u as ee } from "./business-CYpW6-Ls.js";
7
- import { u as te, c as g } from "./campaign-CtoHyXVT.js";
8
- import { b as V, c as R, a as ae } from "./campaign-BtLa7KeF.js";
9
- import { c as oe, p as ne } from "./duplicateCampaign-DGhOBd5l.js";
10
- import { u as se } from "./vue-i18n-DNBGmwox.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-DCvH0lGA.js";
13
- import { u as re } from "./template-DLiHnpjK.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-kS20rM5m.js";
2
- import { i as isRuleGroup } from "./index-goRooQn5.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-B4IAURA_.js";
6
- import "./index-CNKP1_IW.js";
7
- import "./index-CLZnH782.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
- };