@feedmepos/mf-inventory-portal 1.2.9 → 1.2.10-dev.1

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 (51) hide show
  1. package/dist/{App-XpX30-FV.js → App-Bg2M5RwP.js} +1 -1
  2. package/dist/{ApprovalView-D2J7D_Nm.js → ApprovalView-C46UDXnc.js} +24 -24
  3. package/dist/{BindingsDialog-Uso69RV0.js → BindingsDialog-CtJjpbw-.js} +2 -2
  4. package/dist/{BindingsPicker-7w_Pih9R.js → BindingsPicker-B6Er5Lea.js} +1 -1
  5. package/dist/{BindingsTable-CbV4JqKs.js → BindingsTable-MPeTr_ip.js} +1 -1
  6. package/dist/{ClosingDraftView-Cs1hLPBv.js → ClosingDraftView-BaD3MLeG.js} +33 -33
  7. package/dist/{ClosingTemplateView-CzDxdTM8.js → ClosingTemplateView-C4z3GXwd.js} +3 -3
  8. package/dist/{DeliveryOrderPrintPreview-hVu8tti_.js → DeliveryOrderPrintPreview-BfafKFMa.js} +8 -8
  9. package/dist/{FmAdminBadge-UDCFElb7.js → FmAdminBadge-Dg5rl1fj.js} +4 -4
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CeEFXW2z.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BATVvC9u.js} +11 -11
  11. package/dist/{FmMultiselectDialog-Bevvx1r8.js → FmMultiselectDialog-DJ-dIe8C.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C0mdy9Mc.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BBWaPrlm.js} +38 -38
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BKIf5UrZ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-oaujHoaU.js} +1 -1
  14. package/dist/{IngredientGroupView-_eiXCYvr.js → IngredientGroupView-u4ubHtNF.js} +15 -15
  15. package/dist/{IngredientsView-okGkhfX0.js → IngredientsView-CXbJifY6.js} +831 -809
  16. package/dist/{IntegrationView-DYNRksif.js → IntegrationView-XEypfcAW.js} +137 -137
  17. package/dist/{InventoryBindingForm-DyFPXbNg.js → InventoryBindingForm-CETOb5Nj.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-1AvpT307.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DC52GJ2Y.js} +22 -22
  19. package/dist/{InventoryBindingSummary-BnzY__W8.js → InventoryBindingSummary-DbyJW8z0.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-iCRT5ZID.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BQWWQxaq.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CxhPTM5O.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BruydtsG.js} +9 -9
  22. package/dist/{PublishView-BGI8t6ZI.js → PublishView-Cl3IluMR.js} +12 -12
  23. package/dist/{PurchaseOrderPrintPreview-BY0m_m2t.js → PurchaseOrderPrintPreview-BG_uBL4o.js} +7 -7
  24. package/dist/{ReceiveRequestView-BN63OwrJ.js → ReceiveRequestView-BvGlUVTp.js} +191 -191
  25. package/dist/{RecipeView-C6SFIYEV.js → RecipeView-C-7XU5F8.js} +12 -12
  26. package/dist/{StockView-DxAqF_Uz.js → StockView-rYhlg4fr.js} +680 -665
  27. package/dist/SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D0kASPO9.js +158 -0
  28. package/dist/{SupplierView-BGWP3TQ0.js → SupplierView-BoGoqUS-.js} +4 -4
  29. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Dr6Bst81.js → TransferDetails.vue_vue_type_script_setup_true_lang-D53vhWDq.js} +6 -6
  30. package/dist/{TransferTemplateView-CSMou2uQ.js → TransferTemplateView-DZIDXFp7.js} +143 -143
  31. package/dist/{UnitView-Dvn2OFBI.js → UnitView-CvHIFkue.js} +27 -27
  32. package/dist/{WarehouseView-DFIFxlqz.js → WarehouseView-Dh_WZz5L.js} +18 -18
  33. package/dist/{app-cExTkfVB.js → app-BT34Yv61.js} +9120 -9069
  34. package/dist/app.d.ts +6 -6
  35. package/dist/app.js +4 -4
  36. package/dist/{closing-template-CIbh7GpK.js → closing-template-JDCk0_lU.js} +1 -1
  37. package/dist/{decimal-DDB6xkYA.js → decimal-BTgTm2JD.js} +1 -1
  38. package/dist/{format-unit-display-C5nl2Pn9.js → format-unit-display-HHCA1rN3.js} +48 -48
  39. package/dist/{index-5McubZjo.js → index-Bz_lEYOD.js} +1 -1
  40. package/dist/{index-CYvmWIx7.js → index-CdamrmzX.js} +1 -1
  41. package/dist/{purchase-order-template-DqsMgrgI.js → purchase-order-template-DJiYiY6t.js} +1 -1
  42. package/dist/{stock-DzSlKGZm.js → stock-C8afHO4C.js} +1 -1
  43. package/dist/stores/integration/netsuite.d.ts +1 -0
  44. package/dist/{supplier-m9aBkFoK.js → supplier-C8RMKqQX.js} +1 -1
  45. package/dist/tsconfig.app.tsbuildinfo +1 -1
  46. package/dist/{use-ingredient-select-dialog-et1B0WDI.js → use-ingredient-select-dialog-fLK9yq-0.js} +1 -1
  47. package/dist/{use-inventory-binding-dialog-B7_YL7HE.js → use-inventory-binding-dialog--7tzpXgV.js} +1 -1
  48. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialogProps.d.ts +1 -1
  49. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +2 -0
  50. package/package.json +1 -1
  51. package/dist/StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js +0 -59
@@ -1,27 +1,27 @@
1
- import { defineComponent as ce, ref as N, computed as P, resolveComponent as j, openBlock as x, createBlock as z, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as b, createVNode as g, createElementBlock as O, Fragment as ee, renderList as re, unref as i, h as ke, watch as xe, isRef as Ue, createCommentVNode as ae, reactive as it, mergeModels as Ye, useModel as ut, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
- import { u as pe, a0 as dt, f as He, h as mt, a as Pe, F as Ge, a1 as pt, w as Ie, k as me, X as ft, t as Se, $ as Fe, A as vt, M as yt, Z as ve, a2 as _t, a3 as ne, a4 as kt, a5 as Ke, o as bt, s as ht, a6 as gt, a7 as xt, a8 as St, a9 as Ce, aa as Ft, ab as et, Y as q, ac as wt, z as tt, ad as be, ae as $t, af as At, q as Be, n as We, r as Vt, c as Ct, ag as Bt, ah as Mt, ai as Dt, aj as jt, ak as It, b as Tt, K as Ut, _ as Et, L as Ht, O as Pt, P as qe } from "./app-cExTkfVB.js";
3
- import { u as Re, a as ye } from "./stock-DzSlKGZm.js";
4
- import { g as we } from "./decimal-DDB6xkYA.js";
5
- import { e as Rt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CxhPTM5O.js";
6
- import { _ as Te, S as Me, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
7
- import { _ as Ot } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
1
+ import { defineComponent as ce, ref as N, computed as P, resolveComponent as j, openBlock as S, createBlock as z, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as g, createElementBlock as R, Fragment as te, renderList as ie, unref as i, h as be, watch as xe, isRef as Ue, createCommentVNode as oe, reactive as it, mergeModels as Ye, useModel as ut, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
+ import { u as pe, a1 as dt, f as He, h as mt, a as Pe, F as Ge, a2 as pt, w as Ie, k as me, Y as ft, t as Se, a0 as Fe, A as vt, M as yt, $ as ve, a3 as _t, a4 as se, a5 as bt, a6 as Ke, o as kt, s as ht, a7 as gt, a8 as xt, a9 as St, aa as Ce, ab as Ft, ac as et, Z as q, ad as wt, z as tt, ae as ke, af as $t, ag as At, q as Be, n as We, r as Vt, c as Ct, ah as Bt, ai as Mt, aj as Dt, ak as jt, al as It, b as Tt, K as Ut, L as Et, O as Ht, P as Pt, Q as qe } from "./app-BT34Yv61.js";
3
+ import { u as Re, a as ye } from "./stock-C8afHO4C.js";
4
+ import { g as we } from "./decimal-BTgTm2JD.js";
5
+ import { e as Rt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BruydtsG.js";
6
+ import { _ as Te, S as Me, g as st, a as Ot } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D0kASPO9.js";
7
+ import { _ as Nt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
8
8
  import { useI18n as de, useCoreStore as at } from "@feedmepos/mf-common";
9
- import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as Nt } from "@feedmepos/ui-library";
10
- import { defineStore as Lt } from "pinia";
11
- import { u as zt } from "./use-inventory-binding-dialog-B7_YL7HE.js";
12
- import { _ as Yt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-iCRT5ZID.js";
13
- import { E as Gt } from "./empty-placeholder-wf6-BWE8.js";
14
- import { F as Kt } from "./FmAdminBadge-UDCFElb7.js";
9
+ import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as Lt } from "@feedmepos/ui-library";
10
+ import { defineStore as zt } from "pinia";
11
+ import { u as Yt } from "./use-inventory-binding-dialog--7tzpXgV.js";
12
+ import { _ as Gt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BQWWQxaq.js";
13
+ import { E as Kt } from "./empty-placeholder-wf6-BWE8.js";
14
+ import { F as Wt } from "./FmAdminBadge-Dg5rl1fj.js";
15
15
  import "./array-Ca8T3f_G.js";
16
- var he = /* @__PURE__ */ ((_) => (_.History = "History", _.Convert = "Convert", _.Adjust = "Adjust", _))(he || {});
17
- const Wt = [
16
+ var he = /* @__PURE__ */ ((b) => (b.History = "History", b.Convert = "Convert", b.Adjust = "Adjust", b))(he || {});
17
+ const qt = [
18
18
  {
19
19
  translationKey: "inventory.stock.action.history",
20
20
  color: "text-neutral-700",
21
21
  value: "History"
22
22
  /* History */
23
23
  }
24
- ], qt = [
24
+ ], Xt = [
25
25
  {
26
26
  translationKey: "inventory.stock.action.history",
27
27
  color: "text-neutral-700",
@@ -41,7 +41,7 @@ const Wt = [
41
41
  /* Adjust */
42
42
  }
43
43
  ];
44
- async function Xt(_) {
44
+ async function Qt(b) {
45
45
  const c = `${(pe().currentLocation.name || "").replace(
46
46
  / /g,
47
47
  "_"
@@ -50,7 +50,7 @@ async function Xt(_) {
50
50
  [
51
51
  {
52
52
  name: "stock",
53
- data: _,
53
+ data: b,
54
54
  columns: [
55
55
  {
56
56
  name: "Code",
@@ -62,17 +62,17 @@ async function Xt(_) {
62
62
  },
63
63
  {
64
64
  name: "Balance",
65
- selector: (s) => {
66
- const A = $e(s, s.unit);
67
- return A.type === "unit" ? we(s.balance, s.unit, null, !1) : we(s.balance, s.unit, A.measurement, !1);
65
+ selector: (o) => {
66
+ const A = $e(o, o.unit);
67
+ return A.type === "unit" ? we(o.balance, o.unit, null, !1) : we(o.balance, o.unit, A.measurement, !1);
68
68
  }
69
69
  },
70
70
  {
71
71
  name: "Unit",
72
- selector: (s) => {
73
- var m;
74
- const A = $e(s, s.unit);
75
- return A.type === "unit" ? s.unit.abbrev : ((m = s.unit.measurements.find((d) => d.id === A.measurement)) == null ? void 0 : m.abbrev) || "";
72
+ selector: (o) => {
73
+ var p;
74
+ const A = $e(o, o.unit);
75
+ return A.type === "unit" ? o.unit.abbrev : ((p = o.unit.measurements.find((m) => m.id === A.measurement)) == null ? void 0 : p.abbrev) || "";
76
76
  }
77
77
  }
78
78
  ]
@@ -81,18 +81,18 @@ async function Xt(_) {
81
81
  c
82
82
  );
83
83
  }
84
- function $e(_, h) {
85
- const c = localStorage.getItem(`uom:${_._id}`);
84
+ function $e(b, h) {
85
+ const c = localStorage.getItem(`uom:${b._id}`);
86
86
  return c ? c === h._id ? {
87
87
  type: "unit"
88
- } : h.measurements.find((s) => s.id === c) ? {
88
+ } : h.measurements.find((o) => o.id === c) ? {
89
89
  type: "measurement",
90
90
  measurement: c
91
91
  } : {
92
92
  type: "unit"
93
- } : _.trackingMeasurement && h.measurements.find((s) => s.id === _.trackingMeasurement) ? {
93
+ } : b.trackingMeasurement && h.measurements.find((o) => o.id === b.trackingMeasurement) ? {
94
94
  type: "measurement",
95
- measurement: _.trackingMeasurement
95
+ measurement: b.trackingMeasurement
96
96
  } : {
97
97
  type: "unit"
98
98
  };
@@ -105,62 +105,62 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
105
105
  amount: {},
106
106
  defaultTrackingMeasurement: {}
107
107
  },
108
- setup(_) {
108
+ setup(b) {
109
109
  function h(C) {
110
110
  return `uom:${C._id}`;
111
111
  }
112
112
  function c(C) {
113
- const l = h(s.sku);
114
- C ? localStorage.setItem(l, C) : localStorage.setItem(l, s.unit._id), A.value = $e(s.sku, s.unit);
113
+ const l = h(o.sku);
114
+ C ? localStorage.setItem(l, C) : localStorage.setItem(l, o.unit._id), A.value = $e(o.sku, o.unit);
115
115
  }
116
- const s = _, A = N($e(s.sku, s.unit)), m = P(() => {
117
- const { measurements: C } = s.unit;
116
+ const o = b, A = N($e(o.sku, o.unit)), p = P(() => {
117
+ const { measurements: C } = o.unit;
118
118
  return [
119
119
  {
120
- label: `${we(s.amount, s.unit)}`,
120
+ label: `${we(o.amount, o.unit)}`,
121
121
  value: null
122
122
  },
123
123
  ...C.map(({ id: l }) => ({
124
- label: `${we(s.amount, s.unit, l)}`,
124
+ label: `${we(o.amount, o.unit, l)}`,
125
125
  value: l
126
126
  }))
127
127
  ];
128
128
  });
129
- function d({ value: C }) {
129
+ function m({ value: C }) {
130
130
  return i(A).type === "unit" ? C === null : C === i(A).measurement;
131
131
  }
132
132
  const v = P(
133
133
  () => {
134
134
  var C;
135
- return ((C = m.value.find((l) => d(l))) == null ? void 0 : C.label) ?? "";
135
+ return ((C = p.value.find((l) => m(l))) == null ? void 0 : C.label) ?? "";
136
136
  }
137
- ), S = N(!1);
137
+ ), F = N(!1);
138
138
  return (C, l) => {
139
- const a = j("FmIcon"), y = j("FmMenuItem"), B = j("FmMenu");
140
- return x(), z(B, {
139
+ const s = j("FmIcon"), y = j("FmMenuItem"), B = j("FmMenu");
140
+ return S(), z(B, {
141
141
  "stop-click-propagation": "",
142
- onMenuChanged: l[0] || (l[0] = (w) => S.value = w)
142
+ onMenuChanged: l[0] || (l[0] = (w) => F.value = w)
143
143
  }, {
144
144
  "menu-button": I(() => [
145
145
  e("button", {
146
146
  type: "button",
147
147
  class: ge([
148
148
  "w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
149
- S.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
149
+ F.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
150
150
  ])
151
151
  }, [
152
- e("div", Jt, b(v.value), 1),
153
- g(a, {
152
+ e("div", Jt, _(v.value), 1),
153
+ g(s, {
154
154
  class: "text-fm-color-neutral-gray-400",
155
155
  name: "expand_more"
156
156
  })
157
157
  ], 2)
158
158
  ]),
159
159
  default: I(() => [
160
- (x(!0), O(ee, null, re(m.value, (w) => (x(), z(y, {
160
+ (S(!0), R(te, null, ie(p.value, (w) => (S(), z(y, {
161
161
  key: w.value ?? 0,
162
162
  label: w.label,
163
- "model-value": d(w),
163
+ "model-value": m(w),
164
164
  onClick: ($) => c(w.value)
165
165
  }, null, 8, ["label", "model-value", "onClick"]))), 128))
166
166
  ]),
@@ -168,60 +168,60 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
168
168
  });
169
169
  };
170
170
  }
171
- }), Qt = { class: "whitespace-nowrap" }, Zt = /* @__PURE__ */ ce({
171
+ }), Zt = { class: "whitespace-nowrap" }, en = /* @__PURE__ */ ce({
172
172
  __name: "StockHeaderPreview",
173
- setup(_) {
173
+ setup(b) {
174
174
  const { t: h } = de();
175
- return (c, s) => (x(), z(Ot, null, {
175
+ return (c, o) => (S(), z(Nt, null, {
176
176
  default: I(() => [
177
- e("div", Qt, b(i(h)("inventory.stock.prediction.daysRemaining")), 1)
177
+ e("div", Zt, _(i(h)("inventory.stock.prediction.daysRemaining")), 1)
178
178
  ]),
179
179
  _: 1
180
180
  }));
181
181
  }
182
- }), rt = Lt("stockActions", () => {
183
- const _ = N(!1), h = pe(), c = Re(), s = nt(), A = _e(), m = Oe(), { t: d } = de();
182
+ }), rt = zt("stockActions", () => {
183
+ const b = N(!1), h = pe(), c = Re(), o = nt(), A = _e(), p = Oe(), { t: m } = de();
184
184
  async function v() {
185
185
  if (h._currentLocation) {
186
- _.value = !0;
186
+ b.value = !0;
187
187
  try {
188
- await c.readStockBalance(), await c.readProductBalance(), await s.readStockEstimateBalance();
188
+ await c.readStockBalance(), await c.readProductBalance(), await o.readStockEstimateBalance();
189
189
  } catch {
190
190
  A.open({
191
- title: d("inventory.stock.error.title"),
192
- message: d("inventory.stock.error.message"),
191
+ title: m("inventory.stock.error.title"),
192
+ message: m("inventory.stock.error.message"),
193
193
  type: "error"
194
194
  });
195
195
  } finally {
196
- _.value = !1;
196
+ b.value = !1;
197
197
  }
198
198
  }
199
199
  }
200
- const S = N();
200
+ const F = N();
201
201
  async function C($) {
202
202
  var M, D, H;
203
203
  if (!!!((D = (M = $.convert) == null ? void 0 : M.inventoryBindings) != null && D.length)) {
204
- m.open({
205
- title: d("inventory.stock.error.convert.title"),
206
- message: d("inventory.stock.error.convert.message")
204
+ p.open({
205
+ title: m("inventory.stock.error.convert.title"),
206
+ message: m("inventory.stock.error.convert.message")
207
207
  });
208
208
  return;
209
209
  }
210
- const F = {
211
- maxCount: ((H = c.productBalance.find(({ id: R }) => R === $._id)) == null ? void 0 : H.count) || 0,
210
+ const x = {
211
+ maxCount: ((H = c.productBalance.find(({ id: O }) => O === $._id)) == null ? void 0 : H.count) || 0,
212
212
  sku: $,
213
213
  show: !0,
214
- "onUpdate:show"(R) {
215
- S.value.show = R;
214
+ "onUpdate:show"(O) {
215
+ F.value.show = O;
216
216
  },
217
217
  onSubmitted() {
218
218
  v();
219
219
  }
220
220
  };
221
- S.value = F;
221
+ F.value = x;
222
222
  }
223
223
  const l = N();
224
- async function a($) {
224
+ async function s($) {
225
225
  const n = {
226
226
  stock: $,
227
227
  show: !0,
@@ -255,7 +255,7 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
255
255
  C(r);
256
256
  return;
257
257
  case he.Adjust:
258
- a(r);
258
+ s(r);
259
259
  return;
260
260
  }
261
261
  }
@@ -264,12 +264,12 @@ const Jt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
264
264
  onActionMenu: w,
265
265
  stockHistoryProps: y,
266
266
  showSkuHistory: B,
267
- convertSkuDialogProps: S,
267
+ convertSkuDialogProps: F,
268
268
  adjustSkuDialogProps: l
269
269
  };
270
270
  });
271
- function en() {
272
- const _ = pe(), h = rt(), { t: c } = de();
271
+ function tn() {
272
+ const b = pe(), h = rt(), { t: c } = de();
273
273
  return {
274
274
  columnDefs: [
275
275
  {
@@ -288,33 +288,33 @@ function en() {
288
288
  id: "UOM",
289
289
  header: () => c("inventory.stock.balance"),
290
290
  cell(A) {
291
- const m = A.row.original, d = {
292
- unit: m.unit,
293
- sku: m,
294
- amount: m.balance,
295
- defaultTrackingMeasurement: m.trackingMeasurement ?? void 0
291
+ const p = A.row.original, m = {
292
+ unit: p.unit,
293
+ sku: p,
294
+ amount: p.balance,
295
+ defaultTrackingMeasurement: p.trackingMeasurement ?? void 0
296
296
  };
297
- return ke(lt, d);
297
+ return be(lt, m);
298
298
  },
299
299
  size: 180
300
300
  },
301
301
  {
302
302
  accessorKey: "day",
303
303
  id: "expireDate",
304
- header: () => ke(Zt),
304
+ header: () => be(en),
305
305
  enableSorting: !0,
306
306
  sortUndefined: "last",
307
307
  cell(A) {
308
- var l, a;
309
- const m = A.row.original.day, d = (l = A.row.original.thresholds) == null ? void 0 : l.low, v = (a = A.row.original.thresholds) == null ? void 0 : a.mid;
310
- if (typeof m != "number" || typeof d != "number" || typeof v != "number")
311
- return ke(Te, {
312
- days: m
308
+ var l, s;
309
+ const p = A.row.original.day, m = (l = A.row.original.thresholds) == null ? void 0 : l.low, v = (s = A.row.original.thresholds) == null ? void 0 : s.mid;
310
+ if (typeof p != "number" || typeof m != "number" || typeof v != "number")
311
+ return be(Te, {
312
+ days: p
313
313
  });
314
- const S = m <= d ? Me.low : m <= v ? Me.mid : Me.high;
315
- return ke(Te, {
316
- days: m,
317
- level: S
314
+ const F = p <= m ? Me.low : p <= v ? Me.mid : Me.high;
315
+ return be(Te, {
316
+ days: p,
317
+ level: F
318
318
  });
319
319
  },
320
320
  size: 200
@@ -322,10 +322,10 @@ function en() {
322
322
  {
323
323
  id: "action",
324
324
  cell(A) {
325
- var m;
325
+ var p;
326
326
  return mt(
327
- ((m = _._currentLocation) == null ? void 0 : m.type) === "restaurant" ? Wt : qt,
328
- (d) => h.onActionMenu(d, A.row.original)
327
+ ((p = b._currentLocation) == null ? void 0 : p.type) === "restaurant" ? qt : Xt,
328
+ (m) => h.onActionMenu(m, A.row.original)
329
329
  );
330
330
  },
331
331
  enableSorting: !1,
@@ -338,44 +338,44 @@ function en() {
338
338
  ]
339
339
  };
340
340
  }
341
- const tn = {
341
+ const nn = {
342
342
  context: null,
343
343
  error: null,
344
- isRequired(_ = "This field is required") {
345
- return `${this.context ?? ""}`.length === 0 && (this.error = _), this;
344
+ isRequired(b = "This field is required") {
345
+ return `${this.context ?? ""}`.length === 0 && (this.error = b), this;
346
346
  },
347
- isString(_ = "Must be a valid string") {
348
- return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = _)), this);
347
+ isString(b = "Must be a valid string") {
348
+ return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = b)), this);
349
349
  },
350
350
  toInt() {
351
351
  return this.error ? this : (this.context = +this.context, this);
352
352
  },
353
- isInteger(_ = "Must be an integer") {
354
- return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = _), this);
353
+ isInteger(b = "Must be an integer") {
354
+ return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = b), this);
355
355
  },
356
- min(_, h) {
356
+ min(b, h) {
357
357
  if (this.error) return this;
358
358
  try {
359
- typeof this.context == "number" ? +this.context < _ && (this.error = h ?? `Must be at least ${_}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < _ && (this.error = h ?? `Must be at least ${_}`) : this.error = "Length cannot be determined";
359
+ typeof this.context == "number" ? +this.context < b && (this.error = h ?? `Must be at least ${b}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < b && (this.error = h ?? `Must be at least ${b}`) : this.error = "Length cannot be determined";
360
360
  } catch {
361
361
  this.error = "Length cannot be determined";
362
362
  }
363
363
  return this;
364
364
  },
365
- max(_, h) {
365
+ max(b, h) {
366
366
  if (this.error) return this;
367
367
  try {
368
- typeof this.context == "number" ? +this.context > _ && (this.error = h ?? `Must be at most ${_}`) : "length" in this.context ? +this.context.length > _ && (this.error = h ?? `Must be at most ${_}`) : this.error = "Length cannot be determined";
368
+ typeof this.context == "number" ? +this.context > b && (this.error = h ?? `Must be at most ${b}`) : "length" in this.context ? +this.context.length > b && (this.error = h ?? `Must be at most ${b}`) : this.error = "Length cannot be determined";
369
369
  } catch {
370
370
  this.error = "Length cannot be determined";
371
371
  }
372
372
  return this;
373
373
  }
374
374
  };
375
- function Je(_) {
376
- return { ...tn, context: _ };
375
+ function Qe(b) {
376
+ return { ...nn, context: b };
377
377
  }
378
- const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-800" }, sn = { class: "flex flex-col gap-24 w-full" }, an = { class: "flex flex-col gap-8" }, ln = { class: "fm-typo-en-body-lg-600" }, rn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, un = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, cn = { class: "flex flex-col p-16 gap-8" }, dn = { class: "flex flex-col gap-4" }, mn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, pn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, fn = { class: "xs:col-span-3" }, vn = { class: "flex gap-8" }, yn = /* @__PURE__ */ ce({
378
+ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-800" }, an = { class: "flex flex-col gap-24 w-full" }, ln = { class: "flex flex-col gap-8" }, rn = { class: "fm-typo-en-body-lg-600" }, un = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, cn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, dn = { class: "flex flex-col p-16 gap-8" }, mn = { class: "flex flex-col gap-4" }, pn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, fn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, vn = { class: "xs:col-span-3" }, yn = { class: "flex gap-8" }, _n = /* @__PURE__ */ ce({
379
379
  __name: "ConvertSkuDialog",
380
380
  props: {
381
381
  sku: {},
@@ -383,73 +383,73 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
383
383
  show: { type: Boolean }
384
384
  },
385
385
  emits: ["update:show", "submitted"],
386
- setup(_, { expose: h, emit: c }) {
387
- const s = _, A = c, m = zt(), d = Pe(), v = ye(), S = _e(), { t: C } = de(), l = N(0), a = N(null), y = P(() => d.skus), B = P(
386
+ setup(b, { expose: h, emit: c }) {
387
+ const o = b, A = c, p = Yt(), m = Pe(), v = ye(), F = _e(), { t: C } = de(), l = N(0), s = N(null), y = P(() => m.skus), B = P(
388
388
  () => {
389
389
  var k, t;
390
- return (((t = (k = s.sku) == null ? void 0 : k.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
391
- (o) => o.type === Ge.enum.SKU
390
+ return (((t = (k = o.sku) == null ? void 0 : k.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
391
+ (a) => a.type === Ge.enum.SKU
392
392
  );
393
393
  }
394
394
  ), w = P({
395
395
  get() {
396
- return !!a.value;
396
+ return !!s.value;
397
397
  },
398
398
  set(k) {
399
- k ? a.value = He(B.value) : (a.value = null, l.value = Math.min(l.value, s.maxCount ?? 0));
399
+ k ? s.value = He(B.value) : (s.value = null, l.value = Math.min(l.value, o.maxCount ?? 0));
400
400
  }
401
401
  }), $ = N(!1);
402
- xe([() => s.show], ([k]) => {
402
+ xe([() => o.show], ([k]) => {
403
403
  k && (l.value = 0);
404
404
  });
405
405
  function n() {
406
- Q(s.sku, Se(l.value), a.value);
406
+ Q(o.sku, Se(l.value), s.value);
407
407
  }
408
408
  function r(k) {
409
- if (a.value)
409
+ if (s.value)
410
410
  return !0;
411
- const t = Je(k).isInteger().max(s.maxCount ?? 0).error ?? "";
411
+ const t = Qe(k).isInteger().max(o.maxCount ?? 0).error ?? "";
412
412
  return t || !0;
413
413
  }
414
- function F(k) {
415
- var p;
416
- const t = (p = s.sku.convert) != null && p.measurement ? s.sku.unit.measurements.find((V) => {
414
+ function x(k) {
415
+ var f;
416
+ const t = (f = o.sku.convert) != null && f.measurement ? o.sku.unit.measurements.find((V) => {
417
417
  var E;
418
- return V.id === ((E = s.sku.convert) == null ? void 0 : E.measurement);
419
- }) ?? null : null, o = Ie(s.sku.unit, t), f = _t(+k);
420
- return Je(f).isInteger().max(o).error ? "Precision cannot be more than " + o : !0;
418
+ return V.id === ((E = o.sku.convert) == null ? void 0 : E.measurement);
419
+ }) ?? null : null, a = Ie(o.sku.unit, t), d = _t(+k);
420
+ return Qe(d).isInteger().max(a).error ? "Precision cannot be more than " + a : !0;
421
421
  }
422
422
  const M = P(
423
423
  () => {
424
424
  var k, t;
425
- return (k = s.sku.convert) != null && k.measurement ? (t = s.sku.unit.measurements.find((o) => {
426
- var f;
427
- return o.id === ((f = s.sku.convert) == null ? void 0 : f.measurement);
428
- })) == null ? void 0 : t.abbrev : s.sku.unit.abbrev;
425
+ return (k = o.sku.convert) != null && k.measurement ? (t = o.sku.unit.measurements.find((a) => {
426
+ var d;
427
+ return a.id === ((d = o.sku.convert) == null ? void 0 : d.measurement);
428
+ })) == null ? void 0 : t.abbrev : o.sku.unit.abbrev;
429
429
  }
430
430
  ), D = P(() => {
431
- var f, u;
431
+ var d, u;
432
432
  const t = pt({
433
- bindings: ((f = s.sku.convert) == null ? void 0 : f.inventoryBindings) ?? [],
434
- skus: d.skus,
435
- skuGroups: d.skuGroups,
436
- recipes: d.recipes
437
- }).inventoryBindings.filter((p) => "success" in p && p.success).map((p) => p).map((p) => p.binding);
438
- return (u = a.value ?? t) == null ? void 0 : u.map((p) => {
439
- var se, ie, Z, le, Le;
440
- const V = d.skus.find((fe) => fe._id === p.id), E = ((se = p.measurement) == null ? void 0 : se.abbrev) ?? ((ie = V == null ? void 0 : V.unit) == null ? void 0 : ie.abbrev), W = (Z = s.sku.convert) != null && Z.measurement ? s.sku.unit.measurements.find((fe) => {
433
+ bindings: ((d = o.sku.convert) == null ? void 0 : d.inventoryBindings) ?? [],
434
+ skus: m.skus,
435
+ skuGroups: m.skuGroups,
436
+ recipes: m.recipes
437
+ }).inventoryBindings.filter((f) => "success" in f && f.success).map((f) => f).map((f) => f.binding);
438
+ return (u = s.value ?? t) == null ? void 0 : u.map((f) => {
439
+ var Z, le, ee, re, Le;
440
+ const V = m.skus.find((fe) => fe._id === f.id), E = ((Z = f.measurement) == null ? void 0 : Z.abbrev) ?? ((le = V == null ? void 0 : V.unit) == null ? void 0 : le.abbrev), K = (ee = o.sku.convert) != null && ee.measurement ? o.sku.unit.measurements.find((fe) => {
441
441
  var ze;
442
- return fe.id === ((ze = s.sku.convert) == null ? void 0 : ze.measurement);
443
- }) ?? null : null, oe = Ie(s.sku.unit, W), U = F(`${l.value}`) === !0 ? me(
442
+ return fe.id === ((ze = o.sku.convert) == null ? void 0 : ze.measurement);
443
+ }) ?? null : null, ae = Ie(o.sku.unit, K), U = x(`${l.value}`) === !0 ? me(
444
444
  ft(
445
- p.amount,
446
- Se(+l.value, oe)
445
+ f.amount,
446
+ Se(+l.value, ae)
447
447
  ),
448
448
  !1
449
- ) : "0", Y = (Le = (le = a.value) == null ? void 0 : le.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Le.amount, G = Y ? me(Y, !1) : null;
449
+ ) : "0", Y = (Le = (re = s.value) == null ? void 0 : re.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Le.amount, W = Y ? me(Y, !1) : null;
450
450
  return {
451
451
  sku: V,
452
- convertAmount: G ?? U,
452
+ convertAmount: W ?? U,
453
453
  abbrev: E
454
454
  };
455
455
  });
@@ -468,8 +468,8 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
468
468
  (t = (k = H.value) == null ? void 0 : k.resetInputs) == null || t.call(k);
469
469
  }
470
470
  });
471
- const R = Ne(s, "show");
472
- async function Q(k, t, o) {
471
+ const O = Ne(o, "show");
472
+ async function Q(k, t, a) {
473
473
  $.value = !0;
474
474
  try {
475
475
  await v.convertSku({
@@ -477,105 +477,105 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
477
477
  {
478
478
  doc: k,
479
479
  amount: t,
480
- overrides: o == null ? void 0 : o.map((f) => ({
481
- ...f,
480
+ overrides: a == null ? void 0 : a.map((d) => ({
481
+ ...d,
482
482
  amount: {
483
- ...f.amount,
484
- amount: -1 * Math.abs(f.amount.amount)
483
+ ...d.amount,
484
+ amount: -1 * Math.abs(d.amount.amount)
485
485
  // ensure truly negative
486
486
  }
487
487
  }))
488
488
  }
489
489
  ]
490
490
  }), A("update:show", !1), A("submitted");
491
- } catch (f) {
492
- S.open({
491
+ } catch (d) {
492
+ F.open({
493
493
  title: "Something went wrong",
494
494
  message: `Cannot convert ${k.name}. Please try again.`,
495
495
  type: "error"
496
- }), console.error("error at converting stock amount", k, t, f);
496
+ }), console.error("error at converting stock amount", k, t, d);
497
497
  } finally {
498
498
  $.value = !1;
499
499
  }
500
500
  }
501
- function X(k, t, o) {
502
- const f = +t;
503
- let u = o;
504
- t.length > 0 && isFinite(f) ? u = o.map((p) => (p.id !== k || (p.amount = ve(f)), p)) : u = o.map((p) => (p.id !== k || (p.amount = { amount: 0, precision: 0 }), p)), a.value = u;
501
+ function X(k, t, a) {
502
+ const d = +t;
503
+ let u = a;
504
+ t.length > 0 && isFinite(d) ? u = a.map((f) => (f.id !== k || (f.amount = ve(d)), f)) : u = a.map((f) => (f.id !== k || (f.amount = { amount: 0, precision: 0 }), f)), s.value = u;
505
505
  }
506
506
  function T(k) {
507
- const t = y.value.find((o) => o._id === k);
507
+ const t = y.value.find((a) => a._id === k);
508
508
  return t ? st(t.unit, !0) : [];
509
509
  }
510
510
  function L(k, t) {
511
- const o = T(k), f = o.find((u) => u.value === t) ?? o.find((u) => u.value === null);
512
- return f ? {
513
- ...f,
514
- label: f.abbrev
511
+ const a = T(k), d = a.find((u) => u.value === t) ?? a.find((u) => u.value === null);
512
+ return d ? {
513
+ ...d,
514
+ label: d.abbrev
515
515
  } : null;
516
516
  }
517
- function K(k, t, o) {
518
- let f;
517
+ function G(k, t, a) {
518
+ let d;
519
519
  if (t === null)
520
- f = o.map((u) => (u.id !== k || (u.measurement = null), u)) ?? [];
520
+ d = a.map((u) => (u.id !== k || (u.measurement = null), u)) ?? [];
521
521
  else {
522
- const u = y.value.find((p) => p._id === k);
523
- f = o.map((p) => {
522
+ const u = y.value.find((f) => f._id === k);
523
+ d = a.map((f) => {
524
524
  var V, E;
525
- return p.id !== k || (p.measurement = (E = (V = u == null ? void 0 : u.unit) == null ? void 0 : V.measurements) == null ? void 0 : E.find((W) => W.id === t)), p;
525
+ return f.id !== k || (f.measurement = (E = (V = u == null ? void 0 : u.unit) == null ? void 0 : V.measurements) == null ? void 0 : E.find((K) => K.id === t)), f;
526
526
  }) ?? [];
527
527
  }
528
- a.value = f;
528
+ s.value = d;
529
529
  }
530
530
  function J(k, t) {
531
- const o = t.filter((f) => f.id !== k);
532
- a.value = o;
531
+ const a = t.filter((d) => d.id !== k);
532
+ s.value = a;
533
533
  }
534
- function te() {
535
- const k = (a.value ?? []).map((t) => ({
534
+ function ne() {
535
+ const k = (s.value ?? []).map((t) => ({
536
536
  ...t,
537
537
  type: Ge.enum.SKU
538
538
  }));
539
- m.promptIngredientsBinding(
539
+ p.promptIngredientsBinding(
540
540
  k,
541
- (t) => a.value = t,
542
- s.sku._id
541
+ (t) => s.value = t,
542
+ o.sku._id
543
543
  );
544
544
  }
545
545
  return xe(
546
- () => s.show,
546
+ () => o.show,
547
547
  (k) => {
548
- k || (a.value = null, l.value = 0);
548
+ k || (s.value = null, l.value = 0);
549
549
  }
550
550
  ), (k, t) => {
551
- const o = j("FmTextField"), f = j("FmForm"), u = j("FmCard"), p = j("FmSwitch"), V = j("FmFormGroup"), E = j("FmSelect"), W = j("FmButton"), oe = j("FmSideSheet");
552
- return x(), z(oe, {
551
+ const a = j("FmTextField"), d = j("FmForm"), u = j("FmCard"), f = j("FmSwitch"), V = j("FmFormGroup"), E = j("FmSelect"), K = j("FmButton"), ae = j("FmSideSheet");
552
+ return S(), z(ae, {
553
553
  "dismiss-away": "",
554
- modelValue: i(R),
555
- "onUpdate:modelValue": t[3] || (t[3] = (U) => Ue(R) ? R.value = U : null),
554
+ modelValue: i(O),
555
+ "onUpdate:modelValue": t[3] || (t[3] = (U) => Ue(O) ? O.value = U : null),
556
556
  "max-width": 500
557
557
  }, {
558
558
  "side-sheet-header": I(() => [
559
- e("div", nn, [
560
- e("div", on, b(i(C)("inventory.stock.convert.title", { name: k.sku.name })), 1)
559
+ e("div", on, [
560
+ e("div", sn, _(i(C)("inventory.stock.convert.title", { name: k.sku.name })), 1)
561
561
  ])
562
562
  ]),
563
563
  default: I(() => [
564
- e("div", sn, [
565
- g(f, {
564
+ e("div", an, [
565
+ g(d, {
566
566
  ref_key: "formRef",
567
567
  ref: H,
568
568
  onValidationSuccess: n
569
569
  }, {
570
570
  default: I(() => [
571
- g(o, {
571
+ g(a, {
572
572
  disabled: $.value,
573
573
  "model-value": l.value,
574
574
  "onUpdate:modelValue": t[0] || (t[0] = (U) => l.value = U),
575
575
  label: i(C)("inventory.stock.convert.amount"),
576
- rules: [r, F, i(Fe)(0)],
576
+ rules: [r, x, i(Fe)(0)],
577
577
  "append-text": M.value,
578
- "helper-text": a.value ? void 0 : `Max ${k.maxCount} ${M.value}`
578
+ "helper-text": s.value ? void 0 : `Max ${k.maxCount} ${M.value}`
579
579
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
580
580
  ]),
581
581
  _: 1
@@ -585,16 +585,16 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
585
585
  class: "p-16"
586
586
  }, {
587
587
  default: I(() => [
588
- e("div", an, [
589
- e("div", ln, b(i(C)("inventory.stock.convert.deductionSummary")), 1),
590
- (x(!0), O(ee, null, re(D.value, (U) => {
591
- var Y, G;
592
- return x(), O("div", {
588
+ e("div", ln, [
589
+ e("div", rn, _(i(C)("inventory.stock.convert.deductionSummary")), 1),
590
+ (S(!0), R(te, null, ie(D.value, (U) => {
591
+ var Y, W;
592
+ return S(), R("div", {
593
593
  key: (Y = U.sku) == null ? void 0 : Y._id,
594
594
  class: "flex items-center"
595
595
  }, [
596
- e("div", rn, b((G = U.sku) == null ? void 0 : G.name), 1),
597
- e("div", un, " -" + b(U.convertAmount) + " " + b(U.abbrev), 1)
596
+ e("div", un, _((W = U.sku) == null ? void 0 : W.name), 1),
597
+ e("div", cn, " -" + _(U.convertAmount) + " " + _(U.abbrev), 1)
598
598
  ]);
599
599
  }), 128))
600
600
  ])
@@ -603,22 +603,22 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
603
603
  }),
604
604
  g(u, { variant: "outlined" }, {
605
605
  default: I(() => [
606
- e("div", cn, [
607
- g(p, {
606
+ e("div", dn, [
607
+ g(f, {
608
608
  value: "",
609
609
  modelValue: w.value,
610
610
  "onUpdate:modelValue": t[1] || (t[1] = (U) => w.value = U),
611
611
  label: i(C)("inventory.stock.convert.overrideDeduction"),
612
612
  "label-placement": "right"
613
613
  }, null, 8, ["modelValue", "label"]),
614
- w.value ? (x(), O(ee, { key: 0 }, [
614
+ w.value ? (S(), R(te, { key: 0 }, [
615
615
  g(V, {
616
- modelValue: a.value,
616
+ modelValue: s.value,
617
617
  rules: [i(vt)(1, "Must have at least one ingredient binding")]
618
618
  }, null, 8, ["modelValue", "rules"]),
619
- e("div", dn, [
620
- e("div", mn, b(i(C)("inventory.stock.convert.ingredients")), 1),
621
- (x(!0), O(ee, null, re(a.value, (U) => (x(), z(V, {
619
+ e("div", mn, [
620
+ e("div", pn, _(i(C)("inventory.stock.convert.ingredients")), 1),
621
+ (S(!0), R(te, null, ie(s.value, (U) => (S(), z(V, {
622
622
  key: U.id,
623
623
  disabled: $.value,
624
624
  modelValue: +i(me)(U.amount ?? { amount: 1, precision: 0 }),
@@ -631,36 +631,36 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
631
631
  ]
632
632
  }, {
633
633
  default: I(({ invalid: Y }) => {
634
- var G, se, ie;
634
+ var W, Z, le;
635
635
  return [
636
- e("div", pn, [
637
- e("div", fn, b((G = y.value.find((Z) => Z._id === U.id)) == null ? void 0 : G.name), 1),
638
- g(o, {
636
+ e("div", fn, [
637
+ e("div", vn, _((W = y.value.find((ee) => ee._id === U.id)) == null ? void 0 : W.name), 1),
638
+ g(a, {
639
639
  class: "xs:col-span-2",
640
640
  disabled: $.value,
641
641
  modelValue: +i(me)(
642
642
  U.amount ?? { amount: 1, precision: 0 }
643
643
  ),
644
- "onUpdate:modelValue": (Z) => X(U.id, Z, a.value ?? []),
644
+ "onUpdate:modelValue": (ee) => X(U.id, ee, s.value ?? []),
645
645
  invalid: Y
646
646
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
647
647
  g(E, {
648
648
  disabled: $.value,
649
649
  class: "translate-y-[2px]",
650
650
  items: T(U.id),
651
- "model-value": (ie = L(U.id, (se = U.measurement) == null ? void 0 : se.id)) == null ? void 0 : ie.value,
652
- "onUpdate:modelValue": (Z) => K(U.id, Z, a.value ?? []),
651
+ "model-value": (le = L(U.id, (Z = U.measurement) == null ? void 0 : Z.id)) == null ? void 0 : le.value,
652
+ "onUpdate:modelValue": (ee) => G(U.id, ee, s.value ?? []),
653
653
  invalid: Y
654
654
  }, {
655
655
  "helper-text": I(() => t[4] || (t[4] = [])),
656
656
  _: 2
657
657
  }, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
658
- g(W, {
658
+ g(K, {
659
659
  disabled: $.value,
660
660
  type: "button",
661
661
  variant: "tertiary",
662
662
  icon: "delete",
663
- onClick: (Z) => J(U.id, a.value ?? [])
663
+ onClick: (ee) => J(U.id, s.value ?? [])
664
664
  }, null, 8, ["disabled", "onClick"])
665
665
  ])
666
666
  ];
@@ -669,14 +669,14 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
669
669
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
670
670
  ]),
671
671
  e("div", null, [
672
- g(W, {
672
+ g(K, {
673
673
  icon: "link",
674
674
  label: i(C)("inventory.stock.convert.linkIngredient"),
675
675
  variant: "plain",
676
- onClick: te
676
+ onClick: ne
677
677
  }, null, 8, ["label"])
678
678
  ])
679
- ], 64)) : ae("", !0)
679
+ ], 64)) : oe("", !0)
680
680
  ])
681
681
  ]),
682
682
  _: 1
@@ -684,13 +684,13 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
684
684
  ])
685
685
  ]),
686
686
  "side-sheet-footer": I(() => [
687
- e("div", vn, [
688
- g(W, {
687
+ e("div", yn, [
688
+ g(K, {
689
689
  loading: $.value,
690
690
  label: i(C)("inventory.stock.convert.convertButton"),
691
691
  onClick: t[2] || (t[2] = (U) => {
692
- var Y, G;
693
- return (G = (Y = H.value) == null ? void 0 : Y.validateInputs) == null ? void 0 : G.call(Y);
692
+ var Y, W;
693
+ return (W = (Y = H.value) == null ? void 0 : Y.validateInputs) == null ? void 0 : W.call(Y);
694
694
  })
695
695
  }, null, 8, ["loading", "label"])
696
696
  ])
@@ -700,61 +700,61 @@ const nn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-md-80
700
700
  };
701
701
  }
702
702
  });
703
- function De(_, h) {
704
- const c = Se(_, h);
703
+ function De(b, h) {
704
+ const c = Se(b, h);
705
705
  return { ...c, amount: -c.amount };
706
706
  }
707
- function Qe(_, h) {
708
- return Se(Math.abs(_), h);
707
+ function Je(b, h) {
708
+ return Se(Math.abs(b), h);
709
709
  }
710
710
  const je = {
711
- [ne.enum.DAMAGE]: {
711
+ [se.enum.DAMAGE]: {
712
712
  label: "Waste",
713
713
  toAdjustmentAmount: De
714
714
  },
715
- [ne.enum.THEFT]: {
715
+ [se.enum.THEFT]: {
716
716
  label: "Theft",
717
717
  toAdjustmentAmount: De
718
718
  },
719
- [ne.enum.LOSE]: {
719
+ [se.enum.LOSE]: {
720
720
  label: "Lose",
721
721
  toAdjustmentAmount: De
722
722
  },
723
- [ne.enum.EXTRA]: {
723
+ [se.enum.EXTRA]: {
724
724
  label: "Extra",
725
- toAdjustmentAmount: Qe
725
+ toAdjustmentAmount: Je
726
726
  },
727
- [ne.enum.PURCHASE]: {
727
+ [se.enum.PURCHASE]: {
728
728
  label: "Purchase",
729
- toAdjustmentAmount: Qe
729
+ toAdjustmentAmount: Je
730
730
  }
731
- }, _n = { class: "col-span-2 flex" }, kn = { class: "fm-typo-en-body-lg-600 flex-1" }, bn = /* @__PURE__ */ ce({
731
+ }, bn = { class: "col-span-2 flex" }, kn = { class: "fm-typo-en-body-lg-600 flex-1" }, hn = /* @__PURE__ */ ce({
732
732
  __name: "AdjustedItemForm",
733
733
  props: {
734
734
  modelValue: {},
735
735
  disabled: { type: Boolean }
736
736
  },
737
737
  emits: ["update:modelValue", "click:delete"],
738
- setup(_, { emit: h }) {
739
- const c = _, s = h, A = P(
738
+ setup(b, { emit: h }) {
739
+ const c = b, o = h, A = P(
740
740
  () => Object.keys(je).map((l) => ({
741
- label: kt(l),
741
+ label: bt(l),
742
742
  value: l
743
743
  }))
744
- ), m = P(() => st(c.modelValue.doc.unit, !0)), d = P({
744
+ ), p = P(() => st(c.modelValue.doc.unit, !0)), m = P({
745
745
  get() {
746
- return c.modelValue.type ?? ne.enum.PURCHASE;
746
+ return c.modelValue.type ?? se.enum.PURCHASE;
747
747
  },
748
748
  set(l) {
749
- const a = {
749
+ const s = {
750
750
  ...c.modelValue
751
751
  };
752
- a.type = l;
752
+ s.type = l;
753
753
  const y = Ke(c.modelValue.amount);
754
- a.amount = je[a.type].toAdjustmentAmount(
754
+ s.amount = je[s.type].toAdjustmentAmount(
755
755
  +me(y),
756
756
  y.precision
757
- ), s("update:modelValue", a);
757
+ ), o("update:modelValue", s);
758
758
  }
759
759
  }), v = P({
760
760
  get() {
@@ -762,50 +762,50 @@ const je = {
762
762
  return +me(l);
763
763
  },
764
764
  set(l) {
765
- const a = {
765
+ const s = {
766
766
  ...c.modelValue
767
767
  }, y = ve(l);
768
- a.amount = je[d.value].toAdjustmentAmount(
768
+ s.amount = je[m.value].toAdjustmentAmount(
769
769
  l,
770
770
  y.precision
771
- ), s("update:modelValue", a);
771
+ ), o("update:modelValue", s);
772
772
  }
773
- }), S = P({
773
+ }), F = P({
774
774
  get() {
775
775
  var l;
776
776
  return ((l = c.modelValue.measurement) == null ? void 0 : l.id) ?? null;
777
777
  },
778
778
  set(l) {
779
779
  var y, B;
780
- const a = {
780
+ const s = {
781
781
  ...c.modelValue
782
782
  };
783
- a.measurement = ((B = (y = c.modelValue.doc.unit) == null ? void 0 : y.measurements) == null ? void 0 : B.find((w) => w.id === l)) ?? null, s("update:modelValue", a);
783
+ s.measurement = ((B = (y = c.modelValue.doc.unit) == null ? void 0 : y.measurements) == null ? void 0 : B.find((w) => w.id === l)) ?? null, o("update:modelValue", s);
784
784
  }
785
785
  }), C = P({
786
786
  get() {
787
787
  return c.modelValue.remark ?? "";
788
788
  },
789
789
  set(l) {
790
- const a = {
790
+ const s = {
791
791
  ...c.modelValue
792
792
  };
793
- a.remark = l, s("update:modelValue", a);
793
+ s.remark = l, o("update:modelValue", s);
794
794
  }
795
795
  });
796
- return (l, a) => {
796
+ return (l, s) => {
797
797
  const y = j("FmButton"), B = j("FmSelect"), w = j("FmTextarea"), $ = j("FmCard");
798
- return x(), z($, {
798
+ return S(), z($, {
799
799
  variant: "outlined",
800
800
  class: "grid grid-cols-2 gap-8 p-16"
801
801
  }, {
802
802
  default: I(() => [
803
- e("div", _n, [
804
- e("div", kn, b(l.modelValue.doc.name), 1),
803
+ e("div", bn, [
804
+ e("div", kn, _(l.modelValue.doc.name), 1),
805
805
  g(y, {
806
806
  variant: "tertiary",
807
807
  "prepend-icon": "delete",
808
- onClick: a[0] || (a[0] = (n) => s("click:delete"))
808
+ onClick: s[0] || (s[0] = (n) => o("click:delete"))
809
809
  })
810
810
  ]),
811
811
  g(B, {
@@ -813,12 +813,12 @@ const je = {
813
813
  class: "col-span-2",
814
814
  label: "Type",
815
815
  items: A.value,
816
- modelValue: d.value,
817
- "onUpdate:modelValue": a[1] || (a[1] = (n) => d.value = n),
818
- rules: [i(bt)()],
816
+ modelValue: m.value,
817
+ "onUpdate:modelValue": s[1] || (s[1] = (n) => m.value = n),
818
+ rules: [i(kt)()],
819
819
  "label-mark": "required"
820
820
  }, null, 8, ["disabled", "items", "modelValue", "rules"]),
821
- g(Yt, {
821
+ g(Gt, {
822
822
  disabled: l.disabled,
823
823
  label: "Amount",
824
824
  step: +i(me)({
@@ -826,22 +826,22 @@ const je = {
826
826
  precision: i(Ie)(l.modelValue.doc.unit, l.modelValue.measurement)
827
827
  }),
828
828
  modelValue: v.value,
829
- "onUpdate:modelValue": a[2] || (a[2] = (n) => v.value = n),
829
+ "onUpdate:modelValue": s[2] || (s[2] = (n) => v.value = n),
830
830
  rules: [i(Fe)(0)]
831
831
  }, null, 8, ["disabled", "step", "modelValue", "rules"]),
832
832
  g(B, {
833
833
  disabled: l.disabled,
834
834
  label: "Unit",
835
- items: m.value,
836
- modelValue: S.value,
837
- "onUpdate:modelValue": a[3] || (a[3] = (n) => S.value = n)
835
+ items: p.value,
836
+ modelValue: F.value,
837
+ "onUpdate:modelValue": s[3] || (s[3] = (n) => F.value = n)
838
838
  }, null, 8, ["disabled", "items", "modelValue"]),
839
839
  g(w, {
840
840
  class: "col-span-2",
841
841
  disabled: l.disabled,
842
842
  label: "Remark",
843
843
  modelValue: C.value,
844
- "onUpdate:modelValue": a[4] || (a[4] = (n) => C.value = n),
844
+ "onUpdate:modelValue": s[4] || (s[4] = (n) => C.value = n),
845
845
  "label-mark": "optional"
846
846
  }, null, 8, ["disabled", "modelValue"])
847
847
  ]),
@@ -849,66 +849,66 @@ const je = {
849
849
  });
850
850
  };
851
851
  }
852
- }), hn = { class: "flex items-center" }, gn = { class: "fm-typo-en-title-md-800" }, xn = { class: "flex items-center" }, Sn = { class: "fm-typo-en-title-sm-800 flex-1" }, Fn = { class: "flex gap-8" }, wn = /* @__PURE__ */ ce({
852
+ }), gn = { class: "flex items-center" }, xn = { class: "fm-typo-en-title-md-800" }, Sn = { class: "flex items-center" }, Fn = { class: "fm-typo-en-title-sm-800 flex-1" }, wn = { class: "flex gap-8" }, $n = /* @__PURE__ */ ce({
853
853
  __name: "AdjustSkuDialog",
854
854
  props: {
855
855
  stock: {},
856
856
  show: { type: Boolean }
857
857
  },
858
858
  emits: ["update:show", "submitted"],
859
- setup(_, { expose: h, emit: c }) {
860
- const s = _, A = c, m = Pe(), d = Oe(), v = ye(), S = _e(), C = N(!1), { t: l } = de();
861
- function a() {
859
+ setup(b, { expose: h, emit: c }) {
860
+ const o = b, A = c, p = Pe(), m = Oe(), v = ye(), F = _e(), C = N(!1), { t: l } = de();
861
+ function s() {
862
862
  $(He(w));
863
863
  }
864
864
  const y = N();
865
865
  h({
866
866
  validateInputs: () => {
867
- var F, M;
868
- (M = (F = y.value) == null ? void 0 : F.validateInputs) == null || M.call(F);
867
+ var x, M;
868
+ (M = (x = y.value) == null ? void 0 : x.validateInputs) == null || M.call(x);
869
869
  },
870
870
  resetInputsValidation: () => {
871
- var F, M;
872
- (M = (F = y.value) == null ? void 0 : F.resetInputsValidation) == null || M.call(F);
871
+ var x, M;
872
+ (M = (x = y.value) == null ? void 0 : x.resetInputsValidation) == null || M.call(x);
873
873
  },
874
874
  resetInputs: () => {
875
- var F, M;
876
- (M = (F = y.value) == null ? void 0 : F.resetInputs) == null || M.call(F);
875
+ var x, M;
876
+ (M = (x = y.value) == null ? void 0 : x.resetInputs) == null || M.call(x);
877
877
  }
878
878
  });
879
- const B = Ne(s, "show"), w = it({
879
+ const B = Ne(o, "show"), w = it({
880
880
  remark: "",
881
881
  adjustments: [
882
882
  {
883
883
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
884
- type: ne.enum.PURCHASE,
885
- doc: s.stock,
884
+ type: se.enum.PURCHASE,
885
+ doc: o.stock,
886
886
  measurement: null,
887
887
  remark: "",
888
888
  amount: ve(1)
889
889
  }
890
890
  ]
891
891
  });
892
- xe([() => s.show], ([F]) => {
893
- F && (w.remark = "", w.adjustments = [
892
+ xe([() => o.show], ([x]) => {
893
+ x && (w.remark = "", w.adjustments = [
894
894
  {
895
895
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
896
- type: ne.enum.PURCHASE,
897
- doc: s.stock,
896
+ type: se.enum.PURCHASE,
897
+ doc: o.stock,
898
898
  measurement: null,
899
899
  remark: "",
900
900
  amount: ve(1)
901
901
  }
902
902
  ]);
903
903
  });
904
- async function $(F) {
904
+ async function $(x) {
905
905
  C.value = !0;
906
906
  try {
907
907
  await v.adjustSku({
908
- remark: F.remark,
909
- adjustments: F.adjustments.map(({ doc: M, remark: D, type: H, amount: R, measurement: Q }) => ({
908
+ remark: x.remark,
909
+ adjustments: x.adjustments.map(({ doc: M, remark: D, type: H, amount: O, measurement: Q }) => ({
910
910
  id: M._id,
911
- amount: R,
911
+ amount: O,
912
912
  measurement: Q,
913
913
  remark: D,
914
914
  doc: M,
@@ -916,26 +916,26 @@ const je = {
916
916
  }))
917
917
  }), A("update:show", !1), A("submitted");
918
918
  } catch (M) {
919
- S.open({
919
+ F.open({
920
920
  title: l("inventory.stock.adjust.error.title"),
921
921
  message: l("inventory.stock.adjust.error.message"),
922
922
  type: "error"
923
- }), console.log("error on adjust ingredients", F, M);
923
+ }), console.log("error on adjust ingredients", x, M);
924
924
  } finally {
925
925
  C.value = !1;
926
926
  }
927
927
  }
928
928
  function n() {
929
- const F = m.skus.map((D) => ({
929
+ const x = p.skus.map((D) => ({
930
930
  label: D.name,
931
931
  sublabel: D.code,
932
932
  value: D._id
933
- })), M = F.filter((D) => w.adjustments.find((H) => H.doc._id === D.value)).map((D) => D.value);
934
- d.open({
933
+ })), M = x.filter((D) => w.adjustments.find((H) => H.doc._id === D.value)).map((D) => D.value);
934
+ m.open({
935
935
  title: "Select ingredients",
936
936
  contentComponent: ht,
937
937
  contentComponentProps: {
938
- items: F,
938
+ items: x,
939
939
  modelValue: M
940
940
  },
941
941
  overlay: !0,
@@ -952,10 +952,10 @@ const je = {
952
952
  }
953
953
  }).onPrimary((D) => {
954
954
  w.adjustments = D.map(
955
- (H) => w.adjustments.find((R) => R.doc._id === H) ?? {
955
+ (H) => w.adjustments.find((O) => O.doc._id === H) ?? {
956
956
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
957
- type: ne.enum.PURCHASE,
958
- doc: m.skus.find((R) => R._id === H),
957
+ type: se.enum.PURCHASE,
958
+ doc: p.skus.find((O) => O._id === H),
959
959
  measurement: null,
960
960
  remark: "",
961
961
  amount: ve(1)
@@ -963,28 +963,28 @@ const je = {
963
963
  );
964
964
  });
965
965
  }
966
- function r(F) {
967
- w.adjustments.splice(F, 1);
966
+ function r(x) {
967
+ w.adjustments.splice(x, 1);
968
968
  }
969
- return (F, M) => {
970
- const D = j("FmTextarea"), H = j("FmButton"), R = j("FmForm"), Q = j("FmSideSheet");
971
- return x(), z(Q, {
969
+ return (x, M) => {
970
+ const D = j("FmTextarea"), H = j("FmButton"), O = j("FmForm"), Q = j("FmSideSheet");
971
+ return S(), z(Q, {
972
972
  modelValue: i(B),
973
973
  "onUpdate:modelValue": M[2] || (M[2] = (X) => Ue(B) ? B.value = X : null),
974
974
  "dismiss-away": "",
975
975
  "max-width": 500
976
976
  }, {
977
977
  "side-sheet-header": I(() => [
978
- e("div", hn, [
979
- e("div", gn, b(i(l)("inventory.stock.adjust.title")), 1)
978
+ e("div", gn, [
979
+ e("div", xn, _(i(l)("inventory.stock.adjust.title")), 1)
980
980
  ])
981
981
  ]),
982
982
  default: I(() => [
983
- g(R, {
983
+ g(O, {
984
984
  class: "w-full flex flex-col gap-12",
985
985
  ref_key: "formRef",
986
986
  ref: y,
987
- onValidationSuccess: a
987
+ onValidationSuccess: s
988
988
  }, {
989
989
  default: I(() => [
990
990
  g(D, {
@@ -992,8 +992,8 @@ const je = {
992
992
  modelValue: w.remark,
993
993
  "onUpdate:modelValue": M[0] || (M[0] = (X) => w.remark = X)
994
994
  }, null, 8, ["label", "modelValue"]),
995
- e("div", xn, [
996
- e("div", Sn, b(i(l)("inventory.stock.adjust.adjustedItems")), 1),
995
+ e("div", Sn, [
996
+ e("div", Fn, _(i(l)("inventory.stock.adjust.adjustedItems")), 1),
997
997
  g(H, {
998
998
  "prepend-icon": "add",
999
999
  variant: "tertiary",
@@ -1001,7 +1001,7 @@ const je = {
1001
1001
  onClick: n
1002
1002
  })
1003
1003
  ]),
1004
- (x(!0), O(ee, null, re(w.adjustments, (X, T) => (x(), z(bn, {
1004
+ (S(!0), R(te, null, ie(w.adjustments, (X, T) => (S(), z(hn, {
1005
1005
  key: X.id,
1006
1006
  modelValue: w.adjustments[T],
1007
1007
  "onUpdate:modelValue": (L) => w.adjustments[T] = L,
@@ -1012,7 +1012,7 @@ const je = {
1012
1012
  }, 512)
1013
1013
  ]),
1014
1014
  "side-sheet-footer": I(() => [
1015
- e("div", Fn, [
1015
+ e("div", wn, [
1016
1016
  g(H, {
1017
1017
  label: i(l)("inventory.stock.adjust.adjustButton"),
1018
1018
  loading: C.value,
@@ -1027,27 +1027,27 @@ const je = {
1027
1027
  }, 8, ["modelValue"]);
1028
1028
  };
1029
1029
  }
1030
- }), $n = gt((_, h) => ({
1030
+ }), An = gt((b, h) => ({
1031
1031
  // TODO: remove once latest inventory backend has been push
1032
- async findBillsByBusinessId(c, s, A) {
1033
- const m = `${_.businessesBackendUrl}/${c}/reports/find-many`, d = {
1032
+ async findBillsByBusinessId(c, o, A) {
1033
+ const p = `${b.businessesBackendUrl}/${c}/reports/find-many`, m = {
1034
1034
  // type: TYPE.bill,
1035
1035
  type: "bill",
1036
- restaurantIds: s,
1036
+ restaurantIds: o,
1037
1037
  ids: A
1038
1038
  };
1039
- return await h.post(m, d);
1039
+ return await h.post(p, m);
1040
1040
  },
1041
1041
  async findBillsById(c) {
1042
- const A = pe().currentLocationDBName, m = `${_.inventoryBackendUrl}/${A}/bill/search`, d = {
1042
+ const A = pe().currentLocationDBName, p = `${b.inventoryBackendUrl}/${A}/bill/search`, m = {
1043
1043
  ids: c
1044
1044
  };
1045
- return await h.post(m, d);
1045
+ return await h.post(p, m);
1046
1046
  }
1047
- })), An = {
1047
+ })), Vn = {
1048
1048
  key: 0,
1049
1049
  class: "flex justify-center items-center h-32"
1050
- }, Vn = { class: "mb-3" }, Cn = { class: "flex flex-col gap-8" }, Bn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Mn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Dn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Tn = { class: "flex flex-col w-full px-2" }, Un = { class: "flex gap-2" }, En = /* @__PURE__ */ ce({
1050
+ }, Cn = { class: "mb-3" }, Bn = { class: "flex flex-col gap-8" }, Mn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Dn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Tn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Un = { class: "flex flex-col w-full px-2" }, En = { class: "flex gap-2" }, Hn = /* @__PURE__ */ ce({
1051
1051
  __name: "AmendAdjustmentForm",
1052
1052
  props: /* @__PURE__ */ Ye({
1053
1053
  adjustmentId: {}
@@ -1056,54 +1056,54 @@ const je = {
1056
1056
  modelModifiers: {}
1057
1057
  }),
1058
1058
  emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
1059
- setup(_, { emit: h }) {
1060
- const c = _, s = h, A = ye(), m = ut(_, "modelValue"), d = N(!1), v = N(!1), S = N(!1), C = N({
1059
+ setup(b, { emit: h }) {
1060
+ const c = b, o = h, A = ye(), p = ut(b, "modelValue"), m = N(!1), v = N(!1), F = N(!1), C = N({
1061
1061
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1062
1062
  skus: []
1063
1063
  }), l = N();
1064
1064
  Ee(async () => {
1065
- d.value = !0;
1065
+ m.value = !0;
1066
1066
  const n = await A.readSingleAdjustment(c.adjustmentId);
1067
1067
  if (!n) throw new Error("Adjustment not found");
1068
- C.value = n, d.value = !1;
1068
+ C.value = n, m.value = !1;
1069
1069
  });
1070
- async function a() {
1071
- var r, F;
1072
- if ((F = (r = l == null ? void 0 : l.value) == null ? void 0 : r.validateInputs) == null || F.call(r), !v.value) return;
1070
+ async function s() {
1071
+ var r, x;
1072
+ if ((x = (r = l == null ? void 0 : l.value) == null ? void 0 : r.validateInputs) == null || x.call(r), !v.value) return;
1073
1073
  const n = {};
1074
- Object.keys(m.value || {}).forEach((M) => {
1074
+ Object.keys(p.value || {}).forEach((M) => {
1075
1075
  var D;
1076
- Object.keys(((D = m.value) == null ? void 0 : D[M]) || {}).forEach((H) => {
1076
+ Object.keys(((D = p.value) == null ? void 0 : D[M]) || {}).forEach((H) => {
1077
1077
  var Q, X;
1078
- const R = (X = (Q = m.value) == null ? void 0 : Q[M]) == null ? void 0 : X[Number(H)];
1079
- R && B(R.amount) > 0 && (n[M] || (n[M] = []), n[M].push(R));
1078
+ const O = (X = (Q = p.value) == null ? void 0 : Q[M]) == null ? void 0 : X[Number(H)];
1079
+ O && B(O.amount) > 0 && (n[M] || (n[M] = []), n[M].push(O));
1080
1080
  });
1081
1081
  }), await A.revertWastageAdjustment({
1082
1082
  targetWastageAdjustmentId: c.adjustmentId,
1083
1083
  amountsGoingToAdjust: n
1084
- }), s("refreshHistory"), S.value = !1, m.value = {};
1084
+ }), o("refreshHistory"), F.value = !1, p.value = {};
1085
1085
  }
1086
- function y(n, r, F) {
1086
+ function y(n, r, x) {
1087
1087
  return P({
1088
1088
  get: () => {
1089
- var D, H, R;
1090
- const M = (R = (H = (D = m.value) == null ? void 0 : D[n]) == null ? void 0 : H[r]) == null ? void 0 : R.amount;
1089
+ var D, H, O;
1090
+ const M = (O = (H = (D = p.value) == null ? void 0 : D[n]) == null ? void 0 : H[r]) == null ? void 0 : O.amount;
1091
1091
  return M ? B(M, !0) : 0;
1092
1092
  },
1093
1093
  set: (M) => {
1094
- m.value || (m.value = {});
1095
- const D = { ...m.value };
1094
+ p.value || (p.value = {});
1095
+ const D = { ...p.value };
1096
1096
  D[n] || (D[n] = {}), D[n][r] = {
1097
1097
  amount: Ce.fromNumber(M),
1098
- type: ne.Enum.WASTAGE,
1099
- measurement: F
1100
- }, m.value = D;
1098
+ type: se.Enum.WASTAGE,
1099
+ measurement: x
1100
+ }, p.value = D;
1101
1101
  }
1102
1102
  });
1103
1103
  }
1104
1104
  function B(n, r = !0) {
1105
- const F = Number(Ce.toFormatString({ value: n }));
1106
- return r ? Math.abs(F) : F;
1105
+ const x = Number(Ce.toFormatString({ value: n }));
1106
+ return r ? Math.abs(x) : x;
1107
1107
  }
1108
1108
  function w(n, r) {
1109
1109
  return r.measurement ? r.measurement.abbrev : n.sku.unit.abbrev;
@@ -1112,20 +1112,20 @@ const je = {
1112
1112
  return r === 0 ? "N/A" : (n + r).toString();
1113
1113
  }
1114
1114
  return (n, r) => {
1115
- const F = j("FmIcon"), M = j("FmStepperField"), D = j("FmCard"), H = j("FmForm"), R = j("FmSpacer"), Q = j("FmButton"), X = j("FmDialog");
1116
- return x(), z(X, {
1117
- modelValue: S.value,
1118
- "onUpdate:modelValue": r[4] || (r[4] = (T) => S.value = T),
1115
+ const x = j("FmIcon"), M = j("FmStepperField"), D = j("FmCard"), H = j("FmForm"), O = j("FmSpacer"), Q = j("FmButton"), X = j("FmDialog");
1116
+ return S(), z(X, {
1117
+ modelValue: F.value,
1118
+ "onUpdate:modelValue": r[4] || (r[4] = (T) => F.value = T),
1119
1119
  overlay: !0
1120
1120
  }, {
1121
1121
  "dialog-button": I(() => [
1122
- g(Kt, null, {
1122
+ g(Wt, null, {
1123
1123
  default: I(() => [
1124
1124
  e("button", {
1125
- onClick: r[0] || (r[0] = (T) => S.value = !0),
1125
+ onClick: r[0] || (r[0] = (T) => F.value = !0),
1126
1126
  class: "rounded-md hover:bg-gray-100 transition-colors"
1127
1127
  }, [
1128
- g(F, {
1128
+ g(x, {
1129
1129
  name: "edit",
1130
1130
  size: "sm"
1131
1131
  })
@@ -1138,29 +1138,29 @@ const je = {
1138
1138
  e("div", null, "Amend Adjustment", -1)
1139
1139
  ])),
1140
1140
  "dialog-footer": I(() => [
1141
- e("div", Tn, [
1141
+ e("div", Un, [
1142
1142
  r[13] || (r[13] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "1. New adjustment EXTRA will be created for each reversal", -1)),
1143
- e("div", Un, [
1144
- g(R),
1143
+ e("div", En, [
1144
+ g(O),
1145
1145
  g(Q, {
1146
1146
  class: "sm:w-full xs:w-full",
1147
1147
  label: "Close",
1148
1148
  size: "md",
1149
1149
  variant: "tertiary",
1150
- onClick: r[3] || (r[3] = (T) => S.value = !1)
1150
+ onClick: r[3] || (r[3] = (T) => F.value = !1)
1151
1151
  }),
1152
1152
  g(Q, {
1153
1153
  class: "sm:w-full xs:w-full",
1154
1154
  label: "Submit",
1155
1155
  size: "md",
1156
1156
  variant: "primary",
1157
- onClick: a
1157
+ onClick: s
1158
1158
  })
1159
1159
  ])
1160
1160
  ])
1161
1161
  ]),
1162
1162
  default: I(() => [
1163
- d.value ? (x(), O("div", An)) : (x(), z(H, {
1163
+ m.value ? (S(), R("div", Vn)) : (S(), z(H, {
1164
1164
  key: 1,
1165
1165
  ref_key: "formRef",
1166
1166
  ref: l,
@@ -1173,51 +1173,51 @@ const je = {
1173
1173
  blameFormChildOnValidationFailed: ""
1174
1174
  }, {
1175
1175
  default: I(() => [
1176
- e("p", Vn, [
1176
+ e("p", Cn, [
1177
1177
  r[6] || (r[6] = e("b", null, "Date:", -1)),
1178
1178
  r[7] || (r[7] = e("br", null, null, -1)),
1179
- ue(" " + b(i(xt)(i(St)(C.value._id))), 1)
1179
+ ue(" " + _(i(xt)(i(St)(C.value._id))), 1)
1180
1180
  ]),
1181
- e("div", Cn, [
1182
- (x(!0), O(ee, null, re(C.value.skus, (T, L) => (x(), O(ee, { key: L }, [
1183
- (x(!0), O(ee, null, re(T.amounts, (K, J) => (x(), z(D, {
1181
+ e("div", Bn, [
1182
+ (S(!0), R(te, null, ie(C.value.skus, (T, L) => (S(), R(te, { key: L }, [
1183
+ (S(!0), R(te, null, ie(T.amounts, (G, J) => (S(), z(D, {
1184
1184
  key: J,
1185
1185
  variant: "outlined",
1186
1186
  class: "p-2"
1187
1187
  }, {
1188
1188
  default: I(() => [
1189
- e("div", Bn, [
1190
- e("span", Mn, b(T.sku.code), 1),
1191
- e("span", null, b(T.sku.name), 1)
1189
+ e("div", Mn, [
1190
+ e("span", Dn, _(T.sku.code), 1),
1191
+ e("span", null, _(T.sku.name), 1)
1192
1192
  ]),
1193
1193
  r[12] || (r[12] = e("hr", { class: "m-2" }, null, -1)),
1194
- e("div", Dn, [
1194
+ e("div", jn, [
1195
1195
  r[8] || (r[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1196
- e("span", null, b(K.type), 1)
1196
+ e("span", null, _(G.type), 1)
1197
1197
  ]),
1198
- e("div", jn, [
1198
+ e("div", In, [
1199
1199
  r[9] || (r[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1200
- e("span", null, b(i(Ce).toFormatString({ value: K.amount })) + " " + b(w(T, K)), 1)
1200
+ e("span", null, _(i(Ce).toFormatString({ value: G.amount })) + " " + _(w(T, G)), 1)
1201
1201
  ]),
1202
1202
  g(M, {
1203
1203
  "model-value": y(T.sku._id, J).value,
1204
- "onUpdate:modelValue": (te) => y(T.sku._id, J).value = te,
1204
+ "onUpdate:modelValue": (ne) => y(T.sku._id, J).value = ne,
1205
1205
  class: "mb-3",
1206
1206
  label: "Adjust Amount (Leave 0 to skip)",
1207
- "helper-text": `Max: ${B(K.amount)}`,
1208
- "append-text": w(T, K),
1207
+ "helper-text": `Max: ${B(G.amount)}`,
1208
+ "append-text": w(T, G),
1209
1209
  rules: [
1210
- (te) => te <= B(K.amount) || `Cannot be more than ${B(K.amount)}`,
1210
+ (ne) => ne <= B(G.amount) || `Cannot be more than ${B(G.amount)}`,
1211
1211
  i(Fe)(-1)
1212
1212
  ]
1213
1213
  }, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
1214
- e("div", In, [
1214
+ e("div", Tn, [
1215
1215
  r[10] || (r[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1216
1216
  r[11] || (r[11] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "* It's an estimate for your reference, as it didn't include all the reversals related to this adjustment", -1)),
1217
- ue(" " + b($(
1218
- B(K.amount, !1),
1217
+ ue(" " + _($(
1218
+ B(G.amount, !1),
1219
1219
  y(T.sku._id, J).value
1220
- )) + " " + b(w(T, K)), 1)
1220
+ )) + " " + _(w(T, G)), 1)
1221
1221
  ])
1222
1222
  ]),
1223
1223
  _: 2
@@ -1232,19 +1232,19 @@ const je = {
1232
1232
  }, 8, ["modelValue"]);
1233
1233
  };
1234
1234
  }
1235
- }), Hn = { class: "p-16" }, Pn = { class: "fm-typo-en-body-md-600 flex-grow" }, Rn = { class: "flex-grow text-fm-color-typo-secondary" }, On = {
1235
+ }), Pn = { class: "p-16" }, Rn = { class: "fm-typo-en-body-md-600 flex-grow" }, On = { class: "flex-grow text-fm-color-typo-secondary" }, Nn = {
1236
1236
  key: 0,
1237
1237
  class: "my-5"
1238
- }, Nn = { class: "text-neutral-400" }, Ln = { class: "flex-grow" }, zn = { class: "flex gap-1" }, Yn = { class: "flex flex-col gap-1" }, Gn = {
1238
+ }, Ln = { class: "text-neutral-400" }, zn = { class: "flex-grow" }, Yn = { class: "flex gap-1" }, Gn = { class: "flex flex-col gap-1" }, Kn = {
1239
1239
  key: 1,
1240
1240
  class: "t-system text-fsecondary"
1241
- }, Kn = {
1241
+ }, Wn = {
1242
1242
  key: 2,
1243
1243
  class: "inline-flex items-center rounded-md bg-yellow-400/10 px-2 text-xs font-medium text-yellow-500 inset-ring inset-ring-yellow-400/20"
1244
- }, Wn = {
1244
+ }, qn = {
1245
1245
  key: 1,
1246
1246
  class: "shrink-0 text-fm-color-typo-secondary"
1247
- }, qn = /* @__PURE__ */ ce({
1247
+ }, Xn = /* @__PURE__ */ ce({
1248
1248
  __name: "StockRecordCard",
1249
1249
  props: {
1250
1250
  record: {},
@@ -1252,35 +1252,35 @@ const je = {
1252
1252
  bills: { default: () => [] }
1253
1253
  },
1254
1254
  emits: ["refreshHistory"],
1255
- setup(_, { emit: h }) {
1256
- const c = _, s = N(!1);
1255
+ setup(b, { emit: h }) {
1256
+ const c = b, o = N(!1);
1257
1257
  at();
1258
- const A = N(), m = N(null), d = P(() => m.value === null ? "unset" : s.value ? `${m.value}px` : "0px");
1258
+ const A = N(), p = N(null), m = P(() => p.value === null ? "unset" : o.value ? `${p.value}px` : "0px");
1259
1259
  Ee(() => {
1260
1260
  var l;
1261
- m.value = ((l = A.value) == null ? void 0 : l.scrollHeight) || 0;
1261
+ p.value = ((l = A.value) == null ? void 0 : l.scrollHeight) || 0;
1262
1262
  });
1263
1263
  const v = P(() => {
1264
1264
  var $;
1265
- const l = c.record.adjustments, a = c.sku, y = {}, w = l.flatMap((n) => {
1265
+ const l = c.record.adjustments, s = c.sku, y = {}, w = l.flatMap((n) => {
1266
1266
  var r;
1267
- return ((r = n.skus) == null ? void 0 : r.filter((F) => F.sku._id === a._id)) ?? [];
1267
+ return ((r = n.skus) == null ? void 0 : r.filter((x) => x.sku._id === s._id)) ?? [];
1268
1268
  }).flatMap((n) => n.amounts);
1269
1269
  for (const n of w) {
1270
1270
  const r = n.measurement ? Ft(n.measurement.conversion, n.amount) : n.amount;
1271
1271
  y[$ = n.type] ?? (y[$] = { amount: 0, precision: 0 }), y[n.type] = et(r, y[n.type]);
1272
1272
  }
1273
1273
  return Object.entries(y).reduce(
1274
- (n, [r, F]) => (n[r] = /// comment, because without it formatter makes code uglier
1274
+ (n, [r, x]) => (n[r] = /// comment, because without it formatter makes code uglier
1275
1275
  `${q.toFormatString({
1276
- value: F,
1276
+ value: x,
1277
1277
  precision: 4
1278
- })} ${a.unit.abbrev}`, n),
1278
+ })} ${s.unit.abbrev}`, n),
1279
1279
  {}
1280
1280
  );
1281
- }), { t: S } = de(), C = P(() => c.record.adjustmentsByTime.map(({ date: l, adjustments: a }) => ({
1281
+ }), { t: F } = de(), C = P(() => c.record.adjustmentsByTime.map(({ date: l, adjustments: s }) => ({
1282
1282
  time: wt(new Date(l)),
1283
- adjustments: a.flatMap(
1283
+ adjustments: s.flatMap(
1284
1284
  (y) => {
1285
1285
  var B, w;
1286
1286
  return ((w = (B = y.skus) == null ? void 0 : B.map) == null ? void 0 : w.call(B, ($) => {
@@ -1296,7 +1296,7 @@ const je = {
1296
1296
  }
1297
1297
  ).flatMap((y) => {
1298
1298
  var $;
1299
- const B = ($ = c.bills.find((n) => n._id === y.ref)) == null ? void 0 : $.seqNumber, w = B ? S("inventory.stock.record.bill", [B]) : "";
1299
+ const B = ($ = c.bills.find((n) => n._id === y.ref)) == null ? void 0 : $.seqNumber, w = B ? F("inventory.stock.record.bill", [B]) : "";
1300
1300
  return y.amounts.map((n) => {
1301
1301
  var r;
1302
1302
  return {
@@ -1315,67 +1315,67 @@ const je = {
1315
1315
  });
1316
1316
  })
1317
1317
  })));
1318
- return (l, a) => {
1318
+ return (l, s) => {
1319
1319
  const y = j("FmIcon"), B = j("FmTooltip"), w = j("FmCard");
1320
- return x(), z(w, { variant: "outlined" }, {
1320
+ return S(), z(w, { variant: "outlined" }, {
1321
1321
  default: I(() => [
1322
- e("div", Hn, [
1322
+ e("div", Pn, [
1323
1323
  e("div", {
1324
1324
  class: "flex items-center cursor-pointer mb-1",
1325
- onClick: a[0] || (a[0] = ($) => s.value = !s.value)
1325
+ onClick: s[0] || (s[0] = ($) => o.value = !o.value)
1326
1326
  }, [
1327
- e("div", Pn, b(l.record.date), 1),
1327
+ e("div", Rn, _(l.record.date), 1),
1328
1328
  g(y, {
1329
- name: s.value ? "expand_more" : "expand_less",
1329
+ name: o.value ? "expand_more" : "expand_less",
1330
1330
  color: "#777777",
1331
1331
  size: "md"
1332
1332
  }, null, 8, ["name"])
1333
1333
  ]),
1334
- (x(!0), O(ee, null, re(v.value, ($, n) => (x(), O("div", {
1334
+ (S(!0), R(te, null, ie(v.value, ($, n) => (S(), R("div", {
1335
1335
  key: n,
1336
1336
  class: "flex flex-row py-1",
1337
1337
  style: { "font-size": "0.8rem" }
1338
1338
  }, [
1339
- e("div", Rn, b(i(S)(`inventory.inventoryAdjustment.type.${n}`)), 1),
1339
+ e("div", On, _(i(F)(`inventory.inventoryAdjustment.type.${n}`)), 1),
1340
1340
  e("div", {
1341
1341
  class: ge({
1342
1342
  "text-fm-color-typo-error": $.startsWith("-"),
1343
1343
  "text-fm-color-typo-success": !$.startsWith("-"),
1344
1344
  "ml-auto": !0
1345
1345
  })
1346
- }, b($), 3)
1346
+ }, _($), 3)
1347
1347
  ]))), 128)),
1348
1348
  e("div", {
1349
1349
  ref_key: "detailRef",
1350
1350
  ref: A,
1351
1351
  style: Ze({
1352
1352
  fontSize: "0.8rem",
1353
- maxHeight: d.value,
1353
+ maxHeight: m.value,
1354
1354
  overflow: "hidden",
1355
1355
  transition: "max-height 0.2s ease-out"
1356
1356
  })
1357
1357
  }, [
1358
- C.value.length ? (x(), O("hr", On)) : ae("", !0),
1359
- (x(!0), O(ee, null, re(C.value, ($) => (x(), O("div", {
1358
+ C.value.length ? (S(), R("hr", Nn)) : oe("", !0),
1359
+ (S(!0), R(te, null, ie(C.value, ($) => (S(), R("div", {
1360
1360
  key: $.time,
1361
1361
  class: "flex gap-1 w-full"
1362
1362
  }, [
1363
- e("div", Nn, b($.time), 1),
1364
- e("div", Ln, [
1365
- (x(!0), O(ee, null, re($.adjustments, (n) => (x(), O("div", {
1363
+ e("div", Ln, _($.time), 1),
1364
+ e("div", zn, [
1365
+ (S(!0), R(te, null, ie($.adjustments, (n) => (S(), R("div", {
1366
1366
  key: n.name,
1367
1367
  class: "flex gap-1"
1368
1368
  }, [
1369
- e("div", zn, [
1370
- ue(b(i(S)(`inventory.inventoryAdjustment.type.${n.name}`)) + " ", 1),
1371
- n.backdateFrom ? (x(), z(B, {
1369
+ e("div", Yn, [
1370
+ ue(_(i(F)(`inventory.inventoryAdjustment.type.${n.name}`)) + " ", 1),
1371
+ n.backdateFrom ? (S(), z(B, {
1372
1372
  key: 0,
1373
1373
  variant: "plain",
1374
1374
  placement: "top",
1375
1375
  "z-index": 50
1376
1376
  }, {
1377
1377
  content: I(() => [
1378
- e("div", Yn, b(i(S)("inventory.stock.record.backdate", [
1378
+ e("div", Gn, _(i(F)("inventory.stock.record.backdate", [
1379
1379
  i(tt)(new Date(n.backdateFrom))
1380
1380
  ])), 1)
1381
1381
  ]),
@@ -1387,9 +1387,9 @@ const je = {
1387
1387
  })
1388
1388
  ]),
1389
1389
  _: 2
1390
- }, 1024)) : ae("", !0),
1391
- n.remark ? (x(), O("span", Gn, " # " + b(n.remark), 1)) : ae("", !0),
1392
- n.name === i(ne).Enum.CLOSING ? (x(), O("span", Kn, " Actual Balance: " + b(n.toBalance) + " " + b(n.baseUnit), 1)) : ae("", !0)
1390
+ }, 1024)) : oe("", !0),
1391
+ n.remark ? (S(), R("span", Kn, " # " + _(n.remark), 1)) : oe("", !0),
1392
+ n.name === i(se).Enum.CLOSING ? (S(), R("span", Wn, " Actual Balance: " + _(n.toBalance) + " " + _(n.baseUnit), 1)) : oe("", !0)
1393
1393
  ]),
1394
1394
  e("div", {
1395
1395
  class: ge({
@@ -1397,13 +1397,13 @@ const je = {
1397
1397
  "text-fm-color-typo-success": !n.amount.startsWith("-"),
1398
1398
  "ml-auto": !0
1399
1399
  })
1400
- }, b(n.amount), 3),
1401
- n.name === i(ne).Enum.WASTAGE ? (x(), z(En, {
1400
+ }, _(n.amount), 3),
1401
+ n.name === i(se).Enum.WASTAGE ? (S(), z(Hn, {
1402
1402
  key: 0,
1403
1403
  adjustmentId: n.adjustmentId,
1404
- onRefreshHistory: a[1] || (a[1] = (r) => l.$emit("refreshHistory"))
1405
- }, null, 8, ["adjustmentId"])) : ae("", !0),
1406
- n.cost ? (x(), O("div", Wn, " (" + b(i(be)(n.cost, !1, n.cost.precision)) + ") ", 1)) : ae("", !0)
1404
+ onRefreshHistory: s[1] || (s[1] = (r) => l.$emit("refreshHistory"))
1405
+ }, null, 8, ["adjustmentId"])) : oe("", !0),
1406
+ n.cost ? (S(), R("div", qn, " (" + _(i(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : oe("", !0)
1407
1407
  ]))), 128))
1408
1408
  ])
1409
1409
  ]))), 128))
@@ -1415,58 +1415,58 @@ const je = {
1415
1415
  };
1416
1416
  }
1417
1417
  });
1418
- function Xn(_, h) {
1419
- var m;
1420
- const c = Object.keys(ne.enum).reduce(
1421
- (d, v) => (d[v] = { amount: 0, precision: 0 }, d),
1418
+ function Qn(b, h) {
1419
+ var p;
1420
+ const c = Object.keys(se.enum).reduce(
1421
+ (m, v) => (m[v] = { amount: 0, precision: 0 }, m),
1422
1422
  {}
1423
1423
  );
1424
1424
  if (!h)
1425
1425
  return Object.entries(c).reduce(
1426
- (d, [v]) => (d[v] = q.fromNumber(0), d),
1426
+ (m, [v]) => (m[v] = q.fromNumber(0), m),
1427
1427
  {}
1428
1428
  );
1429
- const A = _.flatMap((d) => {
1429
+ const A = b.flatMap((m) => {
1430
1430
  var v;
1431
- return ((v = d.skus) == null ? void 0 : v.filter((S) => S.sku._id === h._id)) ?? [];
1432
- }).flatMap((d) => d.amounts);
1433
- for (const d of A) {
1434
- const v = d.measurement ? q.multiply([d.measurement.conversion, d.amount]) : d.amount;
1435
- c[m = d.type] ?? (c[m] = { amount: 0, precision: 0 }), c[d.type] = q.add([v, c[d.type]]);
1431
+ return ((v = m.skus) == null ? void 0 : v.filter((F) => F.sku._id === h._id)) ?? [];
1432
+ }).flatMap((m) => m.amounts);
1433
+ for (const m of A) {
1434
+ const v = m.measurement ? q.multiply([m.measurement.conversion, m.amount]) : m.amount;
1435
+ c[p = m.type] ?? (c[p] = { amount: 0, precision: 0 }), c[m.type] = q.add([v, c[m.type]]);
1436
1436
  }
1437
1437
  return Object.entries(c).reduce(
1438
- (d, [v, S]) => {
1438
+ (m, [v, F]) => {
1439
1439
  const C = {
1440
- ...S,
1441
- amount: Math.abs(S.amount)
1440
+ ...F,
1441
+ amount: Math.abs(F.amount)
1442
1442
  };
1443
- return d[v] = /// comment, because without it formatter makes code uglier
1443
+ return m[v] = /// comment, because without it formatter makes code uglier
1444
1444
  `${q.toFormatString({
1445
1445
  value: C,
1446
1446
  precision: 4
1447
- })} ${h.unit.abbrev}`, d;
1447
+ })} ${h.unit.abbrev}`, m;
1448
1448
  },
1449
1449
  {}
1450
1450
  );
1451
1451
  }
1452
- function Jn(_, h) {
1452
+ function Jn(b, h) {
1453
1453
  if (!h)
1454
1454
  return null;
1455
1455
  let c = null;
1456
- const A = _.flatMap((m) => {
1457
- var d;
1458
- return ((d = m.skus) == null ? void 0 : d.filter((v) => v.sku._id === h._id)) ?? [];
1459
- }).flatMap((m) => {
1460
- var d;
1461
- return !m.history || ((d = m.history) == null ? void 0 : d.length) === 0 ? [] : m.history[0];
1456
+ const A = b.flatMap((p) => {
1457
+ var m;
1458
+ return ((m = p.skus) == null ? void 0 : m.filter((v) => v.sku._id === h._id)) ?? [];
1459
+ }).flatMap((p) => {
1460
+ var m;
1461
+ return !p.history || ((m = p.history) == null ? void 0 : m.length) === 0 ? [] : p.history[0];
1462
1462
  });
1463
- for (const m of A) {
1464
- const d = m.amounts;
1465
- for (const v of d) {
1466
- if (v.type !== ne.Enum.SALES)
1463
+ for (const p of A) {
1464
+ const m = p.amounts;
1465
+ for (const v of m) {
1466
+ if (v.type !== se.Enum.SALES)
1467
1467
  continue;
1468
- const S = v.measurement ? q.multiply([v.measurement.conversion, v.amount]) : v.amount;
1469
- c ?? (c = q.fromNumber(0)), c = q.add([c, S]);
1468
+ const F = v.measurement ? q.multiply([v.measurement.conversion, v.amount]) : v.amount;
1469
+ c ?? (c = q.fromNumber(0)), c = q.add([c, F]);
1470
1470
  }
1471
1471
  }
1472
1472
  return c != null ? (c.amount = Math.abs(c.amount), `${q.toFormatString({
@@ -1474,128 +1474,128 @@ function Jn(_, h) {
1474
1474
  precision: 4
1475
1475
  })} ${h.unit.abbrev}`) : null;
1476
1476
  }
1477
- const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = { class: "flex-1 line-clamp-2" }, eo = { class: "flex flex-col gap-32 w-full h-full" }, to = { class: "flex items-center relative gap-4" }, no = { class: "flex-1" }, oo = {
1477
+ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = { class: "flex-1 line-clamp-2" }, to = { class: "flex flex-col gap-32 w-full h-full" }, no = { class: "flex items-center relative gap-4" }, oo = { class: "flex-1" }, so = {
1478
1478
  key: 0,
1479
1479
  class: "flex-1 flex flex-col items-center gap-16"
1480
- }, so = { class: "fm-typo-en-body-lg-400 translate-x-4" }, ao = {
1480
+ }, ao = { class: "fm-typo-en-body-lg-400 translate-x-4" }, lo = {
1481
1481
  key: 1,
1482
1482
  class: "flex flex-col gap-12"
1483
- }, lo = { class: "pb-16" }, ro = { class: "fm-typo-cn-body-lg-600" }, io = {
1483
+ }, ro = { class: "pb-16" }, io = { class: "fm-typo-cn-body-lg-600" }, uo = {
1484
1484
  class: "grid gap-12 fm-typo-en-body-md-400",
1485
1485
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1486
- }, uo = { class: "flex flex-col gap-1" }, co = { class: "text-fm-color-typo-secondary" }, mo = { class: "font-bold" }, po = { class: "flex flex-col gap-1" }, fo = { class: "text-fm-color-typo-secondary flex" }, vo = { class: "font-bold" }, yo = { class: "flex flex-col gap-1" }, _o = { class: "text-fm-color-typo-secondary" }, ko = { class: "font-bold" }, bo = { class: "flex flex-col gap-1" }, ho = { class: "text-fm-color-typo-secondary" }, go = { class: "font-bold" }, xo = { class: "flex flex-col gap-1" }, So = { class: "text-fm-color-typo-secondary" }, Fo = { class: "font-bold" }, wo = { class: "flex flex-col gap-1" }, $o = { class: "text-fm-color-typo-secondary" }, Ao = { class: "font-bold" }, Vo = { class: "flex flex-col gap-1" }, Co = { class: "text-fm-color-typo-secondary" }, Bo = { class: "font-bold" }, Mo = { class: "flex flex-col gap-1" }, Do = { class: "text-fm-color-typo-secondary" }, jo = { class: "font-bold" }, Io = { class: "flex flex-col gap-1" }, To = { class: "text-fm-color-typo-secondary" }, Uo = { class: "font-bold" }, Eo = {
1486
+ }, co = { class: "flex flex-col gap-1" }, mo = { class: "text-fm-color-typo-secondary" }, po = { class: "font-bold" }, fo = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary flex" }, yo = { class: "font-bold" }, _o = { class: "flex flex-col gap-1" }, bo = { class: "text-fm-color-typo-secondary" }, ko = { class: "font-bold" }, ho = { class: "flex flex-col gap-1" }, go = { class: "text-fm-color-typo-secondary" }, xo = { class: "font-bold" }, So = { class: "flex flex-col gap-1" }, Fo = { class: "text-fm-color-typo-secondary" }, wo = { class: "font-bold" }, $o = { class: "flex flex-col gap-1" }, Ao = { class: "text-fm-color-typo-secondary" }, Vo = { class: "font-bold" }, Co = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary" }, Mo = { class: "font-bold" }, Do = { class: "flex flex-col gap-1" }, jo = { class: "text-fm-color-typo-secondary" }, Io = { class: "font-bold" }, To = { class: "flex flex-col gap-1" }, Uo = { class: "text-fm-color-typo-secondary" }, Eo = { class: "font-bold" }, Ho = {
1487
1487
  key: 0,
1488
1488
  class: "flex flex-col gap-8"
1489
- }, Ho = { class: "flex" }, Po = { class: "flex-1 flex flex-col gap-1" }, Ro = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Oo = { class: "font-bold" }, No = { class: "flex-1 flex flex-col gap-1" }, Lo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, zo = { class: "flex flex-col gap-1" }, Yo = { class: "font-bold" }, Go = {
1489
+ }, Po = { class: "flex" }, Ro = { class: "flex-1 flex flex-col gap-1" }, Oo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, No = { class: "font-bold" }, Lo = { class: "flex-1 flex flex-col gap-1" }, zo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Yo = { class: "flex flex-col gap-1" }, Go = { class: "font-bold" }, Ko = {
1490
1490
  key: 2,
1491
1491
  class: "flex-1 flex flex-col items-center gap-8"
1492
- }, Ko = ["src"], Wo = { class: "font-bold text-lg" }, qo = { class: "text-xs text-neutral-400 text-center" }, Xo = /* @__PURE__ */ ce({
1492
+ }, Wo = ["src"], qo = { class: "font-bold text-lg" }, Xo = { class: "text-xs text-neutral-400 text-center" }, Qo = /* @__PURE__ */ ce({
1493
1493
  __name: "StockHistory",
1494
1494
  props: {
1495
1495
  sku: {},
1496
1496
  show: { type: Boolean }
1497
1497
  },
1498
1498
  emits: ["update:show"],
1499
- setup(_) {
1500
- const h = at(), c = Re(), s = ye(), A = $n(), m = pe(), d = Ct(), { t: v } = de(), S = _, C = N(!1), l = _e(), a = N($t(0));
1499
+ setup(b) {
1500
+ const h = at(), c = Re(), o = ye(), A = An(), p = pe(), m = Ct(), { t: v } = de(), F = b, C = N(!1), l = _e(), s = N($t(0));
1501
1501
  async function y() {
1502
1502
  C.value = !0;
1503
1503
  try {
1504
- await F(), await c.readStockBalance();
1504
+ await x(), await c.readStockBalance();
1505
1505
  } catch (t) {
1506
1506
  l.open({
1507
1507
  title: "Something went wrong",
1508
1508
  message: "Cannot fetch stock history. Please try again.",
1509
1509
  type: "error"
1510
- }), console.log("failed at fetching item adjustment history", S.sku, a, t);
1510
+ }), console.log("failed at fetching item adjustment history", F.sku, s, t);
1511
1511
  } finally {
1512
1512
  C.value = !1;
1513
1513
  }
1514
1514
  }
1515
1515
  Ee(() => {
1516
1516
  y();
1517
- }), xe([() => a.value, () => S.sku], () => {
1517
+ }), xe([() => s.value, () => F.sku], () => {
1518
1518
  y();
1519
1519
  });
1520
1520
  const B = N([]), w = N([]), $ = N(new Array());
1521
- function n(t, o) {
1522
- return o === "day" ? It(t) : tt(t);
1521
+ function n(t, a) {
1522
+ return a === "day" ? It(t) : tt(t);
1523
1523
  }
1524
- function r(t, o) {
1525
- const f = t.reduce(
1526
- (u, p) => {
1527
- const V = p.effectiveAt ?? ot(p._id);
1524
+ function r(t, a) {
1525
+ const d = t.reduce(
1526
+ (u, f) => {
1527
+ const V = f.effectiveAt ?? ot(f._id);
1528
1528
  if (!V)
1529
1529
  return u;
1530
- const E = n(new Date(V), o);
1531
- return u[E] ?? (u[E] = []), u[E].push(p), u;
1530
+ const E = n(new Date(V), a);
1531
+ return u[E] ?? (u[E] = []), u[E].push(f), u;
1532
1532
  },
1533
1533
  {}
1534
1534
  );
1535
- return Object.keys(f).map((u) => ({
1535
+ return Object.keys(d).map((u) => ({
1536
1536
  date: u,
1537
- adjustments: f[u]
1537
+ adjustments: d[u]
1538
1538
  }));
1539
1539
  }
1540
- async function F() {
1541
- let t = await s.readStockAdjustment(
1542
- S.sku._id,
1543
- Bt(new Date(a.value.startDate)).toISOString(),
1544
- Mt(new Date(a.value.endDate)).toISOString()
1540
+ async function x() {
1541
+ let t = await o.readStockAdjustment(
1542
+ F.sku._id,
1543
+ Bt(new Date(s.value.startDate)).toISOString(),
1544
+ Mt(new Date(s.value.endDate)).toISOString()
1545
1545
  );
1546
1546
  B.value = t;
1547
- const o = t.filter(({ ref: f }) => f == null ? void 0 : f.startsWith("bill_")).map(({ ref: f }) => f);
1548
- await M(o), w.value = r(t, "day").map(({ date: f, adjustments: u }) => ({
1549
- date: f,
1547
+ const a = t.filter(({ ref: d }) => d == null ? void 0 : d.startsWith("bill_")).map(({ ref: d }) => d);
1548
+ await M(a), w.value = r(t, "day").map(({ date: d, adjustments: u }) => ({
1549
+ date: d,
1550
1550
  adjustments: u,
1551
1551
  adjustmentsByTime: r(u, "minute")
1552
1552
  }));
1553
1553
  }
1554
1554
  async function M(t) {
1555
- t.length && ($.value = await A.findBillsById(t).catch((o) => {
1556
- var p;
1557
- console.error("Error on using latest bill API, retrying using legacy api", o);
1558
- const f = ((p = h.currentBusiness.value) == null ? void 0 : p._id) ?? "", u = m.currentLocation.doc._id;
1559
- return A.findBillsByBusinessId(f, [u], t);
1555
+ t.length && ($.value = await A.findBillsById(t).catch((a) => {
1556
+ var f;
1557
+ console.error("Error on using latest bill API, retrying using legacy api", a);
1558
+ const d = ((f = h.currentBusiness.value) == null ? void 0 : f._id) ?? "", u = p.currentLocation.doc._id;
1559
+ return A.findBillsByBusinessId(d, [u], t);
1560
1560
  }));
1561
1561
  }
1562
1562
  const D = P(() => {
1563
- const t = B.value, o = S.sku;
1564
- return Xn(t, o);
1563
+ const t = B.value, a = F.sku;
1564
+ return Qn(t, a);
1565
1565
  }), H = P(() => {
1566
- const t = B.value, o = S.sku;
1567
- return Jn(t, o);
1568
- }), R = P(() => {
1569
- const t = [...B.value].computeFirst((f) => {
1570
- var p, V;
1571
- const u = (V = (p = f.skus) == null ? void 0 : p.find) == null ? void 0 : V.call(p, (E) => E.sku._id === S.sku._id);
1566
+ const t = B.value, a = F.sku;
1567
+ return Jn(t, a);
1568
+ }), O = P(() => {
1569
+ const t = [...B.value].computeFirst((d) => {
1570
+ var f, V;
1571
+ const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (E) => E.sku._id === F.sku._id);
1572
1572
  return u == null ? void 0 : u.fromBalance;
1573
1573
  }) ?? {
1574
1574
  amount: 0,
1575
1575
  precision: 0
1576
- }, o = S.sku;
1577
- return o ? `${q.toFormatString({
1576
+ }, a = F.sku;
1577
+ return a ? `${q.toFormatString({
1578
1578
  value: t,
1579
1579
  precision: 4
1580
- })} ${o.unit.abbrev}` : "";
1580
+ })} ${a.unit.abbrev}` : "";
1581
1581
  }), Q = P(() => {
1582
- const t = [...B.value].reverse().computeFirst((f) => {
1583
- var p, V;
1584
- const u = (V = (p = f.skus) == null ? void 0 : p.find) == null ? void 0 : V.call(p, (E) => E.sku._id === S.sku._id);
1582
+ const t = [...B.value].reverse().computeFirst((d) => {
1583
+ var f, V;
1584
+ const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (E) => E.sku._id === F.sku._id);
1585
1585
  return u == null ? void 0 : u.toBalance;
1586
1586
  }) ?? {
1587
1587
  amount: 0,
1588
1588
  precision: 0
1589
- }, o = S.sku;
1590
- return o ? `${q.toFormatString({ value: t, precision: 4 })} ${o.unit.abbrev}` : "";
1589
+ }, a = F.sku;
1590
+ return a ? `${q.toFormatString({ value: t, precision: 4 })} ${a.unit.abbrev}` : "";
1591
1591
  }), X = P(() => {
1592
- var f;
1593
- const o = B.value.flatMap((u) => {
1594
- var p;
1595
- return ((p = u.skus) == null ? void 0 : p.flatMap((V) => V.amounts)) ?? [];
1592
+ var d;
1593
+ const a = B.value.flatMap((u) => {
1594
+ var f;
1595
+ return ((f = u.skus) == null ? void 0 : f.flatMap((V) => V.amounts)) ?? [];
1596
1596
  }).filter((u) => u.amount.amount < 0).reduce(
1597
- (u, p) => {
1598
- const V = p.cost;
1597
+ (u, f) => {
1598
+ const V = f.cost;
1599
1599
  if (!V) return u;
1600
1600
  const E = {
1601
1601
  ...At(u, Math.max(u.precision, V.precision)),
@@ -1609,96 +1609,96 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1609
1609
  {
1610
1610
  amount: 0,
1611
1611
  precision: 0,
1612
- currency: Be((f = h.currentCountry) == null ? void 0 : f.value)
1612
+ currency: Be((d = h.currentCountry) == null ? void 0 : d.value)
1613
1613
  }
1614
1614
  );
1615
- return be(o, !1, o.precision);
1615
+ return ke(a, !1, a.precision);
1616
1616
  });
1617
1617
  function T() {
1618
- const { startDate: t, endDate: o } = Dt(a.value);
1619
- t !== null && o !== null && (a.value = {
1618
+ const { startDate: t, endDate: a } = Dt(s.value);
1619
+ t !== null && a !== null && (s.value = {
1620
1620
  startDate: t,
1621
- endDate: o
1621
+ endDate: a
1622
1622
  });
1623
1623
  }
1624
- const L = P(() => S.sku.valuation === We.Enum.FIFO ? v("inventory.ingredient.valuationMethod.FIFO") : v("inventory.ingredient.valuationMethod.WAVG")), K = P(() => {
1625
- var E, W, oe, U;
1624
+ const L = P(() => F.sku.valuation === We.Enum.FIFO ? v("inventory.ingredient.valuationMethod.FIFO") : v("inventory.ingredient.valuationMethod.WAVG")), G = P(() => {
1625
+ var E, K, ae, U;
1626
1626
  const t = [...B.value].reverse().computeFirst((Y) => {
1627
- var G, se;
1628
- return (se = (G = Y.skus) == null ? void 0 : G.find) == null ? void 0 : se.call(G, (ie) => ie.sku._id === S.sku._id);
1627
+ var W, Z;
1628
+ return (Z = (W = Y.skus) == null ? void 0 : W.find) == null ? void 0 : Z.call(W, (le) => le.sku._id === F.sku._id);
1629
1629
  });
1630
1630
  if (!t) return "No data";
1631
- const o = [...t.amounts].reverse()[0], f = {
1632
- amount: ((E = o.cost) == null ? void 0 : E.amount) ?? 0,
1633
- precision: ((W = o.cost) == null ? void 0 : W.precision) ?? 0
1634
- }, u = o.amount, p = u.amount == 0 ? q.fromNumber(0) : q.divide([f, u]);
1631
+ const a = [...t.amounts].reverse()[0], d = {
1632
+ amount: ((E = a.cost) == null ? void 0 : E.amount) ?? 0,
1633
+ precision: ((K = a.cost) == null ? void 0 : K.precision) ?? 0
1634
+ }, u = a.amount, f = u.amount == 0 ? q.fromNumber(0) : q.divide([d, u]);
1635
1635
  return {
1636
- ...q.multiply([p, u]),
1637
- currency: ((oe = o.cost) == null ? void 0 : oe.currency) || Be(((U = h.currentCountry) == null ? void 0 : U.value) ?? Vt)
1636
+ ...q.multiply([f, u]),
1637
+ currency: ((ae = a.cost) == null ? void 0 : ae.currency) || Be(((U = h.currentCountry) == null ? void 0 : U.value) ?? Vt)
1638
1638
  };
1639
1639
  }), J = P(() => {
1640
- var f;
1640
+ var d;
1641
1641
  const t = [...B.value].reverse().computeFirst((u) => {
1642
1642
  var V, E;
1643
- const p = (E = (V = u.skus) == null ? void 0 : V.find) == null ? void 0 : E.call(V, (W) => W.sku._id === S.sku._id);
1644
- return p == null ? void 0 : p.toCostBalances;
1643
+ const f = (E = (V = u.skus) == null ? void 0 : V.find) == null ? void 0 : E.call(V, (K) => K.sku._id === F.sku._id);
1644
+ return f == null ? void 0 : f.toCostBalances;
1645
1645
  });
1646
1646
  return t ? {
1647
- ...t.reduce((u, p) => q.add([u, q.fromDinero(p.cost)]), {
1647
+ ...t.reduce((u, f) => q.add([u, q.fromDinero(f.cost)]), {
1648
1648
  amount: 0,
1649
1649
  precision: 0
1650
1650
  }),
1651
- currency: Be((f = h.currentCountry) == null ? void 0 : f.value)
1651
+ currency: Be((d = h.currentCountry) == null ? void 0 : d.value)
1652
1652
  } : "No data";
1653
1653
  });
1654
- function te() {
1655
- const { startDate: t, endDate: o } = jt(a.value);
1656
- t !== null && o !== null && (a.value = {
1654
+ function ne() {
1655
+ const { startDate: t, endDate: a } = jt(s.value);
1656
+ t !== null && a !== null && (s.value = {
1657
1657
  startDate: t,
1658
- endDate: o
1658
+ endDate: a
1659
1659
  });
1660
1660
  }
1661
- const k = Ne(S, "show");
1662
- return (t, o) => {
1663
- const f = j("FmButton"), u = j("FmField"), p = j("FmDateRangePicker"), V = j("FmSpacer"), E = j("FmCircularProgress"), W = j("FmIcon"), oe = j("FmTooltip"), U = j("FmMenuDivider"), Y = j("FmChip"), G = j("FmCardSection"), se = j("FmCard"), ie = j("FmSideSheet");
1664
- return x(), z(ie, {
1661
+ const k = Ne(F, "show");
1662
+ return (t, a) => {
1663
+ const d = j("FmButton"), u = j("FmField"), f = j("FmDateRangePicker"), V = j("FmSpacer"), E = j("FmCircularProgress"), K = j("FmIcon"), ae = j("FmTooltip"), U = j("FmMenuDivider"), Y = j("FmChip"), W = j("FmCardSection"), Z = j("FmCard"), le = j("FmSideSheet");
1664
+ return S(), z(le, {
1665
1665
  "dismiss-away": "",
1666
1666
  modelValue: i(k),
1667
- "onUpdate:modelValue": o[4] || (o[4] = (Z) => Ue(k) ? k.value = Z : null),
1667
+ "onUpdate:modelValue": a[4] || (a[4] = (ee) => Ue(k) ? k.value = ee : null),
1668
1668
  "close-button": !1,
1669
1669
  "max-width": 560
1670
1670
  }, {
1671
1671
  "side-sheet-header": I(() => [
1672
- e("div", Qn, [
1673
- e("div", Zn, b(i(v)("inventory.stock.history.title", [t.sku.name])), 1),
1674
- g(f, {
1672
+ e("div", Zn, [
1673
+ e("div", eo, _(i(v)("inventory.stock.history.title", [t.sku.name])), 1),
1674
+ g(d, {
1675
1675
  variant: "tertiary",
1676
1676
  "prepend-icon": "close",
1677
- onClick: o[0] || (o[0] = (Z) => k.value = !1)
1677
+ onClick: a[0] || (a[0] = (ee) => k.value = !1)
1678
1678
  })
1679
1679
  ])
1680
1680
  ]),
1681
1681
  default: I(() => {
1682
- var Z;
1682
+ var ee;
1683
1683
  return [
1684
- e("div", eo, [
1685
- e("div", to, [
1686
- e("div", no, [
1687
- g(p, {
1688
- modelValue: a.value,
1689
- "onUpdate:modelValue": o[1] || (o[1] = (le) => a.value = le),
1684
+ e("div", to, [
1685
+ e("div", no, [
1686
+ e("div", oo, [
1687
+ g(f, {
1688
+ modelValue: s.value,
1689
+ "onUpdate:modelValue": a[1] || (a[1] = (re) => s.value = re),
1690
1690
  "show-predefined-range": "",
1691
1691
  "start-label": "",
1692
1692
  "end-label": "",
1693
1693
  "z-index": 50
1694
1694
  }, {
1695
- "trigger-button": I(({ opened: le }) => [
1695
+ "trigger-button": I(({ opened: re }) => [
1696
1696
  g(u, {
1697
1697
  "prepend-icon": "calendar_month",
1698
- focused: le
1698
+ focused: re
1699
1699
  }, {
1700
1700
  default: I(() => [
1701
- ue(b(a.value.startDate) + " - " + b(a.value.endDate), 1)
1701
+ ue(_(s.value.startDate) + " - " + _(s.value.endDate), 1)
1702
1702
  ]),
1703
1703
  _: 2
1704
1704
  }, 1032, ["focused"])
@@ -1706,40 +1706,40 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1706
1706
  _: 1
1707
1707
  }, 8, ["modelValue"])
1708
1708
  ]),
1709
- g(f, {
1709
+ g(d, {
1710
1710
  variant: "tertiary",
1711
- onClick: o[2] || (o[2] = (le) => T()),
1711
+ onClick: a[2] || (a[2] = (re) => T()),
1712
1712
  "prepend-icon": "navigate_before"
1713
1713
  }),
1714
- g(f, {
1714
+ g(d, {
1715
1715
  variant: "tertiary",
1716
- onClick: o[3] || (o[3] = (le) => te()),
1716
+ onClick: a[3] || (a[3] = (re) => ne()),
1717
1717
  "prepend-icon": "navigate_next"
1718
1718
  })
1719
1719
  ]),
1720
- C.value ? (x(), O("div", oo, [
1720
+ C.value ? (S(), R("div", so, [
1721
1721
  g(V),
1722
1722
  g(E, { size: "xl" }),
1723
- e("div", so, b(i(v)("inventory.stock.history.loading")), 1),
1723
+ e("div", ao, _(i(v)("inventory.stock.history.loading")), 1),
1724
1724
  g(V),
1725
1725
  g(V)
1726
- ])) : w.value && ((Z = w.value) == null ? void 0 : Z.length) > 0 ? (x(), O("div", ao, [
1727
- g(se, { variant: "outlined" }, {
1726
+ ])) : w.value && ((ee = w.value) == null ? void 0 : ee.length) > 0 ? (S(), R("div", lo, [
1727
+ g(Z, { variant: "outlined" }, {
1728
1728
  default: I(() => [
1729
- g(G, { class: "flex flex-col gap-4" }, {
1729
+ g(W, { class: "flex flex-col gap-4" }, {
1730
1730
  default: I(() => [
1731
- e("div", lo, [
1732
- e("div", ro, b(i(v)("inventory.stock.history.summary.title")), 1)
1731
+ e("div", ro, [
1732
+ e("div", io, _(i(v)("inventory.stock.history.summary.title")), 1)
1733
1733
  ]),
1734
- e("div", io, [
1735
- e("div", uo, [
1736
- e("div", co, b(i(v)("inventory.stock.history.summary.totalPurchase")), 1),
1737
- e("div", mo, b(D.value.PURCHASE), 1)
1734
+ e("div", uo, [
1735
+ e("div", co, [
1736
+ e("div", mo, _(i(v)("inventory.stock.history.summary.totalPurchase")), 1),
1737
+ e("div", po, _(D.value.PURCHASE), 1)
1738
1738
  ]),
1739
- e("div", po, [
1740
- e("div", fo, [
1741
- ue(b(i(v)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1742
- H.value != null ? (x(), z(oe, {
1739
+ e("div", fo, [
1740
+ e("div", vo, [
1741
+ ue(_(i(v)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1742
+ H.value != null ? (S(), z(ae, {
1743
1743
  key: 0,
1744
1744
  variant: "plain",
1745
1745
  placement: "top",
@@ -1747,61 +1747,61 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1747
1747
  "z-index": 50
1748
1748
  }, {
1749
1749
  default: I(() => [
1750
- g(W, {
1750
+ g(K, {
1751
1751
  name: "warning",
1752
1752
  size: "sm"
1753
1753
  })
1754
1754
  ]),
1755
1755
  _: 1
1756
- }, 8, ["content"])) : ae("", !0)
1756
+ }, 8, ["content"])) : oe("", !0)
1757
1757
  ]),
1758
- e("div", vo, b(D.value.SALES), 1)
1758
+ e("div", yo, _(D.value.SALES), 1)
1759
1759
  ]),
1760
- e("div", yo, [
1761
- e("div", _o, b(i(v)("inventory.stock.history.summary.totalLose")), 1),
1762
- e("div", ko, b(D.value.LOSE), 1)
1760
+ e("div", _o, [
1761
+ e("div", bo, _(i(v)("inventory.stock.history.summary.totalLose")), 1),
1762
+ e("div", ko, _(D.value.LOSE), 1)
1763
1763
  ]),
1764
- e("div", bo, [
1765
- e("div", ho, b(i(v)("inventory.stock.history.summary.totalRequest")), 1),
1766
- e("div", go, b(D.value.REQUEST), 1)
1764
+ e("div", ho, [
1765
+ e("div", go, _(i(v)("inventory.stock.history.summary.totalRequest")), 1),
1766
+ e("div", xo, _(D.value.REQUEST), 1)
1767
1767
  ]),
1768
- e("div", xo, [
1769
- e("div", So, b(i(v)("inventory.stock.history.summary.totalReceive")), 1),
1770
- e("div", Fo, b(D.value.RECEIVE), 1)
1768
+ e("div", So, [
1769
+ e("div", Fo, _(i(v)("inventory.stock.history.summary.totalReceive")), 1),
1770
+ e("div", wo, _(D.value.RECEIVE), 1)
1771
1771
  ]),
1772
- e("div", wo, [
1773
- e("div", $o, b(i(v)("inventory.stock.history.summary.totalConvert")), 1),
1774
- e("div", Ao, b(D.value.CONVERT), 1)
1772
+ e("div", $o, [
1773
+ e("div", Ao, _(i(v)("inventory.stock.history.summary.totalConvert")), 1),
1774
+ e("div", Vo, _(D.value.CONVERT), 1)
1775
1775
  ]),
1776
- e("div", Vo, [
1777
- e("div", Co, b(i(v)("inventory.stock.history.summary.totalDamage")), 1),
1778
- e("div", Bo, b(D.value.DAMAGE), 1)
1776
+ e("div", Co, [
1777
+ e("div", Bo, _(i(v)("inventory.stock.history.summary.totalDamage")), 1),
1778
+ e("div", Mo, _(D.value.DAMAGE), 1)
1779
1779
  ]),
1780
- e("div", Mo, [
1781
- e("div", Do, b(i(v)("inventory.stock.history.summary.openingBalance")), 1),
1782
- e("div", jo, b(R.value), 1)
1780
+ e("div", Do, [
1781
+ e("div", jo, _(i(v)("inventory.stock.history.summary.openingBalance")), 1),
1782
+ e("div", Io, _(O.value), 1)
1783
1783
  ]),
1784
- e("div", Io, [
1785
- e("div", To, b(i(v)("inventory.stock.history.summary.lastStockBalance")), 1),
1786
- e("div", Uo, b(Q.value), 1)
1784
+ e("div", To, [
1785
+ e("div", Uo, _(i(v)("inventory.stock.history.summary.lastStockBalance")), 1),
1786
+ e("div", Eo, _(Q.value), 1)
1787
1787
  ])
1788
1788
  ]),
1789
- i(d).enableTotalCost ? (x(), O("div", Eo, [
1789
+ i(m).enableTotalCost ? (S(), R("div", Ho, [
1790
1790
  g(U, { class: "w-full" }),
1791
- e("div", Ho, [
1792
- e("div", Po, [
1791
+ e("div", Po, [
1792
+ e("div", Ro, [
1793
1793
  g(Xe, { "z-index": 50 }, {
1794
1794
  default: I(() => [
1795
- e("div", Ro, [
1796
- ue(b(i(v)("inventory.stock.history.estimatedValue")) + " ", 1),
1797
- g(oe, {
1795
+ e("div", Oo, [
1796
+ ue(_(i(v)("inventory.stock.history.estimatedValue")) + " ", 1),
1797
+ g(ae, {
1798
1798
  variant: "plain",
1799
1799
  placement: "top",
1800
1800
  content: `[${L.value}] ${i(v)("inventory.stock.history.estimatedValueTooltip")}`,
1801
1801
  "z-index": 50
1802
1802
  }, {
1803
1803
  default: I(() => [
1804
- g(W, {
1804
+ g(K, {
1805
1805
  name: "help",
1806
1806
  size: "sm"
1807
1807
  })
@@ -1812,41 +1812,41 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1812
1812
  ]),
1813
1813
  _: 1
1814
1814
  }),
1815
- e("div", Oo, [
1816
- t.sku.valuation === i(We).Enum.FIFO ? (x(), O(ee, { key: 0 }, [
1815
+ e("div", No, [
1816
+ t.sku.valuation === i(We).Enum.FIFO ? (S(), R(te, { key: 0 }, [
1817
1817
  g(Y, {
1818
1818
  label: "FIFO",
1819
1819
  compact: ""
1820
1820
  }),
1821
- ue(" " + b(typeof J.value != "string" ? i(be)(
1821
+ ue(" " + _(typeof J.value != "string" ? i(ke)(
1822
1822
  J.value,
1823
1823
  !1,
1824
1824
  J.value.precision
1825
1825
  ) : J.value), 1)
1826
- ], 64)) : (x(), O(ee, { key: 1 }, [
1827
- ue(b(typeof K.value != "string" ? i(be)(
1828
- K.value,
1826
+ ], 64)) : (S(), R(te, { key: 1 }, [
1827
+ ue(_(typeof G.value != "string" ? i(ke)(
1828
+ G.value,
1829
1829
  !1,
1830
- K.value.precision
1831
- ) : K.value), 1)
1830
+ G.value.precision
1831
+ ) : G.value), 1)
1832
1832
  ], 64))
1833
1833
  ])
1834
1834
  ]),
1835
- e("div", No, [
1835
+ e("div", Lo, [
1836
1836
  g(Xe, { "z-index": 50 }, {
1837
1837
  default: I(() => [
1838
- e("div", Lo, [
1839
- ue(b(i(v)("inventory.stock.history.costSold")) + " ", 1),
1840
- g(oe, {
1838
+ e("div", zo, [
1839
+ ue(_(i(v)("inventory.stock.history.costSold")) + " ", 1),
1840
+ g(ae, {
1841
1841
  variant: "plain",
1842
1842
  placement: "top",
1843
1843
  "z-index": 50
1844
1844
  }, {
1845
1845
  content: I(() => [
1846
- e("div", zo, b(i(v)("inventory.stock.history.costSoldTooltip")), 1)
1846
+ e("div", Yo, _(i(v)("inventory.stock.history.costSoldTooltip")), 1)
1847
1847
  ]),
1848
1848
  default: I(() => [
1849
- g(W, {
1849
+ g(K, {
1850
1850
  name: "help",
1851
1851
  size: "sm"
1852
1852
  })
@@ -1857,38 +1857,38 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1857
1857
  ]),
1858
1858
  _: 1
1859
1859
  }),
1860
- e("div", Yo, b(X.value), 1)
1860
+ e("div", Go, _(X.value), 1)
1861
1861
  ])
1862
1862
  ])
1863
- ])) : ae("", !0)
1863
+ ])) : oe("", !0)
1864
1864
  ]),
1865
1865
  _: 1
1866
1866
  })
1867
1867
  ]),
1868
1868
  _: 1
1869
1869
  }),
1870
- o[5] || (o[5] = e("div", null, null, -1)),
1871
- (x(!0), O(ee, null, re(w.value, (le) => (x(), O(ee, {
1872
- key: le.date
1870
+ a[5] || (a[5] = e("div", null, null, -1)),
1871
+ (S(!0), R(te, null, ie(w.value, (re) => (S(), R(te, {
1872
+ key: re.date
1873
1873
  }, [
1874
- t.sku ? (x(), z(qn, {
1874
+ t.sku ? (S(), z(Xn, {
1875
1875
  key: 0,
1876
- record: le,
1876
+ record: re,
1877
1877
  sku: t.sku,
1878
1878
  bills: $.value,
1879
1879
  onRefreshHistory: y
1880
- }, null, 8, ["record", "sku", "bills"])) : ae("", !0)
1880
+ }, null, 8, ["record", "sku", "bills"])) : oe("", !0)
1881
1881
  ], 64))), 128))
1882
- ])) : (x(), O("div", Go, [
1882
+ ])) : (S(), R("div", Ko, [
1883
1883
  g(V),
1884
1884
  e("div", null, [
1885
1885
  e("img", {
1886
- src: i(Gt),
1886
+ src: i(Kt),
1887
1887
  alt: "List is empty"
1888
- }, null, 8, Ko)
1888
+ }, null, 8, Wo)
1889
1889
  ]),
1890
- e("div", Wo, b(i(v)("inventory.stock.history.noRecords")), 1),
1891
- e("div", qo, b(i(v)("inventory.stock.history.changeDateRange")), 1),
1890
+ e("div", qo, _(i(v)("inventory.stock.history.noRecords")), 1),
1891
+ e("div", Xo, _(i(v)("inventory.stock.history.changeDateRange")), 1),
1892
1892
  g(V),
1893
1893
  g(V)
1894
1894
  ]))
@@ -1899,13 +1899,16 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1899
1899
  }, 8, ["modelValue"]);
1900
1900
  };
1901
1901
  }
1902
- }), Jo = { class: "flex flex-col gap-8" }, Qo = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, es = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ys = /* @__PURE__ */ ce({
1902
+ }), Jo = {
1903
+ key: 0,
1904
+ class: "flex items-center gap-1"
1905
+ }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, es = { class: "flex flex-col gap-8" }, ts = { class: "flex flex-col" }, ns = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, os = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ks = /* @__PURE__ */ ce({
1903
1906
  __name: "StockView",
1904
- setup(_) {
1905
- const { t: h } = de(), c = Pe(), s = pe(), A = Re(), m = rt(), d = ye(), v = nt(), S = Tt(), { columnDefs: C } = en(), l = Oe();
1906
- s.watchLocation($);
1907
- const a = P(
1908
- () => new Set(S.getAvailableItems(S.businessSubsidiaryId))
1907
+ setup(b) {
1908
+ const { t: h } = de(), c = Pe(), o = pe(), A = Re(), p = rt(), m = ye(), v = nt(), F = Tt(), { columnDefs: C } = tn(), l = Oe();
1909
+ o.watchLocation($);
1910
+ const s = P(
1911
+ () => new Set(F.getAvailableItems(F.businessSubsidiaryId))
1909
1912
  ), y = N(!1), B = _e();
1910
1913
  async function w() {
1911
1914
  l.open({
@@ -1922,7 +1925,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1922
1925
  variant: "tertiary"
1923
1926
  }
1924
1927
  }).onPrimary(async () => {
1925
- await d.recalculation.refreshCurrentBalances(), B.open({
1928
+ await m.recalculation.refreshCurrentBalances(), B.open({
1926
1929
  title: "Refresh Stock Balance",
1927
1930
  message: "Stock balance refresh has been queued. This may take a moment to complete.",
1928
1931
  type: "success"
@@ -1930,7 +1933,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1930
1933
  });
1931
1934
  }
1932
1935
  async function $() {
1933
- if (s._currentLocation) {
1936
+ if (o._currentLocation) {
1934
1937
  y.value = !0;
1935
1938
  try {
1936
1939
  await A.readStockBalance(), await A.readProductBalance(), await v.readStockEstimateBalance();
@@ -1947,12 +1950,12 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1947
1950
  }
1948
1951
  const n = P(() => {
1949
1952
  let T = c.skus;
1950
- return F.value && a.value && (T = c.skus.filter((L) => a.value.has(L._id))), T.map((L) => {
1951
- var t, o, f;
1952
- const K = L.trackingMeasurement;
1953
- let J = (o = (t = A.stockBalance.skus) == null ? void 0 : t.find(
1953
+ return x.value && s.value && (T = c.skus.filter((L) => s.value.has(L._id))), T.map((L) => {
1954
+ var t, a, d;
1955
+ const G = L.trackingMeasurement;
1956
+ let J = (a = (t = A.stockBalance.skus) == null ? void 0 : t.find(
1954
1957
  (u) => u.id === L._id
1955
- )) == null ? void 0 : o.balance, te = v.inventoryForecast.skus.find(
1958
+ )) == null ? void 0 : a.balance, ne = v.inventoryForecast.skus.find(
1956
1959
  (u) => u.id === L._id
1957
1960
  );
1958
1961
  return {
@@ -1961,11 +1964,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1961
1964
  amount: 0,
1962
1965
  precision: 0
1963
1966
  },
1964
- day: (te == null ? void 0 : te.depletionDays) ?? void 0,
1965
- trackingUnitAbbrev: K ? ((f = L.unit.measurements.find((u) => u.id === K)) == null ? void 0 : f.abbrev) ?? "" : L.unit.abbrev
1967
+ day: (ne == null ? void 0 : ne.depletionDays) ?? void 0,
1968
+ trackingUnitAbbrev: G ? ((d = L.unit.measurements.find((u) => u.id === G)) == null ? void 0 : d.abbrev) ?? "" : L.unit.abbrev
1966
1969
  };
1967
1970
  });
1968
- }), r = N(""), F = N(!1), { breakpoints: M } = Nt(), D = P(() => M.value.xs || M.value.sm), H = P(() => D.value ? 10 : 20), R = Ut(), Q = P(() => [
1971
+ }), r = N(""), x = N(!0), { breakpoints: M } = Lt(), D = P(() => M.value.xs || M.value.sm), H = P(() => D.value ? 10 : 20), O = Ut(), Q = P(() => [
1969
1972
  {
1970
1973
  label: h("inventory.stock.stock_balance.refreshBalance"),
1971
1974
  value: "refresh-balance",
@@ -1988,18 +1991,18 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
1988
1991
  case "refresh":
1989
1992
  return $();
1990
1993
  case "export":
1991
- return Xt(n.value);
1994
+ return Qt(n.value);
1992
1995
  }
1993
1996
  }
1994
1997
  return (T, L) => {
1995
- const K = j("FmTable");
1996
- return x(), z(Et, {
1998
+ const G = j("FmSwitch"), J = j("FmTable");
1999
+ return S(), z(Et, {
1997
2000
  title: i(h)("inventory.stock.title"),
1998
2001
  actions: Q.value,
1999
2002
  "onClick:action": X
2000
2003
  }, {
2001
2004
  default: I(() => {
2002
- var J, te, k, t;
2005
+ var ne, k, t, a;
2003
2006
  return [
2004
2007
  e("div", {
2005
2008
  class: ge([
@@ -2014,53 +2017,65 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
2014
2017
  searchable: "",
2015
2018
  "change-location": "",
2016
2019
  search: r.value,
2017
- "onUpdate:search": L[0] || (L[0] = (o) => r.value = o)
2018
- }, null, 8, ["search"]),
2019
- (x(), z(K, {
2020
- style: Ze(i(R).tableHeight),
2020
+ "onUpdate:search": L[1] || (L[1] = (d) => r.value = d)
2021
+ }, {
2022
+ default: I(() => [
2023
+ i(F).isEnabled ? (S(), R("div", Jo, [
2024
+ e("span", Zo, _(i(h)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2025
+ g(Ot),
2026
+ g(G, {
2027
+ modelValue: x.value,
2028
+ "onUpdate:modelValue": L[0] || (L[0] = (d) => x.value = d)
2029
+ }, null, 8, ["modelValue"])
2030
+ ])) : oe("", !0)
2031
+ ]),
2032
+ _: 1
2033
+ }, 8, ["search"]),
2034
+ (S(), z(J, {
2035
+ style: Ze(i(O).tableHeight),
2021
2036
  "column-defs": i(C),
2022
2037
  "row-data": n.value,
2023
2038
  "search-value": r.value,
2024
- loading: y.value || !i(s)._currentLocation,
2025
- key: (J = i(s)._currentLocation) == null ? void 0 : J.dbName,
2026
- onRowClick: L[1] || (L[1] = (o) => i(m).showSkuHistory(o.original)),
2039
+ loading: y.value || !i(o)._currentLocation,
2040
+ key: (ne = i(o)._currentLocation) == null ? void 0 : ne.dbName,
2041
+ onRowClick: L[2] || (L[2] = (d) => i(p).showSkuHistory(d.original)),
2027
2042
  "page-size": H.value
2028
2043
  }, {
2029
- "list-row": I((o) => [
2044
+ "list-row": I((d) => [
2030
2045
  g(Pt, {
2031
- row: o,
2032
- onRowClick: i(m).showSkuHistory
2046
+ row: d,
2047
+ onRowClick: i(p).showSkuHistory
2033
2048
  }, {
2034
- default: I((f) => {
2035
- var u, p, V, E, W, oe, U, Y, G, se;
2049
+ default: I((u) => {
2050
+ var f, V, E, K, ae, U, Y, W, Z, le;
2036
2051
  return [
2037
- e("div", Jo, [
2038
- e("div", Qo, [
2039
- e("div", Zo, [
2052
+ e("div", es, [
2053
+ e("div", ts, [
2054
+ e("div", ns, [
2040
2055
  g(i(qe), {
2041
- render: (V = (p = (u = f.code) == null ? void 0 : u.column) == null ? void 0 : p.columnDef) == null ? void 0 : V.cell,
2042
- props: (W = (E = f.code) == null ? void 0 : E.getContext) == null ? void 0 : W.call(E)
2056
+ render: (E = (V = (f = u.code) == null ? void 0 : f.column) == null ? void 0 : V.columnDef) == null ? void 0 : E.cell,
2057
+ props: (ae = (K = u.code) == null ? void 0 : K.getContext) == null ? void 0 : ae.call(K)
2043
2058
  }, null, 8, ["render", "props"])
2044
2059
  ]),
2045
- e("div", es, [
2060
+ e("div", os, [
2046
2061
  g(i(qe), {
2047
- render: (Y = (U = (oe = f.name) == null ? void 0 : oe.column) == null ? void 0 : U.columnDef) == null ? void 0 : Y.cell,
2048
- props: (se = (G = f.name) == null ? void 0 : G.getContext) == null ? void 0 : se.call(G)
2062
+ render: (W = (Y = (U = u.name) == null ? void 0 : U.column) == null ? void 0 : Y.columnDef) == null ? void 0 : W.cell,
2063
+ props: (le = (Z = u.name) == null ? void 0 : Z.getContext) == null ? void 0 : le.call(Z)
2049
2064
  }, null, 8, ["render", "props"])
2050
2065
  ])
2051
2066
  ]),
2052
2067
  e("div", null, [
2053
2068
  g(Te, {
2054
- days: o.original.day
2069
+ days: d.original.day
2055
2070
  }, null, 8, ["days"])
2056
2071
  ]),
2057
2072
  e("div", null, [
2058
2073
  g(lt, {
2059
2074
  class: "xs:w-[160px]",
2060
- unit: o.original.unit,
2061
- sku: o.original,
2062
- amount: o.original.balance,
2063
- "default-tracking-measurement": o.original.trackingMeasurement ?? void 0
2075
+ unit: d.original.unit,
2076
+ sku: d.original,
2077
+ amount: d.original.balance,
2078
+ "default-tracking-measurement": d.original.trackingMeasurement ?? void 0
2064
2079
  }, null, 8, ["unit", "sku", "amount", "default-tracking-measurement"])
2065
2080
  ])
2066
2081
  ])
@@ -2072,10 +2087,10 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
2072
2087
  _: 1
2073
2088
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2074
2089
  ], 2),
2075
- (x(), z(ct, { to: "body" }, [
2076
- (te = i(m).stockHistoryProps) != null && te.sku ? (x(), z(Xo, Ae(Ve({ key: 0 }, i(m).stockHistoryProps)), null, 16)) : ae("", !0),
2077
- (k = i(m).convertSkuDialogProps) != null && k.sku ? (x(), z(yn, Ae(Ve({ key: 1 }, i(m).convertSkuDialogProps)), null, 16)) : ae("", !0),
2078
- (t = i(m).adjustSkuDialogProps) != null && t.stock ? (x(), z(wn, Ae(Ve({ key: 2 }, i(m).adjustSkuDialogProps)), null, 16)) : ae("", !0)
2090
+ (S(), z(ct, { to: "body" }, [
2091
+ (k = i(p).stockHistoryProps) != null && k.sku ? (S(), z(Qo, Ae(Ve({ key: 0 }, i(p).stockHistoryProps)), null, 16)) : oe("", !0),
2092
+ (t = i(p).convertSkuDialogProps) != null && t.sku ? (S(), z(_n, Ae(Ve({ key: 1 }, i(p).convertSkuDialogProps)), null, 16)) : oe("", !0),
2093
+ (a = i(p).adjustSkuDialogProps) != null && a.stock ? (S(), z($n, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : oe("", !0)
2079
2094
  ]))
2080
2095
  ];
2081
2096
  }),
@@ -2085,5 +2100,5 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Zn = {
2085
2100
  }
2086
2101
  });
2087
2102
  export {
2088
- ys as default
2103
+ ks as default
2089
2104
  };