@feedmepos/mf-connect 0.1.81-prod → 0.1.83-prod

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 (104) hide show
  1. package/dist/{Analytic-D4C4cuzb.js → Analytic-1OYb8L9c.js} +11 -11
  2. package/dist/{App-BKC-UTfE.js → App-oQ4_lEV2.js} +7 -7
  3. package/dist/{Bin-B23fmL4B.js → Bin-CQ8CYWAf.js} +8 -8
  4. package/dist/Broadcast-BLq5lca6.js +265 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BEr6i1H7.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-0BKgyMxn.js} +6 -6
  6. package/dist/{Card-CjmquMQ8.js → Card-BbcMCzvO.js} +19 -19
  7. package/dist/{Collections-e324VpKx.js → Collections-0LOyEUoF.js} +8 -8
  8. package/dist/Credit-Crrc3MSu.js +259 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-NtZKuPgi.js} +245 -241
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CLcPRqzn.js → EffectSheet.vue_vue_type_style_index_0_lang-DQaMkTla.js} +6 -6
  11. package/dist/Experience-DJiUmONI.js +258 -0
  12. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-CFEGc8v5.js} +1 -1
  13. package/dist/Game-ChHy4S4P.js +329 -0
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BpNCfgI8.js → ImageInput.vue_vue_type_script_setup_true_lang-BBavh70d.js} +1 -1
  15. package/dist/{Index-Dq_dt4zZ.js → Index-CL5auUCN.js} +10 -10
  16. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-H5IjhmOA.js} +1 -1
  17. package/dist/{MainLayout-B1aJoR95.js → MainLayout-Bf4G5U5F.js} +1 -1
  18. package/dist/{Marketing-Z2EXHTDq.js → Marketing-cNwSm-dt.js} +6 -6
  19. package/dist/{Member-BZq2ZPU1.js → Member-fT7a7zFo.js} +11 -11
  20. package/dist/{MemberList-DamLQWem.js → MemberList-gEN36Erj.js} +27 -27
  21. package/dist/{MemberTransactions-BfGIKXWt.js → MemberTransactions-C4YgiUw-.js} +1 -1
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BMLAp7P0.js → MessageInput.vue_vue_type_script_setup_true_lang-BNDrmYqp.js} +9 -9
  23. package/dist/Mission-Bz9P2pjX.js +333 -0
  24. package/dist/{Overview-DKNSKwjw.js → Overview-BG3Z7Daz.js} +19 -19
  25. package/dist/Point-BBeSJ5p5.js +261 -0
  26. package/dist/Promotion-VmaOESn2.js +390 -0
  27. package/dist/{Queue-CnHJt7BI.js → Queue-DKtUhOBh.js} +11 -11
  28. package/dist/{Record-asuDl00z.js → Record-Cb45m9I8.js} +9 -9
  29. package/dist/{Reward-BqemiBwU.js → Reward-D_uvCEMe.js} +16 -16
  30. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B98IW85o.js → RewardGroup.vue_vue_type_script_setup_true_lang-yUUMGEUJ.js} +12 -12
  31. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CVnNlpHa.js → RuleGroup.vue_vue_type_script_setup_true_lang-CIb7igvo.js} +15 -15
  32. package/dist/{Segment-Q86KMN-k.js → Segment-BJ8XUyeG.js} +25 -25
  33. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CCjoSgCt.js → SelectItems.vue_vue_type_script_setup_true_lang-ht4qyiQM.js} +2 -2
  34. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CttKxzGJ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DC6OQ7Zb.js} +12 -12
  35. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D_pLIyjo.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-i_BRgBRC.js} +4 -4
  36. package/dist/{Setting-D-H3wwqK.js → Setting-CS1wSxO9.js} +14 -14
  37. package/dist/{SettingAdvertisements-CLys7tUI.js → SettingAdvertisements-CWP7VthZ.js} +12 -12
  38. package/dist/{Store-CDTaq9Cl.js → Store-cy0uZfSE.js} +22 -22
  39. package/dist/{StoreRewards-BDbL39N5.js → StoreRewards-DDAvmlEn.js} +15 -15
  40. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BnagjBBu.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CevWXAb6.js} +20 -20
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Dk7yazat.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CPJ4fCu-.js} +1 -1
  42. package/dist/{Tier-BpDxFiVl.js → Tier-CUT_0eYp.js} +22 -22
  43. package/dist/{Title-BC8toEO3.js → Title-DcelZU7H.js} +20 -20
  44. package/dist/{Transaction-Ci7D5pSG.js → Transaction-CwcJnFIO.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DfKxwLyD.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BuDS-vUd.js} +6 -6
  46. package/dist/{Voucher-vnKyiKiV.js → Voucher-z6o5rwFx.js} +162 -141
  47. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CCg8d72J.js → VoucherEditor.vue_vue_type_script_setup_true_lang-FVdeM5pH.js} +12 -12
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-JTpA5O1m.js → ZodTextField.vue_vue_type_script_setup_true_lang-BGuVeHZU.js} +2 -2
  49. package/dist/{app-1E5G1GpN.js → app-BUFlIAB5.js} +13926 -11655
  50. package/dist/app.js +1 -1
  51. package/dist/{business-BUpIHd4Z.js → business-CEL6Cxr7.js} +1 -1
  52. package/dist/{campaign-CZx-8rcc.js → campaign-Bz3O-DFr.js} +1 -1
  53. package/dist/{campaign-D_l_eCaG.js → campaign-CfB7ZWIg.js} +8 -8
  54. package/dist/{campaign.enum-DzMJ_QtT.js → campaign.enum-CCKHGvL9.js} +1 -1
  55. package/dist/{campaign.fn-BfLZqPyL.js → campaign.fn-Cu0sRSpP.js} +154 -154
  56. package/dist/{collectible.enum-CQB3E2Fm.js → collectible.enum-DeWSJ9OK.js} +1 -1
  57. package/dist/{collection.fn-DkJHn6mL.js → collection.fn-hPDt2qvz.js} +2 -2
  58. package/dist/{dto-DUY1vguv.js → dto-BKwcpb4T.js} +4 -4
  59. package/dist/{effect-CpXEk9Dk.js → effect-D070CPN_.js} +1 -1
  60. package/dist/{email-addresses-CVWW3Trx.js → email-addresses-C0fE6EMy.js} +2 -2
  61. package/dist/{export-1cM7yPV3.js → export-CG1ypExs.js} +3 -3
  62. package/dist/{helper-DZwCmt7C.js → helper-C9NBolO7.js} +1 -1
  63. package/dist/{index-BkpYy6m3.js → index-4gCsL8Hl.js} +6 -6
  64. package/dist/{index-Iwu0Pf7N.js → index-6rFsv3Yg.js} +1 -1
  65. package/dist/{index-DcCaSh1B.js → index-B30LtrWw.js} +1 -1
  66. package/dist/{index-DxGLhSm4.js → index-B613auFn.js} +1 -1
  67. package/dist/{index-CL_mVbcg.js → index-BGi7UFjn.js} +1 -1
  68. package/dist/{index-Cu69tDgg.js → index-BXSp11TE.js} +4 -4
  69. package/dist/{index-BWqzh2C4.js → index-CM-qkxMr.js} +11329 -10472
  70. package/dist/{index-UX1BjWKt.js → index-CZoTFXja.js} +3 -3
  71. package/dist/{index-CJQk_hJX.js → index-D7AT7i0e.js} +3 -3
  72. package/dist/{index-yPNsQag2.js → index-DDMr6_UT.js} +4 -4
  73. package/dist/{index-BhGXbniw.js → index-DGNPGZh4.js} +1 -1
  74. package/dist/{index-DikxFmIA.js → index-DLnZyneY.js} +1 -1
  75. package/dist/{index-CnqIH2O9.js → index-DcfdUpTw.js} +1 -1
  76. package/dist/{index.esm2017-DGkosyWY.js → index.esm2017-D0u5JnGx.js} +1 -1
  77. package/dist/{loading-BeO6W824.js → loading-Rn4BXFlo.js} +1 -1
  78. package/dist/{lodash-B5I3zXaY.js → lodash-Ds-QoR_N.js} +1 -1
  79. package/dist/{membership-CdkNnSzC.js → membership-BjklIT2n.js} +3 -3
  80. package/dist/{money-BmJpJ3UM.js → money-DMyZXL-e.js} +1 -1
  81. package/dist/{number-DNxJZHn4.js → number-Cyny8l0t.js} +1 -1
  82. package/dist/{objectid-Dz4U2FAo.js → objectid-Bs1Sha1n.js} +11 -11
  83. package/dist/{plugins-BWUWdHwy.js → plugins-BdQ8LmZm.js} +3 -3
  84. package/dist/{reward-Cg4x-YOj.js → reward-ZGs3fpY1.js} +1 -1
  85. package/dist/{rule-SBzFsmzN.js → rule-BH0ICJcx.js} +3 -3
  86. package/dist/{rule-builder-C12N5APu.js → rule-builder-D2sz7Xd9.js} +1 -1
  87. package/dist/template-_QJbP7yG.js +236 -0
  88. package/dist/{timezone-BdnFtiYJ.js → timezone-ulqdIvC-.js} +2 -2
  89. package/dist/{trigger-ZZWC4YWG.js → trigger-BiXZCT3j.js} +5 -5
  90. package/dist/{usePagination-Ds-cuHop.js → usePagination-Ck7buuI_.js} +1 -1
  91. package/dist/{user-DZARAXiI.js → user-BWTfkoD6.js} +1 -1
  92. package/dist/{vue-i18n-DOqqi883.js → vue-i18n-CmMTYitu.js} +2 -2
  93. package/dist/{xlsx-BQxGGmFn.js → xlsx-BF8PJO-P.js} +1 -1
  94. package/dist/{zod-D_MtMi4T.js → zod-C5iXeYjP.js} +1 -1
  95. package/package.json +2 -1
  96. package/dist/Broadcast-C9kxxthU.js +0 -232
  97. package/dist/Credit-7GDoQ6Ch.js +0 -225
  98. package/dist/Experience-_gbPd2cN.js +0 -224
  99. package/dist/Game-BotH7q2X.js +0 -299
  100. package/dist/Mission-DZBOFfZE.js +0 -303
  101. package/dist/Point-BTCdwbGb.js +0 -227
  102. package/dist/Promotion-BqWbXRrK.js +0 -358
  103. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  104. package/dist/template-B1S6b9tH.js +0 -188
@@ -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-BWUWdHwy.js";
5
- import { u as Y } from "./loading-BeO6W824.js";
6
- import { u as Z } from "./business-BUpIHd4Z.js";
7
- import { u as ee, c as _ } from "./campaign-CZx-8rcc.js";
8
- import { a as B, b as A, g as te } from "./campaign-D_l_eCaG.js";
9
- import { u as oe } from "./vue-i18n-DOqqi883.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-Bsz4DfR2.js";
12
- import { u as se } from "./template-B1S6b9tH.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: x } = 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
- ], C = h();
68
- async function S(e) {
69
- await X.remove(
70
- s("connect.campaign.common.remove.confirm", { name: e.name })
71
- ) && await x(
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 = C.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 x(
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 sm:!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 sm:hidden",
149
- placeholder: "search",
150
- collapsible: ""
151
- }, null, 8, ["modelValue"])
152
- ]),
153
- r($, {
154
- class: "xs:hidden sm: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 sm:!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: C,
223
- "onSubmit:modelValue": I
224
- }, null, 512)
225
- ])
226
- ], 64);
227
- };
228
- }
229
- });
230
- export {
231
- Te as default
232
- };
@@ -1,225 +0,0 @@
1
- import { defineComponent as N, ref as F, computed as j, h as M, onMounted as H, resolveComponent as m, openBlock as d, createElementBlock as g, Fragment as _, createVNode as i, unref as t, createElementVNode as n, withCtx as h, renderList as q, createBlock as C, resolveDynamicComponent as O, toDisplayString as L, createCommentVNode as z } from "vue";
2
- import { _ as G } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
- import { p as W } from "./plugins-BWUWdHwy.js";
5
- import { u as X } from "./loading-BeO6W824.js";
6
- import { u as Y } from "./business-BUpIHd4Z.js";
7
- import { u as Z, c as y } from "./campaign-CZx-8rcc.js";
8
- import { g as ee, a as S, b as V } from "./campaign-D_l_eCaG.js";
9
- import { u as oe } from "./vue-i18n-DOqqi883.js";
10
- import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js";
12
- import { u as ne } from "./template-B1S6b9tH.js";
13
- const re = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { key: 0 }, Se = /* @__PURE__ */ N({
14
- __name: "Credit",
15
- setup(fe) {
16
- const { t: r } = oe(), B = {
17
- label: r("connect.program.common.actions.create", {
18
- type: r("connect.program.credit.title").toLowerCase()
19
- }),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, I = ne("CREDIT", J()), D = Y(), u = Z(), { global: T, minor: w } = X, s = F({
24
- searchKey: "",
25
- location: []
26
- });
27
- function E(e) {
28
- const o = s.value.location;
29
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((c) => {
30
- var l;
31
- return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(c);
32
- }) : e.targetLocation.includes(o);
33
- }
34
- const p = j(
35
- () => u.campaigns.credit.filter((e) => E(e))
36
- ), R = [
37
- {
38
- header: r("connect.program.common.table.title"),
39
- accessorFn: (e) => e.name
40
- },
41
- {
42
- header: r("connect.program.common.table.status"),
43
- accessorFn: (e) => ee(e),
44
- cell(e) {
45
- return S(e.row.original);
46
- }
47
- },
48
- {
49
- header: r("connect.program.common.table.summary"),
50
- accessorFn: (e) => V(e)
51
- },
52
- {
53
- header: r("connect.program.common.table.actions"),
54
- cell(e) {
55
- return M(Q.FmButton, {
56
- variant: "tertiary",
57
- icon: "delete",
58
- iconColor: "neutral-gray-400",
59
- onClick: (o) => {
60
- o.stopPropagation(), v(e.row.original);
61
- }
62
- });
63
- }
64
- }
65
- ], b = F();
66
- async function v(e) {
67
- await W.remove(
68
- r("connect.program.common.remove.confirm", { name: e.name })
69
- ) && await w(
70
- async () => {
71
- await y.delete(e._id), await u.read("CREDIT");
72
- },
73
- {
74
- message: r("connect.program.common.remove.removing", { name: e.name }),
75
- successMessage: r("connect.program.common.remove.removed", {
76
- name: e.name
77
- })
78
- }
79
- );
80
- }
81
- async function f(e) {
82
- e ? await o() : I.open(async (c) => {
83
- await o(c);
84
- });
85
- async function o(c) {
86
- var l;
87
- (l = b.value) == null || l.showSheet(
88
- !0,
89
- "CREDIT",
90
- e ? await y.readById(e._id) : void 0,
91
- c
92
- );
93
- }
94
- }
95
- async function K(e) {
96
- await w(
97
- async () => {
98
- e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await u.read("CREDIT");
99
- },
100
- {
101
- message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
102
- successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
103
- }
104
- );
105
- }
106
- return H(async () => {
107
- await T(async () => {
108
- await u.read("CREDIT");
109
- });
110
- }), (e, o) => {
111
- const c = m("FmPageHead"), l = m("FmSearch"), $ = m("FmTable"), x = m("FmButton"), P = m("FmListItem"), U = m("FmList"), A = m("FmCard");
112
- return d(), g(_, null, [
113
- i(c, {
114
- title: t(r)("connect.program.credit.title"),
115
- actions: t(p).length > 0 ? [B] : [],
116
- "onClick:action": o[0] || (o[0] = () => f())
117
- }, null, 8, ["title", "actions"]),
118
- n("div", re, [
119
- i(l, {
120
- modelValue: t(s).searchKey,
121
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
122
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
123
- placeholder: "search",
124
- collapsible: ""
125
- }, null, 8, ["modelValue"]),
126
- t(u).campaigns.credit && t(u).campaigns.credit.length > 0 ? (d(), g(_, { key: 0 }, [
127
- n("div", se, [
128
- n("div", ie, [
129
- i(te, {
130
- label: `${t(r)("connect.common.location")}: `,
131
- "right-icon": "keyboard_arrow_down",
132
- modelValue: t(s).location,
133
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
134
- icon: "storefront",
135
- "show-item-label": !0,
136
- items: t(D).locationOptions
137
- }, null, 8, ["label", "modelValue", "items"])
138
- ]),
139
- i(l, {
140
- modelValue: t(s).searchKey,
141
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
142
- class: "xs:hidden sm:hidden",
143
- placeholder: "search",
144
- collapsible: ""
145
- }, null, 8, ["modelValue"])
146
- ]),
147
- i($, {
148
- class: "xs:hidden sm:hidden",
149
- "row-data": t(p),
150
- "column-defs": R,
151
- "search-value": t(s).searchKey,
152
- "column-filter": [],
153
- onRowClick: o[4] || (o[4] = (a) => f(a.original)),
154
- "hide-footer": t(p).length < 10
155
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
156
- i(U, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
157
- default: h(() => [
158
- (d(!0), g(_, null, q(t(p).filter(
159
- (a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
160
- ), (a) => (d(), C(P, {
161
- key: a._id.toString(),
162
- onClick: (k) => f(a),
163
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
164
- }, {
165
- default: h(() => [
166
- n("div", le, [
167
- n("div", ce, [
168
- (d(), C(O(t(S)(a))))
169
- ]),
170
- n("div", me, [
171
- n("div", de, L(a.name), 1),
172
- n("div", ue, L(t(V)(a)), 1)
173
- ])
174
- ]),
175
- i(x, {
176
- icon: "delete",
177
- "icon-color": "neutral-gray-400",
178
- variant: "tertiary",
179
- onClick: (k) => (k.stopPropagation(), v(a))
180
- }, null, 8, ["onClick"])
181
- ]),
182
- _: 2
183
- }, 1032, ["onClick"]))), 128))
184
- ]),
185
- _: 1
186
- }),
187
- t(p).length == 0 ? (d(), g("div", pe, [...o[6] || (o[6] = [
188
- n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
189
- ])])) : z("", !0)
190
- ], 64)) : (d(), C(A, {
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: h(() => [
196
- o[7] || (o[7] = n("img", {
197
- src: G,
198
- class: "aspect-square w-[150px]"
199
- }, null, -1)),
200
- o[8] || (o[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
201
- n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
202
- n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
203
- ], -1)),
204
- i(x, {
205
- variant: "primary",
206
- label: "Create credit program",
207
- icon: "add",
208
- onClick: o[5] || (o[5] = (a) => f())
209
- })
210
- ]),
211
- _: 1
212
- })),
213
- i(ae, {
214
- ref_key: "sheetRef",
215
- ref: b,
216
- "onSubmit:modelValue": K
217
- }, null, 512)
218
- ])
219
- ], 64);
220
- };
221
- }
222
- });
223
- export {
224
- Se as default
225
- };
@@ -1,224 +0,0 @@
1
- import { defineComponent as E, ref as S, computed as U, onMounted as j, resolveComponent as m, openBlock as p, createElementBlock as _, Fragment as h, createVNode as i, unref as o, createElementVNode as n, withCtx as x, renderList as M, createBlock as w, resolveDynamicComponent as H, toDisplayString as g, h 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-BWUWdHwy.js";
5
- import { u as W } from "./loading-BeO6W824.js";
6
- import { u as X } from "./business-BUpIHd4Z.js";
7
- import { u as Y, c as y } from "./campaign-CZx-8rcc.js";
8
- import { a as L, b as V, g as Z } from "./campaign-D_l_eCaG.js";
9
- import { u as ee } from "./vue-i18n-DOqqi883.js";
10
- import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js";
12
- import { u as ae } from "./template-B1S6b9tH.js";
13
- const ne = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, le = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "flex flex-col gap-16 text-center" }, ue = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = /* @__PURE__ */ E({
14
- __name: "Experience",
15
- setup(ge) {
16
- const { t: r } = ee(), P = {
17
- label: r("connect.program.common.actions.create", {
18
- type: r("connect.program.experience.title").toLowerCase()
19
- }),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, B = ae("POINT", G()), I = X(), d = Y(), { global: T, minor: b } = W, s = S({
24
- searchKey: "",
25
- location: []
26
- });
27
- function $(e) {
28
- const t = s.value.location;
29
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
30
- var c;
31
- return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
32
- }) : e.targetLocation.includes(t);
33
- }
34
- const u = U(
35
- () => d.campaigns.experience.filter((e) => $(e))
36
- ), K = [
37
- {
38
- header: "Program title",
39
- accessorFn: (e) => e.name
40
- },
41
- {
42
- header: "Status",
43
- accessorFn: (e) => Z(e),
44
- cell(e) {
45
- return L(e.row.original);
46
- }
47
- },
48
- {
49
- header: "Summary",
50
- accessorFn: (e) => V(e)
51
- //v.effect,
52
- },
53
- {
54
- header: "Actions",
55
- cell(e) {
56
- return q(J.FmButton, {
57
- variant: "tertiary",
58
- icon: "delete",
59
- iconColor: "neutral-gray-400",
60
- onClick: (t) => {
61
- t.stopPropagation(), v(e.row.original);
62
- }
63
- });
64
- }
65
- }
66
- ], C = S();
67
- async function v(e) {
68
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await b(
69
- async () => {
70
- await y.delete(e._id), await d.read("POINT");
71
- },
72
- {
73
- message: `Removing ${e.name}`,
74
- successMessage: `Removed ${e.name} successfully`
75
- }
76
- );
77
- }
78
- async function f(e) {
79
- e ? await t() : B.open(async (l) => {
80
- await t(l);
81
- });
82
- async function t(l) {
83
- var c;
84
- (c = C.value) == null || c.showSheet(
85
- !0,
86
- "POINT",
87
- e ? await y.readById(e._id) : void 0,
88
- l
89
- );
90
- }
91
- }
92
- async function N(e) {
93
- await b(
94
- async () => {
95
- e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await d.read("POINT");
96
- },
97
- {
98
- message: r("connect.program.common.update.updating", {
99
- type: r("connect.program.experience.title")
100
- }),
101
- successMessage: r("connect.program.common.update.success", {
102
- type: r("connect.program.experience.title"),
103
- action: e.campaign._id ? "updated" : "created"
104
- })
105
- }
106
- );
107
- }
108
- return j(async () => {
109
- await T(async () => {
110
- await d.read("POINT");
111
- });
112
- }), (e, t) => {
113
- const l = m("FmPageHead"), c = m("FmSearch"), A = m("FmTable"), F = m("FmButton"), O = m("FmListItem"), R = m("FmList"), D = m("FmCard");
114
- return p(), _(h, null, [
115
- i(l, {
116
- title: o(r)("connect.program.experience.title"),
117
- actions: o(u).length > 0 ? [P] : [],
118
- "onClick:action": t[0] || (t[0] = () => f())
119
- }, null, 8, ["title", "actions"]),
120
- n("div", ne, [
121
- i(c, {
122
- modelValue: o(s).searchKey,
123
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(s).searchKey = a),
124
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
125
- placeholder: o(r)("connect.program.common.search"),
126
- collapsible: ""
127
- }, null, 8, ["modelValue", "placeholder"]),
128
- o(d).campaigns.experience && o(d).campaigns.experience.length > 0 ? (p(), _(h, { key: 0 }, [
129
- n("div", re, [
130
- n("div", se, [
131
- i(te, {
132
- label: `${o(r)("connect.common.location")}: `,
133
- "right-icon": "keyboard_arrow_down",
134
- modelValue: o(s).location,
135
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(s).location = a),
136
- icon: "storefront",
137
- "show-item-label": !0,
138
- items: o(I).locationOptions
139
- }, null, 8, ["label", "modelValue", "items"])
140
- ]),
141
- i(c, {
142
- modelValue: o(s).searchKey,
143
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(s).searchKey = a),
144
- class: "xs:hidden sm:hidden",
145
- placeholder: "search",
146
- collapsible: ""
147
- }, null, 8, ["modelValue"])
148
- ]),
149
- i(A, {
150
- class: "xs:hidden sm:hidden",
151
- "row-data": o(u),
152
- "column-defs": K,
153
- "search-value": o(s).searchKey,
154
- "column-filter": [],
155
- onRowClick: t[4] || (t[4] = (a) => f(a.original)),
156
- "hide-footer": o(u).length < 10
157
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
158
- i(R, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
159
- default: x(() => [
160
- (p(!0), _(h, null, M(o(u).filter(
161
- (a) => a.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
162
- ), (a) => (p(), w(O, {
163
- key: a._id.toString(),
164
- onClick: (k) => f(a),
165
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
166
- }, {
167
- default: x(() => [
168
- n("div", ie, [
169
- n("div", ce, [
170
- (p(), w(H(o(L)(a))))
171
- ]),
172
- n("div", le, [
173
- n("div", me, g(a.name), 1),
174
- n("div", de, g(o(V)(a)), 1)
175
- ])
176
- ]),
177
- i(F, {
178
- icon: "delete",
179
- "icon-color": "neutral-gray-400",
180
- variant: "tertiary",
181
- onClick: (k) => (k.stopPropagation(), v(a))
182
- }, null, 8, ["onClick"])
183
- ]),
184
- _: 2
185
- }, 1032, ["onClick"]))), 128))
186
- ]),
187
- _: 1
188
- })
189
- ], 64)) : (p(), w(D, {
190
- key: 1,
191
- variant: "outlined",
192
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
193
- }, {
194
- default: x(() => [
195
- t[6] || (t[6] = n("img", {
196
- src: z,
197
- class: "aspect-square w-[150px]"
198
- }, null, -1)),
199
- n("div", pe, [
200
- n("div", ue, g(o(r)("connect.program.experience.empty_state.title")), 1),
201
- n("div", fe, g(o(r)("connect.program.experience.empty_state.description")), 1)
202
- ]),
203
- i(F, {
204
- variant: "primary",
205
- label: "Create experience program",
206
- icon: "add",
207
- onClick: t[5] || (t[5] = (a) => f())
208
- })
209
- ]),
210
- _: 1
211
- })),
212
- i(oe, {
213
- ref_key: "sheetRef",
214
- ref: C,
215
- "onSubmit:modelValue": N
216
- }, null, 512)
217
- ])
218
- ], 64);
219
- };
220
- }
221
- });
222
- export {
223
- Ve as default
224
- };