@feedmepos/mf-order-setting 0.0.108 → 0.0.109

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 (57) hide show
  1. package/dist/{DisplaySystemView-ChGTO4v2.js → DisplaySystemView-hHA7fMQR.js} +4 -4
  2. package/dist/{FoodCourtInvitationsView-F1LiGOR8.js → FoodCourtInvitationsView-C_x0pvnB.js} +4 -4
  3. package/dist/{FoodCourtOrderSettingsView-D5M5kFAl.js → FoodCourtOrderSettingsView-BMRJe6tf.js} +1 -1
  4. package/dist/FoodCourtOrdersView-DlGJnMOd.js +1433 -0
  5. package/dist/{FoodCourtStallsView-jz1xnZus.js → FoodCourtStallsView-BAzlMqlj.js} +2 -2
  6. package/dist/{FoodCourtStatusView-DC3qHL1L.js → FoodCourtStatusView-CRkk2f66.js} +1 -1
  7. package/dist/{KioskDevicesView-B9w4izOk.js → KioskDevicesView-COuR39YQ.js} +1 -1
  8. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-XJm-f2JF.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CAcDjPbk.js} +5 -5
  9. package/dist/{KioskSettingView-Bmfvz0Kz.js → KioskSettingView-DsIzIbYf.js} +3 -3
  10. package/dist/{KioskView-B0WlDEsG.js → KioskView-B1sn-D6k.js} +8 -8
  11. package/dist/{OrderSettingsView-BF89-eSB.js → OrderSettingsView-BvYGRXfI.js} +10 -10
  12. package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-BqPQnAVb.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-COUKtg5k.js} +1 -1
  13. package/dist/{app-B4ew9SMz.js → app-utsChJtE.js} +71 -15
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-BsZk4QHK.js → dayjs.min-C9WrpSe-.js} +1 -1
  16. package/dist/{featureFlag-CFlCo4uv.js → featureFlag-CHPFyNAw.js} +1 -1
  17. package/dist/frontend/mf-order/src/api/food-court/index.d.ts +29 -2
  18. package/dist/frontend/mf-order/src/app.d.ts +56 -0
  19. package/dist/frontend/mf-order/src/main.d.ts +56 -0
  20. package/dist/frontend/mf-order/src/views/food-court/food-court-order.d.ts +12 -1
  21. package/dist/frontend/mf-order/src/views/food-court/orders/FoodCourtOrderSheet.vue.d.ts +3 -1
  22. package/dist/frontend/mf-order/src/views/food-court/orders/FoodCourtReceiptDialog.vue.d.ts +17 -0
  23. package/dist/frontend/mf-order/src/views/food-court/orders/food-court-receipt.d.ts +20 -0
  24. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  25. package/dist/index--4Q-LHMq.js +6854 -0
  26. package/dist/{index-D0vTvoQN.js → index-BaABuG0J.js} +1 -1
  27. package/dist/{index-Z1ZA897U.js → index-CVxg__RB.js} +1 -1
  28. package/dist/index-Ck6Ef5sR.js +5 -0
  29. package/dist/{index-C6c28uBZ.js → index-D349Zd9k.js} +35 -23
  30. package/dist/{index-DLeX1p1o.js → index-DC8V_7zz.js} +2 -2
  31. package/dist/{index-D4_zVJPi.js → index-DVJkdWEG.js} +4 -4
  32. package/dist/index-iSsU83r4.js +46278 -0
  33. package/dist/{order.dto-DrlhCvYK.js → order.dto-D4yp5hGF.js} +47 -43
  34. package/dist/package/entity/alert/suggestion.dto.d.ts +2 -2
  35. package/dist/package/entity/food-court/order-v2.dto.d.ts +5 -5
  36. package/dist/package/entity/kiosk/kiosk.do.d.ts +16 -16
  37. package/dist/package/entity/kiosk/kiosk.dto.d.ts +19 -19
  38. package/dist/package/entity/order/order.do.d.ts +3 -3
  39. package/dist/package/entity/order/order.dto.d.ts +10 -10
  40. package/dist/package/entity/order/order.enum.d.ts +1 -1
  41. package/dist/package/entity/order-platform/deliveroo/deliveroo.menu.dto.d.ts +30 -30
  42. package/dist/{useInternalUser-BaSqwN4K.js → useInternalUser-CeoNePyw.js} +1 -1
  43. package/package.json +4 -1
  44. package/src/api/food-court/index.ts +42 -4
  45. package/src/locales/en-US.json +15 -1
  46. package/src/locales/ja-JP.json +15 -1
  47. package/src/locales/th-TH.json +15 -1
  48. package/src/locales/zh-CN.json +15 -1
  49. package/src/views/food-court/FoodCourtOrdersView.vue +135 -16
  50. package/src/views/food-court/food-court-order.spec.ts +16 -1
  51. package/src/views/food-court/food-court-order.ts +23 -1
  52. package/src/views/food-court/orders/FoodCourtOrderSheet.vue +29 -11
  53. package/src/views/food-court/orders/FoodCourtReceiptDialog.vue +113 -0
  54. package/src/views/food-court/orders/food-court-receipt.spec.ts +43 -0
  55. package/src/views/food-court/orders/food-court-receipt.ts +49 -0
  56. package/vite.config.ts +13 -0
  57. package/dist/FoodCourtOrdersView-BQrESoTH.js +0 -1190
@@ -0,0 +1,1433 @@
1
+ import { defineComponent as $e, ref as U, watch as me, resolveComponent as K, openBlock as T, createBlock as le, withCtx as oe, createElementVNode as x, createElementBlock as M, toDisplayString as S, createCommentVNode as re, unref as c, createVNode as $, nextTick as mt, computed as ue, Fragment as ne, renderList as ge, createTextVNode as je, normalizeClass as vt, h as Ce } from "vue";
2
+ import { d as ee } from "./dayjs.min-C9WrpSe-.js";
3
+ import { useRoute as pt, useRouter as ht } from "vue-router";
4
+ import { useI18n as Pe, useCoreStore as yt } from "@feedmepos/mf-common";
5
+ import { components as gt } from "@feedmepos/ui-library";
6
+ import { u as rt } from "./snackbar-DZQ0_reQ.js";
7
+ import { u as xt } from "./useFoodCourtContext-2p5sJMcB.js";
8
+ import { d as Fe, b as _t } from "./index-D349Zd9k.js";
9
+ import { e as Ae } from "./food-court-member-joC8tmsI.js";
10
+ import { a as Ct } from "./index-CVxg__RB.js";
11
+ import { a as He } from "./index-BaABuG0J.js";
12
+ const ke = ["PAID", "PENDING_PAYMENT", "CANCELLED"], ve = {
13
+ PAID: { variant: "success", labelKey: "order.foodCourt.orders.statusPaid" },
14
+ PENDING_PAYMENT: { variant: "warning", labelKey: "order.foodCourt.orders.statusPendingPayment" },
15
+ CANCELLED: { variant: "neutral", labelKey: "order.foodCourt.orders.statusCancelled" },
16
+ DRAFT: { variant: "neutral", labelKey: "order.foodCourt.orders.statusDraft" }
17
+ }, bt = [
18
+ { status: "PAID", helpKey: "order.foodCourt.orders.statusPaidHelp" },
19
+ { status: "PENDING_PAYMENT", helpKey: "order.foodCourt.orders.statusPendingPaymentHelp" },
20
+ { status: "CANCELLED", helpKey: "order.foodCourt.orders.statusCancelledHelp" }
21
+ ];
22
+ function Ke(e) {
23
+ const t = e.name || e.restaurantId;
24
+ return e.unitNo ? `${e.unitNo} · ${t}` : t;
25
+ }
26
+ function ze(e) {
27
+ var t;
28
+ switch ((t = e == null ? void 0 : e.bill) == null ? void 0 : t.status) {
29
+ case "REFUNDED":
30
+ return { variant: "critical", labelKey: "order.foodCourt.orders.stallRefunded" };
31
+ case "VOIDED":
32
+ return { variant: "critical", labelKey: "order.foodCourt.orders.stallVoided" };
33
+ }
34
+ switch (e == null ? void 0 : e.status) {
35
+ case "ACCEPTED":
36
+ return { variant: "success", labelKey: "order.foodCourt.orders.stallAccepted" };
37
+ case "DECLINED":
38
+ return { variant: "critical", labelKey: "order.foodCourt.orders.stallDeclined" };
39
+ case "NEW":
40
+ return { variant: "warning", labelKey: "order.foodCourt.orders.stallWaiting" };
41
+ default:
42
+ return { variant: "neutral", labelKey: "order.foodCourt.orders.stallUnknown" };
43
+ }
44
+ }
45
+ function Ge(e, t = ee()) {
46
+ const r = e.startDate ? ee(e.startDate) : t, o = e.endDate ? ee(e.endDate) : r;
47
+ return {
48
+ from: r.startOf("day").format(),
49
+ to: o.add(1, "day").startOf("day").format()
50
+ };
51
+ }
52
+ function fe(e) {
53
+ return e ? Ct.Dinero.fromFdoDinero(e).toFormat(!0) : "-";
54
+ }
55
+ function ot(e, t = !1) {
56
+ return e ? ee(e).format(t ? "DD MMM YYYY, HH:mm:ss" : "DD MMM YYYY, HH:mm") : "-";
57
+ }
58
+ function at(e, t = []) {
59
+ return t.flatMap((r, o) => {
60
+ const a = `${e}.${o}`;
61
+ return [
62
+ {
63
+ key: a,
64
+ name: r.name,
65
+ quantity: r.quantity,
66
+ amount: r.price && r.price.amount !== 0 ? r.price : null,
67
+ remark: null,
68
+ sub: !0
69
+ },
70
+ ...at(a, r.subItems)
71
+ ];
72
+ });
73
+ }
74
+ function wt(e) {
75
+ return e ? Object.entries(e.items ?? {}).filter(([, t]) => t.status !== "VOIDED").flatMap(([t, r]) => {
76
+ var o;
77
+ return [
78
+ {
79
+ key: t,
80
+ name: ((o = r.product) == null ? void 0 : o.name) ?? "",
81
+ quantity: r.quantity,
82
+ amount: r.nettTotal ?? null,
83
+ remark: r.remark || null,
84
+ sub: !1
85
+ },
86
+ ...at(t, r.subItems)
87
+ ];
88
+ }) : [];
89
+ }
90
+ function qe(e) {
91
+ return !e || e.amount === 0;
92
+ }
93
+ function It(e) {
94
+ if (!e) return [];
95
+ const t = [
96
+ {
97
+ key: "subtotal",
98
+ label: "order.foodCourt.orders.subtotal",
99
+ labelIsName: !1,
100
+ amount: e.grossTotal
101
+ }
102
+ ];
103
+ e.adjustedTotal && e.adjustedTotal.amount !== e.grossTotal.amount && t.push({
104
+ key: "discount",
105
+ label: "order.foodCourt.orders.discount",
106
+ labelIsName: !1,
107
+ amount: { ...e.adjustedTotal, amount: e.adjustedTotal.amount - e.grossTotal.amount }
108
+ });
109
+ for (const [r, o] of Object.entries(e.nettTaxes ?? {}))
110
+ o.inclusive || qe(o.total) || t.push({ key: `tax.${r}`, label: o.name, labelIsName: !0, amount: o.total });
111
+ return qe(e.rounding) || t.push({
112
+ key: "rounding",
113
+ label: "order.foodCourt.orders.rounding",
114
+ labelIsName: !1,
115
+ amount: e.rounding
116
+ }), t;
117
+ }
118
+ function Tt(e) {
119
+ const t = new Map((e.pf_orders ?? []).map((r) => [String(r._id), r]));
120
+ return (e.stalls ?? []).map((r) => {
121
+ var n, l;
122
+ const o = t.get(String(r.orderId)) ?? null, a = wt(o == null ? void 0 : o.bill);
123
+ return {
124
+ key: r.orderId,
125
+ unitNo: r.unitNo || null,
126
+ // A stall the court never named has no display name: show the outlet's own name (#FC-018).
127
+ name: r.displayName || ((l = (n = e.stallProfiles) == null ? void 0 : n[String(r.restaurantId)]) == null ? void 0 : l.name) || r.restaurantId,
128
+ amount: r.amount,
129
+ order: o,
130
+ items: a,
131
+ itemCount: a.filter((u) => !u.sub).reduce((u, i) => u + i.quantity, 0),
132
+ totals: It(o == null ? void 0 : o.bill)
133
+ };
134
+ });
135
+ }
136
+ function Dt(e) {
137
+ if (e.status !== "PAID") return `the order is not paid (${e.status})`;
138
+ if (!e.orderNumber) return "the order has no FC number";
139
+ const t = e.stalls ?? [];
140
+ if (!t.length) return "the order has no stalls";
141
+ const r = new Set((e.pf_orders ?? []).map((a) => String(a._id))), o = t.find((a) => !r.has(String(a.orderId)));
142
+ return o ? `stall ${o.displayName || o.restaurantId} has no order` : null;
143
+ }
144
+ function St(e) {
145
+ const [t, r] = e.split(/[-_]/);
146
+ return r ? { languageCode: t, countryCode: r } : { languageCode: t };
147
+ }
148
+ async function kt(e, t, r) {
149
+ const [o, a] = await Promise.all([
150
+ import("./index-iSsU83r4.js").then((u) => u.i),
151
+ import("./index--4Q-LHMq.js")
152
+ ]), n = o.default ?? o;
153
+ r && n.setCountry(r);
154
+ const l = n.foodCourtReceipt.compile({
155
+ order: e,
156
+ locale: St(t)
157
+ });
158
+ return a.render({ groups: l.groups, fontSize: l.fontSize });
159
+ }
160
+ const Nt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Et = { class: "max-h-[70vh] overflow-y-auto flex justify-center" }, Ft = {
161
+ key: 1,
162
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
163
+ }, At = { class: "flex gap-12 justify-end" }, Mt = /* @__PURE__ */ $e({
164
+ __name: "FoodCourtReceiptDialog",
165
+ props: {
166
+ modelValue: { type: Boolean },
167
+ receipt: {}
168
+ },
169
+ emits: ["update:modelValue"],
170
+ setup(e, { emit: t }) {
171
+ const r = e, o = t, { t: a, locale: n } = Pe(), l = yt(), u = U(null), i = U(null), y = U(!1), s = U(null);
172
+ async function h() {
173
+ var f, v;
174
+ const g = r.receipt;
175
+ if (i.value = null, s.value = null, u.value && u.value.replaceChildren(), !g) return;
176
+ const b = Dt(g);
177
+ if (b) {
178
+ s.value = a("order.foodCourt.orders.receiptUnavailable", { reason: b });
179
+ return;
180
+ }
181
+ y.value = !0;
182
+ try {
183
+ const D = await kt(
184
+ g,
185
+ String(n.value ?? "en-US"),
186
+ ((f = l.currentCountry) == null ? void 0 : f.value) ?? null
187
+ );
188
+ if (r.receipt !== g || !r.modelValue) return;
189
+ D.style.width = "100%", D.style.maxWidth = "380px", D.style.height = "auto", i.value = D, await mt(), (v = u.value) == null || v.replaceChildren(D);
190
+ } catch (D) {
191
+ s.value = a("order.foodCourt.orders.receiptUnavailable", {
192
+ reason: D instanceof Error ? D.message : String(D)
193
+ });
194
+ } finally {
195
+ y.value = !1;
196
+ }
197
+ }
198
+ function I() {
199
+ var b, f;
200
+ if (!i.value) return;
201
+ const g = document.createElement("a");
202
+ g.download = `receipt-${((b = r.receipt) == null ? void 0 : b.orderNumber) ?? ((f = r.receipt) == null ? void 0 : f._id) ?? "food-court"}.png`, g.href = i.value.toDataURL("image/png"), g.click();
203
+ }
204
+ return me(
205
+ () => [r.modelValue, r.receipt],
206
+ ([g]) => {
207
+ g && h();
208
+ },
209
+ { immediate: !0 }
210
+ ), (g, b) => {
211
+ const f = K("FmCircularProgress"), v = K("FmButton"), D = K("FmDialog");
212
+ return T(), le(D, {
213
+ "model-value": e.modelValue,
214
+ "max-width": 440,
215
+ "onUpdate:modelValue": b[1] || (b[1] = (E) => o("update:modelValue", E))
216
+ }, {
217
+ "dialog-header": oe(() => [
218
+ x("div", Nt, S(c(a)("order.foodCourt.orders.receiptTitle")), 1)
219
+ ]),
220
+ "dialog-footer": oe(() => [
221
+ x("div", At, [
222
+ i.value ? (T(), le(v, {
223
+ key: 0,
224
+ variant: "secondary",
225
+ "prepend-icon": "download",
226
+ label: c(a)("order.foodCourt.orders.downloadReceipt"),
227
+ onClick: I
228
+ }, null, 8, ["label"])) : re("", !0),
229
+ $(v, {
230
+ variant: "primary",
231
+ label: c(a)("order.foodCourt.orders.close"),
232
+ onClick: b[0] || (b[0] = (E) => o("update:modelValue", !1))
233
+ }, null, 8, ["label"])
234
+ ])
235
+ ]),
236
+ default: oe(() => [
237
+ x("div", Et, [
238
+ y.value ? (T(), le(f, {
239
+ key: 0,
240
+ size: "xl"
241
+ })) : s.value ? (T(), M("span", Ft, S(s.value), 1)) : re("", !0),
242
+ x("div", {
243
+ ref_key: "canvasHost",
244
+ ref: u,
245
+ class: "flex justify-center"
246
+ }, null, 512)
247
+ ])
248
+ ]),
249
+ _: 1
250
+ }, 8, ["model-value"]);
251
+ };
252
+ }
253
+ }), Ot = {
254
+ key: 1,
255
+ class: "flex flex-col gap-3 items-start"
256
+ }, Rt = { class: "fm-typo-en-body-md-400" }, Ut = {
257
+ key: 2,
258
+ class: "flex flex-col gap-12"
259
+ }, $t = { class: "flex items-center justify-between gap-2" }, Pt = { class: "fm-typo-en-title-sm-600" }, Vt = { class: "flex flex-col gap-2" }, Lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "fm-typo-en-body-md-600 break-all" }, Bt = { class: "flex items-center justify-between gap-2" }, jt = { class: "flex items-center gap-2 min-w-0" }, Ht = {
260
+ key: 0,
261
+ class: "px-2 py-[2px] rounded bg-fm-color-neutral-gray-100 fm-typo-en-body-sm-400 shrink-0"
262
+ }, Kt = { class: "fm-typo-en-body-lg-600 truncate" }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, qt = ["onClick"], Wt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xt = { class: "flex items-center gap-1 fm-typo-en-body-md-600" }, Qt = {
263
+ key: 0,
264
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
265
+ }, Zt = {
266
+ key: 1,
267
+ class: "flex flex-col gap-1"
268
+ }, Jt = { class: "flex flex-col min-w-0" }, er = {
269
+ key: 0,
270
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
271
+ }, tr = { class: "shrink-0" }, rr = {
272
+ key: 2,
273
+ class: "flex flex-col gap-1 border-t border-fm-color-neutral-gray-200 pt-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
274
+ }, or = { class: "flex justify-between gap-3 fm-typo-en-body-md-600 text-fm-color-typo-primary" }, ar = { class: "fm-typo-en-title-sm-600" }, nr = { class: "fm-typo-en-title-sm-600" }, lr = { class: "flex gap-3" }, sr = /* @__PURE__ */ $e({
275
+ __name: "FoodCourtOrderSheet",
276
+ props: {
277
+ modelValue: { type: Boolean },
278
+ foodCourtId: {},
279
+ orderId: {}
280
+ },
281
+ emits: ["update:modelValue"],
282
+ setup(e, { emit: t }) {
283
+ const r = e, o = t, { t: a } = Pe(), { showError: n } = rt(), l = U(null), u = U(!1), i = U(!1), y = U(/* @__PURE__ */ new Set()), s = ue(() => l.value ? Tt(l.value) : []), h = ue(() => {
284
+ var v;
285
+ const f = l.value;
286
+ return f ? [
287
+ {
288
+ label: a("order.foodCourt.orders.date"),
289
+ value: ot(((v = f.payment) == null ? void 0 : v.paidAt) ?? null, !0)
290
+ },
291
+ { label: a("order.foodCourt.orders.paidBy"), value: f.paymentMethod || "-" },
292
+ { label: a("order.foodCourt.orders.orderId"), value: f._id }
293
+ ] : [];
294
+ }), I = U(!1);
295
+ function g(f) {
296
+ const v = new Set(y.value);
297
+ v.has(f) ? v.delete(f) : v.add(f), y.value = v;
298
+ }
299
+ async function b() {
300
+ var D, E;
301
+ const f = r.foodCourtId, v = r.orderId;
302
+ if (i.value = !1, !!v) {
303
+ u.value = !0;
304
+ try {
305
+ const F = await Fe.getOrder(f, v);
306
+ if (v !== r.orderId || f !== r.foodCourtId) return;
307
+ l.value = F;
308
+ const N = (E = (D = F.stalls) == null ? void 0 : D[0]) == null ? void 0 : E.orderId;
309
+ y.value = new Set(N ? [N] : []);
310
+ } catch (F) {
311
+ if (v !== r.orderId || f !== r.foodCourtId) return;
312
+ i.value = !0, n(Ae(F));
313
+ } finally {
314
+ v === r.orderId && f === r.foodCourtId && (u.value = !1);
315
+ }
316
+ }
317
+ }
318
+ return me(
319
+ () => [r.foodCourtId, r.orderId],
320
+ () => {
321
+ I.value = !1, l.value = null, b();
322
+ },
323
+ { immediate: !0 }
324
+ ), (f, v) => {
325
+ const D = K("FmCircularProgress"), E = K("FmButton"), F = K("FmChip"), N = K("FmCard"), B = K("FmIcon"), V = K("FmSideSheet");
326
+ return T(), M(ne, null, [
327
+ $(V, {
328
+ "model-value": e.modelValue,
329
+ header: c(a)("order.foodCourt.orders.detailTitle"),
330
+ "dismiss-away": "",
331
+ "max-width": 560,
332
+ "onUpdate:modelValue": v[2] || (v[2] = (p) => o("update:modelValue", p))
333
+ }, {
334
+ "side-sheet-footer": oe(() => [
335
+ x("div", lr, [
336
+ l.value && l.value.status === "PAID" ? (T(), le(E, {
337
+ key: 0,
338
+ variant: "primary",
339
+ "prepend-icon": "receipt_long",
340
+ label: c(a)("order.foodCourt.orders.viewReceipt"),
341
+ size: "lg",
342
+ onClick: v[0] || (v[0] = (p) => I.value = !0)
343
+ }, null, 8, ["label"])) : re("", !0),
344
+ $(E, {
345
+ variant: "secondary",
346
+ label: c(a)("order.foodCourt.orders.close"),
347
+ size: "lg",
348
+ onClick: v[1] || (v[1] = (p) => o("update:modelValue", !1))
349
+ }, null, 8, ["label"])
350
+ ])
351
+ ]),
352
+ default: oe(() => [
353
+ u.value ? (T(), le(D, {
354
+ key: 0,
355
+ size: "xl"
356
+ })) : i.value ? (T(), M("div", Ot, [
357
+ x("span", Rt, S(c(a)("order.foodCourt.orders.detailLoadFailed")), 1),
358
+ $(E, {
359
+ variant: "secondary",
360
+ label: c(a)("order.foodCourt.retry"),
361
+ onClick: b
362
+ }, null, 8, ["label"])
363
+ ])) : l.value ? (T(), M("div", Ut, [
364
+ $(N, {
365
+ variant: "outlined",
366
+ class: "p-16 flex flex-col gap-12"
367
+ }, {
368
+ default: oe(() => [
369
+ x("div", $t, [
370
+ x("span", Pt, S(l.value.orderNumber ? c(a)("order.foodCourt.orders.orderTitle", { number: `#${l.value.orderNumber}` }) : c(a)("order.foodCourt.orders.noNumber")), 1),
371
+ $(F, {
372
+ variant: c(ve)[l.value.status].variant,
373
+ label: c(a)(c(ve)[l.value.status].labelKey)
374
+ }, null, 8, ["variant", "label"])
375
+ ]),
376
+ x("div", Vt, [
377
+ (T(!0), M(ne, null, ge(h.value, (p) => (T(), M("div", {
378
+ key: p.label,
379
+ class: "flex flex-col"
380
+ }, [
381
+ x("span", Lt, S(p.label), 1),
382
+ x("span", Yt, S(p.value), 1)
383
+ ]))), 128))
384
+ ])
385
+ ]),
386
+ _: 1
387
+ }),
388
+ (T(!0), M(ne, null, ge(s.value, (p) => (T(), le(N, {
389
+ key: p.key,
390
+ variant: "outlined",
391
+ class: "p-16 flex flex-col gap-12"
392
+ }, {
393
+ default: oe(() => {
394
+ var C, _, j, Z;
395
+ return [
396
+ x("div", Bt, [
397
+ x("div", jt, [
398
+ p.unitNo ? (T(), M("span", Ht, S(p.unitNo), 1)) : re("", !0),
399
+ x("span", Kt, S(p.name), 1)
400
+ ]),
401
+ $(F, {
402
+ variant: c(ze)(p.order).variant,
403
+ label: c(a)(c(ze)(p.order).labelKey)
404
+ }, null, 8, ["variant", "label"])
405
+ ]),
406
+ x("span", zt, [
407
+ je(S(c(a)("order.foodCourt.orders.billNo")) + " • ", 1),
408
+ x("span", Gt, S(((_ = (C = p.order) == null ? void 0 : C.bill) == null ? void 0 : _.seqNumber) || c(a)("order.foodCourt.orders.notBilled")), 1)
409
+ ]),
410
+ x("button", {
411
+ type: "button",
412
+ class: "flex items-center justify-between border-t border-fm-color-neutral-gray-200 pt-3",
413
+ onClick: (w) => g(p.key)
414
+ }, [
415
+ x("span", Wt, S(c(a)("order.foodCourt.orders.itemCount", { count: p.itemCount })), 1),
416
+ x("span", Xt, [
417
+ je(S(c(fe)(p.amount)) + " ", 1),
418
+ $(B, {
419
+ name: y.value.has(p.key) ? "expand_less" : "expand_more",
420
+ size: "md"
421
+ }, null, 8, ["name"])
422
+ ])
423
+ ], 8, qt),
424
+ y.value.has(p.key) ? (T(), M(ne, { key: 0 }, [
425
+ p.items.length ? (T(), M("div", Zt, [
426
+ (T(!0), M(ne, null, ge(p.items, (w) => (T(), M("div", {
427
+ key: w.key,
428
+ class: vt([
429
+ "flex justify-between gap-3",
430
+ w.sub ? "pl-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" : "fm-typo-en-body-md-600 pt-1"
431
+ ])
432
+ }, [
433
+ x("div", Jt, [
434
+ x("span", null, S(w.sub ? `+ ${w.name}` : `${w.quantity}x ${w.name}`), 1),
435
+ w.remark ? (T(), M("span", er, S(w.remark), 1)) : re("", !0)
436
+ ]),
437
+ x("span", tr, S(w.amount ? c(fe)(w.amount) : ""), 1)
438
+ ], 2))), 128))
439
+ ])) : (T(), M("div", Qt, S(c(a)("order.foodCourt.orders.noItems")), 1)),
440
+ p.totals.length ? (T(), M("div", rr, [
441
+ (T(!0), M(ne, null, ge(p.totals, (w) => (T(), M("div", {
442
+ key: w.key,
443
+ class: "flex justify-between gap-3"
444
+ }, [
445
+ x("span", null, S(w.labelIsName ? w.label : c(a)(w.label)), 1),
446
+ x("span", null, S(c(fe)(w.amount)), 1)
447
+ ]))), 128)),
448
+ x("div", or, [
449
+ x("span", null, S(c(a)("order.foodCourt.orders.stallTotal")), 1),
450
+ x("span", null, S(c(fe)(((Z = (j = p.order) == null ? void 0 : j.bill) == null ? void 0 : Z.nettTotal) ?? p.amount)), 1)
451
+ ])
452
+ ])) : re("", !0)
453
+ ], 64)) : re("", !0)
454
+ ];
455
+ }),
456
+ _: 2
457
+ }, 1024))), 128)),
458
+ $(N, {
459
+ variant: "outlined",
460
+ class: "p-16 flex items-center justify-between"
461
+ }, {
462
+ default: oe(() => [
463
+ x("span", ar, S(c(a)("order.foodCourt.orders.netTotal")), 1),
464
+ x("span", nr, S(c(fe)(l.value.total)), 1)
465
+ ]),
466
+ _: 1
467
+ })
468
+ ])) : re("", !0)
469
+ ]),
470
+ _: 1
471
+ }, 8, ["model-value", "header"]),
472
+ $(Mt, {
473
+ modelValue: I.value,
474
+ "onUpdate:modelValue": v[3] || (v[3] = (p) => I.value = p),
475
+ receipt: l.value
476
+ }, null, 8, ["modelValue", "receipt"])
477
+ ], 64);
478
+ };
479
+ }
480
+ });
481
+ var G = Uint8Array, Q = Uint16Array, Ve = Int32Array, Le = new G([
482
+ 0,
483
+ 0,
484
+ 0,
485
+ 0,
486
+ 0,
487
+ 0,
488
+ 0,
489
+ 0,
490
+ 1,
491
+ 1,
492
+ 1,
493
+ 1,
494
+ 2,
495
+ 2,
496
+ 2,
497
+ 2,
498
+ 3,
499
+ 3,
500
+ 3,
501
+ 3,
502
+ 4,
503
+ 4,
504
+ 4,
505
+ 4,
506
+ 5,
507
+ 5,
508
+ 5,
509
+ 5,
510
+ 0,
511
+ /* unused */
512
+ 0,
513
+ 0,
514
+ /* impossible */
515
+ 0
516
+ ]), Ye = new G([
517
+ 0,
518
+ 0,
519
+ 0,
520
+ 0,
521
+ 1,
522
+ 1,
523
+ 2,
524
+ 2,
525
+ 3,
526
+ 3,
527
+ 4,
528
+ 4,
529
+ 5,
530
+ 5,
531
+ 6,
532
+ 6,
533
+ 7,
534
+ 7,
535
+ 8,
536
+ 8,
537
+ 9,
538
+ 9,
539
+ 10,
540
+ 10,
541
+ 11,
542
+ 11,
543
+ 12,
544
+ 12,
545
+ 13,
546
+ 13,
547
+ /* unused */
548
+ 0,
549
+ 0
550
+ ]), We = new G([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), nt = function(e, t) {
551
+ for (var r = new Q(31), o = 0; o < 31; ++o)
552
+ r[o] = t += 1 << e[o - 1];
553
+ for (var a = new Ve(r[30]), o = 1; o < 30; ++o)
554
+ for (var n = r[o]; n < r[o + 1]; ++n)
555
+ a[n] = n - r[o] << 5 | o;
556
+ return { b: r, r: a };
557
+ }, lt = nt(Le, 2), ir = lt.b, Me = lt.r;
558
+ ir[28] = 258, Me[258] = 28;
559
+ var dr = nt(Ye, 0), Xe = dr.r, Oe = new Q(32768);
560
+ for (var O = 0; O < 32768; ++O) {
561
+ var se = (O & 43690) >> 1 | (O & 21845) << 1;
562
+ se = (se & 52428) >> 2 | (se & 13107) << 2, se = (se & 61680) >> 4 | (se & 3855) << 4, Oe[O] = ((se & 65280) >> 8 | (se & 255) << 8) >> 1;
563
+ }
564
+ var xe = function(e, t, r) {
565
+ for (var o = e.length, a = 0, n = new Q(t); a < o; ++a)
566
+ e[a] && ++n[e[a] - 1];
567
+ var l = new Q(t);
568
+ for (a = 1; a < t; ++a)
569
+ l[a] = l[a - 1] + n[a - 1] << 1;
570
+ var u;
571
+ if (r) {
572
+ u = new Q(1 << t);
573
+ var i = 15 - t;
574
+ for (a = 0; a < o; ++a)
575
+ if (e[a])
576
+ for (var y = a << 4 | e[a], s = t - e[a], h = l[e[a] - 1]++ << s, I = h | (1 << s) - 1; h <= I; ++h)
577
+ u[Oe[h] >> i] = y;
578
+ } else
579
+ for (u = new Q(o), a = 0; a < o; ++a)
580
+ e[a] && (u[a] = Oe[l[e[a] - 1]++] >> 15 - e[a]);
581
+ return u;
582
+ }, ce = new G(288);
583
+ for (var O = 0; O < 144; ++O)
584
+ ce[O] = 8;
585
+ for (var O = 144; O < 256; ++O)
586
+ ce[O] = 9;
587
+ for (var O = 256; O < 280; ++O)
588
+ ce[O] = 7;
589
+ for (var O = 280; O < 288; ++O)
590
+ ce[O] = 8;
591
+ var be = new G(32);
592
+ for (var O = 0; O < 32; ++O)
593
+ be[O] = 5;
594
+ var ur = /* @__PURE__ */ xe(ce, 9, 0), cr = /* @__PURE__ */ xe(be, 5, 0), st = function(e) {
595
+ return (e + 7) / 8 | 0;
596
+ }, it = function(e, t, r) {
597
+ return (r == null || r > e.length) && (r = e.length), new G(e.subarray(t, r));
598
+ }, fr = [
599
+ "unexpected EOF",
600
+ "invalid block type",
601
+ "invalid length/literal",
602
+ "invalid distance",
603
+ "stream finished",
604
+ "no stream handler",
605
+ ,
606
+ // determined by compression function
607
+ "no callback",
608
+ "invalid UTF-8 data",
609
+ "extra field too long",
610
+ "date not in range 1980-2099",
611
+ "filename too long",
612
+ "stream finishing",
613
+ "invalid zip data"
614
+ // determined by unknown compression method
615
+ ], Ie = function(e, t, r) {
616
+ var o = new Error(t || fr[e]);
617
+ if (o.code = e, Error.captureStackTrace && Error.captureStackTrace(o, Ie), !r)
618
+ throw o;
619
+ return o;
620
+ }, ae = function(e, t, r) {
621
+ r <<= t & 7;
622
+ var o = t / 8 | 0;
623
+ e[o] |= r, e[o + 1] |= r >> 8;
624
+ }, he = function(e, t, r) {
625
+ r <<= t & 7;
626
+ var o = t / 8 | 0;
627
+ e[o] |= r, e[o + 1] |= r >> 8, e[o + 2] |= r >> 16;
628
+ }, Ne = function(e, t) {
629
+ for (var r = [], o = 0; o < e.length; ++o)
630
+ e[o] && r.push({ s: o, f: e[o] });
631
+ var a = r.length, n = r.slice();
632
+ if (!a)
633
+ return { t: ut, l: 0 };
634
+ if (a == 1) {
635
+ var l = new G(r[0].s + 1);
636
+ return l[r[0].s] = 1, { t: l, l: 1 };
637
+ }
638
+ r.sort(function(B, V) {
639
+ return B.f - V.f;
640
+ }), r.push({ s: -1, f: 25001 });
641
+ var u = r[0], i = r[1], y = 0, s = 1, h = 2;
642
+ for (r[0] = { s: -1, f: u.f + i.f, l: u, r: i }; s != a - 1; )
643
+ u = r[r[y].f < r[h].f ? y++ : h++], i = r[y != s && r[y].f < r[h].f ? y++ : h++], r[s++] = { s: -1, f: u.f + i.f, l: u, r: i };
644
+ for (var I = n[0].s, o = 1; o < a; ++o)
645
+ n[o].s > I && (I = n[o].s);
646
+ var g = new Q(I + 1), b = Re(r[s - 1], g, 0);
647
+ if (b > t) {
648
+ var o = 0, f = 0, v = b - t, D = 1 << v;
649
+ for (n.sort(function(V, p) {
650
+ return g[p.s] - g[V.s] || V.f - p.f;
651
+ }); o < a; ++o) {
652
+ var E = n[o].s;
653
+ if (g[E] > t)
654
+ f += D - (1 << b - g[E]), g[E] = t;
655
+ else
656
+ break;
657
+ }
658
+ for (f >>= v; f > 0; ) {
659
+ var F = n[o].s;
660
+ g[F] < t ? f -= 1 << t - g[F]++ - 1 : ++o;
661
+ }
662
+ for (; o >= 0 && f; --o) {
663
+ var N = n[o].s;
664
+ g[N] == t && (--g[N], ++f);
665
+ }
666
+ b = t;
667
+ }
668
+ return { t: new G(g), l: b };
669
+ }, Re = function(e, t, r) {
670
+ return e.s == -1 ? Math.max(Re(e.l, t, r + 1), Re(e.r, t, r + 1)) : t[e.s] = r;
671
+ }, Qe = function(e) {
672
+ for (var t = e.length; t && !e[--t]; )
673
+ ;
674
+ for (var r = new Q(++t), o = 0, a = e[0], n = 1, l = function(i) {
675
+ r[o++] = i;
676
+ }, u = 1; u <= t; ++u)
677
+ if (e[u] == a && u != t)
678
+ ++n;
679
+ else {
680
+ if (!a && n > 2) {
681
+ for (; n > 138; n -= 138)
682
+ l(32754);
683
+ n > 2 && (l(n > 10 ? n - 11 << 5 | 28690 : n - 3 << 5 | 12305), n = 0);
684
+ } else if (n > 3) {
685
+ for (l(a), --n; n > 6; n -= 6)
686
+ l(8304);
687
+ n > 2 && (l(n - 3 << 5 | 8208), n = 0);
688
+ }
689
+ for (; n--; )
690
+ l(a);
691
+ n = 1, a = e[u];
692
+ }
693
+ return { c: r.subarray(0, o), n: t };
694
+ }, ye = function(e, t) {
695
+ for (var r = 0, o = 0; o < t.length; ++o)
696
+ r += e[o] * t[o];
697
+ return r;
698
+ }, dt = function(e, t, r) {
699
+ var o = r.length, a = st(t + 2);
700
+ e[a] = o & 255, e[a + 1] = o >> 8, e[a + 2] = e[a] ^ 255, e[a + 3] = e[a + 1] ^ 255;
701
+ for (var n = 0; n < o; ++n)
702
+ e[a + n + 4] = r[n];
703
+ return (a + 4 + o) * 8;
704
+ }, Ze = function(e, t, r, o, a, n, l, u, i, y, s) {
705
+ ae(t, s++, r), ++a[256];
706
+ for (var h = Ne(a, 15), I = h.t, g = h.l, b = Ne(n, 15), f = b.t, v = b.l, D = Qe(I), E = D.c, F = D.n, N = Qe(f), B = N.c, V = N.n, p = new Q(19), C = 0; C < E.length; ++C)
707
+ ++p[E[C] & 31];
708
+ for (var C = 0; C < B.length; ++C)
709
+ ++p[B[C] & 31];
710
+ for (var _ = Ne(p, 7), j = _.t, Z = _.l, w = 19; w > 4 && !j[We[w - 1]]; --w)
711
+ ;
712
+ var J = y + 5 << 3, z = ye(a, ce) + ye(n, be) + l, W = ye(a, I) + ye(n, f) + l + 14 + 3 * w + ye(p, j) + 2 * p[16] + 3 * p[17] + 7 * p[18];
713
+ if (i >= 0 && J <= z && J <= W)
714
+ return dt(t, s, e.subarray(i, i + y));
715
+ var q, L, X, te;
716
+ if (ae(t, s, 1 + (W < z)), s += 2, W < z) {
717
+ q = xe(I, g, 0), L = I, X = xe(f, v, 0), te = f;
718
+ var pe = xe(j, Z, 0);
719
+ ae(t, s, F - 257), ae(t, s + 5, V - 1), ae(t, s + 10, w - 4), s += 14;
720
+ for (var C = 0; C < w; ++C)
721
+ ae(t, s + 3 * C, j[We[C]]);
722
+ s += 3 * w;
723
+ for (var d = [E, B], m = 0; m < 2; ++m)
724
+ for (var k = d[m], C = 0; C < k.length; ++C) {
725
+ var R = k[C] & 31;
726
+ ae(t, s, pe[R]), s += j[R], R > 15 && (ae(t, s, k[C] >> 5 & 127), s += k[C] >> 12);
727
+ }
728
+ } else
729
+ q = ur, L = ce, X = cr, te = be;
730
+ for (var C = 0; C < u; ++C) {
731
+ var A = o[C];
732
+ if (A > 255) {
733
+ var R = A >> 18 & 31;
734
+ he(t, s, q[R + 257]), s += L[R + 257], R > 7 && (ae(t, s, A >> 23 & 31), s += Le[R]);
735
+ var Y = A & 31;
736
+ he(t, s, X[Y]), s += te[Y], Y > 3 && (he(t, s, A >> 5 & 8191), s += Ye[Y]);
737
+ } else
738
+ he(t, s, q[A]), s += L[A];
739
+ }
740
+ return he(t, s, q[256]), s + L[256];
741
+ }, mr = /* @__PURE__ */ new Ve([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), ut = /* @__PURE__ */ new G(0), vr = function(e, t, r, o, a, n) {
742
+ var l = n.z || e.length, u = new G(o + l + 5 * (1 + Math.ceil(l / 7e3)) + a), i = u.subarray(o, u.length - a), y = n.l, s = (n.r || 0) & 7;
743
+ if (t) {
744
+ s && (i[0] = n.r >> 3);
745
+ for (var h = mr[t - 1], I = h >> 13, g = h & 8191, b = (1 << r) - 1, f = n.p || new Q(32768), v = n.h || new Q(b + 1), D = Math.ceil(r / 3), E = 2 * D, F = function(Se) {
746
+ return (e[Se] ^ e[Se + 1] << D ^ e[Se + 2] << E) & b;
747
+ }, N = new Ve(25e3), B = new Q(288), V = new Q(32), p = 0, C = 0, _ = n.i || 0, j = 0, Z = n.w || 0, w = 0; _ + 2 < l; ++_) {
748
+ var J = F(_), z = _ & 32767, W = v[J];
749
+ if (f[z] = W, v[J] = z, Z <= _) {
750
+ var q = l - _;
751
+ if ((p > 7e3 || j > 24576) && (q > 423 || !y)) {
752
+ s = Ze(e, i, 0, N, B, V, C, j, w, _ - w, s), j = p = C = 0, w = _;
753
+ for (var L = 0; L < 286; ++L)
754
+ B[L] = 0;
755
+ for (var L = 0; L < 30; ++L)
756
+ V[L] = 0;
757
+ }
758
+ var X = 2, te = 0, pe = g, d = z - W & 32767;
759
+ if (q > 2 && J == F(_ - d))
760
+ for (var m = Math.min(I, q) - 1, k = Math.min(32767, _), R = Math.min(258, q); d <= k && --pe && z != W; ) {
761
+ if (e[_ + X] == e[_ + X - d]) {
762
+ for (var A = 0; A < R && e[_ + A] == e[_ + A - d]; ++A)
763
+ ;
764
+ if (A > X) {
765
+ if (X = A, te = d, A > m)
766
+ break;
767
+ for (var Y = Math.min(d, A - 2), ie = 0, L = 0; L < Y; ++L) {
768
+ var de = _ - d + L & 32767, Te = f[de], _e = de - Te & 32767;
769
+ _e > ie && (ie = _e, W = de);
770
+ }
771
+ }
772
+ }
773
+ z = W, W = f[z], d += z - W & 32767;
774
+ }
775
+ if (te) {
776
+ N[j++] = 268435456 | Me[X] << 18 | Xe[te];
777
+ var P = Me[X] & 31, Be = Xe[te] & 31;
778
+ C += Le[P] + Ye[Be], ++B[257 + P], ++V[Be], Z = _ + X, ++p;
779
+ } else
780
+ N[j++] = e[_], ++B[e[_]];
781
+ }
782
+ }
783
+ for (_ = Math.max(_, Z); _ < l; ++_)
784
+ N[j++] = e[_], ++B[e[_]];
785
+ s = Ze(e, i, y, N, B, V, C, j, w, _ - w, s), y || (n.r = s & 7 | i[s / 8 | 0] << 3, s -= 7, n.h = v, n.p = f, n.i = _, n.w = Z);
786
+ } else {
787
+ for (var _ = n.w || 0; _ < l + y; _ += 65535) {
788
+ var De = _ + 65535;
789
+ De >= l && (i[s / 8 | 0] = y, De = l), s = dt(i, s + 1, e.subarray(_, De));
790
+ }
791
+ n.i = l;
792
+ }
793
+ return it(u, 0, o + st(s) + a);
794
+ }, pr = /* @__PURE__ */ function() {
795
+ for (var e = new Int32Array(256), t = 0; t < 256; ++t) {
796
+ for (var r = t, o = 9; --o; )
797
+ r = (r & 1 && -306674912) ^ r >>> 1;
798
+ e[t] = r;
799
+ }
800
+ return e;
801
+ }(), hr = function() {
802
+ var e = -1;
803
+ return {
804
+ p: function(t) {
805
+ for (var r = e, o = 0; o < t.length; ++o)
806
+ r = pr[r & 255 ^ t[o]] ^ r >>> 8;
807
+ e = r;
808
+ },
809
+ d: function() {
810
+ return ~e;
811
+ }
812
+ };
813
+ }, yr = function(e, t, r, o, a) {
814
+ if (!a && (a = { l: 1 }, t.dictionary)) {
815
+ var n = t.dictionary.subarray(-32768), l = new G(n.length + e.length);
816
+ l.set(n), l.set(e, n.length), e = l, a.w = n.length;
817
+ }
818
+ return vr(e, t.level == null ? 6 : t.level, t.mem == null ? a.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(e.length))) * 1.5) : 20 : 12 + t.mem, r, o, a);
819
+ }, ct = function(e, t) {
820
+ var r = {};
821
+ for (var o in e)
822
+ r[o] = e[o];
823
+ for (var o in t)
824
+ r[o] = t[o];
825
+ return r;
826
+ }, H = function(e, t, r) {
827
+ for (; r; ++t)
828
+ e[t] = r, r >>>= 8;
829
+ };
830
+ function gr(e, t) {
831
+ return yr(e, t || {}, 0, 0);
832
+ }
833
+ var ft = function(e, t, r, o) {
834
+ for (var a in e) {
835
+ var n = e[a], l = t + a, u = o;
836
+ Array.isArray(n) && (u = ct(o, n[1]), n = n[0]), ArrayBuffer.isView(n) ? r[l] = [n, u] : (r[l += "/"] = [new G(0), u], ft(n, l, r, o));
837
+ }
838
+ }, Je = typeof TextEncoder < "u" && /* @__PURE__ */ new TextEncoder(), xr = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), _r = 0;
839
+ try {
840
+ xr.decode(ut, { stream: !0 }), _r = 1;
841
+ } catch {
842
+ }
843
+ function we(e, t) {
844
+ var r;
845
+ if (Je)
846
+ return Je.encode(e);
847
+ for (var o = e.length, a = new G(e.length + (e.length >> 1)), n = 0, l = function(y) {
848
+ a[n++] = y;
849
+ }, r = 0; r < o; ++r) {
850
+ if (n + 5 > a.length) {
851
+ var u = new G(n + 8 + (o - r << 1));
852
+ u.set(a), a = u;
853
+ }
854
+ var i = e.charCodeAt(r);
855
+ i < 128 || t ? l(i) : i < 2048 ? (l(192 | i >> 6), l(128 | i & 63)) : i > 55295 && i < 57344 ? (i = 65536 + (i & 1047552) | e.charCodeAt(++r) & 1023, l(240 | i >> 18), l(128 | i >> 12 & 63), l(128 | i >> 6 & 63), l(128 | i & 63)) : (l(224 | i >> 12), l(128 | i >> 6 & 63), l(128 | i & 63));
856
+ }
857
+ return it(a, 0, n);
858
+ }
859
+ var Ue = function(e) {
860
+ var t = 0;
861
+ if (e)
862
+ for (var r in e) {
863
+ var o = e[r].length;
864
+ o > 65535 && Ie(9), t += o + 4;
865
+ }
866
+ return t;
867
+ }, et = function(e, t, r, o, a, n, l, u) {
868
+ var i = o.length, y = r.extra, s = u && u.length, h = Ue(y);
869
+ H(e, t, l != null ? 33639248 : 67324752), t += 4, l != null && (e[t++] = 20, e[t++] = r.os), e[t] = 20, t += 2, e[t++] = r.flag << 1 | (n < 0 && 8), e[t++] = a && 8, e[t++] = r.compression & 255, e[t++] = r.compression >> 8;
870
+ var I = new Date(r.mtime == null ? Date.now() : r.mtime), g = I.getFullYear() - 1980;
871
+ if ((g < 0 || g > 119) && Ie(10), H(e, t, g << 25 | I.getMonth() + 1 << 21 | I.getDate() << 16 | I.getHours() << 11 | I.getMinutes() << 5 | I.getSeconds() >> 1), t += 4, n != -1 && (H(e, t, r.crc), H(e, t + 4, n < 0 ? -n - 2 : n), H(e, t + 8, r.size)), H(e, t + 12, i), H(e, t + 14, h), t += 16, l != null && (H(e, t, s), H(e, t + 6, r.attrs), H(e, t + 10, l), t += 14), e.set(o, t), t += i, h)
872
+ for (var b in y) {
873
+ var f = y[b], v = f.length;
874
+ H(e, t, +b), H(e, t + 2, v), e.set(f, t + 4), t += 4 + v;
875
+ }
876
+ return s && (e.set(u, t), t += s), t;
877
+ }, Cr = function(e, t, r, o, a) {
878
+ H(e, t, 101010256), H(e, t + 8, r), H(e, t + 10, r), H(e, t + 12, o), H(e, t + 16, a);
879
+ };
880
+ function br(e, t) {
881
+ t || (t = {});
882
+ var r = {}, o = [];
883
+ ft(e, "", r, t);
884
+ var a = 0, n = 0;
885
+ for (var l in r) {
886
+ var u = r[l], i = u[0], y = u[1], s = y.level == 0 ? 0 : 8, h = we(l), I = h.length, g = y.comment, b = g && we(g), f = b && b.length, v = Ue(y.extra);
887
+ I > 65535 && Ie(11);
888
+ var D = s ? gr(i, y) : i, E = D.length, F = hr();
889
+ F.p(i), o.push(ct(y, {
890
+ size: i.length,
891
+ crc: F.d(),
892
+ c: D,
893
+ f: h,
894
+ m: b,
895
+ u: I != l.length || b && g.length != f,
896
+ o: a,
897
+ compression: s
898
+ })), a += 30 + I + v + E, n += 76 + 2 * (I + v) + (f || 0) + E;
899
+ }
900
+ for (var N = new G(n + 22), B = a, V = n - a, p = 0; p < o.length; ++p) {
901
+ var h = o[p];
902
+ et(N, h.o, h, h.f, h.u, h.c.length);
903
+ var C = 30 + h.f.length + Ue(h.extra);
904
+ N.set(h.c, h.o + C), et(N, a, h, h.f, h.u, h.c.length, h.o, h.m), a += 16 + C + (h.m ? h.m.length : 0);
905
+ }
906
+ return Cr(N, a, o.length, V, B), N;
907
+ }
908
+ function wr(e) {
909
+ return e ? ee(e).format("YYYY-MM-DD HH:mm:ss") : null;
910
+ }
911
+ const Ee = [
912
+ {
913
+ header: "MAIN_ORDER_ID",
914
+ definition: `Unique identifier for every food court order ID
915
+ When a customer makes a single order from 3 stalls, there will be 1 main food court order ID.`,
916
+ value: (e) => e.mainOrderId
917
+ },
918
+ {
919
+ header: "SUB_ORDER_ID",
920
+ definition: `Unique identifier for every order created when the main order gets split and distributed to individual stalls.
921
+ If there are 3 stalls, there will be 3 order IDs.`,
922
+ value: (e) => e.subOrderId
923
+ },
924
+ {
925
+ header: "SHORT_ORDER_ID",
926
+ definition: `Customer-facing order ID for food collection, common across all stalls under the same main food court order ID. This is NOT unique and will be recycled.
927
+ Prefix with FC.`,
928
+ value: (e) => e.shortOrderId
929
+ },
930
+ {
931
+ header: "INVOICE_NO",
932
+ definition: "Invoice No issued by the food court owner for the main food court order",
933
+ value: (e) => e.invoiceNo
934
+ },
935
+ {
936
+ header: "SUB_INVOICE_NO",
937
+ definition: "Invoice No issued by individual stalls for the sub food court orders",
938
+ value: (e) => e.subInvoiceNo
939
+ },
940
+ {
941
+ header: "BILL_ID",
942
+ definition: "Bill ID of the stall order, as printed on the stall receipt",
943
+ value: (e) => e.billId
944
+ },
945
+ {
946
+ header: "TRANSACTION_ID",
947
+ definition: "Payment identifier for the transaction",
948
+ value: (e) => e.transactionId
949
+ },
950
+ {
951
+ header: "GATEWAY_ID",
952
+ definition: "Identifier of the payment gateway used",
953
+ value: (e) => e.gatewayId
954
+ },
955
+ {
956
+ header: "GATEWAY_NAME",
957
+ definition: "Name of the payment gateway used",
958
+ value: (e) => e.gatewayName
959
+ },
960
+ {
961
+ header: "PAYMENT_METHOD",
962
+ definition: "Payment method used by the customer",
963
+ value: (e) => e.paymentMethod
964
+ },
965
+ {
966
+ header: "ORDER_CHANNEL",
967
+ definition: "For identification of whether customer is ordering via kiosk or table QR",
968
+ value: (e) => e.orderChannel
969
+ },
970
+ {
971
+ header: "TRANSACTION_TIMESTAMP",
972
+ definition: "Payment completion timestamp",
973
+ value: (e) => wr(e.transactionTimestamp)
974
+ },
975
+ { header: "ORDER_STATUS", definition: "Status of the order", value: (e) => e.orderStatus },
976
+ {
977
+ header: "PAYMENT_STATUS",
978
+ definition: "Payment status of the order",
979
+ value: (e) => e.paymentStatus
980
+ },
981
+ { header: "CURRENCY", definition: "Currency of the transaction", value: (e) => e.currency },
982
+ // GROSS_AMOUNT − DISCOUNT_APPLIED + SST + SERVICE_CHARGE + ROUNDING = NETT_SALES_AMOUNT, read left
983
+ // to right (Food Court Operations, KDI-4942); the two discount splits follow their total.
984
+ {
985
+ header: "GROSS_AMOUNT",
986
+ definition: "Gross amount for the individual stall order, before discounts",
987
+ value: (e) => e.grossAmount
988
+ },
989
+ {
990
+ header: "DISCOUNT_APPLIED",
991
+ definition: "Total discount applied for a particular stall order ID (ITEM_DISCOUNT + BILL_DISCOUNT)",
992
+ value: (e) => e.discountApplied
993
+ },
994
+ {
995
+ header: "ITEM_DISCOUNT",
996
+ definition: "Item-level discount applied for a particular stall order ID",
997
+ value: (e) => e.itemDiscount
998
+ },
999
+ {
1000
+ header: "BILL_DISCOUNT",
1001
+ definition: "Bill-level discount applied for a particular stall order ID",
1002
+ value: (e) => e.billDiscount
1003
+ },
1004
+ { header: "SST", definition: "SST for the individual stall order", value: (e) => e.sst },
1005
+ {
1006
+ header: "SERVICE_CHARGE",
1007
+ definition: "Service Charge for the individual stall order",
1008
+ value: (e) => e.serviceCharge
1009
+ },
1010
+ {
1011
+ header: "ROUNDING",
1012
+ definition: "Rounding for the individual stall order",
1013
+ value: (e) => e.rounding
1014
+ },
1015
+ {
1016
+ header: "NETT_SALES_AMOUNT",
1017
+ definition: "Amount paid by customer for the individual stall order, including all applicable taxes and service charges",
1018
+ value: (e) => e.nettSalesAmount
1019
+ },
1020
+ {
1021
+ header: "TOTAL_SALES_AMOUNT",
1022
+ definition: "Grand amount paid by customer for all stalls, including all applicable taxes and service charges",
1023
+ value: (e) => e.totalSalesAmount
1024
+ },
1025
+ { header: "FC_ID", definition: "Unique identifier of the food court", value: (e) => e.fcId },
1026
+ { header: "FC_NAME", definition: "Name of the food court", value: (e) => e.fcName },
1027
+ {
1028
+ header: "RESTAURANT_ID",
1029
+ definition: "Unique identifier of the restaurant or stall",
1030
+ value: (e) => e.restaurantId
1031
+ },
1032
+ {
1033
+ header: "RESTAURANT_NAME",
1034
+ definition: "Name of the restaurant or stall",
1035
+ value: (e) => e.restaurantName
1036
+ },
1037
+ { header: "FEE", definition: "MDR charged for the transaction", value: (e) => e.fee },
1038
+ {
1039
+ header: "SETTLEMENT_AMOUNT",
1040
+ definition: "Amount settled by FeedMe after deducting fees",
1041
+ value: (e) => e.settlementAmount
1042
+ },
1043
+ {
1044
+ header: "SETTLEMENT_ID",
1045
+ definition: "Identifier for a batch settlement to the food court owner. Empty if the settlement ID has yet to be generated.",
1046
+ value: (e) => e.settlementId
1047
+ }
1048
+ ];
1049
+ function Ir(e) {
1050
+ return [
1051
+ Ee.map((t) => t.header),
1052
+ Ee.map((t) => t.definition),
1053
+ ...e.map((t) => Ee.map((r) => r.value(t)))
1054
+ ];
1055
+ }
1056
+ function Tr(e, t, r = ee()) {
1057
+ const o = (e ?? "").replace(/[\\/:*?"<>|]/g, "").trim().replace(/\s+/g, "_") || "Food_Court", a = t.startDate ? ee(t.startDate) : r, n = t.endDate ? ee(t.endDate) : a;
1058
+ return `${o}_${a.format("YYYYMMDD")}-${n.format("YYYYMMDD")}.xlsx`;
1059
+ }
1060
+ function Dr(e) {
1061
+ let t = e + 1, r = "";
1062
+ for (; t > 0; ) {
1063
+ const o = (t - 1) % 26;
1064
+ r = String.fromCharCode(65 + o) + r, t = Math.floor((t - 1) / 26);
1065
+ }
1066
+ return r;
1067
+ }
1068
+ function Sr(e) {
1069
+ return e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDFFF]/gu, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1070
+ }
1071
+ function kr(e) {
1072
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetData>${e.map((r, o) => {
1073
+ const a = (l) => `${Dr(l)}${o + 1}`, n = r.map((l, u) => l == null || l === "" ? "" : typeof l == "number" && Number.isFinite(l) ? `<c r="${a(u)}"><v>${l}</v></c>` : `<c r="${a(u)}" t="inlineStr"><is><t xml:space="preserve">${Sr(String(l))}</t></is></c>`).join("");
1074
+ return `<row r="${o + 1}">${n}</row>`;
1075
+ }).join("")}</sheetData></worksheet>`;
1076
+ }
1077
+ const Nr = {
1078
+ "[Content_Types].xml": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>',
1079
+ "_rels/.rels": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',
1080
+ "xl/workbook.xml": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="Orders" sheetId="1" r:id="rId1"/></sheets></workbook>',
1081
+ "xl/_rels/workbook.xml.rels": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>',
1082
+ // The one default style. Optional in the spec, but some readers expect the part.
1083
+ "xl/styles.xml": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fonts count="1"><font><sz val="11"/><name val="Calibri"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>'
1084
+ };
1085
+ function Er(e) {
1086
+ const t = {};
1087
+ for (const [r, o] of Object.entries(Nr)) t[r] = we(o);
1088
+ return t["xl/worksheets/sheet1.xml"] = we(kr(Ir(e))), br(t, { level: 6 });
1089
+ }
1090
+ function Fr(e, t) {
1091
+ const r = new Blob([Er(t)], {
1092
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
1093
+ }), o = URL.createObjectURL(r), a = document.createElement("a");
1094
+ a.href = o, a.download = e, document.body.appendChild(a), a.click(), a.remove(), setTimeout(() => URL.revokeObjectURL(o), 3e4);
1095
+ }
1096
+ const Ar = { class: "py-[1.5rem] flex flex-col gap-1" }, Mr = { class: "px-[1.5rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Or = {
1097
+ key: 0,
1098
+ class: "px-[1.5rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1099
+ }, Rr = {
1100
+ key: 1,
1101
+ class: "px-[1.5rem] flex flex-col gap-12"
1102
+ }, Ur = { class: "flex items-center gap-3 flex-wrap" }, $r = { class: "flex items-start gap-3 flex-wrap" }, Pr = { class: "p-16 flex flex-col gap-12" }, Vr = { class: "fm-typo-en-body-lg-600" }, Lr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yr = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, Br = {
1103
+ key: 1,
1104
+ class: "py-4 flex flex-col gap-3 items-start"
1105
+ }, jr = { class: "fm-typo-en-body-md-400" }, Hr = {
1106
+ key: 1,
1107
+ class: "text-center py-8 text-fm-color-typo-tertiary fm-typo-en-body-md-400"
1108
+ }, Kr = { class: "flex items-center justify-between gap-3 flex-wrap pb-6" }, zr = { class: "flex items-center gap-2" }, Gr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qr = { class: "flex items-center gap-2" }, Wr = { class: "fm-typo-en-body-md-400" }, tt = "Food Court Order Detail View", Xr = "Food Court Orders View", io = /* @__PURE__ */ $e({
1109
+ __name: "FoodCourtOrdersView",
1110
+ setup(e) {
1111
+ const { t } = Pe(), { showError: r, showWarning: o } = rt(), a = xt(), n = pt(), l = ht(), u = ee().format("YYYY-MM-DD"), i = U({
1112
+ startDate: u,
1113
+ endDate: u
1114
+ }), y = U([]), s = U([]), h = U(!1), I = U(""), g = U("");
1115
+ let b;
1116
+ me(I, (d) => {
1117
+ clearTimeout(b), b = setTimeout(() => g.value = d.trim(), 400);
1118
+ });
1119
+ const f = U(0), v = U(25), D = U([]), E = U(!1), F = U(!1), N = U(!1), B = ue(
1120
+ () => ke.map((d) => ({
1121
+ label: t(ve[d].labelKey),
1122
+ value: d
1123
+ }))
1124
+ ), V = U([]), p = ue(
1125
+ () => V.value.map(({ member: d, restaurant: m }) => {
1126
+ var k, R;
1127
+ return {
1128
+ label: Ke({
1129
+ restaurantId: d.restaurantId,
1130
+ unitNo: ((k = d.stall) == null ? void 0 : k.unitNo) || null,
1131
+ name: ((R = d.stall) == null ? void 0 : R.displayName) || (m == null ? void 0 : m.name) || null
1132
+ }),
1133
+ value: d.restaurantId
1134
+ };
1135
+ }).sort((d, m) => d.label.localeCompare(m.label, void 0, { numeric: !0 }))
1136
+ );
1137
+ let C = null;
1138
+ async function _() {
1139
+ const d = a.value;
1140
+ if (!(!d || C === d))
1141
+ try {
1142
+ const m = await _t.listMembers(d);
1143
+ if (d !== a.value) return;
1144
+ V.value = m, C = d;
1145
+ } catch {
1146
+ }
1147
+ }
1148
+ me(a, () => {
1149
+ V.value = [], C = null;
1150
+ });
1151
+ const j = [10, 25, 50, 100].map((d) => ({ label: String(d), value: d })), Z = ue(() => {
1152
+ const { startDate: d, endDate: m } = i.value, k = d ? ee(d).format("DD MMM YYYY") : "", R = m ? ee(m).format("DD MMM YYYY") : k;
1153
+ return k === R ? k : `${k} - ${R}`;
1154
+ });
1155
+ let w = 0;
1156
+ async function J() {
1157
+ const d = a.value, m = ++w;
1158
+ if (N.value = !1, !d) {
1159
+ D.value = [], E.value = !1;
1160
+ return;
1161
+ }
1162
+ F.value = !0;
1163
+ try {
1164
+ const k = await Fe.listOrders(d, {
1165
+ ...Ge(i.value),
1166
+ status: y.value.length ? y.value : ke,
1167
+ page: f.value,
1168
+ limit: v.value,
1169
+ restaurantId: s.value,
1170
+ search: g.value
1171
+ });
1172
+ if (m !== w) return;
1173
+ D.value = k.items, E.value = k.hasMore, _();
1174
+ } catch (k) {
1175
+ if (m !== w) return;
1176
+ D.value = [], E.value = !1, N.value = !0;
1177
+ const R = k instanceof He ? k.code : void 0;
1178
+ r(R === "SEARCH_RANGE_TOO_LONG" ? t("order.foodCourt.orders.searchRangeTooLong", { days: 31 }) : Ae(k));
1179
+ } finally {
1180
+ m === w && (F.value = !1);
1181
+ }
1182
+ }
1183
+ const z = U(!1);
1184
+ async function W() {
1185
+ var A;
1186
+ const d = a.value;
1187
+ if (!d || z.value) return;
1188
+ z.value = !0;
1189
+ const m = { ...i.value }, k = y.value.length ? [...y.value] : ke, R = [...s.value];
1190
+ try {
1191
+ const Y = await Fe.exportOrders(d, {
1192
+ ...Ge(m),
1193
+ status: k,
1194
+ restaurantId: R
1195
+ });
1196
+ if (!Y.rows.length) {
1197
+ o(t("order.foodCourt.orders.exportEmpty"));
1198
+ return;
1199
+ }
1200
+ Fr(Tr(Y.courtName, m), Y.rows), (A = Y.unreadableStalls) != null && A.length && o(t("order.foodCourt.orders.exportIncomplete", { count: Y.unreadableStalls.length }));
1201
+ } catch (Y) {
1202
+ const ie = Y instanceof He ? Y.code : void 0;
1203
+ r(ie === "EXPORT_RANGE_TOO_LONG" ? t("order.foodCourt.orders.exportRangeTooLong", { days: 31 }) : ie === "EXPORT_TOO_MANY_ROWS" ? t("order.foodCourt.orders.exportTooManyRows", { rows: "50,000" }) : Ae(Y));
1204
+ } finally {
1205
+ z.value = !1;
1206
+ }
1207
+ }
1208
+ me(
1209
+ [a, i, y, s, g, v],
1210
+ () => {
1211
+ f.value === 0 ? J() : f.value = 0;
1212
+ },
1213
+ { deep: !0 }
1214
+ ), me(f, J), J();
1215
+ const q = ue(
1216
+ () => n.name === tt && typeof n.params.orderId == "string" ? n.params.orderId : null
1217
+ );
1218
+ function L(d) {
1219
+ l.push({ name: tt, params: { orderId: d._id }, query: n.query });
1220
+ }
1221
+ function X(d) {
1222
+ L(d.original);
1223
+ }
1224
+ function te() {
1225
+ q.value && l.push({ name: Xr, query: n.query });
1226
+ }
1227
+ const pe = ue(() => [
1228
+ {
1229
+ id: "orderNumber",
1230
+ header: () => t("order.foodCourt.orders.columnOrderNo"),
1231
+ cell: ({ row: d }) => d.original.orderNumber ? `#${d.original.orderNumber}` : "-",
1232
+ enableSorting: !1,
1233
+ meta: { width: "120px" }
1234
+ },
1235
+ {
1236
+ id: "createdAt",
1237
+ header: () => t("order.foodCourt.orders.columnDate"),
1238
+ cell: ({ row: d }) => ot(d.original.paidAt ?? d.original.createdAt),
1239
+ enableSorting: !1
1240
+ },
1241
+ {
1242
+ id: "stalls",
1243
+ header: () => t("order.foodCourt.orders.columnStalls"),
1244
+ cell: ({ row: d }) => {
1245
+ const m = d.original.stalls;
1246
+ if (!m) return String(d.original.stallCount);
1247
+ if (!m.length) return "-";
1248
+ const k = m.map(Ke);
1249
+ return Ce("div", { class: "flex flex-col", title: k.join(`
1250
+ `) }, [
1251
+ ...k.slice(0, 2).map((R) => Ce("span", { class: "truncate" }, R)),
1252
+ k.length > 2 ? Ce(
1253
+ "span",
1254
+ { class: "text-fm-color-typo-tertiary" },
1255
+ t("order.foodCourt.orders.moreStalls", { count: k.length - 2 })
1256
+ ) : null
1257
+ ]);
1258
+ },
1259
+ enableSorting: !1,
1260
+ meta: { width: "280px" }
1261
+ },
1262
+ {
1263
+ id: "paymentMethod",
1264
+ header: () => t("order.foodCourt.orders.columnPayment"),
1265
+ cell: ({ row: d }) => d.original.paymentMethod || "-",
1266
+ enableSorting: !1
1267
+ },
1268
+ {
1269
+ id: "total",
1270
+ header: () => t("order.foodCourt.orders.columnTotal"),
1271
+ cell: ({ row: d }) => fe(d.original.total),
1272
+ enableSorting: !1
1273
+ },
1274
+ {
1275
+ id: "status",
1276
+ header: () => t("order.foodCourt.orders.columnStatus"),
1277
+ cell: ({ row: d }) => {
1278
+ const m = ve[d.original.status];
1279
+ return m ? Ce(gt.FmChip, { variant: m.variant, label: t(m.labelKey) }) : "-";
1280
+ },
1281
+ enableSorting: !1
1282
+ }
1283
+ ]);
1284
+ return (d, m) => {
1285
+ const k = K("FmPageHead"), R = K("FmSearch"), A = K("FmButton"), Y = K("FmChip"), ie = K("FmDateRangePicker"), de = K("FmSelect"), Te = K("FmCard"), _e = K("FmTable");
1286
+ return T(), M(ne, null, [
1287
+ x("div", Ar, [
1288
+ $(k, {
1289
+ title: c(t)("order.foodCourt.orders.title"),
1290
+ "line-height": 1.7
1291
+ }, null, 8, ["title"]),
1292
+ x("span", Mr, S(c(t)("order.foodCourt.orders.subtitle")), 1)
1293
+ ]),
1294
+ c(a) ? (T(), M("div", Rr, [
1295
+ x("div", Ur, [
1296
+ $(R, {
1297
+ modelValue: I.value,
1298
+ "onUpdate:modelValue": m[0] || (m[0] = (P) => I.value = P),
1299
+ class: "w-[360px]",
1300
+ placeholder: c(t)("order.foodCourt.orders.searchPlaceholder")
1301
+ }, null, 8, ["modelValue", "placeholder"]),
1302
+ $(A, {
1303
+ class: "ml-auto",
1304
+ variant: "tertiary",
1305
+ "prepend-icon": "info",
1306
+ label: c(t)("order.foodCourt.orders.statusGuide"),
1307
+ onClick: m[1] || (m[1] = (P) => h.value = !h.value)
1308
+ }, null, 8, ["label"]),
1309
+ $(A, {
1310
+ variant: "secondary",
1311
+ "prepend-icon": "download",
1312
+ label: c(t)("order.foodCourt.orders.export"),
1313
+ loading: z.value,
1314
+ onClick: W
1315
+ }, null, 8, ["label", "loading"])
1316
+ ]),
1317
+ x("div", $r, [
1318
+ $(ie, {
1319
+ modelValue: i.value,
1320
+ "onUpdate:modelValue": m[2] || (m[2] = (P) => i.value = P),
1321
+ "show-predefined-range": ""
1322
+ }, {
1323
+ "trigger-button": oe(() => [
1324
+ $(Y, {
1325
+ label: Z.value,
1326
+ icon: "calendar_today"
1327
+ }, null, 8, ["label"])
1328
+ ]),
1329
+ _: 1
1330
+ }, 8, ["modelValue"]),
1331
+ $(de, {
1332
+ modelValue: y.value,
1333
+ "onUpdate:modelValue": m[3] || (m[3] = (P) => y.value = P),
1334
+ class: "min-w-[240px]",
1335
+ multiselect: "",
1336
+ items: B.value,
1337
+ placeholder: c(t)("order.foodCourt.orders.allStatuses")
1338
+ }, null, 8, ["modelValue", "items", "placeholder"]),
1339
+ $(de, {
1340
+ modelValue: s.value,
1341
+ "onUpdate:modelValue": m[4] || (m[4] = (P) => s.value = P),
1342
+ class: "min-w-[280px] max-w-[420px]",
1343
+ multiselect: "",
1344
+ items: p.value,
1345
+ placeholder: c(t)("order.foodCourt.orders.allStalls")
1346
+ }, null, 8, ["modelValue", "items", "placeholder"])
1347
+ ]),
1348
+ h.value ? (T(), le(Te, {
1349
+ key: 0,
1350
+ variant: "outlined"
1351
+ }, {
1352
+ default: oe(() => [
1353
+ x("div", Pr, [
1354
+ x("span", Vr, S(c(t)("order.foodCourt.orders.statusGuide")), 1),
1355
+ (T(!0), M(ne, null, ge(c(bt), (P) => (T(), M("div", {
1356
+ key: P.status,
1357
+ class: "flex items-start gap-12"
1358
+ }, [
1359
+ $(Y, {
1360
+ class: "shrink-0 min-w-[140px]",
1361
+ variant: c(ve)[P.status].variant,
1362
+ label: c(t)(c(ve)[P.status].labelKey)
1363
+ }, null, 8, ["variant", "label"]),
1364
+ x("span", Lr, S(c(t)(P.helpKey)), 1)
1365
+ ]))), 128)),
1366
+ x("span", Yr, S(c(t)("order.foodCourt.orders.statusGuideNote")), 1)
1367
+ ])
1368
+ ]),
1369
+ _: 1
1370
+ })) : re("", !0),
1371
+ N.value ? (T(), M("div", Br, [
1372
+ x("span", jr, S(c(t)("order.foodCourt.orders.loadFailed")), 1),
1373
+ $(A, {
1374
+ variant: "secondary",
1375
+ label: c(t)("order.foodCourt.retry"),
1376
+ onClick: J
1377
+ }, null, 8, ["label"])
1378
+ ])) : (T(), M(ne, { key: 2 }, [
1379
+ F.value || D.value.length ? (T(), le(_e, {
1380
+ key: 0,
1381
+ "row-data": D.value,
1382
+ "column-defs": pe.value,
1383
+ loading: F.value,
1384
+ "hide-footer": !0,
1385
+ "page-size": v.value,
1386
+ "shrink-at": !1,
1387
+ class: "w-full",
1388
+ onRowClick: X
1389
+ }, null, 8, ["row-data", "column-defs", "loading", "page-size"])) : (T(), M("div", Hr, S(g.value ? c(t)("order.foodCourt.orders.noMatch", { search: g.value }) : c(t)("order.foodCourt.orders.empty")), 1)),
1390
+ x("div", Kr, [
1391
+ x("div", zr, [
1392
+ x("span", Gr, S(c(t)("order.foodCourt.orders.perPage")), 1),
1393
+ $(de, {
1394
+ modelValue: v.value,
1395
+ "onUpdate:modelValue": m[5] || (m[5] = (P) => v.value = P),
1396
+ class: "w-[96px]",
1397
+ items: c(j)
1398
+ }, null, 8, ["modelValue", "items"])
1399
+ ]),
1400
+ x("div", qr, [
1401
+ $(A, {
1402
+ variant: "tertiary",
1403
+ "prepend-icon": "chevron_left",
1404
+ label: c(t)("order.foodCourt.orders.previous"),
1405
+ disabled: F.value || f.value === 0,
1406
+ onClick: m[6] || (m[6] = (P) => f.value -= 1)
1407
+ }, null, 8, ["label", "disabled"]),
1408
+ x("span", Wr, S(c(t)("order.foodCourt.orders.page", { page: f.value + 1 })), 1),
1409
+ $(A, {
1410
+ variant: "tertiary",
1411
+ "append-icon": "chevron_right",
1412
+ label: c(t)("order.foodCourt.orders.next"),
1413
+ disabled: F.value || !E.value,
1414
+ onClick: m[7] || (m[7] = (P) => f.value += 1)
1415
+ }, null, 8, ["label", "disabled"])
1416
+ ])
1417
+ ])
1418
+ ], 64))
1419
+ ])) : (T(), M("div", Or, S(c(t)("order.foodCourt.noFoodCourtSelected")), 1)),
1420
+ c(a) ? (T(), le(sr, {
1421
+ key: 2,
1422
+ "model-value": !!q.value,
1423
+ "food-court-id": c(a),
1424
+ "order-id": q.value,
1425
+ "onUpdate:modelValue": m[8] || (m[8] = (P) => !P && te())
1426
+ }, null, 8, ["model-value", "food-court-id", "order-id"])) : re("", !0)
1427
+ ], 64);
1428
+ };
1429
+ }
1430
+ });
1431
+ export {
1432
+ io as default
1433
+ };