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