@feedmepos/mf-menu 0.31.28-beta.1 → 0.31.28-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{App-Ca6EfbM0.js → App-JT3apZxV.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-TjghlPjP.js → ApplyProduct.vue_vue_type_script_setup_true_lang-3GZupnr5.js} +2 -2
  3. package/dist/{Catalog-DcqEymK_.js → Catalog-kAI60cdJ.js} +5 -5
  4. package/dist/{Category-DqhkqPn5.js → Category-CkAn_OV_.js} +5 -5
  5. package/dist/{Category-DrV8RFw0.js → Category-DQjWYgVj.js} +4 -4
  6. package/dist/{CookingGuide-D5324ACr.js → CookingGuide-Bthk1y77.js} +3 -3
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-C1eTlRgY.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-NpRnwCY7.js} +1 -1
  8. package/dist/{Group-DPr6FkUR.js → Group-BGGn1Cm2.js} +3 -3
  9. package/dist/{Group-DdKAKDX5.js → Group-BkosIIKm.js} +1 -1
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-DHUn8wtV.js → Group.vue_vue_type_script_setup_true_lang-wJdVCYYu.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CcL8xIIp.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DnS02X6c.js} +3 -3
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CxG33Zfx.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-B_82rlxL.js} +317 -317
  13. package/dist/{Ingredient-CPMYSTHx.js → Ingredient-CFTQ0Bfc.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-B8edmN9o.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Ibea3-vX.js} +2 -2
  15. package/dist/{LinkProductSideSheet-CMv-Cl8o.js → LinkProductSideSheet-BecKfPsC.js} +1 -1
  16. package/dist/{MenuSetting-DTlVQhH-.js → MenuSetting-DuIDUokD.js} +4 -4
  17. package/dist/{PrintRoute-DZ_go_P2.js → PrintRoute-BcnNriE8.js} +3 -3
  18. package/dist/{Product-C_fICCS0.js → Product-BOOAm4a0.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-B5_7D3Uf.js → Product.vue_vue_type_script_setup_true_lang-CTIrwGpO.js} +11 -11
  20. package/dist/{ProductInternalTools-BB1Fx1SL.js → ProductInternalTools-CLAl51zu.js} +5 -5
  21. package/dist/{Products-BSP9BtpB.js → Products-DVKuBS8J.js} +10 -10
  22. package/dist/{Publish-DfLwMpi0.js → Publish-CNg_VIIx.js} +215 -211
  23. package/dist/{Recipe-ckiwtBvy.js → Recipe-BcrMcQeV.js} +4 -4
  24. package/dist/{Scheduler-GoFfvH3g.js → Scheduler-NByYPuMo.js} +3 -3
  25. package/dist/{ServingSequence-DJRYP2Wa.js → ServingSequence-BoyIqIYh.js} +3 -3
  26. package/dist/{Setting-BaVXtHHw.js → Setting-WbjnZJVn.js} +4 -4
  27. package/dist/{Subcategory-D1ellIJv.js → Subcategory-CEv5BrCf.js} +4 -4
  28. package/dist/{Takeaway-4mhVvPZX.js → Takeaway-Cc1bVUje.js} +1 -1
  29. package/dist/{Takeaway-D4kbxdXq.js → Takeaway-CfPmTA0E.js} +4 -4
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DmyujVsL.js → Takeaway.vue_vue_type_script_setup_true_lang-Bs50mb8k.js} +5 -5
  31. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DlXbq9hl.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CClYMK28.js} +12 -12
  32. package/dist/{Unit-PRuwV5nD.js → Unit-DQsNQ73i.js} +2 -2
  33. package/dist/{Variant-DiA_U-c8.js → Variant-BbotXK2d.js} +3 -3
  34. package/dist/{_id_-CX0cWun0.js → _id_-2-upiNil.js} +9 -9
  35. package/dist/{app-BbWAbjQS.js → app-CbNCInHo.js} +24 -24
  36. package/dist/{app-DhM14nc-.js → app-CbnHCo8C.js} +1 -1
  37. package/dist/app.js +1 -1
  38. package/dist/apps/mf-menu/src/composable/useRestaurantsBatch.d.ts +5 -4
  39. package/dist/apps/mf-menu/src/utils/batchProcessor.d.ts +7 -0
  40. package/dist/apps/mf-menu/src/utils/images.d.ts +1 -1
  41. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  42. package/dist/assets/{linked-status-D9s16EpF.js → linked-status-DQrcb0dN.js} +2 -2
  43. package/dist/assets/{override-menu-DJ-HMb-L.js → override-menu-ABYeceI6.js} +2 -2
  44. package/dist/assets/{validate-menu-B4g9NVpd.js → validate-menu-BUUUwe6X.js} +2 -2
  45. package/dist/{catalog-DICGX26b.js → catalog-n3cxFx7B.js} +1 -1
  46. package/dist/{catalogSetting-DNi3sae4.js → catalogSetting-Coex2wx4.js} +1 -1
  47. package/dist/{category-BVdpkvEY.js → category-DDDCcevC.js} +1 -1
  48. package/dist/{currency-D6GTzLnp.js → currency-YRHxgBh7.js} +1 -1
  49. package/dist/{dayjs.min-D1QpwzEr.js → dayjs.min-Bwk93uaZ.js} +1 -1
  50. package/dist/{index-7J2wjscT.js → index-BPAfFydt.js} +1 -1
  51. package/dist/{index-DnV90eV6.js → index-CbWCuRqD.js} +2 -2
  52. package/dist/{index-CiHIyK0U.js → index-CcHAK_Wv.js} +3 -3
  53. package/dist/{item-D-55zj01.js → item-BIRYK1Ue.js} +3950 -3949
  54. package/dist/{jszip.min-Dc1Q_2By.js → jszip.min-CRbsELup.js} +2 -2
  55. package/dist/{menu-DCNRkoVE.js → menu-DFzGLWUA.js} +1 -1
  56. package/dist/{menu-qiZp8pU6.js → menu-ipD3lXXk.js} +1147 -1129
  57. package/dist/mf-menu.css +1 -1
  58. package/dist/{priceTier-DH9-fsOO.js → priceTier-DB6-pxHE.js} +1 -1
  59. package/dist/{scheduler-v8esE-NR.js → scheduler-vy0G0HXI.js} +3 -3
  60. package/dist/{subcategory-vXszdIfw.js → subcategory-YqL6bVw8.js} +19 -15
  61. package/dist/{toExcel-CXJmxvpO.js → toExcel-CsQHeX96.js} +2 -2
  62. package/dist/{unit-Fgtp7mfX.js → unit-CuKfQHtl.js} +1 -1
  63. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
- import { defineComponent as j, ref as $, computed as V, onMounted as se, resolveComponent as C, createElementBlock as D, openBlock as h, createVNode as s, createElementVNode as o, toDisplayString as F, unref as u, Fragment as B, renderList as Y, createBlock as E, withCtx as U, createCommentVNode as ne, withModifiers as K, h as T } from "vue";
2
- import { D as Q } from "./dayjs.min-D1QpwzEr.js";
3
- import { useRouter as ue } from "vue-router";
4
- import { A as ie, e as re, D as X, a9 as ce, H as W, I as de, u as me, G as pe, a1 as ge } from "./menu-qiZp8pU6.js";
5
- import { useI18n as q, useCoreStore as ve, RestaurantSelector as be } from "@feedmepos/mf-common";
6
- import { useSnackbar as Z, useDialogChild as fe, useDialog as _e, components as J } from "@feedmepos/ui-library";
7
- import { _ as he } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
8
- import { _ as ye } from "./app-BbWAbjQS.js";
9
- import { a as Ce, w as ke } from "./tooltip-B5BiPMx9.js";
10
- import { u as we } from "./discardConfirm-BHni0LNu.js";
11
- import { _ as xe } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
12
- function ee(w) {
13
- return w ? Q(w).format("DD/MM/YY HH:mm") : "-";
1
+ import { defineComponent as K, ref as I, computed as S, onMounted as ne, resolveComponent as C, createElementBlock as R, openBlock as h, createVNode as n, createElementVNode as o, toDisplayString as F, unref as i, Fragment as E, renderList as j, createBlock as O, withCtx as L, createCommentVNode as ue, withModifiers as N, h as H } from "vue";
2
+ import { D as X } from "./dayjs.min-Bwk93uaZ.js";
3
+ import { useRouter as ie } from "vue-router";
4
+ import { A as re, e as ce, D as Z, a9 as de, H as J, I as me, u as pe, G as ge, a1 as ve } from "./menu-ipD3lXXk.js";
5
+ import { useI18n as Y, useCoreStore as be, RestaurantSelector as fe } from "@feedmepos/mf-common";
6
+ import { useSnackbar as ee, useDialogChild as _e, useDialog as he, components as Q } from "@feedmepos/ui-library";
7
+ import { _ as ye } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
8
+ import { _ as Ce } from "./app-CbNCInHo.js";
9
+ import { a as ke, w as we } from "./tooltip-B5BiPMx9.js";
10
+ import { u as xe } from "./discardConfirm-BHni0LNu.js";
11
+ import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
12
+ function ae(x) {
13
+ return x ? X(x).format("DD/MM/YY HH:mm") : "-";
14
14
  }
15
- function Ve(w, x, l) {
16
- const r = (i, m = !1) => {
15
+ function Se(x, V, l) {
16
+ const c = (r, m = !1) => {
17
17
  var y;
18
- return i === void 0 && !m ? "-" : ((y = l.find((f) => f.value === (i || null))) == null ? void 0 : y.label) || "-";
18
+ return r === void 0 && !m ? "-" : ((y = l.find((f) => f.value === (r || null))) == null ? void 0 : y.label) || "-";
19
19
  };
20
- return w.map((i) => {
20
+ return x.map((r) => {
21
21
  var p;
22
- const m = (p = x.find(({ _id: t }) => t === i._id)) == null ? void 0 : p.posVersion, y = !!m && !!ie.Pos.canUse({ feature: re.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: m }), f = r(i.catalogId);
22
+ const m = (p = V.find(({ _id: t }) => t === r._id)) == null ? void 0 : p.posVersion, y = !!m && !!re.Pos.canUse({ feature: ce.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: m }), f = c(r.catalogId);
23
23
  return {
24
- ...i,
24
+ ...r,
25
25
  _default: f,
26
- _posTakeaway: i.takeawayCatalog ? r(i.takeawayCatalog) : f,
27
- _additionalCatalogs: (i.additionalCatalogs || []).map((t) => r(t)),
28
- _lastUpdate: ee(i.updatedAt),
29
- _pickup: y ? r(i.pickupCatalog, !0) : "-",
26
+ _posTakeaway: r.takeawayCatalog ? c(r.takeawayCatalog) : f,
27
+ _additionalCatalogs: (r.additionalCatalogs || []).map((t) => c(t)),
28
+ _lastUpdate: ae(r.updatedAt),
29
+ _pickup: y ? c(r.pickupCatalog, !0) : "-",
30
30
  _canUsePickup: y,
31
31
  _posVersion: m || "-"
32
32
  };
@@ -35,26 +35,26 @@ function Ve(w, x, l) {
35
35
  const Fe = {
36
36
  key: 0,
37
37
  class: "flex items-center justify-center"
38
- }, Se = {
38
+ }, Ie = {
39
39
  key: 1,
40
40
  class: "space-y-16"
41
- }, Ie = { class: "text-fm-color-typo-secondary" }, $e = { class: "space-y-4" }, Ae = /* @__PURE__ */ j({
41
+ }, $e = { class: "text-fm-color-typo-secondary" }, Ae = { class: "space-y-4" }, Me = /* @__PURE__ */ K({
42
42
  __name: "RevertDialog",
43
43
  props: {
44
44
  restaurant: {}
45
45
  },
46
- setup(w) {
47
- const x = w, l = Z(), { custom: r } = X(l), i = $(!1), m = $(null);
46
+ setup(x) {
47
+ const V = x, l = ee(), { custom: c } = Z(l), r = I(!1), m = I(null);
48
48
  async function y() {
49
- await r(
49
+ await c(
50
50
  async () => {
51
51
  var d;
52
- m.value = await ce.readMenuById(((d = x.restaurant.revertConfig) == null ? void 0 : d._id) || "");
52
+ m.value = await de.readMenuById(((d = V.restaurant.revertConfig) == null ? void 0 : d._id) || "");
53
53
  },
54
- { isLoading: i }
54
+ { isLoading: r }
55
55
  );
56
56
  }
57
- const f = V(() => {
57
+ const f = S(() => {
58
58
  var d;
59
59
  return [
60
60
  { label: "Main", value: null },
@@ -63,25 +63,25 @@ const Fe = {
63
63
  value: _._id
64
64
  }))
65
65
  ];
66
- }), { t: p } = q(), t = V(() => {
66
+ }), { t: p } = Y(), t = S(() => {
67
67
  var k;
68
- const d = x.restaurant.revertConfig;
68
+ const d = V.restaurant.revertConfig;
69
69
  if (!d) return [];
70
- const _ = Ve(
70
+ const _ = Se(
71
71
  [
72
72
  {
73
73
  ...d,
74
74
  catalogId: d.catalogId || null
75
75
  }
76
76
  ],
77
- ve().restaurants.value,
77
+ be().restaurants.value,
78
78
  f.value
79
79
  )[0];
80
80
  return [
81
- { label: p("menu.revert.labels.restaurant"), value: x.restaurant.name },
81
+ { label: p("menu.revert.labels.restaurant"), value: V.restaurant.name },
82
82
  {
83
83
  label: p("menu.revert.labels.revert_to"),
84
- value: ee((k = m.value) == null ? void 0 : k.updatedAt)
84
+ value: ae((k = m.value) == null ? void 0 : k.updatedAt)
85
85
  },
86
86
  { label: p("menu.revert.labels.default"), value: _._default },
87
87
  { label: p("menu.revert.labels.pos_takeaway"), value: _._posTakeaway },
@@ -92,25 +92,25 @@ const Fe = {
92
92
  }
93
93
  ];
94
94
  });
95
- se(async () => y());
96
- const { emitData: R } = fe();
95
+ ne(async () => y());
96
+ const { emitData: U } = _e();
97
97
  return (d, _) => {
98
98
  const k = C("FmCircularProgress");
99
- return i.value ? (h(), D("div", Fe, [
100
- s(k, { size: "lg" })
101
- ])) : (h(), D("div", Se, [
102
- o("div", Ie, F(u(p)("menu.revert.description", { name: x.restaurant.name })), 1),
103
- o("div", $e, [
104
- (h(!0), D(B, null, Y(t.value, (S) => (h(), E(Ce, {
105
- key: S.label,
106
- name: S.label,
107
- value: S.value || "--"
99
+ return r.value ? (h(), R("div", Fe, [
100
+ n(k, { size: "lg" })
101
+ ])) : (h(), R("div", Ie, [
102
+ o("div", $e, F(i(p)("menu.revert.description", { name: V.restaurant.name })), 1),
103
+ o("div", Ae, [
104
+ (h(!0), R(E, null, j(t.value, ($) => (h(), O(ke, {
105
+ key: $.label,
106
+ name: $.label,
107
+ value: $.value || "--"
108
108
  }, null, 8, ["name", "value"]))), 128))
109
109
  ])
110
110
  ]));
111
111
  };
112
112
  }
113
- }), Me = { class: "fm-typo-en-title-md-600" }, De = { class: "mt-40" }, Re = { class: "fm-typo-en-title-sm-600" }, Ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Le = { class: "flex gap-8 items-center justify-start" }, Pe = /* @__PURE__ */ j({
113
+ }), De = { class: "fm-typo-en-title-md-600" }, Re = { class: "mt-40" }, Ue = { class: "fm-typo-en-title-sm-600" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Pe = { class: "flex gap-8 items-center justify-start" }, Be = /* @__PURE__ */ K({
114
114
  __name: "UpdateCatalogDialog",
115
115
  props: {
116
116
  catalogs: {
@@ -119,9 +119,9 @@ const Fe = {
119
119
  }
120
120
  },
121
121
  emits: ["onComplete"],
122
- setup(w, { expose: x, emit: l }) {
123
- const { t: r } = q(), i = w;
124
- x({
122
+ setup(x, { expose: V, emit: l }) {
123
+ const { t: c } = Y(), r = x;
124
+ V({
125
125
  show: _,
126
126
  hide: k
127
127
  });
@@ -135,97 +135,97 @@ const Fe = {
135
135
  additionalCatalogs: []
136
136
  };
137
137
  }
138
- const f = V(() => [
138
+ const f = S(() => [
139
139
  {
140
- label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
140
+ label: c("menu.publish.update_catalog_dialog.sections.default.use_default"),
141
141
  value: null
142
142
  },
143
- ...i.catalogs.map((g) => ({
143
+ ...r.catalogs.map((g) => ({
144
144
  label: g.name,
145
145
  value: g._id
146
146
  }))
147
- ]), p = V(() => [
147
+ ]), p = S(() => [
148
148
  {
149
- label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
149
+ label: c("menu.publish.update_catalog_dialog.sections.default.use_default"),
150
150
  value: null
151
151
  },
152
- ...i.catalogs.map((g) => ({
152
+ ...r.catalogs.map((g) => ({
153
153
  label: g.name,
154
154
  value: g._id
155
155
  }))
156
- ]), t = $(y()), R = $(!1), d = $(void 0);
156
+ ]), t = I(y()), U = I(!1), d = I(void 0);
157
157
  function _(g) {
158
- d.value = g ? W(g) : y(), t.value = W(d.value), R.value = !0;
158
+ d.value = g ? J(g) : y(), t.value = J(d.value), U.value = !0;
159
159
  }
160
160
  function k() {
161
- R.value = !1;
161
+ U.value = !1;
162
162
  }
163
- const S = we(
164
- () => !de.isEqual(d.value, t.value),
163
+ const $ = xe(
164
+ () => !me.isEqual(d.value, t.value),
165
165
  () => {
166
166
  k();
167
167
  }
168
168
  );
169
- function z() {
169
+ function T() {
170
170
  k(), m("onComplete", t.value);
171
171
  }
172
172
  return (g, v) => {
173
- const A = C("FmSelect"), N = C("FmCheckbox"), M = C("FmButton"), P = C("FmSideSheet");
174
- return h(), E(P, {
175
- modelValue: R.value,
176
- "onUpdate:modelValue": v[5] || (v[5] = (b) => R.value = b),
173
+ const A = C("FmSelect"), z = C("FmCheckbox"), M = C("FmButton"), B = C("FmSideSheet");
174
+ return h(), O(B, {
175
+ modelValue: U.value,
176
+ "onUpdate:modelValue": v[5] || (v[5] = (b) => U.value = b),
177
177
  "max-width": 560,
178
- "onOn:clickedAway": u(S)
178
+ "onOn:clickedAway": i($)
179
179
  }, {
180
- "side-sheet-header": U(() => [
181
- o("span", Me, F(u(r)("menu.publish.update_catalog_dialog.title")), 1)
180
+ "side-sheet-header": L(() => [
181
+ o("span", De, F(i(c)("menu.publish.update_catalog_dialog.title")), 1)
182
182
  ]),
183
- "side-sheet-footer": U(() => [
184
- o("div", Le, [
185
- s(M, {
186
- label: u(r)("menu.publish.update_catalog_dialog.actions.update"),
183
+ "side-sheet-footer": L(() => [
184
+ o("div", Pe, [
185
+ n(M, {
186
+ label: i(c)("menu.publish.update_catalog_dialog.actions.update"),
187
187
  size: "lg",
188
188
  variant: "primary",
189
- onClick: v[4] || (v[4] = () => z())
189
+ onClick: v[4] || (v[4] = () => T())
190
190
  }, null, 8, ["label"]),
191
- s(M, {
192
- label: u(r)("menu.publish.update_catalog_dialog.actions.cancel"),
191
+ n(M, {
192
+ label: i(c)("menu.publish.update_catalog_dialog.actions.cancel"),
193
193
  size: "lg",
194
194
  variant: "tertiary",
195
195
  onClick: k
196
196
  }, null, 8, ["label"])
197
197
  ])
198
198
  ]),
199
- default: U(() => [
200
- s(A, {
199
+ default: L(() => [
200
+ n(A, {
201
201
  modelValue: t.value.catalogId,
202
202
  "onUpdate:modelValue": v[0] || (v[0] = (b) => t.value.catalogId = b),
203
203
  items: f.value,
204
204
  class: "mb-24",
205
- label: u(r)("menu.publish.update_catalog_dialog.sections.default.label")
205
+ label: i(c)("menu.publish.update_catalog_dialog.sections.default.label")
206
206
  }, null, 8, ["modelValue", "items", "label"]),
207
- s(A, {
207
+ n(A, {
208
208
  modelValue: t.value.takeawayCatalog,
209
209
  "onUpdate:modelValue": v[1] || (v[1] = (b) => t.value.takeawayCatalog = b),
210
210
  items: p.value,
211
211
  class: "mb-24",
212
- label: u(r)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
212
+ label: i(c)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
213
213
  }, null, 8, ["modelValue", "items", "label"]),
214
- s(A, {
214
+ n(A, {
215
215
  modelValue: t.value.pickupCatalog,
216
216
  "onUpdate:modelValue": v[2] || (v[2] = (b) => t.value.pickupCatalog = b),
217
217
  items: p.value,
218
- label: u(r)("menu.publish.update_catalog_dialog.sections.pickup.label")
218
+ label: i(c)("menu.publish.update_catalog_dialog.sections.pickup.label")
219
219
  }, null, 8, ["modelValue", "items", "label"]),
220
- o("div", De, [
221
- o("div", Re, F(u(r)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
222
- o("div", Ue, F(u(r)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
223
- (h(!0), D(B, null, Y(w.catalogs, (b) => (h(), D("div", {
220
+ o("div", Re, [
221
+ o("div", Ue, F(i(c)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
222
+ o("div", Le, F(i(c)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
223
+ (h(!0), R(E, null, j(x.catalogs, (b) => (h(), R("div", {
224
224
  key: b._id
225
225
  }, [
226
- s(N, {
226
+ n(z, {
227
227
  modelValue: t.value.additionalCatalogs,
228
- "onUpdate:modelValue": v[3] || (v[3] = (I) => t.value.additionalCatalogs = I),
228
+ "onUpdate:modelValue": v[3] || (v[3] = (w) => t.value.additionalCatalogs = w),
229
229
  label: b.name,
230
230
  value: b._id
231
231
  }, null, 8, ["modelValue", "label", "value"])
@@ -236,19 +236,19 @@ const Fe = {
236
236
  }, 8, ["modelValue", "onOn:clickedAway"]);
237
237
  };
238
238
  }
239
- }), Be = {
239
+ }), Ee = {
240
240
  class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
241
- }, Ee = {
241
+ }, Oe = {
242
242
  class: "flex items-center xs:mb-8 mb-24"
243
- }, ze = {
243
+ }, Te = {
244
244
  class: "mr-8"
245
- }, Ne = {
245
+ }, ze = {
246
246
  class: "fm-typo-en-title-md-600"
247
- }, Oe = {
247
+ }, Ne = {
248
248
  class: "xs:hidden"
249
- }, Ke = {
249
+ }, He = {
250
250
  class: "pb-8 flex justify-between xs:flex-col gap-8"
251
- }, Te = {
251
+ }, Ke = {
252
252
  class: "grow flex flex-col gap-4"
253
253
  }, je = {
254
254
  class: "flex gap-8 items-center"
@@ -256,28 +256,28 @@ const Fe = {
256
256
  class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
257
257
  }, qe = {
258
258
  class: "space-y-4"
259
- }, He = {
260
- class: "fm-typo-en-body-lg-600"
261
259
  }, Ge = {
262
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
260
+ class: "fm-typo-en-body-lg-600"
263
261
  }, We = {
264
- class: "flex gap-8"
262
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
265
263
  }, Je = {
264
+ class: "flex gap-8"
265
+ }, Qe = {
266
266
  class: "xs:block hidden fixed bottom-72 right-16"
267
- }, ia = /* @__PURE__ */ j({
267
+ }, Xe = 40, ca = /* @__PURE__ */ K({
268
268
  __name: "Publish",
269
- setup(w) {
270
- const x = ue(), {
269
+ setup(x) {
270
+ const V = ie(), {
271
271
  t: l
272
- } = q(), r = (e) => t.state.menu.updatedAt === e.updatedAt, i = ({
272
+ } = Y(), c = (e) => t.state.menu.updatedAt === e.updatedAt, r = ({
273
273
  row: e
274
274
  }) => {
275
- const a = r(e);
276
- return s(he, {
275
+ const a = c(e);
276
+ return n(ye, {
277
277
  label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
278
278
  variant: a ? "success" : "warning"
279
279
  }, null);
280
- }, m = $({}), y = [{
280
+ }, m = I({}), y = [{
281
281
  accessorKey: "name",
282
282
  header: () => l("menu.publish.table.columns.restaurant"),
283
283
  cell: (e) => e.getValue(),
@@ -303,14 +303,14 @@ const Fe = {
303
303
  enableSorting: !1,
304
304
  cell: (e) => {
305
305
  const a = e.getValue();
306
- return S(a);
306
+ return $(a);
307
307
  }
308
308
  }, {
309
309
  accessorKey: "status",
310
310
  header: () => l("menu.common.labels.status"),
311
311
  enableSorting: !1,
312
312
  size: 80,
313
- cell: (e) => s(i, {
313
+ cell: (e) => n(r, {
314
314
  row: e.row.original
315
315
  }, null)
316
316
  }, {
@@ -320,32 +320,32 @@ const Fe = {
320
320
  enableSorting: !1,
321
321
  cell: (e) => {
322
322
  const a = e.row.original;
323
- return t.state.menu.updatedAt, a.updatedAt, T("div", {
323
+ return t.state.menu.updatedAt, a.updatedAt, H("div", {
324
324
  class: "flex justify-end gap-8"
325
- }, [d.value && a.revertConfig ? ke(T(J.FmButton, {
325
+ }, [d.value && a.revertConfig ? we(H(Q.FmButton, {
326
326
  prependIcon: "undo",
327
327
  variant: "secondary",
328
- onClick: K(async () => {
328
+ onClick: N(async () => {
329
329
  await _(e.row.original);
330
330
  }, ["stop", "prevent"])
331
- }), l("menu.publish.actions.revert")) : null, T(J.FmButton, {
331
+ }), l("menu.publish.actions.revert")) : null, H(Q.FmButton, {
332
332
  label: l("menu.publish.actions.publish"),
333
333
  icon: "ios_share",
334
334
  variant: "secondary",
335
- onClick: K(async () => {
336
- const c = A(e.row.original);
337
- await P(c);
335
+ onClick: N(async () => {
336
+ const s = A(e.row.original);
337
+ await B(s);
338
338
  }, ["stop", "prevent"])
339
339
  })]);
340
340
  },
341
341
  meta: {
342
342
  width: "150px"
343
343
  }
344
- }], f = $(""), p = $(), t = me(), R = _e(), d = V(() => t.version !== pe.F_MENU_VERSION.enum.v3);
344
+ }], f = I(""), p = I(), t = pe(), U = he(), d = S(() => t.version !== ge.F_MENU_VERSION.enum.v3);
345
345
  async function _(e) {
346
- e.revertConfig && R.open({
346
+ e.revertConfig && U.open({
347
347
  title: "Revert menu",
348
- contentComponent: Ae,
348
+ contentComponent: Me,
349
349
  contentComponentProps: {
350
350
  restaurant: e
351
351
  },
@@ -366,16 +366,16 @@ const Fe = {
366
366
  });
367
367
  });
368
368
  }
369
- const k = V(() => l("menu.publish.labels.main_version", {
370
- version: S(t.state.menu.updatedAt)
369
+ const k = S(() => l("menu.publish.labels.main_version", {
370
+ version: $(t.state.menu.updatedAt)
371
371
  }));
372
- function S(e) {
373
- return e ? Q(e).format("DD/MM/YYYY hh:mmA") : "";
372
+ function $(e) {
373
+ return e ? X(e).format("DD/MM/YYYY hh:mmA") : "";
374
374
  }
375
- const z = V(() => t.state.menu.modules.catalog), g = V(() => M.queue.value.some((e) => e.id === t.state.menu._id));
375
+ const T = S(() => t.state.menu.modules.catalog), g = S(() => M.queue.value.some((e) => e.id === t.state.menu._id));
376
376
  function v(e) {
377
377
  var a;
378
- return e ? ((a = z.value.find((c) => c._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
378
+ return e ? ((a = T.value.find((s) => s._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
379
379
  }
380
380
  function A(e) {
381
381
  return {
@@ -386,22 +386,22 @@ const Fe = {
386
386
  additionalCatalogs: e.additionalCatalogs
387
387
  };
388
388
  }
389
- function N(e) {
390
- var c;
389
+ function z(e) {
390
+ var s;
391
391
  const a = A(e);
392
- (c = p.value) == null || c.show(a);
392
+ (s = p.value) == null || s.show(a);
393
393
  }
394
- const M = X(Z());
395
- async function P(e) {
396
- var c;
397
- const a = (c = I.value.find((L) => L._id === e.restaurantId)) == null ? void 0 : c.name;
394
+ const M = Z(ee());
395
+ async function B(e) {
396
+ var s;
397
+ const a = (s = w.value.find((D) => D._id === e.restaurantId)) == null ? void 0 : s.name;
398
398
  await M.minor(async () => await t.publishMenu(e), {
399
399
  customId: t.state.menu._id,
400
400
  message: `Publishing menu for ${a}`,
401
401
  successMessage: `Published to ${a}`
402
402
  });
403
403
  }
404
- const b = $(null), I = V(() => t.state.restaurants.filter((e) => {
404
+ const b = I(null), w = S(() => t.state.restaurants.filter((e) => {
405
405
  var a;
406
406
  return !b.value || ((a = b.value) == null ? void 0 : a.includes(e._id));
407
407
  }).map((e) => ({
@@ -411,153 +411,157 @@ const Fe = {
411
411
  takeaway: v(e.takeawayCatalog),
412
412
  pickup: v(e.pickupCatalog)
413
413
  }
414
- }))), ae = V(() => {
414
+ }))), te = S(() => {
415
415
  const e = f.value.toLowerCase();
416
- return I.value.filter(({
416
+ return w.value.filter(({
417
417
  name: a,
418
- catalog: c
419
- }) => a.toLowerCase().includes(e) || c.default.toLowerCase().includes(e) || c.takeaway.toLowerCase().includes(e) || c.pickup.toLowerCase().includes(e));
418
+ catalog: s
419
+ }) => a.toLowerCase().includes(e) || s.default.toLowerCase().includes(e) || s.takeaway.toLowerCase().includes(e) || s.pickup.toLowerCase().includes(e));
420
420
  });
421
- async function H() {
421
+ async function q(e) {
422
+ const a = I("");
423
+ await M.minor(async () => {
424
+ await ve({
425
+ items: e,
426
+ processor: async (s) => {
427
+ const D = A(s);
428
+ return await t.publishMenu(D, !1);
429
+ },
430
+ batchSize: 5,
431
+ batchDelay: 50,
432
+ // 50ms delay to reduce server load
433
+ onProgress({
434
+ total: s,
435
+ batchStart: D,
436
+ batchEnd: P
437
+ }) {
438
+ a.value = `Publishing menu to restaurants ${D}-${P} of ${s}...`;
439
+ }
440
+ }), await t.readRestaurants(), await t.readMenu();
441
+ }, {
442
+ customId: t.state.menu._id,
443
+ message: a,
444
+ successMessage: `Published to ${e.length} restaurant${e.length > 1 ? "s" : ""}`
445
+ });
446
+ }
447
+ async function G() {
422
448
  if (g.value) return;
423
- const e = Object.keys(m.value).map(Number).filter((a) => m.value[a]);
424
- if (e.length === 0 || e.length === I.value.length)
425
- await M.minor(async () => await t.publishAllMenu(), {
426
- customId: t.state.menu._id
427
- });
428
- else {
429
- const a = e.map((c) => I.value[c]);
430
- await M.minor(async () => {
431
- await ge({
432
- items: a,
433
- processor: async (c) => {
434
- const L = A(c);
435
- return await t.publishMenu(L, !1);
436
- },
437
- batchSize: 5,
438
- batchDelay: 50,
439
- // 50ms delay to reduce server load
440
- progressMessage: void 0
441
- // Don't show progress message as we already have loading state
442
- }), await t.readRestaurants(), await t.readMenu();
443
- }, {
444
- customId: t.state.menu._id,
445
- message: `Publishing menu to ${a.length} restaurant${a.length > 1 ? "s" : ""}`,
446
- successMessage: `Published to ${a.length} restaurant${a.length > 1 ? "s" : ""}`
447
- });
448
- }
449
+ const e = Object.keys(m.value).map(Number).filter((s) => m.value[s]), a = e.length === 0 || e.length === w.value.length ? w.value : e.map((s) => w.value[s]);
450
+ a.length > Xe ? await q(a) : e.length === 0 || e.length === w.value.length ? await M.minor(async () => await t.publishAllMenu(), {
451
+ customId: t.state.menu._id
452
+ }) : await q(a);
449
453
  }
450
454
  return (e, a) => {
451
- const c = C("FmChip"), L = C("FmSpacer"), O = C("FmButton"), G = C("FmSearch"), te = C("FmTable"), le = C("FmListItem"), oe = C("FmList");
452
- return h(), D(B, null, [o("div", Be, [o("div", Ee, [o("div", ze, [o("div", Ne, F(u(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
455
+ const s = C("FmChip"), D = C("FmSpacer"), P = C("FmButton"), W = C("FmSearch"), le = C("FmTable"), oe = C("FmListItem"), se = C("FmList");
456
+ return h(), R(E, null, [o("div", Ee, [o("div", Oe, [o("div", Te, [o("div", ze, F(i(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
453
457
  class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
454
- }, null, -1))]), s(c, {
458
+ }, null, -1))]), n(s, {
455
459
  label: k.value,
456
460
  class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
457
- }, null, 8, ["label"]), s(L), o("div", Oe, [s(O, {
461
+ }, null, 8, ["label"]), n(D), o("div", Ne, [n(P, {
458
462
  disabled: g.value,
459
463
  icon: "ios_share",
460
- label: u(l)("menu.publish.actions.publish_all"),
464
+ label: i(l)("menu.publish.actions.publish_all"),
461
465
  variant: "primary",
462
- onClick: a[0] || (a[0] = () => H())
463
- }, null, 8, ["disabled", "label"])])]), o("div", Ke, [s(u(be), {
466
+ onClick: a[0] || (a[0] = () => G())
467
+ }, null, 8, ["disabled", "label"])])]), o("div", He, [n(i(fe), {
464
468
  multiple: "",
465
469
  modelValue: b.value,
466
- "onUpdate:modelValue": a[2] || (a[2] = (n) => b.value = n)
470
+ "onUpdate:modelValue": a[2] || (a[2] = (u) => b.value = u)
467
471
  }, {
468
- "append-right": U(() => [s(L, {
472
+ "append-right": L(() => [n(D, {
469
473
  class: "xs:hidden"
470
- }), s(G, {
474
+ }), n(W, {
471
475
  modelValue: f.value,
472
- "onUpdate:modelValue": a[1] || (a[1] = (n) => f.value = n),
476
+ "onUpdate:modelValue": a[1] || (a[1] = (u) => f.value = u),
473
477
  autofocus: "",
474
478
  class: "w-[320px] xs:hidden",
475
- placeholder: u(l)("menu.publish.table.search.placeholder")
479
+ placeholder: i(l)("menu.publish.table.search.placeholder")
476
480
  }, null, 8, ["modelValue", "placeholder"])]),
477
481
  _: 1
478
- }, 8, ["modelValue"]), s(G, {
482
+ }, 8, ["modelValue"]), n(W, {
479
483
  modelValue: f.value,
480
- "onUpdate:modelValue": a[3] || (a[3] = (n) => f.value = n),
484
+ "onUpdate:modelValue": a[3] || (a[3] = (u) => f.value = u),
481
485
  autofocus: "",
482
486
  class: "w-full xs:block hidden",
483
- placeholder: u(l)("menu.publish.table.search.placeholder")
484
- }, null, 8, ["modelValue", "placeholder"])]), I.value.length > 0 ? (h(), D(B, {
487
+ placeholder: i(l)("menu.publish.table.search.placeholder")
488
+ }, null, 8, ["modelValue", "placeholder"])]), w.value.length > 0 ? (h(), R(E, {
485
489
  key: 0
486
- }, [s(ye, {
490
+ }, [n(Ce, {
487
491
  class: "xs:hidden block"
488
492
  }, {
489
- default: U(() => [s(te, {
493
+ default: L(() => [n(le, {
490
494
  modelValue: m.value,
491
- "onUpdate:modelValue": a[4] || (a[4] = (n) => m.value = n),
495
+ "onUpdate:modelValue": a[4] || (a[4] = (u) => m.value = u),
492
496
  "column-defs": y,
493
497
  loading: g.value,
494
- "page-size": I.value.length,
495
- "row-data": I.value,
498
+ "page-size": w.value.length,
499
+ "row-data": w.value,
496
500
  "search-value": f.value,
497
501
  shrinkAt: !1,
498
502
  selection: "multiple",
499
503
  "hide-footer": "",
500
504
  "pin-header-row": "",
501
- onRowClick: a[5] || (a[5] = (n) => N(n.original))
505
+ onRowClick: a[5] || (a[5] = (u) => z(u.original))
502
506
  }, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
503
507
  _: 1
504
- }), s(oe, {
508
+ }), n(se, {
505
509
  class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
506
510
  separator: ""
507
511
  }, {
508
- default: U(() => [(h(!0), D(B, null, Y(ae.value, (n) => (h(), E(le, {
509
- key: n._id,
510
- label: n.name,
512
+ default: L(() => [(h(!0), R(E, null, j(te.value, (u) => (h(), O(oe, {
513
+ key: u._id,
514
+ label: u.name,
511
515
  style: {
512
516
  padding: "12px 0 !important"
513
517
  },
514
- onClick: () => N(n)
518
+ onClick: () => z(u)
515
519
  }, {
516
- default: U(() => [o("div", Te, [o("div", je, [o("div", Ye, F(S(n.updatedAt)), 1), s(i, {
517
- row: n
518
- }, null, 8, ["row"])]), o("div", qe, [o("div", He, F(n.name), 1), o("div", Ge, [o("div", null, "Default: " + F(n.catalog.default), 1), o("div", null, "POS takeaway: " + F(n.catalog.takeaway), 1), o("div", null, "Pickup: " + F(n.catalog.pickup), 1)])])]), o("div", We, [d.value && n.revertConfig ? (h(), E(O, {
520
+ default: L(() => [o("div", Ke, [o("div", je, [o("div", Ye, F($(u.updatedAt)), 1), n(r, {
521
+ row: u
522
+ }, null, 8, ["row"])]), o("div", qe, [o("div", Ge, F(u.name), 1), o("div", We, [o("div", null, "Default: " + F(u.catalog.default), 1), o("div", null, "POS takeaway: " + F(u.catalog.takeaway), 1), o("div", null, "Pickup: " + F(u.catalog.pickup), 1)])])]), o("div", Je, [d.value && u.revertConfig ? (h(), O(P, {
519
523
  key: 0,
520
524
  disabled: g.value,
521
525
  icon: "undo",
522
526
  variant: "tertiary",
523
- onClick: K(() => _(n), ["stop"])
524
- }, null, 8, ["disabled", "onClick"])) : ne("", !0), s(O, {
527
+ onClick: N(() => _(u), ["stop"])
528
+ }, null, 8, ["disabled", "onClick"])) : ue("", !0), n(P, {
525
529
  disabled: g.value,
526
530
  icon: "ios_share",
527
531
  variant: "tertiary",
528
- onClick: K(() => P(A(n)), ["stop"])
532
+ onClick: N(() => B(A(u)), ["stop"])
529
533
  }, null, 8, ["disabled", "onClick"])])]),
530
534
  _: 2
531
535
  }, 1032, ["label", "onClick"]))), 128))]),
532
536
  _: 1
533
- })], 64)) : (h(), E(u(xe), {
537
+ })], 64)) : (h(), O(i(Ve), {
534
538
  key: 1,
535
- title: u(l)("menu.publish.empty.title"),
536
- subtitle: u(l)("menu.publish.empty.subtitle"),
539
+ title: i(l)("menu.publish.empty.title"),
540
+ subtitle: i(l)("menu.publish.empty.subtitle"),
537
541
  action: {
538
- text: u(l)("menu.publish.empty.action"),
542
+ text: i(l)("menu.publish.empty.action"),
539
543
  icon: "add",
540
544
  callback: () => {
541
- u(x).push({
545
+ i(V).push({
542
546
  name: "$settings-my-business"
543
547
  });
544
548
  }
545
549
  }
546
- }, null, 8, ["title", "subtitle", "action"]))]), o("div", Je, [s(O, {
550
+ }, null, 8, ["title", "subtitle", "action"]))]), o("div", Qe, [n(P, {
547
551
  disabled: g.value,
548
552
  icon: "ios_share",
549
- label: u(l)("menu.publish.actions.publish_all"),
553
+ label: i(l)("menu.publish.actions.publish_all"),
550
554
  variant: "fab",
551
- onClick: a[6] || (a[6] = () => H())
552
- }, null, 8, ["disabled", "label"])]), s(Pe, {
555
+ onClick: a[6] || (a[6] = () => G())
556
+ }, null, 8, ["disabled", "label"])]), n(Be, {
553
557
  ref_key: "updateCatalogDialogRef",
554
558
  ref: p,
555
- catalogs: z.value,
556
- onOnComplete: P
559
+ catalogs: T.value,
560
+ onOnComplete: B
557
561
  }, null, 8, ["catalogs"])], 64);
558
562
  };
559
563
  }
560
564
  });
561
565
  export {
562
- ia as default
566
+ ca as default
563
567
  };