@feedmepos/mf-menu 0.32.67 → 0.32.68

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 (73) hide show
  1. package/dist/{App-D_2YPsjs.js → App-C_wzmb6P.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CXrcvUd0.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DJ-Yyl-y.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CjJbz-O2.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-DHTKM2Rk.js} +3 -3
  4. package/dist/{Catalog-CU71hh7s.js → Catalog-Brdx3vwv.js} +6 -6
  5. package/dist/{Category-DCwub7ud.js → Category-Clan4Fwx.js} +4 -4
  6. package/dist/{Category-C4Q-L3Yi.js → Category-Kr7zDqaR.js} +4 -4
  7. package/dist/{CookingGuide-C7NaktZm.js → CookingGuide-D8K1T0Wk.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DtilpqIC.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DDAz6tmK.js} +1 -1
  9. package/dist/{Group-xFpNJyeL.js → Group-DkEH1W-l.js} +1 -1
  10. package/dist/{Group-CkrDqz-T.js → Group-DyOCkcWz.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-DE-G70ge.js → Group.vue_vue_type_script_setup_true_lang-CMvaZV7r.js} +7 -7
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-k128rAg7.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D0dxZUHg.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BIU52Vn_.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BCKgLffo.js} +212 -212
  14. package/dist/{Ingredient-CPwli_hU.js → Ingredient-ele1Xkxq.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-ePTUodR2.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Cd5pXFbz.js} +2 -2
  16. package/dist/{LinkProductSideSheet-nNfalLk5.js → LinkProductSideSheet-BpRT3ZyK.js} +4 -4
  17. package/dist/{MenuSetting-CaH0Jwpr.js → MenuSetting-DlRwd2RR.js} +7 -7
  18. package/dist/{OrderPacing-tKw6IiKL.js → OrderPacing-bAAj3I9B.js} +5 -5
  19. package/dist/{PrintRoute-C5kwNbLp.js → PrintRoute-DeiR2NvQ.js} +5 -5
  20. package/dist/{Product-Bkijtii9.js → Product-VcKOCdv9.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-EbAb7OeV.js → Product.vue_vue_type_script_setup_true_lang-Bz5Rr6Oo.js} +14 -14
  22. package/dist/{ProductInternalTools-DeQRgaM0.js → ProductInternalTools-BnMKscNT.js} +6 -6
  23. package/dist/{Products-DPMui6GK.js → Products-DFyBBzjn.js} +43 -43
  24. package/dist/Publish-hJOLwfsE.js +1565 -0
  25. package/dist/{Recipe-BHrVAyTR.js → Recipe-DFeTDvuk.js} +5 -5
  26. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DEIMshQI.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BX-hs3g7.js} +1 -1
  27. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CLXOUQg9.js → RuleView.vue_vue_type_script_setup_true_lang-D7TpK5fD.js} +340 -340
  28. package/dist/{Scheduler-B9Kq4p5M.js → Scheduler-CacvSBtZ.js} +78 -72
  29. package/dist/{ServingSequence-B2Aw-upP.js → ServingSequence-Dg0-u71Y.js} +3 -3
  30. package/dist/{Setting-DSYnGvjj.js → Setting-BBVrC3ML.js} +5 -5
  31. package/dist/{Subcategory-CKal75fY.js → Subcategory-RhioZvac.js} +6 -6
  32. package/dist/{Takeaway-DjLT1gYN.js → Takeaway-C_Yocsm8.js} +4 -4
  33. package/dist/{Takeaway-Cw5TTOni.js → Takeaway-DyIJ2dAt.js} +1 -1
  34. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-S6t7pYz6.js → Takeaway.vue_vue_type_script_setup_true_lang-iIM7kEEk.js} +5 -5
  35. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-B7Yhp4h2.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-CyhcbrTQ.js} +1 -1
  36. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-PnQkA8fx.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-DQelKdQf.js} +2 -2
  37. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BfLH0-S8.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BN7PkI9l.js} +15 -15
  38. package/dist/{Unit-CvJEOGMo.js → Unit-bu2YYoAr.js} +2 -2
  39. package/dist/{Variant-DWnjN60q.js → Variant-D4HSAKaA.js} +3 -3
  40. package/dist/{_id_-Bu84Ve7O.js → _id_-TNWD2yHG.js} +10 -10
  41. package/dist/{app-0tvJEHUj.js → app-BwvStTgj.js} +1 -1
  42. package/dist/{app-dZVL_rA1.js → app-D8hc9pO3.js} +32 -32
  43. package/dist/app.js +1 -1
  44. package/dist/apps/mf-menu/src/components/feature/publish.d.ts +2 -2
  45. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  46. package/dist/assets/{linked-status-DMV-szyA.js → linked-status-D3zBIZmV.js} +4 -4
  47. package/dist/assets/{menu-export-CzJKI_ET.js → menu-export-DKP_2V0H.js} +4 -4
  48. package/dist/assets/{override-menu-RB3jwvEO.js → override-menu-C_m4eXlt.js} +4 -4
  49. package/dist/assets/{validate-menu-DOu-uzwh.js → validate-menu-DF53PcFi.js} +3 -3
  50. package/dist/{catalog-B2oSduuM.js → catalog-sB0wljWA.js} +1 -1
  51. package/dist/{catalogSetting-C6Mik03T.js → catalogSetting-DnRDwn_7.js} +1 -1
  52. package/dist/{currency-ByYvKCl5.js → currency-CJMH7GL8.js} +1 -1
  53. package/dist/{dayjs.min-BCNrR3Ec.js → dayjs.min-BPMljI-8.js} +2 -2
  54. package/dist/{discardConfirm-L8BYIlMr.js → discardConfirm-DVc_4r3v.js} +1 -1
  55. package/dist/{index-BHFbkGuw.js → index-BuyOfZQk.js} +5 -5
  56. package/dist/{index-BwNMtsmy.js → index-C3-Fsu9G.js} +1 -1
  57. package/dist/{index-yvD73o51.js → index-D02xcA-8.js} +6 -6
  58. package/dist/{index.vue_vue_type_script_setup_true_lang-BfHbH6Pn.js → index.vue_vue_type_script_setup_true_lang-kdkFlB2a.js} +4544 -4544
  59. package/dist/{item-stn12R2q.js → item-4qAhCGxc.js} +19 -19
  60. package/dist/{jszip.min-BqxWwDPE.js → jszip.min-C7GdBMKl.js} +3 -3
  61. package/dist/{linkProducts-Yrb4YuNq.js → linkProducts-Xj0pwao2.js} +4 -4
  62. package/dist/{memberPricing-DDlCH6ho.js → memberPricing-DrnYW8GA.js} +1 -1
  63. package/dist/{menu-D-13zF8j.js → menu-AX8l-jmp.js} +1 -1
  64. package/dist/{menuV2-Cy2ON3fQ.js → menuV2-DyTvIOlq.js} +28 -28
  65. package/dist/{order_pacing-CrqISlaL.js → order_pacing-0tZW1wH_.js} +5 -5
  66. package/dist/{priceTier-BzSDcc7G.js → priceTier-C3S0kEKr.js} +1 -1
  67. package/dist/{rules-BRNrxcD3.js → rules-BrCS7pk7.js} +3 -3
  68. package/dist/scheduler-Dgi_Z-de.js +519 -0
  69. package/dist/{toExcel-DmUuut1S.js → toExcel-BmRSTeYh.js} +2 -2
  70. package/dist/{unit-eBpDTpWL.js → unit-fWmA4WXX.js} +3 -3
  71. package/package.json +3 -3
  72. package/dist/Publish-OZXQ__8_.js +0 -1532
  73. package/dist/scheduler-Csj6ZYJU.js +0 -515
@@ -1,1532 +0,0 @@
1
- import { defineComponent as J, ref as F, computed as D, onMounted as ge, resolveComponent as N, createElementBlock as P, openBlock as k, createVNode as _, createElementVNode as v, toDisplayString as L, unref as p, Fragment as Y, renderList as W, createBlock as G, watch as Ie, withCtx as z, h as T, normalizeClass as _e, createCommentVNode as Q, createTextVNode as Ve, mergeProps as Ke, normalizeStyle as Ye, renderSlot as Ge, withModifiers as le, onUnmounted as qe } from "vue";
2
- import { D as j } from "./dayjs.min-BCNrR3Ec.js";
3
- import { useRouter as He } from "vue-router";
4
- import { O as Je, b as We } from "./app-5fxKLAzS.js";
5
- import { a as Qe, e as Xe, b as Ne, M as Ze, _ as $e, N as E, u as De, d as Fe, F as et } from "./index.vue_vue_type_script_setup_true_lang-BfHbH6Pn.js";
6
- import { useI18n as X, useCoreStore as ye, RestaurantSelector as Ae } from "@feedmepos/mf-common";
7
- import { useSnackbar as Ce, useDialogChild as tt, useProxiedModel as at, useDialog as Re, components as te, FmButtonVariant as Me } from "@feedmepos/ui-library";
8
- import { _ as lt } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
9
- import { _ as st } from "./app-dZVL_rA1.js";
10
- import { a as nt, w as ot } from "./tooltip-B5BiPMx9.js";
11
- import { u as Oe, l as ut } from "./discardConfirm-L8BYIlMr.js";
12
- import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
- function Be(S) {
14
- return S ? j(S).format("DD/MM/YY HH:mm") : "-";
15
- }
16
- function rt(S, g, a) {
17
- const r = (n, f = !1) => {
18
- var h;
19
- return n === void 0 && !f ? "-" : ((h = a.find((y) => y.value === (n || null))) == null ? void 0 : h.label) || "-";
20
- };
21
- return S.map((n) => {
22
- var c;
23
- const f = (c = g.find(({ _id: C }) => C === n._id)) == null ? void 0 : c.posVersion, h = !!f && !!Qe.Pos.canUse({ feature: Xe.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: f }), y = r(n.catalogId);
24
- return {
25
- ...n,
26
- _default: y,
27
- _posTakeaway: n.takeawayCatalog ? r(n.takeawayCatalog) : y,
28
- _additionalCatalogs: (n.additionalCatalogs || []).map((C) => r(C)),
29
- _lastUpdate: Be(n.updatedAt),
30
- _pickup: h ? r(n.pickupCatalog, !0) : "-",
31
- _canUsePickup: h,
32
- _posVersion: f || "-"
33
- };
34
- });
35
- }
36
- const it = {
37
- key: 0,
38
- class: "flex items-center justify-center"
39
- }, dt = {
40
- key: 1,
41
- class: "space-y-16"
42
- }, ct = { class: "text-fm-color-typo-secondary" }, mt = { class: "space-y-4" }, pt = /* @__PURE__ */ J({
43
- __name: "RevertDialog",
44
- props: {
45
- restaurant: {}
46
- },
47
- setup(S) {
48
- const g = S, a = Ce(), { custom: r } = Ne(a), n = F(!1), f = F(null);
49
- async function h() {
50
- await r(
51
- async () => {
52
- var l;
53
- f.value = await Ze.readMenuById(((l = g.restaurant.revertConfig) == null ? void 0 : l._id) || "");
54
- },
55
- { isLoading: n }
56
- );
57
- }
58
- const y = D(() => {
59
- var l;
60
- return [
61
- { label: "Main", value: null },
62
- ...(((l = f.value) == null ? void 0 : l.modules.catalog) || []).map((s) => ({
63
- label: s.name,
64
- value: s._id
65
- }))
66
- ];
67
- }), { t: c } = X(), C = D(() => {
68
- var o;
69
- const l = g.restaurant.revertConfig;
70
- if (!l) return [];
71
- const s = rt(
72
- [
73
- {
74
- ...l,
75
- catalogId: l.catalogId || null
76
- }
77
- ],
78
- ye().restaurants.value,
79
- y.value
80
- )[0];
81
- return [
82
- { label: c("menu.revert.labels.restaurant"), value: g.restaurant.name },
83
- {
84
- label: c("menu.revert.labels.revert_to"),
85
- value: Be((o = f.value) == null ? void 0 : o.updatedAt)
86
- },
87
- { label: c("menu.revert.labels.default"), value: s._default },
88
- { label: c("menu.revert.labels.pos_takeaway"), value: s._posTakeaway },
89
- { label: c("menu.revert.labels.pickup"), value: s._pickup },
90
- {
91
- label: c("menu.revert.labels.additional_catalogs"),
92
- value: s._additionalCatalogs.join(", ")
93
- }
94
- ];
95
- });
96
- ge(async () => h());
97
- const { emitData: e } = tt();
98
- return (l, s) => {
99
- const o = N("FmCircularProgress");
100
- return n.value ? (k(), P("div", it, [
101
- _(o, { size: "lg" })
102
- ])) : (k(), P("div", dt, [
103
- v("div", ct, L(p(c)("menu.revert.description", { name: g.restaurant.name })), 1),
104
- v("div", mt, [
105
- (k(!0), P(Y, null, W(C.value, (i) => (k(), G(nt, {
106
- key: i.label,
107
- name: i.label,
108
- value: i.value || "--"
109
- }, null, 8, ["name", "value"]))), 128))
110
- ])
111
- ]));
112
- };
113
- }
114
- }), ht = {
115
- class: "break-all fm-typo-en-body-lg-400 line-clamp-1"
116
- }, ft = {
117
- class: "flex flex-col"
118
- }, bt = /* @__PURE__ */ J({
119
- __name: "PublishRestaurantSelector",
120
- props: {
121
- restaurants: {
122
- type: Array,
123
- required: !0
124
- }
125
- },
126
- emits: ["update:modelValue"],
127
- setup(S, {
128
- emit: g
129
- }) {
130
- const a = S, r = g, n = F([]), f = D(() => a.restaurants.map((o) => ({
131
- label: o.name,
132
- value: o._id
133
- }))), h = F(""), y = D(() => {
134
- const o = Array.isArray(n.value) ? n.value : [], i = o.map((b) => f.value.find((U) => U.value === b)).filter((b) => b !== void 0);
135
- let d = [];
136
- return h.value ? (d = f.value.filter((b) => b.label.toLowerCase().includes(h.value.toLowerCase()) && !o.includes(b.value)), [...i, ...d]) : (d = f.value.filter((b) => !o.includes(b.value)), [...i, ...d]);
137
- }), c = D(() => n.value.length > 0 && n.value.length === y.value.length), C = D(() => n.value.filter((o) => y.value.some((i) => i.value === o))), e = () => {
138
- const o = n.value.filter((i) => !C.value.includes(i));
139
- c.value === !0 ? l(o) : l(y.value.map((i) => i.value));
140
- }, l = (o) => {
141
- n.value = o;
142
- };
143
- Ie(n, (o) => {
144
- r("update:modelValue", o);
145
- });
146
- function s(o) {
147
- return a.restaurants.filter((i) => o.includes(i._id)).map((i) => i.name);
148
- }
149
- return (o, i) => {
150
- const d = N("FmSearch"), b = N("FmCheckbox"), U = N("FmSelect");
151
- return k(), G(U, {
152
- modelValue: n.value,
153
- "onUpdate:modelValue": i[1] || (i[1] = (A) => n.value = A),
154
- placeholder: "Select Restaurant",
155
- items: y.value,
156
- multiselect: !0,
157
- "hide-chips": !0
158
- }, {
159
- default: z(() => [v("p", ht, L(n.value.length === a.restaurants.length ? "All restaurants" : s(n.value).join(", ")), 1)]),
160
- "menu-wrapper": z(() => [v("div", ft, [_(d, {
161
- class: "py-8",
162
- modelValue: h.value,
163
- "onUpdate:modelValue": i[0] || (i[0] = (A) => h.value = A),
164
- placeholder: "Search Restaurant"
165
- }, null, 8, ["modelValue"]), _(b, {
166
- class: "py-8",
167
- "model-value": c.value,
168
- label: "All restaurants",
169
- value: "1",
170
- indeterminate: n.value.length > 0,
171
- "onUpdate:modelValue": e
172
- }, null, 8, ["model-value", "indeterminate"]), (k(!0), P(Y, null, W(y.value, (A, q) => (k(), P("div", {
173
- key: q
174
- }, [_(b, {
175
- "model-value": n.value,
176
- label: A.label,
177
- value: A.value,
178
- "onUpdate:modelValue": l
179
- }, null, 8, ["model-value", "label", "value"])]))), 128))])]),
180
- _: 1
181
- }, 8, ["modelValue", "items"]);
182
- };
183
- }
184
- }), vt = {
185
- class: "flex pb-16 w-full items-center justify-between gap-8"
186
- }, _t = {
187
- class: "flex-1 min-w-0 max-w-[300px]"
188
- }, gt = {
189
- key: 0
190
- }, yt = {
191
- key: 1,
192
- class: "text-fm-color-neutral-gray-200"
193
- }, Ct = /* @__PURE__ */ J({
194
- __name: "RestaurantPublishDetail",
195
- props: {
196
- restaurantPublishStatus: {
197
- type: Object,
198
- required: !0
199
- },
200
- statusMap: {
201
- type: Object,
202
- required: !0
203
- }
204
- },
205
- setup(S) {
206
- const {
207
- t: g
208
- } = X(), a = S, r = ye(), n = [{
209
- accessorKey: "restaurantName",
210
- header: g("menu.publish.scheduler_publish.restaurant_publish_details.table.column.restaurant"),
211
- cell: (l) => {
212
- const s = l.getValue();
213
- return T("p", {
214
- class: "text-pretty"
215
- }, s);
216
- },
217
- size: 600
218
- }, {
219
- id: "status",
220
- accessorKey: "publishStatus",
221
- header: g("menu.publish.scheduler_publish.restaurant_publish_details.table.column.status"),
222
- cell: ({
223
- row: l
224
- }) => {
225
- const s = l.original.publishStatus, o = Object.values(a.statusMap).find((d) => d.label === s), i = (o == null ? void 0 : o.textColor) ?? "text-fm-color-neutral-gray-300";
226
- return T("p", {
227
- class: `${i}`
228
- }, s);
229
- }
230
- }, {
231
- accessorKey: "publishedAt",
232
- header: g("menu.publish.scheduler_publish.restaurant_publish_details.table.column.published_at"),
233
- cell: ({
234
- row: l
235
- }) => {
236
- const s = l.original.publishedAt;
237
- return T("p", {
238
- class: "whitespace-nowrap"
239
- }, s);
240
- }
241
- }], f = F([]), h = D(() => Object.entries(a.statusMap).map(([l, s]) => ({
242
- label: s.label,
243
- value: l
244
- }))), y = F(null), c = D(() => Object.entries(a.restaurantPublishStatus).filter(([l, s]) => f.value.length === 0 ? !0 : f.value.includes(s.status)).filter(([l, s]) => !y.value || y.value.length === 0 ? !0 : y.value.includes(l)).map(([l, s]) => ({
245
- restaurantName: e(l),
246
- publishStatus: a.statusMap[s.status].label,
247
- publishedAt: s.publishedAt ? j(s.publishedAt).format("YYYY-MM-DD HH:mm:ss") : ""
248
- })).sort((l, s) => l.restaurantName.localeCompare(s.restaurantName))), C = D(() => {
249
- var s, o;
250
- const l = {};
251
- for (const i of r.restaurants.value) {
252
- if (!(i != null && i._id)) continue;
253
- const d = (s = i == null ? void 0 : i.profile) == null ? void 0 : s.code, b = (o = i == null ? void 0 : i.profile) == null ? void 0 : o.name;
254
- l[i._id] = `${d ? d + " - " : ""}${b || "Unknown Restaurant"}`;
255
- }
256
- return l;
257
- });
258
- function e(l) {
259
- return C.value[l] ?? "Unknown Restaurant";
260
- }
261
- return (l, s) => {
262
- const o = N("FmSelect"), i = N("FmTable");
263
- return k(), P(Y, null, [v("div", vt, [v("div", _t, [_(p(Ae), {
264
- multiple: "",
265
- modelValue: y.value,
266
- "onUpdate:modelValue": s[0] || (s[0] = (d) => y.value = d)
267
- }, null, 8, ["modelValue"])]), _(o, {
268
- class: "flex-shrink-0 min-w-[200px]",
269
- modelValue: f.value,
270
- "onUpdate:modelValue": s[1] || (s[1] = (d) => f.value = d),
271
- items: h.value,
272
- multiselect: "",
273
- "hide-chips": ""
274
- }, {
275
- default: z(() => [f.value.length > 0 ? (k(), P("div", gt, L(f.value.map((d) => {
276
- var b;
277
- return (b = a.statusMap[d]) == null ? void 0 : b.label;
278
- }).join(", ")), 1)) : (k(), P("div", yt, L(p(g)("menu.publish.scheduler_publish.restaurant_publish_details.select_publish_status")), 1))]),
279
- _: 1
280
- }, 8, ["modelValue", "items"])]), c.value.length > 0 ? (k(), G(i, {
281
- key: 0,
282
- class: "flex-1 overflow-hidden",
283
- "column-defs": n,
284
- "row-data": c.value,
285
- "page-size": Object.entries(a.restaurantPublishStatus).length,
286
- "hide-footer": "",
287
- "pin-header-row": ""
288
- }, null, 8, ["row-data", "page-size"])) : (k(), G($e, {
289
- key: 1,
290
- title: p(g)("menu.publish.scheduler_publish.restaurant_publish_details.no_publish_status"),
291
- subtitle: ""
292
- }, null, 8, ["title"]))], 64);
293
- };
294
- }
295
- }), kt = { class: "fm-calendar__name-row fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, wt = ["id"], xt = {
296
- key: 0,
297
- class: "fm-calendar__cell__button--today"
298
- }, St = ["onClick", "onMouseover"], Vt = /* @__PURE__ */ J({
299
- __name: "FmCalendar",
300
- props: {
301
- days: {},
302
- dayCellClass: { type: [Object, Function], default: void 0 },
303
- onDayClick: {},
304
- onCellMouseOver: { type: Function, default: void 0 },
305
- cellSize: { default: "md" }
306
- },
307
- setup(S) {
308
- const { t: g } = X(), a = () => [
309
- g("menu.publish.scheduler.calender.day.sun"),
310
- g("menu.publish.scheduler.calender.day.mon"),
311
- g("menu.publish.scheduler.calender.day.tue"),
312
- g("menu.publish.scheduler.calender.day.wed"),
313
- g("menu.publish.scheduler.calender.day.thu"),
314
- g("menu.publish.scheduler.calender.day.fri"),
315
- g("menu.publish.scheduler.calender.day.sat")
316
- ], r = j(), n = (h, y) => typeof h == "function" ? h(...y) : h, f = (h, y) => {
317
- if (!y) return;
318
- const c = {
319
- "fm-calendar__cell--selected": !1,
320
- "fm-calendar__cell--selected-start": !1,
321
- "fm-calendar__cell--selected-end": !1,
322
- "fm-calendar__cell--selected-between": !1
323
- };
324
- let C;
325
- if (typeof y == "function") {
326
- const { status: e, className: l } = y(h);
327
- e && (c["fm-calendar__cell--selected"] = e.isSelected ?? !1, c["fm-calendar__cell--selected-start"] = e.isStart ?? !1, c["fm-calendar__cell--selected-end"] = e.isEnd ?? !1, c["fm-calendar__cell--selected-between"] = e.isBetween ?? !1), C = l ?? "";
328
- } else {
329
- const { status: e, className: l } = y;
330
- e && (c["fm-calendar__cell--selected"] = n(e.isSelected, [h]) ?? !1, c["fm-calendar__cell--selected-start"] = n(e.isStart, [h]) ?? !1, c["fm-calendar__cell--selected-end"] = n(e.isEnd, [h]) ?? !1, c["fm-calendar__cell--selected-between"] = n(e.isBetween, [h]) ?? !1), C = n(l, [h]) ?? "";
331
- }
332
- return [c, C];
333
- };
334
- return (h, y) => (k(), P("div", null, [
335
- v("div", kt, [
336
- (k(!0), P(Y, null, W(a(), (c) => (k(), P("div", {
337
- key: c,
338
- class: _e(["fm-calendar__cell", `fm-calendar__cell__${h.cellSize}`])
339
- }, L(c), 3))), 128))
340
- ]),
341
- v("div", null, [
342
- (k(!0), P(Y, null, W(h.days, (c, C) => (k(), P("div", {
343
- key: C,
344
- class: "fm-calendar__row fm-typo-en-body-md-400"
345
- }, [
346
- (k(!0), P(Y, null, W(c, (e) => (k(), P("div", {
347
- id: `${e.date.toISOString()}`,
348
- key: e.date.date(),
349
- class: _e(["fm-calendar__cell", [
350
- `fm-calendar__cell__${h.cellSize}`,
351
- f(e.date, h.dayCellClass),
352
- !e.isCurrentMonth && "fm-calendar__cell--not-current-month"
353
- ]])
354
- }, [
355
- e.date.isSame(p(r), "day") && e.isCurrentMonth ? (k(), P("div", xt)) : Q("", !0),
356
- e.isCurrentMonth ? (k(), P("button", {
357
- key: 1,
358
- class: "fm-calendar__cell__button",
359
- type: "button",
360
- onClick: (l) => h.onDayClick(e),
361
- onMouseover: (l) => {
362
- var s;
363
- return (s = h.onCellMouseOver) == null ? void 0 : s.call(h, e.date);
364
- }
365
- }, L(e.date.date()), 41, St)) : Q("", !0)
366
- ], 10, wt))), 128))
367
- ]))), 128))
368
- ])
369
- ]));
370
- }
371
- }), Pe = /* @__PURE__ */ Ue(Vt, [["__scopeId", "data-v-47484312"]]), Ft = { class: "fm-typo-en-body-md-600" }, Mt = {
372
- id: "in-calendar-app",
373
- class: "h-[264px] overflow-y-auto w-[160px]"
374
- }, Pt = ["onVnodeMounted"], It = ["onVnodeMounted"], ce = /* @__PURE__ */ J({
375
- __name: "FmDateRangeYearMonthPicker",
376
- props: {
377
- modelValue: {},
378
- picker: {},
379
- min: {},
380
- max: {}
381
- },
382
- emits: ["update:modelValue"],
383
- setup(S, { emit: g }) {
384
- const { t: a } = X(), r = S, n = g, f = F(!1), h = D(() => {
385
- const e = j(r.min).startOf("year"), l = j(r.max).startOf("year"), s = l.diff(e, "year"), o = [];
386
- for (let i = 0; i <= s; i++)
387
- o.push(l.subtract(i, "year"));
388
- return o;
389
- }), y = (e) => {
390
- const l = j(r.min).startOf("month"), s = j(r.max).startOf("month");
391
- return e.get("year") === l.get("year") ? e.startOf("month").isAfter(l) || e.get("month") === l.get("month") : e.get("year") === s.get("year") ? e.startOf("month").isBefore(s) || e.get("month") === s.get("month") : !0;
392
- }, c = (e) => {
393
- const l = j(r.min).startOf("month"), s = j(r.max).startOf("month");
394
- if (l.get("year") === e.get("year")) {
395
- n("update:modelValue", l);
396
- return;
397
- }
398
- if (s.get("year") === e.get("year")) {
399
- n("update:modelValue", s);
400
- return;
401
- }
402
- n("update:modelValue", e);
403
- };
404
- function C(e, l) {
405
- if (!l)
406
- return !1;
407
- const s = e.el, o = s == null ? void 0 : s.parentElement;
408
- !s || !o || o.scrollTo({
409
- top: s.offsetTop - 50
410
- });
411
- }
412
- return (e, l) => {
413
- const s = N("FmIcon"), o = N("FmMenuItem"), i = N("FmMenu");
414
- return k(), G(i, {
415
- trigger: "click",
416
- onMenuChanged: l[0] || (l[0] = (d) => f.value = d)
417
- }, {
418
- "menu-button": z(() => [
419
- v("div", {
420
- class: _e(["flex gap-4 h-24 items-center px-4 rounded-sm", f.value ? "text-fm-color-primary" : "hover:bg-fm-color-neutral-gray-100"])
421
- }, [
422
- v("div", Ft, [
423
- e.picker === "month" ? (k(), P(Y, { key: 0 }, [
424
- Ve(L(e.modelValue.format(p(a)("menu.publish.scheduler.date.monthFormat"))), 1)
425
- ], 64)) : Q("", !0),
426
- e.picker === "year" ? (k(), P(Y, { key: 1 }, [
427
- Ve(L(e.modelValue.format(p(a)("menu.publish.scheduler.date.yearFormat"))), 1)
428
- ], 64)) : Q("", !0)
429
- ]),
430
- _(s, {
431
- name: f.value ? "expand_less" : "expand_more",
432
- size: "md",
433
- color: "black"
434
- }, null, 8, ["name"])
435
- ], 2)
436
- ]),
437
- default: z(() => [
438
- v("ul", Mt, [
439
- e.picker === "month" ? (k(!0), P(Y, { key: 0 }, W(Array.from(Array(12), (d, b) => e.modelValue.month(b)), (d) => (k(), P("li", {
440
- key: d.format(p(a)("menu.publish.scheduler.date.monthFormat")),
441
- onVnodeMounted: (b) => C(
442
- b,
443
- e.modelValue.format(p(a)("menu.publish.scheduler.date.monthFormat")) === d.format(p(a)("menu.publish.scheduler.date.monthFormat"))
444
- )
445
- }, [
446
- _(o, {
447
- disabled: !y(d),
448
- "model-value": e.modelValue.format(p(a)("menu.publish.scheduler.date.monthFormat")) === d.format(p(a)("menu.publish.scheduler.date.monthFormat")),
449
- label: d.format(p(a)("menu.publish.scheduler.date.monthFormat")),
450
- "onUpdate:modelValue": (b) => n("update:modelValue", d)
451
- }, null, 8, ["disabled", "model-value", "label", "onUpdate:modelValue"])
452
- ], 8, Pt))), 128)) : Q("", !0),
453
- e.picker === "year" ? (k(!0), P(Y, { key: 1 }, W(h.value, (d) => (k(), P("li", {
454
- key: d.format(p(a)("menu.publish.scheduler.date.yearFormat")),
455
- onVnodeMounted: (b) => C(
456
- b,
457
- e.modelValue.format(p(a)("menu.publish.scheduler.date.yearFormat")) === d.format(p(a)("menu.publish.scheduler.date.yearFormat"))
458
- )
459
- }, [
460
- _(o, {
461
- "model-value": e.modelValue.format(p(a)("menu.publish.scheduler.date.yearFormat")) === d.format(p(a)("menu.publish.scheduler.date.yearFormat")),
462
- label: d.format(p(a)("menu.publish.scheduler.date.yearFormat")),
463
- "onUpdate:modelValue": (b) => c(d)
464
- }, null, 8, ["model-value", "label", "onUpdate:modelValue"])
465
- ], 8, It))), 128)) : Q("", !0)
466
- ])
467
- ]),
468
- _: 1
469
- });
470
- };
471
- }
472
- }), Nt = { class: "p-12 space-y-4 w-[552px]" }, $t = { class: "w-max" }, Dt = { class: "flex space-x-24" }, At = { class: "flex items-center py-8 space-x-16" }, Rt = { class: "flex space-x-4" }, Ot = { class: "flex items-center justify-end py-8 space-x-16" }, Ut = { class: "flex space-x-4" }, Bt = { class: "flex gap-8 items-center justify-end w-full" }, me = "YYYY-MM-DD", Tt = /* @__PURE__ */ J({
473
- __name: "DateTimePicker",
474
- props: {
475
- modelValue: {},
476
- showValidBorder: { type: Boolean, default: !1 },
477
- min: { default: () => j().subtract(50, "year").format(me) },
478
- max: { default: () => j().add(25, "year").format(me) },
479
- zIndex: { default: void 0 },
480
- label: { default: "" },
481
- labelMark: { default: "none" },
482
- labelInfo: { default: "" },
483
- disabled: { type: Boolean, default: void 0 },
484
- focused: { type: Boolean, default: !1 },
485
- rules: { default: () => [] },
486
- helperText: { default: "" },
487
- helperState: { default: "none" }
488
- },
489
- emits: ["update:schedulerTime"],
490
- setup(S, { emit: g }) {
491
- const { t: a } = X(), r = S, n = g, f = at(r, "modelValue"), h = F({
492
- hours: new Date(f.value).getHours() % 12 || 12,
493
- minutes: new Date(f.value).getMinutes(),
494
- period: new Date(f.value).getHours() >= 12 ? "PM" : "AM"
495
- /* AM */
496
- }), y = F(j(f.value, me)), c = F(!1);
497
- function C(x, u) {
498
- const [w, R, B] = x.split("-").map(Number), $ = new Date(w, R - 1, B);
499
- let I = u.hours % 12;
500
- return u.period === "PM" && (I += 12), $.setHours(I), $.setMinutes(u.minutes), $.setSeconds(0), $.setMilliseconds(0), $;
501
- }
502
- const e = () => {
503
- f.value = y.value.format(me);
504
- const x = C(f.value, h.value);
505
- n("update:schedulerTime", x.toISOString()), setTimeout(() => {
506
- c.value = !1;
507
- }, 0);
508
- }, l = () => {
509
- y.value = f.value ? j(f.value) : null, c.value = !1;
510
- }, s = (x) => {
511
- c.value = x, x || l();
512
- }, o = F(j().startOf("month")), i = F(j().startOf("month").add(1, "month")), d = (x, u) => {
513
- x === "left" ? (o.value = u, i.value = u.add(1, "month")) : x === "right" && (i.value = u, o.value = u.subtract(1, "month"));
514
- }, b = D(() => A(o.value)), U = D(() => A(o.value.add(1, "month"))), A = (x) => {
515
- const u = [], w = x.endOf("month"), R = x.month();
516
- let B = x.startOf("week"), $ = [];
517
- for (; B.isBefore(w.endOf("week")); )
518
- B.day() === 0 && $.length > 0 && (u.push($), $ = []), $.push({
519
- date: B,
520
- isCurrentMonth: B.month() === R
521
- }), B = B.add(1, "day");
522
- return $.length > 0 && u.push($), u.length < 6 && u.push([]), u;
523
- }, q = (x) => {
524
- y.value = x;
525
- };
526
- return (x, u) => {
527
- const w = N("FmIcon"), R = N("FmTimeInput"), B = N("FmButton"), $ = N("FmPopover");
528
- return k(), G($, {
529
- "show-popover": c.value,
530
- "z-index": r.zIndex,
531
- "exclude-el-from-click-outside": ["in-calendar-app"],
532
- onPopoverChanged: s
533
- }, {
534
- "popover-button": z(() => [
535
- v("div", Ke({
536
- opened: c.value,
537
- showValidBorder: x.showValidBorder
538
- }, { class: "text-fm-color-primary" }), " Select Date & Time ", 16)
539
- ]),
540
- default: z(() => [
541
- v("div", Nt, [
542
- v("div", $t, [
543
- v("div", Dt, [
544
- v("div", null, [
545
- v("div", At, [
546
- _(w, {
547
- outline: !1,
548
- class: "cursor-pointer select-none",
549
- color: "#1C1C1E",
550
- name: "chevron_left",
551
- size: "md",
552
- onClick: u[0] || (u[0] = () => d("left", o.value.subtract(1, "month")))
553
- }),
554
- v("div", Rt, [
555
- _(ce, {
556
- max: x.max,
557
- min: x.min,
558
- "model-value": o.value,
559
- picker: "month",
560
- "onUpdate:modelValue": u[1] || (u[1] = (I) => d("left", I))
561
- }, null, 8, ["max", "min", "model-value"]),
562
- _(ce, {
563
- max: x.max,
564
- min: x.min,
565
- "model-value": o.value,
566
- picker: "year",
567
- "onUpdate:modelValue": u[2] || (u[2] = (I) => d("left", I))
568
- }, null, 8, ["max", "min", "model-value"])
569
- ])
570
- ]),
571
- _(Pe, {
572
- "day-cell-class": {
573
- status: {
574
- isSelected: (I) => I.isSame(y.value, "date")
575
- }
576
- },
577
- days: b.value,
578
- "on-day-click": (I) => q(I.date)
579
- }, null, 8, ["day-cell-class", "days", "on-day-click"])
580
- ]),
581
- v("div", null, [
582
- v("div", Ot, [
583
- v("div", Ut, [
584
- _(ce, {
585
- max: x.max,
586
- min: x.min,
587
- "model-value": i.value,
588
- picker: "month",
589
- "onUpdate:modelValue": u[3] || (u[3] = (I) => d("right", I))
590
- }, null, 8, ["max", "min", "model-value"]),
591
- _(ce, {
592
- max: x.max,
593
- min: x.min,
594
- "model-value": i.value,
595
- picker: "year",
596
- "onUpdate:modelValue": u[4] || (u[4] = (I) => d("right", I))
597
- }, null, 8, ["max", "min", "model-value"])
598
- ]),
599
- _(w, {
600
- outline: !1,
601
- class: "cursor-pointer select-none",
602
- color: "#1C1C1E",
603
- name: "chevron_right",
604
- size: "md",
605
- onClick: u[5] || (u[5] = () => d("left", o.value.add(1, "month")))
606
- })
607
- ]),
608
- _(Pe, {
609
- "day-cell-class": {
610
- status: {
611
- isSelected: (I) => I.isSame(y.value, "date")
612
- }
613
- },
614
- days: U.value,
615
- "on-day-click": (I) => q(I.date)
616
- }, null, 8, ["day-cell-class", "days", "on-day-click"])
617
- ])
618
- ])
619
- ]),
620
- _(R, {
621
- "model-value": h.value ?? {
622
- hours: 0,
623
- minutes: 0,
624
- period: "AM"
625
- /* AM */
626
- },
627
- "onUpdate:modelValue": u[6] || (u[6] = (I) => h.value = I)
628
- }, null, 8, ["model-value"]),
629
- v("div", Bt, [
630
- _(B, {
631
- label: p(a)("common.cancel"),
632
- size: "md",
633
- variant: "tertiary",
634
- onClick: l
635
- }, null, 8, ["label"]),
636
- _(B, {
637
- disabled: !y.value,
638
- label: p(a)("common.confirm"),
639
- size: "md",
640
- variant: "primary",
641
- onClick: e
642
- }, null, 8, ["disabled", "label"])
643
- ])
644
- ])
645
- ]),
646
- _: 1
647
- }, 8, ["show-popover", "z-index"]);
648
- };
649
- }
650
- }), Et = { class: "container" }, Lt = /* @__PURE__ */ J({
651
- __name: "ProgressBar",
652
- props: {
653
- bgcolor: {},
654
- completed: {}
655
- },
656
- setup(S) {
657
- const g = S, a = D(() => ({
658
- height: "100%",
659
- width: `${g.completed ?? 0}%`,
660
- backgroundColor: g.bgcolor,
661
- transition: "width 1s ease-in-out",
662
- borderRadius: "inherit",
663
- textAlign: "right"
664
- }));
665
- return (r, n) => (k(), P("div", Et, [
666
- v("div", {
667
- style: Ye(a.value)
668
- }, null, 4)
669
- ]));
670
- }
671
- }), zt = /* @__PURE__ */ Ue(Lt, [["__scopeId", "data-v-709d7500"]]), jt = {
672
- class: "flex items-center gap-24"
673
- }, Kt = {
674
- class: "fm-typo-en-title-md-600"
675
- }, Yt = /* @__PURE__ */ J({
676
- __name: "PublishProgressView",
677
- props: {
678
- progress: {
679
- type: Number,
680
- required: !1
681
- },
682
- restaurants: {
683
- type: Array,
684
- required: !0
685
- }
686
- },
687
- emits: ["publishMenu"],
688
- setup(S, {
689
- expose: g,
690
- emit: a
691
- }) {
692
- const {
693
- t: r
694
- } = X(), n = Ce(), f = Re(), h = S, y = {
695
- [E.enum.PENDING]: {
696
- label: r("menu.publish.scheduler_publish.status.pending"),
697
- textColor: "text-fm-color-neutral-gray-300",
698
- backgroundColor: "#E0E0DE"
699
- },
700
- [E.enum.RUNNING]: {
701
- label: r("menu.publish.scheduler_publish.status.running"),
702
- textColor: "text-fm-color-system-warning-300",
703
- backgroundColor: "#FFB800"
704
- },
705
- [E.enum.COMPLETED]: {
706
- label: r("menu.publish.scheduler_publish.status.completed"),
707
- textColor: "text-fm-color-system-success-300",
708
- backgroundColor: "#34C759"
709
- },
710
- [E.enum.FAILED]: {
711
- label: r("menu.publish.scheduler_publish.status.failed"),
712
- textColor: "text-fm-color-system-error-300",
713
- backgroundColor: "#FF3B30"
714
- }
715
- }, c = De(), C = F(!1), e = (u) => {
716
- typeof u == "boolean" ? C.value = u : C.value = !C.value;
717
- };
718
- g({
719
- show: C,
720
- trigger: e
721
- });
722
- const l = a, s = D(() => c.state.nextSchedulerPublish ?? {}), o = D(() => Object.entries(s.value).map(([w, R]) => {
723
- var I;
724
- const B = c.runningPublishJob, $ = Object.keys(R.restaurants || {}).length;
725
- return {
726
- date: w,
727
- publisher: ((I = R.owner) == null ? void 0 : I.name) ?? "Unknown",
728
- total_restaurants: r("menu.publish.scheduler_publish.table.row.restaurants", {
729
- total: $
730
- }),
731
- restaurantPublishStatus: R.restaurants || {},
732
- status: R.status,
733
- progress: R.status === E.enum.RUNNING && B === w ? h.progress ?? 0 : 0
734
- };
735
- })), i = F([]), d = F(null), b = F(null), U = [{
736
- accessorKey: "date",
737
- header: r("menu.publish.scheduler_publish.table.columns.date"),
738
- cell: ({
739
- row: u
740
- }) => {
741
- if (u.original.date === "new") {
742
- if (d.value !== null)
743
- return new Date(d.value).toLocaleString();
744
- const R = j(Date.now()).toISOString();
745
- return T(Tt, {
746
- class: "flex h-full items-center",
747
- modelValue: R,
748
- "onUpdate:schedulerTime": (B) => {
749
- d.value = B;
750
- }
751
- });
752
- }
753
- return new Date(u.original.date).toLocaleString();
754
- }
755
- }, {
756
- accessorKey: "publisher",
757
- header: r("menu.publish.scheduler_publish.table.columns.publisher_name")
758
- }, {
759
- accessorKey: "total_restaurants",
760
- header: r("menu.publish.scheduler_publish.table.columns.total_restaurants"),
761
- cell: ({
762
- row: u
763
- }) => u.original.date === "new" ? T(bt, {
764
- restaurants: h.restaurants,
765
- "onUpdate:modelValue": (R) => {
766
- i.value = R;
767
- }
768
- }) : T("p", {}, u.original.total_restaurants)
769
- }, {
770
- accessorKey: "progress",
771
- header: r("menu.publish.scheduler_publish.table.columns.progress"),
772
- cell: ({
773
- row: u
774
- }) => {
775
- const w = u.original.status;
776
- return u.original.date === "new" ? T("div", {
777
- class: "flex justify-end items-center gap-8"
778
- }, [T(te.FmButton, {
779
- variant: "tertiary",
780
- prependIcon: "close",
781
- textColor: "system-error-300",
782
- onClick: () => {
783
- d.value = null, A.value = null, b.value = null;
784
- }
785
- }), T(te.FmButton, {
786
- variant: "tertiary",
787
- prependIcon: "check",
788
- textColor: "system-success-300",
789
- onClick: async () => {
790
- if (!d.value || i.value.length === 0) {
791
- b.value = !1, n.open({
792
- type: "error",
793
- message: "Please select date and restaurants to schedule publish."
794
- });
795
- return;
796
- } else
797
- b.value = !0;
798
- }
799
- })]) : T("div", {
800
- class: "flex justify-between items-center gap-32"
801
- }, [T("div", {
802
- class: "flex flex-col w-full gap-4"
803
- }, [T("div", {
804
- class: "flex items-center gap-8"
805
- }, [T("p", {
806
- class: `fm-typo-en-body-md-400 ${y[w].textColor}`
807
- }, y[w].label), ...w === E.enum.RUNNING ? [T("p", {
808
- class: `fm-typo-en-body-md-400 ${y[w].textColor}`
809
- }, `(${u.original.progress}/${u.original.total_restaurants})`)] : []]), T(zt, {
810
- bgcolor: y[w].backgroundColor,
811
- completed: w === E.enum.PENDING ? 0 : w === E.enum.RUNNING ? Math.floor((u.original.progress ?? 0) / parseInt(u.original.total_restaurants) * 100) : (w === E.enum.COMPLETED, 100)
812
- })]), T(te.FmButton, {
813
- variant: "plain",
814
- prependIcon: "info",
815
- disabled: Array.isArray(u.original.restaurantPublishStatus),
816
- onClick: () => {
817
- f.open({
818
- title: r("menu.publish.scheduler_publish.restaurant_publish_details.title"),
819
- contentComponent: Ct,
820
- contentComponentProps: {
821
- restaurantPublishStatus: u.original.restaurantPublishStatus,
822
- statusMap: y
823
- },
824
- contentClass: "flex flex-col h-full",
825
- maxWidth: "800px",
826
- maxHeight: "80vh"
827
- });
828
- }
829
- }), T(te.FmButton, {
830
- variant: "tertiary",
831
- prependIcon: "delete",
832
- disabled: w !== E.enum.PENDING,
833
- textColor: "system-error-300",
834
- onClick: () => {
835
- const B = j(u.original.date).toISOString();
836
- f.open({
837
- title: "Confirm Remove",
838
- message: "Are you sure you want to remove this scheduled publish? This action cannot be undone.",
839
- primaryActions: {
840
- text: "Remove",
841
- close: !1
842
- },
843
- secondaryActions: {
844
- text: "Cancel",
845
- close: !0
846
- }
847
- }).onPrimary(() => {
848
- c.deleteSchedulerPublish(B).then(() => {
849
- n.open({
850
- type: "success",
851
- message: "Scheduled publish deleted successfully."
852
- });
853
- }).catch(() => {
854
- n.open({
855
- type: "error",
856
- message: "Failed to delete scheduled publish. Please try again."
857
- });
858
- }).finally(() => {
859
- f.close();
860
- });
861
- });
862
- }
863
- })]);
864
- }
865
- }];
866
- ge(async () => {
867
- await c.getNextSchedulerPublish();
868
- });
869
- const A = F(null);
870
- function q() {
871
- b.value = !1, A.value = {
872
- date: "new",
873
- restaurantsIds: []
874
- };
875
- }
876
- Ie(b, async (u) => {
877
- u && (l("publishMenu", {
878
- schedulerTime: d.value,
879
- restaurantIds: i.value
880
- }), await c.getNextSchedulerPublish(), d.value = null, i.value = [], b.value = !1, A.value = null, b.value = null);
881
- });
882
- const x = Oe(() => b.value !== null && b.value === !1, () => {
883
- C.value = !1, A.value = null, d.value = null, i.value = [], b.value = null;
884
- });
885
- return (u, w) => {
886
- const R = N("FmButton"), B = N("FmTable"), $ = N("FmSideSheet");
887
- return k(), P(Y, null, [Ge(u.$slots, "default", {
888
- trigger: e
889
- }), _($, {
890
- modelValue: C.value,
891
- "onUpdate:modelValue": w[1] || (w[1] = (I) => C.value = I),
892
- "close-button": !1,
893
- "max-width": 800,
894
- "onOn:clickedAway": p(x)
895
- }, {
896
- "side-sheet-header": z(() => [v("div", jt, [_(R, {
897
- variant: p(Me).Tertiary,
898
- "prepend-icon": "arrow_back",
899
- onClick: le(p(x), ["stop"])
900
- }, null, 8, ["variant", "onClick"]), v("p", Kt, L(p(r)("menu.publish.actions.publish_progress")), 1)])]),
901
- default: z(() => [v("div", null, [_(B, {
902
- class: "pb-8",
903
- "row-data": [...o.value, A.value].filter(Boolean),
904
- "column-defs": U,
905
- "shrink-at": !1,
906
- pageSize: o.value.length + (A.value ? 1 : 0),
907
- "hide-footer": ""
908
- }, null, 8, ["row-data", "pageSize"]), p(c).state.featureFlags.schedulerPublish && !A.value ? (k(), G(R, {
909
- key: 0,
910
- variant: p(Me).Plain,
911
- "prepend-icon": "add",
912
- label: p(r)("menu.publish.actions.add_scheduler_publish"),
913
- onClick: w[0] || (w[0] = () => q())
914
- }, null, 8, ["variant", "label"])) : Q("", !0)])]),
915
- _: 1
916
- }, 8, ["modelValue", "onOn:clickedAway"])], 64);
917
- };
918
- }
919
- }), Gt = 12e4;
920
- function qt(S) {
921
- return S === E.enum.RUNNING || S === E.enum.PENDING;
922
- }
923
- function Ht(S) {
924
- const g = /* @__PURE__ */ new Map();
925
- for (const a of Object.values(S ?? {})) {
926
- if (!qt(a.status)) continue;
927
- const r = a.status === E.enum.RUNNING ? "publishing" : "queued";
928
- for (const [n, f] of Object.entries(a.restaurants ?? {}))
929
- f.status === E.enum.COMPLETED || f.status === E.enum.FAILED || (r === "publishing" || !g.has(n)) && g.set(n, r);
930
- }
931
- return g;
932
- }
933
- function Jt(S, g) {
934
- const a = g + Gt;
935
- return Object.entries(S ?? {}).some(([r, n]) => {
936
- if (n.status === E.enum.RUNNING) return !0;
937
- if (n.status !== E.enum.PENDING) return !1;
938
- const f = new Date(r).getTime();
939
- return Number.isNaN(f) || f <= a;
940
- });
941
- }
942
- function Wt(S) {
943
- return Object.values(S ?? {}).some((g) => g.status === E.enum.PENDING);
944
- }
945
- function Qt(S, g, a, r) {
946
- return S.get(g) ?? (r === a ? "latest" : "outdated");
947
- }
948
- const Xt = { class: "fm-typo-en-title-md-600" }, Zt = { class: "mt-40" }, ea = { class: "fm-typo-en-title-sm-600" }, ta = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, aa = { class: "flex gap-8 items-center justify-start" }, la = /* @__PURE__ */ J({
949
- __name: "UpdateCatalogDialog",
950
- props: {
951
- catalogs: {
952
- type: Array,
953
- required: !0
954
- }
955
- },
956
- emits: ["onComplete"],
957
- setup(S, { expose: g, emit: a }) {
958
- const { t: r } = X(), n = S;
959
- g({
960
- show: s,
961
- hide: o
962
- });
963
- const f = a;
964
- function h() {
965
- return {
966
- restaurantId: "",
967
- catalogId: void 0,
968
- takeawayCatalog: void 0,
969
- pickupCatalog: null,
970
- additionalCatalogs: []
971
- };
972
- }
973
- const y = D(() => [
974
- {
975
- label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
976
- value: null
977
- },
978
- ...n.catalogs.map((b) => ({
979
- label: b.name,
980
- value: b._id
981
- }))
982
- ]), c = D(() => [
983
- {
984
- label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
985
- value: null
986
- },
987
- ...n.catalogs.map((b) => ({
988
- label: b.name,
989
- value: b._id
990
- }))
991
- ]), C = F(h()), e = F(!1), l = F(void 0);
992
- function s(b) {
993
- l.value = b ? Fe(b) : h(), C.value = Fe(l.value), e.value = !0;
994
- }
995
- function o() {
996
- e.value = !1;
997
- }
998
- const i = Oe(
999
- () => !ut.isEqual(l.value, C.value),
1000
- () => {
1001
- o();
1002
- }
1003
- );
1004
- function d() {
1005
- o(), f("onComplete", C.value);
1006
- }
1007
- return (b, U) => {
1008
- const A = N("FmSelect"), q = N("FmCheckbox"), x = N("FmButton"), u = N("FmSideSheet");
1009
- return k(), G(u, {
1010
- modelValue: e.value,
1011
- "onUpdate:modelValue": U[5] || (U[5] = (w) => e.value = w),
1012
- "max-width": 560,
1013
- "onOn:clickedAway": p(i)
1014
- }, {
1015
- "side-sheet-header": z(() => [
1016
- v("span", Xt, L(p(r)("menu.publish.update_catalog_dialog.title")), 1)
1017
- ]),
1018
- "side-sheet-footer": z(() => [
1019
- v("div", aa, [
1020
- _(x, {
1021
- label: p(r)("menu.publish.update_catalog_dialog.actions.update"),
1022
- size: "lg",
1023
- variant: "primary",
1024
- onClick: U[4] || (U[4] = () => d())
1025
- }, null, 8, ["label"]),
1026
- _(x, {
1027
- label: p(r)("menu.publish.update_catalog_dialog.actions.cancel"),
1028
- size: "lg",
1029
- variant: "tertiary",
1030
- onClick: o
1031
- }, null, 8, ["label"])
1032
- ])
1033
- ]),
1034
- default: z(() => [
1035
- _(A, {
1036
- modelValue: C.value.catalogId,
1037
- "onUpdate:modelValue": U[0] || (U[0] = (w) => C.value.catalogId = w),
1038
- items: y.value,
1039
- class: "mb-24",
1040
- label: p(r)("menu.publish.update_catalog_dialog.sections.default.label")
1041
- }, null, 8, ["modelValue", "items", "label"]),
1042
- _(A, {
1043
- modelValue: C.value.takeawayCatalog,
1044
- "onUpdate:modelValue": U[1] || (U[1] = (w) => C.value.takeawayCatalog = w),
1045
- items: c.value,
1046
- class: "mb-24",
1047
- label: p(r)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
1048
- }, null, 8, ["modelValue", "items", "label"]),
1049
- _(A, {
1050
- modelValue: C.value.pickupCatalog,
1051
- "onUpdate:modelValue": U[2] || (U[2] = (w) => C.value.pickupCatalog = w),
1052
- items: c.value,
1053
- label: p(r)("menu.publish.update_catalog_dialog.sections.pickup.label")
1054
- }, null, 8, ["modelValue", "items", "label"]),
1055
- v("div", Zt, [
1056
- v("div", ea, L(p(r)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
1057
- v("div", ta, L(p(r)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
1058
- (k(!0), P(Y, null, W(S.catalogs, (w) => (k(), P("div", {
1059
- key: w._id
1060
- }, [
1061
- _(q, {
1062
- modelValue: C.value.additionalCatalogs,
1063
- "onUpdate:modelValue": U[3] || (U[3] = (R) => C.value.additionalCatalogs = R),
1064
- label: w.name,
1065
- value: w._id
1066
- }, null, 8, ["modelValue", "label", "value"])
1067
- ]))), 128))
1068
- ])
1069
- ]),
1070
- _: 1
1071
- }, 8, ["modelValue", "onOn:clickedAway"]);
1072
- };
1073
- }
1074
- }), sa = {
1075
- class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
1076
- }, na = {
1077
- class: "flex items-center xs:mb-8 mb-24"
1078
- }, oa = {
1079
- class: "mr-8"
1080
- }, ua = {
1081
- class: "fm-typo-en-title-md-600"
1082
- }, ra = {
1083
- class: "xs:hidden mr-16"
1084
- }, ia = {
1085
- class: "xs:hidden mr-16"
1086
- }, da = {
1087
- class: "xs:hidden"
1088
- }, ca = {
1089
- class: "pb-8 flex justify-between items-start xs:flex-col xs:items-stretch gap-8"
1090
- }, ma = {
1091
- class: "grow flex flex-col gap-4"
1092
- }, pa = {
1093
- class: "flex gap-8 items-center"
1094
- }, ha = {
1095
- class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
1096
- }, fa = {
1097
- class: "space-y-4"
1098
- }, ba = {
1099
- class: "fm-typo-en-body-lg-600"
1100
- }, va = {
1101
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1102
- }, _a = {
1103
- class: "flex gap-8"
1104
- }, ga = {
1105
- class: "xs:block hidden fixed bottom-72 right-16"
1106
- }, ya = 3e4, Da = /* @__PURE__ */ J({
1107
- __name: "Publish",
1108
- setup(S) {
1109
- const g = He(), {
1110
- t: a
1111
- } = X(), r = {
1112
- latest: {
1113
- labelKey: "menu.publish.table.status.latest",
1114
- variant: "success"
1115
- },
1116
- publishing: {
1117
- labelKey: "menu.publish.table.status.publishing",
1118
- variant: "info"
1119
- },
1120
- queued: {
1121
- labelKey: "menu.publish.table.status.queued",
1122
- variant: "neutral"
1123
- },
1124
- outdated: {
1125
- labelKey: "menu.publish.table.status.outdated",
1126
- variant: "warning"
1127
- }
1128
- };
1129
- function n(t) {
1130
- return a(r[t].labelKey);
1131
- }
1132
- const f = ({
1133
- row: t
1134
- }) => {
1135
- const m = r[t.status] ?? r.outdated;
1136
- return _(lt, {
1137
- label: a(m.labelKey),
1138
- variant: m.variant
1139
- }, null);
1140
- }, h = F({}), y = [{
1141
- accessorKey: "displayName",
1142
- header: () => a("menu.publish.table.columns.restaurant"),
1143
- cell: (t) => t.getValue(),
1144
- enableSorting: !0
1145
- }, {
1146
- accessorKey: "catalog",
1147
- header: () => a("menu.publish.table.columns.default"),
1148
- enableSorting: !1,
1149
- cell: (t) => t.getValue().default
1150
- }, {
1151
- accessorKey: "catalog",
1152
- header: () => a("menu.publish.table.columns.pos_takeaway"),
1153
- enableSorting: !1,
1154
- cell: (t) => t.getValue().takeaway
1155
- }, {
1156
- accessorKey: "catalog",
1157
- header: () => a("menu.publish.table.columns.pickup"),
1158
- enableSorting: !1,
1159
- cell: (t) => t.getValue().pickup
1160
- }, {
1161
- accessorKey: "updatedAt",
1162
- header: () => a("menu.publish.table.columns.version"),
1163
- enableSorting: !1,
1164
- cell: (t) => {
1165
- const m = t.getValue();
1166
- return A(m);
1167
- }
1168
- }, {
1169
- accessorKey: "status",
1170
- header: () => a("menu.common.labels.status"),
1171
- enableSorting: !1,
1172
- cell: (t) => _(f, {
1173
- row: t.row.original
1174
- }, null)
1175
- }, {
1176
- accessorKey: "_id",
1177
- header: "",
1178
- size: 52,
1179
- enableSorting: !1,
1180
- cell: (t) => {
1181
- const m = t.row.original;
1182
- return T("div", {
1183
- class: "flex justify-end gap-8"
1184
- }, [d.value && m.revertConfig ? ot(T(te.FmButton, {
1185
- prependIcon: "undo",
1186
- variant: "secondary",
1187
- disabled: se(m._id),
1188
- onClick: le(async () => {
1189
- await b(t.row.original);
1190
- }, ["stop", "prevent"])
1191
- }), a("menu.publish.actions.revert")) : null, T(te.FmButton, {
1192
- label: a("menu.publish.actions.publish"),
1193
- icon: "ios_share",
1194
- variant: "secondary",
1195
- disabled: se(m._id),
1196
- onClick: le(async () => {
1197
- const O = w(t.row.original);
1198
- await pe(O);
1199
- }, ["stop", "prevent"])
1200
- })]);
1201
- },
1202
- meta: {
1203
- width: "150px"
1204
- }
1205
- }], c = F(""), C = F(), e = De(), l = ye(), s = D(() => {
1206
- var m;
1207
- const t = /* @__PURE__ */ new Map();
1208
- for (const O of l.restaurants.value)
1209
- (m = O.profile) != null && m.code && t.set(O._id, O.profile.code);
1210
- return t;
1211
- });
1212
- function o(t, m) {
1213
- const O = s.value.get(t);
1214
- return O ? `${m} (${O})` : m;
1215
- }
1216
- const i = Re(), d = D(() => e.version !== et.enum.v3);
1217
- async function b(t) {
1218
- t.revertConfig && i.open({
1219
- title: "Revert menu",
1220
- contentComponent: pt,
1221
- contentComponentProps: {
1222
- restaurant: t
1223
- },
1224
- primaryActions: {
1225
- text: "Revert",
1226
- close: !0
1227
- },
1228
- secondaryActions: {
1229
- text: "Cancel",
1230
- close: !0
1231
- }
1232
- }).onPrimary(async () => {
1233
- await $.minor(async () => {
1234
- await e.revertRestaurantMenu(t._id);
1235
- }, {
1236
- customId: t._id,
1237
- message: `Revert menu of ${t.name}`
1238
- });
1239
- });
1240
- }
1241
- const U = D(() => a("menu.publish.labels.main_version", {
1242
- version: A(e.state.menu.updatedAt)
1243
- }));
1244
- function A(t) {
1245
- return t ? j(t).format("DD/MM/YYYY hh:mmA") : "";
1246
- }
1247
- const q = D(() => e.state.menu.modules.catalog), x = D(() => $.queue.value.some((t) => t.id === e.state.menu._id));
1248
- function u(t) {
1249
- var m;
1250
- return t ? ((m = q.value.find((O) => O._id === t)) == null ? void 0 : m.name) ?? a("menu.publish.labels.catalog.invalid") : a("menu.publish.labels.catalog.main");
1251
- }
1252
- function w(t) {
1253
- return {
1254
- restaurantId: t._id,
1255
- catalogId: t.catalogId,
1256
- takeawayCatalog: t.takeawayCatalog,
1257
- pickupCatalog: t.pickupCatalog || null,
1258
- additionalCatalogs: t.additionalCatalogs
1259
- };
1260
- }
1261
- function R(t) {
1262
- var O;
1263
- const m = w(t);
1264
- (O = C.value) == null || O.show(m);
1265
- }
1266
- const B = Ce(), $ = Ne(B), I = D(() => Ht(e.state.nextSchedulerPublish));
1267
- function se(t) {
1268
- return x.value || $.checkIsLoading(t) || I.value.has(t);
1269
- }
1270
- async function pe(t) {
1271
- var O;
1272
- if (x.value) return;
1273
- const m = (O = H.value.find((ee) => ee._id === t.restaurantId)) == null ? void 0 : O.name;
1274
- await $.minor(async () => {
1275
- await e.publishMenu(t, !1), e.patchRestaurantCatalogs(t);
1276
- }, {
1277
- customId: e.state.menu._id,
1278
- message: `Registering menu publish for ${m}`,
1279
- successMessage: `Menu publish registered for ${m}.`
1280
- }), await re(!0);
1281
- }
1282
- const ne = F(null), ke = D(() => a("menu.common.labels.status")), H = D(() => {
1283
- const t = c.value.toLowerCase(), m = e.state.menu.updatedAt, O = I.value, ee = e.state.publishMetaRestaurants ?? {};
1284
- return e.state.restaurants.filter((M) => {
1285
- var K;
1286
- return !ne.value || ((K = ne.value) == null ? void 0 : K.includes(M._id));
1287
- }).map((M) => {
1288
- const K = ee[M._id], ie = (K == null ? void 0 : K.lastUpdateAt) ?? M.updatedAt, de = Qt(O, M._id, ie, m);
1289
- return {
1290
- ...M,
1291
- updatedAt: ie,
1292
- // Same shape the backend builds for `/restaurants`: the previous catalog
1293
- // selection, pointing at the menu the last publish shipped.
1294
- revertConfig: K ? {
1295
- ...K.revertConfig,
1296
- _id: K.menuId
1297
- } : M.revertConfig,
1298
- displayName: o(M._id, M.name),
1299
- catalog: {
1300
- default: u(M.catalogId),
1301
- takeaway: u(M.takeawayCatalog),
1302
- pickup: u(M.pickupCatalog)
1303
- },
1304
- status: de,
1305
- [ke.value]: n(de)
1306
- };
1307
- }).filter((M) => Je(M, he.value)).filter(({
1308
- displayName: M,
1309
- catalog: K
1310
- }) => t ? M.toLowerCase().includes(t) || K.default.toLowerCase().includes(t) || K.takeaway.toLowerCase().includes(t) || K.pickup.toLowerCase().includes(t) : !0);
1311
- }), he = F({
1312
- logic: "AND",
1313
- rules: []
1314
- }), Te = D(() => [{
1315
- type: "string",
1316
- key: ke.value,
1317
- entity: "menu",
1318
- values: Object.keys(r).map(n)
1319
- }]), we = F(0), xe = [3e3, 3e3, 5e3, 1e4, 3e4], Z = F(null), ae = F(0), oe = F(!1), fe = F(!1), Se = F(!0);
1320
- function be() {
1321
- Z.value !== null && (clearTimeout(Z.value), Z.value = null);
1322
- }
1323
- async function Ee() {
1324
- await e.getNextSchedulerPublish(), we.value = e.runningPublishJob !== null ? await e.getPublishRestaurantsProgress() : 0;
1325
- }
1326
- async function ue() {
1327
- if (oe.value) {
1328
- fe.value = !0;
1329
- return;
1330
- }
1331
- oe.value = !0, be();
1332
- let t = !1;
1333
- try {
1334
- await Ee();
1335
- } catch (m) {
1336
- t = !0, console.error("Failed to refresh publish status", m);
1337
- } finally {
1338
- oe.value = !1;
1339
- }
1340
- if (Se.value) {
1341
- if (fe.value) {
1342
- fe.value = !1, ae.value = 0, await ue();
1343
- return;
1344
- }
1345
- if (t || Jt(e.state.nextSchedulerPublish, Date.now())) {
1346
- const m = xe[Math.min(ae.value, xe.length - 1)];
1347
- ae.value += 1, Z.value = setTimeout(() => void ue(), m);
1348
- return;
1349
- }
1350
- Wt(e.state.nextSchedulerPublish) && (ae.value = 0, Z.value = setTimeout(() => void ue(), ya));
1351
- }
1352
- }
1353
- async function re(t = !1) {
1354
- if (t)
1355
- be(), ae.value = 0;
1356
- else if (Z.value !== null || oe.value)
1357
- return;
1358
- await ue();
1359
- }
1360
- async function Le() {
1361
- await $.minor(async () => {
1362
- await e.readRestaurants(), await re(!0);
1363
- }, {
1364
- customId: e.state.menu._id
1365
- });
1366
- }
1367
- async function ve(t) {
1368
- if (x.value) return;
1369
- const m = Object.keys(h.value).filter((M) => h.value[M]), O = m.length === 0 || m.length === H.value.length ? H.value : H.value.filter((M) => m.includes(M._id));
1370
- if (t ? t.restaurantIds.length === e.state.restaurants.length : H.value.length === e.state.restaurants.length && (m.length === 0 || m.length === H.value.length))
1371
- await $.minor(async () => {
1372
- await e.publishAllMenu(t == null ? void 0 : t.schedulerTime, !1);
1373
- }, {
1374
- customId: e.state.menu._id,
1375
- successMessage: "Menu publish registered for all restaurants."
1376
- });
1377
- else {
1378
- const M = (t == null ? void 0 : t.restaurantIds) || O.map((K) => K._id);
1379
- await $.minor(async () => {
1380
- await e.publishMultipleMenu(M, t == null ? void 0 : t.schedulerTime, !1);
1381
- }, {
1382
- customId: e.state.menu._id,
1383
- successMessage: `Menu publish registered for ${t != null && t.restaurantIds ? t.restaurantIds.length : O.length} restaurant(s).`
1384
- });
1385
- }
1386
- await re(!0);
1387
- }
1388
- return ge(() => {
1389
- re();
1390
- }), qe(() => {
1391
- Se.value = !1, be();
1392
- }), (t, m) => {
1393
- const O = N("FmChip"), ee = N("FmSpacer"), M = N("FmButton"), K = N("FmBadge"), ie = N("FmSearch"), de = N("FmTable"), ze = N("FmListItem"), je = N("FmList");
1394
- return k(), P(Y, null, [v("div", sa, [v("div", na, [v("div", oa, [v("div", ua, L(p(a)("menu.publish.title")), 1)]), _(O, {
1395
- label: U.value,
1396
- class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
1397
- }, null, 8, ["label"]), _(ee), v("div", ra, [_(M, {
1398
- disabled: x.value,
1399
- label: p(a)("menu.publish.actions.refresh"),
1400
- variant: "secondary",
1401
- onClick: m[0] || (m[0] = () => Le())
1402
- }, null, 8, ["disabled", "label"])]), v("div", ia, [_(Yt, {
1403
- progress: we.value,
1404
- restaurants: H.value,
1405
- onPublishMenu: m[1] || (m[1] = (V) => ve(V))
1406
- }, {
1407
- default: z(({
1408
- trigger: V
1409
- }) => [p(e).activePublishJob !== null ? (k(), G(K, {
1410
- key: 0,
1411
- variant: "critical",
1412
- value: 1
1413
- }, {
1414
- default: z(() => [_(M, {
1415
- variant: "secondary",
1416
- disabled: x.value,
1417
- label: p(a)("menu.publish.actions.publish_progress"),
1418
- onClick: V
1419
- }, null, 8, ["disabled", "label", "onClick"])]),
1420
- _: 2
1421
- }, 1024)) : (k(), G(M, {
1422
- key: 1,
1423
- variant: "secondary",
1424
- disabled: x.value,
1425
- label: p(a)("menu.publish.actions.publish_progress"),
1426
- onClick: V
1427
- }, null, 8, ["disabled", "label", "onClick"]))]),
1428
- _: 1
1429
- }, 8, ["progress", "restaurants"])]), v("div", da, [_(M, {
1430
- disabled: x.value,
1431
- icon: "ios_share",
1432
- label: p(a)("menu.publish.actions.publish_all"),
1433
- variant: "primary",
1434
- onClick: m[2] || (m[2] = () => ve())
1435
- }, null, 8, ["disabled", "label"])])]), v("div", ca, [_(p(Ae), {
1436
- multiple: "",
1437
- modelValue: ne.value,
1438
- "onUpdate:modelValue": m[4] || (m[4] = (V) => ne.value = V)
1439
- }, {
1440
- "append-right": z(() => [_(p(We), {
1441
- modelValue: he.value,
1442
- "onUpdate:modelValue": m[3] || (m[3] = (V) => he.value = V),
1443
- attributes: Te.value
1444
- }, null, 8, ["modelValue", "attributes"])]),
1445
- _: 1
1446
- }, 8, ["modelValue"]), _(ie, {
1447
- modelValue: c.value,
1448
- "onUpdate:modelValue": m[5] || (m[5] = (V) => c.value = V),
1449
- autofocus: "",
1450
- class: "w-[320px] xs:w-full",
1451
- placeholder: p(a)("menu.publish.table.search.placeholder")
1452
- }, null, 8, ["modelValue", "placeholder"])]), H.value.length > 0 ? (k(), P(Y, {
1453
- key: 0
1454
- }, [_(st, {
1455
- class: "xs:hidden block"
1456
- }, {
1457
- default: z(() => [_(de, {
1458
- modelValue: h.value,
1459
- "onUpdate:modelValue": m[6] || (m[6] = (V) => h.value = V),
1460
- "get-row-id": (V) => V._id,
1461
- "column-defs": y,
1462
- loading: x.value,
1463
- "page-size": H.value.length,
1464
- "row-data": H.value,
1465
- shrinkAt: !1,
1466
- virtual: !0,
1467
- selection: "multiple",
1468
- "hide-footer": "",
1469
- "pin-header-row": "",
1470
- onRowClick: m[7] || (m[7] = (V) => R(V.original))
1471
- }, null, 8, ["modelValue", "get-row-id", "loading", "page-size", "row-data"])]),
1472
- _: 1
1473
- }), _(je, {
1474
- class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
1475
- separator: ""
1476
- }, {
1477
- default: z(() => [(k(!0), P(Y, null, W(H.value, (V) => (k(), G(ze, {
1478
- key: V._id,
1479
- label: V.displayName,
1480
- style: {
1481
- padding: "12px 0 !important"
1482
- },
1483
- onClick: () => R(V)
1484
- }, {
1485
- default: z(() => [v("div", ma, [v("div", pa, [v("div", ha, L(A(V.updatedAt)), 1), _(f, {
1486
- row: V
1487
- }, null, 8, ["row"])]), v("div", fa, [v("div", ba, L(V.displayName), 1), v("div", va, [v("div", null, "Default: " + L(V.catalog.default), 1), v("div", null, "POS takeaway: " + L(V.catalog.takeaway), 1), v("div", null, "Pickup: " + L(V.catalog.pickup), 1)])])]), v("div", _a, [d.value && V.revertConfig ? (k(), G(M, {
1488
- key: 0,
1489
- disabled: se(V._id),
1490
- icon: "undo",
1491
- variant: "tertiary",
1492
- onClick: le(() => b(V), ["stop"])
1493
- }, null, 8, ["disabled", "onClick"])) : Q("", !0), _(M, {
1494
- disabled: se(V._id),
1495
- icon: "ios_share",
1496
- variant: "tertiary",
1497
- onClick: le(() => pe(w(V)), ["stop"])
1498
- }, null, 8, ["disabled", "onClick"])])]),
1499
- _: 2
1500
- }, 1032, ["label", "onClick"]))), 128))]),
1501
- _: 1
1502
- })], 64)) : (k(), G(p($e), {
1503
- key: 1,
1504
- title: p(a)("menu.publish.empty.title"),
1505
- subtitle: p(a)("menu.publish.empty.subtitle"),
1506
- action: {
1507
- text: p(a)("menu.publish.empty.action"),
1508
- icon: "add",
1509
- callback: () => {
1510
- p(g).push({
1511
- name: "$settings-my-business"
1512
- });
1513
- }
1514
- }
1515
- }, null, 8, ["title", "subtitle", "action"]))]), v("div", ga, [_(M, {
1516
- disabled: x.value,
1517
- icon: "ios_share",
1518
- label: p(a)("menu.publish.actions.publish_all"),
1519
- variant: "fab",
1520
- onClick: m[8] || (m[8] = () => ve())
1521
- }, null, 8, ["disabled", "label"])]), _(la, {
1522
- ref_key: "updateCatalogDialogRef",
1523
- ref: C,
1524
- catalogs: q.value,
1525
- onOnComplete: pe
1526
- }, null, 8, ["catalogs"])], 64);
1527
- };
1528
- }
1529
- });
1530
- export {
1531
- Da as default
1532
- };