@feedmepos/mf-inventory-portal 1.5.10 → 1.5.11-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 (92) hide show
  1. package/dist/{App-erqZSd0c.js → App-CquCiNsy.js} +4 -4
  2. package/dist/{ApprovalView-C2CGthqi.js → ApprovalView-CU-k06kj.js} +7 -7
  3. package/dist/{BindingsDialog-Cw6MdCbI.js → BindingsDialog-BPBKfeS6.js} +2 -2
  4. package/dist/{BindingsPicker-CcSrxhUo.js → BindingsPicker-DkBI7_0Y.js} +2 -2
  5. package/dist/{BindingsTable-C5nMju9L.js → BindingsTable-C22g1gV7.js} +3 -3
  6. package/dist/{ClosingDraftView-C_Loim5S.js → ClosingDraftView-DgHvcVne.js} +15 -15
  7. package/dist/ClosingHistoryView-Cjm39o7e.js +1114 -0
  8. package/dist/{ClosingTemplateView-PQdTcIFY.js → ClosingTemplateView-BfO_HZS-.js} +14 -14
  9. package/dist/{DefaultView-BIlFmXaB.js → DefaultView-Jl_IdT_Z.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-BhT1YxRZ.js → DeliveryOrderPrintPreview-CaWTHT6h.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DO7xvy5V.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BXmbD4jZ.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bf6RHJdQ.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DWm36ZgX.js} +2 -2
  13. package/dist/{FmMultiselectDialog-cXV6Jo4B.js → FmMultiselectDialog-CEsqNTCq.js} +2 -2
  14. package/dist/{FmMultiselectDialog-B-X6WQXu.js → FmMultiselectDialog-D4gqa0tb.js} +1 -1
  15. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-4NtlySGX.js +388 -0
  16. package/dist/{ImportView-B3jO8aU8.js → ImportView-GTiAyijj.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-GPVWrmed.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BHRq2v-2.js} +1 -1
  18. package/dist/{IngredientGroupView-BuUoHLDb.js → IngredientGroupView-Kk002hXi.js} +5 -5
  19. package/dist/{IngredientsView-Dq_YrtQ5.js → IngredientsView-8Dojrj1e.js} +15 -15
  20. package/dist/{IntegrationExplorerView-Dh5ZPJK-.js → IntegrationExplorerView-BVBqUc3k.js} +352 -352
  21. package/dist/{IntegrationView-DWbHZdc4.js → IntegrationView-eS-LnDeu.js} +13 -13
  22. package/dist/{InventoryBindingForm-D-EN8Tpz.js → InventoryBindingForm-DitsFH4v.js} +1 -1
  23. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-DncMbF6J.js +429 -0
  24. package/dist/{InventoryBindingSummary-BTagfxn1.js → InventoryBindingSummary-DIKZ_7lC.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BUBHDMNn.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DJV_hhgt.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D2B20Qv0.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Pjde4sd6.js} +1 -1
  27. package/dist/{PublishView-CpiWv2n6.js → PublishView-CTwkJWJj.js} +3 -3
  28. package/dist/{PurchaseOrderPrintPreview-Czi5Aip0.js → PurchaseOrderPrintPreview-BuP85XCw.js} +2 -2
  29. package/dist/{ReceiveRequestView-BVEU4j9p.js → ReceiveRequestView-CfWhi-qh.js} +9631 -9552
  30. package/dist/{RecipeView-OVmWTAt-.js → RecipeView-CaNmJwqf.js} +1316 -1291
  31. package/dist/{SettingsView-CMQLojRr.js → SettingsView-DiMxunWj.js} +4 -4
  32. package/dist/{StockView-DZeeZlJq.js → StockView-CWDb29Cp.js} +19 -19
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bf1b1rJK.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-0MNUfMmq.js} +1 -1
  34. package/dist/{SupplierView-BcmkfFvI.js → SupplierView-CLB-ASht.js} +12 -12
  35. package/dist/{SurchargeView-DhcatJUO.js → SurchargeView-C2clhhAW.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6bwhx8Z.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DF-LJ-3w.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-4Ti9w_wf.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Ga9lkrf8.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Dw1TIZVj.js → TransferDetails.vue_vue_type_script_setup_true_lang-R1t4S-6H.js} +20 -20
  39. package/dist/{TransferTemplateView-CRPvLRHd.js → TransferTemplateView-7lXzFWv2.js} +18 -18
  40. package/dist/{UnitCostHistoryView-B4pAplGT.js → UnitCostHistoryView-CZg_dxvk.js} +4 -4
  41. package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-BB3dV6Gh.js +160 -0
  42. package/dist/{UnitView-95-cARn9.js → UnitView-BnZ_3MwD.js} +7 -7
  43. package/dist/{WarehouseView-o1FxslRs.js → WarehouseView-D7j9qMqP.js} +5 -5
  44. package/dist/{WastageTemplateView-D3hu-bq0.js → WastageTemplateView-Cl_9lPqx.js} +14 -14
  45. package/dist/{app-BEJm79K1.js → app-DMMqtQts.js} +23 -11
  46. package/dist/app.d.ts +12 -0
  47. package/dist/app.js +1 -1
  48. package/dist/{closing-template-BotB3jos.js → closing-template-CiSNSKyE.js} +1 -1
  49. package/dist/{date2-CnEklTL8.js → date2-Db-IPmri.js} +1 -1
  50. package/dist/{dayjs.min-CUR65wqq.js → dayjs.min-DD2BO69F.js} +1 -1
  51. package/dist/{decimal-CV_OL7iL.js → decimal-Ds6h3ukt.js} +2 -2
  52. package/dist/{defineDeepModel-D7NJvnaz.js → defineDeepModel-BgonxmUi.js} +1 -1
  53. package/dist/{duplicate-template-DCaAVNSG.js → duplicate-template-L6x61phF.js} +1 -1
  54. package/dist/{feature-BpZTiO4W.js → feature-C0UUWbkT.js} +2 -2
  55. package/dist/{format-time-from-id-Awu23hHz.js → format-time-from-id-lrFC2RMu.js} +1 -1
  56. package/dist/{format-unit-display-B2_RGXzk.js → format-unit-display-CpwFmpcL.js} +11 -11
  57. package/dist/{import-export.helper-BuNDvFsc.js → import-export.helper-BtXLvHMF.js} +6 -6
  58. package/dist/{index-BBqEhoS9.js → index-Cej2xM-2.js} +1 -1
  59. package/dist/{index-BK75WSFH.js → index-CxALGEZr.js} +3 -3
  60. package/dist/{index-D_u-AkFp.js → index-mtJ1GhRU.js} +1 -1
  61. package/dist/{inventory-core-dart.default-D_hfcDPc.js → inventory-core-dart.default-CroeeGeI.js} +1 -1
  62. package/dist/{lz-string-K7l_8Og1.js → lz-string-TL3mT9nT.js} +1 -1
  63. package/dist/{netsuite-CPUKn7UQ.js → netsuite-DOpNemik.js} +2 -2
  64. package/dist/{number-DoYjk_zN.js → number-DlYhqTV5.js} +3 -3
  65. package/dist/{predefined-templates-CEDkdeWc.js → predefined-templates-DDpVS07Q.js} +1 -1
  66. package/dist/{purchase-order-template-ChZyiCwx.js → purchase-order-template-K6HvK5h0.js} +1 -1
  67. package/dist/{recalculationUtils-CEkm9-mp.js → recalculationUtils-BHomSQPu.js} +1 -1
  68. package/dist/{rules-DDjcQi_O.js → rules-r7ubhhR0.js} +2 -2
  69. package/dist/{stock-Voq2gMuS.js → stock-BcLy5Ilr.js} +1 -1
  70. package/dist/{supplier-DFopX4OU.js → supplier-rNHLA7rt.js} +2 -2
  71. package/dist/{surcharge-CjwbPJQi.js → surcharge-B5N4UzQl.js} +1 -1
  72. package/dist/tsconfig.app.tsbuildinfo +1 -1
  73. package/dist/{uom-rules-CHnn3ILl.js → uom-rules-B51fYVj3.js} +1 -1
  74. package/dist/{use-ingredient-select-dialog-DS6__LXy.js → use-ingredient-select-dialog-C7NY9Kj6.js} +2 -2
  75. package/dist/{use-inventory-binding-dialog-DcJJo3Lr.js → use-inventory-binding-dialog-Ca4VaXkz.js} +2 -2
  76. package/dist/{use-template-enabled-locations-BVs_0JOA.js → use-template-enabled-locations-RiR-qhSs.js} +2 -2
  77. package/dist/{use-transfer-locations-Dzp5fj3Z.js → use-transfer-locations-csQ1Ar0m.js} +2 -2
  78. package/dist/{useHrmPermission-DQQ5MYsL.js → useHrmPermission-DHcinOeI.js} +1 -1
  79. package/dist/{useNavigationMenu-msCIV-Ux.js → useNavigationMenu-u8V59Vtc.js} +2 -2
  80. package/dist/{useSseClient-cer6d2VA.js → useSseClient-UQLgDoDc.js} +3 -3
  81. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -0
  82. package/dist/views/receive-request/components/transfer-form/composables/use-stock-balance-toggle.d.ts +3 -0
  83. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +4 -0
  84. package/dist/{vue-i18n-BiedKAFs.js → vue-i18n-CD-rDdDv.js} +534 -534
  85. package/dist/{xlsx-DGn-BAF9.js → xlsx-BRq0kYfc.js} +1 -1
  86. package/dist/{xlsx.util-DXnaPoeW.js → xlsx.util-ylgVcZid.js} +3 -3
  87. package/package.json +2 -2
  88. package/dist/ClosingHistoryView-7TcMNjKb.js +0 -1108
  89. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-BHazP1jS.js +0 -362
  90. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CI4hutH2.js +0 -404
  91. package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-D3OGljNP.js +0 -137
  92. package/dist/export-HmzdllkU.js +0 -26
@@ -1,36 +1,36 @@
1
- import { defineComponent as ie, ref as K, onMounted as pt, resolveComponent as G, openBlock as b, createElementBlock as B, Fragment as X, createElementVNode as y, toDisplayString as D, createVNode as k, createCommentVNode as U, computed as R, watch as ue, unref as n, normalizeClass as Be, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
2
- import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-BEJm79K1.js";
1
+ import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as b, createElementBlock as V, Fragment as X, createElementVNode as v, toDisplayString as U, createVNode as h, createCommentVNode as T, computed as R, watch as ue, unref as n, normalizeClass as Be, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
2
+ import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-DMMqtQts.js";
3
3
  import { useDialog as Le, useSnackbar as je, components as _e, useProxiedModel as Ge, useBreakpoints as xt } from "@feedmepos/ui-library";
4
4
  import { i as $t, _ as It, m as wt } from "./menu-usage-module-D7cxkbEk.js";
5
5
  import { F as se } from "./form-mode.enum-BKiNVH6A.js";
6
- import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-GPVWrmed.js";
6
+ import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-BHRq2v-2.js";
7
7
  import { defineStore as ot, storeToRefs as Et } from "pinia";
8
8
  import { D as He, R as Ve } from "./row-action.enum-DQ9bJ_uv.js";
9
9
  import { c as Vt } from "./component-kqxARxvM.js";
10
- import { a as Q, c as Ke } from "./number-DoYjk_zN.js";
11
- import { useI18n as oe, useCoreStore as St } from "@feedmepos/mf-common";
10
+ import { a as Q, c as Ke } from "./number-DlYhqTV5.js";
11
+ import { useI18n as ie, useCoreStore as St } from "@feedmepos/mf-common";
12
12
  import { u as Bt, _ as Ct } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
13
- import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-DDjcQi_O.js";
14
- import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CI4hutH2.js";
15
- import { a as Pe } from "./FmMultiselectDialog-cXV6Jo4B.js";
16
- import { d as at } from "./defineDeepModel-D7NJvnaz.js";
13
+ import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-r7ubhhR0.js";
14
+ import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-DncMbF6J.js";
15
+ import { a as Pe } from "./FmMultiselectDialog-CEsqNTCq.js";
16
+ import { d as rt } from "./defineDeepModel-BgonxmUi.js";
17
17
  import { L as Tt, P as Ut, D as Pt } from "./app-DiX-EfV6.js";
18
- import { _ as Ce, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BHazP1jS.js";
19
- import { u as Gt } from "./FmMultiselectDialog-B-X6WQXu.js";
20
- import { u as Nt } from "./vue-i18n-BiedKAFs.js";
21
- import { F as zt } from "./inventory-core-dart.default-D_hfcDPc.js";
18
+ import { _ as Ce, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-4NtlySGX.js";
19
+ import { u as Gt } from "./FmMultiselectDialog-D4gqa0tb.js";
20
+ import { u as Nt } from "./vue-i18n-CD-rDdDv.js";
21
+ import { F as zt } from "./inventory-core-dart.default-CroeeGeI.js";
22
22
  import { _ as Ot } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
23
- import { u as We } from "./feature-BpZTiO4W.js";
24
- import { F as he } from "./decimal-CV_OL7iL.js";
25
- import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DO7xvy5V.js";
26
- import { b as rt, d as st } from "./xlsx.util-DXnaPoeW.js";
27
- import { f as dt } from "./date2-CnEklTL8.js";
23
+ import { u as We } from "./feature-C0UUWbkT.js";
24
+ import { F as he } from "./decimal-Ds6h3ukt.js";
25
+ import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BXmbD4jZ.js";
26
+ import { b as at, d as st } from "./xlsx.util-ylgVcZid.js";
27
+ import { f as dt } from "./date2-Db-IPmri.js";
28
28
  import { _ as Lt, F as Qe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
29
- import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bf6RHJdQ.js";
29
+ import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DWm36ZgX.js";
30
30
  const Kt = {
31
31
  key: 0,
32
32
  class: "flex flex-col items-center w-full h-full gap-24"
33
- }, qt = { key: 1 }, Wt = { key: 0 }, Yt = /* @__PURE__ */ ie({
33
+ }, qt = { key: 1 }, Wt = { key: 0 }, Yt = /* @__PURE__ */ le({
34
34
  __name: "DeleteDialog",
35
35
  props: {
36
36
  type: {},
@@ -39,68 +39,68 @@ const Kt = {
39
39
  bindedItems: {}
40
40
  },
41
41
  setup(m) {
42
- const d = m, l = K(d.bindedItems || []), t = K(!1);
42
+ const d = m, l = W(d.bindedItems || []), t = W(!1);
43
43
  pt(() => {
44
44
  i();
45
45
  });
46
46
  async function i() {
47
- var a, h;
48
- !t.value && ((a = d.data) != null && a._id) && (t.value = !0, l.value = await ne().getAffectedMenu((h = d.data) == null ? void 0 : h._id), t.value = !1);
47
+ var r, x;
48
+ !t.value && ((r = d.data) != null && r._id) && (t.value = !0, l.value = await ne().getAffectedMenu((x = d.data) == null ? void 0 : x._id), t.value = !1);
49
49
  }
50
- return (a, h) => {
50
+ return (r, x) => {
51
51
  const u = G("FmSpacer"), o = G("FmCircularProgress");
52
- return b(), B(X, null, [
53
- y("p", null, D(a.message), 1),
54
- t.value ? (b(), B("div", Kt, [
55
- k(u),
56
- y("div", null, [
57
- k(o, { size: "xl" })
52
+ return b(), V(X, null, [
53
+ v("p", null, U(r.message), 1),
54
+ t.value ? (b(), V("div", Kt, [
55
+ h(u),
56
+ v("div", null, [
57
+ h(o, { size: "xl" })
58
58
  ]),
59
- h[0] || (h[0] = y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
60
- k(u)
61
- ])) : (b(), B("div", qt, [
62
- h[2] || (h[2] = y("br", null, null, -1)),
63
- l.value.length > 0 ? (b(), B("div", Wt, [
64
- h[1] || (h[1] = y("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
65
- k(nt, {
59
+ x[0] || (x[0] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
60
+ h(u)
61
+ ])) : (b(), V("div", qt, [
62
+ x[2] || (x[2] = v("br", null, null, -1)),
63
+ l.value.length > 0 ? (b(), V("div", Wt, [
64
+ x[1] || (x[1] = v("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
65
+ h(nt, {
66
66
  name: "Menu",
67
67
  bindings: l.value
68
68
  }, null, 8, ["bindings"])
69
- ])) : U("", !0)
69
+ ])) : T("", !0)
70
70
  ]))
71
71
  ], 64);
72
72
  };
73
73
  }
74
74
  }), ze = ot("recipeForm", function() {
75
- const d = Le(), l = je(), t = ne(), i = K(!1), a = K();
76
- function h() {
77
- const r = {
75
+ const d = Le(), l = je(), t = ne(), i = W(!1), r = W();
76
+ function x() {
77
+ const a = {
78
78
  recipe: {},
79
79
  mode: se.CREATE,
80
80
  show: !0,
81
81
  "onUpdate:show"(p) {
82
- a.value.show = p;
82
+ r.value.show = p;
83
83
  }
84
84
  };
85
- a.value = r;
85
+ r.value = a;
86
86
  }
87
- async function u(r) {
87
+ async function u(a) {
88
88
  const p = {
89
- recipe: Oe(r),
89
+ recipe: Oe(a),
90
90
  mode: se.UPDATE,
91
91
  show: !0,
92
92
  "onUpdate:show"($) {
93
- a.value.show = $;
93
+ r.value.show = $;
94
94
  }
95
95
  };
96
- a.value = p;
96
+ r.value = p;
97
97
  }
98
- async function o(r) {
98
+ async function o(a) {
99
99
  i.value = !0;
100
100
  try {
101
- await t.deleteRecipe(r), l.open({
101
+ await t.deleteRecipe(a), l.open({
102
102
  title: "Success",
103
- message: `Deleted ${r.name}`,
103
+ message: `Deleted ${a.name}`,
104
104
  type: "success"
105
105
  });
106
106
  } catch (p) {
@@ -109,14 +109,14 @@ const Kt = {
109
109
  title: "Cannot delete recipe",
110
110
  contentComponent: It,
111
111
  contentComponentProps: {
112
- subject: (r == null ? void 0 : r.name) ?? "",
112
+ subject: (a == null ? void 0 : a.name) ?? "",
113
113
  items: p.errorResponse.errors.map(($) => {
114
- var C;
114
+ var B;
115
115
  return {
116
116
  chain: [
117
117
  {
118
118
  itemName: $.name,
119
- moduleKey: (C = $.message) != null && C.startsWith("modules.") ? wt($.message) : $.module
119
+ moduleKey: (B = $.message) != null && B.startsWith("modules.") ? wt($.message) : $.module
120
120
  }
121
121
  ]
122
122
  };
@@ -130,7 +130,7 @@ const Kt = {
130
130
  return;
131
131
  }
132
132
  l.open({
133
- title: `Cannot delete ${r == null ? void 0 : r.name}`,
133
+ title: `Cannot delete ${a == null ? void 0 : a.name}`,
134
134
  message: "Please try again.",
135
135
  type: "error"
136
136
  }), console.error("failed to delete recipe", p);
@@ -138,9 +138,9 @@ const Kt = {
138
138
  i.value = !1;
139
139
  }
140
140
  }
141
- function s(r) {
141
+ function s(a) {
142
142
  d.open({
143
- title: `Delete ${(r == null ? void 0 : r.name) ?? "recipe"}?`,
143
+ title: `Delete ${(a == null ? void 0 : a.name) ?? "recipe"}?`,
144
144
  closeButton: !1,
145
145
  primaryActions: {
146
146
  text: "Delete",
@@ -154,45 +154,45 @@ const Kt = {
154
154
  contentComponent: Yt,
155
155
  contentComponentProps: {
156
156
  type: "menu",
157
- data: r,
157
+ data: a,
158
158
  message: "You may not be able to delete this recipe if it is linked in any of the inventory modules."
159
159
  }
160
- }).onPrimary(() => o(r));
160
+ }).onPrimary(() => o(a));
161
161
  }
162
162
  return {
163
- createRecipe: h,
163
+ createRecipe: x,
164
164
  updateRecipe: u,
165
165
  deleteRecipe: s,
166
- recipeDialogProps: a,
166
+ recipeDialogProps: r,
167
167
  recipeViewLoading: i
168
168
  };
169
169
  });
170
170
  function Jt() {
171
- const { updateRecipe: m, deleteRecipe: d } = ze(), l = ne(), { t } = oe();
171
+ const { updateRecipe: m, deleteRecipe: d } = ze(), l = ne(), { t } = ie();
172
172
  async function i(o, s) {
173
- const r = Oe(s);
173
+ const a = Oe(s);
174
174
  if (o === Ve.Edit) {
175
- await m(r);
175
+ await m(a);
176
176
  return;
177
177
  }
178
178
  if (o === Ve.Delete) {
179
- await d(r);
179
+ await d(a);
180
180
  return;
181
181
  }
182
182
  }
183
- function a(o, s) {
184
- const r = o.filter((C) => C.type === be.enum.SKU), p = o.filter(
185
- (C) => C.type === be.enum.SKU_GROUP
186
- ), $ = o.filter((C) => C.type === be.enum.RECIPE);
183
+ function r(o, s) {
184
+ const a = o.filter((B) => B.type === be.enum.SKU), p = o.filter(
185
+ (B) => B.type === be.enum.SKU_GROUP
186
+ ), $ = o.filter((B) => B.type === be.enum.RECIPE);
187
187
  return [
188
- ...r.map((C) => ({ ...C, recipeIds: [...s] })),
189
- ...p.map((C) => ({ ...C, isGroup: !0, recipeIds: [...s] })),
190
- ...$.filter((C) => l.recipeById[C.id] && !s.has(C.id)).flatMap(
191
- (C) => a(l.recipeById[C.id].contains, /* @__PURE__ */ new Set([...s, C.id]))
188
+ ...a.map((B) => ({ ...B, recipeIds: [...s] })),
189
+ ...p.map((B) => ({ ...B, isGroup: !0, recipeIds: [...s] })),
190
+ ...$.filter((B) => l.recipeById[B.id] && !s.has(B.id)).flatMap(
191
+ (B) => r(l.recipeById[B.id].contains, /* @__PURE__ */ new Set([...s, B.id]))
192
192
  )
193
193
  ];
194
194
  }
195
- const h = [
195
+ const x = [
196
196
  {
197
197
  accessorKey: "recipe",
198
198
  header: () => t("inventory.recipe.name"),
@@ -224,44 +224,44 @@ function Jt() {
224
224
  ];
225
225
  function u(o) {
226
226
  const s = ne();
227
- return o.map((r) => ({
228
- recipe: r.name,
229
- ingredients: a(r.contains, /* @__PURE__ */ new Set([r._id])).map((p) => {
230
- var C, I, f, _, S, v;
227
+ return o.map((a) => ({
228
+ recipe: a.name,
229
+ ingredients: r(a.contains, /* @__PURE__ */ new Set([a._id])).map((p) => {
230
+ var B, I, f, k, S, y;
231
231
  if (p.isGroup) {
232
232
  const e = s.skuGroupById[p.id];
233
- return p.recipeIds.slice(1).length ? `(${(C = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : C.name}) ${e.name} (x ${Q(p.amount)})` : `${e.name} (x${Q(p.amount)})`;
233
+ return p.recipeIds.slice(1).length ? `(${(B = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : B.name}) ${e.name} (x ${Q(p.amount)})` : `${e.name} (x${Q(p.amount)})`;
234
234
  }
235
235
  const $ = s.skuById[p.id];
236
- return $ ? p.recipeIds.slice(1).length ? `(${(I = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${$.name} (${Q(p.amount)}${((f = p.measurement) == null ? void 0 : f.abbrev) ?? ((_ = $ == null ? void 0 : $.unit) == null ? void 0 : _.abbrev)})` : `${$.name} (${Q(p.amount)}${((S = p.measurement) == null ? void 0 : S.abbrev) ?? ((v = $ == null ? void 0 : $.unit) == null ? void 0 : v.abbrev)})` : null;
236
+ return $ ? p.recipeIds.slice(1).length ? `(${(I = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${$.name} (${Q(p.amount)}${((f = p.measurement) == null ? void 0 : f.abbrev) ?? ((k = $ == null ? void 0 : $.unit) == null ? void 0 : k.abbrev)})` : `${$.name} (${Q(p.amount)}${((S = p.measurement) == null ? void 0 : S.abbrev) ?? ((y = $ == null ? void 0 : $.unit) == null ? void 0 : y.abbrev)})` : null;
237
237
  }).filter((p) => p).join(", "),
238
- original: r
238
+ original: a
239
239
  }));
240
240
  }
241
- return { columnDefs: h, formatRowData: u };
241
+ return { columnDefs: x, formatRowData: u };
242
242
  }
243
243
  function Ht() {
244
244
  const m = ne(), d = Le();
245
- async function l(a, h, u, o = []) {
245
+ async function l(r, x, u, o = []) {
246
246
  var I, f;
247
- const s = a.filter((_) => _.type === "SKU"), r = a.filter((_) => _.type !== "SKU"), p = /* @__PURE__ */ new Set();
247
+ const s = r.filter((k) => k.type === "SKU"), a = r.filter((k) => k.type !== "SKU"), p = /* @__PURE__ */ new Set();
248
248
  if (u)
249
- for (const _ of m.skus)
250
- !o.some((v) => v === _._id) && _._id !== u && !((f = (I = _.convert) == null ? void 0 : I.inventoryBindings) != null && f.some((v) => v.id === u)) || p.add(_._id);
251
- const $ = m.skus.map((_) => ({
252
- label: _.name,
253
- sublabel: `${_.code}${p.has(_._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
254
- value: _,
255
- disabled: p.has(_._id)
256
- })), C = $.filter(
257
- (_) => s.find((S) => S.id === _.value._id) && !p.has(_.value._id)
258
- ).map((_) => _.value);
249
+ for (const k of m.skus)
250
+ !o.some((y) => y === k._id) && k._id !== u && !((f = (I = k.convert) == null ? void 0 : I.inventoryBindings) != null && f.some((y) => y.id === u)) || p.add(k._id);
251
+ const $ = m.skus.map((k) => ({
252
+ label: k.name,
253
+ sublabel: `${k.code}${p.has(k._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
254
+ value: k,
255
+ disabled: p.has(k._id)
256
+ })), B = $.filter(
257
+ (k) => s.find((S) => S.id === k.value._id) && !p.has(k.value._id)
258
+ ).map((k) => k.value);
259
259
  d.open({
260
260
  title: "Select ingredients",
261
261
  contentComponent: Pe,
262
262
  contentComponentProps: {
263
263
  items: $,
264
- modelValue: C,
264
+ modelValue: B,
265
265
  virtualScroll: !0
266
266
  },
267
267
  primaryActions: {
@@ -273,41 +273,41 @@ function Ht() {
273
273
  close: !0,
274
274
  variant: "tertiary"
275
275
  }
276
- }).onPrimary((_) => {
276
+ }).onPrimary((k) => {
277
277
  const S = [
278
- ...r,
279
- ...a.filter((v) => _.find((e) => e._id === v.id)),
280
- ..._.filter((v) => !a.find((e) => e.id === v._id)).map((v) => ({
278
+ ...a,
279
+ ...r.filter((y) => k.find((e) => e._id === y.id)),
280
+ ...k.filter((y) => !r.find((e) => e.id === y._id)).map((y) => ({
281
281
  type: "SKU",
282
- id: v._id,
282
+ id: y._id,
283
283
  amount: {
284
284
  amount: 1,
285
285
  precision: 0
286
286
  }
287
287
  }))
288
288
  ];
289
- h(S);
289
+ x(S);
290
290
  });
291
291
  }
292
- async function t(a, h, u = []) {
293
- var C;
294
- const o = a.filter((I) => I.type === "RECIPE"), s = a.filter((I) => I.type !== "RECIPE"), r = /* @__PURE__ */ new Set();
292
+ async function t(r, x, u = []) {
293
+ var B;
294
+ const o = r.filter((I) => I.type === "RECIPE"), s = r.filter((I) => I.type !== "RECIPE"), a = /* @__PURE__ */ new Set();
295
295
  if (u.length)
296
296
  for (const I of m.recipes) {
297
- const f = ((C = m.recipeBindingFlattenCache[I._id]) == null ? void 0 : C.inventoryBindings) ?? [], _ = f.some(
298
- (e) => e.bindingPaths.some((V) => u.some((c) => c === V.id))
297
+ const f = ((B = m.recipeBindingFlattenCache[I._id]) == null ? void 0 : B.inventoryBindings) ?? [], k = f.some(
298
+ (e) => e.bindingPaths.some((E) => u.some((c) => c === E.id))
299
299
  ), S = f.some(
300
300
  (e) => "success" in e && u.includes(e.ingredient._id)
301
301
  );
302
- (u.some((e) => e === I._id) || _ || S) && r.add(I._id);
302
+ (u.some((e) => e === I._id) || k || S) && a.add(I._id);
303
303
  }
304
304
  const p = m.recipes.filter((I) => !u.includes(I._id)).map((I) => ({
305
305
  label: I.name,
306
- sublabel: r.has(I._id) ? "(Cannot bind, will cause recursive binding)" : `${I.contains.length} inventory bindings`,
306
+ sublabel: a.has(I._id) ? "(Cannot bind, will cause recursive binding)" : `${I.contains.length} inventory bindings`,
307
307
  value: I,
308
- disabled: r.has(I._id)
308
+ disabled: a.has(I._id)
309
309
  })), $ = p.filter(
310
- (I) => o.find((f) => f.id === I.value._id) && !r.has(I.value._id)
310
+ (I) => o.find((f) => f.id === I.value._id) && !a.has(I.value._id)
311
311
  ).map((I) => I.value);
312
312
  d.open({
313
313
  title: "Select recipes",
@@ -328,10 +328,10 @@ function Ht() {
328
328
  }
329
329
  }).onPrimary((I) => {
330
330
  const f = [
331
- ...a.filter((_) => I.find((S) => S._id === _.id)),
332
- ...I.filter((_) => !a.find((S) => S.id === _._id)).map((_) => ({
331
+ ...r.filter((k) => I.find((S) => S._id === k.id)),
332
+ ...I.filter((k) => !r.find((S) => S.id === k._id)).map((k) => ({
333
333
  type: "RECIPE",
334
- id: _._id,
334
+ id: k._id,
335
335
  amount: {
336
336
  amount: 1,
337
337
  precision: 0
@@ -339,19 +339,19 @@ function Ht() {
339
339
  })),
340
340
  ...s
341
341
  ];
342
- h(f);
342
+ x(f);
343
343
  });
344
344
  }
345
- async function i(a, h, u = []) {
346
- const o = a.filter(($) => $.type === "SKU_GROUP"), s = a.filter(($) => $.type !== "SKU_GROUP"), r = m.skuGroups.filter(($) => !u.includes($._id)).map(($) => ({
345
+ async function i(r, x, u = []) {
346
+ const o = r.filter(($) => $.type === "SKU_GROUP"), s = r.filter(($) => $.type !== "SKU_GROUP"), a = m.skuGroups.filter(($) => !u.includes($._id)).map(($) => ({
347
347
  label: $.name,
348
348
  value: $
349
- })), p = r.filter(($) => o.find((C) => C.id === $.value._id)).map(($) => $.value);
349
+ })), p = a.filter(($) => o.find((B) => B.id === $.value._id)).map(($) => $.value);
350
350
  d.open({
351
351
  title: "Select ingredient group",
352
352
  contentComponent: Pe,
353
353
  contentComponentProps: {
354
- items: r,
354
+ items: a,
355
355
  modelValue: p,
356
356
  virtualScroll: !0
357
357
  },
@@ -365,9 +365,9 @@ function Ht() {
365
365
  variant: "tertiary"
366
366
  }
367
367
  }).onPrimary(($) => {
368
- const C = [
369
- ...a.filter((I) => $.find((f) => f._id === I.id)),
370
- ...$.filter((I) => !a.find((f) => f.id === I._id)).map((I) => ({
368
+ const B = [
369
+ ...r.filter((I) => $.find((f) => f._id === I.id)),
370
+ ...$.filter((I) => !r.find((f) => f.id === I._id)).map((I) => ({
371
371
  type: "SKU_GROUP",
372
372
  id: I._id,
373
373
  amount: {
@@ -377,7 +377,7 @@ function Ht() {
377
377
  })),
378
378
  ...s
379
379
  ];
380
- h(C);
380
+ x(B);
381
381
  });
382
382
  }
383
383
  return {
@@ -386,7 +386,7 @@ function Ht() {
386
386
  promptIngredientGroupsBinding: i
387
387
  };
388
388
  }
389
- const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re = /* @__PURE__ */ ie({
389
+ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re = /* @__PURE__ */ le({
390
390
  __name: "InventoryBindingRule",
391
391
  props: {
392
392
  disabled: { type: Boolean },
@@ -396,64 +396,64 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
396
396
  },
397
397
  emits: ["update:modelValue"],
398
398
  setup(m, { emit: d }) {
399
- const l = m, t = d, { t: i } = oe(), a = St(), h = tt(), u = R(() => {
400
- var C;
401
- const p = /* @__PURE__ */ new Map(), $ = a.restaurants.value.map((I) => I.customAttributes ?? {});
399
+ const l = m, t = d, { t: i } = ie(), r = St(), x = tt(), u = R(() => {
400
+ var B;
401
+ const p = /* @__PURE__ */ new Map(), $ = r.restaurants.value.map((I) => I.customAttributes ?? {});
402
402
  for (const I of $)
403
- for (const [f, _] of Object.entries(I))
404
- p.has(f) || p.set(f, /* @__PURE__ */ new Set()), _ && ((C = p.get(f)) == null || C.add(_));
403
+ for (const [f, k] of Object.entries(I))
404
+ p.has(f) || p.set(f, /* @__PURE__ */ new Set()), k && ((B = p.get(f)) == null || B.add(k));
405
405
  return p;
406
406
  }), o = R(() => [
407
- ...[...u.value.entries()].map(([$, C]) => ({
407
+ ...[...u.value.entries()].map(([$, B]) => ({
408
408
  type: "string",
409
409
  key: $,
410
410
  entity: "restaurant",
411
- values: [...C]
411
+ values: [...B]
412
412
  })),
413
413
  {
414
414
  type: "string",
415
415
  key: "state",
416
416
  entity: "restaurant",
417
417
  values: [...new Set(
418
- h.locations.map(($) => $.doc.profile.address.state).filter(Boolean)
418
+ x.locations.map(($) => $.doc.profile.address.state).filter(Boolean)
419
419
  )]
420
420
  }
421
- ]), s = K(null);
422
- let r = null;
421
+ ]), s = W(null);
422
+ let a = null;
423
423
  return ue(
424
424
  () => l.modelValue,
425
425
  (p) => {
426
- JSON.stringify(p) !== JSON.stringify(r) && (s.value = p ? Tt.build(p) : null);
426
+ JSON.stringify(p) !== JSON.stringify(a) && (s.value = p ? Tt.build(p) : null);
427
427
  },
428
428
  { immediate: !0 }
429
429
  ), ue(
430
430
  s,
431
431
  (p) => {
432
- r = p ? Ut.build(p) : null, t("update:modelValue", r);
432
+ a = p ? Ut.build(p) : null, t("update:modelValue", a);
433
433
  },
434
434
  { deep: !0 }
435
435
  ), (p, $) => {
436
- const C = G("FmLabel"), I = G("FmFormGroup");
437
- return b(), B("div", Qt, [
438
- y("div", Xt, [
439
- k(C, {
436
+ const B = G("FmLabel"), I = G("FmFormGroup");
437
+ return b(), V("div", Qt, [
438
+ v("div", Xt, [
439
+ h(B, {
440
440
  label: n(i)("inventory.ingredientGroup.form.rules.title"),
441
441
  required: p.minCount != null && p.minCount > 0
442
442
  }, null, 8, ["label", "required"]),
443
- k(n(Pt), {
443
+ h(n(Pt), {
444
444
  modelValue: s.value,
445
445
  "onUpdate:modelValue": $[0] || ($[0] = (f) => s.value = f),
446
446
  attributes: o.value
447
447
  }, null, 8, ["modelValue", "attributes"])
448
448
  ]),
449
- k(I, {
449
+ h(I, {
450
450
  "model-value": s.value,
451
451
  rules: [
452
452
  (f) => {
453
- const _ = f ? 1 : 0;
454
- return l.minCount !== void 0 && _ < l.minCount ? n(i)("inventory.ingredientGroup.form.rules.validation.minCount", {
453
+ const k = f ? 1 : 0;
454
+ return l.minCount !== void 0 && k < l.minCount ? n(i)("inventory.ingredientGroup.form.rules.validation.minCount", {
455
455
  count: l.minCount
456
- }) : l.maxCount !== void 0 && _ > l.maxCount ? n(i)("inventory.ingredientGroup.form.rules.validation.maxCount", {
456
+ }) : l.maxCount !== void 0 && k > l.maxCount ? n(i)("inventory.ingredientGroup.form.rules.validation.maxCount", {
457
457
  count: l.maxCount
458
458
  }) : !0;
459
459
  }
@@ -465,13 +465,13 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
465
465
  }), Zt = { class: "border-1 mx-3 my-1 rounded-md" }, en = { class: "flex flex-col w-full border-b border-fm-color-neutral-gray-100" }, tn = {
466
466
  class: "flex items-center",
467
467
  style: { "min-height": "48px" }
468
- }, nn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, on = { class: "flex flex-col" }, ln = { class: "line-clamp-1" }, an = { class: "w-[200px]" }, rn = {
468
+ }, nn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, on = { class: "flex flex-col" }, ln = { class: "line-clamp-1" }, rn = { class: "w-[200px]" }, an = {
469
469
  key: 0,
470
470
  class: "w-[52px]"
471
471
  }, sn = {
472
472
  key: 0,
473
473
  class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-8"
474
- }, dn = { class: "px-12 pb-4" }, un = /* @__PURE__ */ ie({
474
+ }, dn = { class: "px-12 pb-4" }, un = /* @__PURE__ */ le({
475
475
  __name: "InventoryRecipeBindingV2Field",
476
476
  props: {
477
477
  disabled: { type: Boolean },
@@ -482,85 +482,85 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
482
482
  },
483
483
  emits: ["update:modelValue", "delete", "settings"],
484
484
  setup(m, { emit: d }) {
485
- const l = d, { t } = oe(), i = at("modelValue"), a = K(""), h = R(() => +Q(i.amount));
485
+ const l = d, { t } = ie(), i = rt("modelValue"), r = W(""), x = R(() => +Q(i.amount));
486
486
  ue(
487
487
  () => i.amount,
488
488
  (s) => {
489
- const r = Q(s);
490
- a.value !== r && (a.value = r);
489
+ const a = Q(s);
490
+ r.value !== a && (r.value = a);
491
491
  },
492
492
  { immediate: !0 }
493
493
  );
494
494
  let u = null;
495
495
  function o(s) {
496
- a.value = s, u && clearTimeout(u), u = setTimeout(() => {
497
- const r = +s;
498
- s.length > 0 && isFinite(r) ? i.amount = Ke(r) : i.amount = { amount: 0, precision: 0 };
496
+ r.value = s, u && clearTimeout(u), u = setTimeout(() => {
497
+ const a = +s;
498
+ s.length > 0 && isFinite(a) ? i.amount = Ke(a) : i.amount = { amount: 0, precision: 0 };
499
499
  }, 300);
500
500
  }
501
- return (s, r) => {
502
- const p = G("FmTooltip"), $ = G("FmTextField"), C = G("FmButton"), I = G("FmIcon"), f = G("FmFormGroup");
503
- return b(), B("div", Zt, [
504
- k(f, {
501
+ return (s, a) => {
502
+ const p = G("FmTooltip"), $ = G("FmTextField"), B = G("FmButton"), I = G("FmIcon"), f = G("FmFormGroup");
503
+ return b(), V("div", Zt, [
504
+ h(f, {
505
505
  class: Be(["mb-2"]),
506
506
  disabled: s.disabled,
507
- modelValue: h.value,
507
+ modelValue: x.value,
508
508
  rules: [n(it)(0), n(qe)(-1)]
509
509
  }, {
510
- default: J(({ invalid: _ }) => [
511
- y("div", en, [
512
- y("div", tn, [
513
- y("div", nn, [
514
- y("div", on, [
515
- k(p, {
510
+ default: J(({ invalid: k }) => [
511
+ v("div", en, [
512
+ v("div", tn, [
513
+ v("div", nn, [
514
+ v("div", on, [
515
+ h(p, {
516
516
  zIndex: 51,
517
517
  variant: "plain",
518
518
  placement: "top",
519
519
  content: s.displayName
520
520
  }, {
521
521
  default: J(() => [
522
- y("span", ln, D(s.displayName), 1)
522
+ v("span", ln, U(s.displayName), 1)
523
523
  ]),
524
524
  _: 1
525
525
  }, 8, ["content"])
526
526
  ])
527
527
  ]),
528
- y("div", an, [
529
- k($, {
528
+ v("div", rn, [
529
+ h($, {
530
530
  class: "w-full",
531
531
  disabled: s.disabled,
532
- modelValue: a.value,
533
- "onUpdate:modelValue": r[0] || (r[0] = (S) => o(S)),
534
- invalid: _
532
+ modelValue: r.value,
533
+ "onUpdate:modelValue": a[0] || (a[0] = (S) => o(S)),
534
+ invalid: k
535
535
  }, null, 8, ["disabled", "modelValue", "invalid"])
536
536
  ]),
537
- s.readonly ? U("", !0) : (b(), B("div", rn, [
538
- k(C, {
537
+ s.readonly ? T("", !0) : (b(), V("div", an, [
538
+ h(B, {
539
539
  disabled: s.disabled,
540
540
  type: "button",
541
541
  variant: "plain",
542
542
  icon: "delete",
543
543
  "icon-color": "#000000",
544
- onClick: r[1] || (r[1] = () => l("delete", n(i).id))
544
+ onClick: a[1] || (a[1] = () => l("delete", n(i).id))
545
545
  }, null, 8, ["disabled"])
546
546
  ]))
547
547
  ]),
548
- s.showError ? (b(), B("div", sn, [
549
- k(I, {
548
+ s.showError ? (b(), V("div", sn, [
549
+ h(I, {
550
550
  name: "error",
551
551
  color: "system-error-300",
552
552
  size: "sm"
553
553
  }),
554
- y("div", null, D(n(t)("inventory.inventoryBindings.circularError")), 1)
555
- ])) : U("", !0)
554
+ v("div", null, U(n(t)("inventory.inventoryBindings.circularError")), 1)
555
+ ])) : T("", !0)
556
556
  ])
557
557
  ]),
558
558
  _: 1
559
559
  }, 8, ["disabled", "modelValue", "rules"]),
560
- y("div", dn, [
561
- k(Re, {
560
+ v("div", dn, [
561
+ h(Re, {
562
562
  modelValue: n(i).rules,
563
- "onUpdate:modelValue": r[2] || (r[2] = (_) => n(i).rules = _),
563
+ "onUpdate:modelValue": a[2] || (a[2] = (k) => n(i).rules = k),
564
564
  disabled: s.disabled
565
565
  }, null, 8, ["modelValue", "disabled"])
566
566
  ])
@@ -652,18 +652,18 @@ function cn(m) {
652
652
  sublabel: o.unit.abbrev,
653
653
  value: null
654
654
  },
655
- ...o.unit.measurements.map((r) => ({
656
- label: `${r.name} (${r.abbrev})`,
655
+ ...o.unit.measurements.map((a) => ({
656
+ label: `${a.name} (${a.abbrev})`,
657
657
  sublabel: l("inventory.inventoryBindings.alternativeTable.measurementOption"),
658
- value: r.id
658
+ value: a.id
659
659
  }))
660
- ].filter((r) => !r.label.toLowerCase().includes("inactive"));
660
+ ].filter((a) => !a.label.toLowerCase().includes("inactive"));
661
661
  return de(_e.FmSelect, {
662
662
  modelValue: u.row.original.trackingMeasurement ?? null,
663
663
  items: s,
664
664
  disabled: m.disabled ?? !1,
665
- "onUpdate:modelValue": (r) => {
666
- m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, trackingMeasurement: r } : p);
665
+ "onUpdate:modelValue": (a) => {
666
+ m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, trackingMeasurement: a } : p);
667
667
  }
668
668
  });
669
669
  },
@@ -683,17 +683,17 @@ function cn(m) {
683
683
  Ne(1),
684
684
  lt(
685
685
  m.bindingAlternatives.filter((s) => s._id !== o._id).map((s) => {
686
- const r = t.skuById[s._id];
686
+ const a = t.skuById[s._id];
687
687
  return {
688
- label: r == null ? void 0 : r.name,
688
+ label: a == null ? void 0 : a.name,
689
689
  value: s.priority
690
690
  };
691
691
  })
692
692
  )
693
693
  ],
694
694
  "onUpdate:modelValue": (s) => {
695
- const r = Number(s);
696
- isNaN(r) || (m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, priority: r } : p));
695
+ const a = Number(s);
696
+ isNaN(a) || (m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, priority: a } : p));
697
697
  }
698
698
  });
699
699
  }
@@ -734,10 +734,10 @@ function cn(m) {
734
734
  size: "md",
735
735
  disabled: m.disabled ?? !1,
736
736
  onClick: () => {
737
- const s = [...m.bindingAlternatives], r = s.findIndex((p) => p._id === o._id);
738
- if (r > 0) {
739
- const p = s[r - 1];
740
- s[r - 1] = o, s[r] = p;
737
+ const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
738
+ if (a > 0) {
739
+ const p = s[a - 1];
740
+ s[a - 1] = o, s[a] = p;
741
741
  }
742
742
  m.bindingAlternatives = [...s];
743
743
  }
@@ -750,10 +750,10 @@ function cn(m) {
750
750
  size: "md",
751
751
  disabled: m.disabled ?? !1,
752
752
  onClick: () => {
753
- const s = [...m.bindingAlternatives], r = s.findIndex((p) => p._id === o._id);
754
- if (r < s.length - 1) {
755
- const p = s[r + 1];
756
- s[r + 1] = o, s[r] = p;
753
+ const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
754
+ if (a < s.length - 1) {
755
+ const p = s[a + 1];
756
+ s[a + 1] = o, s[a] = p;
757
757
  }
758
758
  m.bindingAlternatives = [...s];
759
759
  }
@@ -772,22 +772,22 @@ function cn(m) {
772
772
  get columnDefs() {
773
773
  return i.value;
774
774
  },
775
- promptAddIngredient: async (h) => {
775
+ promptAddIngredient: async (x) => {
776
776
  const u = [];
777
- for (const r of t.skus)
778
- h.includes(r._id) || u.push({
779
- label: r.name,
780
- sublabel: r.code,
781
- value: r._id,
782
- disabled: h.includes(r._id)
777
+ for (const a of t.skus)
778
+ x.includes(a._id) || u.push({
779
+ label: a.name,
780
+ sublabel: a.code,
781
+ value: a._id,
782
+ disabled: x.includes(a._id)
783
783
  });
784
- const o = (m.bindingAlternatives ?? []).map((r) => r._id), s = await d.multiSelect(u, o, (r) => {
785
- var $, C, I, f, _, S;
786
- const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((v) => v._id === r);
784
+ const o = (m.bindingAlternatives ?? []).map((a) => a._id), s = await d.multiSelect(u, o, (a) => {
785
+ var $, B, I, f, k, S;
786
+ const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((y) => y._id === a);
787
787
  return {
788
- _id: r,
789
- trackingMeasurement: typeof p != "number" || p == -1 ? (C = t.skuById[r]) == null ? void 0 : C.trackingMeasurement : (f = (I = m.bindingAlternatives) == null ? void 0 : I[p]) == null ? void 0 : f.trackingMeasurement,
790
- priority: ((S = (_ = m.bindingAlternatives) == null ? void 0 : _[p]) == null ? void 0 : S.priority) ?? m.bindingAlternatives.length,
788
+ _id: a,
789
+ trackingMeasurement: typeof p != "number" || p == -1 ? (B = t.skuById[a]) == null ? void 0 : B.trackingMeasurement : (f = (I = m.bindingAlternatives) == null ? void 0 : I[p]) == null ? void 0 : f.trackingMeasurement,
790
+ priority: ((S = (k = m.bindingAlternatives) == null ? void 0 : k[p]) == null ? void 0 : S.priority) ?? m.bindingAlternatives.length,
791
791
  default: !1
792
792
  };
793
793
  });
@@ -805,7 +805,7 @@ function cn(m) {
805
805
  }
806
806
  };
807
807
  }
808
- const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, fn = { class: "flex justify-between items-center px-2" }, Se = /* @__PURE__ */ ie({
808
+ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, fn = { class: "flex justify-between items-center px-2" }, Se = /* @__PURE__ */ le({
809
809
  __name: "InventoryBindingAlternative",
810
810
  props: {
811
811
  disabled: { type: Boolean },
@@ -814,7 +814,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
814
814
  },
815
815
  emits: ["update:modelValue"],
816
816
  setup(m, { emit: d }) {
817
- const l = m, t = d, { t: i } = oe(), a = cn({
817
+ const l = m, t = d, { t: i } = ie(), r = cn({
818
818
  get disabled() {
819
819
  return l.disabled ?? !1;
820
820
  },
@@ -824,36 +824,36 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
824
824
  set bindingAlternatives(o) {
825
825
  t("update:modelValue", o);
826
826
  }
827
- }), h = (o) => o && o.some((s) => l.filterIngredientIds.includes(s._id)) ? "Contains invalid ingredient" : !0, u = (o) => o && o.length > 5 ? i("inventory.binding.alternative.maximumExceeded", { max: 5 }) : !0;
827
+ }), x = (o) => o && o.some((s) => l.filterIngredientIds.includes(s._id)) ? "Contains invalid ingredient" : !0, u = (o) => o && o.length > 5 ? i("inventory.binding.alternative.maximumExceeded", { max: 5 }) : !0;
828
828
  return (o, s) => {
829
829
  var I;
830
- const r = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"), C = G("FmTable");
831
- return b(), B("div", pn, [
832
- y("div", mn, [
833
- y("div", fn, [
834
- k(r, {
830
+ const a = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"), B = G("FmTable");
831
+ return b(), V("div", pn, [
832
+ v("div", mn, [
833
+ v("div", fn, [
834
+ h(a, {
835
835
  label: n(i)("inventory.alternatives")
836
836
  }, null, 8, ["label"]),
837
- k(p, {
837
+ h(p, {
838
838
  disabled: o.disabled,
839
839
  "prepend-icon": "link",
840
840
  variant: "primary",
841
841
  class: "border-1 rounded-lg border-fm-color-primary",
842
- onClick: s[0] || (s[0] = (f) => n(a).promptAddIngredient(o.filterIngredientIds)),
842
+ onClick: s[0] || (s[0] = (f) => n(r).promptAddIngredient(o.filterIngredientIds)),
843
843
  size: "md"
844
844
  }, null, 8, ["disabled"])
845
845
  ]),
846
- k($, {
846
+ h($, {
847
847
  "model-value": o.modelValue,
848
- rules: [h, u]
848
+ rules: [x, u]
849
849
  }, null, 8, ["model-value", "rules"])
850
850
  ]),
851
- k(C, {
851
+ h(B, {
852
852
  "row-data": o.modelValue ?? [],
853
- "column-defs": n(a).columnDefs,
853
+ "column-defs": n(r).columnDefs,
854
854
  "page-size": ((I = o.modelValue) == null ? void 0 : I.length) || 0,
855
855
  "shrink-at": 9999,
856
- "column-visibility": n(a).columnVisibility,
856
+ "column-visibility": n(r).columnVisibility,
857
857
  "hide-footer": ""
858
858
  }, null, 8, ["row-data", "column-defs", "page-size", "column-visibility"])
859
859
  ]);
@@ -865,7 +865,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
865
865
  }, gn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, _n = { class: "line-clamp-1 w-full" }, kn = { class: "w-[150px]" }, hn = {
866
866
  key: 0,
867
867
  class: "w-[52px]"
868
- }, xn = { class: "flex flex-col px-12 pb-4" }, $n = /* @__PURE__ */ ie({
868
+ }, xn = { class: "flex flex-col px-12 pb-4" }, $n = /* @__PURE__ */ le({
869
869
  __name: "InventorySkuBindingV2Field",
870
870
  props: {
871
871
  disabled: { type: Boolean },
@@ -879,11 +879,11 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
879
879
  },
880
880
  emits: ["update:modelValue", "delete", "settings"],
881
881
  setup(m, { emit: d }) {
882
- const l = d, { t } = oe(), i = at("modelValue");
883
- function a(u) {
882
+ const l = d, { t } = ie(), i = rt("modelValue");
883
+ function r(u) {
884
884
  u && (i.amount = u.amount, i.measurement = u.measurement);
885
885
  }
886
- function h() {
886
+ function x() {
887
887
  return {
888
888
  modelValue: {
889
889
  amount: i.amount,
@@ -895,35 +895,35 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
895
895
  };
896
896
  }
897
897
  return (u, o) => {
898
- const s = G("FmTooltip"), r = G("FmButton"), p = G("FmFormGroup");
899
- return b(), B("div", vn, [
900
- y("div", yn, [
901
- y("div", bn, [
902
- y("div", gn, [
903
- k(s, {
898
+ const s = G("FmTooltip"), a = G("FmButton"), p = G("FmFormGroup");
899
+ return b(), V("div", vn, [
900
+ v("div", yn, [
901
+ v("div", bn, [
902
+ v("div", gn, [
903
+ h(s, {
904
904
  zIndex: 51,
905
905
  variant: "plain",
906
906
  placement: "top",
907
907
  content: u.displayName
908
908
  }, {
909
909
  default: J(() => [
910
- y("span", _n, D(u.displayName), 1)
910
+ v("span", _n, U(u.displayName), 1)
911
911
  ]),
912
912
  _: 1
913
913
  }, 8, ["content"])
914
914
  ]),
915
- y("div", kn, [
916
- k(Ce, {
915
+ v("div", kn, [
916
+ h(Ce, {
917
917
  "model-value": { amount: n(i).amount, measurement: n(i).measurement },
918
- "onUpdate:modelValue": a,
918
+ "onUpdate:modelValue": r,
919
919
  unit: u.unit,
920
920
  placement: "bottom",
921
921
  "convert-amount-on-change-unit": "",
922
922
  disabled: u.readonly
923
923
  }, null, 8, ["model-value", "unit", "disabled"])
924
924
  ]),
925
- u.readonly ? U("", !0) : (b(), B("div", hn, [
926
- k(r, {
925
+ u.readonly ? T("", !0) : (b(), V("div", hn, [
926
+ h(a, {
927
927
  disabled: u.disabled,
928
928
  type: "button",
929
929
  variant: "tertiary",
@@ -932,13 +932,13 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
932
932
  }, null, 8, ["disabled"])
933
933
  ]))
934
934
  ]),
935
- y("div", xn, [
936
- k(p, {
935
+ v("div", xn, [
936
+ h(p, {
937
937
  modelValue: n(i).amount,
938
938
  rules: [n(qe)(0)]
939
939
  }, null, 8, ["modelValue", "rules"]),
940
- k(p, {
941
- modelValue: h(),
940
+ h(p, {
941
+ modelValue: x(),
942
942
  rules: [
943
943
  n(Mt)(),
944
944
  n(Dt)(u.unit),
@@ -951,14 +951,14 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
951
951
  modelValue: n(i).rules,
952
952
  "onUpdate:modelValue": o[1] || (o[1] = ($) => n(i).rules = $),
953
953
  disabled: u.disabled
954
- }, null, 8, ["modelValue", "disabled"])) : U("", !0),
954
+ }, null, 8, ["modelValue", "disabled"])) : T("", !0),
955
955
  u.ableToConfigureAlternative ? (b(), Y(Se, {
956
956
  key: 1,
957
957
  modelValue: n(i).alternatives,
958
958
  "onUpdate:modelValue": o[2] || (o[2] = ($) => n(i).alternatives = $),
959
959
  disabled: u.disabled,
960
960
  filterIngredientIds: [n(i).id]
961
- }, null, 8, ["modelValue", "disabled", "filterIngredientIds"])) : U("", !0)
961
+ }, null, 8, ["modelValue", "disabled", "filterIngredientIds"])) : T("", !0)
962
962
  ])
963
963
  ]);
964
964
  };
@@ -989,7 +989,13 @@ const In = { class: "flex flex-col gap-24" }, wn = {
989
989
  }, qn = { class: "flex flex-col gap-16" }, Wn = { class: "flex items-center" }, Yn = { class: "flex-1 fm-typo-en-title-sm-600" }, Jn = { class: "flex flex-col" }, Hn = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, Qn = { class: "flex-1 fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Xn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary w-[150px] px-16" }, Zn = {
990
990
  key: 0,
991
991
  class: "w-[52px]"
992
- }, eo = /* @__PURE__ */ ie({
992
+ }, eo = {
993
+ key: 0,
994
+ class: "flex flex-col border-b border-fm-color-neutral-gray-100"
995
+ }, to = {
996
+ class: "flex items-center w-full",
997
+ style: { "min-height": "48px" }
998
+ }, no = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12 text-fm-color-typo-secondary line-clamp-1" }, oo = { class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-12 pb-4" }, io = /* @__PURE__ */ le({
993
999
  __name: "InventoryBindingFormV2",
994
1000
  props: {
995
1001
  id: {},
@@ -1009,7 +1015,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1009
1015
  },
1010
1016
  emits: ["update:modelValue", "click:pick-inventory-bindings"],
1011
1017
  setup(m, { emit: d }) {
1012
- const { t: l } = oe(), t = ne(), i = R(() => t.recipeById), a = R(() => t.skuById), h = R(() => t.skuGroupById), u = m, o = d, s = R(() => kt({
1018
+ const { t: l } = ie(), t = ne(), i = R(() => t.recipeById), r = R(() => t.skuById), x = R(() => t.skuGroupById), u = m, o = d, s = R(() => kt({
1013
1019
  parentId: u.id,
1014
1020
  bindings: u.modelValue,
1015
1021
  recipes: t.recipes.map((F) => F._id === u.id ? {
@@ -1023,86 +1029,89 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1023
1029
  }
1024
1030
  } : F),
1025
1031
  skuGroups: t.skuGroups
1026
- }).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), r = R(
1027
- () => new Set(s.value.map((x) => {
1028
- var w;
1029
- return (w = x.bindingPaths[0]) == null ? void 0 : w.id;
1032
+ }).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a = R(
1033
+ () => new Set(s.value.map((g) => {
1034
+ var C;
1035
+ return (C = g.bindingPaths[0]) == null ? void 0 : C.id;
1030
1036
  }))
1031
- ), p = R(() => u.modelValue.filter((x) => x.type === "RECIPE")), { promptIngredientsBinding: $, promptRecipesBinding: C, promptIngredientGroupsBinding: I } = Ht();
1037
+ ), p = R(() => u.modelValue.filter((g) => g.type === "RECIPE")), { promptIngredientsBinding: $, promptRecipesBinding: B, promptIngredientGroupsBinding: I } = Ht();
1032
1038
  async function f() {
1033
1039
  if (u.iframeMode) {
1034
1040
  o("click:pick-inventory-bindings", "RECIPE");
1035
1041
  return;
1036
1042
  }
1037
- C(
1043
+ B(
1038
1044
  u.modelValue,
1039
- (x) => o("update:modelValue", x),
1045
+ (g) => o("update:modelValue", g),
1040
1046
  u.id ? [u.id] : []
1041
1047
  );
1042
1048
  }
1043
- const _ = R(() => u.modelValue.filter((x) => x.type === "SKU_GROUP"));
1049
+ const k = R(() => u.modelValue.filter((g) => g.type === "SKU_GROUP"));
1044
1050
  async function S() {
1045
1051
  I(
1046
1052
  u.modelValue,
1047
- (x) => o("update:modelValue", x),
1053
+ (g) => o("update:modelValue", g),
1048
1054
  u.id ? [u.id] : []
1049
1055
  );
1050
1056
  }
1051
- function v(x, w, F) {
1052
- const N = +w;
1053
- let T = F;
1054
- w.length > 0 && isFinite(N) ? T = F.map((P) => (P.id !== x || (P.amount = Ke(N)), P)) : T = F.map((P) => (P.id !== x || (P.amount = { amount: 0, precision: 0 }), P)), o("update:modelValue", T);
1057
+ function y(g, C, F) {
1058
+ const A = +C;
1059
+ let P = F;
1060
+ C.length > 0 && isFinite(A) ? P = F.map((K) => (K.id !== g || (K.amount = Ke(A)), K)) : P = F.map((K) => (K.id !== g || (K.amount = { amount: 0, precision: 0 }), K)), o("update:modelValue", P);
1055
1061
  }
1056
- const e = R(() => u.modelValue.filter((x) => x.type === "SKU") ?? []);
1057
- async function V() {
1062
+ const e = R(() => u.modelValue.filter((g) => g.type === "SKU") ?? []);
1063
+ async function E() {
1058
1064
  if (u.iframeMode) {
1059
1065
  o("click:pick-inventory-bindings", "SKU");
1060
1066
  return;
1061
1067
  }
1062
1068
  $(
1063
1069
  u.modelValue,
1064
- (x) => o("update:modelValue", x),
1070
+ (g) => o("update:modelValue", g),
1065
1071
  u.excludeBindingId,
1066
1072
  u.id ? [u.id] : []
1067
1073
  );
1068
1074
  }
1069
- function c(x) {
1070
- const w = u.modelValue.map((F) => F.id === x.id ? x : F);
1071
- o("update:modelValue", w);
1075
+ function c(g) {
1076
+ const C = u.modelValue.map((F) => F.id === g.id ? g : F);
1077
+ o("update:modelValue", C);
1072
1078
  }
1073
- function g(x) {
1074
- const w = u.modelValue.filter((F) => F.id !== x);
1075
- o("update:modelValue", w);
1079
+ function _(g) {
1080
+ const C = u.modelValue.filter((F) => F.id !== g);
1081
+ o("update:modelValue", C);
1076
1082
  }
1077
- function z(x) {
1078
- var F, N;
1079
- if (x.type !== be.enum.SKU)
1083
+ function N(g) {
1084
+ var F, A;
1085
+ if (g.type !== be.enum.SKU)
1080
1086
  throw new Error("Non-SKU binding does not have unit");
1081
- if (!((F = a.value[x.id]) == null ? void 0 : F.unit))
1082
- throw new Error(`Cannot find ingredient: ${x.id}`);
1083
- return (N = a.value[x.id]) == null ? void 0 : N.unit;
1084
- }
1085
- return (x, w) => {
1086
- var W, H, Z;
1087
- const F = G("FmFormGroup"), N = G("FmButton"), T = G("FmIcon"), P = G("FmTextField");
1088
- return b(), B("div", In, [
1089
- k(F, {
1090
- disabled: x.disabled,
1091
- "model-value": x.modelValue,
1087
+ if (!((F = r.value[g.id]) == null ? void 0 : F.unit))
1088
+ throw new Error(`Cannot find ingredient: ${g.id}`);
1089
+ return (A = r.value[g.id]) == null ? void 0 : A.unit;
1090
+ }
1091
+ function z(g) {
1092
+ return !r.value[g.id];
1093
+ }
1094
+ return (g, C) => {
1095
+ var H, ee, O;
1096
+ const F = G("FmFormGroup"), A = G("FmButton"), P = G("FmIcon"), K = G("FmTextField");
1097
+ return b(), V("div", In, [
1098
+ h(F, {
1099
+ disabled: g.disabled,
1100
+ "model-value": g.modelValue,
1092
1101
  rules: [
1093
- ...x.rules,
1102
+ ...g.rules,
1094
1103
  () => s.value.length ? "There is a binding error in your configuration" : !0
1095
1104
  ]
1096
1105
  }, {
1097
- label: J(() => w[4] || (w[4] = [
1098
- y("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
1106
+ label: J(() => C[4] || (C[4] = [
1107
+ v("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
1099
1108
  ])),
1100
1109
  _: 1
1101
1110
  }, 8, ["disabled", "model-value", "rules"]),
1102
- ((W = x.recipeBindingConfig) == null ? void 0 : W.enabled) !== !1 ? (b(), B("div", wn, [
1103
- y("div", En, [
1104
- y("div", Vn, D(n(l)("inventory.inventoryBindings.recipe")), 1),
1105
- x.readonly ? U("", !0) : (b(), Y(N, {
1111
+ ((H = g.recipeBindingConfig) == null ? void 0 : H.enabled) !== !1 ? (b(), V("div", wn, [
1112
+ v("div", En, [
1113
+ v("div", Vn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1114
+ g.readonly ? T("", !0) : (b(), Y(A, {
1106
1115
  key: 0,
1107
1116
  variant: "secondary",
1108
1117
  "text-color": "primary",
@@ -1112,32 +1121,32 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1112
1121
  onClick: f
1113
1122
  }, null, 8, ["label"]))
1114
1123
  ]),
1115
- y("div", Sn, [
1116
- y("div", Bn, [
1117
- y("div", Cn, D(n(l)("inventory.inventoryBindings.recipe")), 1),
1118
- w[5] || (w[5] = y("div", { class: "w-[200px]" }, null, -1)),
1119
- x.recipeBindingConfig.ableToApplyRules ? (b(), B("div", Fn)) : U("", !0),
1120
- x.readonly ? U("", !0) : (b(), B("div", Rn))
1124
+ v("div", Sn, [
1125
+ v("div", Bn, [
1126
+ v("div", Cn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1127
+ C[5] || (C[5] = v("div", { class: "w-[200px]" }, null, -1)),
1128
+ g.recipeBindingConfig.ableToApplyRules ? (b(), V("div", Fn)) : T("", !0),
1129
+ g.readonly ? T("", !0) : (b(), V("div", Rn))
1121
1130
  ]),
1122
- (b(!0), B(X, null, me(p.value, (A) => {
1131
+ (b(!0), V(X, null, me(p.value, (D) => {
1123
1132
  var L;
1124
1133
  return b(), Y(un, {
1125
- key: A.id,
1126
- "model-value": A,
1127
- "display-name": (L = i.value[A.id]) == null ? void 0 : L.name,
1128
- "show-error": r.value.has(A.id),
1129
- readonly: x.readonly,
1130
- disabled: x.disabled,
1131
- "onUpdate:modelValue": w[0] || (w[0] = (O) => c(O)),
1132
- onDelete: w[1] || (w[1] = (O) => g(O))
1134
+ key: D.id,
1135
+ "model-value": D,
1136
+ "display-name": (L = i.value[D.id]) == null ? void 0 : L.name,
1137
+ "show-error": a.value.has(D.id),
1138
+ readonly: g.readonly,
1139
+ disabled: g.disabled,
1140
+ "onUpdate:modelValue": C[0] || (C[0] = (q) => c(q)),
1141
+ onDelete: C[1] || (C[1] = (q) => _(q))
1133
1142
  }, null, 8, ["model-value", "display-name", "show-error", "readonly", "disabled"]);
1134
1143
  }), 128))
1135
1144
  ])
1136
- ])) : U("", !0),
1137
- x.enableIngredientGroup ? (b(), B("div", An, [
1138
- y("div", Tn, [
1139
- y("div", Un, D(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1140
- x.readonly ? U("", !0) : (b(), Y(N, {
1145
+ ])) : T("", !0),
1146
+ g.enableIngredientGroup ? (b(), V("div", An, [
1147
+ v("div", Tn, [
1148
+ v("div", Un, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1149
+ g.readonly ? T("", !0) : (b(), Y(A, {
1141
1150
  key: 0,
1142
1151
  variant: "secondary",
1143
1152
  "text-color": "primary",
@@ -1147,51 +1156,51 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1147
1156
  onClick: S
1148
1157
  }, null, 8, ["label"]))
1149
1158
  ]),
1150
- y("div", Pn, [
1151
- y("div", Mn, [
1152
- y("div", Dn, D(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1153
- w[6] || (w[6] = y("div", { class: "w-[200px]" }, null, -1)),
1154
- w[7] || (w[7] = y("div", { class: "w-[52px]" }, null, -1))
1159
+ v("div", Pn, [
1160
+ v("div", Mn, [
1161
+ v("div", Dn, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1162
+ C[6] || (C[6] = v("div", { class: "w-[200px]" }, null, -1)),
1163
+ C[7] || (C[7] = v("div", { class: "w-[52px]" }, null, -1))
1155
1164
  ]),
1156
- (b(!0), B(X, null, me(_.value, (A) => (b(), Y(F, {
1157
- key: A.id,
1158
- disabled: x.disabled,
1159
- modelValue: +n(Q)(A.amount ?? { amount: 1, precision: 0 }),
1165
+ (b(!0), V(X, null, me(k.value, (D) => (b(), Y(F, {
1166
+ key: D.id,
1167
+ disabled: g.disabled,
1168
+ modelValue: +n(Q)(D.amount ?? { amount: 1, precision: 0 }),
1160
1169
  rules: [n(it)(0), n(qe)(0)]
1161
1170
  }, {
1162
1171
  default: J(({ invalid: L }) => {
1163
- var O;
1172
+ var q;
1164
1173
  return [
1165
- y("div", Gn, [
1166
- r.value.has(A.id) ? (b(), B("div", Nn, [
1167
- k(T, {
1174
+ v("div", Gn, [
1175
+ a.value.has(D.id) ? (b(), V("div", Nn, [
1176
+ h(P, {
1168
1177
  name: "error",
1169
1178
  color: "system-error-300",
1170
1179
  size: "sm"
1171
1180
  }),
1172
- y("div", null, D(n(l)("inventory.inventoryBindings.circularError")), 1)
1173
- ])) : U("", !0),
1174
- y("div", zn, [
1175
- y("div", On, [
1176
- y("div", Ln, D((O = h.value[A.id]) == null ? void 0 : O.name), 1)
1181
+ v("div", null, U(n(l)("inventory.inventoryBindings.circularError")), 1)
1182
+ ])) : T("", !0),
1183
+ v("div", zn, [
1184
+ v("div", On, [
1185
+ v("div", Ln, U((q = x.value[D.id]) == null ? void 0 : q.name), 1)
1177
1186
  ]),
1178
- y("div", jn, [
1179
- k(P, {
1187
+ v("div", jn, [
1188
+ h(K, {
1180
1189
  class: "w-full",
1181
- disabled: x.disabled,
1182
- modelValue: +n(Q)(A.amount ?? { amount: 1, precision: 0 }),
1183
- "onUpdate:modelValue": (q) => v(A.id, q, x.modelValue),
1190
+ disabled: g.disabled,
1191
+ modelValue: +n(Q)(D.amount ?? { amount: 1, precision: 0 }),
1192
+ "onUpdate:modelValue": (oe) => y(D.id, oe, g.modelValue),
1184
1193
  invalid: L
1185
1194
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
1186
1195
  ]),
1187
- x.readonly ? U("", !0) : (b(), B("div", Kn, [
1188
- k(N, {
1189
- disabled: x.disabled,
1196
+ g.readonly ? T("", !0) : (b(), V("div", Kn, [
1197
+ h(A, {
1198
+ disabled: g.disabled,
1190
1199
  type: "button",
1191
1200
  variant: "plain",
1192
1201
  icon: "delete",
1193
1202
  "icon-color": "#000000",
1194
- onClick: (q) => g(A.id)
1203
+ onClick: (oe) => _(D.id)
1195
1204
  }, null, 8, ["disabled", "onClick"])
1196
1205
  ]))
1197
1206
  ])
@@ -1201,58 +1210,74 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1201
1210
  _: 2
1202
1211
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
1203
1212
  ])
1204
- ])) : U("", !0),
1205
- y("div", qn, [
1206
- y("div", Wn, [
1207
- y("div", Yn, D(n(l)("inventory.inventoryBindings.ingredient")), 1),
1208
- x.readonly ? U("", !0) : (b(), Y(N, {
1213
+ ])) : T("", !0),
1214
+ v("div", qn, [
1215
+ v("div", Wn, [
1216
+ v("div", Yn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1217
+ g.readonly ? T("", !0) : (b(), Y(A, {
1209
1218
  key: 0,
1210
1219
  variant: "secondary",
1211
1220
  "text-color": "primary",
1212
1221
  "border-color": "primary",
1213
1222
  label: n(l)("inventory.inventoryBindings.linkIngredient"),
1214
1223
  "prepend-icon": "link",
1215
- onClick: V
1224
+ onClick: E
1216
1225
  }, null, 8, ["label"]))
1217
1226
  ]),
1218
- y("div", Jn, [
1219
- y("div", Hn, [
1220
- y("div", Qn, D(n(l)("inventory.inventoryBindings.ingredient")), 1),
1221
- y("div", Xn, D(n(l)("inventory.inventoryBindings.amount")), 1),
1222
- w[8] || (w[8] = y("div", { class: "w-[52px]" }, null, -1)),
1223
- (H = x.skuBindingConfig) != null && H.ableToApplyRules || (Z = x.skuBindingConfig) != null && Z.ableToConfigureAlternative ? (b(), B("div", Zn)) : U("", !0)
1227
+ v("div", Jn, [
1228
+ v("div", Hn, [
1229
+ v("div", Qn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1230
+ v("div", Xn, U(n(l)("inventory.inventoryBindings.amount")), 1),
1231
+ C[8] || (C[8] = v("div", { class: "w-[52px]" }, null, -1)),
1232
+ (ee = g.skuBindingConfig) != null && ee.ableToApplyRules || (O = g.skuBindingConfig) != null && O.ableToConfigureAlternative ? (b(), V("div", Zn)) : T("", !0)
1224
1233
  ]),
1225
- (b(!0), B(X, null, me(e.value, (A) => {
1226
- var L, O, q;
1227
- return b(), Y($n, {
1228
- key: A.id,
1229
- "model-value": A,
1230
- "display-name": (L = a.value[A.id]) == null ? void 0 : L.name,
1231
- unit: z(A),
1232
- "show-error": r.value.has(A.id),
1233
- "able-to-apply-rules": ((O = x.skuBindingConfig) == null ? void 0 : O.ableToApplyRules) === !0,
1234
- "able-to-configure-alternative": ((q = x.skuBindingConfig) == null ? void 0 : q.ableToConfigureAlternative) === !0,
1235
- readonly: x.readonly,
1236
- disabled: x.disabled,
1237
- "onUpdate:modelValue": w[2] || (w[2] = (le) => c(le)),
1238
- onDelete: w[3] || (w[3] = (le) => g(le))
1239
- }, null, 8, ["model-value", "display-name", "unit", "show-error", "able-to-apply-rules", "able-to-configure-alternative", "readonly", "disabled"]);
1234
+ (b(!0), V(X, null, me(e.value, (D) => {
1235
+ var L, q, oe;
1236
+ return b(), V(X, {
1237
+ key: D.id
1238
+ }, [
1239
+ z(D) ? (b(), V("div", eo, [
1240
+ v("div", to, [
1241
+ v("div", no, U(D.id), 1)
1242
+ ]),
1243
+ v("div", oo, [
1244
+ h(P, {
1245
+ name: "error",
1246
+ color: "system-error-300",
1247
+ size: "sm"
1248
+ }),
1249
+ v("div", null, U(n(l)("inventory.inventoryBindings.missingIngredient")), 1)
1250
+ ])
1251
+ ])) : (b(), Y($n, {
1252
+ key: 1,
1253
+ "model-value": D,
1254
+ "display-name": (L = r.value[D.id]) == null ? void 0 : L.name,
1255
+ unit: N(D),
1256
+ "show-error": a.value.has(D.id),
1257
+ "able-to-apply-rules": ((q = g.skuBindingConfig) == null ? void 0 : q.ableToApplyRules) === !0,
1258
+ "able-to-configure-alternative": ((oe = g.skuBindingConfig) == null ? void 0 : oe.ableToConfigureAlternative) === !0,
1259
+ readonly: g.readonly,
1260
+ disabled: g.disabled,
1261
+ "onUpdate:modelValue": C[2] || (C[2] = (Z) => c(Z)),
1262
+ onDelete: C[3] || (C[3] = (Z) => _(Z))
1263
+ }, null, 8, ["model-value", "display-name", "unit", "show-error", "able-to-apply-rules", "able-to-configure-alternative", "readonly", "disabled"]))
1264
+ ], 64);
1240
1265
  }), 128))
1241
1266
  ])
1242
1267
  ])
1243
1268
  ]);
1244
1269
  };
1245
1270
  }
1246
- }), to = { class: "flex flex-col gap-40" }, no = {
1271
+ }), lo = { class: "flex flex-col gap-40" }, ro = {
1247
1272
  key: 0,
1248
1273
  class: "flex flex-col gap-16"
1249
- }, oo = {
1274
+ }, ao = {
1250
1275
  key: 0,
1251
1276
  class: "col-span-2 mt-16 border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
1252
- }, io = {
1277
+ }, so = {
1253
1278
  key: 0,
1254
1279
  class: "flex flex-col items-center w-full h-full gap-24"
1255
- }, lo = { key: 1 }, ao = { class: "mt-32" }, ro = /* @__PURE__ */ ie({
1280
+ }, uo = { key: 1 }, co = { class: "mt-32" }, po = /* @__PURE__ */ le({
1256
1281
  __name: "RecipeForm",
1257
1282
  props: {
1258
1283
  mode: {},
@@ -1261,14 +1286,14 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1261
1286
  },
1262
1287
  emits: ["update:modelValue", "click:submit"],
1263
1288
  setup(m, { expose: d, emit: l }) {
1264
- const t = m, i = l, a = We(), { t: h } = oe(), u = R({
1289
+ const t = m, i = l, r = We(), { t: x } = ie(), u = R({
1265
1290
  get() {
1266
1291
  var c;
1267
1292
  return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
1268
1293
  },
1269
1294
  set(c) {
1270
- const g = t.modelValue ?? {};
1271
- g.name = c, i("update:modelValue", g);
1295
+ const _ = t.modelValue ?? {};
1296
+ _.name = c, i("update:modelValue", _);
1272
1297
  }
1273
1298
  }), o = R({
1274
1299
  get() {
@@ -1276,8 +1301,8 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1276
1301
  return ((c = t.modelValue) == null ? void 0 : c.contains) ?? [];
1277
1302
  },
1278
1303
  set(c) {
1279
- const g = t.modelValue ?? {};
1280
- g.contains = c, i("update:modelValue", g);
1304
+ const _ = t.modelValue ?? {};
1305
+ _.contains = c, i("update:modelValue", _);
1281
1306
  }
1282
1307
  }), s = R({
1283
1308
  get() {
@@ -1285,151 +1310,151 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1285
1310
  return ((c = t.modelValue) == null ? void 0 : c.customAttributes) ?? {};
1286
1311
  },
1287
1312
  set(c) {
1288
- const g = t.modelValue ? {
1313
+ const _ = t.modelValue ? {
1289
1314
  ...t.modelValue
1290
1315
  } : {};
1291
- g.customAttributes = c, i("update:modelValue", g);
1316
+ _.customAttributes = c, i("update:modelValue", _);
1292
1317
  }
1293
- }), r = R({
1318
+ }), a = R({
1294
1319
  get() {
1295
1320
  var c;
1296
1321
  return ((c = t.modelValue) == null ? void 0 : c.version) ?? null;
1297
1322
  },
1298
1323
  set(c) {
1299
- const g = t.modelValue ? { ...t.modelValue } : {};
1300
- g.version = c, i("update:modelValue", g);
1324
+ const _ = t.modelValue ? { ...t.modelValue } : {};
1325
+ _.version = c, i("update:modelValue", _);
1301
1326
  }
1302
1327
  }), p = R({
1303
1328
  get() {
1304
- return r.value === "v2";
1329
+ return a.value === "v2";
1305
1330
  },
1306
1331
  set(c) {
1307
- r.value = c ? "v2" : null;
1332
+ a.value = c ? "v2" : null;
1308
1333
  }
1309
1334
  });
1310
1335
  function $() {
1311
1336
  i("click:submit");
1312
1337
  }
1313
- const C = K();
1338
+ const B = W();
1314
1339
  d({
1315
1340
  validateInputs: () => {
1316
- var c, g;
1317
- (g = (c = C.value) == null ? void 0 : c.validateInputs) == null || g.call(c);
1341
+ var c, _;
1342
+ (_ = (c = B.value) == null ? void 0 : c.validateInputs) == null || _.call(c);
1318
1343
  },
1319
1344
  resetInputsValidation: () => {
1320
- var c, g;
1321
- (g = (c = C.value) == null ? void 0 : c.resetInputsValidation) == null || g.call(c);
1345
+ var c, _;
1346
+ (_ = (c = B.value) == null ? void 0 : c.resetInputsValidation) == null || _.call(c);
1322
1347
  },
1323
1348
  resetInputs: () => {
1324
- var c, g;
1325
- (g = (c = C.value) == null ? void 0 : c.resetInputs) == null || g.call(c);
1349
+ var c, _;
1350
+ (_ = (c = B.value) == null ? void 0 : c.resetInputs) == null || _.call(c);
1326
1351
  }
1327
1352
  });
1328
- const I = ne(), f = K([]), _ = K(!1), S = K(!1);
1329
- ue(_, async (c) => {
1330
- v(c);
1353
+ const I = ne(), f = W([]), k = W(!1), S = W(!1);
1354
+ ue(k, async (c) => {
1355
+ y(c);
1331
1356
  });
1332
- async function v(c) {
1333
- var g, z;
1334
- c && !S.value && ((g = t.modelValue) != null && g._id) && (S.value = !0, f.value = await I.getAffectedMenu((z = t.modelValue) == null ? void 0 : z._id).delayed(500), S.value = !1);
1357
+ async function y(c) {
1358
+ var _, N;
1359
+ c && !S.value && ((_ = t.modelValue) != null && _._id) && (S.value = !0, f.value = await I.getAffectedMenu((N = t.modelValue) == null ? void 0 : N._id).delayed(500), S.value = !1);
1335
1360
  }
1336
1361
  const e = R(
1337
1362
  () => I.recipes.map((c) => ({ label: c.name, value: c.name }))
1338
- ), V = R(() => {
1363
+ ), E = R(() => {
1339
1364
  var c;
1340
1365
  return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
1341
1366
  });
1342
- return (c, g) => {
1343
- const z = G("FmTextField"), x = G("FmSwitch"), w = G("FmCard"), F = G("FmSpacer"), N = G("FmCircularProgress"), T = G("FmForm");
1344
- return b(), Y(T, {
1367
+ return (c, _) => {
1368
+ const N = G("FmTextField"), z = G("FmSwitch"), g = G("FmCard"), C = G("FmSpacer"), F = G("FmCircularProgress"), A = G("FmForm");
1369
+ return b(), Y(A, {
1345
1370
  ref_key: "formRef",
1346
- ref: C,
1371
+ ref: B,
1347
1372
  onValidationSuccess: $
1348
1373
  }, {
1349
1374
  default: J(() => [
1350
- y("div", to, [
1351
- k(z, {
1375
+ v("div", lo, [
1376
+ h(N, {
1352
1377
  disabled: c.disabled,
1353
- label: n(h)("inventory.recipe.name"),
1378
+ label: n(x)("inventory.recipe.name"),
1354
1379
  "model-value": u.value,
1355
- "onUpdate:modelValue": g[0] || (g[0] = (P) => u.value = P),
1380
+ "onUpdate:modelValue": _[0] || (_[0] = (P) => u.value = P),
1356
1381
  rules: [
1357
1382
  n(Rt)(),
1358
- n(lt)(e.value, V.value, (P) => `[${P.value}] already exists`)
1383
+ n(lt)(e.value, E.value, (P) => `[${P.value}] already exists`)
1359
1384
  ],
1360
1385
  "label-mark": "required"
1361
1386
  }, null, 8, ["disabled", "label", "model-value", "rules"]),
1362
- n(a).enableRecipeV2 ? (b(), B("div", no, [
1363
- k(x, {
1387
+ n(r).enableRecipeV2 ? (b(), V("div", ro, [
1388
+ h(z, {
1364
1389
  modelValue: p.value,
1365
- "onUpdate:modelValue": g[1] || (g[1] = (P) => p.value = P),
1390
+ "onUpdate:modelValue": _[1] || (_[1] = (P) => p.value = P),
1366
1391
  value: !0,
1367
- label: n(h)("inventory.recipe.enableRecipeV2"),
1392
+ label: n(x)("inventory.recipe.enableRecipeV2"),
1368
1393
  "label-placement": "right",
1369
1394
  disabled: c.disabled,
1370
- sublabel: n(h)("inventory.recipe.recipeV2Warning")
1395
+ sublabel: n(x)("inventory.recipe.recipeV2Warning")
1371
1396
  }, null, 8, ["modelValue", "label", "disabled", "sublabel"])
1372
- ])) : U("", !0),
1373
- k(w, {
1397
+ ])) : T("", !0),
1398
+ h(g, {
1374
1399
  variant: "outlined",
1375
1400
  class: "p-16"
1376
1401
  }, {
1377
1402
  default: J(() => {
1378
- var P, W;
1403
+ var P, K;
1379
1404
  return [
1380
- n(a).enableRecipeV2 ? (b(), Y(eo, {
1405
+ n(r).enableRecipeV2 ? (b(), Y(io, {
1381
1406
  key: 0,
1382
1407
  id: (P = c.modelValue) == null ? void 0 : P._id,
1383
1408
  disabled: c.disabled,
1384
1409
  "model-value": o.value,
1385
- "onUpdate:modelValue": g[2] || (g[2] = (H) => o.value = H),
1410
+ "onUpdate:modelValue": _[2] || (_[2] = (H) => o.value = H),
1386
1411
  rules: [n(Ne)(1)],
1387
- "enable-ingredient-group": n(a).enableIngredientGroup,
1412
+ "enable-ingredient-group": n(r).enableIngredientGroup,
1388
1413
  "recipe-binding-config": { enabled: !p.value, ableToApplyRules: p.value },
1389
1414
  "sku-binding-config": {
1390
1415
  ableToConfigureAlternative: p.value
1391
1416
  }
1392
1417
  }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (b(), Y(At, {
1393
1418
  key: 1,
1394
- id: (W = c.modelValue) == null ? void 0 : W._id,
1419
+ id: (K = c.modelValue) == null ? void 0 : K._id,
1395
1420
  disabled: c.disabled,
1396
1421
  "model-value": o.value,
1397
- "onUpdate:modelValue": g[3] || (g[3] = (H) => o.value = H),
1422
+ "onUpdate:modelValue": _[3] || (_[3] = (H) => o.value = H),
1398
1423
  rules: [n(Ne)(1)],
1399
- "enable-ingredient-group": n(a).enableIngredientGroup
1424
+ "enable-ingredient-group": n(r).enableIngredientGroup
1400
1425
  }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group"]))
1401
1426
  ];
1402
1427
  }),
1403
1428
  _: 1
1404
1429
  })
1405
1430
  ]),
1406
- c.mode !== n(se).CREATE ? (b(), B("div", oo, [
1407
- k(x, {
1431
+ c.mode !== n(se).CREATE ? (b(), V("div", ao, [
1432
+ h(z, {
1408
1433
  label: "Show binded items",
1409
- modelValue: _.value,
1410
- "onUpdate:modelValue": g[4] || (g[4] = (P) => _.value = P),
1434
+ modelValue: k.value,
1435
+ "onUpdate:modelValue": _[4] || (_[4] = (P) => k.value = P),
1411
1436
  "label-placement": "right",
1412
1437
  disabled: S.value
1413
1438
  }, null, 8, ["modelValue", "disabled"]),
1414
- S.value ? (b(), B("div", io, [
1415
- k(F),
1416
- y("div", null, [
1417
- k(N, { size: "xl" })
1439
+ S.value ? (b(), V("div", so, [
1440
+ h(C),
1441
+ v("div", null, [
1442
+ h(F, { size: "xl" })
1418
1443
  ]),
1419
- g[6] || (g[6] = y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
1420
- k(F)
1421
- ])) : _.value && f.value.length ? (b(), B("div", lo, [
1422
- k(nt, {
1444
+ _[6] || (_[6] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
1445
+ h(C)
1446
+ ])) : k.value && f.value.length ? (b(), V("div", uo, [
1447
+ h(nt, {
1423
1448
  name: "Menu",
1424
1449
  bindings: f.value
1425
1450
  }, null, 8, ["bindings"])
1426
- ])) : U("", !0)
1427
- ])) : U("", !0),
1428
- y("div", ao, [
1429
- k(Ot, {
1451
+ ])) : T("", !0)
1452
+ ])) : T("", !0),
1453
+ v("div", co, [
1454
+ h(Ot, {
1430
1455
  entity: "inventoryRecipe",
1431
1456
  modelValue: s.value,
1432
- "onUpdate:modelValue": g[5] || (g[5] = (P) => s.value = P)
1457
+ "onUpdate:modelValue": _[5] || (_[5] = (P) => s.value = P)
1433
1458
  }, null, 8, ["modelValue"])
1434
1459
  ])
1435
1460
  ]),
@@ -1437,7 +1462,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1437
1462
  }, 512);
1438
1463
  };
1439
1464
  }
1440
- }), so = { class: "flex gap-4" }, uo = /* @__PURE__ */ ie({
1465
+ }), mo = { class: "flex gap-4" }, fo = /* @__PURE__ */ le({
1441
1466
  __name: "RecipeDialog",
1442
1467
  props: {
1443
1468
  show: { type: Boolean },
@@ -1446,7 +1471,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1446
1471
  },
1447
1472
  emits: ["update:show"],
1448
1473
  setup(m) {
1449
- const d = m, l = ne(), t = je(), { t: i } = oe(), a = Ge(d, "show"), h = Ge(d, "recipe"), u = R(() => {
1474
+ const d = m, l = ne(), t = je(), { t: i } = ie(), r = Ge(d, "show"), x = Ge(d, "recipe"), u = R(() => {
1450
1475
  switch (d.mode) {
1451
1476
  case se.READ:
1452
1477
  return "";
@@ -1466,14 +1491,14 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1466
1491
  return i("common.add");
1467
1492
  }
1468
1493
  return "";
1469
- }), s = K(), r = K(!1);
1494
+ }), s = W(), a = W(!1);
1470
1495
  async function p() {
1471
- r.value = !0;
1496
+ a.value = !0;
1472
1497
  try {
1473
- const f = Oe(h.value);
1474
- f.precision ?? (f.precision = 0), f.measurements ?? (f.measurements = []), await l.createRecipe(f), a.value = !1, t.open({
1498
+ const f = Oe(x.value);
1499
+ f.precision ?? (f.precision = 0), f.measurements ?? (f.measurements = []), await l.createRecipe(f), r.value = !1, t.open({
1475
1500
  title: i("inventory.common.success"),
1476
- message: i("inventory.recipe.create.success", { name: h.value.name }),
1501
+ message: i("inventory.recipe.create.success", { name: x.value.name }),
1477
1502
  type: "success"
1478
1503
  });
1479
1504
  } catch (f) {
@@ -1483,15 +1508,15 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1483
1508
  type: "error"
1484
1509
  });
1485
1510
  } finally {
1486
- r.value = !1;
1511
+ a.value = !1;
1487
1512
  }
1488
1513
  }
1489
1514
  async function $() {
1490
- r.value = !0;
1515
+ a.value = !0;
1491
1516
  try {
1492
- await l.updateRecipe(h.value), a.value = !1, t.open({
1517
+ await l.updateRecipe(x.value), r.value = !1, t.open({
1493
1518
  title: i("inventory.common.success"),
1494
- message: i("inventory.recipe.update.success", { name: h.value.name }),
1519
+ message: i("inventory.recipe.update.success", { name: x.value.name }),
1495
1520
  type: "success"
1496
1521
  });
1497
1522
  } catch (f) {
@@ -1501,12 +1526,12 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1501
1526
  type: "error"
1502
1527
  });
1503
1528
  } finally {
1504
- r.value = !1;
1529
+ a.value = !1;
1505
1530
  }
1506
1531
  }
1507
- function C() {
1508
- var f, _;
1509
- (_ = (f = s.value) == null ? void 0 : f.validateInputs) == null || _.call(f);
1532
+ function B() {
1533
+ var f, k;
1534
+ (k = (f = s.value) == null ? void 0 : f.validateInputs) == null || k.call(f);
1510
1535
  }
1511
1536
  function I() {
1512
1537
  switch (d.mode) {
@@ -1518,41 +1543,41 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1518
1543
  return p();
1519
1544
  }
1520
1545
  }
1521
- return (f, _) => {
1522
- const S = G("FmButton"), v = G("FmSideSheet");
1523
- return b(), Y(v, {
1524
- "model-value": n(a),
1525
- "onUpdate:modelValue": _[3] || (_[3] = (e) => De(a) ? a.value = e : null),
1546
+ return (f, k) => {
1547
+ const S = G("FmButton"), y = G("FmSideSheet");
1548
+ return b(), Y(y, {
1549
+ "model-value": n(r),
1550
+ "onUpdate:modelValue": k[3] || (k[3] = (e) => De(r) ? r.value = e : null),
1526
1551
  header: u.value,
1527
1552
  "close-button": "",
1528
1553
  "dismiss-away": "",
1529
1554
  "max-width": 800
1530
1555
  }, {
1531
1556
  "side-sheet-footer": J(() => [
1532
- y("div", so, [
1533
- k(S, {
1534
- loading: r.value,
1557
+ v("div", mo, [
1558
+ h(S, {
1559
+ loading: a.value,
1535
1560
  label: o.value,
1536
- onClick: C
1561
+ onClick: B
1537
1562
  }, null, 8, ["loading", "label"]),
1538
- k(S, {
1539
- disabled: r.value,
1563
+ h(S, {
1564
+ disabled: a.value,
1540
1565
  label: n(i)("common.close"),
1541
1566
  variant: "tertiary",
1542
- onClick: _[2] || (_[2] = (e) => a.value = !1)
1567
+ onClick: k[2] || (k[2] = (e) => r.value = !1)
1543
1568
  }, null, 8, ["disabled", "label"])
1544
1569
  ])
1545
1570
  ]),
1546
1571
  default: J(() => [
1547
- k(ro, {
1572
+ h(po, {
1548
1573
  class: "w-full",
1549
1574
  ref_key: "hasValidationExpose",
1550
1575
  ref: s,
1551
- modelValue: n(h),
1552
- "onUpdate:modelValue": _[0] || (_[0] = (e) => De(h) ? h.value = e : null),
1576
+ modelValue: n(x),
1577
+ "onUpdate:modelValue": k[0] || (k[0] = (e) => De(x) ? x.value = e : null),
1553
1578
  mode: f.mode,
1554
- disabled: r.value,
1555
- "onClick:submit": _[1] || (_[1] = (e) => I())
1579
+ disabled: a.value,
1580
+ "onClick:submit": k[1] || (k[1] = (e) => I())
1556
1581
  }, null, 8, ["modelValue", "mode", "disabled"])
1557
1582
  ]),
1558
1583
  _: 1
@@ -1568,14 +1593,14 @@ function ke(m, d, l) {
1568
1593
  else if (i.type === be.enum.SKU_GROUP)
1569
1594
  t.push({ ...i, isGroup: !0, recipeIds: [...d] });
1570
1595
  else if (i.type === be.enum.RECIPE) {
1571
- const a = l[i.id];
1572
- a && !d.has(i.id) && t.push(
1573
- ...ke(a.contains, /* @__PURE__ */ new Set([...d, i.id]), l)
1596
+ const r = l[i.id];
1597
+ r && !d.has(i.id) && t.push(
1598
+ ...ke(r.contains, /* @__PURE__ */ new Set([...d, i.id]), l)
1574
1599
  );
1575
1600
  }
1576
1601
  return t;
1577
1602
  }
1578
- function co(m, d) {
1603
+ function vo(m, d) {
1579
1604
  return he.equal(m, d);
1580
1605
  }
1581
1606
  function Ae(m) {
@@ -1596,115 +1621,115 @@ function Xe(m) {
1596
1621
  return m.measurement ? he.multiplyDecimal(m.amount, m.measurement.conversion) : m.amount;
1597
1622
  }
1598
1623
  function Me(m, d) {
1599
- var i, a;
1600
- if (m.type !== d.type || m.id !== d.id || !co(Xe(m), Xe(d))) return !1;
1601
- const l = ((i = m.measurement) == null ? void 0 : i.id) ?? null, t = ((a = d.measurement) == null ? void 0 : a.id) ?? null;
1624
+ var i, r;
1625
+ if (m.type !== d.type || m.id !== d.id || !vo(Xe(m), Xe(d))) return !1;
1626
+ const l = ((i = m.measurement) == null ? void 0 : i.id) ?? null, t = ((r = d.measurement) == null ? void 0 : r.id) ?? null;
1602
1627
  return !(l !== t || Ae(m.rules) !== Ae(d.rules) || Te(m.alternatives) !== Te(d.alternatives));
1603
1628
  }
1604
1629
  function Ze(m, d) {
1605
1630
  return m.type === d.type && m.id === d.id;
1606
1631
  }
1607
- function po(m, d) {
1632
+ function yo(m, d) {
1608
1633
  const l = [];
1609
1634
  let t = [...m.contains];
1610
- for (const a of d)
1611
- switch (a.type) {
1635
+ for (const r of d)
1636
+ switch (r.type) {
1612
1637
  case "remove-binding": {
1613
- const h = t.findIndex(
1614
- (u) => u.type === a.target.type && u.id === a.target.id
1638
+ const x = t.findIndex(
1639
+ (u) => u.type === r.target.type && u.id === r.target.id
1615
1640
  );
1616
- h === -1 ? l.push({ change: a, outcome: "ignored", reason: "Source binding not found in target" }) : (t = [...t.slice(0, h), ...t.slice(h + 1)], l.push({ change: a, outcome: "applied" }));
1641
+ x === -1 ? l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" }) : (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied" }));
1617
1642
  break;
1618
1643
  }
1619
1644
  case "add-binding": {
1620
- if (t.find((o) => Me(o, a.binding))) {
1621
- l.push({ change: a, outcome: "already-satisfied", reason: "Exact binding already present" });
1645
+ if (t.find((o) => Me(o, r.binding))) {
1646
+ l.push({ change: r, outcome: "already-satisfied", reason: "Exact binding already present" });
1622
1647
  break;
1623
1648
  }
1624
- if (t.find((o) => Ze(o, a.binding))) {
1625
- l.push({ change: a, outcome: "blocked", reason: "A similar but non-exact binding already exists" });
1649
+ if (t.find((o) => Ze(o, r.binding))) {
1650
+ l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact binding already exists" });
1626
1651
  break;
1627
1652
  }
1628
- if (m.version === "v2" && a.binding.type === "RECIPE") {
1629
- l.push({ change: a, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1653
+ if (m.version === "v2" && r.binding.type === "RECIPE") {
1654
+ l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1630
1655
  break;
1631
1656
  }
1632
- if (m.version !== "v2" && (a.binding.alternatives ?? []).length > 0) {
1633
- l.push({ change: a, outcome: "blocked", reason: "Cannot add a binding with alternatives to a non-V2 recipe" });
1657
+ if (m.version !== "v2" && (r.binding.alternatives ?? []).length > 0) {
1658
+ l.push({ change: r, outcome: "blocked", reason: "Cannot add a binding with alternatives to a non-V2 recipe" });
1634
1659
  break;
1635
1660
  }
1636
- t = [...t, a.binding], l.push({ change: a, outcome: "applied" });
1661
+ t = [...t, r.binding], l.push({ change: r, outcome: "applied" });
1637
1662
  break;
1638
1663
  }
1639
1664
  case "replace-binding": {
1640
- const h = t.findIndex(
1641
- (s) => s.type === a.from.type && s.id === a.from.id
1642
- ), u = t.find((s) => Me(s, a.to)), o = t.find((s, r) => r !== h && Ze(s, a.to) && !Me(s, a.to));
1643
- if (h === -1) {
1644
- u ? l.push({ change: a, outcome: "already-satisfied", reason: "Target already has exact replacement" }) : l.push({ change: a, outcome: "ignored", reason: "Source binding not found in target" });
1665
+ const x = t.findIndex(
1666
+ (s) => s.type === r.from.type && s.id === r.from.id
1667
+ ), u = t.find((s) => Me(s, r.to)), o = t.find((s, a) => a !== x && Ze(s, r.to) && !Me(s, r.to));
1668
+ if (x === -1) {
1669
+ u ? l.push({ change: r, outcome: "already-satisfied", reason: "Target already has exact replacement" }) : l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" });
1645
1670
  break;
1646
1671
  }
1647
- if (m.version === "v2" && a.to.type === "RECIPE") {
1648
- l.push({ change: a, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1672
+ if (m.version === "v2" && r.to.type === "RECIPE") {
1673
+ l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1649
1674
  break;
1650
1675
  }
1651
- if (m.version !== "v2" && (a.to.alternatives ?? []).length > 0) {
1652
- l.push({ change: a, outcome: "blocked", reason: "Cannot apply a binding with alternatives to a non-V2 recipe" });
1676
+ if (m.version !== "v2" && (r.to.alternatives ?? []).length > 0) {
1677
+ l.push({ change: r, outcome: "blocked", reason: "Cannot apply a binding with alternatives to a non-V2 recipe" });
1653
1678
  break;
1654
1679
  }
1655
1680
  if (o) {
1656
- l.push({ change: a, outcome: "blocked", reason: "A similar but non-exact replacement binding already exists" });
1681
+ l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact replacement binding already exists" });
1657
1682
  break;
1658
1683
  }
1659
- u ? (t = [...t.slice(0, h), ...t.slice(h + 1)], l.push({ change: a, outcome: "applied", reason: "Source removed; replacement already present" })) : (t = [
1660
- ...t.slice(0, h),
1661
- a.to,
1662
- ...t.slice(h + 1)
1663
- ], l.push({ change: a, outcome: "applied" }));
1684
+ u ? (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied", reason: "Source removed; replacement already present" })) : (t = [
1685
+ ...t.slice(0, x),
1686
+ r.to,
1687
+ ...t.slice(x + 1)
1688
+ ], l.push({ change: r, outcome: "applied" }));
1664
1689
  break;
1665
1690
  }
1666
1691
  case "update-binding-rule": {
1667
- const h = t.findIndex(
1668
- (r) => r.type === a.target.type && r.id === a.target.id
1692
+ const x = t.findIndex(
1693
+ (a) => a.type === r.target.type && a.id === r.target.id
1669
1694
  );
1670
- if (h === -1) {
1671
- l.push({ change: a, outcome: "ignored", reason: "Binding not found in target" });
1695
+ if (x === -1) {
1696
+ l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
1672
1697
  break;
1673
1698
  }
1674
- const u = t[h], o = u.rules ?? null, s = a.rule ?? null;
1699
+ const u = t[x], o = u.rules ?? null, s = r.rule ?? null;
1675
1700
  if (Ae(o) === Ae(s)) {
1676
- l.push({ change: a, outcome: "already-satisfied", reason: "Rule already matches" });
1701
+ l.push({ change: r, outcome: "already-satisfied", reason: "Rule already matches" });
1677
1702
  break;
1678
1703
  }
1679
1704
  t = [
1680
- ...t.slice(0, h),
1705
+ ...t.slice(0, x),
1681
1706
  { ...u, rules: s },
1682
- ...t.slice(h + 1)
1683
- ], l.push({ change: a, outcome: "applied" });
1707
+ ...t.slice(x + 1)
1708
+ ], l.push({ change: r, outcome: "applied" });
1684
1709
  break;
1685
1710
  }
1686
1711
  case "update-alternatives": {
1687
1712
  if (m.version !== "v2") {
1688
- l.push({ change: a, outcome: "blocked", reason: "Cannot update alternatives on a non-V2 recipe" });
1713
+ l.push({ change: r, outcome: "blocked", reason: "Cannot update alternatives on a non-V2 recipe" });
1689
1714
  break;
1690
1715
  }
1691
- const h = t.findIndex(
1692
- (r) => r.type === a.target.type && r.id === a.target.id
1716
+ const x = t.findIndex(
1717
+ (a) => a.type === r.target.type && a.id === r.target.id
1693
1718
  );
1694
- if (h === -1) {
1695
- l.push({ change: a, outcome: "ignored", reason: "Binding not found in target" });
1719
+ if (x === -1) {
1720
+ l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
1696
1721
  break;
1697
1722
  }
1698
- const u = t[h], o = Te(u.alternatives), s = Te(a.alternatives);
1723
+ const u = t[x], o = Te(u.alternatives), s = Te(r.alternatives);
1699
1724
  if (o === s) {
1700
- l.push({ change: a, outcome: "already-satisfied", reason: "Alternatives already match" });
1725
+ l.push({ change: r, outcome: "already-satisfied", reason: "Alternatives already match" });
1701
1726
  break;
1702
1727
  }
1703
1728
  t = [
1704
- ...t.slice(0, h),
1705
- { ...u, alternatives: a.alternatives },
1706
- ...t.slice(h + 1)
1707
- ], l.push({ change: a, outcome: "applied" });
1729
+ ...t.slice(0, x),
1730
+ { ...u, alternatives: r.alternatives },
1731
+ ...t.slice(x + 1)
1732
+ ], l.push({ change: r, outcome: "applied" });
1708
1733
  break;
1709
1734
  }
1710
1735
  }
@@ -1724,17 +1749,17 @@ function et(m) {
1724
1749
  return m.target.id !== "";
1725
1750
  }
1726
1751
  }
1727
- function mo(m) {
1752
+ function bo(m) {
1728
1753
  if (m.length === 0) return "no-applicable-changes";
1729
1754
  let d = 0, l = 0, t = 0, i = 0;
1730
- for (const a of m)
1731
- a.outcome === "applied" ? d++ : a.outcome === "blocked" ? l++ : a.outcome === "ignored" ? t++ : a.outcome === "already-satisfied" && i++;
1755
+ for (const r of m)
1756
+ r.outcome === "applied" ? d++ : r.outcome === "blocked" ? l++ : r.outcome === "ignored" ? t++ : r.outcome === "already-satisfied" && i++;
1732
1757
  return l > 0 && d === 0 ? "blocked" : i === m.length ? "already-satisfied" : d > 0 && (t > 0 || l > 0) ? "partially-ignored" : d > 0 ? "will-update" : "no-applicable-changes";
1733
1758
  }
1734
- let fo = 0;
1735
- function vo(m = null) {
1759
+ let go = 0;
1760
+ function _o(m = null) {
1736
1761
  return {
1737
- id: String(++fo),
1762
+ id: String(++go),
1738
1763
  type: m,
1739
1764
  itemId: null,
1740
1765
  amountModel: ye()
@@ -1745,60 +1770,60 @@ function ut(m, d, l, t) {
1745
1770
  if (i.type === "RECIPE") {
1746
1771
  if (i.id === d) return !0;
1747
1772
  if (!l.has(i.id)) {
1748
- const a = t[i.id];
1749
- if (a && ut(a.contains, d, /* @__PURE__ */ new Set([...l, i.id]), t))
1773
+ const r = t[i.id];
1774
+ if (r && ut(r.contains, d, /* @__PURE__ */ new Set([...l, i.id]), t))
1750
1775
  return !0;
1751
1776
  }
1752
1777
  }
1753
1778
  return !1;
1754
1779
  }
1755
1780
  const ge = ot("recipeBulkEditor", function() {
1756
- const d = ne(), l = je(), { t } = oe(), i = K(!1), a = K(1), h = K(null), u = K(/* @__PURE__ */ new Set()), o = K([]), s = K({}), r = K(!1), p = K(/* @__PURE__ */ new Map()), $ = K(""), C = K([]), I = R(() => {
1757
- let A = d.recipes;
1758
- const L = h.value;
1759
- if (L != null && L.nameSearch) {
1760
- const O = L.nameSearch.trim().toLowerCase();
1761
- O && (A = A.filter((q) => q.name.toLowerCase().includes(O)));
1762
- }
1763
- if (L != null && L.filters && L.filters.length > 0) {
1764
- const O = /* @__PURE__ */ new Map();
1765
- for (const q of A)
1766
- O.set(
1781
+ const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1), x = W(null), u = W(/* @__PURE__ */ new Set()), o = W([]), s = W({}), a = W(!1), p = W(/* @__PURE__ */ new Map()), $ = W(""), B = W([]), I = R(() => {
1782
+ let O = d.recipes;
1783
+ const D = x.value;
1784
+ if (D != null && D.nameSearch) {
1785
+ const L = D.nameSearch.trim().toLowerCase();
1786
+ L && (O = O.filter((q) => q.name.toLowerCase().includes(L)));
1787
+ }
1788
+ if (D != null && D.filters && D.filters.length > 0) {
1789
+ const L = /* @__PURE__ */ new Map();
1790
+ for (const q of O)
1791
+ L.set(
1767
1792
  q._id,
1768
1793
  ke(q.contains, /* @__PURE__ */ new Set([q._id]), d.recipeById)
1769
1794
  );
1770
- for (const q of L.filters)
1795
+ for (const q of D.filters)
1771
1796
  if (q.type === "ingredient") {
1772
- const { itemId: le, amount: ee, measurementId: re } = q;
1773
- A = A.filter((fe) => (O.get(fe._id) ?? []).some((ae) => {
1797
+ const { itemId: oe, amount: Z, measurementId: ae } = q;
1798
+ O = O.filter((fe) => (L.get(fe._id) ?? []).some((re) => {
1774
1799
  var ce;
1775
- if (ae.type !== "SKU" || ae.id !== le) return !1;
1776
- if (ae.recipeIds.length === 1) {
1777
- if (ee != null) {
1778
- const Ue = ae.measurement ? he.multiplyDecimal(ae.amount, ae.measurement.conversion) : ae.amount;
1779
- if (!he.equal(Ue, ee)) return !1;
1800
+ if (re.type !== "SKU" || re.id !== oe) return !1;
1801
+ if (re.recipeIds.length === 1) {
1802
+ if (Z != null) {
1803
+ const Ue = re.measurement ? he.multiplyDecimal(re.amount, re.measurement.conversion) : re.amount;
1804
+ if (!he.equal(Ue, Z)) return !1;
1780
1805
  }
1781
- if (re != null && (((ce = ae.measurement) == null ? void 0 : ce.id) ?? null) !== re)
1806
+ if (ae != null && (((ce = re.measurement) == null ? void 0 : ce.id) ?? null) !== ae)
1782
1807
  return !1;
1783
1808
  }
1784
1809
  return !0;
1785
1810
  }));
1786
1811
  } else if (q.type === "recipe") {
1787
- const le = q.itemId;
1788
- A = A.filter(
1789
- (ee) => ut(ee.contains, le, /* @__PURE__ */ new Set([ee._id]), d.recipeById)
1812
+ const oe = q.itemId;
1813
+ O = O.filter(
1814
+ (Z) => ut(Z.contains, oe, /* @__PURE__ */ new Set([Z._id]), d.recipeById)
1790
1815
  );
1791
1816
  }
1792
1817
  }
1793
- return A;
1818
+ return O;
1794
1819
  }), f = R(
1795
- () => I.value.filter((A) => !u.value.has(A._id))
1796
- ), _ = R(() => f.value.length > 0), S = R(() => {
1797
- const A = o.value.filter(et);
1798
- if (A.length === 0) {
1799
- const O = {};
1820
+ () => I.value.filter((O) => !u.value.has(O._id))
1821
+ ), k = R(() => f.value.length > 0), S = R(() => {
1822
+ const O = o.value.filter(et);
1823
+ if (O.length === 0) {
1824
+ const L = {};
1800
1825
  for (const q of f.value)
1801
- O[q._id] = {
1826
+ L[q._id] = {
1802
1827
  recipeId: q._id,
1803
1828
  recipeName: q.name,
1804
1829
  original: q,
@@ -1807,90 +1832,90 @@ const ge = ot("recipeBulkEditor", function() {
1807
1832
  changes: [],
1808
1833
  counts: { applied: 0, ignored: 0, blocked: 0, satisfied: 0 }
1809
1834
  };
1810
- return O;
1811
- }
1812
- const L = {};
1813
- for (const O of f.value) {
1814
- const q = JSON.parse(JSON.stringify(O)), { projected: le, results: ee } = po(q, A), re = mo(ee);
1815
- let fe = 0, xe = 0, ae = 0, ve = 0;
1816
- for (const ce of ee)
1817
- ce.outcome === "applied" ? fe++ : ce.outcome === "ignored" ? xe++ : ce.outcome === "blocked" ? ae++ : ce.outcome === "already-satisfied" && ve++;
1818
- L[O._id] = {
1819
- recipeId: O._id,
1820
- recipeName: O.name,
1835
+ return L;
1836
+ }
1837
+ const D = {};
1838
+ for (const L of f.value) {
1839
+ const q = JSON.parse(JSON.stringify(L)), { projected: oe, results: Z } = yo(q, O), ae = bo(Z);
1840
+ let fe = 0, xe = 0, re = 0, ve = 0;
1841
+ for (const ce of Z)
1842
+ ce.outcome === "applied" ? fe++ : ce.outcome === "ignored" ? xe++ : ce.outcome === "blocked" ? re++ : ce.outcome === "already-satisfied" && ve++;
1843
+ D[L._id] = {
1844
+ recipeId: L._id,
1845
+ recipeName: L.name,
1821
1846
  original: q,
1822
- projected: re === "will-update" || re === "partially-ignored" ? le : null,
1823
- status: re,
1824
- changes: ee,
1825
- counts: { applied: fe, ignored: xe, blocked: ae, satisfied: ve }
1847
+ projected: ae === "will-update" || ae === "partially-ignored" ? oe : null,
1848
+ status: ae,
1849
+ changes: Z,
1850
+ counts: { applied: fe, ignored: xe, blocked: re, satisfied: ve }
1826
1851
  };
1827
1852
  }
1828
- return L;
1829
- }), v = R(() => o.value.some(et) ? Object.values(S.value).some(
1830
- (A) => A.status === "will-update" || A.status === "partially-ignored"
1853
+ return D;
1854
+ }), y = R(() => o.value.some(et) ? Object.values(S.value).some(
1855
+ (O) => O.status === "will-update" || O.status === "partially-ignored"
1831
1856
  ) : !1);
1832
1857
  function e() {
1833
1858
  c(), i.value = !0;
1834
1859
  }
1835
- function V() {
1860
+ function E() {
1836
1861
  i.value = !1;
1837
1862
  }
1838
1863
  function c() {
1839
- a.value = 1, h.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, r.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "", C.value = [];
1864
+ r.value = 1, x.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, a.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "", B.value = [];
1840
1865
  }
1841
- function g(A) {
1842
- h.value = A;
1866
+ function _(O) {
1867
+ x.value = O;
1843
1868
  }
1844
- function z(A) {
1845
- const L = new Set(u.value);
1846
- L.add(A), u.value = L;
1869
+ function N(O) {
1870
+ const D = new Set(u.value);
1871
+ D.add(O), u.value = D;
1847
1872
  }
1848
- function x() {
1873
+ function z() {
1849
1874
  u.value = /* @__PURE__ */ new Set();
1850
1875
  }
1851
- function w(A) {
1852
- o.value = [...o.value, A];
1876
+ function g(O) {
1877
+ o.value = [...o.value, O];
1853
1878
  }
1854
- function F(A, L) {
1855
- const O = [...o.value];
1856
- O[A] = L, o.value = O;
1879
+ function C(O, D) {
1880
+ const L = [...o.value];
1881
+ L[O] = D, o.value = L;
1857
1882
  }
1858
- function N(A) {
1859
- o.value = o.value.filter((L, O) => O !== A);
1883
+ function F(O) {
1884
+ o.value = o.value.filter((D, L) => L !== O);
1860
1885
  }
1861
- function T(A, L) {
1862
- const O = [...o.value], [q] = O.splice(A, 1);
1863
- O.splice(L, 0, q), o.value = O;
1886
+ function A(O, D) {
1887
+ const L = [...o.value], [q] = L.splice(O, 1);
1888
+ L.splice(D, 0, q), o.value = L;
1864
1889
  }
1865
1890
  function P() {
1866
- s.value = { ...S.value }, a.value = 3;
1891
+ s.value = { ...S.value }, r.value = 3;
1867
1892
  }
1868
- function W() {
1869
- s.value = {}, a.value = 2;
1893
+ function K() {
1894
+ s.value = {}, r.value = 2;
1870
1895
  }
1871
1896
  function H() {
1872
1897
  return Object.values(s.value).filter(
1873
- (A) => (A.status === "will-update" || A.status === "partially-ignored") && A.projected != null
1874
- ).map((A) => A.projected);
1898
+ (O) => (O.status === "will-update" || O.status === "partially-ignored") && O.projected != null
1899
+ ).map((O) => O.projected);
1875
1900
  }
1876
- async function Z() {
1877
- if (!r.value) {
1878
- r.value = !0, p.value = /* @__PURE__ */ new Map();
1901
+ async function ee() {
1902
+ if (!a.value) {
1903
+ a.value = !0, p.value = /* @__PURE__ */ new Map();
1879
1904
  try {
1880
- const A = H(), L = await d.importRecipes({
1905
+ const O = H(), D = await d.importRecipes({
1881
1906
  create: [],
1882
- update: A
1883
- }), O = (L == null ? void 0 : L.errors) ?? [];
1884
- if (O.length > 0) {
1907
+ update: O
1908
+ }), L = (D == null ? void 0 : D.errors) ?? [];
1909
+ if (L.length > 0) {
1885
1910
  const q = /* @__PURE__ */ new Map();
1886
- for (const { data: le, error: ee } of O) {
1887
- const re = typeof ee == "string" ? ee : (ee == null ? void 0 : ee.message) ?? t("inventory.recipe.bulkEditor.step3.unknownError");
1888
- q.set(le._id, re);
1911
+ for (const { data: oe, error: Z } of L) {
1912
+ const ae = typeof Z == "string" ? Z : (Z == null ? void 0 : Z.message) ?? t("inventory.recipe.bulkEditor.step3.unknownError");
1913
+ q.set(oe._id, ae);
1889
1914
  }
1890
1915
  p.value = q, l.open({
1891
1916
  title: t("inventory.recipe.bulkEditor.step3.partialErrorTitle"),
1892
1917
  message: t("inventory.recipe.bulkEditor.step3.partialErrorMessage", {
1893
- count: O.length
1918
+ count: L.length
1894
1919
  }),
1895
1920
  type: "warning"
1896
1921
  });
@@ -1898,288 +1923,288 @@ const ge = ot("recipeBulkEditor", function() {
1898
1923
  l.open({
1899
1924
  title: t("inventory.recipe.bulkEditor.step3.successTitle"),
1900
1925
  message: t("inventory.recipe.bulkEditor.step3.successMessage", {
1901
- count: A.length
1926
+ count: O.length
1902
1927
  }),
1903
1928
  type: "success"
1904
1929
  }), i.value = !1, c();
1905
- } catch (A) {
1930
+ } catch (O) {
1906
1931
  l.open({
1907
1932
  title: t("inventory.recipe.bulkEditor.step3.errorTitle"),
1908
1933
  message: t("inventory.recipe.bulkEditor.step3.errorMessage"),
1909
1934
  type: "error"
1910
- }), console.error("confirmAndApply failed", A);
1935
+ }), console.error("confirmAndApply failed", O);
1911
1936
  } finally {
1912
- r.value = !1;
1937
+ a.value = !1;
1913
1938
  }
1914
1939
  }
1915
1940
  }
1916
1941
  return {
1917
1942
  // state
1918
1943
  show: i,
1919
- currentStep: a,
1920
- query: h,
1944
+ currentStep: r,
1945
+ query: x,
1921
1946
  excludedRecipeIds: u,
1922
1947
  modifications: o,
1923
1948
  entries: s,
1924
- isSaving: r,
1949
+ isSaving: a,
1925
1950
  applyErrors: p,
1926
1951
  nameSearch: $,
1927
- filterRows: C,
1952
+ filterRows: B,
1928
1953
  // computed
1929
1954
  matchedRecipes: I,
1930
1955
  selectedRecipes: f,
1931
1956
  livePreviewEntries: S,
1932
- canGoToStep2: _,
1933
- canGoToStep3: v,
1957
+ canGoToStep2: k,
1958
+ canGoToStep3: y,
1934
1959
  // actions
1935
1960
  openDialog: e,
1936
- closeDialog: V,
1961
+ closeDialog: E,
1937
1962
  reset: c,
1938
- updateQuery: g,
1939
- removeRecipe: z,
1940
- restoreAllRecipes: x,
1941
- addModification: w,
1942
- updateModification: F,
1943
- removeModification: N,
1944
- reorderModification: T,
1963
+ updateQuery: _,
1964
+ removeRecipe: N,
1965
+ restoreAllRecipes: z,
1966
+ addModification: g,
1967
+ updateModification: C,
1968
+ removeModification: F,
1969
+ reorderModification: A,
1945
1970
  goToStep3: P,
1946
- backToStep2: W,
1971
+ backToStep2: K,
1947
1972
  buildPayload: H,
1948
- confirmAndApply: Z
1973
+ confirmAndApply: ee
1949
1974
  };
1950
- }), yo = { class: "flex flex-col h-full" }, bo = { class: "px-16 pt-16 pb-8 shrink-0 flex items-center justify-between" }, go = { class: "fm-typo-en-heading-sm-700 text-fm-color-typo-primary" }, _o = { class: "px-16 pt-12 pb-16 border-b border-fm-color-border-default bg-fm-color-surface-default flex flex-col gap-12 shrink-0" }, ko = {
1975
+ }), ko = { class: "flex flex-col h-full" }, ho = { class: "px-16 pt-16 pb-8 shrink-0 flex items-center justify-between" }, xo = { class: "fm-typo-en-heading-sm-700 text-fm-color-typo-primary" }, $o = { class: "px-16 pt-12 pb-16 border-b border-fm-color-border-default bg-fm-color-surface-default flex flex-col gap-12 shrink-0" }, Io = {
1951
1976
  key: 0,
1952
1977
  class: "flex flex-wrap items-center gap-8"
1953
- }, ho = {
1978
+ }, wo = {
1954
1979
  type: "button",
1955
1980
  class: "inline-flex items-center gap-4 h-[30px] pl-8 pr-6 rounded-l-md border border-r-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover cursor-pointer select-none transition-colors"
1956
- }, xo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-primary" }, $o = { class: "flex flex-col gap-8 p-12 min-w-[260px]" }, Io = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, wo = {
1981
+ }, Eo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-primary" }, Vo = { class: "flex flex-col gap-8 p-12 min-w-[260px]" }, So = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, Bo = {
1957
1982
  key: 0,
1958
1983
  class: "flex flex-col gap-4"
1959
- }, Eo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Vo = { class: "text-fm-color-typo-placeholder ml-4" }, So = ["title", "onClick"], Bo = { class: "flex-1 overflow-y-auto" }, Co = {
1984
+ }, Co = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Fo = { class: "text-fm-color-typo-placeholder ml-4" }, Ro = ["title", "onClick"], Ao = { class: "flex-1 overflow-y-auto" }, To = {
1960
1985
  key: 0,
1961
1986
  class: "flex flex-col items-center justify-center h-full gap-8 px-24 text-center"
1962
- }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = {
1987
+ }, Uo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Po = {
1963
1988
  key: 1,
1964
1989
  class: "divide-y divide-fm-color-border-default"
1965
- }, Ao = { class: "flex-1 min-w-0" }, To = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary truncate" }, Uo = {
1990
+ }, Mo = { class: "flex-1 min-w-0" }, Do = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary truncate" }, Go = {
1966
1991
  key: 0,
1967
1992
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-1 whitespace-normal break-words"
1968
- }, Po = { class: "flex items-center gap-4 mt-2" }, Mo = /* @__PURE__ */ ie({
1993
+ }, No = { class: "flex items-center gap-4 mt-2" }, zo = /* @__PURE__ */ le({
1969
1994
  __name: "RecipeBulkEditorStep1",
1970
1995
  setup(m) {
1971
- const { t: d } = oe(), l = ne(), t = ge(), i = R({
1996
+ const { t: d } = ie(), l = ne(), t = ge(), i = R({
1972
1997
  get: () => t.nameSearch,
1973
- set: (v) => {
1974
- t.nameSearch = v;
1998
+ set: (y) => {
1999
+ t.nameSearch = y;
1975
2000
  }
1976
- }), a = R(() => t.filterRows), h = K({});
1977
- function u(v) {
1978
- return h.value[v] ?? !1;
2001
+ }), r = R(() => t.filterRows), x = W({});
2002
+ function u(y) {
2003
+ return x.value[y] ?? !1;
1979
2004
  }
1980
- function o(v, e) {
1981
- h.value = { ...h.value, [v]: e };
2005
+ function o(y, e) {
2006
+ x.value = { ...x.value, [y]: e };
1982
2007
  }
1983
2008
  const s = R(
1984
- () => l.skus.map((v) => ({
1985
- label: v.name,
1986
- sublabel: v.code,
1987
- value: v._id
2009
+ () => l.skus.map((y) => ({
2010
+ label: y.name,
2011
+ sublabel: y.code,
2012
+ value: y._id
1988
2013
  }))
1989
- ), r = R(
1990
- () => l.recipes.map((v) => ({
1991
- label: v.name,
1992
- value: v._id
2014
+ ), a = R(
2015
+ () => l.recipes.map((y) => ({
2016
+ label: y.name,
2017
+ value: y._id
1993
2018
  }))
1994
2019
  );
1995
- function p(v) {
1996
- return v.type !== "ingredient" || !v.itemId ? null : l.skuById[v.itemId] ?? null;
2020
+ function p(y) {
2021
+ return y.type !== "ingredient" || !y.itemId ? null : l.skuById[y.itemId] ?? null;
1997
2022
  }
1998
- function $(v) {
2023
+ function $(y) {
1999
2024
  var e;
2000
- if (!v.type) return d("inventory.recipe.bulkEditor.step1.filter");
2001
- if (v.type === "ingredient") {
2002
- if (!v.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2003
- const V = l.skuById[v.itemId];
2004
- if (!V) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2005
- const { amount: c, measurement: g } = v.amountModel;
2006
- if (!(c != null && c.amount > 0)) return V.name;
2007
- const x = (g == null ? void 0 : g.abbrev) ?? ((e = V.unit) == null ? void 0 : e.abbrev) ?? "", w = Q(c);
2008
- return `${V.name} (${w}${x})`;
2025
+ if (!y.type) return d("inventory.recipe.bulkEditor.step1.filter");
2026
+ if (y.type === "ingredient") {
2027
+ if (!y.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2028
+ const E = l.skuById[y.itemId];
2029
+ if (!E) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2030
+ const { amount: c, measurement: _ } = y.amountModel;
2031
+ if (!(c != null && c.amount > 0)) return E.name;
2032
+ const z = (_ == null ? void 0 : _.abbrev) ?? ((e = E.unit) == null ? void 0 : e.abbrev) ?? "", g = Q(c);
2033
+ return `${E.name} (${g}${z})`;
2009
2034
  }
2010
- if (v.type === "recipe") {
2011
- if (!v.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2012
- const V = l.recipeById[v.itemId];
2013
- return V ? V.name : d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2035
+ if (y.type === "recipe") {
2036
+ if (!y.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2037
+ const E = l.recipeById[y.itemId];
2038
+ return E ? E.name : d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2014
2039
  }
2015
2040
  return "";
2016
2041
  }
2017
- function C(v) {
2018
- const e = vo(v);
2042
+ function B(y) {
2043
+ const e = _o(y);
2019
2044
  t.filterRows.push(e), o(e.id, !0);
2020
2045
  }
2021
- function I(v) {
2022
- t.filterRows = t.filterRows.filter((V) => V.id !== v);
2023
- const e = { ...h.value };
2024
- delete e[v], h.value = e;
2046
+ function I(y) {
2047
+ t.filterRows = t.filterRows.filter((E) => E.id !== y);
2048
+ const e = { ...x.value };
2049
+ delete e[y], x.value = e;
2025
2050
  }
2026
- function f(v) {
2027
- v.amountModel = ye(), o(v.id, !0);
2051
+ function f(y) {
2052
+ y.amountModel = ye(), o(y.id, !0);
2028
2053
  }
2029
2054
  ue(
2030
- [i, a],
2055
+ [i, r],
2031
2056
  () => {
2032
- const v = [];
2033
- for (const c of a.value)
2057
+ const y = [];
2058
+ for (const c of r.value)
2034
2059
  if (!(!c.type || !c.itemId))
2035
2060
  if (c.type === "ingredient") {
2036
- const g = p(c), { amount: z, measurement: x } = c.amountModel, w = z != null && z.amount > 0;
2037
- let F, N;
2038
- g && w && (F = x ? he.multiplyDecimal(z, x.conversion) : z, N = (x == null ? void 0 : x.id) ?? null), v.push({
2061
+ const _ = p(c), { amount: N, measurement: z } = c.amountModel, g = N != null && N.amount > 0;
2062
+ let C, F;
2063
+ _ && g && (C = z ? he.multiplyDecimal(N, z.conversion) : N, F = (z == null ? void 0 : z.id) ?? null), y.push({
2039
2064
  id: c.id,
2040
2065
  type: "ingredient",
2041
2066
  itemId: c.itemId,
2042
- amount: F ?? null,
2043
- measurementId: N
2067
+ amount: C ?? null,
2068
+ measurementId: F
2044
2069
  });
2045
- } else c.type === "recipe" && v.push({
2070
+ } else c.type === "recipe" && y.push({
2046
2071
  id: c.id,
2047
2072
  type: "recipe",
2048
2073
  itemId: c.itemId
2049
2074
  });
2050
2075
  t.updateQuery({
2051
2076
  nameSearch: i.value,
2052
- filters: v
2077
+ filters: y
2053
2078
  });
2054
- const e = i.value.trim().length > 0, V = v.length > 0;
2055
- !e && !V && t.restoreAllRecipes();
2079
+ const e = i.value.trim().length > 0, E = y.length > 0;
2080
+ !e && !E && t.restoreAllRecipes();
2056
2081
  },
2057
2082
  { deep: !0, immediate: !0 }
2058
2083
  );
2059
- function _(v) {
2060
- var g, z, x, w;
2061
- if (v.isGroup) {
2062
- const F = l.skuGroupById[v.id];
2063
- if (!F) return null;
2064
- const N = `x${Q(v.amount)}`;
2065
- return v.recipeIds.slice(1).length ? `(${((g = l.recipeById[v.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? ""}) ${F.name} (${N})` : `${F.name} (${N})`;
2084
+ function k(y) {
2085
+ var _, N, z, g;
2086
+ if (y.isGroup) {
2087
+ const C = l.skuGroupById[y.id];
2088
+ if (!C) return null;
2089
+ const F = `x${Q(y.amount)}`;
2090
+ return y.recipeIds.slice(1).length ? `(${((_ = l.recipeById[y.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? ""}) ${C.name} (${F})` : `${C.name} (${F})`;
2066
2091
  }
2067
- const e = l.skuById[v.id];
2092
+ const e = l.skuById[y.id];
2068
2093
  if (!e) return null;
2069
- const V = ((z = v.measurement) == null ? void 0 : z.abbrev) ?? ((x = e.unit) == null ? void 0 : x.abbrev) ?? "", c = `${Q(v.amount)}${V}`;
2070
- return v.recipeIds.slice(1).length ? `(${((w = l.recipeById[v.recipeIds.at(-1) ?? ""]) == null ? void 0 : w.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
2094
+ const E = ((N = y.measurement) == null ? void 0 : N.abbrev) ?? ((z = e.unit) == null ? void 0 : z.abbrev) ?? "", c = `${Q(y.amount)}${E}`;
2095
+ return y.recipeIds.slice(1).length ? `(${((g = l.recipeById[y.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
2071
2096
  }
2072
- function S(v) {
2073
- return ke(v.contains, /* @__PURE__ */ new Set([v._id]), l.recipeById).map(_).filter((e) => e !== null).join(", ");
2097
+ function S(y) {
2098
+ return ke(y.contains, /* @__PURE__ */ new Set([y._id]), l.recipeById).map(k).filter((e) => e !== null).join(", ");
2074
2099
  }
2075
- return (v, e) => {
2076
- const V = G("FmButton"), c = G("FmSearch"), g = G("FmSelect"), z = G("FmPopover"), x = G("FmIcon"), w = G("FmMenuItem"), F = G("FmMenu"), N = G("FmChip");
2077
- return b(), B("div", yo, [
2078
- y("div", bo, [
2079
- y("span", go, D(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
2100
+ return (y, e) => {
2101
+ const E = G("FmButton"), c = G("FmSearch"), _ = G("FmSelect"), N = G("FmPopover"), z = G("FmIcon"), g = G("FmMenuItem"), C = G("FmMenu"), F = G("FmChip");
2102
+ return b(), V("div", ko, [
2103
+ v("div", ho, [
2104
+ v("span", xo, U(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
2080
2105
  count: n(t).selectedRecipes.length
2081
2106
  })), 1),
2082
- n(t).excludedRecipeIds.size > 0 ? (b(), Y(V, {
2107
+ n(t).excludedRecipeIds.size > 0 ? (b(), Y(E, {
2083
2108
  key: 0,
2084
2109
  label: n(d)("inventory.recipe.bulkEditor.step1.restoreAll"),
2085
2110
  variant: "tertiary",
2086
2111
  size: "md",
2087
- onClick: e[0] || (e[0] = (T) => n(t).restoreAllRecipes())
2088
- }, null, 8, ["label"])) : U("", !0)
2112
+ onClick: e[0] || (e[0] = (A) => n(t).restoreAllRecipes())
2113
+ }, null, 8, ["label"])) : T("", !0)
2089
2114
  ]),
2090
- y("div", _o, [
2091
- k(c, {
2115
+ v("div", $o, [
2116
+ h(c, {
2092
2117
  modelValue: i.value,
2093
- "onUpdate:modelValue": e[1] || (e[1] = (T) => i.value = T),
2118
+ "onUpdate:modelValue": e[1] || (e[1] = (A) => i.value = A),
2094
2119
  placeholder: n(d)("inventory.recipe.bulkEditor.query.nameSearchPlaceholder")
2095
2120
  }, null, 8, ["modelValue", "placeholder"]),
2096
- a.value.length > 0 ? (b(), B("div", ko, [
2097
- (b(!0), B(X, null, me(a.value, (T) => (b(), B("div", {
2098
- key: T.id,
2121
+ r.value.length > 0 ? (b(), V("div", Io, [
2122
+ (b(!0), V(X, null, me(r.value, (A) => (b(), V("div", {
2123
+ key: A.id,
2099
2124
  class: "flex items-center"
2100
2125
  }, [
2101
- k(z, {
2102
- "show-popover": u(T.id),
2126
+ h(N, {
2127
+ "show-popover": u(A.id),
2103
2128
  "exclude-el-from-click-outside": ["fm-menu"],
2104
2129
  placement: "bottom-start",
2105
- onPopoverChanged: (P) => o(T.id, P)
2130
+ onPopoverChanged: (P) => o(A.id, P)
2106
2131
  }, {
2107
2132
  "popover-button": J(() => [
2108
- y("button", ho, [
2109
- y("span", xo, D($(T)), 1)
2133
+ v("button", wo, [
2134
+ v("span", Eo, U($(A)), 1)
2110
2135
  ])
2111
2136
  ]),
2112
2137
  default: J(() => [
2113
- y("div", $o, [
2114
- y("p", Io, D(T.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
2115
- T.type === "ingredient" ? (b(), B(X, { key: 0 }, [
2116
- k(g, {
2117
- modelValue: T.itemId,
2118
- "onUpdate:modelValue": [(P) => T.itemId = P, (P) => f(T)],
2138
+ v("div", Vo, [
2139
+ v("p", So, U(A.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
2140
+ A.type === "ingredient" ? (b(), V(X, { key: 0 }, [
2141
+ h(_, {
2142
+ modelValue: A.itemId,
2143
+ "onUpdate:modelValue": [(P) => A.itemId = P, (P) => f(A)],
2119
2144
  items: s.value,
2120
2145
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectIngredient"),
2121
2146
  clearable: ""
2122
2147
  }, {
2123
2148
  "menu-wrapper": J((P) => [
2124
- k(Fe, we({ ref_for: !0 }, P, {
2149
+ h(Fe, we({ ref_for: !0 }, P, {
2125
2150
  items: s.value,
2126
- "model-value": T.itemId
2151
+ "model-value": A.itemId
2127
2152
  }), null, 16, ["items", "model-value"])
2128
2153
  ]),
2129
2154
  _: 2
2130
2155
  }, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"]),
2131
- p(T) ? (b(), B("div", wo, [
2132
- y("span", Eo, [
2133
- mt(D(n(d)("inventory.recipe.bulkEditor.step1.amountLabel")) + " ", 1),
2134
- y("span", Vo, D(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
2156
+ p(A) ? (b(), V("div", Bo, [
2157
+ v("span", Co, [
2158
+ mt(U(n(d)("inventory.recipe.bulkEditor.step1.amountLabel")) + " ", 1),
2159
+ v("span", Fo, U(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
2135
2160
  ]),
2136
- k(Ce, {
2137
- modelValue: T.amountModel,
2138
- "onUpdate:modelValue": (P) => T.amountModel = P,
2139
- unit: p(T).unit,
2161
+ h(Ce, {
2162
+ modelValue: A.amountModel,
2163
+ "onUpdate:modelValue": (P) => A.amountModel = P,
2164
+ unit: p(A).unit,
2140
2165
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.amountPlaceholder"),
2141
2166
  "convert-amount-on-change-unit": ""
2142
2167
  }, null, 8, ["modelValue", "onUpdate:modelValue", "unit", "placeholder"])
2143
- ])) : U("", !0)
2144
- ], 64)) : T.type === "recipe" ? (b(), Y(g, {
2168
+ ])) : T("", !0)
2169
+ ], 64)) : A.type === "recipe" ? (b(), Y(_, {
2145
2170
  key: 1,
2146
- modelValue: T.itemId,
2147
- "onUpdate:modelValue": [(P) => T.itemId = P, (P) => f(T)],
2148
- items: r.value,
2171
+ modelValue: A.itemId,
2172
+ "onUpdate:modelValue": [(P) => A.itemId = P, (P) => f(A)],
2173
+ items: a.value,
2149
2174
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectRecipe"),
2150
2175
  clearable: ""
2151
2176
  }, {
2152
2177
  "menu-wrapper": J((P) => [
2153
- k(Fe, we({ ref_for: !0 }, P, {
2154
- items: r.value,
2155
- "model-value": T.itemId
2178
+ h(Fe, we({ ref_for: !0 }, P, {
2179
+ items: a.value,
2180
+ "model-value": A.itemId
2156
2181
  }), null, 16, ["items", "model-value"])
2157
2182
  ]),
2158
2183
  _: 2
2159
- }, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"])) : U("", !0)
2184
+ }, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"])) : T("", !0)
2160
2185
  ])
2161
2186
  ]),
2162
2187
  _: 2
2163
2188
  }, 1032, ["show-popover", "onPopoverChanged"]),
2164
- y("button", {
2189
+ v("button", {
2165
2190
  type: "button",
2166
2191
  class: "inline-flex items-center justify-center h-[30px] w-[26px] rounded-r-md border border-l-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover text-fm-color-typo-secondary hover:text-fm-color-typo-primary cursor-pointer transition-colors",
2167
2192
  title: n(d)("inventory.recipe.bulkEditor.step1.removeFilter"),
2168
- onClick: (P) => I(T.id)
2193
+ onClick: (P) => I(A.id)
2169
2194
  }, [
2170
- k(x, {
2195
+ h(z, {
2171
2196
  name: "close",
2172
2197
  size: "sm"
2173
2198
  })
2174
- ], 8, So)
2199
+ ], 8, Ro)
2175
2200
  ]))), 128))
2176
- ])) : U("", !0),
2177
- k(F, {
2201
+ ])) : T("", !0),
2202
+ h(C, {
2178
2203
  "close-on-click": !0,
2179
2204
  placement: "bottom-start"
2180
2205
  }, {
2181
2206
  "menu-button": J(() => [
2182
- k(V, {
2207
+ h(E, {
2183
2208
  label: n(d)("inventory.recipe.bulkEditor.step1.filter"),
2184
2209
  variant: "secondary",
2185
2210
  size: "md",
@@ -2188,50 +2213,50 @@ const ge = ot("recipeBulkEditor", function() {
2188
2213
  }, null, 8, ["label"])
2189
2214
  ]),
2190
2215
  default: J(() => [
2191
- k(w, {
2216
+ h(g, {
2192
2217
  label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient"),
2193
2218
  icon: "inventory_2",
2194
- onClick: e[2] || (e[2] = (T) => C("ingredient"))
2219
+ onClick: e[2] || (e[2] = (A) => B("ingredient"))
2195
2220
  }, null, 8, ["label"]),
2196
- k(w, {
2221
+ h(g, {
2197
2222
  label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe"),
2198
2223
  icon: "restaurant_menu",
2199
- onClick: e[3] || (e[3] = (T) => C("recipe"))
2224
+ onClick: e[3] || (e[3] = (A) => B("recipe"))
2200
2225
  }, null, 8, ["label"])
2201
2226
  ]),
2202
2227
  _: 1
2203
2228
  })
2204
2229
  ]),
2205
- y("div", Bo, [
2206
- n(t).selectedRecipes.length === 0 ? (b(), B("div", Co, [
2207
- k(x, {
2230
+ v("div", Ao, [
2231
+ n(t).selectedRecipes.length === 0 ? (b(), V("div", To, [
2232
+ h(z, {
2208
2233
  name: "search_off",
2209
2234
  size: "lg",
2210
2235
  class: "text-fm-color-typo-placeholder"
2211
2236
  }),
2212
- y("p", Fo, D(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
2213
- ])) : (b(), B("div", Ro, [
2214
- (b(!0), B(X, null, me(n(t).selectedRecipes, (T) => (b(), B("div", {
2215
- key: T._id,
2237
+ v("p", Uo, U(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
2238
+ ])) : (b(), V("div", Po, [
2239
+ (b(!0), V(X, null, me(n(t).selectedRecipes, (A) => (b(), V("div", {
2240
+ key: A._id,
2216
2241
  class: "flex items-center gap-12 px-16 py-12 hover:bg-fm-color-surface-hover transition-colors"
2217
2242
  }, [
2218
- y("div", Ao, [
2219
- y("div", To, D(T.name), 1),
2220
- T.contains.length > 0 ? (b(), B("div", Uo, D(S(T)), 1)) : U("", !0),
2221
- y("div", Po, [
2222
- T.version === "v2" ? (b(), Y(N, {
2243
+ v("div", Mo, [
2244
+ v("div", Do, U(A.name), 1),
2245
+ A.contains.length > 0 ? (b(), V("div", Go, U(S(A)), 1)) : T("", !0),
2246
+ v("div", No, [
2247
+ A.version === "v2" ? (b(), Y(F, {
2223
2248
  key: 0,
2224
2249
  size: "sm",
2225
2250
  label: "V2",
2226
2251
  variant: "info"
2227
- })) : U("", !0)
2252
+ })) : T("", !0)
2228
2253
  ])
2229
2254
  ]),
2230
- k(V, {
2255
+ h(E, {
2231
2256
  variant: "tertiary",
2232
2257
  icon: "do_not_disturb_on",
2233
2258
  title: n(d)("inventory.recipe.bulkEditor.step1.removeRecipeTooltip"),
2234
- onClick: (P) => n(t).removeRecipe(T._id)
2259
+ onClick: (P) => n(t).removeRecipe(A._id)
2235
2260
  }, null, 8, ["title", "onClick"])
2236
2261
  ]))), 128))
2237
2262
  ]))
@@ -2239,16 +2264,16 @@ const ge = ot("recipeBulkEditor", function() {
2239
2264
  ]);
2240
2265
  };
2241
2266
  }
2242
- }), Do = { class: "flex flex-col gap-0 rounded-lg border border-fm-color-border-default bg-fm-color-surface-default overflow-hidden" }, Go = { class: "flex items-start gap-12 px-16 py-12" }, No = { class: "flex-1" }, zo = { class: "flex-1" }, Oo = {
2267
+ }), Oo = { class: "flex flex-col gap-0 rounded-lg border border-fm-color-border-default bg-fm-color-surface-default overflow-hidden" }, Lo = { class: "flex items-start gap-12 px-16 py-12" }, jo = { class: "flex-1" }, Ko = { class: "flex-1" }, qo = {
2243
2268
  key: 0,
2244
2269
  class: "border-t border-fm-color-border-default px-16 py-10 flex items-center gap-10"
2245
- }, Lo = {
2270
+ }, Wo = {
2246
2271
  key: 1,
2247
2272
  class: "border-t border-fm-color-border-default px-16 py-10 flex items-start gap-8 bg-fm-color-surface-warning"
2248
- }, jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, Ko = {
2273
+ }, Yo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, Jo = {
2249
2274
  key: 2,
2250
2275
  class: "border-t border-fm-color-border-default px-16 py-12 flex flex-col gap-12"
2251
- }, qo = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, Wo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Yo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, Ho = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary -mt-8" }, Qo = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, Xo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ei = /* @__PURE__ */ ie({
2276
+ }, Ho = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, Qo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, ei = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary -mt-8" }, ti = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, ni = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, oi = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ii = /* @__PURE__ */ le({
2252
2277
  __name: "ModificationCard",
2253
2278
  props: {
2254
2279
  modelValue: {},
@@ -2256,20 +2281,20 @@ const ge = ot("recipeBulkEditor", function() {
2256
2281
  },
2257
2282
  emits: ["update:modelValue"],
2258
2283
  setup(m, { emit: d }) {
2259
- const l = m, t = d, { t: i } = oe(), a = ne(), h = We();
2260
- function u(E) {
2261
- const M = E.type === "replace-binding" ? E.from.type : E.type === "remove-binding" || E.type === "update-binding-rule" || E.type === "update-alternatives" ? E.target.type : E.type === "add-binding" ? E.binding.type : null;
2284
+ const l = m, t = d, { t: i } = ie(), r = ne(), x = We();
2285
+ function u(w) {
2286
+ const M = w.type === "replace-binding" ? w.from.type : w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives" ? w.target.type : w.type === "add-binding" ? w.binding.type : null;
2262
2287
  return M ? M === "RECIPE" ? "recipe" : "ingredient" : null;
2263
2288
  }
2264
- function o(E) {
2265
- return E.type === "update-alternatives" ? !0 : E.type === "add-binding" ? (E.binding.alternatives ?? []).length > 0 : E.type === "replace-binding" ? (E.to.alternatives ?? []).length > 0 : !1;
2289
+ function o(w) {
2290
+ return w.type === "update-alternatives" ? !0 : w.type === "add-binding" ? (w.binding.alternatives ?? []).length > 0 : w.type === "replace-binding" ? (w.to.alternatives ?? []).length > 0 : !1;
2266
2291
  }
2267
- function s(E) {
2268
- switch (E.type) {
2292
+ function s(w) {
2293
+ switch (w.type) {
2269
2294
  case "add-binding":
2270
2295
  return "link";
2271
2296
  case "replace-binding":
2272
- return E.from.id === E.to.id ? "update" : null;
2297
+ return w.from.id === w.to.id ? "update" : null;
2273
2298
  case "remove-binding":
2274
2299
  return "remove";
2275
2300
  case "update-binding-rule":
@@ -2278,79 +2303,79 @@ const ge = ot("recipeBulkEditor", function() {
2278
2303
  return "alts";
2279
2304
  }
2280
2305
  }
2281
- function r(E) {
2282
- return E.type === "replace-binding" ? E.from.id || null : (E.type === "remove-binding" || E.type === "update-binding-rule" || E.type === "update-alternatives") && E.target.id || null;
2306
+ function a(w) {
2307
+ return w.type === "replace-binding" ? w.from.id || null : (w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives") && w.target.id || null;
2283
2308
  }
2284
- function p(E) {
2285
- return E.type === "add-binding" && E.binding.id || null;
2309
+ function p(w) {
2310
+ return w.type === "add-binding" && w.binding.id || null;
2286
2311
  }
2287
- function $(E) {
2288
- const M = E.type === "replace-binding" ? E.to : E.type === "add-binding" ? E.binding : null;
2312
+ function $(w) {
2313
+ const M = w.type === "replace-binding" ? w.to : w.type === "add-binding" ? w.binding : null;
2289
2314
  return M ? { amount: M.amount, measurement: M.measurement ?? null } : ye();
2290
2315
  }
2291
- function C(E) {
2292
- return E.type === "replace-binding" ? E.to.rules ?? null : E.type === "add-binding" ? E.binding.rules ?? null : null;
2316
+ function B(w) {
2317
+ return w.type === "replace-binding" ? w.to.rules ?? null : w.type === "add-binding" ? w.binding.rules ?? null : null;
2293
2318
  }
2294
- function I(E) {
2295
- return E.type === "update-alternatives" ? E.alternatives ?? [] : E.type === "add-binding" ? E.binding.alternatives ?? [] : [];
2319
+ function I(w) {
2320
+ return w.type === "update-alternatives" ? w.alternatives ?? [] : w.type === "add-binding" ? w.binding.alternatives ?? [] : [];
2296
2321
  }
2297
- const f = K(u(l.modelValue)), _ = K(s(l.modelValue)), S = K(o(l.modelValue)), v = K(r(l.modelValue)), e = K(p(l.modelValue)), V = K($(l.modelValue)), c = K(C(l.modelValue)), g = K(I(l.modelValue)), z = K(
2322
+ const f = W(u(l.modelValue)), k = W(s(l.modelValue)), S = W(o(l.modelValue)), y = W(a(l.modelValue)), e = W(p(l.modelValue)), E = W($(l.modelValue)), c = W(B(l.modelValue)), _ = W(I(l.modelValue)), N = W(
2298
2323
  (() => {
2299
- const E = $(l.modelValue);
2300
- return E.amount ? Q(E.amount) : "";
2324
+ const w = $(l.modelValue);
2325
+ return w.amount ? Q(w.amount) : "";
2301
2326
  })()
2302
2327
  );
2303
- let x = null;
2304
- function w(E) {
2305
- z.value = E, x && clearTimeout(x), x = setTimeout(() => {
2306
- const M = +E;
2307
- V.value = {
2308
- amount: E.length > 0 && isFinite(M) ? Ke(M) : { amount: 0, precision: 0 },
2328
+ let z = null;
2329
+ function g(w) {
2330
+ N.value = w, z && clearTimeout(z), z = setTimeout(() => {
2331
+ const M = +w;
2332
+ E.value = {
2333
+ amount: w.length > 0 && isFinite(M) ? Ke(M) : { amount: 0, precision: 0 },
2309
2334
  measurement: null
2310
2335
  };
2311
2336
  }, 300);
2312
2337
  }
2313
2338
  ue(f, () => {
2314
- _.value = null, S.value = !1, v.value = null, e.value = null, V.value = ye(), c.value = null, g.value = [], z.value = "";
2315
- }), ue(_, () => {
2316
- v.value = null, e.value = null, V.value = ye(), c.value = null, g.value = [], z.value = "";
2317
- }), ue(S, (E) => {
2318
- E || (g.value = [], _.value === "alts" && (_.value = null));
2339
+ k.value = null, S.value = !1, y.value = null, e.value = null, E.value = ye(), c.value = null, _.value = [], N.value = "";
2340
+ }), ue(k, () => {
2341
+ y.value = null, e.value = null, E.value = ye(), c.value = null, _.value = [], N.value = "";
2342
+ }), ue(S, (w) => {
2343
+ w || (_.value = [], k.value === "alts" && (k.value = null));
2319
2344
  });
2320
- const F = R(() => [
2345
+ const C = R(() => [
2321
2346
  { label: i("inventory.recipe.bulkEditor.step2.fieldIngredient"), value: "ingredient" },
2322
2347
  { label: i("inventory.recipe.bulkEditor.step2.fieldRecipe"), value: "recipe" }
2323
- ]), N = R(() => {
2324
- const E = [
2348
+ ]), F = R(() => {
2349
+ const w = [
2325
2350
  { label: i("inventory.recipe.bulkEditor.step2.actionLink"), value: "link" },
2326
2351
  { label: i("inventory.recipe.bulkEditor.step2.actionUpdate"), value: "update" },
2327
2352
  { label: i("inventory.recipe.bulkEditor.step2.actionRemove"), value: "remove" }
2328
2353
  ];
2329
- return f.value === "ingredient" && S.value && h.enableRecipeV2 && E.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), E;
2330
- }), T = R(() => f.value !== null && _.value !== null), P = R(
2331
- () => _.value === "update" || _.value === "remove" || _.value === "alts"
2332
- ), W = R(
2333
- () => _.value === "link"
2354
+ return f.value === "ingredient" && S.value && x.enableRecipeV2 && w.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), w;
2355
+ }), A = R(() => f.value !== null && k.value !== null), P = R(
2356
+ () => k.value === "update" || k.value === "remove" || k.value === "alts"
2357
+ ), K = R(
2358
+ () => k.value === "link"
2334
2359
  ), H = R(
2335
- () => _.value === "update" && v.value !== null
2336
- ), Z = R(
2337
- () => f.value === "ingredient" && S.value && h.enableRecipeV2
2338
- ), A = R(
2339
- () => a.skus.map((E) => ({ label: E.name, sublabel: E.code, value: E._id }))
2340
- ), L = R(
2341
- () => a.recipes.map((E) => ({ label: E.name, value: E._id }))
2342
- ), O = R(() => f.value === "recipe" ? L.value : A.value), q = R(() => f.value === "recipe" ? L.value : A.value), le = R(() => f.value !== "ingredient" || !e.value ? null : a.skuById[e.value] ?? null), ee = R(() => f.value !== "ingredient" || !v.value ? null : a.skuById[v.value] ?? null), re = R(() => {
2343
- const E = v.value ?? e.value;
2344
- return E ? [E] : [];
2345
- }), fe = R(() => Z.value ? Object.values(l.livePreviewEntries).filter(
2346
- (E) => E.original.version !== "v2"
2360
+ () => k.value === "update" && y.value !== null
2361
+ ), ee = R(
2362
+ () => f.value === "ingredient" && S.value && x.enableRecipeV2
2363
+ ), O = R(
2364
+ () => r.skus.map((w) => ({ label: w.name, sublabel: w.code, value: w._id }))
2365
+ ), D = R(
2366
+ () => r.recipes.map((w) => ({ label: w.name, value: w._id }))
2367
+ ), L = R(() => f.value === "recipe" ? D.value : O.value), q = R(() => f.value === "recipe" ? D.value : O.value), oe = R(() => f.value !== "ingredient" || !e.value ? null : r.skuById[e.value] ?? null), Z = R(() => f.value !== "ingredient" || !y.value ? null : r.skuById[y.value] ?? null), ae = R(() => {
2368
+ const w = y.value ?? e.value;
2369
+ return w ? [w] : [];
2370
+ }), fe = R(() => ee.value ? Object.values(l.livePreviewEntries).filter(
2371
+ (w) => w.original.version !== "v2"
2347
2372
  ).length : 0), xe = R(() => Object.values(l.livePreviewEntries).length);
2348
2373
  ue(
2349
- () => [_.value, v.value],
2350
- ([E, M], [te, pe]) => {
2351
- if (E !== "alts" || M === pe) return;
2374
+ () => [k.value, y.value],
2375
+ ([w, M], [te, pe]) => {
2376
+ if (w !== "alts" || M === pe) return;
2352
2377
  if (!M) {
2353
- g.value = [];
2378
+ _.value = [];
2354
2379
  return;
2355
2380
  }
2356
2381
  const $e = Object.values(l.livePreviewEntries).find(
@@ -2358,187 +2383,187 @@ const ge = ot("recipeBulkEditor", function() {
2358
2383
  );
2359
2384
  if ($e) {
2360
2385
  const j = $e.original.contains.find((Ie) => Ie.type === "SKU" && Ie.id === M);
2361
- g.value = j != null && j.alternatives ? [...j.alternatives] : [];
2386
+ _.value = j != null && j.alternatives ? [...j.alternatives] : [];
2362
2387
  } else
2363
- g.value = [];
2388
+ _.value = [];
2364
2389
  }
2365
2390
  );
2366
- const ae = R(() => _.value !== "alts" || !v.value ? 0 : Object.values(l.livePreviewEntries).filter(
2367
- (E) => E.original.version === "v2" && E.original.contains.some((M) => M.type === "SKU" && M.id === v.value)
2391
+ const re = R(() => k.value !== "alts" || !y.value ? 0 : Object.values(l.livePreviewEntries).filter(
2392
+ (w) => w.original.version === "v2" && w.original.contains.some((M) => M.type === "SKU" && M.id === y.value)
2368
2393
  ).length);
2369
2394
  function ve() {
2370
2395
  return f.value === "recipe" ? "RECIPE" : "SKU";
2371
2396
  }
2372
2397
  function ce() {
2373
- const E = ve(), M = ye().amount, te = {
2374
- type: E,
2398
+ const w = ve(), M = ye().amount, te = {
2399
+ type: w,
2375
2400
  id: "",
2376
2401
  amount: M,
2377
2402
  measurement: null,
2378
2403
  rules: null,
2379
2404
  alternatives: []
2380
2405
  };
2381
- switch (_.value) {
2406
+ switch (k.value) {
2382
2407
  case "update":
2383
- return { type: "replace-binding", from: { type: E, id: "" }, to: te };
2408
+ return { type: "replace-binding", from: { type: w, id: "" }, to: te };
2384
2409
  case "remove":
2385
- return { type: "remove-binding", target: { type: E, id: "" } };
2410
+ return { type: "remove-binding", target: { type: w, id: "" } };
2386
2411
  case "alts":
2387
- return { type: "update-alternatives", target: { type: E, id: "" }, alternatives: [] };
2412
+ return { type: "update-alternatives", target: { type: w, id: "" }, alternatives: [] };
2388
2413
  case "link":
2389
2414
  default:
2390
2415
  return { type: "add-binding", binding: te };
2391
2416
  }
2392
2417
  }
2393
2418
  function Ue() {
2394
- return v.value ? { type: ve(), id: v.value } : null;
2419
+ return y.value ? { type: ve(), id: y.value } : null;
2395
2420
  }
2396
- function Ye(E = !1) {
2397
- const M = E ? v.value : e.value;
2421
+ function Ye(w = !1) {
2422
+ const M = w ? y.value : e.value;
2398
2423
  if (!M) return null;
2399
- const { amount: te, measurement: pe } = V.value, Ee = pe ? he.multiplyDecimal(te, pe.conversion) : te;
2424
+ const { amount: te, measurement: pe } = E.value, Ee = pe ? he.multiplyDecimal(te, pe.conversion) : te;
2400
2425
  return {
2401
2426
  type: ve(),
2402
2427
  id: M,
2403
2428
  amount: Ee,
2404
2429
  measurement: pe ?? null,
2405
2430
  rules: f.value === "recipe" ? c.value ?? null : null,
2406
- alternatives: Z.value ? g.value : []
2431
+ alternatives: ee.value ? _.value : []
2407
2432
  };
2408
2433
  }
2409
2434
  function ct() {
2410
2435
  if (!f.value) return;
2411
- if (!_.value) {
2436
+ if (!k.value) {
2412
2437
  t("update:modelValue", ce());
2413
2438
  return;
2414
2439
  }
2415
- const E = Ue(), M = Ye(!1);
2440
+ const w = Ue(), M = Ye(!1);
2416
2441
  let te = null;
2417
- switch (_.value) {
2442
+ switch (k.value) {
2418
2443
  case "link":
2419
2444
  M && (te = { type: "add-binding", binding: M });
2420
2445
  break;
2421
2446
  case "update": {
2422
2447
  const pe = Ye(!0);
2423
- E && pe && (te = { type: "replace-binding", from: E, to: pe });
2448
+ w && pe && (te = { type: "replace-binding", from: w, to: pe });
2424
2449
  break;
2425
2450
  }
2426
2451
  case "remove":
2427
- E && (te = { type: "remove-binding", target: E });
2452
+ w && (te = { type: "remove-binding", target: w });
2428
2453
  break;
2429
2454
  case "alts":
2430
- E && (te = { type: "update-alternatives", target: E, alternatives: g.value });
2455
+ w && (te = { type: "update-alternatives", target: w, alternatives: _.value });
2431
2456
  break;
2432
2457
  }
2433
2458
  t("update:modelValue", te ?? ce());
2434
2459
  }
2435
2460
  return ue(
2436
- [f, _, S, v, e, V, c, g],
2461
+ [f, k, S, y, e, E, c, _],
2437
2462
  () => ct(),
2438
2463
  { deep: !0 }
2439
- ), (E, M) => {
2464
+ ), (w, M) => {
2440
2465
  const te = G("FmSelect"), pe = G("FmSwitch"), Ee = G("FmIcon"), $e = G("FmTextField");
2441
- return b(), B("div", Do, [
2442
- y("div", Go, [
2443
- y("div", No, [
2444
- k(te, {
2466
+ return b(), V("div", Oo, [
2467
+ v("div", Lo, [
2468
+ v("div", jo, [
2469
+ h(te, {
2445
2470
  modelValue: f.value,
2446
2471
  "onUpdate:modelValue": M[0] || (M[0] = (j) => f.value = j),
2447
- items: F.value,
2472
+ items: C.value,
2448
2473
  label: n(i)("inventory.recipe.bulkEditor.step2.sectionField"),
2449
2474
  placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionField")
2450
2475
  }, null, 8, ["modelValue", "items", "label", "placeholder"])
2451
2476
  ]),
2452
- y("div", zo, [
2453
- k(te, {
2454
- modelValue: _.value,
2455
- "onUpdate:modelValue": M[1] || (M[1] = (j) => _.value = j),
2456
- items: N.value,
2477
+ v("div", Ko, [
2478
+ h(te, {
2479
+ modelValue: k.value,
2480
+ "onUpdate:modelValue": M[1] || (M[1] = (j) => k.value = j),
2481
+ items: F.value,
2457
2482
  label: n(i)("inventory.recipe.bulkEditor.step2.sectionAction"),
2458
2483
  placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionAction")
2459
2484
  }, null, 8, ["modelValue", "items", "label", "placeholder"])
2460
2485
  ])
2461
2486
  ]),
2462
- f.value === "ingredient" && n(h).enableRecipeV2 ? (b(), B("div", Oo, [
2463
- k(pe, {
2487
+ f.value === "ingredient" && n(x).enableRecipeV2 ? (b(), V("div", qo, [
2488
+ h(pe, {
2464
2489
  modelValue: S.value,
2465
2490
  "onUpdate:modelValue": M[2] || (M[2] = (j) => S.value = j),
2466
2491
  label: n(i)("inventory.recipe.bulkEditor.step2.includeAlternativesToggle")
2467
2492
  }, null, 8, ["modelValue", "label"])
2468
- ])) : U("", !0),
2469
- Z.value && fe.value > 0 ? (b(), B("div", Lo, [
2470
- k(Ee, {
2493
+ ])) : T("", !0),
2494
+ ee.value && fe.value > 0 ? (b(), V("div", Wo, [
2495
+ h(Ee, {
2471
2496
  name: "warning",
2472
2497
  size: "sm",
2473
2498
  class: "text-fm-color-typo-warning mt-1 shrink-0"
2474
2499
  }),
2475
- y("p", jo, D(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
2500
+ v("p", Yo, U(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
2476
2501
  v1Count: fe.value,
2477
2502
  total: xe.value
2478
2503
  })), 1)
2479
- ])) : U("", !0),
2480
- T.value ? (b(), B("div", Ko, [
2481
- P.value ? (b(), B(X, { key: 0 }, [
2482
- y("p", qo, D(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
2483
- k(te, {
2484
- modelValue: v.value,
2485
- "onUpdate:modelValue": M[3] || (M[3] = (j) => v.value = j),
2486
- items: O.value,
2504
+ ])) : T("", !0),
2505
+ A.value ? (b(), V("div", Jo, [
2506
+ P.value ? (b(), V(X, { key: 0 }, [
2507
+ v("p", Ho, U(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
2508
+ h(te, {
2509
+ modelValue: y.value,
2510
+ "onUpdate:modelValue": M[3] || (M[3] = (j) => y.value = j),
2511
+ items: L.value,
2487
2512
  placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
2488
2513
  clearable: ""
2489
2514
  }, {
2490
2515
  "menu-wrapper": J((j) => [
2491
- k(Fe, we(j, {
2492
- items: O.value,
2493
- "model-value": v.value
2516
+ h(Fe, we(j, {
2517
+ items: L.value,
2518
+ "model-value": y.value
2494
2519
  }), null, 16, ["items", "model-value"])
2495
2520
  ]),
2496
2521
  _: 1
2497
2522
  }, 8, ["modelValue", "items", "placeholder"]),
2498
- H.value ? (b(), B(X, { key: 0 }, [
2499
- f.value === "ingredient" && ee.value ? (b(), Y(Ce, {
2523
+ H.value ? (b(), V(X, { key: 0 }, [
2524
+ f.value === "ingredient" && Z.value ? (b(), Y(Ce, {
2500
2525
  key: 0,
2501
- modelValue: V.value,
2502
- "onUpdate:modelValue": M[4] || (M[4] = (j) => V.value = j),
2503
- unit: ee.value.unit,
2526
+ modelValue: E.value,
2527
+ "onUpdate:modelValue": M[4] || (M[4] = (j) => E.value = j),
2528
+ unit: Z.value.unit,
2504
2529
  placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
2505
2530
  "convert-amount-on-change-unit": ""
2506
2531
  }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (b(), Y($e, {
2507
2532
  key: 1,
2508
- "model-value": z.value,
2533
+ "model-value": N.value,
2509
2534
  label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
2510
2535
  type: "number",
2511
- "onUpdate:modelValue": M[5] || (M[5] = (j) => w(j))
2512
- }, null, 8, ["model-value", "label"])) : U("", !0),
2513
- f.value === "recipe" ? (b(), B(X, { key: 2 }, [
2514
- y("p", Wo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2515
- k(Re, {
2536
+ "onUpdate:modelValue": M[5] || (M[5] = (j) => g(j))
2537
+ }, null, 8, ["model-value", "label"])) : T("", !0),
2538
+ f.value === "recipe" ? (b(), V(X, { key: 2 }, [
2539
+ v("p", Qo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2540
+ h(Re, {
2516
2541
  modelValue: c.value,
2517
2542
  "onUpdate:modelValue": M[6] || (M[6] = (j) => c.value = j)
2518
2543
  }, null, 8, ["modelValue"])
2519
- ], 64)) : U("", !0),
2520
- Z.value ? (b(), B(X, { key: 3 }, [
2521
- y("p", Yo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2522
- k(Se, {
2523
- modelValue: g.value,
2524
- "onUpdate:modelValue": M[7] || (M[7] = (j) => g.value = j),
2525
- "filter-ingredient-ids": re.value
2544
+ ], 64)) : T("", !0),
2545
+ ee.value ? (b(), V(X, { key: 3 }, [
2546
+ v("p", Xo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2547
+ h(Se, {
2548
+ modelValue: _.value,
2549
+ "onUpdate:modelValue": M[7] || (M[7] = (j) => _.value = j),
2550
+ "filter-ingredient-ids": ae.value
2526
2551
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2527
- ], 64)) : U("", !0)
2528
- ], 64)) : U("", !0),
2529
- _.value === "alts" && v.value ? (b(), B(X, { key: 1 }, [
2530
- y("p", Jo, D(ae.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: ae.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
2531
- y("p", Ho, D(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
2532
- k(Se, {
2533
- modelValue: g.value,
2534
- "onUpdate:modelValue": M[8] || (M[8] = (j) => g.value = j),
2535
- "filter-ingredient-ids": re.value
2552
+ ], 64)) : T("", !0)
2553
+ ], 64)) : T("", !0),
2554
+ k.value === "alts" && y.value ? (b(), V(X, { key: 1 }, [
2555
+ v("p", Zo, U(re.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: re.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
2556
+ v("p", ei, U(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
2557
+ h(Se, {
2558
+ modelValue: _.value,
2559
+ "onUpdate:modelValue": M[8] || (M[8] = (j) => _.value = j),
2560
+ "filter-ingredient-ids": ae.value
2536
2561
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2537
- ], 64)) : U("", !0)
2538
- ], 64)) : U("", !0),
2539
- W.value ? (b(), B(X, { key: 1 }, [
2540
- y("p", Qo, D(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
2541
- k(te, {
2562
+ ], 64)) : T("", !0)
2563
+ ], 64)) : T("", !0),
2564
+ K.value ? (b(), V(X, { key: 1 }, [
2565
+ v("p", ti, U(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
2566
+ h(te, {
2542
2567
  modelValue: e.value,
2543
2568
  "onUpdate:modelValue": M[9] || (M[9] = (j) => e.value = j),
2544
2569
  items: q.value,
@@ -2546,90 +2571,90 @@ const ge = ot("recipeBulkEditor", function() {
2546
2571
  clearable: ""
2547
2572
  }, {
2548
2573
  "menu-wrapper": J((j) => [
2549
- k(Fe, we(j, {
2574
+ h(Fe, we(j, {
2550
2575
  items: q.value,
2551
2576
  "model-value": e.value
2552
2577
  }), null, 16, ["items", "model-value"])
2553
2578
  ]),
2554
2579
  _: 1
2555
2580
  }, 8, ["modelValue", "items", "placeholder"]),
2556
- e.value ? (b(), B(X, { key: 0 }, [
2557
- f.value === "ingredient" && le.value ? (b(), Y(Ce, {
2581
+ e.value ? (b(), V(X, { key: 0 }, [
2582
+ f.value === "ingredient" && oe.value ? (b(), Y(Ce, {
2558
2583
  key: 0,
2559
- modelValue: V.value,
2560
- "onUpdate:modelValue": M[10] || (M[10] = (j) => V.value = j),
2561
- unit: le.value.unit,
2584
+ modelValue: E.value,
2585
+ "onUpdate:modelValue": M[10] || (M[10] = (j) => E.value = j),
2586
+ unit: oe.value.unit,
2562
2587
  placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
2563
2588
  "convert-amount-on-change-unit": ""
2564
2589
  }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (b(), Y($e, {
2565
2590
  key: 1,
2566
- "model-value": z.value,
2591
+ "model-value": N.value,
2567
2592
  label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
2568
2593
  type: "number",
2569
- "onUpdate:modelValue": M[11] || (M[11] = (j) => w(j))
2570
- }, null, 8, ["model-value", "label"])) : U("", !0),
2571
- f.value === "recipe" ? (b(), B(X, { key: 2 }, [
2572
- y("p", Xo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2573
- k(Re, {
2594
+ "onUpdate:modelValue": M[11] || (M[11] = (j) => g(j))
2595
+ }, null, 8, ["model-value", "label"])) : T("", !0),
2596
+ f.value === "recipe" ? (b(), V(X, { key: 2 }, [
2597
+ v("p", ni, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2598
+ h(Re, {
2574
2599
  modelValue: c.value,
2575
2600
  "onUpdate:modelValue": M[12] || (M[12] = (j) => c.value = j)
2576
2601
  }, null, 8, ["modelValue"])
2577
- ], 64)) : U("", !0),
2578
- Z.value ? (b(), B(X, { key: 3 }, [
2579
- y("p", Zo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2580
- k(Se, {
2581
- modelValue: g.value,
2582
- "onUpdate:modelValue": M[13] || (M[13] = (j) => g.value = j),
2583
- "filter-ingredient-ids": re.value
2602
+ ], 64)) : T("", !0),
2603
+ ee.value ? (b(), V(X, { key: 3 }, [
2604
+ v("p", oi, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2605
+ h(Se, {
2606
+ modelValue: _.value,
2607
+ "onUpdate:modelValue": M[13] || (M[13] = (j) => _.value = j),
2608
+ "filter-ingredient-ids": ae.value
2584
2609
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2585
- ], 64)) : U("", !0)
2586
- ], 64)) : U("", !0)
2587
- ], 64)) : U("", !0)
2588
- ])) : U("", !0)
2610
+ ], 64)) : T("", !0)
2611
+ ], 64)) : T("", !0)
2612
+ ], 64)) : T("", !0)
2613
+ ])) : T("", !0)
2589
2614
  ]);
2590
2615
  };
2591
2616
  }
2592
- }), ti = { class: "flex flex-col gap-8" }, ni = { class: "flex flex-wrap items-center gap-12 px-4" }, oi = {
2617
+ }), li = { class: "flex flex-col gap-8" }, ri = { class: "flex flex-wrap items-center gap-12 px-4" }, ai = {
2593
2618
  key: 0,
2594
2619
  class: "flex items-center gap-6"
2595
- }, ii = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, li = {
2620
+ }, si = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, di = {
2596
2621
  key: 1,
2597
2622
  class: "flex items-center gap-6"
2598
- }, ai = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ri = {
2623
+ }, ui = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ci = {
2599
2624
  key: 2,
2600
2625
  class: "flex items-center gap-6"
2601
- }, si = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, di = { class: "rounded-lg border border-fm-color-border-default overflow-hidden" }, ui = {
2626
+ }, pi = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, mi = { class: "rounded-lg border border-fm-color-border-default overflow-hidden" }, fi = {
2602
2627
  key: 0,
2603
2628
  class: "px-16 py-12 text-center fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
2604
- }, ci = {
2629
+ }, vi = {
2605
2630
  key: 1,
2606
2631
  class: "divide-y divide-fm-color-border-default"
2607
- }, pi = { class: "flex items-center gap-12" }, mi = { class: "flex-1 fm-typo-en-body-sm-600 text-fm-color-typo-primary truncate" }, fi = {
2632
+ }, yi = { class: "flex items-center gap-12" }, bi = { class: "flex-1 fm-typo-en-body-sm-600 text-fm-color-typo-primary truncate" }, gi = {
2608
2633
  key: 0,
2609
2634
  class: "flex flex-col gap-4 pl-8"
2610
- }, vi = { class: "flex-1 fm-typo-en-body-xs-400 text-fm-color-typo-secondary font-mono truncate" }, yi = /* @__PURE__ */ ie({
2635
+ }, _i = { class: "flex-1 fm-typo-en-body-xs-400 text-fm-color-typo-secondary font-mono truncate" }, ki = /* @__PURE__ */ le({
2611
2636
  __name: "LivePreviewTable",
2612
2637
  setup(m) {
2613
- const { t: d } = oe(), l = ge(), t = ne(), i = {
2638
+ const { t: d } = ie(), l = ge(), t = ne(), i = {
2614
2639
  "will-update": 0,
2615
2640
  "partially-ignored": 1,
2616
2641
  "already-satisfied": 2,
2617
2642
  blocked: 3,
2618
2643
  "no-applicable-changes": 4
2619
- }, a = R(
2644
+ }, r = R(
2620
2645
  () => Object.values(l.livePreviewEntries).sort(
2621
- (e, V) => i[e.status] - i[V.status]
2646
+ (e, E) => i[e.status] - i[E.status]
2622
2647
  )
2623
- ), h = R(
2624
- () => a.value.filter((e) => e.status === "will-update").length
2648
+ ), x = R(
2649
+ () => r.value.filter((e) => e.status === "will-update").length
2625
2650
  ), u = R(
2626
- () => a.value.filter((e) => e.status === "partially-ignored").length
2651
+ () => r.value.filter((e) => e.status === "partially-ignored").length
2627
2652
  ), o = R(
2628
- () => a.value.filter((e) => e.status === "already-satisfied").length
2653
+ () => r.value.filter((e) => e.status === "already-satisfied").length
2629
2654
  ), s = R(
2630
- () => a.value.filter((e) => e.status === "blocked").length
2655
+ () => r.value.filter((e) => e.status === "blocked").length
2631
2656
  );
2632
- function r(e) {
2657
+ function a(e) {
2633
2658
  switch (e) {
2634
2659
  case "will-update":
2635
2660
  return d("inventory.recipe.bulkEditor.status.willUpdate");
@@ -2661,34 +2686,34 @@ const ge = ot("recipeBulkEditor", function() {
2661
2686
  return "neutral";
2662
2687
  }
2663
2688
  }
2664
- function $(e, V) {
2665
- var c, g, z;
2666
- return e === "SKU" ? ((c = t.skuById[V]) == null ? void 0 : c.name) ?? V : e === "SKU_GROUP" ? ((g = t.skuGroupById[V]) == null ? void 0 : g.name) ?? V : e === "RECIPE" ? ((z = t.recipeById[V]) == null ? void 0 : z.name) ?? V : V;
2689
+ function $(e, E) {
2690
+ var c, _, N;
2691
+ return e === "SKU" ? ((c = t.skuById[E]) == null ? void 0 : c.name) ?? E : e === "SKU_GROUP" ? ((_ = t.skuGroupById[E]) == null ? void 0 : _.name) ?? E : e === "RECIPE" ? ((N = t.recipeById[E]) == null ? void 0 : N.name) ?? E : E;
2667
2692
  }
2668
- function C(e) {
2669
- var c, g;
2670
- const V = $(e.type, e.id);
2693
+ function B(e) {
2694
+ var c, _;
2695
+ const E = $(e.type, e.id);
2671
2696
  if (e.type === "SKU") {
2672
- const z = t.skuById[e.id], x = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((g = z == null ? void 0 : z.unit) == null ? void 0 : g.abbrev) ?? "";
2673
- return `${V} (${Q(e.amount)} ${x})`.trim();
2697
+ const N = t.skuById[e.id], z = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((_ = N == null ? void 0 : N.unit) == null ? void 0 : _.abbrev) ?? "";
2698
+ return `${E} (${Q(e.amount)} ${z})`.trim();
2674
2699
  }
2675
- return e.type === "RECIPE" ? `${V} ×${Q(e.amount)}` : V;
2700
+ return e.type === "RECIPE" ? `${E} ×${Q(e.amount)}` : E;
2676
2701
  }
2677
2702
  function I(e) {
2678
2703
  return $(e.type, e.id);
2679
2704
  }
2680
- function f(e, V) {
2681
- const c = V.contains.find((g) => g.type === e.type && g.id === e.id);
2682
- return c ? C(c) : I(e);
2705
+ function f(e, E) {
2706
+ const c = E.contains.find((_) => _.type === e.type && _.id === e.id);
2707
+ return c ? B(c) : I(e);
2683
2708
  }
2684
- function _(e, V) {
2709
+ function k(e, E) {
2685
2710
  switch (e.type) {
2686
2711
  case "add-binding":
2687
- return `+ ${C(e.binding)}`;
2712
+ return `+ ${B(e.binding)}`;
2688
2713
  case "remove-binding":
2689
2714
  return `− ${I(e.target)}`;
2690
2715
  case "replace-binding":
2691
- return `${f(e.from, V)} → ${C(e.to)}`;
2716
+ return `${f(e.from, E)} → ${B(e.to)}`;
2692
2717
  case "update-binding-rule":
2693
2718
  return `Rule: ${I(e.target)}`;
2694
2719
  case "update-alternatives":
@@ -2709,7 +2734,7 @@ const ge = ot("recipeBulkEditor", function() {
2709
2734
  return "neutral";
2710
2735
  }
2711
2736
  }
2712
- function v(e) {
2737
+ function y(e) {
2713
2738
  switch (e) {
2714
2739
  case "applied":
2715
2740
  return d("inventory.recipe.bulkEditor.livePreview.outcomeApplied");
@@ -2723,78 +2748,78 @@ const ge = ot("recipeBulkEditor", function() {
2723
2748
  return e;
2724
2749
  }
2725
2750
  }
2726
- return (e, V) => {
2751
+ return (e, E) => {
2727
2752
  const c = G("FmChip");
2728
- return b(), B("div", ti, [
2729
- y("div", ni, [
2730
- h.value + u.value > 0 ? (b(), B("div", oi, [
2731
- k(c, {
2753
+ return b(), V("div", li, [
2754
+ v("div", ri, [
2755
+ x.value + u.value > 0 ? (b(), V("div", ai, [
2756
+ h(c, {
2732
2757
  size: "sm",
2733
- label: String(h.value + u.value),
2758
+ label: String(x.value + u.value),
2734
2759
  variant: "success"
2735
2760
  }, null, 8, ["label"]),
2736
- y("span", ii, D(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
2737
- ])) : U("", !0),
2738
- o.value > 0 ? (b(), B("div", li, [
2739
- k(c, {
2761
+ v("span", si, U(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
2762
+ ])) : T("", !0),
2763
+ o.value > 0 ? (b(), V("div", di, [
2764
+ h(c, {
2740
2765
  size: "sm",
2741
2766
  label: String(o.value),
2742
2767
  variant: "info"
2743
2768
  }, null, 8, ["label"]),
2744
- y("span", ai, D(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
2745
- ])) : U("", !0),
2746
- s.value > 0 ? (b(), B("div", ri, [
2747
- k(c, {
2769
+ v("span", ui, U(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
2770
+ ])) : T("", !0),
2771
+ s.value > 0 ? (b(), V("div", ci, [
2772
+ h(c, {
2748
2773
  size: "sm",
2749
2774
  label: String(s.value),
2750
2775
  variant: "critical"
2751
2776
  }, null, 8, ["label"]),
2752
- y("span", si, D(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
2753
- ])) : U("", !0)
2777
+ v("span", pi, U(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
2778
+ ])) : T("", !0)
2754
2779
  ]),
2755
- y("div", di, [
2756
- a.value.length === 0 ? (b(), B("div", ui, D(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (b(), B("div", ci, [
2757
- (b(!0), B(X, null, me(a.value, (g) => (b(), B("div", {
2758
- key: g.recipeId,
2780
+ v("div", mi, [
2781
+ r.value.length === 0 ? (b(), V("div", fi, U(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (b(), V("div", vi, [
2782
+ (b(!0), V(X, null, me(r.value, (_) => (b(), V("div", {
2783
+ key: _.recipeId,
2759
2784
  class: "flex flex-col gap-6 px-16 py-10"
2760
2785
  }, [
2761
- y("div", pi, [
2762
- y("span", mi, D(g.recipeName), 1),
2763
- k(c, {
2786
+ v("div", yi, [
2787
+ v("span", bi, U(_.recipeName), 1),
2788
+ h(c, {
2764
2789
  size: "sm",
2765
- label: r(g.status),
2766
- variant: p(g.status)
2790
+ label: a(_.status),
2791
+ variant: p(_.status)
2767
2792
  }, null, 8, ["label", "variant"])
2768
2793
  ]),
2769
- g.changes.length > 0 ? (b(), B("div", fi, [
2770
- (b(!0), B(X, null, me(g.changes, (z, x) => (b(), B("div", {
2771
- key: x,
2794
+ _.changes.length > 0 ? (b(), V("div", gi, [
2795
+ (b(!0), V(X, null, me(_.changes, (N, z) => (b(), V("div", {
2796
+ key: z,
2772
2797
  class: "flex items-center gap-8"
2773
2798
  }, [
2774
- y("span", vi, D(_(z.change, g.original)), 1),
2775
- k(c, {
2799
+ v("span", _i, U(k(N.change, _.original)), 1),
2800
+ h(c, {
2776
2801
  size: "sm",
2777
- label: v(z.outcome),
2778
- variant: S(z.outcome)
2802
+ label: y(N.outcome),
2803
+ variant: S(N.outcome)
2779
2804
  }, null, 8, ["label", "variant"])
2780
2805
  ]))), 128))
2781
- ])) : U("", !0)
2806
+ ])) : T("", !0)
2782
2807
  ]))), 128))
2783
2808
  ]))
2784
2809
  ])
2785
2810
  ]);
2786
2811
  };
2787
2812
  }
2788
- }), bi = { class: "flex flex-col h-full overflow-hidden" }, gi = { class: "flex flex-col min-h-0 shrink-0" }, _i = { class: "flex items-center gap-8 px-16 pt-12 border-b border-fm-color-border-default" }, ki = { class: "flex-1 overflow-x-auto min-w-0" }, hi = {
2813
+ }), hi = { class: "flex flex-col h-full overflow-hidden" }, xi = { class: "flex flex-col min-h-0 shrink-0" }, $i = { class: "flex items-center gap-8 px-16 pt-12 border-b border-fm-color-border-default" }, Ii = { class: "flex-1 overflow-x-auto min-w-0" }, wi = {
2789
2814
  class: "px-16 py-14 overflow-y-auto",
2790
2815
  style: { "max-height": "45vh" }
2791
- }, xi = {
2816
+ }, Ei = {
2792
2817
  key: 0,
2793
2818
  class: "flex flex-col items-center justify-center py-40 gap-8 text-center rounded-lg border border-dashed border-fm-color-border-default"
2794
- }, $i = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ii = { class: "flex-1 overflow-y-auto px-16 py-14 flex flex-col gap-12 min-h-0" }, wi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary shrink-0" }, Ei = /* @__PURE__ */ ie({
2819
+ }, Vi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Si = { class: "flex-1 overflow-y-auto px-16 py-14 flex flex-col gap-12 min-h-0" }, Bi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary shrink-0" }, Ci = /* @__PURE__ */ le({
2795
2820
  __name: "RecipeBulkEditorStep2",
2796
2821
  setup(m) {
2797
- const { t: d } = oe(), l = ge(), t = K(null);
2822
+ const { t: d } = ie(), l = ge(), t = W(null);
2798
2823
  ue(
2799
2824
  () => l.modifications.length,
2800
2825
  (o) => {
@@ -2803,16 +2828,16 @@ const ge = ot("recipeBulkEditor", function() {
2803
2828
  { immediate: !0 }
2804
2829
  );
2805
2830
  function i(o, s) {
2806
- const r = o.type === "replace-binding" ? o.from.type : o.type === "remove-binding" || o.type === "update-binding-rule" || o.type === "update-alternatives" ? o.target.type : o.type === "add-binding" ? o.binding.type : null;
2807
- return r === "RECIPE" ? d("inventory.recipe.bulkEditor.step2.fieldRecipe") : r === "SKU" || r === "SKU_GROUP" ? d("inventory.recipe.bulkEditor.step2.fieldIngredient") : d("inventory.recipe.bulkEditor.step2.tabLabel", { n: s + 1 });
2831
+ const a = o.type === "replace-binding" ? o.from.type : o.type === "remove-binding" || o.type === "update-binding-rule" || o.type === "update-alternatives" ? o.target.type : o.type === "add-binding" ? o.binding.type : null;
2832
+ return a === "RECIPE" ? d("inventory.recipe.bulkEditor.step2.fieldRecipe") : a === "SKU" || a === "SKU_GROUP" ? d("inventory.recipe.bulkEditor.step2.fieldIngredient") : d("inventory.recipe.bulkEditor.step2.tabLabel", { n: s + 1 });
2808
2833
  }
2809
- const a = R(
2834
+ const r = R(
2810
2835
  () => l.modifications.map((o, s) => ({
2811
2836
  label: i(o, s),
2812
2837
  value: s
2813
2838
  }))
2814
2839
  );
2815
- function h() {
2840
+ function x() {
2816
2841
  const s = {
2817
2842
  type: "add-binding",
2818
2843
  binding: {
@@ -2830,24 +2855,24 @@ const ge = ot("recipeBulkEditor", function() {
2830
2855
  l.removeModification(o);
2831
2856
  }
2832
2857
  return (o, s) => {
2833
- const r = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"), C = G("FmIcon");
2834
- return b(), B("div", bi, [
2835
- y("div", gi, [
2836
- y("div", _i, [
2837
- y("div", ki, [
2838
- a.value.length > 0 ? (b(), Y($, {
2858
+ const a = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"), B = G("FmIcon");
2859
+ return b(), V("div", hi, [
2860
+ v("div", xi, [
2861
+ v("div", $i, [
2862
+ v("div", Ii, [
2863
+ r.value.length > 0 ? (b(), Y($, {
2839
2864
  key: 0,
2840
2865
  "model-value": t.value,
2841
- items: a.value,
2866
+ items: r.value,
2842
2867
  "onUpdate:modelValue": s[1] || (s[1] = (I) => t.value = I)
2843
2868
  }, {
2844
2869
  default: J((I) => [
2845
- k(p, we(I, {
2870
+ h(p, we(I, {
2846
2871
  "model-value": t.value,
2847
2872
  "onUpdate:modelValue": s[0] || (s[0] = (f) => t.value = f)
2848
2873
  }), {
2849
2874
  append: J(() => [
2850
- k(r, {
2875
+ h(a, {
2851
2876
  variant: "tertiary",
2852
2877
  icon: "close",
2853
2878
  size: "md",
@@ -2858,139 +2883,139 @@ const ge = ot("recipeBulkEditor", function() {
2858
2883
  }, 1040, ["model-value"])
2859
2884
  ]),
2860
2885
  _: 1
2861
- }, 8, ["model-value", "items"])) : U("", !0)
2886
+ }, 8, ["model-value", "items"])) : T("", !0)
2862
2887
  ]),
2863
- k(r, {
2888
+ h(a, {
2864
2889
  label: n(d)("inventory.recipe.bulkEditor.step2.addModification"),
2865
2890
  variant: "secondary",
2866
2891
  size: "md",
2867
2892
  "prepend-icon": "add",
2868
2893
  class: "shrink-0",
2869
- onClick: h
2894
+ onClick: x
2870
2895
  }, null, 8, ["label"])
2871
2896
  ]),
2872
- y("div", hi, [
2873
- n(l).modifications.length === 0 ? (b(), B("div", xi, [
2874
- k(C, {
2897
+ v("div", wi, [
2898
+ n(l).modifications.length === 0 ? (b(), V("div", Ei, [
2899
+ h(B, {
2875
2900
  name: "edit_note",
2876
2901
  size: "lg",
2877
2902
  class: "text-fm-color-typo-placeholder"
2878
2903
  }),
2879
- y("p", $i, D(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
2880
- ])) : t.value !== null && n(l).modifications[t.value] ? (b(), Y(ei, {
2904
+ v("p", Vi, U(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
2905
+ ])) : t.value !== null && n(l).modifications[t.value] ? (b(), Y(ii, {
2881
2906
  key: t.value,
2882
2907
  "model-value": n(l).modifications[t.value],
2883
2908
  "live-preview-entries": n(l).livePreviewEntries,
2884
2909
  "onUpdate:modelValue": s[2] || (s[2] = (I) => n(l).updateModification(t.value, I))
2885
- }, null, 8, ["model-value", "live-preview-entries"])) : U("", !0)
2910
+ }, null, 8, ["model-value", "live-preview-entries"])) : T("", !0)
2886
2911
  ])
2887
2912
  ]),
2888
- s[3] || (s[3] = y("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
2889
- y("div", Ii, [
2890
- y("span", wi, D(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
2891
- k(yi)
2913
+ s[3] || (s[3] = v("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
2914
+ v("div", Si, [
2915
+ v("span", Bi, U(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
2916
+ h(ki)
2892
2917
  ])
2893
2918
  ]);
2894
2919
  };
2895
2920
  }
2896
2921
  });
2897
- function Vi(m) {
2922
+ function Fi(m) {
2898
2923
  return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
2899
2924
  }
2900
- function Si() {
2901
- const m = ne(), d = ge(), l = m.skuById, t = m.recipeById, i = m.skuGroupById, h = Object.values(d.entries).filter(
2925
+ function Ri() {
2926
+ const m = ne(), d = ge(), l = m.skuById, t = m.recipeById, i = m.skuGroupById, x = Object.values(d.entries).filter(
2902
2927
  (s) => s.status === "will-update" || s.status === "partially-ignored"
2903
- ).flatMap((s, r) => {
2904
- var C;
2905
- const p = s.projected ?? s.original, $ = Vi(p.customAttributes);
2906
- if ((C = p.contains) != null && C.length) {
2907
- const I = p.contains.filter((S) => S.type === "RECIPE"), f = p.contains.filter((S) => S.type === "SKU"), _ = p.contains.filter((S) => S.type === "SKU_GROUP");
2928
+ ).flatMap((s, a) => {
2929
+ var B;
2930
+ const p = s.projected ?? s.original, $ = Fi(p.customAttributes);
2931
+ if ((B = p.contains) != null && B.length) {
2932
+ const I = p.contains.filter((S) => S.type === "RECIPE"), f = p.contains.filter((S) => S.type === "SKU"), k = p.contains.filter((S) => S.type === "SKU_GROUP");
2908
2933
  return [
2909
- ...r === 0 ? [] : [["", "", "", "", "", "", ""]],
2934
+ ...a === 0 ? [] : [["", "", "", "", "", "", ""]],
2910
2935
  ...I.map(
2911
- (S, v) => {
2936
+ (S, y) => {
2912
2937
  var e;
2913
2938
  return [
2914
- v === 0 ? p.name : "",
2939
+ y === 0 ? p.name : "",
2915
2940
  "RECIPE",
2916
2941
  "",
2917
2942
  ((e = t[S.id]) == null ? void 0 : e.name) ?? S.id,
2918
2943
  Q(S.amount),
2919
2944
  "UNIT",
2920
- v === 0 ? $ : ""
2945
+ y === 0 ? $ : ""
2921
2946
  ];
2922
2947
  }
2923
2948
  ),
2924
2949
  ...f.map(
2925
- (S, v) => {
2926
- var e, V, c, g;
2950
+ (S, y) => {
2951
+ var e, E, c, _;
2927
2952
  return [
2928
- !I.length && v === 0 ? p.name : "",
2953
+ !I.length && y === 0 ? p.name : "",
2929
2954
  "INGREDIENT",
2930
2955
  ((e = l[S.id]) == null ? void 0 : e.code) ?? "",
2931
- ((V = l[S.id]) == null ? void 0 : V.name) ?? S.id,
2956
+ ((E = l[S.id]) == null ? void 0 : E.name) ?? S.id,
2932
2957
  Q(S.amount),
2933
- S.measurement ? S.measurement.abbrev : ((g = (c = l[S.id]) == null ? void 0 : c.unit) == null ? void 0 : g.abbrev) ?? "",
2934
- !I.length && v === 0 ? $ : ""
2958
+ S.measurement ? S.measurement.abbrev : ((_ = (c = l[S.id]) == null ? void 0 : c.unit) == null ? void 0 : _.abbrev) ?? "",
2959
+ !I.length && y === 0 ? $ : ""
2935
2960
  ];
2936
2961
  }
2937
2962
  ),
2938
- ..._.map(
2939
- (S, v) => {
2940
- var e, V;
2963
+ ...k.map(
2964
+ (S, y) => {
2965
+ var e, E;
2941
2966
  return [
2942
- I.length === 0 && f.length === 0 && v === 0 ? p.name : "",
2967
+ I.length === 0 && f.length === 0 && y === 0 ? p.name : "",
2943
2968
  "SKU_GROUP",
2944
2969
  ((e = i[S.id]) == null ? void 0 : e.ref) ?? "",
2945
- ((V = i[S.id]) == null ? void 0 : V.name) ?? S.id,
2970
+ ((E = i[S.id]) == null ? void 0 : E.name) ?? S.id,
2946
2971
  Q(S.amount),
2947
2972
  "UNIT",
2948
- I.length === 0 && f.length === 0 && v === 0 ? $ : ""
2973
+ I.length === 0 && f.length === 0 && y === 0 ? $ : ""
2949
2974
  ];
2950
2975
  }
2951
2976
  )
2952
2977
  ];
2953
2978
  }
2954
2979
  return [
2955
- ...r === 0 ? [] : [["", "", "", "", "", "", ""]],
2980
+ ...a === 0 ? [] : [["", "", "", "", "", "", ""]],
2956
2981
  [p.name, "No bindings", "", "", "", "", $]
2957
2982
  ];
2958
- }), o = rt(h, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
2983
+ }), o = at(x, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
2959
2984
  st(o, `RECIPE_BULK_EDIT_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
2960
2985
  }
2961
- const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, Fi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, Ri = { class: "flex flex-wrap gap-12" }, Ai = { class: "flex items-center gap-6" }, Ti = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ui = {
2986
+ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, Ui = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, Pi = { class: "flex flex-wrap gap-12" }, Mi = { class: "flex items-center gap-6" }, Di = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gi = {
2962
2987
  key: 0,
2963
2988
  class: "flex items-center gap-6"
2964
- }, Pi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mi = {
2989
+ }, Ni = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zi = {
2965
2990
  key: 1,
2966
2991
  class: "flex items-center gap-6"
2967
- }, Di = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gi = {
2992
+ }, Oi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Li = {
2968
2993
  key: 2,
2969
2994
  class: "flex items-center gap-6"
2970
- }, Ni = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zi = {
2995
+ }, ji = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ki = {
2971
2996
  key: 3,
2972
2997
  class: "flex items-center gap-6"
2973
- }, Oi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Li = { class: "mt-12" }, ji = ["onClick"], Ki = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary flex-1 truncate" }, qi = {
2998
+ }, qi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Wi = { class: "mt-12" }, Yi = ["onClick"], Ji = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary flex-1 truncate" }, Hi = {
2974
2999
  key: 0,
2975
3000
  class: "px-12 py-8 border-b border-fm-color-border-default"
2976
- }, Wi = { class: "px-12 py-10 leading-relaxed" }, Yi = {
3001
+ }, Qi = { class: "px-12 py-10 leading-relaxed" }, Xi = {
2977
3002
  key: 2,
2978
3003
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder italic"
2979
- }, Ji = { class: "flex items-center gap-12 px-12 py-8 border-t border-fm-color-border-default bg-fm-color-surface-secondary text-fm-color-typo-secondary fm-typo-en-body-xs-400" }, Hi = { key: 0 }, Qi = { key: 1 }, Xi = {
3004
+ }, Zi = { class: "flex items-center gap-12 px-12 py-8 border-t border-fm-color-border-default bg-fm-color-surface-secondary text-fm-color-typo-secondary fm-typo-en-body-xs-400" }, el = { key: 0 }, tl = { key: 1 }, nl = {
2980
3005
  key: 2,
2981
3006
  class: "text-fm-color-warning"
2982
- }, Zi = {
3007
+ }, ol = {
2983
3008
  key: 3,
2984
3009
  class: "text-fm-color-error"
2985
- }, el = {
3010
+ }, il = {
2986
3011
  key: 4,
2987
3012
  class: "text-fm-color-typo-placeholder"
2988
- }, tl = /* @__PURE__ */ ie({
3013
+ }, ll = /* @__PURE__ */ le({
2989
3014
  __name: "RecipeBulkEditorSummaryStep",
2990
3015
  setup(m) {
2991
- const { t: d } = oe(), l = ne(), t = ge(), i = R(() => Object.values(t.entries)), a = R(
3016
+ const { t: d } = ie(), l = ne(), t = ge(), i = R(() => Object.values(t.entries)), r = R(
2992
3017
  () => i.value.filter((e) => e.status === "will-update").length
2993
- ), h = R(
3018
+ ), x = R(
2994
3019
  () => i.value.filter((e) => e.status === "partially-ignored").length
2995
3020
  ), u = R(
2996
3021
  () => i.value.filter((e) => e.status === "already-satisfied").length
@@ -2998,76 +3023,76 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
2998
3023
  () => i.value.filter((e) => e.status === "blocked").length
2999
3024
  ), s = R(
3000
3025
  () => i.value.filter((e) => e.status === "no-applicable-changes").length
3001
- ), r = K(/* @__PURE__ */ new Set());
3026
+ ), a = W(/* @__PURE__ */ new Set());
3002
3027
  function p(e) {
3003
- return r.value.has(e);
3028
+ return a.value.has(e);
3004
3029
  }
3005
3030
  function $(e) {
3006
- const V = new Set(r.value);
3007
- V.has(e) ? V.delete(e) : V.add(e), r.value = V;
3008
- }
3009
- function C(e) {
3010
- var g, z, x;
3011
- const V = [], c = ke(e.contains, /* @__PURE__ */ new Set([e._id]), l.recipeById);
3012
- for (let w = 0; w < c.length; w++) {
3013
- const F = c[w], N = F.recipeIds.slice(1).length > 0, T = N ? ((g = l.recipeById[F.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? "" : "";
3031
+ const E = new Set(a.value);
3032
+ E.has(e) ? E.delete(e) : E.add(e), a.value = E;
3033
+ }
3034
+ function B(e) {
3035
+ var _, N, z;
3036
+ const E = [], c = ke(e.contains, /* @__PURE__ */ new Set([e._id]), l.recipeById);
3037
+ for (let g = 0; g < c.length; g++) {
3038
+ const C = c[g], F = C.recipeIds.slice(1).length > 0, A = F ? ((_ = l.recipeById[C.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? "" : "";
3014
3039
  let P;
3015
- if (F.isGroup) {
3016
- const W = l.skuGroupById[F.id];
3017
- if (!W) continue;
3018
- const H = `x${Q(F.amount)}`;
3019
- P = N ? `(${T}) ${W.name} (${H})` : `${W.name} (${H})`;
3040
+ if (C.isGroup) {
3041
+ const K = l.skuGroupById[C.id];
3042
+ if (!K) continue;
3043
+ const H = `x${Q(C.amount)}`;
3044
+ P = F ? `(${A}) ${K.name} (${H})` : `${K.name} (${H})`;
3020
3045
  } else {
3021
- const W = l.skuById[F.id];
3022
- if (!W) continue;
3023
- const H = ((z = F.measurement) == null ? void 0 : z.abbrev) ?? ((x = W.unit) == null ? void 0 : x.abbrev) ?? "", Z = `${Q(F.amount)}${H}`;
3024
- P = N ? `(${T}) ${W.name} (${Z})` : `${W.name} (${Z})`;
3046
+ const K = l.skuById[C.id];
3047
+ if (!K) continue;
3048
+ const H = ((N = C.measurement) == null ? void 0 : N.abbrev) ?? ((z = K.unit) == null ? void 0 : z.abbrev) ?? "", ee = `${Q(C.amount)}${H}`;
3049
+ P = F ? `(${A}) ${K.name} (${ee})` : `${K.name} (${ee})`;
3025
3050
  }
3026
- w > 0 && V.push({ text: ", " }), V.push({ text: P });
3051
+ g > 0 && E.push({ text: ", " }), E.push({ text: P });
3027
3052
  }
3028
- return V;
3053
+ return E;
3029
3054
  }
3030
3055
  function I(e) {
3031
- var w, F, N, T;
3056
+ var g, C, F, A;
3032
3057
  if (e.isGroup) {
3033
3058
  const P = l.skuGroupById[e.id];
3034
3059
  if (!P) return "";
3035
- const W = e.recipeIds.slice(1).length > 0, H = W ? ((w = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : w.name) ?? "" : "", Z = `x${Q(e.amount)}`;
3036
- return W ? `(${H}) ${P.name} (${Z})` : `${P.name} (${Z})`;
3060
+ const K = e.recipeIds.slice(1).length > 0, H = K ? ((g = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? "" : "", ee = `x${Q(e.amount)}`;
3061
+ return K ? `(${H}) ${P.name} (${ee})` : `${P.name} (${ee})`;
3037
3062
  }
3038
- const V = l.skuById[e.id];
3039
- if (!V) return "";
3040
- const c = e.recipeIds.slice(1).length > 0, g = c ? ((F = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : F.name) ?? "" : "", z = ((N = e.measurement) == null ? void 0 : N.abbrev) ?? ((T = V.unit) == null ? void 0 : T.abbrev) ?? "", x = `${Q(e.amount)}${z}`;
3041
- return c ? `(${g}) ${V.name} (${x})` : `${V.name} (${x})`;
3063
+ const E = l.skuById[e.id];
3064
+ if (!E) return "";
3065
+ const c = e.recipeIds.slice(1).length > 0, _ = c ? ((C = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : C.name) ?? "" : "", N = ((F = e.measurement) == null ? void 0 : F.abbrev) ?? ((A = E.unit) == null ? void 0 : A.abbrev) ?? "", z = `${Q(e.amount)}${N}`;
3066
+ return c ? `(${_}) ${E.name} (${z})` : `${E.name} (${z})`;
3042
3067
  }
3043
3068
  function f(e) {
3044
3069
  if (!e.projected) return [];
3045
- const V = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), g = /* @__PURE__ */ new Map();
3046
- for (const N of V) g.set(`${N.type}:${N.id}`, N);
3047
- const z = /* @__PURE__ */ new Map();
3048
- for (const N of c) z.set(`${N.type}:${N.id}`, N);
3049
- const x = [];
3050
- let w = !0;
3051
- function F(N, T) {
3052
- T && (w || x.push({ kind: "unchanged", text: ", " }), x.push({ kind: N, text: T }), w = !1);
3070
+ const E = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), _ = /* @__PURE__ */ new Map();
3071
+ for (const F of E) _.set(`${F.type}:${F.id}`, F);
3072
+ const N = /* @__PURE__ */ new Map();
3073
+ for (const F of c) N.set(`${F.type}:${F.id}`, F);
3074
+ const z = [];
3075
+ let g = !0;
3076
+ function C(F, A) {
3077
+ A && (g || z.push({ kind: "unchanged", text: ", " }), z.push({ kind: F, text: A }), g = !1);
3053
3078
  }
3054
- for (const [N, T] of g) {
3055
- const P = z.get(N);
3079
+ for (const [F, A] of _) {
3080
+ const P = N.get(F);
3056
3081
  if (!P)
3057
- F("removed", I(T));
3082
+ C("removed", I(A));
3058
3083
  else {
3059
- const W = I(T), H = I(P);
3060
- W === H ? F("unchanged", W) : (F("removed", W), F("added", H));
3084
+ const K = I(A), H = I(P);
3085
+ K === H ? C("unchanged", K) : (C("removed", K), C("added", H));
3061
3086
  }
3062
3087
  }
3063
- for (const [N, T] of z)
3064
- g.has(N) || F("added", I(T));
3065
- return x;
3088
+ for (const [F, A] of N)
3089
+ _.has(F) || C("added", I(A));
3090
+ return z;
3066
3091
  }
3067
- const _ = R(() => {
3092
+ const k = R(() => {
3068
3093
  const e = /* @__PURE__ */ new Map();
3069
- for (const V of i.value)
3070
- e.set(V.recipeId, f(V));
3094
+ for (const E of i.value)
3095
+ e.set(E.recipeId, f(E));
3071
3096
  return e;
3072
3097
  });
3073
3098
  function S(e) {
@@ -3086,7 +3111,7 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3086
3111
  return "";
3087
3112
  }
3088
3113
  }
3089
- function v(e) {
3114
+ function y(e) {
3090
3115
  switch (e) {
3091
3116
  case "will-update":
3092
3117
  return "success";
@@ -3102,154 +3127,154 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3102
3127
  return "neutral";
3103
3128
  }
3104
3129
  }
3105
- return (e, V) => {
3106
- const c = G("FmChip"), g = G("FmButton"), z = G("FmBanner"), x = G("FmIcon");
3107
- return b(), B("div", Bi, [
3108
- y("div", Ci, [
3109
- y("p", Fi, D(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
3110
- y("div", Ri, [
3111
- y("div", Ai, [
3112
- k(c, {
3130
+ return (e, E) => {
3131
+ const c = G("FmChip"), _ = G("FmButton"), N = G("FmBanner"), z = G("FmIcon");
3132
+ return b(), V("div", Ai, [
3133
+ v("div", Ti, [
3134
+ v("p", Ui, U(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
3135
+ v("div", Pi, [
3136
+ v("div", Mi, [
3137
+ h(c, {
3113
3138
  size: "sm",
3114
- label: String(a.value),
3139
+ label: String(r.value),
3115
3140
  variant: "success"
3116
3141
  }, null, 8, ["label"]),
3117
- y("span", Ti, D(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
3142
+ v("span", Di, U(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
3118
3143
  ]),
3119
- h.value > 0 ? (b(), B("div", Ui, [
3120
- k(c, {
3144
+ x.value > 0 ? (b(), V("div", Gi, [
3145
+ h(c, {
3121
3146
  size: "sm",
3122
- label: String(h.value),
3147
+ label: String(x.value),
3123
3148
  variant: "warning"
3124
3149
  }, null, 8, ["label"]),
3125
- y("span", Pi, D(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
3126
- ])) : U("", !0),
3127
- u.value > 0 ? (b(), B("div", Mi, [
3128
- k(c, {
3150
+ v("span", Ni, U(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
3151
+ ])) : T("", !0),
3152
+ u.value > 0 ? (b(), V("div", zi, [
3153
+ h(c, {
3129
3154
  size: "sm",
3130
3155
  label: String(u.value),
3131
3156
  variant: "info"
3132
3157
  }, null, 8, ["label"]),
3133
- y("span", Di, D(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
3134
- ])) : U("", !0),
3135
- o.value > 0 ? (b(), B("div", Gi, [
3136
- k(c, {
3158
+ v("span", Oi, U(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
3159
+ ])) : T("", !0),
3160
+ o.value > 0 ? (b(), V("div", Li, [
3161
+ h(c, {
3137
3162
  size: "sm",
3138
3163
  label: String(o.value),
3139
3164
  variant: "critical"
3140
3165
  }, null, 8, ["label"]),
3141
- y("span", Ni, D(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
3142
- ])) : U("", !0),
3143
- s.value > 0 ? (b(), B("div", zi, [
3144
- k(c, {
3166
+ v("span", ji, U(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
3167
+ ])) : T("", !0),
3168
+ s.value > 0 ? (b(), V("div", Ki, [
3169
+ h(c, {
3145
3170
  size: "sm",
3146
3171
  label: String(s.value),
3147
3172
  variant: "neutral"
3148
3173
  }, null, 8, ["label"]),
3149
- y("span", Oi, D(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
3150
- ])) : U("", !0)
3174
+ v("span", qi, U(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
3175
+ ])) : T("", !0)
3151
3176
  ]),
3152
- y("div", Li, [
3153
- k(g, {
3177
+ v("div", Wi, [
3178
+ h(_, {
3154
3179
  label: n(d)("common.export"),
3155
3180
  variant: "secondary",
3156
3181
  size: "md",
3157
- onClick: n(Si)
3182
+ onClick: n(Ri)
3158
3183
  }, null, 8, ["label", "onClick"])
3159
3184
  ]),
3160
- a.value === 0 && h.value === 0 ? (b(), Y(z, {
3185
+ r.value === 0 && x.value === 0 ? (b(), Y(N, {
3161
3186
  key: 0,
3162
3187
  class: "mt-12",
3163
3188
  type: "warning",
3164
3189
  message: n(d)("inventory.recipe.bulkEditor.summary.nothingToSubmit")
3165
- }, null, 8, ["message"])) : U("", !0)
3190
+ }, null, 8, ["message"])) : T("", !0)
3166
3191
  ]),
3167
- (b(!0), B(X, null, me(i.value, (w) => (b(), B("div", {
3168
- key: w.recipeId,
3192
+ (b(!0), V(X, null, me(i.value, (g) => (b(), V("div", {
3193
+ key: g.recipeId,
3169
3194
  class: "rounded-lg border border-fm-color-border-default overflow-hidden"
3170
3195
  }, [
3171
- y("button", {
3196
+ v("button", {
3172
3197
  type: "button",
3173
- class: Be(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !p(w.recipeId) }]),
3174
- onClick: (F) => $(w.recipeId)
3198
+ class: Be(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !p(g.recipeId) }]),
3199
+ onClick: (C) => $(g.recipeId)
3175
3200
  }, [
3176
- k(x, {
3177
- name: p(w.recipeId) ? "expand_less" : "expand_more",
3201
+ h(z, {
3202
+ name: p(g.recipeId) ? "expand_less" : "expand_more",
3178
3203
  size: "sm",
3179
3204
  class: "text-fm-color-typo-secondary flex-shrink-0"
3180
3205
  }, null, 8, ["name"]),
3181
- y("span", Ki, D(w.recipeName), 1),
3182
- w.original.version === "v2" ? (b(), Y(c, {
3206
+ v("span", Ji, U(g.recipeName), 1),
3207
+ g.original.version === "v2" ? (b(), Y(c, {
3183
3208
  key: 0,
3184
3209
  size: "sm",
3185
3210
  label: "V2",
3186
3211
  variant: "info"
3187
- })) : U("", !0),
3188
- k(c, {
3212
+ })) : T("", !0),
3213
+ h(c, {
3189
3214
  size: "sm",
3190
- label: S(w.status),
3191
- variant: v(w.status)
3215
+ label: S(g.status),
3216
+ variant: y(g.status)
3192
3217
  }, null, 8, ["label", "variant"])
3193
- ], 10, ji),
3194
- p(w.recipeId) ? (b(), B(X, { key: 0 }, [
3195
- n(t).applyErrors.has(w.recipeId) ? (b(), B("div", qi, [
3196
- k(z, {
3218
+ ], 10, Yi),
3219
+ p(g.recipeId) ? (b(), V(X, { key: 0 }, [
3220
+ n(t).applyErrors.has(g.recipeId) ? (b(), V("div", Hi, [
3221
+ h(N, {
3197
3222
  type: "error",
3198
- message: n(t).applyErrors.get(w.recipeId)
3223
+ message: n(t).applyErrors.get(g.recipeId)
3199
3224
  }, null, 8, ["message"])
3200
- ])) : U("", !0),
3201
- y("div", Wi, [
3202
- w.projected ? (_.value.get(w.recipeId) ?? []).length > 0 ? (b(!0), B(X, { key: 1 }, me(_.value.get(w.recipeId), (F, N) => (b(), B("span", {
3203
- key: N,
3225
+ ])) : T("", !0),
3226
+ v("div", Qi, [
3227
+ g.projected ? (k.value.get(g.recipeId) ?? []).length > 0 ? (b(!0), V(X, { key: 1 }, me(k.value.get(g.recipeId), (C, F) => (b(), V("span", {
3228
+ key: F,
3204
3229
  class: Be(["fm-typo-en-body-sm-400", {
3205
- "text-fm-color-typo-secondary": F.kind === "unchanged",
3206
- "line-through text-fm-color-error font-medium": F.kind === "removed",
3207
- "text-fm-color-success font-medium": F.kind === "added"
3230
+ "text-fm-color-typo-secondary": C.kind === "unchanged",
3231
+ "line-through text-fm-color-error font-medium": C.kind === "removed",
3232
+ "text-fm-color-success font-medium": C.kind === "added"
3208
3233
  }])
3209
- }, D(F.text), 3))), 128)) : (b(), B("span", Yi, D(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (b(!0), B(X, { key: 0 }, me(C(w.original), (F, N) => (b(), B("span", {
3210
- key: N,
3234
+ }, U(C.text), 3))), 128)) : (b(), V("span", Xi, U(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (b(!0), V(X, { key: 0 }, me(B(g.original), (C, F) => (b(), V("span", {
3235
+ key: F,
3211
3236
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
3212
- }, D(F.text), 1))), 128))
3237
+ }, U(C.text), 1))), 128))
3213
3238
  ]),
3214
- y("div", Ji, [
3215
- w.counts.applied > 0 ? (b(), B("span", Hi, D(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: w.counts.applied })), 1)) : U("", !0),
3216
- w.counts.satisfied > 0 ? (b(), B("span", Qi, D(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: w.counts.satisfied })), 1)) : U("", !0),
3217
- w.counts.ignored > 0 ? (b(), B("span", Xi, D(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: w.counts.ignored })), 1)) : U("", !0),
3218
- w.counts.blocked > 0 ? (b(), B("span", Zi, D(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: w.counts.blocked })), 1)) : U("", !0),
3219
- w.counts.applied === 0 && w.counts.satisfied === 0 && w.counts.ignored === 0 && w.counts.blocked === 0 ? (b(), B("span", el, D(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : U("", !0)
3239
+ v("div", Zi, [
3240
+ g.counts.applied > 0 ? (b(), V("span", el, U(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: g.counts.applied })), 1)) : T("", !0),
3241
+ g.counts.satisfied > 0 ? (b(), V("span", tl, U(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: g.counts.satisfied })), 1)) : T("", !0),
3242
+ g.counts.ignored > 0 ? (b(), V("span", nl, U(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: g.counts.ignored })), 1)) : T("", !0),
3243
+ g.counts.blocked > 0 ? (b(), V("span", ol, U(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: g.counts.blocked })), 1)) : T("", !0),
3244
+ g.counts.applied === 0 && g.counts.satisfied === 0 && g.counts.ignored === 0 && g.counts.blocked === 0 ? (b(), V("span", il, U(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : T("", !0)
3220
3245
  ])
3221
- ], 64)) : U("", !0)
3246
+ ], 64)) : T("", !0)
3222
3247
  ]))), 128))
3223
3248
  ]);
3224
3249
  };
3225
3250
  }
3226
- }), nl = { class: "flex items-center gap-12" }, ol = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, il = {
3251
+ }), rl = { class: "flex items-center gap-12" }, al = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, sl = {
3227
3252
  key: 0,
3228
3253
  class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
3229
- }, ll = {
3254
+ }, dl = {
3230
3255
  key: 1,
3231
3256
  class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
3232
- }, al = {
3257
+ }, ul = {
3233
3258
  key: 2,
3234
3259
  class: "h-[calc(98vh-120px)] overflow-y-auto px-24 py-20"
3235
- }, rl = {
3260
+ }, cl = {
3236
3261
  key: 0,
3237
3262
  class: "flex items-center gap-8 px-4"
3238
- }, sl = {
3263
+ }, pl = {
3239
3264
  key: 1,
3240
3265
  class: "flex items-center gap-8 px-4"
3241
- }, dl = {
3266
+ }, ml = {
3242
3267
  key: 2,
3243
3268
  class: "flex items-center gap-8 px-4"
3244
- }, ul = /* @__PURE__ */ ie({
3269
+ }, fl = /* @__PURE__ */ le({
3245
3270
  __name: "RecipeBulkEditorDialog",
3246
3271
  props: {
3247
3272
  show: { type: Boolean }
3248
3273
  },
3249
3274
  emits: ["update:show"],
3250
3275
  setup(m, { emit: d }) {
3251
- const l = m, { t } = oe(), i = ge(), a = Ge(l, "show"), h = Le(), u = R(() => i.currentStep === 1), o = R(() => i.currentStep === 2), s = R(() => i.currentStep === 3);
3252
- function r() {
3276
+ const l = m, { t } = ie(), i = ge(), r = Ge(l, "show"), x = Le(), u = R(() => i.currentStep === 1), o = R(() => i.currentStep === 2), s = R(() => i.currentStep === 3);
3277
+ function a() {
3253
3278
  i.currentStep = 2;
3254
3279
  }
3255
3280
  function p() {
@@ -3258,11 +3283,11 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3258
3283
  function $() {
3259
3284
  i.goToStep3();
3260
3285
  }
3261
- function C() {
3286
+ function B() {
3262
3287
  i.backToStep2();
3263
3288
  }
3264
3289
  function I() {
3265
- h.open({
3290
+ x.open({
3266
3291
  title: t("inventory.recipe.bulkEditor.step3.confirmTitle"),
3267
3292
  message: t("inventory.recipe.bulkEditor.step3.confirmMessage"),
3268
3293
  primaryActions: {
@@ -3279,14 +3304,14 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3279
3304
  });
3280
3305
  }
3281
3306
  function f() {
3282
- a.value = !1, i.reset();
3307
+ r.value = !1, i.reset();
3283
3308
  }
3284
- return (_, S) => {
3285
- const v = G("FmChip"), e = G("FmButton"), V = G("FmDialog");
3286
- return b(), Y(V, {
3287
- modelValue: n(a),
3309
+ return (k, S) => {
3310
+ const y = G("FmChip"), e = G("FmButton"), E = G("FmDialog");
3311
+ return b(), Y(E, {
3312
+ modelValue: n(r),
3288
3313
  "onUpdate:modelValue": [
3289
- S[0] || (S[0] = (c) => De(a) ? a.value = c : null),
3314
+ S[0] || (S[0] = (c) => De(r) ? r.value = c : null),
3290
3315
  S[1] || (S[1] = (c) => {
3291
3316
  c || n(i).reset();
3292
3317
  })
@@ -3297,9 +3322,9 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3297
3322
  "max-height": "98vh"
3298
3323
  }, {
3299
3324
  "dialog-header": J(() => [
3300
- y("div", nl, [
3301
- y("span", ol, D(n(t)("inventory.recipe.bulkEditor.title")), 1),
3302
- k(v, {
3325
+ v("div", rl, [
3326
+ v("span", al, U(n(t)("inventory.recipe.bulkEditor.title")), 1),
3327
+ h(y, {
3303
3328
  size: "sm",
3304
3329
  label: n(t)("inventory.recipe.bulkEditor.stepIndicator", { step: n(i).currentStep, total: 3 }),
3305
3330
  variant: "neutral"
@@ -3307,118 +3332,118 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3307
3332
  ])
3308
3333
  ]),
3309
3334
  "dialog-footer": J(() => [
3310
- u.value ? (b(), B("div", rl, [
3311
- k(e, {
3335
+ u.value ? (b(), V("div", cl, [
3336
+ h(e, {
3312
3337
  label: n(t)("common.next"),
3313
3338
  disabled: !n(i).canGoToStep2,
3314
- onClick: r
3339
+ onClick: a
3315
3340
  }, null, 8, ["label", "disabled"]),
3316
- k(e, {
3341
+ h(e, {
3317
3342
  label: n(t)("common.close"),
3318
3343
  variant: "tertiary",
3319
3344
  onClick: f
3320
3345
  }, null, 8, ["label"])
3321
- ])) : o.value ? (b(), B("div", sl, [
3322
- k(e, {
3346
+ ])) : o.value ? (b(), V("div", pl, [
3347
+ h(e, {
3323
3348
  label: n(t)("inventory.recipe.bulkEditor.step2.reviewButton"),
3324
3349
  disabled: !n(i).canGoToStep3,
3325
3350
  onClick: $
3326
3351
  }, null, 8, ["label", "disabled"]),
3327
- k(e, {
3352
+ h(e, {
3328
3353
  label: n(t)("common.back"),
3329
3354
  variant: "secondary",
3330
3355
  onClick: p
3331
3356
  }, null, 8, ["label"]),
3332
- k(e, {
3357
+ h(e, {
3333
3358
  label: n(t)("common.close"),
3334
3359
  variant: "tertiary",
3335
3360
  onClick: f
3336
3361
  }, null, 8, ["label"])
3337
- ])) : s.value ? (b(), B("div", dl, [
3338
- k(e, {
3362
+ ])) : s.value ? (b(), V("div", ml, [
3363
+ h(e, {
3339
3364
  label: n(t)("inventory.recipe.bulkEditor.step3.confirmButton"),
3340
3365
  disabled: n(i).isSaving,
3341
3366
  loading: n(i).isSaving,
3342
3367
  onClick: I
3343
3368
  }, null, 8, ["label", "disabled", "loading"]),
3344
- k(e, {
3369
+ h(e, {
3345
3370
  label: n(t)("common.back"),
3346
3371
  variant: "secondary",
3347
3372
  disabled: n(i).isSaving,
3348
- onClick: C
3373
+ onClick: B
3349
3374
  }, null, 8, ["label", "disabled"]),
3350
- k(e, {
3375
+ h(e, {
3351
3376
  label: n(t)("common.close"),
3352
3377
  variant: "tertiary",
3353
3378
  disabled: n(i).isSaving,
3354
3379
  onClick: f
3355
3380
  }, null, 8, ["label", "disabled"])
3356
- ])) : U("", !0)
3381
+ ])) : T("", !0)
3357
3382
  ]),
3358
3383
  default: J(() => [
3359
- u.value ? (b(), B("div", il, [
3360
- k(Mo)
3361
- ])) : o.value ? (b(), B("div", ll, [
3362
- k(Ei)
3363
- ])) : s.value ? (b(), B("div", al, [
3364
- k(tl)
3365
- ])) : U("", !0)
3384
+ u.value ? (b(), V("div", sl, [
3385
+ h(zo)
3386
+ ])) : o.value ? (b(), V("div", dl, [
3387
+ h(Ci)
3388
+ ])) : s.value ? (b(), V("div", ul, [
3389
+ h(ll)
3390
+ ])) : T("", !0)
3366
3391
  ]),
3367
3392
  _: 1
3368
3393
  }, 8, ["modelValue"]);
3369
3394
  };
3370
3395
  }
3371
3396
  });
3372
- function cl(m) {
3397
+ function vl(m) {
3373
3398
  return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
3374
3399
  }
3375
- function pl() {
3376
- const m = ne(), d = m.recipes, l = m.recipeById, t = m.skuById, i = m.skuGroupById, a = d.flatMap((o, s) => {
3400
+ function yl() {
3401
+ const m = ne(), d = m.recipes, l = m.recipeById, t = m.skuById, i = m.skuGroupById, r = d.flatMap((o, s) => {
3377
3402
  var p;
3378
- const r = cl(o.customAttributes);
3403
+ const a = vl(o.customAttributes);
3379
3404
  if ((p = o.contains) != null && p.length) {
3380
- const $ = o.contains.filter((f) => f.type === "RECIPE"), C = o.contains.filter((f) => f.type === "SKU"), I = o.contains.filter((f) => f.type === "SKU_GROUP");
3405
+ const $ = o.contains.filter((f) => f.type === "RECIPE"), B = o.contains.filter((f) => f.type === "SKU"), I = o.contains.filter((f) => f.type === "SKU_GROUP");
3381
3406
  return [
3382
3407
  ...s === 0 ? [] : [["", "", "", "", "", "", ""]],
3383
3408
  ...$.map(
3384
- (f, _) => {
3409
+ (f, k) => {
3385
3410
  var S;
3386
3411
  return [
3387
- _ === 0 ? o.name : "",
3412
+ k === 0 ? o.name : "",
3388
3413
  "RECIPE",
3389
3414
  "",
3390
3415
  (S = l[f.id]) == null ? void 0 : S.name,
3391
3416
  Q(f.amount),
3392
3417
  "UNIT",
3393
- _ === 0 ? r : ""
3418
+ k === 0 ? a : ""
3394
3419
  ];
3395
3420
  }
3396
3421
  ),
3397
- ...C.map(
3398
- (f, _) => {
3399
- var S, v, e, V;
3422
+ ...B.map(
3423
+ (f, k) => {
3424
+ var S, y, e, E;
3400
3425
  return [
3401
- !$.length && _ === 0 ? o.name : "",
3426
+ !$.length && k === 0 ? o.name : "",
3402
3427
  "INGREDIENT",
3403
3428
  (S = t[f.id]) == null ? void 0 : S.code,
3404
- (v = t[f.id]) == null ? void 0 : v.name,
3429
+ (y = t[f.id]) == null ? void 0 : y.name,
3405
3430
  Q(f.amount),
3406
- f.measurement ? f.measurement.abbrev : (V = (e = t[f.id]) == null ? void 0 : e.unit) == null ? void 0 : V.abbrev,
3407
- !$.length && _ === 0 ? r : ""
3431
+ f.measurement ? f.measurement.abbrev : (E = (e = t[f.id]) == null ? void 0 : e.unit) == null ? void 0 : E.abbrev,
3432
+ !$.length && k === 0 ? a : ""
3408
3433
  ];
3409
3434
  }
3410
3435
  ),
3411
3436
  ...I.map(
3412
- (f, _) => {
3413
- var S, v;
3437
+ (f, k) => {
3438
+ var S, y;
3414
3439
  return [
3415
- $.length === 0 && C.length === 0 && _ === 0 ? o.name : "",
3440
+ $.length === 0 && B.length === 0 && k === 0 ? o.name : "",
3416
3441
  "SKU_GROUP",
3417
3442
  ((S = i[f.id]) == null ? void 0 : S.ref) || "",
3418
- (v = i[f.id]) == null ? void 0 : v.name,
3443
+ (y = i[f.id]) == null ? void 0 : y.name,
3419
3444
  Q(f.amount),
3420
3445
  "UNIT",
3421
- $.length === 0 && C.length === 0 && _ === 0 ? r : ""
3446
+ $.length === 0 && B.length === 0 && k === 0 ? a : ""
3422
3447
  ];
3423
3448
  }
3424
3449
  )
@@ -3426,42 +3451,42 @@ function pl() {
3426
3451
  }
3427
3452
  return [
3428
3453
  ...s === 0 ? [] : [["", "", "", "", "", "", ""]],
3429
- [o.name, "No bindings", "", "", "", "", r]
3454
+ [o.name, "No bindings", "", "", "", "", a]
3430
3455
  ];
3431
- }), u = rt(a, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
3456
+ }), u = at(r, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
3432
3457
  st(u, `RECIPE_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
3433
3458
  }
3434
- const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, vl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kl = /* @__PURE__ */ ie({
3459
+ const bl = { class: "flex flex-col py-8" }, gl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, _l = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jl = /* @__PURE__ */ le({
3435
3460
  __name: "RecipeView",
3436
3461
  setup(m) {
3437
- const d = ne(), l = R(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: a } = ze(), { recipeDialogProps: h, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), r = R(() => s(l.value)), p = ge(), $ = We();
3438
- K(!1);
3439
- function C(c) {
3462
+ const d = ne(), l = R(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: r } = ze(), { recipeDialogProps: x, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), a = R(() => s(l.value)), p = ge(), $ = We();
3463
+ W(!1);
3464
+ function B(c) {
3440
3465
  if (c === "add")
3441
3466
  return i();
3442
3467
  if (c === "export")
3443
- return pl();
3468
+ return yl();
3444
3469
  c === "bulk-edit" && p.openDialog();
3445
3470
  }
3446
- const I = K(""), f = R(() => u.value), { breakpoints: _ } = xt(), S = R(() => _.value.xs || _.value.sm), v = R(() => S.value ? 10 : 20), e = Bt(), { t: V } = oe();
3447
- return (c, g) => {
3448
- const z = G("FmTable");
3471
+ const I = W(""), f = R(() => u.value), { breakpoints: k } = xt(), S = R(() => k.value.xs || k.value.sm), y = R(() => S.value ? 10 : 20), e = Bt(), { t: E } = ie();
3472
+ return (c, _) => {
3473
+ const N = G("FmTable");
3449
3474
  return b(), Y(Ct, {
3450
- title: n(V)("inventory.recipe.title"),
3475
+ title: n(E)("inventory.recipe.title"),
3451
3476
  actions: [
3452
3477
  {
3453
- label: n(V)("inventory.recipe.create.title"),
3478
+ label: n(E)("inventory.recipe.create.title"),
3454
3479
  value: "add",
3455
3480
  isPrimary: !0,
3456
3481
  prependIcon: "add"
3457
3482
  },
3458
- ...n($).enableBulkEditRecipes ? [{ label: n(V)("inventory.recipe.bulkEditor.title"), value: "bulk-edit", isPrimary: !1 }] : [],
3459
- { label: n(V)("common.export"), value: "export", isPrimary: !1 }
3483
+ ...n($).enableBulkEditRecipes ? [{ label: n(E)("inventory.recipe.bulkEditor.title"), value: "bulk-edit", isPrimary: !1 }] : [],
3484
+ { label: n(E)("common.export"), value: "export", isPrimary: !1 }
3460
3485
  ],
3461
- "onClick:action": C
3486
+ "onClick:action": B
3462
3487
  }, {
3463
3488
  default: J(() => [
3464
- y("div", {
3489
+ v("div", {
3465
3490
  class: Be([
3466
3491
  "flex flex-col gap-8 max-h-full",
3467
3492
  {
@@ -3470,40 +3495,40 @@ const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-60
3470
3495
  }
3471
3496
  ])
3472
3497
  }, [
3473
- k(jt, {
3498
+ h(jt, {
3474
3499
  searchable: "",
3475
3500
  search: I.value,
3476
- "onUpdate:search": g[0] || (g[0] = (x) => I.value = x)
3501
+ "onUpdate:search": _[0] || (_[0] = (z) => I.value = z)
3477
3502
  }, null, 8, ["search"]),
3478
- (b(), Y(z, {
3503
+ (b(), Y(N, {
3479
3504
  style: vt(n(e).tableHeight),
3480
3505
  "column-defs": n(o),
3481
- "row-data": r.value,
3506
+ "row-data": a.value,
3482
3507
  "search-value": I.value,
3483
3508
  loading: !n(t)._currentLocation || f.value,
3484
- onRowClick: g[1] || (g[1] = (x) => n(a)(x.original.original)),
3509
+ onRowClick: _[1] || (_[1] = (z) => n(r)(z.original.original)),
3485
3510
  key: l.value.length,
3486
- "page-size": v.value
3511
+ "page-size": y.value
3487
3512
  }, {
3488
- "list-row": J((x) => [
3489
- k(Lt, {
3490
- row: x,
3491
- onRowClick: (w) => n(a)(w.original)
3513
+ "list-row": J((z) => [
3514
+ h(Lt, {
3515
+ row: z,
3516
+ onRowClick: (g) => n(r)(g.original)
3492
3517
  }, {
3493
- default: J((w) => {
3494
- var F, N, T, P, W, H, Z, A, L, O;
3518
+ default: J((g) => {
3519
+ var C, F, A, P, K, H, ee, O, D, L;
3495
3520
  return [
3496
- y("div", ml, [
3497
- y("div", fl, [
3498
- k(n(Qe), {
3499
- render: (T = (N = (F = w.recipe) == null ? void 0 : F.column) == null ? void 0 : N.columnDef) == null ? void 0 : T.cell,
3500
- props: (W = (P = w.recipe) == null ? void 0 : P.getContext) == null ? void 0 : W.call(P)
3521
+ v("div", bl, [
3522
+ v("div", gl, [
3523
+ h(n(Qe), {
3524
+ render: (A = (F = (C = g.recipe) == null ? void 0 : C.column) == null ? void 0 : F.columnDef) == null ? void 0 : A.cell,
3525
+ props: (K = (P = g.recipe) == null ? void 0 : P.getContext) == null ? void 0 : K.call(P)
3501
3526
  }, null, 8, ["render", "props"])
3502
3527
  ]),
3503
- y("div", vl, [
3504
- k(n(Qe), {
3505
- render: (A = (Z = (H = w.ingredients) == null ? void 0 : H.column) == null ? void 0 : Z.columnDef) == null ? void 0 : A.cell,
3506
- props: (O = (L = w.ingredients) == null ? void 0 : L.getContext) == null ? void 0 : O.call(L)
3528
+ v("div", _l, [
3529
+ h(n(Qe), {
3530
+ render: (O = (ee = (H = g.ingredients) == null ? void 0 : H.column) == null ? void 0 : ee.columnDef) == null ? void 0 : O.cell,
3531
+ props: (L = (D = g.ingredients) == null ? void 0 : D.getContext) == null ? void 0 : L.call(D)
3507
3532
  }, null, 8, ["render", "props"])
3508
3533
  ])
3509
3534
  ])
@@ -3516,12 +3541,12 @@ const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-60
3516
3541
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
3517
3542
  ], 2),
3518
3543
  (b(), Y(yt, { to: "body" }, [
3519
- k(uo, bt(gt(n(h))), null, 16),
3520
- n($).enableBulkEditRecipes ? (b(), Y(ul, {
3544
+ h(fo, bt(gt(n(x))), null, 16),
3545
+ n($).enableBulkEditRecipes ? (b(), Y(fl, {
3521
3546
  key: 0,
3522
3547
  show: n(p).show,
3523
- "onUpdate:show": g[2] || (g[2] = (x) => n(p).show = x)
3524
- }, null, 8, ["show"])) : U("", !0)
3548
+ "onUpdate:show": _[2] || (_[2] = (z) => n(p).show = z)
3549
+ }, null, 8, ["show"])) : T("", !0)
3525
3550
  ]))
3526
3551
  ]),
3527
3552
  _: 1
@@ -3530,5 +3555,5 @@ const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-60
3530
3555
  }
3531
3556
  });
3532
3557
  export {
3533
- Kl as default
3558
+ Jl as default
3534
3559
  };