@feedmepos/mf-order-setting 0.0.52 → 0.0.54

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.
Files changed (74) hide show
  1. package/.env.dev +1 -1
  2. package/.env.prod +1 -1
  3. package/dist/{KioskDevicesView-D_YT-CL0.js → KioskDevicesView-CMKNjgWx.js} +1 -1
  4. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-Bxv6oiFw.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-B1sNvlUC.js} +2 -2
  5. package/dist/KioskSettingView-BE_pMA-i.js +720 -0
  6. package/dist/KioskView-U-Wg8oMC.js +480 -0
  7. package/dist/OrderSettingsView-BWzaITT6.js +51916 -0
  8. package/dist/app-CFfgPAd8.js +10445 -0
  9. package/dist/app.js +3 -3
  10. package/dist/dayjs.min-CuRr-wlf.js +283 -0
  11. package/dist/frontend/mf-order/src/app.d.ts +60 -8
  12. package/dist/frontend/mf-order/src/main.d.ts +60 -8
  13. package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +4 -2
  14. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +15 -6
  15. package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +3 -3
  16. package/dist/frontend/mf-order/src/utils/firebase-app.d.ts +4 -0
  17. package/dist/frontend/mf-order/src/utils/firebase-storage.d.ts +2 -0
  18. package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +2 -2
  19. package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +2 -2
  20. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/{index-Bjwv8B4h.js → index-Bj0bCGTm.js} +25 -26
  22. package/dist/menu.dto-DAh1J2ES.js +128627 -0
  23. package/dist/package/entity/booking/booking.do.d.ts +30 -30
  24. package/dist/package/entity/delivery/delivery.dto.d.ts +6 -6
  25. package/dist/package/entity/food-court/order.do.d.ts +24 -4
  26. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +12553 -162
  27. package/dist/package/entity/incoming-order/incoming-order.do.d.ts +43 -22268
  28. package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +14805 -66
  29. package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +1 -1
  30. package/dist/package/entity/index.d.ts +3 -0
  31. package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1 -19864
  32. package/dist/package/entity/order/order-item/order-item.dto.d.ts +1 -3721
  33. package/dist/package/entity/order/order.dto.d.ts +342 -7293
  34. package/dist/package/entity/order/payment/payment.dto.d.ts +3 -344
  35. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +6 -6
  36. package/dist/package/entity/order-platform/grabfood/grabfood-edit-order.do.d.ts +144 -0
  37. package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +282 -47
  38. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +6 -6
  39. package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +69 -14
  40. package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +2 -0
  41. package/dist/package/entity/order-platform/order-platform.dto.d.ts +7306 -3
  42. package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +6 -6
  43. package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +12 -0
  44. package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +12 -0
  45. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +6 -3
  46. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +6 -3
  47. package/dist/package/entity/order-setting/order-setting.do.d.ts +13 -8
  48. package/dist/package/entity/order-setting/order-setting.dto.d.ts +30 -10
  49. package/dist/package/entity/queue/queue.do.d.ts +1 -11
  50. package/dist/package/entity/restaurant/restaurant.dto.d.ts +14 -9
  51. package/dist/package/entity/websocket/websocket.dto.d.ts +24 -12
  52. package/package.json +4 -2
  53. package/src/App.vue +3 -0
  54. package/src/locales/en-US.json +15 -2
  55. package/src/locales/ja-JP.json +31 -18
  56. package/src/locales/th-TH.json +15 -2
  57. package/src/locales/zh-CN.json +15 -2
  58. package/src/main.ts +10 -20
  59. package/src/modules/order-setting/kiosk/interface.ts +4 -2
  60. package/src/stores/order-setting/mapper.ts +63 -60
  61. package/src/utils/firebase-app.ts +34 -0
  62. package/src/utils/firebase-storage.ts +112 -0
  63. package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +1 -19
  64. package/src/views/kiosk/settings/KioskSettingView.vue +136 -43
  65. package/src/views/order-settings/OrderSettingsView.vue +1 -1
  66. package/src/views/order-settings/dine-in/DineInSetting.vue +23 -1
  67. package/src/views/order-settings/drive-thru/DriveThruSetting.vue +19 -18
  68. package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +5 -1
  69. package/dist/KioskSettingView-DS5vEQ07.js +0 -573
  70. package/dist/KioskView-B8NHcyGz.js +0 -477
  71. package/dist/OrderSettingsView-BhEN-2ZZ.js +0 -51602
  72. package/dist/app-BWFBpJUR.js +0 -2986
  73. package/dist/dayjs.min-CD9R3x-Y.js +0 -2092
  74. package/dist/menu.dto-Wzm4Tz0i.js +0 -101874
@@ -0,0 +1,480 @@
1
+ import { defineComponent as $, computed as h, createElementBlock as f, openBlock as p, normalizeClass as k, createCommentVNode as b, createElementVNode as l, toDisplayString as u, unref as c, Fragment as ee, renderList as te, ref as C, defineAsyncComponent as ae, onMounted as ne, watch as oe, resolveComponent as g, createVNode as I, withCtx as se, withDirectives as le, vShow as re, createBlock as V } from "vue";
2
+ import { u as ce, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-B1sNvlUC.js";
3
+ import { useI18n as F, useCoreStore as ue } from "@feedmepos/mf-common";
4
+ import { F as E, a as pe, b as ie } from "./menu.dto-DAh1J2ES.js";
5
+ import { useDialog as me, useSnackbar as ye, useBreakpoints as fe } from "@feedmepos/ui-library";
6
+ import { defineStore as ve } from "pinia";
7
+ import { O as L, c as S } from "./index-Bj0bCGTm.js";
8
+ const _e = {
9
+ key: 0,
10
+ class: "fm-typo-en-title-sm-600"
11
+ }, be = {
12
+ key: 1,
13
+ class: "my-[0.25rem]"
14
+ }, he = { class: "flex flex-col gap-4" }, xe = { class: "flex flex-col gap-2" }, Pe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, we = {
15
+ key: 0,
16
+ class: "flex flex-col gap-1"
17
+ }, Ie = { class: "px-1.5 py-0.5 fm-corner-radius-sm bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary fm-typo-en-body-xs-600 uppercase" }, Te = {
18
+ key: 0,
19
+ class: "fm-typo-en-body-sm-600"
20
+ }, ge = ["title"], Ce = {
21
+ key: 1,
22
+ class: "fm-typo-en-body-lg-600"
23
+ }, Ae = {
24
+ key: 0,
25
+ class: "flex flex-col gap-1"
26
+ }, Ke = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ue = { class: "fm-typo-en-body-lg-600" }, $e = {
27
+ key: 1,
28
+ class: "flex flex-col gap-1"
29
+ }, Fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Oe = { class: "fm-typo-en-body-lg-600" }, qe = {
30
+ key: 2,
31
+ class: "flex flex-col gap-1"
32
+ }, Re = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, De = { class: "fm-typo-en-body-lg-600" }, Be = {
33
+ key: 3,
34
+ class: "flex flex-col gap-1"
35
+ }, Ve = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ee = { class: "fm-typo-en-body-lg-600" }, Le = { key: 0 }, M = /* @__PURE__ */ $({
36
+ __name: "KioskSummary",
37
+ props: {
38
+ restaurantId: {},
39
+ devices: {},
40
+ kioskOrderSetting: {},
41
+ dialogType: { type: Boolean }
42
+ },
43
+ setup(e) {
44
+ const { t } = F(), s = e, r = h(() => {
45
+ var a;
46
+ return (a = s.kioskOrderSetting) != null && a.dineIn.enabled ? t("order.activated") : t("order.deactivated");
47
+ }), n = h(() => {
48
+ var a;
49
+ return (a = s.kioskOrderSetting) != null && a.takeaway.enabled ? t("order.activated") : t("order.deactivated");
50
+ }), o = h(() => {
51
+ var a, m;
52
+ return (a = s.kioskOrderSetting) != null && a.dineIn.displayStand ? t("order.tableService") : (m = s.kioskOrderSetting) != null && m.dineIn && !s.kioskOrderSetting.dineIn.displayStand ? t("order.pickAtCounter") : t("order.unknown");
53
+ }), i = h(() => {
54
+ var a;
55
+ return ((a = s.kioskOrderSetting) == null ? void 0 : a.paymentSetting.paymentTypes.includes(E.enum.cash)) ?? !1;
56
+ }), d = h(() => {
57
+ var m, v;
58
+ const a = [];
59
+ if ((m = s.kioskOrderSetting) == null || m.paymentSetting.paymentTypes.forEach((_) => {
60
+ _ === E.enum.ePayment && a.push(t("order.ePayment"));
61
+ }), a.length > 0 && Object.keys(s.kioskOrderSetting.paymentSetting.ePaymentTypes).length !== 0) {
62
+ const _ = (v = s.kioskOrderSetting) == null ? void 0 : v.paymentSetting.ePaymentTypes;
63
+ (_.card.terminal || _.card.nfc) && a.push(t("order.bankCard")), (_.eWallet.scanPay || _.eWallet.qrPay) && a.push(t("order.eWallet"));
64
+ }
65
+ return a.join(", ");
66
+ });
67
+ return (a, m) => (p(), f("div", {
68
+ class: k(a.dialogType ? "" : ["p-[1.5rem] border fm-corner-radius-lg flex flex-col gap-5 fixed ml-40 w-[320px]"])
69
+ }, [
70
+ a.dialogType ? b("", !0) : (p(), f("span", _e, u(c(t)("order.kioskSummary")), 1)),
71
+ a.dialogType ? b("", !0) : (p(), f("hr", be)),
72
+ l("div", he, [
73
+ l("div", xe, [
74
+ l("span", Pe, u(c(t)("order.kioskDisplay")), 1),
75
+ a.devices.length > 0 ? (p(), f("div", we, [
76
+ (p(!0), f(ee, null, te(a.devices, (v) => (p(), f("div", {
77
+ key: v.machineId,
78
+ class: "fm-typo-en-body-sm-400 flex items-center gap-2"
79
+ }, [
80
+ l("span", Ie, u(v.deviceAppType === "TABLET_APP" ? "T" : "K"), 1),
81
+ v.slotInfo ? (p(), f("span", Te, u(v.slotInfo), 1)) : b("", !0),
82
+ l("span", {
83
+ class: "text-fm-color-typo-secondary truncate flex-1",
84
+ title: v.name
85
+ }, u(v.name), 9, ge)
86
+ ]))), 128))
87
+ ])) : (p(), f("div", Ce, "-"))
88
+ ]),
89
+ r.value === c(t)("order.activated") ? (p(), f("div", Ae, [
90
+ l("span", Ke, u(c(t)("order.dineIn")), 1),
91
+ l("div", Ue, u(r.value), 1)
92
+ ])) : b("", !0),
93
+ r.value === c(t)("order.activated") && o.value !== c(t)("order.unknown") ? (p(), f("div", $e, [
94
+ l("span", Fe, u(c(t)("order.dineInType")), 1),
95
+ l("div", Oe, u(o.value), 1)
96
+ ])) : b("", !0),
97
+ n.value === c(t)("order.activated") ? (p(), f("div", qe, [
98
+ l("span", Re, u(c(t)("order.takeaway")), 1),
99
+ l("div", De, u(n.value), 1)
100
+ ])) : b("", !0),
101
+ d.value || i.value ? (p(), f("div", Be, [
102
+ l("span", Ve, u(c(t)("order.acceptedPayment")), 1),
103
+ l("div", Ee, [
104
+ i.value ? (p(), f("div", Le, u(c(t)("order.offlinePayment")), 1)) : b("", !0),
105
+ l("div", null, u(d.value), 1)
106
+ ])
107
+ ])) : b("", !0)
108
+ ])
109
+ ], 2));
110
+ }
111
+ }), Se = { class: "flex flex-col gap-5 pb-6" }, Me = { class: "fm-typo-en-body-md-400 block" }, Ne = { class: "fm-typo-en-title-md-600" }, We = /* @__PURE__ */ $({
112
+ __name: "KioskOtpDialog",
113
+ props: {
114
+ otp: {}
115
+ },
116
+ setup(e) {
117
+ const { t } = F();
118
+ return (s, r) => (p(), f("div", Se, [
119
+ l("span", Me, u(c(t)("order.bindDeviceMessage")), 1),
120
+ l("div", Ne, u(s.otp), 1)
121
+ ]));
122
+ }
123
+ }), W = {
124
+ enabled: !1,
125
+ prefix: null,
126
+ padDigit: 0,
127
+ standSlotRange: {
128
+ min: 1,
129
+ max: 10
130
+ },
131
+ enablePaxDialog: !1,
132
+ submitOrderInstruction: {
133
+ payAtCounter: null,
134
+ paid: null
135
+ }
136
+ }, je = {
137
+ enabled: !1,
138
+ submitOrderInstruction: {
139
+ payAtCounter: null,
140
+ paid: null
141
+ }
142
+ }, j = {
143
+ enabled: !1,
144
+ submitOrderInstruction: {
145
+ payAtCounter: null,
146
+ paid: null
147
+ },
148
+ enablePaxDialog: !1
149
+ }, He = {
150
+ dineIn: {
151
+ enabled: !1,
152
+ pickUp: j,
153
+ sequenceNumber: pe.parse({}),
154
+ displayStand: W
155
+ },
156
+ takeaway: je,
157
+ paymentSetting: {
158
+ paymentTypes: [],
159
+ offlinePaymentTypes: [],
160
+ ePaymentTypes: {
161
+ terminal: !1,
162
+ card: {
163
+ terminal: !1,
164
+ nfc: !1
165
+ },
166
+ eWallet: {
167
+ terminalQrPay: !1,
168
+ terminalScanPay: !1,
169
+ qrPay: !1,
170
+ scanPay: !1
171
+ }
172
+ }
173
+ },
174
+ menuItem: {
175
+ showAllOnly: !1
176
+ },
177
+ coverImageLandscape: null,
178
+ coverImagePortrait: null
179
+ }, U = {
180
+ payAtCounter: null,
181
+ paid: null
182
+ }, Ye = (e) => {
183
+ var t;
184
+ return {
185
+ kiosk: ze(e.kioskSettings, (t = e.sequenceSettings) == null ? void 0 : t.kioskDineIn)
186
+ };
187
+ }, ze = (e, t) => {
188
+ var s, r, n, o, i, d, a, m, v, _, P;
189
+ return {
190
+ dineIn: Qe(
191
+ t ?? {
192
+ current: 0,
193
+ prefix: "#K"
194
+ },
195
+ (e == null ? void 0 : e.dineIn) ?? void 0
196
+ ),
197
+ takeaway: {
198
+ enabled: (e == null ? void 0 : e.canTakeaway) ?? !1,
199
+ submitOrderInstruction: (s = e == null ? void 0 : e.takeaway) != null && s.submitOrderInstruction ? {
200
+ payAtCounter: ((o = (n = (r = e == null ? void 0 : e.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : n.payAtCounter) == null ? void 0 : o.en) ?? null,
201
+ paid: ((a = (d = (i = e == null ? void 0 : e.takeaway) == null ? void 0 : i.submitOrderInstruction) == null ? void 0 : d.paid) == null ? void 0 : a.en) ?? null
202
+ } : U
203
+ },
204
+ paymentSetting: {
205
+ paymentTypes: ((m = e == null ? void 0 : e.paymentSetting) == null ? void 0 : m.paymentTypes) ?? [],
206
+ offlinePaymentTypes: ((v = e == null ? void 0 : e.paymentSetting) == null ? void 0 : v.offlinePaymentTypes) ?? [],
207
+ ePaymentTypes: ((_ = e == null ? void 0 : e.paymentSetting) == null ? void 0 : _.ePaymentTypes) ?? ie.parse({
208
+ card: {
209
+ terminal: !1,
210
+ nfc: !1
211
+ },
212
+ eWallet: {
213
+ qrPay: !1,
214
+ scanPay: !1
215
+ }
216
+ })
217
+ },
218
+ menuItem: {
219
+ showAllOnly: ((P = e == null ? void 0 : e.menuItem) == null ? void 0 : P.showAllOnly) ?? !1
220
+ },
221
+ coverImageLandscape: (e == null ? void 0 : e.coverImageLandscape) ?? null,
222
+ coverImagePortrait: (e == null ? void 0 : e.coverImagePortrait) ?? null
223
+ };
224
+ }, Qe = (e, t) => {
225
+ var s, r, n, o, i, d, a, m;
226
+ return {
227
+ enabled: !!t,
228
+ sequenceNumber: e,
229
+ pickUp: t != null && t.pickUp ? {
230
+ ...t.pickUp,
231
+ submitOrderInstruction: t.pickUp.submitOrderInstruction ? {
232
+ payAtCounter: ((r = (s = t.pickUp.submitOrderInstruction) == null ? void 0 : s.payAtCounter) == null ? void 0 : r.en) ?? null,
233
+ paid: ((o = (n = t.pickUp.submitOrderInstruction) == null ? void 0 : n.paid) == null ? void 0 : o.en) ?? null
234
+ } : U,
235
+ enablePaxDialog: t.pickUp.enablePaxDialog ? t.pickUp.enablePaxDialog : !1
236
+ } : j,
237
+ displayStand: t != null && t.displayStand ? {
238
+ enabled: t.displayStand.enabled,
239
+ standSlotRange: t.displayStand.standSlotRange,
240
+ prefix: t.displayStand.prefix,
241
+ padDigit: t.displayStand.padDigit,
242
+ enablePaxDialog: t.displayStand.enablePaxDialog ?? !1,
243
+ submitOrderInstruction: t.displayStand.submitOrderInstruction ? {
244
+ payAtCounter: ((d = (i = t.displayStand.submitOrderInstruction) == null ? void 0 : i.payAtCounter) == null ? void 0 : d.en) ?? null,
245
+ paid: ((m = (a = t.displayStand.submitOrderInstruction) == null ? void 0 : a.paid) == null ? void 0 : m.en) ?? null
246
+ } : U
247
+ } : W
248
+ };
249
+ }, Ge = (e) => {
250
+ const t = (n) => {
251
+ var o, i, d, a;
252
+ return {
253
+ requiredSlot: !!n.displayStand,
254
+ displayStand: {
255
+ ...n.displayStand,
256
+ submitOrderInstruction: {
257
+ payAtCounter: (o = n.displayStand.submitOrderInstruction) != null && o.payAtCounter ? {
258
+ en: n.displayStand.submitOrderInstruction.payAtCounter
259
+ } : null,
260
+ paid: (i = n.displayStand.submitOrderInstruction) != null && i.paid ? {
261
+ en: n.displayStand.submitOrderInstruction.paid
262
+ } : null
263
+ }
264
+ },
265
+ pickUp: {
266
+ ...n.pickUp,
267
+ submitOrderInstruction: {
268
+ payAtCounter: (d = n.pickUp.submitOrderInstruction) != null && d.payAtCounter ? {
269
+ en: n.pickUp.submitOrderInstruction.payAtCounter
270
+ } : null,
271
+ paid: (a = n.pickUp.submitOrderInstruction) != null && a.paid ? {
272
+ en: n.pickUp.submitOrderInstruction.paid
273
+ } : null
274
+ }
275
+ }
276
+ };
277
+ }, s = (n) => ({
278
+ canTakeaway: e.takeaway.enabled,
279
+ dineIn: n,
280
+ menuItem: e.menuItem,
281
+ coverImageLandscape: e.coverImageLandscape,
282
+ coverImagePortrait: e.coverImagePortrait,
283
+ paymentSetting: r(e.paymentSetting),
284
+ takeaway: e.takeaway.submitOrderInstruction ? {
285
+ submitOrderInstruction: {
286
+ payAtCounter: e.takeaway.submitOrderInstruction.payAtCounter ? {
287
+ en: e.takeaway.submitOrderInstruction.payAtCounter
288
+ } : null,
289
+ paid: e.takeaway.submitOrderInstruction.paid ? {
290
+ en: e.takeaway.submitOrderInstruction.paid
291
+ } : null
292
+ }
293
+ } : void 0
294
+ }), r = (n) => ({
295
+ paymentTypes: n.paymentTypes,
296
+ offlinePaymentTypes: n.offlinePaymentTypes,
297
+ ePaymentTypes: n.ePaymentTypes
298
+ });
299
+ return e.dineIn.enabled ? {
300
+ kioskSettings: s(t(e.dineIn)),
301
+ kioskDineIn: e.dineIn.sequenceNumber
302
+ } : {
303
+ kioskSettings: s()
304
+ };
305
+ }, N = {
306
+ convertOrderSettingDto: Ye,
307
+ toOrderKioskSettingsDto: Ge
308
+ }, Je = ve("orderSetting", () => {
309
+ const e = C({});
310
+ async function t() {
311
+ const o = await L.getOrderSetting();
312
+ r(o);
313
+ }
314
+ async function s() {
315
+ if (e.value.orderSetting && e.value.kiosk) {
316
+ const { _id: o, ...i } = e.value.orderSetting, d = N.toOrderKioskSettingsDto(e.value.kiosk), a = {
317
+ ...i,
318
+ kioskSettings: d.kioskSettings
319
+ }, m = await L.updateOrderSetting(a);
320
+ r(m);
321
+ }
322
+ }
323
+ function r(o) {
324
+ e.value.orderSetting = o, e.value.kiosk = N.convertOrderSettingDto(o).kiosk;
325
+ }
326
+ function n(o) {
327
+ e.value.kiosk = o;
328
+ }
329
+ return {
330
+ state: e.value,
331
+ getSetting: t,
332
+ updateKioskSetting: s,
333
+ setKioskOrderSetting: n
334
+ };
335
+ }), Xe = { class: "py-[1.5rem]" }, Ze = { class: "flex px-[1.5rem]" }, ke = { class: "flex-[2_2_0%]" }, et = { class: "pt-[1.5rem]" }, tt = { class: "flex flex-col gap-10" }, at = { class: "flex flex-col gap-2" }, nt = { class: "fm-typo-en-title-sm-600" }, ot = { class: "fm-typo-en-title-sm-400" }, st = {
336
+ key: 0,
337
+ class: "flex-[1_1_0%]"
338
+ }, mt = /* @__PURE__ */ $({
339
+ __name: "KioskView",
340
+ setup(e) {
341
+ var D, B;
342
+ const { t } = F(), s = ae(
343
+ () => import("./KioskSettingView-BE_pMA-i.js")
344
+ ), r = C("device"), n = ce(), o = Je(), i = me(), { currentRestaurant: d, restaurants: a, changeRestaurant: m } = ue(), v = ye(), _ = fe(), P = h(() => _.breakpoints.value.xs), T = C(((D = d.value) == null ? void 0 : D._id) ?? void 0), H = h(() => a.value.map((y) => ({
345
+ label: y.profile.name,
346
+ value: y._id
347
+ }))), w = C(((B = d.value) == null ? void 0 : B._id) ?? "");
348
+ function Y() {
349
+ var y;
350
+ i.open({
351
+ title: S(t("order.kioskSummary")),
352
+ contentComponent: M,
353
+ contentComponentProps: {
354
+ restaurantId: (y = d.value) == null ? void 0 : y._id,
355
+ devices: n.state.devices,
356
+ kioskOrderSetting: o.state.kiosk,
357
+ dialogType: !0
358
+ }
359
+ });
360
+ }
361
+ async function O(y) {
362
+ const x = a.value.find((A) => A._id == y);
363
+ await m(x), await q(), T.value = y, w.value = y;
364
+ }
365
+ async function q() {
366
+ await o.getSetting(), await n.getDevices();
367
+ }
368
+ const z = h(() => [
369
+ {
370
+ label: t("order.deviceBinding"),
371
+ value: "device"
372
+ },
373
+ {
374
+ label: t("order.settings"),
375
+ value: "setting"
376
+ }
377
+ ]), R = h(() => n.state.devices);
378
+ async function Q() {
379
+ await n.requestOtp(), i.open({
380
+ title: S(t("order.bindDevice")),
381
+ contentComponent: We,
382
+ contentComponentProps: {
383
+ otp: n.state.otp
384
+ }
385
+ }).onClose(async () => {
386
+ await n.getDevices();
387
+ });
388
+ }
389
+ async function G(y) {
390
+ try {
391
+ o.setKioskOrderSetting(y), await o.updateKioskSetting(), v.open({
392
+ title: t("order.kioskSettingSuccess"),
393
+ type: "success"
394
+ });
395
+ } catch {
396
+ v.open({
397
+ title: t("order.kioskSettingFailed"),
398
+ type: "error"
399
+ });
400
+ }
401
+ }
402
+ return ne(async () => {
403
+ var y;
404
+ (y = d.value) != null && y._id && (w.value = d.value._id, await q());
405
+ }), oe(
406
+ () => a.value.length,
407
+ async (y) => {
408
+ T.value === void 0 && a.value.length > 0 && await O(a.value[0]._id);
409
+ },
410
+ { immediate: !0 }
411
+ ), (y, x) => {
412
+ const A = g("FmButton"), J = g("FmPageHead"), X = g("FmTabs"), Z = g("FmSelect");
413
+ return p(), f("div", Xe, [
414
+ I(J, {
415
+ title: c(t)("order.kiosk")
416
+ }, {
417
+ append: se(() => [
418
+ le(I(A, {
419
+ icon: "info",
420
+ variant: "tertiary",
421
+ onClick: Y
422
+ }, null, 512), [
423
+ [re, P.value]
424
+ ])
425
+ ]),
426
+ _: 1
427
+ }, 8, ["title"]),
428
+ l("div", Ze, [
429
+ l("div", ke, [
430
+ I(X, {
431
+ "model-value": r.value,
432
+ "onUpdate:modelValue": x[0] || (x[0] = (K) => r.value = K),
433
+ items: z.value
434
+ }, null, 8, ["model-value", "items"]),
435
+ l("div", et, [
436
+ l("div", tt, [
437
+ l("div", at, [
438
+ l("span", nt, u(c(t)("order.activateLocation")), 1),
439
+ l("span", ot, u(c(t)("order.selectRestaurant")) + ": ", 1),
440
+ I(Z, {
441
+ class: "w-1/2",
442
+ modelValue: T.value,
443
+ "onUpdate:modelValue": [
444
+ x[1] || (x[1] = (K) => T.value = K),
445
+ O
446
+ ],
447
+ items: H.value,
448
+ placeholder: c(t)("order.selectItem")
449
+ }, null, 8, ["modelValue", "items", "placeholder"])
450
+ ]),
451
+ r.value == "device" ? (p(), V(de, {
452
+ key: 0,
453
+ devices: R.value,
454
+ onRequestOtp: Q
455
+ }, null, 8, ["devices"])) : b("", !0),
456
+ r.value == "setting" ? (p(), V(c(s), {
457
+ key: `KioskSettingView-${w.value}`,
458
+ "restaurant-id": w.value,
459
+ onUpdateKioskOrderSetting: G,
460
+ form: c(o).state.kiosk ?? c(He)
461
+ }, null, 8, ["restaurant-id", "form"])) : b("", !0)
462
+ ])
463
+ ])
464
+ ]),
465
+ P.value ? b("", !0) : (p(), f("div", st, [
466
+ I(M, {
467
+ "restaurant-id": w.value,
468
+ devices: R.value,
469
+ "kiosk-order-setting": c(o).state.kiosk,
470
+ dialogType: !1
471
+ }, null, 8, ["restaurant-id", "devices", "kiosk-order-setting"])
472
+ ]))
473
+ ])
474
+ ]);
475
+ };
476
+ }
477
+ });
478
+ export {
479
+ mt as default
480
+ };