@feedmepos/mf-connect 0.1.3-prod → 0.1.5-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.
- package/dist/Analytic-CC5xdRtS.js +423 -0
- package/dist/{App-DvtYt9h5.js → App-CFLVGljI.js} +276 -275
- package/dist/Broadcast-B5OnLTNo.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DoH4RX_Y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6oleems.js} +8 -8
- package/dist/Card-Cw9Ts0qN.js +824 -0
- package/dist/{Collections-C5-k8WkG.js → Collections-CTEOsTLk.js} +4 -4
- package/dist/Credit-Bt2ntvn6.js +220 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BaOM6fUL.js} +918 -901
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dxyv9AzJ.js +345 -0
- package/dist/Experience-CdiCyjUs.js +221 -0
- package/dist/Game-CD07hjmT.js +255 -0
- package/dist/Marketing-CodbC8LJ.js +316 -0
- package/dist/Member-Cr8ki7-7.js +69 -0
- package/dist/{MemberList-CMefeirT.js → MemberList-_-IwGMer.js} +75 -75
- package/dist/{MemberTransactions-B9oYdzjR.js → MemberTransactions-B3LWcATC.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B0T7ze7r.js → MessageInput.vue_vue_type_script_setup_true_lang-DF-PHN1Z.js} +2 -2
- package/dist/Mission-BqR_oPzu.js +261 -0
- package/dist/Point-wI_0oL5d.js +222 -0
- package/dist/Promotion-Dx6CD3_V.js +253 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BGM1doWM.js → RuleGroup.vue_vue_type_script_setup_true_lang-DiaYx2vk.js} +15 -15
- package/dist/Segment-BzM2a7dM.js +565 -0
- package/dist/Setting-C8me75UN.js +1871 -0
- package/dist/Store-CT-y0pJ4.js +1530 -0
- package/dist/StoreRewards-l5qkiIy-.js +400 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-JumDBZLs.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNyeXIL6.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BtBCggcN.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BYwjePth.js} +1 -1
- package/dist/{Tier-ms8r2E7c.js → Tier-gHTgMsQ3.js} +470 -445
- package/dist/{Title-BBKoBs46.js → Title-DQS7FHaO.js} +298 -282
- package/dist/Transaction-D7nTuNwj.js +39 -0
- package/dist/Voucher-Dr6IxBlt.js +490 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Jh7OW6Wa.js +141 -0
- package/dist/{app-CGgrMOc_.js → app-BCgzIoKj.js} +1 -1
- package/dist/app-CbpXeslU.js +5639 -0
- package/dist/app.js +4 -3
- package/dist/{business-DeMUnCNX.js → business-DDhQna1e.js} +1 -1
- package/dist/{campaign-CBszI6An.js → campaign-CGa533e7.js} +2 -2
- package/dist/{collection.fn-D4Qgx1aW.js → collection.fn-CalTbTcW.js} +2 -2
- package/dist/dto-i36GeVm3.js +2770 -0
- package/dist/{effect-2p4_SGbQ.js → effect-DdEyoxWE.js} +1 -1
- package/dist/{email-addresses-Bc9od2gA.js → email-addresses-DJkhLbVW.js} +1 -1
- package/dist/{export-BK6FgeQO.js → export-g24Ga1Ru.js} +3 -3
- package/dist/{helper-DUkKW7uc.js → helper-BILtwZxJ.js} +1 -1
- package/dist/{index-Cvbyv9Hx.js → index-61n4HR_9.js} +1 -1
- package/dist/{index-AZ8cKg9n.js → index-BOwZO-JV.js} +1 -1
- package/dist/{index-M1SmasnI.js → index-BzskWtcd.js} +3 -3
- package/dist/{index-CTmiZrHu.js → index-CLA_3YPs.js} +1 -1
- package/dist/{index-B9f-K1No.js → index-Ca1erv2G.js} +2 -2
- package/dist/{index-BWWnWRpt.js → index-DgfFUabi.js} +2 -2
- package/dist/{index-Ci8tkzSn.js → index-GQ4JIFWE.js} +1 -1
- package/dist/{index-BFcrfL4W.js → index-ZcMWfKwl.js} +1 -1
- package/dist/{index-g4L04WYz.js → index-bkuptzmD.js} +91 -86
- package/dist/index-hp-LjMMQ.js +3 -0
- package/dist/{index-DRaETKbn.js → index-lYDskqcR.js} +258 -256
- package/dist/{index-D4HYMbSu.js → index-p3dozIB_.js} +3 -3
- package/dist/{index.esm2017-kvuav0Sd.js → index.esm2017-DeO7Sly1.js} +38 -38
- package/dist/{loading-MNCADfHc.js → loading-CqDGv2I6.js} +11 -11
- package/dist/{membership-CsbTF-DX.js → membership-aP_8YmFK.js} +3 -3
- package/dist/{money-Lo7kavmu.js → money-BmmtBTzl.js} +1 -1
- package/dist/{number-BviV2K5O.js → number-By8HkTkQ.js} +1 -1
- package/dist/{rule-DKrUrnrM.js → rule-CI2g3FmQ.js} +3 -3
- package/dist/{rule-builder-DjPniLk6.js → rule-builder-BCBsbe_y.js} +1 -1
- package/dist/{template-DteMEC9C.js → template-CRNz0-Qj.js} +4 -4
- package/dist/{usePagination-BKTq-UbV.js → usePagination-D4IC9efy.js} +1 -1
- package/dist/vue-i18n-0zlAmAlF.js +2365 -0
- package/package.json +7 -4
- package/dist/Analytic-DiPWt78u.js +0 -423
- package/dist/Broadcast-Dv4XcvBh.js +0 -216
- package/dist/Card-DDvwlZF0.js +0 -823
- package/dist/Credit-BDQIr_FJ.js +0 -214
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BQzgcn4V.js +0 -344
- package/dist/Experience-B9H3tOF0.js +0 -211
- package/dist/Game-cy3_ppLO.js +0 -250
- package/dist/Marketing-CWXV2n5F.js +0 -309
- package/dist/Member-DyTX22Zk.js +0 -92
- package/dist/Mission-DxSO3iES.js +0 -248
- package/dist/Point-C5UtlqkX.js +0 -220
- package/dist/Promotion-DhSGTj-R.js +0 -244
- package/dist/Segment-BzI6Ykxp.js +0 -564
- package/dist/Setting-SRUWwF9w.js +0 -1870
- package/dist/Store-CIrn_7Mh.js +0 -1533
- package/dist/StoreRewards-BYc0vgnr.js +0 -429
- package/dist/Transaction-IZL9-6fe.js +0 -36
- package/dist/Voucher-CIWulmcc.js +0 -485
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/app-BQvluJk_.js +0 -2974
- package/dist/dto-Dtvg93Bz.js +0 -1145
- package/dist/index-UR1Lxi0C.js +0 -11
package/dist/Voucher-CIWulmcc.js
DELETED
|
@@ -1,485 +0,0 @@
|
|
|
1
|
-
import { defineComponent as X, ref as y, watch as N, onMounted as J, resolveComponent as p, openBlock as g, createBlock as V, unref as t, isRef as j, withCtx as I, createElementVNode as s, createVNode as r, toDisplayString as U, computed as ee, createElementBlock as O, Fragment as T, renderList as ae, resolveDynamicComponent as te, createCommentVNode as K, h as _ } from "vue";
|
|
2
|
-
import { _ as oe } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as ne, components as x } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as Q, p as z, a as se } from "./loading-MNCADfHc.js";
|
|
5
|
-
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
6
|
-
import { u as ie } from "./business-DeMUnCNX.js";
|
|
7
|
-
import { u as re } from "./campaign-CBszI6An.js";
|
|
8
|
-
import { g as D, a as q } from "./dto-Dtvg93Bz.js";
|
|
9
|
-
import { R as ce } from "./index-UR1Lxi0C.js";
|
|
10
|
-
import { u as me } from "./template-DteMEC9C.js";
|
|
11
|
-
import { _ as ue } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.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 ge } from "./index-AZ8cKg9n.js";
|
|
17
|
-
import { c as F } from "./index-CTmiZrHu.js";
|
|
18
|
-
import { useRouter as ye } from "vue-router";
|
|
19
|
-
import { R as G } from "./app-BQvluJk_.js";
|
|
20
|
-
const _e = { class: "space-y-16" }, ve = { class: "fm-typo-en-body-md-600" }, Ce = { class: "flex items-center justify-end" }, be = { class: "flex items-center gap-8" }, we = /* @__PURE__ */ X({
|
|
21
|
-
__name: "SendVoucherSheet",
|
|
22
|
-
emits: ["success"],
|
|
23
|
-
setup(W, { expose: M, emit: R }) {
|
|
24
|
-
const { minor: P } = Q, L = y(""), i = y({}), E = R, f = y(!1), m = y([]);
|
|
25
|
-
function u(e) {
|
|
26
|
-
f.value = !0, L.value = e.campaignId, m.value = [];
|
|
27
|
-
}
|
|
28
|
-
function v() {
|
|
29
|
-
f.value = !1;
|
|
30
|
-
}
|
|
31
|
-
const $ = [
|
|
32
|
-
{
|
|
33
|
-
header: "Name",
|
|
34
|
-
accessorFn: (e) => e.name || "No Profile"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
header: "Phone",
|
|
38
|
-
accessorFn: (e) => e.phoneNumber || "-"
|
|
39
|
-
}
|
|
40
|
-
], l = y({
|
|
41
|
-
searchValue: "",
|
|
42
|
-
pageSize: 10,
|
|
43
|
-
pageCount: 0,
|
|
44
|
-
pageIndex: 0,
|
|
45
|
-
totalRows: 0,
|
|
46
|
-
isLoading: !1
|
|
47
|
-
}), d = y([]), C = async (e) => {
|
|
48
|
-
l.value.isLoading = !0, d.value = [];
|
|
49
|
-
const a = await ge.read({
|
|
50
|
-
limit: e.pageSize,
|
|
51
|
-
skip: e.pageIndex,
|
|
52
|
-
sortBy: "_id",
|
|
53
|
-
search: l.value.searchValue,
|
|
54
|
-
descending: !1
|
|
55
|
-
});
|
|
56
|
-
d.value = a.resources, l.value.totalRows = a.meta.totalResources ?? 0, l.value.pageCount = a.meta.totalPages ?? 0, l.value.isLoading = !1, i.value = {}, m.value.forEach((o) => {
|
|
57
|
-
const c = d.value.findIndex((w) => w._id == o);
|
|
58
|
-
c > -1 && (console.log(c, "fetch member index"), i.value[c] = !0);
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
function b() {
|
|
62
|
-
d.value.length > 0 && (m.value = m.value.filter(
|
|
63
|
-
(e) => !d.value.some((a) => a._id === e) || // Keep if not in current page
|
|
64
|
-
Object.entries(i.value).some(
|
|
65
|
-
([a, o]) => o && d.value[a]._id === e
|
|
66
|
-
// Keep if selected in current page
|
|
67
|
-
)
|
|
68
|
-
));
|
|
69
|
-
for (const [e, a] of Object.entries(i.value))
|
|
70
|
-
if (a) {
|
|
71
|
-
const o = d.value[e]._id;
|
|
72
|
-
m.value.includes(o) || m.value.push(o);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async function A(e) {
|
|
76
|
-
m.value.length < 1 || await P(
|
|
77
|
-
async () => {
|
|
78
|
-
await F.sendCollection(L.value, {
|
|
79
|
-
memberId: m.value
|
|
80
|
-
}), await E("success"), v();
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
message: "Sending claim(s)",
|
|
84
|
-
successMessage: "Claim(s) created"
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
return N(i, b, { deep: !0 }), N(
|
|
89
|
-
() => l.value.searchValue,
|
|
90
|
-
he.debounce(async () => {
|
|
91
|
-
await C({ pageSize: 10, pageIndex: 0 });
|
|
92
|
-
}, 500)
|
|
93
|
-
), M({
|
|
94
|
-
showSheet: u,
|
|
95
|
-
hideSheet: v
|
|
96
|
-
}), J(async () => {
|
|
97
|
-
await C(l.value);
|
|
98
|
-
}), (e, a) => {
|
|
99
|
-
const o = p("FmSearch"), c = p("FmTable"), w = p("FmButton"), S = p("FmSideSheet");
|
|
100
|
-
return g(), V(S, {
|
|
101
|
-
"max-width": 560,
|
|
102
|
-
"dismiss-away": !0,
|
|
103
|
-
header: "Send voucher to",
|
|
104
|
-
modelValue: t(f),
|
|
105
|
-
"onUpdate:modelValue": [
|
|
106
|
-
a[3] || (a[3] = (h) => j(f) ? f.value = h : null),
|
|
107
|
-
a[4] || (a[4] = (h) => f.value = h)
|
|
108
|
-
]
|
|
109
|
-
}, {
|
|
110
|
-
"side-sheet-footer": I(() => [
|
|
111
|
-
s("div", be, [
|
|
112
|
-
r(w, {
|
|
113
|
-
label: "Send",
|
|
114
|
-
loading: t(fe)().isLoading,
|
|
115
|
-
onClick: A
|
|
116
|
-
}, null, 8, ["loading"]),
|
|
117
|
-
r(w, {
|
|
118
|
-
label: "Cancel",
|
|
119
|
-
type: "button",
|
|
120
|
-
variant: "tertiary",
|
|
121
|
-
onClick: a[2] || (a[2] = (h) => f.value = !1)
|
|
122
|
-
})
|
|
123
|
-
])
|
|
124
|
-
]),
|
|
125
|
-
default: I(() => [
|
|
126
|
-
r(pe, { json: t(m) }, null, 8, ["json"]),
|
|
127
|
-
s("div", _e, [
|
|
128
|
-
s("div", ve, U(t(m).length) + " members selected ", 1),
|
|
129
|
-
s("div", Ce, [
|
|
130
|
-
r(o, {
|
|
131
|
-
class: "mt-4",
|
|
132
|
-
modelValue: t(l).searchValue,
|
|
133
|
-
"onUpdate:modelValue": a[0] || (a[0] = (h) => t(l).searchValue = h),
|
|
134
|
-
placeholder: "Search Member",
|
|
135
|
-
collapsible: ""
|
|
136
|
-
}, null, 8, ["modelValue"])
|
|
137
|
-
]),
|
|
138
|
-
r(c, {
|
|
139
|
-
modelValue: t(i),
|
|
140
|
-
"onUpdate:modelValue": a[1] || (a[1] = (h) => j(i) ? i.value = h : null),
|
|
141
|
-
selection: "multiple",
|
|
142
|
-
loading: t(l).isLoading,
|
|
143
|
-
"row-data": t(d),
|
|
144
|
-
"column-defs": $,
|
|
145
|
-
"page-size": t(l).pageSize,
|
|
146
|
-
"page-count": t(l).pageCount,
|
|
147
|
-
"hide-footer": t(l).totalRows <= t(l).pageSize,
|
|
148
|
-
"fetch-fn": C
|
|
149
|
-
}, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
|
|
150
|
-
])
|
|
151
|
-
]),
|
|
152
|
-
_: 1
|
|
153
|
-
}, 8, ["modelValue"]);
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
var Se = { 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" };
|
|
158
|
-
const xe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, ke = { class: "flex gap-8 overflow-x-auto" }, Fe = { class: "space-y-8" }, Ie = { class: "flex w-full gap-4 items-center" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = { class: "space-y-4" }, Ue = { class: "fm-typo-en-body-lg-600" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "flex gap-8 items-center" }, Ee = /* @__PURE__ */ s("img", {
|
|
159
|
-
src: oe,
|
|
160
|
-
class: "aspect-square w-[150px]"
|
|
161
|
-
}, null, -1), $e = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
162
|
-
/* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create voucher campaign"),
|
|
163
|
-
/* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " A digital coupon that users can redeem for discounts on future purchases. Users usually need to claim and apply the voucher to benefit from the discount. ")
|
|
164
|
-
], -1), aa = /* @__PURE__ */ X({
|
|
165
|
-
__name: "Voucher",
|
|
166
|
-
setup(W) {
|
|
167
|
-
const M = {
|
|
168
|
-
label: "Create campaign",
|
|
169
|
-
value: "create",
|
|
170
|
-
isPrimary: !0,
|
|
171
|
-
prependIcon: "add"
|
|
172
|
-
}, R = ne(), P = me("VOUCHER", R), L = ie(), i = re(), { global: E, minor: f } = Q, m = ye(), u = y({
|
|
173
|
-
searchKey: "",
|
|
174
|
-
location: null
|
|
175
|
-
}), v = ee(
|
|
176
|
-
() => i.campaigns.voucher.filter(
|
|
177
|
-
(e) => !u.value.location || !e.targetLocation || e.targetLocation.includes(u.value.location)
|
|
178
|
-
)
|
|
179
|
-
), $ = [
|
|
180
|
-
{
|
|
181
|
-
header: "Voucher title",
|
|
182
|
-
accessorFn: (e) => e.name
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
header: "Status",
|
|
186
|
-
cell(e) {
|
|
187
|
-
return D(e.row.original);
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
header: "Summary",
|
|
192
|
-
accessorFn: (e) => q(e)
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
header: "Quota",
|
|
196
|
-
accessorFn: (e) => {
|
|
197
|
-
var a;
|
|
198
|
-
return ((a = e.pf_collectible) == null ? void 0 : a.options.maxReceive) ?? "Unlimited";
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
header: "Claimed",
|
|
203
|
-
accessorFn: (e) => {
|
|
204
|
-
var a;
|
|
205
|
-
return ((a = e == null ? void 0 : e.pf_collectible) == null ? void 0 : a.currentReceive) ?? 0;
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
header: "Actions",
|
|
210
|
-
cell(e) {
|
|
211
|
-
return _("div", { class: "flex items-center justify-end" }, [
|
|
212
|
-
_(x.FmButton, {
|
|
213
|
-
icon: "visibility",
|
|
214
|
-
variant: "tertiary",
|
|
215
|
-
iconColor: "neutral-gray-400",
|
|
216
|
-
onClick: async (a) => {
|
|
217
|
-
a.stopPropagation(), await m.push({
|
|
218
|
-
name: G["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
219
|
-
params: { id: e.row.original._id }
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}),
|
|
223
|
-
_(
|
|
224
|
-
x.FmMenu,
|
|
225
|
-
{
|
|
226
|
-
placement: "bottom-end",
|
|
227
|
-
onClick: (a) => {
|
|
228
|
-
a.stopPropagation();
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"menu-button": () => _(x.FmButton, {
|
|
233
|
-
icon: "more_vert",
|
|
234
|
-
iconColor: "neutral-gray-400",
|
|
235
|
-
variant: "tertiary"
|
|
236
|
-
}),
|
|
237
|
-
default: () => {
|
|
238
|
-
const a = [
|
|
239
|
-
_(
|
|
240
|
-
x.FmMenuItem,
|
|
241
|
-
{
|
|
242
|
-
onClick: async (o) => {
|
|
243
|
-
o.stopPropagation(), C(e.row.original);
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
label: _(
|
|
248
|
-
"div",
|
|
249
|
-
{
|
|
250
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
251
|
-
},
|
|
252
|
-
"Remove"
|
|
253
|
-
)
|
|
254
|
-
}
|
|
255
|
-
)
|
|
256
|
-
];
|
|
257
|
-
return e.row.original.event.type === "SIMPLE_CLAIM" && (a.unshift(
|
|
258
|
-
_(x.FmMenuItem, {
|
|
259
|
-
label: "Send",
|
|
260
|
-
onClick: async (o) => {
|
|
261
|
-
var c;
|
|
262
|
-
o.stopPropagation(), (c = d.value) == null || c.showSheet({
|
|
263
|
-
campaignId: e.row.original._id
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
})
|
|
267
|
-
), a.unshift(
|
|
268
|
-
_(x.FmMenuItem, {
|
|
269
|
-
label: "Share",
|
|
270
|
-
onClick: async (o) => {
|
|
271
|
-
if (o.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
|
|
272
|
-
return await z.confirm(
|
|
273
|
-
"Cannot share a voucher that is not a simple claim.",
|
|
274
|
-
"Share Voucher",
|
|
275
|
-
"OK"
|
|
276
|
-
);
|
|
277
|
-
await se(
|
|
278
|
-
`https://${le().currentBusiness.value._id}.${Se.appUrl}/vouchers/${e.row.original._id}`,
|
|
279
|
-
{
|
|
280
|
-
successMessage: "Voucher link copied to clipboard"
|
|
281
|
-
}
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
})
|
|
285
|
-
)), a;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
)
|
|
289
|
-
]);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
], l = y(), d = y();
|
|
293
|
-
async function C(e) {
|
|
294
|
-
await z.remove(`Are you sure you want to remove ${e.name}?`) && await f(
|
|
295
|
-
async () => {
|
|
296
|
-
await F.delete(e._id), await i.read("VOUCHER");
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
message: `Removing ${e.name}`,
|
|
300
|
-
successMessage: `Removed ${e.name} successfully`
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
async function b(e) {
|
|
305
|
-
e ? await a() : P.open(async (o) => {
|
|
306
|
-
await a(o);
|
|
307
|
-
});
|
|
308
|
-
async function a(o) {
|
|
309
|
-
var c;
|
|
310
|
-
(c = l.value) == null || c.showSheet(
|
|
311
|
-
!0,
|
|
312
|
-
"VOUCHER",
|
|
313
|
-
e ? await F.readById(e._id) : void 0,
|
|
314
|
-
o
|
|
315
|
-
);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
async function A(e) {
|
|
319
|
-
e.campaign._id && await new Promise((a) => {
|
|
320
|
-
R.open({
|
|
321
|
-
title: "Confirmation",
|
|
322
|
-
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
323
|
-
primaryActions: { text: "Update all", close: !0 },
|
|
324
|
-
secondaryActions: { text: "Update future only", close: !0 }
|
|
325
|
-
}).onPrimary(async () => {
|
|
326
|
-
var o;
|
|
327
|
-
e.updateCollections = !0, (o = window.top) == null || o.postMessage("updateAllVoucher", "*"), a();
|
|
328
|
-
}).onSecondary(async () => {
|
|
329
|
-
a();
|
|
330
|
-
});
|
|
331
|
-
}), await f(
|
|
332
|
-
async () => {
|
|
333
|
-
e.campaign._id ? await F.update(e.campaign._id, e) : await F.create(e), await i.read("VOUCHER");
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} voucher`,
|
|
337
|
-
successMessage: `Voucher ${e.campaign._id ? "updated" : "created"} successfully`
|
|
338
|
-
}
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
return J(async () => {
|
|
342
|
-
await E(async () => {
|
|
343
|
-
await i.read("VOUCHER");
|
|
344
|
-
});
|
|
345
|
-
}), (e, a) => {
|
|
346
|
-
const o = p("FmPageHead"), c = p("FmSearch"), w = p("FmTable"), S = p("FmButton"), h = p("FmListItem"), Z = p("FmList"), Y = p("FmCard");
|
|
347
|
-
return g(), O(T, null, [
|
|
348
|
-
r(o, {
|
|
349
|
-
title: "Voucher",
|
|
350
|
-
actions: t(v).length > 0 ? [M] : [],
|
|
351
|
-
"onClick:action": a[0] || (a[0] = () => b())
|
|
352
|
-
}, null, 8, ["actions"]),
|
|
353
|
-
s("div", xe, [
|
|
354
|
-
r(c, {
|
|
355
|
-
modelValue: t(u).searchKey,
|
|
356
|
-
"onUpdate:modelValue": a[1] || (a[1] = (n) => t(u).searchKey = n),
|
|
357
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
358
|
-
placeholder: "search",
|
|
359
|
-
collapsible: ""
|
|
360
|
-
}, null, 8, ["modelValue"]),
|
|
361
|
-
t(i).campaigns.voucher && t(i).campaigns.voucher.length > 0 ? (g(), O(T, { key: 0 }, [
|
|
362
|
-
s("div", Ve, [
|
|
363
|
-
s("div", ke, [
|
|
364
|
-
r(de, {
|
|
365
|
-
modelValue: t(u).location,
|
|
366
|
-
"onUpdate:modelValue": a[2] || (a[2] = (n) => t(u).location = n),
|
|
367
|
-
label: "Location: ",
|
|
368
|
-
"show-item-label": !0,
|
|
369
|
-
icon: "storefront",
|
|
370
|
-
placement: "bottom-start",
|
|
371
|
-
items: t(L).locationItems
|
|
372
|
-
}, null, 8, ["modelValue", "items"])
|
|
373
|
-
]),
|
|
374
|
-
r(c, {
|
|
375
|
-
modelValue: t(u).searchKey,
|
|
376
|
-
"onUpdate:modelValue": a[3] || (a[3] = (n) => t(u).searchKey = n),
|
|
377
|
-
class: "xs:hidden",
|
|
378
|
-
placeholder: "search",
|
|
379
|
-
collapsible: ""
|
|
380
|
-
}, null, 8, ["modelValue"])
|
|
381
|
-
]),
|
|
382
|
-
r(w, {
|
|
383
|
-
class: "xs:hidden",
|
|
384
|
-
"row-data": t(v),
|
|
385
|
-
"column-defs": $,
|
|
386
|
-
"search-value": t(u).searchKey,
|
|
387
|
-
"column-filter": [],
|
|
388
|
-
onRowClick: a[4] || (a[4] = (n) => b(n.original)),
|
|
389
|
-
"hide-footer": t(v).length < 10
|
|
390
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
391
|
-
r(Z, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
392
|
-
default: I(() => [
|
|
393
|
-
(g(!0), O(T, null, ae(t(v).filter(
|
|
394
|
-
(n) => n.name.toLowerCase().includes(t(u).searchKey.toLowerCase())
|
|
395
|
-
), (n) => (g(), V(h, {
|
|
396
|
-
key: n._id.toString(),
|
|
397
|
-
onClick: (B) => b(n),
|
|
398
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
399
|
-
}, {
|
|
400
|
-
default: I(() => {
|
|
401
|
-
var B;
|
|
402
|
-
return [
|
|
403
|
-
s("div", Fe, [
|
|
404
|
-
s("div", Ie, [
|
|
405
|
-
(g(), V(te(t(D)(n)))),
|
|
406
|
-
s("div", Re, U(((B = n.pf_collectible) == null ? void 0 : B.currentReceive) ?? 0) + " claimed ", 1)
|
|
407
|
-
]),
|
|
408
|
-
s("div", Le, [
|
|
409
|
-
s("div", Ue, U(n.name), 1),
|
|
410
|
-
s("div", Me, U(t(q)(n)), 1)
|
|
411
|
-
])
|
|
412
|
-
]),
|
|
413
|
-
s("div", Pe, [
|
|
414
|
-
n.event.type === "SIMPLE_CLAIM" ? (g(), V(S, {
|
|
415
|
-
key: 0,
|
|
416
|
-
icon: "visibility",
|
|
417
|
-
"icon-color": "neutral-gray-400",
|
|
418
|
-
variant: "tertiary",
|
|
419
|
-
onClick: async (k) => {
|
|
420
|
-
k.stopPropagation(), await t(ce).push({
|
|
421
|
-
name: t(G)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
422
|
-
params: { id: n._id }
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
}, null, 8, ["onClick"])) : K("", !0),
|
|
426
|
-
n.event.type === "SIMPLE_CLAIM" ? (g(), V(S, {
|
|
427
|
-
key: 1,
|
|
428
|
-
icon: "send",
|
|
429
|
-
"icon-color": "neutral-gray-400",
|
|
430
|
-
variant: "tertiary",
|
|
431
|
-
onClick: (k) => {
|
|
432
|
-
var H;
|
|
433
|
-
k.stopPropagation(), (H = t(d)) == null || H.showSheet({
|
|
434
|
-
campaignId: n._id
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
}, null, 8, ["onClick"])) : K("", !0),
|
|
438
|
-
r(S, {
|
|
439
|
-
icon: "delete",
|
|
440
|
-
"icon-color": "neutral-gray-400",
|
|
441
|
-
variant: "tertiary",
|
|
442
|
-
onClick: (k) => (k.stopPropagation(), C(n))
|
|
443
|
-
}, null, 8, ["onClick"])
|
|
444
|
-
])
|
|
445
|
-
];
|
|
446
|
-
}),
|
|
447
|
-
_: 2
|
|
448
|
-
}, 1032, ["onClick"]))), 128))
|
|
449
|
-
]),
|
|
450
|
-
_: 1
|
|
451
|
-
})
|
|
452
|
-
], 64)) : (g(), V(Y, {
|
|
453
|
-
key: 1,
|
|
454
|
-
variant: "outlined",
|
|
455
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
456
|
-
}, {
|
|
457
|
-
default: I(() => [
|
|
458
|
-
Ee,
|
|
459
|
-
$e,
|
|
460
|
-
r(S, {
|
|
461
|
-
variant: "primary",
|
|
462
|
-
label: "Create voucher campaign",
|
|
463
|
-
icon: "add",
|
|
464
|
-
onClick: a[5] || (a[5] = (n) => b())
|
|
465
|
-
})
|
|
466
|
-
]),
|
|
467
|
-
_: 1
|
|
468
|
-
})),
|
|
469
|
-
r(ue, {
|
|
470
|
-
ref_key: "sheetRef",
|
|
471
|
-
ref: l,
|
|
472
|
-
"onSubmit:modelValue": A
|
|
473
|
-
}, null, 512),
|
|
474
|
-
r(we, {
|
|
475
|
-
ref_key: "sendVoucherSheetRef",
|
|
476
|
-
ref: d
|
|
477
|
-
}, null, 512)
|
|
478
|
-
])
|
|
479
|
-
], 64);
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
export {
|
|
484
|
-
aa as default
|
|
485
|
-
};
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { h as a, defineComponent as y, useAttrs as j, resolveComponent as v, openBlock as u, createBlock as N, mergeProps as O, unref as s, createSlots as x, withCtx as _, createElementVNode as c, toDisplayString as k, renderSlot as T, createElementBlock as R, createCommentVNode as U } from "vue";
|
|
2
|
-
function m(e, t) {
|
|
3
|
-
return e.path.join(".") === t;
|
|
4
|
-
}
|
|
5
|
-
function E(e, t) {
|
|
6
|
-
return e.some((n) => t == "" || m(n, t)) ? "error" : "none";
|
|
7
|
-
}
|
|
8
|
-
function I(e, t) {
|
|
9
|
-
return e.filter((n) => t == "" || m(n, t)).map((n) => n.message).join(",") || void 0;
|
|
10
|
-
}
|
|
11
|
-
const r = {
|
|
12
|
-
ZodIntersection: (e) => e._def.typeName == "ZodIntersection",
|
|
13
|
-
ZodNullable: (e) => e._def.typeName == "ZodNullable",
|
|
14
|
-
ZodOptional: (e) => e._def.typeName == "ZodOptional",
|
|
15
|
-
ZodEffects: (e) => e._def.typeName == "ZodEffects",
|
|
16
|
-
ZodDiscriminatedUnion: (e) => e._def.typeName == "ZodDiscriminatedUnion",
|
|
17
|
-
ZodUnion: (e) => e._def.typeName == "ZodUnion",
|
|
18
|
-
ZodLazy: (e) => e._def.typeName == "ZodLazy",
|
|
19
|
-
ZodRecord: (e) => e._def.typeName == "ZodRecord",
|
|
20
|
-
ZodObject: (e) => e._def.typeName == "ZodObject"
|
|
21
|
-
};
|
|
22
|
-
function p(e) {
|
|
23
|
-
return !(r.ZodNullable(e) || r.ZodOptional(e));
|
|
24
|
-
}
|
|
25
|
-
function i(e, t = []) {
|
|
26
|
-
function n(d) {
|
|
27
|
-
const o = [d._def.left, d._def.right];
|
|
28
|
-
return r.ZodObject(o[0]) && r.ZodObject(o[1]) ? Object.keys(o[0].shape).length > Object.keys(o[1].shape).length ? o[0] : o[1] : o.find((l) => r.ZodDiscriminatedUnion(l)) || o.find((l) => r.ZodObject(l)) || o[1];
|
|
29
|
-
}
|
|
30
|
-
if ((r.ZodNullable(e) || r.ZodOptional(e)) && (e = i(e.unwrap(), t)), r.ZodEffects(e) && (e = i(e.sourceType(), t)), r.ZodDiscriminatedUnion(e)) {
|
|
31
|
-
const d = Object.fromEntries(e.optionsMap.entries());
|
|
32
|
-
if (t.length) {
|
|
33
|
-
const o = t.shift(), l = d[o];
|
|
34
|
-
return i(l, t);
|
|
35
|
-
}
|
|
36
|
-
return console.log(
|
|
37
|
-
"discriminatedUnion found but no KEY supplied, keys:",
|
|
38
|
-
Object.keys(d)
|
|
39
|
-
), e;
|
|
40
|
-
}
|
|
41
|
-
return r.ZodLazy(e) && (e = i(e._def.getter(), t)), r.ZodIntersection(e) && (e = i(n(e), t)), e;
|
|
42
|
-
}
|
|
43
|
-
function Z(e, t, n = []) {
|
|
44
|
-
return t === "" ? i(e, n) : t.split(".").reduce((d, o) => {
|
|
45
|
-
const l = i(d, n);
|
|
46
|
-
return r.ZodObject(l) ? l.shape[o] : d;
|
|
47
|
-
}, e);
|
|
48
|
-
}
|
|
49
|
-
function b(e, t) {
|
|
50
|
-
return (n) => {
|
|
51
|
-
const d = e.safeParse(n);
|
|
52
|
-
return d.success ? !0 : d.error.errors.filter((o) => !t || o.path.join(".") === t).map((o) => o.message).join(", ");
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function S(e, t, n = []) {
|
|
56
|
-
return b(Z(e, t, n));
|
|
57
|
-
}
|
|
58
|
-
function z(e, t) {
|
|
59
|
-
if (!t) return;
|
|
60
|
-
const n = p(e) ? "hidden" : "";
|
|
61
|
-
return a(
|
|
62
|
-
"div",
|
|
63
|
-
{ class: "flex items-center gap-x-4 fm-typo-en-body-lg-400" },
|
|
64
|
-
[
|
|
65
|
-
a("div", t),
|
|
66
|
-
a(
|
|
67
|
-
"div",
|
|
68
|
-
{
|
|
69
|
-
class: `text-fm-color-typo-secondary ${n}`
|
|
70
|
-
},
|
|
71
|
-
"(optional)"
|
|
72
|
-
)
|
|
73
|
-
]
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
const f = {
|
|
77
|
-
helperState: E,
|
|
78
|
-
helperText: I,
|
|
79
|
-
typeAtPath: Z,
|
|
80
|
-
toRule: b,
|
|
81
|
-
ruleAtPath: S,
|
|
82
|
-
isRequired: p,
|
|
83
|
-
toInputLabel: z,
|
|
84
|
-
unwrap: i
|
|
85
|
-
}, L = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary items-center" }, P = {
|
|
86
|
-
key: 0,
|
|
87
|
-
class: "text-fm-color-typo-tertiary"
|
|
88
|
-
}, A = /* @__PURE__ */ y({
|
|
89
|
-
__name: "ZodTextField",
|
|
90
|
-
props: {
|
|
91
|
-
label: {
|
|
92
|
-
type: String,
|
|
93
|
-
required: !1
|
|
94
|
-
},
|
|
95
|
-
schema: {
|
|
96
|
-
type: Object,
|
|
97
|
-
required: !0
|
|
98
|
-
},
|
|
99
|
-
modelValue: {
|
|
100
|
-
type: String
|
|
101
|
-
},
|
|
102
|
-
disabled: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: !1
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
emits: ["update:model-value", "focus-changed"],
|
|
108
|
-
setup(e, { emit: t }) {
|
|
109
|
-
const n = t, d = j();
|
|
110
|
-
return (o, l) => {
|
|
111
|
-
const g = v("FmTextField");
|
|
112
|
-
return u(), N(g, O({
|
|
113
|
-
"model-value": e.modelValue,
|
|
114
|
-
"onUpdate:modelValue": l[0] || (l[0] = (h) => n("update:model-value", h)),
|
|
115
|
-
disabled: e.disabled
|
|
116
|
-
}, s(d), {
|
|
117
|
-
rules: [s(f).toRule(e.schema)]
|
|
118
|
-
}), x({ _: 2 }, [
|
|
119
|
-
e.label ? {
|
|
120
|
-
name: "label",
|
|
121
|
-
fn: _(() => [
|
|
122
|
-
c("div", L, [
|
|
123
|
-
c("div", null, k(e.label), 1),
|
|
124
|
-
T(o.$slots, "append-label", {}, () => [
|
|
125
|
-
s(f).isRequired(e.schema) ? U("", !0) : (u(), R("div", P, " (optional) "))
|
|
126
|
-
])
|
|
127
|
-
])
|
|
128
|
-
]),
|
|
129
|
-
key: "0"
|
|
130
|
-
} : void 0
|
|
131
|
-
]), 1040, ["model-value", "disabled", "rules"]);
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
export {
|
|
136
|
-
f as Z,
|
|
137
|
-
A as _,
|
|
138
|
-
I as a,
|
|
139
|
-
E as g
|
|
140
|
-
};
|