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