@feedmepos/mf-connect 0.1.43-prod → 0.1.44-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-Dntnt0fF.js → Analytic-B0XiTFW0.js} +11 -11
- package/dist/{App-CHOFU1Jz.js → App-DYwp8qCw.js} +6 -6
- package/dist/{Bin-Bk0t3jxM.js → Bin-CP2Gnf8X.js} +8 -8
- package/dist/{Broadcast-BtK024dD.js → Broadcast-whyjKtYv.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DT4x4jwB.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsE4P6KH.js} +6 -6
- package/dist/{Card-C9MGjOMO.js → Card-SxPryyQO.js} +221 -215
- package/dist/{Collections-CEECHDqN.js → Collections-Dkf-TR25.js} +48 -43
- package/dist/{Credit-C4H9yYdS.js → Credit-Bj-7Jz42.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-HDclHVG3.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Awnb6_WY.js} +29 -29
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DO4xK2tT.js → EffectSheet.vue_vue_type_style_index_0_lang-bU1I3nrA.js} +6 -6
- package/dist/{Experience-D17hFUQY.js → Experience-B4E8LXJy.js} +9 -9
- package/dist/{Game-58AOq1-o.js → Game-Bi1DKKvm.js} +10 -10
- package/dist/{Index-CxfH49dx.js → Index-Cd29HQE2.js} +10 -10
- package/dist/{Marketing-BlHmRU-a.js → Marketing-BNFR4TEj.js} +6 -6
- package/dist/{Member-Doa4NehP.js → Member-BSOaSzY-.js} +10 -10
- package/dist/{MemberList-0_xt-Yv2.js → MemberList-B8YX0LEV.js} +25 -25
- package/dist/{MemberTransactions-DcApuet0.js → MemberTransactions-D1L8Oiq7.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-COqx4gFc.js → MessageInput.vue_vue_type_script_setup_true_lang-DYoBeQwx.js} +4 -4
- package/dist/{Mission-Bljlcj8U.js → Mission-VypLwqvF.js} +10 -10
- package/dist/{Overview-CjLx34_V.js → Overview-D0tAh1hu.js} +18 -18
- package/dist/{Point-DPMN2cVS.js → Point-BAINqz6M.js} +9 -9
- package/dist/{Promotion-CcW0JONj.js → Promotion-Dcsmyze_.js} +10 -10
- package/dist/{Queue-9CNq8YPn.js → Queue-CZYvfF1T.js} +10 -10
- package/dist/{Record-DqwobHok.js → Record-D9p7o-t8.js} +8 -8
- package/dist/{Reward-CKchPMUe.js → Reward-CQlPwXV4.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CT_CmIZ1.js → RewardGroup.vue_vue_type_script_setup_true_lang-DW7Oz7dA.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-uqWZM7ZL.js → RuleGroup.vue_vue_type_script_setup_true_lang-P_XFI4p0.js} +107 -106
- package/dist/{Segment-aPweVqa6.js → Segment-CvS_Eo3s.js} +22 -22
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DjnfzUgV.js → SelectItems.vue_vue_type_script_setup_true_lang-r0RuzF7M.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-2J82J14W.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BGpDmOf9.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-hXR1XY3M.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CiwY7ouv.js} +3 -3
- package/dist/{Setting-B5GyXqfd.js → Setting-BS3IVD60.js} +11 -11
- package/dist/{Store-Blng2G8Y.js → Store-C7DSctaq.js} +19 -19
- package/dist/{StoreRewards-CJ4kKR9x.js → StoreRewards-Dr79Mpc7.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CyY9fjCO.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CGX8BjZg.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-zFxvYEOh.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D9fIum70.js} +1 -1
- package/dist/{Tier-C4PHKEGC.js → Tier-rIK0FZuo.js} +232 -229
- package/dist/{Title-BrhEswAr.js → Title-x-uGaue9.js} +148 -145
- package/dist/{Transaction-DAhBTdXH.js → Transaction-DUF6Fv4u.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-2c_9dJsi.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-sTNrXsoh.js} +6 -6
- package/dist/{Voucher-Rev-6bc4.js → Voucher-DlDk466I.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-D03UO278.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BXfb3q80.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-ClTo7c3G.js → ZodTextField.vue_vue_type_script_setup_true_lang-HCNzyNOp.js} +1 -1
- package/dist/{app-BuOGd3Bd.js → app-DY9APO7j.js} +1 -1
- package/dist/{app-DpuLAEEW.js → app-DzUknT2x.js} +464 -456
- package/dist/app.js +1 -1
- package/dist/{business-PmDHqHNr.js → business-DjsjI4kp.js} +1 -1
- package/dist/{campaign-DklhiAHD.js → campaign-DfOj7zSn.js} +9 -9
- package/dist/{campaign-DgTDWhb7.js → campaign-ZjD3chey.js} +2 -2
- package/dist/{campaign.enum-CNDnLa_7.js → campaign.enum-D3xo6Cks.js} +1 -1
- package/dist/{campaign.fn-Y_XDriCr.js → campaign.fn-By1DHCjK.js} +73 -73
- package/dist/{collectible.enum-C4uj31PA.js → collectible.enum-BpR3ioUe.js} +1 -1
- package/dist/{collection.fn-Cd9ccr4X.js → collection.fn-CIymOVNk.js} +2 -2
- package/dist/{dto-BLVzaksW.js → dto-uRM5uaA_.js} +4 -4
- package/dist/{effect-Cpnw4ORB.js → effect-DSFeDhhJ.js} +1 -1
- package/dist/{email-addresses-DfiDKvhJ.js → email-addresses-B3pZNcNt.js} +1 -1
- package/dist/{export-CyK47IkS.js → export-B9WfSHAt.js} +3 -3
- package/dist/{helper-C9p1vGN7.js → helper-CCgGEtdx.js} +1 -1
- package/dist/{index-qs6-cLKZ.js → index-B06uxpDF.js} +3 -3
- package/dist/{index-DZJHHluy.js → index-B8Qg-Ixj.js} +3 -3
- package/dist/{index-B6U6_kuo.js → index-B9JaqqtM.js} +1 -1
- package/dist/{index-BZKTxq3Y.js → index-BLWIwW6r.js} +4 -4
- package/dist/{index-CG2wC3n0.js → index-BTszUs2N.js} +1 -1
- package/dist/{index-D9eT74aI.js → index-BeYLK0K2.js} +1 -1
- package/dist/{index-DiyB4SNM.js → index-BmS1egoc.js} +1 -1
- package/dist/{index-CUH9AsyR.js → index-BmWqCJCi.js} +1023 -1023
- package/dist/{index-8Gy0Dl8L.js → index-C5bUcLyZ.js} +1 -1
- package/dist/{index-1QNdFpM1.js → index-C7OvCzb4.js} +1 -1
- package/dist/{index-D7wvrHGo.js → index-CXLJaee4.js} +1 -1
- package/dist/{index-4BXZyuQq.js → index-JLJo07Rj.js} +1 -1
- package/dist/{index-BkbQao6U.js → index-lSAv8y7n.js} +11 -6
- package/dist/{index-COPP6zPr.js → index-v_4sk2U_.js} +2 -2
- package/dist/{index.esm2017-Bsxm-23w.js → index.esm2017-CJartb_e.js} +1 -1
- package/dist/{loading-BWXMWPjb.js → loading-C9v97WxS.js} +1 -1
- package/dist/{membership-DHxdu0Ae.js → membership-CXmxuzDB.js} +3 -3
- package/dist/{money-DQJFHif9.js → money-lLHkYDTU.js} +1 -1
- package/dist/{number-CGFxq5YY.js → number-BFT1IBUD.js} +1 -1
- package/dist/objectid-G0S1Z8UI.js +145 -0
- package/dist/{plugins-Meo3zVSp.js → plugins-D1scPye4.js} +2 -2
- package/dist/{reward-CxoJ_aE3.js → reward-clRs-T7e.js} +1 -1
- package/dist/{rule-CHe7g5oa.js → rule-CiPYLle-.js} +3 -3
- package/dist/{rule-builder-BvOWfz_d.js → rule-builder-Dip7ySqF.js} +1 -1
- package/dist/{template-DdlMfnh3.js → template-Cjft7Yxd.js} +4 -4
- package/dist/{trigger-w1O8AITh.js → trigger-CEHnWaQ7.js} +4 -4
- package/dist/{user-BCY85GjR.js → user-WVLA3bdA.js} +1 -1
- package/dist/{vue-i18n-CdIFM4CL.js → vue-i18n-h56mRikn.js} +273 -273
- package/dist/{xlsx-vzgdntd_.js → xlsx-SS9sL5Pj.js} +1 -1
- package/package.json +1 -1
- package/dist/objectid-CQ8OspqX.js +0 -145
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as y, computed as E, watch as
|
|
1
|
+
import { defineComponent as Z, ref as y, computed as E, watch as ne, onMounted as X, resolveComponent as v, openBlock as c, createBlock as F, unref as e, isRef as G, withCtx as C, createElementVNode as d, createVNode as i, createElementBlock as $, Fragment as z, renderList as H, createCommentVNode as k, normalizeClass as me, createSlots as ge, h as K, toDisplayString as te, withModifiers as be } from "vue";
|
|
2
2
|
import { _ as ve } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { h as oe } from "./moment-BWErdI6_.js";
|
|
4
|
-
import { useDialog as ye, components as
|
|
5
|
-
import "./index-
|
|
6
|
-
import { u as J } from "./loading-
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as W } from "./membership-
|
|
4
|
+
import { useDialog as ye, components as se } from "@feedmepos/ui-library";
|
|
5
|
+
import "./index-BmWqCJCi.js";
|
|
6
|
+
import { u as J } from "./loading-C9v97WxS.js";
|
|
7
|
+
import { u as ce } from "./app-wDQR6dpb.js";
|
|
8
|
+
import { u as W } from "./membership-CXmxuzDB.js";
|
|
9
9
|
import { _ as Q } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
|
|
10
|
-
import { p as
|
|
11
|
-
import { m as L } from "./index-
|
|
12
|
-
import { z as
|
|
13
|
-
import { Z as
|
|
14
|
-
import { _ as
|
|
15
|
-
import { k as
|
|
16
|
-
import "./index-
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import { O as
|
|
10
|
+
import { p as pe, f as ie, n as _e } from "./plugins-D1scPye4.js";
|
|
11
|
+
import { m as L } from "./index-BeYLK0K2.js";
|
|
12
|
+
import { z as re } from "./app-DzUknT2x.js";
|
|
13
|
+
import { Z as de } from "./zod-Bg2FbC-D.js";
|
|
14
|
+
import { _ as ue } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
15
|
+
import { k as he } from "./index-BLWIwW6r.js";
|
|
16
|
+
import "./index-v_4sk2U_.js";
|
|
17
|
+
import "./index-lSAv8y7n.js";
|
|
18
|
+
import "./index-C5bUcLyZ.js";
|
|
19
|
+
import "./index-B8Qg-Ixj.js";
|
|
20
|
+
import { O as xe } from "./objectid-G0S1Z8UI.js";
|
|
21
21
|
import { a as Ce, c as Se } from "./object-qECH92oz.js";
|
|
22
|
-
import { u as we } from "./business-
|
|
23
|
-
import { w as ke } from "./xlsx-
|
|
24
|
-
import { a as Fe, C as Ve } from "./export-
|
|
22
|
+
import { u as we } from "./business-DjsjI4kp.js";
|
|
23
|
+
import { w as ke } from "./xlsx-SS9sL5Pj.js";
|
|
24
|
+
import { a as Fe, C as Ve } from "./export-B9WfSHAt.js";
|
|
25
25
|
import { u as $e, _ as Me } from "./usePagination-JoYaROkV.js";
|
|
26
|
-
import { u as Be } from "./vue-i18n-
|
|
26
|
+
import { u as Be } from "./vue-i18n-h56mRikn.js";
|
|
27
27
|
import { o as Ue } from "./objectId-dwaoBfJX.js";
|
|
28
|
-
const
|
|
28
|
+
const Ae = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number type", -1), De = { class: "space-y-16" }, Ie = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number Settings", -1), Ne = { class: "gap-16 grid grid-cols-2" }, Pe = { class: "space-y-16" }, Re = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Card Settings", -1), qe = {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: "flex flex-col gap-[16px] w-full"
|
|
31
31
|
}, ze = { class: "flex flex-col gap-[8px]" }, Ee = /* @__PURE__ */ d("p", { class: "fm-typo-en-title-sm-800" }, "Design preview", -1), je = ["src"], Te = { class: "flex pt-[24px] gap-[24px]" }, Le = ["src", "onClick", "alt"], Oe = { class: "flex items-center gap-8" }, Ye = /* @__PURE__ */ Z({
|
|
32
32
|
__name: "CreateCardSheet",
|
|
33
33
|
emits: ["success", "export"],
|
|
34
34
|
setup(ee, { expose: j, emit: T }) {
|
|
35
|
-
const { minor:
|
|
36
|
-
function B(
|
|
37
|
-
|
|
35
|
+
const { minor: D } = J, g = W(), M = y(), _ = y(!1), w = T, n = y(!1);
|
|
36
|
+
function B(m) {
|
|
37
|
+
n.value = m, m && (o.value = {
|
|
38
38
|
quantity: 1,
|
|
39
39
|
code: "",
|
|
40
40
|
codeConfig: {
|
|
41
|
-
length:
|
|
41
|
+
length: 16,
|
|
42
42
|
charset: "1234567890",
|
|
43
43
|
prefix: "",
|
|
44
44
|
suffix: "",
|
|
@@ -46,11 +46,11 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const o = y({
|
|
50
50
|
quantity: 1,
|
|
51
51
|
code: "",
|
|
52
52
|
codeConfig: {
|
|
53
|
-
length:
|
|
53
|
+
length: 16,
|
|
54
54
|
charset: "1234567890",
|
|
55
55
|
prefix: "",
|
|
56
56
|
suffix: "",
|
|
@@ -69,7 +69,7 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
69
69
|
value: "single",
|
|
70
70
|
sublabel: "Enter your own custom number"
|
|
71
71
|
}
|
|
72
|
-
],
|
|
72
|
+
], A = [
|
|
73
73
|
{
|
|
74
74
|
label: "Alphanumeric",
|
|
75
75
|
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
@@ -82,27 +82,27 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
82
82
|
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
83
83
|
{ label: "Numbers", value: "0123456789" },
|
|
84
84
|
{ label: "Custom", value: "" }
|
|
85
|
-
], I = y(
|
|
85
|
+
], I = y(A[0].value), S = y("bulk"), h = y(0), s = E(
|
|
86
86
|
() => {
|
|
87
|
-
var
|
|
88
|
-
return (
|
|
87
|
+
var m;
|
|
88
|
+
return (m = g.membership.design) == null ? void 0 : m[h.value];
|
|
89
89
|
}
|
|
90
90
|
), u = y(!1), r = E(
|
|
91
|
-
() => g.sortedStoreCategories.flatMap((
|
|
91
|
+
() => g.sortedStoreCategories.flatMap((m) => m.bundles)
|
|
92
92
|
);
|
|
93
|
-
async function b(
|
|
93
|
+
async function b(m) {
|
|
94
94
|
var l, V;
|
|
95
95
|
if (await ((l = M.value) == null ? void 0 : l.validateInputs()), !_.value) return;
|
|
96
|
-
|
|
97
|
-
const t = await
|
|
96
|
+
m.design = (V = s.value) == null ? void 0 : V.image;
|
|
97
|
+
const t = await pe.confirm(
|
|
98
98
|
"",
|
|
99
99
|
"Do you want to export generated card(s)?",
|
|
100
100
|
"Export",
|
|
101
101
|
"Generate and without export"
|
|
102
102
|
);
|
|
103
|
-
console.log(t), await
|
|
103
|
+
console.log(t), await D(
|
|
104
104
|
async () => {
|
|
105
|
-
const U = await L.createCards(
|
|
105
|
+
const U = await L.createCards(m);
|
|
106
106
|
console.log(U), await w("success"), t && await w("export", U);
|
|
107
107
|
},
|
|
108
108
|
{
|
|
@@ -113,37 +113,42 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
113
113
|
}
|
|
114
114
|
return j({
|
|
115
115
|
showSheet: B
|
|
116
|
-
}),
|
|
117
|
-
() =>
|
|
118
|
-
(
|
|
119
|
-
|
|
116
|
+
}), ne(
|
|
117
|
+
() => o.value.codeConfig.length,
|
|
118
|
+
(m, t) => {
|
|
119
|
+
m != t && (o.value.codeConfig.pattern = "#".repeat(Number(m)));
|
|
120
|
+
}
|
|
121
|
+
), ne(
|
|
122
|
+
() => o.value.codeConfig.pattern,
|
|
123
|
+
(m, t) => {
|
|
124
|
+
m != t && (o.value.codeConfig.length = (o.value.codeConfig.pattern.match(/#/g) || []).length);
|
|
120
125
|
}
|
|
121
126
|
), X(async () => {
|
|
122
127
|
await g.readMemberStore();
|
|
123
|
-
}), (
|
|
124
|
-
const l = v("FmRadio"), V = v("FmRadioGroup"), U = v("FmSwitch"), f = v("FmStepperField"), N = v("FmSelect"), q = v("FmTextField"),
|
|
125
|
-
return
|
|
128
|
+
}), (m, t) => {
|
|
129
|
+
const l = v("FmRadio"), V = v("FmRadioGroup"), U = v("FmSwitch"), f = v("FmStepperField"), N = v("FmSelect"), q = v("FmTextField"), x = v("FmTextarea"), P = v("FmButton"), O = v("FmForm"), fe = v("FmSideSheet");
|
|
130
|
+
return c(), F(fe, {
|
|
126
131
|
"max-width": 560,
|
|
127
132
|
"dismiss-away": !0,
|
|
128
133
|
header: "Create collection",
|
|
129
|
-
modelValue: e(
|
|
134
|
+
modelValue: e(n),
|
|
130
135
|
"onUpdate:modelValue": [
|
|
131
|
-
t[19] || (t[19] = (R) => G(
|
|
132
|
-
t[20] || (t[20] = (R) =>
|
|
136
|
+
t[19] || (t[19] = (R) => G(n) ? n.value = R : null),
|
|
137
|
+
t[20] || (t[20] = (R) => n.value = R)
|
|
133
138
|
]
|
|
134
139
|
}, {
|
|
135
140
|
"side-sheet-footer": C(() => [
|
|
136
141
|
d("div", Oe, [
|
|
137
142
|
i(P, {
|
|
138
143
|
label: "Save",
|
|
139
|
-
onClick: t[17] || (t[17] = (R) => b(e(
|
|
140
|
-
loading: e(
|
|
144
|
+
onClick: t[17] || (t[17] = (R) => b(e(o))),
|
|
145
|
+
loading: e(ce)().isLoading
|
|
141
146
|
}, null, 8, ["loading"]),
|
|
142
147
|
i(P, {
|
|
143
148
|
label: "Cancel",
|
|
144
149
|
type: "button",
|
|
145
150
|
variant: "tertiary",
|
|
146
|
-
onClick: t[18] || (t[18] = (R) =>
|
|
151
|
+
onClick: t[18] || (t[18] = (R) => n.value = !1)
|
|
147
152
|
})
|
|
148
153
|
])
|
|
149
154
|
]),
|
|
@@ -159,14 +164,14 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
159
164
|
var R, le, ae;
|
|
160
165
|
return [
|
|
161
166
|
d("div", null, [
|
|
162
|
-
|
|
167
|
+
Ae,
|
|
163
168
|
i(V, {
|
|
164
169
|
modelValue: e(S),
|
|
165
170
|
"onUpdate:modelValue": t[0] || (t[0] = (a) => G(S) ? S.value = a : null),
|
|
166
171
|
inline: !1
|
|
167
172
|
}, {
|
|
168
173
|
default: C(() => [
|
|
169
|
-
(
|
|
174
|
+
(c(), $(z, null, H(p, (a) => i(l, {
|
|
170
175
|
key: a.value,
|
|
171
176
|
value: a.value,
|
|
172
177
|
label: a.label,
|
|
@@ -176,9 +181,9 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
176
181
|
_: 1
|
|
177
182
|
}, 8, ["modelValue"])
|
|
178
183
|
]),
|
|
179
|
-
d("div",
|
|
184
|
+
d("div", De, [
|
|
180
185
|
Ie,
|
|
181
|
-
e(S) === "bulk" ? (
|
|
186
|
+
e(S) === "bulk" ? (c(), $(z, { key: 0 }, [
|
|
182
187
|
i(U, {
|
|
183
188
|
"model-value": e(u),
|
|
184
189
|
"label-placement": "right",
|
|
@@ -187,10 +192,10 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
187
192
|
required: !0,
|
|
188
193
|
"onUpdate:modelValue": t[1] || (t[1] = () => u.value = !e(u))
|
|
189
194
|
}, null, 8, ["model-value"]),
|
|
190
|
-
e(u) ? (
|
|
195
|
+
e(u) ? (c(), $(z, { key: 0 }, [
|
|
191
196
|
i(f, {
|
|
192
|
-
"model-value": e(
|
|
193
|
-
"onUpdate:modelValue": t[2] || (t[2] = (a) => e(
|
|
197
|
+
"model-value": e(o).codeConfig.length || null,
|
|
198
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => e(o).codeConfig.length = a),
|
|
194
199
|
label: "Code length",
|
|
195
200
|
rules: [(a) => Number(a) >= 1 || "Code length must at least 1"],
|
|
196
201
|
required: !0
|
|
@@ -198,54 +203,54 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
198
203
|
i(N, {
|
|
199
204
|
label: "Charset",
|
|
200
205
|
"model-value": e(I),
|
|
201
|
-
items:
|
|
202
|
-
"helper-text": e(
|
|
206
|
+
items: A,
|
|
207
|
+
"helper-text": e(o).codeConfig.charset.length > 62 ? `${e(o).codeConfig.charset.substring(0, 62)}...` : e(o).codeConfig.charset,
|
|
203
208
|
"onUpdate:modelValue": t[3] || (t[3] = (a) => {
|
|
204
|
-
I.value = a, e(
|
|
209
|
+
I.value = a, e(o).codeConfig.charset = a;
|
|
205
210
|
})
|
|
206
211
|
}, null, 8, ["model-value", "helper-text"]),
|
|
207
|
-
e(I) === "" ? (
|
|
212
|
+
e(I) === "" ? (c(), F(q, {
|
|
208
213
|
key: 0,
|
|
209
|
-
modelValue: e(
|
|
210
|
-
"onUpdate:modelValue": t[4] || (t[4] = (a) => e(
|
|
214
|
+
modelValue: e(o).codeConfig.charset,
|
|
215
|
+
"onUpdate:modelValue": t[4] || (t[4] = (a) => e(o).codeConfig.charset = a),
|
|
211
216
|
label: "Custom Charset",
|
|
212
217
|
required: ""
|
|
213
218
|
}, null, 8, ["modelValue"])) : k("", !0),
|
|
214
219
|
d("div", Ne, [
|
|
215
220
|
i(q, {
|
|
216
|
-
modelValue: e(
|
|
217
|
-
"onUpdate:modelValue": t[5] || (t[5] = (a) => e(
|
|
221
|
+
modelValue: e(o).codeConfig.prefix,
|
|
222
|
+
"onUpdate:modelValue": t[5] || (t[5] = (a) => e(o).codeConfig.prefix = a),
|
|
218
223
|
label: "Prefix (Optional)"
|
|
219
224
|
}, null, 8, ["modelValue"]),
|
|
220
225
|
i(q, {
|
|
221
|
-
modelValue: e(
|
|
222
|
-
"onUpdate:modelValue": t[6] || (t[6] = (a) => e(
|
|
226
|
+
modelValue: e(o).codeConfig.suffix,
|
|
227
|
+
"onUpdate:modelValue": t[6] || (t[6] = (a) => e(o).codeConfig.suffix = a),
|
|
223
228
|
label: "Suffix (Optional)"
|
|
224
229
|
}, null, 8, ["modelValue"])
|
|
225
230
|
]),
|
|
226
231
|
i(q, {
|
|
227
|
-
modelValue: e(
|
|
228
|
-
"onUpdate:modelValue": t[7] || (t[7] = (a) => e(
|
|
232
|
+
modelValue: e(o).codeConfig.pattern,
|
|
233
|
+
"onUpdate:modelValue": t[7] || (t[7] = (a) => e(o).codeConfig.pattern = a),
|
|
229
234
|
label: "Pattern",
|
|
230
235
|
required: !0
|
|
231
236
|
}, null, 8, ["modelValue"])
|
|
232
237
|
], 64)) : k("", !0),
|
|
233
238
|
i(q, {
|
|
234
|
-
modelValue: e(
|
|
235
|
-
"onUpdate:modelValue": t[8] || (t[8] = (a) => e(
|
|
239
|
+
modelValue: e(o).quantity,
|
|
240
|
+
"onUpdate:modelValue": t[8] || (t[8] = (a) => e(o).quantity = a),
|
|
236
241
|
label: "Number of code",
|
|
237
242
|
rules: [
|
|
238
243
|
(a) => a >= 1 || "Quantity cannot be less than 1",
|
|
239
244
|
(a) => a <= 1e4 || "Quantity cannot more than 10,000"
|
|
240
245
|
],
|
|
241
246
|
required: !0,
|
|
242
|
-
"helper-text": `${e(
|
|
247
|
+
"helper-text": `${e(o).quantity} card will be created`
|
|
243
248
|
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
244
249
|
], 64)) : k("", !0),
|
|
245
|
-
e(S) !== "bulk" ? (
|
|
250
|
+
e(S) !== "bulk" ? (c(), F(x, {
|
|
246
251
|
key: 1,
|
|
247
|
-
modelValue: e(
|
|
248
|
-
"onUpdate:modelValue": t[9] || (t[9] = (a) => e(
|
|
252
|
+
modelValue: e(o).code,
|
|
253
|
+
"onUpdate:modelValue": t[9] || (t[9] = (a) => e(o).code = a),
|
|
249
254
|
label: "Custom Card Number",
|
|
250
255
|
rules: [(a) => e(S) != "single" || !!a || "Custom code is required"],
|
|
251
256
|
placeholder: "(For multiple numbers, please enter in the new row.)"
|
|
@@ -256,58 +261,59 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
256
261
|
i(U, {
|
|
257
262
|
"label-placement": "right",
|
|
258
263
|
label: "Set card number on bind",
|
|
259
|
-
|
|
260
|
-
"
|
|
264
|
+
sublabel: "Automatically set the card number when the user binds the card",
|
|
265
|
+
"model-value": e(o).setCardOnBind || !1,
|
|
266
|
+
"onUpdate:modelValue": t[10] || (t[10] = (a) => e(o).setCardOnBind = a)
|
|
261
267
|
}, null, 8, ["model-value"]),
|
|
262
268
|
i(Q, {
|
|
263
269
|
label: "Activate bundle on bind",
|
|
264
270
|
placeholder: "Select bundle",
|
|
265
271
|
items: e(r).filter((a) => !a.stripePriceId).map((a) => ({ label: a.name, value: a._id })),
|
|
266
|
-
modelValue: e(
|
|
267
|
-
"onUpdate:modelValue": t[12] || (t[12] = (a) => e(
|
|
272
|
+
modelValue: e(o).bundle,
|
|
273
|
+
"onUpdate:modelValue": t[12] || (t[12] = (a) => e(o).bundle = a)
|
|
268
274
|
}, {
|
|
269
275
|
append: C(() => [
|
|
270
|
-
e(
|
|
276
|
+
e(o).bundle ? (c(), F(P, {
|
|
271
277
|
key: 0,
|
|
272
278
|
icon: "link_off",
|
|
273
279
|
variant: "plain",
|
|
274
|
-
onClick: t[11] || (t[11] = (a) => e(
|
|
280
|
+
onClick: t[11] || (t[11] = (a) => e(o).bundle = void 0)
|
|
275
281
|
})) : k("", !0)
|
|
276
282
|
]),
|
|
277
283
|
_: 1
|
|
278
284
|
}, 8, ["items", "modelValue"]),
|
|
279
|
-
(le = (R = e(g).store) == null ? void 0 : R.stripe) != null && le.apiKey ? (
|
|
285
|
+
(le = (R = e(g).store) == null ? void 0 : R.stripe) != null && le.apiKey ? (c(), F(Q, {
|
|
280
286
|
key: 0,
|
|
281
287
|
label: "Linked subscription bundle",
|
|
282
288
|
placeholder: "Select bundle",
|
|
283
289
|
items: e(r).filter((a) => a.stripePriceId).map((a) => ({ label: a.name, value: a._id })),
|
|
284
|
-
modelValue: e(
|
|
285
|
-
"onUpdate:modelValue": t[14] || (t[14] = (a) => e(
|
|
290
|
+
modelValue: e(o).subscriptionBundle,
|
|
291
|
+
"onUpdate:modelValue": t[14] || (t[14] = (a) => e(o).subscriptionBundle = a)
|
|
286
292
|
}, {
|
|
287
293
|
append: C(() => [
|
|
288
|
-
e(
|
|
294
|
+
e(o).subscriptionBundle ? (c(), F(P, {
|
|
289
295
|
key: 0,
|
|
290
296
|
icon: "link_off",
|
|
291
297
|
variant: "plain",
|
|
292
|
-
onClick: t[13] || (t[13] = (a) => e(
|
|
298
|
+
onClick: t[13] || (t[13] = (a) => e(o).subscriptionBundle = void 0)
|
|
293
299
|
})) : k("", !0)
|
|
294
300
|
]),
|
|
295
301
|
_: 1
|
|
296
302
|
}, 8, ["items", "modelValue"])) : k("", !0)
|
|
297
303
|
]),
|
|
298
|
-
e(g).membership.design ? (
|
|
304
|
+
e(g).membership.design ? (c(), $("div", qe, [
|
|
299
305
|
d("div", ze, [
|
|
300
306
|
Ee,
|
|
301
307
|
d("img", {
|
|
302
|
-
src: (ae = e(
|
|
308
|
+
src: (ae = e(s)) == null ? void 0 : ae.image,
|
|
303
309
|
class: "aspect-[16/9]"
|
|
304
310
|
}, null, 8, je),
|
|
305
311
|
d("div", Te, [
|
|
306
|
-
(
|
|
312
|
+
(c(!0), $(z, null, H(e(g).membership.design, (a, Y) => (c(), $("img", {
|
|
307
313
|
src: a.image,
|
|
308
314
|
key: `image_${Y}`,
|
|
309
|
-
class:
|
|
310
|
-
onClick: (bt) =>
|
|
315
|
+
class: me(["w-[112px] h-[63px] cursor-pointer", `${e(h) === Y ? "border-[2px] border-fm-color-primary" : ""}`]),
|
|
316
|
+
onClick: (bt) => h.value = Y,
|
|
311
317
|
alt: `ai_image_predict_${Y}`,
|
|
312
318
|
style: { objectFit: "cover" }
|
|
313
319
|
}, null, 10, Le))), 128))
|
|
@@ -330,32 +336,32 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
330
336
|
__name: "EditCardSheet",
|
|
331
337
|
emits: ["success"],
|
|
332
338
|
setup(ee, { expose: j, emit: T }) {
|
|
333
|
-
const { minor:
|
|
339
|
+
const { minor: D } = J, g = W(), M = y(), _ = y(!1), w = T, n = y({
|
|
334
340
|
_id: "",
|
|
335
341
|
business: "",
|
|
336
342
|
serialNumber: ""
|
|
337
343
|
}), B = y(!1);
|
|
338
|
-
function
|
|
344
|
+
function o(h, s) {
|
|
339
345
|
var u;
|
|
340
|
-
B.value =
|
|
341
|
-
(r) => r.image ===
|
|
346
|
+
B.value = h, h && s && (n.value = s, p.value = (u = g.membership.design) == null ? void 0 : u.findIndex(
|
|
347
|
+
(r) => r.image === s.design
|
|
342
348
|
));
|
|
343
349
|
}
|
|
344
|
-
const p = y(0),
|
|
350
|
+
const p = y(0), A = E(
|
|
345
351
|
() => {
|
|
346
|
-
var
|
|
347
|
-
return (
|
|
352
|
+
var h;
|
|
353
|
+
return (h = g.membership.design) == null ? void 0 : h[p.value];
|
|
348
354
|
}
|
|
349
355
|
), I = E(
|
|
350
356
|
() => g.sortedStoreCategories.flatMap(
|
|
351
|
-
(
|
|
357
|
+
(h) => h.bundles
|
|
352
358
|
)
|
|
353
359
|
);
|
|
354
|
-
async function S(
|
|
355
|
-
var
|
|
356
|
-
await ((
|
|
360
|
+
async function S(h) {
|
|
361
|
+
var s, u;
|
|
362
|
+
await ((s = M.value) == null ? void 0 : s.validateInputs()), _.value && (h.design = (u = A.value) == null ? void 0 : u.image, await D(
|
|
357
363
|
async () => {
|
|
358
|
-
await L.updateCard(
|
|
364
|
+
await L.updateCard(h), await w("success");
|
|
359
365
|
},
|
|
360
366
|
{
|
|
361
367
|
message: "Updating card",
|
|
@@ -364,57 +370,57 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
364
370
|
));
|
|
365
371
|
}
|
|
366
372
|
return j({
|
|
367
|
-
showSheet:
|
|
373
|
+
showSheet: o
|
|
368
374
|
}), X(async () => {
|
|
369
375
|
await g.readMemberStore();
|
|
370
|
-
}), (
|
|
371
|
-
const u = v("FmTextField"), r = v("FmSwitch"), b = v("FmButton"),
|
|
372
|
-
return
|
|
376
|
+
}), (h, s) => {
|
|
377
|
+
const u = v("FmTextField"), r = v("FmSwitch"), b = v("FmButton"), m = v("FmForm"), t = v("FmSideSheet");
|
|
378
|
+
return c(), F(t, {
|
|
373
379
|
"max-width": 560,
|
|
374
380
|
"dismiss-away": !0,
|
|
375
381
|
header: "Edit card",
|
|
376
382
|
modelValue: e(B),
|
|
377
383
|
"onUpdate:modelValue": [
|
|
378
|
-
|
|
379
|
-
|
|
384
|
+
s[10] || (s[10] = (l) => G(B) ? B.value = l : null),
|
|
385
|
+
s[11] || (s[11] = (l) => B.value = l)
|
|
380
386
|
]
|
|
381
387
|
}, {
|
|
382
388
|
"side-sheet-footer": C(() => [
|
|
383
389
|
d("div", et, [
|
|
384
390
|
i(b, {
|
|
385
391
|
label: "Save",
|
|
386
|
-
disabled: !!e(
|
|
387
|
-
onClick:
|
|
388
|
-
loading: e(
|
|
392
|
+
disabled: !!e(n).redeemedAt,
|
|
393
|
+
onClick: s[8] || (s[8] = (l) => S(e(n))),
|
|
394
|
+
loading: e(ce)().isLoading
|
|
389
395
|
}, null, 8, ["disabled", "loading"]),
|
|
390
396
|
i(b, {
|
|
391
397
|
label: "Cancel",
|
|
392
398
|
type: "button",
|
|
393
399
|
variant: "tertiary",
|
|
394
|
-
onClick:
|
|
400
|
+
onClick: s[9] || (s[9] = (l) => B.value = !1)
|
|
395
401
|
})
|
|
396
402
|
])
|
|
397
403
|
]),
|
|
398
404
|
default: C(() => [
|
|
399
|
-
i(
|
|
405
|
+
i(m, {
|
|
400
406
|
ref_key: "form",
|
|
401
407
|
ref: M,
|
|
402
408
|
class: "space-y-40",
|
|
403
|
-
onValidationSuccess:
|
|
404
|
-
onValidationFailed:
|
|
409
|
+
onValidationSuccess: s[6] || (s[6] = (l) => _.value = !0),
|
|
410
|
+
onValidationFailed: s[7] || (s[7] = (l) => _.value = !1)
|
|
405
411
|
}, {
|
|
406
412
|
default: C(() => {
|
|
407
413
|
var l, V, U;
|
|
408
414
|
return [
|
|
409
415
|
d("div", Ke, [
|
|
410
416
|
i(u, {
|
|
411
|
-
modelValue: e(
|
|
412
|
-
"onUpdate:modelValue":
|
|
417
|
+
modelValue: e(n).serialNumber,
|
|
418
|
+
"onUpdate:modelValue": s[0] || (s[0] = (f) => e(n).serialNumber = f),
|
|
413
419
|
label: "Card Number",
|
|
414
420
|
rules: [
|
|
415
|
-
e(
|
|
416
|
-
e(
|
|
417
|
-
e(
|
|
421
|
+
e(de).toRule(e(re).string().min(1, "Card number is required")),
|
|
422
|
+
e(de).toRule(
|
|
423
|
+
e(re).string().max(50, "Card number must be less than 50 characters")
|
|
418
424
|
)
|
|
419
425
|
],
|
|
420
426
|
required: !0
|
|
@@ -423,57 +429,57 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
423
429
|
i(r, {
|
|
424
430
|
"label-placement": "right",
|
|
425
431
|
label: "Set card number on bind",
|
|
426
|
-
"model-value": e(
|
|
427
|
-
"onUpdate:modelValue":
|
|
432
|
+
"model-value": e(n).setCardOnBind || !1,
|
|
433
|
+
"onUpdate:modelValue": s[1] || (s[1] = (f) => e(n).setCardOnBind = f)
|
|
428
434
|
}, null, 8, ["model-value"]),
|
|
429
435
|
i(Q, {
|
|
430
436
|
label: "Activate bundle on bind",
|
|
431
437
|
placeholder: "Select bundle",
|
|
432
438
|
items: e(I).filter((f) => !f.stripePriceId).map((f) => ({ label: f.name, value: f._id })),
|
|
433
|
-
modelValue: e(
|
|
434
|
-
"onUpdate:modelValue":
|
|
439
|
+
modelValue: e(n).bundle,
|
|
440
|
+
"onUpdate:modelValue": s[3] || (s[3] = (f) => e(n).bundle = f)
|
|
435
441
|
}, {
|
|
436
442
|
append: C(() => [
|
|
437
|
-
e(
|
|
443
|
+
e(n).bundle ? (c(), F(b, {
|
|
438
444
|
key: 0,
|
|
439
445
|
icon: "link_off",
|
|
440
446
|
variant: "plain",
|
|
441
|
-
onClick:
|
|
447
|
+
onClick: s[2] || (s[2] = (f) => e(n).bundle = null)
|
|
442
448
|
})) : k("", !0)
|
|
443
449
|
]),
|
|
444
450
|
_: 1
|
|
445
451
|
}, 8, ["items", "modelValue"]),
|
|
446
|
-
(V = (l = e(g).store) == null ? void 0 : l.stripe) != null && V.apiKey ? (
|
|
452
|
+
(V = (l = e(g).store) == null ? void 0 : l.stripe) != null && V.apiKey ? (c(), F(Q, {
|
|
447
453
|
key: 0,
|
|
448
454
|
label: "Linked subscription bundle",
|
|
449
455
|
placeholder: "Select bundle",
|
|
450
456
|
items: e(I).filter((f) => f.stripePriceId).map((f) => ({ label: f.name, value: f._id })),
|
|
451
|
-
modelValue: e(
|
|
452
|
-
"onUpdate:modelValue":
|
|
457
|
+
modelValue: e(n).subscriptionBundle,
|
|
458
|
+
"onUpdate:modelValue": s[5] || (s[5] = (f) => e(n).subscriptionBundle = f)
|
|
453
459
|
}, {
|
|
454
460
|
append: C(() => [
|
|
455
|
-
e(
|
|
461
|
+
e(n).subscriptionBundle ? (c(), F(b, {
|
|
456
462
|
key: 0,
|
|
457
463
|
icon: "link_off",
|
|
458
464
|
variant: "plain",
|
|
459
|
-
onClick:
|
|
465
|
+
onClick: s[4] || (s[4] = (f) => e(n).subscriptionBundle = null)
|
|
460
466
|
})) : k("", !0)
|
|
461
467
|
]),
|
|
462
468
|
_: 1
|
|
463
469
|
}, 8, ["items", "modelValue"])) : k("", !0)
|
|
464
470
|
]),
|
|
465
|
-
e(g).membership.design ? (
|
|
471
|
+
e(g).membership.design ? (c(), $("div", He, [
|
|
466
472
|
d("div", Qe, [
|
|
467
473
|
Ze,
|
|
468
474
|
d("img", {
|
|
469
|
-
src: (U = e(
|
|
475
|
+
src: (U = e(A)) == null ? void 0 : U.image,
|
|
470
476
|
class: "aspect-[16/9]"
|
|
471
477
|
}, null, 8, Xe),
|
|
472
478
|
d("div", Je, [
|
|
473
|
-
(
|
|
479
|
+
(c(!0), $(z, null, H(e(g).membership.design, (f, N) => (c(), $("img", {
|
|
474
480
|
src: f.image,
|
|
475
481
|
key: `image_${N}`,
|
|
476
|
-
class:
|
|
482
|
+
class: me(["w-[112px] h-[63px] cursor-pointer", `${e(p) === N ? "border-[2px] border-fm-color-primary" : ""}`]),
|
|
477
483
|
onClick: (q) => p.value = N,
|
|
478
484
|
alt: `ai_image_predict_${N}`,
|
|
479
485
|
style: { objectFit: "cover" }
|
|
@@ -493,43 +499,43 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
493
499
|
}), lt = {
|
|
494
500
|
key: 0,
|
|
495
501
|
class: "grid grid-cols-1 gap-8"
|
|
496
|
-
}, at = { class: "flex items-center gap-8" },
|
|
502
|
+
}, at = { class: "flex items-center gap-8" }, nt = { class: "flex items-center gap-8" }, ot = 5, st = /* @__PURE__ */ Z({
|
|
497
503
|
__name: "CardDesignSheet",
|
|
498
504
|
emits: ["success"],
|
|
499
505
|
setup(ee, { expose: j, emit: T }) {
|
|
500
|
-
const { minor:
|
|
506
|
+
const { minor: D } = J, g = W(), M = ye(), _ = y(!1);
|
|
501
507
|
y(), y(!1);
|
|
502
|
-
const w = y(),
|
|
508
|
+
const w = y(), n = y(null);
|
|
503
509
|
E(() => {
|
|
504
510
|
var u, r;
|
|
505
|
-
return Math.min((((r = (u = w.value) == null ? void 0 : u.design) == null ? void 0 : r.length) ?? 0) + 1,
|
|
511
|
+
return Math.min((((r = (u = w.value) == null ? void 0 : u.design) == null ? void 0 : r.length) ?? 0) + 1, ot);
|
|
506
512
|
});
|
|
507
|
-
const B = T,
|
|
513
|
+
const B = T, o = E(() => {
|
|
508
514
|
var u, r;
|
|
509
515
|
return ((r = (u = g.membership) == null ? void 0 : u.design) == null ? void 0 : r.filter((b) => b.image)) || [];
|
|
510
516
|
}), p = y(!1);
|
|
511
|
-
function
|
|
517
|
+
function A(u) {
|
|
512
518
|
p.value = u;
|
|
513
519
|
}
|
|
514
520
|
function I() {
|
|
515
521
|
_.value = !0;
|
|
516
522
|
}
|
|
517
523
|
async function S() {
|
|
518
|
-
await
|
|
524
|
+
await D(
|
|
519
525
|
async () => {
|
|
520
526
|
var b;
|
|
521
|
-
const u = Ce(w.value), r =
|
|
522
|
-
if (r.design = (r == null ? void 0 : r.design) || [],
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
527
|
+
const u = Ce(w.value), r = he.parse(u);
|
|
528
|
+
if (r.design = (r == null ? void 0 : r.design) || [], n.value) {
|
|
529
|
+
const m = xe().toHexString(), t = await ie.update(
|
|
530
|
+
ie.designPath(m, n.value),
|
|
531
|
+
n.value
|
|
526
532
|
);
|
|
527
533
|
(b = r.design) == null || b.push({
|
|
528
|
-
_id:
|
|
534
|
+
_id: m,
|
|
529
535
|
image: t
|
|
530
536
|
});
|
|
531
537
|
}
|
|
532
|
-
await L.update(r), await
|
|
538
|
+
await L.update(r), await s(), await B("success"), n.value = null, _.value = !1;
|
|
533
539
|
},
|
|
534
540
|
{
|
|
535
541
|
message: "Saving card design",
|
|
@@ -537,30 +543,30 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
537
543
|
}
|
|
538
544
|
);
|
|
539
545
|
}
|
|
540
|
-
async function
|
|
541
|
-
u ?
|
|
546
|
+
async function h(u, r) {
|
|
547
|
+
u ? n.value = u : r && M.open({
|
|
542
548
|
title: "Delete Design",
|
|
543
549
|
message: "Are you sure you want to delete this design?",
|
|
544
550
|
primaryActions: { text: "Delete", close: !0 },
|
|
545
551
|
secondaryActions: { text: "Cancel", close: !1 }
|
|
546
552
|
}).onPrimary(async () => {
|
|
547
|
-
var
|
|
548
|
-
const b = (
|
|
553
|
+
var m, t;
|
|
554
|
+
const b = (m = w.value.design) == null ? void 0 : m.findIndex((l) => l._id == r);
|
|
549
555
|
console.log(b), b !== -1 && ((t = w.value.design) == null || t.splice(b, 1)), await S();
|
|
550
556
|
}).onSecondary(() => {
|
|
551
557
|
M.close();
|
|
552
558
|
});
|
|
553
559
|
}
|
|
554
|
-
async function
|
|
560
|
+
async function s() {
|
|
555
561
|
await g.readMembership(), w.value = g.membership;
|
|
556
562
|
}
|
|
557
563
|
return j({
|
|
558
|
-
showSheet:
|
|
564
|
+
showSheet: A
|
|
559
565
|
}), X(async () => {
|
|
560
|
-
await
|
|
566
|
+
await s(), o.value.length || (_.value = !0);
|
|
561
567
|
}), (u, r) => {
|
|
562
|
-
const b = v("FmButton"),
|
|
563
|
-
return
|
|
568
|
+
const b = v("FmButton"), m = v("FmSideSheet");
|
|
569
|
+
return c(), F(m, {
|
|
564
570
|
"max-width": 560,
|
|
565
571
|
"dismiss-away": !0,
|
|
566
572
|
header: "Manage Design",
|
|
@@ -571,8 +577,8 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
571
577
|
]
|
|
572
578
|
}, ge({
|
|
573
579
|
default: C(() => [
|
|
574
|
-
e(_) ? k("", !0) : (
|
|
575
|
-
(
|
|
580
|
+
e(_) ? k("", !0) : (c(), $("div", lt, [
|
|
581
|
+
(c(!0), $(z, null, H(e(o), (t) => (c(), F(ue, {
|
|
576
582
|
key: String(t._id),
|
|
577
583
|
"image-fit": "cover",
|
|
578
584
|
label: "",
|
|
@@ -588,20 +594,20 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
588
594
|
class: "!text-neutral-50 !bg-neutral-700",
|
|
589
595
|
icon: "delete",
|
|
590
596
|
variant: "tertiary",
|
|
591
|
-
onClick: (l) =>
|
|
597
|
+
onClick: (l) => h(null, t._id)
|
|
592
598
|
}, null, 8, ["onClick"])
|
|
593
599
|
]),
|
|
594
600
|
_: 2
|
|
595
601
|
}, 1032, ["thumbnail"]))), 128))
|
|
596
602
|
])),
|
|
597
|
-
e(_) ? (
|
|
603
|
+
e(_) ? (c(), F(ue, {
|
|
598
604
|
key: 1,
|
|
599
605
|
"image-fit": "cover",
|
|
600
606
|
label: "",
|
|
601
607
|
"aspect-ratio": "16/9",
|
|
602
608
|
accept: ".png, .jpg, .jpeg, .gif",
|
|
603
609
|
"recommended-size": "Recommended 16:9 ratio / 1280px x 720px",
|
|
604
|
-
"onUpdate:file":
|
|
610
|
+
"onUpdate:file": h
|
|
605
611
|
})) : k("", !0)
|
|
606
612
|
]),
|
|
607
613
|
_: 2
|
|
@@ -609,11 +615,11 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
609
615
|
e(_) ? {
|
|
610
616
|
name: "side-sheet-footer",
|
|
611
617
|
fn: C(() => [
|
|
612
|
-
d("div",
|
|
618
|
+
d("div", nt, [
|
|
613
619
|
i(b, {
|
|
614
620
|
label: "Save",
|
|
615
621
|
onClick: S,
|
|
616
|
-
disabled: !e(
|
|
622
|
+
disabled: !e(n)
|
|
617
623
|
}, null, 8, ["disabled"]),
|
|
618
624
|
i(b, {
|
|
619
625
|
label: "Cancel",
|
|
@@ -651,15 +657,15 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
651
657
|
}, null, -1), ct = { class: "flex flex-col gap-16 text-center" }, pt = { class: "fm-typo-en-title-sm-800" }, ft = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex gap-x-8" }, Ot = /* @__PURE__ */ Z({
|
|
652
658
|
__name: "Card",
|
|
653
659
|
setup(ee) {
|
|
654
|
-
const { minor: j, global: T } = J,
|
|
660
|
+
const { minor: j, global: T } = J, D = y(), g = y(), M = y(), _ = we(), w = W(), { t: n } = Be(), B = E(
|
|
655
661
|
() => w.sortedStoreCategories.flatMap((t) => t.bundles)
|
|
656
|
-
),
|
|
662
|
+
), o = [
|
|
657
663
|
{
|
|
658
|
-
header:
|
|
664
|
+
header: n("connect.loyalty.card.table.card_number"),
|
|
659
665
|
accessorFn: (t) => t.serialNumber
|
|
660
666
|
},
|
|
661
667
|
{
|
|
662
|
-
header:
|
|
668
|
+
header: n("connect.loyalty.card.table.redeemed_by"),
|
|
663
669
|
accessorKey: "user",
|
|
664
670
|
enableSorting: !1,
|
|
665
671
|
cell(t) {
|
|
@@ -670,7 +676,7 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
670
676
|
class: "flex items-center gap-x-8"
|
|
671
677
|
},
|
|
672
678
|
[
|
|
673
|
-
K(
|
|
679
|
+
K(se.FmAvatar, {
|
|
674
680
|
name: l != null && l.photoUrl || l == null ? void 0 : l.name,
|
|
675
681
|
src: (l == null ? void 0 : l.photoUrl) ?? void 0,
|
|
676
682
|
size: "sm"
|
|
@@ -681,7 +687,7 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
681
687
|
}
|
|
682
688
|
},
|
|
683
689
|
{
|
|
684
|
-
header:
|
|
690
|
+
header: n("connect.loyalty.card.table.phone"),
|
|
685
691
|
accessorFn: (t) => {
|
|
686
692
|
var l;
|
|
687
693
|
return ((l = t.pf_member) == null ? void 0 : l.phoneNumber) || "-";
|
|
@@ -689,26 +695,26 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
689
695
|
accessorKey: "pf_member.phoneNumber"
|
|
690
696
|
},
|
|
691
697
|
{
|
|
692
|
-
header:
|
|
698
|
+
header: n("connect.loyalty.card.table.created_at"),
|
|
693
699
|
accessorKey: "_id",
|
|
694
700
|
accessorFn: (t) => oe(Ue(t._id.toString())).format("DD MMM YYYY hh:mmA")
|
|
695
701
|
},
|
|
696
702
|
{
|
|
697
|
-
header:
|
|
703
|
+
header: n("connect.loyalty.card.table.bundle"),
|
|
698
704
|
accessorFn: (t) => {
|
|
699
705
|
var l;
|
|
700
706
|
return ((l = B.value.find((V) => V._id === t.bundle)) == null ? void 0 : l.name) || "-";
|
|
701
707
|
}
|
|
702
708
|
},
|
|
703
709
|
{
|
|
704
|
-
header:
|
|
710
|
+
header: n("connect.loyalty.card.table.redeemed_at"),
|
|
705
711
|
accessorKey: "redeemedAt",
|
|
706
712
|
accessorFn: (t) => t.redeemedAt ? oe(t.redeemedAt).format("DD MMM YYYY hh:mmA") : "-"
|
|
707
713
|
},
|
|
708
714
|
{
|
|
709
|
-
header:
|
|
715
|
+
header: n("connect.loyalty.card.table.actions"),
|
|
710
716
|
cell(t) {
|
|
711
|
-
return K(
|
|
717
|
+
return K(se.FmButton, {
|
|
712
718
|
variant: "tertiary",
|
|
713
719
|
icon: "delete",
|
|
714
720
|
iconColor: "neutral-gray-400",
|
|
@@ -719,25 +725,25 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
719
725
|
});
|
|
720
726
|
}
|
|
721
727
|
}
|
|
722
|
-
], { tableMeta: p, rowData:
|
|
723
|
-
async function
|
|
728
|
+
], { tableMeta: p, rowData: A, onSort: I, debouncedFetchData: S, onSearch: h } = $e(L.readCards);
|
|
729
|
+
async function s(t) {
|
|
724
730
|
var l;
|
|
725
|
-
await S(t), (l =
|
|
731
|
+
await S(t), (l = D.value) == null || l.showSheet(!1);
|
|
726
732
|
}
|
|
727
733
|
const u = E(() => _.isPremium ? [
|
|
728
734
|
{
|
|
729
|
-
label:
|
|
735
|
+
label: n("connect.loyalty.card.actions.create"),
|
|
730
736
|
value: "create",
|
|
731
737
|
isPrimary: !0
|
|
732
738
|
},
|
|
733
739
|
{
|
|
734
|
-
label:
|
|
740
|
+
label: n("connect.loyalty.card.actions.manage_design"),
|
|
735
741
|
value: "design",
|
|
736
742
|
isPrimary: !0
|
|
737
743
|
}
|
|
738
744
|
] : []);
|
|
739
745
|
async function r(t) {
|
|
740
|
-
await
|
|
746
|
+
await pe.remove(
|
|
741
747
|
`Are you sure you want to remove card ${t.serialNumber}?`
|
|
742
748
|
) && await j(
|
|
743
749
|
async () => {
|
|
@@ -765,7 +771,7 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
765
771
|
}
|
|
766
772
|
);
|
|
767
773
|
}
|
|
768
|
-
const
|
|
774
|
+
const m = (t) => {
|
|
769
775
|
var l;
|
|
770
776
|
if (t.redeemedAt) {
|
|
771
777
|
_e.error("Update not permitted", 2e3);
|
|
@@ -775,22 +781,22 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
775
781
|
};
|
|
776
782
|
return X(async () => {
|
|
777
783
|
await T(async () => {
|
|
778
|
-
await _.readPremium(), await w.readMemberStore(), await w.readMembership(), await
|
|
784
|
+
await _.readPremium(), await w.readMemberStore(), await w.readMembership(), await s();
|
|
779
785
|
});
|
|
780
786
|
}), (t, l) => {
|
|
781
787
|
const V = v("FmPill"), U = v("FmPageHead"), f = v("FmSearch"), N = v("FmButton"), q = v("FmCard");
|
|
782
|
-
return
|
|
788
|
+
return c(), $(z, null, [
|
|
783
789
|
i(U, {
|
|
784
|
-
title: e(
|
|
790
|
+
title: e(n)("connect.loyalty.card.title"),
|
|
785
791
|
actions: e(u),
|
|
786
|
-
"onClick:action": l[0] || (l[0] = (
|
|
792
|
+
"onClick:action": l[0] || (l[0] = (x) => {
|
|
787
793
|
var P, O;
|
|
788
|
-
console.log(
|
|
794
|
+
console.log(x), x === "design" && ((P = e(M)) == null || P.showSheet(!0)), x === "create" && ((O = e(D)) == null || O.showSheet(!0));
|
|
789
795
|
})
|
|
790
796
|
}, {
|
|
791
797
|
title: C(() => [
|
|
792
798
|
d("div", it, [
|
|
793
|
-
d("span", rt, te(e(
|
|
799
|
+
d("span", rt, te(e(n)("connect.loyalty.card.title")), 1),
|
|
794
800
|
i(V, {
|
|
795
801
|
class: "ml-8",
|
|
796
802
|
variant: "premium"
|
|
@@ -800,14 +806,14 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
800
806
|
_: 1
|
|
801
807
|
}, 8, ["title", "actions"]),
|
|
802
808
|
d("div", dt, [
|
|
803
|
-
e(
|
|
809
|
+
e(A).length > 0 || e(A).length <= 0 && e(p).searchValue || e(p).pageCount > 0 ? (c(), $(z, { key: 0 }, [
|
|
804
810
|
d("div", ut, [
|
|
805
811
|
i(f, {
|
|
806
812
|
class: "mt-4",
|
|
807
813
|
modelValue: e(p).searchValue,
|
|
808
814
|
"onUpdate:modelValue": [
|
|
809
|
-
l[1] || (l[1] = (
|
|
810
|
-
e(
|
|
815
|
+
l[1] || (l[1] = (x) => e(p).searchValue = x),
|
|
816
|
+
e(h)
|
|
811
817
|
],
|
|
812
818
|
placeholder: "Search",
|
|
813
819
|
collapsible: ""
|
|
@@ -820,25 +826,25 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
820
826
|
]),
|
|
821
827
|
i(Me, {
|
|
822
828
|
loading: e(p).isLoading,
|
|
823
|
-
"row-data": e(
|
|
829
|
+
"row-data": e(A),
|
|
824
830
|
"row-count": e(p).totalRows,
|
|
825
|
-
"column-defs":
|
|
831
|
+
"column-defs": o,
|
|
826
832
|
"shrink-at": !1,
|
|
827
833
|
"page-count": e(p).pageCount,
|
|
828
834
|
"page-index": e(p).pageIndex,
|
|
829
835
|
"page-size": e(p).pageSize,
|
|
830
836
|
onSortChange: e(I),
|
|
831
|
-
onPageChange: l[2] || (l[2] = (
|
|
837
|
+
onPageChange: l[2] || (l[2] = (x) => {
|
|
832
838
|
e(S)({
|
|
833
|
-
pageSize:
|
|
834
|
-
pageIndex:
|
|
839
|
+
pageSize: x.pageSize,
|
|
840
|
+
pageIndex: x.pageIndex
|
|
835
841
|
});
|
|
836
842
|
}),
|
|
837
|
-
onRowClick: l[3] || (l[3] = (
|
|
838
|
-
|
|
843
|
+
onRowClick: l[3] || (l[3] = (x) => {
|
|
844
|
+
m(e(Se)(x.original));
|
|
839
845
|
})
|
|
840
846
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
|
|
841
|
-
], 64)) : (
|
|
847
|
+
], 64)) : (c(), F(q, {
|
|
842
848
|
key: 1,
|
|
843
849
|
variant: "outlined",
|
|
844
850
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
@@ -846,27 +852,27 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
846
852
|
default: C(() => [
|
|
847
853
|
mt,
|
|
848
854
|
d("div", ct, [
|
|
849
|
-
d("div", pt, te(e(
|
|
850
|
-
d("div", ft, te(e(
|
|
855
|
+
d("div", pt, te(e(n)("connect.loyalty.card.empty_state.title")), 1),
|
|
856
|
+
d("div", ft, te(e(n)("connect.loyalty.card.empty_state.description")), 1)
|
|
851
857
|
]),
|
|
852
858
|
d("div", gt, [
|
|
853
859
|
i(N, {
|
|
854
860
|
variant: "primary",
|
|
855
|
-
label: e(
|
|
861
|
+
label: e(n)("connect.loyalty.card.actions.add"),
|
|
856
862
|
icon: "add",
|
|
857
863
|
disabled: !e(_).isPremium,
|
|
858
864
|
onClick: l[4] || (l[4] = () => {
|
|
859
|
-
var
|
|
860
|
-
return (
|
|
865
|
+
var x;
|
|
866
|
+
return (x = e(D)) == null ? void 0 : x.showSheet(!0);
|
|
861
867
|
})
|
|
862
868
|
}, null, 8, ["label", "disabled"]),
|
|
863
869
|
i(N, {
|
|
864
870
|
variant: "secondary",
|
|
865
|
-
label: e(
|
|
871
|
+
label: e(n)("connect.loyalty.card.actions.manage_design"),
|
|
866
872
|
disabled: !e(_).isPremium,
|
|
867
873
|
onClick: l[5] || (l[5] = () => {
|
|
868
|
-
var
|
|
869
|
-
return (
|
|
874
|
+
var x;
|
|
875
|
+
return (x = e(M)) == null ? void 0 : x.showSheet(!0);
|
|
870
876
|
})
|
|
871
877
|
}, null, 8, ["label", "disabled"])
|
|
872
878
|
])
|
|
@@ -875,21 +881,21 @@ const De = /* @__PURE__ */ d("div", { class: "fm-typo-en-body-lg-600" }, "Number
|
|
|
875
881
|
})),
|
|
876
882
|
i(Ye, {
|
|
877
883
|
ref_key: "sheetRef",
|
|
878
|
-
ref:
|
|
879
|
-
onSuccess: l[6] || (l[6] = (
|
|
884
|
+
ref: D,
|
|
885
|
+
onSuccess: l[6] || (l[6] = (x) => s()),
|
|
880
886
|
onExport: b
|
|
881
887
|
}, null, 512),
|
|
882
888
|
i(st, {
|
|
883
889
|
ref_key: "designSheetRef",
|
|
884
890
|
ref: M,
|
|
885
|
-
onSuccess:
|
|
891
|
+
onSuccess: s
|
|
886
892
|
}, null, 512),
|
|
887
893
|
i(tt, {
|
|
888
894
|
ref_key: "editSheetRef",
|
|
889
895
|
ref: g,
|
|
890
|
-
onSuccess: l[7] || (l[7] = (
|
|
896
|
+
onSuccess: l[7] || (l[7] = (x) => {
|
|
891
897
|
var P;
|
|
892
|
-
|
|
898
|
+
s({
|
|
893
899
|
pageSize: e(p).pageSize,
|
|
894
900
|
pageIndex: e(p).pageIndex
|
|
895
901
|
}), (P = e(g)) == null || P.showSheet(!1);
|