@feedmepos/mf-menu 0.32.63-dev.1 → 0.32.63-dev.3

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.
Files changed (83) hide show
  1. package/dist/{App-DhfTGlgM.js → App-DHxlR--3.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C5-8qdJK.js → ApplyProduct.vue_vue_type_script_setup_true_lang-6noIwjis.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CXm-0H18.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-CMI2Nh0n.js} +3 -3
  4. package/dist/{Catalog-WuZJfM6l.js → Catalog-B-S0gygH.js} +22 -22
  5. package/dist/{Category-BeIo7XWY.js → Category-DGDddfLx.js} +4 -4
  6. package/dist/{Category-D-cQQCPS.js → Category-DOhNama9.js} +4 -4
  7. package/dist/{CookingGuide-B-yvD9ZA.js → CookingGuide-CUR57F4P.js} +29 -29
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-2_yzXoa4.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-bIONGM6k.js} +1 -1
  9. package/dist/{Group-CY8lUzQG.js → Group-BsGJ0omP.js} +1 -1
  10. package/dist/{Group-13i5igrS.js → Group-z-0jQPCd.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-DZhxy0tb.js → Group.vue_vue_type_script_setup_true_lang-bBWkJ2Hx.js} +7 -7
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CWqv-oUd.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BbqcH4sM.js} +19 -19
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DTs4Vpdi.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CVGilzd0.js} +4210 -4210
  14. package/dist/{Ingredient-vrUOW6gk.js → Ingredient-D38IVDXK.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-xcVjRjqD.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CKmyz9CP.js} +2 -2
  16. package/dist/{LinkProductSideSheet-DMbJG6wf.js → LinkProductSideSheet-DsBA_o9g.js} +4 -4
  17. package/dist/{MenuSetting-Di2xwm00.js → MenuSetting-D-tln58o.js} +7 -7
  18. package/dist/{OrderPacing-CCe-IcGO.js → OrderPacing-BdCEHKD9.js} +7 -7
  19. package/dist/{PrintRoute-CcfObcHY.js → PrintRoute-DKFMqyeI.js} +10 -10
  20. package/dist/{Product-ChUVnMgG.js → Product-Dzo4ljes.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-C9Qp50hL.js → Product.vue_vue_type_script_setup_true_lang-BtE2aiwU.js} +58 -58
  22. package/dist/{ProductInternalTools-D9HXhgo5.js → ProductInternalTools-Z6XR4zko.js} +14 -14
  23. package/dist/{Products-Bly2ktEC.js → Products-CCo675Ee.js} +63 -63
  24. package/dist/{Publish-C8ubb8Qf.js → Publish-tixV8Of1.js} +107 -107
  25. package/dist/{Recipe-BpMRLsyO.js → Recipe-V9kzxmlf.js} +5 -5
  26. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BD5OCDRn.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DBhAzVz3.js} +1 -1
  27. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-Ba3djmX1.js → RuleView.vue_vue_type_script_setup_true_lang-D9DqmAVY.js} +3 -3
  28. package/dist/{Scheduler-CiB4b2Fn.js → Scheduler-0UpDGQKJ.js} +17 -17
  29. package/dist/{ServingSequence-BlcyW-dv.js → ServingSequence-CutiXht7.js} +3 -3
  30. package/dist/{Setting-DqkL6YYU.js → Setting-jyYmoDiq.js} +5 -5
  31. package/dist/{Subcategory-B4Jg_wtT.js → Subcategory-CQSKOLjU.js} +10 -10
  32. package/dist/{Takeaway-5G3f7jWT.js → Takeaway-CQ0m09TB.js} +1 -1
  33. package/dist/{Takeaway-5rFPYYNA.js → Takeaway-DeCthkOI.js} +4 -4
  34. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CVsOhg_E.js → Takeaway.vue_vue_type_script_setup_true_lang-FHE6oQ0d.js} +7 -7
  35. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-CPqxA6JD.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-D9Ga3fOj.js} +1 -1
  36. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-yrNuTD-3.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-Bz32rpvX.js} +2 -2
  37. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DCPGAyOm.js +5858 -0
  38. package/dist/{Unit-CAkdmQLg.js → Unit-_XiPfauV.js} +2 -2
  39. package/dist/{Variant-BbLQqbAK.js → Variant-DfdMywhn.js} +6 -6
  40. package/dist/{_id_-Dzacr40I.js → _id_-Yj5av4B4.js} +12 -12
  41. package/dist/{app-4yWs09Fr.js → app-BcGgfvbE.js} +102 -102
  42. package/dist/{app-Deov1985.js → app-CqdVluGs.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/apps/mf-menu/src/api/media.d.ts +10 -3
  45. package/dist/apps/mf-menu/src/app.d.ts +60 -10
  46. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/productImages.d.ts +67 -21
  47. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ManageImageDrawer.vue.d.ts +33 -3
  48. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ProductImageField.vue.d.ts +31 -1
  49. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/RegenerateImageDialog.vue.d.ts +10 -0
  50. package/dist/apps/mf-menu/src/helper/menuImport.d.ts +22 -0
  51. package/dist/apps/mf-menu/src/manager/menu/itemOverrider.d.ts +17 -0
  52. package/dist/apps/mf-menu/src/stores/manager/item.d.ts +0 -1
  53. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductDetail.vue.d.ts +9 -3
  54. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  55. package/dist/assets/{linked-status-B2WLhKkV.js → linked-status-DdDQXL8Y.js} +3 -3
  56. package/dist/assets/{menu-export-Dcw5a_dN.js → menu-export-CK5bJyLT.js} +4 -4
  57. package/dist/assets/{override-menu-cBe2aMY6.js → override-menu-CHL7Bynw.js} +3 -3
  58. package/dist/assets/{validate-menu-BM-5GK85.js → validate-menu-g2fslPcE.js} +2 -2
  59. package/dist/{catalog-DKygS2Cs.js → catalog-B_yk-l1-.js} +1 -1
  60. package/dist/{catalogSetting-Bn2TplvM.js → catalogSetting-Dl7uIiJm.js} +1 -1
  61. package/dist/{currency-DXgNHtK8.js → currency-BpjSDqef.js} +1 -1
  62. package/dist/dayjs.min-CVH5LqOA.js +7 -0
  63. package/dist/{discardConfirm-DZwzKO-Q.js → discardConfirm-fCmrAVO1.js} +1 -1
  64. package/dist/{index-K-MBqJJo.js → index-CD_omf3p.js} +1 -1
  65. package/dist/{index-B48KLyqg.js → index-Cru6sUb6.js} +5 -5
  66. package/dist/{index-BEocaqRK.js → index-LYc0WKDO.js} +6 -6
  67. package/dist/{index.vue_vue_type_script_setup_true_lang-Nl505vPi.js → index.vue_vue_type_script_setup_true_lang-qgDBinUn.js} +7932 -7868
  68. package/dist/{item-Da3ArD-G.js → item-EPxRgVm0.js} +4904 -4654
  69. package/dist/{jszip.min-Cc2eR4Cq.js → jszip.min-CNgWv4I3.js} +52 -52
  70. package/dist/{linkProducts-GNuUxFEE.js → linkProducts-DvQ0oP1V.js} +6 -6
  71. package/dist/{memberPricing-T-jr7tn1.js → memberPricing-deWSH2K0.js} +1 -1
  72. package/dist/{menu-DSDRAil-.js → menu-DKJ7olgK.js} +1 -1
  73. package/dist/{menuV2-fTlJdjxi.js → menuV2-CB3eZiiP.js} +318 -313
  74. package/dist/mf-menu.css +1 -1
  75. package/dist/{order_pacing-Dgo1fySS.js → order_pacing-DvP19Nxa.js} +5 -5
  76. package/dist/{priceTier-aT_gIfrN.js → priceTier-DyxDcoSh.js} +1 -1
  77. package/dist/{rules-Cx2hkV20.js → rules-GmuBnHtU.js} +3 -3
  78. package/dist/{scheduler-Bd-q7yF8.js → scheduler-BWAzMbPl.js} +28 -28
  79. package/dist/{toExcel-qfjR83qT.js → toExcel-BMOGsD6n.js} +2 -2
  80. package/dist/{unit-n1T9grbM.js → unit-BCREKGn9.js} +24 -24
  81. package/package.json +1 -1
  82. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-T71R68sq.js +0 -5836
  83. package/dist/dayjs.min-DpX65tgj.js +0 -7
@@ -1,25 +1,29 @@
1
1
  var Le = Object.defineProperty;
2
2
  var We = (e, t, n) => t in e ? Le(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 { l as ae } from "./discardConfirm-DZwzKO-Q.js";
4
+ import { l as ae } from "./discardConfirm-fCmrAVO1.js";
5
5
  import { defineStore as qe } from "pinia";
6
- import { shallowRef as N, ref as B, computed as S, shallowReactive as ze, effectScope as Be, watch as He } from "vue";
7
- import { f as ue, d as C, m as T, k as ie, ag as re, g as H, L as x, c as W, s as D, U as oe, ah as Ge, ai as Je, a as Ye, N as Qe, aj as Xe, ak as Ze, J as et } from "./index.vue_vue_type_script_setup_true_lang-Nl505vPi.js";
6
+ import { shallowRef as j, ref as H, computed as S, shallowReactive as ze, effectScope as He, watch as Be } from "vue";
7
+ import { d as C, f as ue, m as T, k as ie, aj as re, g as B, O as x, c as W, s as V, X as oe, ak as Ge, al as Je, a as Ye, Q as Qe, am as Xe, an as Ze, M as et } from "./index.vue_vue_type_script_setup_true_lang-qgDBinUn.js";
8
8
  import { useCoreStore as se } from "@feedmepos/mf-common";
9
9
  import { useSnackbar as tt } from "@feedmepos/ui-library";
10
- const nt = "/assets/linked-status-B2WLhKkV.js", rt = "/assets/override-menu-cBe2aMY6.js";
11
- function ot(e) {
12
- var s;
10
+ function nt(e) {
11
+ var s, r, u;
13
12
  const t = C(e), n = (s = t.variant) == null ? void 0 : s.variantCombinations;
13
+ if (t.images !== void 0) {
14
+ const c = ((r = t.images) == null ? void 0 : r.find((a) => a.isDefault)) ?? ((u = t.images) == null ? void 0 : u[0]);
15
+ t.image = (c == null ? void 0 : c._id) ?? null;
16
+ }
14
17
  return delete t.variant, delete t.thumbnail, delete t.images, [t, ...n || []];
15
18
  }
19
+ const rt = "/assets/linked-status-DdDQXL8Y.js", ot = "/assets/override-menu-CHL7Bynw.js";
16
20
  function st(e, t, n, s) {
17
- const o = C(t), u = n ? o.modules.catalog.find((f) => f._id === n) : null, l = s ? o.modules.scheduler.find((f) => f._id === s) : null, a = u ? C(u) : void 0, d = n ? o.modules.catalog.filter((f) => f._id !== n) : [], c = l ? C(l) : void 0, g = e.reduce((f, v) => (f[v._id] = ot(v), f), {});
21
+ const r = C(t), u = n ? r.modules.catalog.find((f) => f._id === n) : null, c = s ? r.modules.scheduler.find((f) => f._id === s) : null, a = u ? C(u) : void 0, d = n ? r.modules.catalog.filter((f) => f._id !== n) : [], l = c ? C(c) : void 0, g = e.reduce((f, v) => (f[v._id] = nt(v), f), {});
18
22
  function y(f = []) {
19
- const v = e.map((h) => h._id);
23
+ const v = e.map((p) => p._id);
20
24
  return [
21
- ...f.filter((h) => !v.includes(h._id)),
22
- ...Object.values(g).flatMap((h) => h)
25
+ ...f.filter((p) => !v.includes(p._id)),
26
+ ...Object.values(g).flatMap((p) => p)
23
27
  ];
24
28
  }
25
29
  return a && s ? (a.override.scheduler = {
@@ -27,47 +31,47 @@ function st(e, t, n, s) {
27
31
  [s]: {
28
32
  ...a.override.scheduler[s],
29
33
  _id: s,
30
- items: y(c == null ? void 0 : c.items).map((f) => ({
34
+ items: y(l == null ? void 0 : l.items).map((f) => ({
31
35
  ...f,
32
36
  orderFrom: ie.enum.ALL
33
37
  }))
34
38
  }
35
- }, o.modules.catalog = [...d, a], o) : a ? (a.override.items = {
39
+ }, r.modules.catalog = [...d, a], r) : a ? (a.override.items = {
36
40
  ...a.override.items,
37
41
  ...g
38
- }, o.modules.catalog = [...d, a], o) : c ? (c.items = y(c.items), o.modules.scheduler = [
39
- ...o.modules.scheduler.filter((f) => f._id !== s),
40
- c
41
- ], o) : {
42
+ }, r.modules.catalog = [...d, a], r) : l ? (l.items = y(l.items), r.modules.scheduler = [
43
+ ...r.modules.scheduler.filter((f) => f._id !== s),
44
+ l
45
+ ], r) : {
42
46
  ...re(),
43
47
  modules: {
44
48
  ...re().modules,
45
- catalog: o.modules.catalog,
46
- item: o.modules.item,
47
- group: o.modules.group,
48
- scheduler: o.modules.scheduler
49
+ catalog: r.modules.catalog,
50
+ item: r.modules.item,
51
+ group: r.modules.group,
52
+ scheduler: r.modules.scheduler
49
53
  },
50
- _id: o._id
54
+ _id: r._id
51
55
  };
52
56
  }
53
57
  function F(e, t, n) {
54
58
  var u;
55
59
  if (n >= 3) return e;
56
- const s = t.modules.item.find((l) => l._id === e._id);
60
+ const s = t.modules.item.find((c) => c._id === e._id);
57
61
  if (!s)
58
62
  throw new Error(`_insertItemOverriders - Item not found - ${e._id}`);
59
- const o = (u = s.groups) == null ? void 0 : u.map((l) => {
60
- var c, g, y;
61
- const a = (c = e == null ? void 0 : e.groups) == null ? void 0 : c.find((f) => f._id === l._id);
63
+ const r = (u = s.groups) == null ? void 0 : u.map((c) => {
64
+ var l, g, y;
65
+ const a = (l = e == null ? void 0 : e.groups) == null ? void 0 : l.find((f) => f._id === c._id);
62
66
  let d;
63
- return a ? d = ((g = l.items) == null ? void 0 : g.map((f) => {
64
- var h;
65
- const v = (h = a.items) == null ? void 0 : h.find(
67
+ return a ? d = ((g = c.items) == null ? void 0 : g.map((f) => {
68
+ var p;
69
+ const v = (p = a.items) == null ? void 0 : p.find(
66
70
  (b) => b._id === f._id && b.combinationKey === f.combinationKey
67
71
  );
68
72
  return F(v || f, t, n + 1);
69
- })) ?? [] : d = ((y = l.items) == null ? void 0 : y.map((f) => F(f, t, n + 1))) ?? [], {
70
- ...l,
73
+ })) ?? [] : d = ((y = c.items) == null ? void 0 : y.map((f) => F(f, t, n + 1))) ?? [], {
74
+ ...c,
71
75
  items: d
72
76
  };
73
77
  });
@@ -76,18 +80,18 @@ function F(e, t, n) {
76
80
  name: e.name || s.name,
77
81
  code: e.code || s.code,
78
82
  combinationKey: e.combinationKey,
79
- groups: o
83
+ groups: r
80
84
  };
81
85
  }
82
86
  function at(e, t) {
83
87
  const n = e.groups.map((u) => {
84
- const l = t.modules.group.find((d) => d._id === u._id), a = ((l == null ? void 0 : l.items) || []).map((d) => {
88
+ const c = t.modules.group.find((d) => d._id === u._id), a = ((c == null ? void 0 : c.items) || []).map((d) => {
85
89
  var y;
86
- const c = (y = u.items) == null ? void 0 : y.find(
90
+ const l = (y = u.items) == null ? void 0 : y.find(
87
91
  (f) => f._id === d._id && f.combinationKey === d.combinationKey
88
92
  );
89
- if (c)
90
- return F(c, t, 1);
93
+ if (l)
94
+ return F(l, t, 1);
91
95
  const g = {
92
96
  ...T.generator.initMenuV4ItemOverrider(),
93
97
  _id: d._id,
@@ -96,92 +100,92 @@ function at(e, t) {
96
100
  return F(g, t, 1);
97
101
  });
98
102
  return { ...u, items: a };
99
- }), s = e.variant ? e.variant.variantCombinations.map((u) => F(u, t, 1)) : [], o = {
103
+ }), s = e.variant ? e.variant.variantCombinations.map((u) => F(u, t, 1)) : [], r = {
100
104
  ...T.generator.initMenuV4ItemOverrider(),
101
105
  _id: e._id,
102
106
  name: e.name,
103
107
  code: e.code,
104
108
  groups: n
105
109
  };
106
- return [...s, o];
110
+ return [...s, r];
107
111
  }
108
112
  function G(e, t) {
109
113
  var s;
110
114
  if (!t)
111
115
  return e;
112
116
  const n = { ...e, code: t.code };
113
- return n.groups = (s = n.groups) == null ? void 0 : s.map((o) => {
114
- var l, a;
115
- const u = (l = t.groups) == null ? void 0 : l.find((d) => d._id === o._id);
116
- return o.items = (a = o.items) == null ? void 0 : a.map((d) => {
117
+ return n.groups = (s = n.groups) == null ? void 0 : s.map((r) => {
118
+ var c, a;
119
+ const u = (c = t.groups) == null ? void 0 : c.find((d) => d._id === r._id);
120
+ return r.items = (a = r.items) == null ? void 0 : a.map((d) => {
117
121
  var g;
118
- const c = (g = u == null ? void 0 : u.items) == null ? void 0 : g.find(
122
+ const l = (g = u == null ? void 0 : u.items) == null ? void 0 : g.find(
119
123
  (y) => y._id === d._id && y.combinationKey === d.combinationKey
120
124
  );
121
- return G(d, c);
122
- }), o;
125
+ return G(d, l);
126
+ }), r;
123
127
  }), n;
124
128
  }
125
129
  function ut(e, t) {
126
130
  const n = e.items[t._id];
127
131
  t.variant && (t.variant = {
128
132
  ...t.variant,
129
- variantCombinations: t.variant.variantCombinations.map((o) => {
133
+ variantCombinations: t.variant.variantCombinations.map((r) => {
130
134
  const u = n.find(
131
- (l) => l._id === o._id && l.combinationKey === o.combinationKey
135
+ (c) => c._id === r._id && c.combinationKey === r.combinationKey
132
136
  );
133
137
  if (!u)
134
- throw new Error(`Item overrider not found - ${o._id} - ${o.combinationKey}`);
135
- return G(u, o);
138
+ throw new Error(`Item overrider not found - ${r._id} - ${r.combinationKey}`);
139
+ return G(u, r);
136
140
  })
137
141
  });
138
- const s = n.find((o) => !o.combinationKey);
142
+ const s = n.find((r) => !r.combinationKey);
139
143
  if (!s)
140
144
  throw new Error(`Base item overrider not found - ${t._id}`);
141
- return t.groups = (s.groups || []).map((o) => {
142
- var l;
143
- const u = t.groups.find((a) => a._id === o._id);
144
- return o.items = (l = o.items) == null ? void 0 : l.map((a) => {
145
- var c;
146
- const d = (c = u == null ? void 0 : u.items) == null ? void 0 : c.find(
145
+ return t.groups = (s.groups || []).map((r) => {
146
+ var c;
147
+ const u = t.groups.find((a) => a._id === r._id);
148
+ return r.items = (c = r.items) == null ? void 0 : c.map((a) => {
149
+ var l;
150
+ const d = (l = u == null ? void 0 : u.items) == null ? void 0 : l.find(
147
151
  (g) => g._id === a._id && g.combinationKey === a.combinationKey
148
152
  );
149
153
  return G(a, d);
150
- }), o;
154
+ }), r;
151
155
  }), {
152
156
  ...t,
153
157
  price: (s == null ? void 0 : s.price) || t.price
154
158
  };
155
159
  }
156
- async function Dt(e, t, n, s, o, u = !0) {
157
- const l = C(n), a = u ? st(t, l, s, o) : l, d = t.reduce((y, f) => (y[f._id] = a.modules.item.find((v) => v._id === f._id), y), {}), c = t.reduce((y, f) => {
160
+ async function Vt(e, t, n, s, r, u = !0) {
161
+ const c = C(n), a = u ? st(t, c, s, r) : c, d = t.reduce((y, f) => (y[f._id] = a.modules.item.find((v) => v._id === f._id), y), {}), l = t.reduce((y, f) => {
158
162
  const v = f._id;
159
163
  return y[v] = at(d[v], e), y;
160
164
  }, {}), g = T.getFallbackPrices({
161
165
  rawMenu: a,
162
- items: c,
166
+ items: l,
163
167
  catalogId: s || void 0,
164
- schedulerId: o
168
+ schedulerId: r
165
169
  });
166
170
  return t.map((y) => {
167
171
  const f = y._id, v = d[f];
168
172
  return {
169
173
  ...ut(g, v),
170
- category: s || o ? v == null ? void 0 : v.category : null
174
+ category: s || r ? v == null ? void 0 : v.category : null
171
175
  };
172
176
  });
173
177
  }
174
178
  function Tt(e, t) {
175
179
  if (e.length === 0) return "";
176
180
  const n = e == null ? void 0 : e.split("variant");
177
- return ((n == null ? void 0 : n.reduce((o, u) => {
181
+ return ((n == null ? void 0 : n.reduce((r, u) => {
178
182
  if (u && u.length > 0) {
179
- const l = `variant${u.split("/")[0]}`, a = u.split("/")[1], c = t.find(
180
- ({ _id: g }) => g === l
183
+ const c = `variant${u.split("/")[0]}`, a = u.split("/")[1], l = t.find(
184
+ ({ _id: g }) => g === c
181
185
  ).options.find(({ _id: g }) => g === a);
182
- o.push(((c == null ? void 0 : c.name) || "").trim());
186
+ r.push(((l == null ? void 0 : l.name) || "").trim());
183
187
  }
184
- return o;
188
+ return r;
185
189
  }, [])) || []).join(" / ");
186
190
  }
187
191
  const q = /* @__PURE__ */ new Map();
@@ -190,7 +194,7 @@ async function Kt(e, t) {
190
194
  if (q.has(n))
191
195
  return q.get(n);
192
196
  const s = await ue(
193
- nt,
197
+ rt,
194
198
  JSON.stringify({
195
199
  menu: e,
196
200
  itemId: t
@@ -199,7 +203,7 @@ async function Kt(e, t) {
199
203
  return q.set(n, s), s;
200
204
  }
201
205
  async function ce(e, t, n) {
202
- return await ue(rt, {
206
+ return await ue(ot, {
203
207
  menu: e,
204
208
  catalogId: t,
205
209
  schedulerId: n
@@ -210,34 +214,34 @@ async function it(e, t, n) {
210
214
  const s = `${e._id}-${e.updatedAt}-${t || "null"}-${n || "null"}`;
211
215
  if (z.has(s))
212
216
  return z.get(s);
213
- const o = await ce(e, t, n);
214
- return z.set(s, o), o;
217
+ const r = await ce(e, t, n);
218
+ return z.set(s, r), r;
215
219
  }
216
220
  async function Pt(e, t, n) {
217
- var l, a;
218
- const s = await it(e, t, null), o = [], u = (d, c) => {
221
+ var c, a;
222
+ const s = await it(e, t, null), r = [], u = (d, l) => {
219
223
  const g = C(d);
220
- for (const y in c)
221
- c[y] && (g[y] = c[y]);
224
+ for (const y in l)
225
+ l[y] && (g[y] = l[y]);
222
226
  return g;
223
227
  };
224
228
  for (const d of s.modules.group) {
225
- const c = (l = d.items) == null ? void 0 : l.find((y) => y._id === n && !y.combinationKey), g = e.modules.item.find((y) => y._id === n);
226
- if (c) {
227
- const y = (a = d.items) == null ? void 0 : a.filter((v) => v._id === n && v.combinationKey), f = [c, ...y].map((v) => {
229
+ const l = (c = d.items) == null ? void 0 : c.find((y) => y._id === n && !y.combinationKey), g = e.modules.item.find((y) => y._id === n);
230
+ if (l) {
231
+ const y = (a = d.items) == null ? void 0 : a.filter((v) => v._id === n && v.combinationKey), f = [l, ...y].map((v) => {
228
232
  var M, I;
229
- const h = v.combinationKey ? (I = (M = g == null ? void 0 : g.variant) == null ? void 0 : M.variantCombinations) == null ? void 0 : I.find(
233
+ const p = v.combinationKey ? (I = (M = g == null ? void 0 : g.variant) == null ? void 0 : M.variantCombinations) == null ? void 0 : I.find(
230
234
  (k) => k.combinationKey === v.combinationKey
231
- ) : g, b = h && g ? u(g, h) : v;
235
+ ) : g, b = p && g ? u(g, p) : v;
232
236
  return u(b, v);
233
237
  });
234
- o.push({
238
+ r.push({
235
239
  group: d,
236
240
  items: f
237
241
  });
238
242
  }
239
243
  }
240
- return o;
244
+ return r;
241
245
  }
242
246
  const w = 0, K = 3;
243
247
  function ct(e) {
@@ -284,81 +288,81 @@ function P(e, t) {
284
288
  if (E(e) && E(t)) {
285
289
  const n = Object.keys(e), s = Object.keys(t);
286
290
  if (n.length !== s.length) return !1;
287
- for (const o of n)
288
- if (!Object.prototype.hasOwnProperty.call(t, o) || !P(e[o], t[o])) return !1;
291
+ for (const r of n)
292
+ if (!Object.prototype.hasOwnProperty.call(t, r) || !P(e[r], t[r])) return !1;
289
293
  return !0;
290
294
  }
291
295
  return !1;
292
296
  }
293
297
  function lt(e, t, n) {
294
- const s = e.length, o = t.length, u = /* @__PURE__ */ new Map();
295
- for (let d = 0; d < o; d++) {
296
- const c = n ? n(t[d]) : JSON.stringify(t[d]);
297
- u.has(c) || u.set(c, []), u.get(c).push(d);
298
+ const s = e.length, r = t.length, u = /* @__PURE__ */ new Map();
299
+ for (let d = 0; d < r; d++) {
300
+ const l = n ? n(t[d]) : JSON.stringify(t[d]);
301
+ u.has(l) || u.set(l, []), u.get(l).push(d);
298
302
  }
299
- const l = [], a = /* @__PURE__ */ new Set();
303
+ const c = [], a = /* @__PURE__ */ new Set();
300
304
  for (let d = 0; d < s; d++) {
301
- const c = e[d], g = n ? n(c) : JSON.stringify(c), y = u.get(g);
305
+ const l = e[d], g = n ? n(l) : JSON.stringify(l), y = u.get(g);
302
306
  if (y) {
303
307
  for (const f of y)
304
- if (!a.has(f) && P(c, t[f])) {
305
- l.push({ leftIndex: d, rightIndex: f }), a.add(f);
308
+ if (!a.has(f) && P(l, t[f])) {
309
+ c.push({ leftIndex: d, rightIndex: f }), a.add(f);
306
310
  break;
307
311
  }
308
312
  }
309
313
  }
310
- return l;
314
+ return c;
311
315
  }
312
316
  function dt(e, t, n) {
313
317
  var f, v;
314
318
  if (P(e, t)) return;
315
- const s = { _t: "a" }, o = ((f = n == null ? void 0 : n.arrays) == null ? void 0 : f.detectMove) !== !1, u = ((v = n == null ? void 0 : n.arrays) == null ? void 0 : v.includeValueOnMove) === !0, l = n == null ? void 0 : n.objectHash;
316
- let a = o ? lt(e, t, l) : [];
317
- if (!l && e.length === t.length && e.length > 0 && a.length < e.length) {
318
- const h = E(e[0]) || Array.isArray(e[0]), b = a.length > 0;
319
- if (h || b) {
319
+ const s = { _t: "a" }, r = ((f = n == null ? void 0 : n.arrays) == null ? void 0 : f.detectMove) !== !1, u = ((v = n == null ? void 0 : n.arrays) == null ? void 0 : v.includeValueOnMove) === !0, c = n == null ? void 0 : n.objectHash;
320
+ let a = r ? lt(e, t, c) : [];
321
+ if (!c && e.length === t.length && e.length > 0 && a.length < e.length) {
322
+ const p = E(e[0]) || Array.isArray(e[0]), b = a.length > 0;
323
+ if (p || b) {
320
324
  a = [];
321
325
  for (let M = 0; M < e.length; M++)
322
326
  a.push({ leftIndex: M, rightIndex: M });
323
327
  }
324
328
  }
325
- new Set(a.map((h) => h.leftIndex));
326
- const d = new Set(a.map((h) => h.rightIndex)), c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
327
- for (const h of a)
328
- c.set(h.leftIndex, h.rightIndex), g.set(h.rightIndex, h.leftIndex);
329
- for (let h = 0; h < e.length; h++) {
330
- const b = c.get(h);
329
+ new Set(a.map((p) => p.leftIndex));
330
+ const d = new Set(a.map((p) => p.rightIndex)), l = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
331
+ for (const p of a)
332
+ l.set(p.leftIndex, p.rightIndex), g.set(p.rightIndex, p.leftIndex);
333
+ for (let p = 0; p < e.length; p++) {
334
+ const b = l.get(p);
331
335
  if (b !== void 0) {
332
- const M = J(e[h], t[b], n);
333
- if (M !== void 0 && (s[b] = M), o && b !== h) {
334
- const I = `_${h}`, k = u ? [e[h], b, K] : ["", b, K];
336
+ const M = J(e[p], t[b], n);
337
+ if (M !== void 0 && (s[b] = M), r && b !== p) {
338
+ const I = `_${p}`, k = u ? [e[p], b, K] : ["", b, K];
335
339
  s[I] = k;
336
340
  }
337
341
  } else {
338
- const M = `_${h}`;
339
- s[M] = [e[h], w, w];
342
+ const M = `_${p}`;
343
+ s[M] = [e[p], w, w];
340
344
  }
341
345
  }
342
- for (let h = 0; h < t.length; h++)
343
- d.has(h) || (s[h] = [t[h]]);
346
+ for (let p = 0; p < t.length; p++)
347
+ d.has(p) || (s[p] = [t[p]]);
344
348
  const y = Object.keys(s);
345
349
  if (!(y.length === 1 && y[0] === "_t"))
346
350
  return s;
347
351
  }
348
352
  function mt(e, t, n) {
349
353
  if (P(e, t)) return;
350
- const s = {}, o = Object.keys(e), u = Object.keys(t), l = /* @__PURE__ */ new Set([...o, ...u]);
351
- for (const a of l) {
354
+ const s = {}, r = Object.keys(e), u = Object.keys(t), c = /* @__PURE__ */ new Set([...r, ...u]);
355
+ for (const a of c) {
352
356
  if (n != null && n.propertyFilter && !n.propertyFilter(a, { left: e, right: t }))
353
357
  continue;
354
- const d = Object.prototype.hasOwnProperty.call(e, a), c = Object.prototype.hasOwnProperty.call(t, a);
355
- if (d && c) {
358
+ const d = Object.prototype.hasOwnProperty.call(e, a), l = Object.prototype.hasOwnProperty.call(t, a);
359
+ if (d && l) {
356
360
  const g = J(e[a], t[a], n);
357
361
  g !== void 0 && (s[a] = g);
358
- } else if (d && !c) {
362
+ } else if (d && !l) {
359
363
  const g = n != null && n.omitRemovedValues ? 0 : e[a];
360
364
  s[a] = [g, w, w];
361
- } else !d && c && (s[a] = [t[a]]);
365
+ } else !d && l && (s[a] = [t[a]]);
362
366
  }
363
367
  return Object.keys(s).length > 0 ? s : void 0;
364
368
  }
@@ -376,43 +380,43 @@ function J(e, t, n) {
376
380
  return dt(e, t, n);
377
381
  if (E(e) && E(t))
378
382
  return mt(e, t, n);
379
- const u = n != null && n.cloneDiffValues ? O(e) : e, l = n != null && n.cloneDiffValues ? O(t) : t;
380
- return [$(u), $(l)];
383
+ const u = n != null && n.cloneDiffValues ? O(e) : e, c = n != null && n.cloneDiffValues ? O(t) : t;
384
+ return [$(u), $(c)];
381
385
  }
382
386
  function ft(e, t, n) {
383
387
  return J(e, t, n);
384
388
  }
385
389
  function vt(e, t, n) {
386
- const s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
390
+ const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
387
391
  for (const a in t) {
388
392
  if (a === "_t" || !a.startsWith("_")) continue;
389
- const d = parseInt(a.slice(1)), c = t[a];
390
- Array.isArray(c) && (c.length === 3 && c[2] === w ? s.add(d) : c.length === 3 && c[2] === K && o.set(d, c[1]));
393
+ const d = parseInt(a.slice(1)), l = t[a];
394
+ Array.isArray(l) && (l.length === 3 && l[2] === w ? s.add(d) : l.length === 3 && l[2] === K && r.set(d, l[1]));
391
395
  }
392
396
  const u = [];
393
- let l = 0;
397
+ let c = 0;
394
398
  for (let a = 0; ; a++) {
395
- const d = a.toString(), c = t[d];
396
- if (c !== void 0)
397
- if (Array.isArray(c) && c.length === 1)
398
- u.push(c[0]);
399
+ const d = a.toString(), l = t[d];
400
+ if (l !== void 0)
401
+ if (Array.isArray(l) && l.length === 1)
402
+ u.push(l[0]);
399
403
  else {
400
- for (; l < e.length && s.has(l); )
401
- l++;
402
- l < e.length && (u.push(Y(e[l], c)), l++);
404
+ for (; c < e.length && s.has(c); )
405
+ c++;
406
+ c < e.length && (u.push(Y(e[c], l)), c++);
403
407
  }
404
408
  else {
405
409
  let g = !1;
406
- for (const [y, f] of o.entries())
410
+ for (const [y, f] of r.entries())
407
411
  if (f === a) {
408
412
  u.push(e[y]), g = !0;
409
413
  break;
410
414
  }
411
415
  if (!g) {
412
- for (; l < e.length && (s.has(l) || o.has(l)); )
413
- l++;
414
- if (l < e.length)
415
- u.push(e[l]), l++;
416
+ for (; c < e.length && (s.has(c) || r.has(c)); )
417
+ c++;
418
+ if (c < e.length)
419
+ u.push(e[c]), c++;
416
420
  else
417
421
  break;
418
422
  }
@@ -422,9 +426,9 @@ function vt(e, t, n) {
422
426
  }
423
427
  function yt(e, t, n) {
424
428
  const s = { ...e };
425
- for (const o in t) {
426
- const u = t[o];
427
- Array.isArray(u) ? u.length === 1 ? s[o] = u[0] : u.length === 3 && u[2] === w ? delete s[o] : u.length === 2 && (s[o] = u[1]) : s[o] = Y(s[o], u);
429
+ for (const r in t) {
430
+ const u = t[r];
431
+ Array.isArray(u) ? u.length === 1 ? s[r] = u[0] : u.length === 3 && u[2] === w ? delete s[r] : u.length === 2 && (s[r] = u[1]) : s[r] = Y(s[r], u);
428
432
  }
429
433
  return s;
430
434
  }
@@ -448,35 +452,35 @@ function gt(e) {
448
452
  for (const n in e)
449
453
  if (n !== "_t")
450
454
  if (n.startsWith("_")) {
451
- const s = parseInt(n.slice(1)), o = e[n];
452
- if (Array.isArray(o)) {
453
- if (o.length === 3 && o[2] === w)
454
- t[s] = [o[0]];
455
- else if (o.length === 3 && o[2] === K) {
456
- const u = o[1];
457
- t[`_${u}`] = [o[0], s, K];
455
+ const s = parseInt(n.slice(1)), r = e[n];
456
+ if (Array.isArray(r)) {
457
+ if (r.length === 3 && r[2] === w)
458
+ t[s] = [r[0]];
459
+ else if (r.length === 3 && r[2] === K) {
460
+ const u = r[1];
461
+ t[`_${u}`] = [r[0], s, K];
458
462
  }
459
463
  }
460
464
  } else {
461
- const s = parseInt(n), o = e[n];
462
- if (Array.isArray(o) && o.length === 1)
463
- t[`_${s}`] = [o[0], w, w];
465
+ const s = parseInt(n), r = e[n];
466
+ if (Array.isArray(r) && r.length === 1)
467
+ t[`_${s}`] = [r[0], w, w];
464
468
  else {
465
- const u = Q(o);
469
+ const u = Q(r);
466
470
  u !== void 0 && (t[n] = u);
467
471
  }
468
472
  }
469
473
  return t;
470
474
  }
471
- function ht(e) {
475
+ function pt(e) {
472
476
  const t = {};
473
477
  for (const n in e) {
474
478
  const s = e[n];
475
479
  if (Array.isArray(s))
476
480
  s.length === 1 ? t[n] = [s[0], w, w] : s.length === 3 && s[2] === w ? t[n] = [s[0]] : s.length === 2 && (t[n] = [s[1], s[0]]);
477
481
  else {
478
- const o = Q(s);
479
- o !== void 0 && (t[n] = o);
482
+ const r = Q(s);
483
+ r !== void 0 && (t[n] = r);
480
484
  }
481
485
  }
482
486
  return t;
@@ -493,13 +497,13 @@ function Q(e) {
493
497
  if (e.length === 3 && e[2] === K)
494
498
  return e;
495
499
  }
496
- return E(e) && e._t === "a" ? gt(e) : E(e) ? ht(e) : e;
500
+ return E(e) && e._t === "a" ? gt(e) : E(e) ? pt(e) : e;
497
501
  }
498
502
  }
499
503
  function de(e) {
500
504
  return Q(e);
501
505
  }
502
- function pt(e, t, n) {
506
+ function ht(e, t, n) {
503
507
  const s = de(t);
504
508
  return le(e, s);
505
509
  }
@@ -518,7 +522,7 @@ class _t {
518
522
  return de(t);
519
523
  }
520
524
  unpatch(t, n) {
521
- return pt(t, n, this.options);
525
+ return ht(t, n, this.options);
522
526
  }
523
527
  clone(t) {
524
528
  return O(t);
@@ -537,48 +541,48 @@ function bt({
537
541
  includeValueOnMove: !1
538
542
  },
539
543
  cloneDiffValues: !1
540
- }), n = N(null), s = N([]), o = B(-1), u = N(null), l = S(() => o.value > 0), a = S(() => o.value < s.value.length - 1);
544
+ }), n = j(null), s = j([]), r = H(-1), u = j(null), c = S(() => r.value > 0), a = S(() => r.value < s.value.length - 1);
541
545
  function d(v) {
542
546
  if (n.value === null) {
543
- n.value = C(v), u.value = C(v), s.value = [{ delta: null }], o.value = 0;
547
+ n.value = C(v), u.value = C(v), s.value = [{ delta: null }], r.value = 0;
544
548
  return;
545
549
  }
546
- const h = t.diff(u.value, v);
547
- if (o.value < s.value.length - 1 && (s.value = s.value.slice(0, o.value + 1)), s.value.push({ delta: h }), o.value++, u.value = C(v), s.value.length > e) {
550
+ const p = t.diff(u.value, v);
551
+ if (r.value < s.value.length - 1 && (s.value = s.value.slice(0, r.value + 1)), s.value.push({ delta: p }), r.value++, u.value = C(v), s.value.length > e) {
548
552
  const b = s.value[1].delta;
549
- b && n.value && (n.value = t.patch(C(n.value), b)), s.value.shift(), o.value--;
553
+ b && n.value && (n.value = t.patch(C(n.value), b)), s.value.shift(), r.value--;
550
554
  }
551
555
  }
552
- function c(v) {
556
+ function l(v) {
553
557
  if (!n.value || v < 0 || v >= s.value.length)
554
558
  return;
555
- let h = C(n.value);
559
+ let p = C(n.value);
556
560
  for (let b = 1; b <= v; b++) {
557
561
  const M = s.value[b];
558
- M.delta && (h = t.patch(h, M.delta));
562
+ M.delta && (p = t.patch(p, M.delta));
559
563
  }
560
- return h;
564
+ return p;
561
565
  }
562
566
  function g() {
563
- if (l.value) {
564
- o.value--;
565
- const v = c(o.value);
567
+ if (c.value) {
568
+ r.value--;
569
+ const v = l(r.value);
566
570
  return v && (u.value = C(v)), v;
567
571
  }
568
572
  }
569
573
  function y() {
570
574
  if (a.value) {
571
- o.value++;
572
- const v = c(o.value);
575
+ r.value++;
576
+ const v = l(r.value);
573
577
  return v && (u.value = C(v)), v;
574
578
  }
575
579
  }
576
580
  function f() {
577
- n.value = null, u.value = null, s.value = [], o.value = -1;
581
+ n.value = null, u.value = null, s.value = [], r.value = -1;
578
582
  }
579
583
  return {
580
584
  push: d,
581
- canUndo: l,
585
+ canUndo: c,
582
586
  canRedo: a,
583
587
  undo: g,
584
588
  redo: y,
@@ -587,7 +591,7 @@ function bt({
587
591
  }
588
592
  const Mt = {
589
593
  async updateMenuModule(e, t) {
590
- const n = H.RequestRunner.operation(t, e.modules);
594
+ const n = B.RequestRunner.operation(t, e.modules);
591
595
  if (n.validateError.length > 0)
592
596
  throw new Error(n.validateError.join(`
593
597
  `));
@@ -640,68 +644,68 @@ const $t = qe(
640
644
  () => {
641
645
  const e = ze(wt()), t = se(), n = tt(), s = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
642
646
  selector: "position"
643
- }) : []), o = S(() => {
644
- var r;
645
- return ((r = t.currentBusiness.value) == null ? void 0 : r.menuVersion) || W.F_MENU_VERSION.v3;
646
- }), u = S(() => o.value === W.F_MENU_VERSION.v4), l = S(() => {
647
- const r = e.menu.modules.catalog;
648
- return x(r, { selector: "name" });
647
+ }) : []), r = S(() => {
648
+ var o;
649
+ return ((o = t.currentBusiness.value) == null ? void 0 : o.menuVersion) || W.F_MENU_VERSION.v3;
650
+ }), u = S(() => r.value === W.F_MENU_VERSION.v4), c = S(() => {
651
+ const o = e.menu.modules.catalog;
652
+ return x(o, { selector: "name" });
649
653
  }), a = S(() => {
650
654
  var i;
651
- let r = e.menu.modules.catalog.find(
655
+ let o = e.menu.modules.catalog.find(
652
656
  (m) => m._id === e.currentCatalogId
653
657
  );
654
- return r && ((i = r.linkItemRules) != null && i.length) && (r = T.populateCatalog({
655
- catalog: r,
658
+ return o && ((i = o.linkItemRules) != null && i.length) && (o = T.populateCatalog({
659
+ catalog: o,
656
660
  ruleGroupSettings: e.menu.ruleGroupSettings,
657
661
  items: e.menu.modules.item,
658
662
  ...e.currentRestaurantAttrParams ?? {}
659
- })), r;
660
- }), d = S(() => x(y.value.modules.scheduler, { selector: "name" })), c = S(() => e.menu.modules.scheduler.find(
661
- (r) => r._id === e.currentSchedulerId
663
+ })), o;
664
+ }), d = S(() => x(y.value.modules.scheduler, { selector: "name" })), l = S(() => e.menu.modules.scheduler.find(
665
+ (o) => o._id === e.currentSchedulerId
662
666
  ));
663
- function g(r, i = !0) {
664
- e.menu = { ...r, _rev: e.menu._rev }, i && V.push(e.menu);
667
+ function g(o, i = !0) {
668
+ e.menu = { ...o, _rev: e.menu._rev }, i && D.push(e.menu);
665
669
  }
666
- const y = N(me()), f = B(!1), v = B(1);
667
- async function h() {
670
+ const y = j(me()), f = H(!1), v = H(1);
671
+ async function p() {
668
672
  var m;
669
673
  f.value = !0;
670
- let r = e.menu.modules.catalog;
674
+ let o = e.menu.modules.catalog;
671
675
  if (a.value && ((m = a.value.linkItemRules) != null && m.length)) {
672
- const p = T.populateCatalog({
676
+ const h = T.populateCatalog({
673
677
  catalog: a.value,
674
678
  ruleGroupSettings: e.menu.ruleGroupSettings,
675
679
  items: e.menu.modules.item,
676
680
  ...e.currentRestaurantAttrParams ?? {}
677
681
  });
678
- r = e.menu.modules.catalog.map((_) => _._id === (p == null ? void 0 : p._id) ? p : _);
682
+ o = e.menu.modules.catalog.map((_) => _._id === (h == null ? void 0 : h._id) ? h : _);
679
683
  }
680
684
  const i = await ce(
681
685
  {
682
686
  ...e.menu,
683
687
  modules: {
684
688
  ...e.menu.modules,
685
- catalog: r
689
+ catalog: o
686
690
  }
687
691
  },
688
692
  e.currentCatalogId,
689
693
  e.currentSchedulerId
690
694
  );
691
695
  if (e.currentSchedulerId != null) {
692
- const p = e.menu.modules.catalog.find(
696
+ const h = e.menu.modules.catalog.find(
693
697
  (R) => R._id === e.currentCatalogId
694
- ), _ = p ? p.override.scheduler[e.currentSchedulerId] : e.menu.modules.scheduler.find(
698
+ ), _ = h ? h.override.scheduler[e.currentSchedulerId] : e.menu.modules.scheduler.find(
695
699
  (R) => R._id === e.currentSchedulerId
696
700
  ), A = new Set(((_ == null ? void 0 : _.items) || []).map((R) => R._id));
697
701
  i.modules.item = i.modules.item.filter((R) => A.has(R._id));
698
702
  }
699
703
  return y.value = i, f.value = !1, v.value = v.value + 1, i;
700
704
  }
701
- const M = ae.debounce(h, 200);
705
+ const M = ae.debounce(p, 200);
702
706
  let I = null, k = null;
703
707
  function X() {
704
- k && (k(), k = null), I && I.stop(), I = Be(!0), k = I.run(() => He(
708
+ k && (k(), k = null), I && I.stop(), I = He(!0), k = I.run(() => Be(
705
709
  () => [e.menu, e.currentCatalogId, e.currentSchedulerId],
706
710
  () => {
707
711
  f.value || M();
@@ -714,12 +718,12 @@ const $t = qe(
714
718
  label: "Main",
715
719
  value: null
716
720
  },
717
- ...l.value.map((r) => ({
718
- label: r.name,
719
- value: r._id
721
+ ...c.value.map((o) => ({
722
+ label: o.name,
723
+ value: o._id
720
724
  }))
721
725
  ]), Z = S(() => {
722
- const r = y.value.modules.category;
726
+ const o = y.value.modules.category;
723
727
  return [
724
728
  ...U.value.item.addon ? [
725
729
  {
@@ -728,36 +732,36 @@ const $t = qe(
728
732
  position: 0
729
733
  }
730
734
  ] : [],
731
- ...D(r, (i) => i.name)
735
+ ...V(o, (i) => i.name)
732
736
  ];
733
737
  }), ve = S(() => {
734
- const r = y.value.modules.subCategory || [];
735
- return D(r, (i) => i.name);
738
+ const o = y.value.modules.subCategory || [];
739
+ return V(o, (i) => i.name);
736
740
  }), ee = S(() => {
737
741
  var i;
738
- let r = y.value.modules.item;
742
+ let o = y.value.modules.item;
739
743
  if (a.value) {
740
744
  const m = (i = a.value) == null ? void 0 : i.override.items;
741
- r = r.filter((p) => {
745
+ o = o.filter((h) => {
742
746
  var A;
743
- const _ = (A = m == null ? void 0 : m[p._id]) == null ? void 0 : A.find(
747
+ const _ = (A = m == null ? void 0 : m[h._id]) == null ? void 0 : A.find(
744
748
  (R) => !R.combinationKey
745
749
  );
746
750
  return (_ == null ? void 0 : _.orderFrom) !== ie.enum.NONE;
747
751
  });
748
752
  }
749
- return D(r, (m) => m.code || m.name);
753
+ return V(o, (m) => m.code || m.name);
750
754
  }), ye = S(() => {
751
- const r = e.menu.modules.category, i = D(r, (p) => p.name).reduce(
752
- (p, _, A) => (p[_._id] = A, p),
755
+ const o = e.menu.modules.category, i = V(o, (h) => h.name).reduce(
756
+ (h, _, A) => (h[_._id] = A, h),
753
757
  { "": 0 }
754
758
  ), m = e.menu.modules.item;
755
- return D(
759
+ return V(
756
760
  m,
757
- (p) => p.code || p.name
758
- ).reduce((p, _, A) => (p[_._id] = A + i[_.category || ""], p), {});
759
- }), ge = S(() => oe(j.value, Z.value, ee.value)), he = S(() => {
760
- const r = U.value.item.addon ? [
761
+ (h) => h.code || h.name
762
+ ).reduce((h, _, A) => (h[_._id] = A + i[_.category || ""], h), {});
763
+ }), ge = S(() => oe(N.value, Z.value, ee.value)), pe = S(() => {
764
+ const o = U.value.item.addon ? [
761
765
  {
762
766
  _id: e.currentCatalogId ? "" : null,
763
767
  name: "Addon",
@@ -767,85 +771,85 @@ const $t = qe(
767
771
  ] : e.menu.modules.category;
768
772
  return oe(
769
773
  e.menu.modules.variant,
770
- r,
774
+ o,
771
775
  e.menu.modules.item
772
776
  );
773
- }), j = S(() => {
774
- const r = y.value.modules.variant;
775
- return x(r, { selector: "name" });
777
+ }), N = S(() => {
778
+ const o = y.value.modules.variant;
779
+ return x(o, { selector: "name" });
776
780
  });
777
- function pe(r = []) {
778
- const i = r.map((p) => j.value.find((_) => _._id === p)).filter((p) => !!p);
779
- return T.fullVariantCombination(i).reduce((p, _) => (p[_.combinationKey] = _.selectionName.join(" / "), p), {});
781
+ function he(o = []) {
782
+ const i = o.map((h) => N.value.find((_) => _._id === h)).filter((h) => !!h);
783
+ return T.fullVariantCombination(i).reduce((h, _) => (h[_.combinationKey] = _.selectionName.join(" / "), h), {});
780
784
  }
781
- const _e = S(() => D(y.value.modules.group, (r) => r.name)), Se = S(() => x(y.value.modules.takeaway, { selector: "name" })), be = S(() => x(e.menu.modules.printDepartment || [], {
785
+ const _e = S(() => V(y.value.modules.group, (o) => o.name)), Se = S(() => x(y.value.modules.takeaway, { selector: "name" })), be = S(() => x(e.menu.modules.printDepartment || [], {
782
786
  selector: "name"
783
787
  })), Me = S(() => x(e.menu.modules.unit, { selector: "name" })), we = S(() => x(Ge(e.menu.modules.recipe, e.menu.modules.sku), {
784
788
  selector: "name"
785
789
  })), Ae = S(() => e.menu.modules.cookingGuide), Ce = S(() => {
786
- const r = Je(e.menu.modules.sku);
787
- return x(r, { selector: "code" });
790
+ const o = Je(e.menu.modules.sku);
791
+ return x(o, { selector: "code" });
788
792
  }), Ie = S(() => {
789
- const r = /* @__PURE__ */ new Map();
793
+ const o = /* @__PURE__ */ new Map();
790
794
  return e.menu.modules.item.forEach((i) => {
791
- var m, p;
792
- i.code && r.set(i.code, (r.get(i.code) || 0) + 1), (p = (m = i.variant) == null ? void 0 : m.variantCombinations) == null || p.forEach((_) => {
793
- _.code && r.set(_.code, (r.get(_.code) || 0) + 1);
795
+ var m, h;
796
+ i.code && o.set(i.code, (o.get(i.code) || 0) + 1), (h = (m = i.variant) == null ? void 0 : m.variantCombinations) == null || h.forEach((_) => {
797
+ _.code && o.set(_.code, (o.get(_.code) || 0) + 1);
794
798
  });
795
- }), r;
799
+ }), o;
796
800
  }), U = S(() => {
797
- const r = !e.currentCatalogId, i = o.value === W.F_MENU_VERSION.v4, m = !e.currentSchedulerId, p = {
798
- create: r && m,
799
- edit: r && m,
800
- delete: r && m
801
+ const o = !e.currentCatalogId, i = r.value === W.F_MENU_VERSION.v4, m = !e.currentSchedulerId, h = {
802
+ create: o && m,
803
+ edit: o && m,
804
+ delete: o && m
801
805
  };
802
806
  return {
803
807
  item: {
804
- ...p,
808
+ ...h,
805
809
  edit: i || m,
806
- sort: i && r && m,
810
+ sort: i && o && m,
807
811
  addon: i,
808
812
  code: m,
809
- name: r && m,
810
- description: r && m,
813
+ name: o && m,
814
+ description: o && m,
811
815
  category: m,
812
- thumbnail: r && m,
813
- images: r && m,
814
- orderFrom: (i || r) && m,
815
- orderFromNone: r,
816
+ thumbnail: o && m,
817
+ images: o && m,
818
+ orderFrom: (i || o) && m,
819
+ orderFromNone: o,
816
820
  orderFromActiveOnly: !i,
817
- openPrice: r && m,
818
- unit: r && m,
819
- price: r,
820
- editPrice: r,
821
+ openPrice: o && m,
822
+ unit: o && m,
823
+ price: o,
824
+ editPrice: o,
821
825
  minPrice: i && m,
822
- costing: i && r && m,
823
- tax: r && m,
824
- variant: r && m,
826
+ costing: i && o && m,
827
+ tax: o && m,
828
+ variant: o && m,
825
829
  maxVariant: i ? 4 : 2,
826
- group: r && m,
830
+ group: o && m,
827
831
  overrideProductGroup: i && m,
828
- inventory: (i || r) && m,
832
+ inventory: (i || o) && m,
829
833
  bindToVariant: i,
830
- print: r && m,
834
+ print: o && m,
831
835
  toRoot: i && m,
832
- takeaway: (_) => !!_ && (i || r) && m,
833
- serveDelay: i && r && m,
836
+ takeaway: (_) => !!_ && (i || o) && m,
837
+ serveDelay: i && o && m,
834
838
  multiScheduler: i,
835
839
  canRearrange: i,
836
840
  printConfig: i,
837
841
  takeawayConfig: i
838
842
  },
839
843
  category: {
840
- ...p,
841
- sort: r,
844
+ ...h,
845
+ sort: o,
842
846
  overrideSequence: i
843
847
  },
844
848
  group: {
845
- ...p,
849
+ ...h,
846
850
  edit: i || m,
847
- sort: r,
848
- applyProduct: r,
851
+ sort: o,
852
+ applyProduct: o,
849
853
  showAppliedProduct: m,
850
854
  type: !i,
851
855
  insertRawItems: !i,
@@ -856,32 +860,32 @@ const $t = qe(
856
860
  override: i
857
861
  },
858
862
  takeaway: {
859
- ...p,
860
- edit: (i || r) && m,
861
- name: r
863
+ ...h,
864
+ edit: (i || o) && m,
865
+ name: o
862
866
  },
863
867
  catalog: {
864
- name: !r,
868
+ name: !o,
865
869
  defaultOrderFrom: i,
866
870
  markup: i
867
871
  }
868
872
  };
869
873
  });
870
- function L(r) {
871
- return `${r.systemCode}/${r.taxCode}`;
874
+ function L(o) {
875
+ return `${o.systemCode}/${o.taxCode}`;
872
876
  }
873
- function ke(r) {
874
- const [i, m] = r.split("/");
877
+ function ke(o) {
878
+ const [i, m] = o.split("/");
875
879
  return { systemCode: i, taxCode: m };
876
880
  }
877
- function Ee(r, i, m) {
878
- return (r ?? i ?? []).map((p) => L(p)).find((p) => m.some((_) => _.value === p));
881
+ function Ee(o, i, m) {
882
+ return (o ?? i ?? []).map((h) => L(h)).find((h) => m.some((_) => _.value === h));
879
883
  }
880
884
  const Re = S(() => {
881
- var p;
882
- const r = ["SV5", "SV10"], i = Ye.Country.getCountryFlattenTaxes(
885
+ var h;
886
+ const o = ["SV5", "SV10"], i = Ye.Country.getCountryFlattenTaxes(
883
887
  se().currentCountry.value
884
- ), m = i.filter((_) => u.value || !r.includes(_.taxCode)).map((_) => ({
888
+ ), m = i.filter((_) => u.value || !o.includes(_.taxCode)).map((_) => ({
885
889
  label: `${_.name} (${Qe(_.rate)}%)`,
886
890
  value: L(_),
887
891
  meta: {
@@ -889,47 +893,47 @@ const $t = qe(
889
893
  }
890
894
  }));
891
895
  return m.sort((_, A) => _.label.localeCompare(A.label, void 0, { numeric: !0 })), {
892
- systemCode: (p = i[0]) == null ? void 0 : p.systemCode,
896
+ systemCode: (h = i[0]) == null ? void 0 : h.systemCode,
893
897
  countryTaxOptions: m
894
898
  };
895
899
  }), xe = async () => {
896
- const r = await et.readMenu();
897
- e.menu = r ?? e.menu, te(null);
900
+ const o = await et.readMenu();
901
+ e.menu = o ?? e.menu, te(null);
898
902
  }, Oe = async () => {
899
903
  if (t.isRestaurantLevelMenu.value) {
900
904
  e.restaurants = [];
901
905
  return;
902
906
  }
903
- const { fetchAllRestaurants: r } = Ze();
904
- await r({
907
+ const { fetchAllRestaurants: o } = Ze();
908
+ await o({
905
909
  onBatchEnd: (i) => {
906
910
  e.restaurants = i;
907
911
  }
908
912
  });
909
- }, te = (r) => {
910
- e.currentCatalogId = r;
911
- }, Ve = (r) => {
912
- e.currentSchedulerId = r;
913
- }, De = (r) => {
914
- e.currentCategoryIds = r;
915
- }, Te = (r) => {
916
- e.currentRestaurantAttrParams = r;
917
- }, Ke = async (r, i) => {
918
- const m = Array.isArray(r) ? r : [r];
913
+ }, te = (o) => {
914
+ e.currentCatalogId = o;
915
+ }, De = (o) => {
916
+ e.currentSchedulerId = o;
917
+ }, Ve = (o) => {
918
+ e.currentCategoryIds = o;
919
+ }, Te = (o) => {
920
+ e.currentRestaurantAttrParams = o;
921
+ }, Ke = async (o, i) => {
922
+ const m = Array.isArray(o) ? o : [o];
919
923
  if (!m.length) return;
920
- const p = m.map((_) => ({
924
+ const h = m.map((_) => ({
921
925
  ..._,
922
926
  _id: e.menu._id,
923
927
  _rev: e.menu._rev
924
928
  }));
925
929
  try {
926
- if (i || p.some(
927
- (A) => [H.F_OPERATION_TYPE.delete, H.F_OPERATION_TYPE.deleteMany].includes(A.operation)
930
+ if (i || h.some(
931
+ (A) => [B.F_OPERATION_TYPE.delete, B.F_OPERATION_TYPE.deleteMany].includes(A.operation)
928
932
  )) {
929
- const A = await Xe(p, e.menu.modules);
933
+ const A = await Xe(h, e.menu.modules);
930
934
  if (A !== !0) throw new Error(A);
931
935
  }
932
- const _ = await Mt.updateMenuModule(e.menu, p);
936
+ const _ = await Mt.updateMenuModule(e.menu, h);
933
937
  return g(_.menu), _;
934
938
  } catch (_) {
935
939
  n.open({
@@ -938,22 +942,22 @@ const $t = qe(
938
942
  message: _
939
943
  });
940
944
  }
941
- }, Pe = async (r) => {
945
+ }, Pe = async (o) => {
942
946
  const i = {
943
947
  ...e.menu,
944
- masterCatalogSetting: r.masterCatalogSetting,
945
- lowStockThreshold: r.lowStockThreshold,
946
- priceTierSettings: r.priceTierSettings
948
+ masterCatalogSetting: o.masterCatalogSetting,
949
+ lowStockThreshold: o.lowStockThreshold,
950
+ priceTierSettings: o.priceTierSettings
947
951
  };
948
952
  return g(i), i;
949
- }, V = bt({ maxHistorySize: 50 }), $e = S(() => V.canUndo.value), Fe = S(() => V.canRedo.value), Ne = () => {
950
- const r = V.undo();
951
- r && g(r, !1);
952
- }, je = () => {
953
- const r = V.redo();
954
- r && g(r, !1);
953
+ }, D = bt({ maxHistorySize: 50 }), $e = S(() => D.canUndo.value), Fe = S(() => D.canRedo.value), je = () => {
954
+ const o = D.undo();
955
+ o && g(o, !1);
956
+ }, Ne = () => {
957
+ const o = D.redo();
958
+ o && g(o, !1);
955
959
  }, Ue = () => {
956
- V.clear();
960
+ D.clear();
957
961
  };
958
962
  return {
959
963
  state: e,
@@ -963,13 +967,13 @@ const $t = qe(
963
967
  // async computed state
964
968
  mergedMenu: y,
965
969
  // Computed
966
- version: o,
970
+ version: r,
967
971
  isV4: u,
968
972
  serveSequence: s,
969
- catalogs: l,
973
+ catalogs: c,
970
974
  currentCatalog: a,
971
975
  schedulers: d,
972
- currentScheduler: c,
976
+ currentScheduler: l,
973
977
  catalogOptions: fe,
974
978
  categories: Z,
975
979
  subcategories: ve,
@@ -977,8 +981,8 @@ const $t = qe(
977
981
  sortedItems: ye,
978
982
  itemCodeMap: Ie,
979
983
  categorizedItems: ge,
980
- categorizedRawMenuItems: he,
981
- variants: j,
984
+ categorizedRawMenuItems: pe,
985
+ variants: N,
982
986
  groups: _e,
983
987
  takeaways: Se,
984
988
  printDepartments: be,
@@ -993,22 +997,22 @@ const $t = qe(
993
997
  readMenu: xe,
994
998
  readRestaurants: Oe,
995
999
  selectCatalog: te,
996
- selectScheduler: Ve,
997
- selectCategory: De,
1000
+ selectScheduler: De,
1001
+ selectCategory: Ve,
998
1002
  setRestaurantAttrParams: Te,
999
1003
  updateMenu: Ke,
1000
1004
  updateMenuSetting: Pe,
1001
- computeMergedMenu: h,
1005
+ computeMergedMenu: p,
1002
1006
  // helper
1003
1007
  encodeTax: L,
1004
1008
  decodeTax: ke,
1005
1009
  getSelectedTax: Ee,
1006
- mapVariant: pe,
1010
+ mapVariant: he,
1007
1011
  // history
1008
1012
  canUndoHistory: $e,
1009
1013
  canRedoHistory: Fe,
1010
- undoHistory: Ne,
1011
- redoHistory: je,
1014
+ undoHistory: je,
1015
+ redoHistory: Ne,
1012
1016
  // cleanup
1013
1017
  $dispose: () => {
1014
1018
  M.cancel(), k && (k(), k = null), I && (I.stop(), I = null), Ue();
@@ -1023,7 +1027,8 @@ export {
1023
1027
  Kt as a,
1024
1028
  Pt as f,
1025
1029
  Tt as g,
1026
- Dt as m,
1030
+ nt as i,
1031
+ Vt as m,
1027
1032
  it as o,
1028
1033
  $t as u
1029
1034
  };