@feedmepos/mf-connect 0.0.20-prod → 0.0.22-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-DuwMJh8c.js → Analytic-DiZyXVa2.js} +21 -19
- package/dist/App-B56fA1JN.js +176 -0
- package/dist/{Broadcast-BUgjgqv9.js → Broadcast-ixoPXMt8.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BDU9wbxY.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DlgKZtNO.js} +8 -8
- package/dist/{Card-CwohdmAQ.js → Card-aw5tdKY-.js} +74 -72
- package/dist/{Collections-D-JKj4iC.js → Collections-CMD-SLC3.js} +16 -14
- package/dist/{Credit-BdKekl3X.js → Credit-CEVk1_sX.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DA-7-Qi9.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Co6j2tz0.js} +324 -328
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-lDNh6GmQ.js → EffectSheet.vue_vue_type_style_index_0_lang-xXv4IrKd.js} +5 -5
- package/dist/{Experience-KoC4x_ae.js → Experience-CSui9603.js} +7 -7
- package/dist/{Game-CTkr8R18.js → Game-PodGVfdS.js} +7 -7
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CDeQRYDy.js → ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js} +1 -1
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/{MainLayout-Du7UHyf3.js → MainLayout-DpZC6o3R.js} +2 -1
- package/dist/{Marketing-CTl2LqXi.js → Marketing-CbrFzK0w.js} +13 -12
- package/dist/{Member-hHIz1gGT.js → Member-DnrQEiiV.js} +31 -30
- package/dist/{MemberList-Fs95BxUo.js → MemberList-7Te6kVOJ.js} +33 -30
- package/dist/{MemberTransactions-nmURocbA.js → MemberTransactions-BUp_0bkL.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Zk21rkMZ.js → MessageInput.vue_vue_type_script_setup_true_lang-BrxCjH9R.js} +2 -2
- package/dist/{Mission-B5YwPU71.js → Mission-Bp16rwVh.js} +14 -14
- package/dist/{Point-BiOgpyye.js → Point-DnzgCjC2.js} +7 -7
- package/dist/{Promotion-Bpvuwixe.js → Promotion-BmhVCYgN.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DZlxkB8D.js → RuleGroup.vue_vue_type_script_setup_true_lang-BuELQmoo.js} +16 -15
- package/dist/{Segment-DrEpmY4N.js → Segment-CCrLEh0A.js} +19 -18
- package/dist/{Setting-D48p2snU.js → Setting-v0gKscv9.js} +11 -10
- package/dist/{Store-CT1XE_Sn.js → Store-CHDu8Rop.js} +51 -47
- package/dist/StoreRewards-D_vBCPZl.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DboIoW51.js → StoreTransactions.vue_vue_type_script_setup_true_lang-zDJEaBmd.js} +106 -108
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CtSi80Oy.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CVf5Jjj1.js} +6 -6
- package/dist/{Tier-BzZX_Dki.js → Tier-C5gbgtcG.js} +25 -24
- package/dist/{Title-C2Ji-YGQ.js → Title-CojucJrP.js} +15 -15
- package/dist/{Transaction-BJGKndk-.js → Transaction-D1i5IH7D.js} +1 -1
- package/dist/{Voucher-D2dpFJSA.js → Voucher-VuXKhD49.js} +55 -51
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Cok2f-SL.js +2974 -0
- package/dist/{app-D5_9RvMw.js → app-Df5HEUc7.js} +1 -1
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +2 -2
- package/dist/business-zehruO7m.js +78 -0
- package/dist/{campaign-BK6-HrgE.js → campaign-BDdGYC5z.js} +7 -7
- package/dist/{dto-E-AuMyEO.js → dto-X3oNeL7n.js} +8 -8
- package/dist/{effect-DOWJayPu.js → effect-Cl3gXAd9.js} +1 -1
- package/dist/{export-DMZdMVnb.js → export-COy97xf1.js} +3 -3
- package/dist/{helper-CmlX0eR1.js → helper-BMCigtw-.js} +1 -1
- package/dist/{index-Cj1rTpPK.js → index-9ijJtga8.js} +1 -1
- package/dist/{app-BAgeAm1l.js → index-BENEb_BE.js} +9660 -13019
- package/dist/index-BEWobmlN.js +11 -0
- package/dist/{index-QeG7EuE3.js → index-Bi8rxPHs.js} +1 -1
- package/dist/{index-gOVUv83Y.js → index-Btbk-4q4.js} +3 -3
- package/dist/{index-BkHtyaBf.js → index-CXwywdbf.js} +5 -5
- package/dist/{index-BhHZOSyO.js → index-Cl6-R6oj.js} +1 -1
- package/dist/{index-DKCHICCa.js → index-DEunD6Nb.js} +46 -39
- package/dist/{index-BNy1wU-V.js → index-DcRKYwqb.js} +3 -3
- package/dist/{index-BZbJpBo2.js → index-SusoyGmN.js} +6 -7
- package/dist/{index-zAvZNHx0.js → index-ucUyNm2f.js} +177 -168
- package/dist/{index-RcFvF7Y_.js → index-ueVq8lE0.js} +6 -5
- package/dist/{loading-BIURYgSR.js → loading-B7ZGAeOi.js} +28 -26
- package/dist/{lodash-CxofWkz4.js → lodash-B5I3zXaY.js} +1 -1
- package/dist/{membership-DVEV926P.js → membership-JcEfpV3H.js} +3 -3
- package/dist/{money-99JilzxX.js → money-DFguRQja.js} +1 -1
- package/dist/number-CojWykn9.js +12 -0
- package/dist/{rule-Chwh9Y4B.js → rule-C_lc6_Vf.js} +2 -2
- package/dist/{rule-builder-JEF7ltcg.js → rule-builder-C3AmhP2r.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-B6lZdtyo.js → template-TVj4e3Q0.js} +5 -5
- package/dist/{usePagination-4epNDLvW.js → usePagination-JoYaROkV.js} +1 -1
- package/dist/{xlsx-DKkkHUS_.js → xlsx-zY8O-RaE.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreRewards-DsjyanOO.js +0 -433
- package/dist/number-BKGHLuLf.js +0 -12
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as V, computed as N, onMounted as Z, resolveComponent as p, openBlock as u, createBlock as v, unref as e, isRef as z, withCtx as x, createElementVNode as s, createVNode as n, createElementBlock as I, createTextVNode as J, resolveDynamicComponent as H, toDisplayString as K, Fragment as j, createCommentVNode as U, h as C } from "vue";
|
|
2
|
-
import { _ as Q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { components as $ } from "@feedmepos/ui-library";
|
|
4
|
-
import { b as X, u as q, d as k } from "./app-BAgeAm1l.js";
|
|
5
|
-
import { u as ee, p as M, f as B } from "./loading-BIURYgSR.js";
|
|
6
|
-
import { C as _, u as te } from "./membership-DVEV926P.js";
|
|
7
|
-
import { F as ae } from "./index-zAvZNHx0.js";
|
|
8
|
-
import { c as oe } from "./object-qECH92oz.js";
|
|
9
|
-
import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
10
|
-
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
11
|
-
import { _ as se, Z as w } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
12
|
-
import { _ as ie } from "./ImageInput.vue_vue_type_script_setup_true_lang-CDeQRYDy.js";
|
|
13
|
-
import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CtSi80Oy.js";
|
|
14
|
-
import { _ as me, a as de } from "./EffectSheet.vue_vue_type_style_index_0_lang-lDNh6GmQ.js";
|
|
15
|
-
import { i as ce, t as ue } from "./helper-CmlX0eR1.js";
|
|
16
|
-
import { useRouter as pe } from "vue-router";
|
|
17
|
-
import { m as D } from "./index-Cj1rTpPK.js";
|
|
18
|
-
const fe = {
|
|
19
|
-
key: 0,
|
|
20
|
-
class: "flex flex-col space-y-16 pr-12"
|
|
21
|
-
}, ye = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, we = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, ge = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), be = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1), ve = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _e = { class: "flex items-center gap-8" }, he = /* @__PURE__ */ Y({
|
|
22
|
-
__name: "EditRewardSheet",
|
|
23
|
-
emits: ["update"],
|
|
24
|
-
setup(W, { expose: O, emit: f }) {
|
|
25
|
-
const A = f, S = X(), h = le(), i = V(!1), o = V(), y = V(), l = ae, g = N(
|
|
26
|
-
() => {
|
|
27
|
-
var a;
|
|
28
|
-
return _[((a = o.value) == null ? void 0 : a.type) || "VOUCHER"];
|
|
29
|
-
}
|
|
30
|
-
), P = N(() => {
|
|
31
|
-
const a = l.safeParse(o.value);
|
|
32
|
-
return a.success ? [] : a.error.errors;
|
|
33
|
-
});
|
|
34
|
-
function F() {
|
|
35
|
-
const a = l.safeParse(o.value);
|
|
36
|
-
a.success && A("update", a.data);
|
|
37
|
-
}
|
|
38
|
-
function E(a, t, m = {
|
|
39
|
-
isStoreReward: !1,
|
|
40
|
-
type: "VOUCHER"
|
|
41
|
-
}) {
|
|
42
|
-
i.value = a, a && (y.value = void 0, o.value = t || ce(m.type, {
|
|
43
|
-
business: h.currentBusiness.value._id,
|
|
44
|
-
noCampaign: m.isStoreReward == !0
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
return Z(async () => {
|
|
48
|
-
await S.readLocations();
|
|
49
|
-
}), O({
|
|
50
|
-
showSheet: E,
|
|
51
|
-
data: o,
|
|
52
|
-
rewardImage: y
|
|
53
|
-
}), (a, t) => {
|
|
54
|
-
const m = p("FmTextarea"), c = p("FmHelperText"), R = p("FmSwitch"), T = p("FmButton"), L = p("FmSideSheet");
|
|
55
|
-
return u(), v(L, {
|
|
56
|
-
"max-width": 560,
|
|
57
|
-
modelValue: e(i),
|
|
58
|
-
"onUpdate:modelValue": t[8] || (t[8] = (b) => z(i) ? i.value = b : null),
|
|
59
|
-
header: "Store setting"
|
|
60
|
-
}, {
|
|
61
|
-
"side-sheet-footer": x(() => [
|
|
62
|
-
s("div", _e, [
|
|
63
|
-
n(T, {
|
|
64
|
-
label: "Submit",
|
|
65
|
-
onClick: F,
|
|
66
|
-
disabled: e(P).length > 0 || e(q)().isLoading,
|
|
67
|
-
loading: e(q)().isLoading
|
|
68
|
-
}, null, 8, ["disabled", "loading"]),
|
|
69
|
-
n(T, {
|
|
70
|
-
label: "Cancel",
|
|
71
|
-
onClick: t[7] || (t[7] = (b) => E(!1)),
|
|
72
|
-
variant: "tertiary"
|
|
73
|
-
})
|
|
74
|
-
])
|
|
75
|
-
]),
|
|
76
|
-
default: x(() => {
|
|
77
|
-
var b, d, G;
|
|
78
|
-
return [
|
|
79
|
-
e(o) ? (u(), I("div", fe, [
|
|
80
|
-
s("div", ye, [
|
|
81
|
-
J(" Reward information "),
|
|
82
|
-
(u(), v(H(e(g).chip())))
|
|
83
|
-
]),
|
|
84
|
-
n(se, {
|
|
85
|
-
modelValue: e(o).name,
|
|
86
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) => e(o).name = r),
|
|
87
|
-
label: `${e(g).name} name`,
|
|
88
|
-
schema: e(w).typeAtPath(e(l), "name", [e(o).type])
|
|
89
|
-
}, null, 8, ["modelValue", "label", "schema"]),
|
|
90
|
-
n(m, {
|
|
91
|
-
class: "!mb-[-16px]",
|
|
92
|
-
modelValue: e(o).description,
|
|
93
|
-
"onUpdate:modelValue": t[1] || (t[1] = (r) => e(o).description = r),
|
|
94
|
-
rules: [e(w).ruleAtPath(e(l), "description", [e(o).type])]
|
|
95
|
-
}, {
|
|
96
|
-
label: x(() => [
|
|
97
|
-
(u(), v(H(
|
|
98
|
-
e(w).toInputLabel(
|
|
99
|
-
e(w).typeAtPath(e(l), "description", [e(o).type]),
|
|
100
|
-
`${e(g).name} description`
|
|
101
|
-
)
|
|
102
|
-
)))
|
|
103
|
-
]),
|
|
104
|
-
_: 1
|
|
105
|
-
}, 8, ["modelValue", "rules"]),
|
|
106
|
-
s("div", we, [
|
|
107
|
-
s("div", null, K(e(g).name) + " description should not exceed 200 characters. ", 1),
|
|
108
|
-
s("div", null, K(((b = e(o).description) == null ? void 0 : b.length) ?? 0) + "/200", 1)
|
|
109
|
-
]),
|
|
110
|
-
n(ie, {
|
|
111
|
-
class: "w-1/2 xs:w-2/3",
|
|
112
|
-
"aspect-ratio": "16/9",
|
|
113
|
-
file: e(y) ?? void 0,
|
|
114
|
-
thumbnail: e(o).image ?? void 0,
|
|
115
|
-
"onUpdate:file": t[2] || (t[2] = async (r) => {
|
|
116
|
-
y.value = r, r || (e(o).image = null);
|
|
117
|
-
})
|
|
118
|
-
}, {
|
|
119
|
-
label: x(() => [
|
|
120
|
-
(u(), v(H(
|
|
121
|
-
e(w).toInputLabel(
|
|
122
|
-
e(w).typeAtPath(e(l), "image", [e(o).type]),
|
|
123
|
-
`${e(g).name} image`
|
|
124
|
-
)
|
|
125
|
-
)))
|
|
126
|
-
]),
|
|
127
|
-
_: 1
|
|
128
|
-
}, 8, ["file", "thumbnail"]),
|
|
129
|
-
e(o).type === "VOUCHER" ? (u(), I(j, { key: 0 }, [
|
|
130
|
-
ge,
|
|
131
|
-
n(me, {
|
|
132
|
-
"model-value": e(o).extras.effect,
|
|
133
|
-
"onUpdate:modelValue": t[3] || (t[3] = (r) => {
|
|
134
|
-
e(o).extras.effect = r;
|
|
135
|
-
})
|
|
136
|
-
}, null, 8, ["model-value"]),
|
|
137
|
-
e(o).extras.effect == null ? (u(), v(c, {
|
|
138
|
-
key: 0,
|
|
139
|
-
class: "!mt-8",
|
|
140
|
-
text: "Effect is required",
|
|
141
|
-
state: "error"
|
|
142
|
-
})) : U("", !0),
|
|
143
|
-
be,
|
|
144
|
-
n(de, {
|
|
145
|
-
"model-value": e(o).options,
|
|
146
|
-
"no-campaign": e(o).noCampaign,
|
|
147
|
-
"onUpdate:modelValue": t[4] || (t[4] = (r) => e(o).options = r),
|
|
148
|
-
schema: e(w).typeAtPath(e(l), "options", ["VOUCHER"])
|
|
149
|
-
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
150
|
-
], 64)) : U("", !0),
|
|
151
|
-
ve,
|
|
152
|
-
e(o).type === "VOUCHER" ? (u(), v(re, {
|
|
153
|
-
key: 1,
|
|
154
|
-
"model-value": ((G = (d = e(o).extras) == null ? void 0 : d.targetLocation) == null ? void 0 : G.map(String)) ?? null,
|
|
155
|
-
type: "select",
|
|
156
|
-
"onUpdate:modelValue": t[5] || (t[5] = (r) => {
|
|
157
|
-
e(o).extras.targetLocation = r;
|
|
158
|
-
}),
|
|
159
|
-
rules: [
|
|
160
|
-
e(w).ruleAtPath(e(l), "extras.targetLocation", ["VOUCHER"])
|
|
161
|
-
]
|
|
162
|
-
}, null, 8, ["model-value", "rules"])) : U("", !0),
|
|
163
|
-
n(R, {
|
|
164
|
-
modelValue: e(o).internal,
|
|
165
|
-
"onUpdate:modelValue": t[6] || (t[6] = (r) => e(o).internal = r),
|
|
166
|
-
"label-placement": "right",
|
|
167
|
-
label: "Internal only",
|
|
168
|
-
sublabel: `${e(_)[e(o).type].name} will not be shown to customer`
|
|
169
|
-
}, null, 8, ["modelValue", "sublabel"])
|
|
170
|
-
])) : U("", !0)
|
|
171
|
-
];
|
|
172
|
-
}),
|
|
173
|
-
_: 1
|
|
174
|
-
}, 8, ["modelValue"]);
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
}), Re = { class: "px-24 flex flex-col gap-y-16" }, Ce = { class: "flex items-center justify-between w-full" }, xe = { class: "flex gap-8" }, Fe = /* @__PURE__ */ s("img", {
|
|
178
|
-
src: Q,
|
|
179
|
-
class: "aspect-square w-[150px]"
|
|
180
|
-
}, null, -1), Ve = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
181
|
-
/* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create rewards"),
|
|
182
|
-
/* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Create rewards for your customers to redeem inside their bundle. ")
|
|
183
|
-
], -1), Ge = /* @__PURE__ */ Y({
|
|
184
|
-
__name: "StoreRewards",
|
|
185
|
-
setup(W) {
|
|
186
|
-
const O = {
|
|
187
|
-
label: "Create reward",
|
|
188
|
-
value: "create",
|
|
189
|
-
isPrimary: !0,
|
|
190
|
-
prependIcon: "add"
|
|
191
|
-
}, f = te(), { global: A, minor: S } = ee, h = pe(), i = V({
|
|
192
|
-
searchKey: "",
|
|
193
|
-
columnFilters: []
|
|
194
|
-
}), o = [
|
|
195
|
-
{
|
|
196
|
-
header: "Reward title",
|
|
197
|
-
accessorFn: (a) => a.name
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
id: "type",
|
|
201
|
-
header: "Reward type",
|
|
202
|
-
accessorFn: (a) => a.type,
|
|
203
|
-
cell(a) {
|
|
204
|
-
return _[a.row.original.type].chip();
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
header: "Validity",
|
|
209
|
-
accessorFn: (a) => ue(
|
|
210
|
-
"validityOption" in a.options ? a.options.validityOption || {} : {}
|
|
211
|
-
)
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
header: "Used",
|
|
215
|
-
meta: {
|
|
216
|
-
textAlign: "right"
|
|
217
|
-
},
|
|
218
|
-
accessorFn: (a) => a.currentReceive ?? 0
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
header: "Actions",
|
|
222
|
-
cell(a) {
|
|
223
|
-
return C("div", { class: "flex items-center justify-end gap-4" }, [
|
|
224
|
-
C(
|
|
225
|
-
$.FmMenu,
|
|
226
|
-
{
|
|
227
|
-
placement: "bottom-end",
|
|
228
|
-
onClick: (t) => {
|
|
229
|
-
t.stopPropagation();
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
"menu-button": () => C($.FmButton, {
|
|
234
|
-
icon: "more_vert",
|
|
235
|
-
iconColor: "neutral-gray-400",
|
|
236
|
-
variant: "tertiary"
|
|
237
|
-
}),
|
|
238
|
-
default: () => [
|
|
239
|
-
C($.FmMenuItem, {
|
|
240
|
-
label: "View collections",
|
|
241
|
-
onClick: async (t) => {
|
|
242
|
-
t.stopPropagation(), g(a.row.original._id);
|
|
243
|
-
}
|
|
244
|
-
}),
|
|
245
|
-
// h(components.FmMenuItem, {
|
|
246
|
-
// label: 'View transactions',
|
|
247
|
-
// onClick: async (event: Event) => {
|
|
248
|
-
// event.stopPropagation();
|
|
249
|
-
// onViewTransactions(props.row.original._id as string);
|
|
250
|
-
// },
|
|
251
|
-
// }),
|
|
252
|
-
C(
|
|
253
|
-
$.FmMenuItem,
|
|
254
|
-
{
|
|
255
|
-
onClick: async (t) => {
|
|
256
|
-
t.stopPropagation(), P(a.row.original);
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
label: C(
|
|
261
|
-
"div",
|
|
262
|
-
{
|
|
263
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
264
|
-
},
|
|
265
|
-
"Remove"
|
|
266
|
-
)
|
|
267
|
-
}
|
|
268
|
-
)
|
|
269
|
-
]
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
]);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
], y = N(
|
|
276
|
-
() => f.bundleRewards.filter((a) => a.type == "VOUCHER")
|
|
277
|
-
), l = V();
|
|
278
|
-
function g(a) {
|
|
279
|
-
h.push({
|
|
280
|
-
name: k["$connect-STORE_REWARD_COLLECTIONS"],
|
|
281
|
-
params: { id: a }
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
async function P(a) {
|
|
285
|
-
if (a.type === "TITLE") {
|
|
286
|
-
await M.confirm(
|
|
287
|
-
"You cannot remove a title here, please remove it at the Program > Title section.",
|
|
288
|
-
"Delete reward",
|
|
289
|
-
"Go to title section"
|
|
290
|
-
) && await h.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
await M.remove(
|
|
294
|
-
"Are you sure you want to delete this reward?",
|
|
295
|
-
"Delete reward"
|
|
296
|
-
) && await S(
|
|
297
|
-
async () => {
|
|
298
|
-
await D.deleteReward(a._id), await f.readMembership(), await f.readRewards();
|
|
299
|
-
},
|
|
300
|
-
{ message: "Deleting reward", successMessage: "Reward deleted" }
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
async function F(a) {
|
|
304
|
-
var m;
|
|
305
|
-
const t = a ? oe(f.bundleRewards.find((c) => c._id === a)) : void 0;
|
|
306
|
-
if ((t == null ? void 0 : t.type) === "TITLE") {
|
|
307
|
-
await M.confirm(
|
|
308
|
-
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
309
|
-
"Update reward",
|
|
310
|
-
"Go to title section"
|
|
311
|
-
) && await h.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
(m = l.value) == null || m.showSheet(!0, t, {
|
|
315
|
-
isStoreReward: !0,
|
|
316
|
-
type: "VOUCHER"
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
async function E(a) {
|
|
320
|
-
await S(
|
|
321
|
-
async () => {
|
|
322
|
-
var t, m, c, R;
|
|
323
|
-
(t = l.value) != null && t.rewardImage && a.image ? await B.delete(a.image) : (m = l.value) != null && m.rewardImage && (a.image = await B.update(
|
|
324
|
-
a.image || B.collectibleImagePath(
|
|
325
|
-
void 0,
|
|
326
|
-
l.value.rewardImage
|
|
327
|
-
),
|
|
328
|
-
(c = l.value) == null ? void 0 : c.rewardImage
|
|
329
|
-
)), a._id ? await D.updateReward(a._id, a) : await D.createReward(a), await f.readRewards(), (R = l.value) == null || R.showSheet(!1);
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
message: "Updating reward",
|
|
333
|
-
successMessage: "Reward updated successfully"
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
return Z(async () => {
|
|
338
|
-
await A(async () => {
|
|
339
|
-
await f.readMembership(), await f.readRewards();
|
|
340
|
-
});
|
|
341
|
-
}), (a, t) => {
|
|
342
|
-
const m = p("FmPageHead"), c = p("FmMenuItem"), R = p("FmSearch"), T = p("FmTable"), L = p("FmButton"), b = p("FmCard");
|
|
343
|
-
return u(), I(j, null, [
|
|
344
|
-
n(m, {
|
|
345
|
-
title: "Rewards",
|
|
346
|
-
description: "Create and manage rewards for your customers.",
|
|
347
|
-
actions: [O],
|
|
348
|
-
"back-button": !0,
|
|
349
|
-
"onClick:action": t[0] || (t[0] = () => F()),
|
|
350
|
-
"onClick:back": t[1] || (t[1] = () => e(h).push({ name: e(k)["$connect-STORE"] }))
|
|
351
|
-
}, null, 8, ["actions"]),
|
|
352
|
-
s("div", Re, [
|
|
353
|
-
e(y) && e(y).length > 0 ? (u(), I(j, { key: 0 }, [
|
|
354
|
-
s("div", Ce, [
|
|
355
|
-
s("div", xe, [
|
|
356
|
-
n(ne, {
|
|
357
|
-
label: `Reward type: ${e(i).columnFilters.length == 0 ? "All" : e(i).columnFilters[0].name}`
|
|
358
|
-
}, {
|
|
359
|
-
default: x(() => [
|
|
360
|
-
n(c, {
|
|
361
|
-
onClick: t[2] || (t[2] = (d) => e(i).columnFilters = []),
|
|
362
|
-
label: "All"
|
|
363
|
-
}),
|
|
364
|
-
n(c, {
|
|
365
|
-
onClick: t[3] || (t[3] = (d) => e(i).columnFilters = [
|
|
366
|
-
{
|
|
367
|
-
id: "type",
|
|
368
|
-
value: "VOUCHER",
|
|
369
|
-
name: e(_).VOUCHER.name
|
|
370
|
-
}
|
|
371
|
-
]),
|
|
372
|
-
label: e(_).VOUCHER.name
|
|
373
|
-
}, null, 8, ["label"]),
|
|
374
|
-
n(c, {
|
|
375
|
-
onClick: t[4] || (t[4] = (d) => e(i).columnFilters = [
|
|
376
|
-
{
|
|
377
|
-
id: "type",
|
|
378
|
-
value: "TITLE",
|
|
379
|
-
name: e(_).TITLE.name
|
|
380
|
-
}
|
|
381
|
-
]),
|
|
382
|
-
label: e(_).TITLE.name
|
|
383
|
-
}, null, 8, ["label"])
|
|
384
|
-
]),
|
|
385
|
-
_: 1
|
|
386
|
-
}, 8, ["label"])
|
|
387
|
-
]),
|
|
388
|
-
n(R, {
|
|
389
|
-
modelValue: e(i).searchKey,
|
|
390
|
-
"onUpdate:modelValue": t[5] || (t[5] = (d) => e(i).searchKey = d),
|
|
391
|
-
class: "",
|
|
392
|
-
placeholder: "search",
|
|
393
|
-
collapsible: ""
|
|
394
|
-
}, null, 8, ["modelValue"])
|
|
395
|
-
]),
|
|
396
|
-
n(T, {
|
|
397
|
-
"row-data": e(y),
|
|
398
|
-
"column-defs": o,
|
|
399
|
-
"search-value": e(i).searchKey,
|
|
400
|
-
"column-filter": e(i).columnFilters,
|
|
401
|
-
onRowClick: t[6] || (t[6] = (d) => F(d.original._id)),
|
|
402
|
-
"hide-footer": e(y).length < 10
|
|
403
|
-
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
404
|
-
], 64)) : (u(), v(b, {
|
|
405
|
-
key: 1,
|
|
406
|
-
variant: "outlined",
|
|
407
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
408
|
-
}, {
|
|
409
|
-
default: x(() => [
|
|
410
|
-
Fe,
|
|
411
|
-
Ve,
|
|
412
|
-
n(L, {
|
|
413
|
-
variant: "primary",
|
|
414
|
-
label: "Create reward",
|
|
415
|
-
onClick: t[7] || (t[7] = (d) => F()),
|
|
416
|
-
icon: "add"
|
|
417
|
-
})
|
|
418
|
-
]),
|
|
419
|
-
_: 1
|
|
420
|
-
})),
|
|
421
|
-
n(he, {
|
|
422
|
-
ref_key: "rewardSheetRef",
|
|
423
|
-
ref: l,
|
|
424
|
-
onUpdate: t[8] || (t[8] = (d) => E(d))
|
|
425
|
-
}, null, 512)
|
|
426
|
-
])
|
|
427
|
-
], 64);
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
export {
|
|
432
|
-
Ge as default
|
|
433
|
-
};
|
package/dist/number-BKGHLuLf.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { a } from "./app-BAgeAm1l.js";
|
|
2
|
-
function s(t) {
|
|
3
|
-
return a.DineroFactory(t).multiply(100).toFormat(!1);
|
|
4
|
-
}
|
|
5
|
-
function f(t, r = 2, o = !1) {
|
|
6
|
-
const e = parseFloat(String(t)).toFixed(r);
|
|
7
|
-
return o ? parseFloat(e).toString() : e;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
s as F,
|
|
11
|
-
f
|
|
12
|
-
};
|