@feedmepos/mf-menu 0.32.83-dev.1 → 0.32.83-dev.2

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 (79) hide show
  1. package/dist/{App-BYdCC3TK.js → App-CJtpyTsA.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CsMCfu1s.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C01hHwqy.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CWH86f_J.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-4xmgAa5D.js} +3 -3
  4. package/dist/{Catalog-BPRRb4QE.js → Catalog-CTUtAc6s.js} +6 -6
  5. package/dist/{CatalogBinding-B2vhvUHz.js → CatalogBinding-DQf2xYH8.js} +13 -13
  6. package/dist/{Category-zKR2QaeE.js → Category-DP6UnoXf.js} +4 -4
  7. package/dist/{Category-DeeXKn4P.js → Category-Q9BCIS4J.js} +4 -4
  8. package/dist/{CookingGuide-Wm39wm7Q.js → CookingGuide-GbojUPLO.js} +5 -5
  9. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CAHNxiEJ.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CBRNh-O-.js} +1 -1
  10. package/dist/{Group-BNcZYOU4.js → Group-CJqQLteU.js} +3 -3
  11. package/dist/{Group-E2HYqd9f.js → Group-Dsc8PGdX.js} +1 -1
  12. package/dist/{Group.vue_vue_type_script_setup_true_lang-DPk_cgPi.js → Group.vue_vue_type_script_setup_true_lang-FWqqHQ20.js} +7 -7
  13. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B0X5brpK.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BcQa7V0d.js} +5 -5
  14. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DxowkX0c.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Cb9tTsPG.js} +7 -7
  15. package/dist/{Ingredient-DcJrO6OE.js → Ingredient-DWEB328H.js} +4 -4
  16. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DfrJBP75.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Dab9-l-S.js} +2 -2
  17. package/dist/{LinkProductSideSheet-DTzuEcF5.js → LinkProductSideSheet-BluWowSV.js} +4 -4
  18. package/dist/{MenuSetting-DICpAfNK.js → MenuSetting-C_ZsIERs.js} +7 -7
  19. package/dist/{OrderPacing-pD1pgJG5.js → OrderPacing-BZhIFo4P.js} +5 -5
  20. package/dist/{PrintRoute-BAY_gpJS.js → PrintRoute-C5ZJs7tz.js} +5 -5
  21. package/dist/{Product-B_YsLenC.js → Product-rESWzhq6.js} +1 -1
  22. package/dist/{Product.vue_vue_type_script_setup_true_lang-DEsNttgJ.js → Product.vue_vue_type_script_setup_true_lang-C-zJ0P53.js} +14 -14
  23. package/dist/{ProductInternalTools-CfA-6XtS.js → ProductInternalTools-tkLzH5hJ.js} +6 -6
  24. package/dist/{Products-arAA8I2u.js → Products-DxpE9Hhz.js} +49 -49
  25. package/dist/Publish-3z09Tj11.js +1608 -0
  26. package/dist/{Recipe-DRcrzXhA.js → Recipe-Dqtj2Ye9.js} +5 -5
  27. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CAVrU6RI.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CST9Gy_R.js} +1 -1
  28. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DYnnO3SQ.js → RuleView.vue_vue_type_script_setup_true_lang-_MGk1b10.js} +211 -211
  29. package/dist/{Scheduler-oxLqE74K.js → Scheduler-BgkBxTeC.js} +3 -3
  30. package/dist/{ServingSequence-DVkB7hDy.js → ServingSequence-D92cps_j.js} +3 -3
  31. package/dist/{Setting-DOsTp22X.js → Setting-JUioq6ZT.js} +5 -5
  32. package/dist/{Subcategory-BaclYZ5p.js → Subcategory-vjc6gzqd.js} +6 -6
  33. package/dist/{Takeaway-D2jvmsuu.js → Takeaway-BXMBCjFg.js} +1 -1
  34. package/dist/Takeaway-DSOy02ma.js +64 -0
  35. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-539rI3Ek.js +331 -0
  36. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-M3Oh6Dr6.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-C37PZJuF.js} +1 -1
  37. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-DjswjUjQ.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-BjsExR0h.js} +2 -2
  38. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dcd1ek03.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dy-eMWb4.js} +602 -601
  39. package/dist/{Unit-Dx8HMvAE.js → Unit-_Eoj6ONR.js} +2 -2
  40. package/dist/{Variant-Dx6EWp55.js → Variant-D1iCI3U5.js} +3 -3
  41. package/dist/{_id_-DIsWlajV.js → _id_-BUrZucNq.js} +10 -10
  42. package/dist/{app-curMXZbh.js → app-B8GiVUrR.js} +1 -1
  43. package/dist/{app-BdtPzkjA.js → app-BJA5-4eB.js} +392 -392
  44. package/dist/app.js +1 -1
  45. package/dist/apps/mf-menu/src/app.d.ts +25 -0
  46. package/dist/apps/mf-menu/src/components/feature/TakeAwayManager/Form.vue.d.ts +3 -3
  47. package/dist/apps/mf-menu/src/helper/takeawayOverride.d.ts +12 -0
  48. package/dist/apps/mf-menu/src/manager/menu/takeaway.d.ts +14 -0
  49. package/dist/apps/mf-menu/src/views/Publish/publishError.d.ts +20 -0
  50. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/assets/{linked-status-DsxqMxwe.js → linked-status-Bqmqi1JL.js} +2 -2
  52. package/dist/assets/{menu-export-DcW52Lu3.js → menu-export-CfrN-LuH.js} +2 -2
  53. package/dist/assets/{override-menu-DPPsvKsd.js → override-menu-Cy7YaK_1.js} +2 -2
  54. package/dist/assets/{validate-menu-Byl7hJI2.js → validate-menu-BPtUlI3H.js} +2 -2
  55. package/dist/{catalog-D4uhTN3P.js → catalog-B3YnChlG.js} +1 -1
  56. package/dist/{catalogSetting-_zy50XFm.js → catalogSetting-BeiJ3_Fx.js} +1 -1
  57. package/dist/{currency-8AD3AdtT.js → currency-BKZrZwjw.js} +1 -1
  58. package/dist/{dayjs.min-CSadJcjJ.js → dayjs.min-WGRuZAMu.js} +2 -2
  59. package/dist/{discardConfirm-egY5vwUU.js → discardConfirm-CuLDiWC_.js} +1 -1
  60. package/dist/{index-BPGZgTH-.js → index-BYh87zkc.js} +5 -5
  61. package/dist/{index-B0hyUFIc.js → index-C36SngVC.js} +1 -1
  62. package/dist/{index-BpoYrrVu.js → index-CUzEne2b.js} +137 -131
  63. package/dist/{index.vue_vue_type_script_setup_true_lang-qUahjdoy.js → index.vue_vue_type_script_setup_true_lang-BJZykcBx.js} +10600 -10590
  64. package/dist/{item-CGqK7sn4.js → item-BQYLe0DU.js} +1289 -1288
  65. package/dist/{jszip.min-Qb_fhEy6.js → jszip.min-kAXqpQrc.js} +384 -384
  66. package/dist/{linkProducts-DwBnfj3L.js → linkProducts-B3BYn9Cw.js} +4 -4
  67. package/dist/{memberPricing-CcXhcbV9.js → memberPricing-DzPTdmS5.js} +1 -1
  68. package/dist/{menu-Cmz90lOu.js → menu-DUOE-Q12.js} +1 -1
  69. package/dist/{menuV2-yXOZpuda.js → menuV2-BO3LtBSw.js} +48 -48
  70. package/dist/{order_pacing-Bp1Hpcp2.js → order_pacing-DqVag6W3.js} +5 -5
  71. package/dist/{priceTier-B14Zw5XH.js → priceTier-BFauU3rd.js} +1 -1
  72. package/dist/{rules-COZi7aRn.js → rules-B596A4CJ.js} +3 -3
  73. package/dist/{scheduler-eoUNmYqB.js → scheduler-KT6kOtgK.js} +5 -5
  74. package/dist/{toExcel-BkhEG-vD.js → toExcel-CgXzLIId.js} +2 -2
  75. package/dist/{unit-Bmje7das.js → unit-BJeua1T7.js} +3 -3
  76. package/package.json +2 -2
  77. package/dist/Publish-BORONVKG.js +0 -1582
  78. package/dist/Takeaway-BbcmF6t2.js +0 -64
  79. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BpswLmDw.js +0 -324
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as G, computed as y, h as f, withModifiers as O, ref as q, resolveComponent as h, createBlock as b, openBlock as c, unref as i, withCtx as _, createElementBlock as F, createVNode as p, Fragment as B, createElementVNode as s, renderList as J, toDisplayString as k, createCommentVNode as P } from "vue";
2
- import { B as d, C as X, j as Z, u as ee, b as te, _ as ne } from "./index.vue_vue_type_script_setup_true_lang-qUahjdoy.js";
2
+ import { B as d, C as X, j as Z, u as ee, b as te, _ as ne } from "./index.vue_vue_type_script_setup_true_lang-BJZykcBx.js";
3
3
  import { useI18n as ae, useAppLocale as oe, formatTimeOfDay as A } from "@feedmepos/mf-common";
4
4
  import { components as le, useDialog as se, useSnackbar as re } from "@feedmepos/ui-library";
5
5
  import { _ as ue } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
6
- import { _ as ce } from "./app-BdtPzkjA.js";
7
- import { d as ie, _ as de, u as me, c as fe } from "./scheduler-eoUNmYqB.js";
6
+ import { _ as ce } from "./app-BJA5-4eB.js";
7
+ import { d as ie, _ as de, u as me, c as fe } from "./scheduler-KT6kOtgK.js";
8
8
  import { _ as pe } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
9
9
  const ye = {
10
10
  class: "flex flex-1 justify-end"
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as J, ref as F, computed as E, resolveComponent as y, createElementBlock as h, openBlock as m, Fragment as x, renderSlot as ae, createVNode as l, unref as t, withCtx as f, createElementVNode as b, toDisplayString as U, onBeforeMount as oe, watch as D, watchEffect as se, h as T, getCurrentInstance as le, onMounted as re, createBlock as Y, createCommentVNode as G, isRef as ie, normalizeClass as Q, renderList as ue } from "vue";
2
2
  import { useRouter as ce } from "vue-router";
3
- import { f as H, u as W, b as X, j as Z, h as I, i as M, _ as de, F as me } from "./index.vue_vue_type_script_setup_true_lang-qUahjdoy.js";
3
+ import { f as H, u as W, b as X, j as Z, h as I, i as M, _ as de, F as me } from "./index.vue_vue_type_script_setup_true_lang-BJZykcBx.js";
4
4
  import { useI18n as ee, ItemSelector as pe, useCoreStore as fe } from "@feedmepos/mf-common";
5
5
  import { useSnackbar as ne, components as K, useDialog as _e, FmButtonVariant as z, useBreakpoints as ve } from "@feedmepos/ui-library";
6
6
  import { _ as ge } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
7
- import { _ as he, R as ye } from "./app-BdtPzkjA.js";
7
+ import { _ as he, R as ye } from "./app-BJA5-4eB.js";
8
8
  import { c as be } from "./check-C9mY6LiX.js";
9
9
  import { _ as ke } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
10
10
  import { u as xe } from "./search-BAPEUu1R.js";
11
- import { u as Se } from "./app-curMXZbh.js";
11
+ import { u as Se } from "./app-B8GiVUrR.js";
12
12
  import { c as Ce } from "./createComponentProgrammatically-Bt2rn1IQ.js";
13
13
  const qe = { class: "fm-typo-en-title-md-600" }, we = { class: "space-y-32 flex flex-col h-full" }, Ve = { class: "flex gap-8 items-center justify-start" }, Fe = /* @__PURE__ */ J({
14
14
  __name: "Form",
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as ie, computed as g, ref as re, watch as me, watchEffect as ce, resolveComponent as d, createElementBlock as O, openBlock as r, normalizeClass as z, createVNode as s, withCtx as c, createElementVNode as f, createBlock as p, createCommentVNode as y, unref as e, Fragment as A, renderList as I, createTextVNode as de, toDisplayString as L } from "vue";
2
- import { u as pe, b as ve, F as ge, j as fe, a as be, d as _e, l as k, f as E } from "./index.vue_vue_type_script_setup_true_lang-qUahjdoy.js";
2
+ import { u as pe, b as ve, F as ge, j as fe, a as be, d as _e, l as k, f as E } from "./index.vue_vue_type_script_setup_true_lang-BJZykcBx.js";
3
3
  import { useCoreStore as ye, useI18n as Ce } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as ke, useDialog as xe, FmButtonVariant as R, FmButtonColorThemeVariant as W, components as Se } from "@feedmepos/ui-library";
5
5
  import { _ as M } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
6
- import { _ as he } from "./RuleView.vue_vue_type_script_setup_true_lang-DYnnO3SQ.js";
7
- import { _ as j, a as Oe } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B0X5brpK.js";
8
- import { C, a as x } from "./catalogSetting-_zy50XFm.js";
9
- import { C as Ve } from "./catalog-D4uhTN3P.js";
6
+ import { _ as he } from "./RuleView.vue_vue_type_script_setup_true_lang-_MGk1b10.js";
7
+ import { _ as j, a as Oe } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BcQa7V0d.js";
8
+ import { C, a as x } from "./catalogSetting-BeiJ3_Fx.js";
9
+ import { C as Ve } from "./catalog-B3YnChlG.js";
10
10
  const we = {
11
11
  class: /* @__PURE__ */ z(["overflow-scroll", "flex-1", "xs:px-16 xs:py-16", "pt-16"])
12
12
  }, Me = {
@@ -2,18 +2,18 @@ import { defineComponent as z, ref as x, computed as V, watch as te, resolveComp
2
2
  import { useI18n as A } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as R, components as W, useDialog as X, FmButtonVariant as q, useBreakpoints as se, FmButtonColorThemeVariant as ie } from "@feedmepos/ui-library";
4
4
  import { _ as re } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
- import { b as P, j as Y, u as J, h as Z, i as ee, _ as ce } from "./index.vue_vue_type_script_setup_true_lang-qUahjdoy.js";
5
+ import { b as P, j as Y, u as J, h as Z, i as ee, _ as ce } from "./index.vue_vue_type_script_setup_true_lang-BJZykcBx.js";
6
6
  import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
7
- import { _ as me } from "./app-BdtPzkjA.js";
7
+ import { _ as me } from "./app-BJA5-4eB.js";
8
8
  import { c as de } from "./createForm-BoUQeZTd.js";
9
- import { u as pe } from "./discardConfirm-egY5vwUU.js";
9
+ import { u as pe } from "./discardConfirm-CuLDiWC_.js";
10
10
  import { c as G } from "./object-DVUNCr7w.js";
11
- import { r as _e, u as ae } from "./rules-COZi7aRn.js";
12
- import { _ as fe } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-DjswjUjQ.js";
11
+ import { r as _e, u as ae } from "./rules-B596A4CJ.js";
12
+ import { _ as fe } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-BjsExR0h.js";
13
13
  import { c as ve } from "./check-C9mY6LiX.js";
14
14
  import { g as H } from "./translation-fNx6yEpy.js";
15
15
  import { _ as ge } from "./TranslationViewChip.vue_vue_type_script_setup_true_lang-DiK3fi9J.js";
16
- import { a as ye } from "./menu-Cmz90lOu.js";
16
+ import { a as ye } from "./menu-DUOE-Q12.js";
17
17
  const be = {
18
18
  class: "fm-typo-en-title-md-600"
19
19
  }, he = {
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-BpswLmDw.js";
1
+ import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-539rI3Ek.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1,64 @@
1
+ import { defineComponent as f, computed as y, ref as k, createBlock as i, openBlock as d, unref as e, withCtx as s, createElementVNode as t, toDisplayString as b, createCommentVNode as g, createVNode as m } from "vue";
2
+ import { b as w, u as v, j as x, h, i as E } from "./index.vue_vue_type_script_setup_true_lang-BJZykcBx.js";
3
+ import { useI18n as M } from "@feedmepos/mf-common";
4
+ import { useSnackbar as T } from "@feedmepos/ui-library";
5
+ import { _ as V } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
6
+ import { _ as C } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
7
+ import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-539rI3Ek.js";
8
+ import { T as S, l as L, w as O } from "./index-CUzEne2b.js";
9
+ import { a as U } from "./menu-DUOE-Q12.js";
10
+ const B = { class: "flex-1 flex justify-between gap-8 pl-8" }, F = { class: "flex items-center" }, P = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, R = { class: "fm-typo-en-body-md-600 font-semibold" }, J = /* @__PURE__ */ f({
11
+ __name: "Takeaway",
12
+ setup(j) {
13
+ const u = T(), l = w(u), c = v(), p = x(l), _ = y(() => c.rules.item.bindToVariant), n = k(0), { t: r } = M();
14
+ return U().resetOnMount(), (D, o) => (d(), i(C, {
15
+ heading: e(r)("menu.takeaway.title")
16
+ }, {
17
+ default: s(() => [
18
+ m(N, {
19
+ "onUpdate:count": o[0] || (o[0] = (a) => n.value = a)
20
+ })
21
+ ]),
22
+ "append-heading": s(() => [
23
+ t("div", B, [
24
+ t("div", F, [
25
+ t("div", P, [
26
+ t("p", R, b(n.value), 1)
27
+ ])
28
+ ]),
29
+ t("div", null, [
30
+ n.value > 0 ? (d(), i(e(S), {
31
+ key: 0,
32
+ "bind-to-variant": _.value,
33
+ action: "add",
34
+ "apply-product": "",
35
+ "onUpdate:takeaway": o[1] || (o[1] = (a) => e(p).updateMenu(
36
+ {
37
+ module: e(E).enum.takeaway,
38
+ operation: e(h.F_OPERATION_TYPE).create,
39
+ data: e(O)(a),
40
+ link: e(L)(a.usedBy || [])
41
+ },
42
+ a.name
43
+ ))
44
+ }, {
45
+ default: s(({ trigger: a }) => [
46
+ m(V, {
47
+ label: e(r)("menu.takeaway.actions.add"),
48
+ "prepend-icon": "add",
49
+ type: "button",
50
+ onClick: a
51
+ }, null, 8, ["label", "onClick"])
52
+ ]),
53
+ _: 1
54
+ }, 8, ["bind-to-variant"])) : g("", !0)
55
+ ])
56
+ ])
57
+ ]),
58
+ _: 1
59
+ }, 8, ["heading"]));
60
+ }
61
+ });
62
+ export {
63
+ J as default
64
+ };
@@ -0,0 +1,331 @@
1
+ import { getCurrentInstance as ne, defineComponent as oe, computed as x, watch as ie, h as S, resolveComponent as E, createElementBlock as V, openBlock as g, Fragment as L, normalizeClass as R, createElementVNode as b, createVNode as I, unref as n, isRef as j, withCtx as O, renderList as se, createBlock as $, createCommentVNode as q, toDisplayString as P, withModifiers as G } from "vue";
2
+ import { f as D, b as J, j as Q, u as W, h as F, i as A, a as re, as as H, _ as le } from "./index.vue_vue_type_script_setup_true_lang-BJZykcBx.js";
3
+ import { useI18n as X, useCoreStore as ce } from "@feedmepos/mf-common";
4
+ import { useDialog as de, useSnackbar as Z, FmButtonVariant as N, components as ue, useBreakpoints as me } from "@feedmepos/ui-library";
5
+ import { _ as ye } from "./app-BJA5-4eB.js";
6
+ import { a as pe, w as ee, l as ae, T as fe } from "./index-CUzEne2b.js";
7
+ import { _ as _e } from "./TranslationViewChip.vue_vue_type_script_setup_true_lang-DiK3fi9J.js";
8
+ import { u as ke } from "./search-BAPEUu1R.js";
9
+ import { f as z } from "./currency-BKZrZwjw.js";
10
+ import { defineStore as ve } from "pinia";
11
+ import { C as we } from "./catalog-B3YnChlG.js";
12
+ import { c as ge } from "./createComponentProgrammatically-Bt2rn1IQ.js";
13
+ function be(v, y, l) {
14
+ const c = D(v);
15
+ return l == null ? delete c.override.takeaway[y] : c.override.takeaway[y] = { price: l }, c;
16
+ }
17
+ function he(v, y, l, c) {
18
+ var p, f, k;
19
+ if (c >= 0) {
20
+ const u = (p = v.override.items[y._id][c]) == null ? void 0 : p.takeawayUsed;
21
+ return u == null ? void 0 : D(u);
22
+ }
23
+ const e = l.find((u) => u._id === y._id);
24
+ return y.combinationKey ? ((k = (f = e == null ? void 0 : e.variant) == null ? void 0 : f.variantCombinations.find((u) => u.combinationKey === y.combinationKey)) == null ? void 0 : k.takeawayUsed) ?? (e == null ? void 0 : e.takeawayUsed) : e == null ? void 0 : e.takeawayUsed;
25
+ }
26
+ function xe(v, y, l, c) {
27
+ var k, u;
28
+ const e = D(v), p = [...l.usedBy, ...y.usedBy];
29
+ for (const o of p) {
30
+ const d = l.usedBy.some(
31
+ (t) => t._id === o._id && t.combinationKey === o.combinationKey
32
+ ) ? l._id : "", a = (e.override.items[o._id] || []).findIndex(
33
+ (t) => t.combinationKey === o.combinationKey
34
+ ), m = he(e, o, c, a);
35
+ if (a >= 0)
36
+ e.override.items[o._id][a].takeawayUsed = d;
37
+ else if (m !== d) {
38
+ const t = {
39
+ _id: o._id,
40
+ combinationKey: o.combinationKey,
41
+ takeawayUsed: d
42
+ };
43
+ e.override.items[o._id] = [...e.override.items[o._id] || [], t];
44
+ }
45
+ }
46
+ const f = [...new Set(p.map((o) => o._id))];
47
+ for (const o of f) {
48
+ const w = c.find((m) => m._id === o);
49
+ if (!((u = (k = w == null ? void 0 : w.variant) == null ? void 0 : k.variantCombinations) != null && u.length)) continue;
50
+ const d = (e.override.items[o] || []).findIndex(
51
+ (m) => !m.combinationKey
52
+ );
53
+ if (d < 0) continue;
54
+ l.usedBy.some((m) => m._id === o) || (e.override.items[o][d].takeawayUsed = "");
55
+ }
56
+ return e;
57
+ }
58
+ const Ce = ve("takeaway-manager", () => {
59
+ const v = de(), y = Z(), l = J(y), c = Q(l), e = W(), p = ne(), { t: f } = X(), k = (a) => {
60
+ var t, h;
61
+ const { vNode: m } = ge(
62
+ pe,
63
+ p,
64
+ a
65
+ );
66
+ (h = (t = m.component) == null ? void 0 : t.exposed) == null || h.trigger();
67
+ };
68
+ async function u(a) {
69
+ var h, U;
70
+ const t = ((U = (h = e.currentCatalog) == null ? void 0 : h.override.takeaway[a._id]) == null ? void 0 : U.price) ? null : e.state.menu.modules.takeaway.find((C) => C._id === a._id);
71
+ k({
72
+ initialValue: a,
73
+ applyProduct: !0,
74
+ bindToVariant: e.rules.item.bindToVariant,
75
+ fallback: t,
76
+ action: "update",
77
+ "onUpdate:takeaway": async (C) => {
78
+ let i = be(
79
+ e.currentCatalog,
80
+ a._id,
81
+ C.price
82
+ );
83
+ i = xe(i, a, C, e.state.menu.modules.item), await new we(i, e, c.updateMenu, v).update();
84
+ }
85
+ });
86
+ }
87
+ async function o(a) {
88
+ k({
89
+ initialValue: a,
90
+ bindToVariant: e.rules.item.bindToVariant,
91
+ applyProduct: !0,
92
+ action: "update",
93
+ "onUpdate:takeaway": async (m) => {
94
+ const t = ee(m);
95
+ await c.updateMenu(
96
+ {
97
+ module: A.enum.takeaway,
98
+ operation: F.F_OPERATION_TYPE.update,
99
+ data: t,
100
+ link: ae(t.usedBy || [])
101
+ },
102
+ t.name
103
+ );
104
+ }
105
+ });
106
+ }
107
+ async function w(a) {
108
+ e.currentCatalog ? await u(a) : await o(a);
109
+ }
110
+ async function d(a) {
111
+ v.open({
112
+ title: f("menu.common.dialog.remove.takeaway.title"),
113
+ message: f("menu.common.dialog.remove.takeaway.message", { name: a.name }),
114
+ primaryActions: {
115
+ text: f("menu.common.actions.remove"),
116
+ close: !0,
117
+ variant: N.Destructive
118
+ },
119
+ secondaryActions: {
120
+ text: f("menu.common.actions.cancel"),
121
+ close: !0
122
+ }
123
+ }).onPrimary(async () => {
124
+ await c.updateMenu(
125
+ {
126
+ module: A.enum.takeaway,
127
+ operation: F.F_OPERATION_TYPE.delete,
128
+ data: a._id
129
+ },
130
+ a.name,
131
+ !0
132
+ );
133
+ });
134
+ }
135
+ return {
136
+ deleteTakeaway: d,
137
+ updateTakeaway: w
138
+ };
139
+ }), Te = {
140
+ key: 0,
141
+ class: /* @__PURE__ */ R(["flex-1 overflow-hidden", "space-y-16", "flex flex-col", "overflow-hidden", "pt-16"])
142
+ }, Ve = {
143
+ class: "flex items-center space-x-8 justify-end"
144
+ }, Ie = {
145
+ class: "w-[320px]"
146
+ }, Se = {
147
+ class: "px-16 pt-8"
148
+ }, Ue = {
149
+ class: /* @__PURE__ */ R(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100"])
150
+ }, Ke = ["onClick"], Me = {
151
+ class: "flex-1"
152
+ }, Pe = {
153
+ class: "fm-typo-en-body-lg-600 mb-4"
154
+ }, Be = {
155
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
156
+ }, Ee = {
157
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
158
+ }, Le = {
159
+ key: 1,
160
+ class: "xs:pt-24"
161
+ }, He = /* @__PURE__ */ oe({
162
+ __name: "Takeaway",
163
+ emits: ["update:count"],
164
+ setup(v, {
165
+ emit: y
166
+ }) {
167
+ const l = W(), c = Ce(), e = x(() => l.rules.item.bindToVariant), p = x(() => l.rules.takeaway), f = Q(J(Z())), k = ce(), u = x(() => re.Country.getCountry(k.currentCountry.value).currency), o = x(() => l.takeaways.map((i) => ({
168
+ ...i,
169
+ usedBy: l.items.reduce((s, _) => {
170
+ var r, K, Y;
171
+ const T = _.takeawayUsed === i._id;
172
+ if ((!e.value || !((K = (r = _.variant) == null ? void 0 : r.variantGroupIds) != null && K.length)) && T)
173
+ s.push({
174
+ _id: _._id
175
+ });
176
+ else {
177
+ const te = (((Y = _.variant) == null ? void 0 : Y.variantCombinations) || []).filter((M) => M.takeawayUsed === i._id || M.takeawayUsed == null && T).map((M) => ({
178
+ _id: _._id,
179
+ combinationKey: M.combinationKey
180
+ }));
181
+ s = [...s, ...te];
182
+ }
183
+ return s;
184
+ }, [])
185
+ }))), {
186
+ filter: w,
187
+ searchKey: d
188
+ } = ke(), a = x(() => o.value.filter((i) => w([i.name, z(i.price, !1)]))), m = y;
189
+ ie(() => a.value.length, (i) => {
190
+ m("update:count", i);
191
+ }, {
192
+ immediate: !0
193
+ });
194
+ const {
195
+ t
196
+ } = X(), h = x(() => [{
197
+ accessorKey: "name",
198
+ header: () => t("menu.takeaway.table.columns.name"),
199
+ enableSorting: !1,
200
+ size: 700,
201
+ cell: (i) => {
202
+ const s = i.row.original, _ = i.getValue();
203
+ return S("div", {
204
+ class: "flex items-center gap-8"
205
+ }, [S("span", {
206
+ class: "break-all"
207
+ }, _), s.name_locale ? S(_e, {
208
+ nameLocale: s.name_locale ?? {}
209
+ }) : null]);
210
+ }
211
+ }, {
212
+ accessorKey: "price",
213
+ header: () => t("menu.takeaway.table.columns.price", {
214
+ symbol: u.value.symbol
215
+ }),
216
+ enableSorting: !1,
217
+ size: 200,
218
+ meta: {
219
+ textAlign: "right"
220
+ },
221
+ cell: (i) => {
222
+ const s = i.getValue();
223
+ return z(s, !1);
224
+ }
225
+ }, {
226
+ accessorKey: "usedBy",
227
+ header: () => t("menu.takeaway.table.columns.products"),
228
+ enableSorting: !1,
229
+ size: 200,
230
+ cell: (i) => {
231
+ const s = i.getValue(), _ = H(l.categorizedItems, s).flatMap((T) => T.items).length ?? 0;
232
+ return t("menu.takeaway.table.items_linked", {
233
+ count: _
234
+ });
235
+ }
236
+ }, {
237
+ id: "action",
238
+ size: 52,
239
+ meta: {
240
+ cellClass: "pl-16",
241
+ headerContentClass: "-mx-16"
242
+ },
243
+ cell: (i) => S("div", {
244
+ class: "flex justify-end items-center"
245
+ }, [p.value.delete ? S(ue.FmButton, {
246
+ prependIcon: "delete",
247
+ variant: N.Tertiary,
248
+ textColor: "neutral-gray-400",
249
+ onClick: (s) => {
250
+ s.stopPropagation(), c.deleteTakeaway(i.row.original);
251
+ }
252
+ }) : null])
253
+ }]), U = me(), C = x(() => U.breakpoints.value.xs);
254
+ return (i, s) => {
255
+ const _ = E("fm-search"), T = E("fm-table"), B = E("fm-button");
256
+ return o.value.length ? (g(), V(L, {
257
+ key: 0
258
+ }, [C.value ? (g(), V(L, {
259
+ key: 1
260
+ }, [b("div", Se, [I(_, {
261
+ class: "w-full",
262
+ autofocus: "",
263
+ modelValue: n(d),
264
+ "onUpdate:modelValue": s[2] || (s[2] = (r) => j(d) ? d.value = r : null),
265
+ placeholder: n(t)("menu.takeaway.table.search.placeholder")
266
+ }, null, 8, ["modelValue", "placeholder"])]), b("div", Ue, [(g(!0), V(L, null, se(a.value, (r) => (g(), V("div", {
267
+ key: r._id,
268
+ class: R(["py-12 px-16", "flex space-x-8", "items-center"]),
269
+ onClick: () => {
270
+ p.value.edit && n(c).updateTakeaway(r);
271
+ }
272
+ }, [b("div", Me, [b("p", Pe, P(r.name), 1), b("p", Be, P(`${n(H)(n(l).categorizedItems, r.usedBy).flatMap((K) => K.items).length ?? 0} items linked`), 1), b("p", Ee, " Price: " + P(u.value.symbol) + P(n(z)(r.price, !1)), 1)]), p.value.delete ? (g(), $(B, {
273
+ key: 0,
274
+ variant: n(N).Tertiary,
275
+ "text-color": "neutral-gray-400",
276
+ "prepend-icon": "delete",
277
+ onClick: G(() => n(c).deleteTakeaway(r), ["stop"])
278
+ }, null, 8, ["variant", "onClick"])) : q("", !0)], 8, Ke))), 128))])], 64)) : (g(), V("div", Te, [b("div", Ve, [b("div", Ie, [I(_, {
279
+ autofocus: "",
280
+ modelValue: n(d),
281
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => j(d) ? d.value = r : null),
282
+ placeholder: n(t)("menu.takeaway.table.search.placeholder")
283
+ }, null, 8, ["modelValue", "placeholder"])])]), I(ye, null, {
284
+ default: O(() => [I(T, {
285
+ "column-defs": h.value,
286
+ loading: n(f).checkMenuIsLoading(),
287
+ "page-size": a.value.length,
288
+ "row-data": a.value,
289
+ "search-value": n(d),
290
+ "shrink-at": !1,
291
+ class: "flex-1 overflow-hidden",
292
+ "hide-footer": "",
293
+ "pin-header-row": "",
294
+ onRowClick: s[1] || (s[1] = (r) => {
295
+ p.value.edit && n(c).updateTakeaway(r.original);
296
+ })
297
+ }, null, 8, ["column-defs", "loading", "page-size", "row-data", "search-value"])]),
298
+ _: 1
299
+ })]))], 64)) : (g(), V("div", Le, [I(n(le), {
300
+ subtitle: n(t)("menu.takeaway.empty.subtitle"),
301
+ title: n(t)("menu.takeaway.empty.title")
302
+ }, {
303
+ action: O(() => [p.value.create ? (g(), $(n(fe), {
304
+ key: 0,
305
+ "bind-to-variant": e.value,
306
+ action: "add",
307
+ "apply-product": "",
308
+ "onUpdate:takeaway": s[3] || (s[3] = (r) => n(f).updateMenu({
309
+ module: n(A).enum.takeaway,
310
+ operation: n(F.F_OPERATION_TYPE).create,
311
+ data: n(ee)(r),
312
+ link: n(ae)(r.usedBy || [])
313
+ }, r.name))
314
+ }, {
315
+ default: O(({
316
+ trigger: r
317
+ }) => [I(B, {
318
+ "prepend-icon": "add",
319
+ label: n(t)("menu.takeaway.empty.action"),
320
+ onClick: G(r, ["stop"])
321
+ }, null, 8, ["label", "onClick"])]),
322
+ _: 1
323
+ }, 8, ["bind-to-variant"])) : q("", !0)]),
324
+ _: 1
325
+ }, 8, ["subtitle", "title"])]));
326
+ };
327
+ }
328
+ });
329
+ export {
330
+ He as _
331
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as v, createElementBlock as d, openBlock as a, normalizeClass as b, toDisplayString as y, unref as u, resolveComponent as i, createVNode as _, createElementVNode as c, computed as h, createBlock as g, createCommentVNode as w, Fragment as k, renderList as x, withCtx as F } from "vue";
2
2
  import { useI18n as S } from "@feedmepos/mf-common";
3
3
  import { g as I, a as L } from "./translation-fNx6yEpy.js";
4
- import { u as N } from "./index.vue_vue_type_script_setup_true_lang-qUahjdoy.js";
4
+ import { u as N } from "./index.vue_vue_type_script_setup_true_lang-BJZykcBx.js";
5
5
  const C = /* @__PURE__ */ v({
6
6
  __name: "LocaleIconBadge",
7
7
  props: {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as z, ref as p, watch as L, computed as k, resolveComponent as v, createBlock as w, openBlock as f, unref as n, withCtx as _, createElementVNode as i, createVNode as r, toDisplayString as h, createElementBlock as x, createCommentVNode as F, Fragment as I, renderList as A } from "vue";
2
- import { l as S, u as q } from "./discardConfirm-egY5vwUU.js";
2
+ import { l as S, u as q } from "./discardConfirm-CuLDiWC_.js";
3
3
  import { useI18n as G } from "@feedmepos/mf-common";
4
- import { _ as H, a as J, b as K, c as M } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-M3Oh6Dr6.js";
4
+ import { _ as H, a as J, b as K, c as M } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-C37PZJuF.js";
5
5
  const P = { class: "fm-typo-en-title-md-600" }, Q = { class: "pt-8 space-y-24" }, R = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, W = { class: "flex items-center gap-16" }, X = { class: "fm-typo-en-body-lg-600" }, Y = { class: "flex flex-col gap-32 pl-32" }, Z = {
6
6
  key: 0,
7
7
  class: "space-y-8"