@feedmepos/mf-menu 0.32.66-dev.1 → 0.32.66-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-CI_iNcgK.js → App-D0YpNkYr.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CYxG4ihX.js → ApplyProduct.vue_vue_type_script_setup_true_lang-YPM2sgEJ.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-UllnR0h6.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-CAXhUciI.js} +3 -3
- package/dist/{Catalog-Bh2SAffq.js → Catalog-I3XpPLoT.js} +6 -6
- package/dist/{Category-DfTtG9CR.js → Category-BTmqDRbK.js} +4 -4
- package/dist/{Category-CVKnqszH.js → Category-CfCp_M4X.js} +4 -4
- package/dist/{CookingGuide-ya45J1Mt.js → CookingGuide-BRHwTegP.js} +5 -5
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-i6fzPFdp.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-ksv-RMn2.js} +1 -1
- package/dist/{Group-DLo3Tq5F.js → Group-BvrANEY8.js} +1 -1
- package/dist/{Group-d5ODb1qt.js → Group-Bwj6UATr.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-mJM1hfDS.js → Group.vue_vue_type_script_setup_true_lang-CYLH4YhA.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Ctw_g4uv.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DWpeinru.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-OzkvL_JP.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DEvUaDcb.js} +7 -7
- package/dist/{Ingredient-BT24CVH8.js → Ingredient-B8n9cRsp.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-Cd2xFodR.js → InventoryBinding.vue_vue_type_script_setup_true_lang-92V2JZvW.js} +2 -2
- package/dist/{LinkProductSideSheet-CAjxumsy.js → LinkProductSideSheet-LF2pdsYn.js} +4 -4
- package/dist/{MenuSetting-CrKps0Pr.js → MenuSetting-DrObZATH.js} +7 -7
- package/dist/{OrderPacing-DV8YhW4M.js → OrderPacing-CIP1oshR.js} +5 -5
- package/dist/{PrintRoute-N_c01sX7.js → PrintRoute-BUErmYxT.js} +5 -5
- package/dist/{Product-i45cWBne.js → Product-DBRc2y1I.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-SBnKF6Dc.js → Product.vue_vue_type_script_setup_true_lang-BvtMo0M4.js} +14 -14
- package/dist/{ProductInternalTools-C10beN3h.js → ProductInternalTools-CnYr5piv.js} +6 -6
- package/dist/{Products-Copz_NxK.js → Products-DkqJELto.js} +65 -65
- package/dist/{Publish-Dx9g-Iml.js → Publish-C94D_B2o.js} +446 -444
- package/dist/{Recipe-B0dhSxLY.js → Recipe-DxTc4llT.js} +5 -5
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BfTWVSgk.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BC59l-9q.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CGjp5ObO.js → RuleView.vue_vue_type_script_setup_true_lang-BpGitWig.js} +3 -3
- package/dist/{Scheduler-Bdy9DG0p.js → Scheduler-CtdYHGoQ.js} +3 -3
- package/dist/{ServingSequence-onP8TGmt.js → ServingSequence-Bx0Z7ob9.js} +3 -3
- package/dist/{Setting-h1N-6VJG.js → Setting-BWKT6o_d.js} +5 -5
- package/dist/{Subcategory-uRvIJSP2.js → Subcategory-BckJmrDm.js} +6 -6
- package/dist/{Takeaway-BVfssE0J.js → Takeaway-DULjBrov.js} +1 -1
- package/dist/{Takeaway-1LAZ7cjz.js → Takeaway-Dvt7GRhi.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DQy0jvn3.js → Takeaway.vue_vue_type_script_setup_true_lang-BanPhJ_p.js} +5 -5
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-CFfvrpnY.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-BA1GwxTn.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-DY_CAuFa.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-B45Qj3ka.js} +2 -2
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BL_x8Upd.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-mlqLqR9u.js} +15 -15
- package/dist/{Unit-Bdjbice8.js → Unit-C2rVtZXW.js} +2 -2
- package/dist/{Variant-D6lnVRhc.js → Variant-C1aRShIB.js} +3 -3
- package/dist/{_id_-_IoP91Df.js → _id_-TNQRaQmS.js} +10 -10
- package/dist/{app-CHa-DBPQ.js → app-Cbzk6cOz.js} +32 -32
- package/dist/{app-DuSxtjmC.js → app-DwyLCetV.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/menu.d.ts +3 -3
- package/dist/apps/mf-menu/src/stores/menu.d.ts +5 -4
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DBJxrh2U.js → linked-status-BY2u9ovw.js} +4 -4
- package/dist/assets/{menu-export-UgrjUnN2.js → menu-export-BaTSKjZt.js} +3 -3
- package/dist/assets/{override-menu-CIRYGinT.js → override-menu-Ccftxk6t.js} +4 -4
- package/dist/assets/{validate-menu-D8-_8UwY.js → validate-menu-CLI_SnXI.js} +4 -4
- package/dist/{catalog-C_rhdKvu.js → catalog-CVzF_mVG.js} +1 -1
- package/dist/{catalogSetting-SujM_d4-.js → catalogSetting-C1g9ndFL.js} +1 -1
- package/dist/{currency-CBsQulKD.js → currency-BMMqzZYC.js} +1 -1
- package/dist/{dayjs.min-CBi2aUyP.js → dayjs.min-BozAuX2f.js} +2 -2
- package/dist/{discardConfirm-BhV1iT_G.js → discardConfirm-CFESnGLS.js} +1 -1
- package/dist/{index-CtMD-H5N.js → index-BNzLcju2.js} +1 -1
- package/dist/{index-aXVdUVi9.js → index-BRt5TwuO.js} +6 -6
- package/dist/{index-D10URGOP.js → index-CyomkF6Q.js} +5 -5
- package/dist/{index.vue_vue_type_script_setup_true_lang-cI7uKVre.js → index.vue_vue_type_script_setup_true_lang-CESDAztS.js} +10559 -10562
- package/dist/{item-B7ovTnkT.js → item-Bg78_1Z3.js} +19 -19
- package/dist/{jszip.min-nm6XtoQ3.js → jszip.min-CfmqMq7-.js} +3 -3
- package/dist/{linkProducts-lOTzQqNK.js → linkProducts-Dk-7vVTM.js} +4 -4
- package/dist/{memberPricing-BYT32y4D.js → memberPricing-BeLPeWJc.js} +1 -1
- package/dist/{menu-6qHiTu0j.js → menu-Cn6vin1M.js} +1 -1
- package/dist/{menuV2-ILhcIRUD.js → menuV2-DMl-WMCG.js} +67 -67
- package/dist/{order_pacing-Bq09k_C7.js → order_pacing-SVJqBJun.js} +5 -5
- package/dist/{priceTier-BzuYYCqN.js → priceTier-BOIqyyMG.js} +1 -1
- package/dist/{rules-BrliKHcG.js → rules-Bw94jp35.js} +3 -3
- package/dist/{scheduler-6lSaa1nT.js → scheduler-BooRYOi1.js} +5 -5
- package/dist/{toExcel-C8QPvQuM.js → toExcel-FAK9N74s.js} +2 -2
- package/dist/{unit-s4XWrNN2.js → unit-BiH3semx.js} +3 -3
- package/package.json +2 -2
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { defineComponent as J, ref as
|
|
2
|
-
import { D as z } from "./dayjs.min-
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { O as
|
|
5
|
-
import { a as
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { useSnackbar as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { a as
|
|
11
|
-
import { u as
|
|
12
|
-
import { _ as
|
|
13
|
-
function
|
|
1
|
+
import { defineComponent as J, ref as $, computed as N, onMounted as ce, resolveComponent as A, createElementBlock as F, openBlock as y, createVNode as v, createElementVNode as f, toDisplayString as T, unref as c, Fragment as L, renderList as W, createBlock as K, watch as Ce, withCtx as E, h as B, normalizeClass as de, createCommentVNode as Q, createTextVNode as _e, mergeProps as Oe, normalizeStyle as Be, renderSlot as Te, withModifiers as te, onUnmounted as Ee } from "vue";
|
|
2
|
+
import { D as z } from "./dayjs.min-BozAuX2f.js";
|
|
3
|
+
import { useRouter as ze } from "vue-router";
|
|
4
|
+
import { O as Le, b as je } from "./app-5fxKLAzS.js";
|
|
5
|
+
import { a as Ke, e as Ye, b as we, M as He, _ as xe, N as G, u as Ve, d as ge, F as qe } from "./index.vue_vue_type_script_setup_true_lang-CESDAztS.js";
|
|
6
|
+
import { useI18n as X, useCoreStore as me, RestaurantSelector as Se } from "@feedmepos/mf-common";
|
|
7
|
+
import { useSnackbar as pe, useDialogChild as Ge, useProxiedModel as Je, useDialog as Fe, components as Z, FmButtonVariant as ye } from "@feedmepos/ui-library";
|
|
8
|
+
import { _ as We } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
9
|
+
import { _ as Qe } from "./app-Cbzk6cOz.js";
|
|
10
|
+
import { a as Xe, w as Ze } from "./tooltip-B5BiPMx9.js";
|
|
11
|
+
import { u as Me, l as et } from "./discardConfirm-CFESnGLS.js";
|
|
12
|
+
import { _ as Pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
+
function Ie(D) {
|
|
14
14
|
return D ? z(D).format("DD/MM/YY HH:mm") : "-";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function tt(D, x, a) {
|
|
17
17
|
const p = (i, g = !1) => {
|
|
18
18
|
var h;
|
|
19
|
-
return i === void 0 && !g ? "-" : ((h =
|
|
19
|
+
return i === void 0 && !g ? "-" : ((h = a.find((_) => _.value === (i || null))) == null ? void 0 : h.label) || "-";
|
|
20
20
|
};
|
|
21
21
|
return D.map((i) => {
|
|
22
22
|
var e;
|
|
23
|
-
const g = (e = x.find(({ _id: k }) => k === i._id)) == null ? void 0 : e.posVersion, h = !!g && !!
|
|
23
|
+
const g = (e = x.find(({ _id: k }) => k === i._id)) == null ? void 0 : e.posVersion, h = !!g && !!Ke.Pos.canUse({ feature: Ye.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: g }), _ = p(i.catalogId);
|
|
24
24
|
return {
|
|
25
25
|
...i,
|
|
26
26
|
_default: _,
|
|
27
27
|
_posTakeaway: i.takeawayCatalog ? p(i.takeawayCatalog) : _,
|
|
28
28
|
_additionalCatalogs: (i.additionalCatalogs || []).map((k) => p(k)),
|
|
29
|
-
_lastUpdate:
|
|
29
|
+
_lastUpdate: Ie(i.updatedAt),
|
|
30
30
|
_pickup: h ? p(i.pickupCatalog, !0) : "-",
|
|
31
31
|
_canUsePickup: h,
|
|
32
32
|
_posVersion: g || "-"
|
|
33
33
|
};
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const at = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "flex items-center justify-center"
|
|
39
39
|
}, lt = {
|
|
40
40
|
key: 1,
|
|
41
41
|
class: "space-y-16"
|
|
42
|
-
},
|
|
42
|
+
}, st = { class: "text-fm-color-typo-secondary" }, nt = { class: "space-y-4" }, ot = /* @__PURE__ */ J({
|
|
43
43
|
__name: "RevertDialog",
|
|
44
44
|
props: {
|
|
45
45
|
restaurant: {}
|
|
46
46
|
},
|
|
47
47
|
setup(D) {
|
|
48
|
-
const x = D,
|
|
48
|
+
const x = D, a = pe(), { custom: p } = we(a), i = $(!1), g = $(null);
|
|
49
49
|
async function h() {
|
|
50
50
|
await p(
|
|
51
51
|
async () => {
|
|
52
|
-
var
|
|
53
|
-
g.value = await
|
|
52
|
+
var l;
|
|
53
|
+
g.value = await He.readMenuById(((l = x.restaurant.revertConfig) == null ? void 0 : l._id) || "");
|
|
54
54
|
},
|
|
55
55
|
{ isLoading: i }
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
const _ =
|
|
59
|
-
var
|
|
58
|
+
const _ = N(() => {
|
|
59
|
+
var l;
|
|
60
60
|
return [
|
|
61
61
|
{ label: "Main", value: null },
|
|
62
|
-
...(((
|
|
62
|
+
...(((l = g.value) == null ? void 0 : l.modules.catalog) || []).map((n) => ({
|
|
63
63
|
label: n.name,
|
|
64
64
|
value: n._id
|
|
65
65
|
}))
|
|
66
66
|
];
|
|
67
|
-
}), { t: e } =
|
|
67
|
+
}), { t: e } = X(), k = N(() => {
|
|
68
68
|
var o;
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
71
|
-
const n =
|
|
69
|
+
const l = x.restaurant.revertConfig;
|
|
70
|
+
if (!l) return [];
|
|
71
|
+
const n = tt(
|
|
72
72
|
[
|
|
73
73
|
{
|
|
74
|
-
...
|
|
75
|
-
catalogId:
|
|
74
|
+
...l,
|
|
75
|
+
catalogId: l.catalogId || null
|
|
76
76
|
}
|
|
77
77
|
],
|
|
78
|
-
|
|
78
|
+
me().restaurants.value,
|
|
79
79
|
_.value
|
|
80
80
|
)[0];
|
|
81
81
|
return [
|
|
82
82
|
{ label: e("menu.revert.labels.restaurant"), value: x.restaurant.name },
|
|
83
83
|
{
|
|
84
84
|
label: e("menu.revert.labels.revert_to"),
|
|
85
|
-
value:
|
|
85
|
+
value: Ie((o = g.value) == null ? void 0 : o.updatedAt)
|
|
86
86
|
},
|
|
87
87
|
{ label: e("menu.revert.labels.default"), value: n._default },
|
|
88
88
|
{ label: e("menu.revert.labels.pos_takeaway"), value: n._posTakeaway },
|
|
@@ -93,16 +93,16 @@ const tt = {
|
|
|
93
93
|
}
|
|
94
94
|
];
|
|
95
95
|
});
|
|
96
|
-
|
|
97
|
-
const { emitData: s } =
|
|
98
|
-
return (
|
|
99
|
-
const o =
|
|
100
|
-
return i.value ? (y(), F("div",
|
|
101
|
-
|
|
96
|
+
ce(async () => h());
|
|
97
|
+
const { emitData: s } = Ge();
|
|
98
|
+
return (l, n) => {
|
|
99
|
+
const o = A("FmCircularProgress");
|
|
100
|
+
return i.value ? (y(), F("div", at, [
|
|
101
|
+
v(o, { size: "lg" })
|
|
102
102
|
])) : (y(), F("div", lt, [
|
|
103
|
-
f("div",
|
|
104
|
-
f("div",
|
|
105
|
-
(y(!0), F(
|
|
103
|
+
f("div", st, T(c(e)("menu.revert.description", { name: x.restaurant.name })), 1),
|
|
104
|
+
f("div", nt, [
|
|
105
|
+
(y(!0), F(L, null, W(k.value, (r) => (y(), K(Xe, {
|
|
106
106
|
key: r.label,
|
|
107
107
|
name: r.label,
|
|
108
108
|
value: r.value || "--"
|
|
@@ -111,11 +111,11 @@ const tt = {
|
|
|
111
111
|
]));
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
}),
|
|
114
|
+
}), ut = {
|
|
115
115
|
class: "break-all fm-typo-en-body-lg-400 line-clamp-1"
|
|
116
|
-
},
|
|
116
|
+
}, rt = {
|
|
117
117
|
class: "flex flex-col"
|
|
118
|
-
},
|
|
118
|
+
}, it = /* @__PURE__ */ J({
|
|
119
119
|
__name: "PublishRestaurantSelector",
|
|
120
120
|
props: {
|
|
121
121
|
restaurants: {
|
|
@@ -127,28 +127,28 @@ const tt = {
|
|
|
127
127
|
setup(D, {
|
|
128
128
|
emit: x
|
|
129
129
|
}) {
|
|
130
|
-
const
|
|
130
|
+
const a = D, p = x, i = $([]), g = N(() => a.restaurants.map((o) => ({
|
|
131
131
|
label: o.name,
|
|
132
132
|
value: o._id
|
|
133
|
-
}))), h =
|
|
133
|
+
}))), h = $(""), _ = N(() => {
|
|
134
134
|
const o = Array.isArray(i.value) ? i.value : [], r = o.map((m) => g.value.find((R) => R.value === m)).filter((m) => m !== void 0);
|
|
135
135
|
let d = [];
|
|
136
136
|
return h.value ? (d = g.value.filter((m) => m.label.toLowerCase().includes(h.value.toLowerCase()) && !o.includes(m.value)), [...r, ...d]) : (d = g.value.filter((m) => !o.includes(m.value)), [...r, ...d]);
|
|
137
|
-
}), e =
|
|
137
|
+
}), e = N(() => i.value.length > 0 && i.value.length === _.value.length), k = N(() => i.value.filter((o) => _.value.some((r) => r.value === o))), s = () => {
|
|
138
138
|
const o = i.value.filter((r) => !k.value.includes(r));
|
|
139
|
-
e.value === !0 ?
|
|
140
|
-
},
|
|
139
|
+
e.value === !0 ? l(o) : l(_.value.map((r) => r.value));
|
|
140
|
+
}, l = (o) => {
|
|
141
141
|
i.value = o;
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
Ce(i, (o) => {
|
|
144
144
|
p("update:modelValue", o);
|
|
145
145
|
});
|
|
146
146
|
function n(o) {
|
|
147
|
-
return
|
|
147
|
+
return a.restaurants.filter((r) => o.includes(r._id)).map((r) => r.name);
|
|
148
148
|
}
|
|
149
149
|
return (o, r) => {
|
|
150
|
-
const d =
|
|
151
|
-
return y(),
|
|
150
|
+
const d = A("FmSearch"), m = A("FmCheckbox"), R = A("FmSelect");
|
|
151
|
+
return y(), K(R, {
|
|
152
152
|
modelValue: i.value,
|
|
153
153
|
"onUpdate:modelValue": r[1] || (r[1] = (S) => i.value = S),
|
|
154
154
|
placeholder: "Select Restaurant",
|
|
@@ -156,41 +156,41 @@ const tt = {
|
|
|
156
156
|
multiselect: !0,
|
|
157
157
|
"hide-chips": !0
|
|
158
158
|
}, {
|
|
159
|
-
default: E(() => [f("p",
|
|
160
|
-
"menu-wrapper": E(() => [f("div",
|
|
159
|
+
default: E(() => [f("p", ut, T(i.value.length === a.restaurants.length ? "All restaurants" : n(i.value).join(", ")), 1)]),
|
|
160
|
+
"menu-wrapper": E(() => [f("div", rt, [v(d, {
|
|
161
161
|
class: "py-8",
|
|
162
162
|
modelValue: h.value,
|
|
163
163
|
"onUpdate:modelValue": r[0] || (r[0] = (S) => h.value = S),
|
|
164
164
|
placeholder: "Search Restaurant"
|
|
165
|
-
}, null, 8, ["modelValue"]),
|
|
165
|
+
}, null, 8, ["modelValue"]), v(m, {
|
|
166
166
|
class: "py-8",
|
|
167
167
|
"model-value": e.value,
|
|
168
168
|
label: "All restaurants",
|
|
169
169
|
value: "1",
|
|
170
170
|
indeterminate: i.value.length > 0,
|
|
171
171
|
"onUpdate:modelValue": s
|
|
172
|
-
}, null, 8, ["model-value", "indeterminate"]), (y(!0), F(
|
|
173
|
-
key:
|
|
174
|
-
}, [
|
|
172
|
+
}, null, 8, ["model-value", "indeterminate"]), (y(!0), F(L, null, W(_.value, (S, Y) => (y(), F("div", {
|
|
173
|
+
key: Y
|
|
174
|
+
}, [v(m, {
|
|
175
175
|
"model-value": i.value,
|
|
176
176
|
label: S.label,
|
|
177
177
|
value: S.value,
|
|
178
|
-
"onUpdate:modelValue":
|
|
178
|
+
"onUpdate:modelValue": l
|
|
179
179
|
}, null, 8, ["model-value", "label", "value"])]))), 128))])]),
|
|
180
180
|
_: 1
|
|
181
181
|
}, 8, ["modelValue", "items"]);
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
}),
|
|
184
|
+
}), dt = {
|
|
185
185
|
class: "flex pb-16 w-full items-center justify-between gap-8"
|
|
186
|
-
}, dt = {
|
|
187
|
-
class: "flex-1 min-w-0 max-w-[300px]"
|
|
188
186
|
}, ct = {
|
|
189
|
-
|
|
187
|
+
class: "flex-1 min-w-0 max-w-[300px]"
|
|
190
188
|
}, mt = {
|
|
189
|
+
key: 0
|
|
190
|
+
}, pt = {
|
|
191
191
|
key: 1,
|
|
192
192
|
class: "text-fm-color-neutral-gray-200"
|
|
193
|
-
},
|
|
193
|
+
}, ht = /* @__PURE__ */ J({
|
|
194
194
|
__name: "RestaurantPublishDetail",
|
|
195
195
|
props: {
|
|
196
196
|
restaurantPublishStatus: {
|
|
@@ -205,11 +205,11 @@ const tt = {
|
|
|
205
205
|
setup(D) {
|
|
206
206
|
const {
|
|
207
207
|
t: x
|
|
208
|
-
} =
|
|
208
|
+
} = X(), a = D, p = me(), i = [{
|
|
209
209
|
accessorKey: "restaurantName",
|
|
210
210
|
header: x("menu.publish.scheduler_publish.restaurant_publish_details.table.column.restaurant"),
|
|
211
|
-
cell: (
|
|
212
|
-
const n =
|
|
211
|
+
cell: (l) => {
|
|
212
|
+
const n = l.getValue();
|
|
213
213
|
return B("p", {
|
|
214
214
|
class: "text-pretty"
|
|
215
215
|
}, n);
|
|
@@ -220,9 +220,9 @@ const tt = {
|
|
|
220
220
|
accessorKey: "publishStatus",
|
|
221
221
|
header: x("menu.publish.scheduler_publish.restaurant_publish_details.table.column.status"),
|
|
222
222
|
cell: ({
|
|
223
|
-
row:
|
|
223
|
+
row: l
|
|
224
224
|
}) => {
|
|
225
|
-
const n =
|
|
225
|
+
const n = l.original.publishStatus, o = Object.values(a.statusMap).find((d) => d.label === n), r = (o == null ? void 0 : o.textColor) ?? "text-fm-color-neutral-gray-300";
|
|
226
226
|
return B("p", {
|
|
227
227
|
class: `${r}`
|
|
228
228
|
}, n);
|
|
@@ -231,40 +231,40 @@ const tt = {
|
|
|
231
231
|
accessorKey: "publishedAt",
|
|
232
232
|
header: x("menu.publish.scheduler_publish.restaurant_publish_details.table.column.published_at"),
|
|
233
233
|
cell: ({
|
|
234
|
-
row:
|
|
234
|
+
row: l
|
|
235
235
|
}) => {
|
|
236
|
-
const n =
|
|
236
|
+
const n = l.original.publishedAt;
|
|
237
237
|
return B("p", {
|
|
238
238
|
class: "whitespace-nowrap"
|
|
239
239
|
}, n);
|
|
240
240
|
}
|
|
241
|
-
}], g =
|
|
241
|
+
}], g = $([]), h = N(() => Object.entries(a.statusMap).map(([l, n]) => ({
|
|
242
242
|
label: n.label,
|
|
243
|
-
value:
|
|
244
|
-
}))), _ =
|
|
245
|
-
restaurantName: s(
|
|
246
|
-
publishStatus:
|
|
243
|
+
value: l
|
|
244
|
+
}))), _ = $(null), e = N(() => Object.entries(a.restaurantPublishStatus).filter(([l, n]) => g.value.length === 0 ? !0 : g.value.includes(n.status)).filter(([l, n]) => !_.value || _.value.length === 0 ? !0 : _.value.includes(l)).map(([l, n]) => ({
|
|
245
|
+
restaurantName: s(l),
|
|
246
|
+
publishStatus: a.statusMap[n.status].label,
|
|
247
247
|
publishedAt: n.publishedAt ? z(n.publishedAt).format("YYYY-MM-DD HH:mm:ss") : ""
|
|
248
|
-
})).sort((
|
|
248
|
+
})).sort((l, n) => l.restaurantName.localeCompare(n.restaurantName))), k = N(() => {
|
|
249
249
|
var n, o;
|
|
250
|
-
const
|
|
250
|
+
const l = {};
|
|
251
251
|
for (const r of p.restaurants.value) {
|
|
252
252
|
if (!(r != null && r._id)) continue;
|
|
253
253
|
const d = (n = r == null ? void 0 : r.profile) == null ? void 0 : n.code, m = (o = r == null ? void 0 : r.profile) == null ? void 0 : o.name;
|
|
254
|
-
|
|
254
|
+
l[r._id] = `${d ? d + " - " : ""}${m || "Unknown Restaurant"}`;
|
|
255
255
|
}
|
|
256
|
-
return
|
|
256
|
+
return l;
|
|
257
257
|
});
|
|
258
|
-
function s(
|
|
259
|
-
return k.value[
|
|
258
|
+
function s(l) {
|
|
259
|
+
return k.value[l] ?? "Unknown Restaurant";
|
|
260
260
|
}
|
|
261
|
-
return (
|
|
262
|
-
const o =
|
|
263
|
-
return y(), F(
|
|
261
|
+
return (l, n) => {
|
|
262
|
+
const o = A("FmSelect"), r = A("FmTable");
|
|
263
|
+
return y(), F(L, null, [f("div", dt, [f("div", ct, [v(c(Se), {
|
|
264
264
|
multiple: "",
|
|
265
265
|
modelValue: _.value,
|
|
266
266
|
"onUpdate:modelValue": n[0] || (n[0] = (d) => _.value = d)
|
|
267
|
-
}, null, 8, ["modelValue"])]),
|
|
267
|
+
}, null, 8, ["modelValue"])]), v(o, {
|
|
268
268
|
class: "flex-shrink-0 min-w-[200px]",
|
|
269
269
|
modelValue: g.value,
|
|
270
270
|
"onUpdate:modelValue": n[1] || (n[1] = (d) => g.value = d),
|
|
@@ -272,30 +272,30 @@ const tt = {
|
|
|
272
272
|
multiselect: "",
|
|
273
273
|
"hide-chips": ""
|
|
274
274
|
}, {
|
|
275
|
-
default: E(() => [g.value.length > 0 ? (y(), F("div",
|
|
275
|
+
default: E(() => [g.value.length > 0 ? (y(), F("div", mt, T(g.value.map((d) => {
|
|
276
276
|
var m;
|
|
277
|
-
return (m =
|
|
278
|
-
}).join(", ")), 1)) : (y(), F("div",
|
|
277
|
+
return (m = a.statusMap[d]) == null ? void 0 : m.label;
|
|
278
|
+
}).join(", ")), 1)) : (y(), F("div", pt, T(c(x)("menu.publish.scheduler_publish.restaurant_publish_details.select_publish_status")), 1))]),
|
|
279
279
|
_: 1
|
|
280
|
-
}, 8, ["modelValue", "items"])]), e.value.length > 0 ? (y(),
|
|
280
|
+
}, 8, ["modelValue", "items"])]), e.value.length > 0 ? (y(), K(r, {
|
|
281
281
|
key: 0,
|
|
282
282
|
class: "flex-1 overflow-hidden",
|
|
283
283
|
"column-defs": i,
|
|
284
284
|
"row-data": e.value,
|
|
285
|
-
"page-size": Object.entries(
|
|
285
|
+
"page-size": Object.entries(a.restaurantPublishStatus).length,
|
|
286
286
|
"hide-footer": "",
|
|
287
287
|
"pin-header-row": ""
|
|
288
|
-
}, null, 8, ["row-data", "page-size"])) : (y(),
|
|
288
|
+
}, null, 8, ["row-data", "page-size"])) : (y(), K(xe, {
|
|
289
289
|
key: 1,
|
|
290
290
|
title: c(x)("menu.publish.scheduler_publish.restaurant_publish_details.no_publish_status"),
|
|
291
291
|
subtitle: ""
|
|
292
292
|
}, null, 8, ["title"]))], 64);
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
}),
|
|
295
|
+
}), ft = { class: "fm-calendar__name-row fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, bt = ["id"], vt = {
|
|
296
296
|
key: 0,
|
|
297
297
|
class: "fm-calendar__cell__button--today"
|
|
298
|
-
},
|
|
298
|
+
}, _t = ["onClick", "onMouseover"], gt = /* @__PURE__ */ J({
|
|
299
299
|
__name: "FmCalendar",
|
|
300
300
|
props: {
|
|
301
301
|
days: {},
|
|
@@ -305,7 +305,7 @@ const tt = {
|
|
|
305
305
|
cellSize: { default: "md" }
|
|
306
306
|
},
|
|
307
307
|
setup(D) {
|
|
308
|
-
const { t: x } =
|
|
308
|
+
const { t: x } = X(), a = () => [
|
|
309
309
|
x("menu.publish.scheduler.calender.day.sun"),
|
|
310
310
|
x("menu.publish.scheduler.calender.day.mon"),
|
|
311
311
|
x("menu.publish.scheduler.calender.day.tue"),
|
|
@@ -323,55 +323,55 @@ const tt = {
|
|
|
323
323
|
};
|
|
324
324
|
let k;
|
|
325
325
|
if (typeof _ == "function") {
|
|
326
|
-
const { status: s, className:
|
|
327
|
-
s && (e["fm-calendar__cell--selected"] = s.isSelected ?? !1, e["fm-calendar__cell--selected-start"] = s.isStart ?? !1, e["fm-calendar__cell--selected-end"] = s.isEnd ?? !1, e["fm-calendar__cell--selected-between"] = s.isBetween ?? !1), k =
|
|
326
|
+
const { status: s, className: l } = _(h);
|
|
327
|
+
s && (e["fm-calendar__cell--selected"] = s.isSelected ?? !1, e["fm-calendar__cell--selected-start"] = s.isStart ?? !1, e["fm-calendar__cell--selected-end"] = s.isEnd ?? !1, e["fm-calendar__cell--selected-between"] = s.isBetween ?? !1), k = l ?? "";
|
|
328
328
|
} else {
|
|
329
|
-
const { status: s, className:
|
|
330
|
-
s && (e["fm-calendar__cell--selected"] = i(s.isSelected, [h]) ?? !1, e["fm-calendar__cell--selected-start"] = i(s.isStart, [h]) ?? !1, e["fm-calendar__cell--selected-end"] = i(s.isEnd, [h]) ?? !1, e["fm-calendar__cell--selected-between"] = i(s.isBetween, [h]) ?? !1), k = i(
|
|
329
|
+
const { status: s, className: l } = _;
|
|
330
|
+
s && (e["fm-calendar__cell--selected"] = i(s.isSelected, [h]) ?? !1, e["fm-calendar__cell--selected-start"] = i(s.isStart, [h]) ?? !1, e["fm-calendar__cell--selected-end"] = i(s.isEnd, [h]) ?? !1, e["fm-calendar__cell--selected-between"] = i(s.isBetween, [h]) ?? !1), k = i(l, [h]) ?? "";
|
|
331
331
|
}
|
|
332
332
|
return [e, k];
|
|
333
333
|
};
|
|
334
334
|
return (h, _) => (y(), F("div", null, [
|
|
335
|
-
f("div",
|
|
336
|
-
(y(!0), F(
|
|
335
|
+
f("div", ft, [
|
|
336
|
+
(y(!0), F(L, null, W(a(), (e) => (y(), F("div", {
|
|
337
337
|
key: e,
|
|
338
|
-
class:
|
|
338
|
+
class: de(["fm-calendar__cell", `fm-calendar__cell__${h.cellSize}`])
|
|
339
339
|
}, T(e), 3))), 128))
|
|
340
340
|
]),
|
|
341
341
|
f("div", null, [
|
|
342
|
-
(y(!0), F(
|
|
342
|
+
(y(!0), F(L, null, W(h.days, (e, k) => (y(), F("div", {
|
|
343
343
|
key: k,
|
|
344
344
|
class: "fm-calendar__row fm-typo-en-body-md-400"
|
|
345
345
|
}, [
|
|
346
|
-
(y(!0), F(
|
|
346
|
+
(y(!0), F(L, null, W(e, (s) => (y(), F("div", {
|
|
347
347
|
id: `${s.date.toISOString()}`,
|
|
348
348
|
key: s.date.date(),
|
|
349
|
-
class:
|
|
349
|
+
class: de(["fm-calendar__cell", [
|
|
350
350
|
`fm-calendar__cell__${h.cellSize}`,
|
|
351
351
|
g(s.date, h.dayCellClass),
|
|
352
352
|
!s.isCurrentMonth && "fm-calendar__cell--not-current-month"
|
|
353
353
|
]])
|
|
354
354
|
}, [
|
|
355
|
-
s.date.isSame(c(p), "day") && s.isCurrentMonth ? (y(), F("div", vt)) :
|
|
355
|
+
s.date.isSame(c(p), "day") && s.isCurrentMonth ? (y(), F("div", vt)) : Q("", !0),
|
|
356
356
|
s.isCurrentMonth ? (y(), F("button", {
|
|
357
357
|
key: 1,
|
|
358
358
|
class: "fm-calendar__cell__button",
|
|
359
359
|
type: "button",
|
|
360
|
-
onClick: (
|
|
361
|
-
onMouseover: (
|
|
360
|
+
onClick: (l) => h.onDayClick(s),
|
|
361
|
+
onMouseover: (l) => {
|
|
362
362
|
var n;
|
|
363
363
|
return (n = h.onCellMouseOver) == null ? void 0 : n.call(h, s.date);
|
|
364
364
|
}
|
|
365
|
-
}, T(s.date.date()), 41,
|
|
366
|
-
], 10,
|
|
365
|
+
}, T(s.date.date()), 41, _t)) : Q("", !0)
|
|
366
|
+
], 10, bt))), 128))
|
|
367
367
|
]))), 128))
|
|
368
368
|
])
|
|
369
369
|
]));
|
|
370
370
|
}
|
|
371
|
-
}), ke = /* @__PURE__ */
|
|
371
|
+
}), ke = /* @__PURE__ */ Pe(gt, [["__scopeId", "data-v-47484312"]]), yt = { class: "fm-typo-en-body-md-600" }, kt = {
|
|
372
372
|
id: "in-calendar-app",
|
|
373
373
|
class: "h-[264px] overflow-y-auto w-[160px]"
|
|
374
|
-
},
|
|
374
|
+
}, Ct = ["onVnodeMounted"], wt = ["onVnodeMounted"], le = /* @__PURE__ */ J({
|
|
375
375
|
__name: "FmDateRangeYearMonthPicker",
|
|
376
376
|
props: {
|
|
377
377
|
modelValue: {},
|
|
@@ -381,18 +381,18 @@ const tt = {
|
|
|
381
381
|
},
|
|
382
382
|
emits: ["update:modelValue"],
|
|
383
383
|
setup(D, { emit: x }) {
|
|
384
|
-
const { t:
|
|
385
|
-
const s = z(p.min).startOf("year"),
|
|
384
|
+
const { t: a } = X(), p = D, i = x, g = $(!1), h = N(() => {
|
|
385
|
+
const s = z(p.min).startOf("year"), l = z(p.max).startOf("year"), n = l.diff(s, "year"), o = [];
|
|
386
386
|
for (let r = 0; r <= n; r++)
|
|
387
|
-
o.push(
|
|
387
|
+
o.push(l.subtract(r, "year"));
|
|
388
388
|
return o;
|
|
389
389
|
}), _ = (s) => {
|
|
390
|
-
const
|
|
391
|
-
return s.get("year") ===
|
|
390
|
+
const l = z(p.min).startOf("month"), n = z(p.max).startOf("month");
|
|
391
|
+
return s.get("year") === l.get("year") ? s.startOf("month").isAfter(l) || s.get("month") === l.get("month") : s.get("year") === n.get("year") ? s.startOf("month").isBefore(n) || s.get("month") === n.get("month") : !0;
|
|
392
392
|
}, e = (s) => {
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
i("update:modelValue",
|
|
393
|
+
const l = z(p.min).startOf("month"), n = z(p.max).startOf("month");
|
|
394
|
+
if (l.get("year") === s.get("year")) {
|
|
395
|
+
i("update:modelValue", l);
|
|
396
396
|
return;
|
|
397
397
|
}
|
|
398
398
|
if (n.get("year") === s.get("year")) {
|
|
@@ -401,33 +401,33 @@ const tt = {
|
|
|
401
401
|
}
|
|
402
402
|
i("update:modelValue", s);
|
|
403
403
|
};
|
|
404
|
-
function k(s,
|
|
405
|
-
if (!
|
|
404
|
+
function k(s, l) {
|
|
405
|
+
if (!l)
|
|
406
406
|
return !1;
|
|
407
407
|
const n = s.el, o = n == null ? void 0 : n.parentElement;
|
|
408
408
|
!n || !o || o.scrollTo({
|
|
409
409
|
top: n.offsetTop - 50
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
|
-
return (s,
|
|
413
|
-
const n =
|
|
414
|
-
return y(),
|
|
412
|
+
return (s, l) => {
|
|
413
|
+
const n = A("FmIcon"), o = A("FmMenuItem"), r = A("FmMenu");
|
|
414
|
+
return y(), K(r, {
|
|
415
415
|
trigger: "click",
|
|
416
|
-
onMenuChanged:
|
|
416
|
+
onMenuChanged: l[0] || (l[0] = (d) => g.value = d)
|
|
417
417
|
}, {
|
|
418
418
|
"menu-button": E(() => [
|
|
419
419
|
f("div", {
|
|
420
|
-
class:
|
|
420
|
+
class: de(["flex gap-4 h-24 items-center px-4 rounded-sm", g.value ? "text-fm-color-primary" : "hover:bg-fm-color-neutral-gray-100"])
|
|
421
421
|
}, [
|
|
422
|
-
f("div",
|
|
423
|
-
s.picker === "month" ? (y(), F(
|
|
424
|
-
_e(T(s.modelValue.format(c(
|
|
425
|
-
], 64)) :
|
|
426
|
-
s.picker === "year" ? (y(), F(
|
|
427
|
-
_e(T(s.modelValue.format(c(
|
|
428
|
-
], 64)) :
|
|
422
|
+
f("div", yt, [
|
|
423
|
+
s.picker === "month" ? (y(), F(L, { key: 0 }, [
|
|
424
|
+
_e(T(s.modelValue.format(c(a)("menu.publish.scheduler.date.monthFormat"))), 1)
|
|
425
|
+
], 64)) : Q("", !0),
|
|
426
|
+
s.picker === "year" ? (y(), F(L, { key: 1 }, [
|
|
427
|
+
_e(T(s.modelValue.format(c(a)("menu.publish.scheduler.date.yearFormat"))), 1)
|
|
428
|
+
], 64)) : Q("", !0)
|
|
429
429
|
]),
|
|
430
|
-
|
|
430
|
+
v(n, {
|
|
431
431
|
name: g.value ? "expand_less" : "expand_more",
|
|
432
432
|
size: "md",
|
|
433
433
|
color: "black"
|
|
@@ -435,47 +435,47 @@ const tt = {
|
|
|
435
435
|
], 2)
|
|
436
436
|
]),
|
|
437
437
|
default: E(() => [
|
|
438
|
-
f("ul",
|
|
439
|
-
s.picker === "month" ? (y(!0), F(
|
|
440
|
-
key: d.format(c(
|
|
438
|
+
f("ul", kt, [
|
|
439
|
+
s.picker === "month" ? (y(!0), F(L, { key: 0 }, W(Array.from(Array(12), (d, m) => s.modelValue.month(m)), (d) => (y(), F("li", {
|
|
440
|
+
key: d.format(c(a)("menu.publish.scheduler.date.monthFormat")),
|
|
441
441
|
onVnodeMounted: (m) => k(
|
|
442
442
|
m,
|
|
443
|
-
s.modelValue.format(c(
|
|
443
|
+
s.modelValue.format(c(a)("menu.publish.scheduler.date.monthFormat")) === d.format(c(a)("menu.publish.scheduler.date.monthFormat"))
|
|
444
444
|
)
|
|
445
445
|
}, [
|
|
446
|
-
|
|
446
|
+
v(o, {
|
|
447
447
|
disabled: !_(d),
|
|
448
|
-
"model-value": s.modelValue.format(c(
|
|
449
|
-
label: d.format(c(
|
|
448
|
+
"model-value": s.modelValue.format(c(a)("menu.publish.scheduler.date.monthFormat")) === d.format(c(a)("menu.publish.scheduler.date.monthFormat")),
|
|
449
|
+
label: d.format(c(a)("menu.publish.scheduler.date.monthFormat")),
|
|
450
450
|
"onUpdate:modelValue": (m) => i("update:modelValue", d)
|
|
451
451
|
}, null, 8, ["disabled", "model-value", "label", "onUpdate:modelValue"])
|
|
452
|
-
], 8,
|
|
453
|
-
s.picker === "year" ? (y(!0), F(
|
|
454
|
-
key: d.format(c(
|
|
452
|
+
], 8, Ct))), 128)) : Q("", !0),
|
|
453
|
+
s.picker === "year" ? (y(!0), F(L, { key: 1 }, W(h.value, (d) => (y(), F("li", {
|
|
454
|
+
key: d.format(c(a)("menu.publish.scheduler.date.yearFormat")),
|
|
455
455
|
onVnodeMounted: (m) => k(
|
|
456
456
|
m,
|
|
457
|
-
s.modelValue.format(c(
|
|
457
|
+
s.modelValue.format(c(a)("menu.publish.scheduler.date.yearFormat")) === d.format(c(a)("menu.publish.scheduler.date.yearFormat"))
|
|
458
458
|
)
|
|
459
459
|
}, [
|
|
460
|
-
|
|
461
|
-
"model-value": s.modelValue.format(c(
|
|
462
|
-
label: d.format(c(
|
|
460
|
+
v(o, {
|
|
461
|
+
"model-value": s.modelValue.format(c(a)("menu.publish.scheduler.date.yearFormat")) === d.format(c(a)("menu.publish.scheduler.date.yearFormat")),
|
|
462
|
+
label: d.format(c(a)("menu.publish.scheduler.date.yearFormat")),
|
|
463
463
|
"onUpdate:modelValue": (m) => e(d)
|
|
464
464
|
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])
|
|
465
|
-
], 8,
|
|
465
|
+
], 8, wt))), 128)) : Q("", !0)
|
|
466
466
|
])
|
|
467
467
|
]),
|
|
468
468
|
_: 1
|
|
469
469
|
});
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
|
-
}),
|
|
472
|
+
}), xt = { class: "p-12 space-y-4 w-[552px]" }, Vt = { class: "w-max" }, St = { class: "flex space-x-24" }, Ft = { class: "flex items-center py-8 space-x-16" }, Mt = { class: "flex space-x-4" }, Pt = { class: "flex items-center justify-end py-8 space-x-16" }, It = { class: "flex space-x-4" }, $t = { class: "flex gap-8 items-center justify-end w-full" }, se = "YYYY-MM-DD", At = /* @__PURE__ */ J({
|
|
473
473
|
__name: "DateTimePicker",
|
|
474
474
|
props: {
|
|
475
475
|
modelValue: {},
|
|
476
476
|
showValidBorder: { type: Boolean, default: !1 },
|
|
477
|
-
min: { default: () => z().subtract(50, "year").format(
|
|
478
|
-
max: { default: () => z().add(25, "year").format(
|
|
477
|
+
min: { default: () => z().subtract(50, "year").format(se) },
|
|
478
|
+
max: { default: () => z().add(25, "year").format(se) },
|
|
479
479
|
zIndex: { default: void 0 },
|
|
480
480
|
label: { default: "" },
|
|
481
481
|
labelMark: { default: "none" },
|
|
@@ -488,62 +488,62 @@ const tt = {
|
|
|
488
488
|
},
|
|
489
489
|
emits: ["update:schedulerTime"],
|
|
490
490
|
setup(D, { emit: x }) {
|
|
491
|
-
const { t:
|
|
491
|
+
const { t: a } = X(), p = D, i = x, g = Je(p, "modelValue"), h = $({
|
|
492
492
|
hours: new Date(g.value).getHours() % 12 || 12,
|
|
493
493
|
minutes: new Date(g.value).getMinutes(),
|
|
494
494
|
period: new Date(g.value).getHours() >= 12 ? "PM" : "AM"
|
|
495
495
|
/* AM */
|
|
496
|
-
}), _ =
|
|
496
|
+
}), _ = $(z(g.value, se)), e = $(!1);
|
|
497
497
|
function k(V, u) {
|
|
498
|
-
const [C,
|
|
499
|
-
let
|
|
500
|
-
return u.period === "PM" && (
|
|
498
|
+
const [C, P, U] = V.split("-").map(Number), O = new Date(C, P - 1, U);
|
|
499
|
+
let I = u.hours % 12;
|
|
500
|
+
return u.period === "PM" && (I += 12), O.setHours(I), O.setMinutes(u.minutes), O.setSeconds(0), O.setMilliseconds(0), O;
|
|
501
501
|
}
|
|
502
502
|
const s = () => {
|
|
503
|
-
g.value = _.value.format(
|
|
503
|
+
g.value = _.value.format(se);
|
|
504
504
|
const V = k(g.value, h.value);
|
|
505
505
|
i("update:schedulerTime", V.toISOString()), setTimeout(() => {
|
|
506
506
|
e.value = !1;
|
|
507
507
|
}, 0);
|
|
508
|
-
},
|
|
508
|
+
}, l = () => {
|
|
509
509
|
_.value = g.value ? z(g.value) : null, e.value = !1;
|
|
510
510
|
}, n = (V) => {
|
|
511
|
-
e.value = V, V ||
|
|
512
|
-
}, o =
|
|
511
|
+
e.value = V, V || l();
|
|
512
|
+
}, o = $(z().startOf("month")), r = $(z().startOf("month").add(1, "month")), d = (V, u) => {
|
|
513
513
|
V === "left" ? (o.value = u, r.value = u.add(1, "month")) : V === "right" && (r.value = u, o.value = u.subtract(1, "month"));
|
|
514
|
-
}, m =
|
|
515
|
-
const u = [], C = V.endOf("month"),
|
|
514
|
+
}, m = N(() => S(o.value)), R = N(() => S(o.value.add(1, "month"))), S = (V) => {
|
|
515
|
+
const u = [], C = V.endOf("month"), P = V.month();
|
|
516
516
|
let U = V.startOf("week"), O = [];
|
|
517
517
|
for (; U.isBefore(C.endOf("week")); )
|
|
518
518
|
U.day() === 0 && O.length > 0 && (u.push(O), O = []), O.push({
|
|
519
519
|
date: U,
|
|
520
|
-
isCurrentMonth: U.month() ===
|
|
520
|
+
isCurrentMonth: U.month() === P
|
|
521
521
|
}), U = U.add(1, "day");
|
|
522
522
|
return O.length > 0 && u.push(O), u.length < 6 && u.push([]), u;
|
|
523
|
-
},
|
|
523
|
+
}, Y = (V) => {
|
|
524
524
|
_.value = V;
|
|
525
525
|
};
|
|
526
526
|
return (V, u) => {
|
|
527
|
-
const C =
|
|
528
|
-
return y(),
|
|
527
|
+
const C = A("FmIcon"), P = A("FmTimeInput"), U = A("FmButton"), O = A("FmPopover");
|
|
528
|
+
return y(), K(O, {
|
|
529
529
|
"show-popover": e.value,
|
|
530
530
|
"z-index": p.zIndex,
|
|
531
531
|
"exclude-el-from-click-outside": ["in-calendar-app"],
|
|
532
532
|
onPopoverChanged: n
|
|
533
533
|
}, {
|
|
534
534
|
"popover-button": E(() => [
|
|
535
|
-
f("div",
|
|
535
|
+
f("div", Oe({
|
|
536
536
|
opened: e.value,
|
|
537
537
|
showValidBorder: V.showValidBorder
|
|
538
538
|
}, { class: "text-fm-color-primary" }), " Select Date & Time ", 16)
|
|
539
539
|
]),
|
|
540
540
|
default: E(() => [
|
|
541
|
-
f("div",
|
|
542
|
-
f("div",
|
|
543
|
-
f("div",
|
|
541
|
+
f("div", xt, [
|
|
542
|
+
f("div", Vt, [
|
|
543
|
+
f("div", St, [
|
|
544
544
|
f("div", null, [
|
|
545
|
-
f("div",
|
|
546
|
-
|
|
545
|
+
f("div", Ft, [
|
|
546
|
+
v(C, {
|
|
547
547
|
outline: !1,
|
|
548
548
|
class: "cursor-pointer select-none",
|
|
549
549
|
color: "#1C1C1E",
|
|
@@ -551,52 +551,52 @@ const tt = {
|
|
|
551
551
|
size: "md",
|
|
552
552
|
onClick: u[0] || (u[0] = () => d("left", o.value.subtract(1, "month")))
|
|
553
553
|
}),
|
|
554
|
-
f("div",
|
|
555
|
-
|
|
554
|
+
f("div", Mt, [
|
|
555
|
+
v(le, {
|
|
556
556
|
max: V.max,
|
|
557
557
|
min: V.min,
|
|
558
558
|
"model-value": o.value,
|
|
559
559
|
picker: "month",
|
|
560
|
-
"onUpdate:modelValue": u[1] || (u[1] = (
|
|
560
|
+
"onUpdate:modelValue": u[1] || (u[1] = (I) => d("left", I))
|
|
561
561
|
}, null, 8, ["max", "min", "model-value"]),
|
|
562
|
-
|
|
562
|
+
v(le, {
|
|
563
563
|
max: V.max,
|
|
564
564
|
min: V.min,
|
|
565
565
|
"model-value": o.value,
|
|
566
566
|
picker: "year",
|
|
567
|
-
"onUpdate:modelValue": u[2] || (u[2] = (
|
|
567
|
+
"onUpdate:modelValue": u[2] || (u[2] = (I) => d("left", I))
|
|
568
568
|
}, null, 8, ["max", "min", "model-value"])
|
|
569
569
|
])
|
|
570
570
|
]),
|
|
571
|
-
|
|
571
|
+
v(ke, {
|
|
572
572
|
"day-cell-class": {
|
|
573
573
|
status: {
|
|
574
|
-
isSelected: (
|
|
574
|
+
isSelected: (I) => I.isSame(_.value, "date")
|
|
575
575
|
}
|
|
576
576
|
},
|
|
577
577
|
days: m.value,
|
|
578
|
-
"on-day-click": (
|
|
578
|
+
"on-day-click": (I) => Y(I.date)
|
|
579
579
|
}, null, 8, ["day-cell-class", "days", "on-day-click"])
|
|
580
580
|
]),
|
|
581
581
|
f("div", null, [
|
|
582
|
-
f("div",
|
|
583
|
-
f("div",
|
|
584
|
-
|
|
582
|
+
f("div", Pt, [
|
|
583
|
+
f("div", It, [
|
|
584
|
+
v(le, {
|
|
585
585
|
max: V.max,
|
|
586
586
|
min: V.min,
|
|
587
587
|
"model-value": r.value,
|
|
588
588
|
picker: "month",
|
|
589
|
-
"onUpdate:modelValue": u[3] || (u[3] = (
|
|
589
|
+
"onUpdate:modelValue": u[3] || (u[3] = (I) => d("right", I))
|
|
590
590
|
}, null, 8, ["max", "min", "model-value"]),
|
|
591
|
-
|
|
591
|
+
v(le, {
|
|
592
592
|
max: V.max,
|
|
593
593
|
min: V.min,
|
|
594
594
|
"model-value": r.value,
|
|
595
595
|
picker: "year",
|
|
596
|
-
"onUpdate:modelValue": u[4] || (u[4] = (
|
|
596
|
+
"onUpdate:modelValue": u[4] || (u[4] = (I) => d("right", I))
|
|
597
597
|
}, null, 8, ["max", "min", "model-value"])
|
|
598
598
|
]),
|
|
599
|
-
|
|
599
|
+
v(C, {
|
|
600
600
|
outline: !1,
|
|
601
601
|
class: "cursor-pointer select-none",
|
|
602
602
|
color: "#1C1C1E",
|
|
@@ -605,37 +605,37 @@ const tt = {
|
|
|
605
605
|
onClick: u[5] || (u[5] = () => d("left", o.value.add(1, "month")))
|
|
606
606
|
})
|
|
607
607
|
]),
|
|
608
|
-
|
|
608
|
+
v(ke, {
|
|
609
609
|
"day-cell-class": {
|
|
610
610
|
status: {
|
|
611
|
-
isSelected: (
|
|
611
|
+
isSelected: (I) => I.isSame(_.value, "date")
|
|
612
612
|
}
|
|
613
613
|
},
|
|
614
614
|
days: R.value,
|
|
615
|
-
"on-day-click": (
|
|
615
|
+
"on-day-click": (I) => Y(I.date)
|
|
616
616
|
}, null, 8, ["day-cell-class", "days", "on-day-click"])
|
|
617
617
|
])
|
|
618
618
|
])
|
|
619
619
|
]),
|
|
620
|
-
|
|
620
|
+
v(P, {
|
|
621
621
|
"model-value": h.value ?? {
|
|
622
622
|
hours: 0,
|
|
623
623
|
minutes: 0,
|
|
624
624
|
period: "AM"
|
|
625
625
|
/* AM */
|
|
626
626
|
},
|
|
627
|
-
"onUpdate:modelValue": u[6] || (u[6] = (
|
|
627
|
+
"onUpdate:modelValue": u[6] || (u[6] = (I) => h.value = I)
|
|
628
628
|
}, null, 8, ["model-value"]),
|
|
629
|
-
f("div",
|
|
630
|
-
|
|
631
|
-
label: c(
|
|
629
|
+
f("div", $t, [
|
|
630
|
+
v(U, {
|
|
631
|
+
label: c(a)("common.cancel"),
|
|
632
632
|
size: "md",
|
|
633
633
|
variant: "tertiary",
|
|
634
|
-
onClick:
|
|
634
|
+
onClick: l
|
|
635
635
|
}, null, 8, ["label"]),
|
|
636
|
-
|
|
636
|
+
v(U, {
|
|
637
637
|
disabled: !_.value,
|
|
638
|
-
label: c(
|
|
638
|
+
label: c(a)("common.confirm"),
|
|
639
639
|
size: "md",
|
|
640
640
|
variant: "primary",
|
|
641
641
|
onClick: s
|
|
@@ -647,14 +647,14 @@ const tt = {
|
|
|
647
647
|
}, 8, ["show-popover", "z-index"]);
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
|
-
}), Nt = { class: "container" },
|
|
650
|
+
}), Nt = { class: "container" }, Dt = /* @__PURE__ */ J({
|
|
651
651
|
__name: "ProgressBar",
|
|
652
652
|
props: {
|
|
653
653
|
bgcolor: {},
|
|
654
654
|
completed: {}
|
|
655
655
|
},
|
|
656
656
|
setup(D) {
|
|
657
|
-
const x = D,
|
|
657
|
+
const x = D, a = N(() => ({
|
|
658
658
|
height: "100%",
|
|
659
659
|
width: `${x.completed ?? 0}%`,
|
|
660
660
|
backgroundColor: x.bgcolor,
|
|
@@ -664,15 +664,15 @@ const tt = {
|
|
|
664
664
|
}));
|
|
665
665
|
return (p, i) => (y(), F("div", Nt, [
|
|
666
666
|
f("div", {
|
|
667
|
-
style:
|
|
667
|
+
style: Be(a.value)
|
|
668
668
|
}, null, 4)
|
|
669
669
|
]));
|
|
670
670
|
}
|
|
671
|
-
}),
|
|
671
|
+
}), Rt = /* @__PURE__ */ Pe(Dt, [["__scopeId", "data-v-709d7500"]]), Ut = {
|
|
672
672
|
class: "flex items-center gap-24"
|
|
673
|
-
},
|
|
673
|
+
}, Ot = {
|
|
674
674
|
class: "fm-typo-en-title-md-600"
|
|
675
|
-
},
|
|
675
|
+
}, Bt = /* @__PURE__ */ J({
|
|
676
676
|
__name: "PublishProgressView",
|
|
677
677
|
props: {
|
|
678
678
|
progress: {
|
|
@@ -687,53 +687,52 @@ const tt = {
|
|
|
687
687
|
emits: ["publishMenu"],
|
|
688
688
|
setup(D, {
|
|
689
689
|
expose: x,
|
|
690
|
-
emit:
|
|
690
|
+
emit: a
|
|
691
691
|
}) {
|
|
692
692
|
const {
|
|
693
693
|
t: p
|
|
694
|
-
} =
|
|
695
|
-
[
|
|
694
|
+
} = X(), i = pe(), g = Fe(), h = D, _ = {
|
|
695
|
+
[G.enum.PENDING]: {
|
|
696
696
|
label: p("menu.publish.scheduler_publish.status.pending"),
|
|
697
697
|
textColor: "text-fm-color-neutral-gray-300",
|
|
698
698
|
backgroundColor: "#E0E0DE"
|
|
699
699
|
},
|
|
700
|
-
[
|
|
700
|
+
[G.enum.RUNNING]: {
|
|
701
701
|
label: p("menu.publish.scheduler_publish.status.running"),
|
|
702
702
|
textColor: "text-fm-color-system-warning-300",
|
|
703
703
|
backgroundColor: "#FFB800"
|
|
704
704
|
},
|
|
705
|
-
[
|
|
705
|
+
[G.enum.COMPLETED]: {
|
|
706
706
|
label: p("menu.publish.scheduler_publish.status.completed"),
|
|
707
707
|
textColor: "text-fm-color-system-success-300",
|
|
708
708
|
backgroundColor: "#34C759"
|
|
709
709
|
},
|
|
710
|
-
[
|
|
710
|
+
[G.enum.FAILED]: {
|
|
711
711
|
label: p("menu.publish.scheduler_publish.status.failed"),
|
|
712
712
|
textColor: "text-fm-color-system-error-300",
|
|
713
713
|
backgroundColor: "#FF3B30"
|
|
714
714
|
}
|
|
715
|
-
}, e =
|
|
715
|
+
}, e = Ve(), k = $(!1), s = (u) => {
|
|
716
716
|
typeof u == "boolean" ? k.value = u : k.value = !k.value;
|
|
717
717
|
};
|
|
718
718
|
x({
|
|
719
719
|
show: k,
|
|
720
720
|
trigger: s
|
|
721
721
|
});
|
|
722
|
-
const
|
|
723
|
-
var
|
|
724
|
-
const U = e.runningPublishJob, O = Object.keys(
|
|
722
|
+
const l = a, n = N(() => e.state.nextSchedulerPublish ?? {}), o = N(() => Object.entries(n.value).map(([C, P]) => {
|
|
723
|
+
var I;
|
|
724
|
+
const U = e.runningPublishJob, O = Object.keys(P.restaurants || {}).length;
|
|
725
725
|
return {
|
|
726
726
|
date: C,
|
|
727
|
-
publisher: ((
|
|
727
|
+
publisher: ((I = P.owner) == null ? void 0 : I.name) ?? "Unknown",
|
|
728
728
|
total_restaurants: p("menu.publish.scheduler_publish.table.row.restaurants", {
|
|
729
729
|
total: O
|
|
730
730
|
}),
|
|
731
|
-
restaurantPublishStatus:
|
|
732
|
-
status:
|
|
733
|
-
progress: U === C ? h.progress ?? 0 : 0
|
|
734
|
-
// Only apply progress to the running job's row
|
|
731
|
+
restaurantPublishStatus: P.restaurants || {},
|
|
732
|
+
status: P.status,
|
|
733
|
+
progress: P.status === G.enum.RUNNING && U === C ? h.progress ?? 0 : 0
|
|
735
734
|
};
|
|
736
|
-
})), r =
|
|
735
|
+
})), r = $([]), d = $(null), m = $(null), R = [{
|
|
737
736
|
accessorKey: "date",
|
|
738
737
|
header: p("menu.publish.scheduler_publish.table.columns.date"),
|
|
739
738
|
cell: ({
|
|
@@ -742,10 +741,10 @@ const tt = {
|
|
|
742
741
|
if (u.original.date === "new") {
|
|
743
742
|
if (d.value !== null)
|
|
744
743
|
return new Date(d.value).toLocaleString();
|
|
745
|
-
const
|
|
746
|
-
return B(
|
|
744
|
+
const P = z(Date.now()).toISOString();
|
|
745
|
+
return B(At, {
|
|
747
746
|
class: "flex h-full items-center",
|
|
748
|
-
modelValue:
|
|
747
|
+
modelValue: P,
|
|
749
748
|
"onUpdate:schedulerTime": (U) => {
|
|
750
749
|
d.value = U;
|
|
751
750
|
}
|
|
@@ -761,10 +760,10 @@ const tt = {
|
|
|
761
760
|
header: p("menu.publish.scheduler_publish.table.columns.total_restaurants"),
|
|
762
761
|
cell: ({
|
|
763
762
|
row: u
|
|
764
|
-
}) => u.original.date === "new" ? B(
|
|
763
|
+
}) => u.original.date === "new" ? B(it, {
|
|
765
764
|
restaurants: h.restaurants,
|
|
766
|
-
"onUpdate:modelValue": (
|
|
767
|
-
r.value =
|
|
765
|
+
"onUpdate:modelValue": (P) => {
|
|
766
|
+
r.value = P;
|
|
768
767
|
}
|
|
769
768
|
}) : B("p", {}, u.original.total_restaurants)
|
|
770
769
|
}, {
|
|
@@ -776,14 +775,14 @@ const tt = {
|
|
|
776
775
|
const C = u.original.status;
|
|
777
776
|
return u.original.date === "new" ? B("div", {
|
|
778
777
|
class: "flex justify-end items-center gap-8"
|
|
779
|
-
}, [B(
|
|
778
|
+
}, [B(Z.FmButton, {
|
|
780
779
|
variant: "tertiary",
|
|
781
780
|
prependIcon: "close",
|
|
782
781
|
textColor: "system-error-300",
|
|
783
782
|
onClick: () => {
|
|
784
783
|
d.value = null, S.value = null, m.value = null;
|
|
785
784
|
}
|
|
786
|
-
}), B(
|
|
785
|
+
}), B(Z.FmButton, {
|
|
787
786
|
variant: "tertiary",
|
|
788
787
|
prependIcon: "check",
|
|
789
788
|
textColor: "system-success-300",
|
|
@@ -805,19 +804,19 @@ const tt = {
|
|
|
805
804
|
class: "flex items-center gap-8"
|
|
806
805
|
}, [B("p", {
|
|
807
806
|
class: `fm-typo-en-body-md-400 ${_[C].textColor}`
|
|
808
|
-
}, _[C].label), ...C ===
|
|
807
|
+
}, _[C].label), ...C === G.enum.RUNNING ? [B("p", {
|
|
809
808
|
class: `fm-typo-en-body-md-400 ${_[C].textColor}`
|
|
810
|
-
}, `(${u.original.progress}/${u.original.total_restaurants})`)] : []]), B(
|
|
809
|
+
}, `(${u.original.progress}/${u.original.total_restaurants})`)] : []]), B(Rt, {
|
|
811
810
|
bgcolor: _[C].backgroundColor,
|
|
812
|
-
completed: C ===
|
|
813
|
-
})]), B(
|
|
811
|
+
completed: C === G.enum.PENDING ? 0 : C === G.enum.RUNNING ? Math.floor((u.original.progress ?? 0) / parseInt(u.original.total_restaurants) * 100) : (C === G.enum.COMPLETED, 100)
|
|
812
|
+
})]), B(Z.FmButton, {
|
|
814
813
|
variant: "plain",
|
|
815
814
|
prependIcon: "info",
|
|
816
815
|
disabled: Array.isArray(u.original.restaurantPublishStatus),
|
|
817
816
|
onClick: () => {
|
|
818
817
|
g.open({
|
|
819
818
|
title: p("menu.publish.scheduler_publish.restaurant_publish_details.title"),
|
|
820
|
-
contentComponent:
|
|
819
|
+
contentComponent: ht,
|
|
821
820
|
contentComponentProps: {
|
|
822
821
|
restaurantPublishStatus: u.original.restaurantPublishStatus,
|
|
823
822
|
statusMap: _
|
|
@@ -827,10 +826,10 @@ const tt = {
|
|
|
827
826
|
maxHeight: "80vh"
|
|
828
827
|
});
|
|
829
828
|
}
|
|
830
|
-
}), B(
|
|
829
|
+
}), B(Z.FmButton, {
|
|
831
830
|
variant: "tertiary",
|
|
832
831
|
prependIcon: "delete",
|
|
833
|
-
disabled: C !==
|
|
832
|
+
disabled: C !== G.enum.PENDING,
|
|
834
833
|
textColor: "system-error-300",
|
|
835
834
|
onClick: () => {
|
|
836
835
|
const U = z(u.original.date).toISOString();
|
|
@@ -864,60 +863,60 @@ const tt = {
|
|
|
864
863
|
})]);
|
|
865
864
|
}
|
|
866
865
|
}];
|
|
867
|
-
|
|
866
|
+
ce(async () => {
|
|
868
867
|
await e.getNextSchedulerPublish();
|
|
869
868
|
});
|
|
870
|
-
const S =
|
|
871
|
-
function
|
|
869
|
+
const S = $(null);
|
|
870
|
+
function Y() {
|
|
872
871
|
m.value = !1, S.value = {
|
|
873
872
|
date: "new",
|
|
874
873
|
restaurantsIds: []
|
|
875
874
|
};
|
|
876
875
|
}
|
|
877
|
-
|
|
878
|
-
u && (
|
|
876
|
+
Ce(m, async (u) => {
|
|
877
|
+
u && (l("publishMenu", {
|
|
879
878
|
schedulerTime: d.value,
|
|
880
879
|
restaurantIds: r.value
|
|
881
880
|
}), await e.getNextSchedulerPublish(), d.value = null, r.value = [], m.value = !1, S.value = null, m.value = null);
|
|
882
881
|
});
|
|
883
|
-
const V =
|
|
882
|
+
const V = Me(() => m.value !== null && m.value === !1, () => {
|
|
884
883
|
k.value = !1, S.value = null, d.value = null, r.value = [], m.value = null;
|
|
885
884
|
});
|
|
886
885
|
return (u, C) => {
|
|
887
|
-
const
|
|
888
|
-
return y(), F(
|
|
886
|
+
const P = A("FmButton"), U = A("FmTable"), O = A("FmSideSheet");
|
|
887
|
+
return y(), F(L, null, [Te(u.$slots, "default", {
|
|
889
888
|
trigger: s
|
|
890
|
-
}),
|
|
889
|
+
}), v(O, {
|
|
891
890
|
modelValue: k.value,
|
|
892
|
-
"onUpdate:modelValue": C[1] || (C[1] = (
|
|
891
|
+
"onUpdate:modelValue": C[1] || (C[1] = (I) => k.value = I),
|
|
893
892
|
"close-button": !1,
|
|
894
893
|
"max-width": 800,
|
|
895
894
|
"onOn:clickedAway": c(V)
|
|
896
895
|
}, {
|
|
897
|
-
"side-sheet-header": E(() => [f("div",
|
|
896
|
+
"side-sheet-header": E(() => [f("div", Ut, [v(P, {
|
|
898
897
|
variant: c(ye).Tertiary,
|
|
899
898
|
"prepend-icon": "arrow_back",
|
|
900
|
-
onClick:
|
|
901
|
-
}, null, 8, ["variant", "onClick"]), f("p",
|
|
902
|
-
default: E(() => [f("div", null, [
|
|
899
|
+
onClick: te(c(V), ["stop"])
|
|
900
|
+
}, null, 8, ["variant", "onClick"]), f("p", Ot, T(c(p)("menu.publish.actions.publish_progress")), 1)])]),
|
|
901
|
+
default: E(() => [f("div", null, [v(U, {
|
|
903
902
|
class: "pb-8",
|
|
904
903
|
"row-data": [...o.value, S.value].filter(Boolean),
|
|
905
904
|
"column-defs": R,
|
|
906
905
|
"shrink-at": !1,
|
|
907
906
|
pageSize: o.value.length + (S.value ? 1 : 0),
|
|
908
907
|
"hide-footer": ""
|
|
909
|
-
}, null, 8, ["row-data", "pageSize"]), c(e).state.featureFlags.schedulerPublish && !S.value ? (y(),
|
|
908
|
+
}, null, 8, ["row-data", "pageSize"]), c(e).state.featureFlags.schedulerPublish && !S.value ? (y(), K(P, {
|
|
910
909
|
key: 0,
|
|
911
910
|
variant: c(ye).Plain,
|
|
912
911
|
"prepend-icon": "add",
|
|
913
912
|
label: c(p)("menu.publish.actions.add_scheduler_publish"),
|
|
914
|
-
onClick: C[0] || (C[0] = () =>
|
|
915
|
-
}, null, 8, ["variant", "label"])) :
|
|
913
|
+
onClick: C[0] || (C[0] = () => Y())
|
|
914
|
+
}, null, 8, ["variant", "label"])) : Q("", !0)])]),
|
|
916
915
|
_: 1
|
|
917
916
|
}, 8, ["modelValue", "onOn:clickedAway"])], 64);
|
|
918
917
|
};
|
|
919
918
|
}
|
|
920
|
-
}),
|
|
919
|
+
}), Tt = { class: "fm-typo-en-title-md-600" }, Et = { class: "mt-40" }, zt = { class: "fm-typo-en-title-sm-600" }, Lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, jt = { class: "flex gap-8 items-center justify-start" }, Kt = /* @__PURE__ */ J({
|
|
921
920
|
__name: "UpdateCatalogDialog",
|
|
922
921
|
props: {
|
|
923
922
|
catalogs: {
|
|
@@ -926,13 +925,13 @@ const tt = {
|
|
|
926
925
|
}
|
|
927
926
|
},
|
|
928
927
|
emits: ["onComplete"],
|
|
929
|
-
setup(D, { expose: x, emit:
|
|
930
|
-
const { t: p } =
|
|
928
|
+
setup(D, { expose: x, emit: a }) {
|
|
929
|
+
const { t: p } = X(), i = D;
|
|
931
930
|
x({
|
|
932
931
|
show: n,
|
|
933
932
|
hide: o
|
|
934
933
|
});
|
|
935
|
-
const g =
|
|
934
|
+
const g = a;
|
|
936
935
|
function h() {
|
|
937
936
|
return {
|
|
938
937
|
restaurantId: "",
|
|
@@ -942,7 +941,7 @@ const tt = {
|
|
|
942
941
|
additionalCatalogs: []
|
|
943
942
|
};
|
|
944
943
|
}
|
|
945
|
-
const _ =
|
|
944
|
+
const _ = N(() => [
|
|
946
945
|
{
|
|
947
946
|
label: p("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
948
947
|
value: null
|
|
@@ -951,7 +950,7 @@ const tt = {
|
|
|
951
950
|
label: m.name,
|
|
952
951
|
value: m._id
|
|
953
952
|
}))
|
|
954
|
-
]), e =
|
|
953
|
+
]), e = N(() => [
|
|
955
954
|
{
|
|
956
955
|
label: p("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
957
956
|
value: null
|
|
@@ -960,15 +959,15 @@ const tt = {
|
|
|
960
959
|
label: m.name,
|
|
961
960
|
value: m._id
|
|
962
961
|
}))
|
|
963
|
-
]), k =
|
|
962
|
+
]), k = $(h()), s = $(!1), l = $(void 0);
|
|
964
963
|
function n(m) {
|
|
965
|
-
|
|
964
|
+
l.value = m ? ge(m) : h(), k.value = ge(l.value), s.value = !0;
|
|
966
965
|
}
|
|
967
966
|
function o() {
|
|
968
967
|
s.value = !1;
|
|
969
968
|
}
|
|
970
|
-
const r =
|
|
971
|
-
() => !
|
|
969
|
+
const r = Me(
|
|
970
|
+
() => !et.isEqual(l.value, k.value),
|
|
972
971
|
() => {
|
|
973
972
|
o();
|
|
974
973
|
}
|
|
@@ -977,25 +976,25 @@ const tt = {
|
|
|
977
976
|
o(), g("onComplete", k.value);
|
|
978
977
|
}
|
|
979
978
|
return (m, R) => {
|
|
980
|
-
const S =
|
|
981
|
-
return y(),
|
|
979
|
+
const S = A("FmSelect"), Y = A("FmCheckbox"), V = A("FmButton"), u = A("FmSideSheet");
|
|
980
|
+
return y(), K(u, {
|
|
982
981
|
modelValue: s.value,
|
|
983
982
|
"onUpdate:modelValue": R[5] || (R[5] = (C) => s.value = C),
|
|
984
983
|
"max-width": 560,
|
|
985
984
|
"onOn:clickedAway": c(r)
|
|
986
985
|
}, {
|
|
987
986
|
"side-sheet-header": E(() => [
|
|
988
|
-
f("span",
|
|
987
|
+
f("span", Tt, T(c(p)("menu.publish.update_catalog_dialog.title")), 1)
|
|
989
988
|
]),
|
|
990
989
|
"side-sheet-footer": E(() => [
|
|
991
|
-
f("div",
|
|
992
|
-
|
|
990
|
+
f("div", jt, [
|
|
991
|
+
v(V, {
|
|
993
992
|
label: c(p)("menu.publish.update_catalog_dialog.actions.update"),
|
|
994
993
|
size: "lg",
|
|
995
994
|
variant: "primary",
|
|
996
995
|
onClick: R[4] || (R[4] = () => d())
|
|
997
996
|
}, null, 8, ["label"]),
|
|
998
|
-
|
|
997
|
+
v(V, {
|
|
999
998
|
label: c(p)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
1000
999
|
size: "lg",
|
|
1001
1000
|
variant: "tertiary",
|
|
@@ -1004,35 +1003,35 @@ const tt = {
|
|
|
1004
1003
|
])
|
|
1005
1004
|
]),
|
|
1006
1005
|
default: E(() => [
|
|
1007
|
-
|
|
1006
|
+
v(S, {
|
|
1008
1007
|
modelValue: k.value.catalogId,
|
|
1009
1008
|
"onUpdate:modelValue": R[0] || (R[0] = (C) => k.value.catalogId = C),
|
|
1010
1009
|
items: _.value,
|
|
1011
1010
|
class: "mb-24",
|
|
1012
1011
|
label: c(p)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
1013
1012
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
1014
|
-
|
|
1013
|
+
v(S, {
|
|
1015
1014
|
modelValue: k.value.takeawayCatalog,
|
|
1016
1015
|
"onUpdate:modelValue": R[1] || (R[1] = (C) => k.value.takeawayCatalog = C),
|
|
1017
1016
|
items: e.value,
|
|
1018
1017
|
class: "mb-24",
|
|
1019
1018
|
label: c(p)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
1020
1019
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
1021
|
-
|
|
1020
|
+
v(S, {
|
|
1022
1021
|
modelValue: k.value.pickupCatalog,
|
|
1023
1022
|
"onUpdate:modelValue": R[2] || (R[2] = (C) => k.value.pickupCatalog = C),
|
|
1024
1023
|
items: e.value,
|
|
1025
1024
|
label: c(p)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
1026
1025
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
1027
|
-
f("div",
|
|
1028
|
-
f("div",
|
|
1029
|
-
f("div",
|
|
1030
|
-
(y(!0), F(
|
|
1026
|
+
f("div", Et, [
|
|
1027
|
+
f("div", zt, T(c(p)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
1028
|
+
f("div", Lt, T(c(p)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
1029
|
+
(y(!0), F(L, null, W(D.catalogs, (C) => (y(), F("div", {
|
|
1031
1030
|
key: C._id
|
|
1032
1031
|
}, [
|
|
1033
|
-
|
|
1032
|
+
v(Y, {
|
|
1034
1033
|
modelValue: k.value.additionalCatalogs,
|
|
1035
|
-
"onUpdate:modelValue": R[3] || (R[3] = (
|
|
1034
|
+
"onUpdate:modelValue": R[3] || (R[3] = (P) => k.value.additionalCatalogs = P),
|
|
1036
1035
|
label: C.name,
|
|
1037
1036
|
value: C._id
|
|
1038
1037
|
}, null, 8, ["modelValue", "label", "value"])
|
|
@@ -1043,84 +1042,84 @@ const tt = {
|
|
|
1043
1042
|
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
1044
1043
|
};
|
|
1045
1044
|
}
|
|
1046
|
-
}),
|
|
1045
|
+
}), Yt = {
|
|
1047
1046
|
class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
|
|
1048
|
-
}, Yt = {
|
|
1049
|
-
class: "flex items-center xs:mb-8 mb-24"
|
|
1050
1047
|
}, Ht = {
|
|
1051
|
-
class: "
|
|
1048
|
+
class: "flex items-center xs:mb-8 mb-24"
|
|
1052
1049
|
}, qt = {
|
|
1053
|
-
class: "
|
|
1050
|
+
class: "mr-8"
|
|
1054
1051
|
}, Gt = {
|
|
1055
|
-
class: "
|
|
1052
|
+
class: "fm-typo-en-title-md-600"
|
|
1056
1053
|
}, Jt = {
|
|
1057
1054
|
class: "xs:hidden mr-16"
|
|
1058
1055
|
}, Wt = {
|
|
1059
|
-
class: "xs:hidden"
|
|
1056
|
+
class: "xs:hidden mr-16"
|
|
1060
1057
|
}, Qt = {
|
|
1061
|
-
class: "
|
|
1058
|
+
class: "xs:hidden"
|
|
1062
1059
|
}, Xt = {
|
|
1063
|
-
class: "
|
|
1060
|
+
class: "pb-8 flex justify-between items-start xs:flex-col xs:items-stretch gap-8"
|
|
1064
1061
|
}, Zt = {
|
|
1062
|
+
class: "grow flex flex-col gap-4"
|
|
1063
|
+
}, ea = {
|
|
1065
1064
|
class: "flex gap-8 items-center"
|
|
1066
|
-
},
|
|
1065
|
+
}, ta = {
|
|
1067
1066
|
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
1068
|
-
},
|
|
1067
|
+
}, aa = {
|
|
1069
1068
|
class: "space-y-4"
|
|
1070
|
-
},
|
|
1069
|
+
}, la = {
|
|
1071
1070
|
class: "fm-typo-en-body-lg-600"
|
|
1072
|
-
},
|
|
1071
|
+
}, sa = {
|
|
1073
1072
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1074
|
-
},
|
|
1073
|
+
}, na = {
|
|
1075
1074
|
class: "flex gap-8"
|
|
1076
|
-
},
|
|
1075
|
+
}, oa = {
|
|
1077
1076
|
class: "xs:block hidden fixed bottom-72 right-16"
|
|
1078
|
-
},
|
|
1077
|
+
}, ga = /* @__PURE__ */ J({
|
|
1079
1078
|
__name: "Publish",
|
|
1080
1079
|
setup(D) {
|
|
1081
|
-
const x =
|
|
1082
|
-
t:
|
|
1083
|
-
} =
|
|
1080
|
+
const x = ze(), {
|
|
1081
|
+
t: a
|
|
1082
|
+
} = X(), p = ({
|
|
1084
1083
|
row: t
|
|
1085
1084
|
}) => {
|
|
1086
|
-
const
|
|
1087
|
-
return
|
|
1088
|
-
label:
|
|
1089
|
-
variant:
|
|
1085
|
+
const b = t.status === "latest";
|
|
1086
|
+
return v(We, {
|
|
1087
|
+
label: a(b ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
|
|
1088
|
+
variant: b ? "success" : "warning"
|
|
1090
1089
|
}, null);
|
|
1091
|
-
}, i =
|
|
1090
|
+
}, i = $({}), g = [{
|
|
1092
1091
|
accessorKey: "displayName",
|
|
1093
|
-
header: () =>
|
|
1092
|
+
header: () => a("menu.publish.table.columns.restaurant"),
|
|
1094
1093
|
cell: (t) => t.getValue(),
|
|
1095
1094
|
enableSorting: !0
|
|
1096
1095
|
}, {
|
|
1097
1096
|
accessorKey: "catalog",
|
|
1098
|
-
header: () =>
|
|
1097
|
+
header: () => a("menu.publish.table.columns.default"),
|
|
1099
1098
|
enableSorting: !1,
|
|
1100
1099
|
cell: (t) => t.getValue().default
|
|
1101
1100
|
}, {
|
|
1102
1101
|
accessorKey: "catalog",
|
|
1103
|
-
header: () =>
|
|
1102
|
+
header: () => a("menu.publish.table.columns.pos_takeaway"),
|
|
1104
1103
|
enableSorting: !1,
|
|
1105
1104
|
cell: (t) => t.getValue().takeaway
|
|
1106
1105
|
}, {
|
|
1107
1106
|
accessorKey: "catalog",
|
|
1108
|
-
header: () =>
|
|
1107
|
+
header: () => a("menu.publish.table.columns.pickup"),
|
|
1109
1108
|
enableSorting: !1,
|
|
1110
1109
|
cell: (t) => t.getValue().pickup
|
|
1111
1110
|
}, {
|
|
1112
1111
|
accessorKey: "updatedAt",
|
|
1113
|
-
header: () =>
|
|
1112
|
+
header: () => a("menu.publish.table.columns.version"),
|
|
1114
1113
|
enableSorting: !1,
|
|
1115
1114
|
cell: (t) => {
|
|
1116
|
-
const
|
|
1117
|
-
return m(
|
|
1115
|
+
const b = t.getValue();
|
|
1116
|
+
return m(b);
|
|
1118
1117
|
}
|
|
1119
1118
|
}, {
|
|
1120
1119
|
accessorKey: "status",
|
|
1121
|
-
header: () =>
|
|
1120
|
+
header: () => a("menu.common.labels.status"),
|
|
1122
1121
|
enableSorting: !1,
|
|
1123
|
-
cell: (t) =>
|
|
1122
|
+
cell: (t) => v(p, {
|
|
1124
1123
|
row: t.row.original
|
|
1125
1124
|
}, null)
|
|
1126
1125
|
}, {
|
|
@@ -1129,20 +1128,20 @@ const tt = {
|
|
|
1129
1128
|
size: 52,
|
|
1130
1129
|
enableSorting: !1,
|
|
1131
1130
|
cell: (t) => {
|
|
1132
|
-
const
|
|
1131
|
+
const b = t.row.original;
|
|
1133
1132
|
return B("div", {
|
|
1134
1133
|
class: "flex justify-end gap-8"
|
|
1135
|
-
}, [o.value &&
|
|
1134
|
+
}, [o.value && b.revertConfig ? Ze(B(Z.FmButton, {
|
|
1136
1135
|
prependIcon: "undo",
|
|
1137
1136
|
variant: "secondary",
|
|
1138
|
-
onClick:
|
|
1137
|
+
onClick: te(async () => {
|
|
1139
1138
|
await r(t.row.original);
|
|
1140
1139
|
}, ["stop", "prevent"])
|
|
1141
|
-
}),
|
|
1142
|
-
label:
|
|
1140
|
+
}), a("menu.publish.actions.revert")) : null, B(Z.FmButton, {
|
|
1141
|
+
label: a("menu.publish.actions.publish"),
|
|
1143
1142
|
icon: "ios_share",
|
|
1144
1143
|
variant: "secondary",
|
|
1145
|
-
onClick:
|
|
1144
|
+
onClick: te(async () => {
|
|
1146
1145
|
const w = V(t.row.original);
|
|
1147
1146
|
await U(w);
|
|
1148
1147
|
}, ["stop", "prevent"])
|
|
@@ -1151,22 +1150,22 @@ const tt = {
|
|
|
1151
1150
|
meta: {
|
|
1152
1151
|
width: "150px"
|
|
1153
1152
|
}
|
|
1154
|
-
}], h =
|
|
1155
|
-
var
|
|
1153
|
+
}], h = $(""), _ = $(), e = Ve(), k = me(), s = N(() => {
|
|
1154
|
+
var b;
|
|
1156
1155
|
const t = /* @__PURE__ */ new Map();
|
|
1157
1156
|
for (const w of k.restaurants.value)
|
|
1158
|
-
(
|
|
1157
|
+
(b = w.profile) != null && b.code && t.set(w._id, w.profile.code);
|
|
1159
1158
|
return t;
|
|
1160
1159
|
});
|
|
1161
|
-
function
|
|
1160
|
+
function l(t, b) {
|
|
1162
1161
|
const w = s.value.get(t);
|
|
1163
|
-
return w ? `${
|
|
1162
|
+
return w ? `${b} (${w})` : b;
|
|
1164
1163
|
}
|
|
1165
|
-
const n =
|
|
1164
|
+
const n = Fe(), o = N(() => e.version !== qe.enum.v3);
|
|
1166
1165
|
async function r(t) {
|
|
1167
1166
|
t.revertConfig && n.open({
|
|
1168
1167
|
title: "Revert menu",
|
|
1169
|
-
contentComponent:
|
|
1168
|
+
contentComponent: ot,
|
|
1170
1169
|
contentComponentProps: {
|
|
1171
1170
|
restaurant: t
|
|
1172
1171
|
},
|
|
@@ -1179,7 +1178,7 @@ const tt = {
|
|
|
1179
1178
|
close: !0
|
|
1180
1179
|
}
|
|
1181
1180
|
}).onPrimary(async () => {
|
|
1182
|
-
await
|
|
1181
|
+
await P.minor(async () => {
|
|
1183
1182
|
await e.revertRestaurantMenu(t._id);
|
|
1184
1183
|
}, {
|
|
1185
1184
|
customId: t._id,
|
|
@@ -1187,16 +1186,16 @@ const tt = {
|
|
|
1187
1186
|
});
|
|
1188
1187
|
});
|
|
1189
1188
|
}
|
|
1190
|
-
const d =
|
|
1189
|
+
const d = N(() => a("menu.publish.labels.main_version", {
|
|
1191
1190
|
version: m(e.state.menu.updatedAt)
|
|
1192
1191
|
}));
|
|
1193
1192
|
function m(t) {
|
|
1194
1193
|
return t ? z(t).format("DD/MM/YYYY hh:mmA") : "";
|
|
1195
1194
|
}
|
|
1196
|
-
const R =
|
|
1197
|
-
function
|
|
1198
|
-
var
|
|
1199
|
-
return t ? ((
|
|
1195
|
+
const R = N(() => e.state.menu.modules.catalog), S = N(() => P.queue.value.some((t) => t.id === e.state.menu._id));
|
|
1196
|
+
function Y(t) {
|
|
1197
|
+
var b;
|
|
1198
|
+
return t ? ((b = R.value.find((w) => w._id === t)) == null ? void 0 : b.name) ?? a("menu.publish.labels.catalog.invalid") : a("menu.publish.labels.catalog.main");
|
|
1200
1199
|
}
|
|
1201
1200
|
function V(t) {
|
|
1202
1201
|
return {
|
|
@@ -1209,202 +1208,205 @@ const tt = {
|
|
|
1209
1208
|
}
|
|
1210
1209
|
function u(t) {
|
|
1211
1210
|
var w;
|
|
1212
|
-
const
|
|
1213
|
-
(w = _.value) == null || w.show(
|
|
1211
|
+
const b = V(t);
|
|
1212
|
+
(w = _.value) == null || w.show(b);
|
|
1214
1213
|
}
|
|
1215
|
-
const C =
|
|
1214
|
+
const C = pe(), P = we(C);
|
|
1216
1215
|
async function U(t) {
|
|
1217
1216
|
var w;
|
|
1218
|
-
|
|
1219
|
-
|
|
1217
|
+
if (S.value) return;
|
|
1218
|
+
const b = (w = H.value.find((q) => q._id === t.restaurantId)) == null ? void 0 : w.name;
|
|
1219
|
+
await P.minor(async () => await e.publishMenu(t, !1), {
|
|
1220
1220
|
customId: e.state.menu._id,
|
|
1221
|
-
message: `
|
|
1222
|
-
successMessage: `
|
|
1223
|
-
});
|
|
1221
|
+
message: `Registering menu publish for ${b}`,
|
|
1222
|
+
successMessage: `Menu publish registered for ${b}.`
|
|
1223
|
+
}), await ae();
|
|
1224
1224
|
}
|
|
1225
|
-
const O =
|
|
1226
|
-
const t = h.value.toLowerCase(),
|
|
1225
|
+
const O = $(null), I = N(() => a("menu.common.labels.status")), he = N(() => a("menu.publish.table.status.latest")), fe = N(() => a("menu.publish.table.status.outdated")), H = N(() => {
|
|
1226
|
+
const t = h.value.toLowerCase(), b = e.state.menu.updatedAt;
|
|
1227
1227
|
return e.state.restaurants.filter((w) => {
|
|
1228
|
-
var
|
|
1229
|
-
return !O.value || ((
|
|
1228
|
+
var q;
|
|
1229
|
+
return !O.value || ((q = O.value) == null ? void 0 : q.includes(w._id));
|
|
1230
1230
|
}).map((w) => ({
|
|
1231
1231
|
...w,
|
|
1232
|
-
displayName:
|
|
1232
|
+
displayName: l(w._id, w.name),
|
|
1233
1233
|
catalog: {
|
|
1234
|
-
default:
|
|
1235
|
-
takeaway:
|
|
1236
|
-
pickup:
|
|
1234
|
+
default: Y(w.catalogId),
|
|
1235
|
+
takeaway: Y(w.takeawayCatalog),
|
|
1236
|
+
pickup: Y(w.pickupCatalog)
|
|
1237
1237
|
},
|
|
1238
|
-
status:
|
|
1239
|
-
[
|
|
1240
|
-
})).filter((w) =>
|
|
1238
|
+
status: b === w.updatedAt ? "latest" : "outdated",
|
|
1239
|
+
[I.value]: b === w.updatedAt ? he.value : fe.value
|
|
1240
|
+
})).filter((w) => Le(w, ne.value)).filter(({
|
|
1241
1241
|
displayName: w,
|
|
1242
|
-
catalog:
|
|
1243
|
-
}) => t ? w.toLowerCase().includes(t) ||
|
|
1244
|
-
}),
|
|
1242
|
+
catalog: q
|
|
1243
|
+
}) => t ? w.toLowerCase().includes(t) || q.default.toLowerCase().includes(t) || q.takeaway.toLowerCase().includes(t) || q.pickup.toLowerCase().includes(t) : !0);
|
|
1244
|
+
}), ne = $({
|
|
1245
1245
|
logic: "AND",
|
|
1246
1246
|
rules: []
|
|
1247
|
-
}),
|
|
1247
|
+
}), $e = N(() => [{
|
|
1248
1248
|
type: "string",
|
|
1249
|
-
key:
|
|
1249
|
+
key: I.value,
|
|
1250
1250
|
entity: "menu",
|
|
1251
|
-
values: [
|
|
1252
|
-
}]),
|
|
1253
|
-
|
|
1254
|
-
|
|
1251
|
+
values: [he.value, fe.value]
|
|
1252
|
+
}]), oe = $(0), ee = $(null), ue = $(!1);
|
|
1253
|
+
function be() {
|
|
1254
|
+
ee.value !== null && (clearInterval(ee.value), ee.value = null);
|
|
1255
|
+
}
|
|
1256
|
+
async function ve() {
|
|
1257
|
+
return await e.getNextSchedulerPublish(), e.activePublishJob !== null ? (ue.value = !0, oe.value = e.runningPublishJob !== null ? await e.getPublishRestaurantsProgress() : 0, !0) : (oe.value = 0, be(), ue.value && (ue.value = !1, await e.readRestaurants()), !1);
|
|
1258
|
+
}
|
|
1259
|
+
async function ae() {
|
|
1260
|
+
!await ve() || ee.value !== null || (ee.value = setInterval(() => {
|
|
1261
|
+
ve();
|
|
1262
|
+
}, 3e4));
|
|
1263
|
+
}
|
|
1264
|
+
async function Ae() {
|
|
1265
|
+
await P.minor(async () => {
|
|
1266
|
+
await e.readRestaurants(), await ae();
|
|
1267
|
+
}, {
|
|
1255
1268
|
customId: e.state.menu._id
|
|
1256
|
-
})
|
|
1257
|
-
await ie();
|
|
1258
|
-
}, 3e4)) : (ue.value && (C.close(ue.value), ue.value = null), L.value !== null && (clearInterval(L.value), L.value = null), te.value = null);
|
|
1269
|
+
});
|
|
1259
1270
|
}
|
|
1260
1271
|
async function re(t) {
|
|
1261
1272
|
if (S.value) return;
|
|
1262
|
-
const
|
|
1263
|
-
if (t ? t.restaurantIds.length === e.state.restaurants.length :
|
|
1264
|
-
await
|
|
1265
|
-
await e.publishAllMenu(t == null ? void 0 : t.schedulerTime);
|
|
1273
|
+
const b = Object.keys(i.value).filter((j) => i.value[j]), w = b.length === 0 || b.length === H.value.length ? H.value : H.value.filter((j) => b.includes(j._id));
|
|
1274
|
+
if (t ? t.restaurantIds.length === e.state.restaurants.length : H.value.length === e.state.restaurants.length && (b.length === 0 || b.length === H.value.length))
|
|
1275
|
+
await P.minor(async () => {
|
|
1276
|
+
await e.publishAllMenu(t == null ? void 0 : t.schedulerTime, !1);
|
|
1266
1277
|
}, {
|
|
1267
1278
|
successMessage: "Menu publish registered for all restaurants."
|
|
1268
|
-
})
|
|
1279
|
+
});
|
|
1269
1280
|
else {
|
|
1270
|
-
const
|
|
1271
|
-
await
|
|
1272
|
-
await e.publishMultipleMenu(
|
|
1281
|
+
const j = (t == null ? void 0 : t.restaurantIds) || w.map((ie) => ie._id);
|
|
1282
|
+
await P.minor(async () => {
|
|
1283
|
+
await e.publishMultipleMenu(j, t == null ? void 0 : t.schedulerTime, !1);
|
|
1273
1284
|
}, {
|
|
1274
1285
|
successMessage: `Menu publish registered for ${t != null && t.restaurantIds ? t.restaurantIds.length : w.length} restaurant(s).`
|
|
1275
1286
|
});
|
|
1276
1287
|
}
|
|
1277
|
-
|
|
1278
|
-
await ie();
|
|
1279
|
-
}, 3e4);
|
|
1280
|
-
}
|
|
1281
|
-
async function ie() {
|
|
1282
|
-
await e.getNextSchedulerPublish(), e.runningPublishJob !== null ? (te.value = !1, ae.value = await e.getPublishRestaurantsProgress()) : (te.value = !0, L.value !== null && (clearInterval(L.value), L.value = null));
|
|
1288
|
+
await ae();
|
|
1283
1289
|
}
|
|
1284
|
-
return
|
|
1285
|
-
|
|
1286
|
-
}),
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
L.value != null && (clearInterval(L.value), L.value = null);
|
|
1292
|
-
}), (t, v) => {
|
|
1293
|
-
const w = $("FmChip"), G = $("FmSpacer"), K = $("FmButton"), de = $("FmBadge"), Ne = $("FmSearch"), Ae = $("FmTable"), De = $("FmListItem"), Re = $("FmList");
|
|
1294
|
-
return y(), F(j, null, [f("div", Kt, [f("div", Yt, [f("div", Ht, [f("div", qt, T(c(l)("menu.publish.title")), 1)]), b(w, {
|
|
1290
|
+
return ce(() => {
|
|
1291
|
+
ae();
|
|
1292
|
+
}), Ee(() => {
|
|
1293
|
+
be();
|
|
1294
|
+
}), (t, b) => {
|
|
1295
|
+
const w = A("FmChip"), q = A("FmSpacer"), j = A("FmButton"), ie = A("FmBadge"), Ne = A("FmSearch"), De = A("FmTable"), Re = A("FmListItem"), Ue = A("FmList");
|
|
1296
|
+
return y(), F(L, null, [f("div", Yt, [f("div", Ht, [f("div", qt, [f("div", Gt, T(c(a)("menu.publish.title")), 1)]), v(w, {
|
|
1295
1297
|
label: d.value,
|
|
1296
1298
|
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
1297
|
-
}, null, 8, ["label"]),
|
|
1299
|
+
}, null, 8, ["label"]), v(q), f("div", Jt, [v(j, {
|
|
1298
1300
|
disabled: S.value,
|
|
1299
|
-
label: c(
|
|
1301
|
+
label: c(a)("menu.publish.actions.refresh"),
|
|
1300
1302
|
variant: "secondary",
|
|
1301
|
-
onClick:
|
|
1302
|
-
}, null, 8, ["disabled", "label"])]), f("div",
|
|
1303
|
-
progress:
|
|
1304
|
-
restaurants:
|
|
1305
|
-
onPublishMenu:
|
|
1303
|
+
onClick: b[0] || (b[0] = () => Ae())
|
|
1304
|
+
}, null, 8, ["disabled", "label"])]), f("div", Wt, [v(Bt, {
|
|
1305
|
+
progress: oe.value,
|
|
1306
|
+
restaurants: H.value,
|
|
1307
|
+
onPublishMenu: b[1] || (b[1] = (M) => re(M))
|
|
1306
1308
|
}, {
|
|
1307
1309
|
default: E(({
|
|
1308
|
-
trigger:
|
|
1309
|
-
}) => [c(e).
|
|
1310
|
+
trigger: M
|
|
1311
|
+
}) => [c(e).activePublishJob !== null ? (y(), K(ie, {
|
|
1310
1312
|
key: 0,
|
|
1311
1313
|
variant: "critical",
|
|
1312
1314
|
value: 1
|
|
1313
1315
|
}, {
|
|
1314
|
-
default: E(() => [
|
|
1316
|
+
default: E(() => [v(j, {
|
|
1315
1317
|
variant: "secondary",
|
|
1316
1318
|
disabled: S.value,
|
|
1317
|
-
label: c(
|
|
1318
|
-
onClick:
|
|
1319
|
+
label: c(a)("menu.publish.actions.publish_progress"),
|
|
1320
|
+
onClick: M
|
|
1319
1321
|
}, null, 8, ["disabled", "label", "onClick"])]),
|
|
1320
1322
|
_: 2
|
|
1321
|
-
}, 1024)) : (y(),
|
|
1323
|
+
}, 1024)) : (y(), K(j, {
|
|
1322
1324
|
key: 1,
|
|
1323
1325
|
variant: "secondary",
|
|
1324
1326
|
disabled: S.value,
|
|
1325
|
-
label: c(
|
|
1326
|
-
onClick:
|
|
1327
|
+
label: c(a)("menu.publish.actions.publish_progress"),
|
|
1328
|
+
onClick: M
|
|
1327
1329
|
}, null, 8, ["disabled", "label", "onClick"]))]),
|
|
1328
1330
|
_: 1
|
|
1329
|
-
}, 8, ["progress", "restaurants"])]), f("div",
|
|
1331
|
+
}, 8, ["progress", "restaurants"])]), f("div", Qt, [v(j, {
|
|
1330
1332
|
disabled: S.value,
|
|
1331
1333
|
icon: "ios_share",
|
|
1332
|
-
label: c(
|
|
1334
|
+
label: c(a)("menu.publish.actions.publish_all"),
|
|
1333
1335
|
variant: "primary",
|
|
1334
|
-
onClick:
|
|
1335
|
-
}, null, 8, ["disabled", "label"])])]), f("div",
|
|
1336
|
+
onClick: b[2] || (b[2] = () => re())
|
|
1337
|
+
}, null, 8, ["disabled", "label"])])]), f("div", Xt, [v(c(Se), {
|
|
1336
1338
|
multiple: "",
|
|
1337
1339
|
modelValue: O.value,
|
|
1338
|
-
"onUpdate:modelValue":
|
|
1340
|
+
"onUpdate:modelValue": b[4] || (b[4] = (M) => O.value = M)
|
|
1339
1341
|
}, {
|
|
1340
|
-
"append-right": E(() => [
|
|
1341
|
-
modelValue:
|
|
1342
|
-
"onUpdate:modelValue":
|
|
1343
|
-
attributes:
|
|
1342
|
+
"append-right": E(() => [v(c(je), {
|
|
1343
|
+
modelValue: ne.value,
|
|
1344
|
+
"onUpdate:modelValue": b[3] || (b[3] = (M) => ne.value = M),
|
|
1345
|
+
attributes: $e.value
|
|
1344
1346
|
}, null, 8, ["modelValue", "attributes"])]),
|
|
1345
1347
|
_: 1
|
|
1346
|
-
}, 8, ["modelValue"]),
|
|
1348
|
+
}, 8, ["modelValue"]), v(Ne, {
|
|
1347
1349
|
modelValue: h.value,
|
|
1348
|
-
"onUpdate:modelValue":
|
|
1350
|
+
"onUpdate:modelValue": b[5] || (b[5] = (M) => h.value = M),
|
|
1349
1351
|
autofocus: "",
|
|
1350
1352
|
class: "w-[320px] xs:w-full",
|
|
1351
|
-
placeholder: c(
|
|
1352
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
1353
|
+
placeholder: c(a)("menu.publish.table.search.placeholder")
|
|
1354
|
+
}, null, 8, ["modelValue", "placeholder"])]), H.value.length > 0 ? (y(), F(L, {
|
|
1353
1355
|
key: 0
|
|
1354
|
-
}, [
|
|
1356
|
+
}, [v(Qe, {
|
|
1355
1357
|
class: "xs:hidden block"
|
|
1356
1358
|
}, {
|
|
1357
|
-
default: E(() => [
|
|
1359
|
+
default: E(() => [v(De, {
|
|
1358
1360
|
modelValue: i.value,
|
|
1359
|
-
"onUpdate:modelValue":
|
|
1360
|
-
"get-row-id": (
|
|
1361
|
+
"onUpdate:modelValue": b[6] || (b[6] = (M) => i.value = M),
|
|
1362
|
+
"get-row-id": (M) => M._id,
|
|
1361
1363
|
"column-defs": g,
|
|
1362
1364
|
loading: S.value,
|
|
1363
|
-
"page-size":
|
|
1364
|
-
"row-data":
|
|
1365
|
+
"page-size": H.value.length,
|
|
1366
|
+
"row-data": H.value,
|
|
1365
1367
|
shrinkAt: !1,
|
|
1366
1368
|
virtual: !0,
|
|
1367
1369
|
selection: "multiple",
|
|
1368
1370
|
"hide-footer": "",
|
|
1369
1371
|
"pin-header-row": "",
|
|
1370
|
-
onRowClick:
|
|
1372
|
+
onRowClick: b[7] || (b[7] = (M) => u(M.original))
|
|
1371
1373
|
}, null, 8, ["modelValue", "get-row-id", "loading", "page-size", "row-data"])]),
|
|
1372
1374
|
_: 1
|
|
1373
|
-
}),
|
|
1375
|
+
}), v(Ue, {
|
|
1374
1376
|
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
1375
1377
|
separator: ""
|
|
1376
1378
|
}, {
|
|
1377
|
-
default: E(() => [(y(!0), F(
|
|
1378
|
-
key:
|
|
1379
|
-
label:
|
|
1379
|
+
default: E(() => [(y(!0), F(L, null, W(H.value, (M) => (y(), K(Re, {
|
|
1380
|
+
key: M._id,
|
|
1381
|
+
label: M.displayName,
|
|
1380
1382
|
style: {
|
|
1381
1383
|
padding: "12px 0 !important"
|
|
1382
1384
|
},
|
|
1383
|
-
onClick: () => u(
|
|
1385
|
+
onClick: () => u(M)
|
|
1384
1386
|
}, {
|
|
1385
|
-
default: E(() => [f("div",
|
|
1386
|
-
row:
|
|
1387
|
-
}, null, 8, ["row"])]), f("div",
|
|
1387
|
+
default: E(() => [f("div", Zt, [f("div", ea, [f("div", ta, T(m(M.updatedAt)), 1), v(p, {
|
|
1388
|
+
row: M
|
|
1389
|
+
}, null, 8, ["row"])]), f("div", aa, [f("div", la, T(M.displayName), 1), f("div", sa, [f("div", null, "Default: " + T(M.catalog.default), 1), f("div", null, "POS takeaway: " + T(M.catalog.takeaway), 1), f("div", null, "Pickup: " + T(M.catalog.pickup), 1)])])]), f("div", na, [o.value && M.revertConfig ? (y(), K(j, {
|
|
1388
1390
|
key: 0,
|
|
1389
1391
|
disabled: S.value,
|
|
1390
1392
|
icon: "undo",
|
|
1391
1393
|
variant: "tertiary",
|
|
1392
|
-
onClick:
|
|
1393
|
-
}, null, 8, ["disabled", "onClick"])) :
|
|
1394
|
+
onClick: te(() => r(M), ["stop"])
|
|
1395
|
+
}, null, 8, ["disabled", "onClick"])) : Q("", !0), v(j, {
|
|
1394
1396
|
disabled: S.value,
|
|
1395
1397
|
icon: "ios_share",
|
|
1396
1398
|
variant: "tertiary",
|
|
1397
|
-
onClick:
|
|
1399
|
+
onClick: te(() => U(V(M)), ["stop"])
|
|
1398
1400
|
}, null, 8, ["disabled", "onClick"])])]),
|
|
1399
1401
|
_: 2
|
|
1400
1402
|
}, 1032, ["label", "onClick"]))), 128))]),
|
|
1401
1403
|
_: 1
|
|
1402
|
-
})], 64)) : (y(),
|
|
1404
|
+
})], 64)) : (y(), K(c(xe), {
|
|
1403
1405
|
key: 1,
|
|
1404
|
-
title: c(
|
|
1405
|
-
subtitle: c(
|
|
1406
|
+
title: c(a)("menu.publish.empty.title"),
|
|
1407
|
+
subtitle: c(a)("menu.publish.empty.subtitle"),
|
|
1406
1408
|
action: {
|
|
1407
|
-
text: c(
|
|
1409
|
+
text: c(a)("menu.publish.empty.action"),
|
|
1408
1410
|
icon: "add",
|
|
1409
1411
|
callback: () => {
|
|
1410
1412
|
c(x).push({
|
|
@@ -1412,13 +1414,13 @@ const tt = {
|
|
|
1412
1414
|
});
|
|
1413
1415
|
}
|
|
1414
1416
|
}
|
|
1415
|
-
}, null, 8, ["title", "subtitle", "action"]))]), f("div",
|
|
1417
|
+
}, null, 8, ["title", "subtitle", "action"]))]), f("div", oa, [v(j, {
|
|
1416
1418
|
disabled: S.value,
|
|
1417
1419
|
icon: "ios_share",
|
|
1418
|
-
label: c(
|
|
1420
|
+
label: c(a)("menu.publish.actions.publish_all"),
|
|
1419
1421
|
variant: "fab",
|
|
1420
|
-
onClick:
|
|
1421
|
-
}, null, 8, ["disabled", "label"])]),
|
|
1422
|
+
onClick: b[8] || (b[8] = () => re())
|
|
1423
|
+
}, null, 8, ["disabled", "label"])]), v(Kt, {
|
|
1422
1424
|
ref_key: "updateCatalogDialogRef",
|
|
1423
1425
|
ref: _,
|
|
1424
1426
|
catalogs: R.value,
|
|
@@ -1428,5 +1430,5 @@ const tt = {
|
|
|
1428
1430
|
}
|
|
1429
1431
|
});
|
|
1430
1432
|
export {
|
|
1431
|
-
|
|
1433
|
+
ga as default
|
|
1432
1434
|
};
|