@feedmepos/mf-menu 0.31.33 → 0.31.34-alpha

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 (101) hide show
  1. package/dist/{App-DNDOc3bV.js → App-CaKDbV0S.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BvrfcWHU.js → ApplyProduct.vue_vue_type_script_setup_true_lang-gY18sRMg.js} +20 -20
  3. package/dist/{Catalog-Zhi-3W6T.js → Catalog-B0zMoi7e.js} +80 -80
  4. package/dist/{Category-BU0bkAGd.js → Category-Dyou6Q17.js} +31 -27
  5. package/dist/{Category-CE9ixFkD.js → Category-rMN8037Q.js} +19 -19
  6. package/dist/{CookingGuide-eghVaeEY.js → CookingGuide-DT2XxaWa.js} +4 -4
  7. package/dist/CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cv9LNAfi.js +113 -0
  8. package/dist/{Group-DWrtP9Au.js → Group-CYSIOe3D.js} +1 -1
  9. package/dist/{Group-DDZPf6LY.js → Group-M4WPAAYz.js} +3 -3
  10. package/dist/Group.vue_vue_type_script_setup_true_lang-B-BH-2WN.js +686 -0
  11. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-TQWka93A.js +367 -0
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Cus0YKUt.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DgSO7SQW.js} +4982 -5081
  13. package/dist/{Ingredient-BJgvOyV9.js → Ingredient-DNvr30pW.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CF99abLi.js → InventoryBinding.vue_vue_type_script_setup_true_lang-G44luws0.js} +1052 -1052
  15. package/dist/LinkProductSideSheet-Cp0HFoP2.js +297 -0
  16. package/dist/LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js +8024 -0
  17. package/dist/{MenuSetting-gkwORUX0.js → MenuSetting-UeQ2NyVm.js} +4 -4
  18. package/dist/{PrintRoute-Cda6sFlL.js → PrintRoute-5uX9ymJY.js} +89 -88
  19. package/dist/{Product-61AAh5L-.js → Product-Dxqf8_iq.js} +1 -1
  20. package/dist/Product.vue_vue_type_script_setup_true_lang-DUtGVRCH.js +1578 -0
  21. package/dist/{ProductInternalTools-o8cVZXCT.js → ProductInternalTools-BCF9q0i_.js} +5 -5
  22. package/dist/Products--adhOQ8n.js +283 -0
  23. package/dist/{Publish-BRgJUzoA.js → Publish-CRaoaFxc.js} +3 -3
  24. package/dist/{Recipe-CV8lvryp.js → Recipe-DPkzZMJi.js} +4 -4
  25. package/dist/{Scheduler-B_ptvb82.js → Scheduler-BuwjNHHj.js} +3 -3
  26. package/dist/{ServingSequence-DABGnLbT.js → ServingSequence-Cdf_Zmat.js} +3 -3
  27. package/dist/Setting-Vr3Thttm.js +259 -0
  28. package/dist/{Subcategory-BiqlAvMs.js → Subcategory-DoXmjcg1.js} +4 -4
  29. package/dist/{Takeaway-BBdkzEiP.js → Takeaway-BRTQu8VT.js} +1 -1
  30. package/dist/{Takeaway-nIjrDu5C.js → Takeaway-t3il54Bd.js} +4 -4
  31. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-D_M2PFO-.js → Takeaway.vue_vue_type_script_setup_true_lang-DtHABSgp.js} +6 -6
  32. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-D_ACNj_Z.js +431 -0
  33. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DAoGiRV-.js +5990 -0
  34. package/dist/{Unit-Di5sUbhV.js → Unit-C_QY3IX_.js} +2 -2
  35. package/dist/{Variant-CiZCtZk9.js → Variant-CR4IEm-Q.js} +3 -3
  36. package/dist/_id_-DOU7ieGB.js +202 -0
  37. package/dist/{app-B63V5b4I.js → app--fRC3N4C.js} +1 -1
  38. package/dist/{app-DuD_IPou.js → app-CrXLAKdw.js} +95 -97
  39. package/dist/app.js +6 -7
  40. package/dist/apps/mf-menu/src/app.d.ts +62 -3
  41. package/dist/apps/mf-menu/src/components/feature/PriceTier/LinkPriceTierSection.vue.d.ts +24 -0
  42. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +30 -0
  43. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +33 -0
  44. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/catalog.d.ts +2 -0
  45. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +80 -1
  46. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +1276 -0
  47. package/dist/apps/mf-menu/src/helper/import-export.d.ts +77 -0
  48. package/dist/apps/mf-menu/src/helper/menu.d.ts +77 -0
  49. package/dist/apps/mf-menu/src/helper/setting/catalogSetting.d.ts +11 -2
  50. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +77 -0
  51. package/dist/apps/mf-menu/src/router/shared.d.ts +0 -1
  52. package/dist/apps/mf-menu/src/stores/manager/catalog.d.ts +2 -0
  53. package/dist/apps/mf-menu/src/stores/menu.d.ts +79 -0
  54. package/dist/apps/mf-menu/src/types/linkProducts.d.ts +21 -0
  55. package/dist/apps/mf-menu/src/views/PrintRoute/PrintDepartmentDialog.vue.d.ts +5 -3
  56. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +82 -0
  57. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  58. package/dist/assets/linked-status-BTF_dm9R.js +24 -0
  59. package/dist/assets/override-menu-BPu7TVCy.js +24 -0
  60. package/dist/assets/validate-menu-BQpDfHbr.js +24 -0
  61. package/dist/{catalog-DfYSMjLc.js → catalog-BGiDWODL.js} +1 -1
  62. package/dist/catalogSetting-C34kIcYn.js +71 -0
  63. package/dist/{category-mmjX_QdF.js → category-CayMSpUc.js} +1 -1
  64. package/dist/{currency-3ugQtBPt.js → currency-BggoZpJv.js} +1 -1
  65. package/dist/{dayjs.min-CkV4mNm8.js → dayjs.min-BKDTLohL.js} +1 -1
  66. package/dist/{index-Cztb2LVZ.js → index-BPcRbiW0.js} +3 -3
  67. package/dist/{index-BboaHtmY.js → index-CLFhXi0y.js} +3 -3
  68. package/dist/index-D7yR1j9C.js +215 -0
  69. package/dist/{index-BZaKuDcN.js → index-f9kzXNPD.js} +28 -28
  70. package/dist/{item-CVnDeXhJ.js → item-C51o9ejv.js} +547 -545
  71. package/dist/{jszip.min-GxfcHBC5.js → jszip.min-m57vowh9.js} +353 -353
  72. package/dist/{menu-sGVv4bhQ.js → menu-DHfLxvzU.js} +4 -4
  73. package/dist/menu-DK7wG3S5.js +133287 -0
  74. package/dist/menuV2-B-0V65cx.js +707 -0
  75. package/dist/mf-menu.css +1 -1
  76. package/dist/{priceTier-CHTA0ZEb.js → priceTier-DD-24pkj.js} +1 -1
  77. package/dist/{scheduler-CaMxCHZ0.js → scheduler-NjDv_P4c.js} +16 -17
  78. package/dist/subcategory-DLdBwjHV.js +148 -0
  79. package/dist/{toExcel-WorodvP1.js → toExcel-coJ5igRV.js} +15 -15
  80. package/dist/{unit-DtKZZYL6.js → unit-C7XUV0EW.js} +5 -4
  81. package/package.json +5 -5
  82. package/dist/CustomAttributeChip.vue_vue_type_script_setup_true_lang-BiF8rW4M.js +0 -7949
  83. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +0 -26
  84. package/dist/Group.vue_vue_type_script_setup_true_lang-DyqGsRAW.js +0 -698
  85. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BmRUg94d.js +0 -206
  86. package/dist/LinkProductSideSheet-CTT4oGUY.js +0 -112
  87. package/dist/Product.vue_vue_type_script_setup_true_lang-Cy4uok1E.js +0 -1560
  88. package/dist/Products-D0rrANT6.js +0 -270
  89. package/dist/Setting-3ISlMXOA.js +0 -258
  90. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-DzQ8_6Bi.js +0 -71
  91. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-y0n5hTLk.js +0 -6149
  92. package/dist/_id_-DY8himeL.js +0 -200
  93. package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +0 -70
  94. package/dist/assets/linked-status-CkBKnMXs.js +0 -24
  95. package/dist/assets/override-menu-XZ7XfcfS.js +0 -24
  96. package/dist/assets/validate-menu-Bomogq01.js +0 -24
  97. package/dist/catalogSetting-_4Z0s3_Q.js +0 -65
  98. package/dist/index-Ce4v8o7D.js +0 -106
  99. package/dist/menu-IGORh0Ik.js +0 -108039
  100. package/dist/subcategory-CmVttqlG.js +0 -817
  101. /package/dist/{apps/mf-menu/src/components → packages/shared/src/components/info}/CustomAttributeChip.vue.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-D_M2PFO-.js";
1
+ import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-DtHABSgp.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as f, computed as y, ref as k, createBlock as i, openBlock as d, unref as a, withCtx as s, createElementVNode as t, toDisplayString as b, createCommentVNode as g, createVNode as m } from "vue";
2
- import { D as x, u as v, O as w, J as E, G as M } from "./menu-IGORh0Ik.js";
2
+ import { D as x, u as v, O as w, J as E, G as M } from "./menu-DK7wG3S5.js";
3
3
  import { useI18n as T } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as V } from "@feedmepos/ui-library";
5
5
  import { _ as h } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
6
6
  import { _ as C } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-D_M2PFO-.js";
8
- import { T as O, l as S } from "./index-Cztb2LVZ.js";
9
- import { a as L } from "./menu-sGVv4bhQ.js";
7
+ import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-DtHABSgp.js";
8
+ import { T as O, l as S } from "./index-BPcRbiW0.js";
9
+ import { a as L } from "./menu-DHfLxvzU.js";
10
10
  const U = { class: "flex-1 flex justify-between gap-8 pl-8" }, B = { class: "flex items-center" }, D = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, F = { class: "fm-typo-en-body-md-600 font-semibold" }, z = /* @__PURE__ */ f({
11
11
  __name: "Takeaway",
12
12
  setup(I) {
@@ -1,14 +1,14 @@
1
1
  import { getCurrentInstance as te, defineComponent as oe, computed as h, watch as ne, h as R, resolveComponent as S, createElementBlock as C, openBlock as _, Fragment as O, normalizeClass as D, createElementVNode as k, createVNode as V, unref as t, isRef as j, withCtx as P, renderList as ie, createBlock as G, createCommentVNode as $, toDisplayString as I, withModifiers as H } from "vue";
2
- import { D as q, u as Q, O as W, J as N, G as z, H as L, A as se, at as J } from "./menu-IGORh0Ik.js";
2
+ import { D as q, u as Q, O as W, J as N, G as z, H as L, A as se, an as J } from "./menu-DK7wG3S5.js";
3
3
  import { useI18n as X, useCoreStore as re } from "@feedmepos/mf-common";
4
4
  import { useDialog as le, useSnackbar as Z, FmButtonVariant as A, components as ce, useBreakpoints as de } from "@feedmepos/ui-library";
5
- import { _ as ue } from "./app-DuD_IPou.js";
5
+ import { _ as ue } from "./app-CrXLAKdw.js";
6
6
  import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
7
- import { a as ye, l as ee, T as pe } from "./index-Cztb2LVZ.js";
7
+ import { a as ye, l as ee, T as pe } from "./index-BPcRbiW0.js";
8
8
  import { u as fe } from "./search-BAPEUu1R.js";
9
- import { f as F } from "./currency-3ugQtBPt.js";
9
+ import { f as F } from "./currency-BggoZpJv.js";
10
10
  import { defineStore as _e } from "pinia";
11
- import { C as ke } from "./catalog-DfYSMjLc.js";
11
+ import { C as ke } from "./catalog-BGiDWODL.js";
12
12
  import { c as ve } from "./createComponentProgrammatically-Bt2rn1IQ.js";
13
13
  function we(T, U, l, m) {
14
14
  var y, v, w, g;
@@ -123,7 +123,7 @@ const ge = _e("takeaway-manager", () => {
123
123
  };
124
124
  }), be = {
125
125
  key: 0,
126
- class: /* @__PURE__ */ D(["flex-1 overflow-hidden", "space-y-16", "flex flex-col", "overflow-hidden"])
126
+ class: /* @__PURE__ */ D(["flex-1 overflow-hidden", "space-y-16", "flex flex-col", "overflow-hidden", "pt-16"])
127
127
  }, he = {
128
128
  class: "flex items-center space-x-8 justify-end"
129
129
  }, xe = {
@@ -0,0 +1,431 @@
1
+ import { computed as i, defineComponent as D, ref as y, resolveComponent as P, createElementBlock as k, openBlock as v, normalizeClass as w, createVNode as z, normalizeStyle as A, withCtx as V, createBlock as b, createCommentVNode as K } from "vue";
2
+ import { G as p, J as M, D as R, O as S, ah as U, u as N, c as x } from "./menu-DK7wG3S5.js";
3
+ import { u as C } from "./menuV2-B-0V65cx.js";
4
+ import { C as I, h as $ } from "./catalog-BGiDWODL.js";
5
+ import { useSnackbar as F, useDialog as T } from "@feedmepos/ui-library";
6
+ import { b as L } from "./LinkProductSideSheet-Cp0HFoP2.js";
7
+ import { useI18n as B } from "@feedmepos/mf-common";
8
+ function j() {
9
+ const t = C(), s = i(() => t.categorizedRawMenuItems.filter((u) => u.items.length > 0)), d = i(() => {
10
+ const u = t.currentCatalog;
11
+ return u ? I.getItemAvailable(u).map((e) => ({ _id: e })) : [];
12
+ });
13
+ async function m(u) {
14
+ const e = t.currentCatalog;
15
+ if (!e) return;
16
+ const n = u.reduce(
17
+ (o, r) => (o[r] = O(
18
+ r,
19
+ e.override.items[r],
20
+ u.includes(r),
21
+ t.version === p.F_MENU_VERSION.enum.v3
22
+ ), o),
23
+ {}
24
+ ), a = {
25
+ ...e,
26
+ override: {
27
+ ...e.override,
28
+ items: {
29
+ ...n
30
+ }
31
+ }
32
+ };
33
+ await t.updateMenu({
34
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
35
+ operation: M.F_OPERATION_TYPE.update,
36
+ data: a
37
+ });
38
+ }
39
+ async function l(u) {
40
+ var o;
41
+ const e = t.currentCatalog;
42
+ if (!e) return;
43
+ const n = u.reduce(
44
+ (r, c) => {
45
+ const _ = e.override.items[c];
46
+ return r[c] = O(
47
+ c,
48
+ _,
49
+ !0,
50
+ t.version === p.F_MENU_VERSION.enum.v3
51
+ ), r;
52
+ },
53
+ {}
54
+ ), a = {
55
+ ...e,
56
+ override: {
57
+ ...e.override,
58
+ items: {
59
+ ...((o = e.override) == null ? void 0 : o.items) || {},
60
+ ...n
61
+ }
62
+ },
63
+ /**
64
+ * linkItemRules and items under override are two ways to manage linked items under catalog,
65
+ * if we changed items under override, we should clear linkItemRules to avoid conflict.
66
+ */
67
+ linkItemRules: null
68
+ };
69
+ await t.updateMenu({
70
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
71
+ operation: M.F_OPERATION_TYPE.update,
72
+ data: a
73
+ });
74
+ }
75
+ async function g(u) {
76
+ var o;
77
+ const e = t.currentCatalog;
78
+ if (!e) return;
79
+ const n = u.reduce(
80
+ (r, c) => {
81
+ const _ = e.override.items[c];
82
+ return r[c] = O(
83
+ c,
84
+ _,
85
+ !1,
86
+ t.version === p.F_MENU_VERSION.enum.v3
87
+ ), r;
88
+ },
89
+ {}
90
+ ), a = {
91
+ ...e,
92
+ override: {
93
+ ...e.override,
94
+ items: {
95
+ ...((o = e.override) == null ? void 0 : o.items) || {},
96
+ ...n
97
+ }
98
+ }
99
+ };
100
+ await t.updateMenu({
101
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
102
+ operation: M.F_OPERATION_TYPE.update,
103
+ data: a
104
+ });
105
+ }
106
+ async function f(u) {
107
+ const e = t.currentCatalog;
108
+ if (!e) return;
109
+ const n = {
110
+ ...e,
111
+ linkItemRules: u
112
+ };
113
+ await t.updateMenu({
114
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
115
+ operation: M.F_OPERATION_TYPE.update,
116
+ data: n
117
+ });
118
+ }
119
+ return {
120
+ linkableItems: s,
121
+ currentItems: d,
122
+ setProduct: m,
123
+ applyProduct: l,
124
+ removeProduct: g,
125
+ saveLinkItemRules: f
126
+ };
127
+ }
128
+ function O(t, s, d, m) {
129
+ const l = s == null ? void 0 : s.find((u) => !u.combinationKey), g = d ? null : p.F_ORDER_FROM.enum.NONE, f = m ? d ? null : "" : l == null ? void 0 : l.category;
130
+ return [
131
+ {
132
+ ...l ?? {},
133
+ orderFrom: g,
134
+ category: f,
135
+ _id: t
136
+ },
137
+ ...(s == null ? void 0 : s.filter((u) => !!u.combinationKey)) ?? []
138
+ ];
139
+ }
140
+ function G() {
141
+ const t = C(), s = F(), d = T(), m = R(s), l = S(m), g = i(() => {
142
+ const e = t.categorizedRawMenuItems, n = new Set(
143
+ t.currentCatalog ? I.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((a) => a._id)
144
+ );
145
+ return e.map((a) => ({
146
+ ...a,
147
+ items: a.items.filter((o) => n.has(o._id))
148
+ })).filter((a) => a.items.length > 0);
149
+ }), f = i(() => {
150
+ var o;
151
+ const e = t.currentScheduler;
152
+ if (!e) return [];
153
+ const n = t.currentCatalog, a = n ? ((o = n.override.scheduler[e._id]) == null ? void 0 : o.items) ?? [] : e.items;
154
+ return [
155
+ ...new Set(a.filter((r) => r.orderFrom != p.F_ORDER_FROM.enum.NONE).map((r) => r._id))
156
+ ].map((r) => ({ _id: r }));
157
+ });
158
+ async function u(e) {
159
+ const n = t.currentScheduler;
160
+ if (!n) return;
161
+ const a = t.currentCatalog;
162
+ if (a && t.rules.scheduler.override) {
163
+ const o = new I(
164
+ a,
165
+ t,
166
+ l.updateMenu,
167
+ d
168
+ );
169
+ o.overrideCatalogSchedulerItems(e, n._id), await t.updateMenu({
170
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
171
+ operation: M.F_OPERATION_TYPE.update,
172
+ data: o.getCatalog()
173
+ });
174
+ } else {
175
+ const o = e.reduce(
176
+ (c, _) => {
177
+ const h = n.items.filter((E) => E._id == _) ?? [];
178
+ return c = c.concat(
179
+ U(_, h, (E) => ({
180
+ ...E,
181
+ orderFrom: null
182
+ }))
183
+ ), c;
184
+ },
185
+ []
186
+ ), r = {
187
+ ...n,
188
+ items: o
189
+ };
190
+ await t.updateMenu({
191
+ module: p.F_MENU_MODULE_V4_KEY.enum.scheduler,
192
+ operation: M.F_OPERATION_TYPE.update,
193
+ data: r
194
+ });
195
+ }
196
+ }
197
+ return {
198
+ linkableItems: g,
199
+ currentItems: f,
200
+ applyProduct: u
201
+ };
202
+ }
203
+ const J = () => {
204
+ const t = N(), s = F(), d = R(s), m = S(d), l = i(() => t.categorizedRawMenuItems.filter((e) => e.items.length > 0)), g = i(() => {
205
+ const e = t.currentCatalog;
206
+ return e ? I.getItemAvailable(e).map((n) => ({ _id: n })) : [];
207
+ });
208
+ async function f(e) {
209
+ const n = t.currentCatalog;
210
+ if (!n) return;
211
+ const o = t.state.menu.modules.item.map((c) => c._id).reduce(
212
+ (c, _) => {
213
+ const h = n.override.items[_];
214
+ return c[_] = $(
215
+ _,
216
+ h,
217
+ e.includes(_),
218
+ t.version === x.F_MENU_VERSION.v3
219
+ ), c;
220
+ },
221
+ {}
222
+ ), r = {
223
+ ...n,
224
+ override: { ...n.override, items: o },
225
+ /**
226
+ * linkItemRules and items under override are two ways to manage linked items under catalog,
227
+ * if we changed items under override, we should clear linkItemRules to avoid conflict.
228
+ */
229
+ linkItemRules: null
230
+ };
231
+ await m.updateMenu(
232
+ {
233
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
234
+ operation: M.F_OPERATION_TYPE.update,
235
+ data: r
236
+ },
237
+ r.name
238
+ );
239
+ }
240
+ async function u(e) {
241
+ const n = t.currentCatalog;
242
+ if (!n) return;
243
+ const a = {
244
+ ...n,
245
+ linkItemRules: e
246
+ };
247
+ await m.updateMenu(
248
+ {
249
+ module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
250
+ operation: M.F_OPERATION_TYPE.update,
251
+ data: a
252
+ },
253
+ a.name
254
+ );
255
+ }
256
+ return {
257
+ linkableItems: l,
258
+ currentItems: g,
259
+ applyProduct: f,
260
+ saveLinkItemRules: u
261
+ };
262
+ }, q = () => {
263
+ const t = N(), s = F(), d = T(), m = R(s), l = S(m), g = i(() => {
264
+ const e = t.categorizedRawMenuItems, n = new Set(
265
+ t.currentCatalog ? I.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((a) => a._id)
266
+ );
267
+ return e.map((a) => ({
268
+ ...a,
269
+ items: a.items.filter((o) => n.has(o._id))
270
+ })).filter((a) => a.items.length > 0);
271
+ }), f = i(() => {
272
+ var o;
273
+ const e = t.currentScheduler;
274
+ if (!e) return [];
275
+ const n = t.currentCatalog, a = n ? ((o = n.override.scheduler[e._id]) == null ? void 0 : o.items) ?? [] : e.items;
276
+ return [
277
+ ...new Set(a.filter((r) => r.orderFrom != p.F_ORDER_FROM.enum.NONE).map((r) => r._id))
278
+ ].map((r) => ({ _id: r }));
279
+ });
280
+ async function u(e) {
281
+ const n = t.currentScheduler;
282
+ if (!n) return;
283
+ const a = t.currentCatalog;
284
+ if (a && t.rules.scheduler.override) {
285
+ const o = new I(a, t, l.updateMenu, d);
286
+ o.overrideCatalogSchedulerItems(e, n._id), await o.update();
287
+ } else {
288
+ const o = e.reduce(
289
+ (c, _) => {
290
+ const h = n.items.filter((E) => E._id == _) ?? [];
291
+ return c = c.concat(
292
+ U(_, h, (E) => ({
293
+ ...E,
294
+ orderFrom: null
295
+ }))
296
+ ), c;
297
+ },
298
+ []
299
+ ), r = {
300
+ ...n,
301
+ items: o
302
+ };
303
+ await l.updateMenu(
304
+ {
305
+ module: p.F_MENU_MODULE_V4_KEY.enum.scheduler,
306
+ operation: M.F_OPERATION_TYPE.update,
307
+ data: r
308
+ },
309
+ r.name
310
+ );
311
+ }
312
+ }
313
+ return {
314
+ linkableItems: g,
315
+ currentItems: f,
316
+ applyProduct: u
317
+ };
318
+ };
319
+ function ae(t) {
320
+ if (!t) {
321
+ const e = N(), n = i(() => e.state.menu.modules.item ?? []), a = i(() => {
322
+ var h;
323
+ return ((h = e.currentCatalog) == null ? void 0 : h.linkItemRules) ?? null;
324
+ }), o = q(), r = J(), c = i(() => !e.state.currentSchedulerId);
325
+ return {
326
+ menuItems: n,
327
+ linkItemRules: a,
328
+ catalogManager: r,
329
+ schedulerManager: o,
330
+ noScheduler: c,
331
+ handleSubmit: (h) => {
332
+ if (h.mode === L.Rules)
333
+ r.saveLinkItemRules(h.linkItemRules);
334
+ else {
335
+ const E = h.items.map((Y) => Y._id);
336
+ c.value ? r.applyProduct(E) : o.applyProduct(E);
337
+ }
338
+ }
339
+ };
340
+ }
341
+ const s = C(), d = i(() => s.state.menu.modules.item ?? []), m = i(() => {
342
+ var e;
343
+ return ((e = s.currentCatalog) == null ? void 0 : e.linkItemRules) ?? null;
344
+ }), l = G(), g = j(), f = i(() => !s.state.currentSchedulerId);
345
+ return {
346
+ menuItems: d,
347
+ linkItemRules: m,
348
+ catalogManager: g,
349
+ schedulerManager: l,
350
+ noScheduler: f,
351
+ handleSubmit: (e) => {
352
+ if (e.mode === L.Rules)
353
+ g.saveLinkItemRules(e.linkItemRules);
354
+ else {
355
+ const n = e.items.map((a) => a._id);
356
+ f.value ? g.applyProduct(n) : l.applyProduct(n);
357
+ }
358
+ }
359
+ };
360
+ }
361
+ const H = ["alt", "src", "crossorigin"], re = /* @__PURE__ */ D({
362
+ __name: "Thumbnail",
363
+ props: {
364
+ src: {},
365
+ alt: {},
366
+ className: {},
367
+ size: {},
368
+ crossorigin: { type: Boolean, default: !0 }
369
+ },
370
+ setup(t) {
371
+ const s = t, { t: d } = B(), m = y(!1), l = y(!s.src), g = () => {
372
+ m.value = !1, l.value = !0;
373
+ }, f = () => {
374
+ m.value = !0, l.value = !0;
375
+ }, u = i(() => s.alt ? d("menu.thumbnail.alt.with_name", { name: s.alt }) : d("menu.thumbnail.alt.default")), e = i(() => typeof s.size == "number" ? {
376
+ width: s.size,
377
+ height: s.size
378
+ } : {
379
+ width: s.size.width,
380
+ height: s.size.height
381
+ }), n = i(() => {
382
+ if (!s.src) return null;
383
+ if (s.crossorigin) {
384
+ const a = s.src.includes("?") ? "&" : "?";
385
+ return `${s.src}${a}_cors=${Date.now()}`;
386
+ }
387
+ return s.src;
388
+ });
389
+ return (a, o) => {
390
+ const r = P("fm-icon"), c = P("fm-card");
391
+ return v(), k("div", {
392
+ class: w([a.className, "flex items-center justify-center"])
393
+ }, [
394
+ z(c, {
395
+ class: w(["flex items-center justify-center", "rounded-md"]),
396
+ style: A({ width: `${e.value.width}px`, height: `${e.value.height}px` }),
397
+ variant: "outlined"
398
+ }, {
399
+ default: V(() => [
400
+ n.value && !m.value ? (v(), k("img", {
401
+ key: 0,
402
+ alt: u.value,
403
+ class: w(["w-full h-full", "object-cover", l.value ? "" : "hidden"]),
404
+ src: n.value,
405
+ crossorigin: s.crossorigin ? "anonymous" : void 0,
406
+ onError: f,
407
+ onLoad: g
408
+ }, null, 42, H)) : (v(), b(r, {
409
+ key: 1,
410
+ color: "neutral-gray-300",
411
+ name: "image",
412
+ outline: ""
413
+ })),
414
+ l.value ? K("", !0) : (v(), b(r, {
415
+ key: 2,
416
+ class: "animate-spin",
417
+ name: "progress_activity",
418
+ spin: ""
419
+ }))
420
+ ]),
421
+ _: 1
422
+ }, 8, ["style"])
423
+ ], 2);
424
+ };
425
+ }
426
+ });
427
+ export {
428
+ re as _,
429
+ j as a,
430
+ ae as u
431
+ };