@feedmepos/mf-order-setting 0.0.77 → 0.0.78
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/{KioskDevicesView-Dgs5_UoK.js → KioskDevicesView-Db2DyKc2.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-B4DXPgAV.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-Do-EH0Hn.js} +3 -3
- package/dist/{KioskSettingView-BUcPNVTc.js → KioskSettingView-D1JaAjmx.js} +3 -3
- package/dist/KioskView-B0jhv4Zp.js +464 -0
- package/dist/OrderSettingsView-BPNN4jOB.js +35883 -0
- package/dist/{app-BIvt4NBq.js → app-DpdLDlVr.js} +1993 -1954
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-B58_jBg3.js → dayjs.min-Cs3D4xiZ.js} +1 -1
- package/dist/frontend/mf-order/src/app.d.ts +16 -0
- package/dist/frontend/mf-order/src/helpers/map.d.ts +12 -1
- package/dist/frontend/mf-order/src/main.d.ts +16 -0
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +28 -0
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +9 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.d.ts +5 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +6 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-CLS-FSH-.js → index-BZL2Hpkn.js} +2 -2
- package/dist/{index-CahsmFL1.js → index-DXkcRRAu.js} +1 -1
- package/dist/lineman-settings.dto-CtRqCjzQ.js +74920 -0
- package/dist/package/entity/booking/booking.do.d.ts +125 -0
- package/dist/package/entity/delivery/delivery.dto.d.ts +25 -0
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +87 -0
- package/dist/package/entity/member/member.dto.d.ts +38 -0
- package/dist/package/entity/order/order.do.d.ts +90 -0
- package/dist/package/entity/order/order.dto.d.ts +198 -0
- package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +316 -48
- package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +1131 -209
- package/dist/package/entity/order-platform/external/menu/external-menu.dto.d.ts +3 -3
- package/dist/package/entity/order-platform/external/menu/external-menu.enum.d.ts +10 -1
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +80 -36
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +190 -83
- package/dist/package/entity/order-platform/external/order/external-order.enum.d.ts +2 -2
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +18 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +13 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +25 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +25 -0
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +2 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +25 -0
- package/dist/style.css +1 -1
- package/package.json +7 -9
- package/src/helpers/map.ts +24 -0
- package/src/locales/en-US.json +4 -0
- package/src/locales/ja-JP.json +4 -0
- package/src/locales/th-TH.json +4 -0
- package/src/locales/zh-CN.json +4 -0
- package/src/views/kiosk/KioskView.vue +51 -7
- package/src/views/order-settings/OrderSettingsView.vue +2 -2
- package/src/views/order-settings/delivery/DeliverySetting.vue +18 -1
- package/src/views/order-settings/delivery/delivery.ts +37 -0
- package/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue +24 -8
- package/src/views/order-settings/delivery/inhouse/ZoneDialog.vue +14 -2
- package/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue +136 -27
- package/dist/KioskView-DelVMMj4.js +0 -430
- package/dist/OrderSettingsView-DE2U7vqW.js +0 -60930
- package/dist/lineman-settings.dto-DBDThIb0.js +0 -62793
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as P, defineComponent as ee, resolveComponent as S, openBlock as l, createElementBlock as u, createElementVNode as a, toDisplayString as i, unref as s, createVNode as m, computed as T, watch as pe, createCommentVNode as D, withCtx as H, Fragment as W, renderList as Z, normalizeClass as we, createBlock as L, createTextVNode as X, renderSlot as Ae } from "vue";
|
|
2
2
|
import { useI18n as le } from "@feedmepos/mf-common";
|
|
3
3
|
import { defineStore as Pe } from "pinia";
|
|
4
|
-
import { r as Y, g as ve } from "./lineman-settings.dto-
|
|
4
|
+
import { r as Y, g as ve } from "./lineman-settings.dto-CtRqCjzQ.js";
|
|
5
5
|
import { useDialog as De, useSnackbar as Se } from "@feedmepos/ui-library";
|
|
6
|
-
import { d as ie } from "./dayjs.min-
|
|
7
|
-
import { g as Ce, c as Fe, a as fe } from "./app-
|
|
6
|
+
import { d as ie } from "./dayjs.min-Cs3D4xiZ.js";
|
|
7
|
+
import { g as Ce, c as Fe, a as fe } from "./app-DpdLDlVr.js";
|
|
8
8
|
async function Me() {
|
|
9
9
|
const n = await Y().get("/kiosk/otp");
|
|
10
10
|
return ve(n);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as oe, computed as A, ref as L, onMounted as pe, resolveComponent as w, openBlock as k, createBlock as G, withCtx as T, createVNode as s, unref as a, createElementVNode as r, withDirectives as R, vShow as U, watch as ce, createElementBlock as q, toDisplayString as g, createCommentVNode as ye } from "vue";
|
|
2
|
-
import { e as le, b as re, s as se, d as fe, r as ae, f as te, h as ve } from "./app-
|
|
3
|
-
import { b as m, c as be } from "./lineman-settings.dto-
|
|
4
|
-
import { _ as ge, u as Ie, a as Pe } from "./index-
|
|
2
|
+
import { e as le, b as re, s as se, d as fe, r as ae, f as te, h as ve } from "./app-DpdLDlVr.js";
|
|
3
|
+
import { b as m, c as be } from "./lineman-settings.dto-CtRqCjzQ.js";
|
|
4
|
+
import { _ as ge, u as Ie, a as Pe } from "./index-BZL2Hpkn.js";
|
|
5
5
|
import { useI18n as de, FeedMeAuth as ie, useCoreStore as Se } from "@feedmepos/mf-common";
|
|
6
6
|
import { useSnackbar as xe } from "@feedmepos/ui-library";
|
|
7
7
|
const we = { class: "ml-7" }, _e = { class: "ml-7" }, Ce = { class: "flex flex-row gap-9" }, Ve = /* @__PURE__ */ oe({
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { defineComponent as j, openBlock as _, createElementBlock as G, createElementVNode as m, toDisplayString as w, unref as i, ref as f, defineAsyncComponent as le, computed as L, onMounted as re, watch as ce, resolveComponent as P, createVNode as T, withCtx as ue, createBlock as U, createCommentVNode as E } from "vue";
|
|
2
|
+
import { u as oe, _ as se } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-Do-EH0Hn.js";
|
|
3
|
+
import { useDialog as pe, useSnackbar as de } from "@feedmepos/ui-library";
|
|
4
|
+
import { useI18n as Q, useCoreStore as ie } from "@feedmepos/mf-common";
|
|
5
|
+
import { F as me, a as ye, S as M } from "./lineman-settings.dto-CtRqCjzQ.js";
|
|
6
|
+
import { defineStore as fe } from "pinia";
|
|
7
|
+
import { O as N } from "./index-DXkcRRAu.js";
|
|
8
|
+
import { u as ve } from "./app-DpdLDlVr.js";
|
|
9
|
+
const be = { class: "flex flex-col gap-5 pb-6" }, _e = { class: "fm-typo-en-body-md-400 block" }, Ce = { class: "fm-typo-en-title-md-600" }, he = /* @__PURE__ */ j({
|
|
10
|
+
__name: "KioskOtpDialog",
|
|
11
|
+
props: {
|
|
12
|
+
otp: {}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const { t: a } = Q();
|
|
16
|
+
return (l, c) => (_(), G("div", be, [
|
|
17
|
+
m("span", _e, w(i(a)("order.bindDeviceMessage")), 1),
|
|
18
|
+
m("div", Ce, w(e.otp), 1)
|
|
19
|
+
]));
|
|
20
|
+
}
|
|
21
|
+
}), z = {
|
|
22
|
+
enabled: !1,
|
|
23
|
+
prefix: null,
|
|
24
|
+
padDigit: 0,
|
|
25
|
+
standSlotRange: {
|
|
26
|
+
min: 1,
|
|
27
|
+
max: 10
|
|
28
|
+
},
|
|
29
|
+
enablePaxDialog: !1,
|
|
30
|
+
submitOrderInstruction: {
|
|
31
|
+
payAtCounter: null,
|
|
32
|
+
paid: null
|
|
33
|
+
}
|
|
34
|
+
}, Pe = {
|
|
35
|
+
enabled: !1,
|
|
36
|
+
submitOrderInstruction: {
|
|
37
|
+
payAtCounter: null,
|
|
38
|
+
paid: null
|
|
39
|
+
}
|
|
40
|
+
}, J = {
|
|
41
|
+
enabled: !1,
|
|
42
|
+
submitOrderInstruction: {
|
|
43
|
+
payAtCounter: null,
|
|
44
|
+
paid: null
|
|
45
|
+
},
|
|
46
|
+
enablePaxDialog: !1
|
|
47
|
+
}, we = {
|
|
48
|
+
dineIn: {
|
|
49
|
+
enabled: !1,
|
|
50
|
+
pickUp: J,
|
|
51
|
+
sequenceNumber: me.parse({}),
|
|
52
|
+
displayStand: z
|
|
53
|
+
},
|
|
54
|
+
takeaway: Pe,
|
|
55
|
+
paymentSetting: {
|
|
56
|
+
paymentTypes: [],
|
|
57
|
+
offlinePaymentTypes: [],
|
|
58
|
+
ePaymentTypes: {
|
|
59
|
+
terminal: !1,
|
|
60
|
+
card: {
|
|
61
|
+
terminal: !1,
|
|
62
|
+
nfc: !1
|
|
63
|
+
},
|
|
64
|
+
eWallet: {
|
|
65
|
+
terminalQrPay: !1,
|
|
66
|
+
terminalScanPay: !1,
|
|
67
|
+
qrPay: !1,
|
|
68
|
+
scanPay: !1
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
menuItem: {
|
|
73
|
+
showAllOnly: !1
|
|
74
|
+
},
|
|
75
|
+
coverImageLandscape: null,
|
|
76
|
+
coverImagePortrait: null,
|
|
77
|
+
otaChannel: "",
|
|
78
|
+
autoCloseBill: null,
|
|
79
|
+
printReceiptAfterClose: null
|
|
80
|
+
}, F = {
|
|
81
|
+
payAtCounter: null,
|
|
82
|
+
paid: null
|
|
83
|
+
}, Ae = (e) => {
|
|
84
|
+
var a;
|
|
85
|
+
return {
|
|
86
|
+
kiosk: Ie(e.kioskSettings, (a = e.sequenceSettings) == null ? void 0 : a.kioskDineIn)
|
|
87
|
+
};
|
|
88
|
+
}, Ie = (e, a) => {
|
|
89
|
+
var l, c, t, n, u, o, s, d, C, v, y;
|
|
90
|
+
return {
|
|
91
|
+
dineIn: xe(
|
|
92
|
+
a ?? {
|
|
93
|
+
current: 0,
|
|
94
|
+
prefix: "#K"
|
|
95
|
+
},
|
|
96
|
+
(e == null ? void 0 : e.dineIn) ?? void 0
|
|
97
|
+
),
|
|
98
|
+
takeaway: {
|
|
99
|
+
enabled: (e == null ? void 0 : e.canTakeaway) ?? !1,
|
|
100
|
+
submitOrderInstruction: (l = e == null ? void 0 : e.takeaway) != null && l.submitOrderInstruction ? {
|
|
101
|
+
payAtCounter: ((n = (t = (c = e == null ? void 0 : e.takeaway) == null ? void 0 : c.submitOrderInstruction) == null ? void 0 : t.payAtCounter) == null ? void 0 : n.en) ?? null,
|
|
102
|
+
paid: ((s = (o = (u = e == null ? void 0 : e.takeaway) == null ? void 0 : u.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : s.en) ?? null
|
|
103
|
+
} : F
|
|
104
|
+
},
|
|
105
|
+
paymentSetting: {
|
|
106
|
+
paymentTypes: ((d = e == null ? void 0 : e.paymentSetting) == null ? void 0 : d.paymentTypes) ?? [],
|
|
107
|
+
offlinePaymentTypes: ((C = e == null ? void 0 : e.paymentSetting) == null ? void 0 : C.offlinePaymentTypes) ?? [],
|
|
108
|
+
ePaymentTypes: ((v = e == null ? void 0 : e.paymentSetting) == null ? void 0 : v.ePaymentTypes) ?? ye.parse({
|
|
109
|
+
card: {
|
|
110
|
+
terminal: !1,
|
|
111
|
+
nfc: !1
|
|
112
|
+
},
|
|
113
|
+
eWallet: {
|
|
114
|
+
qrPay: !1,
|
|
115
|
+
scanPay: !1
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
},
|
|
119
|
+
menuItem: {
|
|
120
|
+
showAllOnly: ((y = e == null ? void 0 : e.menuItem) == null ? void 0 : y.showAllOnly) ?? !1
|
|
121
|
+
},
|
|
122
|
+
otaChannel: (e == null ? void 0 : e.otaChannel) ?? "",
|
|
123
|
+
coverImageLandscape: (e == null ? void 0 : e.coverImageLandscape) ?? null,
|
|
124
|
+
coverImagePortrait: (e == null ? void 0 : e.coverImagePortrait) ?? null,
|
|
125
|
+
// Preserve "unset" as null — collapsing to a boolean here is what let an
|
|
126
|
+
// unrelated save overwrite the inherited dineInSettings value.
|
|
127
|
+
autoCloseBill: (e == null ? void 0 : e.autoCloseBill) ?? null,
|
|
128
|
+
printReceiptAfterClose: (e == null ? void 0 : e.printReceiptAfterClose) ?? null
|
|
129
|
+
};
|
|
130
|
+
}, xe = (e, a) => {
|
|
131
|
+
var l, c, t, n, u, o, s, d;
|
|
132
|
+
return {
|
|
133
|
+
enabled: !!a,
|
|
134
|
+
sequenceNumber: e,
|
|
135
|
+
pickUp: a != null && a.pickUp ? {
|
|
136
|
+
...a.pickUp,
|
|
137
|
+
submitOrderInstruction: a.pickUp.submitOrderInstruction ? {
|
|
138
|
+
payAtCounter: ((c = (l = a.pickUp.submitOrderInstruction) == null ? void 0 : l.payAtCounter) == null ? void 0 : c.en) ?? null,
|
|
139
|
+
paid: ((n = (t = a.pickUp.submitOrderInstruction) == null ? void 0 : t.paid) == null ? void 0 : n.en) ?? null
|
|
140
|
+
} : F,
|
|
141
|
+
enablePaxDialog: a.pickUp.enablePaxDialog ? a.pickUp.enablePaxDialog : !1
|
|
142
|
+
} : J,
|
|
143
|
+
displayStand: a != null && a.displayStand ? {
|
|
144
|
+
enabled: a.displayStand.enabled,
|
|
145
|
+
standSlotRange: a.displayStand.standSlotRange,
|
|
146
|
+
prefix: a.displayStand.prefix,
|
|
147
|
+
padDigit: a.displayStand.padDigit,
|
|
148
|
+
enablePaxDialog: a.displayStand.enablePaxDialog ?? !1,
|
|
149
|
+
submitOrderInstruction: a.displayStand.submitOrderInstruction ? {
|
|
150
|
+
payAtCounter: ((o = (u = a.displayStand.submitOrderInstruction) == null ? void 0 : u.payAtCounter) == null ? void 0 : o.en) ?? null,
|
|
151
|
+
paid: ((d = (s = a.displayStand.submitOrderInstruction) == null ? void 0 : s.paid) == null ? void 0 : d.en) ?? null
|
|
152
|
+
} : F
|
|
153
|
+
} : z
|
|
154
|
+
};
|
|
155
|
+
}, Re = (e) => {
|
|
156
|
+
const a = (t) => {
|
|
157
|
+
var n, u, o, s;
|
|
158
|
+
return {
|
|
159
|
+
requiredSlot: !!t.displayStand,
|
|
160
|
+
displayStand: {
|
|
161
|
+
...t.displayStand,
|
|
162
|
+
submitOrderInstruction: {
|
|
163
|
+
payAtCounter: (n = t.displayStand.submitOrderInstruction) != null && n.payAtCounter ? {
|
|
164
|
+
en: t.displayStand.submitOrderInstruction.payAtCounter
|
|
165
|
+
} : null,
|
|
166
|
+
paid: (u = t.displayStand.submitOrderInstruction) != null && u.paid ? {
|
|
167
|
+
en: t.displayStand.submitOrderInstruction.paid
|
|
168
|
+
} : null
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
pickUp: {
|
|
172
|
+
...t.pickUp,
|
|
173
|
+
submitOrderInstruction: {
|
|
174
|
+
payAtCounter: (o = t.pickUp.submitOrderInstruction) != null && o.payAtCounter ? {
|
|
175
|
+
en: t.pickUp.submitOrderInstruction.payAtCounter
|
|
176
|
+
} : null,
|
|
177
|
+
paid: (s = t.pickUp.submitOrderInstruction) != null && s.paid ? {
|
|
178
|
+
en: t.pickUp.submitOrderInstruction.paid
|
|
179
|
+
} : null
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}, l = (t) => ({
|
|
184
|
+
canTakeaway: e.takeaway.enabled,
|
|
185
|
+
dineIn: t,
|
|
186
|
+
menuItem: e.menuItem,
|
|
187
|
+
coverImageLandscape: e.coverImageLandscape,
|
|
188
|
+
coverImagePortrait: e.coverImagePortrait,
|
|
189
|
+
otaChannel: e.otaChannel || void 0,
|
|
190
|
+
// Omit when unset so the backend's `?? config.autoCloseBill` inheritance
|
|
191
|
+
// still applies — sending `false` here would pin it off for good.
|
|
192
|
+
autoCloseBill: e.autoCloseBill ?? void 0,
|
|
193
|
+
printReceiptAfterClose: e.printReceiptAfterClose ?? void 0,
|
|
194
|
+
paymentSetting: c(e.paymentSetting),
|
|
195
|
+
takeaway: e.takeaway.submitOrderInstruction ? {
|
|
196
|
+
submitOrderInstruction: {
|
|
197
|
+
payAtCounter: e.takeaway.submitOrderInstruction.payAtCounter ? {
|
|
198
|
+
en: e.takeaway.submitOrderInstruction.payAtCounter
|
|
199
|
+
} : null,
|
|
200
|
+
paid: e.takeaway.submitOrderInstruction.paid ? {
|
|
201
|
+
en: e.takeaway.submitOrderInstruction.paid
|
|
202
|
+
} : null
|
|
203
|
+
}
|
|
204
|
+
} : void 0
|
|
205
|
+
}), c = (t) => ({
|
|
206
|
+
paymentTypes: t.paymentTypes,
|
|
207
|
+
offlinePaymentTypes: t.offlinePaymentTypes,
|
|
208
|
+
ePaymentTypes: t.ePaymentTypes
|
|
209
|
+
});
|
|
210
|
+
return e.dineIn.enabled ? {
|
|
211
|
+
kioskSettings: l(a(e.dineIn)),
|
|
212
|
+
kioskDineIn: e.dineIn.sequenceNumber
|
|
213
|
+
} : {
|
|
214
|
+
kioskSettings: l()
|
|
215
|
+
};
|
|
216
|
+
}, H = {
|
|
217
|
+
convertOrderSettingDto: Ae,
|
|
218
|
+
toOrderKioskSettingsDto: Re
|
|
219
|
+
}, Le = fe("orderSetting", () => {
|
|
220
|
+
const e = f({});
|
|
221
|
+
async function a() {
|
|
222
|
+
const n = await N.getOrderSetting();
|
|
223
|
+
c(n);
|
|
224
|
+
}
|
|
225
|
+
async function l() {
|
|
226
|
+
if (e.value.orderSetting && e.value.kiosk) {
|
|
227
|
+
const { _id: n, ...u } = e.value.orderSetting, o = H.toOrderKioskSettingsDto(e.value.kiosk), s = {
|
|
228
|
+
...u,
|
|
229
|
+
kioskSettings: o.kioskSettings
|
|
230
|
+
}, d = await N.updateOrderSetting(s);
|
|
231
|
+
c(d);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function c(n) {
|
|
235
|
+
e.value.orderSetting = n, e.value.kiosk = H.convertOrderSettingDto(n).kiosk;
|
|
236
|
+
}
|
|
237
|
+
function t(n) {
|
|
238
|
+
e.value.kiosk = n;
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
state: e.value,
|
|
242
|
+
getSetting: a,
|
|
243
|
+
updateKioskSetting: l,
|
|
244
|
+
setKioskOrderSetting: t
|
|
245
|
+
};
|
|
246
|
+
}), Te = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ue = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Ee = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), Fe = /[^\p{L}\d]+/giu, W = "$1\0$2", X = "";
|
|
247
|
+
function Y(e) {
|
|
248
|
+
let a = e.trim();
|
|
249
|
+
a = a.replace(Te, W).replace(Ue, W), a = a.replace(Fe, "\0");
|
|
250
|
+
let l = 0, c = a.length;
|
|
251
|
+
for (; a.charAt(l) === "\0"; )
|
|
252
|
+
l++;
|
|
253
|
+
if (l === c)
|
|
254
|
+
return [];
|
|
255
|
+
for (; a.charAt(c - 1) === "\0"; )
|
|
256
|
+
c--;
|
|
257
|
+
return a.slice(l, c).split(/\0/g);
|
|
258
|
+
}
|
|
259
|
+
function Ke(e) {
|
|
260
|
+
const a = Y(e);
|
|
261
|
+
for (let l = 0; l < a.length; l++) {
|
|
262
|
+
const c = a[l], t = Ee.exec(c);
|
|
263
|
+
if (t) {
|
|
264
|
+
const n = t.index + (t[1] ?? t[2]).length;
|
|
265
|
+
a.splice(l, 1, c.slice(0, n), c.slice(n));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return a;
|
|
269
|
+
}
|
|
270
|
+
function De(e, a) {
|
|
271
|
+
const [l, c, t] = $e(e, a), n = qe(a == null ? void 0 : a.locale), u = Be(a == null ? void 0 : a.locale);
|
|
272
|
+
return l + c.map(Ve(n, u)).join(" ") + t;
|
|
273
|
+
}
|
|
274
|
+
function qe(e) {
|
|
275
|
+
return (a) => a.toLocaleLowerCase(e);
|
|
276
|
+
}
|
|
277
|
+
function Be(e) {
|
|
278
|
+
return (a) => a.toLocaleUpperCase(e);
|
|
279
|
+
}
|
|
280
|
+
function Ve(e, a) {
|
|
281
|
+
return (l) => `${a(l[0])}${e(l.slice(1))}`;
|
|
282
|
+
}
|
|
283
|
+
function $e(e, a = {}) {
|
|
284
|
+
const l = a.split ?? (a.separateNumbers ? Ke : Y), c = a.prefixCharacters ?? X, t = a.suffixCharacters ?? X;
|
|
285
|
+
let n = 0, u = e.length;
|
|
286
|
+
for (; n < e.length; ) {
|
|
287
|
+
const o = e.charAt(n);
|
|
288
|
+
if (!c.includes(o))
|
|
289
|
+
break;
|
|
290
|
+
n++;
|
|
291
|
+
}
|
|
292
|
+
for (; u > n; ) {
|
|
293
|
+
const o = u - 1, s = e.charAt(o);
|
|
294
|
+
if (!t.includes(s))
|
|
295
|
+
break;
|
|
296
|
+
u = o;
|
|
297
|
+
}
|
|
298
|
+
return [
|
|
299
|
+
e.slice(0, n),
|
|
300
|
+
l(e.slice(n, u)),
|
|
301
|
+
e.slice(u)
|
|
302
|
+
];
|
|
303
|
+
}
|
|
304
|
+
const Me = { class: "py-[1.5rem]" }, Ne = { class: "px-[1.5rem]" }, He = { class: "pt-[1.5rem]" }, We = { class: "flex flex-col gap-10" }, Xe = { class: "fm-typo-en-title-sm-600" }, je = { class: "fm-typo-en-title-sm-400" }, Se = /* @__PURE__ */ j({
|
|
305
|
+
__name: "KioskView",
|
|
306
|
+
setup(e) {
|
|
307
|
+
var V, $;
|
|
308
|
+
const { t: a } = Q(), { canManageOrderSetting: l } = ve(), c = le(
|
|
309
|
+
() => import("./KioskSettingView-D1JaAjmx.js")
|
|
310
|
+
), t = f("device"), n = oe(), u = Le(), o = pe(), { currentRestaurant: s, restaurants: d, changeRestaurant: C } = ie(), v = de(), y = f(((V = s.value) == null ? void 0 : V._id) ?? void 0), A = f(null), I = f(""), K = f(null), D = L(() => {
|
|
311
|
+
const r = I.value.trim().toLowerCase();
|
|
312
|
+
return d.value.filter(
|
|
313
|
+
(p) => !r || p.profile.name.toLowerCase().includes(r) || p._id.toLowerCase().includes(r)
|
|
314
|
+
).map((p) => ({
|
|
315
|
+
label: p.profile.name,
|
|
316
|
+
value: p._id
|
|
317
|
+
}));
|
|
318
|
+
});
|
|
319
|
+
async function Z(r) {
|
|
320
|
+
I.value = r;
|
|
321
|
+
}
|
|
322
|
+
function O(r) {
|
|
323
|
+
var p, b;
|
|
324
|
+
if (!r) {
|
|
325
|
+
I.value = "";
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
(b = (p = K.value) == null ? void 0 : p.querySelector("input")) == null || b.select();
|
|
329
|
+
}
|
|
330
|
+
const h = f((($ = s.value) == null ? void 0 : $._id) ?? "");
|
|
331
|
+
async function q(r) {
|
|
332
|
+
const p = d.value.find((b) => b._id == r);
|
|
333
|
+
await C(p), await B(), y.value = r, h.value = r;
|
|
334
|
+
}
|
|
335
|
+
async function B() {
|
|
336
|
+
if (l.value)
|
|
337
|
+
try {
|
|
338
|
+
await u.getSetting();
|
|
339
|
+
} catch {
|
|
340
|
+
}
|
|
341
|
+
await x();
|
|
342
|
+
}
|
|
343
|
+
async function x() {
|
|
344
|
+
A.value = null;
|
|
345
|
+
try {
|
|
346
|
+
await n.getDevices();
|
|
347
|
+
} catch (r) {
|
|
348
|
+
A.value = r instanceof M && r.status === 403 ? "forbidden" : "error";
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const g = L(() => {
|
|
352
|
+
const r = [{ label: a("order.deviceBinding"), value: "device" }];
|
|
353
|
+
return l.value && r.push({ label: a("order.settings"), value: "setting" }), r;
|
|
354
|
+
}), S = L(() => n.state.devices);
|
|
355
|
+
async function k() {
|
|
356
|
+
try {
|
|
357
|
+
await n.requestOtp();
|
|
358
|
+
} catch (r) {
|
|
359
|
+
v.open({
|
|
360
|
+
title: r instanceof M && r.status === 403 ? a("order.bindDevicePermissionDenied") : a("order.bindDeviceFailed"),
|
|
361
|
+
type: "error"
|
|
362
|
+
});
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
o.open({
|
|
366
|
+
title: De(a("order.bindDevice")),
|
|
367
|
+
contentComponent: he,
|
|
368
|
+
contentComponentProps: {
|
|
369
|
+
otp: n.state.otp
|
|
370
|
+
}
|
|
371
|
+
}).onClose(async () => {
|
|
372
|
+
await x();
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
async function ee(r) {
|
|
376
|
+
try {
|
|
377
|
+
u.setKioskOrderSetting(r), await u.updateKioskSetting(), v.open({
|
|
378
|
+
title: a("order.kioskSettingSuccess"),
|
|
379
|
+
type: "success"
|
|
380
|
+
});
|
|
381
|
+
} catch {
|
|
382
|
+
v.open({
|
|
383
|
+
title: a("order.kioskSettingFailed"),
|
|
384
|
+
type: "error"
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return re(async () => {
|
|
389
|
+
var r;
|
|
390
|
+
(r = s.value) != null && r._id && (h.value = s.value._id, await B());
|
|
391
|
+
}), ce(
|
|
392
|
+
() => d.value.length,
|
|
393
|
+
async (r) => {
|
|
394
|
+
y.value === void 0 && d.value.length > 0 && await q(d.value[0]._id);
|
|
395
|
+
},
|
|
396
|
+
{ immediate: !0 }
|
|
397
|
+
), (r, p) => {
|
|
398
|
+
const b = P("FmPageHead"), ae = P("FmTabs"), te = P("FmMenuItem"), ne = P("FmSelect");
|
|
399
|
+
return _(), G("div", Me, [
|
|
400
|
+
T(b, {
|
|
401
|
+
title: i(a)("order.kiosk")
|
|
402
|
+
}, null, 8, ["title"]),
|
|
403
|
+
m("div", Ne, [
|
|
404
|
+
T(ae, {
|
|
405
|
+
"model-value": t.value,
|
|
406
|
+
"onUpdate:modelValue": p[0] || (p[0] = (R) => t.value = R),
|
|
407
|
+
items: g.value
|
|
408
|
+
}, null, 8, ["model-value", "items"]),
|
|
409
|
+
m("div", He, [
|
|
410
|
+
m("div", We, [
|
|
411
|
+
m("div", {
|
|
412
|
+
class: "flex flex-col gap-2",
|
|
413
|
+
ref_key: "restaurantPicker",
|
|
414
|
+
ref: K
|
|
415
|
+
}, [
|
|
416
|
+
m("span", Xe, w(i(a)("order.activateLocation")), 1),
|
|
417
|
+
m("span", je, w(i(a)("order.selectRestaurant")) + ": ", 1),
|
|
418
|
+
T(ne, {
|
|
419
|
+
class: "w-1/2",
|
|
420
|
+
modelValue: y.value,
|
|
421
|
+
"onUpdate:modelValue": [
|
|
422
|
+
p[1] || (p[1] = (R) => y.value = R),
|
|
423
|
+
q
|
|
424
|
+
],
|
|
425
|
+
items: D.value,
|
|
426
|
+
placeholder: i(a)("order.searchRestaurant"),
|
|
427
|
+
searchable: "",
|
|
428
|
+
"search-debounce": 150,
|
|
429
|
+
"on-search": Z,
|
|
430
|
+
onDropdownChanged: O
|
|
431
|
+
}, {
|
|
432
|
+
"append-menu": ue(() => [
|
|
433
|
+
D.value.length ? E("", !0) : (_(), U(te, {
|
|
434
|
+
key: 0,
|
|
435
|
+
disabled: "",
|
|
436
|
+
label: i(a)("order.noRestaurantFound")
|
|
437
|
+
}, null, 8, ["label"]))
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
}, 8, ["modelValue", "items", "placeholder"])
|
|
441
|
+
], 512),
|
|
442
|
+
t.value == "device" ? (_(), U(se, {
|
|
443
|
+
key: 0,
|
|
444
|
+
devices: S.value,
|
|
445
|
+
"load-error": A.value,
|
|
446
|
+
onRequestOtp: k,
|
|
447
|
+
onRetry: x
|
|
448
|
+
}, null, 8, ["devices", "load-error"])) : E("", !0),
|
|
449
|
+
t.value == "setting" && i(l) ? (_(), U(i(c), {
|
|
450
|
+
key: `KioskSettingView-${h.value}`,
|
|
451
|
+
"restaurant-id": h.value,
|
|
452
|
+
onUpdateKioskOrderSetting: ee,
|
|
453
|
+
form: i(u).state.kiosk ?? i(we)
|
|
454
|
+
}, null, 8, ["restaurant-id", "form"])) : E("", !0)
|
|
455
|
+
])
|
|
456
|
+
])
|
|
457
|
+
])
|
|
458
|
+
]);
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
export {
|
|
463
|
+
Se as default
|
|
464
|
+
};
|