@feedmepos/mf-menu 0.32.23 → 0.32.24-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-BQrTlra2.js → App-DWa2ro-f.js} +7 -7
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-nvakbuFX.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CdIdJY4-.js} +3 -3
- package/dist/{Catalog-DpV_2Ps7.js → Catalog-gxjwLBL8.js} +6 -6
- package/dist/{Category-DkQIE8Nf.js → Category-CnQgEoXv.js} +4 -4
- package/dist/{Category-s602x4Ny.js → Category-b1T4-gOH.js} +6 -6
- package/dist/{CookingGuide-D7sAQKZA.js → CookingGuide-CUJSj1Un.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Dnz04pQa.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-5gt-nLhG.js} +1 -1
- package/dist/{Group-BC3bRF_2.js → Group-CYhZLZdB.js} +1 -1
- package/dist/{Group-C3FN7rAQ.js → Group-Dc2EDFF3.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DQ-e7UzM.js → Group.vue_vue_type_script_setup_true_lang-D-Gl4zab.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D4_AQAfN.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-_GEQ9BZ6.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-FP23TwfT.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-1mMSNX61.js} +1712 -1713
- package/dist/{Ingredient-DCIcw8cZ.js → Ingredient-CH9SBRIS.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-Dvtobqbd.js → InventoryBinding.vue_vue_type_script_setup_true_lang-C2nNtBUN.js} +2 -2
- package/dist/{LinkProductSideSheet-CrkvgOCn.js → LinkProductSideSheet-DiZ3OmeY.js} +3 -3
- package/dist/{MenuSetting-BfiBb0yL.js → MenuSetting-oQ-pE6-k.js} +5 -5
- package/dist/{PrintRoute-DE7FUMZD.js → PrintRoute-DV4KaeiV.js} +4 -4
- package/dist/{Product-CnWEOWr9.js → Product-ClXRVbms.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-D6nVXEie.js → Product.vue_vue_type_script_setup_true_lang-C78UpW8f.js} +12 -12
- package/dist/{ProductInternalTools-B7ii2y4W.js → ProductInternalTools-gyVV8L3d.js} +6 -6
- package/dist/{Products-FPQn57BI.js → Products-oahICCSP.js} +22 -22
- package/dist/{Publish-CyZEKbxH.js → Publish-DF3d_3rw.js} +3 -3
- package/dist/{Recipe-BEkXlenR.js → Recipe-49fLn6eg.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DUU0-Xqc.js → RuleView.vue_vue_type_script_setup_true_lang-GvOgZC22.js} +366 -366
- package/dist/{Scheduler-RCY4KBHo.js → Scheduler-Csc7bE5a.js} +3 -3
- package/dist/{ServingSequence-B9kOm3O3.js → ServingSequence-CrTHHVER.js} +3 -3
- package/dist/{Setting-BDaWZCh_.js → Setting-x8ttMcXv.js} +5 -5
- package/dist/{Subcategory-BkfYktpA.js → Subcategory-5D4NhMF_.js} +4 -4
- package/dist/{Takeaway-rcnFSkgC.js → Takeaway-B0ycYVS9.js} +4 -4
- package/dist/{Takeaway-BI1jJHeP.js → Takeaway-n9uPsp_D.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BdrZXb5n.js → Takeaway.vue_vue_type_script_setup_true_lang-BydMa7xB.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang--d2bz2yD.js → Thumbnail.vue_vue_type_script_setup_true_lang-CEI3II1k.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-VJhYJ9wu.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D-83EMI0.js} +14 -14
- package/dist/{Unit-BV4uBI_o.js → Unit-DTolggPS.js} +2 -2
- package/dist/{Variant-D38Y3nrC.js → Variant-B6w7MCjS.js} +3 -3
- package/dist/{_id_-CS_eX0H7.js → _id_-Ba11JoSh.js} +9 -9
- package/dist/{app-C-z2tD0X.js → app-BrxjOGCM.js} +26 -26
- package/dist/{app-DNwbA3RQ.js → app-TKCPYgHk.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DsLZPMEN.js → linked-status-j7iSFteX.js} +2 -2
- package/dist/assets/{menu-export-4I4CcUJ1.js → menu-export-Ca019WiB.js} +2 -2
- package/dist/assets/{override-menu-pjqPpoTC.js → override-menu-Co5QYVz1.js} +2 -2
- package/dist/assets/{validate-menu-C8cTbOcv.js → validate-menu-DmioO-4V.js} +2 -2
- package/dist/{catalog-B7QUzLoE.js → catalog-DC-VBcyF.js} +1 -1
- package/dist/{catalogSetting-DLOnF4LE.js → catalogSetting-DJfq2idY.js} +1 -1
- package/dist/{category-BtFovCQI.js → category-C76JJbHE.js} +1 -1
- package/dist/{currency-B3E6hNRW.js → currency-DtU-NGcm.js} +1 -1
- package/dist/{dayjs.min-D63hY2A3.js → dayjs.min-B7AQ2t3u.js} +1 -1
- package/dist/{index-_kR14hUt.js → index-BjeV1NsI.js} +3 -3
- package/dist/{index-CRP6q1zm.js → index-C4K8XMtw.js} +1 -1
- package/dist/{index-BiPiCn4i.js → index-C_w1SduC.js} +4 -4
- package/dist/{index.vue_vue_type_script_setup_true_lang-_L_fpAVx.js → index.vue_vue_type_script_setup_true_lang-PaZUOl8m.js} +180 -180
- package/dist/{item-DvT7eHLk.js → item-D0Bi2cpK.js} +13 -13
- package/dist/{jszip.min-CCOASWIM.js → jszip.min-r9UHwmze.js} +2 -2
- package/dist/{menu-BzA3kdNL.js → menu-mRn5dsWt.js} +1 -1
- package/dist/{menuV2-Do5huiRH.js → menuV2-m5ZdhFyl.js} +147 -147
- package/dist/{priceTier-DWekTOo1.js → priceTier-2OP34EBo.js} +1 -1
- package/dist/{scheduler-B0nhfgW4.js → scheduler-CkgI9i8e.js} +4 -4
- package/dist/{subcategory-D84ydXuM.js → subcategory-D8ilv4ln.js} +2 -2
- package/dist/{toExcel-BfN5A5eq.js → toExcel-CeAZQsHE.js} +2 -2
- package/dist/{unit-5njceFRD.js → unit-BgDtOYqv.js} +2 -2
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var We = Object.defineProperty;
|
|
2
2
|
var Le = (e, t, n) => t in e ? We(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var ne = (e, t, n) => Le(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { K as ae, I as C, D as T, A as ue, aq as re, M as G, J as ie, ae as x, a as L, $ as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { shallowRef as j, ref as B, computed as S, shallowReactive as
|
|
4
|
+
import { K as ae, I as C, D as T, A as ue, aq as re, M as G, J as ie, ae as x, a as L, $ as D, ao as oe, ar as qe, as as ze, B as Ge, ag as Be, at as He, au as Je, ad as Ye } from "./index.vue_vue_type_script_setup_true_lang-PaZUOl8m.js";
|
|
5
|
+
import { defineStore as Qe } from "pinia";
|
|
6
|
+
import { shallowRef as j, ref as B, computed as S, shallowReactive as Xe, effectScope as Ze, watch as et } from "vue";
|
|
7
7
|
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
8
8
|
import { useSnackbar as tt } from "@feedmepos/ui-library";
|
|
9
|
-
const nt = "/assets/linked-status-
|
|
9
|
+
const nt = "/assets/linked-status-j7iSFteX.js", rt = "/assets/override-menu-Co5QYVz1.js";
|
|
10
10
|
function ot(e) {
|
|
11
11
|
var o;
|
|
12
12
|
const t = C(e), n = (o = t.variant) == null ? void 0 : o.variantCombinations;
|
|
@@ -14,11 +14,11 @@ function ot(e) {
|
|
|
14
14
|
}
|
|
15
15
|
function st(e, t, n, o) {
|
|
16
16
|
const r = C(t), u = n ? r.modules.catalog.find((v) => v._id === n) : null, l = o ? r.modules.scheduler.find((v) => v._id === o) : null, a = u ? C(u) : void 0, c = n ? r.modules.catalog.filter((v) => v._id !== n) : [], i = l ? C(l) : void 0, f = e.reduce((v, y) => (v[y._id] = ot(y), v), {});
|
|
17
|
-
function
|
|
18
|
-
const y = e.map((
|
|
17
|
+
function h(v = []) {
|
|
18
|
+
const y = e.map((p) => p._id);
|
|
19
19
|
return [
|
|
20
|
-
...v.filter((
|
|
21
|
-
...Object.values(f).flatMap((
|
|
20
|
+
...v.filter((p) => !y.includes(p._id)),
|
|
21
|
+
...Object.values(f).flatMap((p) => p)
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
24
|
return a && o ? (a.override.scheduler = {
|
|
@@ -26,7 +26,7 @@ function st(e, t, n, o) {
|
|
|
26
26
|
[o]: {
|
|
27
27
|
...a.override.scheduler[o],
|
|
28
28
|
_id: o,
|
|
29
|
-
items:
|
|
29
|
+
items: h(i == null ? void 0 : i.items).map((v) => ({
|
|
30
30
|
...v,
|
|
31
31
|
orderFrom: ue.F_ORDER_FROM.enum.ALL
|
|
32
32
|
}))
|
|
@@ -34,7 +34,7 @@ function st(e, t, n, o) {
|
|
|
34
34
|
}, r.modules.catalog = [...c, a], r) : a ? (a.override.items = {
|
|
35
35
|
...a.override.items,
|
|
36
36
|
...f
|
|
37
|
-
}, r.modules.catalog = [...c, a], r) : i ? (i.items =
|
|
37
|
+
}, r.modules.catalog = [...c, a], r) : i ? (i.items = h(i.items), r.modules.scheduler = [
|
|
38
38
|
...r.modules.scheduler.filter((v) => v._id !== o),
|
|
39
39
|
i
|
|
40
40
|
], r) : {
|
|
@@ -49,23 +49,23 @@ function st(e, t, n, o) {
|
|
|
49
49
|
_id: r._id
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function P(e, t, n) {
|
|
53
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
58
|
const r = (u = o.groups) == null ? void 0 : u.map((l) => {
|
|
59
|
-
var i, f,
|
|
59
|
+
var i, f, h;
|
|
60
60
|
const a = (i = e == null ? void 0 : e.groups) == null ? void 0 : i.find((v) => v._id === l._id);
|
|
61
61
|
let c;
|
|
62
62
|
return a ? c = ((f = l.items) == null ? void 0 : f.map((v) => {
|
|
63
|
-
var
|
|
64
|
-
const y = (
|
|
63
|
+
var p;
|
|
64
|
+
const y = (p = a.items) == null ? void 0 : p.find(
|
|
65
65
|
(b) => b._id === v._id && b.combinationKey === v.combinationKey
|
|
66
66
|
);
|
|
67
|
-
return
|
|
68
|
-
})) ?? [] : c = ((
|
|
67
|
+
return P(y || v, t, n + 1);
|
|
68
|
+
})) ?? [] : c = ((h = l.items) == null ? void 0 : h.map((v) => P(v, t, n + 1))) ?? [], {
|
|
69
69
|
...l,
|
|
70
70
|
items: c
|
|
71
71
|
};
|
|
@@ -81,21 +81,21 @@ function F(e, t, n) {
|
|
|
81
81
|
function at(e, t) {
|
|
82
82
|
const n = e.groups.map((u) => {
|
|
83
83
|
const l = t.modules.group.find((c) => c._id === u._id), a = ((l == null ? void 0 : l.items) || []).map((c) => {
|
|
84
|
-
var
|
|
85
|
-
const i = (
|
|
84
|
+
var h;
|
|
85
|
+
const i = (h = u.items) == null ? void 0 : h.find(
|
|
86
86
|
(v) => v._id === c._id && v.combinationKey === c.combinationKey
|
|
87
87
|
);
|
|
88
88
|
if (i)
|
|
89
|
-
return
|
|
89
|
+
return P(i, t, 1);
|
|
90
90
|
const f = {
|
|
91
91
|
...T.generator.initMenuV4ItemOverrider(),
|
|
92
92
|
_id: c._id,
|
|
93
93
|
combinationKey: c.combinationKey
|
|
94
94
|
};
|
|
95
|
-
return
|
|
95
|
+
return P(f, t, 1);
|
|
96
96
|
});
|
|
97
97
|
return { ...u, items: a };
|
|
98
|
-
}), o = e.variant ? e.variant.variantCombinations.map((u) =>
|
|
98
|
+
}), o = e.variant ? e.variant.variantCombinations.map((u) => P(u, t, 1)) : [], r = {
|
|
99
99
|
...T.generator.initMenuV4ItemOverrider(),
|
|
100
100
|
_id: e._id,
|
|
101
101
|
name: e.name,
|
|
@@ -115,7 +115,7 @@ function H(e, t) {
|
|
|
115
115
|
return r.items = (a = r.items) == null ? void 0 : a.map((c) => {
|
|
116
116
|
var f;
|
|
117
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;
|
|
@@ -152,25 +152,25 @@ function ut(e, t) {
|
|
|
152
152
|
price: (o == null ? void 0 : o.price) || t.price
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
async function
|
|
156
|
-
const l = C(n), a = u ? st(t, l, o, r) : l, c = t.reduce((
|
|
155
|
+
async function Vt(e, t, n, o, r, u = !0) {
|
|
156
|
+
const l = C(n), a = u ? st(t, l, o, r) : l, c = t.reduce((h, v) => (h[v._id] = a.modules.item.find((y) => y._id === v._id), h), {}), i = t.reduce((h, v) => {
|
|
157
157
|
const y = v._id;
|
|
158
|
-
return
|
|
158
|
+
return h[y] = at(c[y], e), h;
|
|
159
159
|
}, {}), f = T.getFallbackPrices({
|
|
160
160
|
rawMenu: a,
|
|
161
161
|
items: i,
|
|
162
162
|
catalogId: o || void 0,
|
|
163
163
|
schedulerId: r
|
|
164
164
|
});
|
|
165
|
-
return t.map((
|
|
166
|
-
const v =
|
|
165
|
+
return t.map((h) => {
|
|
166
|
+
const v = h._id, y = c[v];
|
|
167
167
|
return {
|
|
168
168
|
...ut(f, y),
|
|
169
169
|
category: o || r ? y == null ? void 0 : y.category : null
|
|
170
170
|
};
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Dt(e, t) {
|
|
174
174
|
if (e.length === 0) return "";
|
|
175
175
|
const n = e == null ? void 0 : e.split("variant");
|
|
176
176
|
return ((n == null ? void 0 : n.reduce((r, u) => {
|
|
@@ -204,7 +204,7 @@ async function ce(e, t, n) {
|
|
|
204
204
|
schedulerId: n
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Ft(e, t, n) {
|
|
208
208
|
const o = /* @__PURE__ */ new Set();
|
|
209
209
|
function r(u, l) {
|
|
210
210
|
if (!e || !u || !l || o.has(l)) return !1;
|
|
@@ -246,18 +246,18 @@ async function $t(e, t, n) {
|
|
|
246
246
|
var l, a;
|
|
247
247
|
const o = await it(e, t, null), r = [], u = (c, i) => {
|
|
248
248
|
const f = C(c);
|
|
249
|
-
for (const
|
|
250
|
-
i[
|
|
249
|
+
for (const h in i)
|
|
250
|
+
i[h] && (f[h] = i[h]);
|
|
251
251
|
return f;
|
|
252
252
|
};
|
|
253
253
|
for (const c of o.modules.group) {
|
|
254
|
-
const i = (l = c.items) == null ? void 0 : l.find((
|
|
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
|
|
257
|
-
var
|
|
258
|
-
const
|
|
259
|
-
(
|
|
260
|
-
) : f, b =
|
|
256
|
+
const h = (a = c.items) == null ? void 0 : a.filter((y) => y._id === n && y.combinationKey), v = [i, ...h].map((y) => {
|
|
257
|
+
var w, I;
|
|
258
|
+
const p = y.combinationKey ? (I = (w = f == null ? void 0 : f.variant) == null ? void 0 : w.variantCombinations) == null ? void 0 : I.find(
|
|
259
|
+
(E) => E.combinationKey === y.combinationKey
|
|
260
|
+
) : f, b = p && f ? u(f, p) : y;
|
|
261
261
|
return u(b, y);
|
|
262
262
|
});
|
|
263
263
|
r.push({
|
|
@@ -268,7 +268,7 @@ async function $t(e, t, n) {
|
|
|
268
268
|
}
|
|
269
269
|
return r;
|
|
270
270
|
}
|
|
271
|
-
const
|
|
271
|
+
const M = 0, F = 3;
|
|
272
272
|
function ct(e) {
|
|
273
273
|
const t = /^\/(.*)\/([gimyu]*)$/.exec(e.toString());
|
|
274
274
|
if (!t)
|
|
@@ -327,9 +327,9 @@ function lt(e, t, n) {
|
|
|
327
327
|
}
|
|
328
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),
|
|
331
|
-
if (
|
|
332
|
-
for (const v of
|
|
330
|
+
const i = e[c], f = n ? n(i) : JSON.stringify(i), h = u.get(f);
|
|
331
|
+
if (h) {
|
|
332
|
+
for (const v of h)
|
|
333
333
|
if (!a.has(v) && K(i, t[v])) {
|
|
334
334
|
l.push({ leftIndex: c, rightIndex: v }), a.add(v);
|
|
335
335
|
break;
|
|
@@ -344,34 +344,34 @@ function dt(e, t, n) {
|
|
|
344
344
|
const o = { _t: "a" }, r = ((v = n == null ? void 0 : n.arrays) == null ? void 0 : v.detectMove) !== !1, u = ((y = n == null ? void 0 : n.arrays) == null ? void 0 : y.includeValueOnMove) === !0, l = n == null ? void 0 : n.objectHash;
|
|
345
345
|
let a = r ? lt(e, t, l) : [];
|
|
346
346
|
if (!l && e.length === t.length && e.length > 0 && a.length < e.length) {
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
347
|
+
const p = k(e[0]) || Array.isArray(e[0]), b = a.length > 0;
|
|
348
|
+
if (p || b) {
|
|
349
349
|
a = [];
|
|
350
|
-
for (let
|
|
351
|
-
a.push({ leftIndex:
|
|
350
|
+
for (let w = 0; w < e.length; w++)
|
|
351
|
+
a.push({ leftIndex: w, rightIndex: w });
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
new Set(a.map((
|
|
355
|
-
const c = new Set(a.map((
|
|
356
|
-
for (const
|
|
357
|
-
i.set(
|
|
358
|
-
for (let
|
|
359
|
-
const b = i.get(
|
|
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
|
+
i.set(p.leftIndex, p.rightIndex), f.set(p.rightIndex, p.leftIndex);
|
|
358
|
+
for (let p = 0; p < e.length; p++) {
|
|
359
|
+
const b = i.get(p);
|
|
360
360
|
if (b !== void 0) {
|
|
361
|
-
const
|
|
362
|
-
if (
|
|
363
|
-
const
|
|
364
|
-
o[
|
|
361
|
+
const w = J(e[p], t[b], n);
|
|
362
|
+
if (w !== void 0 && (o[b] = w), r && b !== p) {
|
|
363
|
+
const I = `_${p}`, E = u ? [e[p], b, F] : ["", b, F];
|
|
364
|
+
o[I] = E;
|
|
365
365
|
}
|
|
366
366
|
} else {
|
|
367
|
-
const
|
|
368
|
-
o[
|
|
367
|
+
const w = `_${p}`;
|
|
368
|
+
o[w] = [e[p], M, M];
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
for (let
|
|
372
|
-
c.has(
|
|
373
|
-
const
|
|
374
|
-
if (!(
|
|
371
|
+
for (let p = 0; p < t.length; p++)
|
|
372
|
+
c.has(p) || (o[p] = [t[p]]);
|
|
373
|
+
const h = Object.keys(o);
|
|
374
|
+
if (!(h.length === 1 && h[0] === "_t"))
|
|
375
375
|
return o;
|
|
376
376
|
}
|
|
377
377
|
function ft(e, t, n) {
|
|
@@ -386,7 +386,7 @@ function ft(e, t, n) {
|
|
|
386
386
|
f !== void 0 && (o[a] = f);
|
|
387
387
|
} else if (c && !i) {
|
|
388
388
|
const f = n != null && n.omitRemovedValues ? 0 : e[a];
|
|
389
|
-
o[a] = [f,
|
|
389
|
+
o[a] = [f, M, M];
|
|
390
390
|
} else !c && i && (o[a] = [t[a]]);
|
|
391
391
|
}
|
|
392
392
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
@@ -416,7 +416,7 @@ function vt(e, t, n) {
|
|
|
416
416
|
for (const a in t) {
|
|
417
417
|
if (a === "_t" || !a.startsWith("_")) continue;
|
|
418
418
|
const c = parseInt(a.slice(1)), i = t[a];
|
|
419
|
-
Array.isArray(i) && (i.length === 3 && i[2] ===
|
|
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
421
|
const u = [];
|
|
422
422
|
let l = 0;
|
|
@@ -432,9 +432,9 @@ function vt(e, t, n) {
|
|
|
432
432
|
}
|
|
433
433
|
else {
|
|
434
434
|
let f = !1;
|
|
435
|
-
for (const [
|
|
435
|
+
for (const [h, v] of r.entries())
|
|
436
436
|
if (v === a) {
|
|
437
|
-
u.push(e[
|
|
437
|
+
u.push(e[h]), f = !0;
|
|
438
438
|
break;
|
|
439
439
|
}
|
|
440
440
|
if (!f) {
|
|
@@ -453,7 +453,7 @@ function yt(e, t, n) {
|
|
|
453
453
|
const o = { ...e };
|
|
454
454
|
for (const r in t) {
|
|
455
455
|
const u = t[r];
|
|
456
|
-
Array.isArray(u) ? u.length === 1 ? o[r] = u[0] : u.length === 3 && u[2] ===
|
|
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
|
}
|
|
@@ -464,7 +464,7 @@ function Y(e, t, n) {
|
|
|
464
464
|
return t[0];
|
|
465
465
|
if (t.length === 2)
|
|
466
466
|
return t[1];
|
|
467
|
-
if (t.length === 3 && t[2] ===
|
|
467
|
+
if (t.length === 3 && t[2] === M)
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
470
|
return k(t) && t._t === "a" ? vt(e, t) : k(t) && k(e) ? yt(e, t) : e;
|
|
@@ -472,61 +472,61 @@ function Y(e, t, n) {
|
|
|
472
472
|
function le(e, t, n) {
|
|
473
473
|
return Y(e, t);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function ht(e) {
|
|
476
476
|
const t = { _t: "a" };
|
|
477
477
|
for (const n in e)
|
|
478
478
|
if (n !== "_t")
|
|
479
479
|
if (n.startsWith("_")) {
|
|
480
480
|
const o = parseInt(n.slice(1)), r = e[n];
|
|
481
481
|
if (Array.isArray(r)) {
|
|
482
|
-
if (r.length === 3 && r[2] ===
|
|
482
|
+
if (r.length === 3 && r[2] === M)
|
|
483
483
|
t[o] = [r[0]];
|
|
484
|
-
else if (r.length === 3 && r[2] ===
|
|
484
|
+
else if (r.length === 3 && r[2] === F) {
|
|
485
485
|
const u = r[1];
|
|
486
|
-
t[`_${u}`] = [r[0], o,
|
|
486
|
+
t[`_${u}`] = [r[0], o, F];
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
} else {
|
|
490
490
|
const o = parseInt(n), r = e[n];
|
|
491
491
|
if (Array.isArray(r) && r.length === 1)
|
|
492
|
-
t[`_${o}`] = [r[0],
|
|
492
|
+
t[`_${o}`] = [r[0], M, M];
|
|
493
493
|
else {
|
|
494
|
-
const u =
|
|
494
|
+
const u = Q(r);
|
|
495
495
|
u !== void 0 && (t[n] = u);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
return t;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function pt(e) {
|
|
501
501
|
const t = {};
|
|
502
502
|
for (const n in e) {
|
|
503
503
|
const o = e[n];
|
|
504
504
|
if (Array.isArray(o))
|
|
505
|
-
o.length === 1 ? t[n] = [o[0],
|
|
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 = Q(o);
|
|
508
508
|
r !== void 0 && (t[n] = r);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
return t;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function Q(e) {
|
|
514
514
|
if (e !== void 0) {
|
|
515
515
|
if (Array.isArray(e)) {
|
|
516
516
|
if (e.length === 1)
|
|
517
|
-
return [e[0],
|
|
517
|
+
return [e[0], M, M];
|
|
518
518
|
if (e.length === 2)
|
|
519
519
|
return [e[1], e[0]];
|
|
520
|
-
if (e.length === 3 && e[2] ===
|
|
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 k(e) && e._t === "a" ?
|
|
525
|
+
return k(e) && e._t === "a" ? ht(e) : k(e) ? pt(e) : e;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
function de(e) {
|
|
529
|
-
return
|
|
529
|
+
return Q(e);
|
|
530
530
|
}
|
|
531
531
|
function gt(e, t, n) {
|
|
532
532
|
const o = de(t);
|
|
@@ -572,8 +572,8 @@ function bt({
|
|
|
572
572
|
n.value = C(y), u.value = C(y), o.value = [{ delta: null }], r.value = 0;
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
|
-
const
|
|
576
|
-
if (r.value < o.value.length - 1 && (o.value = o.value.slice(0, r.value + 1)), o.value.push({ delta:
|
|
575
|
+
const p = t.diff(u.value, y);
|
|
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 = C(y), o.value.length > e) {
|
|
577
577
|
const b = o.value[1].delta;
|
|
578
578
|
b && n.value && (n.value = t.patch(C(n.value), b)), o.value.shift(), r.value--;
|
|
579
579
|
}
|
|
@@ -581,12 +581,12 @@ function bt({
|
|
|
581
581
|
function i(y) {
|
|
582
582
|
if (!n.value || y < 0 || y >= o.value.length)
|
|
583
583
|
return;
|
|
584
|
-
let
|
|
584
|
+
let p = C(n.value);
|
|
585
585
|
for (let b = 1; b <= y; b++) {
|
|
586
|
-
const
|
|
587
|
-
|
|
586
|
+
const w = o.value[b];
|
|
587
|
+
w.delta && (p = t.patch(p, w.delta));
|
|
588
588
|
}
|
|
589
|
-
return
|
|
589
|
+
return p;
|
|
590
590
|
}
|
|
591
591
|
function f() {
|
|
592
592
|
if (l.value) {
|
|
@@ -595,7 +595,7 @@ function bt({
|
|
|
595
595
|
return y && (u.value = C(y)), y;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function h() {
|
|
599
599
|
if (a.value) {
|
|
600
600
|
r.value++;
|
|
601
601
|
const y = i(r.value);
|
|
@@ -610,11 +610,11 @@ function bt({
|
|
|
610
610
|
canUndo: l,
|
|
611
611
|
canRedo: a,
|
|
612
612
|
undo: f,
|
|
613
|
-
redo:
|
|
613
|
+
redo: h,
|
|
614
614
|
clear: v
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
|
-
const
|
|
617
|
+
const wt = {
|
|
618
618
|
async updateMenuModule(e, t) {
|
|
619
619
|
const n = G.RequestRunner.operation(t, e.modules);
|
|
620
620
|
if (n.validateError.length > 0)
|
|
@@ -651,7 +651,7 @@ function fe() {
|
|
|
651
651
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function Mt() {
|
|
655
655
|
return {
|
|
656
656
|
restaurants: [],
|
|
657
657
|
menu: { ...fe(), _rev: "" },
|
|
@@ -664,10 +664,10 @@ function wt() {
|
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
|
-
const
|
|
667
|
+
const Pt = Qe(
|
|
668
668
|
"mf-menu-store-v2",
|
|
669
669
|
() => {
|
|
670
|
-
const e =
|
|
670
|
+
const e = Xe(Mt()), t = se(), n = tt(), o = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
|
|
671
671
|
selector: "position"
|
|
672
672
|
}) : []), r = S(() => {
|
|
673
673
|
var s;
|
|
@@ -686,14 +686,14 @@ const Ft = Ze(
|
|
|
686
686
|
items: e.menu.modules.item,
|
|
687
687
|
...e.currentRestaurantAttrParams ?? {}
|
|
688
688
|
})), s;
|
|
689
|
-
}), c = S(() => x(
|
|
689
|
+
}), c = S(() => x(h.value.modules.scheduler, { selector: "name" })), i = S(() => e.menu.modules.scheduler.find(
|
|
690
690
|
(s) => s._id === e.currentSchedulerId
|
|
691
691
|
));
|
|
692
692
|
function f(s, d = !0) {
|
|
693
|
-
e.menu = { ...s, _rev: e.menu._rev }, d &&
|
|
693
|
+
e.menu = { ...s, _rev: e.menu._rev }, d && V.push(e.menu);
|
|
694
694
|
}
|
|
695
|
-
const
|
|
696
|
-
async function
|
|
695
|
+
const h = j(fe()), v = B(!1), y = B(1);
|
|
696
|
+
async function p() {
|
|
697
697
|
var m;
|
|
698
698
|
v.value = !0;
|
|
699
699
|
let s = e.menu.modules.catalog;
|
|
@@ -725,19 +725,19 @@ const Ft = Ze(
|
|
|
725
725
|
), A = new Set(((_ == null ? void 0 : _.items) || []).map((R) => R._id));
|
|
726
726
|
d.modules.item = d.modules.item.filter((R) => A.has(R._id));
|
|
727
727
|
}
|
|
728
|
-
return
|
|
728
|
+
return h.value = d, v.value = !1, y.value = y.value + 1, d;
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
let
|
|
732
|
-
function
|
|
733
|
-
|
|
730
|
+
const w = ie.debounce(p, 200);
|
|
731
|
+
let I = null, E = null;
|
|
732
|
+
function X() {
|
|
733
|
+
E && (E(), E = null), I && I.stop(), I = Ze(!0), E = I.run(() => et(
|
|
734
734
|
() => [e.menu, e.currentCatalogId, e.currentSchedulerId],
|
|
735
735
|
() => {
|
|
736
|
-
v.value ||
|
|
736
|
+
v.value || w();
|
|
737
737
|
}
|
|
738
738
|
)) || null;
|
|
739
739
|
}
|
|
740
|
-
|
|
740
|
+
X();
|
|
741
741
|
const me = S(() => [
|
|
742
742
|
{
|
|
743
743
|
label: "Main",
|
|
@@ -747,8 +747,8 @@ const Ft = Ze(
|
|
|
747
747
|
label: s.name,
|
|
748
748
|
value: s._id
|
|
749
749
|
}))
|
|
750
|
-
]),
|
|
751
|
-
const s =
|
|
750
|
+
]), Z = S(() => {
|
|
751
|
+
const s = h.value.modules.category;
|
|
752
752
|
return [
|
|
753
753
|
...U.value.item.addon ? [
|
|
754
754
|
{
|
|
@@ -757,14 +757,14 @@ const Ft = Ze(
|
|
|
757
757
|
position: 0
|
|
758
758
|
}
|
|
759
759
|
] : [],
|
|
760
|
-
...
|
|
760
|
+
...D(s, (d) => d.name)
|
|
761
761
|
];
|
|
762
762
|
}), ve = S(() => {
|
|
763
|
-
const s =
|
|
764
|
-
return
|
|
763
|
+
const s = h.value.modules.subCategory || [];
|
|
764
|
+
return D(s, (d) => d.name);
|
|
765
765
|
}), ee = S(() => {
|
|
766
766
|
var d;
|
|
767
|
-
let s =
|
|
767
|
+
let s = h.value.modules.item;
|
|
768
768
|
if (a.value) {
|
|
769
769
|
const m = (d = a.value) == null ? void 0 : d.override.items;
|
|
770
770
|
s = s.filter((g) => {
|
|
@@ -775,17 +775,17 @@ const Ft = Ze(
|
|
|
775
775
|
return (_ == null ? void 0 : _.orderFrom) !== ue.F_ORDER_FROM.enum.NONE;
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
|
-
return
|
|
778
|
+
return D(s, (m) => m.code || m.name);
|
|
779
779
|
}), ye = S(() => {
|
|
780
|
-
const s = e.menu.modules.category, d =
|
|
780
|
+
const s = e.menu.modules.category, d = D(s, (g) => g.name).reduce(
|
|
781
781
|
(g, _, A) => (g[_._id] = A, g),
|
|
782
782
|
{ "": 0 }
|
|
783
783
|
), m = e.menu.modules.item;
|
|
784
|
-
return
|
|
784
|
+
return D(
|
|
785
785
|
m,
|
|
786
786
|
(g) => g.code || g.name
|
|
787
787
|
).reduce((g, _, A) => (g[_._id] = A + d[_.category || ""], g), {});
|
|
788
|
-
}),
|
|
788
|
+
}), he = S(() => oe(N.value, Z.value, ee.value)), pe = S(() => {
|
|
789
789
|
const s = U.value.item.addon ? [
|
|
790
790
|
{
|
|
791
791
|
_id: e.currentCatalogId ? "" : null,
|
|
@@ -800,21 +800,21 @@ const Ft = Ze(
|
|
|
800
800
|
e.menu.modules.item
|
|
801
801
|
);
|
|
802
802
|
}), N = S(() => {
|
|
803
|
-
const s =
|
|
803
|
+
const s = h.value.modules.variant;
|
|
804
804
|
return x(s, { selector: "name" });
|
|
805
805
|
});
|
|
806
806
|
function ge(s = []) {
|
|
807
807
|
const d = s.map((g) => N.value.find((_) => _._id === g)).filter((g) => !!g);
|
|
808
808
|
return T.fullVariantCombination(d).reduce((g, _) => (g[_.combinationKey] = _.selectionName.join(" / "), g), {});
|
|
809
809
|
}
|
|
810
|
-
const _e = S(() =>
|
|
810
|
+
const _e = S(() => D(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
|
-
})),
|
|
812
|
+
})), we = S(() => x(e.menu.modules.unit, { selector: "name" })), Me = S(() => x(qe(e.menu.modules.recipe, e.menu.modules.sku), {
|
|
813
813
|
selector: "name"
|
|
814
814
|
})), Ae = S(() => e.menu.modules.cookingGuide), Ce = S(() => {
|
|
815
815
|
const s = ze(e.menu.modules.sku);
|
|
816
816
|
return x(s, { selector: "code" });
|
|
817
|
-
}),
|
|
817
|
+
}), Ie = S(() => {
|
|
818
818
|
const s = /* @__PURE__ */ new Map();
|
|
819
819
|
return e.menu.modules.item.forEach((d) => {
|
|
820
820
|
var m, g;
|
|
@@ -896,7 +896,7 @@ const Ft = Ze(
|
|
|
896
896
|
function W(s) {
|
|
897
897
|
return `${s.systemCode}/${s.taxCode}`;
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function Ee(s) {
|
|
900
900
|
const [d, m] = s.split("/");
|
|
901
901
|
return { systemCode: d, taxCode: m };
|
|
902
902
|
}
|
|
@@ -930,13 +930,13 @@ const Ft = Ze(
|
|
|
930
930
|
});
|
|
931
931
|
}, te = (s) => {
|
|
932
932
|
e.currentCatalogId = s;
|
|
933
|
-
}, De = (s) => {
|
|
934
|
-
e.currentSchedulerId = s;
|
|
935
933
|
}, Ve = (s) => {
|
|
934
|
+
e.currentSchedulerId = s;
|
|
935
|
+
}, De = (s) => {
|
|
936
936
|
e.currentCategoryIds = s;
|
|
937
937
|
}, Te = (s) => {
|
|
938
938
|
e.currentRestaurantAttrParams = s;
|
|
939
|
-
},
|
|
939
|
+
}, Fe = async (s, d) => {
|
|
940
940
|
const m = Array.isArray(s) ? s : [s];
|
|
941
941
|
if (!m.length) return;
|
|
942
942
|
const g = m.map((_) => ({
|
|
@@ -951,7 +951,7 @@ const Ft = Ze(
|
|
|
951
951
|
const A = await He(g, e.menu.modules);
|
|
952
952
|
if (A !== !0) throw new Error(A);
|
|
953
953
|
}
|
|
954
|
-
const _ = await
|
|
954
|
+
const _ = await wt.updateMenuModule(e.menu, g);
|
|
955
955
|
return f(_.menu), _;
|
|
956
956
|
} catch (_) {
|
|
957
957
|
n.open({
|
|
@@ -968,14 +968,14 @@ const Ft = Ze(
|
|
|
968
968
|
priceTierSettings: s.priceTierSettings
|
|
969
969
|
};
|
|
970
970
|
return f(d), d;
|
|
971
|
-
},
|
|
972
|
-
const s =
|
|
971
|
+
}, V = bt({ maxHistorySize: 50 }), $e = S(() => V.canUndo.value), Pe = S(() => V.canRedo.value), je = () => {
|
|
972
|
+
const s = V.undo();
|
|
973
973
|
s && f(s, !1);
|
|
974
974
|
}, Ne = () => {
|
|
975
|
-
const s =
|
|
975
|
+
const s = V.redo();
|
|
976
976
|
s && f(s, !1);
|
|
977
977
|
}, Ue = () => {
|
|
978
|
-
|
|
978
|
+
V.clear();
|
|
979
979
|
};
|
|
980
980
|
return {
|
|
981
981
|
state: e,
|
|
@@ -983,7 +983,7 @@ const Ft = Ze(
|
|
|
983
983
|
workerIsComputing: v,
|
|
984
984
|
mergedMenuChangeId: y,
|
|
985
985
|
// async computed state
|
|
986
|
-
mergedMenu:
|
|
986
|
+
mergedMenu: h,
|
|
987
987
|
// Computed
|
|
988
988
|
version: r,
|
|
989
989
|
isV4: u,
|
|
@@ -993,19 +993,19 @@ const Ft = Ze(
|
|
|
993
993
|
schedulers: c,
|
|
994
994
|
currentScheduler: i,
|
|
995
995
|
catalogOptions: me,
|
|
996
|
-
categories:
|
|
996
|
+
categories: Z,
|
|
997
997
|
subcategories: ve,
|
|
998
998
|
items: ee,
|
|
999
999
|
sortedItems: ye,
|
|
1000
|
-
itemCodeMap:
|
|
1001
|
-
categorizedItems:
|
|
1002
|
-
categorizedRawMenuItems:
|
|
1000
|
+
itemCodeMap: Ie,
|
|
1001
|
+
categorizedItems: he,
|
|
1002
|
+
categorizedRawMenuItems: pe,
|
|
1003
1003
|
variants: N,
|
|
1004
1004
|
groups: _e,
|
|
1005
1005
|
takeaways: Se,
|
|
1006
1006
|
printDepartments: be,
|
|
1007
|
-
units:
|
|
1008
|
-
recipes:
|
|
1007
|
+
units: we,
|
|
1008
|
+
recipes: Me,
|
|
1009
1009
|
cookingGuide: Ae,
|
|
1010
1010
|
skus: Ce,
|
|
1011
1011
|
rules: U,
|
|
@@ -1015,39 +1015,39 @@ const Ft = Ze(
|
|
|
1015
1015
|
readMenu: xe,
|
|
1016
1016
|
readRestaurants: Oe,
|
|
1017
1017
|
selectCatalog: te,
|
|
1018
|
-
selectScheduler:
|
|
1019
|
-
selectCategory:
|
|
1018
|
+
selectScheduler: Ve,
|
|
1019
|
+
selectCategory: De,
|
|
1020
1020
|
setRestaurantAttrParams: Te,
|
|
1021
|
-
updateMenu:
|
|
1021
|
+
updateMenu: Fe,
|
|
1022
1022
|
updateMenuSetting: Ke,
|
|
1023
|
-
computeMergedMenu:
|
|
1023
|
+
computeMergedMenu: p,
|
|
1024
1024
|
// helper
|
|
1025
1025
|
encodeTax: W,
|
|
1026
|
-
decodeTax:
|
|
1026
|
+
decodeTax: Ee,
|
|
1027
1027
|
getSelectedTax: ke,
|
|
1028
1028
|
mapVariant: ge,
|
|
1029
1029
|
// history
|
|
1030
1030
|
canUndoHistory: $e,
|
|
1031
|
-
canRedoHistory:
|
|
1031
|
+
canRedoHistory: Pe,
|
|
1032
1032
|
undoHistory: je,
|
|
1033
1033
|
redoHistory: Ne,
|
|
1034
1034
|
// cleanup
|
|
1035
1035
|
$dispose: () => {
|
|
1036
|
-
|
|
1036
|
+
w.cancel(), E && (E(), E = null), I && (I.stop(), I = null), Ue();
|
|
1037
1037
|
},
|
|
1038
1038
|
$reinitialize: () => {
|
|
1039
|
-
|
|
1039
|
+
X();
|
|
1040
1040
|
}
|
|
1041
1041
|
};
|
|
1042
1042
|
}
|
|
1043
1043
|
);
|
|
1044
1044
|
export {
|
|
1045
1045
|
Tt as a,
|
|
1046
|
-
|
|
1046
|
+
Ft as b,
|
|
1047
1047
|
Kt as c,
|
|
1048
1048
|
$t as f,
|
|
1049
|
-
|
|
1050
|
-
|
|
1049
|
+
Dt as g,
|
|
1050
|
+
Vt as m,
|
|
1051
1051
|
it as o,
|
|
1052
|
-
|
|
1052
|
+
Pt as u
|
|
1053
1053
|
};
|