@feedmepos/mf-menu 0.20.2 → 0.21.0

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 (54) hide show
  1. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-Ds2qfY_X.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DxlJ6xrN.js} +10 -10
  2. package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-BRepaPR3.js → ApplyProducts.vue_vue_type_script_setup_true_lang-CF-fCyCs.js} +5 -4
  3. package/dist/{Catalog-S5KDEWzG.js → Catalog-CVmJyr3D.js} +74 -73
  4. package/dist/{Category-DLaNEtA5.js → Category-CjzACwyb.js} +6 -6
  5. package/dist/{CookingGuide-DSGZapxz.js → CookingGuide-COZFvS4P.js} +7 -6
  6. package/dist/{Group-CBMSkmwQ.js → Group-Bun-FrIN.js} +1 -1
  7. package/dist/{Group-B0VQ-64x.js → Group-xCFTbuXd.js} +7 -7
  8. package/dist/{Group.vue_vue_type_script_setup_true_lang-DKzrhXtM.js → Group.vue_vue_type_script_setup_true_lang-DSfas9NO.js} +57 -56
  9. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BV-FC8tM.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-kl0WpFCW.js} +24 -24
  10. package/dist/{Ingredient-CnPQ0kiR.js → Ingredient-w4kVvEml.js} +69 -68
  11. package/dist/{LinkProductSideSheet-A26Otbdm.js → LinkProductSideSheet-CBHtwxCb.js} +30 -29
  12. package/dist/{PrintRoute-BlJMdPP0.js → PrintRoute-DXsa638J.js} +30 -29
  13. package/dist/{Product-BvD813LL.js → Product-BAtB4ebt.js} +1 -1
  14. package/dist/{Product.vue_vue_type_script_setup_true_lang-D_oKtXbh.js → Product.vue_vue_type_script_setup_true_lang-DeJy-daz.js} +276 -279
  15. package/dist/{Products-B8Ok-bkN.js → Products-BQHiOdhZ.js} +24 -23
  16. package/dist/{Publish-qBiJUQ4X.js → Publish-DbxeuyRV.js} +68 -67
  17. package/dist/{Recipe-CJxJJAUV.js → Recipe-T2PlHYY_.js} +84 -83
  18. package/dist/{Scheduler-DfAMwXCu.js → Scheduler-C-W85pjK.js} +2 -2
  19. package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-CArE_Hua.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-DQNfBh14.js} +1 -1
  20. package/dist/ServingSequence-lNzb6f-1.js +4 -0
  21. package/dist/{Setting-BbgJcWsN.js → Setting-C8gm77EA.js} +1 -1
  22. package/dist/{Setting.vue_vue_type_script_setup_true_lang-BbVEzNve.js → Setting.vue_vue_type_script_setup_true_lang-BR3_ywqR.js} +13 -12
  23. package/dist/{Takeaway-wAXsZQN2.js → Takeaway-CCw_DHze.js} +12 -12
  24. package/dist/{Takeaway-CMDFYeUw.js → Takeaway-DbHgvpIH.js} +1 -1
  25. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DSphRs_i.js → Takeaway.vue_vue_type_script_setup_true_lang-DsUQ3Dlh.js} +22 -21
  26. package/dist/{TaxSetting-C1XOTv-9.js → TaxSetting-BQdKVfBi.js} +4 -4
  27. package/dist/{Unit-BW3iqgp8.js → Unit-M217TP4K.js} +22 -21
  28. package/dist/{Variant-BJIxp9PJ.js → Variant-Boy7TugQ.js} +10 -10
  29. package/dist/{_id_-B25OxuPV.js → _id_-DA8Gpcqf.js} +6 -6
  30. package/dist/{app-BFJlAowN.js → app-rWkFl8Vq.js} +43468 -73420
  31. package/dist/app.js +4 -4
  32. package/dist/assets/linked-status-C8QAoUQr.js +24 -0
  33. package/dist/assets/validate-menu-DuCKFpOM.js +24 -0
  34. package/dist/{catalog-Do7RfIKm.js → catalog-Bas11mgo.js} +21595 -21593
  35. package/dist/{catalog-B-Z6lEFK.js → catalog-CfrgLaRX.js} +1 -1
  36. package/dist/{category-DEWEor3m.js → category-D-4M9HY7.js} +5 -4
  37. package/dist/currency-BPHwez-E.js +7 -0
  38. package/dist/index-Cwb_hpVz.js +7393 -0
  39. package/dist/{index-BEdHzZvu.js → index-v25k4isU.js} +47 -47
  40. package/dist/{item-BooojPpg.js → item-DTVh14mw.js} +1195 -1194
  41. package/dist/{lodash-247YxYiQ.js → lodash-BsZHKgKE.js} +439 -439
  42. package/dist/{menu-DCnWrgH7.js → menu-CUz01P4H.js} +6 -5
  43. package/dist/{object-B2cP_UeG.js → object-CbSdUbPF.js} +25 -25
  44. package/dist/{scheduler-0cChIv2I.js → scheduler-BuIczYeS.js} +13 -12
  45. package/dist/{takeaway-mwqVQ1ij.js → takeaway-DC-YsV2Q.js} +28 -27
  46. package/dist/{toExcel-Dha8Vf3u.js → toExcel-CaiFM8FE.js} +237 -237
  47. package/dist/{unit-BgfdgXAu.js → unit-D_VflvJf.js} +6 -5
  48. package/dist/{vuedraggable-BEszc36M.js → vuedraggable-WU01qJgi.js} +110 -110
  49. package/package.json +3 -3
  50. package/dist/ServingSequence-DxDMeto7.js +0 -4
  51. package/dist/assets/linked-status-4i88AmvK.js +0 -24
  52. package/dist/assets/validate-menu-CTKwgXfw.js +0 -24
  53. package/dist/currency-33gUke3q.js +0 -7
  54. package/dist/index-BXl09ebx.js +0 -21908
@@ -1,96 +1,97 @@
1
- import { ref as D, computed as g, defineComponent as ce, resolveComponent as q, openBlock as b, createBlock as G, withCtx as M, createVNode as i, createElementVNode as f, toDisplayString as Q, unref as l, createElementBlock as z, Fragment as xe, renderList as De, createTextVNode as Ze, mergeModels as Je, useModel as Qe, onMounted as Xe, renderSlot as he, watch as pe, h as A, withModifiers as Ve, createCommentVNode as ue, resolveDynamicComponent as et, normalizeStyle as tt, normalizeClass as se, nextTick as lt, watchEffect as at } from "vue";
2
- import { u as ye, a as Ne, c as ve, x as fe, F as ot, y as nt, k as ie, g as rt, z as Fe, i as je } from "./app-BFJlAowN.js";
3
- import { _ as $e } from "./SchedulerSelector.vue_vue_type_script_setup_true_lang-CArE_Hua.js";
4
- import { useI18n as Ce, useCoreStore as Ue } from "@feedmepos/mf-common";
5
- import { useSnackbar as Be, useDialog as Ae, components as re, FmButtonVariant as H, FmButtonColorThemeVariant as R, useBreakpoints as Ee } from "@feedmepos/ui-library";
1
+ import { ref as N, computed as g, defineComponent as ce, resolveComponent as q, openBlock as b, createBlock as G, withCtx as O, createVNode as i, createElementVNode as f, toDisplayString as Q, unref as l, createElementBlock as z, Fragment as xe, renderList as Ne, createTextVNode as He, mergeModels as Ze, useModel as Je, renderSlot as he, watch as pe, h as A, withModifiers as Ve, createCommentVNode as ue, resolveDynamicComponent as Qe, normalizeStyle as Xe, normalizeClass as se, nextTick as et, watchEffect as tt } from "vue";
2
+ import { u as ge, a as je, w as ve, F as lt, x as at, i as ie, d as ot, y as Fe, g as De } from "./app-rWkFl8Vq.js";
3
+ import { _ as $e } from "./SchedulerSelector.vue_vue_type_script_setup_true_lang-DQNfBh14.js";
4
+ import { useI18n as Ce, useCoreStore as nt } from "@feedmepos/mf-common";
5
+ import { useSnackbar as Ue, useDialog as Be, components as re, FmButtonVariant as Y, FmButtonColorThemeVariant as R, useBreakpoints as Ae } from "@feedmepos/ui-library";
6
+ import { Country as rt, Dinero as _e } from "@feedmepos/core";
6
7
  import "vue-router";
7
- import { u as ge } from "./menu-DCnWrgH7.js";
8
- import { u as Ke } from "./category-DEWEor3m.js";
9
- import "./vuedraggable-BEszc36M.js";
10
- import { s as st, _ as ut, c as Te, a as it, u as ct } from "./catalog-Do7RfIKm.js";
11
- import { _ as dt } from "./takeaway-mwqVQ1ij.js";
12
- import { f as mt } from "./currency-33gUke3q.js";
13
- import { l as be } from "./lodash-247YxYiQ.js";
14
- import { u as Le, m as pt } from "./item-BooojPpg.js";
15
- import { w as vt } from "./InfoBasic.vue_vue_type_script_setup_true_lang-DxQBDu16.js";
16
- import { F as ft } from "./object-B2cP_UeG.js";
8
+ import { u as be } from "./menu-CUz01P4H.js";
9
+ import { u as Ee } from "./category-D-4M9HY7.js";
10
+ import "./vuedraggable-WU01qJgi.js";
11
+ import { _ as st, c as Te, a as ut, u as it } from "./catalog-Bas11mgo.js";
12
+ import { _ as ct } from "./takeaway-DC-YsV2Q.js";
13
+ import { f as dt } from "./currency-BPHwez-E.js";
14
+ import { l as fe } from "./lodash-BsZHKgKE.js";
15
+ import { u as Ke, m as mt } from "./item-DTVh14mw.js";
16
+ import { w as pt } from "./InfoBasic.vue_vue_type_script_setup_true_lang-DxQBDu16.js";
17
+ import { F as vt } from "./object-CbSdUbPF.js";
17
18
  import { _ as Ie } from "./TextChip.vue_vue_type_script_setup_true_lang-CNp85hoQ.js";
18
- import { L as Me } from "./LinkProductSideSheet-A26Otbdm.js";
19
- function bt(O, d) {
20
- const m = D(!0), r = g(() => {
19
+ import { L as Oe } from "./LinkProductSideSheet-CBHtwxCb.js";
20
+ function ft(M, d) {
21
+ const m = N(!0), n = g(() => {
21
22
  var p, y;
22
- return !m.value && (!d.value || ((p = d.value) == null ? void 0 : p.length) === ((y = O.value) == null ? void 0 : y.length));
23
- }), S = g(() => {
23
+ return !m.value && (!d.value || ((p = d.value) == null ? void 0 : p.length) === ((y = M.value) == null ? void 0 : y.length));
24
+ }), F = g(() => {
24
25
  var p, y, $, _;
25
- return !!((p = d.value) != null && p.length && ((y = d.value) == null ? void 0 : y.length) > 0 && (($ = d.value) == null ? void 0 : $.length) < ((_ = O.value) == null ? void 0 : _.length));
26
+ return !!((p = d.value) != null && p.length && ((y = d.value) == null ? void 0 : y.length) > 0 && (($ = d.value) == null ? void 0 : $.length) < ((_ = M.value) == null ? void 0 : _.length));
26
27
  });
27
- return { allCleared: m, allSelected: r, indeterminate: S, toggleAll: () => {
28
+ return { allCleared: m, allSelected: n, indeterminate: F, toggleAll: () => {
28
29
  d.value = void 0, m.value = !m.value;
29
30
  }, toggleOption: (p) => {
30
- var $, _, Y;
31
+ var $, _, W;
31
32
  let y;
32
- d.value === void 0 && m.value ? y = [p] : d.value === void 0 && !m.value ? y = ($ = O.value.map((T) => T.value)) == null ? void 0 : $.filter((T) => T !== p) : (_ = d.value) != null && _.includes(p) ? y = (Y = d.value) == null ? void 0 : Y.filter((T) => T !== p) : y = [...d.value || [], p], y.length === 0 ? (d.value = void 0, m.value = !0) : y.length === O.value.length ? (d.value = void 0, m.value = !1) : d.value = y;
33
+ d.value === void 0 && m.value ? y = [p] : d.value === void 0 && !m.value ? y = ($ = M.value.map((T) => T.value)) == null ? void 0 : $.filter((T) => T !== p) : (_ = d.value) != null && _.includes(p) ? y = (W = d.value) == null ? void 0 : W.filter((T) => T !== p) : y = [...d.value || [], p], y.length === 0 ? (d.value = void 0, m.value = !0) : y.length === M.value.length ? (d.value = void 0, m.value = !1) : d.value = y;
33
34
  } };
34
35
  }
35
- const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, Oe = /* @__PURE__ */ ce({
36
+ const bt = { class: "p-4" }, gt = { class: "flex-1 overflow-y-auto min-h-0" }, Me = /* @__PURE__ */ ce({
36
37
  __name: "CategorySelector",
37
- setup(O) {
38
- const d = ye(), { categories: m, selectedCategories: r } = ge(), S = g(() => d.state.currentCategoryIds), n = g(
38
+ setup(M) {
39
+ const d = ge(), { categories: m, selectedCategories: n } = be(), F = g(() => d.state.currentCategoryIds), r = g(
39
40
  () => m.value.map((k) => ({ label: k.name, value: k.id }))
40
- ), W = g(() => n.value.filter(
41
+ ), J = g(() => r.value.filter(
41
42
  (k) => k.label.toLowerCase().includes($.value.toLowerCase())
42
43
  )), { t: p } = Ce(), y = g(() => {
43
- var k, c, N;
44
- return m.value.length === ((k = r.value) == null ? void 0 : k.length) ? p("menu.category.selector.all") : ((c = r.value) == null ? void 0 : c.length) === 1 ? r.value[0].name : `${(N = r.value) == null ? void 0 : N.length}`;
45
- }), $ = D(""), _ = g({
46
- get: () => S.value,
44
+ var k, c, j;
45
+ return m.value.length === ((k = n.value) == null ? void 0 : k.length) ? p("menu.category.selector.all") : ((c = n.value) == null ? void 0 : c.length) === 1 ? n.value[0].name : `${(j = n.value) == null ? void 0 : j.length}`;
46
+ }), $ = N(""), _ = g({
47
+ get: () => F.value,
47
48
  set: (k) => {
48
49
  d.selectCategory(k);
49
50
  }
50
- }), { allCleared: Y, allSelected: T, toggleAll: Z, toggleOption: J, indeterminate: E } = bt(n, _);
51
+ }), { allCleared: W, allSelected: T, toggleAll: H, toggleOption: Z, indeterminate: E } = ft(r, _);
51
52
  return (k, c) => {
52
- const N = q("FmIcon"), K = q("FmChip"), L = q("FmSearch"), ae = q("FmMenuItem"), X = q("FmMenu");
53
+ const j = q("FmIcon"), K = q("FmChip"), L = q("FmSearch"), ae = q("FmMenuItem"), X = q("FmMenu");
53
54
  return b(), G(X, {
54
55
  "close-on-click": !1,
55
56
  width: "220px"
56
57
  }, {
57
- "menu-button": M(() => [
58
+ "menu-button": O(() => [
58
59
  i(K, {
59
60
  label: y.value,
60
61
  class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400"
61
62
  }, {
62
- default: M(() => [
63
+ default: O(() => [
63
64
  f("p", null, Q(l(p)("menu.category.selector.title", { label: y.value })), 1),
64
- i(N, { name: "expand_more" })
65
+ i(j, { name: "expand_more" })
65
66
  ]),
66
67
  _: 1
67
68
  }, 8, ["label"])
68
69
  ]),
69
- default: M(() => [
70
- f("div", gt, [
70
+ default: O(() => [
71
+ f("div", bt, [
71
72
  i(L, {
72
73
  autofocus: "",
73
74
  modelValue: $.value,
74
- "onUpdate:modelValue": c[0] || (c[0] = (j) => $.value = j),
75
+ "onUpdate:modelValue": c[0] || (c[0] = (D) => $.value = D),
75
76
  placeholder: l(p)("menu.common.actions.search")
76
77
  }, null, 8, ["modelValue", "placeholder"])
77
78
  ]),
78
- f("div", yt, [
79
+ f("div", gt, [
79
80
  i(ae, {
80
81
  label: "All",
81
82
  "has-checkbox": "",
82
83
  "model-value": l(T),
83
84
  indeterminate: l(E),
84
- onClick: l(Z)
85
+ onClick: l(H)
85
86
  }, null, 8, ["model-value", "indeterminate", "onClick"]),
86
- (b(!0), z(xe, null, De(W.value, (j) => {
87
- var w;
87
+ (b(!0), z(xe, null, Ne(J.value, (D) => {
88
+ var S;
88
89
  return b(), G(ae, {
89
- key: j.value || "",
90
- label: j.label,
90
+ key: D.value || "",
91
+ label: D.label,
91
92
  "has-checkbox": "",
92
- "model-value": l(T) || ((w = _.value) == null ? void 0 : w.includes(j.value)),
93
- onClick: (U) => l(J)(j.value)
93
+ "model-value": l(T) || ((S = _.value) == null ? void 0 : S.includes(D.value)),
94
+ onClick: (U) => l(Z)(D.value)
94
95
  }, null, 8, ["label", "model-value", "onClick"]);
95
96
  }), 128))
96
97
  ])
@@ -99,103 +100,99 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
99
100
  });
100
101
  };
101
102
  }
102
- }), Pe = (O) => i("div", {
103
+ }), Pe = (M) => i("div", {
103
104
  class: "flex flex-1 justify-end"
104
- }, [i("span", null, [O, Ze(" ")])]), _t = /* @__PURE__ */ ce({
105
+ }, [i("span", null, [M, He(" ")])]), yt = /* @__PURE__ */ ce({
105
106
  __name: "CategorySelectorSingle",
106
- props: /* @__PURE__ */ Je({
107
+ props: /* @__PURE__ */ Ze({
107
108
  disabled: { type: Boolean, default: !1 }
108
109
  }, {
109
110
  modelValue: {},
110
111
  modelModifiers: {}
111
112
  }),
112
113
  emits: ["update:modelValue"],
113
- setup(O) {
114
- const d = ye(), m = Qe(O, "modelValue"), r = g(() => d.categories.map((S) => ({
115
- label: S.name,
116
- value: S._id || null
114
+ setup(M) {
115
+ const d = ge(), m = Je(M, "modelValue"), n = g(() => d.categories.map((F) => ({
116
+ label: F.name,
117
+ value: F._id || null
117
118
  })));
118
- return (S, n) => {
119
- const W = q("FmSelect");
120
- return b(), G(W, {
121
- items: r.value,
119
+ return (F, r) => {
120
+ const J = q("FmSelect");
121
+ return b(), G(J, {
122
+ items: n.value,
122
123
  modelValue: m.value,
123
- "onUpdate:modelValue": n[0] || (n[0] = (p) => m.value = p),
124
- disabled: S.disabled
124
+ "onUpdate:modelValue": r[0] || (r[0] = (p) => m.value = p),
125
+ disabled: F.disabled
125
126
  }, null, 8, ["items", "modelValue", "disabled"]);
126
127
  };
127
128
  }
128
129
  }), ze = /* @__PURE__ */ ce({
129
130
  __name: "ImportButton",
130
- setup(O) {
131
- const d = D(!1);
131
+ setup(M) {
132
+ const d = N(!1);
132
133
  function m() {
133
134
  d.value = !d.value;
134
135
  }
135
- const r = Ue();
136
- return Xe(() => {
137
- const S = r.currentCountry.value;
138
- S && st(S);
139
- }), (S, n) => (b(), z(xe, null, [
140
- i(ut, {
136
+ return (n, F) => (b(), z(xe, null, [
137
+ i(st, {
141
138
  modelValue: d.value,
142
- "onUpdate:modelValue": n[0] || (n[0] = (W) => d.value = W)
139
+ "onUpdate:modelValue": F[0] || (F[0] = (r) => d.value = r)
143
140
  }, null, 8, ["modelValue"]),
144
- he(S.$slots, "default", { trigger: m })
141
+ he(n.$slots, "default", { trigger: m })
145
142
  ], 64));
146
143
  }
147
- }), ht = {
144
+ }), _t = {
148
145
  class: "flex justify-between items-center space-x-8"
149
- }, xt = {
146
+ }, ht = {
150
147
  class: "flex space-x-8"
151
- }, Ct = {
148
+ }, xt = {
152
149
  class: "w-[320px]"
153
- }, kt = {
150
+ }, Ct = {
154
151
  key: 0,
155
152
  class: /* @__PURE__ */ se(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
156
- }, St = {
153
+ }, kt = {
157
154
  key: 0,
158
155
  class: "flex items-center p-4"
159
- }, wt = {
156
+ }, St = {
160
157
  class: /* @__PURE__ */ se(["mr-8", "fm-typo-en-body-md-400"])
161
- }, Vt = {
158
+ }, wt = {
162
159
  key: 1,
163
160
  class: "px-16 py-4 space-x-8 flex justify-end"
164
- }, Ft = {
161
+ }, Vt = {
165
162
  key: 1
166
- }, $t = {
163
+ }, Ft = {
167
164
  class: "flex space-x-8"
168
- }, Tt = {
165
+ }, $t = {
169
166
  key: 1,
170
167
  class: "pt-8 flex flex-col flex-1 overflow-hidden"
171
- }, It = {
168
+ }, Tt = {
172
169
  class: "space-y-8 pb-8"
173
- }, Mt = {
170
+ }, It = {
174
171
  class: "w-full px-8"
175
172
  }, Ot = {
176
173
  class: "flex space-x-8 px-8"
177
- }, Pt = {
174
+ }, Mt = {
178
175
  key: 0,
179
176
  class: /* @__PURE__ */ se(["flex flex-col flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
180
- }, zt = ["onClick"], Dt = {
177
+ }, Pt = ["onClick"], zt = {
181
178
  class: "min-w-0 flex flex-1 items-center justify-start space-x-16"
182
179
  }, Nt = {
183
180
  class: "flex-1 min-w-0"
184
181
  }, jt = {
185
182
  class: "flex justify-between items-center gap-8 pb-4"
186
- }, Ut = {
183
+ }, Dt = {
187
184
  class: "flex-1 min-w-0 fm-typo-en-body-lg-600 line-clamp-2"
185
+ }, Ut = {
186
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
188
187
  }, Bt = {
189
188
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
190
189
  }, At = {
191
190
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
192
191
  }, Et = {
193
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
194
- }, Kt = {
195
192
  key: 1
196
- }, Lt = {
193
+ }, Kt = {
197
194
  class: "flex space-x-8"
198
- }, Rt = /* @__PURE__ */ ce({
195
+ }, Lt = /* @__PURE__ */ ce({
199
196
  __name: "ProductTable",
200
197
  props: {
201
198
  modelValue: {},
@@ -205,46 +202,46 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
205
202
  }
206
203
  },
207
204
  emits: ["update:model-value", "reset:model-value", "update:editing", "update:search-key"],
208
- setup(O, {
205
+ setup(M, {
209
206
  emit: d
210
207
  }) {
211
- const m = O, {
212
- t: r
213
- } = Ce(), S = Ue(), n = ye(), W = Be(), p = Ae(), y = Ne(W), $ = je(y);
214
- Ke({
208
+ const m = M, {
209
+ t: n
210
+ } = Ce(), F = nt(), r = ge(), J = Ue(), p = Be(), y = je(J), $ = De(y);
211
+ Ee({
215
212
  dialog: p,
216
213
  menuLoader: $
217
214
  });
218
- const _ = Le();
219
- g(() => !n.state.currentSchedulerId);
220
- const Y = S.currentCountry, T = g(() => Y.value ? ve.Country.getCountry(Y.value) : null), Z = g(() => n.rules.item);
221
- g(() => J.value.length === 1 && J.value[0].id === null);
215
+ const _ = Ke();
216
+ g(() => !r.state.currentSchedulerId);
217
+ const W = F.currentCountry, T = g(() => W.value ? rt.getCountry(W.value) : null), H = g(() => r.rules.item);
218
+ g(() => Z.value.length === 1 && Z.value[0].id === null);
222
219
  const {
223
- selectedCategories: J
224
- } = ge(), E = g(() => be.flatten(J.value.map((e) => e.items))), k = d, c = D(!1);
220
+ selectedCategories: Z
221
+ } = be(), E = g(() => fe.flatten(Z.value.map((e) => e.items))), k = d, c = N(!1);
225
222
  pe(() => c.value, (e) => {
226
223
  k("update:editing", e);
227
224
  });
228
- const N = (e) => {
229
- rt.isBoolean(e) ? c.value = e : c.value = !c.value;
230
- }, K = D(""), L = g(() => E.value.filter((e) => {
225
+ const j = (e) => {
226
+ ot.isBoolean(e) ? c.value = e : c.value = !c.value;
227
+ }, K = N(""), L = g(() => E.value.filter((e) => {
231
228
  var o;
232
- return !K.value || !K.value.trim() ? !0 : `${e.code} ${e.name} ${ke(e)} ${X(e.category || null)} ${(o = fe()[e.orderFrom]) == null ? void 0 : o.label}`.toLowerCase().includes(K.value.toLowerCase());
229
+ return !K.value || !K.value.trim() ? !0 : `${e.code} ${e.name} ${ke(e)} ${X(e.category || null)} ${(o = ve()[e.orderFrom]) == null ? void 0 : o.label}`.toLowerCase().includes(K.value.toLowerCase());
233
230
  })), {
234
231
  categories: ae
235
- } = ge(), X = (e) => {
232
+ } = be(), X = (e) => {
236
233
  const t = ae.value.find((o) => o.id === e || e === null && o.id === "");
237
234
  return t == null ? void 0 : t.name;
238
- }, j = (e, t, o) => {
239
- let a = be.clone(m.modelValue);
235
+ }, D = (e, t, o) => {
236
+ let a = fe.clone(m.modelValue);
240
237
  const u = a[e];
241
238
  u && (a[e] = {
242
239
  ...u,
243
240
  [t]: o
244
241
  }, k("update:model-value", a));
245
- }, w = be.debounce(j, 300), U = (e) => (t) => !!t || r("menu.product.table.validation.name_required", {
242
+ }, S = fe.debounce(D, 300), U = (e) => (t) => !!t || n("menu.product.table.validation.name_required", {
246
243
  field: e
247
- }), V = (e) => e >= 0 || r("menu.product.table.validation.price_min"), F = [U("Name")], x = () => [(e) => V(typeof e == "number" ? e : Number(e) ?? 0)], P = fe(), B = D([{
244
+ }), w = (e) => e >= 0 || n("menu.product.table.validation.price_min"), V = [U("Name")], x = () => [(e) => w(typeof e == "number" ? e : Number(e) ?? 0)], P = ve(), B = N([{
248
245
  accessorKey: "thumbnail",
249
246
  header: "",
250
247
  size: 64,
@@ -264,36 +261,36 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
264
261
  enableSorting: !1
265
262
  }, {
266
263
  accessorKey: "code",
267
- header: () => r("menu.product.table.columns.code"),
264
+ header: () => n("menu.product.table.columns.code"),
268
265
  enableSorting: !1,
269
266
  size: 100,
270
267
  cell: (e) => {
271
268
  const t = e.row.original, o = e.getValue() || "--";
272
269
  if (!c.value) return o;
273
- const a = _e(t._id);
270
+ const a = ye(t._id);
274
271
  return A(re.FmTextField, {
275
- disabled: !Z.value.code,
272
+ disabled: !H.value.code,
276
273
  modelValue: a == null ? void 0 : a.code,
277
274
  placeholder: m.modelValue[t._id].fallbackCode,
278
275
  "onUpdate:modelValue": (u) => {
279
- w(t._id, "code", u);
276
+ S(t._id, "code", u);
280
277
  }
281
278
  });
282
279
  }
283
280
  }, {
284
281
  accessorKey: "name",
285
- header: () => r("menu.product.table.columns.name"),
282
+ header: () => n("menu.product.table.columns.name"),
286
283
  enableSorting: !1,
287
284
  size: 240,
288
285
  cell: (e) => {
289
286
  const t = e.row.original, o = e.getValue();
290
287
  return c.value ? A(re.FmTextField, {
291
- disabled: !Z.value.name,
288
+ disabled: !H.value.name,
292
289
  modelValue: t.name,
293
290
  "onUpdate:modelValue": (a) => {
294
- w(t._id, "name", a);
291
+ S(t._id, "name", a);
295
292
  },
296
- rules: F,
293
+ rules: V,
297
294
  placeholder: t.fallbackName
298
295
  }) : o;
299
296
  }
@@ -301,7 +298,7 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
301
298
  accessorKey: "price",
302
299
  header: () => {
303
300
  var e;
304
- return Pe(r("menu.product.table.columns.price", {
301
+ return Pe(n("menu.product.table.columns.price", {
305
302
  currency: (e = T.value) == null ? void 0 : e.currency.symbol
306
303
  }));
307
304
  },
@@ -313,17 +310,17 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
313
310
  cell: (e) => {
314
311
  var u;
315
312
  const t = e.getValue();
316
- if (!c.value) return ve.Dinero.fromFdoDinero(t).toFormat();
313
+ if (!c.value) return _e.fromFdoDinero(t).toFormat();
317
314
  const o = m.modelValue[e.row.original._id], a = o.fallbackPrice;
318
- return A(dt, {
315
+ return A(ct, {
319
316
  min: 0,
320
317
  disabled: !o.editPrice,
321
318
  // @ts-ignore
322
- placeholder: a ? mt(a, !1) : void 0,
323
- modelValue: (u = _e(o._id)) == null ? void 0 : u.price,
319
+ placeholder: a ? dt(a, !1) : void 0,
320
+ modelValue: (u = ye(o._id)) == null ? void 0 : u.price,
324
321
  // @ts-ignore
325
322
  "onUpdate:modelValue": (h) => {
326
- j(o._id, "price", h);
323
+ D(o._id, "price", h);
327
324
  },
328
325
  rules: x()
329
326
  });
@@ -337,38 +334,38 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
337
334
  textAlign: "right"
338
335
  },
339
336
  cell: (e) => {
340
- const t = e.getValue(), o = e.row.original, a = n.taxSetting.countryTaxOptions, u = n.getSelectedTax(t, o.fallbackTaxes, n.taxSetting.countryTaxOptions), h = a.find((le) => le.value === u);
337
+ const t = e.getValue(), o = e.row.original, a = r.taxSetting.countryTaxOptions, u = r.getSelectedTax(t, o.fallbackTaxes, r.taxSetting.countryTaxOptions), h = a.find((le) => le.value === u);
341
338
  if (!c.value)
342
- return `${h != null && h.meta.rate ? ot(h.meta.rate) : 0}%`;
343
- const s = n.getSelectedTax(t, o.fallbackTaxes, n.taxSetting.countryTaxOptions);
339
+ return `${h != null && h.meta.rate ? lt(h.meta.rate) : 0}%`;
340
+ const s = r.getSelectedTax(t, o.fallbackTaxes, r.taxSetting.countryTaxOptions);
344
341
  return A(re.FmSelect, {
345
- disabled: !Z.value.tax,
346
- items: n.taxSetting.countryTaxOptions,
342
+ disabled: !H.value.tax,
343
+ items: r.taxSetting.countryTaxOptions,
347
344
  modelValue: s,
348
345
  "onUpdate:modelValue": async (le) => {
349
- const me = n.decodeTax(le);
350
- w(o._id, "taxes", [me]);
346
+ const me = r.decodeTax(le);
347
+ S(o._id, "taxes", [me]);
351
348
  }
352
349
  });
353
350
  }
354
351
  }, {
355
352
  accessorKey: "category",
356
- header: () => r("menu.product.table.columns.category"),
353
+ header: () => n("menu.product.table.columns.category"),
357
354
  enableSorting: !1,
358
355
  size: 140,
359
356
  cell: (e) => {
360
357
  const t = e.row.original;
361
- return c.value ? A(_t, {
358
+ return c.value ? A(yt, {
362
359
  "model-value": m.modelValue[t._id].category,
363
- disabled: !!(n.state.currentCatalogId || n.state.currentSchedulerId),
360
+ disabled: !!(r.state.currentCatalogId || r.state.currentSchedulerId),
364
361
  "onUpdate:modelValue": async (o) => {
365
- w(t._id, "category", o);
362
+ S(t._id, "category", o);
366
363
  }
367
364
  }) : X(t.category || null);
368
365
  }
369
366
  }, {
370
367
  accessorKey: "orderFrom",
371
- header: () => r("menu.product.table.columns.order_from"),
368
+ header: () => n("menu.product.table.columns.order_from"),
372
369
  enableSorting: !0,
373
370
  sortingFn: (e, t) => {
374
371
  const [o, a] = [e, t].map((u) => P[u.original.orderFrom].sortingIndex);
@@ -377,13 +374,13 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
377
374
  size: 110,
378
375
  cell: (e) => {
379
376
  var u, h;
380
- const t = e.getValue(), o = e.row.original, a = fe();
377
+ const t = e.getValue(), o = e.row.original, a = ve();
381
378
  return c.value ? A(re.FmSelect, {
382
- disabled: !Z.value.orderFrom,
383
- items: Object.values(fe()),
379
+ disabled: !H.value.orderFrom,
380
+ items: Object.values(ve()),
384
381
  modelValue: t,
385
382
  "onUpdate:modelValue": async (s) => {
386
- j(o._id, "orderFrom", s);
383
+ D(o._id, "orderFrom", s);
387
384
  }
388
385
  }) : A(Ie, {
389
386
  label: (u = a[t]) == null ? void 0 : u.label,
@@ -400,12 +397,12 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
400
397
  },
401
398
  header: () => A("div", {
402
399
  class: "w-full px-4 flex justify-end"
403
- }, [vt(A(re.FmButton, {
404
- variant: H.Tertiary,
400
+ }, [pt(A(re.FmButton, {
401
+ variant: Y.Tertiary,
405
402
  textColor: R.NeutralGray400,
406
403
  prependIcon: "edit",
407
404
  class: "flex justify-end",
408
- onClick: N,
405
+ onClick: j,
409
406
  type: "button"
410
407
  }), "Bulk edit")]),
411
408
  cell: (e) => {
@@ -426,8 +423,8 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
426
423
  })]);
427
424
  }
428
425
  }]);
429
- n.taxSetting.systemCode || B.value.splice(4, 1);
430
- const C = D({}), v = D([]);
426
+ r.taxSetting.systemCode || B.value.splice(4, 1);
427
+ const C = N({}), v = N([]);
431
428
  pe([() => C.value, () => L.value], (e) => {
432
429
  let t = [];
433
430
  Object.keys(e[0]).forEach((o) => {
@@ -443,8 +440,8 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
443
440
  C.value = {};
444
441
  };
445
442
  async function I() {
446
- await lt();
447
- const e = () => !!n.currentCatalog || !!n.state.currentSchedulerId, t = (a) => a === "" || a === null ? e() ? "" : null : a, o = Object.values(m.modelValue).filter((a) => {
443
+ await et();
444
+ const e = () => !!r.currentCatalog || !!r.state.currentSchedulerId, t = (a) => a === "" || a === null ? e() ? "" : null : a, o = Object.values(m.modelValue).filter((a) => {
448
445
  const u = Object.values(m.originalValue).find((h) => h._id === a._id);
449
446
  return Fe(u, a);
450
447
  }).map((a) => ({
@@ -456,7 +453,7 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
456
453
  taxes: a.taxes,
457
454
  category: t(a.category || null)
458
455
  }));
459
- await _.updateMany(o), N(!1);
456
+ await _.updateMany(o), j(!1);
460
457
  }
461
458
  const oe = async () => {
462
459
  await _.deleteItem(v.value.map((e) => ({
@@ -473,106 +470,106 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
473
470
  primaryActions: {
474
471
  text: "Discard",
475
472
  close: !0,
476
- variant: H.Destructive
473
+ variant: Y.Destructive
477
474
  },
478
475
  secondaryActions: {
479
476
  text: "Cancel",
480
477
  close: !0
481
478
  }
482
479
  }).onPrimary(() => {
483
- te(), N(!1);
484
- }) : (N(!1), te());
480
+ te(), j(!1);
481
+ }) : (j(!1), te());
485
482
  }, de = g(() => ({
486
483
  thumbnail: !c.value,
487
484
  actions: !c.value
488
- })), Re = (e) => {
485
+ })), Le = (e) => {
489
486
  _.update(e._id);
490
487
  };
491
- async function Ge(e) {
488
+ async function Re(e) {
492
489
  await _.update(e.original._id);
493
490
  }
494
491
  function ke(e) {
495
492
  var h;
496
493
  const t = e.price ?? // TODO: fix type error
497
494
  // @ts-ignore
498
- e.fallbackPrice ?? ve.Dinero.fromNumber({
495
+ e.fallbackPrice ?? _e.fromNumber({
499
496
  number: 0
500
497
  }).toObject(), o = e.taxes;
501
- n.taxSetting.countryTaxOptions;
502
- const a = ve.Dinero.fromFdoDinero(t).toFormat(), u = (h = T.value) == null ? void 0 : h.currency.symbol;
503
- return n.getSelectedTax(
498
+ r.taxSetting.countryTaxOptions;
499
+ const a = _e.fromFdoDinero(t).toFormat(), u = (h = T.value) == null ? void 0 : h.currency.symbol;
500
+ return r.getSelectedTax(
504
501
  o,
505
502
  // TODO: fix type error
506
503
  // @ts-ignore
507
504
  e.fallbackTaxes,
508
- n.taxSetting.countryTaxOptions
505
+ r.taxSetting.countryTaxOptions
509
506
  ), `${u == null ? void 0 : u.toUpperCase()}${a}`;
510
507
  }
511
- function _e(e) {
508
+ function ye(e) {
512
509
  var a;
513
- const t = n.currentCatalog, o = n.state.currentSchedulerId;
510
+ const t = r.currentCatalog, o = r.state.currentSchedulerId;
514
511
  if (t && o) {
515
512
  const u = t.override.scheduler[o] ?? {
516
513
  _id: o
517
514
  };
518
515
  return ((a = u == null ? void 0 : u.items) == null ? void 0 : a.filter((s) => s._id === e))[0];
519
- } else return t ? t.override.items[e][0] : o ? n.schedulers.find((s) => s._id === o).items.filter((s) => s._id === e)[0] : E.value.find((u) => u._id === e);
516
+ } else return t ? t.override.items[e][0] : o ? r.schedulers.find((s) => s._id === o).items.filter((s) => s._id === e)[0] : E.value.find((u) => u._id === e);
520
517
  }
521
- const qe = Ee(), We = g(() => qe.breakpoints.value.xs), Se = D(null), Ye = nt(Se), He = g(() => {
518
+ const Ge = Ae(), qe = g(() => Ge.breakpoints.value.xs), Se = N(null), We = at(Se), Ye = g(() => {
522
519
  var t;
523
520
  return {
524
- height: `calc(100vh - ${((t = Ye.value) == null ? void 0 : t.top) + 24}px)`
521
+ height: `calc(100vh - ${((t = We.value) == null ? void 0 : t.top) + 24}px)`
525
522
  };
526
523
  });
527
524
  return (e, t) => {
528
525
  const o = q("fm-search"), a = q("fm-button"), u = q("fm-table"), h = q("fm-form");
529
- return We.value ? (b(), z("div", Tt, [f("div", It, [f("div", Mt, [i(o, {
526
+ return qe.value ? (b(), z("div", $t, [f("div", Tt, [f("div", It, [i(o, {
530
527
  "model-value": K.value,
531
528
  "onUpdate:modelValue": t[4] || (t[4] = (s) => K.value = s),
532
529
  autofocus: "",
533
- placeholder: l(r)("menu.product.table.search.placeholder")
530
+ placeholder: l(n)("menu.product.table.search.placeholder")
534
531
  }, null, 8, ["model-value", "placeholder"])]), t[6] || (t[6] = f("div", {
535
532
  class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
536
- }, null, -1)), f("div", Ot, [he(e.$slots, "filter")])]), E.value.length ? (b(), z("div", Pt, [(b(!0), z(xe, null, De(L.value, (s) => {
533
+ }, null, -1)), f("div", Ot, [he(e.$slots, "filter")])]), E.value.length ? (b(), z("div", Mt, [(b(!0), z(xe, null, Ne(L.value, (s) => {
537
534
  var le, me, we;
538
535
  return b(), z("div", {
539
536
  key: s._id,
540
537
  class: "max-w-full py-12 px-16 space-x-16 flex items-center",
541
- onClick: () => Re(s)
542
- }, [f("div", Dt, [i(Te, {
538
+ onClick: () => Le(s)
539
+ }, [f("div", zt, [i(Te, {
543
540
  alt: s.name,
544
541
  size: 72,
545
542
  src: s.thumbnail
546
- }, null, 8, ["alt", "src"]), f("div", Nt, [f("div", jt, [f("p", Ut, Q(s.name), 1), i(Ie, {
543
+ }, null, 8, ["alt", "src"]), f("div", Nt, [f("div", jt, [f("p", Dt, Q(s.name), 1), i(Ie, {
547
544
  label: (le = l(P)[s.orderFrom || ""]) == null ? void 0 : le.label,
548
545
  variant: (me = l(P)[s.orderFrom || ""]) == null ? void 0 : me.variant
549
- }, null, 8, ["label", "variant"])]), f("p", Bt, Q(ke(s)), 1), f("p", At, Q(l(r)("menu.product.table.columns.code")) + ": " + Q(((we = _e(s._id)) == null ? void 0 : we.code) || "--"), 1), f("p", Et, Q(l(r)("menu.product.table.columns.category")) + ": " + Q(X(s.category || null)), 1)])]), i(a, {
546
+ }, null, 8, ["label", "variant"])]), f("p", Ut, Q(ke(s)), 1), f("p", Bt, Q(l(n)("menu.product.table.columns.code")) + ": " + Q(((we = ye(s._id)) == null ? void 0 : we.code) || "--"), 1), f("p", At, Q(l(n)("menu.product.table.columns.category")) + ": " + Q(X(s.category || null)), 1)])]), i(a, {
550
547
  "text-color": l(R).NeutralGray400,
551
- variant: l(H).Tertiary,
548
+ variant: l(Y).Tertiary,
552
549
  "prepend-icon": "delete",
553
550
  onClick: Ve(() => l(_).deleteItem([{
554
551
  _id: s._id,
555
552
  name: s.name,
556
553
  thumbnail: s.thumbnail
557
554
  }]), ["stop"])
558
- }, null, 8, ["text-color", "variant", "onClick"])], 8, zt);
559
- }), 128))])) : (b(), z("div", Kt, [i(ie, {
560
- subtitle: l(r)("menu.product.table.empty.subtitle"),
561
- title: l(r)("menu.product.table.empty.title")
555
+ }, null, 8, ["text-color", "variant", "onClick"])], 8, Pt);
556
+ }), 128))])) : (b(), z("div", Et, [i(ie, {
557
+ subtitle: l(n)("menu.product.table.empty.subtitle"),
558
+ title: l(n)("menu.product.table.empty.title")
562
559
  }, {
563
- action: M(() => [f("div", Lt, [i(a, {
564
- variant: l(H).Primary,
565
- label: l(r)("menu.product.table.empty.actions.add"),
560
+ action: O(() => [f("div", Kt, [i(a, {
561
+ variant: l(Y).Primary,
562
+ label: l(n)("menu.product.table.empty.actions.add"),
566
563
  "prepend-icon": "add",
567
564
  onClick: t[5] || (t[5] = (s) => l(_).create(null))
568
565
  }, null, 8, ["variant", "label"]), i(ze, null, {
569
- default: M(({
566
+ default: O(({
570
567
  trigger: s
571
568
  }) => [i(a, {
572
569
  "bg-color": l(R).NeutralGray100,
573
570
  "text-color": l(R).NeutralGray400,
574
- variant: l(H).Primary,
575
- label: l(r)("menu.product.table.empty.actions.import"),
571
+ variant: l(Y).Primary,
572
+ label: l(n)("menu.product.table.empty.actions.import"),
576
573
  "prepend-icon": "download",
577
574
  onClick: s
578
575
  }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
@@ -585,15 +582,15 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
585
582
  class: "flex flex-col flex-1 space-y-8 overflow-hidden",
586
583
  onValidationSuccess: I
587
584
  }, {
588
- default: M(() => [f("div", ht, [f("div", xt, [he(e.$slots, "filter")]), f("div", Ct, [i(o, {
585
+ default: O(() => [f("div", _t, [f("div", ht, [he(e.$slots, "filter")]), f("div", xt, [i(o, {
589
586
  "model-value": K.value,
590
587
  "onUpdate:modelValue": t[0] || (t[0] = (s) => K.value = s),
591
588
  autofocus: "",
592
- placeholder: l(r)("menu.product.table.search.placeholder")
593
- }, null, 8, ["model-value", "placeholder"])])]), E.value.length ? (b(), z("div", kt, [v.value.length && !c.value ? (b(), z("div", St, [f("p", wt, Q(l(r)("menu.product.table.selection.count", {
589
+ placeholder: l(n)("menu.product.table.search.placeholder")
590
+ }, null, 8, ["model-value", "placeholder"])])]), E.value.length ? (b(), z("div", Ct, [v.value.length && !c.value ? (b(), z("div", kt, [f("p", St, Q(l(n)("menu.product.table.selection.count", {
594
591
  count: v.value.length
595
592
  })), 1), i(a, {
596
- label: l(r)("menu.product.table.selection.actions.deselect_all"),
593
+ label: l(n)("menu.product.table.selection.actions.deselect_all"),
597
594
  type: "button",
598
595
  variant: "plain",
599
596
  onClick: ee
@@ -601,46 +598,46 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
601
598
  "border-color": l(R).SystemError300,
602
599
  "text-color": l(R).SystemError300,
603
600
  class: "ml-auto",
604
- label: l(r)("menu.product.table.selection.actions.remove"),
601
+ label: l(n)("menu.product.table.selection.actions.remove"),
605
602
  "prepend-icon": "delete",
606
603
  variant: "secondary",
607
604
  onClick: oe
608
- }, null, 8, ["border-color", "text-color", "label"])])) : ue("", !0), c.value ? (b(), z("div", Vt, [i(a, {
609
- variant: l(H).Tertiary,
610
- label: l(r)("menu.product.table.bulk_edit.actions.reset_all"),
605
+ }, null, 8, ["border-color", "text-color", "label"])])) : ue("", !0), c.value ? (b(), z("div", wt, [i(a, {
606
+ variant: l(Y).Tertiary,
607
+ label: l(n)("menu.product.table.bulk_edit.actions.reset_all"),
611
608
  onClick: te
612
609
  }, null, 8, ["variant", "label"]), i(a, {
613
- variant: l(H).Tertiary,
614
- label: l(r)("menu.common.actions.cancel"),
610
+ variant: l(Y).Tertiary,
611
+ label: l(n)("menu.common.actions.cancel"),
615
612
  onClick: ne
616
613
  }, null, 8, ["variant", "label"]), i(a, {
617
614
  borderColor: l(R).ColorPrimary,
618
615
  textColor: l(R).ColorPrimary,
619
- variant: l(H).Secondary,
620
- label: l(r)("menu.product.table.bulk_edit.actions.save"),
616
+ variant: l(Y).Secondary,
617
+ label: l(n)("menu.product.table.bulk_edit.actions.save"),
621
618
  type: "submit"
622
619
  }, null, 8, ["borderColor", "textColor", "variant", "label"])])) : ue("", !0), f("div", {
623
620
  ref_key: "tableWrapper",
624
621
  ref: Se
625
- }, [(b(), G(et(c.value ? ft : "div"), {
626
- title: l(r)("menu.product.table.bulk_edit.title"),
622
+ }, [(b(), G(Qe(c.value ? vt : "div"), {
623
+ title: l(n)("menu.product.table.bulk_edit.title"),
627
624
  show: c.value,
628
625
  "primary-action": {
629
- label: l(r)("menu.product.table.bulk_edit.actions.save")
626
+ label: l(n)("menu.product.table.bulk_edit.actions.save")
630
627
  },
631
628
  "secondary-actions": [{
632
- label: l(r)("menu.product.table.bulk_edit.actions.reset_all"),
629
+ label: l(n)("menu.product.table.bulk_edit.actions.reset_all"),
633
630
  click: te
634
631
  }, {
635
- label: l(r)("menu.common.actions.cancel"),
632
+ label: l(n)("menu.common.actions.cancel"),
636
633
  click: ne
637
634
  }],
638
635
  class: "overflow-hidden",
639
- style: tt(He.value),
636
+ style: Xe(Ye.value),
640
637
  onOnPrimary: I,
641
638
  onOnCancel: ne
642
639
  }, {
643
- default: M(() => [i(u, {
640
+ default: O(() => [i(u, {
644
641
  class: se({
645
642
  "mt-24": c.value
646
643
  }),
@@ -655,26 +652,26 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
655
652
  "shrink-at": !1,
656
653
  "hide-footer": "",
657
654
  "pin-header-row": "",
658
- onRowClick: t[2] || (t[2] = (s) => c.value ? void 0 : Ge(s))
655
+ onRowClick: t[2] || (t[2] = (s) => c.value ? void 0 : Re(s))
659
656
  }, null, 8, ["class", "modelValue", "column-defs", "column-visibility", "loading", "page-size", "row-data", "selection"])]),
660
657
  _: 1
661
- }, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (b(), z("div", Ft, [i(ie, {
662
- subtitle: l(r)("menu.product.table.empty.subtitle"),
663
- title: l(r)("menu.product.table.empty.title")
658
+ }, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (b(), z("div", Vt, [i(ie, {
659
+ subtitle: l(n)("menu.product.table.empty.subtitle"),
660
+ title: l(n)("menu.product.table.empty.title")
664
661
  }, {
665
- action: M(() => [f("div", $t, [i(a, {
666
- variant: l(H).Primary,
667
- label: l(r)("menu.product.table.empty.actions.add"),
662
+ action: O(() => [f("div", Ft, [i(a, {
663
+ variant: l(Y).Primary,
664
+ label: l(n)("menu.product.table.empty.actions.add"),
668
665
  "prepend-icon": "add",
669
666
  onClick: t[3] || (t[3] = (s) => l(_).create(null))
670
667
  }, null, 8, ["variant", "label"]), i(ze, null, {
671
- default: M(({
668
+ default: O(({
672
669
  trigger: s
673
670
  }) => [i(a, {
674
671
  "bg-color": l(R).NeutralGray100,
675
672
  "text-color": l(R).NeutralGray400,
676
- variant: l(H).Primary,
677
- label: l(r)("menu.product.table.empty.actions.import"),
673
+ variant: l(Y).Primary,
674
+ label: l(n)("menu.product.table.empty.actions.import"),
678
675
  "prepend-icon": "download",
679
676
  onClick: s
680
677
  }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
@@ -686,44 +683,44 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
686
683
  }));
687
684
  };
688
685
  }
689
- }), Gt = {
686
+ }), Rt = {
690
687
  key: 0,
691
688
  class: /* @__PURE__ */ se(["flex flex-col", "flex-1", "overflow-hidden"])
692
- }, qt = {
689
+ }, Gt = {
693
690
  class: /* @__PURE__ */ se(["pt-16 xs:pt-0", "flex xs:flex-col", "flex-1", "w-full", "overflow-hidden"])
694
- }, Wt = { class: "flex flex-col flex-1 overflow-hidden" }, Yt = {
691
+ }, qt = { class: "flex flex-col flex-1 overflow-hidden" }, Wt = {
695
692
  key: 1,
696
693
  class: "pt-16 xs:pt-8 space-y-24"
697
- }, Ht = { class: "flex items-center gap-8 px-16" }, vl = /* @__PURE__ */ ce({
694
+ }, Yt = { class: "flex items-center gap-8 px-16" }, vl = /* @__PURE__ */ ce({
698
695
  __name: "Product",
699
- setup(O) {
700
- const d = Ae(), m = Be(), r = Ne(m), S = je(r);
701
- Ke({
696
+ setup(M) {
697
+ const d = Be(), m = Ue(), n = je(m), F = De(n);
698
+ Ee({
702
699
  dialog: d,
703
- menuLoader: S
700
+ menuLoader: F
704
701
  });
705
- const n = ye(), W = g(() => n.rules.item), p = it(), y = Le(), $ = ct(), _ = g(() => !n.state.currentCatalogId), Y = g(() => n.rules.item), T = g(() => !n.state.currentSchedulerId), Z = D(!1), J = D(!1), E = g(() => {
706
- var V, F, x, P;
702
+ const r = ge(), J = g(() => r.rules.item), p = ut(), y = Ke(), $ = it(), _ = g(() => !r.state.currentCatalogId), W = g(() => r.rules.item), T = g(() => !r.state.currentSchedulerId), H = N(!1), Z = N(!1), E = g(() => {
703
+ var w, V, x, P;
707
704
  if (_.value && T.value) return;
708
705
  if (T.value) {
709
- const B = (V = n.currentCatalog) == null ? void 0 : V.override.items;
706
+ const B = (w = r.currentCatalog) == null ? void 0 : w.override.items;
710
707
  return B ? Object.entries(B).reduce((C, [v, ee]) => {
711
708
  const I = ee.find((oe) => !oe.combinationKey);
712
709
  return I && (C[v] = I), C;
713
710
  }, {}) : {};
714
711
  }
715
- return ((_.value ? (F = n.currentScheduler) == null ? void 0 : F.items : (P = (x = n.currentCatalog) == null ? void 0 : x.override.scheduler[n.state.currentSchedulerId]) == null ? void 0 : P.items) ?? []).reduce((B, C) => (C.combinationKey || (B[C._id] = C), B), {});
716
- }), k = D({}), c = D({}), N = async () => {
712
+ return ((_.value ? (V = r.currentScheduler) == null ? void 0 : V.items : (P = (x = r.currentCatalog) == null ? void 0 : x.override.scheduler[r.state.currentSchedulerId]) == null ? void 0 : P.items) ?? []).reduce((B, C) => (C.combinationKey || (B[C._id] = C), B), {});
713
+ }), k = N({}), c = N({}), j = async () => {
717
714
  var P, B;
718
- J.value = !0;
719
- const U = !!E.value, V = be.flatten(L.value.map((C) => C.items)), F = U && Z.value ? await pt(
720
- n.mergedMenu,
721
- V,
722
- n.state.menu,
723
- (P = n.currentCatalog) == null ? void 0 : P._id,
724
- (B = n.currentScheduler) == null ? void 0 : B._id,
715
+ Z.value = !0;
716
+ const U = !!E.value, w = fe.flatten(L.value.map((C) => C.items)), V = U && H.value ? await mt(
717
+ r.mergedMenu,
718
+ w,
719
+ r.state.menu,
720
+ (P = r.currentCatalog) == null ? void 0 : P._id,
721
+ (B = r.currentScheduler) == null ? void 0 : B._id,
725
722
  !1
726
- ) : void 0, x = V.reduce((C, v, ee) => {
723
+ ) : void 0, x = w.reduce((C, v, ee) => {
727
724
  var oe, te, ne, de;
728
725
  const I = (oe = E.value) == null ? void 0 : oe[v._id];
729
726
  return C[v._id] = {
@@ -731,80 +728,80 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
731
728
  name: v.name,
732
729
  code: U ? I == null ? void 0 : I.code : v == null ? void 0 : v.code,
733
730
  category: v.category,
734
- price: U && Y.value.editPrice ? I == null ? void 0 : I.price : v.price,
731
+ price: U && W.value.editPrice ? I == null ? void 0 : I.price : v.price,
735
732
  orderFrom: U ? I == null ? void 0 : I.orderFrom : v.orderFrom,
736
733
  taxes: U ? null : v.taxes,
737
734
  thumbnail: v.thumbnail,
738
- fallbackPrice: (te = F == null ? void 0 : F[ee]) == null ? void 0 : te.price,
735
+ fallbackPrice: (te = V == null ? void 0 : V[ee]) == null ? void 0 : te.price,
739
736
  fallbackName: U ? v.name : void 0,
740
- fallbackCode: (ne = F == null ? void 0 : F[ee]) == null ? void 0 : ne.code,
741
- fallbackOrder: (de = F == null ? void 0 : F[ee]) == null ? void 0 : de.orderFrom,
737
+ fallbackCode: (ne = V == null ? void 0 : V[ee]) == null ? void 0 : ne.code,
738
+ fallbackOrder: (de = V == null ? void 0 : V[ee]) == null ? void 0 : de.orderFrom,
742
739
  fallbackTaxes: U ? v.taxes : null
743
740
  }, C;
744
741
  }, {});
745
- k.value = x, c.value = { ...x }, J.value = !1;
746
- }, { categories: K, selectedCategories: L } = ge();
747
- at(async () => {
748
- L.value && await N();
742
+ k.value = x, c.value = { ...x }, Z.value = !1;
743
+ }, { categories: K, selectedCategories: L } = be();
744
+ tt(async () => {
745
+ L.value && await j();
749
746
  });
750
747
  function ae() {
751
748
  y.create(null);
752
749
  }
753
750
  const X = () => {
754
- L.value && N();
755
- }, j = Ee();
756
- g(() => j.breakpoints.value.xs);
757
- const { t: w } = Ce();
758
- return (U, V) => {
759
- const F = q("fm-button");
760
- return l(K).length ? (b(), z("div", Gt, [
761
- f("div", qt, [
762
- f("div", Wt, [
763
- l(L) ? (b(), G(Rt, {
751
+ L.value && j();
752
+ }, D = Ae();
753
+ g(() => D.breakpoints.value.xs);
754
+ const { t: S } = Ce();
755
+ return (U, w) => {
756
+ const V = q("fm-button");
757
+ return l(K).length ? (b(), z("div", Rt, [
758
+ f("div", Gt, [
759
+ f("div", qt, [
760
+ l(L) ? (b(), G(Lt, {
764
761
  key: 0,
765
- "is-calculating": J.value,
762
+ "is-calculating": Z.value,
766
763
  "model-value": k.value,
767
764
  "original-value": c.value,
768
- "onUpdate:modelValue": V[0] || (V[0] = (x) => k.value = x),
765
+ "onUpdate:modelValue": w[0] || (w[0] = (x) => k.value = x),
769
766
  "onReset:modelValue": X,
770
- "onUpdate:editing": V[1] || (V[1] = (x) => Z.value = x)
767
+ "onUpdate:editing": w[1] || (w[1] = (x) => H.value = x)
771
768
  }, {
772
- filter: M(() => [
773
- i(Oe),
774
- Y.value.multiScheduler ? (b(), G($e, { key: 0 })) : ue("", !0)
769
+ filter: O(() => [
770
+ i(Me),
771
+ W.value.multiScheduler ? (b(), G($e, { key: 0 })) : ue("", !0)
775
772
  ]),
776
773
  _: 1
777
774
  }, 8, ["is-calculating", "model-value", "original-value"])) : ue("", !0)
778
775
  ])
779
776
  ])
780
- ])) : (b(), z("div", Yt, [
781
- f("div", Ht, [
782
- i(Oe),
783
- Y.value.multiScheduler ? (b(), G($e, { key: 0 })) : ue("", !0)
777
+ ])) : (b(), z("div", Wt, [
778
+ f("div", Yt, [
779
+ i(Me),
780
+ W.value.multiScheduler ? (b(), G($e, { key: 0 })) : ue("", !0)
784
781
  ]),
785
- W.value.create ? (b(), G(ie, {
782
+ J.value.create ? (b(), G(ie, {
786
783
  key: 0,
787
784
  action: {
788
- text: l(w)("menu.product.empty.with_create.action"),
785
+ text: l(S)("menu.product.empty.with_create.action"),
789
786
  callback: ae
790
787
  },
791
- subtitle: l(w)("menu.product.empty.with_create.subtitle"),
792
- title: l(w)("menu.product.empty.with_create.title")
788
+ subtitle: l(S)("menu.product.empty.with_create.subtitle"),
789
+ title: l(S)("menu.product.empty.with_create.title")
793
790
  }, null, 8, ["action", "subtitle", "title"])) : T.value ? (b(), G(ie, {
794
791
  key: 1,
795
- subtitle: l(w)("menu.product.empty.no_scheduler.subtitle"),
796
- title: l(w)("menu.product.empty.no_scheduler.title")
792
+ subtitle: l(S)("menu.product.empty.no_scheduler.subtitle"),
793
+ title: l(S)("menu.product.empty.no_scheduler.title")
797
794
  }, {
798
- action: M(() => [
799
- i(Me, {
795
+ action: O(() => [
796
+ i(Oe, {
800
797
  "categorized-items": l($).linkableItems.value,
801
798
  "initial-value": l($).currentItems.value,
802
799
  "show-variant": !1,
803
- onSubmit: V[2] || (V[2] = (x) => l($).applyProduct(x.map((P) => P._id)))
800
+ onSubmit: w[2] || (w[2] = (x) => l($).applyProduct(x.map((P) => P._id)))
804
801
  }, {
805
- default: M(({ trigger: x }) => [
806
- i(F, {
807
- label: l(w)("menu.common.actions.link_product"),
802
+ default: O(({ trigger: x }) => [
803
+ i(V, {
804
+ label: l(S)("menu.common.actions.link_product"),
808
805
  "prepend-icon": "link",
809
806
  onClick: x
810
807
  }, null, 8, ["label", "onClick"])
@@ -815,19 +812,19 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
815
812
  _: 1
816
813
  }, 8, ["subtitle", "title"])) : (b(), G(ie, {
817
814
  key: 2,
818
- subtitle: l(w)("menu.product.empty.with_scheduler.subtitle"),
819
- title: l(w)("menu.product.empty.with_scheduler.title")
815
+ subtitle: l(S)("menu.product.empty.with_scheduler.subtitle"),
816
+ title: l(S)("menu.product.empty.with_scheduler.title")
820
817
  }, {
821
- action: M(() => [
822
- i(Me, {
818
+ action: O(() => [
819
+ i(Oe, {
823
820
  "categorized-items": l(p).linkableItems.value,
824
821
  "initial-value": l(p).currentItems.value,
825
822
  "show-variant": !1,
826
- onSubmit: V[3] || (V[3] = (x) => l(p).applyProduct(x.map((P) => P._id)))
823
+ onSubmit: w[3] || (w[3] = (x) => l(p).applyProduct(x.map((P) => P._id)))
827
824
  }, {
828
- default: M(({ trigger: x }) => [
829
- i(F, {
830
- label: l(w)("menu.common.actions.apply_product"),
825
+ default: O(({ trigger: x }) => [
826
+ i(V, {
827
+ label: l(S)("menu.common.actions.apply_product"),
831
828
  onClick: x
832
829
  }, null, 8, ["label", "onClick"])
833
830
  ]),