@feedmepos/mf-menu-portal 1.0.4-dev.3 → 1.0.4

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 (80) hide show
  1. package/dist/{App-nS46pByh.js → App-CgYpEYgp.js} +3 -3
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js} +1 -1
  3. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-DnvN5R5w.js → BindingTable.vue_vue_type_script_setup_true_lang-CWe5_Sm5.js} +1 -1
  4. package/dist/{Catalog-B4RS8T29.js → Catalog-BrHGEI3p.js} +4 -4
  5. package/dist/{CatalogBinding-6_783kbu.js → CatalogBinding-BjTeOA91.js} +3 -3
  6. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BawCLY5-.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-doB3hsWD.js} +3 -3
  7. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-BjP8ZXyb.js → CatalogEditor.vue_vue_type_script_setup_true_lang-BpBR-N_x.js} +7 -7
  8. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Diapahfp.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-P59vHZEn.js} +14 -14
  9. package/dist/{Category-CqneIGq4.js → Category-6-ppsSmZ.js} +5 -5
  10. package/dist/{Category-DNQH1CI7.js → Category-CdsbuUqi.js} +2 -2
  11. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-DlNUOgyu.js +847 -0
  12. package/dist/{CookingGuide-DTAiFmEL.js → CookingGuide-CRyRlBeV.js} +5 -5
  13. package/dist/{Group-5xO2j3CL.js → Group-DVrUlq4i.js} +2 -2
  14. package/dist/{Group-DeUqUomY.js → Group-DqyBHSFx.js} +5 -5
  15. package/dist/GroupList.vue_vue_type_script_setup_true_lang-oGNs8e8f.js +1807 -0
  16. package/dist/Ingredient-CGLfhbvN.js +505 -0
  17. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-C0rc1FRO.js +782 -0
  18. package/dist/{MenuSetting-DdekHsQy.js → MenuSetting-Oct3vbHj.js} +4 -4
  19. package/dist/OrderPacing-BDkzflgE.js +769 -0
  20. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-C3SqQPSr.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-B259anSs.js} +2 -2
  21. package/dist/{Preview-DGTw0POk.js → Preview-V9cSpevb.js} +1 -1
  22. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-DffhFv0Y.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-k5S4mGCN.js} +1 -1
  23. package/dist/PrintRoute-3UwiMoBU.js +518 -0
  24. package/dist/{Product-CsbcyIgD.js → Product-LaB-YRTQ.js} +4 -4
  25. package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +7931 -0
  26. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang--rBKdKV7.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-BBXGnZtc.js} +9 -9
  27. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BUC6qUnG.js +2011 -0
  28. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-DtCzHjpN.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CjQRRqBx.js} +1 -1
  29. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-aDx01-WW.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-3yzUcogQ.js} +630 -587
  30. package/dist/{ProductInternalTools-Ccd4dAmx.js → ProductInternalTools-DWCgC825.js} +2 -2
  31. package/dist/{ProductInventoryDialog-DYcKdKHi.js → ProductInventoryDialog-D0d5RywR.js} +1 -1
  32. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-DySFcCJz.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-CmYKO0ZX.js} +1 -1
  33. package/dist/ProductList.vue_vue_type_script_setup_true_lang-DeX8Exly.js +2765 -0
  34. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Dw2xiPYX.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-BFD6_Sbb.js} +1 -1
  35. package/dist/{Products-phZwCZhU.js → Products-BLUhwFT-.js} +3 -3
  36. package/dist/Publish-Dkjnls7p.js +1337 -0
  37. package/dist/Recipe-BGfofjHT.js +388 -0
  38. package/dist/{Scheduler-C-A5m92O.js → Scheduler-BL7t8aS7.js} +314 -254
  39. package/dist/ServingSequence-CDFXMCiN.js +374 -0
  40. package/dist/{Setting-C24V-lps.js → Setting-gYZoZxQG.js} +6 -6
  41. package/dist/Subcategory-CnlrVwCy.js +459 -0
  42. package/dist/{Takeaway-BFP2ohJn.js → Takeaway-BWVzwWnh.js} +5 -5
  43. package/dist/{Takeaway-DywX5BiX.js → Takeaway-D8FzvC2w.js} +2 -2
  44. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-B3QS7o1v.js → TakeawayList.vue_vue_type_script_setup_true_lang-igS-FXq5.js} +4 -4
  45. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B8nXazx6.js +1291 -0
  46. package/dist/Unit-Do7Tt8U8.js +424 -0
  47. package/dist/{Variant-BBfWhH-s.js → Variant-D1kLupxx.js} +5 -5
  48. package/dist/{_id_-BooM3FX1.js → _id_-DomaBHrh.js} +3 -3
  49. package/dist/{app-Bmgb8ACe.js → app-C_XNYz8_.js} +312 -312
  50. package/dist/app.js +1 -1
  51. package/dist/apps/mf-menu/src/app.d.ts +60 -0
  52. package/dist/apps/mf-menu/src/components/Product/BulkCategorySelect.vue.d.ts +37 -0
  53. package/dist/apps/mf-menu/src/components/Product/ProductAttributeFilter.vue.d.ts +11 -1
  54. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +2 -2
  55. package/dist/apps/mf-menu/src/components/feature/NestedGroupManager/NestedGroupOverrideSheets.vue.d.ts +27 -0
  56. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesFilter.vue.d.ts +20 -0
  57. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  58. package/dist/assets/{menu-compute-CG-fX5pi.js → menu-compute-Did75Kp9.js} +2 -2
  59. package/dist/assets/{validate-menu-BeGMWVns.js → validate-menu-DVMOLygB.js} +2 -2
  60. package/dist/mf-menu-portal.css +1 -1
  61. package/dist/{provide-CfF0FmUz.js → provide-Bwf3KcOV.js} +67991 -66892
  62. package/dist/{useActionFeedback-DyUCQl2x.js → useActionFeedback-CXx7dOVc.js} +1 -1
  63. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js → vuedraggable-CBtQLb_S.js} +140 -139
  64. package/package.json +2 -2
  65. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-Bt_onPrP.js +0 -797
  66. package/dist/GroupList.vue_vue_type_script_setup_true_lang-Dgya_JLB.js +0 -2183
  67. package/dist/Ingredient-BlDW3TfZ.js +0 -463
  68. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-0tCpJlOf.js +0 -709
  69. package/dist/OrderPacing-Bb2n5wmI.js +0 -698
  70. package/dist/PrintRoute-CJB4gIP2.js +0 -473
  71. package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D8DygCBl.js +0 -110
  72. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-J6LpJ5wT.js +0 -1257
  73. package/dist/ProductList.vue_vue_type_script_setup_true_lang-DTLslTpK.js +0 -10353
  74. package/dist/Publish-BeKIXu3z.js +0 -1261
  75. package/dist/Recipe-Fo4tBkBv.js +0 -350
  76. package/dist/ServingSequence-BrCwLSO7.js +0 -336
  77. package/dist/Subcategory-B0oZIKbw.js +0 -412
  78. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D7mhnrXx.js +0 -1213
  79. package/dist/Unit-NhEwH-kr.js +0 -385
  80. package/dist/apps/mf-menu/src/views/MenuManagementEditor/RestaurantAttributesFilter.vue.d.ts +0 -2
@@ -0,0 +1,1337 @@
1
+ import { defineComponent as oe, openBlock as s, createElementBlock as b, createElementVNode as n, normalizeStyle as fl, normalizeClass as ze, computed as v, h as A, onUnmounted as de, resolveComponent as _, Fragment as j, createVNode as u, withCtx as k, unref as a, renderList as ne, createBlock as y, toDisplayString as i, createCommentVNode as $, ref as Ie, shallowRef as re, watch as Be, mergeProps as yl, withModifiers as Oe, createSlots as kl } from "vue";
2
+ import { useRouter as wl } from "vue-router";
3
+ import { useI18n as Se } from "@feedmepos/mf-common";
4
+ import { useDialog as xl, useBreakpoints as Cl, components as se } from "@feedmepos/ui-library";
5
+ import { _ as Ke } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
6
+ import { _ as Fl } from "./app-C_XNYz8_.js";
7
+ import { _ as Il } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
8
+ import { b as $e, u as me, a as Sl } from "./provide-Bwf3KcOV.js";
9
+ import { u as $l } from "./useActionFeedback-CXx7dOVc.js";
10
+ const Pl = ["aria-valuenow"], Al = /* @__PURE__ */ oe({
11
+ __name: "ProgressBar",
12
+ props: {
13
+ percent: {},
14
+ variant: { default: "neutral" }
15
+ },
16
+ setup(G) {
17
+ const d = G, t = {
18
+ neutral: "bg-fm-color-neutral-gray-200",
19
+ warning: "bg-fm-color-system-warning-300",
20
+ success: "bg-fm-color-system-success-300",
21
+ error: "bg-fm-color-system-error-300"
22
+ };
23
+ return (V, w) => (s(), b("div", {
24
+ class: "h-4 w-full overflow-hidden fm-corner-radius-md bg-fm-color-neutral-gray-100",
25
+ role: "progressbar",
26
+ "aria-valuenow": Math.min(100, Math.max(0, d.percent)),
27
+ "aria-valuemin": "0",
28
+ "aria-valuemax": "100"
29
+ }, [
30
+ n("div", {
31
+ class: ze(["h-full fm-corner-radius-md", t[d.variant]]),
32
+ style: fl({ width: `${Math.min(100, Math.max(0, d.percent))}%` })
33
+ }, null, 6)
34
+ ], 8, Pl));
35
+ }
36
+ }), je = {
37
+ PENDING: "text-fm-color-neutral-gray-300",
38
+ RUNNING: "text-fm-color-system-warning-300",
39
+ COMPLETED: "text-fm-color-system-success-300",
40
+ FAILED: "text-fm-color-system-error-300"
41
+ }, Ml = {
42
+ PENDING: "neutral",
43
+ RUNNING: "warning",
44
+ COMPLETED: "success",
45
+ FAILED: "error"
46
+ }, ce = {
47
+ PENDING: "menu.publish.scheduler_publish.status.pending",
48
+ RUNNING: "menu.publish.scheduler_publish.status.running",
49
+ COMPLETED: "menu.publish.scheduler_publish.status.completed",
50
+ FAILED: "menu.publish.scheduler_publish.status.failed"
51
+ }, Ll = [
52
+ "PENDING",
53
+ "RUNNING",
54
+ "COMPLETED",
55
+ "FAILED"
56
+ ], Vl = { class: "flex w-full items-center justify-between gap-8 pb-16" }, Nl = { class: "min-w-0 flex-1" }, Tl = { class: "fm-typo-en-body-md-600 select-none overflow-hidden text-ellipsis whitespace-nowrap text-fm-color-neutral-gray-400" }, Dl = { key: 0 }, Rl = {
57
+ key: 1,
58
+ class: "text-fm-color-neutral-gray-200"
59
+ }, Ul = {
60
+ key: 0,
61
+ class: "text-fm-color-typo-secondary",
62
+ role: "alert"
63
+ }, El = {
64
+ key: 1,
65
+ class: "text-fm-color-typo-secondary",
66
+ role: "status"
67
+ }, Bl = /* @__PURE__ */ oe({
68
+ __name: "PublishScheduleDetails",
69
+ props: {
70
+ session: {}
71
+ },
72
+ setup(G) {
73
+ const d = G, { t, d: V, locale: w } = Se(), Q = $e(), F = me(d.session), h = v(
74
+ () => F.value.status === "ready" ? F.value.value : null
75
+ ), R = v(() => {
76
+ var r;
77
+ return [...((r = h.value) == null ? void 0 : r.rows) ?? []];
78
+ }), N = v(
79
+ () => Ll.map((r) => ({
80
+ label: t(ce[r]),
81
+ value: r
82
+ }))
83
+ ), q = v(() => {
84
+ var r;
85
+ return [...((r = h.value) == null ? void 0 : r.statusFilter) ?? []];
86
+ });
87
+ function C(r) {
88
+ return new Intl.ListFormat(w.value, {
89
+ style: "long",
90
+ type: "conjunction"
91
+ }).format(r);
92
+ }
93
+ const P = v({
94
+ get: () => {
95
+ var I;
96
+ const r = ((I = h.value) == null ? void 0 : I.restaurantFilter) ?? [];
97
+ return r.length > 0 ? [...r] : null;
98
+ },
99
+ set: (r) => d.session.setRestaurantFilter(r ?? [])
100
+ }), p = v(() => {
101
+ var I;
102
+ if (P.value === null)
103
+ return t("menu.publish.scheduler_publish.selector.restaurant.all");
104
+ const r = new Map(
105
+ (((I = h.value) == null ? void 0 : I.restaurantOptions) ?? []).map((T) => [
106
+ T.restaurantId,
107
+ T.name ?? t("menu.common.labels.unknown")
108
+ ])
109
+ );
110
+ return C(
111
+ P.value.map((T) => r.get(T)).filter((T) => T !== void 0)
112
+ );
113
+ }), pe = v(
114
+ () => C(
115
+ q.value.map(
116
+ (r) => t(ce[r])
117
+ )
118
+ )
119
+ );
120
+ function be(r) {
121
+ return P.value === null || P.value.includes(r);
122
+ }
123
+ function he(r) {
124
+ return r ? V(new Date(r), {
125
+ year: "numeric",
126
+ month: "2-digit",
127
+ day: "2-digit",
128
+ hour: "2-digit",
129
+ hour12: !0,
130
+ minute: "2-digit",
131
+ second: "2-digit"
132
+ }) : "";
133
+ }
134
+ const J = v(() => [
135
+ {
136
+ accessorKey: "restaurantName",
137
+ header: () => t(
138
+ "menu.publish.scheduler_publish.restaurant_publish_details.table.column.restaurant"
139
+ ),
140
+ size: 600,
141
+ cell: (r) => r.getValue() ?? t("menu.common.labels.unknown")
142
+ },
143
+ {
144
+ id: "status",
145
+ accessorKey: "status",
146
+ header: () => t(
147
+ "menu.publish.scheduler_publish.restaurant_publish_details.table.column.status"
148
+ ),
149
+ cell: (r) => {
150
+ const I = r.getValue();
151
+ return A(
152
+ "p",
153
+ { class: je[I] },
154
+ t(ce[I])
155
+ );
156
+ }
157
+ },
158
+ {
159
+ accessorKey: "publishedAt",
160
+ header: () => t(
161
+ "menu.publish.scheduler_publish.restaurant_publish_details.table.column.published_at"
162
+ ),
163
+ cell: (r) => A(
164
+ "p",
165
+ { class: "whitespace-nowrap" },
166
+ he(r.getValue())
167
+ )
168
+ }
169
+ ]);
170
+ return de(() => d.session.dispose()), (r, I) => {
171
+ const T = _("FmIcon"), ve = _("FmChip"), U = _("FmMenuItem"), W = _("FmMenu"), _e = _("FmSelect"), X = _("FmCircularProgress"), H = _("FmTable");
172
+ return s(), b(j, null, [
173
+ n("div", Vl, [
174
+ n("div", Nl, [
175
+ u(W, {
176
+ "close-on-click": !1,
177
+ width: 360
178
+ }, {
179
+ "menu-button": k(() => [
180
+ u(ve, null, {
181
+ default: k(() => [
182
+ u(T, {
183
+ color: "neutral-gray-400",
184
+ name: "storefront",
185
+ outline: "",
186
+ size: "sm"
187
+ }),
188
+ n("div", Tl, i(p.value), 1),
189
+ u(T, {
190
+ color: "neutral-gray-400",
191
+ name: "keyboard_arrow_down",
192
+ outline: "",
193
+ size: "sm"
194
+ })
195
+ ]),
196
+ _: 1
197
+ })
198
+ ]),
199
+ default: k(() => {
200
+ var M;
201
+ return [
202
+ u(U, {
203
+ "has-checkbox": "",
204
+ label: a(t)("menu.publish.scheduler_publish.selector.restaurant.all"),
205
+ "model-value": P.value === null,
206
+ onClick: I[0] || (I[0] = (S) => d.session.selectAllRestaurants())
207
+ }, null, 8, ["label", "model-value"]),
208
+ (s(!0), b(j, null, ne(((M = h.value) == null ? void 0 : M.restaurantOptions) ?? [], (S) => (s(), y(U, {
209
+ key: S.restaurantId,
210
+ "has-checkbox": "",
211
+ label: S.name ?? a(t)("menu.common.labels.unknown"),
212
+ "model-value": be(S.restaurantId),
213
+ onClick: (L) => d.session.toggleRestaurant(S.restaurantId)
214
+ }, null, 8, ["label", "model-value", "onClick"]))), 128))
215
+ ];
216
+ }),
217
+ _: 1
218
+ })
219
+ ]),
220
+ u(_e, {
221
+ class: "min-w-[200px] flex-shrink-0",
222
+ "aria-label": a(t)(
223
+ "menu.publish.scheduler_publish.restaurant_publish_details.table.column.status"
224
+ ),
225
+ "hide-chips": "",
226
+ items: N.value,
227
+ "model-value": q.value,
228
+ multiselect: "",
229
+ "onUpdate:modelValue": I[1] || (I[1] = (M) => d.session.setStatusFilter(M ?? []))
230
+ }, {
231
+ default: k(() => [
232
+ q.value.length > 0 ? (s(), b("div", Dl, i(pe.value), 1)) : (s(), b("div", Rl, i(a(t)(
233
+ "menu.publish.scheduler_publish.restaurant_publish_details.select_publish_status"
234
+ )), 1))
235
+ ]),
236
+ _: 1
237
+ }, 8, ["aria-label", "items", "model-value"])
238
+ ]),
239
+ a(F).status === "error" ? (s(), b("p", Ul, i(a(Q)(a(F).error.message)), 1)) : a(F).status === "unavailable" ? (s(), b("p", El, i(a(Q)(a(F).reason)), 1)) : a(F).status === "loading" ? (s(), y(X, { key: 2 })) : h.value && h.value.rows.length > 0 ? (s(), y(H, {
240
+ key: 3,
241
+ class: "flex-1 overflow-hidden",
242
+ "column-defs": J.value,
243
+ "hide-footer": "",
244
+ "page-size": h.value.rows.length,
245
+ "pin-header-row": "",
246
+ "row-data": R.value,
247
+ "shrink-at": !1
248
+ }, null, 8, ["column-defs", "page-size", "row-data"])) : h.value ? (s(), y(a(Ke), {
249
+ key: 4,
250
+ subtitle: "",
251
+ title: a(t)(
252
+ "menu.publish.scheduler_publish.restaurant_publish_details.no_publish_status"
253
+ )
254
+ }, null, 8, ["title"])) : $("", !0)
255
+ ], 64);
256
+ };
257
+ }
258
+ }), Ol = {
259
+ key: 1,
260
+ class: "text-fm-color-typo-secondary",
261
+ role: "alert"
262
+ }, zl = {
263
+ key: 2,
264
+ class: "space-y-16"
265
+ }, Kl = { class: "text-fm-color-typo-secondary" }, jl = { class: "space-y-4" }, Gl = { class: "space-y-4" }, Hl = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ql = { class: "fm-typo-en-body-lg-600" }, Jl = { class: "space-y-4" }, Wl = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Xl = { class: "fm-typo-en-body-lg-600" }, Yl = { class: "space-y-4" }, Ql = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Zl = { class: "fm-typo-en-body-lg-600" }, et = { class: "space-y-4" }, lt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, tt = { class: "fm-typo-en-body-lg-600" }, at = { class: "space-y-4" }, st = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, nt = { class: "fm-typo-en-body-lg-600" }, ot = { class: "space-y-4" }, ut = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, it = { class: "fm-typo-en-body-lg-600" }, rt = /* @__PURE__ */ oe({
266
+ __name: "PublishRevertPreview",
267
+ props: {
268
+ session: {}
269
+ },
270
+ setup(G) {
271
+ const d = G, { d: t, locale: V, t: w } = Se(), Q = $e(), F = me(d.session), h = v(
272
+ () => F.value.status === "ready" ? F.value.value : null
273
+ );
274
+ function R(C) {
275
+ return C === null ? w("menu.publish.labels.none") : C.kind === "default" ? w("menu.publish.labels.catalog.main") : C.kind === "missing" ? w("menu.publish.labels.catalog.invalid") : C.name;
276
+ }
277
+ function N(C) {
278
+ return C ? t(new Date(C), {
279
+ year: "2-digit",
280
+ month: "2-digit",
281
+ day: "2-digit",
282
+ hour: "numeric",
283
+ minute: "2-digit",
284
+ hour12: !0
285
+ }) : w("menu.publish.labels.none");
286
+ }
287
+ function q(C) {
288
+ return C.length === 0 ? w("menu.publish.labels.none") : new Intl.ListFormat(V.value, {
289
+ style: "long",
290
+ type: "conjunction"
291
+ }).format(C.map(R));
292
+ }
293
+ return de(() => d.session.dispose()), (C, P) => {
294
+ const p = _("FmCircularProgress");
295
+ return a(F).status === "loading" ? (s(), y(p, { key: 0 })) : a(F).status === "error" ? (s(), b("p", Ol, i(a(Q)(a(F).error.message)), 1)) : h.value ? (s(), b("div", zl, [
296
+ n("p", Kl, i(a(w)("menu.revert.description", { name: h.value.restaurantName })), 1),
297
+ n("dl", jl, [
298
+ n("div", Gl, [
299
+ n("dt", Hl, i(a(w)("menu.revert.labels.restaurant")), 1),
300
+ n("dd", ql, i(h.value.restaurantName), 1)
301
+ ]),
302
+ n("div", Jl, [
303
+ n("dt", Wl, i(a(w)("menu.revert.labels.revert_to")), 1),
304
+ n("dd", Xl, i(N(h.value.publishedAt)), 1)
305
+ ]),
306
+ n("div", Yl, [
307
+ n("dt", Ql, i(a(w)("menu.revert.labels.default")), 1),
308
+ n("dd", Zl, i(R(h.value.defaultCatalog)), 1)
309
+ ]),
310
+ n("div", et, [
311
+ n("dt", lt, i(a(w)("menu.revert.labels.pos_takeaway")), 1),
312
+ n("dd", tt, i(R(h.value.takeawayCatalog)), 1)
313
+ ]),
314
+ n("div", at, [
315
+ n("dt", st, i(a(w)("menu.revert.labels.pickup")), 1),
316
+ n("dd", nt, i(R(h.value.pickupCatalog)), 1)
317
+ ]),
318
+ n("div", ot, [
319
+ n("dt", ut, i(a(w)("menu.revert.labels.additional_catalogs")), 1),
320
+ n("dd", it, i(q(h.value.additionalCatalogs)), 1)
321
+ ])
322
+ ])
323
+ ])) : $("", !0);
324
+ };
325
+ }
326
+ }), ct = {
327
+ key: 0,
328
+ class: "ml-8 flex flex-1 items-center gap-16"
329
+ }, dt = {
330
+ key: 0,
331
+ class: "text-fm-color-typo-secondary",
332
+ role: "alert"
333
+ }, mt = {
334
+ key: 1,
335
+ "data-menu-state": "unavailable",
336
+ class: "text-fm-color-typo-secondary"
337
+ }, pt = { class: "mb-8 flex items-center justify-between gap-8 xs:flex-wrap xs:px-16 xs:pt-8" }, bt = { class: "fm-typo-en-body-md-600 select-none overflow-hidden text-ellipsis whitespace-nowrap text-fm-color-neutral-gray-400" }, ht = { class: "ml-auto w-[280px] xs:ml-0 xs:w-full" }, vt = { class: "min-w-0 grow flex flex-col gap-4" }, _t = { class: "flex gap-8 items-center" }, gt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, ft = { class: "space-y-4" }, yt = { class: "fm-typo-en-body-lg-600 break-words" }, kt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary break-words" }, wt = { class: "flex shrink-0 gap-8" }, xt = {
338
+ key: 3,
339
+ class: "fixed right-16 bottom-[72px] z-[100]"
340
+ }, Ct = { class: "flex items-center gap-24" }, Ft = { class: "fm-typo-en-title-md-600" }, It = {
341
+ key: 0,
342
+ class: "text-fm-color-typo-secondary",
343
+ role: "alert"
344
+ }, St = {
345
+ key: 1,
346
+ class: "text-fm-color-typo-secondary",
347
+ role: "status"
348
+ }, $t = {
349
+ key: 5,
350
+ class: "bg-fm-color-neutral-gray-100"
351
+ }, Pt = {
352
+ key: 1,
353
+ class: "text-fm-color-typo-secondary",
354
+ role: "alert"
355
+ }, At = {
356
+ key: 2,
357
+ class: "text-fm-color-typo-secondary",
358
+ role: "status"
359
+ }, Mt = { class: "grid grid-cols-[164px_163px_163px_1fr] items-center px-16 py-4" }, Lt = { class: "flex justify-end gap-8" }, Vt = {
360
+ key: 0,
361
+ class: "flex gap-8 px-16 pb-12"
362
+ }, Nt = { class: "fm-typo-en-title-md-600" }, Tt = { class: "mt-40" }, Dt = { class: "fm-typo-en-title-sm-600" }, Rt = { class: "fm-typo-en-body-md-400 mb-8 mt-4 text-fm-color-typo-secondary" }, Ut = {
363
+ key: 1,
364
+ class: "text-fm-color-typo-secondary",
365
+ role: "alert"
366
+ }, Et = {
367
+ key: 2,
368
+ class: "text-fm-color-typo-secondary",
369
+ role: "status"
370
+ }, Bt = { class: "flex items-center justify-start gap-8" }, Ot = /* @__PURE__ */ oe({
371
+ __name: "PublishList",
372
+ props: {
373
+ sdk: {}
374
+ },
375
+ setup(G) {
376
+ const d = G, { t, n: V, d: w, locale: Q } = Se(), F = wl(), h = $e(), R = xl(), { run: N } = $l(), { breakpoints: q } = Cl(), C = v(() => q.value.xs), P = me(
377
+ d.sdk.publish.restaurants
378
+ ), p = v(
379
+ () => P.value.status === "ready" ? P.value.value : null
380
+ ), pe = v(() => {
381
+ var e;
382
+ return [...((e = p.value) == null ? void 0 : e.rows) ?? []];
383
+ }), be = v(
384
+ () => {
385
+ var e;
386
+ return ((e = p.value) == null ? void 0 : e.selectedRestaurantIds) ?? [];
387
+ }
388
+ ), he = v(
389
+ () => Object.fromEntries(
390
+ be.value.map((e) => [e, !0])
391
+ )
392
+ ), J = v(() => {
393
+ var e;
394
+ return ((e = p.value) == null ? void 0 : e.restaurantFilter) ?? [];
395
+ }), r = v(() => {
396
+ var e;
397
+ return ((e = p.value) == null ? void 0 : e.statusFilter) ?? [];
398
+ }), I = [
399
+ "latest",
400
+ "outdated",
401
+ "publishing",
402
+ "queued"
403
+ ];
404
+ function T(e) {
405
+ return new Intl.ListFormat(Q.value, {
406
+ style: "long",
407
+ type: "conjunction"
408
+ }).format(e);
409
+ }
410
+ const ve = v(() => {
411
+ var l;
412
+ if (J.value.length === 0)
413
+ return t("menu.publish.scheduler_publish.selector.restaurant.all");
414
+ const e = new Map(
415
+ (((l = p.value) == null ? void 0 : l.restaurantOptions) ?? []).map((c) => [
416
+ c.restaurantId,
417
+ c.name
418
+ ])
419
+ );
420
+ return T(
421
+ J.value.map((c) => e.get(c)).filter((c) => c !== void 0)
422
+ );
423
+ }), U = me(
424
+ d.sdk.publish.progress
425
+ ), W = v(
426
+ () => U.value.status === "ready" ? U.value.value : null
427
+ ), _e = v(() => {
428
+ var e;
429
+ return [...((e = W.value) == null ? void 0 : e.rows) ?? []];
430
+ }), X = Ie(!1), H = Ie(!1), M = Ie(!1), S = re(null), L = re(null);
431
+ let le = null;
432
+ function Ge(e) {
433
+ return e ? w(new Date(e), {
434
+ year: "numeric",
435
+ month: "2-digit",
436
+ day: "2-digit",
437
+ hour: "2-digit",
438
+ minute: "2-digit",
439
+ second: "2-digit",
440
+ hour12: !0
441
+ }) : "";
442
+ }
443
+ function ge(e) {
444
+ return e ? w(new Date(e), {
445
+ year: "numeric",
446
+ month: "2-digit",
447
+ day: "2-digit",
448
+ hour: "2-digit",
449
+ minute: "2-digit",
450
+ hour12: !0
451
+ }) : "";
452
+ }
453
+ function He() {
454
+ var e, l;
455
+ return ((l = (e = E.value) == null ? void 0 : e.scheduledAt) == null ? void 0 : l.split("T")[0]) ?? null;
456
+ }
457
+ function qe(e) {
458
+ const l = e == null ? void 0 : e.inputEl;
459
+ l instanceof HTMLInputElement && l.setAttribute(
460
+ "aria-label",
461
+ t("menu.publish.scheduler_publish.selector.date_time")
462
+ );
463
+ }
464
+ function Je() {
465
+ var l;
466
+ const e = (l = E.value) == null ? void 0 : l.scheduledAt;
467
+ return e ? w(new Date(e), {
468
+ year: "numeric",
469
+ month: "numeric",
470
+ day: "numeric",
471
+ hour: "numeric",
472
+ minute: "2-digit",
473
+ hour12: !0
474
+ }) : "";
475
+ }
476
+ const We = v(
477
+ () => {
478
+ var e;
479
+ return ((e = E.value) == null ? void 0 : e.scheduledAt) !== null;
480
+ }
481
+ );
482
+ function Xe(e) {
483
+ var c, g, m;
484
+ const l = ((g = (c = E.value) == null ? void 0 : c.scheduledAt) == null ? void 0 : g.split("T")[1]) ?? "00:00";
485
+ (m = S.value) == null || m.setScheduledAt(`${e}T${l}`);
486
+ }
487
+ function fe(e) {
488
+ var c, g;
489
+ const l = ((g = (c = E.value) == null ? void 0 : c.scheduledAt) == null ? void 0 : g.split("T")[1]) ?? "00:00";
490
+ return e === "minute" ? l.slice(3, 5) : l.slice(0, 2) === "00" ? "12" : l.slice(0, 2);
491
+ }
492
+ function Pe(e, l) {
493
+ var Y, ee, ae;
494
+ const c = (Y = E.value) == null ? void 0 : Y.scheduledAt, g = c == null ? void 0 : c.split("T")[0];
495
+ if (!g) return;
496
+ const m = ((ee = c == null ? void 0 : c.split("T")[1]) == null ? void 0 : ee.slice(0, 2)) ?? "00", O = e === "hour" ? l === "12" ? "00" : l : m, K = e === "minute" ? l : fe("minute");
497
+ (ae = S.value) == null || ae.setScheduledAt(`${g}T${O}:${K}`);
498
+ }
499
+ const Ye = v(
500
+ () => {
501
+ var e;
502
+ return t("menu.publish.labels.main_version", {
503
+ version: ge((e = p.value) == null ? void 0 : e.mainVersionAt)
504
+ });
505
+ }
506
+ );
507
+ function Z(e) {
508
+ switch (e.kind) {
509
+ case "named":
510
+ return e.name;
511
+ case "missing":
512
+ return t("menu.publish.labels.catalog.invalid");
513
+ case "default":
514
+ return t("menu.publish.labels.catalog.main");
515
+ }
516
+ }
517
+ async function Qe() {
518
+ var e;
519
+ ((e = p.value) == null ? void 0 : e.refresh.state) === "allowed" && await N(() => d.sdk.publish.refresh(), {
520
+ loadingMessage: t("menu.common.loading")
521
+ });
522
+ }
523
+ function Ze(e) {
524
+ d.sdk.publish.search(e);
525
+ }
526
+ function el() {
527
+ F.hasRoute("$settings-my-business") && F.push({ name: "$settings-my-business" });
528
+ }
529
+ function ll(e) {
530
+ return J.value.length === 0 || J.value.includes(e);
531
+ }
532
+ function tl(e) {
533
+ d.sdk.publish.setStatusFilter(e);
534
+ }
535
+ function al(e) {
536
+ tl(
537
+ r.value.includes(e) ? r.value.filter((l) => l !== e) : [...r.value, e]
538
+ );
539
+ }
540
+ function sl(e) {
541
+ d.sdk.publish.setSelectedRestaurants(
542
+ Object.entries(e).filter(([, l]) => l).map(([l]) => l)
543
+ );
544
+ }
545
+ async function Ae() {
546
+ await N(() => d.sdk.publish.publish(), {
547
+ loadingMessage: t("menu.common.loading"),
548
+ successMessage: (e) => {
549
+ var l;
550
+ return e.restaurantIds.length === ((l = p.value) == null ? void 0 : l.totalCount) ? t("menu.publish.actions.snackbar.published_all") : t("menu.publish.actions.snackbar.published", {
551
+ count: V(e.restaurantIds.length)
552
+ });
553
+ }
554
+ });
555
+ }
556
+ function Me(e) {
557
+ N(() => d.sdk.publish.publishOne(e.restaurantId), {
558
+ loadingMessage: t("menu.publish.actions.snackbar.restaurant_publishing", {
559
+ name: e.restaurantName
560
+ }),
561
+ successMessage: t("menu.publish.actions.snackbar.restaurant_published", {
562
+ name: e.restaurantName
563
+ })
564
+ });
565
+ }
566
+ function Le(e) {
567
+ if (e.revert.state !== "allowed") return;
568
+ const l = d.sdk.publish.revertPreview(e.restaurantId);
569
+ R.open({
570
+ title: t("menu.revert.title"),
571
+ contentComponent: rt,
572
+ contentComponentProps: { session: l },
573
+ primaryActions: {
574
+ text: t("menu.revert.action"),
575
+ close: !0
576
+ },
577
+ secondaryActions: {
578
+ text: t("menu.common.actions.cancel"),
579
+ close: !0
580
+ }
581
+ }).onPrimary(
582
+ () => N(() => d.sdk.publish.revert(e.restaurantId), {
583
+ loadingTitle: t("menu.publish.actions.snackbar.reverting", {
584
+ name: e.restaurantName
585
+ }),
586
+ successMessage: t("menu.publish.actions.snackbar.reverted")
587
+ })
588
+ );
589
+ }
590
+ function nl() {
591
+ ye();
592
+ const e = d.sdk.publish.scheduleEditor();
593
+ S.value = e, L.value = e.get(), le = e.subscribe((l) => {
594
+ L.value = l;
595
+ }), M.value = !0;
596
+ }
597
+ function ye() {
598
+ var e;
599
+ le == null || le(), le = null, (e = S.value) == null || e.dispose(), S.value = null, L.value = null;
600
+ }
601
+ const E = v(
602
+ () => {
603
+ var e;
604
+ return ((e = L.value) == null ? void 0 : e.status) === "ready" ? L.value.value : null;
605
+ }
606
+ );
607
+ async function ol() {
608
+ var c;
609
+ if (!S.value) return;
610
+ const e = ((c = E.value) == null ? void 0 : c.restaurantIds.length) ?? 0;
611
+ (await N(() => S.value.submit(), {
612
+ loadingMessage: t("menu.common.loading"),
613
+ successMessage: t("menu.publish.actions.snackbar.scheduled", {
614
+ count: V(e)
615
+ }),
616
+ // `submit()` switches its capability to disabled synchronously only
617
+ // after accepting a write. Local composite validation stays allowed,
618
+ // so it gets the legacy immediate error toast without a spinner.
619
+ showLoading: () => {
620
+ var m;
621
+ const g = (m = S.value) == null ? void 0 : m.get();
622
+ return (g == null ? void 0 : g.status) === "ready" && g.value.submit.state === "disabled";
623
+ },
624
+ toastFieldIssues: !0
625
+ })).kind === "success" && (M.value = !1);
626
+ }
627
+ Be(M, (e) => {
628
+ e || ye();
629
+ }), de(ye);
630
+ function ul(e) {
631
+ R.open({
632
+ title: t("menu.publish.scheduler_publish.remove_scheduled.title"),
633
+ message: t("menu.publish.scheduler_publish.remove_scheduled.message"),
634
+ primaryActions: {
635
+ text: t("menu.common.actions.remove"),
636
+ close: !0
637
+ },
638
+ secondaryActions: {
639
+ text: t("menu.common.actions.cancel"),
640
+ close: !0
641
+ }
642
+ }).onPrimary(
643
+ () => N(() => d.sdk.publish.cancelSchedule(e.scheduledAt), {
644
+ successMessage: t(
645
+ "menu.publish.scheduler_publish.remove_scheduled.success"
646
+ ),
647
+ successPresentation: "message",
648
+ showLoading: !1
649
+ })
650
+ );
651
+ }
652
+ const B = re(null), z = re(
653
+ null
654
+ );
655
+ let te = null;
656
+ function Ve(e) {
657
+ if (e.openCatalogMapping.state !== "allowed") return;
658
+ ke();
659
+ const l = d.sdk.publish.catalogMapping(e.restaurantId);
660
+ B.value = l, z.value = l.get(), te = l.subscribe((c) => {
661
+ z.value = c;
662
+ }), H.value = !0;
663
+ }
664
+ function ke() {
665
+ var e;
666
+ te == null || te(), te = null, (e = B.value) == null || e.dispose(), B.value = null, z.value = null;
667
+ }
668
+ Be(H, (e) => {
669
+ e || ke();
670
+ }), de(ke);
671
+ const D = v(
672
+ () => {
673
+ var e;
674
+ return ((e = z.value) == null ? void 0 : e.status) === "ready" ? z.value.value : null;
675
+ }
676
+ ), we = v(() => {
677
+ var e;
678
+ return [
679
+ {
680
+ label: t(
681
+ "menu.publish.update_catalog_dialog.sections.default.use_default"
682
+ ),
683
+ value: null
684
+ },
685
+ ...(((e = D.value) == null ? void 0 : e.catalogOptions) ?? []).map((l) => ({
686
+ label: l.name,
687
+ value: l.catalogId
688
+ }))
689
+ ];
690
+ }), il = v(
691
+ () => {
692
+ var e;
693
+ return (((e = D.value) == null ? void 0 : e.additionalCatalogs) ?? []).filter((l) => l.selected).map((l) => l.catalogId);
694
+ }
695
+ );
696
+ function xe(e, l) {
697
+ B.value && (e === "catalogId" ? B.value.setCatalogId(l) : e === "takeawayCatalog" ? B.value.setTakeawayCatalog(l) : B.value.setPickupCatalog(l));
698
+ }
699
+ function rl(e) {
700
+ var l;
701
+ (l = B.value) == null || l.setAdditionalCatalogs(e);
702
+ }
703
+ async function cl() {
704
+ var g, m, O, K;
705
+ if (!B.value) return;
706
+ const e = (g = D.value) == null ? void 0 : g.restaurantId, l = ((O = (m = p.value) == null ? void 0 : m.rows.find((Y) => Y.restaurantId === e)) == null ? void 0 : O.restaurantName) ?? ((K = D.value) == null ? void 0 : K.displayName) ?? "";
707
+ (await N(() => B.value.submit(), {
708
+ loadingTitle: t("menu.publish.actions.snackbar.restaurant_publishing", {
709
+ name: l
710
+ }),
711
+ loadingMessage: t("menu.common.loading"),
712
+ successMessage: t("menu.publish.actions.snackbar.restaurant_published", {
713
+ name: l
714
+ })
715
+ })).kind === "success" && (H.value = !1);
716
+ }
717
+ function dl(e) {
718
+ if (e.openDetails.state !== "allowed") return;
719
+ const l = d.sdk.publish.scheduleDetails(e.scheduledAt);
720
+ R.open({
721
+ title: t(
722
+ "menu.publish.scheduler_publish.restaurant_publish_details.title"
723
+ ),
724
+ contentComponent: Bl,
725
+ contentComponentProps: { session: l },
726
+ contentClass: "flex flex-col h-full",
727
+ maxWidth: "800px",
728
+ maxHeight: "80vh"
729
+ });
730
+ }
731
+ function Ne(e) {
732
+ const l = e === "latest";
733
+ return {
734
+ label: t(e === "publishing" ? "menu.publish.table.status.publishing" : e === "queued" ? "menu.publish.table.status.queued" : l ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
735
+ variant: l ? "success" : e === "outdated" ? (
736
+ // Legacy represents an out-of-date menu as an orange, not
737
+ // mustard, state. FmChip's warning variant is mustard, so the
738
+ // neutral chip below receives the semantic warning tokens.
739
+ "plain"
740
+ ) : e === "publishing" ? "info" : "plain",
741
+ class: e === "outdated" ? "bg-fm-color-system-warning-100 text-fm-color-primary" : void 0
742
+ };
743
+ }
744
+ const ml = v(() => [
745
+ {
746
+ accessorKey: "displayName",
747
+ header: () => t("menu.publish.table.columns.restaurant"),
748
+ cell: (e) => e.getValue(),
749
+ enableSorting: !0
750
+ },
751
+ {
752
+ id: "defaultCatalog",
753
+ accessorKey: "defaultCatalog",
754
+ header: () => t("menu.publish.table.columns.default"),
755
+ enableSorting: !1,
756
+ cell: (e) => Z(e.getValue())
757
+ },
758
+ {
759
+ id: "takeawayCatalog",
760
+ accessorKey: "takeawayCatalog",
761
+ header: () => t("menu.publish.table.columns.pos_takeaway"),
762
+ enableSorting: !1,
763
+ cell: (e) => Z(e.getValue())
764
+ },
765
+ {
766
+ id: "pickupCatalog",
767
+ accessorKey: "pickupCatalog",
768
+ header: () => t("menu.publish.table.columns.pickup"),
769
+ enableSorting: !1,
770
+ cell: (e) => Z(e.getValue())
771
+ },
772
+ {
773
+ accessorKey: "publishedAt",
774
+ header: () => t("menu.publish.table.columns.version"),
775
+ enableSorting: !1,
776
+ cell: (e) => ge(e.getValue())
777
+ },
778
+ {
779
+ accessorKey: "status",
780
+ header: () => t("menu.common.labels.status"),
781
+ enableSorting: !1,
782
+ cell: (e) => A(
783
+ se.FmChip,
784
+ Ne(e.getValue())
785
+ )
786
+ },
787
+ {
788
+ id: "actions",
789
+ header: "",
790
+ enableSorting: !1,
791
+ cell: (e) => {
792
+ var m;
793
+ const l = (m = e == null ? void 0 : e.row) == null ? void 0 : m.original;
794
+ if (!l) return null;
795
+ const c = l.publish ?? { state: "disabled" }, g = l.revert ?? { state: "hidden" };
796
+ return A("div", { class: "flex justify-end gap-4" }, [
797
+ g.state === "hidden" ? null : A(se.FmButton, {
798
+ icon: "undo",
799
+ variant: "secondary",
800
+ disabled: g.state !== "allowed",
801
+ ariaLabel: t("menu.publish.actions.revert"),
802
+ onClick: (O) => {
803
+ O.stopPropagation(), Le(l);
804
+ }
805
+ }),
806
+ A(se.FmButton, {
807
+ label: t("menu.publish.actions.publish"),
808
+ prependIcon: "ios_share",
809
+ size: "md",
810
+ variant: "secondary",
811
+ disabled: c.state !== "allowed",
812
+ onClick: (O) => {
813
+ O.stopPropagation(), Me(l);
814
+ }
815
+ })
816
+ ]);
817
+ }
818
+ }
819
+ ]), pl = v(() => [
820
+ {
821
+ accessorKey: "scheduledAt",
822
+ header: () => t("menu.publish.scheduler_publish.table.columns.date"),
823
+ cell: (e) => Ge(e.getValue())
824
+ },
825
+ {
826
+ accessorKey: "publisherName",
827
+ header: () => t("menu.publish.scheduler_publish.table.columns.publisher_name"),
828
+ cell: (e) => e.getValue() ?? t("menu.common.labels.unknown")
829
+ },
830
+ {
831
+ accessorKey: "restaurantCount",
832
+ header: () => t("menu.publish.scheduler_publish.table.columns.total_restaurants"),
833
+ cell: (e) => t("menu.publish.scheduler_publish.table.row.restaurants", {
834
+ total: V(e.getValue())
835
+ })
836
+ },
837
+ {
838
+ id: "progress",
839
+ accessorKey: "progressPercent",
840
+ header: () => t("menu.publish.scheduler_publish.table.columns.progress"),
841
+ cell: (e) => {
842
+ var c, g;
843
+ const l = e.row.original;
844
+ return A("div", { class: "flex items-center justify-between gap-32" }, [
845
+ A("div", { class: "flex w-full flex-col gap-4" }, [
846
+ A("div", { class: "flex items-center gap-8" }, [
847
+ A(
848
+ "p",
849
+ {
850
+ class: `fm-typo-en-body-md-400 ${je[l.status]}`
851
+ },
852
+ t(ce[l.status])
853
+ ),
854
+ l.status === "RUNNING" ? A(
855
+ "span",
856
+ {
857
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
858
+ },
859
+ t("menu.publish.scheduler_publish.table.row.progress", {
860
+ published: V(l.publishedCount),
861
+ total: V(l.restaurantCount)
862
+ })
863
+ ) : null
864
+ ]),
865
+ A(Al, {
866
+ percent: l.progressPercent,
867
+ variant: Ml[l.status]
868
+ })
869
+ ]),
870
+ A(se.FmButton, {
871
+ variant: "plain",
872
+ prependIcon: "info",
873
+ "aria-label": t(
874
+ "menu.publish.scheduler_publish.restaurant_publish_details.title"
875
+ ),
876
+ disabled: ((c = l.openDetails) == null ? void 0 : c.state) !== "allowed",
877
+ onClick: () => dl(l)
878
+ }),
879
+ A(se.FmButton, {
880
+ icon: "delete",
881
+ variant: "tertiary",
882
+ disabled: ((g = l.cancel) == null ? void 0 : g.state) !== "allowed",
883
+ ariaLabel: t("menu.common.actions.remove"),
884
+ onClick: (m) => {
885
+ m.stopPropagation(), ul(l);
886
+ }
887
+ })
888
+ ]);
889
+ }
890
+ }
891
+ ]);
892
+ return (e, l) => {
893
+ const c = _("FmChip"), g = _("FmSpacer"), m = _("FmButton"), O = _("FmBadge"), K = _("FmCircularProgress"), Y = _("FmIcon"), ee = _("FmMenuItem"), ae = _("FmMenu"), bl = _("FmSearch"), Te = _("FmTable"), hl = _("FmListItem"), vl = _("FmList"), Ce = _("FmTextField"), _l = _("FmDatePicker"), ue = _("FmSelect"), De = _("FmSideSheet"), gl = _("FmCheckbox");
894
+ return s(), y(Il, {
895
+ heading: a(t)("menu.publish.title")
896
+ }, {
897
+ "append-heading": k(() => {
898
+ var o, f, x, ie, Re, Ue;
899
+ return [
900
+ C.value ? $("", !0) : (s(), b("div", ct, [
901
+ (o = p.value) != null && o.mainVersionAt ? (s(), y(c, {
902
+ key: 0,
903
+ label: Ye.value,
904
+ class: "bg-fm-color-system-warning-100 text-fm-color-primary"
905
+ }, null, 8, ["label"])) : $("", !0),
906
+ u(g),
907
+ p.value ? (s(), y(m, {
908
+ key: 1,
909
+ disabled: p.value.refresh.state !== "allowed",
910
+ label: a(t)("menu.publish.actions.refresh"),
911
+ variant: "secondary",
912
+ onClick: Qe
913
+ }, null, 8, ["disabled", "label"])) : $("", !0),
914
+ (f = p.value) != null && f.hasRunningJob ? (s(), y(O, {
915
+ key: 2,
916
+ value: 1,
917
+ variant: "critical"
918
+ }, {
919
+ default: k(() => {
920
+ var Fe, Ee;
921
+ return [
922
+ u(m, {
923
+ disabled: ((Ee = (Fe = p.value) == null ? void 0 : Fe.openProgress) == null ? void 0 : Ee.state) !== "allowed",
924
+ label: a(t)("menu.publish.actions.publish_progress"),
925
+ variant: "secondary",
926
+ onClick: l[0] || (l[0] = (zt) => X.value = !0)
927
+ }, null, 8, ["disabled", "label"])
928
+ ];
929
+ }),
930
+ _: 1
931
+ })) : p.value ? (s(), y(m, {
932
+ key: 3,
933
+ disabled: ((ie = (x = p.value) == null ? void 0 : x.openProgress) == null ? void 0 : ie.state) !== "allowed",
934
+ label: a(t)("menu.publish.actions.publish_progress"),
935
+ variant: "secondary",
936
+ onClick: l[1] || (l[1] = (Fe) => X.value = !0)
937
+ }, null, 8, ["disabled", "label"])) : $("", !0),
938
+ p.value ? (s(), y(m, {
939
+ key: 4,
940
+ disabled: ((Ue = (Re = p.value) == null ? void 0 : Re.publish) == null ? void 0 : Ue.state) !== "allowed",
941
+ label: a(t)("menu.publish.actions.publish_all"),
942
+ "prepend-icon": "ios_share",
943
+ onClick: Ae
944
+ }, null, 8, ["disabled", "label"])) : $("", !0)
945
+ ]))
946
+ ];
947
+ }),
948
+ default: k(() => [
949
+ a(P).status === "error" ? (s(), b("p", dt, i(a(h)(a(P).error.message)), 1)) : a(P).status === "unavailable" ? (s(), b("div", mt, i(a(h)(a(P).reason)), 1)) : a(P).status === "loading" ? (s(), y(K, { key: 2 })) : p.value ? (s(), b(j, { key: 3 }, [
950
+ n("div", pt, [
951
+ u(ae, {
952
+ "close-on-click": !1,
953
+ width: 360
954
+ }, {
955
+ "menu-button": k(() => [
956
+ u(c, null, {
957
+ default: k(() => [
958
+ u(Y, {
959
+ color: "neutral-gray-400",
960
+ name: "storefront",
961
+ outline: "",
962
+ size: "sm"
963
+ }),
964
+ n("div", bt, i(ve.value), 1),
965
+ u(Y, {
966
+ color: "neutral-gray-400",
967
+ name: "keyboard_arrow_down",
968
+ outline: "",
969
+ size: "sm"
970
+ })
971
+ ]),
972
+ _: 1
973
+ })
974
+ ]),
975
+ default: k(() => [
976
+ u(ee, {
977
+ "has-checkbox": "",
978
+ label: a(t)("menu.publish.scheduler_publish.selector.restaurant.all"),
979
+ "model-value": J.value.length === 0,
980
+ onClick: l[2] || (l[2] = (o) => d.sdk.publish.selectAllRestaurants())
981
+ }, null, 8, ["label", "model-value"]),
982
+ (s(!0), b(j, null, ne(p.value.restaurantOptions, (o) => (s(), y(ee, {
983
+ key: o.restaurantId,
984
+ "has-checkbox": "",
985
+ label: o.name,
986
+ "model-value": ll(o.restaurantId),
987
+ onClick: (f) => d.sdk.publish.toggleRestaurantFilter(o.restaurantId)
988
+ }, null, 8, ["label", "model-value", "onClick"]))), 128))
989
+ ]),
990
+ _: 1
991
+ }),
992
+ u(ae, { "close-on-click": !1 }, {
993
+ "menu-button": k(() => [
994
+ u(m, {
995
+ "prepend-icon": "add",
996
+ label: a(t)("menu.publish.table.filter"),
997
+ variant: "secondary"
998
+ }, null, 8, ["label"])
999
+ ]),
1000
+ default: k(() => [
1001
+ (s(), b(j, null, ne(I, (o) => u(ee, {
1002
+ key: o,
1003
+ "has-checkbox": "",
1004
+ label: a(t)(
1005
+ o === "latest" ? "menu.publish.table.status.latest" : o === "outdated" ? "menu.publish.table.status.outdated" : o === "publishing" ? "menu.publish.table.status.publishing" : "menu.publish.table.status.queued"
1006
+ ),
1007
+ "model-value": r.value.includes(o),
1008
+ onClick: (f) => al(o)
1009
+ }, null, 8, ["label", "model-value", "onClick"])), 64))
1010
+ ]),
1011
+ _: 1
1012
+ }),
1013
+ n("div", ht, [
1014
+ u(bl, {
1015
+ "aria-label": a(t)("menu.publish.table.search.placeholder"),
1016
+ "model-value": p.value.query,
1017
+ placeholder: a(t)("menu.publish.table.search.placeholder"),
1018
+ "onUpdate:modelValue": Ze
1019
+ }, null, 8, ["aria-label", "model-value", "placeholder"])
1020
+ ])
1021
+ ]),
1022
+ p.value.totalCount === 0 ? (s(), y(a(Ke), {
1023
+ key: 0,
1024
+ action: {
1025
+ text: a(t)("menu.publish.empty.action"),
1026
+ icon: "add",
1027
+ callback: el
1028
+ },
1029
+ subtitle: a(t)("menu.publish.empty.subtitle"),
1030
+ title: a(t)("menu.publish.empty.title")
1031
+ }, null, 8, ["action", "subtitle", "title"])) : C.value ? (s(), y(vl, {
1032
+ key: 2,
1033
+ class: "w-full px-16 flex-1 min-h-0 overflow-auto pb-64",
1034
+ separator: ""
1035
+ }, {
1036
+ default: k(() => [
1037
+ (s(!0), b(j, null, ne(p.value.rows, (o) => (s(), y(hl, {
1038
+ key: o.restaurantId,
1039
+ class: "!py-12 !px-0",
1040
+ onClick: (f) => Ve(o)
1041
+ }, {
1042
+ default: k(() => [
1043
+ n("div", vt, [
1044
+ n("div", _t, [
1045
+ n("div", gt, i(ge(o.publishedAt)), 1),
1046
+ u(c, yl({ ref_for: !0 }, Ne(o.status)), null, 16)
1047
+ ]),
1048
+ n("div", ft, [
1049
+ n("div", yt, i(o.displayName), 1),
1050
+ n("div", kt, [
1051
+ n("div", null, i(a(t)("menu.common.labels.a11y_labelled_name", {
1052
+ label: a(t)("menu.publish.table.columns.default"),
1053
+ name: Z(o.defaultCatalog)
1054
+ })), 1),
1055
+ n("div", null, i(a(t)("menu.common.labels.a11y_labelled_name", {
1056
+ label: a(t)("menu.publish.table.columns.pos_takeaway"),
1057
+ name: Z(o.takeawayCatalog)
1058
+ })), 1),
1059
+ n("div", null, i(a(t)("menu.common.labels.a11y_labelled_name", {
1060
+ label: a(t)("menu.publish.table.columns.pickup"),
1061
+ name: Z(o.pickupCatalog)
1062
+ })), 1)
1063
+ ])
1064
+ ])
1065
+ ]),
1066
+ n("div", wt, [
1067
+ o.revert.state !== "hidden" ? (s(), y(m, {
1068
+ key: 0,
1069
+ "aria-label": a(t)("menu.publish.actions.revert"),
1070
+ disabled: o.revert.state !== "allowed",
1071
+ icon: "undo",
1072
+ variant: "tertiary",
1073
+ onClick: Oe((f) => Le(o), ["stop"])
1074
+ }, null, 8, ["aria-label", "disabled", "onClick"])) : $("", !0),
1075
+ u(m, {
1076
+ "aria-label": a(t)("menu.publish.actions.publish"),
1077
+ disabled: o.publish.state !== "allowed",
1078
+ icon: "ios_share",
1079
+ variant: "tertiary",
1080
+ onClick: Oe((f) => Me(o), ["stop"])
1081
+ }, null, 8, ["aria-label", "disabled", "onClick"])
1082
+ ])
1083
+ ]),
1084
+ _: 2
1085
+ }, 1032, ["onClick"]))), 128))
1086
+ ]),
1087
+ _: 1
1088
+ })) : (s(), y(Fl, { key: 1 }, {
1089
+ default: k(() => {
1090
+ var o, f;
1091
+ return [
1092
+ u(Te, {
1093
+ "column-defs": ml.value,
1094
+ "get-row-id": (x) => x.restaurantId,
1095
+ "model-value": he.value,
1096
+ "page-size": Math.max(((f = (o = p.value) == null ? void 0 : o.rows) == null ? void 0 : f.length) ?? 0, 1),
1097
+ "pin-header-row": "",
1098
+ "row-data": pe.value,
1099
+ selection: "multiple",
1100
+ "shrink-at": !1,
1101
+ virtual: !0,
1102
+ "hide-footer": "",
1103
+ "onUpdate:modelValue": sl,
1104
+ onRowClick: l[3] || (l[3] = (x) => Ve(x.original))
1105
+ }, null, 8, ["column-defs", "get-row-id", "model-value", "page-size", "row-data"])
1106
+ ];
1107
+ }),
1108
+ _: 1
1109
+ })),
1110
+ C.value ? (s(), b("div", xt, [
1111
+ u(m, {
1112
+ disabled: p.value.publish.state !== "allowed",
1113
+ label: a(t)("menu.publish.actions.publish_all"),
1114
+ "prepend-icon": "ios_share",
1115
+ variant: "fab",
1116
+ onClick: Ae
1117
+ }, null, 8, ["disabled", "label"])
1118
+ ])) : $("", !0)
1119
+ ], 64)) : $("", !0),
1120
+ u(De, {
1121
+ modelValue: X.value,
1122
+ "onUpdate:modelValue": l[9] || (l[9] = (o) => X.value = o),
1123
+ "close-button": !1,
1124
+ "max-width": 800
1125
+ }, {
1126
+ "side-sheet-header": k(() => [
1127
+ n("div", Ct, [
1128
+ u(m, {
1129
+ "aria-label": a(t)("menu.common.actions.back"),
1130
+ "prepend-icon": "arrow_back",
1131
+ variant: "tertiary",
1132
+ onClick: l[4] || (l[4] = (o) => X.value = !1)
1133
+ }, null, 8, ["aria-label"]),
1134
+ n("p", Ft, i(a(t)("menu.publish.actions.publish_progress")), 1)
1135
+ ])
1136
+ ]),
1137
+ default: k(() => {
1138
+ var o;
1139
+ return [
1140
+ n("div", null, [
1141
+ a(U).status === "error" ? (s(), b("p", It, i(a(h)(a(U).error.message)), 1)) : a(U).status === "unavailable" ? (s(), b("p", St, i(a(h)(a(U).reason)), 1)) : a(U).status === "loading" ? (s(), y(K, { key: 2 })) : W.value ? (s(), y(Te, {
1142
+ key: 3,
1143
+ class: ze({ "pb-8": !M.value }),
1144
+ "column-defs": pl.value,
1145
+ "hide-footer": "",
1146
+ "page-size": Math.max(1, W.value.rows.length),
1147
+ "row-data": _e.value,
1148
+ "shrink-at": !1
1149
+ }, null, 8, ["class", "column-defs", "page-size", "row-data"])) : $("", !0),
1150
+ !M.value && W.value && ((o = W.value.schedule) == null ? void 0 : o.state) === "allowed" ? (s(), y(m, {
1151
+ key: 4,
1152
+ "prepend-icon": "add",
1153
+ label: a(t)("menu.publish.actions.add_scheduler_publish"),
1154
+ variant: "plain",
1155
+ onClick: nl
1156
+ }, null, 8, ["label"])) : $("", !0),
1157
+ M.value && L.value ? (s(), b("div", $t, [
1158
+ L.value.status === "loading" ? (s(), y(K, { key: 0 })) : L.value.status === "error" ? (s(), b("p", Pt, i(a(h)(L.value.error.message)), 1)) : L.value.status === "unavailable" ? (s(), b("p", At, i(a(h)(L.value.reason)), 1)) : E.value ? (s(), b(j, { key: 3 }, [
1159
+ n("div", Mt, [
1160
+ n("div", null, [
1161
+ u(_l, {
1162
+ label: "",
1163
+ "model-value": He() ?? void 0,
1164
+ "onUpdate:modelValue": Xe
1165
+ }, {
1166
+ "trigger-button": k(() => [
1167
+ u(Ce, {
1168
+ ref: qe,
1169
+ label: "",
1170
+ "model-value": Je(),
1171
+ placeholder: a(t)(
1172
+ "menu.publish.scheduler_publish.selector.date_time_placeholder"
1173
+ ),
1174
+ readonly: ""
1175
+ }, null, 8, ["model-value", "placeholder"])
1176
+ ]),
1177
+ _: 1
1178
+ }, 8, ["model-value"])
1179
+ ]),
1180
+ l[16] || (l[16] = n("div", null, null, -1)),
1181
+ u(ue, {
1182
+ class: "w-[130px]",
1183
+ "data-testid": "publish-schedule-restaurants",
1184
+ "hide-chips": "",
1185
+ "menu-id": "publish-schedule-restaurants-menu",
1186
+ role: "combobox",
1187
+ "aria-label": a(t)(
1188
+ "menu.publish.scheduler_publish.selector.restaurant.accessibility"
1189
+ ),
1190
+ items: E.value.restaurantOptions.map((f) => ({
1191
+ label: f.name,
1192
+ value: f.restaurantId
1193
+ })),
1194
+ label: "",
1195
+ "model-value": E.value.restaurantIds,
1196
+ multiselect: "",
1197
+ "onUpdate:modelValue": l[5] || (l[5] = (f) => {
1198
+ var x;
1199
+ return (x = S.value) == null ? void 0 : x.setRestaurantIds(f ?? []);
1200
+ })
1201
+ }, null, 8, ["aria-label", "items", "model-value"]),
1202
+ n("div", Lt, [
1203
+ u(m, {
1204
+ "aria-label": a(t)("menu.common.actions.cancel"),
1205
+ "prepend-icon": "close",
1206
+ "text-color": "system-error-300",
1207
+ variant: "tertiary",
1208
+ onClick: l[6] || (l[6] = (f) => M.value = !1)
1209
+ }, null, 8, ["aria-label"]),
1210
+ u(m, {
1211
+ "aria-label": a(t)("menu.publish.actions.publish"),
1212
+ "prepend-icon": "check",
1213
+ "text-color": "system-success-300",
1214
+ variant: "tertiary",
1215
+ onClick: ol
1216
+ }, null, 8, ["aria-label"])
1217
+ ])
1218
+ ]),
1219
+ We.value ? (s(), b("div", Vt, [
1220
+ u(Ce, {
1221
+ label: a(t)("menu.publish.scheduler_publish.selector.date_time_hour"),
1222
+ "model-value": fe("hour"),
1223
+ type: "text",
1224
+ "onUpdate:modelValue": l[7] || (l[7] = (f) => Pe("hour", f))
1225
+ }, null, 8, ["label", "model-value"]),
1226
+ u(Ce, {
1227
+ label: a(t)("menu.publish.scheduler_publish.selector.date_time_minute"),
1228
+ "model-value": fe("minute"),
1229
+ type: "text",
1230
+ "onUpdate:modelValue": l[8] || (l[8] = (f) => Pe("minute", f))
1231
+ }, null, 8, ["label", "model-value"])
1232
+ ])) : $("", !0)
1233
+ ], 64)) : $("", !0)
1234
+ ])) : $("", !0)
1235
+ ])
1236
+ ];
1237
+ }),
1238
+ _: 1
1239
+ }, 8, ["modelValue"]),
1240
+ u(De, {
1241
+ modelValue: H.value,
1242
+ "onUpdate:modelValue": l[15] || (l[15] = (o) => H.value = o),
1243
+ "max-width": 560
1244
+ }, kl({
1245
+ "side-sheet-header": k(() => [
1246
+ n("span", Nt, i(a(t)("menu.publish.update_catalog_dialog.title")), 1)
1247
+ ]),
1248
+ default: k(() => {
1249
+ var o, f;
1250
+ return [
1251
+ D.value ? (s(), b(j, { key: 0 }, [
1252
+ u(ue, {
1253
+ class: "mb-24",
1254
+ items: we.value,
1255
+ label: a(t)("menu.publish.update_catalog_dialog.sections.default.label"),
1256
+ "model-value": D.value.defaultCatalogId,
1257
+ "onUpdate:modelValue": l[10] || (l[10] = (x) => xe("catalogId", x ?? null))
1258
+ }, null, 8, ["items", "label", "model-value"]),
1259
+ u(ue, {
1260
+ class: "mb-24",
1261
+ items: we.value,
1262
+ label: a(t)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label"),
1263
+ "model-value": D.value.takeawayCatalogId,
1264
+ "onUpdate:modelValue": l[11] || (l[11] = (x) => xe(
1265
+ "takeawayCatalog",
1266
+ x ?? null
1267
+ ))
1268
+ }, null, 8, ["items", "label", "model-value"]),
1269
+ u(ue, {
1270
+ items: we.value,
1271
+ label: a(t)("menu.publish.update_catalog_dialog.sections.pickup.label"),
1272
+ "model-value": D.value.pickupCatalogId,
1273
+ "onUpdate:modelValue": l[12] || (l[12] = (x) => xe(
1274
+ "pickupCatalog",
1275
+ x ?? null
1276
+ ))
1277
+ }, null, 8, ["items", "label", "model-value"]),
1278
+ n("div", Tt, [
1279
+ n("div", Dt, i(a(t)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
1280
+ n("div", Rt, i(a(t)(
1281
+ "menu.publish.update_catalog_dialog.sections.additional.subtitle"
1282
+ )), 1),
1283
+ (s(!0), b(j, null, ne(D.value.additionalCatalogs, (x) => (s(), b("div", {
1284
+ key: x.catalogId
1285
+ }, [
1286
+ u(gl, {
1287
+ label: x.name,
1288
+ "model-value": il.value,
1289
+ value: x.catalogId,
1290
+ "onUpdate:modelValue": l[13] || (l[13] = (ie) => rl(ie))
1291
+ }, null, 8, ["label", "model-value", "value"])
1292
+ ]))), 128))
1293
+ ])
1294
+ ], 64)) : ((o = z.value) == null ? void 0 : o.status) === "error" ? (s(), b("p", Ut, i(a(h)(z.value.error.message)), 1)) : ((f = z.value) == null ? void 0 : f.status) === "unavailable" ? (s(), b("p", Et, i(a(h)(z.value.reason)), 1)) : (s(), y(K, { key: 3 }))
1295
+ ];
1296
+ }),
1297
+ _: 2
1298
+ }, [
1299
+ D.value ? {
1300
+ name: "side-sheet-footer",
1301
+ fn: k(() => {
1302
+ var o;
1303
+ return [
1304
+ n("div", Bt, [
1305
+ u(m, {
1306
+ label: a(t)("menu.publish.update_catalog_dialog.actions.update"),
1307
+ size: "lg",
1308
+ disabled: ((o = D.value.submit) == null ? void 0 : o.state) !== "allowed",
1309
+ onClick: cl
1310
+ }, null, 8, ["label", "disabled"]),
1311
+ u(m, {
1312
+ label: a(t)("menu.publish.update_catalog_dialog.actions.cancel"),
1313
+ size: "lg",
1314
+ variant: "tertiary",
1315
+ onClick: l[14] || (l[14] = (f) => H.value = !1)
1316
+ }, null, 8, ["label"])
1317
+ ])
1318
+ ];
1319
+ }),
1320
+ key: "0"
1321
+ } : void 0
1322
+ ]), 1032, ["modelValue"])
1323
+ ]),
1324
+ _: 1
1325
+ }, 8, ["heading"]);
1326
+ };
1327
+ }
1328
+ }), Qt = /* @__PURE__ */ oe({
1329
+ __name: "Publish",
1330
+ setup(G) {
1331
+ const d = Sl();
1332
+ return (t, V) => (s(), y(Ot, { sdk: a(d) }, null, 8, ["sdk"]));
1333
+ }
1334
+ });
1335
+ export {
1336
+ Qt as default
1337
+ };