@feedmepos/mf-connect 0.1.0-beta.7 → 0.1.0-beta.70

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 (123) hide show
  1. package/dist/Analytic-DEQUEGlq.js +427 -0
  2. package/dist/{App-DalxIjTu.js → App-CcoU2SAx.js} +445 -420
  3. package/dist/AuditLogs-CiB6u06w.js +1886 -0
  4. package/dist/Bin-C2_1m5RT.js +166 -0
  5. package/dist/{Broadcast-uMAvsC--.js → Broadcast-TotIXDuJ.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-JxbENan8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CixQu3Pr.js} +6 -8
  7. package/dist/Card-Ce-_xMgS.js +896 -0
  8. package/dist/Collections-DKva6Doi.js +459 -0
  9. package/dist/{Credit-QlnatflM.js → Credit-BVUxIJ6C.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKEumoan.js +2181 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BE07lc4M.js → EffectSheet.vue_vue_type_style_index_0_lang-ah4bz-qR.js} +49 -49
  14. package/dist/{Experience-Czy41ifp.js → Experience-DV3384o0.js} +32 -30
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  16. package/dist/Game-DY83ti52.js +278 -0
  17. package/dist/Index-DEIaZ-2H.js +259 -0
  18. package/dist/Marketing-C2RwIlrg.js +20071 -0
  19. package/dist/Member-D4fc-wzd.js +333 -0
  20. package/dist/MemberList-DSMI6t_D.js +1598 -0
  21. package/dist/MemberTransactions-wXUlbbRq.js +45 -0
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CtM73bcN.js → MessageInput.vue_vue_type_script_setup_true_lang-DYS0klKm.js} +135 -120
  23. package/dist/Mission-P_KLDEpg.js +296 -0
  24. package/dist/Overview-8vc0f1D7.js +1078 -0
  25. package/dist/{Point-By6ogYy_.js → Point-B4Y0Pq60.js} +55 -53
  26. package/dist/{Promotion-DKcBr-RI.js → Promotion-C1CbesgZ.js} +65 -57
  27. package/dist/Queue-BlPA7PNH.js +244 -0
  28. package/dist/Record-Cl1qXSSk.js +340 -0
  29. package/dist/Reward-jy6-W1Eh.js +442 -0
  30. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-d5JNNNHf.js +150 -0
  31. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DYul_Nu8.js +1640 -0
  32. package/dist/Segment-B36Nrvxs.js +568 -0
  33. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-jN0xUFNR.js +181 -0
  34. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLFTNooB.js +186 -0
  35. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-H_Sehhgf.js +147 -0
  36. package/dist/Setting-AgQf2X4W.js +1931 -0
  37. package/dist/Store-D3Mm0pan.js +1841 -0
  38. package/dist/StoreRewards-L0VLWz8l.js +423 -0
  39. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Zl_cXXSD.js +1028 -0
  40. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-nEdCD6la.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b4mfueTj.js} +1 -1
  41. package/dist/{Tier-DvAs0-yx.js → Tier-DQq-375x.js} +327 -318
  42. package/dist/{Title-B_Trr39o.js → Title-OJxuBvaa.js} +224 -209
  43. package/dist/{Transaction-DCJw-b3H.js → Transaction-vgsYRfD7.js} +2 -2
  44. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Cwi0mvC3.js +130 -0
  45. package/dist/Voucher-BFwLaoxe.js +354 -0
  46. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DNUBaNtJ.js +419 -0
  47. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXkhu8e9.js → ZodTextField.vue_vue_type_script_setup_true_lang-ms40eptZ.js} +1 -1
  48. package/dist/app-BQFTJ_hE.js +33357 -0
  49. package/dist/app-D7C3Fxfi.js +7077 -0
  50. package/dist/app.js +1 -1
  51. package/dist/{business-BC4-i1cU.js → business-vzpvmTdG.js} +1 -1
  52. package/dist/{campaign--0_yMbMV.js → campaign-BkxTDfsK.js} +2 -2
  53. package/dist/campaign-UQ8kMVeC.js +1810 -0
  54. package/dist/campaign.enum-BdT-e9h9.js +20 -0
  55. package/dist/campaign.fn-lc4ZhFCU.js +758 -0
  56. package/dist/collectible.enum-C8kd17Tz.js +19 -0
  57. package/dist/{collection.fn-3TwPe7aF.js → collection.fn-BIw1Y_tv.js} +2 -2
  58. package/dist/dto-CwzAhB8x.js +214 -0
  59. package/dist/{effect-BeR0LK61.js → effect-CJcvLlKG.js} +33 -16
  60. package/dist/email-addresses-BCJTQPT0.js +705 -0
  61. package/dist/{export-xeLLhqvh.js → export-URRwle1z.js} +5 -5
  62. package/dist/{helper-B5iqfKh8.js → helper-DccnE6zn.js} +1 -1
  63. package/dist/index-BiIZ7X6d.js +29556 -0
  64. package/dist/{index-CyKZ-SsN.js → index-BsRJ4kVb.js} +1 -1
  65. package/dist/{index-CU_d8jjU.js → index-C3lpXz_P.js} +1 -1
  66. package/dist/{index-Ct_wR519.js → index-CFA3EqId.js} +24 -21
  67. package/dist/{index-DP-dGMJC.js → index-CPRN3irj.js} +2230 -871
  68. package/dist/index-CaxFS90M.js +56 -0
  69. package/dist/index-CsaQJMAR.js +66 -0
  70. package/dist/index-D4MX9e5q.js +115 -0
  71. package/dist/index-DrE9VkxR.js +32 -0
  72. package/dist/index-EOPRlB9V.js +54 -0
  73. package/dist/{index-CAn5heDe.js → index-FcxOGFKj.js} +48 -4
  74. package/dist/{index-Bh-uaaBG.js → index-OScGm4mF.js} +1506 -1480
  75. package/dist/{index-BOdtpNkP.js → index-ghSGvG-m.js} +266 -173
  76. package/dist/index-vh86FiIQ.js +10 -0
  77. package/dist/{index.esm2017-5jeDA5Zo.js → index.esm2017-CE1CQHrP.js} +121 -121
  78. package/dist/loading-B8zghYbj.js +71 -0
  79. package/dist/{membership-D0nqqWNZ.js → membership-DoJMF2T6.js} +54 -46
  80. package/dist/money-CTR0rXZw.js +15 -0
  81. package/dist/number-Bhgz9eFP.js +12 -0
  82. package/dist/objectid-DdVJrRBw.js +145 -0
  83. package/dist/{loading-C-JDVajU.js → plugins-B5mQ7CHT.js} +3871 -3943
  84. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  85. package/dist/reward-DicsEEHe.js +36 -0
  86. package/dist/{rule-builder-BXt29Es4.js → rule-builder-BWb4JTrd.js} +1 -1
  87. package/dist/{rule-Dn_GgBCe.js → rule-s8siRar1.js} +185 -178
  88. package/dist/style.css +1 -1
  89. package/dist/{template-D2Oi3dxP.js → template-Qb5ozfLa.js} +5 -5
  90. package/dist/trigger-Bsb3Kj35.js +144 -0
  91. package/dist/user-DJ8aHRaM.js +54 -0
  92. package/dist/{vue-i18n-Dud8fvmw.js → vue-i18n-BG2U7GtN.js} +282 -282
  93. package/dist/{xlsx-CCRCidY2.js → xlsx-2QxyDFwt.js} +1 -1
  94. package/package.json +11 -7
  95. package/dist/Analytic-BMpS6jWb.js +0 -622
  96. package/dist/Card-DV8-g69L.js +0 -825
  97. package/dist/Collections-DRafEHT1.js +0 -453
  98. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js +0 -2813
  99. package/dist/Game-CD3zSitz.js +0 -255
  100. package/dist/Marketing-NNes8z6Q.js +0 -316
  101. package/dist/Member-CTqBgYuV.js +0 -69
  102. package/dist/MemberList-B99tS5ce.js +0 -1733
  103. package/dist/MemberTransactions-D1YCXPOg.js +0 -38
  104. package/dist/Mission-XbBVKBiE.js +0 -261
  105. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1ESqEFO.js +0 -1753
  106. package/dist/Segment-B8cszL-F.js +0 -437
  107. package/dist/Setting-aZYABlMW.js +0 -1901
  108. package/dist/Store-Bx2tyJwe.js +0 -1511
  109. package/dist/StoreRewards-DTp9G6gw.js +0 -401
  110. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js +0 -890
  111. package/dist/Voucher-jqv3ji90.js +0 -490
  112. package/dist/app-WlcUVbFb.js +0 -5764
  113. package/dist/app-_w0hjM7u.js +0 -53428
  114. package/dist/dto-Ns2dLn1B.js +0 -2770
  115. package/dist/index-BWb9vRCi.js +0 -29193
  116. package/dist/index-CpU9aqyW.js +0 -206
  117. package/dist/index-CqO_ZvtD.js +0 -99
  118. package/dist/index-CuvNtC_M.js +0 -61
  119. package/dist/index-DsNsA2uX.js +0 -298
  120. package/dist/index-WAMr3npT.js +0 -762
  121. package/dist/money-hdbrblud.js +0 -15
  122. package/dist/number-CRWGOZaW.js +0 -12
  123. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,490 +0,0 @@
1
- import { defineComponent as X, ref as _, watch as N, onMounted as J, resolveComponent as h, openBlock as y, createBlock as k, unref as t, isRef as j, withCtx as M, createElementVNode as l, createVNode as r, toDisplayString as F, computed as oe, h as C, createElementBlock as $, Fragment as T, renderList as te, resolveDynamicComponent as ae, createCommentVNode as K } from "vue";
2
- import { _ as ne } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as se, components as V } from "@feedmepos/ui-library";
4
- import { u as W, p as z, a as le } from "./loading-C-JDVajU.js";
5
- import { useCoreStore as ce } from "@feedmepos/mf-common";
6
- import { u as ie } from "./business-BC4-i1cU.js";
7
- import { u as re } from "./campaign--0_yMbMV.js";
8
- import { g as D, b as q } from "./dto-Ns2dLn1B.js";
9
- import "./index-CyKZ-SsN.js";
10
- import { u as ue } from "./template-D2Oi3dxP.js";
11
- import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js";
12
- import { _ as de } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
13
- import { J as pe } from "./JsonViewer-v8_C7l5N.js";
14
- import { u as fe } from "./app-wDQR6dpb.js";
15
- import { l as he } from "./lodash-B5I3zXaY.js";
16
- import { m as ve } from "./index-Ct_wR519.js";
17
- import { c as L } from "./index-CqO_ZvtD.js";
18
- import { u as ge } from "./vue-i18n-Dud8fvmw.js";
19
- import { useRouter as ye } from "vue-router";
20
- import { R as G } from "./app-WlcUVbFb.js";
21
- const _e = { class: "space-y-16" }, be = { class: "fm-typo-en-body-md-600" }, Ce = { class: "flex items-center justify-end" }, we = { class: "flex items-center gap-8" }, Se = /* @__PURE__ */ X({
22
- __name: "SendVoucherSheet",
23
- emits: ["success"],
24
- setup(Q, { expose: a, emit: A }) {
25
- const { minor: R } = W, P = _(""), v = _({}), b = A, g = _(!1), u = _([]);
26
- function U(c) {
27
- g.value = !0, P.value = c.campaignId, u.value = [];
28
- }
29
- function m() {
30
- g.value = !1;
31
- }
32
- const S = [
33
- {
34
- header: "Name",
35
- accessorFn: (c) => c.name || "No Profile"
36
- },
37
- {
38
- header: "Phone",
39
- accessorFn: (c) => c.phoneNumber || "-"
40
- }
41
- ], i = _({
42
- searchValue: "",
43
- pageSize: 10,
44
- pageCount: 0,
45
- pageIndex: 0,
46
- totalRows: 0,
47
- isLoading: !1
48
- }), f = _([]), w = async (c) => {
49
- i.value.isLoading = !0, f.value = [];
50
- const e = await ve.read({
51
- limit: c.pageSize,
52
- skip: c.pageIndex,
53
- sortBy: "_id",
54
- search: i.value.searchValue,
55
- descending: !1
56
- });
57
- f.value = e.resources, i.value.totalRows = e.meta.totalResources ?? 0, i.value.pageCount = e.meta.totalPages ?? 0, i.value.isLoading = !1, v.value = {}, u.value.forEach((o) => {
58
- const s = f.value.findIndex((d) => d._id == o);
59
- s > -1 && (console.log(s, "fetch member index"), v.value[s] = !0);
60
- });
61
- };
62
- function E() {
63
- f.value.length > 0 && (u.value = u.value.filter(
64
- (c) => !f.value.some((e) => e._id === c) || // Keep if not in current page
65
- Object.entries(v.value).some(
66
- ([e, o]) => o && f.value[e]._id === c
67
- // Keep if selected in current page
68
- )
69
- ));
70
- for (const [c, e] of Object.entries(v.value))
71
- if (e) {
72
- const o = f.value[c]._id;
73
- u.value.includes(o) || u.value.push(o);
74
- }
75
- }
76
- async function x(c) {
77
- u.value.length < 1 || await R(
78
- async () => {
79
- await L.sendCollection(P.value, {
80
- memberId: u.value
81
- }), await b("success"), m();
82
- },
83
- {
84
- message: "Sending claim(s)",
85
- successMessage: "Claim(s) created"
86
- }
87
- );
88
- }
89
- return N(v, E, { deep: !0 }), N(
90
- () => i.value.searchValue,
91
- he.debounce(async () => {
92
- await w({ pageSize: 10, pageIndex: 0 });
93
- }, 500)
94
- ), a({
95
- showSheet: U,
96
- hideSheet: m
97
- }), J(async () => {
98
- await w(i.value);
99
- }), (c, e) => {
100
- const o = h("FmSearch"), s = h("FmTable"), d = h("FmButton"), B = h("FmSideSheet");
101
- return y(), k(B, {
102
- "max-width": 560,
103
- "dismiss-away": !0,
104
- header: "Send voucher to",
105
- modelValue: t(g),
106
- "onUpdate:modelValue": [
107
- e[3] || (e[3] = (p) => j(g) ? g.value = p : null),
108
- e[4] || (e[4] = (p) => g.value = p)
109
- ]
110
- }, {
111
- "side-sheet-footer": M(() => [
112
- l("div", we, [
113
- r(d, {
114
- label: "Send",
115
- loading: t(fe)().isLoading,
116
- onClick: x
117
- }, null, 8, ["loading"]),
118
- r(d, {
119
- label: "Cancel",
120
- type: "button",
121
- variant: "tertiary",
122
- onClick: e[2] || (e[2] = (p) => g.value = !1)
123
- })
124
- ])
125
- ]),
126
- default: M(() => [
127
- r(pe, { json: t(u) }, null, 8, ["json"]),
128
- l("div", _e, [
129
- l("div", be, F(t(u).length) + " members selected ", 1),
130
- l("div", Ce, [
131
- r(o, {
132
- class: "mt-4",
133
- modelValue: t(i).searchValue,
134
- "onUpdate:modelValue": e[0] || (e[0] = (p) => t(i).searchValue = p),
135
- placeholder: "Search Member",
136
- collapsible: ""
137
- }, null, 8, ["modelValue"])
138
- ]),
139
- r(s, {
140
- modelValue: t(v),
141
- "onUpdate:modelValue": e[1] || (e[1] = (p) => j(v) ? v.value = p : null),
142
- selection: "multiple",
143
- loading: t(i).isLoading,
144
- "row-data": t(f),
145
- "column-defs": S,
146
- "page-size": t(i).pageSize,
147
- "page-count": t(i).pageCount,
148
- "hide-footer": t(i).totalRows <= t(i).pageSize,
149
- "fetch-fn": w
150
- }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
151
- ])
152
- ]),
153
- _: 1
154
- }, 8, ["modelValue"]);
155
- };
156
- }
157
- });
158
- var xe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
159
- const Ve = { class: "px-24 flex flex-col gap-y-16" }, ke = { class: "flex items-center justify-between w-full" }, Fe = { class: "flex gap-8 overflow-x-auto" }, Ie = { class: "space-y-8" }, Le = { class: "flex w-full gap-4 items-center" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Pe = { class: "fm-typo-en-body-lg-600" }, Ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = { class: "flex gap-8 items-center" }, Ae = { class: "flex flex-col gap-16 text-center" }, Be = { class: "fm-typo-en-title-sm-800" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, no = /* @__PURE__ */ X({
160
- __name: "Voucher",
161
- setup(Q) {
162
- const { t: a } = ge(), A = {
163
- label: a("connect.voucher.createCampaign"),
164
- value: "create",
165
- isPrimary: !0,
166
- prependIcon: "add"
167
- }, R = se(), P = ue("VOUCHER", R), v = ie(), b = re(), { global: g, minor: u } = W, U = ye(), m = _({
168
- searchKey: "",
169
- location: null
170
- }), S = oe(
171
- () => b.campaigns.voucher.filter(
172
- (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
173
- )
174
- ), i = [
175
- {
176
- header: a("connect.voucher.voucherTitle"),
177
- accessorFn: (e) => e.name
178
- },
179
- {
180
- header: a("connect.voucher.status"),
181
- cell(e) {
182
- return D(e.row.original);
183
- }
184
- },
185
- {
186
- header: a("connect.voucher.summary"),
187
- accessorFn: (e) => q(e)
188
- },
189
- {
190
- header: a("connect.voucher.quota"),
191
- accessorFn: (e) => {
192
- var o;
193
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
194
- }
195
- },
196
- {
197
- header: a("connect.voucher.claimed"),
198
- accessorFn: (e) => {
199
- var o;
200
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
201
- }
202
- },
203
- {
204
- header: a("connect.voucher.actions"),
205
- cell(e) {
206
- return C("div", { class: "flex items-center justify-end" }, [
207
- C(V.FmButton, {
208
- icon: "visibility",
209
- variant: "tertiary",
210
- iconColor: "neutral-gray-400",
211
- onClick: async (o) => {
212
- o.stopPropagation(), await U.push({
213
- name: G["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
214
- params: { id: e.row.original._id }
215
- });
216
- }
217
- }),
218
- C(
219
- V.FmMenu,
220
- {
221
- placement: "bottom-end",
222
- onClick: (o) => {
223
- o.stopPropagation();
224
- }
225
- },
226
- {
227
- "menu-button": () => C(V.FmButton, {
228
- icon: "more_vert",
229
- iconColor: "neutral-gray-400",
230
- variant: "tertiary"
231
- }),
232
- default: () => {
233
- const o = [
234
- C(
235
- V.FmMenuItem,
236
- {
237
- onClick: async (s) => {
238
- s.stopPropagation(), E(e.row.original);
239
- }
240
- },
241
- {
242
- label: C(
243
- "div",
244
- {
245
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
246
- },
247
- a("connect.voucher.remove")
248
- )
249
- }
250
- )
251
- ];
252
- return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
253
- C(V.FmMenuItem, {
254
- label: a("connect.voucher.send"),
255
- onClick: async (s) => {
256
- var d;
257
- s.stopPropagation(), (d = w.value) == null || d.showSheet({
258
- campaignId: e.row.original._id
259
- });
260
- }
261
- })
262
- ), o.unshift(
263
- C(V.FmMenuItem, {
264
- label: a("connect.voucher.share"),
265
- onClick: async (s) => {
266
- if (s.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
267
- return await z.confirm(
268
- "Cannot share a voucher that is not a simple claim.",
269
- "Share Voucher",
270
- "OK"
271
- );
272
- await le(
273
- `https://${ce().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
274
- {
275
- successMessage: "Voucher link copied to clipboard"
276
- }
277
- );
278
- }
279
- })
280
- )), o;
281
- }
282
- }
283
- )
284
- ]);
285
- }
286
- }
287
- ], f = _(), w = _();
288
- async function E(e) {
289
- await z.remove(a("voucher.confirmRemove", { name: e.name })) && await u(
290
- async () => {
291
- await L.delete(e._id), await b.read("VOUCHER");
292
- },
293
- {
294
- message: a("voucher.removing", { name: e.name }),
295
- successMessage: a("voucher.removedSuccessfully", { name: e.name })
296
- }
297
- );
298
- }
299
- async function x(e) {
300
- e ? await o() : P.open(async (s) => {
301
- await o(s);
302
- });
303
- async function o(s) {
304
- var d;
305
- (d = f.value) == null || d.showSheet(
306
- !0,
307
- "VOUCHER",
308
- e ? await L.readById(e._id) : void 0,
309
- s
310
- );
311
- }
312
- }
313
- async function c(e) {
314
- e.campaign._id && await new Promise((o) => {
315
- R.open({
316
- title: "Confirmation",
317
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
318
- primaryActions: { text: "Update all", close: !0 },
319
- secondaryActions: { text: "Update future only", close: !0 }
320
- }).onPrimary(async () => {
321
- var s;
322
- e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
323
- }).onSecondary(async () => {
324
- o();
325
- });
326
- }), await u(
327
- async () => {
328
- e.campaign._id ? await L.update(e.campaign._id, e) : await L.create(e), await b.read("VOUCHER");
329
- },
330
- {
331
- message: a(
332
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
333
- ),
334
- successMessage: a(
335
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
336
- )
337
- }
338
- );
339
- }
340
- return J(async () => {
341
- await g(async () => {
342
- await b.read("VOUCHER");
343
- });
344
- }), (e, o) => {
345
- const s = h("FmPageHead"), d = h("FmSearch"), B = h("FmTable"), p = h("FmButton"), Z = h("FmListItem"), Y = h("FmList"), ee = h("FmCard");
346
- return y(), $(T, null, [
347
- r(s, {
348
- title: t(a)("connect.voucher.title"),
349
- actions: t(S).length > 0 ? [A] : [],
350
- "onClick:action": o[0] || (o[0] = () => x())
351
- }, null, 8, ["title", "actions"]),
352
- l("div", Ve, [
353
- r(d, {
354
- modelValue: t(m).searchKey,
355
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(m).searchKey = n),
356
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
357
- placeholder: t(a)("connect.voucher.search"),
358
- collapsible: ""
359
- }, null, 8, ["modelValue", "placeholder"]),
360
- t(b).campaigns.voucher && t(b).campaigns.voucher.length > 0 ? (y(), $(T, { key: 0 }, [
361
- l("div", ke, [
362
- l("div", Fe, [
363
- r(de, {
364
- modelValue: t(m).location,
365
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(m).location = n),
366
- label: t(a)("connect.voucher.location"),
367
- "show-item-label": !0,
368
- icon: "storefront",
369
- placement: "bottom-start",
370
- items: t(v).locationItems
371
- }, null, 8, ["modelValue", "label", "items"])
372
- ]),
373
- r(d, {
374
- modelValue: t(m).searchKey,
375
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(m).searchKey = n),
376
- class: "xs:hidden",
377
- placeholder: t(a)("connect.voucher.search"),
378
- collapsible: ""
379
- }, null, 8, ["modelValue", "placeholder"])
380
- ]),
381
- r(B, {
382
- class: "xs:hidden",
383
- "row-data": t(S),
384
- "column-defs": i,
385
- "search-value": t(m).searchKey,
386
- "column-filter": [],
387
- onRowClick: o[4] || (o[4] = (n) => x(n.original)),
388
- "hide-footer": t(S).length < 10
389
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
390
- r(Y, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
391
- default: M(() => [
392
- (y(!0), $(T, null, te(t(S).filter(
393
- (n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
394
- ), (n) => (y(), k(Z, {
395
- key: n._id.toString(),
396
- onClick: (O) => x(n),
397
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
398
- }, {
399
- default: M(() => {
400
- var O;
401
- return [
402
- l("div", Ie, [
403
- l("div", Le, [
404
- (y(), k(ae(t(D)(n)))),
405
- l("div", Me, F(((O = n.pf_collectible) == null ? void 0 : O.currentReceive) ?? 0) + " claimed ", 1)
406
- ]),
407
- l("div", Re, [
408
- l("div", Pe, F(n.name), 1),
409
- l("div", Ue, F(t(q)(n)), 1)
410
- ])
411
- ]),
412
- l("div", Ee, [
413
- n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
414
- key: 0,
415
- icon: "visibility",
416
- "icon-color": "neutral-gray-400",
417
- variant: "tertiary",
418
- onClick: async (I) => {
419
- I.stopPropagation(), await t(U).push({
420
- name: t(G)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
421
- params: { id: n._id }
422
- });
423
- }
424
- }, null, 8, ["onClick"])) : K("", !0),
425
- n.event.type === "SIMPLE_CLAIM" ? (y(), k(p, {
426
- key: 1,
427
- icon: "send",
428
- "icon-color": "neutral-gray-400",
429
- variant: "tertiary",
430
- onClick: (I) => {
431
- var H;
432
- I.stopPropagation(), (H = t(w)) == null || H.showSheet({
433
- campaignId: n._id
434
- });
435
- }
436
- }, null, 8, ["onClick"])) : K("", !0),
437
- r(p, {
438
- icon: "delete",
439
- "icon-color": "neutral-gray-400",
440
- variant: "tertiary",
441
- onClick: (I) => (I.stopPropagation(), E(n))
442
- }, null, 8, ["onClick"])
443
- ])
444
- ];
445
- }),
446
- _: 2
447
- }, 1032, ["onClick"]))), 128))
448
- ]),
449
- _: 1
450
- })
451
- ], 64)) : (y(), k(ee, {
452
- key: 1,
453
- variant: "outlined",
454
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
455
- }, {
456
- default: M(() => [
457
- o[6] || (o[6] = l("img", {
458
- src: ne,
459
- class: "aspect-square w-[150px]"
460
- }, null, -1)),
461
- l("div", Ae, [
462
- l("div", Be, F(t(a)("connect.voucher.createVoucherCampaign")), 1),
463
- l("div", Oe, F(t(a)("connect.voucher.description")), 1)
464
- ]),
465
- r(p, {
466
- variant: "primary",
467
- label: t(a)("connect.voucher.createVoucherCampaign"),
468
- icon: "add",
469
- onClick: o[5] || (o[5] = (n) => x())
470
- }, null, 8, ["label"])
471
- ]),
472
- _: 1
473
- })),
474
- r(me, {
475
- ref_key: "sheetRef",
476
- ref: f,
477
- "onSubmit:modelValue": c
478
- }, null, 512),
479
- r(Se, {
480
- ref_key: "sendVoucherSheetRef",
481
- ref: w
482
- }, null, 512)
483
- ])
484
- ], 64);
485
- };
486
- }
487
- });
488
- export {
489
- no as default
490
- };