@feedmepos/mf-connect 0.1.14-prod → 0.1.15-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 (88) hide show
  1. package/dist/{Analytic-MRp7gtO3.js → Analytic-C7qqDS5D.js} +18 -17
  2. package/dist/{App-BU3B2A-F.js → App-DKZYz5r2.js} +68 -64
  3. package/dist/Bin-U7U1Vaju.js +165 -0
  4. package/dist/{Broadcast-DmciJlSU.js → Broadcast-BzChnp4V.js} +8 -8
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DJPOgBXj.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BELIbS3v.js} +6 -7
  6. package/dist/{Card-Dq2cAgTi.js → Card-DAfZz7q5.js} +78 -79
  7. package/dist/{Collections-B4x4VH1a.js → Collections-joGRHyag.js} +5 -5
  8. package/dist/{Credit-CVdT1KBU.js → Credit-N1qDB4XC.js} +8 -8
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BmjXu-U7.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-J95iaF7a.js} +27 -27
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-A_uosv-g.js → EffectSheet.vue_vue_type_style_index_0_lang-DwzQSmst.js} +8 -8
  11. package/dist/{Experience-CEeXWbue.js → Experience-D5GrDbft.js} +8 -8
  12. package/dist/{Game-mx5c5ZhV.js → Game-DI7BDPO_.js} +8 -8
  13. package/dist/{Index-DQ1qadwz.js → Index-CbuAJ2dE.js} +9 -9
  14. package/dist/{Marketing-CciBZijv.js → Marketing-BSqMfy70.js} +5 -5
  15. package/dist/{Member-C51SlKxj.js → Member-CGd5wNHJ.js} +4 -4
  16. package/dist/MemberList-DnS8KHYF.js +1596 -0
  17. package/dist/MemberTransactions-GAAX3aSV.js +45 -0
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DZu24zwy.js → MessageInput.vue_vue_type_script_setup_true_lang-Bc2wcibo.js} +5 -5
  19. package/dist/{Mission-LpCnpKYD.js → Mission-BVM_1IJ8.js} +8 -8
  20. package/dist/{Overview-DxvOqUao.js → Overview-D2IYZCPn.js} +62 -63
  21. package/dist/{Point-BmI7y6h6.js → Point-B684quZM.js} +8 -8
  22. package/dist/{Promotion-MHaOqrwu.js → Promotion-DJOoRnxt.js} +9 -9
  23. package/dist/{Record-75BxMATe.js → Record-Bk74XVUj.js} +6 -6
  24. package/dist/{Reward-8VfyFuEt.js → Reward-BM0AGGL6.js} +35 -35
  25. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D12_r-9X.js → RewardGroup.vue_vue_type_script_setup_true_lang-CuA2D52B.js} +12 -13
  26. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BIdBxvN7.js → RuleGroup.vue_vue_type_script_setup_true_lang-Cxv3cZ1v.js} +14 -15
  27. package/dist/{Segment-I9FUibZy.js → Segment-DqOsH95n.js} +13 -13
  28. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BGeR0-AG.js → SelectItems.vue_vue_type_script_setup_true_lang-ypjkVZkZ.js} +2 -2
  29. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Qo0aOTI9.js +147 -0
  30. package/dist/{Setting-B8V2I0EZ.js → Setting-D6cRTVUl.js} +31 -31
  31. package/dist/{Store-CQkGNSSm.js → Store-DqtUurcv.js} +55 -56
  32. package/dist/{StoreRewards-DOtjveqw.js → StoreRewards-DPFMA3p9.js} +12 -12
  33. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Cf9IsQXS.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CYqo5att.js} +321 -354
  34. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DPmeW62s.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxEV-6_4.js} +1 -1
  35. package/dist/{Tier-DAj_5abZ.js → Tier-CFd-HaGX.js} +20 -21
  36. package/dist/{Title-DryO4wcO.js → Title-CBktBb5l.js} +20 -21
  37. package/dist/{Transaction-DpibVFU-.js → Transaction-Bb8UU_lj.js} +2 -2
  38. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DoiPRPPo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DBiUmz3C.js} +6 -6
  39. package/dist/Voucher-Bukem4U7.js +353 -0
  40. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DRnVggfC.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CTbqVMCn.js} +10 -10
  41. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzBcsSYS.js → ZodTextField.vue_vue_type_script_setup_true_lang-D8zMv7ks.js} +1 -1
  42. package/dist/{app-BoQTcBOD.js → app-BL2xIPMp.js} +102 -66
  43. package/dist/{app-BzPle2EI.js → app-CO6FVdHg.js} +1 -1
  44. package/dist/app.js +1 -1
  45. package/dist/{business-H9a63ymR.js → business-BMTDDe8v.js} +1 -1
  46. package/dist/{dto-BBLfD0Lh.js → campaign-C5TEfnWg.js} +610 -819
  47. package/dist/{campaign-CR-16mwD.js → campaign-CzpECNqa.js} +2 -2
  48. package/dist/{campaign.enum-DcaetYuk.js → campaign.enum-CVF3KbJ2.js} +1 -1
  49. package/dist/{campaign.fn-BqGZqM77.js → campaign.fn-WT1gfEwK.js} +110 -110
  50. package/dist/{collectible.enum-YKtiwQbt.js → collectible.enum-BW7-BEa-.js} +3 -3
  51. package/dist/{collection.fn-CI8lSAsC.js → collection.fn-BRsC9uPP.js} +2 -2
  52. package/dist/dto-B1tWHAjt.js +214 -0
  53. package/dist/{effect-36H79d0n.js → effect-4Ov4Jl68.js} +1 -1
  54. package/dist/{email-addresses-drrACeqJ.js → email-addresses-L25192f3.js} +1 -1
  55. package/dist/{export-BgnO3lJs.js → export-UEJjaL0g.js} +5 -5
  56. package/dist/{helper-CcV9DZXq.js → helper-BNBSbgdl.js} +1 -1
  57. package/dist/{index-mgoYj6L9.js → index-BWY2o9U9.js} +1 -1
  58. package/dist/index-BnWjqXOJ.js +115 -0
  59. package/dist/{index-DydNNBhY.js → index-BxwVs3Ot.js} +29 -4
  60. package/dist/index-Cg64BkVG.js +44 -0
  61. package/dist/{index-CibFRBGu.js → index-ChKwu49G.js} +6 -6
  62. package/dist/{index-ZycLk3NR.js → index-CtY-c-yc.js} +1 -1
  63. package/dist/{index-BPbhXWRp.js → index-D4iYmdD4.js} +12 -13
  64. package/dist/{index-BEDXujqZ.js → index-D8Qn3ZjQ.js} +1 -1
  65. package/dist/{index-Cidu1YZP.js → index-DpCBCiH_.js} +5 -5
  66. package/dist/{index-DLAAi9ur.js → index-DxjXJh5H.js} +3 -3
  67. package/dist/{index-BRTpdfj3.js → index-fdv6AHmk.js} +2057 -1010
  68. package/dist/{index-CB1CnEOn.js → index-jf1CG6wc.js} +1 -1
  69. package/dist/{index.esm2017-QS_XhcBp.js → index.esm2017-D-3LEGru.js} +1 -1
  70. package/dist/{loading-LktVwV5k.js → loading-CUp8ZsA0.js} +4 -4
  71. package/dist/{membership-7ETvXph3.js → membership-DwbiFGd7.js} +6 -6
  72. package/dist/{money-BYszknw8.js → money-BLrbHrdQ.js} +1 -1
  73. package/dist/{number-Dmd4vT4F.js → number--bZt83Nn.js} +1 -1
  74. package/dist/{objectid-BQtSeCVi.js → objectid-CCGQh_Y_.js} +4 -4
  75. package/dist/{reward-DJGOX-D1.js → reward-D99cFWcD.js} +1 -1
  76. package/dist/{rule-D7jM4gdg.js → rule-UpH1Y1i5.js} +3 -3
  77. package/dist/{rule-builder-FO9UeYUJ.js → rule-builder-ujLy6UTt.js} +1 -1
  78. package/dist/{template-C4Ddrpk1.js → template-FiuUP37O.js} +4 -4
  79. package/dist/{trigger-w7Q4qOMB.js → trigger-BZYtwSky.js} +13 -13
  80. package/dist/{usePagination-PH1OvyZM.js → usePagination-DDW-s6D3.js} +1 -1
  81. package/dist/{user-DRPXRVy2.js → user-BA3Sw5dU.js} +1 -1
  82. package/dist/{vue-i18n-B49HKiTU.js → vue-i18n-C5t_xZZj.js} +2 -2
  83. package/package.json +1 -1
  84. package/dist/MemberList-D1x731cU.js +0 -1043
  85. package/dist/MemberTransactions-BpoTQHFQ.js +0 -38
  86. package/dist/Voucher-CSc0_dGX.js +0 -491
  87. package/dist/index-6RqtavHk.js +0 -1051
  88. package/dist/index-B5ii6hOh.js +0 -99
@@ -1,38 +0,0 @@
1
- import { defineComponent as i, ref as p, resolveComponent as _, openBlock as l, createElementBlock as d, createVNode as f, unref as e, createBlock as r, createCommentVNode as v } from "vue";
2
- import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-Cf9IsQXS.js";
3
- import { useRouter as x } from "vue-router";
4
- const C = { class: "flex flex-col gap-y-32 pb-24" }, N = /* @__PURE__ */ i({
5
- __name: "MemberTransactions",
6
- setup(T) {
7
- const s = x(), t = [
8
- {
9
- label: "Collection",
10
- value: "collection"
11
- },
12
- {
13
- label: "Store",
14
- value: "store"
15
- }
16
- ], o = p(t[0]), a = s.currentRoute.value.params.id;
17
- return (y, n) => {
18
- const u = _("FmTabs");
19
- return l(), d("div", C, [
20
- f(u, {
21
- "model-value": e(o).value,
22
- items: t,
23
- "onUpdate:modelValue": n[0] || (n[0] = (c) => o.value = t.find((m) => m.value === c))
24
- }, null, 8, ["model-value"]),
25
- e(o).value == "collection" ? (l(), r(b, {
26
- key: 0,
27
- user: e(a)
28
- }, null, 8, ["user"])) : e(o).value == "store" ? (l(), r(k, {
29
- key: 1,
30
- user: e(a)
31
- }, null, 8, ["user"])) : v("", !0)
32
- ]);
33
- };
34
- }
35
- });
36
- export {
37
- N as default
38
- };
@@ -1,491 +0,0 @@
1
- import { defineComponent as X, ref as _, watch as N, onMounted as J, resolveComponent as h, openBlock as y, createBlock as F, unref as t, isRef as j, withCtx as M, createElementVNode as l, createVNode as r, toDisplayString as k, computed as oe, h as b, 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-LktVwV5k.js";
5
- import { useCoreStore as ce } from "@feedmepos/mf-common";
6
- import { u as ie } from "./business-H9a63ymR.js";
7
- import { u as re } from "./campaign-CR-16mwD.js";
8
- import { g as ue, a as D, b as q } from "./dto-BBLfD0Lh.js";
9
- import "./index-CB1CnEOn.js";
10
- import { u as me } from "./template-C4Ddrpk1.js";
11
- import { _ as de } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BmjXu-U7.js";
12
- import { _ as pe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
13
- import { J as fe } from "./JsonViewer-v8_C7l5N.js";
14
- import { u as he } from "./app-wDQR6dpb.js";
15
- import { l as ge } from "./lodash-B5I3zXaY.js";
16
- import { m as ve } from "./index-ZycLk3NR.js";
17
- import { c as L } from "./index-B5ii6hOh.js";
18
- import { u as ye } from "./vue-i18n-B49HKiTU.js";
19
- import { useRouter as _e } from "vue-router";
20
- import { R as G } from "./app-BoQTcBOD.js";
21
- const Ce = { class: "space-y-16" }, be = { class: "fm-typo-en-body-md-600" }, we = { class: "flex items-center justify-end" }, Se = { class: "flex items-center gap-8" }, xe = /* @__PURE__ */ X({
22
- __name: "SendVoucherSheet",
23
- emits: ["success"],
24
- setup(Q, { expose: a, emit: A }) {
25
- const { minor: R } = W, P = _(""), g = _({}), C = A, v = _(!1), u = _([]);
26
- function U(c) {
27
- v.value = !0, P.value = c.campaignId, u.value = [];
28
- }
29
- function m() {
30
- v.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, g.value = {}, u.value.forEach((o) => {
58
- const s = f.value.findIndex((d) => d._id == o);
59
- s > -1 && (console.log(s, "fetch member index"), g.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(g.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(g.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 C("success"), m();
82
- },
83
- {
84
- message: "Sending claim(s)",
85
- successMessage: "Claim(s) created"
86
- }
87
- );
88
- }
89
- return N(g, E, { deep: !0 }), N(
90
- () => i.value.searchValue,
91
- ge.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(), F(B, {
102
- "max-width": 560,
103
- "dismiss-away": !0,
104
- header: "Send voucher to",
105
- modelValue: t(v),
106
- "onUpdate:modelValue": [
107
- e[3] || (e[3] = (p) => j(v) ? v.value = p : null),
108
- e[4] || (e[4] = (p) => v.value = p)
109
- ]
110
- }, {
111
- "side-sheet-footer": M(() => [
112
- l("div", Se, [
113
- r(d, {
114
- label: "Send",
115
- loading: t(he)().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) => v.value = !1)
123
- })
124
- ])
125
- ]),
126
- default: M(() => [
127
- r(fe, { json: t(u) }, null, 8, ["json"]),
128
- l("div", Ce, [
129
- l("div", be, k(t(u).length) + " members selected ", 1),
130
- l("div", we, [
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(g),
141
- "onUpdate:modelValue": e[1] || (e[1] = (p) => j(g) ? g.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 Ve = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
159
- const Fe = { class: "px-24 flex flex-col gap-y-16" }, ke = { 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" }, Re = { 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" }, Ee = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ae = { class: "flex gap-8 items-center" }, Be = /* @__PURE__ */ l("img", {
160
- src: ne,
161
- class: "aspect-square w-[150px]"
162
- }, null, -1), Oe = { class: "flex flex-col gap-16 text-center" }, $e = { class: "fm-typo-en-title-sm-800" }, Te = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lo = /* @__PURE__ */ X({
163
- __name: "Voucher",
164
- setup(Q) {
165
- const { t: a } = ye(), A = {
166
- label: a("connect.voucher.createCampaign"),
167
- value: "create",
168
- isPrimary: !0,
169
- prependIcon: "add"
170
- }, R = se(), P = me("VOUCHER", R), g = ie(), C = re(), { global: v, minor: u } = W, U = _e(), m = _({
171
- searchKey: "",
172
- location: null
173
- }), S = oe(
174
- () => C.campaigns.voucher.filter(
175
- (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
176
- )
177
- ), i = [
178
- {
179
- header: a("connect.voucher.voucherTitle"),
180
- accessorFn: (e) => e.name
181
- },
182
- {
183
- header: a("connect.voucher.status"),
184
- accessorFn: (e) => ue(e),
185
- cell(e) {
186
- return D(e.row.original);
187
- }
188
- },
189
- {
190
- header: a("connect.voucher.summary"),
191
- accessorFn: (e) => q(e)
192
- },
193
- {
194
- header: a("connect.voucher.quota"),
195
- accessorFn: (e) => {
196
- var o;
197
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
198
- }
199
- },
200
- {
201
- header: a("connect.voucher.claimed"),
202
- accessorFn: (e) => {
203
- var o;
204
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
205
- }
206
- },
207
- {
208
- header: a("connect.voucher.actions"),
209
- cell(e) {
210
- return b("div", { class: "flex items-center justify-end" }, [
211
- b(V.FmButton, {
212
- icon: "visibility",
213
- variant: "tertiary",
214
- iconColor: "neutral-gray-400",
215
- onClick: async (o) => {
216
- o.stopPropagation(), await U.push({
217
- name: G["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
218
- params: { id: e.row.original._id }
219
- });
220
- }
221
- }),
222
- b(
223
- V.FmMenu,
224
- {
225
- placement: "bottom-end",
226
- onClick: (o) => {
227
- o.stopPropagation();
228
- }
229
- },
230
- {
231
- "menu-button": () => b(V.FmButton, {
232
- icon: "more_vert",
233
- iconColor: "neutral-gray-400",
234
- variant: "tertiary"
235
- }),
236
- default: () => {
237
- const o = [
238
- b(
239
- V.FmMenuItem,
240
- {
241
- onClick: async (s) => {
242
- s.stopPropagation(), E(e.row.original);
243
- }
244
- },
245
- {
246
- label: b(
247
- "div",
248
- {
249
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
250
- },
251
- a("connect.voucher.remove")
252
- )
253
- }
254
- )
255
- ];
256
- return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
257
- b(V.FmMenuItem, {
258
- label: a("connect.voucher.send"),
259
- onClick: async (s) => {
260
- var d;
261
- s.stopPropagation(), (d = w.value) == null || d.showSheet({
262
- campaignId: e.row.original._id
263
- });
264
- }
265
- })
266
- ), o.unshift(
267
- b(V.FmMenuItem, {
268
- label: a("connect.voucher.share"),
269
- onClick: async (s) => {
270
- if (s.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
271
- return await z.confirm(
272
- "Cannot share a voucher that is not a simple claim.",
273
- "Share Voucher",
274
- "OK"
275
- );
276
- await le(
277
- `https://${ce().currentBusiness.value._id}.${Ve.appUrl}/vouchers/${e.row.original._id}`,
278
- {
279
- successMessage: "Voucher link copied to clipboard"
280
- }
281
- );
282
- }
283
- })
284
- )), o;
285
- }
286
- }
287
- )
288
- ]);
289
- }
290
- }
291
- ], f = _(), w = _();
292
- async function E(e) {
293
- await z.remove(a("voucher.confirmRemove", { name: e.name })) && await u(
294
- async () => {
295
- await L.delete(e._id), await C.read("VOUCHER");
296
- },
297
- {
298
- message: a("voucher.removing", { name: e.name }),
299
- successMessage: a("voucher.removedSuccessfully", { name: e.name })
300
- }
301
- );
302
- }
303
- async function x(e) {
304
- e ? await o() : P.open(async (s) => {
305
- await o(s);
306
- });
307
- async function o(s) {
308
- var d;
309
- (d = f.value) == null || d.showSheet(
310
- !0,
311
- "VOUCHER",
312
- e ? await L.readById(e._id) : void 0,
313
- s
314
- );
315
- }
316
- }
317
- async function c(e) {
318
- e.campaign._id && await new Promise((o) => {
319
- R.open({
320
- title: "Confirmation",
321
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
322
- primaryActions: { text: "Update all", close: !0 },
323
- secondaryActions: { text: "Update future only", close: !0 }
324
- }).onPrimary(async () => {
325
- var s;
326
- e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
327
- }).onSecondary(async () => {
328
- o();
329
- });
330
- }), await u(
331
- async () => {
332
- e.campaign._id ? await L.update(e.campaign._id, e) : await L.create(e), await C.read("VOUCHER");
333
- },
334
- {
335
- message: a(
336
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
337
- ),
338
- successMessage: a(
339
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
340
- )
341
- }
342
- );
343
- }
344
- return J(async () => {
345
- await v(async () => {
346
- await C.read("VOUCHER");
347
- });
348
- }), (e, o) => {
349
- const s = h("FmPageHead"), d = h("FmSearch"), B = h("FmTable"), p = h("FmButton"), Z = h("FmListItem"), Y = h("FmList"), ee = h("FmCard");
350
- return y(), $(T, null, [
351
- r(s, {
352
- title: t(a)("connect.voucher.title"),
353
- actions: t(S).length > 0 ? [A] : [],
354
- "onClick:action": o[0] || (o[0] = () => x())
355
- }, null, 8, ["title", "actions"]),
356
- l("div", Fe, [
357
- r(d, {
358
- modelValue: t(m).searchKey,
359
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(m).searchKey = n),
360
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
361
- placeholder: t(a)("connect.voucher.search"),
362
- collapsible: ""
363
- }, null, 8, ["modelValue", "placeholder"]),
364
- t(C).campaigns.voucher && t(C).campaigns.voucher.length > 0 ? (y(), $(T, { key: 0 }, [
365
- l("div", ke, [
366
- l("div", Ie, [
367
- r(pe, {
368
- modelValue: t(m).location,
369
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(m).location = n),
370
- label: t(a)("connect.voucher.location"),
371
- "show-item-label": !0,
372
- icon: "storefront",
373
- placement: "bottom-start",
374
- items: t(g).locationItems
375
- }, null, 8, ["modelValue", "label", "items"])
376
- ]),
377
- r(d, {
378
- modelValue: t(m).searchKey,
379
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(m).searchKey = n),
380
- class: "xs:hidden",
381
- placeholder: t(a)("connect.voucher.search"),
382
- collapsible: ""
383
- }, null, 8, ["modelValue", "placeholder"])
384
- ]),
385
- r(B, {
386
- class: "xs:hidden",
387
- "row-data": t(S),
388
- "column-defs": i,
389
- "search-value": t(m).searchKey,
390
- "column-filter": [],
391
- onRowClick: o[4] || (o[4] = (n) => x(n.original)),
392
- "hide-footer": t(S).length < 10
393
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
394
- r(Y, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
395
- default: M(() => [
396
- (y(!0), $(T, null, te(t(S).filter(
397
- (n) => n.name.toLowerCase().includes(t(m).searchKey.toLowerCase())
398
- ), (n) => (y(), F(Z, {
399
- key: n._id.toString(),
400
- onClick: (O) => x(n),
401
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
402
- }, {
403
- default: M(() => {
404
- var O;
405
- return [
406
- l("div", Le, [
407
- l("div", Me, [
408
- (y(), F(ae(t(D)(n)))),
409
- l("div", Re, k(((O = n.pf_collectible) == null ? void 0 : O.currentReceive) ?? 0) + " claimed ", 1)
410
- ]),
411
- l("div", Pe, [
412
- l("div", Ue, k(n.name), 1),
413
- l("div", Ee, k(t(q)(n)), 1)
414
- ])
415
- ]),
416
- l("div", Ae, [
417
- n.event.type === "SIMPLE_CLAIM" ? (y(), F(p, {
418
- key: 0,
419
- icon: "visibility",
420
- "icon-color": "neutral-gray-400",
421
- variant: "tertiary",
422
- onClick: async (I) => {
423
- I.stopPropagation(), await t(U).push({
424
- name: t(G)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
425
- params: { id: n._id }
426
- });
427
- }
428
- }, null, 8, ["onClick"])) : K("", !0),
429
- n.event.type === "SIMPLE_CLAIM" ? (y(), F(p, {
430
- key: 1,
431
- icon: "send",
432
- "icon-color": "neutral-gray-400",
433
- variant: "tertiary",
434
- onClick: (I) => {
435
- var H;
436
- I.stopPropagation(), (H = t(w)) == null || H.showSheet({
437
- campaignId: n._id
438
- });
439
- }
440
- }, null, 8, ["onClick"])) : K("", !0),
441
- r(p, {
442
- icon: "delete",
443
- "icon-color": "neutral-gray-400",
444
- variant: "tertiary",
445
- onClick: (I) => (I.stopPropagation(), E(n))
446
- }, null, 8, ["onClick"])
447
- ])
448
- ];
449
- }),
450
- _: 2
451
- }, 1032, ["onClick"]))), 128))
452
- ]),
453
- _: 1
454
- })
455
- ], 64)) : (y(), F(ee, {
456
- key: 1,
457
- variant: "outlined",
458
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
459
- }, {
460
- default: M(() => [
461
- Be,
462
- l("div", Oe, [
463
- l("div", $e, k(t(a)("connect.voucher.createVoucherCampaign")), 1),
464
- l("div", Te, k(t(a)("connect.voucher.description")), 1)
465
- ]),
466
- r(p, {
467
- variant: "primary",
468
- label: t(a)("connect.voucher.createVoucherCampaign"),
469
- icon: "add",
470
- onClick: o[5] || (o[5] = (n) => x())
471
- }, null, 8, ["label"])
472
- ]),
473
- _: 1
474
- })),
475
- r(de, {
476
- ref_key: "sheetRef",
477
- ref: f,
478
- "onSubmit:modelValue": c
479
- }, null, 512),
480
- r(xe, {
481
- ref_key: "sendVoucherSheetRef",
482
- ref: w
483
- }, null, 512)
484
- ])
485
- ], 64);
486
- };
487
- }
488
- });
489
- export {
490
- lo as default
491
- };