@feedmepos/mf-order-setting 0.0.72-prod → 0.0.73-dev
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/.env +1 -1
- package/README.md +7 -23
- package/dist/{KioskDevicesView-DIiEVc0i.js → KioskDevicesView-Dztw-Q35.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-BD0Olm4_.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-Ol419NZh.js} +3 -3
- package/dist/{KioskSettingView-Csm9he9M.js → KioskSettingView-BUHmoxyO.js} +183 -202
- package/dist/{KioskView-Ho2ts0j6.js → KioskView-B8j77zMA.js} +4 -4
- package/dist/OrderSettingsView-C5PK8CKZ.js +60009 -0
- package/dist/{app-xl2InG-H.js → app-C2_s0fkK.js} +5066 -4942
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BVqlMLNE.js → dayjs.min-B3nOmXcs.js} +1 -1
- package/dist/frontend/mf-order/src/api/menu/index.d.ts +1 -1
- package/dist/frontend/mf-order/src/api/remoteOrder/index.d.ts +10 -3
- package/dist/frontend/mf-order/src/app.d.ts +44 -8
- package/dist/frontend/mf-order/src/components/GoogleMap.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/composables/useQrOrderingEnabled.d.ts +2 -0
- package/dist/frontend/mf-order/src/helpers/menu.d.ts +1 -1
- package/dist/frontend/mf-order/src/main.d.ts +44 -8
- package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +21 -21
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +906 -1044
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +36 -3
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +5 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/DeliverySetting.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/components/TaxInput.vue.d.ts +3 -8
- package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.d.ts +3 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.data.d.ts +5 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +21 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +28 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/LinemanSetting.vue.d.ts +46 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/TngSetting.vue.d.ts +57 -0
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +23 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/Preorder.vue.d.ts +27 -0
- package/dist/frontend/mf-order/src/views/order-settings/servicecharge/RateInput.vue.d.ts +8 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/index-6PQJ07gD.js +665 -0
- package/dist/{index-B4qdL9W3.js → index-B4XxBqiV.js} +1 -1
- package/dist/lineman-settings.dto-DcYJFu0U.js +60394 -0
- package/dist/package/entity/_type-assert.d.ts +7 -0
- package/dist/package/entity/booking/booking.dto.d.ts +24 -24
- package/dist/package/entity/delivery/delivery.dto.d.ts +8 -8
- package/dist/package/entity/delivery/delivery.enum.d.ts +12 -0
- package/dist/package/entity/delivery/gateway/grab.dto.d.ts +2 -2
- package/dist/package/entity/delivery/gateway/kosmo.dto.d.ts +16 -16
- package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +4 -4
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +282 -4591
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +32 -24
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +23 -11719
- package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +2 -2
- package/dist/package/entity/index.d.ts +12 -0
- package/dist/package/entity/kiosk/kiosk.do.d.ts +140 -140
- package/dist/package/entity/kiosk/kiosk.dto.d.ts +168 -168
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +63 -7
- package/dist/package/entity/marketing/marketing.dto.d.ts +4 -4
- package/dist/package/entity/member/member.dto.d.ts +6 -0
- package/dist/package/entity/order/dine-in/dine-in.do.d.ts +8 -8
- package/dist/package/entity/order/effects/effect.dto.d.ts +68 -16
- package/dist/package/entity/order/menu/menu.dto.d.ts +45 -8
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +358 -3853
- package/dist/package/entity/order/order.do.d.ts +239 -42
- package/dist/package/entity/order/order.dto.d.ts +6497 -2236
- package/dist/package/entity/order/payment/payment.dto.d.ts +52 -12
- package/dist/package/entity/order-platform/base-integration.do.d.ts +8 -0
- package/dist/package/entity/order-platform/deliveroo/deliveroo-dto.d.ts +2 -2
- package/dist/package/entity/order-platform/deliveroo/deliveroo-order.do.d.ts +524 -524
- package/dist/package/entity/order-platform/deliveroo/deliveroo-setting.do.d.ts +2 -2
- package/dist/package/entity/order-platform/deliveroo/deliveroo.menu.dto.d.ts +58 -58
- package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +212 -284
- package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +331 -589
- package/dist/package/entity/order-platform/external/menu/external-menu.dto.d.ts +1 -1
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +12 -12
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +275 -275
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +3 -3
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +3 -3
- package/dist/package/entity/order-platform/foodpanda/foodpanda-menu.dto.d.ts +284 -284
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +40 -40
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +16 -16
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +2 -2
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +2 -2
- package/dist/package/entity/order-platform/gofood/gofood-order.do.d.ts +18 -18
- package/dist/package/entity/order-platform/gofood/gofood-settings.do.d.ts +2 -2
- package/dist/package/entity/order-platform/gofood/gofood-settings.dto.d.ts +2 -2
- package/dist/package/entity/order-platform/gofood/gofood.dto.d.ts +32 -32
- package/dist/package/entity/order-platform/grabfood/grabfood-edit-order.do.d.ts +12 -12
- package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +134 -115
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +187 -165
- package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +8 -2
- package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +49 -42
- package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +67 -54
- package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +1 -1
- package/dist/package/entity/order-platform/lineman/lineman-settings.do.d.ts +37 -0
- package/dist/package/entity/order-platform/lineman/lineman-settings.dto.d.ts +40 -0
- package/dist/package/entity/order-platform/menu.dto.d.ts +716 -13887
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +136 -2
- package/dist/package/entity/order-platform/order-platform.enum.d.ts +1 -1
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +176 -176
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +62 -62
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +8 -2
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +8 -2
- package/dist/package/entity/order-platform/tng/tng-menu.do.d.ts +1061 -0
- package/dist/package/entity/order-platform/tng/tng-order.do.d.ts +1915 -0
- package/dist/package/entity/order-platform/tng/tng-settings.do.d.ts +379 -0
- package/dist/package/entity/order-platform/tng/tng-settings.dto.d.ts +301 -0
- package/dist/package/entity/order-platform/tng/tng.dto.d.ts +1162 -0
- package/dist/package/entity/order-platform/tng/tng.enum.d.ts +29 -0
- package/dist/package/entity/order-setting/delivery/inhouse-delivery.do.d.ts +12 -0
- package/dist/package/entity/order-setting/delivery/inhouse-delivery.dto.d.ts +12 -0
- package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +11 -0
- package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +9 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +2 -2
- package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +2 -2
- package/dist/package/entity/order-setting/order-setting.do.d.ts +55 -4
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +110 -8
- package/dist/package/entity/order-setting/pickup/pickup.do.d.ts +12 -0
- package/dist/package/entity/order-setting/pickup/pickup.dto.d.ts +12 -0
- package/dist/package/entity/payment/transaction.d.ts +80 -8
- package/dist/package/entity/printer/printer.do.d.ts +14 -14
- package/dist/package/entity/pubsub/ably/ably.enum.d.ts +1 -1
- package/dist/package/entity/queue/queue.do.d.ts +236 -1901
- package/dist/package/entity/queue/queue.dto.d.ts +743 -445
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +27 -4
- package/dist/package/entity/websocket/websocket.dto.d.ts +10 -10
- package/dist/style.css +1 -0
- package/golar.config.ts +20 -0
- package/package.json +28 -22
- package/src/Entry.vue +2 -10
- package/src/api/menu/index.ts +1 -1
- package/src/api/remoteOrder/index.ts +176 -110
- package/src/composables/useQrOrderingEnabled.ts +66 -0
- package/src/helpers/menu.ts +1 -1
- package/src/locales/en-US.json +421 -412
- package/src/locales/ja-JP.json +1769 -1760
- package/src/locales/th-TH.json +409 -400
- package/src/locales/zh-CN.json +417 -408
- package/src/main.ts +4 -44
- package/src/router/index.ts +2 -2
- package/src/stores/menu/menu.ts +48 -27
- package/src/stores/restaurant/index.ts +24 -9
- package/src/utils/firebase-storage.ts +3 -13
- package/src/views/kiosk/settings/KioskSettingView.vue +3 -2
- package/src/views/order-settings/OrderSettingsView.vue +31 -11
- package/src/views/order-settings/delivery/DeliverySetting.vue +223 -11
- package/src/views/order-settings/delivery/components/TaxInput.vue +1 -1
- package/src/views/order-settings/delivery/delivery.data.ts +31 -10
- package/src/views/order-settings/delivery/delivery.ts +60 -28
- package/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue +40 -1
- package/src/views/order-settings/delivery/integrated-delivery/DeliverooSetting.vue +1 -1
- package/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue +15 -7
- package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +83 -27
- package/src/views/order-settings/delivery/integrated-delivery/LinemanSetting.vue +79 -0
- package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue +2 -0
- package/src/views/order-settings/delivery/integrated-delivery/TngSetting.vue +749 -0
- package/src/views/order-settings/dine-in/DineInSetting.vue +54 -23
- package/src/views/order-settings/general/GeneralSetting.vue +15 -6
- package/src/views/order-settings/pickup/PickUpSettingDialog.vue +31 -3
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +34 -0
- package/src/views/order-settings/pickup/Preorder.vue +13 -12
- package/src/views/order-settings/queue/QueueSetting.vue +30 -1
- package/src/views/order-settings/servicecharge/RateInput.vue +9 -7
- package/vite.config.ts +16 -16
- package/dist/OrderSettingsView-C0G8kP3v.js +0 -32222
- package/dist/frontend/mf-order/src/api/auth/index.d.ts +0 -7
- package/dist/frontend/mf-order/src/stores/iframe/index.d.ts +0 -14
- package/dist/index-kCI8JdNP.js +0 -628
- package/dist/queue-transfer.dto-BLyCakS5.js +0 -45618
- package/src/api/auth/index.ts +0 -20
- package/src/stores/iframe/index.ts +0 -23
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
import { defineComponent as Q, ref as O, resolveComponent as F, openBlock as g, createElementBlock as E, createElementVNode as h, toDisplayString as C, createVNode as D, unref as $, createBlock as j, computed as N, watch as ne, onMounted as ae, withCtx as M, createTextVNode as re, createCommentVNode as x, Fragment as oe, renderList as se, renderSlot as ue } from "vue";
|
|
2
|
+
import { e as w } from "./app-C2_s0fkK.js";
|
|
3
|
+
import { useDialog as le, useSnackbar as ie } from "@feedmepos/ui-library";
|
|
4
|
+
import { useI18n as G, useCoreStore as te } from "@feedmepos/mf-common";
|
|
5
|
+
import { defineStore as de } from "pinia";
|
|
6
|
+
import { r as R, g as n, w as V, S as z, e as q } from "./lineman-settings.dto-DcYJFu0U.js";
|
|
7
|
+
const ce = /* @__PURE__ */ Q({
|
|
8
|
+
__name: "OfflinePaymentTypeDialogContent",
|
|
9
|
+
props: {
|
|
10
|
+
name: {},
|
|
11
|
+
instruction: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:nameValue", "update:instructionValue"],
|
|
14
|
+
setup(e, { emit: t }) {
|
|
15
|
+
const { t: u } = G(), y = e, r = t, f = O("");
|
|
16
|
+
function m(b) {
|
|
17
|
+
r("update:nameValue", b);
|
|
18
|
+
}
|
|
19
|
+
function P(b) {
|
|
20
|
+
r("update:instructionValue", b);
|
|
21
|
+
}
|
|
22
|
+
return (b, v) => {
|
|
23
|
+
const _ = F("FmTextField"), c = F("FmTextarea");
|
|
24
|
+
return g(), E("div", null, [
|
|
25
|
+
h("span", null, C(y.name), 1),
|
|
26
|
+
D(_, {
|
|
27
|
+
"model-value": f.value,
|
|
28
|
+
"onUpdate:modelValue": m,
|
|
29
|
+
placeholder: $(u)("order.enterPaymentName"),
|
|
30
|
+
rules: [(i) => !!i || $(u)("order.fieldCannotBeEmpty")]
|
|
31
|
+
}, null, 8, ["model-value", "placeholder", "rules"]),
|
|
32
|
+
v[0] || (v[0] = h("div", { class: "mb-12" }, null, -1)),
|
|
33
|
+
h("span", null, C(y.instruction), 1),
|
|
34
|
+
D(c, {
|
|
35
|
+
"model-value": f.value,
|
|
36
|
+
"onUpdate:modelValue": P,
|
|
37
|
+
placeholder: $(u)("order.enterPaymentInstruction")
|
|
38
|
+
}, null, 8, ["model-value", "placeholder"])
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}), pe = /* @__PURE__ */ Q({
|
|
43
|
+
__name: "OfflinePaymentTypeDialog",
|
|
44
|
+
emits: ["add:offline-payment-type"],
|
|
45
|
+
setup(e, { emit: t }) {
|
|
46
|
+
const { t: u } = G(), y = le(), r = O(""), f = O(""), m = () => {
|
|
47
|
+
r.value = "", f.value = "", y.open({
|
|
48
|
+
title: u("order.addCustomPayment"),
|
|
49
|
+
contentComponent: ce,
|
|
50
|
+
contentComponentProps: {
|
|
51
|
+
name: u("order.name"),
|
|
52
|
+
instruction: u("order.instruction"),
|
|
53
|
+
"onUpdate:nameValue": (v) => {
|
|
54
|
+
r.value = v;
|
|
55
|
+
},
|
|
56
|
+
"onUpdate:instructionValue": (v) => {
|
|
57
|
+
f.value = v;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
primaryActions: { text: u("order.add"), close: !0 },
|
|
61
|
+
secondaryActions: { text: u("order.cancel"), close: !0 }
|
|
62
|
+
}).onPrimary(async () => {
|
|
63
|
+
const v = {
|
|
64
|
+
name: r.value,
|
|
65
|
+
instruction: f.value
|
|
66
|
+
};
|
|
67
|
+
await P(v);
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
async function P(v) {
|
|
71
|
+
b("add:offline-payment-type", v);
|
|
72
|
+
}
|
|
73
|
+
const b = t;
|
|
74
|
+
return (v, _) => {
|
|
75
|
+
const c = F("FmButton");
|
|
76
|
+
return g(), j(c, {
|
|
77
|
+
label: $(u)("order.editOfflinePayment"),
|
|
78
|
+
onClick: m,
|
|
79
|
+
variant: "plain"
|
|
80
|
+
}, null, 8, ["label"]);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}), ye = { class: "flex flex-col gap-3" }, fe = { class: "flex-grow fm-typo-en-title-sm-600" }, me = { class: "flex flex-row items-center" }, ve = { key: 0 }, ge = { key: 0 }, we = { class: "font-bold" }, he = { class: "mt-3" }, Pe = {
|
|
84
|
+
key: 1,
|
|
85
|
+
class: "text-fm-color-secondary-salmon fm-typo-en-body-sm-600 ml-7"
|
|
86
|
+
}, be = {
|
|
87
|
+
key: 2,
|
|
88
|
+
class: "ml-7"
|
|
89
|
+
}, _e = {
|
|
90
|
+
key: 4,
|
|
91
|
+
class: "text-fm-color-secondary-salmon fm-typo-en-body-sm-600 ml-7"
|
|
92
|
+
}, Re = /* @__PURE__ */ Q({
|
|
93
|
+
__name: "PaymentType",
|
|
94
|
+
props: {
|
|
95
|
+
paymentTypes: {
|
|
96
|
+
type: Array,
|
|
97
|
+
required: !0
|
|
98
|
+
},
|
|
99
|
+
offlinePaymentTypes: {
|
|
100
|
+
type: Array,
|
|
101
|
+
required: !0
|
|
102
|
+
},
|
|
103
|
+
showDisabledOptions: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !1
|
|
106
|
+
},
|
|
107
|
+
disabledSuffixes: {
|
|
108
|
+
type: Object,
|
|
109
|
+
default: () => ({})
|
|
110
|
+
},
|
|
111
|
+
allowEPayment: {
|
|
112
|
+
type: [Boolean, String],
|
|
113
|
+
required: !0
|
|
114
|
+
},
|
|
115
|
+
allowCredit: {
|
|
116
|
+
type: [Boolean, String],
|
|
117
|
+
default: !1
|
|
118
|
+
},
|
|
119
|
+
maxCustomPayment: {
|
|
120
|
+
type: Number,
|
|
121
|
+
default: void 0
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
emits: ["update:paymentTypes", "update:offlinePaymentTypes"],
|
|
125
|
+
setup(e, { emit: t }) {
|
|
126
|
+
const { t: u } = G(), { currentRestaurant: y } = te(), r = e, f = t;
|
|
127
|
+
async function m(l) {
|
|
128
|
+
f(
|
|
129
|
+
"update:offlinePaymentTypes",
|
|
130
|
+
r.offlinePaymentTypes.filter((d, p) => p !== l)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
const P = N(() => (r.paymentTypes || []).includes(w.F_ORDER_PAYMENT_TYPE.enum.ePayment)), b = N(() => (r.paymentTypes || []).includes(w.F_ORDER_PAYMENT_TYPE.enum.credit)), v = N(() => {
|
|
134
|
+
const l = r.paymentTypes || [], d = r.offlinePaymentTypes || [];
|
|
135
|
+
return l.includes(w.F_ORDER_PAYMENT_TYPE.enum.cash) || d.length > 0;
|
|
136
|
+
}), _ = O(!1), c = O([]), i = N(() => [
|
|
137
|
+
{ label: u("order.offlinePayment"), value: "offline" },
|
|
138
|
+
{
|
|
139
|
+
label: u("order.ePayment"),
|
|
140
|
+
value: "e-payment",
|
|
141
|
+
disable: !r.allowEPayment,
|
|
142
|
+
suffix: !r.allowEPayment && r.showDisabledOptions ? {
|
|
143
|
+
text: `(${r.disabledSuffixes["e-payment"] || u("order.notAllowed")})`,
|
|
144
|
+
class: "text-negative t-system"
|
|
145
|
+
} : void 0
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: u("order.credit"),
|
|
149
|
+
value: "credit",
|
|
150
|
+
disable: !r.allowCredit,
|
|
151
|
+
suffix: !r.allowCredit && r.showDisabledOptions ? {
|
|
152
|
+
text: `(${r.disabledSuffixes.credit || u("order.notAllowed")})`,
|
|
153
|
+
class: "text-negative t-system"
|
|
154
|
+
} : void 0
|
|
155
|
+
}
|
|
156
|
+
]), k = () => {
|
|
157
|
+
const l = [];
|
|
158
|
+
v.value && l.push("offline"), P.value && l.push("e-payment"), b.value && l.push("credit"), c.value = l;
|
|
159
|
+
let d = 0;
|
|
160
|
+
r.showDisabledOptions ? d = i.value.length : d = i.value.filter((p) => !(p.value === "e-payment" && !r.allowEPayment || p.value === "credit" && !r.allowCredit)).length, _.value = l.length === d && l.length > 0;
|
|
161
|
+
};
|
|
162
|
+
k();
|
|
163
|
+
const B = (l) => {
|
|
164
|
+
const d = i.value.filter((o) => !(o.value === "e-payment" && !r.allowEPayment || o.value === "credit" && !r.allowCredit));
|
|
165
|
+
c.value = l ? d.map((o) => o.value) : [], _.value = l;
|
|
166
|
+
const p = [], a = l ? r.offlinePaymentTypes || [] : [];
|
|
167
|
+
c.value.includes("e-payment") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.ePayment), c.value.includes("offline") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.cash), c.value.includes("credit") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.credit), f("update:paymentTypes", p), f("update:offlinePaymentTypes", a);
|
|
168
|
+
}, A = (l) => {
|
|
169
|
+
c.value = l, r.showDisabledOptions ? i.value.length : i.value.filter((o) => !(o.value === "e-payment" && !r.allowEPayment || o.value === "credit" && !r.allowCredit)).length;
|
|
170
|
+
const d = i.value.filter((o) => !(o.value === "e-payment" && !r.allowEPayment || o.value === "credit" && !r.allowCredit)).length;
|
|
171
|
+
_.value = l.length === d && l.length > 0;
|
|
172
|
+
const p = [], a = l.includes("offline") ? r.offlinePaymentTypes || [] : [];
|
|
173
|
+
l.includes("e-payment") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.ePayment), l.includes("offline") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.cash), l.includes("credit") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.credit), f("update:paymentTypes", p), f("update:offlinePaymentTypes", a);
|
|
174
|
+
};
|
|
175
|
+
return ne(
|
|
176
|
+
() => y.value,
|
|
177
|
+
(l) => {
|
|
178
|
+
k();
|
|
179
|
+
},
|
|
180
|
+
{ immediate: !0 }
|
|
181
|
+
), ae(() => {
|
|
182
|
+
k();
|
|
183
|
+
}), (l, d) => {
|
|
184
|
+
var L, W, H, J, K, X, Z;
|
|
185
|
+
const p = F("FmCheckbox"), a = F("FmCardSection"), o = F("FmCard"), Y = F("FmButton");
|
|
186
|
+
return g(), E("div", ye, [
|
|
187
|
+
h("div", fe, C($(u)("order.acceptedPayment")), 1),
|
|
188
|
+
D(p, {
|
|
189
|
+
value: "",
|
|
190
|
+
"model-value": _.value,
|
|
191
|
+
label: $(u)("order.all"),
|
|
192
|
+
indeterminate: c.value.length > 0 && !_.value,
|
|
193
|
+
"onUpdate:modelValue": B
|
|
194
|
+
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
195
|
+
h("div", me, [
|
|
196
|
+
D(p, {
|
|
197
|
+
modelValue: c.value,
|
|
198
|
+
"onUpdate:modelValue": [
|
|
199
|
+
d[0] || (d[0] = (T) => c.value = T),
|
|
200
|
+
A
|
|
201
|
+
],
|
|
202
|
+
label: i.value[0].label,
|
|
203
|
+
value: i.value[0].value
|
|
204
|
+
}, null, 8, ["modelValue", "label", "value"])
|
|
205
|
+
]),
|
|
206
|
+
c.value.includes(i.value[0].value) ? (g(), E("div", ve, [
|
|
207
|
+
((L = e.offlinePaymentTypes) == null ? void 0 : L.length) === 0 ? (g(), E("div", ge, [
|
|
208
|
+
D(o, { variant: "outlined" }, {
|
|
209
|
+
default: M(() => [
|
|
210
|
+
D(a, null, {
|
|
211
|
+
default: M(() => [
|
|
212
|
+
re(C($(u)("order.cash")), 1)
|
|
213
|
+
]),
|
|
214
|
+
_: 1
|
|
215
|
+
})
|
|
216
|
+
]),
|
|
217
|
+
_: 1
|
|
218
|
+
})
|
|
219
|
+
])) : x("", !0),
|
|
220
|
+
(g(!0), E(oe, null, se(e.offlinePaymentTypes, (T, ee) => (g(), E("p", { key: ee }, [
|
|
221
|
+
D(o, {
|
|
222
|
+
variant: "outlined",
|
|
223
|
+
class: "mb-3"
|
|
224
|
+
}, {
|
|
225
|
+
default: M(() => [
|
|
226
|
+
D(a, { class: "flex items-center justify-between" }, {
|
|
227
|
+
default: M(() => [
|
|
228
|
+
h("div", null, [
|
|
229
|
+
h("span", we, C(T.name), 1),
|
|
230
|
+
d[4] || (d[4] = h("br", null, null, -1)),
|
|
231
|
+
h("span", null, C(T.instruction), 1)
|
|
232
|
+
]),
|
|
233
|
+
h("div", null, [
|
|
234
|
+
D(Y, {
|
|
235
|
+
"append-icon": "delete",
|
|
236
|
+
variant: "plain",
|
|
237
|
+
onClick: (Se) => m(ee)
|
|
238
|
+
}, null, 8, ["onClick"])
|
|
239
|
+
])
|
|
240
|
+
]),
|
|
241
|
+
_: 2
|
|
242
|
+
}, 1024)
|
|
243
|
+
]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, 1024)
|
|
246
|
+
]))), 128)),
|
|
247
|
+
h("div", he, [
|
|
248
|
+
e.offlinePaymentTypes.length === 0 || e.showDisabledOptions ? (g(), j(pe, {
|
|
249
|
+
key: 0,
|
|
250
|
+
"onAdd:offlinePaymentType": d[1] || (d[1] = (T) => f("update:offlinePaymentTypes", [...r.offlinePaymentTypes, T]))
|
|
251
|
+
})) : x("", !0)
|
|
252
|
+
])
|
|
253
|
+
])) : x("", !0),
|
|
254
|
+
D(p, {
|
|
255
|
+
modelValue: c.value,
|
|
256
|
+
"onUpdate:modelValue": [
|
|
257
|
+
d[2] || (d[2] = (T) => c.value = T),
|
|
258
|
+
A
|
|
259
|
+
],
|
|
260
|
+
label: i.value[1].label,
|
|
261
|
+
value: i.value[1].value,
|
|
262
|
+
disabled: i.value[1].disable
|
|
263
|
+
}, null, 8, ["modelValue", "label", "value", "disabled"]),
|
|
264
|
+
i.value[1].suffix ? (g(), E("div", Pe, C((J = (H = (W = i.value) == null ? void 0 : W[1]) == null ? void 0 : H.suffix) == null ? void 0 : J.text), 1)) : x("", !0),
|
|
265
|
+
c.value.includes("e-payment") ? (g(), E("div", be, [
|
|
266
|
+
ue(l.$slots, "e-payment-content")
|
|
267
|
+
])) : x("", !0),
|
|
268
|
+
e.allowCredit || e.showDisabledOptions ? (g(), j(p, {
|
|
269
|
+
key: 3,
|
|
270
|
+
modelValue: c.value,
|
|
271
|
+
"onUpdate:modelValue": [
|
|
272
|
+
d[3] || (d[3] = (T) => c.value = T),
|
|
273
|
+
A
|
|
274
|
+
],
|
|
275
|
+
label: i.value[2].label,
|
|
276
|
+
value: i.value[2].value,
|
|
277
|
+
disabled: i.value[2].disable
|
|
278
|
+
}, null, 8, ["modelValue", "label", "value", "disabled"])) : x("", !0),
|
|
279
|
+
i.value[2].suffix ? (g(), E("div", _e, C((Z = (X = (K = i.value) == null ? void 0 : K[2]) == null ? void 0 : X.suffix) == null ? void 0 : Z.text), 1)) : x("", !0)
|
|
280
|
+
]);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
}), I = {
|
|
284
|
+
async readRestaurantSetting(e) {
|
|
285
|
+
const t = await V().get(`/restaurants/${e}/restaurant-setting`);
|
|
286
|
+
return n(t);
|
|
287
|
+
},
|
|
288
|
+
async updateDineInSetting(e) {
|
|
289
|
+
const t = await R().put("/dine-in", e);
|
|
290
|
+
return n(t);
|
|
291
|
+
},
|
|
292
|
+
async updatePickupSetting(e) {
|
|
293
|
+
const t = await R().put("/pickup", e);
|
|
294
|
+
return n(t);
|
|
295
|
+
},
|
|
296
|
+
async updateDriveThruSetting(e) {
|
|
297
|
+
const t = await R().put("/drive-thru", e);
|
|
298
|
+
return n(t);
|
|
299
|
+
},
|
|
300
|
+
async updateServiceCharge(e) {
|
|
301
|
+
const t = await R().put("/service-charge-setting", e);
|
|
302
|
+
return n(t);
|
|
303
|
+
},
|
|
304
|
+
async getMobileOrderSetting() {
|
|
305
|
+
return await n(await R().get("/order-settings"));
|
|
306
|
+
},
|
|
307
|
+
async updateQueueSetting(e, t) {
|
|
308
|
+
const u = await R().put("/queue", t);
|
|
309
|
+
return n(u);
|
|
310
|
+
}
|
|
311
|
+
}, s = (e) => {
|
|
312
|
+
const t = `/${e}`;
|
|
313
|
+
return V(t, "portal");
|
|
314
|
+
}, U = () => {
|
|
315
|
+
const e = z.getRestaurantId();
|
|
316
|
+
if (!e) throw new Error("Invalid restaurant ID");
|
|
317
|
+
const { linkedDeliveryBackend: t } = z.getBackendUrl(), u = `${t}/restaurants/${e}/linked-deliveries`;
|
|
318
|
+
return V("", "portal", { url: u });
|
|
319
|
+
}, S = {
|
|
320
|
+
async readLinkedDeliveryCompanies() {
|
|
321
|
+
return n(await U().get(""));
|
|
322
|
+
},
|
|
323
|
+
async readLocalDeliveryCompanies() {
|
|
324
|
+
return n(await V().get("/deliveries"));
|
|
325
|
+
},
|
|
326
|
+
async createDeliveryCompany(e) {
|
|
327
|
+
return n(await U().post("", e));
|
|
328
|
+
},
|
|
329
|
+
async updateDeliveryCompany(e) {
|
|
330
|
+
return n(await U().put(`/${e._id}`, e));
|
|
331
|
+
},
|
|
332
|
+
async deleteDeliveryCompany(e) {
|
|
333
|
+
return n(await U().delete(`/${e._id}`));
|
|
334
|
+
},
|
|
335
|
+
integratedDelivery: {
|
|
336
|
+
async updateInhouse(e, t) {
|
|
337
|
+
return n(
|
|
338
|
+
await V().put(`/restaurants/${e}/in-house-delivery`, t)
|
|
339
|
+
);
|
|
340
|
+
},
|
|
341
|
+
async updateFeedme(e, t) {
|
|
342
|
+
return n(
|
|
343
|
+
await V().put(`/restaurants/${e}/feedme-delivery`, t)
|
|
344
|
+
);
|
|
345
|
+
},
|
|
346
|
+
async readFoodpanda(e) {
|
|
347
|
+
return n(await s("foodpanda").get(`/setting/${e}`));
|
|
348
|
+
},
|
|
349
|
+
async readFoodpandaOrders(e) {
|
|
350
|
+
return n(await s("foodpanda").get("/order", { params: e }));
|
|
351
|
+
},
|
|
352
|
+
async reflowFoodpandaOrders(e) {
|
|
353
|
+
return n(await s("foodpanda").put(`/order/reflow/${e}`));
|
|
354
|
+
},
|
|
355
|
+
async rejectFoodpandaOrders(e) {
|
|
356
|
+
return n(await s("foodpanda").put(`/order/void/${e}`));
|
|
357
|
+
},
|
|
358
|
+
async updateFoodpanda(e, t) {
|
|
359
|
+
return n(
|
|
360
|
+
await s("foodpanda").put(`/setting/${e}`, {
|
|
361
|
+
_id: e,
|
|
362
|
+
...t
|
|
363
|
+
})
|
|
364
|
+
);
|
|
365
|
+
},
|
|
366
|
+
async syncFoodpandaMenu(e) {
|
|
367
|
+
return n(await s("foodpanda").put(`/menu-sync/${e}`));
|
|
368
|
+
},
|
|
369
|
+
async readGrabfood(e) {
|
|
370
|
+
return n(await s("grabfood").get(`/setting/${e}`));
|
|
371
|
+
},
|
|
372
|
+
async readGrabfoodOrders(e) {
|
|
373
|
+
return n(await s("grabfood").get("/order", { params: e }));
|
|
374
|
+
},
|
|
375
|
+
async reflowGrabfoodOrders(e) {
|
|
376
|
+
return n(await s("grabfood").put(`/order/reflow/${e}`));
|
|
377
|
+
},
|
|
378
|
+
async rejectGrabfoodOrders(e) {
|
|
379
|
+
return n(await s("grabfood").put(`/order/void/${e}`));
|
|
380
|
+
},
|
|
381
|
+
async updateGrabfood(e, t) {
|
|
382
|
+
return n(
|
|
383
|
+
await s("grabfood").put(`/setting/${e}`, {
|
|
384
|
+
_id: e,
|
|
385
|
+
...t
|
|
386
|
+
})
|
|
387
|
+
);
|
|
388
|
+
},
|
|
389
|
+
async syncGrabfoodMenu(e) {
|
|
390
|
+
return n(await s("grabfood").get(`/menu-sync/${e}`));
|
|
391
|
+
},
|
|
392
|
+
async startSelfServeFlow(e) {
|
|
393
|
+
return n(
|
|
394
|
+
await s("grabfood").get(`/setting/integration-url/${e}`)
|
|
395
|
+
);
|
|
396
|
+
},
|
|
397
|
+
async readShopeefood(e) {
|
|
398
|
+
return n(await s("shopeefood").get(`/setting/${e}`));
|
|
399
|
+
},
|
|
400
|
+
async readShopeefoodOrders(e) {
|
|
401
|
+
return n(await s("shopeefood").get("/order", { params: e }));
|
|
402
|
+
},
|
|
403
|
+
async reflowShopeefoodOrders(e) {
|
|
404
|
+
return n(await s("shopeefood").put(`/order/reflow/${e}`));
|
|
405
|
+
},
|
|
406
|
+
async rejectShopeefoodOrders(e) {
|
|
407
|
+
return n(await s("shopeefood").put(`/order/void/${e}`));
|
|
408
|
+
},
|
|
409
|
+
async updateShopeefood(e, t) {
|
|
410
|
+
return n(
|
|
411
|
+
await s("shopeefood").put(`/setting/${e}`, {
|
|
412
|
+
_id: e,
|
|
413
|
+
...t
|
|
414
|
+
})
|
|
415
|
+
);
|
|
416
|
+
},
|
|
417
|
+
async syncShopeefoodMenu(e) {
|
|
418
|
+
return n(await s("shopeefood").get(`/menu-sync/${e}`));
|
|
419
|
+
},
|
|
420
|
+
async readGofood(e) {
|
|
421
|
+
return n(await s("gofood").get(`/setting/${e}`));
|
|
422
|
+
},
|
|
423
|
+
async updateGofood(e, t) {
|
|
424
|
+
return n(
|
|
425
|
+
await s("gofood").put(`/setting/${e}`, {
|
|
426
|
+
...t,
|
|
427
|
+
_id: e
|
|
428
|
+
})
|
|
429
|
+
);
|
|
430
|
+
},
|
|
431
|
+
async syncGofoodMenu(e) {
|
|
432
|
+
return n(await s("gofood").get(`/menu-sync/${e}`));
|
|
433
|
+
},
|
|
434
|
+
async readLineman(e) {
|
|
435
|
+
return n(await s("lineman").get(`/setting/${e}`));
|
|
436
|
+
},
|
|
437
|
+
async updateLineman(e, t) {
|
|
438
|
+
return n(
|
|
439
|
+
await s("lineman").put(`/setting/${e}`, {
|
|
440
|
+
...t,
|
|
441
|
+
_id: e
|
|
442
|
+
})
|
|
443
|
+
);
|
|
444
|
+
},
|
|
445
|
+
async updateDeliveroo(e, t) {
|
|
446
|
+
return n(
|
|
447
|
+
await s("deliveroo").put(`/setting/${e}`, {
|
|
448
|
+
_id: e,
|
|
449
|
+
...t
|
|
450
|
+
})
|
|
451
|
+
);
|
|
452
|
+
},
|
|
453
|
+
async readDeliveroo(e) {
|
|
454
|
+
return n(await s("deliveroo").get(`/setting/${e}`));
|
|
455
|
+
},
|
|
456
|
+
async syncDeliverooMenu(e) {
|
|
457
|
+
return n(await s("deliveroo").get(`/menu-sync/${e}`));
|
|
458
|
+
},
|
|
459
|
+
async readTng(e) {
|
|
460
|
+
return n(await s("tng").get(`/setting/${e}`));
|
|
461
|
+
},
|
|
462
|
+
async updateTng(e, t) {
|
|
463
|
+
return n(
|
|
464
|
+
await s("tng").put(`/setting/${e}`, {
|
|
465
|
+
_id: e,
|
|
466
|
+
...t
|
|
467
|
+
})
|
|
468
|
+
);
|
|
469
|
+
},
|
|
470
|
+
async syncTngMenu(e) {
|
|
471
|
+
return n(await s("tng").put(`/menu-sync/${e}`));
|
|
472
|
+
},
|
|
473
|
+
async readExternal(e) {
|
|
474
|
+
return n(await s("external").get(`/setting/${e}`));
|
|
475
|
+
},
|
|
476
|
+
async updateExternal(e, t) {
|
|
477
|
+
return n(
|
|
478
|
+
await s("external").put(`setting/${e}`, {
|
|
479
|
+
...t
|
|
480
|
+
})
|
|
481
|
+
);
|
|
482
|
+
},
|
|
483
|
+
async syncExternalMenu(e) {
|
|
484
|
+
return n(await s("external").get(`/menu-sync/${e}`));
|
|
485
|
+
},
|
|
486
|
+
async flowTestOrder(e, t) {
|
|
487
|
+
return n(await s(t).put(`/test-order/${e}`));
|
|
488
|
+
},
|
|
489
|
+
async cancelTestOrder(e, t) {
|
|
490
|
+
return n(
|
|
491
|
+
await s(t).put(`/test-order/cancel/${e}`)
|
|
492
|
+
);
|
|
493
|
+
},
|
|
494
|
+
async reflowFpOrderNotInDb(e) {
|
|
495
|
+
return n(await s("foodpanda").put("/order/reconcile", e));
|
|
496
|
+
},
|
|
497
|
+
async reflowGfOrderNotInDb(e) {
|
|
498
|
+
return n(await s("grabfood").put("/order/reconcile", e));
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
function Te() {
|
|
503
|
+
return {
|
|
504
|
+
restaurantSettings: {}
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
const Ve = de("restaurant", () => {
|
|
508
|
+
const e = te(), t = O(Te()), u = N(
|
|
509
|
+
() => {
|
|
510
|
+
var a;
|
|
511
|
+
return t.value.restaurantSettings[((a = e.currentRestaurant.value) == null ? void 0 : a._id) || ""];
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
async function y(a) {
|
|
515
|
+
const o = await I.readRestaurantSetting(a);
|
|
516
|
+
return t.value.restaurantSettings = {
|
|
517
|
+
...t.value.restaurantSettings,
|
|
518
|
+
[a]: o
|
|
519
|
+
}, o;
|
|
520
|
+
}
|
|
521
|
+
async function r(a) {
|
|
522
|
+
await y(a), z.setRestaurantId(a), setRestaurantId(a), q.FeatureFlag.setRestaurant(a || void 0), localStorage.set("feedme_restaurant", a);
|
|
523
|
+
}
|
|
524
|
+
async function f(a) {
|
|
525
|
+
await I.updateServiceCharge(a);
|
|
526
|
+
}
|
|
527
|
+
async function m(a) {
|
|
528
|
+
await I.updateDineInSetting(a);
|
|
529
|
+
}
|
|
530
|
+
async function P(a) {
|
|
531
|
+
await I.updatePickupSetting(a);
|
|
532
|
+
}
|
|
533
|
+
async function b(a) {
|
|
534
|
+
await I.updateDriveThruSetting(a);
|
|
535
|
+
}
|
|
536
|
+
async function v(a, o) {
|
|
537
|
+
await S.integratedDelivery.updateInhouse(a, o);
|
|
538
|
+
}
|
|
539
|
+
async function _(a, o) {
|
|
540
|
+
return await S.integratedDelivery.updateFeedme(a, o);
|
|
541
|
+
}
|
|
542
|
+
async function c(a, o) {
|
|
543
|
+
await S.integratedDelivery.updateFoodpanda(a, o);
|
|
544
|
+
}
|
|
545
|
+
async function i(a, o) {
|
|
546
|
+
await S.integratedDelivery.updateGrabfood(a, o);
|
|
547
|
+
}
|
|
548
|
+
async function k(a, o) {
|
|
549
|
+
await S.integratedDelivery.updateLineman(a, o);
|
|
550
|
+
}
|
|
551
|
+
async function B(a, o) {
|
|
552
|
+
await S.integratedDelivery.updateShopeefood(a, o);
|
|
553
|
+
}
|
|
554
|
+
async function A(a, o) {
|
|
555
|
+
await S.integratedDelivery.updateGofood(a, o);
|
|
556
|
+
}
|
|
557
|
+
async function l(a, o) {
|
|
558
|
+
await S.integratedDelivery.updateDeliveroo(a, o);
|
|
559
|
+
}
|
|
560
|
+
async function d(a, o) {
|
|
561
|
+
await S.integratedDelivery.updateExternal(a, o);
|
|
562
|
+
}
|
|
563
|
+
function p() {
|
|
564
|
+
const { t: a } = G();
|
|
565
|
+
if (!e.currentRestaurant.value)
|
|
566
|
+
return "getRestaurantEPayment - Invalid restaurant ";
|
|
567
|
+
const o = e.currentRestaurant.value.payoutAccount, Y = e.currentRestaurant.value.posVersion;
|
|
568
|
+
return !!Y && q.Pos.canUse({
|
|
569
|
+
feature: w.F_FEATURE.enum.qrEPayment,
|
|
570
|
+
posVersion: Y
|
|
571
|
+
}) ? !o || !o.enable || o.status !== w.F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED ? a("order.payoutAccountIsRequired") : !0 : a("order.payoutPosVersion", { version: q.Pos.minVersionToUse(w.F_FEATURE.enum.qrEPayment) });
|
|
572
|
+
}
|
|
573
|
+
return {
|
|
574
|
+
state: t.value,
|
|
575
|
+
currentRestaurantSetting: u.value,
|
|
576
|
+
readRestaurantSetting: y,
|
|
577
|
+
selectRestaurant: r,
|
|
578
|
+
updateServiceCharge: f,
|
|
579
|
+
updateDineInSetting: m,
|
|
580
|
+
updatePickupSetting: P,
|
|
581
|
+
updateDriveThruSetting: b,
|
|
582
|
+
updateInhouseDelivery: v,
|
|
583
|
+
updateFeedmeDelivery: _,
|
|
584
|
+
updateIntegratedFoodpandaDelivery: c,
|
|
585
|
+
updateIntegratedGrabfoodDelivery: i,
|
|
586
|
+
updateIntegratedLinemanDelivery: k,
|
|
587
|
+
updateIntegratedShopeefoodDelivery: B,
|
|
588
|
+
updateIntegratedGofoodDelivery: A,
|
|
589
|
+
updateIntegratedDeliverooDelivery: l,
|
|
590
|
+
updateExternalDelivery: d,
|
|
591
|
+
getRestaurantEPayment: p
|
|
592
|
+
};
|
|
593
|
+
});
|
|
594
|
+
function De() {
|
|
595
|
+
const e = ie();
|
|
596
|
+
function t(m) {
|
|
597
|
+
e.open({
|
|
598
|
+
type: "success",
|
|
599
|
+
message: m,
|
|
600
|
+
position: "bottom"
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
function u(m) {
|
|
604
|
+
e.open({
|
|
605
|
+
type: "error",
|
|
606
|
+
message: m,
|
|
607
|
+
position: "bottom"
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
let y = null;
|
|
611
|
+
function r(m) {
|
|
612
|
+
return y = e.open({
|
|
613
|
+
type: "neutral",
|
|
614
|
+
spinner: !0,
|
|
615
|
+
message: m,
|
|
616
|
+
position: "bottom",
|
|
617
|
+
persistent: !0
|
|
618
|
+
// Ensure the snackbar stays visible until manually closed
|
|
619
|
+
}), y;
|
|
620
|
+
}
|
|
621
|
+
function f() {
|
|
622
|
+
y && (e.close(y), y = null);
|
|
623
|
+
}
|
|
624
|
+
return { showSuccess: t, showError: u, showLoading: r, closeLoadingSnackbar: f };
|
|
625
|
+
}
|
|
626
|
+
const ke = () => {
|
|
627
|
+
const { showError: e } = De(), t = O(!1);
|
|
628
|
+
function u() {
|
|
629
|
+
t.value = !0;
|
|
630
|
+
}
|
|
631
|
+
function y() {
|
|
632
|
+
t.value = !1;
|
|
633
|
+
}
|
|
634
|
+
async function r(m) {
|
|
635
|
+
try {
|
|
636
|
+
return u(), await m();
|
|
637
|
+
} finally {
|
|
638
|
+
y();
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
async function f(m) {
|
|
642
|
+
try {
|
|
643
|
+
return u(), await m();
|
|
644
|
+
} catch (P) {
|
|
645
|
+
throw e(`${P}`), P;
|
|
646
|
+
} finally {
|
|
647
|
+
y();
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return {
|
|
651
|
+
isLoading: t,
|
|
652
|
+
startLoading: u,
|
|
653
|
+
stopLoading: y,
|
|
654
|
+
startAsyncCall: r,
|
|
655
|
+
startAsyncCallWithErr: f
|
|
656
|
+
};
|
|
657
|
+
};
|
|
658
|
+
export {
|
|
659
|
+
Re as _,
|
|
660
|
+
Ve as a,
|
|
661
|
+
De as b,
|
|
662
|
+
I as c,
|
|
663
|
+
S as r,
|
|
664
|
+
ke as u
|
|
665
|
+
};
|