@feedmepos/mf-menu 0.32.7-beta.2 → 0.32.7-dev

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 (87) hide show
  1. package/dist/{App-BIQ0CTci.js → App-DCkQc7e4.js} +98 -98
  2. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-uzmq3vwy.js +161 -0
  3. package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js +74 -0
  4. package/dist/{Catalog-D2wc24o8.js → Catalog-CUPoRid3.js} +9 -9
  5. package/dist/{Category-DA5-55d2.js → Category-BkvhZ57Y.js} +7 -7
  6. package/dist/{Category-BPufryqK.js → Category-Cdw0ikhP.js} +4 -4
  7. package/dist/{CookingGuide-DKvou40e.js → CookingGuide-BZ-4oULM.js} +6 -6
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DHoAYdGI.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CJvVFWdR.js} +3 -3
  9. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +26 -0
  10. package/dist/{Group-D60oAvmM.js → Group-C1FaXdUb.js} +1 -1
  11. package/dist/{Group-Bgpc6qE1.js → Group-Cec83DWm.js} +4 -4
  12. package/dist/{Group.vue_vue_type_script_setup_true_lang-BXn3--BL.js → Group.vue_vue_type_script_setup_true_lang-2_lLBdX2.js} +128 -128
  13. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BD9IZkwW.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BEDyKWhK.js} +91 -91
  14. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BE3LdBYY.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BteTvMnx.js} +3225 -3225
  15. package/dist/{Ingredient-Brv4hml-.js → Ingredient-DulL8h2B.js} +29 -29
  16. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CIOX-pq1.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DoBx7Dal.js} +104 -104
  17. package/dist/{LinkProductSideSheet-BDMbKJ8o.js → LinkProductSideSheet-Br2eE8pC.js} +251 -251
  18. package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js +69 -0
  19. package/dist/{MenuSetting-DvCu23my.js → MenuSetting-DxW4LCW4.js} +77 -77
  20. package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-vFqWGM6P.js → PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js} +8 -8
  21. package/dist/{PrintRoute-DwgLKDUV.js → PrintRoute-Da6Zkx-0.js} +5 -5
  22. package/dist/{Product-EmoWM778.js → Product-Cs76t18_.js} +1 -1
  23. package/dist/{Product.vue_vue_type_script_setup_true_lang-5HyO_RYw.js → Product.vue_vue_type_script_setup_true_lang-C6SOu4Vv.js} +606 -606
  24. package/dist/{ProductInternalTools-PqzouaF2.js → ProductInternalTools-DPbeRvTM.js} +10 -10
  25. package/dist/{Products-ZgfTT9dI.js → Products--7dGfuuT.js} +52 -52
  26. package/dist/{Publish-CUdRwmN1.js → Publish-COmZtiyX.js} +5 -5
  27. package/dist/{Recipe-BRUxyire.js → Recipe-BaN_1zrP.js} +5 -5
  28. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CPFGkaTr.js → RuleView.vue_vue_type_script_setup_true_lang-DputprQj.js} +451 -448
  29. package/dist/{Scheduler-BXdZh-xC.js → Scheduler-BSUpIAaK.js} +4 -4
  30. package/dist/{ServingSequence-EAZHOHiy.js → ServingSequence-dXBb7e5d.js} +4 -4
  31. package/dist/{Setting-BRut_Xj0.js → Setting-CalEQW0n.js} +6 -6
  32. package/dist/{Subcategory-D6Yrs-vO.js → Subcategory-zPHtX7Vc.js} +5 -5
  33. package/dist/{Takeaway-Bi8JfDWa.js → Takeaway-CRDj2Bpe.js} +5 -5
  34. package/dist/{Takeaway-CRdlNTu7.js → Takeaway-CcnmeTmu.js} +1 -1
  35. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DKQZ9J8Z.js → Takeaway.vue_vue_type_script_setup_true_lang-Cj7vyOaP.js} +5 -5
  36. package/dist/{TextChip.vue_vue_type_script_setup_true_lang-BJMcI3U2.js → TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js} +5 -5
  37. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DDWk-WUW.js → Thumbnail.vue_vue_type_script_setup_true_lang-B0552qsN.js} +74 -74
  38. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BwnyIDNH.js +6038 -0
  39. package/dist/{Unit-Ccs_k5IS.js → Unit-C7-Oj5S3.js} +3 -3
  40. package/dist/{Variant-BHmgMXq7.js → Variant-CYiMkE0q.js} +4 -4
  41. package/dist/{_id_-DSSoi4Gy.js → _id_-D75ZcNlf.js} +11 -11
  42. package/dist/{app-CzXxFrl1.js → app-5fxKLAzS.js} +447 -447
  43. package/dist/{app-C8Dm2-h4.js → app-BhLVpUSl.js} +35 -35
  44. package/dist/{app-B9seAt5l.js → app-DzVMOviz.js} +1 -1
  45. package/dist/app.js +1 -1
  46. package/dist/apps/mf-menu/src/app.d.ts +20 -0
  47. package/dist/apps/mf-menu/src/components/feature/CategoryManager/CategoriesSelector.vue.d.ts +1 -1
  48. package/dist/apps/mf-menu/src/components/feature/MenuSelector.vue.d.ts +1 -1
  49. package/dist/apps/mf-menu/src/components/feature/SubcategoryManager/SubcategorySelector.vue.d.ts +1 -1
  50. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +2 -1
  51. package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
  52. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/assets/linked-status-BoIPm5hC.js +13 -0
  54. package/dist/assets/override-menu-DfTrwWpR.js +13 -0
  55. package/dist/assets/validate-menu-BhWvQ3T9.js +13 -0
  56. package/dist/{catalog-CD-fdGdY.js → catalog-CudNSsIP.js} +1 -1
  57. package/dist/{catalogSetting-Ci85lXor.js → catalogSetting-BVHO9tK3.js} +1 -1
  58. package/dist/{category-6NAH0dUF.js → category-BQpgz1lk.js} +1 -1
  59. package/dist/{currency-BP_z7R5d.js → currency-BfS7H2KE.js} +1 -1
  60. package/dist/{index-BLMijxTj.js → index-BHdPJta4.js} +91 -91
  61. package/dist/{index-C1XCbqC-.js → index-DmGJvREM.js} +56 -56
  62. package/dist/{index-Cftm4-G_.js → index-DuLXS699.js} +5 -5
  63. package/dist/{index-DgDQzkPR.js → index-aaoziUNI.js} +30 -30
  64. package/dist/{index.vue_vue_type_script_setup_true_lang-D-k9WcQV.js → index.vue_vue_type_script_setup_true_lang-Dje9kp-F.js} +40026 -40153
  65. package/dist/item-BtKW0wdj.js +7685 -0
  66. package/dist/{iteration-ZG64Re91.js → iteration-CaliNodx.js} +1 -1
  67. package/dist/{jszip.min-BETdv0rh.js → jszip.min-DXbkmgRD.js} +102 -102
  68. package/dist/{menu-COMXycAe.js → menu-D-lUEuvX.js} +1 -1
  69. package/dist/{menuV2-CeRS0Jw3.js → menuV2-D-6O36DO.js} +357 -348
  70. package/dist/mf-menu.css +1 -1
  71. package/dist/packages/shared/src/components/form/SelectFilter.vue.d.ts +1 -1
  72. package/dist/{priceTier-t2T3Q87F.js → priceTier-DKnYaOA9.js} +1 -1
  73. package/dist/{scheduler-BbJUVuiK.js → scheduler-DEwfbYPL.js} +7 -7
  74. package/dist/{subcategory-61kOQh4g.js → subcategory-CQKklgcd.js} +2 -2
  75. package/dist/{toExcel-DIYaK18-.js → toExcel-CRwL-QqF.js} +2 -2
  76. package/dist/{unit-B6StucsI.js → unit-BzM1rmN7.js} +151 -151
  77. package/dist/{vuedraggable-DnBIRDMr.js → vuedraggable-CK8z7qA8.js} +2 -2
  78. package/package.json +3 -2
  79. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-BpEjqhAC.js +0 -161
  80. package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-CnCoRLDg.js +0 -74
  81. package/dist/FormItem.vue_vue_type_script_setup_true_lang-B3Ixruh-.js +0 -26
  82. package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-Bm_hSelC.js +0 -69
  83. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-JdHaBpaX.js +0 -5997
  84. package/dist/assets/linked-status-Cuf8X8_g.js +0 -13
  85. package/dist/assets/override-menu-yxQLf82k.js +0 -13
  86. package/dist/assets/validate-menu-BwbenBs6.js +0 -13
  87. package/dist/item-ByEPWjef.js +0 -6819
@@ -1,41 +1,41 @@
1
- var Ue = Object.defineProperty;
2
- var We = (e, t, n) => t in e ? Ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var ne = (e, t, n) => We(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { ao as ue, H as C, B as T, z as ae, ap as re, J as G, I as ie, ac as x, c as L, X as D, am as oe, aq as Le, ar as qe, A as ze, ae as Ge, as as He, at as Be, ab as Je } from "./index.vue_vue_type_script_setup_true_lang-D-k9WcQV.js";
1
+ var We = Object.defineProperty;
2
+ var Le = (e, t, n) => t in e ? We(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var ne = (e, t, n) => Le(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { ao as ae, H as C, B as T, z as ue, ap as re, J as B, I as ie, ac as x, c as L, X as V, am as oe, aq as qe, ar as ze, A as Be, ae as Ge, as as He, at as Je, ab as Ye } from "./index.vue_vue_type_script_setup_true_lang-Dje9kp-F.js";
5
5
  import { defineStore as Xe } from "pinia";
6
- import { shallowRef as j, ref as H, computed as S, shallowReactive as Ye, effectScope as Qe, watch as Ze } from "vue";
6
+ import { shallowRef as j, ref as G, computed as S, shallowReactive as Qe, effectScope as Ze, watch as et } from "vue";
7
7
  import { useCoreStore as se } from "@feedmepos/mf-common";
8
- import { useSnackbar as et } from "@feedmepos/ui-library";
9
- const tt = "/assets/linked-status-Cuf8X8_g.js", nt = "/assets/override-menu-yxQLf82k.js";
10
- function rt(e) {
8
+ import { useSnackbar as tt } from "@feedmepos/ui-library";
9
+ const nt = "/assets/linked-status-BoIPm5hC.js", rt = "/assets/override-menu-DfTrwWpR.js";
10
+ function ot(e) {
11
11
  var o;
12
12
  const t = C(e), n = (o = t.variant) == null ? void 0 : o.variantCombinations;
13
13
  return delete t.variant, delete t.thumbnail, [t, ...n || []];
14
14
  }
15
- function ot(e, t, n, o) {
16
- const r = C(t), a = n ? r.modules.catalog.find((m) => m._id === n) : null, l = o ? r.modules.scheduler.find((m) => m._id === o) : null, u = a ? C(a) : void 0, c = n ? r.modules.catalog.filter((m) => m._id !== n) : [], i = l ? C(l) : void 0, f = e.reduce((m, v) => (m[v._id] = rt(v), m), {});
17
- function h(m = []) {
18
- const v = e.map((p) => p._id);
15
+ function st(e, t, n, o) {
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 p(v = []) {
18
+ const y = e.map((h) => h._id);
19
19
  return [
20
- ...m.filter((p) => !v.includes(p._id)),
21
- ...Object.values(f).flatMap((p) => p)
20
+ ...v.filter((h) => !y.includes(h._id)),
21
+ ...Object.values(f).flatMap((h) => h)
22
22
  ];
23
23
  }
24
- return u && o ? (u.override.scheduler = {
25
- ...u.override.scheduler,
24
+ return a && o ? (a.override.scheduler = {
25
+ ...a.override.scheduler,
26
26
  [o]: {
27
- ...u.override.scheduler[o],
27
+ ...a.override.scheduler[o],
28
28
  _id: o,
29
- items: h(i == null ? void 0 : i.items).map((m) => ({
30
- ...m,
31
- orderFrom: ae.F_ORDER_FROM.enum.ALL
29
+ items: p(i == null ? void 0 : i.items).map((v) => ({
30
+ ...v,
31
+ orderFrom: ue.F_ORDER_FROM.enum.ALL
32
32
  }))
33
33
  }
34
- }, r.modules.catalog = [...c, u], r) : u ? (u.override.items = {
35
- ...u.override.items,
34
+ }, r.modules.catalog = [...c, a], r) : a ? (a.override.items = {
35
+ ...a.override.items,
36
36
  ...f
37
- }, r.modules.catalog = [...c, u], r) : i ? (i.items = h(i.items), r.modules.scheduler = [
38
- ...r.modules.scheduler.filter((m) => m._id !== o),
37
+ }, r.modules.catalog = [...c, a], r) : i ? (i.items = p(i.items), r.modules.scheduler = [
38
+ ...r.modules.scheduler.filter((v) => v._id !== o),
39
39
  i
40
40
  ], r) : {
41
41
  ...re(),
@@ -50,22 +50,22 @@ function ot(e, t, n, o) {
50
50
  };
51
51
  }
52
52
  function $(e, t, n) {
53
- var a;
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 = (a = o.groups) == null ? void 0 : a.map((l) => {
59
- var i, f, h;
60
- const u = (i = e == null ? void 0 : e.groups) == null ? void 0 : i.find((m) => m._id === l._id);
58
+ const r = (u = o.groups) == null ? void 0 : u.map((l) => {
59
+ var i, f, p;
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
- return u ? c = ((f = l.items) == null ? void 0 : f.map((m) => {
63
- var p;
64
- const v = (p = u.items) == null ? void 0 : p.find(
65
- (b) => b._id === m._id && b.combinationKey === m.combinationKey
62
+ return a ? c = ((f = l.items) == null ? void 0 : f.map((v) => {
63
+ var h;
64
+ const y = (h = a.items) == null ? void 0 : h.find(
65
+ (b) => b._id === v._id && b.combinationKey === v.combinationKey
66
66
  );
67
- return $(v || m, t, n + 1);
68
- })) ?? [] : c = ((h = l.items) == null ? void 0 : h.map((m) => $(m, t, n + 1))) ?? [], {
67
+ return $(y || v, t, n + 1);
68
+ })) ?? [] : c = ((p = l.items) == null ? void 0 : p.map((v) => $(v, t, n + 1))) ?? [], {
69
69
  ...l,
70
70
  items: c
71
71
  };
@@ -78,12 +78,12 @@ function $(e, t, n) {
78
78
  groups: r
79
79
  };
80
80
  }
81
- function st(e, t) {
82
- const n = e.groups.map((a) => {
83
- const l = t.modules.group.find((c) => c._id === a._id), u = ((l == null ? void 0 : l.items) || []).map((c) => {
84
- var h;
85
- const i = (h = a.items) == null ? void 0 : h.find(
86
- (m) => m._id === c._id && m.combinationKey === c.combinationKey
81
+ function at(e, t) {
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
+ var p;
85
+ const i = (p = u.items) == null ? void 0 : p.find(
86
+ (v) => v._id === c._id && v.combinationKey === c.combinationKey
87
87
  );
88
88
  if (i)
89
89
  return $(i, t, 1);
@@ -94,8 +94,8 @@ function st(e, t) {
94
94
  };
95
95
  return $(f, t, 1);
96
96
  });
97
- return { ...a, items: u };
98
- }), o = e.variant ? e.variant.variantCombinations.map((a) => $(a, t, 1)) : [], r = {
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,
@@ -104,20 +104,20 @@ function st(e, t) {
104
104
  };
105
105
  return [...o, r];
106
106
  }
107
- function B(e, t) {
107
+ function H(e, t) {
108
108
  var o;
109
109
  if (!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, u;
114
- const a = (l = t.groups) == null ? void 0 : l.find((c) => c._id === r._id);
115
- return r.items = (u = r.items) == null ? void 0 : u.map((c) => {
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 = a == null ? void 0 : a.items) == null ? void 0 : f.find(
118
- (h) => h._id === c._id && h.combinationKey === c.combinationKey
117
+ const i = (f = u == null ? void 0 : u.items) == null ? void 0 : f.find(
118
+ (p) => p._id === c._id && p.combinationKey === c.combinationKey
119
119
  );
120
- return B(c, i);
120
+ return H(c, i);
121
121
  }), r;
122
122
  }), n;
123
123
  }
@@ -126,12 +126,12 @@ function ut(e, t) {
126
126
  t.variant && (t.variant = {
127
127
  ...t.variant,
128
128
  variantCombinations: t.variant.variantCombinations.map((r) => {
129
- const a = n.find(
129
+ const u = n.find(
130
130
  (l) => l._id === r._id && l.combinationKey === r.combinationKey
131
131
  );
132
- if (!a)
132
+ if (!u)
133
133
  throw new Error(`Item overrider not found - ${r._id} - ${r.combinationKey}`);
134
- return B(a, r);
134
+ return H(u, r);
135
135
  })
136
136
  });
137
137
  const o = n.find((r) => !r.combinationKey);
@@ -139,57 +139,57 @@ 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 a = t.groups.find((u) => u._id === r._id);
143
- return r.items = (l = r.items) == null ? void 0 : l.map((u) => {
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 = a == null ? void 0 : a.items) == null ? void 0 : i.find(
146
- (f) => f._id === u._id && f.combinationKey === u.combinationKey
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 B(u, c);
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, a = !0) {
156
- const l = C(n), u = a ? ot(t, l, o, r) : l, c = t.reduce((h, m) => (h[m._id] = u.modules.item.find((v) => v._id === m._id), h), {}), i = t.reduce((h, m) => {
157
- const v = m._id;
158
- return h[v] = st(c[v], e), h;
155
+ async function Dt(e, t, n, o, r, u = !0) {
156
+ const l = C(n), a = u ? st(t, l, o, r) : l, c = t.reduce((p, v) => (p[v._id] = a.modules.item.find((y) => y._id === v._id), p), {}), i = t.reduce((p, v) => {
157
+ const y = v._id;
158
+ return p[y] = at(c[y], e), p;
159
159
  }, {}), f = T.getFallbackPrices({
160
- rawMenu: u,
160
+ rawMenu: a,
161
161
  items: i,
162
162
  catalogId: o || void 0,
163
163
  schedulerId: r
164
164
  });
165
- return t.map((h) => {
166
- const m = h._id, v = c[m];
165
+ return t.map((p) => {
166
+ const v = p._id, y = c[v];
167
167
  return {
168
- ...ut(f, v),
169
- category: o || r ? v == null ? void 0 : v.category : null
168
+ ...ut(f, y),
169
+ category: o || r ? y == null ? void 0 : y.category : null
170
170
  };
171
171
  });
172
172
  }
173
173
  function Vt(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, a) => {
177
- if (a && a.length > 0) {
178
- const l = `variant${a.split("/")[0]}`, u = a.split("/")[1], i = t.find(
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 === u);
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
186
  const q = /* @__PURE__ */ new Map();
187
- async function Dt(e, t) {
187
+ async function Tt(e, t) {
188
188
  const n = `${e._id}-${e.updatedAt}-${t}`;
189
189
  if (q.has(n))
190
190
  return q.get(n);
191
- const o = await ue(
192
- tt,
191
+ const o = await ae(
192
+ nt,
193
193
  JSON.stringify({
194
194
  menu: e,
195
195
  itemId: t
@@ -198,22 +198,22 @@ async function Dt(e, t) {
198
198
  return q.set(n, o), o;
199
199
  }
200
200
  async function ce(e, t, n) {
201
- return await ue(nt, {
201
+ return await ae(rt, {
202
202
  menu: e,
203
203
  catalogId: t,
204
204
  schedulerId: n
205
205
  });
206
206
  }
207
- function Tt(e, t, n) {
207
+ function Pt(e, t, n) {
208
208
  const o = /* @__PURE__ */ new Set();
209
- function r(a, l) {
210
- if (!e || !a || !l || o.has(l)) return !1;
209
+ function r(u, l) {
210
+ if (!e || !u || !l || o.has(l)) return !1;
211
211
  o.add(l);
212
- const u = e.modules.item.find((c) => c._id === l);
213
- return !u || !u.groups ? !1 : u.groups.some((c) => c._id === a) ? !0 : u.groups.some((c) => {
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(a, f._id)) return !0;
216
+ if (r(u, f._id)) return !0;
217
217
  return !1;
218
218
  });
219
219
  }
@@ -221,11 +221,11 @@ function Tt(e, t, n) {
221
221
  }
222
222
  function Ft(e, t, n) {
223
223
  const o = /* @__PURE__ */ new Set();
224
- function r(a, l) {
225
- if (!e || !a || !l || o.has(a)) return !1;
226
- o.add(a);
227
- const u = e.modules.group.find((c) => c._id === a);
228
- return !u || !u.items ? !1 : u.items.some((c) => c._id === l) ? !0 : u.items.some((c) => {
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;
@@ -235,7 +235,7 @@ function Ft(e, t, n) {
235
235
  return r(t, n);
236
236
  }
237
237
  const z = /* @__PURE__ */ new Map();
238
- async function at(e, t, n) {
238
+ async function it(e, t, n) {
239
239
  const o = `${e._id}-${e.updatedAt}-${t || "null"}-${n || "null"}`;
240
240
  if (z.has(o))
241
241
  return z.get(o);
@@ -243,33 +243,33 @@ async function at(e, t, n) {
243
243
  return z.set(o, r), r;
244
244
  }
245
245
  async function Kt(e, t, n) {
246
- var l, u;
247
- const o = await at(e, t, null), r = [], a = (c, i) => {
246
+ var l, a;
247
+ const o = await it(e, t, null), r = [], u = (c, i) => {
248
248
  const f = C(c);
249
- for (const h in i)
250
- i[h] && (f[h] = i[h]);
249
+ for (const p in i)
250
+ i[p] && (f[p] = i[p]);
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((h) => h._id === n && !h.combinationKey), f = e.modules.item.find((h) => h._id === n);
254
+ const i = (l = c.items) == null ? void 0 : l.find((p) => p._id === n && !p.combinationKey), f = e.modules.item.find((p) => p._id === n);
255
255
  if (i) {
256
- const h = (u = c.items) == null ? void 0 : u.filter((v) => v._id === n && v.combinationKey), m = [i, ...h].map((v) => {
256
+ const p = (a = c.items) == null ? void 0 : a.filter((y) => y._id === n && y.combinationKey), v = [i, ...p].map((y) => {
257
257
  var w, I;
258
- const p = v.combinationKey ? (I = (w = f == null ? void 0 : f.variant) == null ? void 0 : w.variantCombinations) == null ? void 0 : I.find(
259
- (k) => k.combinationKey === v.combinationKey
260
- ) : f, b = p && f ? a(f, p) : v;
261
- return a(b, v);
258
+ const h = 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 = h && f ? u(f, h) : y;
261
+ return u(b, y);
262
262
  });
263
263
  r.push({
264
264
  group: c,
265
- items: m
265
+ items: v
266
266
  });
267
267
  }
268
268
  }
269
269
  return r;
270
270
  }
271
- const M = 0, F = 3;
272
- function it(e) {
271
+ const M = 0, P = 3;
272
+ function ct(e) {
273
273
  const t = /^\/(.*)\/([gimyu]*)$/.exec(e.toString());
274
274
  if (!t)
275
275
  throw new Error("Invalid RegExp");
@@ -285,19 +285,19 @@ function O(e) {
285
285
  if (e instanceof Date)
286
286
  return new Date(e.getTime());
287
287
  if (e instanceof RegExp)
288
- return it(e);
288
+ return ct(e);
289
289
  const t = {};
290
290
  for (const n in e)
291
291
  Object.prototype.hasOwnProperty.call(e, n) && (t[n] = O(e[n]));
292
292
  return t;
293
293
  }
294
- function P(e) {
294
+ function K(e) {
295
295
  return e instanceof RegExp ? e.toString() : e;
296
296
  }
297
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 K(e, t) {
300
+ function F(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,157 +307,157 @@ function K(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 (!K(e[n], t[n])) return !1;
310
+ if (!F(e[n], t[n])) return !1;
311
311
  return !0;
312
312
  }
313
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) || !K(e[r], t[r])) return !1;
317
+ if (!Object.prototype.hasOwnProperty.call(t, r) || !F(e[r], t[r])) return !1;
318
318
  return !0;
319
319
  }
320
320
  return !1;
321
321
  }
322
- function ct(e, t, n) {
323
- const o = e.length, r = t.length, a = /* @__PURE__ */ new Map();
322
+ function lt(e, t, n) {
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
- a.has(i) || a.set(i, []), a.get(i).push(c);
326
+ u.has(i) || u.set(i, []), u.get(i).push(c);
327
327
  }
328
- const l = [], u = /* @__PURE__ */ new Set();
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 = a.get(f);
331
- if (h) {
332
- for (const m of h)
333
- if (!u.has(m) && K(i, t[m])) {
334
- l.push({ leftIndex: c, rightIndex: m }), u.add(m);
330
+ const i = e[c], f = n ? n(i) : JSON.stringify(i), p = u.get(f);
331
+ if (p) {
332
+ for (const v of p)
333
+ if (!a.has(v) && F(i, t[v])) {
334
+ l.push({ leftIndex: c, rightIndex: v }), a.add(v);
335
335
  break;
336
336
  }
337
337
  }
338
338
  }
339
339
  return l;
340
340
  }
341
- function lt(e, t, n) {
342
- var m, v;
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, a = ((v = n == null ? void 0 : n.arrays) == null ? void 0 : v.includeValueOnMove) === !0, l = n == null ? void 0 : n.objectHash;
345
- let u = r ? ct(e, t, l) : [];
346
- if (!l && e.length === t.length && e.length > 0 && u.length < e.length) {
347
- const p = R(e[0]) || Array.isArray(e[0]), b = u.length > 0;
348
- if (p || b) {
349
- u = [];
341
+ function dt(e, t, n) {
342
+ var v, y;
343
+ if (F(e, t)) return;
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
+ let a = r ? lt(e, t, l) : [];
346
+ if (!l && e.length === t.length && e.length > 0 && a.length < e.length) {
347
+ const h = R(e[0]) || Array.isArray(e[0]), b = a.length > 0;
348
+ if (h || b) {
349
+ a = [];
350
350
  for (let w = 0; w < e.length; w++)
351
- u.push({ leftIndex: w, rightIndex: w });
351
+ a.push({ leftIndex: w, rightIndex: w });
352
352
  }
353
353
  }
354
- new Set(u.map((p) => p.leftIndex));
355
- const c = new Set(u.map((p) => p.rightIndex)), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
356
- for (const p of u)
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);
354
+ new Set(a.map((h) => h.leftIndex));
355
+ const c = new Set(a.map((h) => h.rightIndex)), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
356
+ for (const h of a)
357
+ i.set(h.leftIndex, h.rightIndex), f.set(h.rightIndex, h.leftIndex);
358
+ for (let h = 0; h < e.length; h++) {
359
+ const b = i.get(h);
360
360
  if (b !== void 0) {
361
- const w = J(e[p], t[b], n);
362
- if (w !== void 0 && (o[b] = w), r && b !== p) {
363
- const I = `_${p}`, k = a ? [e[p], b, F] : ["", b, F];
364
- o[I] = k;
361
+ const w = J(e[h], t[b], n);
362
+ if (w !== void 0 && (o[b] = w), r && b !== h) {
363
+ const I = `_${h}`, E = u ? [e[h], b, P] : ["", b, P];
364
+ o[I] = E;
365
365
  }
366
366
  } else {
367
- const w = `_${p}`;
368
- o[w] = [e[p], M, M];
367
+ const w = `_${h}`;
368
+ o[w] = [e[h], M, M];
369
369
  }
370
370
  }
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"))
371
+ for (let h = 0; h < t.length; h++)
372
+ c.has(h) || (o[h] = [t[h]]);
373
+ const p = Object.keys(o);
374
+ if (!(p.length === 1 && p[0] === "_t"))
375
375
  return o;
376
376
  }
377
- function dt(e, t, n) {
378
- if (K(e, t)) return;
379
- const o = {}, r = Object.keys(e), a = Object.keys(t), l = /* @__PURE__ */ new Set([...r, ...a]);
380
- for (const u of l) {
381
- if (n != null && n.propertyFilter && !n.propertyFilter(u, { left: e, right: t }))
377
+ function ft(e, t, n) {
378
+ if (F(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, u), i = Object.prototype.hasOwnProperty.call(t, u);
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[u], t[u], n);
386
- f !== void 0 && (o[u] = f);
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[u];
389
- o[u] = [f, M, M];
390
- } else !c && i && (o[u] = [t[u]]);
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 (K(e, t)) return;
395
+ if (F(e, t)) return;
396
396
  if (e === void 0 && t !== void 0) {
397
- const u = n != null && n.cloneDiffValues ? O(t) : t;
398
- return [P(u)];
397
+ const a = n != null && n.cloneDiffValues ? O(t) : t;
398
+ return [K(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 u = n != null && n.cloneDiffValues ? O(e) : e, c = n != null && n.cloneDiffValues ? O(t) : t;
402
- return [P(u), P(c)];
401
+ const a = n != null && n.cloneDiffValues ? O(e) : e, c = n != null && n.cloneDiffValues ? O(t) : t;
402
+ return [K(a), K(c)];
403
403
  }
404
404
  if (Array.isArray(e) && Array.isArray(t))
405
- return lt(e, t, n);
406
- if (R(e) && R(t))
407
405
  return dt(e, t, n);
408
- const a = n != null && n.cloneDiffValues ? O(e) : e, l = n != null && n.cloneDiffValues ? O(t) : t;
409
- return [P(a), P(l)];
406
+ if (R(e) && R(t))
407
+ return ft(e, t, n);
408
+ const u = n != null && n.cloneDiffValues ? O(e) : e, l = n != null && n.cloneDiffValues ? O(t) : t;
409
+ return [K(u), K(l)];
410
410
  }
411
- function ft(e, t, n) {
411
+ function mt(e, t, n) {
412
412
  return J(e, t, n);
413
413
  }
414
- function mt(e, t, n) {
414
+ function vt(e, t, n) {
415
415
  const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
416
- for (const u in t) {
417
- if (u === "_t" || !u.startsWith("_")) continue;
418
- const c = parseInt(u.slice(1)), i = t[u];
419
- Array.isArray(i) && (i.length === 3 && i[2] === M ? o.add(c) : i.length === 3 && i[2] === F && r.set(c, i[1]));
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] === P && r.set(c, i[1]));
420
420
  }
421
- const a = [];
421
+ const u = [];
422
422
  let l = 0;
423
- for (let u = 0; ; u++) {
424
- const c = u.toString(), i = t[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
- a.push(i[0]);
427
+ u.push(i[0]);
428
428
  else {
429
429
  for (; l < e.length && o.has(l); )
430
430
  l++;
431
- l < e.length && (a.push(X(e[l], i)), l++);
431
+ l < e.length && (u.push(Y(e[l], i)), l++);
432
432
  }
433
433
  else {
434
434
  let f = !1;
435
- for (const [h, m] of r.entries())
436
- if (m === u) {
437
- a.push(e[h]), f = !0;
435
+ for (const [p, v] of r.entries())
436
+ if (v === a) {
437
+ u.push(e[p]), 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
- a.push(e[l]), l++;
444
+ u.push(e[l]), l++;
445
445
  else
446
446
  break;
447
447
  }
448
448
  }
449
449
  }
450
- return a;
450
+ return u;
451
451
  }
452
- function vt(e, t, n) {
452
+ function yt(e, t, n) {
453
453
  const o = { ...e };
454
454
  for (const r in t) {
455
- const a = t[r];
456
- Array.isArray(a) ? a.length === 1 ? o[r] = a[0] : a.length === 3 && a[2] === M ? delete o[r] : a.length === 2 && (o[r] = a[1]) : o[r] = X(o[r], a);
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 X(e, t, n) {
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,12 +467,12 @@ function X(e, t, n) {
467
467
  if (t.length === 3 && t[2] === M)
468
468
  return;
469
469
  }
470
- return R(t) && t._t === "a" ? mt(e, t) : R(t) && R(e) ? vt(e, t) : e;
470
+ return R(t) && t._t === "a" ? vt(e, t) : R(t) && R(e) ? yt(e, t) : e;
471
471
  }
472
472
  function le(e, t, n) {
473
- return X(e, t);
473
+ return Y(e, t);
474
474
  }
475
- function yt(e) {
475
+ function pt(e) {
476
476
  const t = { _t: "a" };
477
477
  for (const n in e)
478
478
  if (n !== "_t")
@@ -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] === F) {
485
- const a = r[1];
486
- t[`_${a}`] = [r[0], o, F];
484
+ else if (r.length === 3 && r[2] === P) {
485
+ const u = r[1];
486
+ t[`_${u}`] = [r[0], o, P];
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 a = Y(r);
495
- a !== void 0 && (t[n] = a);
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 = Y(o);
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 Y(e) {
513
+ function X(e) {
514
514
  if (e !== void 0) {
515
515
  if (Array.isArray(e)) {
516
516
  if (e.length === 1)
@@ -519,26 +519,26 @@ 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] === F)
522
+ if (e.length === 3 && e[2] === P)
523
523
  return e;
524
524
  }
525
- return R(e) && e._t === "a" ? yt(e) : R(e) ? ht(e) : e;
525
+ return R(e) && e._t === "a" ? pt(e) : R(e) ? ht(e) : e;
526
526
  }
527
527
  }
528
528
  function de(e) {
529
- return Y(e);
529
+ return X(e);
530
530
  }
531
- function pt(e, t, n) {
531
+ function gt(e, t, n) {
532
532
  const o = de(t);
533
533
  return le(e, o);
534
534
  }
535
- class gt {
535
+ class _t {
536
536
  constructor(t) {
537
537
  ne(this, "options");
538
538
  this.options = t || {};
539
539
  }
540
540
  diff(t, n) {
541
- return ft(t, n, this.options);
541
+ return mt(t, n, this.options);
542
542
  }
543
543
  patch(t, n) {
544
544
  return le(t, n, this.options);
@@ -547,76 +547,76 @@ class gt {
547
547
  return de(t);
548
548
  }
549
549
  unpatch(t, n) {
550
- return pt(t, n, this.options);
550
+ return gt(t, n, this.options);
551
551
  }
552
552
  clone(t) {
553
553
  return O(t);
554
554
  }
555
555
  }
556
- function _t(e) {
557
- return new gt(e);
556
+ function St(e) {
557
+ return new _t(e);
558
558
  }
559
- function St({
559
+ function bt({
560
560
  maxHistorySize: e = 10
561
561
  }) {
562
- const t = _t({
563
- objectHash: (v) => v._id || v.id,
562
+ const t = St({
563
+ objectHash: (y) => y._id || y.id,
564
564
  arrays: {
565
565
  detectMove: !0,
566
566
  includeValueOnMove: !1
567
567
  },
568
568
  cloneDiffValues: !1
569
- }), n = j(null), o = j([]), r = H(-1), a = j(null), l = S(() => r.value > 0), u = S(() => r.value < o.value.length - 1);
570
- function c(v) {
569
+ }), n = j(null), o = j([]), r = G(-1), u = j(null), l = S(() => r.value > 0), a = S(() => r.value < o.value.length - 1);
570
+ function c(y) {
571
571
  if (n.value === null) {
572
- n.value = C(v), a.value = C(v), o.value = [{ delta: null }], r.value = 0;
572
+ n.value = C(y), u.value = C(y), o.value = [{ delta: null }], r.value = 0;
573
573
  return;
574
574
  }
575
- const p = t.diff(a.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++, a.value = C(v), o.value.length > e) {
575
+ const h = 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: h }), 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
  }
580
580
  }
581
- function i(v) {
582
- if (!n.value || v < 0 || v >= o.value.length)
581
+ function i(y) {
582
+ if (!n.value || y < 0 || y >= o.value.length)
583
583
  return;
584
- let p = C(n.value);
585
- for (let b = 1; b <= v; b++) {
584
+ let h = C(n.value);
585
+ for (let b = 1; b <= y; b++) {
586
586
  const w = o.value[b];
587
- w.delta && (p = t.patch(p, w.delta));
587
+ w.delta && (h = t.patch(h, w.delta));
588
588
  }
589
- return p;
589
+ return h;
590
590
  }
591
591
  function f() {
592
592
  if (l.value) {
593
593
  r.value--;
594
- const v = i(r.value);
595
- return v && (a.value = C(v)), v;
594
+ const y = i(r.value);
595
+ return y && (u.value = C(y)), y;
596
596
  }
597
597
  }
598
- function h() {
599
- if (u.value) {
598
+ function p() {
599
+ if (a.value) {
600
600
  r.value++;
601
- const v = i(r.value);
602
- return v && (a.value = C(v)), v;
601
+ const y = i(r.value);
602
+ return y && (u.value = C(y)), y;
603
603
  }
604
604
  }
605
- function m() {
606
- n.value = null, a.value = null, o.value = [], r.value = -1;
605
+ function v() {
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: u,
611
+ canRedo: a,
612
612
  undo: f,
613
- redo: h,
614
- clear: m
613
+ redo: p,
614
+ clear: v
615
615
  };
616
616
  }
617
- const bt = {
617
+ const wt = {
618
618
  async updateMenuModule(e, t) {
619
- const n = G.RequestRunner.operation(t, e.modules);
619
+ const n = B.RequestRunner.operation(t, e.modules);
620
620
  if (n.validateError.length > 0)
621
621
  throw new Error(n.validateError.join(`
622
622
  `));
@@ -651,7 +651,7 @@ function fe() {
651
651
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
652
652
  };
653
653
  }
654
- function wt() {
654
+ function Mt() {
655
655
  return {
656
656
  restaurants: [],
657
657
  menu: { ...fe(), _rev: "" },
@@ -664,21 +664,21 @@ function wt() {
664
664
  }
665
665
  };
666
666
  }
667
- const Pt = Xe(
667
+ const $t = Xe(
668
668
  "mf-menu-store-v2",
669
669
  () => {
670
- const e = Ye(wt()), t = se(), n = et(), o = S(() => e.menu.modules.serveSequence ? x(e.menu.modules.serveSequence, {
670
+ const e = Qe(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;
674
674
  return ((s = t.currentBusiness.value) == null ? void 0 : s.menuVersion) || L.F_MENU_VERSION.v3;
675
- }), a = S(() => r.value === L.F_MENU_VERSION.v4), l = S(() => {
675
+ }), u = S(() => r.value === L.F_MENU_VERSION.v4), l = S(() => {
676
676
  const s = e.menu.modules.catalog;
677
677
  return x(s, { selector: "name" });
678
- }), u = S(() => {
678
+ }), a = S(() => {
679
679
  var d;
680
680
  let s = e.menu.modules.catalog.find(
681
- (y) => y._id === e.currentCatalogId
681
+ (m) => m._id === e.currentCatalogId
682
682
  );
683
683
  return s && ((d = s.linkItemRules) != null && d.length) && (s = T.populateCatalog({
684
684
  catalog: s,
@@ -686,20 +686,20 @@ const Pt = Xe(
686
686
  items: e.menu.modules.item,
687
687
  ...e.currentRestaurantAttrParams ?? {}
688
688
  })), s;
689
- }), c = S(() => x(h.value.modules.scheduler, { selector: "name" })), i = S(() => e.menu.modules.scheduler.find(
689
+ }), c = S(() => x(p.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 && V.push(e.menu);
693
+ e.menu = { ...s, _rev: e.menu._rev }, d && D.push(e.menu);
694
694
  }
695
- const h = j(fe()), m = H(!1), v = H(1);
696
- async function p() {
697
- var y;
698
- m.value = !0;
695
+ const p = j(fe()), v = G(!1), y = G(1);
696
+ async function h() {
697
+ var m;
698
+ v.value = !0;
699
699
  let s = e.menu.modules.catalog;
700
- if (u.value && ((y = u.value.linkItemRules) != null && y.length)) {
700
+ if (a.value && ((m = a.value.linkItemRules) != null && m.length)) {
701
701
  const g = T.populateCatalog({
702
- catalog: u.value,
702
+ catalog: a.value,
703
703
  ruleGroupSettings: e.menu.ruleGroupSettings,
704
704
  items: e.menu.modules.item,
705
705
  ...e.currentRestaurantAttrParams ?? {}
@@ -719,21 +719,21 @@ const Pt = Xe(
719
719
  );
720
720
  if (e.currentSchedulerId != null) {
721
721
  const g = e.menu.modules.catalog.find(
722
- (E) => E._id === e.currentCatalogId
722
+ (k) => k._id === e.currentCatalogId
723
723
  ), _ = g ? g.override.scheduler[e.currentSchedulerId] : e.menu.modules.scheduler.find(
724
- (E) => E._id === e.currentSchedulerId
725
- ), A = new Set(((_ == null ? void 0 : _.items) || []).map((E) => E._id));
726
- d.modules.item = d.modules.item.filter((E) => A.has(E._id));
724
+ (k) => k._id === e.currentSchedulerId
725
+ ), A = new Set(((_ == null ? void 0 : _.items) || []).map((k) => k._id));
726
+ d.modules.item = d.modules.item.filter((k) => A.has(k._id));
727
727
  }
728
- return h.value = d, m.value = !1, v.value = v.value + 1, d;
728
+ return p.value = d, v.value = !1, y.value = y.value + 1, d;
729
729
  }
730
- const w = ie.debounce(p, 200);
731
- let I = null, k = null;
730
+ const w = ie.debounce(h, 200);
731
+ let I = null, E = null;
732
732
  function Q() {
733
- k && (k(), k = null), I && I.stop(), I = Qe(!0), k = I.run(() => Ze(
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
- m.value || w();
736
+ v.value || w();
737
737
  }
738
738
  )) || null;
739
739
  }
@@ -748,7 +748,7 @@ const Pt = Xe(
748
748
  value: s._id
749
749
  }))
750
750
  ]), Z = S(() => {
751
- const s = h.value.modules.category;
751
+ const s = p.value.modules.category;
752
752
  return [
753
753
  ...U.value.item.addon ? [
754
754
  {
@@ -757,35 +757,35 @@ const Pt = Xe(
757
757
  position: 0
758
758
  }
759
759
  ] : [],
760
- ...D(s, (d) => d.name)
760
+ ...V(s, (d) => d.name)
761
761
  ];
762
762
  }), ve = S(() => {
763
- const s = h.value.modules.subCategory || [];
764
- return D(s, (d) => d.name);
763
+ const s = p.value.modules.subCategory || [];
764
+ return V(s, (d) => d.name);
765
765
  }), ee = S(() => {
766
766
  var d;
767
- let s = h.value.modules.item;
768
- if (u.value) {
769
- const y = (d = u.value) == null ? void 0 : d.override.items;
767
+ let s = p.value.modules.item;
768
+ if (a.value) {
769
+ const m = (d = a.value) == null ? void 0 : d.override.items;
770
770
  s = s.filter((g) => {
771
771
  var A;
772
- const _ = (A = y == null ? void 0 : y[g._id]) == null ? void 0 : A.find(
773
- (E) => !E.combinationKey
772
+ const _ = (A = m == null ? void 0 : m[g._id]) == null ? void 0 : A.find(
773
+ (k) => !k.combinationKey
774
774
  );
775
- return (_ == null ? void 0 : _.orderFrom) !== ae.F_ORDER_FROM.enum.NONE;
775
+ return (_ == null ? void 0 : _.orderFrom) !== ue.F_ORDER_FROM.enum.NONE;
776
776
  });
777
777
  }
778
- return D(s, (y) => y.code || y.name);
778
+ return V(s, (m) => m.code || m.name);
779
779
  }), ye = S(() => {
780
- const s = e.menu.modules.category, d = D(s, (g) => g.name).reduce(
780
+ const s = e.menu.modules.category, d = V(s, (g) => g.name).reduce(
781
781
  (g, _, A) => (g[_._id] = A, g),
782
782
  { "": 0 }
783
- ), y = e.menu.modules.item;
784
- return D(
785
- y,
783
+ ), m = e.menu.modules.item;
784
+ return V(
785
+ m,
786
786
  (g) => g.code || g.name
787
787
  ).reduce((g, _, A) => (g[_._id] = A + d[_.category || ""], g), {});
788
- }), he = S(() => oe(N.value, Z.value, ee.value)), pe = S(() => {
788
+ }), pe = S(() => oe(N.value, Z.value, ee.value)), he = S(() => {
789
789
  const s = U.value.item.addon ? [
790
790
  {
791
791
  _id: e.currentCatalogId ? "" : null,
@@ -800,56 +800,64 @@ const Pt = Xe(
800
800
  e.menu.modules.item
801
801
  );
802
802
  }), N = S(() => {
803
- const s = h.value.modules.variant;
803
+ const s = p.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(() => D(h.value.modules.group, (s) => s.name)), Se = S(() => x(h.value.modules.takeaway, { selector: "name" })), be = S(() => x(e.menu.modules.printDepartment || [], {
810
+ const _e = S(() => V(p.value.modules.group, (s) => s.name)), Se = S(() => x(p.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(Le(e.menu.modules.recipe, e.menu.modules.sku), {
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
- const s = qe(e.menu.modules.sku);
815
+ const s = ze(e.menu.modules.sku);
816
816
  return x(s, { selector: "code" });
817
+ }), Ie = S(() => {
818
+ const s = /* @__PURE__ */ new Map();
819
+ return e.menu.modules.item.forEach((d) => {
820
+ var m, g;
821
+ d.code && s.set(d.code, (s.get(d.code) || 0) + 1), (g = (m = d.variant) == null ? void 0 : m.variantCombinations) == null || g.forEach((_) => {
822
+ _.code && s.set(_.code, (s.get(_.code) || 0) + 1);
823
+ });
824
+ }), s;
817
825
  }), U = S(() => {
818
- const s = !e.currentCatalogId, d = r.value === L.F_MENU_VERSION.v4, y = !e.currentSchedulerId, g = {
819
- create: s && y,
820
- edit: s && y,
821
- delete: s && y
826
+ const s = !e.currentCatalogId, d = r.value === L.F_MENU_VERSION.v4, m = !e.currentSchedulerId, g = {
827
+ create: s && m,
828
+ edit: s && m,
829
+ delete: s && m
822
830
  };
823
831
  return {
824
832
  item: {
825
833
  ...g,
826
- edit: d || y,
827
- sort: d && s && y,
834
+ edit: d || m,
835
+ sort: d && s && m,
828
836
  addon: d,
829
- code: y,
830
- name: s && y,
831
- description: s && y,
832
- category: y,
833
- thumbnail: s && y,
834
- orderFrom: (d || s) && y,
837
+ code: m,
838
+ name: s && m,
839
+ description: s && m,
840
+ category: m,
841
+ thumbnail: s && m,
842
+ orderFrom: (d || s) && m,
835
843
  orderFromNone: s,
836
844
  orderFromActiveOnly: !d,
837
- openPrice: s && y,
838
- unit: s && y,
845
+ openPrice: s && m,
846
+ unit: s && m,
839
847
  price: s,
840
848
  editPrice: s,
841
- minPrice: d && y,
842
- costing: d && s && y,
843
- tax: s && y,
844
- variant: s && y,
849
+ minPrice: d && m,
850
+ costing: d && s && m,
851
+ tax: s && m,
852
+ variant: s && m,
845
853
  maxVariant: d ? 4 : 2,
846
- group: s && y,
847
- overrideProductGroup: d && y,
848
- inventory: (d || s) && y,
854
+ group: s && m,
855
+ overrideProductGroup: d && m,
856
+ inventory: (d || s) && m,
849
857
  bindToVariant: d,
850
- print: s && y,
851
- toRoot: d && y,
852
- takeaway: (_) => !!_ && (d || s) && y,
858
+ print: s && m,
859
+ toRoot: d && m,
860
+ takeaway: (_) => !!_ && (d || s) && m,
853
861
  multiScheduler: d,
854
862
  canRearrange: d,
855
863
  printConfig: d
@@ -861,10 +869,10 @@ const Pt = Xe(
861
869
  },
862
870
  group: {
863
871
  ...g,
864
- edit: d || y,
872
+ edit: d || m,
865
873
  sort: s,
866
874
  applyProduct: s,
867
- showAppliedProduct: y,
875
+ showAppliedProduct: m,
868
876
  type: !d,
869
877
  insertRawItems: !d,
870
878
  multiScheduler: d
@@ -874,7 +882,7 @@ const Pt = Xe(
874
882
  },
875
883
  takeaway: {
876
884
  ...g,
877
- edit: (d || s) && y,
885
+ edit: (d || s) && m,
878
886
  name: s
879
887
  },
880
888
  catalog: {
@@ -887,33 +895,33 @@ const Pt = Xe(
887
895
  function W(s) {
888
896
  return `${s.systemCode}/${s.taxCode}`;
889
897
  }
890
- function Ie(s) {
891
- const [d, y] = s.split("/");
892
- return { systemCode: d, taxCode: y };
898
+ function Ee(s) {
899
+ const [d, m] = s.split("/");
900
+ return { systemCode: d, taxCode: m };
893
901
  }
894
- function ke(s, d, y) {
895
- return (s ?? d ?? []).map((g) => W(g)).find((g) => y.some((_) => _.value === g));
902
+ function Re(s, d, m) {
903
+ return (s ?? d ?? []).map((g) => W(g)).find((g) => m.some((_) => _.value === g));
896
904
  }
897
- const Re = S(() => {
905
+ const ke = S(() => {
898
906
  var g;
899
- const s = ["SV5", "SV10"], d = ze.Country.getCountryFlattenTaxes(
907
+ const s = ["SV5", "SV10"], d = Be.Country.getCountryFlattenTaxes(
900
908
  se().currentCountry.value
901
- ), y = d.filter((_) => a.value || !s.includes(_.taxCode)).map((_) => ({
909
+ ), m = d.filter((_) => u.value || !s.includes(_.taxCode)).map((_) => ({
902
910
  label: `${_.name} (${Ge(_.rate)}%)`,
903
911
  value: W(_),
904
912
  meta: {
905
913
  rate: _.rate
906
914
  }
907
915
  }));
908
- return y.sort((_, A) => _.label.localeCompare(A.label, void 0, { numeric: !0 })), {
916
+ return m.sort((_, A) => _.label.localeCompare(A.label, void 0, { numeric: !0 })), {
909
917
  systemCode: (g = d[0]) == null ? void 0 : g.systemCode,
910
- countryTaxOptions: y
918
+ countryTaxOptions: m
911
919
  };
912
- }), Ee = async () => {
913
- const s = await Je.readMenu();
920
+ }), xe = async () => {
921
+ const s = await Ye.readMenu();
914
922
  e.menu = s ?? e.menu, te(null);
915
- }, xe = async () => {
916
- const { fetchAllRestaurants: s } = Be();
923
+ }, Oe = async () => {
924
+ const { fetchAllRestaurants: s } = Je();
917
925
  await s({
918
926
  onBatchEnd: (d) => {
919
927
  e.restaurants = d;
@@ -921,28 +929,28 @@ const Pt = Xe(
921
929
  });
922
930
  }, te = (s) => {
923
931
  e.currentCatalogId = s;
924
- }, Oe = (s) => {
932
+ }, De = (s) => {
925
933
  e.currentSchedulerId = s;
926
934
  }, Ve = (s) => {
927
935
  e.currentCategoryIds = s;
928
- }, De = (s) => {
936
+ }, Te = (s) => {
929
937
  e.currentRestaurantAttrParams = s;
930
- }, Te = async (s, d) => {
931
- const y = Array.isArray(s) ? s : [s];
932
- if (!y.length) return;
933
- const g = y.map((_) => ({
938
+ }, Pe = async (s, d) => {
939
+ const m = Array.isArray(s) ? s : [s];
940
+ if (!m.length) return;
941
+ const g = m.map((_) => ({
934
942
  ..._,
935
943
  _id: e.menu._id,
936
944
  _rev: e.menu._rev
937
945
  }));
938
946
  try {
939
947
  if (d || g.some(
940
- (A) => [G.F_OPERATION_TYPE.delete, G.F_OPERATION_TYPE.deleteMany].includes(A.operation)
948
+ (A) => [B.F_OPERATION_TYPE.delete, B.F_OPERATION_TYPE.deleteMany].includes(A.operation)
941
949
  )) {
942
950
  const A = await He(g, e.menu.modules);
943
951
  if (A !== !0) throw new Error(A);
944
952
  }
945
- const _ = await bt.updateMenuModule(e.menu, g);
953
+ const _ = await wt.updateMenuModule(e.menu, g);
946
954
  return f(_.menu), _;
947
955
  } catch (_) {
948
956
  n.open({
@@ -959,28 +967,28 @@ const Pt = Xe(
959
967
  priceTierSettings: s.priceTierSettings
960
968
  };
961
969
  return f(d), d;
962
- }, V = St({ maxHistorySize: 50 }), Ke = S(() => V.canUndo.value), Pe = S(() => V.canRedo.value), $e = () => {
963
- const s = V.undo();
964
- s && f(s, !1);
965
- }, je = () => {
966
- const s = V.redo();
970
+ }, D = bt({ maxHistorySize: 50 }), Ke = S(() => D.canUndo.value), $e = S(() => D.canRedo.value), je = () => {
971
+ const s = D.undo();
967
972
  s && f(s, !1);
968
973
  }, Ne = () => {
969
- V.clear();
974
+ const s = D.redo();
975
+ s && f(s, !1);
976
+ }, Ue = () => {
977
+ D.clear();
970
978
  };
971
979
  return {
972
980
  state: e,
973
981
  // loading state
974
- workerIsComputing: m,
975
- mergedMenuChangeId: v,
982
+ workerIsComputing: v,
983
+ mergedMenuChangeId: y,
976
984
  // async computed state
977
- mergedMenu: h,
985
+ mergedMenu: p,
978
986
  // Computed
979
987
  version: r,
980
- isV4: a,
988
+ isV4: u,
981
989
  serveSequence: o,
982
990
  catalogs: l,
983
- currentCatalog: u,
991
+ currentCatalog: a,
984
992
  schedulers: c,
985
993
  currentScheduler: i,
986
994
  catalogOptions: me,
@@ -988,8 +996,9 @@ const Pt = Xe(
988
996
  subcategories: ve,
989
997
  items: ee,
990
998
  sortedItems: ye,
991
- categorizedItems: he,
992
- categorizedRawMenuItems: pe,
999
+ itemCodeMap: Ie,
1000
+ categorizedItems: pe,
1001
+ categorizedRawMenuItems: he,
993
1002
  variants: N,
994
1003
  groups: _e,
995
1004
  takeaways: Se,
@@ -999,31 +1008,31 @@ const Pt = Xe(
999
1008
  cookingGuide: Ae,
1000
1009
  skus: Ce,
1001
1010
  rules: U,
1002
- taxSetting: Re,
1011
+ taxSetting: ke,
1003
1012
  // Action
1004
1013
  setMenu: f,
1005
- readMenu: Ee,
1006
- readRestaurants: xe,
1014
+ readMenu: xe,
1015
+ readRestaurants: Oe,
1007
1016
  selectCatalog: te,
1008
- selectScheduler: Oe,
1017
+ selectScheduler: De,
1009
1018
  selectCategory: Ve,
1010
- setRestaurantAttrParams: De,
1011
- updateMenu: Te,
1019
+ setRestaurantAttrParams: Te,
1020
+ updateMenu: Pe,
1012
1021
  updateMenuSetting: Fe,
1013
- computeMergedMenu: p,
1022
+ computeMergedMenu: h,
1014
1023
  // helper
1015
1024
  encodeTax: W,
1016
- decodeTax: Ie,
1017
- getSelectedTax: ke,
1025
+ decodeTax: Ee,
1026
+ getSelectedTax: Re,
1018
1027
  mapVariant: ge,
1019
1028
  // history
1020
1029
  canUndoHistory: Ke,
1021
- canRedoHistory: Pe,
1022
- undoHistory: $e,
1023
- redoHistory: je,
1030
+ canRedoHistory: $e,
1031
+ undoHistory: je,
1032
+ redoHistory: Ne,
1024
1033
  // cleanup
1025
1034
  $dispose: () => {
1026
- w.cancel(), k && (k(), k = null), I && (I.stop(), I = null), Ne();
1035
+ w.cancel(), E && (E(), E = null), I && (I.stop(), I = null), Ue();
1027
1036
  },
1028
1037
  $reinitialize: () => {
1029
1038
  Q();
@@ -1032,12 +1041,12 @@ const Pt = Xe(
1032
1041
  }
1033
1042
  );
1034
1043
  export {
1035
- Dt as a,
1036
- Tt as b,
1044
+ Tt as a,
1045
+ Pt as b,
1037
1046
  Ft as c,
1038
1047
  Kt as f,
1039
1048
  Vt as g,
1040
- Ot as m,
1041
- at as o,
1042
- Pt as u
1049
+ Dt as m,
1050
+ it as o,
1051
+ $t as u
1043
1052
  };