@feedmepos/mf-connect 0.1.0-beta.61 → 0.1.0-beta.63
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-u9mtlxSv.js → Analytic-B6gawfKq.js} +11 -11
- package/dist/{App-BwTQE7Ft.js → App-D5hrcZFI.js} +6 -6
- package/dist/{AuditLogs-BVMRclSw.js → AuditLogs-CNl7JmOE.js} +8 -8
- package/dist/{Bin-Cca-XOkz.js → Bin-8AxBcVVx.js} +8 -8
- package/dist/{Broadcast-DRQgpwdP.js → Broadcast-CtITrwEL.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CeUu_T1u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DOwAdkjF.js} +6 -6
- package/dist/{Card-CnbB_u31.js → Card-BEWdNGJk.js} +15 -15
- package/dist/{Collections-BjlfOSC3.js → Collections-Q9dNhSNn.js} +5 -5
- package/dist/{Credit-BoElrcx9.js → Credit-DfzIwziN.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B3WVwem6.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BckrtGWZ.js} +28 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CGfpziKs.js → EffectSheet.vue_vue_type_style_index_0_lang-CZoqGhE_.js} +6 -6
- package/dist/{Experience-SdGBf4vU.js → Experience-CBFckRvf.js} +9 -9
- package/dist/{Game-ChLHibpB.js → Game-B9CUNCtq.js} +9 -9
- package/dist/{Index-D7Kq6uyf.js → Index-CQQUQJOS.js} +10 -10
- package/dist/{Marketing-BDajIqR_.js → Marketing-CQO5hw8D.js} +6 -6
- package/dist/{Member-BPZryqWL.js → Member-CXtvsQNE.js} +5 -5
- package/dist/{MemberList-C52Dop8Z.js → MemberList-poBwKTlI.js} +24 -24
- package/dist/{MemberTransactions-DHU78kgS.js → MemberTransactions-BYJGcT4u.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-js1F2E4N.js → MessageInput.vue_vue_type_script_setup_true_lang-DtmAbuY4.js} +2 -2
- package/dist/{Mission-BQR3qjAu.js → Mission-DTrzmqgl.js} +9 -9
- package/dist/{Overview-BbLYWXjG.js → Overview-CW1vkdhy.js} +17 -17
- package/dist/{Point-DbTcWJbQ.js → Point-4IquZrGL.js} +9 -9
- package/dist/{Promotion-CIrpWBQD.js → Promotion-D-z6DDla.js} +10 -10
- package/dist/{Queue-B0Mfq2Vn.js → Queue-BhX0AFF2.js} +9 -9
- package/dist/{Record-Z6ZrJeLc.js → Record-DM3zFBc4.js} +7 -7
- package/dist/{Reward-D6k0QFQA.js → Reward-DH5ibLPZ.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-GJ6j_jOh.js → RewardGroup.vue_vue_type_script_setup_true_lang-Bj5eD5pX.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-gQxmX9ur.js → RuleGroup.vue_vue_type_script_setup_true_lang-CtUMriGp.js} +12 -12
- package/dist/{Segment-D6MF-EO8.js → Segment-BI6GO8iX.js} +14 -14
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BWG-pz6F.js → SelectItems.vue_vue_type_script_setup_true_lang-Zjg61vYE.js} +3 -3
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-HgorlHNz.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Dmoq_bJZ.js} +3 -3
- package/dist/{Setting--OFDS95z.js → Setting-B6CcCapm.js} +10 -10
- package/dist/{Store-BqlRTC-c.js → Store-CT7VDudR.js} +683 -595
- package/dist/{StoreRewards-BTu0IdDN.js → StoreRewards-DDyGOrSx.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BX053DJA.js → StoreTransactions.vue_vue_type_script_setup_true_lang-8iCqW_N7.js} +17 -17
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BAkuqLwy.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Cglce4fZ.js} +1 -1
- package/dist/{Tier-CE9LYAEX.js → Tier-CISq9Rg4.js} +19 -19
- package/dist/{Title-DOOASUMI.js → Title-ByEP9Gjs.js} +19 -19
- package/dist/{Transaction-DPxUOBP-.js → Transaction-CCYK-3X1.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CKwf0F_i.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CydeM-n-.js} +6 -6
- package/dist/{Voucher-D69DD02z.js → Voucher-zTTTntky.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CFL0Nsez.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DL1xQskK.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Byh6_EJM.js → ZodTextField.vue_vue_type_script_setup_true_lang-C6UdHnVo.js} +1 -1
- package/dist/{app-DgfmbHZe.js → app-D5Ra9xrG.js} +1 -1
- package/dist/{app-C2u1t47T.js → app-DxynV1X7.js} +576 -568
- package/dist/app.js +1 -1
- package/dist/{business-BqCJB_vA.js → business-dhbztRTa.js} +1 -1
- package/dist/{campaign-D0dTbl5b.js → campaign-B1iNc9qO.js} +9 -9
- package/dist/{campaign-CWMPCmmU.js → campaign-BQA5cPe-.js} +2 -2
- package/dist/{campaign.enum-DhE8N4pA.js → campaign.enum-CSqtGFzq.js} +1 -1
- package/dist/{campaign.fn-BpO-RQih.js → campaign.fn-BbK0gRMO.js} +79 -79
- package/dist/{collectible.enum-rWEc6Tsw.js → collectible.enum-C6CobEkg.js} +1 -1
- package/dist/{collection.fn-biX2iFDQ.js → collection.fn-DxhFXSTy.js} +2 -2
- package/dist/{dto-3m7xZwfI.js → dto-BEr_RwXD.js} +4 -4
- package/dist/{effect-ZMGRxKCZ.js → effect-qgarf2Pv.js} +1 -1
- package/dist/{email-addresses-lgY03bkq.js → email-addresses-GiNBRPBn.js} +1 -1
- package/dist/{export-BOzeYUy8.js → export-FZKAj1_m.js} +3 -3
- package/dist/{helper-CO29wun4.js → helper-CAFMDuuv.js} +1 -1
- package/dist/{index-ChrOXJDq.js → index-BKk1muBO.js} +1 -1
- package/dist/{index-Xh9cW6Y9.js → index-Ba-4JUrM.js} +3 -3
- package/dist/{index-LYAWIqjk.js → index-Bpnf1Jnl.js} +1 -1
- package/dist/{index-BVbiAxW8.js → index-C-FzeYpM.js} +1 -1
- package/dist/{index-B3V7krW_.js → index-CvtM6V5B.js} +3 -3
- package/dist/{index-DNGenFnf.js → index-DBUGR-0t.js} +1 -1
- package/dist/{index-YsC4VklJ.js → index-DIQ2zqIs.js} +1 -1
- package/dist/{index-Dd22X409.js → index-DWfSOO2Y.js} +6 -6
- package/dist/{index-CYOwwy3h.js → index-DnIJGBOA.js} +1 -1
- package/dist/{index-Bvch9tuP.js → index-I1QEAfZZ.js} +1 -1
- package/dist/{index-CbYXYVYp.js → index-ZP0c52Fr.js} +2 -2
- package/dist/{index-XhqaicYu.js → index-re4GLf0z.js} +4 -4
- package/dist/{index.esm2017-CJ1flA6S.js → index.esm2017-Dh8iO0Er.js} +1 -1
- package/dist/{loading-CUs_CN1k.js → loading-Dn4uRmEp.js} +1 -1
- package/dist/{membership-D-GVacos.js → membership-D8D_UHuB.js} +3 -3
- package/dist/{money-CMtSALkX.js → money-DBRNHF-Z.js} +1 -1
- package/dist/{number-CDwwgAYM.js → number-CFLIvcEb.js} +1 -1
- package/dist/{objectid-Bf9yKD81.js → objectid-BmDkIt_5.js} +12 -12
- package/dist/{plugins-9sQTEyth.js → plugins-l5VSqqNJ.js} +4 -4
- package/dist/{reward-DblXGhWc.js → reward-DdEwVAuY.js} +1 -1
- package/dist/{rule-Cy8cTzuw.js → rule-DpS_KPvK.js} +3 -3
- package/dist/{rule-builder-Cn5vZgFN.js → rule-builder-DSCguKh_.js} +1 -1
- package/dist/{template-Cal94dUy.js → template-CTaPJpC9.js} +4 -4
- package/dist/{trigger-C1nwLSP8.js → trigger-CuuEBItq.js} +4 -4
- package/dist/{user-ir4Rn5bP.js → user-J7_0joF2.js} +1 -1
- package/dist/{vue-i18n-eOHBBaH5.js → vue-i18n-DLLf4Ccx.js} +300 -300
- package/dist/{xlsx-DulnT75_.js → xlsx-8eSK1fl8.js} +1 -1
- package/package.json +1 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { defineComponent as ee, computed as j, resolveComponent as h, openBlock as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { c as
|
|
5
|
-
import { u as Ee } from "./loading-
|
|
6
|
-
import { u as
|
|
7
|
-
import { a as Je, c as
|
|
1
|
+
import { defineComponent as ee, computed as j, resolveComponent as h, openBlock as g, createBlock as I, withCtx as T, createElementVNode as _, createElementBlock as B, createVNode as i, createCommentVNode as M, toDisplayString as L, unref as e, Fragment as X, renderList as re, ref as R, isRef as oe, reactive as Ke, onMounted as fe, watch as we, toRaw as He, createTextVNode as de, h as qe } from "vue";
|
|
2
|
+
import { _ as Ye } from "./tier-BJDhpH6X.js";
|
|
3
|
+
import { useDialog as Me, useDialogChild as Oe, components as We } from "@feedmepos/ui-library";
|
|
4
|
+
import { c as N, e as he, S as ze } from "./index-CvtM6V5B.js";
|
|
5
|
+
import { u as Ee } from "./loading-Dn4uRmEp.js";
|
|
6
|
+
import { u as ke, C as me } from "./membership-D8D_UHuB.js";
|
|
7
|
+
import { a as Je, c as De } from "./object-qECH92oz.js";
|
|
8
8
|
import { _ as ue } from "./lodash-B5I3zXaY.js";
|
|
9
|
-
import { d as se, a as Ge, p as
|
|
10
|
-
import { u as be } from "./vue-i18n-
|
|
9
|
+
import { d as se, a as Ge, p as _e, n as Xe, f as Fe } from "./plugins-l5VSqqNJ.js";
|
|
10
|
+
import { u as be } from "./vue-i18n-DLLf4Ccx.js";
|
|
11
11
|
import { Z, g as J, a as G } from "./zod-Bg2FbC-D.js";
|
|
12
|
-
import { z as Q, R as Ze } from "./app-
|
|
13
|
-
import { k as Qe, l as et, m as tt, n as
|
|
14
|
-
import { u as
|
|
15
|
-
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { J as
|
|
17
|
-
import { _ as ot } from "./index-
|
|
18
|
-
import { _ as
|
|
19
|
-
import { _ as
|
|
20
|
-
import { z as st, a as rt } from "./money-
|
|
21
|
-
import { F as it } from "./number-
|
|
22
|
-
import { t as dt } from "./helper-
|
|
23
|
-
import "./index-
|
|
24
|
-
import "./index-
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-
|
|
27
|
-
import { m as ut } from "./index-
|
|
28
|
-
import { m as
|
|
12
|
+
import { z as Q, R as Ze } from "./app-DxynV1X7.js";
|
|
13
|
+
import { k as Qe, l as et, m as tt, n as Ae, o as nt } from "./index-re4GLf0z.js";
|
|
14
|
+
import { u as Se } from "./app-wDQR6dpb.js";
|
|
15
|
+
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-C6UdHnVo.js";
|
|
16
|
+
import { J as Pe } from "./JsonViewer-v8_C7l5N.js";
|
|
17
|
+
import { _ as ot } from "./index-ZP0c52Fr.js";
|
|
18
|
+
import { _ as at } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
|
|
19
|
+
import { _ as lt } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
20
|
+
import { z as st, a as rt } from "./money-DBRNHF-Z.js";
|
|
21
|
+
import { F as it } from "./number-CFLIvcEb.js";
|
|
22
|
+
import { t as dt } from "./helper-CAFMDuuv.js";
|
|
23
|
+
import "./index-Bpnf1Jnl.js";
|
|
24
|
+
import "./index-DWfSOO2Y.js";
|
|
25
|
+
import "./index-DIQ2zqIs.js";
|
|
26
|
+
import "./index-Ba-4JUrM.js";
|
|
27
|
+
import { m as ut } from "./index-BKk1muBO.js";
|
|
28
|
+
import { m as Ce } from "./index-I1QEAfZZ.js";
|
|
29
29
|
import { useRouter as ct } from "vue-router";
|
|
30
|
-
function je(
|
|
31
|
-
return se.DineroFactory(
|
|
30
|
+
function je(v) {
|
|
31
|
+
return se.DineroFactory(v).toUnit();
|
|
32
32
|
}
|
|
33
|
-
function mt(
|
|
33
|
+
function mt(v, x, l, f, r = [], b = []) {
|
|
34
34
|
const o = ot.compact(
|
|
35
|
-
x.map((t) =>
|
|
35
|
+
x.map((t) => v.find((c) => c.systemCode === t.systemCode && c.taxCode === t.taxCode)).filter((t) => !!t && b.includes(t.systemCode))
|
|
36
36
|
), m = o.reduce(
|
|
37
37
|
(t, c) => {
|
|
38
38
|
var y;
|
|
39
39
|
return Object.assign(t, {
|
|
40
40
|
[c.taxCode]: {
|
|
41
|
-
inclusive: ((y =
|
|
41
|
+
inclusive: ((y = r.find((d) => d.systemCode === c.systemCode)) == null ? void 0 : y.inclusive) || !1,
|
|
42
42
|
adjustment: {
|
|
43
43
|
level: 1,
|
|
44
44
|
type: {
|
|
@@ -63,7 +63,7 @@ function mt(g, x, a, f, i = [], b = []) {
|
|
|
63
63
|
level: 0,
|
|
64
64
|
type: {
|
|
65
65
|
type: "BY_AMOUNT",
|
|
66
|
-
amount: se.DineroFactory(
|
|
66
|
+
amount: se.DineroFactory(l).subtract(se.Dinero.fromNumber({ number: f }).toObject()).toObject()
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
},
|
|
@@ -84,84 +84,84 @@ function mt(g, x, a, f, i = [], b = []) {
|
|
|
84
84
|
}).convertPrecision(2).toObject()
|
|
85
85
|
}));
|
|
86
86
|
}
|
|
87
|
-
function pt(
|
|
88
|
-
return
|
|
87
|
+
function pt(v, x, l) {
|
|
88
|
+
return v ? v.reduce((f, r) => {
|
|
89
89
|
var b;
|
|
90
|
-
return (b =
|
|
90
|
+
return (b = l.find((o) => o.systemCode === r.systemCode)) != null && b.inclusive || (f = se.DineroFactory(f.toObject()).add(r.total)), f;
|
|
91
91
|
}, se.DineroFactory(x)).toObject() : se.DineroFactory(x).toObject();
|
|
92
92
|
}
|
|
93
93
|
const yt = { class: "relative h-[120px] aspect-video flex items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, ft = ["src"], bt = {
|
|
94
94
|
key: 2,
|
|
95
95
|
class: "absolute top-2 left-2"
|
|
96
|
-
},
|
|
96
|
+
}, gt = { class: "absolute top-0 right-0" }, vt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xt = { class: "flex gap-8 items-center flex-wrap" }, _t = /* @__PURE__ */ ee({
|
|
97
97
|
__name: "StoreBundleCard",
|
|
98
98
|
props: {
|
|
99
99
|
bundle: { type: Object, required: !0 }
|
|
100
100
|
},
|
|
101
101
|
emits: ["edit", "delete", "send"],
|
|
102
|
-
setup(
|
|
103
|
-
const
|
|
102
|
+
setup(v, { emit: x }) {
|
|
103
|
+
const l = v, f = x, r = j(() => {
|
|
104
104
|
const o = [];
|
|
105
|
-
return
|
|
106
|
-
`${
|
|
107
|
-
),
|
|
105
|
+
return l.bundle.price.amount > 0 && o.push(
|
|
106
|
+
`${N.Config.getCountry().currency.symbol}${je(l.bundle.price)}`
|
|
107
|
+
), l.bundle.coinPrice && o.push(`${l.bundle.coinPrice} point(s)`), o.join(" or ");
|
|
108
108
|
}), b = j(() => {
|
|
109
109
|
var m, u;
|
|
110
110
|
const o = [];
|
|
111
|
-
if (
|
|
112
|
-
const t =
|
|
111
|
+
if (l.bundle.titles.length > 0 && o.push(`${l.bundle.titles.length} title(s)`), l.bundle.vouchers.length > 0 && o.push(`${l.bundle.vouchers.length} voucher(s)`), l.bundle.credit.normal || (m = l.bundle.credit.free) != null && m.amount) {
|
|
112
|
+
const t = l.bundle.credit.normal + (((u = l.bundle.credit.free) == null ? void 0 : u.amount) ?? 0);
|
|
113
113
|
o.push(`${t} credit(s)`);
|
|
114
114
|
}
|
|
115
115
|
return o;
|
|
116
116
|
});
|
|
117
117
|
return (o, m) => {
|
|
118
|
-
const u = h("FmIcon"), t = h("FmChip"), c = h("FmButton"), y = h("FmMenuItem"), d = h("FmMenu"),
|
|
119
|
-
return
|
|
118
|
+
const u = h("FmIcon"), t = h("FmChip"), c = h("FmButton"), y = h("FmMenuItem"), d = h("FmMenu"), V = h("FmCard");
|
|
119
|
+
return g(), I(V, {
|
|
120
120
|
variant: "outlined",
|
|
121
121
|
class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full text-center items-center"
|
|
122
122
|
}, {
|
|
123
123
|
default: T(() => [
|
|
124
124
|
_("div", yt, [
|
|
125
|
-
|
|
125
|
+
v.bundle.image ? (g(), B("img", {
|
|
126
126
|
key: 1,
|
|
127
|
-
src:
|
|
127
|
+
src: v.bundle.image,
|
|
128
128
|
class: "w-full h-full object-contain aspect-video"
|
|
129
|
-
}, null, 8, ft)) : (
|
|
129
|
+
}, null, 8, ft)) : (g(), I(u, {
|
|
130
130
|
key: 0,
|
|
131
131
|
name: "image",
|
|
132
132
|
outline: !0,
|
|
133
133
|
size: "md",
|
|
134
134
|
class: "text-fm-color-neutral-gray-200"
|
|
135
135
|
})),
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
v.bundle.isFeedvibe ? (g(), B("div", bt, [
|
|
137
|
+
i(t, {
|
|
138
138
|
label: "Feedvibe",
|
|
139
139
|
class: "text-fm-color-primary bg-fm-color-system-warning-100",
|
|
140
140
|
compact: ""
|
|
141
141
|
})
|
|
142
|
-
])) :
|
|
143
|
-
_("div",
|
|
144
|
-
|
|
142
|
+
])) : M("", !0),
|
|
143
|
+
_("div", gt, [
|
|
144
|
+
i(d, { placement: "bottom-end" }, {
|
|
145
145
|
"menu-button": T(() => [
|
|
146
|
-
|
|
146
|
+
i(c, {
|
|
147
147
|
icon: "more_vert",
|
|
148
148
|
variant: "tertiary"
|
|
149
149
|
})
|
|
150
150
|
]),
|
|
151
151
|
default: T(() => [
|
|
152
|
-
|
|
153
|
-
onClick: m[0] || (m[0] = (
|
|
152
|
+
i(y, {
|
|
153
|
+
onClick: m[0] || (m[0] = (a) => f("edit", v.bundle)),
|
|
154
154
|
icon: "edit",
|
|
155
155
|
label: "Edit"
|
|
156
156
|
}),
|
|
157
|
-
|
|
157
|
+
v.bundle.stripePriceId ? M("", !0) : (g(), I(y, {
|
|
158
158
|
key: 0,
|
|
159
|
-
onClick: m[1] || (m[1] = (
|
|
159
|
+
onClick: m[1] || (m[1] = (a) => f("send", v.bundle)),
|
|
160
160
|
icon: "send",
|
|
161
161
|
label: "Send"
|
|
162
162
|
})),
|
|
163
|
-
|
|
164
|
-
onClick: m[2] || (m[2] = (
|
|
163
|
+
i(y, {
|
|
164
|
+
onClick: m[2] || (m[2] = (a) => f("delete", v.bundle)),
|
|
165
165
|
icon: "delete"
|
|
166
166
|
}, {
|
|
167
167
|
label: T(() => m[3] || (m[3] = [
|
|
@@ -174,12 +174,12 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
174
174
|
})
|
|
175
175
|
])
|
|
176
176
|
]),
|
|
177
|
-
_("div",
|
|
178
|
-
_("div", ht, L(e(
|
|
177
|
+
_("div", vt, L(v.bundle.name), 1),
|
|
178
|
+
_("div", ht, L(e(r) || "Free"), 1),
|
|
179
179
|
_("div", xt, [
|
|
180
|
-
(
|
|
181
|
-
key:
|
|
182
|
-
label:
|
|
180
|
+
(g(!0), B(X, null, re(e(b), (a, S) => (g(), I(t, {
|
|
181
|
+
key: S,
|
|
182
|
+
label: a
|
|
183
183
|
}, null, 8, ["label"]))), 128))
|
|
184
184
|
])
|
|
185
185
|
]),
|
|
@@ -190,18 +190,18 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
190
190
|
}), Ct = /* @__PURE__ */ ee({
|
|
191
191
|
__name: "AddBundleCard",
|
|
192
192
|
emits: ["create"],
|
|
193
|
-
setup(
|
|
194
|
-
const { t:
|
|
195
|
-
return (
|
|
193
|
+
setup(v, { emit: x }) {
|
|
194
|
+
const { t: l } = be(), f = x;
|
|
195
|
+
return (r, b) => {
|
|
196
196
|
const o = h("FmButton"), m = h("FmCard");
|
|
197
|
-
return
|
|
197
|
+
return g(), I(m, {
|
|
198
198
|
variant: "outlined",
|
|
199
199
|
class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
|
|
200
200
|
}, {
|
|
201
201
|
default: T(() => [
|
|
202
|
-
|
|
202
|
+
i(o, {
|
|
203
203
|
onClick: b[0] || (b[0] = (u) => f("create")),
|
|
204
|
-
label: e(
|
|
204
|
+
label: e(l)("connect.store.actions.addBundle"),
|
|
205
205
|
icon: "add",
|
|
206
206
|
variant: "secondary"
|
|
207
207
|
}, null, 8, ["label"])
|
|
@@ -210,7 +210,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
210
210
|
});
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
}),
|
|
213
|
+
}), St = { class: "space-y-16" }, Ft = { class: "flex w-full justify-between pb-16" }, Vt = { class: "flex items-center justify-end gap-8" }, wt = /* @__PURE__ */ ee({
|
|
214
214
|
__name: "CategoryDialog",
|
|
215
215
|
props: {
|
|
216
216
|
action: {
|
|
@@ -222,40 +222,40 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
222
222
|
default: () => ""
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
|
-
setup(
|
|
226
|
-
const { t: x } = be(),
|
|
225
|
+
setup(v) {
|
|
226
|
+
const { t: x } = be(), l = v, f = Me(), { emitData: r, emitAction: b } = Oe(), o = R(l.initialValue), m = Q.string().min(1);
|
|
227
227
|
function u() {
|
|
228
|
-
|
|
228
|
+
r(o.value), b("primary"), f.close();
|
|
229
229
|
}
|
|
230
230
|
function t() {
|
|
231
|
-
|
|
231
|
+
r(null), b("primary"), f.close();
|
|
232
232
|
}
|
|
233
233
|
return (c, y) => {
|
|
234
|
-
const d = h("FmTextField"),
|
|
235
|
-
return
|
|
236
|
-
|
|
234
|
+
const d = h("FmTextField"), V = h("FmButton");
|
|
235
|
+
return g(), B("div", St, [
|
|
236
|
+
i(d, {
|
|
237
237
|
modelValue: e(o),
|
|
238
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
238
|
+
"onUpdate:modelValue": y[0] || (y[0] = (a) => oe(o) ? o.value = a : null),
|
|
239
239
|
label: e(x)("connect.store.category.label"),
|
|
240
240
|
rules: [e(Z).toRule(e(m))]
|
|
241
241
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
242
|
-
_("div",
|
|
242
|
+
_("div", Ft, [
|
|
243
243
|
_("div", null, [
|
|
244
|
-
|
|
244
|
+
v.action == "edit" ? (g(), I(V, {
|
|
245
245
|
key: 0,
|
|
246
246
|
onClick: t,
|
|
247
247
|
label: e(x)("connect.common.delete"),
|
|
248
248
|
variant: "destructive"
|
|
249
|
-
}, null, 8, ["label"])) :
|
|
249
|
+
}, null, 8, ["label"])) : M("", !0)
|
|
250
250
|
]),
|
|
251
|
-
_("div",
|
|
252
|
-
|
|
251
|
+
_("div", Vt, [
|
|
252
|
+
i(V, {
|
|
253
253
|
label: e(x)("connect.common.cancel"),
|
|
254
254
|
variant: "tertiary",
|
|
255
|
-
onClick: y[1] || (y[1] = (
|
|
255
|
+
onClick: y[1] || (y[1] = (a) => e(f).close())
|
|
256
256
|
}, null, 8, ["label"]),
|
|
257
|
-
|
|
258
|
-
label:
|
|
257
|
+
i(V, {
|
|
258
|
+
label: v.action == "edit" ? e(x)("connect.common.edit") : e(x)("connect.common.add"),
|
|
259
259
|
disabled: !e(o),
|
|
260
260
|
onClick: u
|
|
261
261
|
}, null, 8, ["label", "disabled"])
|
|
@@ -264,10 +264,10 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
264
264
|
]);
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
-
}),
|
|
267
|
+
}), kt = { class: "space-y-16" }, Pt = { class: "flex items-center justify-end gap-8 pb-16" }, $t = /* @__PURE__ */ ee({
|
|
268
268
|
__name: "SelectCategoryDialog",
|
|
269
|
-
setup(
|
|
270
|
-
const { emitData: x, emitAction:
|
|
269
|
+
setup(v) {
|
|
270
|
+
const { emitData: x, emitAction: l } = Oe(), f = ke(), r = R(), b = j(
|
|
271
271
|
() => f.sortedStoreCategories.map((o, m) => ({
|
|
272
272
|
label: o.name,
|
|
273
273
|
value: m
|
|
@@ -275,39 +275,39 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
275
275
|
);
|
|
276
276
|
return (o, m) => {
|
|
277
277
|
const u = h("FmSelect"), t = h("FmButton");
|
|
278
|
-
return
|
|
278
|
+
return g(), B("div", kt, [
|
|
279
279
|
m[4] || (m[4] = _("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1)),
|
|
280
|
-
|
|
280
|
+
i(u, {
|
|
281
281
|
placeholder: "Select a category",
|
|
282
282
|
items: e(b),
|
|
283
|
-
modelValue: e(
|
|
283
|
+
modelValue: e(r),
|
|
284
284
|
"onUpdate:modelValue": [
|
|
285
|
-
m[0] || (m[0] = (c) => oe(
|
|
285
|
+
m[0] || (m[0] = (c) => oe(r) ? r.value = c : null),
|
|
286
286
|
m[1] || (m[1] = (c) => e(x)(c))
|
|
287
287
|
],
|
|
288
288
|
label: "Category"
|
|
289
289
|
}, null, 8, ["items", "modelValue"]),
|
|
290
|
-
_("div",
|
|
291
|
-
|
|
290
|
+
_("div", Pt, [
|
|
291
|
+
i(t, {
|
|
292
292
|
variant: "tertiary",
|
|
293
293
|
label: "Cancel",
|
|
294
|
-
onClick: m[2] || (m[2] = (c) => e(
|
|
294
|
+
onClick: m[2] || (m[2] = (c) => e(l)("tertiary"))
|
|
295
295
|
}),
|
|
296
|
-
|
|
296
|
+
i(t, {
|
|
297
297
|
label: "Select",
|
|
298
|
-
onClick: m[3] || (m[3] = (c) => e(
|
|
299
|
-
disabled: e(
|
|
298
|
+
onClick: m[3] || (m[3] = (c) => e(l)("primary")),
|
|
299
|
+
disabled: e(r) == null
|
|
300
300
|
}, null, 8, ["disabled"])
|
|
301
301
|
])
|
|
302
302
|
]);
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
305
|
});
|
|
306
|
-
function
|
|
307
|
-
return
|
|
306
|
+
function xe(v) {
|
|
307
|
+
return v.states.map((x) => ({ label: x, value: x }));
|
|
308
308
|
}
|
|
309
309
|
const Tt = {
|
|
310
|
-
[
|
|
310
|
+
[he.F_COUNTRY.enum.MY]: {
|
|
311
311
|
states: [
|
|
312
312
|
"Johor",
|
|
313
313
|
"Kedah",
|
|
@@ -327,16 +327,16 @@ const Tt = {
|
|
|
327
327
|
"Terengganu"
|
|
328
328
|
],
|
|
329
329
|
get stateItems() {
|
|
330
|
-
return
|
|
330
|
+
return xe(this);
|
|
331
331
|
}
|
|
332
332
|
},
|
|
333
|
-
[
|
|
333
|
+
[he.F_COUNTRY.enum.SG]: {
|
|
334
334
|
states: [],
|
|
335
335
|
get stateItems() {
|
|
336
|
-
return
|
|
336
|
+
return xe(this);
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
|
-
[
|
|
339
|
+
[he.F_COUNTRY.enum.ID]: {
|
|
340
340
|
states: [
|
|
341
341
|
"Aceh",
|
|
342
342
|
"Bali",
|
|
@@ -373,10 +373,94 @@ const Tt = {
|
|
|
373
373
|
"West Sumatra"
|
|
374
374
|
],
|
|
375
375
|
get stateItems() {
|
|
376
|
-
return
|
|
376
|
+
return xe(this);
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
[he.F_COUNTRY.enum.TH]: {
|
|
380
|
+
states: [
|
|
381
|
+
"Bangkok",
|
|
382
|
+
"Amnat Charoen",
|
|
383
|
+
"Ang Thong",
|
|
384
|
+
"Bueng Kan",
|
|
385
|
+
"Buri Ram",
|
|
386
|
+
"Chachoengsao",
|
|
387
|
+
"Chai Nat",
|
|
388
|
+
"Chaiyaphum",
|
|
389
|
+
"Chanthaburi",
|
|
390
|
+
"Chiang Mai",
|
|
391
|
+
"Chiang Rai",
|
|
392
|
+
"Chonburi",
|
|
393
|
+
"Chumphon",
|
|
394
|
+
"Kalasin",
|
|
395
|
+
"Kamphaeng Phet",
|
|
396
|
+
"Kanchanaburi",
|
|
397
|
+
"Khon Kaen",
|
|
398
|
+
"Krabi",
|
|
399
|
+
"Lampang",
|
|
400
|
+
"Lamphun",
|
|
401
|
+
"Loei",
|
|
402
|
+
"Lopburi",
|
|
403
|
+
"Mae Hong Son",
|
|
404
|
+
"Maha Sarakham",
|
|
405
|
+
"Mukdahan",
|
|
406
|
+
"Nakhon Nayok",
|
|
407
|
+
"Nakhon Pathom",
|
|
408
|
+
"Nakhon Phanom",
|
|
409
|
+
"Nakhon Ratchasima",
|
|
410
|
+
"Nakhon Sawan",
|
|
411
|
+
"Nakhon Si Thammarat",
|
|
412
|
+
"Nan",
|
|
413
|
+
"Narathiwat",
|
|
414
|
+
"Nong Bua Lamphu",
|
|
415
|
+
"Nong Khai",
|
|
416
|
+
"Nonthaburi",
|
|
417
|
+
"Pathum Thani",
|
|
418
|
+
"Pattani",
|
|
419
|
+
"Phang Nga",
|
|
420
|
+
"Phatthalung",
|
|
421
|
+
"Phayao",
|
|
422
|
+
"Phetchabun",
|
|
423
|
+
"Phetchaburi",
|
|
424
|
+
"Phichit",
|
|
425
|
+
"Phitsanulok",
|
|
426
|
+
"Phra Nakhon Si Ayutthaya",
|
|
427
|
+
"Phrae",
|
|
428
|
+
"Phuket",
|
|
429
|
+
"Prachinburi",
|
|
430
|
+
"Prachuap Khiri Khan",
|
|
431
|
+
"Ranong",
|
|
432
|
+
"Ratchaburi",
|
|
433
|
+
"Rayong",
|
|
434
|
+
"Roi Et",
|
|
435
|
+
"Sa Kaeo",
|
|
436
|
+
"Sakon Nakhon",
|
|
437
|
+
"Samut Prakan",
|
|
438
|
+
"Samut Sakhon",
|
|
439
|
+
"Samut Songkhram",
|
|
440
|
+
"Saraburi",
|
|
441
|
+
"Satun",
|
|
442
|
+
"Sing Buri",
|
|
443
|
+
"Sisaket",
|
|
444
|
+
"Songkhla",
|
|
445
|
+
"Sukhothai",
|
|
446
|
+
"Suphan Buri",
|
|
447
|
+
"Surat Thani",
|
|
448
|
+
"Surin",
|
|
449
|
+
"Tak",
|
|
450
|
+
"Trang",
|
|
451
|
+
"Trat",
|
|
452
|
+
"Ubon Ratchathani",
|
|
453
|
+
"Udon Thani",
|
|
454
|
+
"Uthai Thani",
|
|
455
|
+
"Uttaradit",
|
|
456
|
+
"Yala",
|
|
457
|
+
"Yasothon"
|
|
458
|
+
],
|
|
459
|
+
get stateItems() {
|
|
460
|
+
return xe(this);
|
|
377
461
|
}
|
|
378
462
|
}
|
|
379
|
-
}, pe = () =>
|
|
463
|
+
}, pe = () => N.Config.getCountry(), ye = {
|
|
380
464
|
get fullCurrency() {
|
|
381
465
|
return pe().currency;
|
|
382
466
|
},
|
|
@@ -384,30 +468,30 @@ const Tt = {
|
|
|
384
468
|
return pe().currency.code;
|
|
385
469
|
},
|
|
386
470
|
get fullTax() {
|
|
387
|
-
return
|
|
471
|
+
return N.Country.getCountryFlattenTaxes(pe().code);
|
|
388
472
|
},
|
|
389
473
|
get taxSystem() {
|
|
390
474
|
return pe().taxSystems;
|
|
391
475
|
},
|
|
392
|
-
taxInclusion(
|
|
476
|
+
taxInclusion(v) {
|
|
393
477
|
return ye.taxSystem.map((x) => ({
|
|
394
478
|
systemCode: x.code,
|
|
395
|
-
inclusive:
|
|
479
|
+
inclusive: v !== void 0 ? v : !1
|
|
396
480
|
}));
|
|
397
481
|
},
|
|
398
482
|
groupedTaxOptions() {
|
|
399
|
-
const
|
|
483
|
+
const v = N.Country.getCountryFlattenTaxes(pe().code);
|
|
400
484
|
return ye.taxSystem.map((x) => ({
|
|
401
485
|
code: x.code,
|
|
402
|
-
options:
|
|
486
|
+
options: v.map((l) => ({ ...l, feedmeTaxCode: ye.generateCode(l) })).filter((l) => l.systemCode === x.code)
|
|
403
487
|
}));
|
|
404
488
|
},
|
|
405
|
-
systemDefaultCode(
|
|
406
|
-
const x = ye.groupedTaxOptions().find((
|
|
407
|
-
return x == null ? void 0 : x.options.find((
|
|
489
|
+
systemDefaultCode(v) {
|
|
490
|
+
const x = ye.groupedTaxOptions().find((l) => l.code === v);
|
|
491
|
+
return x == null ? void 0 : x.options.find((l) => l.default);
|
|
408
492
|
},
|
|
409
|
-
generateCode(
|
|
410
|
-
return `${
|
|
493
|
+
generateCode(v) {
|
|
494
|
+
return `${v.systemCode}/${v.taxCode}`;
|
|
411
495
|
}
|
|
412
496
|
}, ne = ye, Ut = /* @__PURE__ */ ee({
|
|
413
497
|
__name: "TaxInclusiveSetting",
|
|
@@ -419,18 +503,18 @@ const Tt = {
|
|
|
419
503
|
}
|
|
420
504
|
},
|
|
421
505
|
emits: ["update:model-value"],
|
|
422
|
-
setup(
|
|
423
|
-
const
|
|
506
|
+
setup(v, { emit: x }) {
|
|
507
|
+
const l = v, f = ne.taxSystem, r = x, b = R(l.modelValue);
|
|
424
508
|
function o(c, y) {
|
|
425
|
-
const d = ue.clone(
|
|
426
|
-
|
|
509
|
+
const d = ue.clone(l.modelValue), V = d.findIndex((a) => a.systemCode === c);
|
|
510
|
+
V >= 0 ? d[V].inclusive = y : d.push({
|
|
427
511
|
systemCode: c,
|
|
428
512
|
inclusive: y
|
|
429
|
-
}), b.value = d,
|
|
513
|
+
}), b.value = d, r("update:model-value", d);
|
|
430
514
|
}
|
|
431
515
|
function m() {
|
|
432
516
|
return f.map((c) => {
|
|
433
|
-
const y =
|
|
517
|
+
const y = l.modelValue ? l.modelValue.find((d) => d.systemCode === c.code) : !1;
|
|
434
518
|
return {
|
|
435
519
|
label: c.name,
|
|
436
520
|
config: {
|
|
@@ -442,31 +526,31 @@ const Tt = {
|
|
|
442
526
|
};
|
|
443
527
|
});
|
|
444
528
|
}
|
|
445
|
-
const u =
|
|
529
|
+
const u = Ke(m());
|
|
446
530
|
function t(c, y) {
|
|
447
531
|
return `${c} ${y ? "Inclusive" : "Exclusive"}`;
|
|
448
532
|
}
|
|
449
533
|
return fe(() => {
|
|
450
|
-
|
|
534
|
+
l.modelValue.length || o(f[0].code, !1);
|
|
451
535
|
}), we(
|
|
452
|
-
() =>
|
|
536
|
+
() => l.modelValue,
|
|
453
537
|
(c, y) => {
|
|
454
538
|
c != y && !c.length && o(f[0].code, !1);
|
|
455
539
|
}
|
|
456
540
|
), (c, y) => {
|
|
457
541
|
const d = h("FmSwitch");
|
|
458
|
-
return
|
|
459
|
-
var
|
|
460
|
-
return
|
|
461
|
-
|
|
462
|
-
"model-value": ((
|
|
542
|
+
return g(!0), B(X, null, re(e(u), (V, a) => {
|
|
543
|
+
var S;
|
|
544
|
+
return g(), B("div", { key: a }, [
|
|
545
|
+
i(d, {
|
|
546
|
+
"model-value": ((S = e(b)[a]) == null ? void 0 : S.inclusive) || !1,
|
|
463
547
|
"label-placement": "left",
|
|
464
|
-
"onUpdate:modelValue": (
|
|
548
|
+
"onUpdate:modelValue": (k) => V.input(k)
|
|
465
549
|
}, {
|
|
466
550
|
label: T(() => {
|
|
467
|
-
var
|
|
551
|
+
var k;
|
|
468
552
|
return [
|
|
469
|
-
_("div", null, L(t(
|
|
553
|
+
_("div", null, L(t(V.label, ((k = e(b)[a]) == null ? void 0 : k.inclusive) || !1)), 1)
|
|
470
554
|
];
|
|
471
555
|
}),
|
|
472
556
|
_: 2
|
|
@@ -477,53 +561,53 @@ const Tt = {
|
|
|
477
561
|
}
|
|
478
562
|
});
|
|
479
563
|
var Rt = { mode: "development", appMode: "mf" };
|
|
480
|
-
const It = { class: "space-y-8" },
|
|
564
|
+
const It = { class: "space-y-8" }, Bt = {
|
|
481
565
|
key: 0,
|
|
482
566
|
class: "space-y-16"
|
|
483
|
-
},
|
|
567
|
+
}, Nt = /* @__PURE__ */ ee({
|
|
484
568
|
__name: "StripeSetting",
|
|
485
569
|
props: {
|
|
486
570
|
modelValue: {}
|
|
487
571
|
},
|
|
488
572
|
emits: ["update:modelValue"],
|
|
489
|
-
setup(
|
|
490
|
-
const
|
|
491
|
-
we(
|
|
492
|
-
m != o && (!
|
|
573
|
+
setup(v, { emit: x }) {
|
|
574
|
+
const l = v, f = x, r = R(!1);
|
|
575
|
+
we(r, (o, m) => {
|
|
576
|
+
m != o && (!l.modelValue && o ? f("update:modelValue", {
|
|
493
577
|
apiKey: "",
|
|
494
578
|
webhookSecret: ""
|
|
495
579
|
}) : o || f("update:modelValue", void 0));
|
|
496
580
|
});
|
|
497
581
|
const b = j(() => {
|
|
498
|
-
const o = Rt.mode === "development", m =
|
|
499
|
-
return `https://marketing${o ? "-dev" : ""}${u}.feedmeapi.com/stripe/${
|
|
582
|
+
const o = Rt.mode === "development", m = N.Config.getCountry().code.toLowerCase(), u = m != "my" ? `.${m}` : "";
|
|
583
|
+
return `https://marketing${o ? "-dev" : ""}${u}.feedmeapi.com/stripe/${ze.getBusinessId()}/webhook`;
|
|
500
584
|
});
|
|
501
585
|
return fe(() => {
|
|
502
|
-
|
|
586
|
+
r.value = !!l.modelValue;
|
|
503
587
|
}), (o, m) => {
|
|
504
588
|
const u = h("FmSwitch"), t = h("FmTextField"), c = h("FmButton");
|
|
505
|
-
return
|
|
506
|
-
|
|
507
|
-
modelValue: e(
|
|
508
|
-
"onUpdate:modelValue": m[0] || (m[0] = (y) => oe(
|
|
589
|
+
return g(), B("div", It, [
|
|
590
|
+
i(u, {
|
|
591
|
+
modelValue: e(r),
|
|
592
|
+
"onUpdate:modelValue": m[0] || (m[0] = (y) => oe(r) ? r.value = y : null),
|
|
509
593
|
value: "true",
|
|
510
594
|
label: "Enable Stripe"
|
|
511
595
|
}, null, 8, ["modelValue"]),
|
|
512
|
-
|
|
513
|
-
|
|
596
|
+
l.modelValue ? (g(), B("div", Bt, [
|
|
597
|
+
i(t, {
|
|
514
598
|
label: "API Key",
|
|
515
|
-
modelValue:
|
|
516
|
-
"onUpdate:modelValue": m[1] || (m[1] = (y) =>
|
|
599
|
+
modelValue: l.modelValue.apiKey,
|
|
600
|
+
"onUpdate:modelValue": m[1] || (m[1] = (y) => l.modelValue.apiKey = y),
|
|
517
601
|
"helper-text": "Go to Stripe Dashboard get your API Key and paste here."
|
|
518
602
|
}, null, 8, ["modelValue"]),
|
|
519
|
-
|
|
603
|
+
i(t, {
|
|
520
604
|
label: "Webhook URL",
|
|
521
605
|
"model-value": e(b),
|
|
522
606
|
readonly: "",
|
|
523
607
|
"helper-text": "Copy this URL to your Stripe dashboard"
|
|
524
608
|
}, {
|
|
525
609
|
append: T(() => [
|
|
526
|
-
|
|
610
|
+
i(c, {
|
|
527
611
|
icon: "content_copy",
|
|
528
612
|
variant: "tertiary",
|
|
529
613
|
onClick: m[2] || (m[2] = (y) => e(Ge)(e(b)))
|
|
@@ -531,28 +615,28 @@ const It = { class: "space-y-8" }, Dt = {
|
|
|
531
615
|
]),
|
|
532
616
|
_: 1
|
|
533
617
|
}, 8, ["model-value"]),
|
|
534
|
-
|
|
535
|
-
modelValue:
|
|
536
|
-
"onUpdate:modelValue": m[3] || (m[3] = (y) =>
|
|
618
|
+
i(t, {
|
|
619
|
+
modelValue: l.modelValue.webhookSecret,
|
|
620
|
+
"onUpdate:modelValue": m[3] || (m[3] = (y) => l.modelValue.webhookSecret = y),
|
|
537
621
|
label: "Webhook Secret",
|
|
538
622
|
"helper-text": `Copy the webhook signing secret from your Stripe account and paste
|
|
539
623
|
here.`
|
|
540
624
|
}, null, 8, ["modelValue"])
|
|
541
|
-
])) :
|
|
625
|
+
])) : M("", !0)
|
|
542
626
|
]);
|
|
543
627
|
};
|
|
544
628
|
}
|
|
545
|
-
}),
|
|
629
|
+
}), Dt = {
|
|
546
630
|
key: 0,
|
|
547
631
|
class: "space-y-16 pr-12"
|
|
548
|
-
},
|
|
632
|
+
}, At = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Mt = {
|
|
549
633
|
key: 1,
|
|
550
634
|
class: "space-y-16"
|
|
551
|
-
},
|
|
635
|
+
}, Ot = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Et = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, jt = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, Lt = { class: "space-y-4" }, Kt = { class: "fm-typo-en-body-lg-400" }, Ht = { class: "space-y-16" }, qt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Yt = { class: "flex items-center gap-8" }, Wt = /* @__PURE__ */ ee({
|
|
552
636
|
__name: "StoreSettingSheet",
|
|
553
637
|
emits: ["update"],
|
|
554
|
-
setup(
|
|
555
|
-
const { t: f } = be(),
|
|
638
|
+
setup(v, { expose: x, emit: l }) {
|
|
639
|
+
const { t: f } = be(), r = l, b = R(!1), o = R(), m = R(!1), u = Qe.extend({
|
|
556
640
|
company: et.extend({
|
|
557
641
|
name: Q.string().min(1, "Company name is required"),
|
|
558
642
|
regNo: Q.string().min(1, "Registration number is required"),
|
|
@@ -569,8 +653,8 @@ const It = { class: "space-y-8" }, Dt = {
|
|
|
569
653
|
})
|
|
570
654
|
}), t = j(() => u.safeParse(o.value).success);
|
|
571
655
|
function c() {
|
|
572
|
-
const
|
|
573
|
-
|
|
656
|
+
const V = u.safeParse(o.value);
|
|
657
|
+
V.success && r("update", V.data);
|
|
574
658
|
}
|
|
575
659
|
function y() {
|
|
576
660
|
return {
|
|
@@ -582,7 +666,7 @@ const It = { class: "space-y-8" }, Dt = {
|
|
|
582
666
|
city: "",
|
|
583
667
|
postcode: "",
|
|
584
668
|
state: "",
|
|
585
|
-
country:
|
|
669
|
+
country: N.Config.getCountry().name
|
|
586
670
|
},
|
|
587
671
|
phoneNo: "",
|
|
588
672
|
regNo: "",
|
|
@@ -591,117 +675,117 @@ const It = { class: "space-y-8" }, Dt = {
|
|
|
591
675
|
inclusiveTaxes: []
|
|
592
676
|
};
|
|
593
677
|
}
|
|
594
|
-
function d(
|
|
595
|
-
b.value =
|
|
678
|
+
function d(V, a) {
|
|
679
|
+
b.value = V, V && (o.value = a != null && a.company ? a : y());
|
|
596
680
|
}
|
|
597
681
|
return x({
|
|
598
682
|
showSheet: d,
|
|
599
683
|
data: o
|
|
600
|
-
}), (
|
|
601
|
-
const
|
|
602
|
-
return
|
|
684
|
+
}), (V, a) => {
|
|
685
|
+
const S = h("FmIcon"), k = h("FmMenuItem"), D = h("FmMenu"), Y = h("FmSelect"), z = h("FmButton"), K = h("FmSideSheet");
|
|
686
|
+
return g(), I(K, {
|
|
603
687
|
"max-width": 560,
|
|
604
688
|
modelValue: e(b),
|
|
605
|
-
"onUpdate:modelValue":
|
|
689
|
+
"onUpdate:modelValue": a[15] || (a[15] = (W) => oe(b) ? b.value = W : null),
|
|
606
690
|
header: e(f)("connect.store.setting.title")
|
|
607
691
|
}, {
|
|
608
692
|
"side-sheet-footer": T(() => [
|
|
609
|
-
_("div",
|
|
610
|
-
|
|
693
|
+
_("div", Yt, [
|
|
694
|
+
i(z, {
|
|
611
695
|
label: e(f)("connect.common.save"),
|
|
612
696
|
onClick: c,
|
|
613
|
-
disabled: !e(t) || e(
|
|
614
|
-
loading: e(
|
|
697
|
+
disabled: !e(t) || e(Se)().isLoading,
|
|
698
|
+
loading: e(Se)().isLoading
|
|
615
699
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
616
|
-
|
|
700
|
+
i(z, {
|
|
617
701
|
label: e(f)("connect.common.cancel"),
|
|
618
|
-
onClick:
|
|
702
|
+
onClick: a[14] || (a[14] = (W) => d(!1)),
|
|
619
703
|
variant: "tertiary"
|
|
620
704
|
}, null, 8, ["label"])
|
|
621
705
|
])
|
|
622
706
|
]),
|
|
623
707
|
default: T(() => {
|
|
624
|
-
var
|
|
708
|
+
var W, ae;
|
|
625
709
|
return [
|
|
626
|
-
|
|
627
|
-
e(o) && e(o).company ? (
|
|
628
|
-
_("div",
|
|
629
|
-
|
|
710
|
+
i(Pe, { json: e(o) }, null, 8, ["json"]),
|
|
711
|
+
e(o) && e(o).company ? (g(), B("div", Dt, [
|
|
712
|
+
_("div", At, L(e(f)("connect.store.setting.company.legal_info")), 1),
|
|
713
|
+
i(te, {
|
|
630
714
|
modelValue: e(o).company.name,
|
|
631
|
-
"onUpdate:modelValue":
|
|
715
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => e(o).company.name = s),
|
|
632
716
|
label: e(f)("connect.store.setting.company.name"),
|
|
633
717
|
schema: e(Z).typeAtPath(e(u), "company.name")
|
|
634
718
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
635
|
-
|
|
719
|
+
i(te, {
|
|
636
720
|
modelValue: e(o).company.regNo,
|
|
637
|
-
"onUpdate:modelValue":
|
|
721
|
+
"onUpdate:modelValue": a[1] || (a[1] = (s) => e(o).company.regNo = s),
|
|
638
722
|
label: e(f)("connect.store.setting.company.reg_no"),
|
|
639
723
|
schema: e(Z).typeAtPath(e(u), "company.regNo")
|
|
640
724
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
641
|
-
e(
|
|
725
|
+
e(N.Config).getCountry().taxSystems.length ? (g(), I(te, {
|
|
642
726
|
key: 0,
|
|
643
727
|
modelValue: e(o).company.sstRegNo,
|
|
644
728
|
"onUpdate:modelValue": [
|
|
645
|
-
|
|
646
|
-
|
|
729
|
+
a[2] || (a[2] = (s) => e(o).company.sstRegNo = s),
|
|
730
|
+
a[3] || (a[3] = (s) => s ? null : e(o).inclusiveTaxes = [])
|
|
647
731
|
],
|
|
648
732
|
label: e(f)("connect.store.setting.company.tax_reg_no"),
|
|
649
733
|
schema: e(Z).typeAtPath(e(u), "company.sstRegNo")
|
|
650
|
-
}, null, 8, ["modelValue", "label", "schema"])) :
|
|
651
|
-
(
|
|
652
|
-
_("div",
|
|
653
|
-
|
|
734
|
+
}, null, 8, ["modelValue", "label", "schema"])) : M("", !0),
|
|
735
|
+
(W = e(o).company) != null && W.sstRegNo && e(o).inclusiveTaxes ? (g(), B("div", Mt, [
|
|
736
|
+
_("div", Ot, L(e(f)("connect.store.setting.company.tax")), 1),
|
|
737
|
+
i(Ut, {
|
|
654
738
|
modelValue: e(o).inclusiveTaxes,
|
|
655
|
-
"onUpdate:modelValue":
|
|
739
|
+
"onUpdate:modelValue": a[4] || (a[4] = (s) => e(o).inclusiveTaxes = s)
|
|
656
740
|
}, null, 8, ["modelValue"])
|
|
657
|
-
])) :
|
|
658
|
-
|
|
741
|
+
])) : M("", !0),
|
|
742
|
+
i(te, {
|
|
659
743
|
modelValue: e(o).company.phoneNo,
|
|
660
|
-
"onUpdate:modelValue":
|
|
744
|
+
"onUpdate:modelValue": a[5] || (a[5] = (s) => e(o).company.phoneNo = s),
|
|
661
745
|
label: e(f)("connect.store.setting.company.phone"),
|
|
662
746
|
schema: e(Z).typeAtPath(e(u), "company.phoneNo")
|
|
663
747
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
664
748
|
_("div", Et, L(e(f)("connect.store.setting.company.address.title")), 1),
|
|
665
|
-
|
|
749
|
+
i(te, {
|
|
666
750
|
modelValue: e(o).company.address.line1,
|
|
667
|
-
"onUpdate:modelValue":
|
|
751
|
+
"onUpdate:modelValue": a[6] || (a[6] = (s) => e(o).company.address.line1 = s),
|
|
668
752
|
label: e(f)("connect.store.setting.company.address.line1"),
|
|
669
753
|
schema: e(Z).typeAtPath(e(u), "company.address.line1")
|
|
670
754
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
671
|
-
|
|
755
|
+
i(te, {
|
|
672
756
|
modelValue: e(o).company.address.line2,
|
|
673
|
-
"onUpdate:modelValue":
|
|
757
|
+
"onUpdate:modelValue": a[7] || (a[7] = (s) => e(o).company.address.line2 = s),
|
|
674
758
|
label: e(f)("connect.store.setting.company.address.line2"),
|
|
675
759
|
schema: e(Z).typeAtPath(e(u), "company.address.line2")
|
|
676
760
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
677
761
|
_("div", jt, [
|
|
678
|
-
|
|
762
|
+
i(te, {
|
|
679
763
|
modelValue: e(o).company.address.city,
|
|
680
|
-
"onUpdate:modelValue":
|
|
764
|
+
"onUpdate:modelValue": a[8] || (a[8] = (s) => e(o).company.address.city = s),
|
|
681
765
|
label: e(f)("connect.store.setting.company.address.city"),
|
|
682
766
|
schema: e(Z).typeAtPath(e(u), "company.address.city")
|
|
683
767
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
684
|
-
|
|
768
|
+
i(te, {
|
|
685
769
|
modelValue: e(o).company.address.postcode,
|
|
686
|
-
"onUpdate:modelValue":
|
|
770
|
+
"onUpdate:modelValue": a[9] || (a[9] = (s) => e(o).company.address.postcode = s),
|
|
687
771
|
label: e(f)("connect.store.setting.company.address.postcode"),
|
|
688
772
|
schema: e(Z).typeAtPath(e(u), "company.address.postcode")
|
|
689
773
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
690
774
|
_("div", Lt, [
|
|
691
|
-
_("div",
|
|
692
|
-
|
|
775
|
+
_("div", Kt, L(e(f)("connect.store.setting.company.address.state")), 1),
|
|
776
|
+
i(D, {
|
|
693
777
|
placement: "top-end",
|
|
694
778
|
"model-value": e(m)
|
|
695
779
|
}, {
|
|
696
780
|
"menu-button": T(() => [
|
|
697
|
-
|
|
781
|
+
i(te, {
|
|
698
782
|
modelValue: e(o).company.address.state,
|
|
699
|
-
"onUpdate:modelValue":
|
|
783
|
+
"onUpdate:modelValue": a[10] || (a[10] = (s) => e(o).company.address.state = s),
|
|
700
784
|
schema: e(Z).typeAtPath(e(u), "company.address.state"),
|
|
701
|
-
onFocusChanged:
|
|
785
|
+
onFocusChanged: a[11] || (a[11] = (s) => m.value = s)
|
|
702
786
|
}, {
|
|
703
787
|
append: T(() => [
|
|
704
|
-
|
|
788
|
+
i(S, {
|
|
705
789
|
name: e(m) ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
706
790
|
}, null, 8, ["name"])
|
|
707
791
|
]),
|
|
@@ -709,12 +793,12 @@ const It = { class: "space-y-8" }, Dt = {
|
|
|
709
793
|
}, 8, ["modelValue", "schema"])
|
|
710
794
|
]),
|
|
711
795
|
default: T(() => [
|
|
712
|
-
(
|
|
796
|
+
(g(!0), B(X, null, re(e(Tt)[e(N.Config).getCountry().code].stateItems.filter(
|
|
713
797
|
(s) => {
|
|
714
798
|
var w, U;
|
|
715
799
|
return s.label.toLowerCase().includes(((U = (w = e(o)) == null ? void 0 : w.company) == null ? void 0 : U.address.state.toLowerCase()) ?? "");
|
|
716
800
|
}
|
|
717
|
-
) || [], (s) => (
|
|
801
|
+
) || [], (s) => (g(), I(k, {
|
|
718
802
|
key: s.value,
|
|
719
803
|
"model-value": e(o).company.address.state === s.value,
|
|
720
804
|
label: s.label,
|
|
@@ -726,27 +810,27 @@ const It = { class: "space-y-8" }, Dt = {
|
|
|
726
810
|
_: 1
|
|
727
811
|
}, 8, ["model-value"])
|
|
728
812
|
]),
|
|
729
|
-
|
|
813
|
+
i(Y, {
|
|
730
814
|
label: e(f)("connect.store.setting.company.address.country"),
|
|
731
815
|
modelValue: e(o).company.address.country,
|
|
732
|
-
"onUpdate:modelValue":
|
|
816
|
+
"onUpdate:modelValue": a[12] || (a[12] = (s) => e(o).company.address.country = s),
|
|
733
817
|
items: [
|
|
734
818
|
{
|
|
735
|
-
label: e(
|
|
736
|
-
value: e(
|
|
819
|
+
label: e(N.Config).getCountry().name,
|
|
820
|
+
value: e(N.Config).getCountry().name
|
|
737
821
|
}
|
|
738
822
|
],
|
|
739
823
|
rules: [e(Z).ruleAtPath(e(u), "company.address.country")]
|
|
740
824
|
}, null, 8, ["label", "modelValue", "items", "rules"])
|
|
741
825
|
]),
|
|
742
|
-
_("div",
|
|
743
|
-
_("div",
|
|
744
|
-
|
|
745
|
-
"model-value": (
|
|
746
|
-
"onUpdate:modelValue":
|
|
826
|
+
_("div", Ht, [
|
|
827
|
+
_("div", qt, L(e(f)("connect.store.setting.stripe.title")), 1),
|
|
828
|
+
i(Nt, {
|
|
829
|
+
"model-value": (ae = e(o)) == null ? void 0 : ae.stripe,
|
|
830
|
+
"onUpdate:modelValue": a[13] || (a[13] = (s) => e(o).stripe = s)
|
|
747
831
|
}, null, 8, ["model-value"])
|
|
748
832
|
])
|
|
749
|
-
])) :
|
|
833
|
+
])) : M("", !0)
|
|
750
834
|
];
|
|
751
835
|
}),
|
|
752
836
|
_: 1
|
|
@@ -754,8 +838,8 @@ const It = { class: "space-y-8" }, Dt = {
|
|
|
754
838
|
};
|
|
755
839
|
}
|
|
756
840
|
});
|
|
757
|
-
function
|
|
758
|
-
return
|
|
841
|
+
function zt(v, x = !0) {
|
|
842
|
+
return N.DineroFactory(v).toFormat(x);
|
|
759
843
|
}
|
|
760
844
|
const Jt = /* @__PURE__ */ ee({
|
|
761
845
|
__name: "TaxVariantSetting",
|
|
@@ -767,23 +851,23 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
767
851
|
}
|
|
768
852
|
},
|
|
769
853
|
emits: ["update:modelValue"],
|
|
770
|
-
setup(
|
|
771
|
-
const
|
|
854
|
+
setup(v, { emit: x }) {
|
|
855
|
+
const l = v, f = x;
|
|
772
856
|
fe(() => {
|
|
773
857
|
if (o.value.length !== b.value.length) {
|
|
774
858
|
const t = b.value.reduce((c, y) => {
|
|
775
859
|
const d = ne.systemDefaultCode(y.name);
|
|
776
860
|
if (!d) return c;
|
|
777
|
-
const { systemCode:
|
|
778
|
-
return y.value || c.push({ systemCode:
|
|
861
|
+
const { systemCode: V, taxCode: a } = d;
|
|
862
|
+
return y.value || c.push({ systemCode: V, taxCode: a }), c;
|
|
779
863
|
}, []);
|
|
780
864
|
u(t);
|
|
781
865
|
}
|
|
782
866
|
});
|
|
783
|
-
function
|
|
867
|
+
function r() {
|
|
784
868
|
return ne.groupedTaxOptions();
|
|
785
869
|
}
|
|
786
|
-
const b = j(() =>
|
|
870
|
+
const b = j(() => r().map((t) => ({
|
|
787
871
|
name: t.code,
|
|
788
872
|
value: (o.value || []).find(
|
|
789
873
|
(c) => t.options.some((y) => y.feedmeTaxCode === c)
|
|
@@ -792,46 +876,46 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
792
876
|
label: `${c.name} (${it(c.rate)}%)`,
|
|
793
877
|
value: c.feedmeTaxCode
|
|
794
878
|
}))
|
|
795
|
-
}))), o = j(() =>
|
|
879
|
+
}))), o = j(() => l.modelValue.map((t) => ne.generateCode(t)));
|
|
796
880
|
function m(t) {
|
|
797
|
-
const c =
|
|
798
|
-
(
|
|
799
|
-
), y = c == null ? void 0 : c.options.find((
|
|
881
|
+
const c = r().find(
|
|
882
|
+
(a) => a.options.some((S) => S.feedmeTaxCode === t)
|
|
883
|
+
), y = c == null ? void 0 : c.options.find((a) => a.feedmeTaxCode === t);
|
|
800
884
|
if (!y) return;
|
|
801
|
-
const { systemCode: d, taxCode:
|
|
802
|
-
u([{ systemCode: d, taxCode:
|
|
885
|
+
const { systemCode: d, taxCode: V } = y;
|
|
886
|
+
u([{ systemCode: d, taxCode: V }]);
|
|
803
887
|
}
|
|
804
888
|
function u(t) {
|
|
805
|
-
const c = ue.clone(
|
|
889
|
+
const c = ue.clone(l.modelValue);
|
|
806
890
|
t.forEach((y) => {
|
|
807
|
-
const d =
|
|
808
|
-
(
|
|
809
|
-
),
|
|
810
|
-
(
|
|
891
|
+
const d = r().find(
|
|
892
|
+
(S) => S.options.some((k) => k.feedmeTaxCode === ne.generateCode(y))
|
|
893
|
+
), V = (d == null ? void 0 : d.options) || [], a = c.findIndex(
|
|
894
|
+
(S) => V.some((k) => ne.generateCode(k) === ne.generateCode(S))
|
|
811
895
|
);
|
|
812
|
-
|
|
896
|
+
a >= 0 ? c.splice(a, 1, y) : c.push(y);
|
|
813
897
|
}), f("update:modelValue", c);
|
|
814
898
|
}
|
|
815
899
|
return (t, c) => {
|
|
816
900
|
const y = h("FmRadio"), d = h("FmRadioGroup");
|
|
817
|
-
return
|
|
818
|
-
key:
|
|
901
|
+
return g(!0), B(X, null, re(e(b), (V) => (g(), B("div", {
|
|
902
|
+
key: V.name,
|
|
819
903
|
class: "flex items-start"
|
|
820
904
|
}, [
|
|
821
|
-
|
|
822
|
-
modelValue:
|
|
905
|
+
i(d, {
|
|
906
|
+
modelValue: V.value,
|
|
823
907
|
"onUpdate:modelValue": [
|
|
824
|
-
(
|
|
825
|
-
c[0] || (c[0] = (
|
|
826
|
-
m(
|
|
908
|
+
(a) => V.value = a,
|
|
909
|
+
c[0] || (c[0] = (a) => {
|
|
910
|
+
m(a);
|
|
827
911
|
})
|
|
828
912
|
]
|
|
829
913
|
}, {
|
|
830
914
|
default: T(() => [
|
|
831
|
-
(
|
|
832
|
-
key:
|
|
833
|
-
value:
|
|
834
|
-
label:
|
|
915
|
+
(g(!0), B(X, null, re(V.options, (a, S) => (g(), I(y, {
|
|
916
|
+
key: S,
|
|
917
|
+
value: a.value,
|
|
918
|
+
label: a.label
|
|
835
919
|
}, null, 8, ["value", "label"]))), 128))
|
|
836
920
|
]),
|
|
837
921
|
_: 2
|
|
@@ -839,13 +923,13 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
839
923
|
]))), 128);
|
|
840
924
|
};
|
|
841
925
|
}
|
|
842
|
-
}),
|
|
926
|
+
}), Ve = {
|
|
843
927
|
get _id() {
|
|
844
928
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
845
929
|
},
|
|
846
930
|
name: "",
|
|
847
|
-
price:
|
|
848
|
-
originalPrice:
|
|
931
|
+
price: N.Dinero.zero().toObject(),
|
|
932
|
+
originalPrice: N.Dinero.zero().toObject(),
|
|
849
933
|
vouchers: [],
|
|
850
934
|
credit: {
|
|
851
935
|
normal: 0,
|
|
@@ -865,18 +949,18 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
865
949
|
}, Gt = {
|
|
866
950
|
key: 0,
|
|
867
951
|
class: "space-y-24 pr-12"
|
|
868
|
-
}, Xt = { class: "space-y-8" }, Zt = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, Qt = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, en = { class: "fm-typo-en-title-sm-800 !mb-[-
|
|
952
|
+
}, Xt = { class: "space-y-8" }, Zt = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, Qt = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, en = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, tn = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, nn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, on = { class: "space-y-8" }, an = { class: "flex items-center justify-between" }, ln = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, sn = { class: "space-y-8" }, rn = { class: "flex items-center gap-8" }, dn = /* @__PURE__ */ ee({
|
|
869
953
|
__name: "EditBundleSheet",
|
|
870
954
|
emits: ["update"],
|
|
871
|
-
setup(
|
|
872
|
-
const f =
|
|
955
|
+
setup(v, { expose: x, emit: l }) {
|
|
956
|
+
const f = l, { t: r } = be(), b = ke(), o = R(!1), m = R([]), u = R({
|
|
873
957
|
category: 0,
|
|
874
958
|
index: -1,
|
|
875
959
|
originalCategoryIndex: void 0
|
|
876
|
-
}), t = R(ue.cloneDeep(
|
|
960
|
+
}), t = R(ue.cloneDeep(Ve)), c = R(), y = Ae, d = j(() => {
|
|
877
961
|
const p = y.safeParse(t.value);
|
|
878
962
|
return p.success ? [] : p.error.errors;
|
|
879
|
-
}),
|
|
963
|
+
}), V = [
|
|
880
964
|
{
|
|
881
965
|
header: "Reward title",
|
|
882
966
|
accessorFn: (p) => p.collectible.name,
|
|
@@ -896,10 +980,10 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
896
980
|
cell(p) {
|
|
897
981
|
var C;
|
|
898
982
|
const n = p.row.original;
|
|
899
|
-
return n.collectible.type == "VOUCHER" || n.selectedReward == null ? n.description :
|
|
900
|
-
"onUpdate:modelValue": (
|
|
983
|
+
return n.collectible.type == "VOUCHER" || n.selectedReward == null ? n.description : qe(We.FmStepperField, {
|
|
984
|
+
"onUpdate:modelValue": (P) => {
|
|
901
985
|
t.value.titles = t.value.titles.map(
|
|
902
|
-
(E) => E.id == n.collectible._id ? { ...E, dayToExpire:
|
|
986
|
+
(E) => E.id == n.collectible._id ? { ...E, dayToExpire: P } : E
|
|
903
987
|
);
|
|
904
988
|
},
|
|
905
989
|
modelValue: ((C = n.selectedReward) == null ? void 0 : C.extra) ?? 0,
|
|
@@ -907,20 +991,22 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
907
991
|
helperState: J(d.value, "titles"),
|
|
908
992
|
helperText: G(d.value, "titles"),
|
|
909
993
|
max: 9999,
|
|
910
|
-
rules: [(
|
|
994
|
+
rules: [(P) => P <= 9999 || "Maximum 9999 days allowed"],
|
|
911
995
|
showSteppers: !1,
|
|
912
996
|
disabled: !!t.value.stripePriceId
|
|
913
997
|
});
|
|
914
998
|
}
|
|
915
999
|
}
|
|
916
|
-
],
|
|
917
|
-
const n =
|
|
1000
|
+
], a = R([]), S = j(() => b.bundleRewards.map((p) => {
|
|
1001
|
+
const n = k.value.find((P) => P.id == p._id), C = p.type === "VOUCHER" ? `${p.options.maxUse} use(s), ${dt(
|
|
1002
|
+
p.options.validityOption || {}
|
|
1003
|
+
)}` : "No expiry";
|
|
918
1004
|
return {
|
|
919
1005
|
collectible: p,
|
|
920
1006
|
description: C,
|
|
921
1007
|
selectedReward: n
|
|
922
1008
|
};
|
|
923
|
-
})),
|
|
1009
|
+
})), k = j(() => {
|
|
924
1010
|
var p, n;
|
|
925
1011
|
return [
|
|
926
1012
|
...((p = t.value) == null ? void 0 : p.titles.map((C) => ({
|
|
@@ -932,192 +1018,194 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
932
1018
|
extra: void 0
|
|
933
1019
|
}))) ?? []
|
|
934
1020
|
];
|
|
935
|
-
}),
|
|
1021
|
+
}), D = j(
|
|
936
1022
|
() => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
|
|
937
1023
|
);
|
|
938
|
-
function
|
|
1024
|
+
function Y(p) {
|
|
939
1025
|
t.value.subscriptionValidity = p;
|
|
940
1026
|
for (const n of t.value.titles)
|
|
941
1027
|
n.dayToExpire = p;
|
|
942
1028
|
t.value.credit.free && (t.value.credit.free.day = p);
|
|
943
1029
|
}
|
|
944
|
-
function
|
|
945
|
-
const p =
|
|
1030
|
+
function z() {
|
|
1031
|
+
const p = S.value, n = t.value;
|
|
946
1032
|
if (!(!n || !p))
|
|
947
1033
|
for (let C = 0; C < p.length; C++) {
|
|
948
|
-
const
|
|
949
|
-
|
|
950
|
-
(
|
|
1034
|
+
const P = p[C];
|
|
1035
|
+
K.value[C] ? P.collectible.type == "TITLE" ? n.titles.findIndex(
|
|
1036
|
+
(H) => H.id == P.collectible._id
|
|
951
1037
|
) < 0 && n.titles.push({
|
|
952
|
-
id:
|
|
953
|
-
dayToExpire:
|
|
1038
|
+
id: P.collectible._id,
|
|
1039
|
+
dayToExpire: D.value
|
|
954
1040
|
}) : n.vouchers.findIndex(
|
|
955
|
-
(
|
|
956
|
-
) < 0 && n.vouchers.push(
|
|
957
|
-
(
|
|
1041
|
+
(H) => H == P.collectible._id
|
|
1042
|
+
) < 0 && n.vouchers.push(P.collectible._id) : (n.titles = n.titles.filter((q) => q.id != P.collectible._id), n.vouchers = n.vouchers.filter(
|
|
1043
|
+
(q) => q != P.collectible._id
|
|
958
1044
|
));
|
|
959
1045
|
}
|
|
960
1046
|
}
|
|
961
|
-
const
|
|
962
|
-
we(
|
|
963
|
-
const
|
|
1047
|
+
const K = R({});
|
|
1048
|
+
we(K, z, { deep: !0 });
|
|
1049
|
+
const W = j(() => {
|
|
964
1050
|
var p, n;
|
|
965
1051
|
return (n = (p = b.storeOption) == null ? void 0 : p.company) == null ? void 0 : n.sstRegNo;
|
|
966
|
-
}),
|
|
1052
|
+
}), ae = j(() => {
|
|
967
1053
|
var p, n, C;
|
|
968
1054
|
return (C = (n = (p = b.storeOption) == null ? void 0 : p.inclusiveTaxes) == null ? void 0 : n[0]) != null && C.inclusive ? "Inclusive" : "Exclusive";
|
|
969
1055
|
}), s = j(() => {
|
|
970
1056
|
var p, n, C;
|
|
971
1057
|
return mt(
|
|
972
1058
|
ne.fullTax,
|
|
973
|
-
|
|
1059
|
+
He(t.value.taxes),
|
|
974
1060
|
t.value.price,
|
|
975
1061
|
Number(t.value.credit.normal),
|
|
976
1062
|
((p = b.storeOption) == null ? void 0 : p.inclusiveTaxes) ?? [],
|
|
977
|
-
(C = (n = b.storeOption) == null ? void 0 : n.company) != null && C.sstRegNo ? ne.taxSystem.map((
|
|
1063
|
+
(C = (n = b.storeOption) == null ? void 0 : n.company) != null && C.sstRegNo ? ne.taxSystem.map((P) => P.code) : []
|
|
978
1064
|
);
|
|
979
1065
|
}), w = j(() => s.value.reduce(
|
|
980
1066
|
(n, C) => n.add(C.total),
|
|
981
1067
|
rt()
|
|
982
1068
|
).toFormat()), U = j(() => {
|
|
983
|
-
var
|
|
1069
|
+
var P;
|
|
984
1070
|
const p = pt(
|
|
985
1071
|
s.value,
|
|
986
1072
|
t.value.price,
|
|
987
|
-
((
|
|
1073
|
+
((P = b.storeOption) == null ? void 0 : P.inclusiveTaxes) ?? []
|
|
988
1074
|
);
|
|
989
1075
|
t.value.priceWithTaxes = p;
|
|
990
|
-
const n =
|
|
1076
|
+
const n = zt(p, !1), C = Number(n.replace(/[^\d.-]/g, ""));
|
|
991
1077
|
return Number.isNaN(C) ? 0 : C;
|
|
992
1078
|
});
|
|
993
|
-
function
|
|
994
|
-
t.value.taxTotals = s.value, f("update",
|
|
1079
|
+
function O() {
|
|
1080
|
+
t.value.taxTotals = s.value, f("update", Ae.parse(Je(t.value)));
|
|
995
1081
|
}
|
|
996
|
-
function
|
|
997
|
-
return ue.cloneDeep(
|
|
1082
|
+
function $() {
|
|
1083
|
+
return ue.cloneDeep(Ve);
|
|
998
1084
|
}
|
|
999
|
-
function
|
|
1000
|
-
o.value = p, p && n && (c.value = void 0, m.value = n.categories, t.value = n.bundle ||
|
|
1085
|
+
function A(p, n) {
|
|
1086
|
+
o.value = p, p && n && (c.value = void 0, m.value = n.categories, t.value = n.bundle || $(), u.value.category = n.category, u.value.index = n.index, u.value.originalCategoryIndex = n.category, K.value = S.value.reduce((C, P, E) => (C[E] = !!P.selectedReward, C), {}));
|
|
1001
1087
|
}
|
|
1002
1088
|
return x({
|
|
1003
|
-
showSheet:
|
|
1089
|
+
showSheet: A,
|
|
1004
1090
|
bundleImage: c,
|
|
1005
1091
|
target: u,
|
|
1006
1092
|
data: t
|
|
1007
1093
|
}), (p, n) => {
|
|
1008
|
-
const C = h("FmSwitch"),
|
|
1009
|
-
return
|
|
1094
|
+
const C = h("FmSwitch"), P = h("FmHelperText"), E = h("FmTextField"), q = h("FmSelect"), H = h("FmStepperField"), ie = h("FmMenuItem"), ge = h("FmTable"), ce = h("FmButton"), ve = h("FmSideSheet");
|
|
1095
|
+
return g(), I(ve, {
|
|
1010
1096
|
"max-width": 768,
|
|
1011
1097
|
modelValue: e(o),
|
|
1012
|
-
"onUpdate:modelValue": n[20] || (n[20] = (
|
|
1013
|
-
header: e(u).index != -1 ? e(
|
|
1098
|
+
"onUpdate:modelValue": n[20] || (n[20] = (le) => oe(o) ? o.value = le : null),
|
|
1099
|
+
header: e(u).index != -1 ? e(r)("connect.store.bundle.edit.title") : e(r)("connect.store.bundle.edit.create")
|
|
1014
1100
|
}, {
|
|
1015
1101
|
"side-sheet-footer": T(() => [
|
|
1016
|
-
_("div",
|
|
1017
|
-
|
|
1102
|
+
_("div", rn, [
|
|
1103
|
+
i(ce, {
|
|
1018
1104
|
label: e(u).index != -1 ? "Save" : "Add",
|
|
1019
|
-
onClick:
|
|
1105
|
+
onClick: O,
|
|
1020
1106
|
disabled: e(d).length > 0,
|
|
1021
|
-
loading: e(
|
|
1107
|
+
loading: e(Se)().isLoading
|
|
1022
1108
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
1023
|
-
|
|
1109
|
+
i(ce, {
|
|
1024
1110
|
label: "Cancel",
|
|
1025
|
-
onClick: n[19] || (n[19] = (
|
|
1111
|
+
onClick: n[19] || (n[19] = (le) => A(!1)),
|
|
1026
1112
|
variant: "tertiary"
|
|
1027
1113
|
})
|
|
1028
1114
|
])
|
|
1029
1115
|
]),
|
|
1030
1116
|
default: T(() => {
|
|
1031
|
-
var
|
|
1117
|
+
var le, $e, Te, Ue, Re, Ie, Be, Ne;
|
|
1032
1118
|
return [
|
|
1033
|
-
|
|
1034
|
-
e(t) ? (
|
|
1119
|
+
i(Pe, { json: e(t) }, null, 8, ["json"]),
|
|
1120
|
+
e(t) ? (g(), B("div", Gt, [
|
|
1035
1121
|
_("div", Xt, [
|
|
1036
|
-
e(
|
|
1122
|
+
e(N.Config).getCountry().code == "MY" && ((le = e(b).payoutAccount) == null ? void 0 : le.status) == "APPROVED" && (($e = e(b).payoutAccount) != null && $e.enable) ? (g(), I(C, {
|
|
1037
1123
|
key: 0,
|
|
1038
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
1039
|
-
e(t).isFeedvibe =
|
|
1124
|
+
"onUpdate:modelValue": n[0] || (n[0] = (F) => {
|
|
1125
|
+
e(t).isFeedvibe = F, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], K.value = {});
|
|
1040
1126
|
}),
|
|
1041
1127
|
"label-placement": "right",
|
|
1042
1128
|
"model-value": e(t).isFeedvibe || !1,
|
|
1043
1129
|
label: "Feedvibe Campaign",
|
|
1044
1130
|
sublabel: "Bundle will be appear for Feedvibe campaign use"
|
|
1045
|
-
}, null, 8, ["model-value"])) :
|
|
1046
|
-
e(t).isFeedvibe ? (
|
|
1131
|
+
}, null, 8, ["model-value"])) : M("", !0),
|
|
1132
|
+
e(t).isFeedvibe ? (g(), I(P, {
|
|
1047
1133
|
key: 1,
|
|
1048
1134
|
text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app",
|
|
1049
1135
|
state: "warning"
|
|
1050
|
-
})) :
|
|
1136
|
+
})) : M("", !0)
|
|
1051
1137
|
]),
|
|
1052
|
-
_("div", Zt, L(e(
|
|
1053
|
-
|
|
1054
|
-
label: e(
|
|
1138
|
+
_("div", Zt, L(e(r)("connect.store.bundle.edit.basicInformation")), 1),
|
|
1139
|
+
i(E, {
|
|
1140
|
+
label: e(r)("connect.store.bundle.edit.bundleName"),
|
|
1055
1141
|
modelValue: e(t).name,
|
|
1056
|
-
"onUpdate:modelValue": n[1] || (n[1] = (
|
|
1142
|
+
"onUpdate:modelValue": n[1] || (n[1] = (F) => e(t).name = F),
|
|
1057
1143
|
"helper-state": e(J)(e(d), "name"),
|
|
1058
1144
|
"helper-text": e(G)(e(d), "name")
|
|
1059
1145
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1060
|
-
|
|
1146
|
+
i(q, {
|
|
1061
1147
|
modelValue: e(u).category,
|
|
1062
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
1148
|
+
"onUpdate:modelValue": n[2] || (n[2] = (F) => e(u).category = F),
|
|
1063
1149
|
label: "Store Category",
|
|
1064
|
-
items: e(m).map((
|
|
1150
|
+
items: e(m).map((F, Le) => ({ label: F, value: Le }))
|
|
1065
1151
|
}, null, 8, ["modelValue", "items"]),
|
|
1066
|
-
|
|
1067
|
-
label: e(
|
|
1152
|
+
i(at, {
|
|
1153
|
+
label: e(r)("connect.store.bundle.edit.bundleImage"),
|
|
1068
1154
|
class: "w-1/2 xs:w-2/3",
|
|
1069
1155
|
"aspect-ratio": "16/9",
|
|
1070
1156
|
thumbnail: e(t).image ?? void 0,
|
|
1071
1157
|
file: e(c) ?? void 0,
|
|
1072
|
-
"onUpdate:file": n[3] || (n[3] = (
|
|
1073
|
-
c.value =
|
|
1158
|
+
"onUpdate:file": n[3] || (n[3] = (F) => {
|
|
1159
|
+
c.value = F;
|
|
1074
1160
|
}),
|
|
1075
1161
|
"helper-state": e(J)(e(d), "image"),
|
|
1076
1162
|
"helper-text": e(G)(e(d), "image")
|
|
1077
1163
|
}, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
|
|
1078
|
-
|
|
1079
|
-
"model-value": e(
|
|
1080
|
-
label: e(
|
|
1164
|
+
i(H, {
|
|
1165
|
+
"model-value": e(N.Dinero).fromFdoDinero(e(t).price).toUnit(),
|
|
1166
|
+
label: e(r)("connect.store.bundle.edit.bundlePrice"),
|
|
1081
1167
|
min: 0,
|
|
1082
1168
|
"max-fraction-digits": 2,
|
|
1083
|
-
"onUpdate:modelValue": n[4] || (n[4] = (
|
|
1084
|
-
e(t).price.amount =
|
|
1169
|
+
"onUpdate:modelValue": n[4] || (n[4] = (F) => {
|
|
1170
|
+
e(t).price.amount = F * 10 ** e(t).price.precision;
|
|
1085
1171
|
}),
|
|
1086
1172
|
"is-currency": !0,
|
|
1087
1173
|
"show-steppers": !1,
|
|
1088
|
-
"helper-text": e(G)(e(d), "price") || `${e(
|
|
1174
|
+
"helper-text": e(G)(e(d), "price") || `${e(N.Dinero).fromNumber({ number: 1 }).toFormat(
|
|
1175
|
+
!0
|
|
1176
|
+
)} = ${e(N.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
|
|
1089
1177
|
"helper-state": e(J)(e(d), "price")
|
|
1090
1178
|
}, {
|
|
1091
1179
|
prepend: T(() => [
|
|
1092
|
-
de(L(e(
|
|
1180
|
+
de(L(e(N.Dinero).defaultCurrency()), 1)
|
|
1093
1181
|
]),
|
|
1094
1182
|
_: 1
|
|
1095
1183
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
1096
|
-
|
|
1097
|
-
"model-value": e(
|
|
1098
|
-
label: e(
|
|
1184
|
+
i(H, {
|
|
1185
|
+
"model-value": e(N.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
|
|
1186
|
+
label: e(r)("connect.store.bundle.edit.bundleValue"),
|
|
1099
1187
|
min: 0,
|
|
1100
1188
|
"max-fraction-digits": 2,
|
|
1101
|
-
"onUpdate:modelValue": n[5] || (n[5] = (
|
|
1102
|
-
e(t).originalPrice || (e(t).originalPrice = e(
|
|
1189
|
+
"onUpdate:modelValue": n[5] || (n[5] = (F) => {
|
|
1190
|
+
e(t).originalPrice || (e(t).originalPrice = e(N.Dinero).zero().toObject()), e(t).originalPrice.amount = F * 10 ** e(t).originalPrice.precision;
|
|
1103
1191
|
}),
|
|
1104
1192
|
"is-currency": !0,
|
|
1105
1193
|
"show-steppers": !1,
|
|
1106
|
-
"helper-text": e(G)(e(d), "originalPrice") || e(
|
|
1194
|
+
"helper-text": e(G)(e(d), "originalPrice") || e(r)("connect.store.bundle.edit.originalPriceHelper"),
|
|
1107
1195
|
"helper-state": e(J)(e(d), "originalPrice")
|
|
1108
1196
|
}, {
|
|
1109
1197
|
prepend: T(() => [
|
|
1110
|
-
de(L(e(
|
|
1198
|
+
de(L(e(N.Dinero).defaultCurrency()), 1)
|
|
1111
1199
|
]),
|
|
1112
1200
|
_: 1
|
|
1113
1201
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
1114
|
-
e(t).isFeedvibe ?
|
|
1202
|
+
e(t).isFeedvibe ? M("", !0) : (g(), I(H, {
|
|
1115
1203
|
key: 0,
|
|
1116
1204
|
"model-value": e(t).coinPrice ?? null,
|
|
1117
|
-
label: e(
|
|
1205
|
+
label: e(r)("connect.store.bundle.edit.pointNeeded"),
|
|
1118
1206
|
min: 0,
|
|
1119
|
-
"onUpdate:modelValue": n[6] || (n[6] = (
|
|
1120
|
-
|
|
1207
|
+
"onUpdate:modelValue": n[6] || (n[6] = (F) => {
|
|
1208
|
+
F > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = F;
|
|
1121
1209
|
}),
|
|
1122
1210
|
"show-steppers": !1,
|
|
1123
1211
|
"helper-state": e(J)(e(d), "coinPrice"),
|
|
@@ -1128,32 +1216,32 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1128
1216
|
])),
|
|
1129
1217
|
_: 1
|
|
1130
1218
|
}, 8, ["model-value", "label", "helper-state", "helper-text"])),
|
|
1131
|
-
(Te = e(b).storeOption) != null && Te.stripe && !e(t).isFeedvibe ? (
|
|
1132
|
-
_("div", Qt, L(e(
|
|
1133
|
-
|
|
1134
|
-
label: e(
|
|
1219
|
+
(Te = e(b).storeOption) != null && Te.stripe && !e(t).isFeedvibe ? (g(), B(X, { key: 1 }, [
|
|
1220
|
+
_("div", Qt, L(e(r)("connect.store.bundle.edit.subscriptionSettings")), 1),
|
|
1221
|
+
i(E, {
|
|
1222
|
+
label: e(r)("connect.store.bundle.edit.stripePriceId"),
|
|
1135
1223
|
modelValue: e(t).stripePriceId,
|
|
1136
|
-
"onUpdate:modelValue": n[7] || (n[7] = (
|
|
1224
|
+
"onUpdate:modelValue": n[7] || (n[7] = (F) => e(t).stripePriceId = F),
|
|
1137
1225
|
"helper-state": e(J)(e(d), "stripePriceId"),
|
|
1138
1226
|
"helper-text": e(G)(e(d), "stripePriceId")
|
|
1139
1227
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1140
|
-
e(t).stripePriceId ? (
|
|
1228
|
+
e(t).stripePriceId ? (g(), I(H, {
|
|
1141
1229
|
key: 0,
|
|
1142
1230
|
"model-value": e(t).subscriptionValidity ?? null,
|
|
1143
1231
|
min: 1,
|
|
1144
|
-
"onUpdate:modelValue":
|
|
1145
|
-
label: e(
|
|
1232
|
+
"onUpdate:modelValue": Y,
|
|
1233
|
+
label: e(r)("connect.store.bundle.edit.subscriptionValidity"),
|
|
1146
1234
|
"show-steppers": !1,
|
|
1147
1235
|
"helper-state": e(J)(e(d), "subscriptionValidity"),
|
|
1148
1236
|
"helper-text": e(G)(e(d), "subscriptionValidity")
|
|
1149
|
-
}, null, 8, ["model-value", "label", "helper-state", "helper-text"])) :
|
|
1150
|
-
], 64)) :
|
|
1151
|
-
e(t).isFeedvibe ?
|
|
1152
|
-
|
|
1153
|
-
|
|
1237
|
+
}, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : M("", !0)
|
|
1238
|
+
], 64)) : M("", !0),
|
|
1239
|
+
e(t).isFeedvibe ? M("", !0) : (g(), B(X, { key: 2 }, [
|
|
1240
|
+
_("div", en, L(e(r)("connect.store.bundle.edit.credit")), 1),
|
|
1241
|
+
i(H, {
|
|
1154
1242
|
modelValue: e(t).credit.normal,
|
|
1155
|
-
"onUpdate:modelValue": n[8] || (n[8] = (
|
|
1156
|
-
label: "
|
|
1243
|
+
"onUpdate:modelValue": n[8] || (n[8] = (F) => e(t).credit.normal = F),
|
|
1244
|
+
label: e(r)("connect.store.bundle.edit.normalCredit"),
|
|
1157
1245
|
"show-steppers": !1,
|
|
1158
1246
|
"helper-state": e(J)(e(d), "credit.normal"),
|
|
1159
1247
|
"helper-text": e(G)(e(d), "credit.normal")
|
|
@@ -1162,17 +1250,17 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1162
1250
|
de(" credit ")
|
|
1163
1251
|
])),
|
|
1164
1252
|
_: 1
|
|
1165
|
-
}, 8, ["modelValue", "helper-state", "helper-text"]),
|
|
1166
|
-
|
|
1253
|
+
}, 8, ["modelValue", "label", "helper-state", "helper-text"]),
|
|
1254
|
+
i(H, {
|
|
1167
1255
|
"model-value": ((Ue = e(t).credit.free) == null ? void 0 : Ue.amount) ?? null,
|
|
1168
1256
|
min: 0,
|
|
1169
|
-
"onUpdate:modelValue": n[9] || (n[9] = (
|
|
1257
|
+
"onUpdate:modelValue": n[9] || (n[9] = (F) => {
|
|
1170
1258
|
e(t).credit.free || (e(t).credit.free = {
|
|
1171
1259
|
amount: 0,
|
|
1172
1260
|
day: 1
|
|
1173
|
-
}), e(t).credit.free.amount =
|
|
1261
|
+
}), e(t).credit.free.amount = F;
|
|
1174
1262
|
}),
|
|
1175
|
-
label: "
|
|
1263
|
+
label: e(r)("connect.store.bundle.edit.freeCredit"),
|
|
1176
1264
|
"show-steppers": !1,
|
|
1177
1265
|
"helper-state": e(J)(e(d), "credit.free.amount"),
|
|
1178
1266
|
"helper-text": e(G)(e(d), "credit.free.amount")
|
|
@@ -1181,17 +1269,17 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1181
1269
|
de(" credit ")
|
|
1182
1270
|
])),
|
|
1183
1271
|
_: 1
|
|
1184
|
-
}, 8, ["model-value", "helper-state", "helper-text"]),
|
|
1185
|
-
(Re = e(t).credit.free) != null && Re.amount ? (
|
|
1272
|
+
}, 8, ["model-value", "label", "helper-state", "helper-text"]),
|
|
1273
|
+
(Re = e(t).credit.free) != null && Re.amount ? (g(), I(H, {
|
|
1186
1274
|
key: 0,
|
|
1187
1275
|
disabled: !!e(t).stripePriceId,
|
|
1188
1276
|
"model-value": ((Ie = e(t).credit.free) == null ? void 0 : Ie.day) ?? null,
|
|
1189
1277
|
min: 0,
|
|
1190
|
-
"onUpdate:modelValue": n[10] || (n[10] = (
|
|
1278
|
+
"onUpdate:modelValue": n[10] || (n[10] = (F) => {
|
|
1191
1279
|
e(t).credit.free || (e(t).credit.free = {
|
|
1192
1280
|
amount: 0,
|
|
1193
1281
|
day: 1
|
|
1194
|
-
}), e(t).credit.free.day = e(
|
|
1282
|
+
}), e(t).credit.free.day = e(D) || F;
|
|
1195
1283
|
}),
|
|
1196
1284
|
label: "Free credit valid for",
|
|
1197
1285
|
"show-steppers": !1,
|
|
@@ -1202,39 +1290,39 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1202
1290
|
de(" day(s) ")
|
|
1203
1291
|
])),
|
|
1204
1292
|
_: 1
|
|
1205
|
-
}, 8, ["disabled", "model-value", "helper-state", "helper-text"])) :
|
|
1293
|
+
}, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : M("", !0)
|
|
1206
1294
|
], 64)),
|
|
1207
|
-
e(
|
|
1208
|
-
n[
|
|
1209
|
-
|
|
1295
|
+
e(W) ? (g(), B(X, { key: 3 }, [
|
|
1296
|
+
n[25] || (n[25] = _("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1)),
|
|
1297
|
+
i(Jt, {
|
|
1210
1298
|
modelValue: e(t).taxes,
|
|
1211
|
-
"onUpdate:modelValue": n[11] || (n[11] = (
|
|
1299
|
+
"onUpdate:modelValue": n[11] || (n[11] = (F) => e(t).taxes = F)
|
|
1212
1300
|
}, null, 8, ["modelValue"]),
|
|
1213
|
-
|
|
1214
|
-
label: `Tax Charged (${e(
|
|
1301
|
+
i(E, {
|
|
1302
|
+
label: `Tax Charged (${e(ae)})`,
|
|
1215
1303
|
"model-value": e(w),
|
|
1216
1304
|
disabled: ""
|
|
1217
1305
|
}, null, 8, ["label", "model-value"])
|
|
1218
|
-
], 64)) :
|
|
1219
|
-
|
|
1306
|
+
], 64)) : M("", !0),
|
|
1307
|
+
i(H, {
|
|
1220
1308
|
label: "Total Price",
|
|
1221
1309
|
"model-value": e(U),
|
|
1222
1310
|
disabled: !0
|
|
1223
1311
|
}, null, 8, ["model-value"]),
|
|
1224
|
-
_("div",
|
|
1225
|
-
_("div",
|
|
1226
|
-
_("div",
|
|
1227
|
-
_("div",
|
|
1228
|
-
|
|
1229
|
-
label: `Reward type: ${e(
|
|
1312
|
+
_("div", tn, L(e(r)("connect.store.bundle.edit.bundleReward.title")), 1),
|
|
1313
|
+
_("div", nn, L(e(r)("connect.store.bundle.edit.bundleReward.description")), 1),
|
|
1314
|
+
_("div", on, [
|
|
1315
|
+
_("div", an, [
|
|
1316
|
+
i(lt, {
|
|
1317
|
+
label: `Reward type: ${e(a).length == 0 ? "All" : e(a)[0].name}`
|
|
1230
1318
|
}, {
|
|
1231
1319
|
default: T(() => [
|
|
1232
|
-
|
|
1233
|
-
onClick: n[12] || (n[12] = (
|
|
1320
|
+
i(ie, {
|
|
1321
|
+
onClick: n[12] || (n[12] = (F) => a.value = []),
|
|
1234
1322
|
label: "All"
|
|
1235
1323
|
}),
|
|
1236
|
-
|
|
1237
|
-
onClick: n[13] || (n[13] = (
|
|
1324
|
+
i(ie, {
|
|
1325
|
+
onClick: n[13] || (n[13] = (F) => a.value = [
|
|
1238
1326
|
{
|
|
1239
1327
|
id: "type",
|
|
1240
1328
|
value: "VOUCHER",
|
|
@@ -1243,8 +1331,8 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1243
1331
|
]),
|
|
1244
1332
|
label: e(me).VOUCHER.name
|
|
1245
1333
|
}, null, 8, ["label"]),
|
|
1246
|
-
|
|
1247
|
-
onClick: n[14] || (n[14] = (
|
|
1334
|
+
i(ie, {
|
|
1335
|
+
onClick: n[14] || (n[14] = (F) => a.value = [
|
|
1248
1336
|
{
|
|
1249
1337
|
id: "type",
|
|
1250
1338
|
value: "TITLE",
|
|
@@ -1257,98 +1345,98 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1257
1345
|
_: 1
|
|
1258
1346
|
}, 8, ["label"])
|
|
1259
1347
|
]),
|
|
1260
|
-
|
|
1261
|
-
modelValue: e(
|
|
1262
|
-
"onUpdate:modelValue": n[15] || (n[15] = (
|
|
1348
|
+
i(ge, {
|
|
1349
|
+
modelValue: e(K),
|
|
1350
|
+
"onUpdate:modelValue": n[15] || (n[15] = (F) => oe(K) ? K.value = F : null),
|
|
1263
1351
|
selection: "multiple",
|
|
1264
|
-
"column-filter": e(
|
|
1265
|
-
"column-defs":
|
|
1266
|
-
"row-data": e(
|
|
1267
|
-
(
|
|
1352
|
+
"column-filter": e(a),
|
|
1353
|
+
"column-defs": V,
|
|
1354
|
+
"row-data": e(S).filter(
|
|
1355
|
+
(F) => !e(t).isFeedvibe || F.collectible.type == "VOUCHER"
|
|
1268
1356
|
),
|
|
1269
|
-
"hide-footer": e(
|
|
1357
|
+
"hide-footer": e(S).length <= 10
|
|
1270
1358
|
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
|
|
1271
|
-
|
|
1359
|
+
i(P, {
|
|
1272
1360
|
text: e(G)(e(d), "titles"),
|
|
1273
1361
|
state: e(J)(e(d), "titles")
|
|
1274
1362
|
}, null, 8, ["text", "state"])
|
|
1275
1363
|
]),
|
|
1276
|
-
_("div", ln, L(e(
|
|
1277
|
-
_("div",
|
|
1278
|
-
|
|
1364
|
+
_("div", ln, L(e(r)("connect.store.bundle.edit.advanceSetting")), 1),
|
|
1365
|
+
_("div", sn, [
|
|
1366
|
+
i(C, {
|
|
1279
1367
|
"model-value": e(t).internal ?? !1,
|
|
1280
|
-
"onUpdate:modelValue": n[16] || (n[16] = (
|
|
1368
|
+
"onUpdate:modelValue": n[16] || (n[16] = (F) => e(t).internal = F),
|
|
1281
1369
|
"label-placement": "right",
|
|
1282
|
-
label: e(
|
|
1283
|
-
sublabel: e(
|
|
1370
|
+
label: e(r)("connect.store.bundle.edit.internalBundle"),
|
|
1371
|
+
sublabel: e(r)("connect.store.bundle.edit.internalBundleDescription")
|
|
1284
1372
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1285
|
-
|
|
1373
|
+
i(C, {
|
|
1286
1374
|
"model-value": e(t).hideInPos ?? !1,
|
|
1287
|
-
"onUpdate:modelValue": n[17] || (n[17] = (
|
|
1375
|
+
"onUpdate:modelValue": n[17] || (n[17] = (F) => e(t).hideInPos = F),
|
|
1288
1376
|
"label-placement": "right",
|
|
1289
|
-
label: e(
|
|
1290
|
-
sublabel: e(
|
|
1377
|
+
label: e(r)("connect.store.bundle.edit.hideInPos"),
|
|
1378
|
+
sublabel: e(r)("connect.store.bundle.edit.hideInPosDescription")
|
|
1291
1379
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1292
|
-
|
|
1293
|
-
"model-value": ((
|
|
1294
|
-
"onUpdate:modelValue": n[18] || (n[18] = (
|
|
1295
|
-
label: e(
|
|
1380
|
+
i(H, {
|
|
1381
|
+
"model-value": ((Ne = (Be = e(t).config) == null ? void 0 : Be.options) == null ? void 0 : Ne.maxPerUser) || null,
|
|
1382
|
+
"onUpdate:modelValue": n[18] || (n[18] = (F) => e(ue).set(e(t), "config.options.maxPerUser", F)),
|
|
1383
|
+
label: e(r)("connect.store.bundle.edit.maxPerUser"),
|
|
1296
1384
|
"show-steppers": !1,
|
|
1297
1385
|
placeholder: "Unlimited"
|
|
1298
1386
|
}, null, 8, ["model-value", "label"])
|
|
1299
1387
|
])
|
|
1300
|
-
])) :
|
|
1388
|
+
])) : M("", !0)
|
|
1301
1389
|
];
|
|
1302
1390
|
}),
|
|
1303
1391
|
_: 1
|
|
1304
1392
|
}, 8, ["modelValue", "header"]);
|
|
1305
1393
|
};
|
|
1306
1394
|
}
|
|
1307
|
-
}),
|
|
1395
|
+
}), un = { class: "flex gap-8 items-center flex-wrap" }, cn = { class: "flex items-center gap-8" }, mn = /* @__PURE__ */ ee({
|
|
1308
1396
|
__name: "SendBundleSheet",
|
|
1309
1397
|
emits: ["success"],
|
|
1310
|
-
setup(
|
|
1311
|
-
const { minor: f } = Ee,
|
|
1398
|
+
setup(v, { expose: x, emit: l }) {
|
|
1399
|
+
const { minor: f } = Ee, r = R(), b = R(""), o = R(""), m = R([]), u = R(!1), t = R();
|
|
1312
1400
|
R(!0);
|
|
1313
|
-
function c(
|
|
1314
|
-
u.value = !0, b.value = null, o.value = "",
|
|
1401
|
+
function c(S) {
|
|
1402
|
+
u.value = !0, b.value = null, o.value = "", r.value = S.bundle;
|
|
1315
1403
|
}
|
|
1316
1404
|
function y() {
|
|
1317
1405
|
u.value = !1;
|
|
1318
1406
|
}
|
|
1319
|
-
async function d(
|
|
1320
|
-
const
|
|
1407
|
+
async function d(S) {
|
|
1408
|
+
const k = await ut.read({
|
|
1321
1409
|
limit: 25,
|
|
1322
1410
|
skip: 0,
|
|
1323
1411
|
sortBy: "_id",
|
|
1324
|
-
search:
|
|
1412
|
+
search: S,
|
|
1325
1413
|
descending: !1
|
|
1326
1414
|
});
|
|
1327
|
-
m.value =
|
|
1328
|
-
label: `${
|
|
1329
|
-
value:
|
|
1330
|
-
})), await new Promise((
|
|
1415
|
+
m.value = k.resources.map((D) => ({
|
|
1416
|
+
label: `${D.name} (${D.phoneNumber})`,
|
|
1417
|
+
value: D._id
|
|
1418
|
+
})), await new Promise((D) => setTimeout(D, 100));
|
|
1331
1419
|
}
|
|
1332
|
-
async function
|
|
1333
|
-
if (!
|
|
1334
|
-
const
|
|
1335
|
-
(
|
|
1420
|
+
async function V() {
|
|
1421
|
+
if (!r.value || !b.value) return;
|
|
1422
|
+
const S = m.value.find(
|
|
1423
|
+
(D) => D.value === b.value
|
|
1336
1424
|
);
|
|
1337
|
-
await
|
|
1338
|
-
`Are you sure you want to send bundle ${
|
|
1425
|
+
await _e.confirm(
|
|
1426
|
+
`Are you sure you want to send bundle ${r.value.name} to ${S == null ? void 0 : S.label}?`,
|
|
1339
1427
|
"Confirm",
|
|
1340
1428
|
"Confirm",
|
|
1341
1429
|
"Cancel"
|
|
1342
1430
|
) && await f(
|
|
1343
1431
|
async () => {
|
|
1344
|
-
const
|
|
1345
|
-
bundle:
|
|
1432
|
+
const D = {
|
|
1433
|
+
bundle: r.value._id,
|
|
1346
1434
|
member: b.value,
|
|
1347
1435
|
source: nt.enum.ADMIN,
|
|
1348
1436
|
ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${o.value}`,
|
|
1349
1437
|
withCoin: !1
|
|
1350
1438
|
};
|
|
1351
|
-
await
|
|
1439
|
+
await Ce.sendBundle(D), y();
|
|
1352
1440
|
},
|
|
1353
1441
|
{
|
|
1354
1442
|
message: "Sending bundle",
|
|
@@ -1356,100 +1444,100 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1356
1444
|
}
|
|
1357
1445
|
);
|
|
1358
1446
|
}
|
|
1359
|
-
const
|
|
1360
|
-
var
|
|
1361
|
-
const
|
|
1362
|
-
return ((
|
|
1363
|
-
`${
|
|
1364
|
-
), (
|
|
1447
|
+
const a = j(() => {
|
|
1448
|
+
var k, D, Y;
|
|
1449
|
+
const S = [];
|
|
1450
|
+
return ((k = r.value) == null ? void 0 : k.price.amount) > 0 && S.push(
|
|
1451
|
+
`${N.Config.getCountry().currency.symbol}${je((D = r.value) == null ? void 0 : D.price)}`
|
|
1452
|
+
), (Y = r.value) != null && Y.coinPrice && S.push(`${r.value.coinPrice} point(s)`), S.join(" or ");
|
|
1365
1453
|
});
|
|
1366
1454
|
return x({
|
|
1367
1455
|
showSheet: c,
|
|
1368
1456
|
hideSheet: y
|
|
1369
1457
|
}), fe(async () => {
|
|
1370
1458
|
await d("");
|
|
1371
|
-
}), (
|
|
1372
|
-
const
|
|
1373
|
-
return
|
|
1459
|
+
}), (S, k) => {
|
|
1460
|
+
const D = h("FmCardMedia"), Y = h("FmCardHeader"), z = h("FmChip"), K = h("FmCardSection"), W = h("FmCard"), ae = h("FmSelect"), s = h("FmTextField"), w = h("FmForm"), U = h("FmButton"), O = h("FmSideSheet");
|
|
1461
|
+
return g(), I(O, {
|
|
1374
1462
|
"max-width": 560,
|
|
1375
1463
|
"dismiss-away": !0,
|
|
1376
1464
|
header: "Send bundle to member",
|
|
1377
1465
|
modelValue: e(u),
|
|
1378
1466
|
"onUpdate:modelValue": [
|
|
1379
|
-
|
|
1380
|
-
|
|
1467
|
+
k[4] || (k[4] = ($) => oe(u) ? u.value = $ : null),
|
|
1468
|
+
k[5] || (k[5] = ($) => u.value = $)
|
|
1381
1469
|
]
|
|
1382
1470
|
}, {
|
|
1383
1471
|
"side-sheet-footer": T(() => [
|
|
1384
|
-
_("div",
|
|
1385
|
-
|
|
1472
|
+
_("div", cn, [
|
|
1473
|
+
i(U, {
|
|
1386
1474
|
label: "Send",
|
|
1387
|
-
loading: e(
|
|
1388
|
-
onClick:
|
|
1389
|
-
var
|
|
1390
|
-
return (
|
|
1475
|
+
loading: e(Se)().isLoading,
|
|
1476
|
+
onClick: k[2] || (k[2] = async () => {
|
|
1477
|
+
var $;
|
|
1478
|
+
return ($ = e(t)) == null ? void 0 : $.validateInputs();
|
|
1391
1479
|
})
|
|
1392
1480
|
}, null, 8, ["loading"]),
|
|
1393
|
-
|
|
1481
|
+
i(U, {
|
|
1394
1482
|
label: "Cancel",
|
|
1395
1483
|
type: "button",
|
|
1396
1484
|
variant: "tertiary",
|
|
1397
|
-
onClick:
|
|
1485
|
+
onClick: k[3] || (k[3] = ($) => u.value = !1)
|
|
1398
1486
|
})
|
|
1399
1487
|
])
|
|
1400
1488
|
]),
|
|
1401
1489
|
default: T(() => [
|
|
1402
|
-
|
|
1490
|
+
i(w, {
|
|
1403
1491
|
class: "space-y-16",
|
|
1404
1492
|
ref_key: "form",
|
|
1405
1493
|
ref: t,
|
|
1406
|
-
onValidationSuccess:
|
|
1494
|
+
onValidationSuccess: V,
|
|
1407
1495
|
blameFormChildOnValidationFailed: ""
|
|
1408
1496
|
}, {
|
|
1409
1497
|
default: T(() => [
|
|
1410
|
-
|
|
1498
|
+
i(W, {
|
|
1411
1499
|
class: "max-w-[700px]",
|
|
1412
1500
|
horizontal: "",
|
|
1413
1501
|
variant: "outlined"
|
|
1414
1502
|
}, {
|
|
1415
1503
|
default: T(() => {
|
|
1416
|
-
var
|
|
1504
|
+
var $, A;
|
|
1417
1505
|
return [
|
|
1418
|
-
(
|
|
1506
|
+
($ = e(r)) != null && $.image ? (g(), I(D, {
|
|
1419
1507
|
key: 0,
|
|
1420
1508
|
width: "100",
|
|
1421
|
-
src: (
|
|
1422
|
-
}, null, 8, ["src"])) :
|
|
1423
|
-
|
|
1509
|
+
src: (A = e(r)) == null ? void 0 : A.image
|
|
1510
|
+
}, null, 8, ["src"])) : M("", !0),
|
|
1511
|
+
i(K, { class: "flex flex-col gap-16 justify-between" }, {
|
|
1424
1512
|
default: T(() => {
|
|
1425
1513
|
var p;
|
|
1426
1514
|
return [
|
|
1427
|
-
|
|
1515
|
+
i(Y, {
|
|
1428
1516
|
class: "p-0",
|
|
1429
|
-
title: (p = e(
|
|
1430
|
-
subtitle: e(
|
|
1517
|
+
title: (p = e(r)) == null ? void 0 : p.name,
|
|
1518
|
+
subtitle: e(a)
|
|
1431
1519
|
}, null, 8, ["title", "subtitle"]),
|
|
1432
|
-
|
|
1520
|
+
i(K, { class: "p-0" }, {
|
|
1433
1521
|
default: T(() => {
|
|
1434
|
-
var n, C,
|
|
1522
|
+
var n, C, P, E, q, H, ie, ge, ce, ve, le;
|
|
1435
1523
|
return [
|
|
1436
|
-
_("div",
|
|
1437
|
-
(n = e(
|
|
1524
|
+
_("div", un, [
|
|
1525
|
+
(n = e(r)) != null && n.isFeedvibe ? (g(), I(z, {
|
|
1438
1526
|
key: 0,
|
|
1439
1527
|
label: "Feedvibe"
|
|
1440
|
-
})) :
|
|
1441
|
-
(
|
|
1528
|
+
})) : M("", !0),
|
|
1529
|
+
(P = (C = e(r)) == null ? void 0 : C.titles) != null && P.length ? (g(), I(z, {
|
|
1442
1530
|
key: 1,
|
|
1443
|
-
label: `${e(
|
|
1444
|
-
}, null, 8, ["label"])) :
|
|
1445
|
-
(
|
|
1531
|
+
label: `${e(r).titles.length} title(s)`
|
|
1532
|
+
}, null, 8, ["label"])) : M("", !0),
|
|
1533
|
+
(q = (E = e(r)) == null ? void 0 : E.vouchers) != null && q.length ? (g(), I(z, {
|
|
1446
1534
|
key: 2,
|
|
1447
|
-
label: `${e(
|
|
1448
|
-
}, null, 8, ["label"])) :
|
|
1449
|
-
(ie = (
|
|
1535
|
+
label: `${e(r).vouchers.length} voucher(s)`
|
|
1536
|
+
}, null, 8, ["label"])) : M("", !0),
|
|
1537
|
+
(ie = (H = e(r)) == null ? void 0 : H.credit) != null && ie.normal || (ve = (ce = (ge = e(r)) == null ? void 0 : ge.credit) == null ? void 0 : ce.free) != null && ve.amount ? (g(), I(z, {
|
|
1450
1538
|
key: 3,
|
|
1451
|
-
label: `${(e(
|
|
1452
|
-
}, null, 8, ["label"])) :
|
|
1539
|
+
label: `${(e(r).credit.normal || 0) + (((le = e(r).credit.free) == null ? void 0 : le.amount) || 0)} credit(s)`
|
|
1540
|
+
}, null, 8, ["label"])) : M("", !0)
|
|
1453
1541
|
])
|
|
1454
1542
|
];
|
|
1455
1543
|
}),
|
|
@@ -1463,22 +1551,22 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1463
1551
|
}),
|
|
1464
1552
|
_: 1
|
|
1465
1553
|
}),
|
|
1466
|
-
|
|
1554
|
+
i(ae, {
|
|
1467
1555
|
modelValue: e(b),
|
|
1468
|
-
"onUpdate:modelValue":
|
|
1556
|
+
"onUpdate:modelValue": k[0] || (k[0] = ($) => oe(b) ? b.value = $ : null),
|
|
1469
1557
|
label: "Select member",
|
|
1470
1558
|
searchable: "",
|
|
1471
1559
|
items: e(m),
|
|
1472
1560
|
onSearch: d,
|
|
1473
|
-
rules: [(
|
|
1561
|
+
rules: [($) => !!$ > 0 || "Member is required"],
|
|
1474
1562
|
"helper-text": "Type to search member"
|
|
1475
1563
|
}, null, 8, ["modelValue", "items", "rules"]),
|
|
1476
|
-
|
|
1564
|
+
i(s, {
|
|
1477
1565
|
modelValue: e(o),
|
|
1478
|
-
"onUpdate:modelValue":
|
|
1566
|
+
"onUpdate:modelValue": k[1] || (k[1] = ($) => oe(o) ? o.value = $ : null),
|
|
1479
1567
|
label: "Reference (optional)",
|
|
1480
1568
|
rules: [
|
|
1481
|
-
(
|
|
1569
|
+
($) => $.length < 50 || "Reference must be less than 50 characters"
|
|
1482
1570
|
]
|
|
1483
1571
|
}, null, 8, ["modelValue", "rules"])
|
|
1484
1572
|
]),
|
|
@@ -1490,112 +1578,112 @@ const Jt = /* @__PURE__ */ ee({
|
|
|
1490
1578
|
};
|
|
1491
1579
|
}
|
|
1492
1580
|
});
|
|
1493
|
-
var
|
|
1494
|
-
const
|
|
1581
|
+
var pn = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
|
|
1582
|
+
const yn = { class: "px-24 flex flex-col gap-y-16" }, fn = { class: "flex gap-8 items-center" }, bn = { class: "fm-typo-en-body-lg-600" }, gn = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, vn = { class: "flex flex-col gap-16 text-center" }, hn = { class: "fm-typo-en-title-sm-800" }, xn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gn = /* @__PURE__ */ ee({
|
|
1495
1583
|
__name: "Store",
|
|
1496
|
-
setup(
|
|
1584
|
+
setup(v) {
|
|
1497
1585
|
const x = {
|
|
1498
1586
|
label: "Setup payout account",
|
|
1499
1587
|
value: "payout",
|
|
1500
1588
|
isPrimary: !1
|
|
1501
|
-
}, { t:
|
|
1502
|
-
label:
|
|
1589
|
+
}, { t: l } = be(), f = {
|
|
1590
|
+
label: l("connect.store.actions.setting"),
|
|
1503
1591
|
value: "setting",
|
|
1504
1592
|
isPrimary: !1
|
|
1505
|
-
},
|
|
1506
|
-
label:
|
|
1593
|
+
}, r = {
|
|
1594
|
+
label: l("connect.store.actions.manageReward"),
|
|
1507
1595
|
value: "create_reward"
|
|
1508
1596
|
}, b = {
|
|
1509
|
-
label:
|
|
1597
|
+
label: l("connect.store.actions.addCategory"),
|
|
1510
1598
|
value: "create_category",
|
|
1511
1599
|
isPrimary: !0,
|
|
1512
1600
|
prependIcon: "add"
|
|
1513
|
-
}, o = R(), m = ct(), u =
|
|
1514
|
-
async function
|
|
1601
|
+
}, o = R(), m = ct(), u = ke(), { global: t, minor: c } = Ee, y = Me(), d = j(() => u.sortedStoreCategories), V = j(() => u.sortedStoreCategories.map((s) => s.name)), a = R(), S = R();
|
|
1602
|
+
async function k(s) {
|
|
1515
1603
|
var w;
|
|
1516
|
-
s === "setting" ? (w =
|
|
1604
|
+
s === "setting" ? (w = a.value) == null || w.showSheet(!0, u.storeOption) : s === "create_category" ? Y(-1) : s === "create_reward" ? await m.push({ name: Ze["$connect-STORE_REWARDS"] }) : s == "payout" && window.open(pn.paymentPortalUrl, "_blank");
|
|
1517
1605
|
}
|
|
1518
|
-
async function
|
|
1606
|
+
async function D(s) {
|
|
1519
1607
|
await c(
|
|
1520
1608
|
async () => {
|
|
1521
1609
|
var w;
|
|
1522
|
-
await
|
|
1610
|
+
await Ce.updateStore(s), await u.readMemberStore(), (w = a.value) == null || w.showSheet(!1);
|
|
1523
1611
|
},
|
|
1524
1612
|
{
|
|
1525
|
-
message:
|
|
1526
|
-
successMessage:
|
|
1613
|
+
message: l("connect.store.setting.update.message"),
|
|
1614
|
+
successMessage: l("connect.store.setting.update.success")
|
|
1527
1615
|
}
|
|
1528
1616
|
);
|
|
1529
1617
|
}
|
|
1530
|
-
async function
|
|
1618
|
+
async function Y(s = -1) {
|
|
1531
1619
|
var w, U;
|
|
1532
|
-
if ((!u.storeOption || !u.storeOption.company) && await
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1620
|
+
if ((!u.storeOption || !u.storeOption.company) && await _e.confirm(
|
|
1621
|
+
l("connect.store.category.setup.title"),
|
|
1622
|
+
l("connect.store.category.setup.button"),
|
|
1623
|
+
l("connect.store.category.setup.action"),
|
|
1624
|
+
l("connect.common.cancel")
|
|
1537
1625
|
))
|
|
1538
|
-
return (w =
|
|
1626
|
+
return (w = a.value) == null ? void 0 : w.showSheet(!0);
|
|
1539
1627
|
y.open({
|
|
1540
|
-
title: s == -1 ?
|
|
1628
|
+
title: s == -1 ? l("connect.store.category.add") : l("connect.store.category.edit"),
|
|
1541
1629
|
contentComponent: wt,
|
|
1542
1630
|
contentComponentProps: {
|
|
1543
1631
|
initialValue: ((U = d.value[s]) == null ? void 0 : U.name) ?? "",
|
|
1544
1632
|
action: s == -1 ? "add" : "edit"
|
|
1545
1633
|
}
|
|
1546
|
-
}).onPrimary(async (
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1634
|
+
}).onPrimary(async (O) => {
|
|
1635
|
+
O === null && !await _e.remove(
|
|
1636
|
+
l("connect.store.category.remove.confirm"),
|
|
1637
|
+
l("connect.store.category.remove.title")
|
|
1550
1638
|
) || await c(
|
|
1551
1639
|
async () => {
|
|
1552
|
-
const
|
|
1553
|
-
await
|
|
1554
|
-
categories:
|
|
1640
|
+
const $ = s == -1 ? [...d.value, { name: O, bundles: [] }] : [...d.value].map((A, p) => p == s ? { ...A, name: O } : A).filter((A) => A.name !== null);
|
|
1641
|
+
await Ce.updateStoreBundle({
|
|
1642
|
+
categories: $
|
|
1555
1643
|
}), await u.readMemberStore();
|
|
1556
1644
|
},
|
|
1557
1645
|
{
|
|
1558
|
-
message:
|
|
1559
|
-
successMessage:
|
|
1646
|
+
message: O === null ? l("connect.store.category.update.deleting") : s == -1 ? l("connect.store.category.update.creating") : l("connect.store.category.update.updating"),
|
|
1647
|
+
successMessage: O === null ? l("connect.store.category.update.success.deleted") : s == -1 ? l("connect.store.category.update.success.created") : l("connect.store.category.update.success.updated")
|
|
1560
1648
|
}
|
|
1561
1649
|
);
|
|
1562
1650
|
});
|
|
1563
1651
|
}
|
|
1564
|
-
async function
|
|
1652
|
+
async function z(s, w, U, O) {
|
|
1565
1653
|
var p, n, C;
|
|
1566
|
-
w ?? (w = (p =
|
|
1567
|
-
const
|
|
1568
|
-
for (const
|
|
1569
|
-
for (const E of
|
|
1654
|
+
w ?? (w = (p = S.value) == null ? void 0 : p.target.category), U ?? (U = (n = S.value) == null ? void 0 : n.target.index), O ?? (O = (C = S.value) == null ? void 0 : C.target.originalCategoryIndex);
|
|
1655
|
+
const $ = De(d.value);
|
|
1656
|
+
for (const P of $)
|
|
1657
|
+
for (const E of P.bundles)
|
|
1570
1658
|
console.log(E, "bundle in payload"), "pf_vouchers" in E && delete E.pf_vouchers;
|
|
1571
|
-
w !=
|
|
1572
|
-
const
|
|
1573
|
-
if (!
|
|
1659
|
+
w != O && ($[O].bundles.splice(U, 1), U = $[w].bundles.length), console.log(w, U, O, "ci, bi, originalCategoryIndex");
|
|
1660
|
+
const A = $[w];
|
|
1661
|
+
if (!A) {
|
|
1574
1662
|
Xe.error("Unexpected error", 2e3);
|
|
1575
1663
|
return;
|
|
1576
1664
|
}
|
|
1577
1665
|
if (s == null) {
|
|
1578
|
-
if (await
|
|
1666
|
+
if (await _e.remove(
|
|
1579
1667
|
"Are you sure you want to delete this bundle?",
|
|
1580
1668
|
"Delete bundle"
|
|
1581
1669
|
) == !1)
|
|
1582
1670
|
return;
|
|
1583
|
-
|
|
1671
|
+
A.bundles.splice(U, 1);
|
|
1584
1672
|
} else
|
|
1585
|
-
U == -1 ?
|
|
1673
|
+
U == -1 ? A.bundles.push(s) : A.bundles[U] = s;
|
|
1586
1674
|
await c(
|
|
1587
1675
|
async () => {
|
|
1588
|
-
var
|
|
1676
|
+
var P, E;
|
|
1589
1677
|
if (s != null) {
|
|
1590
|
-
const
|
|
1591
|
-
|
|
1592
|
-
Fe.bundleImagePath(void 0,
|
|
1593
|
-
|
|
1678
|
+
const q = (P = S.value) == null ? void 0 : P.bundleImage;
|
|
1679
|
+
q === null && s.image ? (await Fe.delete(s.image), s.image = null) : q && (s.image = await Fe.update(
|
|
1680
|
+
Fe.bundleImagePath(void 0, q),
|
|
1681
|
+
q
|
|
1594
1682
|
));
|
|
1595
1683
|
}
|
|
1596
|
-
await
|
|
1597
|
-
categories:
|
|
1598
|
-
}), await u.readMemberStore(), await u.readMembership(), await u.readRewards(), (E =
|
|
1684
|
+
await Ce.updateStoreBundle({
|
|
1685
|
+
categories: $
|
|
1686
|
+
}), await u.readMemberStore(), await u.readMembership(), await u.readRewards(), (E = S.value) == null || E.showSheet(!1);
|
|
1599
1687
|
},
|
|
1600
1688
|
{
|
|
1601
1689
|
message: `${s == null ? "Deleting" : U == -1 ? "Creating" : "Updating"} bundle`,
|
|
@@ -1603,15 +1691,15 @@ const pn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1603
1691
|
}
|
|
1604
1692
|
);
|
|
1605
1693
|
}
|
|
1606
|
-
function
|
|
1694
|
+
function K(s) {
|
|
1607
1695
|
var w;
|
|
1608
|
-
(w =
|
|
1696
|
+
(w = S.value) == null || w.showSheet(!0, {
|
|
1609
1697
|
...s,
|
|
1610
|
-
bundle: s.bundle ?
|
|
1698
|
+
bundle: s.bundle ? De(s.bundle) : void 0
|
|
1611
1699
|
});
|
|
1612
1700
|
}
|
|
1613
|
-
const
|
|
1614
|
-
function
|
|
1701
|
+
const W = R([]);
|
|
1702
|
+
function ae(s) {
|
|
1615
1703
|
var w;
|
|
1616
1704
|
(w = o.value) == null || w.showSheet({
|
|
1617
1705
|
bundle: s
|
|
@@ -1620,28 +1708,28 @@ const pn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1620
1708
|
return fe(async () => {
|
|
1621
1709
|
var s, w;
|
|
1622
1710
|
await t(async () => {
|
|
1623
|
-
var U,
|
|
1711
|
+
var U, O;
|
|
1624
1712
|
if (await u.readMemberStore(), await u.readMembership(), await u.readRewards(), await u.readPayoutAccount(), (U = m.currentRoute.value.query) != null && U.action) {
|
|
1625
|
-
switch ((
|
|
1713
|
+
switch ((O = m.currentRoute.value.query) == null ? void 0 : O.action) {
|
|
1626
1714
|
case "update_setting":
|
|
1627
|
-
|
|
1715
|
+
k("setting");
|
|
1628
1716
|
break;
|
|
1629
1717
|
case "create_category":
|
|
1630
|
-
|
|
1718
|
+
Y(-1);
|
|
1631
1719
|
break;
|
|
1632
1720
|
case "create_feedvibe_bundle":
|
|
1633
1721
|
y.open({
|
|
1634
1722
|
title: "Select category",
|
|
1635
|
-
contentComponent:
|
|
1636
|
-
}).onPrimary((
|
|
1637
|
-
y.close(),
|
|
1638
|
-
categories:
|
|
1639
|
-
category:
|
|
1723
|
+
contentComponent: $t
|
|
1724
|
+
}).onPrimary(($) => {
|
|
1725
|
+
y.close(), K({
|
|
1726
|
+
categories: V.value,
|
|
1727
|
+
category: $,
|
|
1640
1728
|
index: -1,
|
|
1641
1729
|
bundle: {
|
|
1642
|
-
...ue.cloneDeep(
|
|
1730
|
+
...ue.cloneDeep(Ve),
|
|
1643
1731
|
isFeedvibe: !0,
|
|
1644
|
-
price:
|
|
1732
|
+
price: N.Dinero.fromNumber({
|
|
1645
1733
|
number: 10,
|
|
1646
1734
|
precision: 2
|
|
1647
1735
|
}).toObject()
|
|
@@ -1652,92 +1740,92 @@ const pn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1652
1740
|
}
|
|
1653
1741
|
m.replace({ query: {} });
|
|
1654
1742
|
}
|
|
1655
|
-
}),
|
|
1743
|
+
}), W.value = [f, r, b], (((s = u.payoutAccount) == null ? void 0 : s.status) != "APPROVED" || ((w = u.payoutAccount) == null ? void 0 : w.enable) != !0) && (W.value = [
|
|
1656
1744
|
x,
|
|
1657
1745
|
f,
|
|
1658
|
-
|
|
1746
|
+
r,
|
|
1659
1747
|
b
|
|
1660
1748
|
]);
|
|
1661
1749
|
}), (s, w) => {
|
|
1662
|
-
const U = h("FmPageHead"),
|
|
1663
|
-
return
|
|
1664
|
-
|
|
1665
|
-
title: e(
|
|
1666
|
-
actions: e(
|
|
1667
|
-
"onClick:action":
|
|
1750
|
+
const U = h("FmPageHead"), O = h("FmButton"), $ = h("FmCard");
|
|
1751
|
+
return g(), B(X, null, [
|
|
1752
|
+
i(U, {
|
|
1753
|
+
title: e(l)("connect.store.title"),
|
|
1754
|
+
actions: e(W),
|
|
1755
|
+
"onClick:action": k
|
|
1668
1756
|
}, null, 8, ["title", "actions"]),
|
|
1669
|
-
_("div",
|
|
1670
|
-
e(d) && e(d).length > 0 ? (
|
|
1671
|
-
(
|
|
1672
|
-
key:
|
|
1757
|
+
_("div", yn, [
|
|
1758
|
+
e(d) && e(d).length > 0 ? (g(), B(X, { key: 0 }, [
|
|
1759
|
+
(g(!0), B(X, null, re(e(d), (A, p) => (g(), B("div", {
|
|
1760
|
+
key: A.name,
|
|
1673
1761
|
class: "space-y-8 py-12"
|
|
1674
1762
|
}, [
|
|
1675
|
-
_("div",
|
|
1676
|
-
_("div",
|
|
1677
|
-
|
|
1678
|
-
|
|
1763
|
+
_("div", fn, [
|
|
1764
|
+
_("div", bn, L(A.name), 1),
|
|
1765
|
+
i(Pe, { json: A }, null, 8, ["json"]),
|
|
1766
|
+
i(O, {
|
|
1679
1767
|
icon: "edit",
|
|
1680
1768
|
size: "md",
|
|
1681
1769
|
variant: "tertiary",
|
|
1682
|
-
onClick: (n) =>
|
|
1770
|
+
onClick: (n) => Y(p)
|
|
1683
1771
|
}, null, 8, ["onClick"])
|
|
1684
1772
|
]),
|
|
1685
|
-
_("div",
|
|
1686
|
-
(
|
|
1773
|
+
_("div", gn, [
|
|
1774
|
+
(g(!0), B(X, null, re(A.bundles, (n, C) => (g(), I(_t, {
|
|
1687
1775
|
bundle: n,
|
|
1688
1776
|
key: n._id,
|
|
1689
|
-
onEdit: (
|
|
1777
|
+
onEdit: (P) => K({
|
|
1690
1778
|
bundle: n,
|
|
1691
1779
|
category: p,
|
|
1692
1780
|
index: C,
|
|
1693
|
-
categories: e(
|
|
1781
|
+
categories: e(V)
|
|
1694
1782
|
}),
|
|
1695
|
-
onDelete: (
|
|
1696
|
-
onSend:
|
|
1783
|
+
onDelete: (P) => z(null, p, C),
|
|
1784
|
+
onSend: ae
|
|
1697
1785
|
}, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
|
|
1698
|
-
|
|
1699
|
-
onCreate: (n) =>
|
|
1786
|
+
i(Ct, {
|
|
1787
|
+
onCreate: (n) => K({
|
|
1700
1788
|
category: p,
|
|
1701
1789
|
index: -1,
|
|
1702
|
-
categories: e(
|
|
1790
|
+
categories: e(V)
|
|
1703
1791
|
})
|
|
1704
1792
|
}, null, 8, ["onCreate"])
|
|
1705
1793
|
])
|
|
1706
1794
|
]))), 128)),
|
|
1707
|
-
|
|
1795
|
+
i(dn, {
|
|
1708
1796
|
ref_key: "bundleSheetRef",
|
|
1709
|
-
ref:
|
|
1710
|
-
onUpdate:
|
|
1797
|
+
ref: S,
|
|
1798
|
+
onUpdate: z
|
|
1711
1799
|
}, null, 512)
|
|
1712
|
-
], 64)) : (
|
|
1800
|
+
], 64)) : (g(), I($, {
|
|
1713
1801
|
key: 1,
|
|
1714
1802
|
variant: "outlined",
|
|
1715
1803
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
1716
1804
|
}, {
|
|
1717
1805
|
default: T(() => [
|
|
1718
1806
|
w[1] || (w[1] = _("img", {
|
|
1719
|
-
src:
|
|
1807
|
+
src: Ye,
|
|
1720
1808
|
class: "aspect-square w-[150px]"
|
|
1721
1809
|
}, null, -1)),
|
|
1722
1810
|
_("div", vn, [
|
|
1723
|
-
_("div",
|
|
1724
|
-
_("div",
|
|
1811
|
+
_("div", hn, L(e(l)("connect.store.bundle.title")), 1),
|
|
1812
|
+
_("div", xn, L(e(l)("connect.store.bundle.description")), 1)
|
|
1725
1813
|
]),
|
|
1726
|
-
|
|
1814
|
+
i(O, {
|
|
1727
1815
|
variant: "primary",
|
|
1728
|
-
label: e(
|
|
1816
|
+
label: e(l)("connect.store.actions.addCategory"),
|
|
1729
1817
|
icon: "add",
|
|
1730
|
-
onClick: w[0] || (w[0] = (
|
|
1818
|
+
onClick: w[0] || (w[0] = (A) => Y(-1))
|
|
1731
1819
|
}, null, 8, ["label"])
|
|
1732
1820
|
]),
|
|
1733
1821
|
_: 1
|
|
1734
1822
|
})),
|
|
1735
|
-
|
|
1823
|
+
i(Wt, {
|
|
1736
1824
|
ref_key: "settingSheetRef",
|
|
1737
|
-
ref:
|
|
1738
|
-
onUpdate:
|
|
1825
|
+
ref: a,
|
|
1826
|
+
onUpdate: D
|
|
1739
1827
|
}, null, 512),
|
|
1740
|
-
|
|
1828
|
+
i(mn, {
|
|
1741
1829
|
ref_key: "sendBundleSheetRef",
|
|
1742
1830
|
ref: o
|
|
1743
1831
|
}, null, 512)
|
|
@@ -1747,5 +1835,5 @@ const pn = { class: "px-24 flex flex-col gap-y-16" }, yn = { class: "flex gap-8
|
|
|
1747
1835
|
}
|
|
1748
1836
|
});
|
|
1749
1837
|
export {
|
|
1750
|
-
|
|
1838
|
+
Gn as default
|
|
1751
1839
|
};
|