@feedmepos/mf-order-setting 0.0.49 → 0.0.50

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 (46) hide show
  1. package/dist/{KioskDevicesView-Ch_mWJz9.js → KioskDevicesView-u14hzPbE.js} +1 -1
  2. package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-DBgRDIoS.js +501 -0
  3. package/dist/{KioskSettingView-CaBhf48e.js → KioskSettingView-DmvtZcV1.js} +1 -1
  4. package/dist/KioskView-M8V91gD5.js +474 -0
  5. package/dist/{OrderSettingsView-CRgoLOD2.js → OrderSettingsView-Bl3LshG3.js} +4 -4
  6. package/dist/{app-CDTAjXj9.js → app-CLewMjcd.js} +67 -19
  7. package/dist/app.js +1 -1
  8. package/dist/{dayjs.min-dI_j30pv.js → dayjs.min-DCTYRWyD.js} +1 -1
  9. package/dist/frontend/mf-order/src/app.d.ts +48 -0
  10. package/dist/frontend/mf-order/src/main.d.ts +48 -0
  11. package/dist/frontend/mf-order/src/modules/kiosk/interface.d.ts +1 -0
  12. package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +3 -0
  13. package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +6 -3
  14. package/dist/frontend/mf-order/src/views/order-settings/servicecharge/ServiceChargeRule.vue.d.ts +2 -2
  15. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  16. package/dist/{index-B8U5Sawr.js → index-B7LtJeBJ.js} +2 -2
  17. package/dist/{menu.dto-qVeqpSdz.js → menu.dto-Co7iXHNr.js} +6345 -6286
  18. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +104 -12
  19. package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +106 -6
  20. package/dist/package/entity/kiosk/kiosk.do.d.ts +32 -0
  21. package/dist/package/entity/kiosk/kiosk.dto.d.ts +44 -0
  22. package/dist/package/entity/order/order.enum.d.ts +2 -0
  23. package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +62 -0
  24. package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +178 -0
  25. package/dist/package/entity/order-platform/grabfood/grabfood-menu.do.d.ts +15 -0
  26. package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +1834 -15
  27. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +13 -13
  28. package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +3 -0
  29. package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +528 -805
  30. package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +8 -5
  31. package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +1 -1
  32. package/dist/package/entity/order-platform/order-platform.dto.d.ts +0 -20
  33. package/dist/package/entity/queue/queue.dto.d.ts +20 -0
  34. package/package.json +1 -1
  35. package/src/locales/en-US.json +12 -0
  36. package/src/locales/ja-JP.json +12 -0
  37. package/src/locales/th-TH.json +12 -0
  38. package/src/locales/zh-CN.json +12 -0
  39. package/src/modules/kiosk/interface.ts +1 -0
  40. package/src/stores/kiosk/mapper.ts +1 -0
  41. package/src/views/kiosk/KioskSummary.vue +37 -31
  42. package/src/views/kiosk/KioskView.vue +4 -1
  43. package/src/views/kiosk/devices/KioskDeviceCard.vue +205 -89
  44. package/src/views/kiosk/devices/KioskDevicesView.vue +133 -17
  45. package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-DV2HYd8u.js +0 -306
  46. package/dist/KioskView-BGm-emCw.js +0 -452
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-DV2HYd8u.js";
1
+ import { _ as f } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-DBgRDIoS.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1,501 @@
1
+ import { ref as C, defineComponent as G, resolveComponent as F, createElementBlock as b, openBlock as u, createElementVNode as e, createVNode as v, toDisplayString as a, unref as _, computed as $, createCommentVNode as D, withCtx as q, Fragment as W, renderList as H, createBlock as z, createTextVNode as U } from "vue";
2
+ import { useI18n as Q } from "@feedmepos/mf-common";
3
+ import { defineStore as se } from "pinia";
4
+ import { r as Y, g as Z, d as R } from "./dayjs.min-DCTYRWyD.js";
5
+ import { g as ie, c as ae } from "./menu.dto-Co7iXHNr.js";
6
+ import { useDialog as le, useSnackbar as re } from "@feedmepos/ui-library";
7
+ async function ce() {
8
+ const o = await Y().get("/kiosk/otp");
9
+ return Z(o);
10
+ }
11
+ async function de() {
12
+ const o = await Y().get("/kiosk/devices");
13
+ return Z(o);
14
+ }
15
+ async function pe(o) {
16
+ await Y().delete(`/kiosk/unbind/${o}`);
17
+ }
18
+ async function ue(o, n) {
19
+ await Y().put(`/kiosk/updateDevicePin/${n}`, { pinInfo: o });
20
+ }
21
+ const j = {
22
+ requestOtp: ce,
23
+ getDevices: de,
24
+ unbind: pe,
25
+ updateDevicePin: ue
26
+ }, me = (o) => ({
27
+ name: o.name ?? "N/A",
28
+ machineId: o.machineId,
29
+ config: {
30
+ scannerInfo: o.scannerInfo ?? void 0,
31
+ printerInfo: o.printerInfo ?? void 0,
32
+ terminalInfo: o.terminalInfo ?? void 0
33
+ },
34
+ activatedAt: ve(o.token),
35
+ deviceAppType: o.deviceAppType ?? void 0,
36
+ slotInfo: o.slotInfo ?? void 0,
37
+ pinInfo: o.pinInfo ?? void 0,
38
+ deviceAppVersion: o.deviceAppVersion ?? void 0,
39
+ deviceAppOTAVersion: o.deviceAppOTAVersion ?? void 0,
40
+ lastStartup: o.lastStartup ? new Date(o.lastStartup) : void 0
41
+ });
42
+ function ve(o) {
43
+ const n = o.substring(0, 8), f = parseInt(n, 16);
44
+ return new Date(f * 1e3);
45
+ }
46
+ const fe = {
47
+ toMfKioskDevice: me
48
+ }, ye = se("kiosk", () => {
49
+ const o = C({
50
+ otp: "",
51
+ devices: []
52
+ });
53
+ async function n() {
54
+ const l = await j.requestOtp();
55
+ o.value.otp = l.otp;
56
+ }
57
+ async function f() {
58
+ const l = await j.getDevices();
59
+ o.value.devices = l.map((i) => fe.toMfKioskDevice(i));
60
+ }
61
+ async function m(l) {
62
+ await j.unbind(l), await f();
63
+ }
64
+ async function c(l, i) {
65
+ await j.updateDevicePin(l, i);
66
+ }
67
+ return {
68
+ state: o.value,
69
+ requestOtp: n,
70
+ getDevices: f,
71
+ unbind: m,
72
+ updateDevicePin: c
73
+ };
74
+ });
75
+ var ee = { exports: {} };
76
+ (function(o, n) {
77
+ (function(f, m) {
78
+ o.exports = m();
79
+ })(ae, function() {
80
+ return function(f, m, c) {
81
+ f = f || {};
82
+ var l = m.prototype, i = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
83
+ function p(s, d, k, I) {
84
+ return l.fromToBase(s, d, k, I);
85
+ }
86
+ c.en.relativeTime = i, l.fromToBase = function(s, d, k, I, y) {
87
+ for (var M, w, V, N = k.$locale().relativeTime || i, x = f.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], B = x.length, P = 0; P < B; P += 1) {
88
+ var T = x[P];
89
+ T.d && (M = I ? c(s).diff(k, T.d, !0) : k.diff(s, T.d, !0));
90
+ var A = (f.rounding || Math.round)(Math.abs(M));
91
+ if (V = M > 0, A <= T.r || !T.r) {
92
+ A <= 1 && P > 0 && (T = x[P - 1]);
93
+ var S = N[T.l];
94
+ y && (A = y("" + A)), w = typeof S == "string" ? S.replace("%d", A) : S(A, d, T.l, V);
95
+ break;
96
+ }
97
+ }
98
+ if (d) return w;
99
+ var O = V ? N.future : N.past;
100
+ return typeof O == "function" ? O(w) : O.replace("%s", w);
101
+ }, l.to = function(s, d) {
102
+ return p(s, d, this, !0);
103
+ }, l.from = function(s, d) {
104
+ return p(s, d, this);
105
+ };
106
+ var r = function(s) {
107
+ return s.$u ? c.utc() : c();
108
+ };
109
+ l.toNow = function(s) {
110
+ return this.to(r(this), s);
111
+ }, l.fromNow = function(s) {
112
+ return this.from(r(this), s);
113
+ };
114
+ };
115
+ });
116
+ })(ee);
117
+ var he = ee.exports;
118
+ const be = /* @__PURE__ */ ie(he), _e = /* @__PURE__ */ G({
119
+ __name: "KioskUnbindConfirm",
120
+ props: {
121
+ machineId: {}
122
+ },
123
+ emits: ["update:modelValue"],
124
+ setup(o, { emit: n }) {
125
+ const { t: f } = Q(), m = n, c = C("");
126
+ function l(i) {
127
+ m("update:modelValue", i);
128
+ }
129
+ return (i, p) => {
130
+ const r = F("FmTextField");
131
+ return u(), b("div", null, [
132
+ e("span", null, a(_(f)("order.unbindKioskDeviceWarning", { machineId: i.machineId })), 1),
133
+ v(r, {
134
+ "model-value": c.value,
135
+ "onUpdate:modelValue": l,
136
+ placeholder: i.machineId
137
+ }, null, 8, ["model-value", "placeholder"])
138
+ ]);
139
+ };
140
+ }
141
+ }), ke = { class: "border fm-corner-radius-lg p-12 hover:bg-fm-color-neutral-gray-50 transition-colors" }, ge = { class: "flex items-center justify-between mb-2" }, xe = { class: "flex items-center gap-2" }, Te = { class: "px-2 py-1 fm-corner-radius-md fm-typo-en-body-sm-600 uppercase bg-fm-color-neutral-gray-200 text-fm-color-typo-secondary" }, Ae = {
142
+ key: 0,
143
+ class: "fm-typo-en-body-md-600 text-fm-color-typo-primary"
144
+ }, Ie = { class: "flex items-center gap-1" }, we = {
145
+ key: 0,
146
+ class: "py-[1rem] flex flex-col gap-6"
147
+ }, Pe = { class: "fm-typo-en-title-sm-600" }, De = { class: "w-full border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2" }, Ce = { class: "flex flex-col gap-1 mb-2" }, Fe = { class: "fm-typo-en-body-lg-600 block" }, Me = { class: "flex flex-col gap-1 mb-2" }, $e = { class: "fm-typo-en-body-lg-600 block font-mono text-sm break-all" }, Ve = { class: "flex flex-col gap-1 mb-2" }, Be = { class: "fm-typo-en-body-lg-600 block" }, Se = { class: "flex flex-col gap-1 mb-2" }, Ne = { class: "fm-typo-en-body-lg-600 block" }, Oe = { class: "flex flex-col gap-1 mb-2" }, Ee = { class: "fm-typo-en-body-lg-600 block" }, Le = {
148
+ key: 0,
149
+ class: "fm-typo-en-title-sm-600"
150
+ }, Ke = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ue = { class: "fm-typo-en-body-lg-600 block" }, je = { key: 1 }, qe = { class: "py-[1rem] flex flex-col gap-6 text-center items-center" }, Ye = { class: "flex flex-col gap-1 mb-2" }, Re = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, We = { class: "mt-5 block" }, He = ["title"], ze = ["title"], Ge = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary font-mono" }, Qe = { class: "flex items-center gap-3 flex-wrap fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Je = { class: "flex items-center gap-1" }, Xe = {
151
+ key: 0,
152
+ class: "flex items-center gap-1"
153
+ }, Ze = { class: "flex items-center gap-1" }, et = ["title"], tt = /* @__PURE__ */ G({
154
+ __name: "KioskDeviceCard",
155
+ props: {
156
+ device: {}
157
+ },
158
+ setup(o) {
159
+ R.extend(be);
160
+ const { t: n } = Q(), f = le(), m = re(), c = ye(), l = C(!1), i = o, p = C(""), r = $(() => Object.entries(i.device.config)), s = $(() => {
161
+ var t;
162
+ return ((t = i.device) == null ? void 0 : t.deviceAppType) === "TABLET_APP" ? "Tablet App" : "Kiosk App";
163
+ }), d = $(() => {
164
+ var t;
165
+ return ((t = i.device) == null ? void 0 : t.deviceAppType) === "TABLET_APP";
166
+ }), k = $(() => {
167
+ const t = i.device.machineId;
168
+ return !t || t.length <= 16 ? t : `${t.slice(0, 8)}...${t.slice(-4)}`;
169
+ });
170
+ async function I() {
171
+ try {
172
+ await navigator.clipboard.writeText(i.device.machineId), m.open({
173
+ type: "success",
174
+ message: n("order.machineIdCopied"),
175
+ position: "bottom"
176
+ });
177
+ } catch {
178
+ m.open({
179
+ type: "error",
180
+ message: n("order.copyFailed"),
181
+ position: "bottom"
182
+ });
183
+ }
184
+ }
185
+ function y(t) {
186
+ return R(t).fromNow();
187
+ }
188
+ function M(t) {
189
+ return R(t).format("DD MMM YYYY HH:mm:ss");
190
+ }
191
+ function w() {
192
+ p.value = "", f.open({
193
+ title: n("order.unbindKioskDevice"),
194
+ contentComponent: _e,
195
+ contentComponentProps: {
196
+ machineId: i.device.machineId,
197
+ "onUpdate:modelValue": (t) => {
198
+ p.value = t;
199
+ }
200
+ },
201
+ dismissAway: !1,
202
+ primaryActions: {
203
+ text: n("order.unbind"),
204
+ variant: "destructive",
205
+ close: !1
206
+ },
207
+ secondaryActions: {
208
+ text: n("order.cancel"),
209
+ variant: "tertiary",
210
+ close: !0
211
+ }
212
+ }).onPrimary(async () => {
213
+ p.value == i.device.machineId ? (await oe(), m.open({
214
+ type: "success",
215
+ message: n("order.unbindSuccess"),
216
+ position: "bottom"
217
+ }), f.close()) : m.open({
218
+ type: "warning",
219
+ message: n("order.unbindWarning"),
220
+ position: "bottom"
221
+ });
222
+ });
223
+ }
224
+ const V = $(() => {
225
+ var t;
226
+ return (t = i.device) == null ? void 0 : t.pinInfo;
227
+ }), N = $(() => x.value ? "Re-enter new PIN" : "Enter new PIN"), x = C(!1), B = C(), P = C();
228
+ function T() {
229
+ l.value = !0;
230
+ }
231
+ function A() {
232
+ x.value = !1, B.value = null, P.value = null, l.value = !1;
233
+ }
234
+ function S(t) {
235
+ x.value ? (P.value = t, O()) : (B.value = t, x.value = !0);
236
+ }
237
+ async function O() {
238
+ B.value === P.value ? (await te(), m.open({
239
+ type: "success",
240
+ message: "Successfuly update device PIN",
241
+ position: "top"
242
+ })) : m.open({
243
+ type: "error",
244
+ message: "Entered PIN not the same, please try again",
245
+ position: "top"
246
+ }), A();
247
+ }
248
+ async function te() {
249
+ await c.updateDevicePin(B.value, i.device.machineId);
250
+ }
251
+ async function oe() {
252
+ await c.unbind(i.device.machineId);
253
+ }
254
+ return (t, h) => {
255
+ const L = F("FmButton"), J = F("FmPinField"), ne = F("FmSideSheet"), E = F("FmIcon");
256
+ return u(), b("div", ke, [
257
+ e("div", ge, [
258
+ e("div", xe, [
259
+ e("span", Te, a(d.value ? "Tablet" : "Kiosk"), 1),
260
+ d.value && t.device.slotInfo ? (u(), b("span", Ae, a(t.device.slotInfo), 1)) : D("", !0)
261
+ ]),
262
+ e("div", Ie, [
263
+ v(ne, {
264
+ header: _(n)("order.deviceDetails"),
265
+ "dismiss-away": "",
266
+ maxWidth: 700,
267
+ "onOn:clickedAway": A
268
+ }, {
269
+ "side-sheet-button": q(() => [
270
+ v(L, {
271
+ variant: "tertiary",
272
+ icon: "more_vert"
273
+ })
274
+ ]),
275
+ default: q(() => {
276
+ var X;
277
+ return [
278
+ l.value ? (u(), b("div", je, [
279
+ e("div", qe, [
280
+ e("div", Ye, [
281
+ e("span", Re, a(N.value), 1),
282
+ e("span", We, [
283
+ x.value ? D("", !0) : (u(), z(J, {
284
+ key: 0,
285
+ length: 4,
286
+ onComplete: h[0] || (h[0] = (g) => S(g))
287
+ })),
288
+ x.value ? (u(), z(J, {
289
+ key: 1,
290
+ length: 4,
291
+ onComplete: h[1] || (h[1] = (g) => S(g))
292
+ })) : D("", !0)
293
+ ])
294
+ ]),
295
+ v(L, {
296
+ class: "w-1/3",
297
+ variant: "secondary",
298
+ label: "Cancel reset PIN",
299
+ onClick: A
300
+ })
301
+ ])
302
+ ])) : (u(), b("div", we, [
303
+ e("span", Pe, a(t.device.name), 1),
304
+ e("div", De, [
305
+ h[7] || (h[7] = e("span", { class: "fm-typo-en-title-sm-600 mb-3" }, "App Info", -1)),
306
+ e("div", Ce, [
307
+ h[2] || (h[2] = e("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Type", -1)),
308
+ e("span", Fe, a(s.value), 1)
309
+ ]),
310
+ e("div", Me, [
311
+ h[3] || (h[3] = e("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Machine ID", -1)),
312
+ e("span", $e, a(t.device.machineId), 1)
313
+ ]),
314
+ e("div", Ve, [
315
+ h[4] || (h[4] = e("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Version", -1)),
316
+ e("span", Be, a(t.device.deviceAppVersion ?? "Below 0.0.42"), 1)
317
+ ]),
318
+ e("div", Se, [
319
+ h[5] || (h[5] = e("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "OTA Version", -1)),
320
+ e("span", Ne, a(t.device.deviceAppOTAVersion ?? "Not available"), 1)
321
+ ]),
322
+ e("div", Oe, [
323
+ h[6] || (h[6] = e("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "PIN Code", -1)),
324
+ e("span", Ee, a(V.value ? "Yes" : "No"), 1)
325
+ ]),
326
+ v(L, {
327
+ class: "w-auto",
328
+ variant: "primary",
329
+ label: (X = t.device) != null && X.pinInfo ? "Reset Device PIN" : "Set Device PIN",
330
+ onClick: T
331
+ }, null, 8, ["label"])
332
+ ]),
333
+ (u(!0), b(W, null, H(r.value.filter((g) => g[1]), (g) => (u(), b("div", {
334
+ key: g[0],
335
+ class: "w-full border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2"
336
+ }, [
337
+ g[1] ? (u(), b("span", Le, a(g[0]), 1)) : D("", !0),
338
+ g[1] ? (u(!0), b(W, { key: 1 }, H(Object.entries(g[1]), (K) => (u(), b("div", {
339
+ class: "flex flex-col gap-1",
340
+ key: K[0]
341
+ }, [
342
+ e("span", Ke, a(K[0]), 1),
343
+ e("span", Ue, a(K[1] == "" ? "-" : K[1]), 1)
344
+ ]))), 128)) : D("", !0)
345
+ ]))), 128))
346
+ ]))
347
+ ];
348
+ }),
349
+ _: 1
350
+ }, 8, ["header"]),
351
+ v(L, {
352
+ variant: "plain",
353
+ icon: "link_off",
354
+ class: "text-fm-color-system-error-300",
355
+ onClick: w
356
+ })
357
+ ])
358
+ ]),
359
+ e("div", {
360
+ class: "fm-typo-en-body-md-600 text-fm-color-typo-primary mb-1 overflow-hidden text-ellipsis whitespace-nowrap",
361
+ title: t.device.name
362
+ }, a(t.device.name), 9, He),
363
+ e("div", {
364
+ class: "flex items-center gap-1 mb-2 cursor-pointer group",
365
+ onClick: I,
366
+ title: _(n)("order.clickToCopy")
367
+ }, [
368
+ e("span", Ge, a(k.value), 1),
369
+ v(E, {
370
+ name: "content_copy",
371
+ class: "text-fm-color-typo-tertiary opacity-0 group-hover:opacity-100 transition-opacity"
372
+ })
373
+ ], 8, ze),
374
+ e("div", Qe, [
375
+ e("span", Je, [
376
+ v(E, { name: "smartphone" }),
377
+ U(" v" + a(t.device.deviceAppVersion ?? "?"), 1)
378
+ ]),
379
+ t.device.deviceAppOTAVersion ? (u(), b("span", Xe, [
380
+ v(E, { name: "system_update" }),
381
+ U(" " + a(t.device.deviceAppOTAVersion), 1)
382
+ ])) : D("", !0),
383
+ e("span", Ze, [
384
+ v(E, { name: "lock" }),
385
+ U(" " + a(V.value ? _(n)("order.pinSet") : _(n)("order.noPin")), 1)
386
+ ]),
387
+ t.device.lastStartup ? (u(), b("span", {
388
+ key: 1,
389
+ class: "flex items-center gap-1",
390
+ title: M(t.device.lastStartup)
391
+ }, [
392
+ v(E, { name: "schedule" }),
393
+ U(" " + a(y(t.device.lastStartup)), 1)
394
+ ], 8, et)) : D("", !0)
395
+ ])
396
+ ]);
397
+ };
398
+ }
399
+ }), ot = { class: "flex flex-col gap-4" }, nt = { class: "flex items-center justify-between" }, st = { class: "flex flex-col gap-2" }, it = { class: "fm-typo-en-title-sm-600 block" }, at = { class: "fm-typo-en-body-md-400 block" }, lt = { class: "flex items-center gap-3 flex-wrap" }, rt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ct = { class: "grid grid-cols-2 gap-2 py-8" }, dt = {
400
+ key: 0,
401
+ class: "text-center py-8 text-fm-color-typo-tertiary fm-typo-en-body-md-400 col-span-2"
402
+ }, pt = {
403
+ key: 1,
404
+ class: "text-center py-8 text-fm-color-typo-tertiary fm-typo-en-body-md-400 col-span-2"
405
+ }, bt = /* @__PURE__ */ G({
406
+ __name: "KioskDevicesView",
407
+ props: {
408
+ devices: {}
409
+ },
410
+ emits: ["requestOtp"],
411
+ setup(o) {
412
+ const { t: n } = Q(), f = o, m = C(""), c = C("all"), l = $(() => {
413
+ switch (c.value) {
414
+ case "tablet":
415
+ return n("order.tabletOnly");
416
+ case "kiosk":
417
+ return n("order.kioskOnly");
418
+ default:
419
+ return n("order.allTypes");
420
+ }
421
+ }), i = $(() => {
422
+ let p = f.devices;
423
+ c.value === "tablet" ? p = p.filter((s) => s.deviceAppType === "TABLET_APP") : c.value === "kiosk" && (p = p.filter((s) => s.deviceAppType !== "TABLET_APP"));
424
+ const r = m.value.toLowerCase().trim();
425
+ return r && (p = p.filter((s) => {
426
+ var y, M, w;
427
+ const d = ((y = s.name) == null ? void 0 : y.toLowerCase()) || "", k = ((M = s.machineId) == null ? void 0 : M.toLowerCase()) || "", I = ((w = s.slotInfo) == null ? void 0 : w.toLowerCase()) || "";
428
+ return d.includes(r) || k.includes(r) || I.includes(r);
429
+ })), p.sort((s, d) => s.deviceAppType === "TABLET_APP" && d.deviceAppType !== "TABLET_APP" ? -1 : s.deviceAppType !== "TABLET_APP" && d.deviceAppType === "TABLET_APP" ? 1 : s.deviceAppType === "TABLET_APP" && d.deviceAppType === "TABLET_APP" ? (s.slotInfo || "").localeCompare(d.slotInfo || "") : (s.name || "").localeCompare(d.name || ""));
430
+ });
431
+ return (p, r) => {
432
+ const s = F("FmButton"), d = F("FmSearch"), k = F("FmMenuItem"), I = F("FmMenu");
433
+ return u(), b("div", null, [
434
+ e("div", ot, [
435
+ e("div", nt, [
436
+ e("div", st, [
437
+ e("span", it, a(_(n)("order.kioskDisplay")), 1),
438
+ e("span", at, a(_(n)("order.kioskDisplayDescription")), 1)
439
+ ]),
440
+ v(s, {
441
+ variant: "primary",
442
+ label: _(n)("order.bindDevice"),
443
+ size: "md",
444
+ "prepend-icon": "link",
445
+ onClick: r[0] || (r[0] = (y) => p.$emit("requestOtp"))
446
+ }, null, 8, ["label"])
447
+ ]),
448
+ e("div", lt, [
449
+ v(d, {
450
+ "model-value": m.value,
451
+ "onUpdate:modelValue": r[1] || (r[1] = (y) => m.value = y),
452
+ class: "flex-1 min-w-[200px] max-w-[400px]",
453
+ placeholder: _(n)("order.searchDevices")
454
+ }, null, 8, ["model-value", "placeholder"]),
455
+ v(I, null, {
456
+ "menu-button": q(() => [
457
+ v(s, {
458
+ variant: "tertiary",
459
+ "prepend-icon": "filter_list",
460
+ label: l.value,
461
+ class: "fm-typo-en-body-md-600"
462
+ }, null, 8, ["label"])
463
+ ]),
464
+ default: q(() => [
465
+ v(k, {
466
+ "model-value": c.value === "all",
467
+ label: _(n)("order.allTypes"),
468
+ onClick: r[2] || (r[2] = (y) => c.value = "all")
469
+ }, null, 8, ["model-value", "label"]),
470
+ v(k, {
471
+ "model-value": c.value === "tablet",
472
+ label: _(n)("order.tabletOnly"),
473
+ onClick: r[3] || (r[3] = (y) => c.value = "tablet")
474
+ }, null, 8, ["model-value", "label"]),
475
+ v(k, {
476
+ "model-value": c.value === "kiosk",
477
+ label: _(n)("order.kioskOnly"),
478
+ onClick: r[4] || (r[4] = (y) => c.value = "kiosk")
479
+ }, null, 8, ["model-value", "label"])
480
+ ]),
481
+ _: 1
482
+ }),
483
+ e("span", rt, a(_(n)("order.showingDevices", { count: i.value.length, total: p.devices.length })), 1)
484
+ ]),
485
+ e("div", ct, [
486
+ (u(!0), b(W, null, H(i.value, (y) => (u(), z(tt, {
487
+ key: y.machineId,
488
+ device: y
489
+ }, null, 8, ["device"]))), 128)),
490
+ i.value.length === 0 && p.devices.length > 0 ? (u(), b("div", dt, a(_(n)("order.noDevicesMatch")), 1)) : D("", !0),
491
+ p.devices.length === 0 ? (u(), b("div", pt, a(_(n)("order.noDevicesBound")), 1)) : D("", !0)
492
+ ])
493
+ ])
494
+ ]);
495
+ };
496
+ }
497
+ });
498
+ export {
499
+ bt as _,
500
+ ye as u
501
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as J, computed as C, ref as k, onMounted as ae, resolveComponent as x, createElementBlock as I, openBlock as _, Fragment as B, createVNode as o, createElementVNode as i, createCommentVNode as L, unref as a, withCtx as T, createTextVNode as ne, toDisplayString as v, renderList as H, withDirectives as N, vShow as F } from "vue";
2
- import { F as U, c as r } from "./menu.dto-qVeqpSdz.js";
2
+ import { F as U, d as r } from "./menu.dto-Co7iXHNr.js";
3
3
  import { _ as te, u as ue } from "./index-BXsnV_eO.js";
4
4
  import { useI18n as X } from "@feedmepos/mf-common";
5
5
  import { useSnackbar as oe } from "@feedmepos/ui-library";