@feedmepos/mf-menu 0.32.82 → 0.32.83-dev.2

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