@feedmepos/mf-menu 0.31.68-prod → 0.31.69-prod
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--QrVG.js → App-Byjppp7I.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-fG_BJMQJ.js → ApplyProduct.vue_vue_type_script_setup_true_lang-a3SOjvXY.js} +3 -3
- package/dist/{Catalog-BMPz4HgZ.js → Catalog-Bx3K7UqS.js} +6 -6
- package/dist/{Category-DwIcXBXO.js → Category-BxfQ5OjG.js} +6 -6
- package/dist/{Category-CXoXOkqP.js → Category-C01Ct1Tf.js} +4 -4
- package/dist/{CookingGuide-CgBbTKGz.js → CookingGuide-CsTgj78F.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CvPRLahQ.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Dn-rOcky.js} +1 -1
- package/dist/{Group-DdWKntFD.js → Group-BUT2zIZO.js} +3 -3
- package/dist/{Group-FT5kjJpF.js → Group-DqV3QKc-.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-kypU8KME.js → Group.vue_vue_type_script_setup_true_lang-uzYIOv4G.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C7nVEyP0.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-zJW4-S9p.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-B0knYCDR.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-7qMW2Pv6.js} +7 -7
- package/dist/{Ingredient-BGxrfK_P.js → Ingredient-CM1T0bUh.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-QKmtShaF.js → InventoryBinding.vue_vue_type_script_setup_true_lang-NETtbB15.js} +1052 -1052
- package/dist/{LinkProductSideSheet-D3N9WMt-.js → LinkProductSideSheet-CcqAYsNl.js} +3 -3
- package/dist/{MenuSetting-fCW7yn9L.js → MenuSetting-DYb7ukCf.js} +5 -5
- package/dist/{PrintRoute-C8WpVMCg.js → PrintRoute-Cok4l1zV.js} +4 -4
- package/dist/{Product-CesK0Jb_.js → Product-Dhc4Adhn.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CL7p1L26.js → Product.vue_vue_type_script_setup_true_lang-Cz-_UH53.js} +13 -13
- package/dist/{ProductInternalTools-Dvc4yvoP.js → ProductInternalTools-D0RSqHy-.js} +5 -5
- package/dist/{Products-y63EZezp.js → Products-Cqm3G5zr.js} +11 -11
- package/dist/{Publish-CXAFN9nH.js → Publish-B4tEDino.js} +3 -3
- package/dist/{Recipe-I6KXcYS5.js → Recipe-7Dmy8ftx.js} +4 -4
- package/dist/{Scheduler-CUxGoAYV.js → Scheduler-DdRzLW-P.js} +3 -3
- package/dist/{ServingSequence-CsUY7XGL.js → ServingSequence-BInVw61-.js} +3 -3
- package/dist/{Setting-DTIndhgh.js → Setting-DcmNcix_.js} +5 -5
- package/dist/{Subcategory-DS7AB3OH.js → Subcategory-BJPHM19c.js} +4 -4
- package/dist/{Takeaway-D2InRA7G.js → Takeaway-CAMQB-IJ.js} +1 -1
- package/dist/{Takeaway-DriZgLXL.js → Takeaway-DffrT2Oe.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BvRQJjRj.js → Takeaway.vue_vue_type_script_setup_true_lang-d739Y4lL.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-CaA4nQjq.js → Thumbnail.vue_vue_type_script_setup_true_lang-DadgzMI1.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BVDbtq9o.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DBz3IAPN.js} +399 -394
- package/dist/{Unit-Bex-a7lb.js → Unit-DAjjHptw.js} +2 -2
- package/dist/{Variant-BzVsT2jm.js → Variant-DbK_VSB4.js} +3 -3
- package/dist/{_id_-Dl5bCv02.js → _id_-BekyhQuo.js} +10 -10
- package/dist/{app-B50mNq4C.js → app-DtCzoQbv.js} +30 -30
- package/dist/{app-EO3mkzdW.js → app-Dy_PpbJy.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +4 -0
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/CategoriesSelector.vue.d.ts +5 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-CXB_01B1.js → linked-status-BtBrdkGB.js} +2 -2
- package/dist/assets/{override-menu-CgijweKW.js → override-menu-aFa61roK.js} +2 -2
- package/dist/assets/{validate-menu-CdAJ-JHM.js → validate-menu-59YPNrR_.js} +2 -2
- package/dist/{catalog-BHir10AP.js → catalog-BMQMzuhB.js} +1 -1
- package/dist/{catalogSetting-Cl0DxvXL.js → catalogSetting-CQzUjCKe.js} +1 -1
- package/dist/{category-BHYLTJJC.js → category-COs21nTW.js} +1 -1
- package/dist/{currency-B98FhcGK.js → currency-Dhnr3ve1.js} +1 -1
- package/dist/{customAttributes-ogWxq4Tm.js → customAttributes-3FR2K7UT.js} +1 -1
- package/dist/{dayjs.min-B-U1bqfv.js → dayjs.min-Ch62VG8w.js} +1 -1
- package/dist/{index-CTTVuqw7.js → index-BtcFkeQa.js} +3 -3
- package/dist/{index-C2cz9wGc.js → index-C7QPwnik.js} +4 -4
- package/dist/{index-ClJpoaAA.js → index-D12PAJYh.js} +1 -1
- package/dist/{index-B8Gn-X1l.js → index-eArd_3kW.js} +1 -1
- package/dist/{item-BZMS-TO_.js → item-B-j4iPOr.js} +4698 -4689
- package/dist/{jszip.min-CNLRuEMk.js → jszip.min-5blhaVPG.js} +245 -245
- package/dist/{menu-lVDeJ_wR.js → menu-Ca6KeFDH.js} +4 -4
- package/dist/{menu-BCVYl65c.js → menu-CxC6-3Ha.js} +1 -1
- package/dist/{menuV2-aTjHrm3W.js → menuV2-vW_kPd7g.js} +197 -197
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-Ck2eQXnO.js → priceTier-DnE-LoIJ.js} +1 -1
- package/dist/{scheduler-Bl99ja7r.js → scheduler-DJ9vrIaV.js} +4 -4
- package/dist/{subcategory-CAFBSz0j.js → subcategory-BtKCfoK9.js} +2 -2
- package/dist/{toExcel-B5Ixpgtd.js → toExcel-B8G6ceKY.js} +2 -2
- package/dist/{unit-DmdOuyXm.js → unit-8ggZO-G6.js} +2 -2
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var Ue = Object.defineProperty;
|
|
2
2
|
var We = (e, t, n) => t in e ? Ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var ne = (e, t, n) => We(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { an as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { shallowRef as j, ref as
|
|
4
|
+
import { an as ae, H as I, D as T, A as ue, ao as re, J as q, I as ie, a8 as x, c as B, X as V, ai as oe, ap as Be, aq as Le, B as Ge, aa as qe, ar as ze, as as He, a7 as Je } from "./menu-Ca6KeFDH.js";
|
|
5
|
+
import { defineStore as Ye } from "pinia";
|
|
6
|
+
import { shallowRef as j, ref as z, computed as S, shallowReactive as Xe, effectScope as Qe, watch as Ze } from "vue";
|
|
7
7
|
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
8
8
|
import { useSnackbar as et } from "@feedmepos/ui-library";
|
|
9
|
-
const tt = "/assets/linked-status-
|
|
9
|
+
const tt = "/assets/linked-status-BtBrdkGB.js", nt = "/assets/override-menu-aFa61roK.js";
|
|
10
10
|
function rt(e) {
|
|
11
11
|
var o;
|
|
12
|
-
const t =
|
|
12
|
+
const t = I(e), n = (o = t.variant) == null ? void 0 : o.variantCombinations;
|
|
13
13
|
return delete t.variant, delete t.thumbnail, [t, ...n || []];
|
|
14
14
|
}
|
|
15
15
|
function ot(e, t, n, o) {
|
|
16
|
-
const r =
|
|
16
|
+
const r = I(t), u = n ? r.modules.catalog.find((m) => m._id === n) : null, l = o ? r.modules.scheduler.find((m) => m._id === o) : null, a = u ? I(u) : void 0, c = n ? r.modules.catalog.filter((m) => m._id !== n) : [], i = l ? I(l) : void 0, f = e.reduce((m, v) => (m[v._id] = rt(v), m), {});
|
|
17
17
|
function h(m = []) {
|
|
18
18
|
const v = e.map((p) => p._id);
|
|
19
19
|
return [
|
|
@@ -21,20 +21,20 @@ function ot(e, t, n, o) {
|
|
|
21
21
|
...Object.values(f).flatMap((p) => p)
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
|
-
return
|
|
25
|
-
...
|
|
24
|
+
return a && o ? (a.override.scheduler = {
|
|
25
|
+
...a.override.scheduler,
|
|
26
26
|
[o]: {
|
|
27
|
-
...
|
|
27
|
+
...a.override.scheduler[o],
|
|
28
28
|
_id: o,
|
|
29
29
|
items: h(i == null ? void 0 : i.items).map((m) => ({
|
|
30
30
|
...m,
|
|
31
|
-
orderFrom:
|
|
31
|
+
orderFrom: ue.F_ORDER_FROM.enum.ALL
|
|
32
32
|
}))
|
|
33
33
|
}
|
|
34
|
-
}, r.modules.catalog = [...c,
|
|
35
|
-
...
|
|
34
|
+
}, r.modules.catalog = [...c, a], r) : a ? (a.override.items = {
|
|
35
|
+
...a.override.items,
|
|
36
36
|
...f
|
|
37
|
-
}, r.modules.catalog = [...c,
|
|
37
|
+
}, r.modules.catalog = [...c, a], r) : i ? (i.items = h(i.items), r.modules.scheduler = [
|
|
38
38
|
...r.modules.scheduler.filter((m) => m._id !== o),
|
|
39
39
|
i
|
|
40
40
|
], r) : {
|
|
@@ -50,18 +50,18 @@ function ot(e, t, n, o) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
function $(e, t, n) {
|
|
53
|
-
var
|
|
53
|
+
var u;
|
|
54
54
|
if (n >= 3) return e;
|
|
55
55
|
const o = t.modules.item.find((l) => l._id === e._id);
|
|
56
56
|
if (!o)
|
|
57
57
|
throw new Error(`_insertItemOverriders - Item not found - ${e._id}`);
|
|
58
|
-
const r = (
|
|
58
|
+
const r = (u = o.groups) == null ? void 0 : u.map((l) => {
|
|
59
59
|
var i, f, h;
|
|
60
|
-
const
|
|
60
|
+
const a = (i = e == null ? void 0 : e.groups) == null ? void 0 : i.find((m) => m._id === l._id);
|
|
61
61
|
let c;
|
|
62
|
-
return
|
|
62
|
+
return a ? c = ((f = l.items) == null ? void 0 : f.map((m) => {
|
|
63
63
|
var p;
|
|
64
|
-
const v = (p =
|
|
64
|
+
const v = (p = a.items) == null ? void 0 : p.find(
|
|
65
65
|
(b) => b._id === m._id && b.combinationKey === m.combinationKey
|
|
66
66
|
);
|
|
67
67
|
return $(v || m, t, n + 1);
|
|
@@ -79,10 +79,10 @@ function $(e, t, n) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
function st(e, t) {
|
|
82
|
-
const n = e.groups.map((
|
|
83
|
-
const l = t.modules.group.find((c) => c._id ===
|
|
82
|
+
const n = e.groups.map((u) => {
|
|
83
|
+
const l = t.modules.group.find((c) => c._id === u._id), a = ((l == null ? void 0 : l.items) || []).map((c) => {
|
|
84
84
|
var h;
|
|
85
|
-
const i = (h =
|
|
85
|
+
const i = (h = u.items) == null ? void 0 : h.find(
|
|
86
86
|
(m) => m._id === c._id && m.combinationKey === c.combinationKey
|
|
87
87
|
);
|
|
88
88
|
if (i)
|
|
@@ -94,8 +94,8 @@ function st(e, t) {
|
|
|
94
94
|
};
|
|
95
95
|
return $(f, t, 1);
|
|
96
96
|
});
|
|
97
|
-
return { ...
|
|
98
|
-
}), o = e.variant ? e.variant.variantCombinations.map((
|
|
97
|
+
return { ...u, items: a };
|
|
98
|
+
}), o = e.variant ? e.variant.variantCombinations.map((u) => $(u, t, 1)) : [], r = {
|
|
99
99
|
...T.generator.initMenuV4ItemOverrider(),
|
|
100
100
|
_id: e._id,
|
|
101
101
|
name: e.name,
|
|
@@ -110,28 +110,28 @@ function H(e, t) {
|
|
|
110
110
|
return e;
|
|
111
111
|
const n = { ...e, code: t.code };
|
|
112
112
|
return n.groups = (o = n.groups) == null ? void 0 : o.map((r) => {
|
|
113
|
-
var l,
|
|
114
|
-
const
|
|
115
|
-
return r.items = (
|
|
113
|
+
var l, a;
|
|
114
|
+
const u = (l = t.groups) == null ? void 0 : l.find((c) => c._id === r._id);
|
|
115
|
+
return r.items = (a = r.items) == null ? void 0 : a.map((c) => {
|
|
116
116
|
var f;
|
|
117
|
-
const i = (f =
|
|
117
|
+
const i = (f = u == null ? void 0 : u.items) == null ? void 0 : f.find(
|
|
118
118
|
(h) => h._id === c._id && h.combinationKey === c.combinationKey
|
|
119
119
|
);
|
|
120
120
|
return H(c, i);
|
|
121
121
|
}), r;
|
|
122
122
|
}), n;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function at(e, t) {
|
|
125
125
|
const n = e.items[t._id];
|
|
126
126
|
t.variant && (t.variant = {
|
|
127
127
|
...t.variant,
|
|
128
128
|
variantCombinations: t.variant.variantCombinations.map((r) => {
|
|
129
|
-
const
|
|
129
|
+
const u = n.find(
|
|
130
130
|
(l) => l._id === r._id && l.combinationKey === r.combinationKey
|
|
131
131
|
);
|
|
132
|
-
if (!
|
|
132
|
+
if (!u)
|
|
133
133
|
throw new Error(`Item overrider not found - ${r._id} - ${r.combinationKey}`);
|
|
134
|
-
return H(
|
|
134
|
+
return H(u, r);
|
|
135
135
|
})
|
|
136
136
|
});
|
|
137
137
|
const o = n.find((r) => !r.combinationKey);
|
|
@@ -139,25 +139,25 @@ function ut(e, t) {
|
|
|
139
139
|
throw new Error(`Base item overrider not found - ${t._id}`);
|
|
140
140
|
return t.groups = (o.groups || []).map((r) => {
|
|
141
141
|
var l;
|
|
142
|
-
const
|
|
143
|
-
return r.items = (l = r.items) == null ? void 0 : l.map((
|
|
142
|
+
const u = t.groups.find((a) => a._id === r._id);
|
|
143
|
+
return r.items = (l = r.items) == null ? void 0 : l.map((a) => {
|
|
144
144
|
var i;
|
|
145
|
-
const c = (i =
|
|
146
|
-
(f) => f._id ===
|
|
145
|
+
const c = (i = u == null ? void 0 : u.items) == null ? void 0 : i.find(
|
|
146
|
+
(f) => f._id === a._id && f.combinationKey === a.combinationKey
|
|
147
147
|
);
|
|
148
|
-
return H(
|
|
148
|
+
return H(a, c);
|
|
149
149
|
}), r;
|
|
150
150
|
}), {
|
|
151
151
|
...t,
|
|
152
152
|
price: (o == null ? void 0 : o.price) || t.price
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
async function Ot(e, t, n, o, r,
|
|
156
|
-
const l =
|
|
155
|
+
async function Ot(e, t, n, o, r, u = !0) {
|
|
156
|
+
const l = I(n), a = u ? ot(t, l, o, r) : l, c = t.reduce((h, m) => (h[m._id] = a.modules.item.find((v) => v._id === m._id), h), {}), i = t.reduce((h, m) => {
|
|
157
157
|
const v = m._id;
|
|
158
158
|
return h[v] = st(c[v], e), h;
|
|
159
159
|
}, {}), f = T.getFallbackPrices({
|
|
160
|
-
rawMenu:
|
|
160
|
+
rawMenu: a,
|
|
161
161
|
items: i,
|
|
162
162
|
catalogId: o || void 0,
|
|
163
163
|
schedulerId: r
|
|
@@ -165,7 +165,7 @@ async function Ot(e, t, n, o, r, a = !0) {
|
|
|
165
165
|
return t.map((h) => {
|
|
166
166
|
const m = h._id, v = c[m];
|
|
167
167
|
return {
|
|
168
|
-
...
|
|
168
|
+
...at(f, v),
|
|
169
169
|
category: o || r ? v == null ? void 0 : v.category : null
|
|
170
170
|
};
|
|
171
171
|
});
|
|
@@ -173,32 +173,32 @@ async function Ot(e, t, n, o, r, a = !0) {
|
|
|
173
173
|
function Dt(e, t) {
|
|
174
174
|
if (e.length === 0) return "";
|
|
175
175
|
const n = e == null ? void 0 : e.split("variant");
|
|
176
|
-
return ((n == null ? void 0 : n.reduce((r,
|
|
177
|
-
if (
|
|
178
|
-
const l = `variant${
|
|
176
|
+
return ((n == null ? void 0 : n.reduce((r, u) => {
|
|
177
|
+
if (u && u.length > 0) {
|
|
178
|
+
const l = `variant${u.split("/")[0]}`, a = u.split("/")[1], i = t.find(
|
|
179
179
|
({ _id: f }) => f === l
|
|
180
|
-
).options.find(({ _id: f }) => f ===
|
|
180
|
+
).options.find(({ _id: f }) => f === a);
|
|
181
181
|
r.push(((i == null ? void 0 : i.name) || "").trim());
|
|
182
182
|
}
|
|
183
183
|
return r;
|
|
184
184
|
}, [])) || []).join(" / ");
|
|
185
185
|
}
|
|
186
|
-
const
|
|
186
|
+
const L = /* @__PURE__ */ new Map();
|
|
187
187
|
async function Vt(e, t) {
|
|
188
188
|
const n = `${e._id}-${e.updatedAt}-${t}`;
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
191
|
-
const o = await
|
|
189
|
+
if (L.has(n))
|
|
190
|
+
return L.get(n);
|
|
191
|
+
const o = await ae(
|
|
192
192
|
tt,
|
|
193
193
|
JSON.stringify({
|
|
194
194
|
menu: e,
|
|
195
195
|
itemId: t
|
|
196
196
|
})
|
|
197
197
|
);
|
|
198
|
-
return
|
|
198
|
+
return L.set(n, o), o;
|
|
199
199
|
}
|
|
200
200
|
async function ce(e, t, n) {
|
|
201
|
-
return await
|
|
201
|
+
return await ae(nt, {
|
|
202
202
|
menu: e,
|
|
203
203
|
catalogId: t,
|
|
204
204
|
schedulerId: n
|
|
@@ -206,26 +206,26 @@ async function ce(e, t, n) {
|
|
|
206
206
|
}
|
|
207
207
|
function Tt(e, t, n) {
|
|
208
208
|
const o = /* @__PURE__ */ new Set();
|
|
209
|
-
function r(
|
|
210
|
-
if (!e || !
|
|
209
|
+
function r(u, l) {
|
|
210
|
+
if (!e || !u || !l || o.has(l)) return !1;
|
|
211
211
|
o.add(l);
|
|
212
|
-
const
|
|
213
|
-
return !
|
|
212
|
+
const a = e.modules.item.find((c) => c._id === l);
|
|
213
|
+
return !a || !a.groups ? !1 : a.groups.some((c) => c._id === u) ? !0 : a.groups.some((c) => {
|
|
214
214
|
const i = e.modules.group.find((f) => f._id === c._id);
|
|
215
215
|
for (const f of (i == null ? void 0 : i.items) || [])
|
|
216
|
-
if (r(
|
|
216
|
+
if (r(u, f._id)) return !0;
|
|
217
217
|
return !1;
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
return r(t, n);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Ft(e, t, n) {
|
|
223
223
|
const o = /* @__PURE__ */ new Set();
|
|
224
|
-
function r(
|
|
225
|
-
if (!e || !
|
|
226
|
-
o.add(
|
|
227
|
-
const
|
|
228
|
-
return !
|
|
224
|
+
function r(u, l) {
|
|
225
|
+
if (!e || !u || !l || o.has(u)) return !1;
|
|
226
|
+
o.add(u);
|
|
227
|
+
const a = e.modules.group.find((c) => c._id === u);
|
|
228
|
+
return !a || !a.items ? !1 : a.items.some((c) => c._id === l) ? !0 : a.items.some((c) => {
|
|
229
229
|
const i = e.modules.item.find((f) => f._id === c._id);
|
|
230
230
|
for (const f of (i == null ? void 0 : i.groups) || [])
|
|
231
231
|
if (r(f._id, l)) return !0;
|
|
@@ -234,18 +234,18 @@ function Kt(e, t, n) {
|
|
|
234
234
|
}
|
|
235
235
|
return r(t, n);
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
async function
|
|
237
|
+
const G = /* @__PURE__ */ new Map();
|
|
238
|
+
async function ut(e, t, n) {
|
|
239
239
|
const o = `${e._id}-${e.updatedAt}-${t || "null"}-${n || "null"}`;
|
|
240
|
-
if (
|
|
241
|
-
return
|
|
240
|
+
if (G.has(o))
|
|
241
|
+
return G.get(o);
|
|
242
242
|
const r = await ce(e, t, n);
|
|
243
|
-
return
|
|
243
|
+
return G.set(o, r), r;
|
|
244
244
|
}
|
|
245
|
-
async function
|
|
246
|
-
var l,
|
|
247
|
-
const o = await
|
|
248
|
-
const f =
|
|
245
|
+
async function Kt(e, t, n) {
|
|
246
|
+
var l, a;
|
|
247
|
+
const o = await ut(e, t, null), r = [], u = (c, i) => {
|
|
248
|
+
const f = I(c);
|
|
249
249
|
for (const h in i)
|
|
250
250
|
i[h] && (f[h] = i[h]);
|
|
251
251
|
return f;
|
|
@@ -253,12 +253,12 @@ async function Ft(e, t, n) {
|
|
|
253
253
|
for (const c of o.modules.group) {
|
|
254
254
|
const i = (l = c.items) == null ? void 0 : l.find((h) => h._id === n && !h.combinationKey), f = e.modules.item.find((h) => h._id === n);
|
|
255
255
|
if (i) {
|
|
256
|
-
const h = (
|
|
257
|
-
var w,
|
|
258
|
-
const p = v.combinationKey ? (
|
|
259
|
-
(
|
|
260
|
-
) : f, b = p && f ?
|
|
261
|
-
return
|
|
256
|
+
const h = (a = c.items) == null ? void 0 : a.filter((v) => v._id === n && v.combinationKey), m = [i, ...h].map((v) => {
|
|
257
|
+
var w, C;
|
|
258
|
+
const p = v.combinationKey ? (C = (w = f == null ? void 0 : f.variant) == null ? void 0 : w.variantCombinations) == null ? void 0 : C.find(
|
|
259
|
+
(k) => k.combinationKey === v.combinationKey
|
|
260
|
+
) : f, b = p && f ? u(f, p) : v;
|
|
261
|
+
return u(b, v);
|
|
262
262
|
});
|
|
263
263
|
r.push({
|
|
264
264
|
group: c,
|
|
@@ -268,7 +268,7 @@ async function Ft(e, t, n) {
|
|
|
268
268
|
}
|
|
269
269
|
return r;
|
|
270
270
|
}
|
|
271
|
-
const M = 0,
|
|
271
|
+
const M = 0, F = 3;
|
|
272
272
|
function it(e) {
|
|
273
273
|
const t = /^\/(.*)\/([gimyu]*)$/.exec(e.toString());
|
|
274
274
|
if (!t)
|
|
@@ -294,10 +294,10 @@ function O(e) {
|
|
|
294
294
|
function P(e) {
|
|
295
295
|
return e instanceof RegExp ? e.toString() : e;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function R(e) {
|
|
298
298
|
return typeof e == "object" && e !== null && !Array.isArray(e) && !(e instanceof Date) && !(e instanceof RegExp);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function K(e, t) {
|
|
301
301
|
if (e === t) return !0;
|
|
302
302
|
if (typeof e != typeof t) return !1;
|
|
303
303
|
if (e instanceof Date && t instanceof Date)
|
|
@@ -307,31 +307,31 @@ function F(e, t) {
|
|
|
307
307
|
if (Array.isArray(e) && Array.isArray(t)) {
|
|
308
308
|
if (e.length !== t.length) return !1;
|
|
309
309
|
for (let n = 0; n < e.length; n++)
|
|
310
|
-
if (!
|
|
310
|
+
if (!K(e[n], t[n])) return !1;
|
|
311
311
|
return !0;
|
|
312
312
|
}
|
|
313
|
-
if (
|
|
313
|
+
if (R(e) && R(t)) {
|
|
314
314
|
const n = Object.keys(e), o = Object.keys(t);
|
|
315
315
|
if (n.length !== o.length) return !1;
|
|
316
316
|
for (const r of n)
|
|
317
|
-
if (!Object.prototype.hasOwnProperty.call(t, r) || !
|
|
317
|
+
if (!Object.prototype.hasOwnProperty.call(t, r) || !K(e[r], t[r])) return !1;
|
|
318
318
|
return !0;
|
|
319
319
|
}
|
|
320
320
|
return !1;
|
|
321
321
|
}
|
|
322
322
|
function ct(e, t, n) {
|
|
323
|
-
const o = e.length, r = t.length,
|
|
323
|
+
const o = e.length, r = t.length, u = /* @__PURE__ */ new Map();
|
|
324
324
|
for (let c = 0; c < r; c++) {
|
|
325
325
|
const i = n ? n(t[c]) : JSON.stringify(t[c]);
|
|
326
|
-
|
|
326
|
+
u.has(i) || u.set(i, []), u.get(i).push(c);
|
|
327
327
|
}
|
|
328
|
-
const l = [],
|
|
328
|
+
const l = [], a = /* @__PURE__ */ new Set();
|
|
329
329
|
for (let c = 0; c < o; c++) {
|
|
330
|
-
const i = e[c], f = n ? n(i) : JSON.stringify(i), h =
|
|
330
|
+
const i = e[c], f = n ? n(i) : JSON.stringify(i), h = u.get(f);
|
|
331
331
|
if (h) {
|
|
332
332
|
for (const m of h)
|
|
333
|
-
if (!
|
|
334
|
-
l.push({ leftIndex: c, rightIndex: m }),
|
|
333
|
+
if (!a.has(m) && K(i, t[m])) {
|
|
334
|
+
l.push({ leftIndex: c, rightIndex: m }), a.add(m);
|
|
335
335
|
break;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
@@ -340,28 +340,28 @@ function ct(e, t, n) {
|
|
|
340
340
|
}
|
|
341
341
|
function lt(e, t, n) {
|
|
342
342
|
var m, v;
|
|
343
|
-
if (
|
|
344
|
-
const o = { _t: "a" }, r = ((m = n == null ? void 0 : n.arrays) == null ? void 0 : m.detectMove) !== !1,
|
|
345
|
-
let
|
|
346
|
-
if (!l && e.length === t.length && e.length > 0 &&
|
|
347
|
-
const p =
|
|
343
|
+
if (K(e, t)) return;
|
|
344
|
+
const o = { _t: "a" }, r = ((m = n == null ? void 0 : n.arrays) == null ? void 0 : m.detectMove) !== !1, u = ((v = n == null ? void 0 : n.arrays) == null ? void 0 : v.includeValueOnMove) === !0, l = n == null ? void 0 : n.objectHash;
|
|
345
|
+
let a = r ? ct(e, t, l) : [];
|
|
346
|
+
if (!l && e.length === t.length && e.length > 0 && a.length < e.length) {
|
|
347
|
+
const p = R(e[0]) || Array.isArray(e[0]), b = a.length > 0;
|
|
348
348
|
if (p || b) {
|
|
349
|
-
|
|
349
|
+
a = [];
|
|
350
350
|
for (let w = 0; w < e.length; w++)
|
|
351
|
-
|
|
351
|
+
a.push({ leftIndex: w, rightIndex: w });
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
new Set(
|
|
355
|
-
const c = new Set(
|
|
356
|
-
for (const p of
|
|
354
|
+
new Set(a.map((p) => p.leftIndex));
|
|
355
|
+
const c = new Set(a.map((p) => p.rightIndex)), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
356
|
+
for (const p of a)
|
|
357
357
|
i.set(p.leftIndex, p.rightIndex), f.set(p.rightIndex, p.leftIndex);
|
|
358
358
|
for (let p = 0; p < e.length; p++) {
|
|
359
359
|
const b = i.get(p);
|
|
360
360
|
if (b !== void 0) {
|
|
361
361
|
const w = J(e[p], t[b], n);
|
|
362
362
|
if (w !== void 0 && (o[b] = w), r && b !== p) {
|
|
363
|
-
const
|
|
364
|
-
o[
|
|
363
|
+
const C = `_${p}`, k = u ? [e[p], b, F] : ["", b, F];
|
|
364
|
+
o[C] = k;
|
|
365
365
|
}
|
|
366
366
|
} else {
|
|
367
367
|
const w = `_${p}`;
|
|
@@ -375,89 +375,89 @@ function lt(e, t, n) {
|
|
|
375
375
|
return o;
|
|
376
376
|
}
|
|
377
377
|
function dt(e, t, n) {
|
|
378
|
-
if (
|
|
379
|
-
const o = {}, r = Object.keys(e),
|
|
380
|
-
for (const
|
|
381
|
-
if (n != null && n.propertyFilter && !n.propertyFilter(
|
|
378
|
+
if (K(e, t)) return;
|
|
379
|
+
const o = {}, r = Object.keys(e), u = Object.keys(t), l = /* @__PURE__ */ new Set([...r, ...u]);
|
|
380
|
+
for (const a of l) {
|
|
381
|
+
if (n != null && n.propertyFilter && !n.propertyFilter(a, { left: e, right: t }))
|
|
382
382
|
continue;
|
|
383
|
-
const c = Object.prototype.hasOwnProperty.call(e,
|
|
383
|
+
const c = Object.prototype.hasOwnProperty.call(e, a), i = Object.prototype.hasOwnProperty.call(t, a);
|
|
384
384
|
if (c && i) {
|
|
385
|
-
const f = J(e[
|
|
386
|
-
f !== void 0 && (o[
|
|
385
|
+
const f = J(e[a], t[a], n);
|
|
386
|
+
f !== void 0 && (o[a] = f);
|
|
387
387
|
} else if (c && !i) {
|
|
388
|
-
const f = n != null && n.omitRemovedValues ? 0 : e[
|
|
389
|
-
o[
|
|
390
|
-
} else !c && i && (o[
|
|
388
|
+
const f = n != null && n.omitRemovedValues ? 0 : e[a];
|
|
389
|
+
o[a] = [f, M, M];
|
|
390
|
+
} else !c && i && (o[a] = [t[a]]);
|
|
391
391
|
}
|
|
392
392
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
393
393
|
}
|
|
394
394
|
function J(e, t, n) {
|
|
395
|
-
if (
|
|
395
|
+
if (K(e, t)) return;
|
|
396
396
|
if (e === void 0 && t !== void 0) {
|
|
397
|
-
const
|
|
398
|
-
return [P(
|
|
397
|
+
const a = n != null && n.cloneDiffValues ? O(t) : t;
|
|
398
|
+
return [P(a)];
|
|
399
399
|
}
|
|
400
400
|
if (typeof e !== typeof t || e instanceof Date != t instanceof Date || e instanceof RegExp != t instanceof RegExp || Array.isArray(e) !== Array.isArray(t)) {
|
|
401
|
-
const
|
|
402
|
-
return [P(
|
|
401
|
+
const a = n != null && n.cloneDiffValues ? O(e) : e, c = n != null && n.cloneDiffValues ? O(t) : t;
|
|
402
|
+
return [P(a), P(c)];
|
|
403
403
|
}
|
|
404
404
|
if (Array.isArray(e) && Array.isArray(t))
|
|
405
405
|
return lt(e, t, n);
|
|
406
|
-
if (
|
|
406
|
+
if (R(e) && R(t))
|
|
407
407
|
return dt(e, t, n);
|
|
408
|
-
const
|
|
409
|
-
return [P(
|
|
408
|
+
const u = n != null && n.cloneDiffValues ? O(e) : e, l = n != null && n.cloneDiffValues ? O(t) : t;
|
|
409
|
+
return [P(u), P(l)];
|
|
410
410
|
}
|
|
411
411
|
function ft(e, t, n) {
|
|
412
412
|
return J(e, t, n);
|
|
413
413
|
}
|
|
414
414
|
function mt(e, t, n) {
|
|
415
415
|
const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
|
|
416
|
-
for (const
|
|
417
|
-
if (
|
|
418
|
-
const c = parseInt(
|
|
419
|
-
Array.isArray(i) && (i.length === 3 && i[2] === M ? o.add(c) : i.length === 3 && i[2] ===
|
|
416
|
+
for (const a in t) {
|
|
417
|
+
if (a === "_t" || !a.startsWith("_")) continue;
|
|
418
|
+
const c = parseInt(a.slice(1)), i = t[a];
|
|
419
|
+
Array.isArray(i) && (i.length === 3 && i[2] === M ? o.add(c) : i.length === 3 && i[2] === F && r.set(c, i[1]));
|
|
420
420
|
}
|
|
421
|
-
const
|
|
421
|
+
const u = [];
|
|
422
422
|
let l = 0;
|
|
423
|
-
for (let
|
|
424
|
-
const c =
|
|
423
|
+
for (let a = 0; ; a++) {
|
|
424
|
+
const c = a.toString(), i = t[c];
|
|
425
425
|
if (i !== void 0)
|
|
426
426
|
if (Array.isArray(i) && i.length === 1)
|
|
427
|
-
|
|
427
|
+
u.push(i[0]);
|
|
428
428
|
else {
|
|
429
429
|
for (; l < e.length && o.has(l); )
|
|
430
430
|
l++;
|
|
431
|
-
l < e.length && (
|
|
431
|
+
l < e.length && (u.push(Y(e[l], i)), l++);
|
|
432
432
|
}
|
|
433
433
|
else {
|
|
434
434
|
let f = !1;
|
|
435
435
|
for (const [h, m] of r.entries())
|
|
436
|
-
if (m ===
|
|
437
|
-
|
|
436
|
+
if (m === a) {
|
|
437
|
+
u.push(e[h]), f = !0;
|
|
438
438
|
break;
|
|
439
439
|
}
|
|
440
440
|
if (!f) {
|
|
441
441
|
for (; l < e.length && (o.has(l) || r.has(l)); )
|
|
442
442
|
l++;
|
|
443
443
|
if (l < e.length)
|
|
444
|
-
|
|
444
|
+
u.push(e[l]), l++;
|
|
445
445
|
else
|
|
446
446
|
break;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
return
|
|
450
|
+
return u;
|
|
451
451
|
}
|
|
452
452
|
function vt(e, t, n) {
|
|
453
453
|
const o = { ...e };
|
|
454
454
|
for (const r in t) {
|
|
455
|
-
const
|
|
456
|
-
Array.isArray(
|
|
455
|
+
const u = t[r];
|
|
456
|
+
Array.isArray(u) ? u.length === 1 ? o[r] = u[0] : u.length === 3 && u[2] === M ? delete o[r] : u.length === 2 && (o[r] = u[1]) : o[r] = Y(o[r], u);
|
|
457
457
|
}
|
|
458
458
|
return o;
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Y(e, t, n) {
|
|
461
461
|
if (t === void 0) return e;
|
|
462
462
|
if (Array.isArray(t)) {
|
|
463
463
|
if (t.length === 1)
|
|
@@ -467,10 +467,10 @@ function X(e, t, n) {
|
|
|
467
467
|
if (t.length === 3 && t[2] === M)
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
|
-
return
|
|
470
|
+
return R(t) && t._t === "a" ? mt(e, t) : R(t) && R(e) ? vt(e, t) : e;
|
|
471
471
|
}
|
|
472
472
|
function le(e, t, n) {
|
|
473
|
-
return
|
|
473
|
+
return Y(e, t);
|
|
474
474
|
}
|
|
475
475
|
function yt(e) {
|
|
476
476
|
const t = { _t: "a" };
|
|
@@ -481,9 +481,9 @@ function yt(e) {
|
|
|
481
481
|
if (Array.isArray(r)) {
|
|
482
482
|
if (r.length === 3 && r[2] === M)
|
|
483
483
|
t[o] = [r[0]];
|
|
484
|
-
else if (r.length === 3 && r[2] ===
|
|
485
|
-
const
|
|
486
|
-
t[`_${
|
|
484
|
+
else if (r.length === 3 && r[2] === F) {
|
|
485
|
+
const u = r[1];
|
|
486
|
+
t[`_${u}`] = [r[0], o, F];
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
} else {
|
|
@@ -491,8 +491,8 @@ function yt(e) {
|
|
|
491
491
|
if (Array.isArray(r) && r.length === 1)
|
|
492
492
|
t[`_${o}`] = [r[0], M, M];
|
|
493
493
|
else {
|
|
494
|
-
const
|
|
495
|
-
|
|
494
|
+
const u = X(r);
|
|
495
|
+
u !== void 0 && (t[n] = u);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
return t;
|
|
@@ -504,13 +504,13 @@ function ht(e) {
|
|
|
504
504
|
if (Array.isArray(o))
|
|
505
505
|
o.length === 1 ? t[n] = [o[0], M, M] : o.length === 3 && o[2] === M ? t[n] = [o[0]] : o.length === 2 && (t[n] = [o[1], o[0]]);
|
|
506
506
|
else {
|
|
507
|
-
const r =
|
|
507
|
+
const r = X(o);
|
|
508
508
|
r !== void 0 && (t[n] = r);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
return t;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function X(e) {
|
|
514
514
|
if (e !== void 0) {
|
|
515
515
|
if (Array.isArray(e)) {
|
|
516
516
|
if (e.length === 1)
|
|
@@ -519,14 +519,14 @@ function Y(e) {
|
|
|
519
519
|
return [e[1], e[0]];
|
|
520
520
|
if (e.length === 3 && e[2] === M)
|
|
521
521
|
return [e[0]];
|
|
522
|
-
if (e.length === 3 && e[2] ===
|
|
522
|
+
if (e.length === 3 && e[2] === F)
|
|
523
523
|
return e;
|
|
524
524
|
}
|
|
525
|
-
return
|
|
525
|
+
return R(e) && e._t === "a" ? yt(e) : R(e) ? ht(e) : e;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
function de(e) {
|
|
529
|
-
return
|
|
529
|
+
return X(e);
|
|
530
530
|
}
|
|
531
531
|
function pt(e, t, n) {
|
|
532
532
|
const o = de(t);
|
|
@@ -566,22 +566,22 @@ function St({
|
|
|
566
566
|
includeValueOnMove: !1
|
|
567
567
|
},
|
|
568
568
|
cloneDiffValues: !1
|
|
569
|
-
}), n = j(null), o = j([]), r =
|
|
569
|
+
}), n = j(null), o = j([]), r = z(-1), u = j(null), l = S(() => r.value > 0), a = S(() => r.value < o.value.length - 1);
|
|
570
570
|
function c(v) {
|
|
571
571
|
if (n.value === null) {
|
|
572
|
-
n.value =
|
|
572
|
+
n.value = I(v), u.value = I(v), o.value = [{ delta: null }], r.value = 0;
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
|
-
const p = t.diff(
|
|
576
|
-
if (r.value < o.value.length - 1 && (o.value = o.value.slice(0, r.value + 1)), o.value.push({ delta: p }), r.value++,
|
|
575
|
+
const p = t.diff(u.value, v);
|
|
576
|
+
if (r.value < o.value.length - 1 && (o.value = o.value.slice(0, r.value + 1)), o.value.push({ delta: p }), r.value++, u.value = I(v), o.value.length > e) {
|
|
577
577
|
const b = o.value[1].delta;
|
|
578
|
-
b && n.value && (n.value = t.patch(
|
|
578
|
+
b && n.value && (n.value = t.patch(I(n.value), b)), o.value.shift(), r.value--;
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
function i(v) {
|
|
582
582
|
if (!n.value || v < 0 || v >= o.value.length)
|
|
583
583
|
return;
|
|
584
|
-
let p =
|
|
584
|
+
let p = I(n.value);
|
|
585
585
|
for (let b = 1; b <= v; b++) {
|
|
586
586
|
const w = o.value[b];
|
|
587
587
|
w.delta && (p = t.patch(p, w.delta));
|
|
@@ -592,23 +592,23 @@ function St({
|
|
|
592
592
|
if (l.value) {
|
|
593
593
|
r.value--;
|
|
594
594
|
const v = i(r.value);
|
|
595
|
-
return v && (
|
|
595
|
+
return v && (u.value = I(v)), v;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
function h() {
|
|
599
|
-
if (
|
|
599
|
+
if (a.value) {
|
|
600
600
|
r.value++;
|
|
601
601
|
const v = i(r.value);
|
|
602
|
-
return v && (
|
|
602
|
+
return v && (u.value = I(v)), v;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
function m() {
|
|
606
|
-
n.value = null,
|
|
606
|
+
n.value = null, u.value = null, o.value = [], r.value = -1;
|
|
607
607
|
}
|
|
608
608
|
return {
|
|
609
609
|
push: c,
|
|
610
610
|
canUndo: l,
|
|
611
|
-
canRedo:
|
|
611
|
+
canRedo: a,
|
|
612
612
|
undo: f,
|
|
613
613
|
redo: h,
|
|
614
614
|
clear: m
|
|
@@ -616,7 +616,7 @@ function St({
|
|
|
616
616
|
}
|
|
617
617
|
const bt = {
|
|
618
618
|
async updateMenuModule(e, t) {
|
|
619
|
-
const n =
|
|
619
|
+
const n = q.RequestRunner.operation(t, e.modules);
|
|
620
620
|
if (n.validateError.length > 0)
|
|
621
621
|
throw new Error(n.validateError.join(`
|
|
622
622
|
`));
|
|
@@ -664,18 +664,18 @@ function wt() {
|
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
|
-
const Pt =
|
|
667
|
+
const Pt = Ye(
|
|
668
668
|
"mf-menu-store-v2",
|
|
669
669
|
() => {
|
|
670
|
-
const e =
|
|
670
|
+
const e = Xe(wt()), t = se(), n = et(), o = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
|
|
671
671
|
selector: "position"
|
|
672
672
|
}) : []), r = S(() => {
|
|
673
673
|
var s;
|
|
674
|
-
return ((s = t.currentBusiness.value) == null ? void 0 : s.menuVersion) ||
|
|
675
|
-
}),
|
|
674
|
+
return ((s = t.currentBusiness.value) == null ? void 0 : s.menuVersion) || B.F_MENU_VERSION.v3;
|
|
675
|
+
}), u = S(() => r.value === B.F_MENU_VERSION.v4), l = S(() => {
|
|
676
676
|
const s = e.menu.modules.catalog;
|
|
677
677
|
return x(s, { selector: "name" });
|
|
678
|
-
}),
|
|
678
|
+
}), a = S(() => {
|
|
679
679
|
var d;
|
|
680
680
|
let s = e.menu.modules.catalog.find(
|
|
681
681
|
(y) => y._id === e.currentCatalogId
|
|
@@ -692,14 +692,14 @@ const Pt = Xe(
|
|
|
692
692
|
function f(s, d = !0) {
|
|
693
693
|
e.menu = { ...s, _rev: e.menu._rev }, d && D.push(e.menu);
|
|
694
694
|
}
|
|
695
|
-
const h = j(fe()), m =
|
|
695
|
+
const h = j(fe()), m = z(!1), v = z(1);
|
|
696
696
|
async function p() {
|
|
697
697
|
var y;
|
|
698
698
|
m.value = !0;
|
|
699
699
|
let s = e.menu.modules.catalog;
|
|
700
|
-
if (
|
|
700
|
+
if (a.value && ((y = a.value.linkItemRules) != null && y.length)) {
|
|
701
701
|
const g = T.populateCatalog({
|
|
702
|
-
catalog:
|
|
702
|
+
catalog: a.value,
|
|
703
703
|
ruleGroupSettings: e.menu.ruleGroupSettings,
|
|
704
704
|
items: e.menu.modules.item,
|
|
705
705
|
...e.currentRestaurantAttrParams ?? {}
|
|
@@ -728,9 +728,9 @@ const Pt = Xe(
|
|
|
728
728
|
return h.value = d, m.value = !1, v.value = v.value + 1, d;
|
|
729
729
|
}
|
|
730
730
|
const w = ie.debounce(p, 200);
|
|
731
|
-
let
|
|
731
|
+
let C = null, k = null;
|
|
732
732
|
function Q() {
|
|
733
|
-
|
|
733
|
+
k && (k(), k = null), C && C.stop(), C = Qe(!0), k = C.run(() => Ze(
|
|
734
734
|
() => [e.menu, e.currentCatalogId, e.currentSchedulerId],
|
|
735
735
|
() => {
|
|
736
736
|
m.value || w();
|
|
@@ -765,14 +765,14 @@ const Pt = Xe(
|
|
|
765
765
|
}), ee = S(() => {
|
|
766
766
|
var d;
|
|
767
767
|
let s = h.value.modules.item;
|
|
768
|
-
if (
|
|
769
|
-
const y = (d =
|
|
768
|
+
if (a.value) {
|
|
769
|
+
const y = (d = a.value) == null ? void 0 : d.override.items;
|
|
770
770
|
s = s.filter((g) => {
|
|
771
771
|
var A;
|
|
772
772
|
const _ = (A = y == null ? void 0 : y[g._id]) == null ? void 0 : A.find(
|
|
773
773
|
(E) => !E.combinationKey
|
|
774
774
|
);
|
|
775
|
-
return (_ == null ? void 0 : _.orderFrom) !==
|
|
775
|
+
return (_ == null ? void 0 : _.orderFrom) !== ue.F_ORDER_FROM.enum.NONE;
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
778
|
return V(s, (y) => y.code || y.name);
|
|
@@ -809,13 +809,13 @@ const Pt = Xe(
|
|
|
809
809
|
}
|
|
810
810
|
const _e = S(() => V(h.value.modules.group, (s) => s.name)), Se = S(() => x(h.value.modules.takeaway, { selector: "name" })), be = S(() => x(e.menu.modules.printDepartment || [], {
|
|
811
811
|
selector: "name"
|
|
812
|
-
})), we = S(() => x(e.menu.modules.unit, { selector: "name" })), Me = S(() => x(
|
|
812
|
+
})), we = S(() => x(e.menu.modules.unit, { selector: "name" })), Me = S(() => x(Be(e.menu.modules.recipe, e.menu.modules.sku), {
|
|
813
813
|
selector: "name"
|
|
814
|
-
})), Ae = S(() => e.menu.modules.cookingGuide),
|
|
815
|
-
const s =
|
|
814
|
+
})), Ae = S(() => e.menu.modules.cookingGuide), Ie = S(() => {
|
|
815
|
+
const s = Le(e.menu.modules.sku);
|
|
816
816
|
return x(s, { selector: "code" });
|
|
817
817
|
}), U = S(() => {
|
|
818
|
-
const s = !e.currentCatalogId, d = r.value ===
|
|
818
|
+
const s = !e.currentCatalogId, d = r.value === B.F_MENU_VERSION.v4, y = !e.currentSchedulerId, g = {
|
|
819
819
|
create: s && y,
|
|
820
820
|
edit: s && y,
|
|
821
821
|
delete: s && y
|
|
@@ -886,19 +886,19 @@ const Pt = Xe(
|
|
|
886
886
|
function W(s) {
|
|
887
887
|
return `${s.systemCode}/${s.taxCode}`;
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function Ce(s) {
|
|
890
890
|
const [d, y] = s.split("/");
|
|
891
891
|
return { systemCode: d, taxCode: y };
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function ke(s, d, y) {
|
|
894
894
|
return (s ?? d ?? []).map((g) => W(g)).find((g) => y.some((_) => _.value === g));
|
|
895
895
|
}
|
|
896
|
-
const
|
|
896
|
+
const Re = S(() => {
|
|
897
897
|
var g;
|
|
898
|
-
const s = ["SV5", "SV10"], d =
|
|
898
|
+
const s = ["SV5", "SV10"], d = Ge.Country.getCountryFlattenTaxes(
|
|
899
899
|
se().currentCountry.value
|
|
900
|
-
), y = d.filter((_) =>
|
|
901
|
-
label: `${_.name} (${
|
|
900
|
+
), y = d.filter((_) => u.value || !s.includes(_.taxCode)).map((_) => ({
|
|
901
|
+
label: `${_.name} (${qe(_.rate)}%)`,
|
|
902
902
|
value: W(_),
|
|
903
903
|
meta: {
|
|
904
904
|
rate: _.rate
|
|
@@ -936,9 +936,9 @@ const Pt = Xe(
|
|
|
936
936
|
}));
|
|
937
937
|
try {
|
|
938
938
|
if (d || g.some(
|
|
939
|
-
(A) => [
|
|
939
|
+
(A) => [q.F_OPERATION_TYPE.delete, q.F_OPERATION_TYPE.deleteMany].includes(A.operation)
|
|
940
940
|
)) {
|
|
941
|
-
const A = await
|
|
941
|
+
const A = await ze(g, e.menu.modules);
|
|
942
942
|
if (A !== !0) throw new Error(A);
|
|
943
943
|
}
|
|
944
944
|
const _ = await bt.updateMenuModule(e.menu, g);
|
|
@@ -950,7 +950,7 @@ const Pt = Xe(
|
|
|
950
950
|
message: _
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
|
-
},
|
|
953
|
+
}, Fe = async (s) => {
|
|
954
954
|
const d = {
|
|
955
955
|
...e.menu,
|
|
956
956
|
masterCatalogSetting: s.masterCatalogSetting,
|
|
@@ -958,7 +958,7 @@ const Pt = Xe(
|
|
|
958
958
|
priceTierSettings: s.priceTierSettings
|
|
959
959
|
};
|
|
960
960
|
return f(d), d;
|
|
961
|
-
}, D = St({ maxHistorySize: 50 }),
|
|
961
|
+
}, D = St({ maxHistorySize: 50 }), Ke = S(() => D.canUndo.value), Pe = S(() => D.canRedo.value), $e = () => {
|
|
962
962
|
const s = D.undo();
|
|
963
963
|
s && f(s, !1);
|
|
964
964
|
}, je = () => {
|
|
@@ -976,10 +976,10 @@ const Pt = Xe(
|
|
|
976
976
|
mergedMenu: h,
|
|
977
977
|
// Computed
|
|
978
978
|
version: r,
|
|
979
|
-
isV4:
|
|
979
|
+
isV4: u,
|
|
980
980
|
serveSequence: o,
|
|
981
981
|
catalogs: l,
|
|
982
|
-
currentCatalog:
|
|
982
|
+
currentCatalog: a,
|
|
983
983
|
schedulers: c,
|
|
984
984
|
currentScheduler: i,
|
|
985
985
|
catalogOptions: me,
|
|
@@ -996,9 +996,9 @@ const Pt = Xe(
|
|
|
996
996
|
units: we,
|
|
997
997
|
recipes: Me,
|
|
998
998
|
cookingGuide: Ae,
|
|
999
|
-
skus:
|
|
999
|
+
skus: Ie,
|
|
1000
1000
|
rules: U,
|
|
1001
|
-
taxSetting:
|
|
1001
|
+
taxSetting: Re,
|
|
1002
1002
|
// Action
|
|
1003
1003
|
setMenu: f,
|
|
1004
1004
|
readMenu: Ee,
|
|
@@ -1008,21 +1008,21 @@ const Pt = Xe(
|
|
|
1008
1008
|
selectCategory: De,
|
|
1009
1009
|
setRestaurantAttrParams: Ve,
|
|
1010
1010
|
updateMenu: Te,
|
|
1011
|
-
updateMenuSetting:
|
|
1011
|
+
updateMenuSetting: Fe,
|
|
1012
1012
|
computeMergedMenu: p,
|
|
1013
1013
|
// helper
|
|
1014
1014
|
encodeTax: W,
|
|
1015
|
-
decodeTax:
|
|
1016
|
-
getSelectedTax:
|
|
1015
|
+
decodeTax: Ce,
|
|
1016
|
+
getSelectedTax: ke,
|
|
1017
1017
|
mapVariant: ge,
|
|
1018
1018
|
// history
|
|
1019
|
-
canUndoHistory:
|
|
1019
|
+
canUndoHistory: Ke,
|
|
1020
1020
|
canRedoHistory: Pe,
|
|
1021
1021
|
undoHistory: $e,
|
|
1022
1022
|
redoHistory: je,
|
|
1023
1023
|
// cleanup
|
|
1024
1024
|
$dispose: () => {
|
|
1025
|
-
w.cancel(),
|
|
1025
|
+
w.cancel(), k && (k(), k = null), C && (C.stop(), C = null), Ne();
|
|
1026
1026
|
},
|
|
1027
1027
|
$reinitialize: () => {
|
|
1028
1028
|
Q();
|
|
@@ -1033,10 +1033,10 @@ const Pt = Xe(
|
|
|
1033
1033
|
export {
|
|
1034
1034
|
Vt as a,
|
|
1035
1035
|
Tt as b,
|
|
1036
|
-
|
|
1037
|
-
|
|
1036
|
+
Ft as c,
|
|
1037
|
+
Kt as f,
|
|
1038
1038
|
Dt as g,
|
|
1039
1039
|
Ot as m,
|
|
1040
|
-
|
|
1040
|
+
ut as o,
|
|
1041
1041
|
Pt as u
|
|
1042
1042
|
};
|