@feedmepos/mf-menu 0.31.40-beta.2 → 0.31.40-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/{App-CoKv0BFp.js → App-aWEH-ZEk.js} +9 -9
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-B14Q0hS_.js → ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js} +3 -3
  3. package/dist/{Catalog-BRovMtuI.js → Catalog-BoFfFdn8.js} +9 -8
  4. package/dist/{Category-DytZqgIt.js → Category-CWYbb3Jn.js} +4 -4
  5. package/dist/{Category-CT8-B4zh.js → Category-DZ45uikR.js} +6 -6
  6. package/dist/{CookingGuide-Ct5qRLG0.js → CookingGuide-BU0PRWIQ.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-D3R3TCba.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js} +1 -1
  8. package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +50 -0
  9. package/dist/{Group-Dk1yQTTt.js → Group-BMQDeqiS.js} +1 -1
  10. package/dist/{Group-G_H8i5_8.js → Group-C0T_uknK.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-CoTdB2d5.js → Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js} +8 -8
  12. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +367 -0
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BKx7uQtR.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js} +14 -13
  14. package/dist/{Ingredient-ChynYQq6.js → Ingredient-3lwDUQx_.js} +3 -3
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DyaUxnMx.js → InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js} +2 -2
  16. package/dist/LinkProductSideSheet-LDZjKX95.js +297 -0
  17. package/dist/{app-CiBqmBzO.js → LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js} +2084 -2120
  18. package/dist/MenuSetting-AhutsCVy.js +185 -0
  19. package/dist/{PrintRoute-DwAZHUrQ.js → PrintRoute-DfJ-vUAb.js} +4 -4
  20. package/dist/{Product-Bx2NPQvC.js → Product-F4PoLm9v.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-od_O6x7E.js → Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js} +465 -468
  22. package/dist/{ProductInternalTools-BOguHh06.js → ProductInternalTools-DSGU-OqU.js} +6 -6
  23. package/dist/{Products-DA2hOsxr.js → Products-COzW2Z4g.js} +85 -88
  24. package/dist/{Publish-WATQWkjh.js → Publish-CDXVWCk2.js} +3 -3
  25. package/dist/{Recipe-WPwGgur3.js → Recipe-BZx4wrcP.js} +4 -4
  26. package/dist/{Scheduler-Djjggrh2.js → Scheduler-wHCWSeU2.js} +3 -3
  27. package/dist/{ServingSequence-CryZJTWA.js → ServingSequence-BbYEhDYh.js} +3 -3
  28. package/dist/{Setting-BtLsmoqY.js → Setting-C9Tlw1Iy.js} +45 -44
  29. package/dist/{Subcategory-BvlYDquD.js → Subcategory-C8AwfrKb.js} +4 -4
  30. package/dist/{Takeaway-8khxlcKQ.js → Takeaway-DaEUn-yM.js} +4 -4
  31. package/dist/{Takeaway-BBvFxAlx.js → Takeaway-t1053wg2.js} +1 -1
  32. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-B8blN-yJ.js → Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js} +5 -5
  33. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-CA9RlNkt.js → Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js} +95 -97
  34. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js +5998 -0
  35. package/dist/{Unit-Diu00sM2.js → Unit-CnqptGCz.js} +2 -2
  36. package/dist/{Variant-CO15W0wb.js → Variant-DiOYOwJs.js} +3 -3
  37. package/dist/{_id_-CxA_FzSG.js → _id_-BSfU16VO.js} +75 -78
  38. package/dist/{app-Blbof2Ga.js → app-Cou6qPF2.js} +1 -1
  39. package/dist/{app-5ESai6-B.js → app-Ddb81PNo.js} +278 -278
  40. package/dist/app.js +1 -1
  41. package/dist/apps/mf-menu/src/api/menu.d.ts +1 -2
  42. package/dist/apps/mf-menu/src/app.d.ts +0 -144
  43. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +0 -36
  44. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +3 -9
  45. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +9 -2
  46. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +4 -294
  47. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +0 -40
  48. package/dist/apps/mf-menu/src/helper/import-export.d.ts +0 -285
  49. package/dist/apps/mf-menu/src/helper/menu.d.ts +0 -285
  50. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +0 -285
  51. package/dist/apps/mf-menu/src/stores/menu.d.ts +3 -293
  52. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +0 -166
  53. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/assets/linked-status-B_crHhZH.js +24 -0
  55. package/dist/assets/override-menu-BmlCEpHH.js +24 -0
  56. package/dist/assets/validate-menu-CF-psoB-.js +24 -0
  57. package/dist/{catalog-CXjEQ80k.js → catalog-DSuJhsUb.js} +1 -1
  58. package/dist/{catalogSetting-aJSUDY_z.js → catalogSetting-C3gEw9ov.js} +1 -1
  59. package/dist/{category-TqQULuHq.js → category-CwWq3KCE.js} +1 -1
  60. package/dist/{currency-CRjh8ne7.js → currency-g45Sh-t6.js} +1 -1
  61. package/dist/{dayjs.min-MBmYgyRY.js → dayjs.min-g3eN5z-V.js} +1 -1
  62. package/dist/index-0Q5T9VZV.js +214 -0
  63. package/dist/{index-dkHuztwB.js → index-0yRUi7LL.js} +1 -1
  64. package/dist/{index-CzjFGFvP.js → index-BLQCYEc6.js} +8 -7
  65. package/dist/{index-B1NS2hBa.js → index-QsLFbxyG.js} +4 -4
  66. package/dist/{item-Dj14On9a.js → item-BvvQ9urP.js} +386 -386
  67. package/dist/{jszip.min-Be1afVon.js → jszip.min-DzdUiaR4.js} +353 -353
  68. package/dist/{menu-C0Xu-iTb.js → menu-DFNvhoNQ.js} +31149 -31298
  69. package/dist/{menu-kRDoPBjm.js → menu-QrVg2Ph7.js} +7 -7
  70. package/dist/{menuV2-D6Gmxd9X.js → menuV2-Ezf_jW40.js} +137 -142
  71. package/dist/mf-menu.css +1 -1
  72. package/dist/{priceTier-CJlFGOpm.js → priceTier-zENsn3P_.js} +1 -1
  73. package/dist/{scheduler-B11d6fJr.js → scheduler-BuwGSv6A.js} +8 -8
  74. package/dist/{subcategory-D6hTbHP-.js → subcategory-O3L_zCJA.js} +2 -2
  75. package/dist/{toExcel-BedErXvS.js → toExcel-CpRy_4nG.js} +2 -2
  76. package/dist/{unit-D5jDzsM2.js → unit-Ct_7Hfa2.js} +41 -42
  77. package/package.json +3 -3
  78. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B_Yv8Thl.js +0 -399
  79. package/dist/LinkProductSideSheet-DsoPo7Q_.js +0 -361
  80. package/dist/MenuSetting-CDSc-56P.js +0 -618
  81. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-LVWB5CIa.js +0 -5994
  82. package/dist/apps/mf-menu/src/composable/attributes.d.ts +0 -26
  83. package/dist/apps/mf-menu/src/utils/array.d.ts +0 -1
  84. package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +0 -12
  85. package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +0 -2
  86. package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +0 -176
  87. package/dist/assets/linked-status-x1efKEih.js +0 -13
  88. package/dist/assets/override-menu-D8d9BWzy.js +0 -13
  89. package/dist/assets/validate-menu-DUJ20GHx.js +0 -13
  90. package/dist/customAttributes-32VmzFKZ.js +0 -177
  91. package/dist/index-FzHOAFSW.js +0 -246
@@ -1,81 +1,81 @@
1
- import { ref as V, computed as h, defineComponent as K, resolveComponent as z, createBlock as I, openBlock as m, withCtx as T, createElementVNode as g, createVNode as d, unref as a, createElementBlock as C, Fragment as pe, renderList as we, createCommentVNode as U, normalizeClass as ve, toDisplayString as B, withModifiers as fe, mergeModels as Je, useModel as Xe, renderSlot as _e, watch as de, createTextVNode as et, watchEffect as tt, nextTick as Ae, resolveDynamicComponent as lt, onMounted as at, h as L, isRef as je, normalizeStyle as ft } from "vue";
2
- import { u as Ve, Q as Ce, B as me, H as Re, I as ge, U as gt, aa as bt, ab as _t, ac as Pe, ad as yt, P as ht, ae as Ee } from "./menu-C0Xu-iTb.js";
3
- import { useI18n as Ie, useCoreStore as Oe, useCustomAttributes as xt } from "@feedmepos/mf-common";
4
- import { u as Se } from "./menu-kRDoPBjm.js";
1
+ import { ref as I, computed as h, defineComponent as K, resolveComponent as z, createBlock as $, openBlock as m, withCtx as P, createElementVNode as g, createVNode as d, unref as a, createElementBlock as C, Fragment as de, renderList as ke, createCommentVNode as R, normalizeClass as me, toDisplayString as B, withModifiers as ve, mergeModels as Ze, useModel as Je, renderSlot as _e, watch as ie, createTextVNode as Xe, watchEffect as et, nextTick as Pe, resolveDynamicComponent as tt, onMounted as lt, h as G, isRef as Ne, normalizeStyle as ft } from "vue";
2
+ import { u as Fe, Q as xe, B as ce, H as Ae, I as ge, U as gt, aa as bt, ab as _t, ac as Te, ad as yt, P as ht, ae as je } from "./menu-DFNvhoNQ.js";
3
+ import { useI18n as Ve, useCoreStore as Me, useCustomAttributes as xt } from "@feedmepos/mf-common";
4
+ import { u as we } from "./menu-QrVg2Ph7.js";
5
5
  import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
6
- import { L as Ge } from "./LinkProductSideSheet-DsoPo7Q_.js";
7
- import { r as Ct, _ as Le } from "./index-FzHOAFSW.js";
8
- import { _ as Ue, a as qe } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-D3R3TCba.js";
9
- import { _ as Me, u as kt } from "./Thumbnail.vue_vue_type_script_setup_true_lang-CA9RlNkt.js";
10
- import { f as wt, o as St, a as Ft, m as Vt } from "./menuV2-D6Gmxd9X.js";
11
- import { u as ot, C as It } from "./item-Dj14On9a.js";
12
- import { b as We, H as $t } from "./app-CiBqmBzO.js";
13
- import { useBreakpoints as rt, components as te, useDialog as Tt, FmButtonColorThemeVariant as q, FmButtonVariant as ee } from "@feedmepos/ui-library";
14
- import { F as Pt } from "./index-dkHuztwB.js";
15
- import { _ as ze, a as At } from "./app-5ESai6-B.js";
16
- import { _ as ke } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
17
- import { _ as Rt } from "./index-B1NS2hBa.js";
18
- import { r as Ut, _ as Mt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-BKx7uQtR.js";
6
+ import { L as Ee } from "./LinkProductSideSheet-LDZjKX95.js";
7
+ import { r as Ct, _ as Ge } from "./index-0Q5T9VZV.js";
8
+ import { _ as Re, a as Le } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js";
9
+ import { _ as Ue, u as kt } from "./Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js";
10
+ import { f as wt, o as St, a as Ft, m as Vt } from "./menuV2-Ezf_jW40.js";
11
+ import { u as at, C as It } from "./item-BvvQ9urP.js";
12
+ import { b as qe, H as $t } from "./LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js";
13
+ import { useBreakpoints as ot, components as le, useDialog as Tt, FmButtonColorThemeVariant as L, FmButtonVariant as te } from "@feedmepos/ui-library";
14
+ import { F as Pt } from "./index-0yRUi7LL.js";
15
+ import { _ as Oe, a as At } from "./app-Ddb81PNo.js";
16
+ import { _ as Ce } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
17
+ import { _ as Rt } from "./index-QsLFbxyG.js";
18
+ import { r as Ut, _ as Mt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js";
19
19
  import { c as Ot } from "./check-C9mY6LiX.js";
20
- import { f as zt } from "./currency-CRjh8ne7.js";
20
+ import { f as zt } from "./currency-g45Sh-t6.js";
21
21
  import { w as Dt } from "./tooltip-B5BiPMx9.js";
22
22
  function Bt(k, e) {
23
- const n = V(!0), i = h(() => {
23
+ const r = I(!0), i = h(() => {
24
24
  var s, f;
25
- return !n.value && (!e.value || ((s = e.value) == null ? void 0 : s.length) === ((f = k.value) == null ? void 0 : f.length));
25
+ return !r.value && (!e.value || ((s = e.value) == null ? void 0 : s.length) === ((f = k.value) == null ? void 0 : f.length));
26
26
  }), l = h(() => {
27
27
  var s, f, p, b;
28
28
  return !!((s = e.value) != null && s.length && ((f = e.value) == null ? void 0 : f.length) > 0 && ((p = e.value) == null ? void 0 : p.length) < ((b = k.value) == null ? void 0 : b.length));
29
29
  });
30
- return { allCleared: n, allSelected: i, indeterminate: l, toggleAll: () => {
31
- e.value = void 0, n.value = !n.value;
30
+ return { allCleared: r, allSelected: i, indeterminate: l, toggleAll: () => {
31
+ e.value = void 0, r.value = !r.value;
32
32
  }, toggleOption: (s) => {
33
33
  var p, b, y;
34
34
  let f;
35
- e.value === void 0 && n.value ? f = [s] : e.value === void 0 && !n.value ? f = (p = k.value.map((w) => w.value)) == null ? void 0 : p.filter((w) => w !== s) : (b = e.value) != null && b.includes(s) ? f = (y = e.value) == null ? void 0 : y.filter((w) => w !== s) : f = [...e.value || [], s], f.length === 0 ? (e.value = void 0, n.value = !0) : f.length === k.value.length ? (e.value = void 0, n.value = !1) : e.value = f;
35
+ e.value === void 0 && r.value ? f = [s] : e.value === void 0 && !r.value ? f = (p = k.value.map((w) => w.value)) == null ? void 0 : p.filter((w) => w !== s) : (b = e.value) != null && b.includes(s) ? f = (y = e.value) == null ? void 0 : y.filter((w) => w !== s) : f = [...e.value || [], s], f.length === 0 ? (e.value = void 0, r.value = !0) : f.length === k.value.length ? (e.value = void 0, r.value = !1) : e.value = f;
36
36
  } };
37
37
  }
38
38
  const Kt = { class: "inline-flex items-center" }, Nt = {
39
39
  key: 0,
40
- class: /* @__PURE__ */ ve([
40
+ class: /* @__PURE__ */ me([
41
41
  "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
42
42
  "text-fm-color-neutral-gray-400"
43
43
  ])
44
- }, jt = { class: "p-4" }, Et = { class: "flex-1 overflow-y-auto min-h-0" }, He = /* @__PURE__ */ K({
44
+ }, jt = { class: "p-4" }, Et = { class: "flex-1 overflow-y-auto min-h-0" }, We = /* @__PURE__ */ K({
45
45
  __name: "CategorySelector",
46
46
  emits: ["toggleAttributeFilter"],
47
47
  setup(k, { emit: e }) {
48
- const n = e, i = Ve(), { categories: l, selectedCategories: u } = Se(), t = h(() => i.state.currentCategoryIds), s = h(
48
+ const r = e, i = Fe(), { categories: l, selectedCategories: u } = we(), t = h(() => i.state.currentCategoryIds), s = h(
49
49
  () => l.value.map((D) => ({ label: D.name, value: D.id }))
50
50
  ), f = h(() => s.value.filter(
51
51
  (D) => D.label.toLowerCase().includes(y.value.toLowerCase())
52
- )), { t: p } = Ie(), b = h(() => {
53
- var D, O, H;
54
- return l.value.length === ((D = u.value) == null ? void 0 : D.length) ? p("menu.category.selector.all") : ((O = u.value) == null ? void 0 : O.length) === 1 ? u.value[0].name : `${(H = u.value) == null ? void 0 : H.length}`;
55
- }), y = V(""), w = h({
52
+ )), { t: p } = Ve(), b = h(() => {
53
+ var D, O, W;
54
+ return l.value.length === ((D = u.value) == null ? void 0 : D.length) ? p("menu.category.selector.all") : ((O = u.value) == null ? void 0 : O.length) === 1 ? u.value[0].name : `${(W = u.value) == null ? void 0 : W.length}`;
55
+ }), y = I(""), w = h({
56
56
  get: () => t.value,
57
57
  set: (D) => {
58
58
  i.selectCategory(D);
59
59
  }
60
- }), { allSelected: W, toggleAll: Y, toggleOption: S, indeterminate: oe } = Bt(
60
+ }), { allSelected: q, toggleAll: Y, toggleOption: S, indeterminate: ne } = Bt(
61
61
  s,
62
62
  w
63
- ), Z = Oe(), re = h(() => Z.itemAttributeSettings.value.length > 0);
63
+ ), Z = Me(), re = h(() => Z.itemAttributeSettings.value.length > 0);
64
64
  function E() {
65
- n("toggleAttributeFilter");
65
+ r("toggleAttributeFilter");
66
66
  }
67
67
  return (D, O) => {
68
- const H = z("FmIcon"), J = z("FmChip"), ne = z("FmSearch"), Q = z("FmMenuItem"), se = z("FmMenu");
69
- return m(), I(se, {
68
+ const W = z("FmIcon"), J = z("FmChip"), se = z("FmSearch"), H = z("FmMenuItem"), M = z("FmMenu");
69
+ return m(), $(M, {
70
70
  "close-on-click": !1,
71
71
  width: 220
72
72
  }, {
73
- "menu-button": T(() => [
73
+ "menu-button": P(() => [
74
74
  g("div", Kt, [
75
75
  d(J, null, {
76
- default: T(() => [
77
- b.value ? (m(), C("div", Nt, B(a(p)("menu.category.selector.title", { label: b.value })), 1)) : U("", !0),
78
- d(H, {
76
+ default: P(() => [
77
+ b.value ? (m(), C("div", Nt, B(a(p)("menu.category.selector.title", { label: b.value })), 1)) : R("", !0),
78
+ d(W, {
79
79
  color: "neutral-gray-400",
80
80
  name: "expand_more",
81
81
  size: "sm"
@@ -83,47 +83,47 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
83
83
  re.value ? (m(), C("div", {
84
84
  key: 1,
85
85
  class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
86
- onClick: fe(E, ["stop"])
86
+ onClick: ve(E, ["stop"])
87
87
  }, [
88
- d(H, {
88
+ d(W, {
89
89
  name: "filter_alt",
90
90
  outline: "",
91
91
  color: "neutral-gray-400",
92
92
  size: "sm",
93
- onClick: O[0] || (O[0] = fe(() => {
93
+ onClick: O[0] || (O[0] = ve(() => {
94
94
  }, ["prevent"]))
95
95
  })
96
- ])) : U("", !0)
96
+ ])) : R("", !0)
97
97
  ]),
98
98
  _: 1
99
99
  })
100
100
  ])
101
101
  ]),
102
- default: T(() => [
102
+ default: P(() => [
103
103
  g("div", jt, [
104
- d(ne, {
104
+ d(se, {
105
105
  autofocus: "",
106
106
  modelValue: y.value,
107
- "onUpdate:modelValue": O[1] || (O[1] = (R) => y.value = R),
107
+ "onUpdate:modelValue": O[1] || (O[1] = (V) => y.value = V),
108
108
  placeholder: a(p)("menu.common.actions.search")
109
109
  }, null, 8, ["modelValue", "placeholder"])
110
110
  ]),
111
111
  g("div", Et, [
112
- d(Q, {
112
+ d(H, {
113
113
  label: "All",
114
114
  "has-checkbox": "",
115
- "model-value": a(W),
116
- indeterminate: a(oe),
115
+ "model-value": a(q),
116
+ indeterminate: a(ne),
117
117
  onClick: a(Y)
118
118
  }, null, 8, ["model-value", "indeterminate", "onClick"]),
119
- (m(!0), C(pe, null, we(f.value, (R) => {
120
- var $;
121
- return m(), I(Q, {
122
- key: R.value || "",
123
- label: R.label,
119
+ (m(!0), C(de, null, ke(f.value, (V) => {
120
+ var A;
121
+ return m(), $(H, {
122
+ key: V.value || "",
123
+ label: V.label,
124
124
  "has-checkbox": "",
125
- "model-value": a(W) || (($ = w.value) == null ? void 0 : $.includes(R.value)),
126
- onClick: (P) => a(S)(R.value)
125
+ "model-value": a(q) || ((A = w.value) == null ? void 0 : A.includes(V.value)),
126
+ onClick: (T) => a(S)(V.value)
127
127
  }, null, 8, ["label", "model-value", "onClick"]);
128
128
  }), 128))
129
129
  ])
@@ -138,14 +138,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
138
138
  }, Qt = { key: 0 }, Yt = {
139
139
  key: 1,
140
140
  class: "inline-block w-8"
141
- }, Zt = { key: 0 }, Jt = { key: 1 }, Qe = /* @__PURE__ */ K({
141
+ }, Zt = { key: 0 }, Jt = { key: 1 }, He = /* @__PURE__ */ K({
142
142
  __name: "CategoriesChip",
143
143
  props: {
144
144
  categories: { default: () => [] },
145
145
  ellipsis: { type: Boolean, default: !0 }
146
146
  },
147
147
  setup(k) {
148
- const e = k, { t: n } = Ie(), i = rt(), l = h(() => i.breakpoints.value.xs), u = h(() => e.ellipsis ? l.value ? 1 : 2 : 1 / 0), t = h(() => e.categories.length <= u.value ? e.categories : e.categories.slice(0, u.value)), s = V(!0), f = h(() => {
148
+ const e = k, { t: r } = Ve(), i = ot(), l = h(() => i.breakpoints.value.xs), u = h(() => e.ellipsis ? l.value ? 1 : 2 : 1 / 0), t = h(() => e.categories.length <= u.value ? e.categories : e.categories.slice(0, u.value)), s = I(!0), f = h(() => {
149
149
  if (s.value) {
150
150
  const b = t.value.join(", ");
151
151
  return b.length > 20 ? b.slice(0, 20) + "..." : b;
@@ -154,31 +154,31 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
154
154
  });
155
155
  return (p, b) => {
156
156
  const y = z("FmTooltip");
157
- return l.value ? (m(), C(pe, { key: 1 }, [
157
+ return l.value ? (m(), C(de, { key: 1 }, [
158
158
  p.categories.length > 0 ? (m(), C("p", Ht, [
159
- g("span", null, B(a(n)("menu.product.table.columns.category")) + ": ", 1),
159
+ g("span", null, B(a(r)("menu.product.table.columns.category")) + ": ", 1),
160
160
  g("span", null, B(f.value), 1),
161
161
  s.value ? (m(), C("span", Yt)) : (m(), C("br", Qt)),
162
162
  p.categories.length > u.value ? (m(), C("span", {
163
163
  key: 2,
164
164
  class: "fm-typo-en-body-md-400 text-fm-color-primary cursor-pointer",
165
- onClick: b[0] || (b[0] = fe((w) => s.value = !s.value, ["stop", "prevent"]))
165
+ onClick: b[0] || (b[0] = ve((w) => s.value = !s.value, ["stop", "prevent"]))
166
166
  }, [
167
- s.value ? (m(), C("span", Zt, B(a(n)("menu.product.table.category.expand", { count: p.categories.length - u.value })), 1)) : (m(), C("span", Jt, B(a(n)("menu.product.table.category.collapse")), 1))
168
- ])) : U("", !0)
169
- ])) : U("", !0)
170
- ], 64)) : (m(), I(y, {
167
+ s.value ? (m(), C("span", Zt, B(a(r)("menu.product.table.category.expand", { count: p.categories.length - u.value })), 1)) : (m(), C("span", Jt, B(a(r)("menu.product.table.category.collapse")), 1))
168
+ ])) : R("", !0)
169
+ ])) : R("", !0)
170
+ ], 64)) : (m(), $(y, {
171
171
  key: 0,
172
172
  class: "flex",
173
173
  variant: "rich",
174
174
  placement: "top",
175
175
  "z-index": 50
176
176
  }, {
177
- content: T(() => [
177
+ content: P(() => [
178
178
  g("div", Lt, [
179
- g("p", qt, B(a(n)("menu.product.table.category.all")), 1),
179
+ g("p", qt, B(a(r)("menu.product.table.category.all")), 1),
180
180
  g("div", Wt, [
181
- (m(!0), C(pe, null, we(e.categories, (w) => (m(), I(ke, {
181
+ (m(!0), C(de, null, ke(e.categories, (w) => (m(), $(Ce, {
182
182
  key: w,
183
183
  label: w,
184
184
  variant: "neutral"
@@ -186,18 +186,18 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
186
186
  ])
187
187
  ])
188
188
  ]),
189
- default: T(() => [
189
+ default: P(() => [
190
190
  g("div", Gt, [
191
- (m(!0), C(pe, null, we(t.value, (w) => (m(), I(ke, {
191
+ (m(!0), C(de, null, ke(t.value, (w) => (m(), $(Ce, {
192
192
  key: w,
193
193
  label: w,
194
194
  variant: "neutral"
195
195
  }, null, 8, ["label"]))), 128)),
196
- p.categories.length > u.value ? (m(), I(ke, {
196
+ p.categories.length > u.value ? (m(), $(Ce, {
197
197
  key: 0,
198
198
  label: "...",
199
199
  variant: "neutral"
200
- })) : U("", !0)
200
+ })) : R("", !0)
201
201
  ])
202
202
  ]),
203
203
  _: 1
@@ -206,7 +206,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
206
206
  }
207
207
  }), Xt = /* @__PURE__ */ K({
208
208
  __name: "ProductSearcher",
209
- props: /* @__PURE__ */ Je({
209
+ props: /* @__PURE__ */ Ze({
210
210
  label: {},
211
211
  helperText: {},
212
212
  menu: {}
@@ -216,15 +216,15 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
216
216
  }),
217
217
  emits: ["update:modelValue"],
218
218
  setup(k) {
219
- const e = k, n = Xe(k, "modelValue"), i = h(() => e.menu.modules.item.map((l) => ({
219
+ const e = k, r = Je(k, "modelValue"), i = h(() => e.menu.modules.item.map((l) => ({
220
220
  label: l.code ? `${l.code} ${l.name}` : l.name,
221
221
  value: l._id
222
222
  })));
223
223
  return (l, u) => {
224
224
  const t = z("FmSelect");
225
- return m(), I(t, {
226
- modelValue: n.value,
227
- "onUpdate:modelValue": u[0] || (u[0] = (s) => n.value = s),
225
+ return m(), $(t, {
226
+ modelValue: r.value,
227
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => r.value = s),
228
228
  items: i.value,
229
229
  searchable: !0,
230
230
  "search-target": "label",
@@ -237,9 +237,9 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
237
237
  }), el = { class: "flex" }, tl = { class: "w-[260px] space-y-16 h-full" }, ll = { class: "flex items-center gap-4 px-8" }, al = { class: "fm-typo-en-title-sm-600" }, ol = {
238
238
  key: 0,
239
239
  class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
240
- }, rl = { class: "fm-typo-en-body-md-600" }, nl = { class: "flex-1" }, nt = /* @__PURE__ */ K({
240
+ }, nl = { class: "fm-typo-en-body-md-600" }, rl = { class: "flex-1" }, nt = /* @__PURE__ */ K({
241
241
  __name: "ViewLayout",
242
- props: /* @__PURE__ */ Je({
242
+ props: /* @__PURE__ */ Ze({
243
243
  title: {},
244
244
  titleBadge: {},
245
245
  items: {}
@@ -249,47 +249,47 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
249
249
  }),
250
250
  emits: ["update:modelValue"],
251
251
  setup(k) {
252
- const e = Xe(k, "modelValue");
253
- return (n, i) => {
252
+ const e = Je(k, "modelValue");
253
+ return (r, i) => {
254
254
  const l = z("FmCollapsibleTabs");
255
255
  return m(), C("div", el, [
256
256
  g("div", tl, [
257
257
  g("div", ll, [
258
- g("p", al, B(n.title), 1),
259
- n.titleBadge !== void 0 ? (m(), C("div", ol, [
260
- g("p", rl, B(n.titleBadge), 1)
261
- ])) : U("", !0)
258
+ g("p", al, B(r.title), 1),
259
+ r.titleBadge !== void 0 ? (m(), C("div", ol, [
260
+ g("p", nl, B(r.titleBadge), 1)
261
+ ])) : R("", !0)
262
262
  ]),
263
- d(ze, null, {
264
- default: T(() => [
263
+ d(Oe, null, {
264
+ default: P(() => [
265
265
  d(l, {
266
266
  modelValue: e.value,
267
267
  "onUpdate:modelValue": i[0] || (i[0] = (u) => e.value = u),
268
- items: n.items
268
+ items: r.items
269
269
  }, null, 8, ["modelValue", "items"])
270
270
  ]),
271
271
  _: 1
272
272
  })
273
273
  ]),
274
274
  i[1] || (i[1] = g("div", { class: "w-[1px] min-h-full ml-4 mr-12 bg-fm-color-neutral-gray-100 self-stretch" }, null, -1)),
275
- g("div", nl, [
276
- _e(n.$slots, "default")
275
+ g("div", rl, [
276
+ _e(r.$slots, "default")
277
277
  ])
278
278
  ]);
279
279
  };
280
280
  }
281
- }), Fe = /* @__PURE__ */ K({
281
+ }), Se = /* @__PURE__ */ K({
282
282
  __name: "OrderFromChip",
283
283
  props: {
284
284
  orderFrom: {}
285
285
  },
286
286
  setup(k) {
287
- const e = k, n = Ce();
287
+ const e = k, r = xe();
288
288
  return (i, l) => {
289
289
  var u, t;
290
- return m(), I(ke, {
291
- label: ((u = a(n)[e.orderFrom]) == null ? void 0 : u.label) || e.orderFrom,
292
- variant: (t = a(n)[e.orderFrom]) == null ? void 0 : t.variant
290
+ return m(), $(Ce, {
291
+ label: ((u = a(r)[e.orderFrom]) == null ? void 0 : u.label) || e.orderFrom,
292
+ variant: (t = a(r)[e.orderFrom]) == null ? void 0 : t.variant
293
293
  }, null, 8, ["label", "variant"]);
294
294
  };
295
295
  }
@@ -299,7 +299,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
299
299
  data: {}
300
300
  },
301
301
  setup(k) {
302
- const e = k, n = [{
302
+ const e = k, r = [{
303
303
  accessorKey: "code",
304
304
  header: () => "Code",
305
305
  enableSorting: !1,
@@ -309,12 +309,12 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
309
309
  const s = t.original;
310
310
  return s.subRows ? d("div", {
311
311
  class: "flex items-center gap-2 fm-typo-en-body-md-600 text-fm-color-typo-secondary"
312
- }, [d(te.FmButton, {
312
+ }, [d(le.FmButton, {
313
313
  icon: "keyboard_arrow_up",
314
314
  variant: "tertiary",
315
315
  class: ["cursor-pointer", "transition-transform", t.getIsExpanded() ? "transform rotate-180" : ""],
316
316
  onClick: t.getToggleExpandedHandler()
317
- }, null), et("Found in group: "), s.groupName]) : s.code;
317
+ }, null), Xe("Found in group: "), s.groupName]) : s.code;
318
318
  },
319
319
  meta: {
320
320
  colspan: (t) => t.original.subRows ? 5 : 1
@@ -346,24 +346,24 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
346
346
  enableSorting: !1,
347
347
  cell: (t) => {
348
348
  const s = t.row.original;
349
- return d(Fe, {
349
+ return d(Se, {
350
350
  orderFrom: s.orderFrom ?? ""
351
351
  }, null);
352
352
  },
353
353
  meta: {
354
354
  colspan: (t) => t.original.subRows ? 0 : 1
355
355
  }
356
- }], i = V({}), l = (t) => t.subRows;
356
+ }], i = I({}), l = (t) => t.subRows;
357
357
  function u() {
358
358
  i.value = Object.fromEntries(e.data.map((t, s) => [s, !0]));
359
359
  }
360
- return de(() => e.data, () => {
360
+ return ie(() => e.data, () => {
361
361
  u();
362
362
  }), (t, s) => {
363
363
  const f = z("FmTable");
364
- return m(), I(ze, null, {
365
- default: T(() => [d(f, {
366
- "column-defs": n,
364
+ return m(), $(Oe, null, {
365
+ default: P(() => [d(f, {
366
+ "column-defs": r,
367
367
  "row-data": t.data,
368
368
  "hide-footer": !0,
369
369
  "page-size": 1e6,
@@ -383,15 +383,15 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
383
383
  menu: {}
384
384
  },
385
385
  setup(k) {
386
- const e = k, n = V(""), i = h(() => l.value.reduce((p, b) => p + (typeof b.badge == "number" ? b.badge ?? 1 : 0), 0)), l = V([]), u = h(() => {
387
- const p = l.value.find((y) => y.value === n.value);
386
+ const e = k, r = I(""), i = h(() => l.value.reduce((p, b) => p + (typeof b.badge == "number" ? b.badge ?? 1 : 0), 0)), l = I([]), u = h(() => {
387
+ const p = l.value.find((y) => y.value === r.value);
388
388
  return ((p == null ? void 0 : p.itemInGroup) || []).map((y) => ({
389
389
  groupName: y.group.name,
390
390
  subRows: y.items.map((w) => ({
391
391
  // @ts-ignore
392
392
  code: w.code || w.fallbackCode,
393
393
  productName: w.combinationKey ? "" : w.name ?? "",
394
- price: w.price ? me.Dinero.fromFdoDinero(w.price).toFormat() : "--",
394
+ price: w.price ? ce.Dinero.fromFdoDinero(w.price).toFormat() : "--",
395
395
  orderFrom: w.orderFrom ?? void 0,
396
396
  variant: w.combinationKey ? w.name ?? "" : void 0
397
397
  }))
@@ -416,14 +416,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
416
416
  itemInGroup: []
417
417
  }))];
418
418
  }
419
- h(() => l.value.find((p) => p.value === n.value));
419
+ h(() => l.value.find((p) => p.value === r.value));
420
420
  async function s(p) {
421
421
  const b = l.value.find((y) => y.catalogId === p);
422
422
  if (b) {
423
- b.badge = () => d(te.FmCircularProgress, {
423
+ b.badge = () => d(le.FmCircularProgress, {
424
424
  size: "md"
425
425
  }, null);
426
- const y = await wt(Re(e.menu), p, e.itemId);
426
+ const y = await wt(Ae(e.menu), p, e.itemId);
427
427
  b.badge = y.length, b.disabled = y.length <= 0, b.itemInGroup = y;
428
428
  }
429
429
  }
@@ -432,18 +432,18 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
432
432
  s(p.catalogId);
433
433
  });
434
434
  }
435
- return de([() => e.menu, () => e.itemId], () => {
435
+ return ie([() => e.menu, () => e.itemId], () => {
436
436
  e.menu && e.itemId && f();
437
437
  }, {
438
438
  immediate: !0
439
- }), (p, b) => (m(), I(nt, {
440
- modelValue: n.value,
441
- "onUpdate:modelValue": b[0] || (b[0] = (y) => n.value = y),
439
+ }), (p, b) => (m(), $(nt, {
440
+ modelValue: r.value,
441
+ "onUpdate:modelValue": b[0] || (b[0] = (y) => r.value = y),
442
442
  items: l.value,
443
443
  title: "Catalog",
444
444
  "title-badge": i.value
445
445
  }, {
446
- default: T(() => [d(sl, {
446
+ default: P(() => [d(sl, {
447
447
  data: u.value
448
448
  }, null, 8, ["data"])]),
449
449
  _: 1
@@ -460,12 +460,12 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
460
460
  schedulerIds: {}
461
461
  },
462
462
  setup(k) {
463
- const e = k, n = [{
463
+ const e = k, r = [{
464
464
  accessorKey: "scheduler",
465
465
  header: () => "Scheduler",
466
466
  enableSorting: !1,
467
467
  cell: (u) => {
468
- const t = u.row.original, s = t.loading ? d(te.FmCircularProgress, {
468
+ const t = u.row.original, s = t.loading ? d(le.FmCircularProgress, {
469
469
  size: "md"
470
470
  }, null) : null;
471
471
  return d("div", {
@@ -489,12 +489,12 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
489
489
  header: () => "Order from",
490
490
  cell: (u) => {
491
491
  const t = u.row.original;
492
- return d(Fe, {
492
+ return d(Se, {
493
493
  orderFrom: t.orderFrom
494
494
  }, null);
495
495
  },
496
496
  enableSorting: !1
497
- }], i = V([]);
497
+ }], i = I([]);
498
498
  function l(u, t) {
499
499
  return {
500
500
  loading: !0,
@@ -506,23 +506,23 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
506
506
  orderFrom: "--"
507
507
  };
508
508
  }
509
- return de([() => e.menu, () => e.catalogId, () => e.schedulerIds], async () => {
509
+ return ie([() => e.menu, () => e.catalogId, () => e.schedulerIds], async () => {
510
510
  i.value = [l(null, "All day"), ...e.schedulerIds.map((u) => {
511
511
  var t;
512
512
  return l(u, ((t = e.menu.modules.scheduler.find((s) => s._id === u)) == null ? void 0 : t.name) || "Unknown");
513
513
  })], i.value.forEach(async (u) => {
514
- const s = (await St(Re(e.menu), e.catalogId, u.schedulerId)).modules.item.find((p) => p._id === e.itemId), f = i.value.findIndex((p) => p.schedulerId === u.schedulerId);
514
+ const s = (await St(Ae(e.menu), e.catalogId, u.schedulerId)).modules.item.find((p) => p._id === e.itemId), f = i.value.findIndex((p) => p.schedulerId === u.schedulerId);
515
515
  if (s) {
516
- const p = Re(i.value);
517
- p[f].loading = !1, p[f].code = s.code || "--", p[f].productName = s.name || "--", p[f].price = me.Dinero.fromFdoDinero(s.price).toFormat(), p[f].orderFrom = s.orderFrom || "--", i.value = p;
516
+ const p = Ae(i.value);
517
+ p[f].loading = !1, p[f].code = s.code || "--", p[f].productName = s.name || "--", p[f].price = ce.Dinero.fromFdoDinero(s.price).toFormat(), p[f].orderFrom = s.orderFrom || "--", i.value = p;
518
518
  }
519
519
  });
520
520
  }), (u, t) => {
521
521
  const s = z("FmTable");
522
- return m(), I(ze, null, {
523
- default: T(() => [g("div", il, [d(s, {
522
+ return m(), $(Oe, null, {
523
+ default: P(() => [g("div", il, [d(s, {
524
524
  class: "min-w-[800px]",
525
- "column-defs": n,
525
+ "column-defs": r,
526
526
  "row-data": i.value,
527
527
  "hide-footer": !0,
528
528
  "page-size": i.value.length,
@@ -539,23 +539,23 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
539
539
  menu: {}
540
540
  },
541
541
  setup(k) {
542
- const e = k, n = V(null);
543
- tt(async () => {
544
- n.value = await Ft(e.menu, e.itemId), await Ae(), i.value = l.value[0].value;
542
+ const e = k, r = I(null);
543
+ et(async () => {
544
+ r.value = await Ft(e.menu, e.itemId), await Pe(), i.value = l.value[0].value;
545
545
  });
546
- const i = V(""), l = h(() => {
546
+ const i = I(""), l = h(() => {
547
547
  var f, p;
548
548
  const t = {
549
549
  label: "Master product",
550
550
  value: "",
551
551
  catalogId: null,
552
- badge: (((f = n.value) == null ? void 0 : f.schedulers.length) || 0) + 1,
553
- schedulerIds: (p = n.value) == null ? void 0 : p.schedulers
552
+ badge: (((f = r.value) == null ? void 0 : f.schedulers.length) || 0) + 1,
553
+ schedulerIds: (p = r.value) == null ? void 0 : p.schedulers
554
554
  };
555
- if (!n.value)
555
+ if (!r.value)
556
556
  return [t];
557
557
  const s = e.menu.modules.catalog.map((b) => {
558
- const y = n.value.catalogs[b._id];
558
+ const y = r.value.catalogs[b._id];
559
559
  return {
560
560
  label: b.name,
561
561
  value: b._id,
@@ -567,14 +567,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
567
567
  });
568
568
  return [t, ...s];
569
569
  }), u = h(() => l.value.find((t) => t.value === i.value));
570
- return (t, s) => (m(), I(nt, {
570
+ return (t, s) => (m(), $(nt, {
571
571
  modelValue: i.value,
572
572
  "onUpdate:modelValue": s[0] || (s[0] = (f) => i.value = f),
573
573
  items: l.value,
574
574
  title: "Catalog",
575
575
  "title-badge": l.value.filter((f) => !f.disabled).length
576
576
  }, {
577
- default: T(() => {
577
+ default: P(() => {
578
578
  var f, p;
579
579
  return [
580
580
  d(cl, {
@@ -598,34 +598,34 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
598
598
  menu: {}
599
599
  },
600
600
  setup(k) {
601
- const e = k, n = h(() => e.menu.modules.item.find((l) => l._id === e.itemId)), i = h(() => {
601
+ const e = k, r = h(() => e.menu.modules.item.find((l) => l._id === e.itemId)), i = h(() => {
602
602
  var l;
603
- return me.Dinero.fromFdoDinero((l = n.value) == null ? void 0 : l.price).toFormat(!0);
603
+ return ce.Dinero.fromFdoDinero((l = r.value) == null ? void 0 : l.price).toFormat(!0);
604
604
  });
605
605
  return (l, u) => {
606
606
  var t, s, f, p, b, y, w;
607
607
  return m(), C("div", ml, [
608
- d(Me, {
609
- alt: ((t = n.value) == null ? void 0 : t.name) ?? null,
608
+ d(Ue, {
609
+ alt: ((t = r.value) == null ? void 0 : t.name) ?? null,
610
610
  size: 72,
611
- src: (s = n.value) == null ? void 0 : s.thumbnail,
611
+ src: (s = r.value) == null ? void 0 : s.thumbnail,
612
612
  crossorigin: !1
613
613
  }, null, 8, ["alt", "src"]),
614
614
  g("div", pl, [
615
615
  g("p", vl, [
616
- (f = n.value) != null && f.code ? (m(), C("span", fl, B((p = n.value) == null ? void 0 : p.code) + ", ", 1)) : U("", !0),
617
- g("span", null, B((b = n.value) == null ? void 0 : b.name), 1)
616
+ (f = r.value) != null && f.code ? (m(), C("span", fl, B((p = r.value) == null ? void 0 : p.code) + ", ", 1)) : R("", !0),
617
+ g("span", null, B((b = r.value) == null ? void 0 : b.name), 1)
618
618
  ]),
619
619
  g("p", gl, "Base price: " + B(i.value), 1),
620
- (y = n.value) != null && y.customAttributes ? (m(), C("div", bl, [
620
+ (y = r.value) != null && y.customAttributes ? (m(), C("div", bl, [
621
621
  g("div", _l, [
622
622
  u[0] || (u[0] = g("span", null, "Tagging:", -1)),
623
- d(Ue, {
623
+ d(Re, {
624
624
  ellipsis: !1,
625
- "custom-attributes": (w = n.value) == null ? void 0 : w.customAttributes
625
+ "custom-attributes": (w = r.value) == null ? void 0 : w.customAttributes
626
626
  }, null, 8, ["custom-attributes"])
627
627
  ])
628
- ])) : U("", !0)
628
+ ])) : R("", !0)
629
629
  ])
630
630
  ]);
631
631
  };
@@ -637,7 +637,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
637
637
  menu: {}
638
638
  },
639
639
  setup(k) {
640
- const e = V("product"), n = h(() => [
640
+ const e = I("product"), r = h(() => [
641
641
  {
642
642
  value: "product",
643
643
  label: "Product",
@@ -661,11 +661,11 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
661
661
  d(u, {
662
662
  modelValue: e.value,
663
663
  "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s),
664
- items: n.value
664
+ items: r.value
665
665
  }, null, 8, ["modelValue", "items"])
666
666
  ]),
667
667
  g("div", null, [
668
- (m(), I(lt((t = n.value.find((s) => s.value === e.value)) == null ? void 0 : t.component), {
668
+ (m(), $(tt((t = r.value.find((s) => s.value === e.value)) == null ? void 0 : t.component), {
669
669
  "item-id": i.itemId,
670
670
  menu: i.menu
671
671
  }, null, 8, ["item-id", "menu"]))
@@ -680,8 +680,8 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
680
680
  showSearch: { type: Boolean, default: !1 }
681
681
  },
682
682
  setup(k) {
683
- const e = k, n = Ve(), i = V(null);
684
- return at(() => {
683
+ const e = k, r = Fe(), i = I(null);
684
+ return lt(() => {
685
685
  i.value = e.itemId;
686
686
  }), (l, u) => (m(), C("div", Cl, [
687
687
  l.showSearch ? (m(), C("div", kl, [
@@ -691,45 +691,45 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
691
691
  class: "w-1/2",
692
692
  label: "Search and compare prices",
693
693
  "helper-text": "Quickly find products and view their prices across different catalogs and schedules.",
694
- menu: a(n).state.menu
694
+ menu: a(r).state.menu
695
695
  }, null, 8, ["modelValue", "menu"])
696
- ])) : U("", !0),
696
+ ])) : R("", !0),
697
697
  g("div", null, [
698
- i.value ? (m(), I(xl, {
698
+ i.value ? (m(), $(xl, {
699
699
  key: 0,
700
700
  "item-id": i.value,
701
- menu: a(n).state.menu
702
- }, null, 8, ["item-id", "menu"])) : U("", !0)
701
+ menu: a(r).state.menu
702
+ }, null, 8, ["item-id", "menu"])) : R("", !0)
703
703
  ])
704
704
  ]));
705
705
  }
706
706
  }), Sl = /* @__PURE__ */ K({
707
707
  __name: "OverviewSheet",
708
708
  setup(k) {
709
- const e = V(null), n = V(!1);
709
+ const e = I(null), r = I(!1);
710
710
  function i(l) {
711
- n.value = !n.value, l && (e.value = l);
711
+ r.value = !r.value, l && (e.value = l);
712
712
  }
713
713
  return (l, u) => {
714
714
  const t = z("FmSideSheet");
715
- return m(), C(pe, null, [
715
+ return m(), C(de, null, [
716
716
  _e(l.$slots, "default", { trigger: i }),
717
717
  d(t, {
718
718
  id: "product-overview",
719
- modelValue: n.value,
720
- "onUpdate:modelValue": u[0] || (u[0] = (s) => n.value = s),
719
+ modelValue: r.value,
720
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => r.value = s),
721
721
  "max-width": 1200,
722
722
  "dismiss-away": ""
723
723
  }, {
724
- "side-sheet-header": T(() => u[1] || (u[1] = [
724
+ "side-sheet-header": P(() => u[1] || (u[1] = [
725
725
  g("p", { class: "fm-typo-en-title-md-600" }, "Product Overview", -1)
726
726
  ])),
727
- default: T(() => [
727
+ default: P(() => [
728
728
  g("div", null, [
729
- n.value && e.value ? (m(), I(wl, {
729
+ r.value && e.value ? (m(), $(wl, {
730
730
  key: 0,
731
731
  "item-id": e.value
732
- }, null, 8, ["item-id"])) : U("", !0)
732
+ }, null, 8, ["item-id"])) : R("", !0)
733
733
  ])
734
734
  ]),
735
735
  _: 1
@@ -739,15 +739,15 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
739
739
  }
740
740
  });
741
741
  var Fl = Ut();
742
- const Ye = /* @__PURE__ */ K({
742
+ const Qe = /* @__PURE__ */ K({
743
743
  __name: "ImportButton",
744
744
  setup(k) {
745
- const e = V(!1);
746
- function n() {
745
+ const e = I(!1);
746
+ function r() {
747
747
  e.value = !e.value;
748
748
  }
749
- const i = Oe();
750
- return at(() => {
749
+ const i = Me();
750
+ return lt(() => {
751
751
  const l = i.currentCountry.value;
752
752
  if (l)
753
753
  try {
@@ -755,17 +755,17 @@ const Ye = /* @__PURE__ */ K({
755
755
  } catch (u) {
756
756
  console.log("Unable to set country config", u);
757
757
  }
758
- }), (l, u) => (m(), C(pe, null, [
758
+ }), (l, u) => (m(), C(de, null, [
759
759
  d(Mt, {
760
760
  modelValue: e.value,
761
761
  "onUpdate:modelValue": u[0] || (u[0] = (t) => e.value = t)
762
762
  }, null, 8, ["modelValue"]),
763
- _e(l.$slots, "default", { trigger: n })
763
+ _e(l.$slots, "default", { trigger: r })
764
764
  ], 64));
765
765
  }
766
- }), Ze = (k) => d("div", {
766
+ }), Ye = (k) => d("div", {
767
767
  class: "flex flex-1 justify-end"
768
- }, [d("span", null, [k, et(" ")])]), Vl = {
768
+ }, [d("span", null, [k, Xe(" ")])]), Vl = {
769
769
  class: "flex justify-between items-center space-x-8"
770
770
  }, Il = {
771
771
  class: "flex space-x-8 items-center"
@@ -775,12 +775,12 @@ const Ye = /* @__PURE__ */ K({
775
775
  key: 0
776
776
  }, Pl = {
777
777
  key: 1,
778
- class: /* @__PURE__ */ ve(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
778
+ class: /* @__PURE__ */ me(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
779
779
  }, Al = {
780
780
  key: 0,
781
781
  class: "flex items-center p-4"
782
782
  }, Rl = {
783
- class: /* @__PURE__ */ ve(["mr-8", "fm-typo-en-body-md-400"])
783
+ class: /* @__PURE__ */ me(["mr-8", "fm-typo-en-body-md-400"])
784
784
  }, Ul = {
785
785
  key: 1,
786
786
  class: "px-16 py-4 space-x-8 flex justify-end"
@@ -802,7 +802,7 @@ const Ye = /* @__PURE__ */ K({
802
802
  class: "px-8"
803
803
  }, jl = {
804
804
  key: 0,
805
- class: /* @__PURE__ */ ve(["flex flex-col flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
805
+ class: /* @__PURE__ */ me(["flex flex-col flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
806
806
  }, El = ["onClick"], Gl = {
807
807
  class: "min-w-0 flex flex-1 items-center justify-start space-x-16"
808
808
  }, Ll = {
@@ -833,24 +833,24 @@ const Ye = /* @__PURE__ */ K({
833
833
  emits: ["update:model-value", "reset:model-value", "update:editing", "update:search-key"],
834
834
  setup(k, {
835
835
  expose: e,
836
- emit: n
836
+ emit: r
837
837
  }) {
838
838
  const i = k, {
839
839
  t: l
840
- } = Ie(), u = Oe(), t = Ve(), s = Tt(), f = ot(), p = u.currentCountry, b = h(() => p.value ? me.Country.getCountry(p.value) : null), y = h(() => t.rules.item), {
840
+ } = Ve(), u = Me(), t = Fe(), s = Tt(), f = at(), p = u.currentCountry, b = h(() => p.value ? ce.Country.getCountry(p.value) : null), y = h(() => t.rules.item), {
841
841
  selectedCategories: w
842
- } = Se(), W = h(() => {
843
- const o = ge.flatten(w.value.map((r) => r.items));
844
- return ge.uniqBy(o, (r) => r._id);
845
- }), Y = n, S = V(!1);
846
- de(() => S.value, (o) => {
842
+ } = we(), q = h(() => {
843
+ const o = ge.flatten(w.value.map((n) => n.items));
844
+ return ge.uniqBy(o, (n) => n._id);
845
+ }), Y = r, S = I(!1);
846
+ ie(() => S.value, (o) => {
847
847
  Y("update:editing", o);
848
848
  });
849
- const oe = (o) => {
849
+ const ne = (o) => {
850
850
  Ot.isBoolean(o) ? S.value = o : S.value = !S.value;
851
- }, Z = V(!1), re = V(null);
851
+ }, Z = I(!1), re = I(null);
852
852
  async function E() {
853
- Z.value = !Z.value, Z.value && (await Ae(), re.value && re.value.toggleProperty(!0));
853
+ Z.value = !Z.value, Z.value && (await Pe(), re.value && re.value.toggleProperty(!0));
854
854
  }
855
855
  e({
856
856
  toggleAttributeFilter: E
@@ -858,37 +858,37 @@ const Ye = /* @__PURE__ */ K({
858
858
  const {
859
859
  attributes: D,
860
860
  filterRule: O,
861
- mongoQuery: H
861
+ mongoQuery: W
862
862
  } = xt({
863
- valueSource: W,
863
+ valueSource: q,
864
864
  entity: "item"
865
- }), J = V(""), ne = Ct(J, 300), Q = h(() => {
865
+ }), J = I(""), se = Ct(J, 300), H = h(() => {
866
866
  const o = (c) => {
867
867
  var x;
868
- return !ne.value || !ne.value.trim() ? !0 : [c.code, c.name, Be(c), ...Pe(se.value, c), (x = Ce()[c.orderFrom]) == null ? void 0 : x.label, Object.values(c.customAttributes ?? {}).join(" ")].join(" ").toLowerCase().includes(ne.value.toLowerCase());
869
- }, r = (c) => H.value ? $t(c.customAttributes, H.value) : !0;
870
- return W.value.filter((c) => o(c) && r(c));
868
+ return !se.value || !se.value.trim() ? !0 : [c.code, c.name, De(c), ...Te(M.value, c), (x = xe()[c.orderFrom]) == null ? void 0 : x.label, Object.values(c.customAttributes ?? {}).join(" ")].join(" ").toLowerCase().includes(se.value.toLowerCase());
869
+ }, n = (c) => W.value ? $t(c.customAttributes, W.value) : !0;
870
+ return q.value.filter((c) => o(c) && n(c));
871
871
  }), {
872
- categories: se
873
- } = Se(), R = h(() => t.categories.map((o) => ({
872
+ categories: M
873
+ } = we(), V = h(() => t.categories.map((o) => ({
874
874
  label: o.name,
875
875
  value: o._id || null
876
- }))), $ = (o, r, c) => {
876
+ }))), A = (o, n, c) => {
877
877
  let v = ge.clone(i.modelValue);
878
878
  const x = v[o];
879
- x && (typeof r == "object" && r !== null ? v[o] = {
879
+ x && (typeof n == "object" && n !== null ? v[o] = {
880
880
  ...x,
881
- ...r
881
+ ...n
882
882
  } : v[o] = {
883
883
  ...x,
884
- [r]: c
884
+ [n]: c
885
885
  }, Y("update:model-value", v));
886
- }, P = bt(() => i.originalValue, () => i.modelValue), A = ge.debounce($, 300), ue = (o) => (r) => !!r || l("menu.product.table.validation.name_required", {
886
+ }, T = bt(() => i.originalValue, () => i.modelValue), X = ge.debounce(A, 300), Q = (o) => (n) => !!n || l("menu.product.table.validation.name_required", {
887
887
  field: o
888
- }), G = (o) => o >= 0 || l("menu.product.table.validation.price_min"), N = [ue("Name")], M = () => [(o) => G(typeof o == "number" ? o : Number(o) ?? 0)], ie = Ce(), j = h(() => {
888
+ }), N = (o) => o >= 0 || l("menu.product.table.validation.price_min"), U = [Q("Name")], ue = () => [(o) => N(typeof o == "number" ? o : Number(o) ?? 0)], j = xe(), pe = h(() => {
889
889
  const o = t.isV4;
890
890
  return gt.setCoreStore(u).taxSetting(o);
891
- }), ce = h(() => [{
891
+ }), fe = h(() => [{
892
892
  accessorKey: "thumbnail",
893
893
  header: "",
894
894
  size: 110,
@@ -897,10 +897,10 @@ const Ye = /* @__PURE__ */ K({
897
897
  headerContentClass: "px-0"
898
898
  },
899
899
  cell: (o) => {
900
- var r, c;
901
- return L(Me, {
900
+ var n, c;
901
+ return G(Ue, {
902
902
  src: o.getValue(),
903
- alt: (c = (r = o == null ? void 0 : o.row) == null ? void 0 : r.original) == null ? void 0 : c.name,
903
+ alt: (c = (n = o == null ? void 0 : o.row) == null ? void 0 : n.original) == null ? void 0 : c.name,
904
904
  className: "my-8 mx-12",
905
905
  size: 72,
906
906
  crossorigin: !1
@@ -913,17 +913,17 @@ const Ye = /* @__PURE__ */ K({
913
913
  enableSorting: !1,
914
914
  size: 100,
915
915
  cell: (o) => {
916
- const r = o.row.original, c = o.getValue() || "--";
916
+ const n = o.row.original, c = o.getValue() || "--";
917
917
  if (!S.value) return d("span", {
918
918
  class: "break-all"
919
919
  }, [c]);
920
- const v = Te(r._id);
921
- return L(te.FmTextField, {
920
+ const v = $e(n._id);
921
+ return G(le.FmTextField, {
922
922
  disabled: !y.value.code,
923
- modelValue: P(r._id, "code") ?? (v == null ? void 0 : v.code),
924
- placeholder: i.modelValue[r._id].fallbackCode,
923
+ modelValue: T(n._id, "code") ?? (v == null ? void 0 : v.code),
924
+ placeholder: i.modelValue[n._id].fallbackCode,
925
925
  "onUpdate:modelValue": (x) => {
926
- A(r._id, "code", x);
926
+ X(n._id, "code", x);
927
927
  }
928
928
  });
929
929
  }
@@ -933,22 +933,22 @@ const Ye = /* @__PURE__ */ K({
933
933
  enableSorting: !1,
934
934
  size: 200,
935
935
  cell: (o) => {
936
- const r = o.row.original, c = o.getValue();
937
- return S.value ? L(te.FmTextField, {
936
+ const n = o.row.original, c = o.getValue();
937
+ return S.value ? G(le.FmTextField, {
938
938
  disabled: !y.value.name,
939
- modelValue: P(r._id, "name") ?? r.name,
939
+ modelValue: T(n._id, "name") ?? n.name,
940
940
  "onUpdate:modelValue": (v) => {
941
- A(r._id, "name", v);
941
+ X(n._id, "name", v);
942
942
  },
943
- rules: N,
944
- placeholder: r.fallbackName
943
+ rules: U,
944
+ placeholder: n.fallbackName
945
945
  }) : c;
946
946
  }
947
947
  }, {
948
948
  accessorKey: "price",
949
949
  header: () => {
950
950
  var o;
951
- return Ze(l("menu.product.table.columns.price", {
951
+ return Ye(l("menu.product.table.columns.price", {
952
952
  currency: (o = b.value) == null ? void 0 : o.currency.symbol
953
953
  }));
954
954
  },
@@ -959,42 +959,42 @@ const Ye = /* @__PURE__ */ K({
959
959
  },
960
960
  cell: (o) => {
961
961
  var x;
962
- const r = o.getValue();
963
- if (!S.value) return me.Dinero.fromFdoDinero(r).toFormat();
962
+ const n = o.getValue();
963
+ if (!S.value) return ce.Dinero.fromFdoDinero(n).toFormat();
964
964
  const c = i.modelValue[o.row.original._id], v = c.fallbackPrice;
965
- return L(Rt, {
965
+ return G(Rt, {
966
966
  min: 0,
967
967
  disabled: !c.editPrice,
968
968
  // @ts-ignore
969
969
  placeholder: v ? zt(v, !1) : void 0,
970
- modelValue: P(c._id, "price") ?? ((x = Te(c._id)) == null ? void 0 : x.price),
970
+ modelValue: T(c._id, "price") ?? ((x = $e(c._id)) == null ? void 0 : x.price),
971
971
  // @ts-ignore
972
972
  "onUpdate:modelValue": (F) => {
973
- $(c._id, "price", F);
973
+ A(c._id, "price", F);
974
974
  },
975
- rules: M()
975
+ rules: ue()
976
976
  });
977
977
  }
978
978
  }, {
979
979
  accessorKey: "taxes",
980
- header: () => Ze(j.value.systemCode),
980
+ header: () => Ye(pe.value.systemCode),
981
981
  size: S.value ? 120 : 80,
982
982
  enableSorting: !1,
983
983
  meta: {
984
984
  textAlign: "right"
985
985
  },
986
986
  cell: (o) => {
987
- const r = o.getValue(), c = o.row.original, v = t.taxSetting.countryTaxOptions, x = t.getSelectedTax(r, c.fallbackTaxes, t.taxSetting.countryTaxOptions), F = v.find((ae) => ae.value === x);
987
+ const n = o.getValue(), c = o.row.original, v = t.taxSetting.countryTaxOptions, x = t.getSelectedTax(n, c.fallbackTaxes, t.taxSetting.countryTaxOptions), F = v.find((oe) => oe.value === x);
988
988
  if (!S.value)
989
989
  return `${F != null && F.meta.rate ? _t(F.meta.rate) : 0}%`;
990
- const _ = t.getSelectedTax(P(c._id, "taxes") ?? r, c.fallbackTaxes, t.taxSetting.countryTaxOptions);
991
- return L(te.FmSelect, {
990
+ const _ = t.getSelectedTax(T(c._id, "taxes") ?? n, c.fallbackTaxes, t.taxSetting.countryTaxOptions);
991
+ return G(le.FmSelect, {
992
992
  disabled: !y.value.tax,
993
993
  items: t.taxSetting.countryTaxOptions,
994
994
  modelValue: _,
995
- "onUpdate:modelValue": async (ae) => {
996
- const xe = t.decodeTax(ae);
997
- A(c._id, "taxes", [xe]);
995
+ "onUpdate:modelValue": async (oe) => {
996
+ const he = t.decodeTax(oe);
997
+ X(c._id, "taxes", [he]);
998
998
  }
999
999
  });
1000
1000
  }
@@ -1004,26 +1004,26 @@ const Ye = /* @__PURE__ */ K({
1004
1004
  enableSorting: !1,
1005
1005
  size: 140,
1006
1006
  cell: (o) => {
1007
- const r = o.row.original;
1007
+ const n = o.row.original;
1008
1008
  if (!S.value)
1009
- return L(Qe, {
1010
- categories: Pe(se.value, r)
1009
+ return G(He, {
1010
+ categories: Te(M.value, n)
1011
1011
  });
1012
- const c = yt(i.originalValue, i.modelValue, r._id) ?? ht(r), v = (c == null ? void 0 : c.map((F) => F._id)) ?? [], x = c == null ? void 0 : c.reduce((F, _) => (F[_._id] = _, F), {});
1013
- return L(It, {
1012
+ const c = yt(i.originalValue, i.modelValue, n._id) ?? ht(n), v = (c == null ? void 0 : c.map((F) => F._id)) ?? [], x = c == null ? void 0 : c.reduce((F, _) => (F[_._id] = _, F), {});
1013
+ return G(It, {
1014
1014
  shouldShowChips: !1,
1015
1015
  shouldShowSelectedItemsWithinPlaceholder: !0,
1016
1016
  modelValue: v.length > 0 ? v : [null],
1017
- items: R.value,
1017
+ items: V.value,
1018
1018
  disabled: !!(t.state.currentCatalogId || t.state.currentSchedulerId),
1019
1019
  "onUpdate:modelValue": async (F) => {
1020
- const [_, ...ae] = F;
1021
- A(r._id, {
1020
+ const [_, ...oe] = F;
1021
+ X(n._id, {
1022
1022
  category: _,
1023
- additionalCategories: ae.map((xe) => {
1024
- const Ne = x == null ? void 0 : x[xe];
1025
- return Ne || {
1026
- _id: xe,
1023
+ additionalCategories: oe.map((he) => {
1024
+ const Ke = x == null ? void 0 : x[he];
1025
+ return Ke || {
1026
+ _id: he,
1027
1027
  position: null
1028
1028
  };
1029
1029
  })
@@ -1038,31 +1038,31 @@ const Ye = /* @__PURE__ */ K({
1038
1038
  enableSorting: !1,
1039
1039
  size: 140,
1040
1040
  cell: (o) => {
1041
- const r = o.row.original;
1042
- return L(Ue, {
1043
- customAttributes: r.customAttributes
1041
+ const n = o.row.original;
1042
+ return G(Re, {
1043
+ customAttributes: n.customAttributes
1044
1044
  });
1045
1045
  }
1046
1046
  }, {
1047
1047
  accessorKey: "orderFrom",
1048
1048
  header: () => l("menu.product.table.columns.order_from"),
1049
1049
  enableSorting: !0,
1050
- sortingFn: (o, r) => {
1051
- const [c, v] = [o, r].map((x) => ie[x.original.orderFrom].sortingIndex);
1050
+ sortingFn: (o, n) => {
1051
+ const [c, v] = [o, n].map((x) => j[x.original.orderFrom].sortingIndex);
1052
1052
  return c - v;
1053
1053
  },
1054
1054
  size: 140,
1055
1055
  cell: (o) => {
1056
- const r = o.getValue(), c = o.row.original;
1057
- return S.value ? L(te.FmSelect, {
1056
+ const n = o.getValue(), c = o.row.original;
1057
+ return S.value ? G(le.FmSelect, {
1058
1058
  disabled: !y.value.orderFrom,
1059
- items: Object.values(Ce()),
1060
- modelValue: P(c._id, "orderFrom") ?? r,
1059
+ items: Object.values(xe()),
1060
+ modelValue: T(c._id, "orderFrom") ?? n,
1061
1061
  "onUpdate:modelValue": async (v) => {
1062
- $(c._id, "orderFrom", v);
1062
+ A(c._id, "orderFrom", v);
1063
1063
  }
1064
- }) : L(Fe, {
1065
- orderFrom: r
1064
+ }) : G(Se, {
1065
+ orderFrom: n
1066
1066
  });
1067
1067
  }
1068
1068
  }, {
@@ -1073,66 +1073,66 @@ const Ye = /* @__PURE__ */ K({
1073
1073
  headerClass: "py-4",
1074
1074
  textAlign: "right"
1075
1075
  },
1076
- header: () => L("div", {
1076
+ header: () => G("div", {
1077
1077
  class: "w-full px-4 flex justify-end"
1078
- }, [Dt(L(te.FmButton, {
1079
- variant: ee.Tertiary,
1080
- textColor: q.NeutralGray400,
1078
+ }, [Dt(G(le.FmButton, {
1079
+ variant: te.Tertiary,
1080
+ textColor: L.NeutralGray400,
1081
1081
  prependIcon: "edit",
1082
1082
  class: "flex justify-end",
1083
- onClick: oe,
1083
+ onClick: ne,
1084
1084
  type: "button"
1085
1085
  }), "Bulk edit")]),
1086
1086
  cell: (o) => {
1087
- const r = o.row.original;
1087
+ const n = o.row.original;
1088
1088
  return d("div", {
1089
1089
  class: "px-4 flex justify-end"
1090
1090
  }, [d(Sl, null, {
1091
1091
  default: ({
1092
1092
  trigger: c
1093
- }) => d(te.FmButton, {
1093
+ }) => d(le.FmButton, {
1094
1094
  icon: "overview",
1095
1095
  variant: "tertiary",
1096
- textColor: q.NeutralGray400,
1097
- onClick: fe(() => {
1098
- c(r._id);
1096
+ textColor: L.NeutralGray400,
1097
+ onClick: ve(() => {
1098
+ c(n._id);
1099
1099
  }, ["stop", "prevent"])
1100
1100
  }, null)
1101
- }), d(te.FmButton, {
1101
+ }), d(le.FmButton, {
1102
1102
  icon: "delete",
1103
1103
  variant: "tertiary",
1104
- textColor: q.NeutralGray400,
1105
- onClick: fe(async () => {
1104
+ textColor: L.NeutralGray400,
1105
+ onClick: ve(async () => {
1106
1106
  await f.deleteItem([{
1107
- _id: r._id,
1108
- name: r.name,
1109
- thumbnail: r.thumbnail
1107
+ _id: n._id,
1108
+ name: n.name,
1109
+ thumbnail: n.thumbnail
1110
1110
  }]);
1111
1111
  }, ["stop", "prevent"])
1112
1112
  }, null)]);
1113
1113
  }
1114
1114
  }]);
1115
- t.taxSetting.systemCode || ce.value.splice(4, 1);
1116
- const le = V({}), X = V([]);
1117
- de([() => le.value, () => Q.value], (o) => {
1118
- let r = [];
1115
+ t.taxSetting.systemCode || fe.value.splice(4, 1);
1116
+ const ae = I({}), ee = I([]);
1117
+ ie([() => ae.value, () => H.value], (o) => {
1118
+ let n = [];
1119
1119
  Object.keys(o[0]).forEach((c) => {
1120
- const v = o[0][c], x = Q.value[parseInt(c)];
1121
- x && (v ? r.push(x) : X.value = r.filter((F) => F !== x));
1122
- }), X.value = r;
1123
- }), de(() => W.value, () => {
1124
- le.value = {}, X.value = [];
1125
- }), de(() => S.value, () => {
1126
- le.value = {}, X.value = [];
1120
+ const v = o[0][c], x = H.value[parseInt(c)];
1121
+ x && (v ? n.push(x) : ee.value = n.filter((F) => F !== x));
1122
+ }), ee.value = n;
1123
+ }), ie(() => q.value, () => {
1124
+ ae.value = {}, ee.value = [];
1125
+ }), ie(() => S.value, () => {
1126
+ ae.value = {}, ee.value = [];
1127
1127
  });
1128
- const ye = () => {
1129
- le.value = {};
1128
+ const rt = () => {
1129
+ ae.value = {};
1130
1130
  };
1131
- async function De() {
1132
- await Ae();
1133
- const o = () => !!t.currentCatalog || !!t.state.currentSchedulerId, r = (v) => v === "" || v === null ? o() ? "" : null : v, c = Object.values(i.modelValue).filter((v) => {
1131
+ async function ze() {
1132
+ await Pe();
1133
+ const o = () => !!t.currentCatalog || !!t.state.currentSchedulerId, n = (v) => v === "" || v === null ? o() ? "" : null : v, c = Object.values(i.modelValue).filter((v) => {
1134
1134
  const x = Object.values(i.originalValue).find((F) => F._id === v._id);
1135
- return Ee(x, v);
1135
+ return je(x, v);
1136
1136
  }).map((v) => ({
1137
1137
  _id: v._id,
1138
1138
  name: v.name,
@@ -1140,41 +1140,41 @@ const Ye = /* @__PURE__ */ K({
1140
1140
  price: v.price,
1141
1141
  orderFrom: v.orderFrom ?? null,
1142
1142
  taxes: v.taxes,
1143
- category: r(v.category || null),
1143
+ category: n(v.category || null),
1144
1144
  additionalCategories: v.additionalCategories
1145
1145
  }));
1146
- await f.updateMany(c), oe(!1);
1146
+ await f.updateMany(c), ne(!1);
1147
1147
  }
1148
1148
  const st = async () => {
1149
- await f.deleteItem(X.value.map((o) => ({
1149
+ await f.deleteItem(ee.value.map((o) => ({
1150
1150
  _id: o._id,
1151
1151
  name: o.name,
1152
1152
  thumbnail: o.thumbnail
1153
1153
  })));
1154
- }, he = () => {
1154
+ }, ye = () => {
1155
1155
  Y("reset:model-value");
1156
- }, $e = () => {
1157
- Object.entries(i.modelValue).some(([r, c]) => Ee(c, i.originalValue[r])) ? s.open({
1156
+ }, Ie = () => {
1157
+ Object.entries(i.modelValue).some(([n, c]) => je(c, i.originalValue[n])) ? s.open({
1158
1158
  title: "You have unsaved changes!",
1159
1159
  message: "Are you sure you want to discard? You will lose all the changes if discard edit.",
1160
1160
  primaryActions: {
1161
1161
  text: "Discard",
1162
1162
  close: !0,
1163
- variant: ee.Destructive
1163
+ variant: te.Destructive
1164
1164
  },
1165
1165
  secondaryActions: {
1166
1166
  text: "Cancel",
1167
1167
  close: !0
1168
1168
  }
1169
1169
  }).onPrimary(() => {
1170
- he(), oe(!1);
1171
- }) : (oe(!1), he());
1170
+ ye(), ne(!1);
1171
+ }) : (ne(!1), ye());
1172
1172
  }, ut = h(() => {
1173
- var o, r;
1173
+ var o, n;
1174
1174
  return {
1175
1175
  thumbnail: !S.value,
1176
1176
  actions: !S.value,
1177
- tagging: !S.value && ((r = (o = u.itemAttributeSettings) == null ? void 0 : o.value) == null ? void 0 : r.length) > 0
1177
+ tagging: !S.value && ((n = (o = u.itemAttributeSettings) == null ? void 0 : o.value) == null ? void 0 : n.length) > 0
1178
1178
  };
1179
1179
  }), it = (o) => {
1180
1180
  f.update(o._id);
@@ -1182,13 +1182,13 @@ const Ye = /* @__PURE__ */ K({
1182
1182
  async function ct(o) {
1183
1183
  await f.update(o.original._id);
1184
1184
  }
1185
- function Be(o) {
1185
+ function De(o) {
1186
1186
  var _;
1187
- const r = o.price ?? // TODO: fix type error
1187
+ const n = o.price ?? // TODO: fix type error
1188
1188
  // @ts-ignore
1189
- o.fallbackPrice ?? me.Dinero.fromNumber({
1189
+ o.fallbackPrice ?? ce.Dinero.fromNumber({
1190
1190
  number: 0
1191
- }).toObject(), c = o.taxes, v = t.taxSetting.countryTaxOptions, x = me.Dinero.fromFdoDinero(r).toFormat(), F = (_ = b.value) == null ? void 0 : _.currency.symbol;
1191
+ }).toObject(), c = o.taxes, v = t.taxSetting.countryTaxOptions, x = ce.Dinero.fromFdoDinero(n).toFormat(), F = (_ = b.value) == null ? void 0 : _.currency.symbol;
1192
1192
  return t.getSelectedTax(
1193
1193
  c,
1194
1194
  // TODO: fix type error
@@ -1197,56 +1197,56 @@ const Ye = /* @__PURE__ */ K({
1197
1197
  v
1198
1198
  ), `${F == null ? void 0 : F.toUpperCase()}${x}`;
1199
1199
  }
1200
- function Te(o) {
1200
+ function $e(o) {
1201
1201
  var v;
1202
- const r = t.currentCatalog, c = t.state.currentSchedulerId;
1203
- if (r && c) {
1204
- const x = r.override.scheduler[c] ?? {}, F = (v = x == null ? void 0 : x.items) == null ? void 0 : v.filter((_) => _._id === o);
1202
+ const n = t.currentCatalog, c = t.state.currentSchedulerId;
1203
+ if (n && c) {
1204
+ const x = n.override.scheduler[c] ?? {}, F = (v = x == null ? void 0 : x.items) == null ? void 0 : v.filter((_) => _._id === o);
1205
1205
  return F == null ? void 0 : F[0];
1206
- } else return r ? r.override.items[o][0] : c ? t.schedulers.find((_) => _._id === c).items.filter((_) => _._id === o)[0] : W.value.find((x) => x._id === o);
1206
+ } else return n ? n.override.items[o][0] : c ? t.schedulers.find((_) => _._id === c).items.filter((_) => _._id === o)[0] : q.value.find((x) => x._id === o);
1207
1207
  }
1208
- const dt = rt(), mt = h(() => dt.breakpoints.value.xs), Ke = V(null), pt = At(Ke, Z), vt = h(() => {
1209
- var r;
1208
+ const dt = ot(), mt = h(() => dt.breakpoints.value.xs), Be = I(null), pt = At(Be, Z), vt = h(() => {
1209
+ var n;
1210
1210
  return {
1211
- height: `calc(100vh - ${((r = pt.value) == null ? void 0 : r.top) + 24}px)`
1211
+ height: `calc(100vh - ${((n = pt.value) == null ? void 0 : n.top) + 24}px)`
1212
1212
  };
1213
1213
  });
1214
- return (o, r) => {
1214
+ return (o, n) => {
1215
1215
  const c = z("fm-search"), v = z("fm-button"), x = z("fm-table"), F = z("fm-form");
1216
1216
  return mt.value ? (m(), C("div", zl, [g("div", Dl, [g("div", Bl, [d(c, {
1217
1217
  "model-value": J.value,
1218
- "onUpdate:modelValue": r[5] || (r[5] = (_) => J.value = _),
1218
+ "onUpdate:modelValue": n[5] || (n[5] = (_) => J.value = _),
1219
1219
  autofocus: "",
1220
1220
  placeholder: a(l)("menu.product.table.search.placeholder")
1221
- }, null, 8, ["model-value", "placeholder"])]), r[8] || (r[8] = g("div", {
1221
+ }, null, 8, ["model-value", "placeholder"])]), n[8] || (n[8] = g("div", {
1222
1222
  class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
1223
- }, null, -1)), g("div", Kl, [_e(o.$slots, "filter")]), Z.value ? (m(), C("div", Nl, [d(a(We), {
1223
+ }, null, -1)), g("div", Kl, [_e(o.$slots, "filter")]), Z.value ? (m(), C("div", Nl, [d(a(qe), {
1224
1224
  ref_key: "attributeFilterRef",
1225
1225
  ref: re,
1226
1226
  attributes: a(D),
1227
1227
  modelValue: a(O),
1228
- "onUpdate:modelValue": r[6] || (r[6] = (_) => je(O) ? O.value = _ : null)
1229
- }, null, 8, ["attributes", "modelValue"])])) : U("", !0)]), W.value.length ? (m(), C("div", jl, [(m(!0), C(pe, null, we(Q.value, (_) => {
1230
- var ae;
1228
+ "onUpdate:modelValue": n[6] || (n[6] = (_) => Ne(O) ? O.value = _ : null)
1229
+ }, null, 8, ["attributes", "modelValue"])])) : R("", !0)]), q.value.length ? (m(), C("div", jl, [(m(!0), C(de, null, ke(H.value, (_) => {
1230
+ var oe;
1231
1231
  return m(), C("div", {
1232
1232
  key: _._id,
1233
1233
  class: "max-w-full py-12 px-16 space-x-16 flex items-center",
1234
1234
  onClick: () => it(_)
1235
- }, [g("div", Gl, [d(Me, {
1235
+ }, [g("div", Gl, [d(Ue, {
1236
1236
  alt: _.name,
1237
1237
  size: 72,
1238
1238
  src: _.thumbnail
1239
- }, null, 8, ["alt", "src"]), g("div", Ll, [g("div", ql, [g("p", Wl, B(_.name), 1), d(Fe, {
1239
+ }, null, 8, ["alt", "src"]), g("div", Ll, [g("div", ql, [g("p", Wl, B(_.name), 1), d(Se, {
1240
1240
  "order-from": _.orderFrom
1241
- }, null, 8, ["order-from"])]), g("p", Hl, B(Be(_)), 1), g("p", Ql, B(a(l)("menu.product.table.columns.code")) + ": " + B(((ae = Te(_._id)) == null ? void 0 : ae.code) || "--"), 1), g("p", Yl, [d(Qe, {
1242
- categories: a(Pe)(a(se), _)
1243
- }, null, 8, ["categories"])]), d(Ue, {
1241
+ }, null, 8, ["order-from"])]), g("p", Hl, B(De(_)), 1), g("p", Ql, B(a(l)("menu.product.table.columns.code")) + ": " + B(((oe = $e(_._id)) == null ? void 0 : oe.code) || "--"), 1), g("p", Yl, [d(He, {
1242
+ categories: a(Te)(a(M), _)
1243
+ }, null, 8, ["categories"])]), d(Re, {
1244
1244
  "custom-attributes": _.customAttributes
1245
1245
  }, null, 8, ["custom-attributes"])])]), d(v, {
1246
- "text-color": a(q).NeutralGray400,
1247
- variant: a(ee).Tertiary,
1246
+ "text-color": a(L).NeutralGray400,
1247
+ variant: a(te).Tertiary,
1248
1248
  "prepend-icon": "delete",
1249
- onClick: fe(() => a(f).deleteItem([{
1249
+ onClick: ve(() => a(f).deleteItem([{
1250
1250
  _id: _._id,
1251
1251
  name: _.name,
1252
1252
  thumbnail: _.thumbnail
@@ -1256,18 +1256,18 @@ const Ye = /* @__PURE__ */ K({
1256
1256
  subtitle: a(l)("menu.product.table.empty.subtitle"),
1257
1257
  title: a(l)("menu.product.table.empty.title")
1258
1258
  }, {
1259
- action: T(() => [g("div", Jl, [d(v, {
1260
- variant: a(ee).Primary,
1259
+ action: P(() => [g("div", Jl, [d(v, {
1260
+ variant: a(te).Primary,
1261
1261
  label: a(l)("menu.product.table.empty.actions.add"),
1262
1262
  "prepend-icon": "add",
1263
- onClick: r[7] || (r[7] = (_) => a(f).create(null))
1264
- }, null, 8, ["variant", "label"]), d(Ye, null, {
1265
- default: T(({
1263
+ onClick: n[7] || (n[7] = (_) => a(f).create(null))
1264
+ }, null, 8, ["variant", "label"]), d(Qe, null, {
1265
+ default: P(({
1266
1266
  trigger: _
1267
1267
  }) => [d(v, {
1268
- "bg-color": a(q).NeutralGray100,
1269
- "text-color": a(q).NeutralGray400,
1270
- variant: a(ee).Primary,
1268
+ "bg-color": a(L).NeutralGray100,
1269
+ "text-color": a(L).NeutralGray400,
1270
+ variant: a(te).Primary,
1271
1271
  label: a(l)("menu.product.table.empty.actions.import"),
1272
1272
  "prepend-icon": "download",
1273
1273
  onClick: _
@@ -1275,56 +1275,56 @@ const Ye = /* @__PURE__ */ K({
1275
1275
  _: 1
1276
1276
  })])]),
1277
1277
  _: 1
1278
- }, 8, ["subtitle", "title"])]))])) : (m(), I(F, {
1278
+ }, 8, ["subtitle", "title"])]))])) : (m(), $(F, {
1279
1279
  key: 0,
1280
1280
  "blame-form-child-on-validation-failed": "",
1281
1281
  class: "flex flex-col flex-1 space-y-8 overflow-hidden",
1282
- onValidationSuccess: De
1282
+ onValidationSuccess: ze
1283
1283
  }, {
1284
- default: T(() => [g("div", Vl, [g("div", Il, [_e(o.$slots, "filter")]), g("div", $l, [d(c, {
1284
+ default: P(() => [g("div", Vl, [g("div", Il, [_e(o.$slots, "filter")]), g("div", $l, [d(c, {
1285
1285
  "model-value": J.value,
1286
- "onUpdate:modelValue": r[0] || (r[0] = (_) => J.value = _),
1286
+ "onUpdate:modelValue": n[0] || (n[0] = (_) => J.value = _),
1287
1287
  autofocus: "",
1288
1288
  placeholder: a(l)("menu.product.table.search.placeholder")
1289
- }, null, 8, ["model-value", "placeholder"])])]), Z.value ? (m(), C("div", Tl, [d(a(We), {
1289
+ }, null, 8, ["model-value", "placeholder"])])]), Z.value ? (m(), C("div", Tl, [d(a(qe), {
1290
1290
  ref_key: "attributeFilterRef",
1291
1291
  ref: re,
1292
1292
  attributes: a(D),
1293
1293
  modelValue: a(O),
1294
- "onUpdate:modelValue": r[1] || (r[1] = (_) => je(O) ? O.value = _ : null)
1295
- }, null, 8, ["attributes", "modelValue"])])) : U("", !0), W.value.length ? (m(), C("div", Pl, [X.value.length && !S.value ? (m(), C("div", Al, [g("p", Rl, B(a(l)("menu.product.table.selection.count", {
1296
- count: X.value.length
1294
+ "onUpdate:modelValue": n[1] || (n[1] = (_) => Ne(O) ? O.value = _ : null)
1295
+ }, null, 8, ["attributes", "modelValue"])])) : R("", !0), q.value.length ? (m(), C("div", Pl, [ee.value.length && !S.value ? (m(), C("div", Al, [g("p", Rl, B(a(l)("menu.product.table.selection.count", {
1296
+ count: ee.value.length
1297
1297
  })), 1), d(v, {
1298
1298
  label: a(l)("menu.product.table.selection.actions.deselect_all"),
1299
1299
  type: "button",
1300
1300
  variant: "plain",
1301
- onClick: ye
1301
+ onClick: rt
1302
1302
  }, null, 8, ["label"]), d(v, {
1303
- "border-color": a(q).SystemError300,
1304
- "text-color": a(q).SystemError300,
1303
+ "border-color": a(L).SystemError300,
1304
+ "text-color": a(L).SystemError300,
1305
1305
  class: "ml-auto",
1306
1306
  label: a(l)("menu.product.table.selection.actions.remove"),
1307
1307
  "prepend-icon": "delete",
1308
1308
  variant: "secondary",
1309
1309
  onClick: st
1310
- }, null, 8, ["border-color", "text-color", "label"])])) : U("", !0), S.value ? (m(), C("div", Ul, [d(v, {
1311
- variant: a(ee).Tertiary,
1310
+ }, null, 8, ["border-color", "text-color", "label"])])) : R("", !0), S.value ? (m(), C("div", Ul, [d(v, {
1311
+ variant: a(te).Tertiary,
1312
1312
  label: a(l)("menu.product.table.bulk_edit.actions.reset_all"),
1313
- onClick: he
1313
+ onClick: ye
1314
1314
  }, null, 8, ["variant", "label"]), d(v, {
1315
- variant: a(ee).Tertiary,
1315
+ variant: a(te).Tertiary,
1316
1316
  label: a(l)("menu.common.actions.cancel"),
1317
- onClick: $e
1317
+ onClick: Ie
1318
1318
  }, null, 8, ["variant", "label"]), d(v, {
1319
- borderColor: a(q).ColorPrimary,
1320
- textColor: a(q).ColorPrimary,
1321
- variant: a(ee).Secondary,
1319
+ borderColor: a(L).ColorPrimary,
1320
+ textColor: a(L).ColorPrimary,
1321
+ variant: a(te).Secondary,
1322
1322
  label: a(l)("menu.product.table.bulk_edit.actions.save"),
1323
1323
  type: "submit"
1324
- }, null, 8, ["borderColor", "textColor", "variant", "label"])])) : U("", !0), g("div", {
1324
+ }, null, 8, ["borderColor", "textColor", "variant", "label"])])) : R("", !0), g("div", {
1325
1325
  ref_key: "tableWrapper",
1326
- ref: Ke
1327
- }, [(m(), I(lt(S.value ? Pt : "div"), {
1326
+ ref: Be
1327
+ }, [(m(), $(tt(S.value ? Pt : "div"), {
1328
1328
  ref: "fullWrapper",
1329
1329
  title: S.value ? a(l)("menu.product.table.bulk_edit.title") : "",
1330
1330
  show: S.value,
@@ -1333,53 +1333,53 @@ const Ye = /* @__PURE__ */ K({
1333
1333
  },
1334
1334
  "secondary-actions": [{
1335
1335
  label: a(l)("menu.product.table.bulk_edit.actions.reset_all"),
1336
- click: he
1336
+ click: ye
1337
1337
  }, {
1338
1338
  label: a(l)("menu.common.actions.cancel"),
1339
- click: $e
1339
+ click: Ie
1340
1340
  }],
1341
1341
  class: "overflow-x-scroll",
1342
1342
  style: ft(vt.value),
1343
- onOnPrimary: De,
1344
- onOnCancel: $e
1343
+ onOnPrimary: ze,
1344
+ onOnCancel: Ie
1345
1345
  }, {
1346
- default: T(() => [d(x, {
1347
- class: ve({
1346
+ default: P(() => [d(x, {
1347
+ class: me({
1348
1348
  "min-w-[1100px]": !0,
1349
1349
  "mt-24": S.value
1350
1350
  }),
1351
- modelValue: le.value,
1352
- "onUpdate:modelValue": r[2] || (r[2] = (_) => le.value = _),
1353
- "column-defs": ce.value,
1351
+ modelValue: ae.value,
1352
+ "onUpdate:modelValue": n[2] || (n[2] = (_) => ae.value = _),
1353
+ "column-defs": fe.value,
1354
1354
  "column-visibility": ut.value,
1355
1355
  loading: o.isCalculating,
1356
- "page-size": Q.value.length,
1357
- "row-data": Q.value,
1356
+ "page-size": H.value.length,
1357
+ "row-data": H.value,
1358
1358
  "shrink-at": !1,
1359
1359
  selection: S.value ? void 0 : "multiple",
1360
1360
  virtual: !0,
1361
1361
  "virtual-row-height": S.value ? 48 : 91,
1362
1362
  "hide-footer": "",
1363
1363
  "pin-header-row": "",
1364
- onRowClick: r[3] || (r[3] = (_) => S.value ? void 0 : ct(_))
1364
+ onRowClick: n[3] || (n[3] = (_) => S.value ? void 0 : ct(_))
1365
1365
  }, null, 8, ["class", "modelValue", "column-defs", "column-visibility", "loading", "page-size", "row-data", "selection", "virtual-row-height"])]),
1366
1366
  _: 1
1367
1367
  }, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (m(), C("div", Ml, [d(be, {
1368
1368
  subtitle: a(l)("menu.product.table.empty.subtitle"),
1369
1369
  title: a(l)("menu.product.table.empty.title")
1370
1370
  }, {
1371
- action: T(() => [g("div", Ol, [d(v, {
1372
- variant: a(ee).Primary,
1371
+ action: P(() => [g("div", Ol, [d(v, {
1372
+ variant: a(te).Primary,
1373
1373
  label: a(l)("menu.product.table.empty.actions.add"),
1374
1374
  "prepend-icon": "add",
1375
- onClick: r[4] || (r[4] = (_) => a(f).create(null))
1376
- }, null, 8, ["variant", "label"]), d(Ye, null, {
1377
- default: T(({
1375
+ onClick: n[4] || (n[4] = (_) => a(f).create(null))
1376
+ }, null, 8, ["variant", "label"]), d(Qe, null, {
1377
+ default: P(({
1378
1378
  trigger: _
1379
1379
  }) => [d(v, {
1380
- "bg-color": a(q).NeutralGray100,
1381
- "text-color": a(q).NeutralGray400,
1382
- variant: a(ee).Primary,
1380
+ "bg-color": a(L).NeutralGray100,
1381
+ "text-color": a(L).NeutralGray400,
1382
+ variant: a(te).Primary,
1383
1383
  label: a(l)("menu.product.table.empty.actions.import"),
1384
1384
  "prepend-icon": "download",
1385
1385
  onClick: _
@@ -1394,62 +1394,62 @@ const Ye = /* @__PURE__ */ K({
1394
1394
  }
1395
1395
  }), ea = {
1396
1396
  key: 0,
1397
- class: /* @__PURE__ */ ve(["flex flex-col", "flex-1", "overflow-hidden"])
1397
+ class: /* @__PURE__ */ me(["flex flex-col", "flex-1", "overflow-hidden"])
1398
1398
  }, ta = {
1399
- class: /* @__PURE__ */ ve(["pt-16 xs:pt-0", "flex xs:flex-col", "flex-1", "w-full", "overflow-hidden"])
1399
+ class: /* @__PURE__ */ me(["pt-16 xs:pt-0", "flex xs:flex-col", "flex-1", "w-full", "overflow-hidden"])
1400
1400
  }, la = { class: "flex flex-col flex-1 overflow-hidden" }, aa = {
1401
1401
  key: 1,
1402
1402
  class: "pt-16 xs:pt-8 space-y-24"
1403
1403
  }, oa = { class: "flex items-center gap-8 px-16" }, Fa = /* @__PURE__ */ K({
1404
1404
  __name: "Product",
1405
1405
  setup(k) {
1406
- const e = Ve(), n = h(() => e.rules.item), i = ot(), l = h(() => !e.state.currentCatalogId), u = h(() => e.rules.item), t = h(() => !e.state.currentSchedulerId), s = V(!1), f = V(!1), p = h(() => {
1407
- var $, P, A, ue;
1406
+ const e = Fe(), r = h(() => e.rules.item), i = at(), l = h(() => !e.state.currentCatalogId), u = h(() => e.rules.item), t = h(() => !e.state.currentSchedulerId), s = I(!1), f = I(!1), p = h(() => {
1407
+ var V, A, T, X;
1408
1408
  if (l.value && t.value) return;
1409
1409
  if (t.value) {
1410
- const G = ($ = e.currentCatalog) == null ? void 0 : $.override.items;
1411
- return G ? Object.entries(G).reduce((N, [M, ie]) => {
1412
- const j = ie.find((ce) => !ce.combinationKey);
1413
- return j && (N[M] = j), N;
1410
+ const Q = (V = e.currentCatalog) == null ? void 0 : V.override.items;
1411
+ return Q ? Object.entries(Q).reduce((N, [U, ue]) => {
1412
+ const j = ue.find((pe) => !pe.combinationKey);
1413
+ return j && (N[U] = j), N;
1414
1414
  }, {}) : {};
1415
1415
  }
1416
- return ((l.value ? (P = e.currentScheduler) == null ? void 0 : P.items : (ue = (A = e.currentCatalog) == null ? void 0 : A.override.scheduler[e.state.currentSchedulerId]) == null ? void 0 : ue.items) ?? []).reduce((G, N) => (N.combinationKey || (G[N._id] = N), G), {});
1417
- }), b = V({}), y = V({}), w = async () => {
1418
- var ue, G;
1416
+ return ((l.value ? (A = e.currentScheduler) == null ? void 0 : A.items : (X = (T = e.currentCatalog) == null ? void 0 : T.override.scheduler[e.state.currentSchedulerId]) == null ? void 0 : X.items) ?? []).reduce((Q, N) => (N.combinationKey || (Q[N._id] = N), Q), {});
1417
+ }), b = I({}), y = I({}), w = async () => {
1418
+ var X, Q;
1419
1419
  f.value = !0;
1420
- const R = !!p.value, $ = ge.flatten(Y.value.map((N) => N.items)), P = R && s.value ? await Vt(
1420
+ const M = !!p.value, V = ge.flatten(Y.value.map((N) => N.items)), A = M && s.value ? await Vt(
1421
1421
  e.mergedMenu,
1422
- $,
1422
+ V,
1423
1423
  e.state.menu,
1424
- (ue = e.currentCatalog) == null ? void 0 : ue._id,
1425
- (G = e.currentScheduler) == null ? void 0 : G._id,
1424
+ (X = e.currentCatalog) == null ? void 0 : X._id,
1425
+ (Q = e.currentScheduler) == null ? void 0 : Q._id,
1426
1426
  !1
1427
- ) : void 0, A = $.reduce((N, M, ie) => {
1428
- var ce, le, X, ye;
1429
- const j = (ce = p.value) == null ? void 0 : ce[M._id];
1430
- return N[M._id] = {
1431
- _id: M._id,
1432
- name: M.name,
1433
- code: R ? j == null ? void 0 : j.code : M == null ? void 0 : M.code,
1434
- category: M.category,
1435
- additionalCategories: M.additionalCategories,
1436
- price: R && u.value.editPrice ? j == null ? void 0 : j.price : M.price,
1437
- orderFrom: R ? j == null ? void 0 : j.orderFrom : M.orderFrom,
1438
- taxes: R ? null : M.taxes,
1439
- thumbnail: M.thumbnail,
1440
- fallbackPrice: (le = P == null ? void 0 : P[ie]) == null ? void 0 : le.price,
1441
- fallbackName: R ? M.name : void 0,
1442
- fallbackCode: (X = P == null ? void 0 : P[ie]) == null ? void 0 : X.code,
1443
- fallbackOrder: (ye = P == null ? void 0 : P[ie]) == null ? void 0 : ye.orderFrom,
1444
- fallbackTaxes: R ? M.taxes : null
1427
+ ) : void 0, T = V.reduce((N, U, ue) => {
1428
+ var pe, fe, ae, ee;
1429
+ const j = (pe = p.value) == null ? void 0 : pe[U._id];
1430
+ return N[U._id] = {
1431
+ _id: U._id,
1432
+ name: U.name,
1433
+ code: M ? j == null ? void 0 : j.code : U == null ? void 0 : U.code,
1434
+ category: U.category,
1435
+ additionalCategories: U.additionalCategories,
1436
+ price: M && u.value.editPrice ? j == null ? void 0 : j.price : U.price,
1437
+ orderFrom: M ? j == null ? void 0 : j.orderFrom : U.orderFrom,
1438
+ taxes: M ? null : U.taxes,
1439
+ thumbnail: U.thumbnail,
1440
+ fallbackPrice: (fe = A == null ? void 0 : A[ue]) == null ? void 0 : fe.price,
1441
+ fallbackName: M ? U.name : void 0,
1442
+ fallbackCode: (ae = A == null ? void 0 : A[ue]) == null ? void 0 : ae.code,
1443
+ fallbackOrder: (ee = A == null ? void 0 : A[ue]) == null ? void 0 : ee.orderFrom,
1444
+ fallbackTaxes: M ? U.taxes : null
1445
1445
  }, N;
1446
1446
  }, {});
1447
- b.value = A, y.value = { ...A }, f.value = !1;
1448
- }, { categories: W, selectedCategories: Y } = Se(), S = V(null);
1449
- function oe() {
1447
+ b.value = T, y.value = { ...T }, f.value = !1;
1448
+ }, { categories: q, selectedCategories: Y } = we(), S = I(null);
1449
+ function ne() {
1450
1450
  S.value && S.value.toggleAttributeFilter();
1451
1451
  }
1452
- tt(async () => {
1452
+ et(async () => {
1453
1453
  Y.value && await w();
1454
1454
  });
1455
1455
  function Z() {
@@ -1457,57 +1457,56 @@ const Ye = /* @__PURE__ */ K({
1457
1457
  }
1458
1458
  const re = () => {
1459
1459
  Y.value && w();
1460
- }, { t: E } = Ie(), D = h(() => {
1461
- var R, $;
1462
- return ($ = (R = e.currentCatalog) == null ? void 0 : R.linkItemRules) == null ? void 0 : $.length;
1460
+ }, { t: E } = Ve(), D = h(() => {
1461
+ var M, V;
1462
+ return (V = (M = e.currentCatalog) == null ? void 0 : M.linkItemRules) == null ? void 0 : V.length;
1463
1463
  }), {
1464
1464
  menuItems: O,
1465
- categories: H,
1466
- linkItemRules: J,
1467
- handleSubmit: ne,
1468
- catalogManager: Q,
1469
- schedulerManager: se
1465
+ linkItemRules: W,
1466
+ handleSubmit: J,
1467
+ catalogManager: se,
1468
+ schedulerManager: H
1470
1469
  } = kt(!1);
1471
- return (R, $) => {
1472
- const P = z("fm-button");
1473
- return a(W).length ? (m(), C("div", ea, [
1470
+ return (M, V) => {
1471
+ const A = z("fm-button");
1472
+ return a(q).length ? (m(), C("div", ea, [
1474
1473
  g("div", ta, [
1475
1474
  g("div", la, [
1476
- a(Y) ? (m(), I(Xl, {
1475
+ a(Y) ? (m(), $(Xl, {
1477
1476
  key: 0,
1478
1477
  ref_key: "productTableRef",
1479
1478
  ref: S,
1480
1479
  "is-calculating": f.value,
1481
1480
  "model-value": b.value,
1482
1481
  "original-value": y.value,
1483
- "onUpdate:modelValue": $[1] || ($[1] = (A) => b.value = A),
1482
+ "onUpdate:modelValue": V[1] || (V[1] = (T) => b.value = T),
1484
1483
  "onReset:modelValue": re,
1485
- "onUpdate:editing": $[2] || ($[2] = (A) => s.value = A)
1484
+ "onUpdate:editing": V[2] || (V[2] = (T) => s.value = T)
1486
1485
  }, {
1487
- filter: T(() => [
1488
- d(He, { onToggleAttributeFilter: oe }),
1489
- u.value.multiScheduler ? (m(), I(qe, { key: 0 })) : U("", !0),
1490
- D.value ? (m(), I(Le, {
1486
+ filter: P(() => [
1487
+ d(We, { onToggleAttributeFilter: ne }),
1488
+ u.value.multiScheduler ? (m(), $(Le, { key: 0 })) : R("", !0),
1489
+ D.value ? (m(), $(Ge, {
1491
1490
  key: 1,
1492
- "current-restaurant-attr-params": a(e).state.currentRestaurantAttrParams,
1493
- onConfirm: $[0] || ($[0] = (A) => a(e).setRestaurantAttrParams(A))
1494
- }, null, 8, ["current-restaurant-attr-params"])) : U("", !0)
1491
+ "current-restaurant-custom-attributes": a(e).state.currentRestaurantCustomAttributes,
1492
+ onConfirm: V[0] || (V[0] = (T) => a(e).setRestaurantCustomAttributes(T))
1493
+ }, null, 8, ["current-restaurant-custom-attributes"])) : R("", !0)
1495
1494
  ]),
1496
1495
  _: 1
1497
- }, 8, ["is-calculating", "model-value", "original-value"])) : U("", !0)
1496
+ }, 8, ["is-calculating", "model-value", "original-value"])) : R("", !0)
1498
1497
  ])
1499
1498
  ])
1500
1499
  ])) : (m(), C("div", aa, [
1501
1500
  g("div", oa, [
1502
- d(He),
1503
- u.value.multiScheduler ? (m(), I(qe, { key: 0 })) : U("", !0),
1504
- D.value ? (m(), I(Le, {
1501
+ d(We),
1502
+ u.value.multiScheduler ? (m(), $(Le, { key: 0 })) : R("", !0),
1503
+ D.value ? (m(), $(Ge, {
1505
1504
  key: 1,
1506
- "current-restaurant-attr-params": a(e).state.currentRestaurantAttrParams,
1507
- onConfirm: $[3] || ($[3] = (A) => a(e).setRestaurantAttrParams(A))
1508
- }, null, 8, ["current-restaurant-attr-params"])) : U("", !0)
1505
+ "current-restaurant-custom-attributes": a(e).state.currentRestaurantCustomAttributes,
1506
+ onConfirm: V[3] || (V[3] = (T) => a(e).setRestaurantCustomAttributes(T))
1507
+ }, null, 8, ["current-restaurant-custom-attributes"])) : R("", !0)
1509
1508
  ]),
1510
- n.value.create ? (m(), I(be, {
1509
+ r.value.create ? (m(), $(be, {
1511
1510
  key: 0,
1512
1511
  action: {
1513
1512
  text: a(E)("menu.product.empty.with_create.action"),
@@ -1515,59 +1514,57 @@ const Ye = /* @__PURE__ */ K({
1515
1514
  },
1516
1515
  subtitle: a(E)("menu.product.empty.with_create.subtitle"),
1517
1516
  title: a(E)("menu.product.empty.with_create.title")
1518
- }, null, 8, ["action", "subtitle", "title"])) : t.value ? (m(), I(be, {
1517
+ }, null, 8, ["action", "subtitle", "title"])) : t.value ? (m(), $(be, {
1519
1518
  key: 1,
1520
1519
  subtitle: a(E)("menu.product.empty.no_scheduler.subtitle"),
1521
1520
  title: a(E)("menu.product.empty.no_scheduler.title")
1522
1521
  }, {
1523
- action: T(() => [
1524
- d(Ge, {
1525
- "categorized-items": a(Q).linkableItems.value,
1526
- "initial-value": a(Q).currentItems.value,
1522
+ action: P(() => [
1523
+ d(Ee, {
1524
+ "categorized-items": a(se).linkableItems.value,
1525
+ "initial-value": a(se).currentItems.value,
1527
1526
  "show-variant": !1,
1528
1527
  "menu-items": a(O),
1529
- categories: a(H),
1530
- "link-item-rules": a(J),
1528
+ "link-item-rules": a(W),
1531
1529
  "no-scheduler": t.value,
1532
1530
  "is-local-only": !0,
1533
- onSubmit: a(ne)
1531
+ onSubmit: a(J)
1534
1532
  }, {
1535
- default: T(({ trigger: A }) => [
1536
- d(P, {
1533
+ default: P(({ trigger: T }) => [
1534
+ d(A, {
1537
1535
  label: a(E)("menu.common.actions.link_product"),
1538
1536
  "prepend-icon": "link",
1539
- onClick: A
1537
+ onClick: T
1540
1538
  }, null, 8, ["label", "onClick"])
1541
1539
  ]),
1542
1540
  _: 1
1543
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])
1541
+ }, 8, ["categorized-items", "initial-value", "menu-items", "link-item-rules", "no-scheduler", "onSubmit"])
1544
1542
  ]),
1545
1543
  _: 1
1546
- }, 8, ["subtitle", "title"])) : (m(), I(be, {
1544
+ }, 8, ["subtitle", "title"])) : (m(), $(be, {
1547
1545
  key: 2,
1548
1546
  subtitle: a(E)("menu.product.empty.with_scheduler.subtitle"),
1549
1547
  title: a(E)("menu.product.empty.with_scheduler.title")
1550
1548
  }, {
1551
- action: T(() => [
1552
- d(Ge, {
1553
- "categorized-items": a(se).linkableItems.value,
1554
- "initial-value": a(se).currentItems.value,
1549
+ action: P(() => [
1550
+ d(Ee, {
1551
+ "categorized-items": a(H).linkableItems.value,
1552
+ "initial-value": a(H).currentItems.value,
1555
1553
  "show-variant": !1,
1556
1554
  "menu-items": a(O),
1557
- categories: a(H),
1558
- "link-item-rules": a(J),
1555
+ "link-item-rules": a(W),
1559
1556
  "no-scheduler": t.value,
1560
1557
  "is-local-only": !0,
1561
- onSubmit: a(ne)
1558
+ onSubmit: a(J)
1562
1559
  }, {
1563
- default: T(({ trigger: A }) => [
1564
- d(P, {
1560
+ default: P(({ trigger: T }) => [
1561
+ d(A, {
1565
1562
  label: a(E)("menu.common.actions.apply_product"),
1566
- onClick: A
1563
+ onClick: T
1567
1564
  }, null, 8, ["label", "onClick"])
1568
1565
  ]),
1569
1566
  _: 1
1570
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])
1567
+ }, 8, ["categorized-items", "initial-value", "menu-items", "link-item-rules", "no-scheduler", "onSubmit"])
1571
1568
  ]),
1572
1569
  _: 1
1573
1570
  }, 8, ["subtitle", "title"]))
@@ -1576,6 +1573,6 @@ const Ye = /* @__PURE__ */ K({
1576
1573
  }
1577
1574
  });
1578
1575
  export {
1579
- Ye as _,
1576
+ Qe as _,
1580
1577
  Fa as a
1581
1578
  };