@feedmepos/mf-order-setting 0.0.75-prod → 0.0.76
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-B1dsUMwh.js → KioskDevicesView-H7stMDFu.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-BmCrSZnS.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-DgpV4oKE.js} +3 -3
- package/dist/{KioskSettingView-DUUr39PJ.js → KioskSettingView-fF6k9s_q.js} +3 -3
- package/dist/KioskView-Cxcc1UL1.js +420 -0
- package/dist/{OrderSettingsView-AY0L3EfF.js → OrderSettingsView-Ds2L_rbu.js} +7717 -7871
- package/dist/{app-DzO7wZsC.js → app-BDlPjU4y.js} +9 -5
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BNHTbbaJ.js → dayjs.min-OJf1trOq.js} +1 -1
- package/dist/frontend/mf-order/src/app.d.ts +4 -0
- package/dist/frontend/mf-order/src/main.d.ts +4 -0
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSetting.vue.d.ts +0 -17
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +9 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-DQA37h5T.js → index-Bid9lO2x.js} +2 -2
- package/dist/index-gGOpbnY3.js +23 -0
- package/dist/{lineman-settings.dto-BMG_DnTF.js → lineman-settings.dto-Cny_fF4n.js} +1 -1
- package/package.json +1 -1
- package/src/locales/en-US.json +1 -0
- package/src/locales/ja-JP.json +1 -0
- package/src/locales/th-TH.json +1 -0
- package/src/locales/zh-CN.json +1 -0
- package/src/views/order-settings/pickup/PickUpSetting.vue +124 -195
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +24 -1
- package/dist/KioskView-4_Kl607M.js +0 -362
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialog.vue.d.ts +0 -16
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickupList.vue.d.ts +0 -16
- package/dist/index-BP0fOlVh.js +0 -86
- package/src/views/order-settings/pickup/PickUpSettingDialog.vue +0 -118
- package/src/views/order-settings/pickup/PickupList.vue +0 -49
|
@@ -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-Cny_fF4n.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-OJf1trOq.js";
|
|
7
|
+
import { g as Ce, c as Fe, a as fe } from "./app-BDlPjU4y.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 me, resolveComponent as w, openBlock as R, createBlock as G, withCtx as k, createVNode as s, unref as l, createElementVNode as r, withDirectives as E, vShow as N, watch as pe, createElementBlock as j, toDisplayString as g, createCommentVNode as ce } from "vue";
|
|
2
|
-
import { e as ae, b as re, s as se, d as ye, r as le, f as te, h as fe } from "./app-
|
|
3
|
-
import { b as m, c as ve } from "./lineman-settings.dto-
|
|
4
|
-
import { _ as be, u as ge, a as Ie } from "./index-
|
|
2
|
+
import { e as ae, b as re, s as se, d as ye, r as le, f as te, h as fe } from "./app-BDlPjU4y.js";
|
|
3
|
+
import { b as m, c as ve } from "./lineman-settings.dto-Cny_fF4n.js";
|
|
4
|
+
import { _ as be, u as ge, a as Ie } from "./index-Bid9lO2x.js";
|
|
5
5
|
import { useI18n as de, FeedMeAuth as ie, useCoreStore as Pe } from "@feedmepos/mf-common";
|
|
6
6
|
import { useSnackbar as Se } from "@feedmepos/ui-library";
|
|
7
7
|
const xe = { class: "ml-7" }, we = { class: "ml-7" }, _e = { class: "flex flex-row gap-9" }, Ve = /* @__PURE__ */ oe({
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { defineComponent as H, openBlock as P, createElementBlock as W, createElementVNode as i, toDisplayString as h, unref as d, ref as v, defineAsyncComponent as k, computed as A, onMounted as ee, watch as ae, resolveComponent as T, createVNode as U, createBlock as D, createCommentVNode as q } from "vue";
|
|
2
|
+
import { u as te, _ as ne } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-DgpV4oKE.js";
|
|
3
|
+
import { useDialog as le, useSnackbar as re } from "@feedmepos/ui-library";
|
|
4
|
+
import { useI18n as X, useCoreStore as ce } from "@feedmepos/mf-common";
|
|
5
|
+
import { F as ue, a as oe, S as V } from "./lineman-settings.dto-Cny_fF4n.js";
|
|
6
|
+
import { defineStore as se } from "pinia";
|
|
7
|
+
import { O as $ } from "./index-gGOpbnY3.js";
|
|
8
|
+
import { u as pe } from "./app-BDlPjU4y.js";
|
|
9
|
+
const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body-md-400 block" }, me = { class: "fm-typo-en-title-md-600" }, ye = /* @__PURE__ */ H({
|
|
10
|
+
__name: "KioskOtpDialog",
|
|
11
|
+
props: {
|
|
12
|
+
otp: {}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const { t: a } = X();
|
|
16
|
+
return (l, r) => (P(), W("div", de, [
|
|
17
|
+
i("span", ie, h(d(a)("order.bindDeviceMessage")), 1),
|
|
18
|
+
i("div", me, h(e.otp), 1)
|
|
19
|
+
]));
|
|
20
|
+
}
|
|
21
|
+
}), j = {
|
|
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
|
+
}, fe = {
|
|
35
|
+
enabled: !1,
|
|
36
|
+
submitOrderInstruction: {
|
|
37
|
+
payAtCounter: null,
|
|
38
|
+
paid: null
|
|
39
|
+
}
|
|
40
|
+
}, G = {
|
|
41
|
+
enabled: !1,
|
|
42
|
+
submitOrderInstruction: {
|
|
43
|
+
payAtCounter: null,
|
|
44
|
+
paid: null
|
|
45
|
+
},
|
|
46
|
+
enablePaxDialog: !1
|
|
47
|
+
}, ve = {
|
|
48
|
+
dineIn: {
|
|
49
|
+
enabled: !1,
|
|
50
|
+
pickUp: G,
|
|
51
|
+
sequenceNumber: ue.parse({}),
|
|
52
|
+
displayStand: j
|
|
53
|
+
},
|
|
54
|
+
takeaway: fe,
|
|
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
|
+
}, L = {
|
|
79
|
+
payAtCounter: null,
|
|
80
|
+
paid: null
|
|
81
|
+
}, be = (e) => {
|
|
82
|
+
var a;
|
|
83
|
+
return {
|
|
84
|
+
kiosk: _e(e.kioskSettings, (a = e.sequenceSettings) == null ? void 0 : a.kioskDineIn)
|
|
85
|
+
};
|
|
86
|
+
}, _e = (e, a) => {
|
|
87
|
+
var l, r, t, n, c, o, s, p, b, f, m;
|
|
88
|
+
return {
|
|
89
|
+
dineIn: Pe(
|
|
90
|
+
a ?? {
|
|
91
|
+
current: 0,
|
|
92
|
+
prefix: "#K"
|
|
93
|
+
},
|
|
94
|
+
(e == null ? void 0 : e.dineIn) ?? void 0
|
|
95
|
+
),
|
|
96
|
+
takeaway: {
|
|
97
|
+
enabled: (e == null ? void 0 : e.canTakeaway) ?? !1,
|
|
98
|
+
submitOrderInstruction: (l = e == null ? void 0 : e.takeaway) != null && l.submitOrderInstruction ? {
|
|
99
|
+
payAtCounter: ((n = (t = (r = e == null ? void 0 : e.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : t.payAtCounter) == null ? void 0 : n.en) ?? null,
|
|
100
|
+
paid: ((s = (o = (c = e == null ? void 0 : e.takeaway) == null ? void 0 : c.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : s.en) ?? null
|
|
101
|
+
} : L
|
|
102
|
+
},
|
|
103
|
+
paymentSetting: {
|
|
104
|
+
paymentTypes: ((p = e == null ? void 0 : e.paymentSetting) == null ? void 0 : p.paymentTypes) ?? [],
|
|
105
|
+
offlinePaymentTypes: ((b = e == null ? void 0 : e.paymentSetting) == null ? void 0 : b.offlinePaymentTypes) ?? [],
|
|
106
|
+
ePaymentTypes: ((f = e == null ? void 0 : e.paymentSetting) == null ? void 0 : f.ePaymentTypes) ?? oe.parse({
|
|
107
|
+
card: {
|
|
108
|
+
terminal: !1,
|
|
109
|
+
nfc: !1
|
|
110
|
+
},
|
|
111
|
+
eWallet: {
|
|
112
|
+
qrPay: !1,
|
|
113
|
+
scanPay: !1
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
},
|
|
117
|
+
menuItem: {
|
|
118
|
+
showAllOnly: ((m = e == null ? void 0 : e.menuItem) == null ? void 0 : m.showAllOnly) ?? !1
|
|
119
|
+
},
|
|
120
|
+
otaChannel: (e == null ? void 0 : e.otaChannel) ?? "",
|
|
121
|
+
coverImageLandscape: (e == null ? void 0 : e.coverImageLandscape) ?? null,
|
|
122
|
+
coverImagePortrait: (e == null ? void 0 : e.coverImagePortrait) ?? null
|
|
123
|
+
};
|
|
124
|
+
}, Pe = (e, a) => {
|
|
125
|
+
var l, r, t, n, c, o, s, p;
|
|
126
|
+
return {
|
|
127
|
+
enabled: !!a,
|
|
128
|
+
sequenceNumber: e,
|
|
129
|
+
pickUp: a != null && a.pickUp ? {
|
|
130
|
+
...a.pickUp,
|
|
131
|
+
submitOrderInstruction: a.pickUp.submitOrderInstruction ? {
|
|
132
|
+
payAtCounter: ((r = (l = a.pickUp.submitOrderInstruction) == null ? void 0 : l.payAtCounter) == null ? void 0 : r.en) ?? null,
|
|
133
|
+
paid: ((n = (t = a.pickUp.submitOrderInstruction) == null ? void 0 : t.paid) == null ? void 0 : n.en) ?? null
|
|
134
|
+
} : L,
|
|
135
|
+
enablePaxDialog: a.pickUp.enablePaxDialog ? a.pickUp.enablePaxDialog : !1
|
|
136
|
+
} : G,
|
|
137
|
+
displayStand: a != null && a.displayStand ? {
|
|
138
|
+
enabled: a.displayStand.enabled,
|
|
139
|
+
standSlotRange: a.displayStand.standSlotRange,
|
|
140
|
+
prefix: a.displayStand.prefix,
|
|
141
|
+
padDigit: a.displayStand.padDigit,
|
|
142
|
+
enablePaxDialog: a.displayStand.enablePaxDialog ?? !1,
|
|
143
|
+
submitOrderInstruction: a.displayStand.submitOrderInstruction ? {
|
|
144
|
+
payAtCounter: ((o = (c = a.displayStand.submitOrderInstruction) == null ? void 0 : c.payAtCounter) == null ? void 0 : o.en) ?? null,
|
|
145
|
+
paid: ((p = (s = a.displayStand.submitOrderInstruction) == null ? void 0 : s.paid) == null ? void 0 : p.en) ?? null
|
|
146
|
+
} : L
|
|
147
|
+
} : j
|
|
148
|
+
};
|
|
149
|
+
}, he = (e) => {
|
|
150
|
+
const a = (t) => {
|
|
151
|
+
var n, c, o, s;
|
|
152
|
+
return {
|
|
153
|
+
requiredSlot: !!t.displayStand,
|
|
154
|
+
displayStand: {
|
|
155
|
+
...t.displayStand,
|
|
156
|
+
submitOrderInstruction: {
|
|
157
|
+
payAtCounter: (n = t.displayStand.submitOrderInstruction) != null && n.payAtCounter ? {
|
|
158
|
+
en: t.displayStand.submitOrderInstruction.payAtCounter
|
|
159
|
+
} : null,
|
|
160
|
+
paid: (c = t.displayStand.submitOrderInstruction) != null && c.paid ? {
|
|
161
|
+
en: t.displayStand.submitOrderInstruction.paid
|
|
162
|
+
} : null
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
pickUp: {
|
|
166
|
+
...t.pickUp,
|
|
167
|
+
submitOrderInstruction: {
|
|
168
|
+
payAtCounter: (o = t.pickUp.submitOrderInstruction) != null && o.payAtCounter ? {
|
|
169
|
+
en: t.pickUp.submitOrderInstruction.payAtCounter
|
|
170
|
+
} : null,
|
|
171
|
+
paid: (s = t.pickUp.submitOrderInstruction) != null && s.paid ? {
|
|
172
|
+
en: t.pickUp.submitOrderInstruction.paid
|
|
173
|
+
} : null
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}, l = (t) => ({
|
|
178
|
+
canTakeaway: e.takeaway.enabled,
|
|
179
|
+
dineIn: t,
|
|
180
|
+
menuItem: e.menuItem,
|
|
181
|
+
coverImageLandscape: e.coverImageLandscape,
|
|
182
|
+
coverImagePortrait: e.coverImagePortrait,
|
|
183
|
+
otaChannel: e.otaChannel || void 0,
|
|
184
|
+
paymentSetting: r(e.paymentSetting),
|
|
185
|
+
takeaway: e.takeaway.submitOrderInstruction ? {
|
|
186
|
+
submitOrderInstruction: {
|
|
187
|
+
payAtCounter: e.takeaway.submitOrderInstruction.payAtCounter ? {
|
|
188
|
+
en: e.takeaway.submitOrderInstruction.payAtCounter
|
|
189
|
+
} : null,
|
|
190
|
+
paid: e.takeaway.submitOrderInstruction.paid ? {
|
|
191
|
+
en: e.takeaway.submitOrderInstruction.paid
|
|
192
|
+
} : null
|
|
193
|
+
}
|
|
194
|
+
} : void 0
|
|
195
|
+
}), r = (t) => ({
|
|
196
|
+
paymentTypes: t.paymentTypes,
|
|
197
|
+
offlinePaymentTypes: t.offlinePaymentTypes,
|
|
198
|
+
ePaymentTypes: t.ePaymentTypes
|
|
199
|
+
});
|
|
200
|
+
return e.dineIn.enabled ? {
|
|
201
|
+
kioskSettings: l(a(e.dineIn)),
|
|
202
|
+
kioskDineIn: e.dineIn.sequenceNumber
|
|
203
|
+
} : {
|
|
204
|
+
kioskSettings: l()
|
|
205
|
+
};
|
|
206
|
+
}, N = {
|
|
207
|
+
convertOrderSettingDto: be,
|
|
208
|
+
toOrderKioskSettingsDto: he
|
|
209
|
+
}, we = se("orderSetting", () => {
|
|
210
|
+
const e = v({});
|
|
211
|
+
async function a() {
|
|
212
|
+
const n = await $.getOrderSetting();
|
|
213
|
+
r(n);
|
|
214
|
+
}
|
|
215
|
+
async function l() {
|
|
216
|
+
if (e.value.orderSetting && e.value.kiosk) {
|
|
217
|
+
const { _id: n, ...c } = e.value.orderSetting, o = N.toOrderKioskSettingsDto(e.value.kiosk), s = {
|
|
218
|
+
...c,
|
|
219
|
+
kioskSettings: o.kioskSettings
|
|
220
|
+
}, p = await $.updateOrderSetting(s);
|
|
221
|
+
r(p);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function r(n) {
|
|
225
|
+
e.value.orderSetting = n, e.value.kiosk = N.convertOrderSettingDto(n).kiosk;
|
|
226
|
+
}
|
|
227
|
+
function t(n) {
|
|
228
|
+
e.value.kiosk = n;
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
state: e.value,
|
|
232
|
+
getSetting: a,
|
|
233
|
+
updateKioskSetting: l,
|
|
234
|
+
setKioskOrderSetting: t
|
|
235
|
+
};
|
|
236
|
+
}), Ce = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ie = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), xe = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), Ae = /[^\p{L}\d]+/giu, M = "$1\0$2", B = "";
|
|
237
|
+
function Q(e) {
|
|
238
|
+
let a = e.trim();
|
|
239
|
+
a = a.replace(Ce, M).replace(Ie, M), a = a.replace(Ae, "\0");
|
|
240
|
+
let l = 0, r = a.length;
|
|
241
|
+
for (; a.charAt(l) === "\0"; )
|
|
242
|
+
l++;
|
|
243
|
+
if (l === r)
|
|
244
|
+
return [];
|
|
245
|
+
for (; a.charAt(r - 1) === "\0"; )
|
|
246
|
+
r--;
|
|
247
|
+
return a.slice(l, r).split(/\0/g);
|
|
248
|
+
}
|
|
249
|
+
function Te(e) {
|
|
250
|
+
const a = Q(e);
|
|
251
|
+
for (let l = 0; l < a.length; l++) {
|
|
252
|
+
const r = a[l], t = xe.exec(r);
|
|
253
|
+
if (t) {
|
|
254
|
+
const n = t.index + (t[1] ?? t[2]).length;
|
|
255
|
+
a.splice(l, 1, r.slice(0, n), r.slice(n));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return a;
|
|
259
|
+
}
|
|
260
|
+
function Ue(e, a) {
|
|
261
|
+
const [l, r, t] = Fe(e, a), n = Le(a == null ? void 0 : a.locale), c = Re(a == null ? void 0 : a.locale);
|
|
262
|
+
return l + r.map(Ee(n, c)).join(" ") + t;
|
|
263
|
+
}
|
|
264
|
+
function Le(e) {
|
|
265
|
+
return (a) => a.toLocaleLowerCase(e);
|
|
266
|
+
}
|
|
267
|
+
function Re(e) {
|
|
268
|
+
return (a) => a.toLocaleUpperCase(e);
|
|
269
|
+
}
|
|
270
|
+
function Ee(e, a) {
|
|
271
|
+
return (l) => `${a(l[0])}${e(l.slice(1))}`;
|
|
272
|
+
}
|
|
273
|
+
function Fe(e, a = {}) {
|
|
274
|
+
const l = a.split ?? (a.separateNumbers ? Te : Q), r = a.prefixCharacters ?? B, t = a.suffixCharacters ?? B;
|
|
275
|
+
let n = 0, c = e.length;
|
|
276
|
+
for (; n < e.length; ) {
|
|
277
|
+
const o = e.charAt(n);
|
|
278
|
+
if (!r.includes(o))
|
|
279
|
+
break;
|
|
280
|
+
n++;
|
|
281
|
+
}
|
|
282
|
+
for (; c > n; ) {
|
|
283
|
+
const o = c - 1, s = e.charAt(o);
|
|
284
|
+
if (!t.includes(s))
|
|
285
|
+
break;
|
|
286
|
+
c = o;
|
|
287
|
+
}
|
|
288
|
+
return [
|
|
289
|
+
e.slice(0, n),
|
|
290
|
+
l(e.slice(n, c)),
|
|
291
|
+
e.slice(c)
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
const Ke = { class: "py-[1.5rem]" }, De = { class: "px-[1.5rem]" }, qe = { class: "pt-[1.5rem]" }, Ve = { class: "flex flex-col gap-10" }, $e = { class: "flex flex-col gap-2" }, Ne = { class: "fm-typo-en-title-sm-600" }, Me = { class: "fm-typo-en-title-sm-400" }, Je = /* @__PURE__ */ H({
|
|
295
|
+
__name: "KioskView",
|
|
296
|
+
setup(e) {
|
|
297
|
+
var F, K;
|
|
298
|
+
const { t: a } = X(), { canManageOrderSetting: l } = pe(), r = k(
|
|
299
|
+
() => import("./KioskSettingView-fF6k9s_q.js")
|
|
300
|
+
), t = v("device"), n = te(), c = we(), o = le(), { currentRestaurant: s, restaurants: p, changeRestaurant: b } = ce(), f = re(), m = v(((F = s.value) == null ? void 0 : F._id) ?? void 0), w = v(null), z = A(() => p.value.map((u) => ({
|
|
301
|
+
label: u.profile.name,
|
|
302
|
+
value: u._id
|
|
303
|
+
}))), _ = v(((K = s.value) == null ? void 0 : K._id) ?? "");
|
|
304
|
+
async function R(u) {
|
|
305
|
+
const y = p.value.find((I) => I._id == u);
|
|
306
|
+
await b(y), await E(), m.value = u, _.value = u;
|
|
307
|
+
}
|
|
308
|
+
async function E() {
|
|
309
|
+
if (l.value)
|
|
310
|
+
try {
|
|
311
|
+
await c.getSetting();
|
|
312
|
+
} catch {
|
|
313
|
+
}
|
|
314
|
+
await C();
|
|
315
|
+
}
|
|
316
|
+
async function C() {
|
|
317
|
+
w.value = null;
|
|
318
|
+
try {
|
|
319
|
+
await n.getDevices();
|
|
320
|
+
} catch (u) {
|
|
321
|
+
w.value = u instanceof V && u.status === 403 ? "forbidden" : "error";
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const J = A(() => {
|
|
325
|
+
const u = [{ label: a("order.deviceBinding"), value: "device" }];
|
|
326
|
+
return l.value && u.push({ label: a("order.settings"), value: "setting" }), u;
|
|
327
|
+
}), O = A(() => n.state.devices);
|
|
328
|
+
async function Y() {
|
|
329
|
+
try {
|
|
330
|
+
await n.requestOtp();
|
|
331
|
+
} catch (u) {
|
|
332
|
+
f.open({
|
|
333
|
+
title: u instanceof V && u.status === 403 ? a("order.bindDevicePermissionDenied") : a("order.bindDeviceFailed"),
|
|
334
|
+
type: "error"
|
|
335
|
+
});
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
o.open({
|
|
339
|
+
title: Ue(a("order.bindDevice")),
|
|
340
|
+
contentComponent: ye,
|
|
341
|
+
contentComponentProps: {
|
|
342
|
+
otp: n.state.otp
|
|
343
|
+
}
|
|
344
|
+
}).onClose(async () => {
|
|
345
|
+
await C();
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
async function Z(u) {
|
|
349
|
+
try {
|
|
350
|
+
c.setKioskOrderSetting(u), await c.updateKioskSetting(), f.open({
|
|
351
|
+
title: a("order.kioskSettingSuccess"),
|
|
352
|
+
type: "success"
|
|
353
|
+
});
|
|
354
|
+
} catch {
|
|
355
|
+
f.open({
|
|
356
|
+
title: a("order.kioskSettingFailed"),
|
|
357
|
+
type: "error"
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return ee(async () => {
|
|
362
|
+
var u;
|
|
363
|
+
(u = s.value) != null && u._id && (_.value = s.value._id, await E());
|
|
364
|
+
}), ae(
|
|
365
|
+
() => p.value.length,
|
|
366
|
+
async (u) => {
|
|
367
|
+
m.value === void 0 && p.value.length > 0 && await R(p.value[0]._id);
|
|
368
|
+
},
|
|
369
|
+
{ immediate: !0 }
|
|
370
|
+
), (u, y) => {
|
|
371
|
+
const I = T("FmPageHead"), g = T("FmTabs"), S = T("FmSelect");
|
|
372
|
+
return P(), W("div", Ke, [
|
|
373
|
+
U(I, {
|
|
374
|
+
title: d(a)("order.kiosk")
|
|
375
|
+
}, null, 8, ["title"]),
|
|
376
|
+
i("div", De, [
|
|
377
|
+
U(g, {
|
|
378
|
+
"model-value": t.value,
|
|
379
|
+
"onUpdate:modelValue": y[0] || (y[0] = (x) => t.value = x),
|
|
380
|
+
items: J.value
|
|
381
|
+
}, null, 8, ["model-value", "items"]),
|
|
382
|
+
i("div", qe, [
|
|
383
|
+
i("div", Ve, [
|
|
384
|
+
i("div", $e, [
|
|
385
|
+
i("span", Ne, h(d(a)("order.activateLocation")), 1),
|
|
386
|
+
i("span", Me, h(d(a)("order.selectRestaurant")) + ": ", 1),
|
|
387
|
+
U(S, {
|
|
388
|
+
class: "w-1/2",
|
|
389
|
+
modelValue: m.value,
|
|
390
|
+
"onUpdate:modelValue": [
|
|
391
|
+
y[1] || (y[1] = (x) => m.value = x),
|
|
392
|
+
R
|
|
393
|
+
],
|
|
394
|
+
items: z.value,
|
|
395
|
+
placeholder: d(a)("order.selectItem")
|
|
396
|
+
}, null, 8, ["modelValue", "items", "placeholder"])
|
|
397
|
+
]),
|
|
398
|
+
t.value == "device" ? (P(), D(ne, {
|
|
399
|
+
key: 0,
|
|
400
|
+
devices: O.value,
|
|
401
|
+
"load-error": w.value,
|
|
402
|
+
onRequestOtp: Y,
|
|
403
|
+
onRetry: C
|
|
404
|
+
}, null, 8, ["devices", "load-error"])) : q("", !0),
|
|
405
|
+
t.value == "setting" && d(l) ? (P(), D(d(r), {
|
|
406
|
+
key: `KioskSettingView-${_.value}`,
|
|
407
|
+
"restaurant-id": _.value,
|
|
408
|
+
onUpdateKioskOrderSetting: Z,
|
|
409
|
+
form: d(c).state.kiosk ?? d(ve)
|
|
410
|
+
}, null, 8, ["restaurant-id", "form"])) : q("", !0)
|
|
411
|
+
])
|
|
412
|
+
])
|
|
413
|
+
])
|
|
414
|
+
]);
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
export {
|
|
419
|
+
Je as default
|
|
420
|
+
};
|