@feedmepos/mf-connect 0.1.38-beta.52 → 0.1.38-beta.53

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 (130) hide show
  1. package/package.json +2 -2
  2. package/dist/Analytic-BU1mOMoX.js +0 -760
  3. package/dist/App-fw6iFNxW.js +0 -4638
  4. package/dist/AuditLogs-CliU8167.js +0 -1887
  5. package/dist/Bin-C49tzfas.js +0 -166
  6. package/dist/Broadcast-YZVnZTCD.js +0 -232
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DEwsZags.js +0 -122
  8. package/dist/Card-DcQQyJl9.js +0 -911
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections--8lmoXWR.js +0 -540
  11. package/dist/Credit-CfkLFMei.js +0 -227
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-t6eac8yR.js +0 -3151
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CXVOuiLI.js +0 -347
  16. package/dist/Experience-BnVVC2-L.js +0 -228
  17. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/Game-Dbz4DzY_.js +0 -297
  20. package/dist/Grab-CCqScmpp.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-C5irH9v6.js +0 -145
  22. package/dist/Index-DPsM9D4W.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  25. package/dist/MainLayout-B1aJoR95.js +0 -41
  26. package/dist/Marketing-CFwxWdJq.js +0 -21761
  27. package/dist/Member-ZPKbf5Bk.js +0 -281
  28. package/dist/MemberList-BDs-70nG.js +0 -1607
  29. package/dist/MemberOverview-wL_ailso.js +0 -58
  30. package/dist/MemberTransactions-C-zHpuZF.js +0 -45
  31. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-B2TKmOOK.js +0 -60616
  32. package/dist/Mission-BHkb1E9m.js +0 -301
  33. package/dist/Overview-DYlcqNCX.js +0 -1079
  34. package/dist/Point-BEhNBY2_.js +0 -231
  35. package/dist/Promotion-DOXRIej4.js +0 -363
  36. package/dist/Queue-Bwa0LWhf.js +0 -260
  37. package/dist/Record-BoI8l1Qq.js +0 -341
  38. package/dist/Reward-BVQaqAYM.js +0 -442
  39. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BC3dEiWi.js +0 -150
  40. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-HpleMvjm.js +0 -1767
  41. package/dist/Segment-Cmy7nu27.js +0 -882
  42. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-pab6X2DC.js +0 -181
  43. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqIh8D8O.js +0 -189
  44. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CESoNd87.js +0 -147
  45. package/dist/Setting-DN8j_6Xv.js +0 -1993
  46. package/dist/SettingAdvertisements-qHdiaa6m.js +0 -264
  47. package/dist/Store-DfhVYCgX.js +0 -1936
  48. package/dist/StoreRewards-NYucFLJU.js +0 -535
  49. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BGOcOAXR.js +0 -1036
  50. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DRin8Jzw.js +0 -8093
  51. package/dist/Tier-Dl0aBuJz.js +0 -970
  52. package/dist/Title-DvO6Mira.js +0 -568
  53. package/dist/Transaction-ONVl4UZZ.js +0 -39
  54. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-FyE25D8o.js +0 -130
  55. package/dist/Voucher-BZ1feYh1.js +0 -399
  56. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Lilql8J4.js +0 -421
  57. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-C_ZdCOPI.js +0 -56
  58. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  59. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  60. package/dist/app-B_RRkjaD.js +0 -42566
  61. package/dist/app-wDQR6dpb.js +0 -39
  62. package/dist/app.js +0 -7
  63. package/dist/business-y5qSMcd-.js +0 -82
  64. package/dist/campaign-CpzFl8Vr.js +0 -4
  65. package/dist/campaign-DHgol2Lt.js +0 -219
  66. package/dist/campaign-Drxe0zPX.js +0 -253
  67. package/dist/campaign.enum-CwAPVgPe.js +0 -21
  68. package/dist/campaign.fn-DMx5xsiK.js +0 -776
  69. package/dist/collectible.enum-Bh4jnUgP.js +0 -19
  70. package/dist/collection.fn-BpC_YBwG.js +0 -26
  71. package/dist/dto-DWkf9QOb.js +0 -222
  72. package/dist/effect-D5ZWGpNS.js +0 -78
  73. package/dist/email-addresses-DFtVESS8.js +0 -705
  74. package/dist/export-BtUy3sWU.js +0 -97
  75. package/dist/feedme.ico +0 -0
  76. package/dist/helper-DtWMZoWX.js +0 -86
  77. package/dist/index-7HXC3sH0.js +0 -56
  78. package/dist/index-BQlhmw75.js +0 -3
  79. package/dist/index-BdX7CxUg.js +0 -30076
  80. package/dist/index-BerRe0M3.js +0 -76
  81. package/dist/index-BrZ3xZzk.js +0 -146
  82. package/dist/index-CJzBpsBP.js +0 -3412
  83. package/dist/index-CQiABpeB.js +0 -32456
  84. package/dist/index-CqIWlGW3.js +0 -38
  85. package/dist/index-CsaQJMAR.js +0 -66
  86. package/dist/index-DPCDboPA.js +0 -32
  87. package/dist/index-DPaH8jaV.js +0 -8884
  88. package/dist/index-Dkce3JZ_.js +0 -54
  89. package/dist/index-DrYv_gG4.js +0 -31
  90. package/dist/index-SfJbKfWl.js +0 -2407
  91. package/dist/index-vh86FiIQ.js +0 -10
  92. package/dist/index.esm2017-CbvE5vCC.js +0 -3069
  93. package/dist/loading-BWGIK17X.js +0 -71
  94. package/dist/lodash-B5I3zXaY.js +0 -3678
  95. package/dist/membership-Zy2P6O6X.js +0 -235
  96. package/dist/moment-D7p2TMB-.js +0 -2583
  97. package/dist/money-D_fZmBbi.js +0 -15
  98. package/dist/number-C4DhXkCm.js +0 -12
  99. package/dist/object-qECH92oz.js +0 -26
  100. package/dist/objectId-dwaoBfJX.js +0 -7
  101. package/dist/objectid-C6eRcDzI.js +0 -145
  102. package/dist/plugins-DDAJav2s.js +0 -1817
  103. package/dist/reward-Dxjvmy7-.js +0 -36
  104. package/dist/rule-builder-ZkPWAiTl.js +0 -102
  105. package/dist/rule-sclqeiyk.js +0 -1951
  106. package/dist/style.css +0 -4
  107. package/dist/template-CAs0lkTY.js +0 -188
  108. package/dist/tier-BJDhpH6X.js +0 -4
  109. package/dist/tiers/tier=1.png +0 -0
  110. package/dist/tiers/tier=2.png +0 -0
  111. package/dist/tiers/tier=3.png +0 -0
  112. package/dist/tiers/tier=4.png +0 -0
  113. package/dist/timezone-5t8ki0gE.js +0 -1151
  114. package/dist/titles/type=diamond.png +0 -0
  115. package/dist/titles/type=drinks.png +0 -0
  116. package/dist/titles/type=food.png +0 -0
  117. package/dist/titles/type=heart.png +0 -0
  118. package/dist/titles/type=medal.png +0 -0
  119. package/dist/titles/type=spend.png +0 -0
  120. package/dist/titles/type=thank-you.png +0 -0
  121. package/dist/titles/type=thumbs-up.png +0 -0
  122. package/dist/titles/type=years.png +0 -0
  123. package/dist/trigger-B2fpKTfg.js +0 -213
  124. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  125. package/dist/type_drinks-D6jnpvwV.js +0 -4
  126. package/dist/usePagination-Ds-cuHop.js +0 -223
  127. package/dist/user-ORhbAsqi.js +0 -55
  128. package/dist/vue-i18n-cyOhW8mW.js +0 -2365
  129. package/dist/xlsx-4klfjFae.js +0 -15491
  130. package/dist/zod-BsHmzMQd.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-BWGIK17X.js";
4
- import { u as R } from "./business-y5qSMcd-.js";
5
- import { C as A } from "./campaign-Drxe0zPX.js";
6
- import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-t6eac8yR.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-CESoNd87.js";
9
- import { u as D } from "./vue-i18n-cyOhW8mW.js";
10
- import { h as E } from "./moment-D7p2TMB-.js";
11
- import { p as I } from "./plugins-DDAJav2s.js";
12
- import { c as g } from "./campaign-DHgol2Lt.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,232 +0,0 @@
1
- import { defineComponent as U, ref as h, computed as j, onMounted as E, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as b, createVNode as r, unref as o, createElementVNode as n, withCtx as w, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as p, createCommentVNode as z, h as G } from "vue";
2
- import { _ as J } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as Q, components as W } from "@feedmepos/ui-library";
4
- import { p as X } from "./plugins-DDAJav2s.js";
5
- import { u as Y } from "./loading-BWGIK17X.js";
6
- import { u as Z } from "./business-y5qSMcd-.js";
7
- import { u as ee, c as _ } from "./campaign-DHgol2Lt.js";
8
- import { b as B, c as A, a as te } from "./campaign-Drxe0zPX.js";
9
- import { u as oe } from "./vue-i18n-cyOhW8mW.js";
10
- import { _ as ae } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as ne } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-t6eac8yR.js";
12
- import { u as se } from "./template-CAs0lkTY.js";
13
- const ce = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { key: 0 }, ye = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, _e = { class: "flex flex-col gap-16 text-center" }, he = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = /* @__PURE__ */ U({
14
- __name: "Broadcast",
15
- setup(we) {
16
- const { t: s } = oe(), L = {
17
- label: s("connect.campaign.common.createCampaign"),
18
- value: "create",
19
- isPrimary: !0,
20
- prependIcon: "add"
21
- }, V = se("BROADCAST", Q()), D = Z(), u = ee(), { global: R, minor: C } = Y, T = h((/* @__PURE__ */ new Date()).toISOString()), c = h({
22
- searchKey: "",
23
- location: []
24
- });
25
- function K(e) {
26
- const t = c.value.location;
27
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
28
- var i;
29
- return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(l);
30
- }) : e.targetLocation.includes(t);
31
- }
32
- const f = j(
33
- () => u.campaigns.broadcast.filter((e) => K(e))
34
- ), O = [
35
- {
36
- header: "Broadcast title",
37
- accessorFn: (e) => e.name
38
- },
39
- {
40
- header: "Status",
41
- accessorFn: (e) => te(e),
42
- cell(e) {
43
- return B(e.row.original);
44
- }
45
- },
46
- {
47
- header: "Summary",
48
- accessorFn: (e) => A(e)
49
- },
50
- {
51
- header: "Message sent",
52
- accessorFn: (e) => e.currentReceive ?? "N/A"
53
- },
54
- {
55
- header: "Actions",
56
- cell(e) {
57
- return G(W.FmButton, {
58
- variant: "tertiary",
59
- icon: "delete",
60
- iconColor: "neutral-gray-400",
61
- onClick: (t) => {
62
- t.stopPropagation(), S(e.row.original);
63
- }
64
- });
65
- }
66
- }
67
- ], x = h();
68
- async function S(e) {
69
- await X.remove(
70
- s("connect.campaign.common.remove.confirm", { name: e.name })
71
- ) && await C(
72
- async () => {
73
- await _.delete(e._id), await u.read("BROADCAST");
74
- },
75
- {
76
- message: s("connect.campaign.common.remove.removing", { name: e.name }),
77
- successMessage: s("connect.campaign.common.remove.removed", {
78
- name: e.name
79
- })
80
- }
81
- );
82
- }
83
- async function g(e) {
84
- T.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : V.open(async (l) => {
85
- await t(l);
86
- });
87
- async function t(l) {
88
- var i;
89
- (i = x.value) == null || i.showSheet(
90
- !0,
91
- "BROADCAST",
92
- e ? await _.readById(e._id) : void 0,
93
- l
94
- );
95
- }
96
- }
97
- async function I(e) {
98
- await C(
99
- async () => {
100
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("BROADCAST");
101
- },
102
- {
103
- message: s(
104
- `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
105
- ),
106
- successMessage: s("connect.campaign.broadcast.update.success", {
107
- action: e.campaign._id ? "updated" : "created"
108
- })
109
- }
110
- );
111
- }
112
- return E(async () => {
113
- await R(async () => {
114
- await u.read("BROADCAST");
115
- });
116
- }), (e, t) => {
117
- const l = m("FmPageHead"), i = m("FmSearch"), $ = m("FmTable"), F = m("FmButton"), P = m("FmListItem"), M = m("FmList"), N = m("FmCard");
118
- return d(), y(b, null, [
119
- r(l, {
120
- title: o(s)("connect.campaign.broadcast.title"),
121
- actions: o(f).length > 0 ? [L] : [],
122
- "onClick:action": t[0] || (t[0] = () => g())
123
- }, null, 8, ["title", "actions"]),
124
- n("div", ce, [
125
- r(i, {
126
- modelValue: o(c).searchKey,
127
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
128
- class: "hidden xs:!block border-b-2 border-fm-color-neutral-gray-100",
129
- placeholder: o(s)("connect.campaign.common.search"),
130
- collapsible: ""
131
- }, null, 8, ["modelValue", "placeholder"]),
132
- o(u).campaigns.broadcast && o(u).campaigns.broadcast.length > 0 ? (d(), y(b, { key: 0 }, [
133
- n("div", re, [
134
- n("div", ie, [
135
- r(ae, {
136
- label: `${o(s)("connect.campaign.common.location")}: `,
137
- "right-icon": "keyboard_arrow_down",
138
- modelValue: o(c).location,
139
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
140
- icon: "storefront",
141
- "show-item-label": !0,
142
- items: o(D).locationOptions
143
- }, null, 8, ["label", "modelValue", "items"])
144
- ]),
145
- r(i, {
146
- modelValue: o(c).searchKey,
147
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
148
- class: "xs:hidden",
149
- placeholder: "search",
150
- collapsible: ""
151
- }, null, 8, ["modelValue"])
152
- ]),
153
- r($, {
154
- class: "xs:hidden",
155
- "row-data": o(f),
156
- "column-defs": O,
157
- "search-value": o(c).searchKey,
158
- "column-filter": [],
159
- onRowClick: t[4] || (t[4] = (a) => g(a.original)),
160
- "hide-footer": !0
161
- }, null, 8, ["row-data", "search-value"]),
162
- r(M, { class: "hidden xs:!flex flex-col mx-[-24px]" }, {
163
- default: w(() => [
164
- (d(!0), y(b, null, H(o(f).filter(
165
- (a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
166
- ), (a) => (d(), v(P, {
167
- key: a._id.toString(),
168
- onClick: (k) => g(a),
169
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
170
- }, {
171
- default: w(() => [
172
- n("div", le, [
173
- n("div", me, [
174
- (d(), v(q(o(B)(a)))),
175
- n("div", de, p(a.currentReceive ?? 0) + " sent ", 1)
176
- ]),
177
- n("div", ue, [
178
- n("div", pe, p(a.name), 1),
179
- n("div", fe, p(o(A)(a)), 1)
180
- ])
181
- ]),
182
- r(F, {
183
- icon: "delete",
184
- "icon-color": "neutral-gray-400",
185
- variant: "tertiary",
186
- onClick: (k) => (k.stopPropagation(), S(a))
187
- }, null, 8, ["onClick"])
188
- ]),
189
- _: 2
190
- }, 1032, ["onClick"]))), 128))
191
- ]),
192
- _: 1
193
- }),
194
- o(f).length == 0 ? (d(), y("div", ge, [
195
- n("div", ye, p(o(s)("connect.campaign.common.noResults")), 1)
196
- ])) : z("", !0)
197
- ], 64)) : (d(), v(N, {
198
- key: 1,
199
- variant: "outlined",
200
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
201
- }, {
202
- default: w(() => [
203
- t[6] || (t[6] = n("img", {
204
- src: J,
205
- class: "aspect-square w-[150px]"
206
- }, null, -1)),
207
- n("div", _e, [
208
- n("div", he, p(o(s)("connect.campaign.broadcast.create.title")), 1),
209
- n("div", be, p(o(s)("connect.campaign.broadcast.create.description")), 1)
210
- ]),
211
- r(F, {
212
- variant: "primary",
213
- label: o(s)("connect.campaign.broadcast.create.button"),
214
- icon: "add",
215
- onClick: t[5] || (t[5] = (a) => g())
216
- }, null, 8, ["label"])
217
- ]),
218
- _: 1
219
- })),
220
- r(ne, {
221
- ref_key: "sheetRef",
222
- ref: x,
223
- "onSubmit:modelValue": I
224
- }, null, 512)
225
- ])
226
- ], 64);
227
- };
228
- }
229
- });
230
- export {
231
- Te as default
232
- };
@@ -1,122 +0,0 @@
1
- import { R as RuleOperator, _ } from "./index-DPaH8jaV.js";
2
- import { i as isRuleGroup } from "./rule-builder-ZkPWAiTl.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-SfJbKfWl.js";
6
- import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-CJzBpsBP.js";
7
- import "./index-CQiABpeB.js";
8
- import "./index-CqIWlGW3.js";
9
- import "./index-Dkce3JZ_.js";
10
- function validateRule(data, r, date) {
11
- const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
12
- function meetConditions(e) {
13
- return Object.entries(e.conditions ?? {}).reduce(
14
- (o, [n, t]) => {
15
- const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
16
- if (t == null)
17
- return console.log("Bad data, ignoring rule", {
18
- // property: r.property,
19
- // source,
20
- conditionKey: n,
21
- equator: t
22
- // raw: data,
23
- }), o;
24
- const i = rules[n](
25
- l,
26
- t
27
- );
28
- return o && i;
29
- },
30
- !0
31
- );
32
- }
33
- function evaluateRuleResult(rr, logic) {
34
- const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
35
- return !logic || !!eval(target);
36
- }
37
- function getRuleResults(e) {
38
- return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
39
- ...o,
40
- [n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
41
- }), {}) : {
42
- [e.name]: meetConditions(e)
43
- };
44
- }
45
- return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
46
- }
47
- 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({
48
- __name: "CampaignTypeDialog",
49
- props: {
50
- onSelect: {
51
- type: Function,
52
- required: !0
53
- }
54
- },
55
- setup(e) {
56
- const o = e, n = useDialog(), t = [
57
- {
58
- title: "Promotion",
59
- description: "Special offers or deals made available for a limited time",
60
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
61
- },
62
- {
63
- title: "Voucher",
64
- description: "A digital coupon that can be redeemed for a discounts on future purchases.",
65
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
66
- },
67
- {
68
- title: "Experience",
69
- description: "Experience points help customers gain membership tiers.",
70
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
71
- },
72
- {
73
- title: "Point",
74
- description: "Points allow customers to purchase bundle items.",
75
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
76
- },
77
- {
78
- title: "Game",
79
- description: "The game feature adds a fun and encourage customers to engage more.",
80
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
81
- },
82
- {
83
- title: "Credit",
84
- description: "Credits are virtual money that customers can use to pay for their purchases.",
85
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
86
- }
87
- ];
88
- function l(i) {
89
- n.close(), o.onSelect(i);
90
- }
91
- return (i, a) => {
92
- const c = resolveComponent("FmCard");
93
- return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
94
- default: withCtx(() => [
95
- a[0] || (a[0] = createElementVNode("div", { class: "" }, [
96
- createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
97
- 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. ")
98
- ], -1)),
99
- createElementVNode("div", _hoisted_1, [
100
- (openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
101
- variant: "outlined",
102
- key: s.value,
103
- onClick: (u) => l(s.value),
104
- class: "p-16 space-y-8 cursor-pointer"
105
- }, {
106
- default: withCtx(() => [
107
- createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
108
- createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
109
- ]),
110
- _: 2
111
- }, 1032, ["onClick"])), 64))
112
- ])
113
- ]),
114
- _: 1
115
- });
116
- };
117
- }
118
- });
119
- export {
120
- _sfc_main as _,
121
- validateRule as v
122
- };