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