@feedmepos/mf-connect 0.1.38-beta.6 → 0.1.38-beta.60

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 +13 -5
  2. package/dist/Analytic-NBx32reB.js +0 -761
  3. package/dist/App-CaK9PvMd.js +0 -4632
  4. package/dist/AuditLogs-C-gCCPvF.js +0 -1887
  5. package/dist/Bin-CL6o1JSs.js +0 -166
  6. package/dist/Broadcast-B2-itjvZ.js +0 -227
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BIySMYGP.js +0 -121
  8. package/dist/Card-DNdEjt6s.js +0 -905
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-DepGq6WJ.js +0 -465
  11. package/dist/Credit-D7K0gFwc.js +0 -222
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-HMjbuy2C.js +0 -2185
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DrbMJlm5.js +0 -347
  16. package/dist/Experience-FlBX3eyN.js +0 -223
  17. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  19. package/dist/Game-Cc3D7lKV.js +0 -278
  20. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
  21. package/dist/Index-2wokhhFB.js +0 -259
  22. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  23. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  24. package/dist/MainLayout-B1aJoR95.js +0 -41
  25. package/dist/Marketing-D7PXYloN.js +0 -20073
  26. package/dist/Member-2xV4Izwa.js +0 -279
  27. package/dist/MemberList-CYgBdyJt.js +0 -1606
  28. package/dist/MemberOverview-wL_ailso.js +0 -58
  29. package/dist/MemberTransactions-DWDV01N4.js +0 -45
  30. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Becsw31k.js +0 -60343
  31. package/dist/Mission-BSGc9822.js +0 -296
  32. package/dist/Overview-BZjto86d.js +0 -1079
  33. package/dist/Point-0U4TTdPW.js +0 -226
  34. package/dist/Promotion-DiUa0GcV.js +0 -289
  35. package/dist/Queue-D62r2qjy.js +0 -260
  36. package/dist/Record-0iF3dG7y.js +0 -341
  37. package/dist/Reward-C5IEJYu6.js +0 -442
  38. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-S2Fd0qO8.js +0 -150
  39. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CxlamGFP.js +0 -1751
  40. package/dist/Segment-BknjBrUP.js +0 -882
  41. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BLQlkp-j.js +0 -181
  42. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CaPi4hYB.js +0 -188
  43. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BoZ0ZpNZ.js +0 -147
  44. package/dist/Setting-RLI7RgmN.js +0 -1936
  45. package/dist/Store-gxmv8hWJ.js +0 -1842
  46. package/dist/StoreRewards-C_6gY_Nk.js +0 -423
  47. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B5uzSYM4.js +0 -1029
  48. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-yjI96ZL0.js +0 -139
  49. package/dist/Tier-B168DtFj.js +0 -888
  50. package/dist/Title-uH0RI1N3.js +0 -565
  51. package/dist/Transaction-Bx-pmLrJ.js +0 -39
  52. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Ce_55V7l.js +0 -130
  53. package/dist/Voucher-Dzpz2AEB.js +0 -384
  54. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-dbA6_6b9.js +0 -419
  55. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CfLiUj9f.js +0 -56
  56. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  57. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  58. package/dist/app-B90wINOO.js +0 -33357
  59. package/dist/app-DuUxQ1ZP.js +0 -7086
  60. package/dist/app-wDQR6dpb.js +0 -39
  61. package/dist/app.js +0 -7
  62. package/dist/business-B65OtB5B.js +0 -79
  63. package/dist/campaign-CpzFl8Vr.js +0 -4
  64. package/dist/campaign-iKI-L84v.js +0 -1810
  65. package/dist/campaign-qGy6uzrC.js +0 -96
  66. package/dist/campaign.enum-CZp2DmXI.js +0 -20
  67. package/dist/campaign.fn-DKScnmjX.js +0 -758
  68. package/dist/collectible.enum-CN-lnG1m.js +0 -19
  69. package/dist/collection.fn-mMwGQWce.js +0 -26
  70. package/dist/dto-C5ri8Nws.js +0 -214
  71. package/dist/effect-Bg3yb9T6.js +0 -78
  72. package/dist/email-addresses-CQsN724N.js +0 -705
  73. package/dist/export-BLf2dhFd.js +0 -97
  74. package/dist/feedme.ico +0 -0
  75. package/dist/helper-CFaph16Q.js +0 -71
  76. package/dist/index-BBPIZjw6.js +0 -31
  77. package/dist/index-BCGDOgxb.js +0 -38
  78. package/dist/index-BCPBmANe.js +0 -3120
  79. package/dist/index-BKOgzVx6.js +0 -32
  80. package/dist/index-BN2Uyvj4.js +0 -30038
  81. package/dist/index-BPZtjcTm.js +0 -76
  82. package/dist/index-BPyac0fq.js +0 -56
  83. package/dist/index-BkySejFg.js +0 -54
  84. package/dist/index-CH2d_B8c.js +0 -121
  85. package/dist/index-CrbnfAk8.js +0 -8861
  86. package/dist/index-CsaQJMAR.js +0 -66
  87. package/dist/index-DJwQICyC.js +0 -146
  88. package/dist/index-DaEQgaiW.js +0 -2213
  89. package/dist/index-Dkmn0jmX.js +0 -32260
  90. package/dist/index-Dy5p_b1S.js +0 -3
  91. package/dist/index-vh86FiIQ.js +0 -10
  92. package/dist/index.esm2017-B9vJTKYg.js +0 -3069
  93. package/dist/loading-MEQuW9Xa.js +0 -71
  94. package/dist/lodash-B5I3zXaY.js +0 -3678
  95. package/dist/membership-Du79A0Pl.js +0 -235
  96. package/dist/moment-BWErdI6_.js +0 -2578
  97. package/dist/money-DXgYs2-R.js +0 -15
  98. package/dist/number-CBMkNZvH.js +0 -12
  99. package/dist/object-qECH92oz.js +0 -26
  100. package/dist/objectId-dwaoBfJX.js +0 -7
  101. package/dist/objectid-BeZTZYqi.js +0 -145
  102. package/dist/plugins-KiMuDTPp.js +0 -208
  103. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  104. package/dist/reward-ClX_lWcQ.js +0 -36
  105. package/dist/rule-BfidJ75Y.js +0 -1951
  106. package/dist/rule-builder-BTcZx77a.js +0 -89
  107. package/dist/style.css +0 -4
  108. package/dist/template-DPpMK30W.js +0 -190
  109. package/dist/tier-BJDhpH6X.js +0 -4
  110. package/dist/tiers/tier=1.png +0 -0
  111. package/dist/tiers/tier=2.png +0 -0
  112. package/dist/tiers/tier=3.png +0 -0
  113. package/dist/tiers/tier=4.png +0 -0
  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-DLp1bkZP.js +0 -144
  124. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  125. package/dist/type_drinks-D6jnpvwV.js +0 -4
  126. package/dist/usePagination-BeF5K3M7.js +0 -223
  127. package/dist/user-Cq9CGBHZ.js +0 -54
  128. package/dist/vue-i18n-COzqUgQy.js +0 -2365
  129. package/dist/xlsx-Be4bARvl.js +0 -15491
  130. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,226 +0,0 @@
1
- import { defineComponent as j, ref as P, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as b, Fragment as w, createVNode as r, unref as t, withCtx as y, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as C, resolveDynamicComponent as q } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q } from "./plugins-KiMuDTPp.js";
5
- import { u as W } from "./loading-MEQuW9Xa.js";
6
- import { u as X } from "./business-B65OtB5B.js";
7
- import { u as Y } from "./campaign-qGy6uzrC.js";
8
- import { g as Z, a as V, b as I } from "./campaign-iKI-L84v.js";
9
- import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
- import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-HMjbuy2C.js";
11
- import { u as oe } from "./template-DPpMK30W.js";
12
- import { u as ae } from "./vue-i18n-COzqUgQy.js";
13
- import { c as _ } from "./index-CH2d_B8c.js";
14
- const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { 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" }, pe = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, _e = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ j({
15
- __name: "Point",
16
- setup(be) {
17
- const { t: s } = ae(), B = {
18
- label: s("connect.program.common.actions.create", {
19
- type: s("connect.program.point.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, $ = oe("COIN", G()), h = X(), m = Y(), { global: K, minor: x } = W, i = P({
25
- searchKey: "",
26
- location: null
27
- }), u = A(
28
- () => m.campaigns.point.filter(
29
- (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
30
- )
31
- ), N = [
32
- {
33
- header: s("connect.program.common.table.title"),
34
- accessorFn: (e) => e.name
35
- },
36
- {
37
- header: s("connect.program.common.table.status"),
38
- accessorFn: (e) => Z(e),
39
- cell(e) {
40
- return V(e.row.original);
41
- }
42
- },
43
- {
44
- header: s("connect.program.common.table.summary"),
45
- accessorFn: (e) => I(e)
46
- },
47
- {
48
- header: s("connect.program.common.table.actions"),
49
- cell(e) {
50
- return E(J.FmButton, {
51
- variant: "tertiary",
52
- icon: "delete",
53
- iconColor: "neutral-gray-400",
54
- onClick: (o) => {
55
- o.stopPropagation(), F(e.row.original);
56
- }
57
- });
58
- }
59
- }
60
- ], v = P();
61
- async function F(e) {
62
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await x(
63
- async () => {
64
- await _.delete(e._id), await m.read("COIN");
65
- },
66
- {
67
- message: `Removing ${e.name}`,
68
- successMessage: `Removed ${e.name} successfully`
69
- }
70
- );
71
- }
72
- async function f(e) {
73
- e ? await o() : $.open(async (p) => {
74
- await o(p);
75
- });
76
- async function o(p) {
77
- var g;
78
- (g = v.value) == null || g.showSheet(
79
- !0,
80
- "COIN",
81
- e ? await _.readById(e._id) : void 0,
82
- p
83
- );
84
- }
85
- }
86
- async function R(e) {
87
- await x(
88
- async () => {
89
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("COIN");
90
- },
91
- {
92
- message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
93
- successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
94
- }
95
- );
96
- }
97
- return M(async () => {
98
- await K(async () => {
99
- await m.read("COIN");
100
- });
101
- }), (e, o) => {
102
- const p = l("FmPill"), g = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
103
- return d(), b(w, null, [
104
- r(g, {
105
- title: t(s)("connect.program.point.title"),
106
- actions: t(u).length > 0 && t(h).isPremium ? [B] : [],
107
- "onClick:action": o[0] || (o[0] = () => f())
108
- }, {
109
- title: y(() => [
110
- n("div", ne, [
111
- n("span", se, c(t(s)("connect.program.point.title")), 1),
112
- r(p, { variant: "premium" })
113
- ])
114
- ]),
115
- _: 1
116
- }, 8, ["title", "actions"]),
117
- n("div", ie, [
118
- r(k, {
119
- modelValue: t(i).searchKey,
120
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
121
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
122
- placeholder: "search",
123
- collapsible: ""
124
- }, null, 8, ["modelValue"]),
125
- t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), b(w, { key: 0 }, [
126
- n("div", re, [
127
- n("div", le, [
128
- r(ee, {
129
- modelValue: t(i).location,
130
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
131
- label: "Location: ",
132
- "show-item-label": !0,
133
- icon: "storefront",
134
- placement: "bottom-start",
135
- items: t(h).locationItems
136
- }, null, 8, ["modelValue", "items"])
137
- ]),
138
- r(k, {
139
- modelValue: t(i).searchKey,
140
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
141
- class: "xs:hidden",
142
- placeholder: "search",
143
- collapsible: ""
144
- }, null, 8, ["modelValue"])
145
- ]),
146
- r(O, {
147
- class: "xs:hidden",
148
- "row-data": t(u),
149
- "column-defs": N,
150
- "search-value": t(i).searchKey,
151
- "column-filter": [],
152
- onRowClick: o[4] || (o[4] = (a) => f(a.original)),
153
- "hide-footer": t(u).length < 10
154
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
155
- r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
156
- default: y(() => [
157
- (d(!0), b(w, null, H(t(u).filter(
158
- (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
159
- ), (a) => (d(), C(U, {
160
- key: a._id.toString(),
161
- onClick: (L) => f(a),
162
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
163
- }, {
164
- default: y(() => [
165
- n("div", ce, [
166
- n("div", me, [
167
- (d(), C(q(t(V)(a)))),
168
- n("div", de, c(t(s)("connect.program.point.used", {
169
- count: a.currentReceive ?? 0
170
- })), 1)
171
- ]),
172
- n("div", pe, [
173
- n("div", ue, c(a.name), 1),
174
- n("div", fe, c(t(I)(a)), 1)
175
- ]),
176
- n("div", ge, " Point received: " + c(a.currentReceive ?? 0), 1)
177
- ]),
178
- r(S, {
179
- icon: "delete",
180
- "icon-color": "neutral-gray-400",
181
- variant: "tertiary",
182
- onClick: (L) => (L.stopPropagation(), F(a))
183
- }, null, 8, ["onClick"])
184
- ]),
185
- _: 2
186
- }, 1032, ["onClick"]))), 128))
187
- ]),
188
- _: 1
189
- })
190
- ], 64)) : (d(), C(T, {
191
- key: 1,
192
- variant: "outlined",
193
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
194
- }, {
195
- default: y(() => [
196
- o[6] || (o[6] = n("img", {
197
- src: z,
198
- class: "aspect-square w-[150px]"
199
- }, null, -1)),
200
- n("div", ye, [
201
- n("div", _e, c(t(s)("connect.program.point.empty_state.title")), 1),
202
- n("div", he, c(t(s)("connect.program.point.empty_state.description")), 1)
203
- ]),
204
- r(S, {
205
- variant: "primary",
206
- label: "Create point program",
207
- disabled: !t(h).isPremium,
208
- icon: "add",
209
- onClick: o[5] || (o[5] = (a) => f())
210
- }, null, 8, ["disabled"])
211
- ]),
212
- _: 1
213
- })),
214
- r(te, {
215
- ref_key: "sheetRef",
216
- ref: v,
217
- "onSubmit:modelValue": R
218
- }, null, 512)
219
- ])
220
- ], 64);
221
- };
222
- }
223
- });
224
- export {
225
- Ke as default
226
- };
@@ -1,289 +0,0 @@
1
- import { defineComponent as J, ref as S, computed as Q, h as W, onMounted as X, resolveComponent as m, openBlock as u, createElementBlock as w, Fragment as v, createVNode as l, unref as a, createElementVNode as r, withCtx as b, renderList as Y, createBlock as x, resolveDynamicComponent as Z, toDisplayString as _ } from "vue";
2
- import { _ as ee } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as oe, components as te } from "@feedmepos/ui-library";
4
- import { c as O, p as L } from "./plugins-KiMuDTPp.js";
5
- import { u as ne } from "./loading-MEQuW9Xa.js";
6
- import { u as ae } from "./business-B65OtB5B.js";
7
- import { u as se } from "./campaign-qGy6uzrC.js";
8
- import { u as re } from "./vue-i18n-COzqUgQy.js";
9
- import { g as ie, a as V } from "./campaign-iKI-L84v.js";
10
- import { e as I } from "./effect-Bg3yb9T6.js";
11
- import { _ as le } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-HMjbuy2C.js";
12
- import { u as ce } from "./template-DPpMK30W.js";
13
- import { _ as B } from "./FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js";
14
- import { c as d } from "./index-CH2d_B8c.js";
15
- const me = { class: "px-24 flex flex-col gap-y-16" }, pe = { class: "flex items-center justify-between w-full" }, ue = { class: "flex gap-8 overflow-x-auto" }, de = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ye = { class: "space-y-4" }, ge = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "flex flex-col gap-16 text-center" }, we = { class: "fm-typo-en-title-sm-800" }, ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ J({
16
- __name: "Promotion",
17
- setup(be) {
18
- const { t: n } = re(), M = {
19
- label: n("connect.promotion.createCampaign"),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, R = {
24
- label: "Force sync",
25
- value: "sync",
26
- isPrimary: !1,
27
- prependIcon: "refresh"
28
- }, A = ce("PROMOTION", oe()), C = ae(), f = se(), { global: K, minor: h } = ne, N = [
29
- {
30
- label: "Bill promotion",
31
- value: "BILL"
32
- },
33
- {
34
- label: "Item promotion",
35
- value: "ITEM"
36
- }
37
- ], s = S({
38
- searchKey: "",
39
- location: [],
40
- effectType: []
41
- });
42
- function $(e) {
43
- const o = s.value.location;
44
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((c) => {
45
- var i;
46
- return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(c);
47
- }) : e.targetLocation.includes(o);
48
- }
49
- function U(e) {
50
- var i, g;
51
- const o = s.value.effectType;
52
- if (!o || o.length === 0) return !0;
53
- const c = (g = (i = e.effect) == null ? void 0 : i.options) == null ? void 0 : g.target;
54
- return o.includes(c);
55
- }
56
- const p = Q(
57
- () => f.campaigns.promotion.filter(
58
- (e) => $(e) && U(e)
59
- )
60
- ), D = [
61
- {
62
- header: n("connect.promotion.promotionTitle"),
63
- accessorFn: (e) => e.name
64
- },
65
- {
66
- header: n("connect.promotion.status"),
67
- accessorFn: (e) => ie(e),
68
- cell(e) {
69
- return V(e.row.original);
70
- }
71
- },
72
- {
73
- header: n("connect.promotion.type"),
74
- accessorFn: (e) => `${O.title(e.effect.options.target)} promotion`
75
- },
76
- {
77
- header: n("connect.promotion.summary"),
78
- accessorFn: (e) => I(e.effect)
79
- },
80
- {
81
- header: n("connect.promotion.actions"),
82
- cell(e) {
83
- return W(te.FmButton, {
84
- variant: "tertiary",
85
- icon: "delete",
86
- iconColor: "neutral-gray-400",
87
- onClick: (o) => {
88
- o.stopPropagation(), k(e.row.original);
89
- }
90
- });
91
- }
92
- }
93
- ], F = S();
94
- async function k(e) {
95
- await L.remove(
96
- n("connect.promotion.confirmRemove", { name: e.name })
97
- ) && await h(
98
- async () => {
99
- await d.delete(e._id), await f.read("PROMOTION");
100
- },
101
- {
102
- message: n("connect.promotion.removing", { name: e.name }),
103
- successMessage: n("connect.promotion.removedSuccessfully", {
104
- name: e.name
105
- })
106
- }
107
- );
108
- }
109
- async function y(e) {
110
- e ? await o() : A.open(async (c) => {
111
- await o(c);
112
- });
113
- async function o(c) {
114
- var i;
115
- (i = F.value) == null || i.showSheet(
116
- !0,
117
- "PROMOTION",
118
- e ? await d.readById(e._id) : void 0,
119
- c
120
- );
121
- }
122
- }
123
- async function E(e) {
124
- await h(
125
- async () => {
126
- e.campaign._id ? await d.update(e.campaign._id, e) : await d.create(e), await f.read("PROMOTION");
127
- },
128
- {
129
- message: n(
130
- e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
131
- ),
132
- successMessage: n(
133
- e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
134
- )
135
- }
136
- );
137
- }
138
- async function j(e) {
139
- switch (e) {
140
- case "create":
141
- y();
142
- break;
143
- case "sync":
144
- await L.confirm(
145
- "Are you sure you want to synchronize all promotions to POS?",
146
- "Force sync"
147
- ) && h(
148
- async () => {
149
- await d.syncAllPromotion();
150
- },
151
- {
152
- message: "Syncing promotions...",
153
- successMessage: "All promotions synced"
154
- }
155
- );
156
- break;
157
- }
158
- }
159
- return X(async () => {
160
- await K(async () => {
161
- await C.readLocations(), await f.read("PROMOTION");
162
- });
163
- }), (e, o) => {
164
- const c = m("FmPageHead"), i = m("FmSearch"), g = m("FmTable"), H = m("FmChip"), T = m("FmButton"), q = m("FmListItem"), z = m("FmList"), G = m("FmCard");
165
- return u(), w(v, null, [
166
- l(c, {
167
- title: a(n)("connect.promotion.title"),
168
- actions: a(p).length > 0 ? [M, R] : [],
169
- "onClick:action": j
170
- }, null, 8, ["title", "actions"]),
171
- r("div", me, [
172
- l(i, {
173
- modelValue: s.value.searchKey,
174
- "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
175
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
176
- placeholder: a(n)("connect.promotion.search"),
177
- collapsible: ""
178
- }, null, 8, ["modelValue", "placeholder"]),
179
- a(p) && a(p).length > 0 ? (u(), w(v, { key: 0 }, [
180
- r("div", pe, [
181
- r("div", ue, [
182
- l(B, {
183
- label: `${a(n)("connect.common.location")}: `,
184
- "right-icon": "keyboard_arrow_down",
185
- modelValue: s.value.location,
186
- "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
187
- icon: "storefront",
188
- "show-item-label": !0,
189
- items: a(C).locationOptions
190
- }, null, 8, ["label", "modelValue", "items"]),
191
- l(B, {
192
- label: "Type:",
193
- "right-icon": "keyboard_arrow_down",
194
- modelValue: s.value.effectType,
195
- "onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
196
- icon: "filter_list",
197
- "show-item-label": !0,
198
- items: N
199
- }, null, 8, ["modelValue"])
200
- ]),
201
- l(i, {
202
- modelValue: s.value.searchKey,
203
- "onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
204
- class: "xs:hidden",
205
- placeholder: "search",
206
- collapsible: ""
207
- }, null, 8, ["modelValue"])
208
- ]),
209
- l(g, {
210
- class: "xs:hidden",
211
- "row-data": a(p),
212
- "column-defs": D,
213
- "search-value": s.value.searchKey,
214
- "column-filter": [],
215
- onRowClick: o[4] || (o[4] = (t) => y(t.original)),
216
- "hide-footer": a(p).length < 10
217
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
218
- l(z, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
219
- default: b(() => [
220
- (u(!0), w(v, null, Y(a(p).filter(
221
- (t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
222
- ), (t) => (u(), x(q, {
223
- key: t._id.toString(),
224
- onClick: (P) => y(t),
225
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
226
- }, {
227
- default: b(() => [
228
- r("div", de, [
229
- r("div", fe, [
230
- (u(), x(Z(a(V)(t)))),
231
- l(H, {
232
- class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
233
- compact: !0,
234
- label: `${a(O).title(t.effect.options.target)} promotion`
235
- }, null, 8, ["label"])
236
- ]),
237
- r("div", ye, [
238
- r("div", ge, _(t.name), 1),
239
- r("div", _e, _(a(I)(t.effect)), 1)
240
- ])
241
- ]),
242
- l(T, {
243
- icon: "delete",
244
- "icon-color": "neutral-gray-400",
245
- variant: "tertiary",
246
- onClick: (P) => (P.stopPropagation(), k(t))
247
- }, null, 8, ["onClick"])
248
- ]),
249
- _: 2
250
- }, 1032, ["onClick"]))), 128))
251
- ]),
252
- _: 1
253
- })
254
- ], 64)) : (u(), x(G, {
255
- key: 1,
256
- variant: "outlined",
257
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
258
- }, {
259
- default: b(() => [
260
- o[6] || (o[6] = r("img", {
261
- src: ee,
262
- class: "aspect-square w-[150px]"
263
- }, null, -1)),
264
- r("div", he, [
265
- r("div", we, _(a(n)("connect.promotion.createPromotionCampaign")), 1),
266
- r("div", ve, _(a(n)("connect.promotion.description")), 1)
267
- ]),
268
- l(T, {
269
- variant: "primary",
270
- label: a(n)("connect.promotion.createPromotionCampaign"),
271
- icon: "add",
272
- onClick: o[5] || (o[5] = (t) => y())
273
- }, null, 8, ["label"])
274
- ]),
275
- _: 1
276
- }))
277
- ]),
278
- l(le, {
279
- ref_key: "sheetRef",
280
- ref: F,
281
- "onSubmit:modelValue": E
282
- }, null, 512)
283
- ], 64);
284
- };
285
- }
286
- });
287
- export {
288
- Ae as default
289
- };