@feedmepos/mf-inventory-portal 0.0.25-dev.41 → 0.0.25-dev.42

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 (43) hide show
  1. package/dist/{App-BqAbcrCa.js → App-BgLyTa3Z.js} +2 -2
  2. package/dist/{ApprovalView-CstNyWuq.js → ApprovalView-UC31qsPD.js} +17 -17
  3. package/dist/{BindingsDialog-B2POgTvT.js → BindingsDialog-h9el4EvX.js} +2 -2
  4. package/dist/{BindingsPicker-Bp8wNAW0.js → BindingsPicker-Cw5AT6xO.js} +1 -1
  5. package/dist/{BindingsTable-C5ToIwJw.js → BindingsTable-Boj3hZup.js} +1 -1
  6. package/dist/{ClosingDraftView-B5KgTQOB.js → ClosingDraftView-DOH7FmkH.js} +2 -2
  7. package/dist/{ClosingTemplateView-B6gT5-A_.js → ClosingTemplateView-CG7qArA8.js} +2 -2
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BcedQV1P.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-k1J8dWcK.js} +3 -3
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Bc6eTKR-.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C5qp_p1A.js} +1 -1
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-C76t4wed.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBYsiV9t.js} +1 -1
  11. package/dist/{IngredientGroupView-Bo18pDpd.js → IngredientGroupView-CWEw3I3i.js} +14 -14
  12. package/dist/{IngredientsView-D4Tx5h1N.js → IngredientsView-B6EDjPTe.js} +492 -504
  13. package/dist/{IntegrationView-5cTVErK7.js → IntegrationView-DiSoM1K8.js} +1 -1
  14. package/dist/{InventoryBindingForm-D_JUD2PF.js → InventoryBindingForm-nKWx-EUW.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Co33Sz1A.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BMMD4hwX.js} +3 -3
  16. package/dist/{InventoryBindingSummary-DsQqzLxI.js → InventoryBindingSummary-CQnCjIY4.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CKCHqrFd.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cr8DwdOC.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-NhSXPpV1.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DnZI3Gfj.js} +1 -1
  19. package/dist/{PublishView-CVReC-7J.js → PublishView-DvHW27pI.js} +7 -7
  20. package/dist/{PurchaseOrderPrintPreview-kHtSdc_I.js → PurchaseOrderPrintPreview-DSTbRKyh.js} +1 -1
  21. package/dist/{ReceiveRequestView-JJdBl6jR.js → ReceiveRequestView-BKRHqSU-.js} +9 -9
  22. package/dist/{RecipeView-BAZzsPdQ.js → RecipeView-CFTrf0YF.js} +21 -21
  23. package/dist/{StockView-Dwzf7ewT.js → StockView-CAPLd29m.js} +1526 -1539
  24. package/dist/{SupplierView-BoTsfsYX.js → SupplierView-C_CrS9FM.js} +441 -453
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-C2ZBmCNY.js → TransferDetails.vue_vue_type_script_setup_true_lang-BWuWB95v.js} +4 -4
  26. package/dist/{TransferTemplateView-BLO1uHet.js → TransferTemplateView-BaJaiaO9.js} +68 -68
  27. package/dist/{UnitView-DfJ-huaQ.js → UnitView-DY9nZs1y.js} +3 -3
  28. package/dist/{WarehouseView-h5_GDAYM.js → WarehouseView-CAFxl8K4.js} +1 -1
  29. package/dist/{app-CRWxxzQN.js → app-Jh5wwLsF.js} +3271 -3260
  30. package/dist/app.js +1 -1
  31. package/dist/{decimal-BDt03-KF.js → decimal-0_acpDRy.js} +1 -1
  32. package/dist/{feature-D_c7uzcV.js → feature-CqX_LtOl.js} +1 -1
  33. package/dist/{format-unit-display-CsfojMpU.js → format-unit-display-CYPC8_oX.js} +2 -2
  34. package/dist/helper/country.d.ts +1 -0
  35. package/dist/{index-BbwuhE-c.js → index-QcOk4LDU.js} +2 -2
  36. package/dist/{stock-DSyF_gBG.js → stock-BpWEKDoQ.js} +1 -1
  37. package/dist/stores/helper/generate-backend-urls.d.ts +0 -1
  38. package/dist/{supplier-BLqNIQG9.js → supplier-By3gzRHW.js} +1 -1
  39. package/dist/tsconfig.app.tsbuildinfo +1 -1
  40. package/dist/{use-ingredient-select-dialog-BSxFzWSk.js → use-ingredient-select-dialog-hkbfGnB9.js} +1 -1
  41. package/dist/{use-inventory-binding-dialog-DyIQsTTm.js → use-inventory-binding-dialog-BFG04MUx.js} +1 -1
  42. package/dist/{vue-i18n-ZO6qpjnw.js → vue-i18n-D57Xfcpf.js} +2 -2
  43. package/package.json +3 -3
@@ -1,22 +1,22 @@
1
- import { ref as Y, defineComponent as ne, computed as S, resolveComponent as C, openBlock as f, createBlock as P, withCtx as V, createVNode as c, unref as d, createElementBlock as T, Fragment as X, createElementVNode as m, createCommentVNode as O, renderSlot as pe, createTextVNode as $e, toDisplayString as A, normalizeClass as ee, onMounted as rt, watch as Ge, renderList as ie, isRef as Be, createSlots as We, normalizeStyle as st, Teleport as Ne, normalizeProps as it, guardReactiveProps as dt } from "vue";
2
- import { a as oe, d as W, e as Ke, S as ut, f as mt, D as ze, h as he, A as xe, b as Ee, i as Ze, j as ke, t as Je, k as fe, l as Se, U as ct, m as pt, M as vt, n as Le, C as Ce, o as He, p as Qe, q as ft, r as Xe, s as yt, v as gt, I as bt, w as ht, x as _t, u as xt, y as kt, _ as Vt, z as St, B as Ct, E as Oe } from "./app-CRWxxzQN.js";
3
- import { useDialog as et, useSnackbar as Ve, useProxiedModel as Ye, useDialogChild as wt, useBreakpoints as Ft } from "@feedmepos/ui-library";
4
- import { i as Mt, _ as It } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { useI18n as le, useCoreStore as ye } from "@feedmepos/mf-common";
6
- import { defineStore as $t, storeToRefs as Et } from "pinia";
7
- import { g as Ut, _ as we, S as Fe } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
- import { _ as Rt } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-Co33Sz1A.js";
9
- import { _ as Me } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-C76t4wed.js";
10
- import { u as tt } from "./feature-D_c7uzcV.js";
11
- import { _ as _e } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
- import { _ as Tt } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
1
+ import { ref as q, defineComponent as te, computed as S, resolveComponent as C, openBlock as f, createBlock as B, withCtx as V, createVNode as c, unref as d, createElementBlock as T, Fragment as X, createElementVNode as m, createCommentVNode as j, renderSlot as ce, createTextVNode as Me, toDisplayString as A, normalizeClass as ee, onMounted as at, watch as Ye, renderList as re, isRef as De, createSlots as Ge, normalizeStyle as rt, Teleport as Pe, normalizeProps as st, guardReactiveProps as it } from "vue";
2
+ import { a as ne, d as K, e as We, S as dt, f as ut, D as Be, h as be, A as _e, b as Ie, i as Ke, j as xe, t as Ze, k as ve, l as Ve, U as mt, m as ct, M as pt, n as Ne, o as ze, p as Le, q as Je, r as vt, s as Qe, v as ft, w as yt, I as gt, x as bt, y as ht, u as _t, z as xt, _ as kt, B as Vt, C as St, E as He } from "./app-Jh5wwLsF.js";
3
+ import { useDialog as Xe, useSnackbar as ke, useProxiedModel as Oe, useDialogChild as Ct, useBreakpoints as wt } from "@feedmepos/ui-library";
4
+ import { i as Ft, _ as Mt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
+ import { useI18n as oe, useCoreStore as fe } from "@feedmepos/mf-common";
6
+ import { defineStore as It, storeToRefs as $t } from "pinia";
7
+ import { g as Et, _ as Se, S as Ce } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
+ import { _ as Ut } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BMMD4hwX.js";
9
+ import { _ as we } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBYsiV9t.js";
10
+ import { u as et } from "./feature-CqX_LtOl.js";
11
+ import { _ as he } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
+ import { _ as Rt } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
13
13
  import "./array-hChJVZLE.js";
14
- const Ie = $t("ingredientForm", function() {
15
- const o = et(), y = Ve(), r = oe(), n = Y(!1), { t: l } = le(), i = Y();
14
+ const Fe = It("ingredientForm", function() {
15
+ const o = Xe(), y = ke(), r = ne(), n = q(!1), { t: l } = oe(), i = q();
16
16
  function a() {
17
17
  const b = {
18
18
  unit: {},
19
- mode: W.CREATE,
19
+ mode: K.CREATE,
20
20
  show: !0,
21
21
  "onUpdate:show"(s) {
22
22
  i.value.show = s;
@@ -26,8 +26,8 @@ const Ie = $t("ingredientForm", function() {
26
26
  }
27
27
  async function h(b) {
28
28
  const s = {
29
- unit: Ke(b),
30
- mode: W.UPDATE,
29
+ unit: We(b),
30
+ mode: K.UPDATE,
31
31
  show: !0,
32
32
  "onUpdate:show"(x) {
33
33
  i.value.show = x;
@@ -44,9 +44,9 @@ const Ie = $t("ingredientForm", function() {
44
44
  type: "success"
45
45
  });
46
46
  } catch (s) {
47
- s instanceof ut && Mt(s) ? o.open({
47
+ s instanceof dt && Ft(s) ? o.open({
48
48
  title: "Cannot delete ingredient",
49
- contentComponent: It,
49
+ contentComponent: Mt,
50
50
  contentComponentProps: {
51
51
  subject: (b == null ? void 0 : b.name) ?? "",
52
52
  items: s.errorResponse.message
@@ -88,15 +88,15 @@ const Ie = $t("ingredientForm", function() {
88
88
  ingredientViewLoading: n
89
89
  };
90
90
  });
91
- function At() {
92
- const { updateIngredient: u, deleteIngredient: o } = Ie(), { t: y } = le();
91
+ function Tt() {
92
+ const { updateIngredient: u, deleteIngredient: o } = Fe(), { t: y } = oe();
93
93
  async function r(l, i) {
94
- const a = Ke(i);
95
- if (l === he.Edit) {
94
+ const a = We(i);
95
+ if (l === be.Edit) {
96
96
  await u(a);
97
97
  return;
98
98
  }
99
- if (l === he.Delete) {
99
+ if (l === be.Delete) {
100
100
  await o(a);
101
101
  return;
102
102
  }
@@ -136,8 +136,8 @@ function At() {
136
136
  id: "action",
137
137
  header: "",
138
138
  cell(l) {
139
- return mt(
140
- [ze[he.Edit], ze[he.Delete]],
139
+ return ut(
140
+ [Be[be.Edit], Be[be.Delete]],
141
141
  (i) => {
142
142
  r(i, l.row.original);
143
143
  }
@@ -152,7 +152,7 @@ function At() {
152
152
  }
153
153
  ] };
154
154
  }
155
- const Dt = /* @__PURE__ */ ne({
155
+ const At = /* @__PURE__ */ te({
156
156
  __name: "ConvertForm",
157
157
  props: {
158
158
  modelValue: {},
@@ -168,7 +168,7 @@ const Dt = /* @__PURE__ */ ne({
168
168
  }), n = S(() => {
169
169
  var s;
170
170
  return (s = y.rootValue) == null ? void 0 : s._id;
171
- }), l = o, { t: i } = le(), a = S({
171
+ }), l = o, { t: i } = oe(), a = S({
172
172
  get() {
173
173
  return !!y.modelValue;
174
174
  },
@@ -178,7 +178,7 @@ const Dt = /* @__PURE__ */ ne({
178
178
  inventoryBindings: []
179
179
  }) : l("update:modelValue", null);
180
180
  }
181
- }), h = S(() => Ut(r.value));
181
+ }), h = S(() => Et(r.value));
182
182
  function k(s) {
183
183
  const x = y.modelValue ?? {};
184
184
  x.measurement = s ? `${s}` : null, l("update:modelValue", x);
@@ -193,13 +193,13 @@ const Dt = /* @__PURE__ */ ne({
193
193
  return s.measurement ? h.value.find((x) => x.value === s.measurement) ?? null : h.value.find((x) => x.value === null) ?? null;
194
194
  });
195
195
  return (s, x) => {
196
- const U = C("FmSwitch"), I = C("FmSelect"), B = C("FmCard");
197
- return f(), P(B, {
196
+ const U = C("FmSwitch"), I = C("FmSelect"), N = C("FmCard");
197
+ return f(), B(N, {
198
198
  variant: "outlined",
199
199
  class: "p-16 flex flex-col gap-16"
200
200
  }, {
201
201
  default: V(() => {
202
- var F, v;
202
+ var w, v;
203
203
  return [
204
204
  c(U, {
205
205
  value: "",
@@ -214,21 +214,21 @@ const Dt = /* @__PURE__ */ ne({
214
214
  m("div", null, [
215
215
  c(I, {
216
216
  label: d(i)("inventory.ingredient.convertible.convertTo"),
217
- modelValue: (F = b.value) == null ? void 0 : F.value,
217
+ modelValue: (w = b.value) == null ? void 0 : w.value,
218
218
  "onUpdate:modelValue": k,
219
219
  items: h.value,
220
220
  disabled: s.readonly
221
221
  }, null, 8, ["label", "modelValue", "items", "disabled"])
222
222
  ]),
223
- c(Rt, {
223
+ c(Ut, {
224
224
  id: n.value,
225
225
  "model-value": ((v = s.modelValue) == null ? void 0 : v.inventoryBindings) ?? [],
226
226
  "onUpdate:modelValue": g,
227
227
  "exclude-binding-id": n.value,
228
- rules: [d(xe)(1)],
228
+ rules: [d(_e)(1)],
229
229
  readonly: s.readonly
230
230
  }, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
231
- ], 64)) : O("", !0)
231
+ ], 64)) : j("", !0)
232
232
  ];
233
233
  }),
234
234
  _: 1
@@ -236,16 +236,16 @@ const Dt = /* @__PURE__ */ ne({
236
236
  };
237
237
  }
238
238
  });
239
- function se() {
239
+ function ae() {
240
240
  return {
241
241
  low: 6,
242
242
  mid: 14
243
243
  };
244
244
  }
245
- const Pt = {
245
+ const Dt = {
246
246
  key: 0,
247
247
  class: "flex flex-col gap-4"
248
- }, ve = /* @__PURE__ */ ne({
248
+ }, pe = /* @__PURE__ */ te({
249
249
  __name: "FmLockableField",
250
250
  props: {
251
251
  locked: { type: Boolean },
@@ -260,23 +260,23 @@ const Pt = {
260
260
  setup(u) {
261
261
  return (o, y) => {
262
262
  const r = C("FmLabel"), n = C("FmIcon"), l = C("FmTooltip"), i = C("FmField");
263
- return o.locked ? (f(), T("div", Pt, [
264
- pe(o.$slots, "label", {}, () => [
263
+ return o.locked ? (f(), T("div", Dt, [
264
+ ce(o.$slots, "label", {}, () => [
265
265
  c(r, {
266
266
  label: o.label,
267
267
  disabled: o.disabled
268
268
  }, null, 8, ["label", "disabled"])
269
269
  ]),
270
- pe(o.$slots, "field", {}, () => [
270
+ ce(o.$slots, "field", {}, () => [
271
271
  c(i, { disabled: o.disabled }, {
272
272
  prepend: V(() => [
273
- o.tooltipMessage ? (f(), P(l, {
273
+ o.tooltipMessage ? (f(), B(l, {
274
274
  key: 0,
275
275
  placement: o.tooltipPlacement,
276
276
  "z-index": o.tooltipZIndex
277
277
  }, {
278
278
  content: V(() => [
279
- $e(A(o.tooltipMessage), 1)
279
+ Me(A(o.tooltipMessage), 1)
280
280
  ]),
281
281
  default: V(() => [
282
282
  c(n, {
@@ -285,14 +285,14 @@ const Pt = {
285
285
  })
286
286
  ]),
287
287
  _: 1
288
- }, 8, ["placement", "z-index"])) : (f(), P(n, {
288
+ }, 8, ["placement", "z-index"])) : (f(), B(n, {
289
289
  key: 1,
290
290
  name: "lock",
291
291
  color: "neutral-gray-400"
292
292
  }))
293
293
  ]),
294
294
  default: V(() => [
295
- pe(o.$slots, "modelValue", {}, () => [
295
+ ce(o.$slots, "modelValue", {}, () => [
296
296
  m("div", {
297
297
  class: ee([
298
298
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
@@ -304,7 +304,7 @@ const Pt = {
304
304
  _: 3
305
305
  }, 8, ["disabled"])
306
306
  ]),
307
- pe(o.$slots, "helper-text", {}, () => [
307
+ ce(o.$slots, "helper-text", {}, () => [
308
308
  m("div", {
309
309
  class: ee([
310
310
  "fm-typo-en-body-sm-400 line-clamp-1",
@@ -312,13 +312,13 @@ const Pt = {
312
312
  ])
313
313
  }, A(o.helperText), 3)
314
314
  ])
315
- ])) : pe(o.$slots, "default", { key: 1 });
315
+ ])) : ce(o.$slots, "default", { key: 1 });
316
316
  };
317
317
  }
318
- }), Bt = { class: "flex gap-8" }, Nt = { class: "flex-1" }, zt = { class: "flex-1" }, Lt = { class: "text-fm-color-typo-secondary" }, Ht = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Ot = {
318
+ }), Pt = { class: "flex gap-8" }, Bt = { class: "flex-1" }, Nt = { class: "flex-1" }, zt = { class: "text-fm-color-typo-secondary" }, Lt = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Ht = {
319
319
  key: 3,
320
320
  class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
321
- }, Yt = { class: "flex flex-col gap-12" }, jt = { class: "flex flex-col gap-4" }, qt = { class: "fm-typo-en-title-sm-600" }, Gt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Wt = { class: "flex flex-col gap-4" }, Kt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Zt = { class: "flex-1 p-12 flex flex-col gap-8" }, Jt = { class: "mx-auto" }, Qt = { class: "flex flex-col" }, Xt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, en = { class: "flex-1 p-12 flex flex-col gap-8" }, tn = { class: "mx-auto" }, nn = { class: "flex flex-col" }, on = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ln = { class: "flex-1 p-12 flex flex-col gap-8" }, an = { class: "mx-auto" }, rn = { class: "flex flex-col" }, sn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, dn = /* @__PURE__ */ ne({
321
+ }, Ot = { class: "flex flex-col gap-12" }, jt = { class: "flex flex-col gap-4" }, qt = { class: "fm-typo-en-title-sm-600" }, Yt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Gt = { class: "flex flex-col gap-4" }, Wt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Kt = { class: "flex-1 p-12 flex flex-col gap-8" }, Zt = { class: "mx-auto" }, Jt = { class: "flex flex-col" }, Qt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Xt = { class: "flex-1 p-12 flex flex-col gap-8" }, en = { class: "mx-auto" }, tn = { class: "flex flex-col" }, nn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, on = { class: "flex-1 p-12 flex flex-col gap-8" }, ln = { class: "mx-auto" }, an = { class: "flex flex-col" }, rn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, sn = /* @__PURE__ */ te({
322
322
  __name: "IngredientForm",
323
323
  props: {
324
324
  mode: {},
@@ -327,312 +327,300 @@ const Pt = {
327
327
  },
328
328
  emits: ["update:modelValue", "click:submit"],
329
329
  setup(u, { expose: o, emit: y }) {
330
- var me;
331
- const { t: r } = le(), n = u, l = y, i = oe(), a = ye(), h = tt(), k = Ee(), g = S(() => k.isEnabled);
332
- function b(e) {
333
- if (e.length === 0) return;
334
- const t = e[0], p = n.modelValue ?? {
330
+ var ue;
331
+ const { t: r } = oe(), n = u, l = y, i = ne(), a = fe(), h = et(), k = Ie(), g = S(() => k.isEnabled);
332
+ function b(t) {
333
+ if (t.length === 0) return;
334
+ const e = t[0], p = n.modelValue ?? {
335
335
  unit: i.units.find((_) => _)
336
336
  };
337
- p.unit || (p.unit = t, l("update:modelValue", p));
337
+ p.unit || (p.unit = e, l("update:modelValue", p));
338
338
  }
339
- rt(() => {
339
+ at(() => {
340
340
  b(i.units);
341
- }), Ge([() => i.units], ([e]) => {
342
- b(e);
341
+ }), Ye([() => i.units], ([t]) => {
342
+ b(t);
343
343
  });
344
344
  function s() {
345
345
  l("click:submit");
346
346
  }
347
347
  const x = S({
348
348
  get() {
349
- var e;
350
- return ((e = n.modelValue) == null ? void 0 : e.code) ?? "";
349
+ var t;
350
+ return ((t = n.modelValue) == null ? void 0 : t.code) ?? "";
351
351
  },
352
- set(e) {
353
- const t = n.modelValue ? {
352
+ set(t) {
353
+ const e = n.modelValue ? {
354
354
  ...n.modelValue
355
355
  } : {};
356
- t.code = e, l("update:modelValue", t);
356
+ e.code = t, l("update:modelValue", e);
357
357
  }
358
358
  }), U = S({
359
359
  get() {
360
- var e;
361
- return ((e = n.modelValue) == null ? void 0 : e.name) ?? "";
360
+ var t;
361
+ return ((t = n.modelValue) == null ? void 0 : t.name) ?? "";
362
362
  },
363
- set(e) {
364
- const t = n.modelValue ? {
363
+ set(t) {
364
+ const e = n.modelValue ? {
365
365
  ...n.modelValue
366
366
  } : {};
367
- t.name = e, l("update:modelValue", t);
367
+ e.name = t, l("update:modelValue", e);
368
368
  }
369
369
  }), I = S({
370
370
  get() {
371
- var t, p;
372
- const e = (p = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : p.costPerUnit;
373
- return e ? +Ze(e) : 0;
371
+ var e, p;
372
+ const t = (p = (e = n.modelValue) == null ? void 0 : e.defaultCost) == null ? void 0 : p.costPerUnit;
373
+ return t ? +Ke(t) : 0;
374
374
  },
375
- set(e) {
376
- var p, _, E, w;
377
- const t = n.modelValue ? {
375
+ set(t) {
376
+ var p, _, E, F;
377
+ const e = n.modelValue ? {
378
378
  ...n.modelValue
379
379
  } : {};
380
- t.defaultCost ?? (t.defaultCost = {
380
+ e.defaultCost ?? (e.defaultCost = {
381
381
  costPerUnit: {
382
382
  amount: 0,
383
383
  precision: 2,
384
- currency: ((p = ke(a.currentCountry.value)) == null ? void 0 : p.currency) ?? "MYR"
384
+ currency: ((p = xe(a.currentCountry.value)) == null ? void 0 : p.currency) ?? "MYR"
385
385
  },
386
- measurement: (w = (E = (_ = n.modelValue) == null ? void 0 : _.unit) == null ? void 0 : E.measurements) == null ? void 0 : w.find(
387
- (q) => {
388
- var Q;
389
- return q.id === ((Q = n.modelValue) == null ? void 0 : Q.trackingMeasurement);
386
+ measurement: (F = (E = (_ = n.modelValue) == null ? void 0 : _.unit) == null ? void 0 : E.measurements) == null ? void 0 : F.find(
387
+ (O) => {
388
+ var G;
389
+ return O.id === ((G = n.modelValue) == null ? void 0 : G.trackingMeasurement);
390
390
  }
391
391
  )
392
- }), t.defaultCost.costPerUnit = {
393
- ...t.defaultCost.costPerUnit,
394
- ...Je(+e, 4)
395
- }, l("update:modelValue", t);
392
+ }), e.defaultCost.costPerUnit = {
393
+ ...e.defaultCost.costPerUnit,
394
+ ...Ze(+t, 4)
395
+ }, l("update:modelValue", e);
396
396
  }
397
- }), B = S(() => {
398
- var t, p, _;
399
- const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? i.units.find((E) => E);
400
- return e ? {
401
- _id: e._id,
397
+ }), N = S(() => {
398
+ var e, p, _;
399
+ const t = ((e = n.modelValue) == null ? void 0 : e.unit) ?? i.units.find((E) => E);
400
+ return t ? {
401
+ _id: t._id,
402
402
  measurement: (p = n.modelValue) == null ? void 0 : p.trackingMeasurement,
403
- name: ((_ = e.measurements.find((E) => {
404
- var w;
405
- return E.id === ((w = n.modelValue) == null ? void 0 : w.trackingMeasurement);
406
- })) == null ? void 0 : _.name) ?? e.name
403
+ name: ((_ = t.measurements.find((E) => {
404
+ var F;
405
+ return E.id === ((F = n.modelValue) == null ? void 0 : F.trackingMeasurement);
406
+ })) == null ? void 0 : _.name) ?? t.name
407
407
  } : null;
408
- }), F = S(
409
- () => i.units.flatMap(({ name: e, _id: t, abbrev: p, measurements: _ }) => [
408
+ }), w = S(
409
+ () => i.units.flatMap(({ name: t, _id: e, abbrev: p, measurements: _ }) => [
410
410
  {
411
- label: `${e}`,
411
+ label: `${t}`,
412
412
  value: null,
413
413
  displayAsSection: !0
414
414
  },
415
415
  {
416
- label: `${e} (${p})`,
417
- value: { _id: t },
416
+ label: `${t} (${p})`,
417
+ value: { _id: e },
418
418
  displayAsSection: !1
419
419
  },
420
- ..._.map(({ id: E, name: w, abbrev: q }) => ({
421
- label: `${w} (${q})`,
422
- value: { _id: t, measurement: E },
420
+ ..._.map(({ id: E, name: F, abbrev: O }) => ({
421
+ label: `${F} (${O})`,
422
+ value: { _id: e, measurement: E },
423
423
  displayAsSection: !1
424
424
  }))
425
425
  ])
426
426
  );
427
- function v(e) {
428
- var t, p, _, E, w;
429
- return ((p = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : p._id) === ((_ = e.value) == null ? void 0 : _._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((w = e.value) == null ? void 0 : w.measurement);
427
+ function v(t) {
428
+ var e, p, _, E, F;
429
+ return ((p = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : p._id) === ((_ = t.value) == null ? void 0 : _._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((F = t.value) == null ? void 0 : F.measurement);
430
430
  }
431
- function R(e) {
432
- var q, Q;
433
- if (!e) return;
434
- const { _id: t, measurement: p } = e, _ = p || void 0, E = i.units.find((ce) => ce._id === t);
431
+ function R(t) {
432
+ var O, G;
433
+ if (!t) return;
434
+ const { _id: e, measurement: p } = t, _ = p || void 0, E = i.units.find((me) => me._id === e);
435
435
  if (!E)
436
436
  return;
437
- const w = n.modelValue ?? {};
438
- w.unit = E, w.trackingMeasurement = _, w.convert && (w.convert.measurement = _ || null), h.enableTotalCost && (w.defaultCost = {
439
- measurement: E.measurements.find((ce) => ce.id === _),
437
+ const F = n.modelValue ?? {};
438
+ F.unit = E, F.trackingMeasurement = _, F.convert && (F.convert.measurement = _ || null), h.enableTotalCost && (F.defaultCost = {
439
+ measurement: E.measurements.find((me) => me.id === _),
440
440
  costPerUnit: {
441
- ...((q = w.defaultCost) == null ? void 0 : q.costPerUnit) ?? {
441
+ ...((O = F.defaultCost) == null ? void 0 : O.costPerUnit) ?? {
442
442
  amount: 0,
443
443
  precision: 2,
444
- currency: ((Q = ke(a.currentCountry.value)) == null ? void 0 : Q.currency) ?? "MYR"
444
+ currency: ((G = xe(a.currentCountry.value)) == null ? void 0 : G.currency) ?? "MYR"
445
445
  }
446
446
  }
447
- }), l("update:modelValue", w);
447
+ }), l("update:modelValue", F);
448
448
  }
449
- const Z = S({
449
+ const J = S({
450
450
  get() {
451
- var e;
452
- return ((e = n.modelValue) == null ? void 0 : e.convert) ?? null;
451
+ var t;
452
+ return ((t = n.modelValue) == null ? void 0 : t.convert) ?? null;
453
453
  },
454
- set(e) {
455
- const t = n.modelValue ? {
454
+ set(t) {
455
+ const e = n.modelValue ? {
456
456
  ...n.modelValue
457
457
  } : {};
458
- e ? t.convert = e : t.convert = null, l("update:modelValue", t);
458
+ t ? e.convert = t : e.convert = null, l("update:modelValue", e);
459
459
  }
460
- }), K = S(() => fe.options.filter(
461
- (e) => e === fe.enum.FIFO || e === fe.enum.WAVG
462
- ).map((e) => ({
463
- label: r(`inventory.ingredient.valuationMethod.${e}`),
464
- value: e
460
+ }), Z = S(() => ve.options.filter(
461
+ (t) => t === ve.enum.FIFO || t === ve.enum.WAVG
462
+ ).map((t) => ({
463
+ label: r(`inventory.ingredient.valuationMethod.${t}`),
464
+ value: t
465
465
  }))), L = S({
466
466
  get() {
467
- var e;
468
- return ((e = n.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
467
+ var t;
468
+ return ((t = n.modelValue) == null ? void 0 : t.valuation) ?? "WAVG";
469
469
  },
470
- set(e) {
471
- const t = n.modelValue ? {
470
+ set(t) {
471
+ const e = n.modelValue ? {
472
472
  ...n.modelValue
473
473
  } : {};
474
- t.valuation = e, l("update:modelValue", t);
474
+ e.valuation = t, l("update:modelValue", e);
475
475
  }
476
- }), j = S({
476
+ }), Y = S({
477
477
  get() {
478
- var e;
479
- return ((e = n.modelValue) == null ? void 0 : e.customAttributes) ?? {};
478
+ var t;
479
+ return ((t = n.modelValue) == null ? void 0 : t.customAttributes) ?? {};
480
480
  },
481
- set(e) {
482
- const t = n.modelValue ? {
481
+ set(t) {
482
+ const e = n.modelValue ? {
483
483
  ...n.modelValue
484
484
  } : {};
485
- t.customAttributes = e, l("update:modelValue", t);
485
+ e.customAttributes = t, l("update:modelValue", e);
486
486
  }
487
- }), H = Y();
487
+ }), H = q();
488
488
  o({
489
489
  validateInputs: () => {
490
- var e, t;
491
- (t = (e = H.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
490
+ var t, e;
491
+ (e = (t = H.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
492
492
  },
493
493
  resetInputsValidation: () => {
494
- var e, t;
495
- (t = (e = H.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
494
+ var t, e;
495
+ (e = (t = H.value) == null ? void 0 : t.resetInputsValidation) == null || e.call(t);
496
496
  },
497
497
  resetInputs: () => {
498
- var e, t;
499
- (t = (e = H.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
498
+ var t, e;
499
+ (e = (t = H.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
500
500
  }
501
501
  });
502
- const J = Y(!1), de = S(
502
+ const Q = q(!1), se = S(
503
503
  () => {
504
- var e, t, p;
505
- return (e = n.modelValue) != null && e._id ? ((p = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : p.filter(
504
+ var t, e, p;
505
+ return (t = n.modelValue) != null && t._id ? ((p = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : p.filter(
506
506
  (_) => _.from === "INGREDIENT"
507
507
  )) ?? [] : [];
508
508
  }
509
- ), ge = S(
509
+ ), ye = S(
510
510
  () => {
511
- var e, t, p;
512
- return (e = n.modelValue) != null && e._id ? ((p = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : p.filter(
511
+ var t, e, p;
512
+ return (t = n.modelValue) != null && t._id ? ((p = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : p.filter(
513
513
  (_) => _.from === "RECIPE"
514
514
  )) ?? [] : [];
515
515
  }
516
516
  ), D = S(
517
517
  () => {
518
- var e, t, p;
519
- return (e = n.modelValue) != null && e._id ? ((p = i.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : p.filter((_) => _.from === "MENU")) ?? [] : [];
518
+ var t, e, p;
519
+ return (t = n.modelValue) != null && t._id ? ((p = i.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : p.filter((_) => _.from === "MENU")) ?? [] : [];
520
520
  }
521
521
  ), $ = S(
522
- () => i.skus.map((e) => ({ label: e.name, value: e.code }))
523
- ), ue = Y((me = n.modelValue) == null ? void 0 : me.code);
524
- function ae(e) {
522
+ () => i.skus.map((t) => ({ label: t.name, value: t.code }))
523
+ ), ie = q((ue = n.modelValue) == null ? void 0 : ue.code);
524
+ function le(t) {
525
525
  var p;
526
- const t = e.el;
527
- t && ((p = t.querySelector("[x-should-scroll-into=true]")) == null || p.scrollIntoView());
528
- }
529
- function re(e) {
530
- switch (e) {
531
- case Ce.MY:
532
- return "MYR";
533
- case Ce.SG:
534
- return "SGD";
535
- case Ce.ID:
536
- return "IDR";
537
- default:
538
- return "MYR";
539
- }
526
+ const e = t.el;
527
+ e && ((p = e.querySelector("[x-should-scroll-into=true]")) == null || p.scrollIntoView());
540
528
  }
541
- const N = S(
529
+ const de = S(
542
530
  () => {
543
- var e, t, p, _, E, w;
544
- return ((_ = (p = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : p.find(
545
- (q) => {
546
- var Q;
547
- return q.id === ((Q = n.modelValue) == null ? void 0 : Q.trackingMeasurement);
531
+ var t, e, p, _, E, F;
532
+ return ((_ = (p = (e = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : e.measurements) == null ? void 0 : p.find(
533
+ (O) => {
534
+ var G;
535
+ return O.id === ((G = n.modelValue) == null ? void 0 : G.trackingMeasurement);
548
536
  }
549
- )) == null ? void 0 : _.abbrev) ?? ((w = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : w.abbrev);
537
+ )) == null ? void 0 : _.abbrev) ?? ((F = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : F.abbrev);
550
538
  }
551
- ), z = S({
539
+ ), P = S({
552
540
  get() {
553
- var e, t;
554
- return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? se().low;
541
+ var t, e;
542
+ return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.low) ?? ae().low;
555
543
  },
556
- set(e) {
544
+ set(t) {
557
545
  var _;
558
- const t = ((_ = n.modelValue) == null ? void 0 : _.thresholds) ?? se();
559
- t.low = e;
546
+ const e = ((_ = n.modelValue) == null ? void 0 : _.thresholds) ?? ae();
547
+ e.low = t;
560
548
  const p = n.modelValue ? {
561
549
  ...n.modelValue
562
550
  } : {};
563
- p.thresholds = t, l("update:modelValue", p);
551
+ p.thresholds = e, l("update:modelValue", p);
564
552
  }
565
- }), te = S({
553
+ }), z = S({
566
554
  get() {
567
- var e, t;
568
- return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? se().mid;
555
+ var t, e;
556
+ return ((e = (t = n.modelValue) == null ? void 0 : t.thresholds) == null ? void 0 : e.mid) ?? ae().mid;
569
557
  },
570
- set(e) {
558
+ set(t) {
571
559
  var _;
572
- const t = ((_ = n.modelValue) == null ? void 0 : _.thresholds) ?? se();
573
- t.mid = e;
560
+ const e = ((_ = n.modelValue) == null ? void 0 : _.thresholds) ?? ae();
561
+ e.mid = t;
574
562
  const p = n.modelValue ? {
575
563
  ...n.modelValue
576
564
  } : {};
577
- p.thresholds = t, l("update:modelValue", p);
565
+ p.thresholds = e, l("update:modelValue", p);
578
566
  }
579
567
  });
580
- function be() {
581
- return function(t) {
582
- return typeof (t == null ? void 0 : t.low) != "number" || typeof (t == null ? void 0 : t.mid) != "number" ? "Required" : t.low >= t.mid ? "Days for red indicator should be less than yellow indicator." : !0;
568
+ function ge() {
569
+ return function(e) {
570
+ return typeof (e == null ? void 0 : e.low) != "number" || typeof (e == null ? void 0 : e.mid) != "number" ? "Required" : e.low >= e.mid ? "Days for red indicator should be less than yellow indicator." : !0;
583
571
  };
584
572
  }
585
- return (e, t) => {
586
- const p = C("FmTextField"), _ = C("FmLabel"), E = C("FmField"), w = C("FmMenuHeader"), q = C("FmMenuDivider"), Q = C("FmMenuItem"), ce = C("FmMenu"), Ue = C("FmFormGroup"), ot = C("FmSelect"), lt = C("FmSwitch"), Re = C("FmStepperField"), at = C("FmForm");
587
- return f(), P(at, {
588
- disabled: e.disabled,
573
+ return (t, e) => {
574
+ const p = C("FmTextField"), _ = C("FmLabel"), E = C("FmField"), F = C("FmMenuHeader"), O = C("FmMenuDivider"), G = C("FmMenuItem"), me = C("FmMenu"), $e = C("FmFormGroup"), nt = C("FmSelect"), ot = C("FmSwitch"), Ee = C("FmStepperField"), lt = C("FmForm");
575
+ return f(), B(lt, {
576
+ disabled: t.disabled,
589
577
  ref_key: "formRef",
590
578
  ref: H,
591
579
  class: "flex flex-col gap-32",
592
580
  onValidationSuccess: s
593
581
  }, {
594
582
  default: V(() => {
595
- var Te, Ae, De, Pe;
583
+ var Ue, Re, Te, Ae;
596
584
  return [
597
- m("div", Bt, [
598
- m("div", Nt, [
599
- c(ve, {
585
+ m("div", Pt, [
586
+ m("div", Bt, [
587
+ c(pe, {
600
588
  "tooltip-message": "This field is managed by NetSuite",
601
589
  "tooltip-z-index": 50,
602
590
  label: d(r)("inventory.ingredient.code"),
603
591
  "model-value": x.value,
604
- "onUpdate:modelValue": t[1] || (t[1] = (M) => x.value = M),
592
+ "onUpdate:modelValue": e[1] || (e[1] = (M) => x.value = M),
605
593
  locked: g.value,
606
- disabled: e.disabled
594
+ disabled: t.disabled
607
595
  }, {
608
596
  default: V(() => [
609
597
  c(p, {
610
598
  label: d(r)("inventory.ingredient.code"),
611
599
  "model-value": x.value,
612
- "onUpdate:modelValue": t[0] || (t[0] = (M) => x.value = M),
613
- rules: [d(Se)(), d(ct)($.value, ue.value)],
600
+ "onUpdate:modelValue": e[0] || (e[0] = (M) => x.value = M),
601
+ rules: [d(Ve)(), d(mt)($.value, ie.value)],
614
602
  "label-mark": "required"
615
603
  }, null, 8, ["label", "model-value", "rules"])
616
604
  ]),
617
605
  _: 1
618
606
  }, 8, ["label", "model-value", "locked", "disabled"])
619
607
  ]),
620
- m("div", zt, [
621
- c(ve, {
608
+ m("div", Nt, [
609
+ c(pe, {
622
610
  "tooltip-message": "This field is managed by NetSuite",
623
611
  "tooltip-z-index": 50,
624
612
  label: d(r)("inventory.ingredient.name"),
625
613
  "model-value": U.value,
626
- "onUpdate:modelValue": t[3] || (t[3] = (M) => U.value = M),
614
+ "onUpdate:modelValue": e[3] || (e[3] = (M) => U.value = M),
627
615
  locked: g.value,
628
- disabled: e.disabled
616
+ disabled: t.disabled
629
617
  }, {
630
618
  default: V(() => [
631
619
  c(p, {
632
620
  label: d(r)("inventory.ingredient.name"),
633
621
  "model-value": U.value,
634
- "onUpdate:modelValue": t[2] || (t[2] = (M) => U.value = M),
635
- rules: [d(Se)()],
622
+ "onUpdate:modelValue": e[2] || (e[2] = (M) => U.value = M),
623
+ rules: [d(Ve)()],
636
624
  "label-mark": "required"
637
625
  }, null, 8, ["label", "model-value", "rules"])
638
626
  ]),
@@ -640,19 +628,19 @@ const Pt = {
640
628
  }, 8, ["label", "model-value", "locked", "disabled"])
641
629
  ])
642
630
  ]),
643
- c(ve, {
631
+ c(pe, {
644
632
  "tooltip-message": "This field is managed by NetSuite",
645
633
  "tooltip-z-index": 50,
646
634
  label: d(r)("inventory.ingredient.unit"),
647
- "helper-text": (Te = e.modelValue) != null && Te.trackingMeasurement ? `Base unit: ${(De = (Ae = e.modelValue) == null ? void 0 : Ae.unit) == null ? void 0 : De.name}` : void 0,
648
- "model-value": (Pe = B.value) == null ? void 0 : Pe.name,
635
+ "helper-text": (Ue = t.modelValue) != null && Ue.trackingMeasurement ? `Base unit: ${(Te = (Re = t.modelValue) == null ? void 0 : Re.unit) == null ? void 0 : Te.name}` : void 0,
636
+ "model-value": (Ae = N.value) == null ? void 0 : Ae.name,
649
637
  locked: g.value,
650
- disabled: e.disabled
638
+ disabled: t.disabled
651
639
  }, {
652
640
  default: V(() => [
653
- c(Ue, {
654
- "model-value": B.value,
655
- rules: [d(Se)()],
641
+ c($e, {
642
+ "model-value": N.value,
643
+ rules: [d(Ve)()],
656
644
  "label-mark": "required"
657
645
  }, {
658
646
  label: V(() => [
@@ -661,23 +649,23 @@ const Pt = {
661
649
  }, null, 8, ["label"])
662
650
  ]),
663
651
  default: V(({ invalid: M }) => [
664
- c(ce, null, {
652
+ c(me, null, {
665
653
  "menu-button": V(() => [
666
654
  c(E, {
667
655
  class: ee([
668
656
  "fm-typo-en-body-lg-400",
669
657
  {
670
- "text-fm-color-typo-primary": !e.disabled,
671
- "text-fm-color-typo-disabled": e.disabled
658
+ "text-fm-color-typo-primary": !t.disabled,
659
+ "text-fm-color-typo-disabled": t.disabled
672
660
  }
673
661
  ]),
674
662
  invalid: M,
675
663
  "append-icon": "expand_more"
676
664
  }, {
677
665
  default: V(() => {
678
- var G;
666
+ var W;
679
667
  return [
680
- $e(A((G = B.value) == null ? void 0 : G.name), 1)
668
+ Me(A((W = N.value) == null ? void 0 : W.name), 1)
681
669
  ];
682
670
  }),
683
671
  _: 2
@@ -686,22 +674,22 @@ const Pt = {
686
674
  default: V(() => [
687
675
  m("div", {
688
676
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
689
- onVnodeMounted: ae
677
+ onVnodeMounted: le
690
678
  }, [
691
- (f(!0), T(X, null, ie(F.value, (G) => (f(), T(X, {
692
- key: G.label
679
+ (f(!0), T(X, null, re(w.value, (W) => (f(), T(X, {
680
+ key: W.label
693
681
  }, [
694
- G.displayAsSection ? (f(), T(X, { key: 0 }, [
695
- c(w, {
696
- label: G.label
682
+ W.displayAsSection ? (f(), T(X, { key: 0 }, [
683
+ c(F, {
684
+ label: W.label
697
685
  }, null, 8, ["label"]),
698
- c(q)
699
- ], 64)) : (f(), P(Q, {
686
+ c(O)
687
+ ], 64)) : (f(), B(G, {
700
688
  key: 1,
701
- label: G.label,
702
- "model-value": v(G),
703
- onClick: (Yn) => R(G.value),
704
- "x-should-scroll-into": `${v(G)}`
689
+ label: W.label,
690
+ "model-value": v(W),
691
+ onClick: (On) => R(W.value),
692
+ "x-should-scroll-into": `${v(W)}`
705
693
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
706
694
  ], 64))), 128))
707
695
  ], 512)
@@ -714,17 +702,17 @@ const Pt = {
714
702
  ]),
715
703
  _: 1
716
704
  }, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
717
- d(h).enableTotalCost ? (f(), P(ve, {
705
+ d(h).enableTotalCost ? (f(), B(pe, {
718
706
  key: 0,
719
707
  "tooltip-message": "This field is managed by NetSuite",
720
708
  "tooltip-z-index": 50,
721
709
  label: d(r)("inventory.ingredient.valuationMethod.title"),
722
710
  "model-value": d(r)("inventory.ingredient.valuationMethod." + L.value),
723
711
  locked: g.value,
724
- disabled: e.disabled
712
+ disabled: t.disabled
725
713
  }, {
726
714
  label: V(() => [
727
- c(_e, { "z-index": 50 }, {
715
+ c(he, { "z-index": 50 }, {
728
716
  default: V(() => [
729
717
  c(_, {
730
718
  label: d(r)("inventory.ingredient.valuationMethod.title")
@@ -734,25 +722,25 @@ const Pt = {
734
722
  })
735
723
  ]),
736
724
  default: V(() => [
737
- c(ot, {
725
+ c(nt, {
738
726
  class: "col-span-2",
739
727
  "model-value": L.value,
740
- "onUpdate:modelValue": t[4] || (t[4] = (M) => L.value = M),
741
- items: K.value
728
+ "onUpdate:modelValue": e[4] || (e[4] = (M) => L.value = M),
729
+ items: Z.value
742
730
  }, null, 8, ["model-value", "items"])
743
731
  ]),
744
732
  _: 1
745
- }, 8, ["label", "model-value", "locked", "disabled"])) : O("", !0),
746
- d(h).enableTotalCost ? (f(), P(ve, {
733
+ }, 8, ["label", "model-value", "locked", "disabled"])) : j("", !0),
734
+ d(h).enableTotalCost ? (f(), B(pe, {
747
735
  key: 1,
748
736
  "tooltip-message": "This field is managed by NetSuite",
749
737
  "tooltip-z-index": 50,
750
- "model-value": `${d(pt)()} ${I.value}`,
738
+ "model-value": `${d(ct)()} ${I.value}`,
751
739
  locked: g.value,
752
- disabled: e.disabled
740
+ disabled: t.disabled
753
741
  }, {
754
742
  label: V(() => [
755
- c(_e, { "z-index": 50 }, {
743
+ c(he, { "z-index": 50 }, {
756
744
  default: V(() => [
757
745
  c(_, {
758
746
  label: d(r)("inventory.ingredient.pricePerUnit")
@@ -764,11 +752,11 @@ const Pt = {
764
752
  default: V(() => [
765
753
  c(p, {
766
754
  "model-value": I.value,
767
- "onUpdate:modelValue": t[5] || (t[5] = (M) => I.value = M),
768
- rules: [d(xe)(0), d(vt)(4)]
755
+ "onUpdate:modelValue": e[5] || (e[5] = (M) => I.value = M),
756
+ rules: [d(_e)(0), d(pt)(4)]
769
757
  }, {
770
758
  label: V(() => [
771
- c(_e, { "z-index": 50 }, {
759
+ c(he, { "z-index": 50 }, {
772
760
  default: V(() => [
773
761
  c(_, {
774
762
  label: d(r)("inventory.ingredient.pricePerUnit")
@@ -778,82 +766,82 @@ const Pt = {
778
766
  })
779
767
  ]),
780
768
  prepend: V(() => {
781
- var M, G;
769
+ var M, W;
782
770
  return [
783
- m("div", Lt, A(re(((M = d(a).currentCountry) == null ? void 0 : M.value) ?? d(Le)) === "MYR" ? "RM" : re(((G = d(a).currentCountry) == null ? void 0 : G.value) ?? d(Le))), 1)
771
+ m("div", zt, A(d(Ne)(((M = d(a).currentCountry) == null ? void 0 : M.value) ?? d(ze)) === "MYR" ? "RM" : d(Ne)(((W = d(a).currentCountry) == null ? void 0 : W.value) ?? d(ze))), 1)
784
772
  ];
785
773
  }),
786
774
  append: V(() => [
787
- m("div", Ht, " / " + A(N.value), 1)
775
+ m("div", Lt, " / " + A(de.value), 1)
788
776
  ]),
789
777
  _: 1
790
778
  }, 8, ["model-value", "rules"])
791
779
  ]),
792
780
  _: 1
793
- }, 8, ["model-value", "locked", "disabled"])) : O("", !0),
794
- !g.value || Z.value ? (f(), P(Dt, {
781
+ }, 8, ["model-value", "locked", "disabled"])) : j("", !0),
782
+ !g.value || J.value ? (f(), B(At, {
795
783
  key: 2,
796
- "model-value": Z.value,
797
- "onUpdate:modelValue": t[6] || (t[6] = (M) => Z.value = M),
798
- "root-value": e.modelValue,
784
+ "model-value": J.value,
785
+ "onUpdate:modelValue": e[6] || (e[6] = (M) => J.value = M),
786
+ "root-value": t.modelValue,
799
787
  readonly: g.value
800
- }, null, 8, ["model-value", "root-value", "readonly"])) : O("", !0),
801
- e.mode !== d(W).CREATE ? (f(), T("div", Ot, [
788
+ }, null, 8, ["model-value", "root-value", "readonly"])) : j("", !0),
789
+ t.mode !== d(K).CREATE ? (f(), T("div", Ht, [
802
790
  m("div", null, [
803
- c(lt, {
791
+ c(ot, {
804
792
  label: d(r)("inventory.ingredient.bindedItems.title"),
805
- modelValue: J.value,
806
- "onUpdate:modelValue": t[7] || (t[7] = (M) => J.value = M),
793
+ modelValue: Q.value,
794
+ "onUpdate:modelValue": e[7] || (e[7] = (M) => Q.value = M),
807
795
  "label-placement": "right"
808
796
  }, null, 8, ["label", "modelValue"])
809
797
  ]),
810
- J.value && de.value.length ? (f(), P(Me, {
798
+ Q.value && se.value.length ? (f(), B(we, {
811
799
  key: 0,
812
800
  name: d(r)("inventory.ingredient.bindedItems.ingredient"),
813
- bindings: de.value
814
- }, null, 8, ["name", "bindings"])) : O("", !0),
815
- J.value && ge.value.length ? (f(), P(Me, {
801
+ bindings: se.value
802
+ }, null, 8, ["name", "bindings"])) : j("", !0),
803
+ Q.value && ye.value.length ? (f(), B(we, {
816
804
  key: 1,
817
805
  name: d(r)("inventory.ingredient.bindedItems.recipe"),
818
- bindings: ge.value
819
- }, null, 8, ["name", "bindings"])) : O("", !0),
820
- J.value && D.value.length ? (f(), P(Me, {
806
+ bindings: ye.value
807
+ }, null, 8, ["name", "bindings"])) : j("", !0),
808
+ Q.value && D.value.length ? (f(), B(we, {
821
809
  key: 2,
822
810
  name: d(r)("inventory.ingredient.bindedItems.menu"),
823
811
  bindings: D.value
824
- }, null, 8, ["name", "bindings"])) : O("", !0)
825
- ])) : O("", !0),
826
- m("div", Yt, [
812
+ }, null, 8, ["name", "bindings"])) : j("", !0)
813
+ ])) : j("", !0),
814
+ m("div", Ot, [
827
815
  m("div", jt, [
828
- c(_e, null, {
816
+ c(he, null, {
829
817
  default: V(() => [
830
818
  m("div", qt, A(d(r)("inventory.ingredient.threshold.title")), 1)
831
819
  ]),
832
820
  _: 1
833
821
  }),
834
- m("div", Gt, A(d(r)("inventory.ingredient.threshold.subtitle")), 1)
822
+ m("div", Yt, A(d(r)("inventory.ingredient.threshold.subtitle")), 1)
835
823
  ]),
836
- m("div", Wt, [
837
- c(Ue, {
838
- "model-value": { low: z.value, mid: te.value },
839
- rules: [be()]
824
+ m("div", Gt, [
825
+ c($e, {
826
+ "model-value": { low: P.value, mid: z.value },
827
+ rules: [ge()]
840
828
  }, null, 8, ["model-value", "rules"]),
841
- m("div", Kt, [
842
- m("div", Zt, [
843
- m("div", Jt, [
844
- c(we, {
845
- days: z.value,
846
- level: d(Fe).low
829
+ m("div", Wt, [
830
+ m("div", Kt, [
831
+ m("div", Zt, [
832
+ c(Se, {
833
+ days: P.value,
834
+ level: d(Ce).low
847
835
  }, null, 8, ["days", "level"])
848
836
  ]),
849
- m("div", Qt, [
850
- m("div", Xt, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
851
- c(Re, {
852
- modelValue: z.value,
853
- "onUpdate:modelValue": t[8] || (t[8] = (M) => z.value = M),
854
- rules: [d(xe)(0)]
837
+ m("div", Jt, [
838
+ m("div", Qt, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
839
+ c(Ee, {
840
+ modelValue: P.value,
841
+ "onUpdate:modelValue": e[8] || (e[8] = (M) => P.value = M),
842
+ rules: [d(_e)(0)]
855
843
  }, {
856
- append: V(() => t[11] || (t[11] = [
844
+ append: V(() => e[11] || (e[11] = [
857
845
  m("div", {
858
846
  class: "text-fm-color-typo-secondary",
859
847
  style: { "padding-right": "32px" }
@@ -863,7 +851,7 @@ const Pt = {
863
851
  }, 8, ["modelValue", "rules"])
864
852
  ])
865
853
  ]),
866
- t[13] || (t[13] = m("div", {
854
+ e[13] || (e[13] = m("div", {
867
855
  class: "h-full bg-fm-color-neutral-gray-200 relative",
868
856
  style: { width: "1px" }
869
857
  }, [
@@ -872,21 +860,21 @@ const Pt = {
872
860
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
873
861
  }, " < ")
874
862
  ], -1)),
875
- m("div", en, [
876
- m("div", tn, [
877
- c(we, {
878
- days: te.value,
879
- level: d(Fe).mid
863
+ m("div", Xt, [
864
+ m("div", en, [
865
+ c(Se, {
866
+ days: z.value,
867
+ level: d(Ce).mid
880
868
  }, null, 8, ["days", "level"])
881
869
  ]),
882
- m("div", nn, [
883
- m("div", on, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
884
- c(Re, {
885
- modelValue: te.value,
886
- "onUpdate:modelValue": t[9] || (t[9] = (M) => te.value = M),
887
- rules: [d(xe)(0)]
870
+ m("div", tn, [
871
+ m("div", nn, A(d(r)("inventory.ingredient.threshold.whenRemaining")), 1),
872
+ c(Ee, {
873
+ modelValue: z.value,
874
+ "onUpdate:modelValue": e[9] || (e[9] = (M) => z.value = M),
875
+ rules: [d(_e)(0)]
888
876
  }, {
889
- append: V(() => t[12] || (t[12] = [
877
+ append: V(() => e[12] || (e[12] = [
890
878
  m("div", {
891
879
  class: "text-fm-color-typo-secondary",
892
880
  style: { "padding-right": "32px" }
@@ -896,7 +884,7 @@ const Pt = {
896
884
  }, 8, ["modelValue", "rules"])
897
885
  ])
898
886
  ]),
899
- t[14] || (t[14] = m("div", {
887
+ e[14] || (e[14] = m("div", {
900
888
  class: "h-full bg-fm-color-neutral-gray-200 relative",
901
889
  style: { width: "1px" }
902
890
  }, [
@@ -905,25 +893,25 @@ const Pt = {
905
893
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
906
894
  }, " < ")
907
895
  ], -1)),
908
- m("div", ln, [
909
- m("div", an, [
910
- c(we, {
911
- days: te.value + 1,
912
- level: d(Fe).high
896
+ m("div", on, [
897
+ m("div", ln, [
898
+ c(Se, {
899
+ days: z.value + 1,
900
+ level: d(Ce).high
913
901
  }, null, 8, ["days", "level"])
914
902
  ]),
915
- m("div", rn, [
916
- m("div", sn, A(d(r)("inventory.ingredient.threshold.stockIsStaple")), 1)
903
+ m("div", an, [
904
+ m("div", rn, A(d(r)("inventory.ingredient.threshold.stockIsStaple")), 1)
917
905
  ])
918
906
  ])
919
907
  ])
920
908
  ])
921
909
  ]),
922
910
  m("div", null, [
923
- c(Tt, {
911
+ c(Rt, {
924
912
  entity: "inventorySku",
925
- modelValue: j.value,
926
- "onUpdate:modelValue": t[10] || (t[10] = (M) => j.value = M)
913
+ modelValue: Y.value,
914
+ "onUpdate:modelValue": e[10] || (e[10] = (M) => Y.value = M)
927
915
  }, null, 8, ["modelValue"])
928
916
  ])
929
917
  ];
@@ -932,44 +920,44 @@ const Pt = {
932
920
  }, 8, ["disabled"]);
933
921
  };
934
922
  }
935
- }), un = { class: "flex flex-col gap-32" }, mn = {
923
+ }), dn = { class: "flex flex-col gap-32" }, un = {
936
924
  key: 0,
937
925
  class: "flex flex-col gap-12"
938
- }, cn = { class: "flex flex-col gap-4" }, pn = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, fn = { class: "flex gap-4" }, yn = /* @__PURE__ */ ne({
926
+ }, mn = { class: "flex flex-col gap-4" }, cn = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, pn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, vn = { class: "flex gap-4" }, fn = /* @__PURE__ */ te({
939
927
  __name: "IngredientDialog",
940
928
  props: {
941
929
  show: { type: Boolean },
942
930
  unit: {},
943
- mode: { default: W.READ }
931
+ mode: { default: K.READ }
944
932
  },
945
933
  emits: ["update:show"],
946
934
  setup(u) {
947
- const o = u, y = oe(), r = Ee(), n = Ve(), { t: l } = le(), i = Ye(o, "show"), a = Ye(o, "unit"), h = S(
935
+ const o = u, y = ne(), r = Ie(), n = ke(), { t: l } = oe(), i = Oe(o, "show"), a = Oe(o, "unit"), h = S(
948
936
  () => {
949
937
  var v;
950
938
  return r.isEnabled && r.netSuiteItemBySkuId.has((v = o.unit) == null ? void 0 : v._id);
951
939
  }
952
940
  ), k = S(() => {
953
941
  switch (o.mode) {
954
- case W.READ:
942
+ case K.READ:
955
943
  return "";
956
- case W.UPDATE:
944
+ case K.UPDATE:
957
945
  return l("inventory.ingredient.update.title");
958
- case W.CREATE:
946
+ case K.CREATE:
959
947
  return l("inventory.ingredient.create.title");
960
948
  }
961
949
  return "";
962
950
  }), g = S(() => {
963
951
  switch (o.mode) {
964
- case W.READ:
952
+ case K.READ:
965
953
  return "";
966
- case W.UPDATE:
954
+ case K.UPDATE:
967
955
  return l("common.save");
968
- case W.CREATE:
956
+ case K.CREATE:
969
957
  return l("common.add");
970
958
  }
971
959
  return "";
972
- }), b = Y(), s = Y(!1);
960
+ }), b = q(), s = q(!1);
973
961
  async function x() {
974
962
  s.value = !0;
975
963
  try {
@@ -979,7 +967,7 @@ const Pt = {
979
967
  type: "success"
980
968
  });
981
969
  } catch (v) {
982
- v instanceof He || n.open({
970
+ v instanceof Le || n.open({
983
971
  title: l("inventory.ingredient.create.error.title"),
984
972
  message: l("inventory.ingredient.create.error.message"),
985
973
  type: "error"
@@ -997,7 +985,7 @@ const Pt = {
997
985
  type: "success"
998
986
  });
999
987
  } catch (v) {
1000
- v instanceof He || n.open({
988
+ v instanceof Le || n.open({
1001
989
  title: l("inventory.ingredient.update.error.title"),
1002
990
  message: l("inventory.ingredient.update.error.message"),
1003
991
  type: "error"
@@ -1010,89 +998,89 @@ const Pt = {
1010
998
  var v, R;
1011
999
  (R = (v = b.value) == null ? void 0 : v.validateInputs) == null || R.call(v);
1012
1000
  }
1013
- function B() {
1001
+ function N() {
1014
1002
  switch (o.mode) {
1015
- case W.READ:
1003
+ case K.READ:
1016
1004
  return;
1017
- case W.UPDATE:
1005
+ case K.UPDATE:
1018
1006
  return U();
1019
- case W.CREATE:
1007
+ case K.CREATE:
1020
1008
  return x();
1021
1009
  }
1022
1010
  }
1023
- const F = S(() => {
1024
- var Z, K;
1025
- if (!r.isEnabled || !((Z = o.unit) != null && Z._id)) return null;
1026
- const v = (K = r.netSuiteItemBySkuId.get(o.unit._id)) == null ? void 0 : K[0];
1011
+ const w = S(() => {
1012
+ var J, Z;
1013
+ if (!r.isEnabled || !((J = o.unit) != null && J._id)) return null;
1014
+ const v = (Z = r.netSuiteItemBySkuId.get(o.unit._id)) == null ? void 0 : Z[0];
1027
1015
  return v ? r.state.setting.childItems.filter(
1028
1016
  (L) => L.parentNetSuiteId === v.netSuiteId
1029
1017
  ).map((L) => {
1030
1018
  var H;
1031
- const j = (H = r.measurementByNetsuiteId.get(L.unitOfMeasureId)) == null ? void 0 : H[0];
1032
- return j ? {
1019
+ const Y = (H = r.measurementByNetsuiteId.get(L.unitOfMeasureId)) == null ? void 0 : H[0];
1020
+ return Y ? {
1033
1021
  externalId: L.externalId,
1034
- ...j
1022
+ ...Y
1035
1023
  } : null;
1036
1024
  }).filter((L) => L).map((L) => L) : null;
1037
1025
  });
1038
1026
  return (v, R) => {
1039
- const Z = C("FmChip"), K = C("FmButton"), L = C("FmSideSheet");
1040
- return f(), P(L, {
1027
+ const J = C("FmChip"), Z = C("FmButton"), L = C("FmSideSheet");
1028
+ return f(), B(L, {
1041
1029
  "model-value": d(i),
1042
- "onUpdate:modelValue": R[3] || (R[3] = (j) => Be(i) ? i.value = j : null),
1030
+ "onUpdate:modelValue": R[3] || (R[3] = (Y) => De(i) ? i.value = Y : null),
1043
1031
  header: k.value,
1044
1032
  "close-button": "",
1045
1033
  "dismiss-away": "",
1046
1034
  "max-width": 500
1047
1035
  }, {
1048
1036
  "side-sheet-footer": V(() => [
1049
- m("div", fn, [
1050
- c(K, {
1037
+ m("div", vn, [
1038
+ c(Z, {
1051
1039
  loading: s.value,
1052
1040
  label: g.value,
1053
1041
  onClick: I
1054
1042
  }, null, 8, ["loading", "label"]),
1055
- c(K, {
1043
+ c(Z, {
1056
1044
  disabled: s.value,
1057
1045
  label: d(l)("common.close"),
1058
1046
  variant: "tertiary",
1059
- onClick: R[2] || (R[2] = (j) => i.value = !1)
1047
+ onClick: R[2] || (R[2] = (Y) => i.value = !1)
1060
1048
  }, null, 8, ["disabled", "label"])
1061
1049
  ])
1062
1050
  ]),
1063
1051
  default: V(() => {
1064
- var j;
1052
+ var Y;
1065
1053
  return [
1066
- m("div", un, [
1054
+ m("div", dn, [
1067
1055
  m("div", null, [
1068
- h.value ? (f(), P(Z, {
1056
+ h.value ? (f(), B(J, {
1069
1057
  key: 0,
1070
1058
  label: "Netsuite",
1071
1059
  compact: ""
1072
- })) : O("", !0)
1060
+ })) : j("", !0)
1073
1061
  ]),
1074
- c(dn, {
1062
+ c(sn, {
1075
1063
  class: "w-full",
1076
1064
  ref_key: "hasValidationExpose",
1077
1065
  ref: b,
1078
1066
  modelValue: d(a),
1079
- "onUpdate:modelValue": R[0] || (R[0] = (H) => Be(a) ? a.value = H : null),
1067
+ "onUpdate:modelValue": R[0] || (R[0] = (H) => De(a) ? a.value = H : null),
1080
1068
  mode: v.mode,
1081
1069
  disabled: s.value,
1082
- "onClick:submit": R[1] || (R[1] = (H) => B())
1070
+ "onClick:submit": R[1] || (R[1] = (H) => N())
1083
1071
  }, null, 8, ["modelValue", "mode", "disabled"]),
1084
- (j = F.value) != null && j.length ? (f(), T("div", mn, [
1072
+ (Y = w.value) != null && Y.length ? (f(), T("div", un, [
1085
1073
  R[4] || (R[4] = m("div", { class: "fm-typo-en-title-sm-600" }, A("NetSuite info"), -1)),
1086
- m("div", cn, [
1087
- (f(!0), T(X, null, ie(F.value, (H, J) => (f(), T("div", {
1088
- key: J,
1074
+ m("div", mn, [
1075
+ (f(!0), T(X, null, re(w.value, (H, Q) => (f(), T("div", {
1076
+ key: Q,
1089
1077
  class: "flex items-center"
1090
1078
  }, [
1091
- m("div", pn, A(H.externalId), 1),
1092
- m("div", vn, A(H.abbrev), 1)
1079
+ m("div", cn, A(H.externalId), 1),
1080
+ m("div", pn, A(H.abbrev), 1)
1093
1081
  ]))), 128))
1094
1082
  ])
1095
- ])) : O("", !0)
1083
+ ])) : j("", !0)
1096
1084
  ])
1097
1085
  ];
1098
1086
  }),
@@ -1101,24 +1089,24 @@ const Pt = {
1101
1089
  };
1102
1090
  }
1103
1091
  });
1104
- function* gn(u) {
1092
+ function* yn(u) {
1105
1093
  for (; ; )
1106
1094
  yield u[Math.floor(Math.random() * u.length)];
1107
1095
  }
1108
- function bn(u = 4, o = gn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1096
+ function gn(u = 4, o = yn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1109
1097
  return Array.from({ length: u }).map(() => o.next().value).join("");
1110
1098
  }
1111
- function hn() {
1112
- return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${bn()}`;
1099
+ function bn() {
1100
+ return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${gn()}`;
1113
1101
  }
1114
- const _n = {
1102
+ const hn = {
1115
1103
  _id: "",
1116
1104
  name: "",
1117
1105
  abbrev: "",
1118
1106
  precision: 0,
1119
1107
  measurements: []
1120
1108
  };
1121
- function xn(u) {
1109
+ function _n(u) {
1122
1110
  var y, r, n, l, i;
1123
1111
  return {
1124
1112
  code: u.code,
@@ -1126,12 +1114,12 @@ function xn(u) {
1126
1114
  unit: ((y = u.unit.measurements.find((a) => a.id === u.trackingMeasurement)) == null ? void 0 : y.abbrev) ?? u.unit.abbrev,
1127
1115
  baseUnit: u.unit.abbrev,
1128
1116
  valuationMethod: u.valuation ?? "WAVG",
1129
- pricePerUnit: (r = u.defaultCost) != null && r.costPerUnit ? +Ze((n = u.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1130
- thresholdLow: ((l = u.thresholds) == null ? void 0 : l.low) ?? se().low,
1131
- thresholdMid: ((i = u.thresholds) == null ? void 0 : i.mid) ?? se().mid
1117
+ pricePerUnit: (r = u.defaultCost) != null && r.costPerUnit ? +Ke((n = u.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1118
+ thresholdLow: ((l = u.thresholds) == null ? void 0 : l.low) ?? ae().low,
1119
+ thresholdMid: ((i = u.thresholds) == null ? void 0 : i.mid) ?? ae().mid
1132
1120
  };
1133
1121
  }
1134
- function nt() {
1122
+ function tt() {
1135
1123
  var n;
1136
1124
  const u = [
1137
1125
  {
@@ -1150,7 +1138,7 @@ function nt() {
1150
1138
  id: "baseUnit",
1151
1139
  name: "Base unit"
1152
1140
  }
1153
- ], o = tt(), y = ye(), r = ke(y.currentCountry.value);
1141
+ ], o = et(), y = fe(), r = xe(y.currentCountry.value);
1154
1142
  return o.enableTotalCost && u.push(
1155
1143
  {
1156
1144
  id: "valuationMethod",
@@ -1171,28 +1159,28 @@ function nt() {
1171
1159
  }
1172
1160
  ), u;
1173
1161
  }
1174
- function kn() {
1175
- const o = oe().skus.map(xn), r = ye().currentBusiness.value, n = nt(), l = [
1162
+ function xn() {
1163
+ const o = ne().skus.map(_n), r = fe().currentBusiness.value, n = tt(), l = [
1176
1164
  ["Business name:", r == null ? void 0 : r.name],
1177
1165
  ["Business ID:", r == null ? void 0 : r._id],
1178
1166
  ["Menu version", r == null ? void 0 : r.menuVersion],
1179
1167
  [],
1180
1168
  n.map((k) => k.name),
1181
1169
  ...o.map((k) => n.map((g) => k[g.id]))
1182
- ], i = n.map((k) => `system:${k.id}`), a = Qe(l, i), h = `${r == null ? void 0 : r.name} ingredients (${ft(/* @__PURE__ */ new Date())}).xlsx`;
1183
- return Xe(a, h), h;
1170
+ ], i = n.map((k) => `system:${k.id}`), a = Je(l, i), h = `${r == null ? void 0 : r.name} ingredients (${vt(/* @__PURE__ */ new Date())}).xlsx`;
1171
+ return Qe(a, h), h;
1184
1172
  }
1185
- function Vn() {
1186
- const o = ye().currentBusiness.value, y = nt(), r = [
1173
+ function kn() {
1174
+ const o = fe().currentBusiness.value, y = tt(), r = [
1187
1175
  ["Business name:", o == null ? void 0 : o.name],
1188
1176
  ["Business ID:", o == null ? void 0 : o._id],
1189
1177
  ["Menu version", o == null ? void 0 : o.menuVersion],
1190
1178
  [],
1191
1179
  y.map((a) => a.name)
1192
- ], n = y.map((a) => `system:${a.id}`), l = Qe(r, n), i = "FeedMe ingredients template.xlsx";
1193
- return Xe(l, i), i;
1180
+ ], n = y.map((a) => `system:${a.id}`), l = Je(r, n), i = "FeedMe ingredients template.xlsx";
1181
+ return Qe(l, i), i;
1194
1182
  }
1195
- function Sn(u) {
1183
+ function Vn(u) {
1196
1184
  const [
1197
1185
  o,
1198
1186
  y,
@@ -1201,7 +1189,7 @@ function Sn(u) {
1201
1189
  l,
1202
1190
  i,
1203
1191
  ...a
1204
- ] = gt(u);
1192
+ ] = yt(u);
1205
1193
  if (!o || !o.length || o.some((s) => s.length && !s.startsWith("system:")))
1206
1194
  throw new Error("Missing meta header. Excel file does not come from the template.");
1207
1195
  const h = o.map((s) => s.split(":")[1]), g = ["code", "name", "unit", "baseUnit"].filter((s) => !h.includes(s));
@@ -1212,8 +1200,8 @@ function Sn(u) {
1212
1200
  return a.map((s, x) => {
1213
1201
  const U = {};
1214
1202
  for (const I in h) {
1215
- const B = h[I];
1216
- Object.assign(U, { [B]: s[I] });
1203
+ const N = h[I];
1204
+ Object.assign(U, { [N]: s[I] });
1217
1205
  }
1218
1206
  return {
1219
1207
  index: x,
@@ -1222,8 +1210,8 @@ function Sn(u) {
1222
1210
  });
1223
1211
  }
1224
1212
  function je(u, o, y) {
1225
- var F;
1226
- const n = oe().units, l = new Array(), i = y.filter((v) => v.data.code === u.code);
1213
+ var w;
1214
+ const n = ne().units, l = new Array(), i = y.filter((v) => v.data.code === u.code);
1227
1215
  i.length > 1 && l.push(
1228
1216
  `Code ${u.code} is already used in row ${i.map((v) => v.index + 6).join()}.`
1229
1217
  );
@@ -1234,16 +1222,16 @@ function je(u, o, y) {
1234
1222
  const v = `Cannot find unit conversion for ${u.baseUnit} with symbol ${u.unit || "[empty]"}.`;
1235
1223
  l.push(v);
1236
1224
  }
1237
- const k = fe.options.find(
1225
+ const k = ve.options.find(
1238
1226
  (v) => v === u.valuationMethod
1239
1227
  );
1240
1228
  u.valuationMethod && !k && l.push(
1241
- `Expected valuation method to be one of ${fe.options.join()} but got ${u.valuationMethod} instead.`
1229
+ `Expected valuation method to be one of ${ve.options.join()} but got ${u.valuationMethod} instead.`
1242
1230
  );
1243
- const b = ye().currentCountry.value, s = (v) => `${v}`.length && bt()(v) === !0, x = s(`${u.pricePerUnit}`) === !0 ? {
1231
+ const b = fe().currentCountry.value, s = (v) => `${v}`.length && gt()(v) === !0, x = s(`${u.pricePerUnit}`) === !0 ? {
1244
1232
  costPerUnit: {
1245
- ...Je(Number(u.pricePerUnit) || 0),
1246
- currency: ((F = ke(b)) == null ? void 0 : F.currency) ?? "MYR"
1233
+ ...Ze(Number(u.pricePerUnit) || 0),
1234
+ currency: ((w = xe(b)) == null ? void 0 : w.currency) ?? "MYR"
1247
1235
  },
1248
1236
  measurement: h
1249
1237
  } : void 0, U = s(`${u.thresholdLow}`) && s(`${u.thresholdMid}`) ? {
@@ -1253,10 +1241,10 @@ function je(u, o, y) {
1253
1241
  return {
1254
1242
  type: "create",
1255
1243
  sku: {
1256
- _id: hn(),
1244
+ _id: bn(),
1257
1245
  code: u.code,
1258
1246
  name: u.name,
1259
- unit: a ?? n.find((v) => v) ?? _n,
1247
+ unit: a ?? n.find((v) => v) ?? hn,
1260
1248
  trackingMeasurement: h == null ? void 0 : h.id,
1261
1249
  valuation: k,
1262
1250
  defaultCost: x,
@@ -1266,9 +1254,9 @@ function je(u, o, y) {
1266
1254
  excelRowNumber: o + 6
1267
1255
  };
1268
1256
  }
1269
- function Cn(u) {
1257
+ function Sn(u) {
1270
1258
  try {
1271
- const o = Sn(u).filter((k) => k.data.code), r = oe().skus, n = yt(r, "code"), l = o.filter((k) => !n[k.data.code]), i = o.filter((k) => n[k.data.code]), a = l.map(
1259
+ const o = Vn(u).filter((k) => k.data.code), r = ne().skus, n = ft(r, "code"), l = o.filter((k) => !n[k.data.code]), i = o.filter((k) => n[k.data.code]), a = l.map(
1272
1260
  (k) => je(k.data, k.index, o)
1273
1261
  ), h = i.map((k) => {
1274
1262
  const g = je(k.data, k.index, o), b = n[k.data.code];
@@ -1303,10 +1291,10 @@ function Cn(u) {
1303
1291
  };
1304
1292
  }
1305
1293
  }
1306
- const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-col" }, Mn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, In = {
1294
+ const Cn = { class: "flex items-center gap-12 pl-8" }, wn = { class: "flex flex-col" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Mn = {
1307
1295
  key: 0,
1308
1296
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1309
- }, $n = { key: 0 }, qe = /* @__PURE__ */ ne({
1297
+ }, In = { key: 0 }, qe = /* @__PURE__ */ te({
1310
1298
  __name: "ImportIngredientItem",
1311
1299
  props: {
1312
1300
  type: {},
@@ -1317,23 +1305,23 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1317
1305
  setup(u) {
1318
1306
  return (o, y) => {
1319
1307
  const r = C("FmIcon"), n = C("FmTooltip");
1320
- return f(), T("div", wn, [
1308
+ return f(), T("div", Cn, [
1321
1309
  y[0] || (y[0] = m("div", null, "•", -1)),
1322
- m("div", Fn, [
1323
- m("div", Mn, [
1310
+ m("div", wn, [
1311
+ m("div", Fn, [
1324
1312
  m("div", {
1325
1313
  class: ee({
1326
1314
  "text-fm-color-system-error-300": o.errors.length
1327
1315
  })
1328
1316
  }, [
1329
- $e(A(o.name) + " ", 1),
1330
- o.type === "create" ? (f(), T("span", In, "(new)")) : O("", !0)
1317
+ Me(A(o.name) + " ", 1),
1318
+ o.type === "create" ? (f(), T("span", Mn, "(new)")) : j("", !0)
1331
1319
  ], 2),
1332
- o.errors.length ? (f(), T("div", $n, [
1320
+ o.errors.length ? (f(), T("div", In, [
1333
1321
  c(n, { "z-index": 50 }, {
1334
1322
  content: V(() => [
1335
1323
  m("ol", null, [
1336
- (f(!0), T(X, null, ie(o.errors, (l, i) => (f(), T("li", { key: i }, A(l), 1))), 128))
1324
+ (f(!0), T(X, null, re(o.errors, (l, i) => (f(), T("li", { key: i }, A(l), 1))), 128))
1337
1325
  ])
1338
1326
  ]),
1339
1327
  default: V(() => [
@@ -1345,7 +1333,7 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1345
1333
  ]),
1346
1334
  _: 1
1347
1335
  })
1348
- ])) : O("", !0)
1336
+ ])) : j("", !0)
1349
1337
  ]),
1350
1338
  m("div", {
1351
1339
  class: ee([
@@ -1360,37 +1348,37 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1360
1348
  ]);
1361
1349
  };
1362
1350
  }
1363
- }), En = { class: "flex flex-col gap-24" }, Un = { class: "fm-typo-en-body-md-400" }, Rn = { class: "flex flex-col gap-8" }, Tn = { class: "line-clamp-2 text-ellipsis break-all" }, An = {
1351
+ }), $n = { class: "flex flex-col gap-24" }, En = { class: "fm-typo-en-body-md-400" }, Un = { class: "flex flex-col gap-8" }, Rn = { class: "line-clamp-2 text-ellipsis break-all" }, Tn = {
1364
1352
  key: 2,
1365
1353
  class: "shrink-0"
1366
- }, Dn = {
1354
+ }, An = {
1367
1355
  key: 0,
1368
1356
  class: "flex flex-col"
1369
- }, Pn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Bn = {
1357
+ }, Dn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Pn = {
1370
1358
  key: 0,
1371
1359
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1372
- }, Nn = { class: "fm-typo-en-body-lg-600" }, zn = /* @__PURE__ */ ne({
1360
+ }, Bn = { class: "fm-typo-en-body-lg-600" }, Nn = /* @__PURE__ */ te({
1373
1361
  __name: "ImportIngredients",
1374
1362
  setup(u) {
1375
- const o = Y(null), y = wt(), r = Ve(), n = Y(!1), l = Y(new Array()), i = Y([]), a = Y([]), h = S(
1363
+ const o = q(null), y = Ct(), r = ke(), n = q(!1), l = q(new Array()), i = q([]), a = q([]), h = S(
1376
1364
  () => !!l.value.length || i.value.some((s) => s.errors.length) || a.value.some((s) => s.errors.length)
1377
1365
  ), k = S(
1378
1366
  () => !!i.value.length || !!a.value.length
1379
- ), { t: g } = le();
1367
+ ), { t: g } = oe();
1380
1368
  async function b(s) {
1381
1369
  l.value = [], i.value = [], a.value = [];
1382
1370
  try {
1383
1371
  n.value = !0;
1384
1372
  const [x] = await Promise.all([
1385
- _t(s),
1373
+ ht(s),
1386
1374
  // fake buffer
1387
- new Promise((B) => setTimeout(B, 1e3))
1388
- ]), U = x.SheetNames.find((B) => B);
1375
+ new Promise((N) => setTimeout(N, 1e3))
1376
+ ]), U = x.SheetNames.find((N) => N);
1389
1377
  if (!U) {
1390
1378
  l.value.push(g("inventory.ingredient.import.fileError.noSheet"));
1391
1379
  return;
1392
1380
  }
1393
- const I = Cn(x.Sheets[U]);
1381
+ const I = Sn(x.Sheets[U]);
1394
1382
  if (I.invalidExcel) {
1395
1383
  l.value.push(I.invalidExcelMessage ?? g("inventory.ingredient.import.fileError.invalidExcel"));
1396
1384
  return;
@@ -1413,26 +1401,26 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1413
1401
  }), n.value = !1;
1414
1402
  }
1415
1403
  }
1416
- return Ge(o, (s) => {
1404
+ return Ye(o, (s) => {
1417
1405
  s && b(s);
1418
1406
  }), (s, x) => {
1419
- const U = C("FmCircularProgress"), I = C("FmIcon"), B = C("FmButton");
1420
- return f(), T("div", En, [
1421
- m("div", Un, A(d(g)("inventory.ingredient.import.uploadDescription")), 1),
1422
- c(ht, {
1407
+ const U = C("FmCircularProgress"), I = C("FmIcon"), N = C("FmButton");
1408
+ return f(), T("div", $n, [
1409
+ m("div", En, A(d(g)("inventory.ingredient.import.uploadDescription")), 1),
1410
+ c(bt, {
1423
1411
  class: ee({
1424
1412
  "w-full": !0,
1425
1413
  "h-[200px]": !o.value
1426
1414
  }),
1427
1415
  accept: ".xlsx",
1428
- onFileUpload: x[0] || (x[0] = (F) => o.value = F),
1416
+ onFileUpload: x[0] || (x[0] = (w) => o.value = w),
1429
1417
  label: d(g)("inventory.ingredient.import.uploadTemplate"),
1430
1418
  "button-label": d(g)("inventory.ingredient.import.selectFile")
1431
- }, We({ _: 2 }, [
1419
+ }, Ge({ _: 2 }, [
1432
1420
  o.value ? {
1433
1421
  name: "default",
1434
- fn: V(({ openFileDialog: F }) => [
1435
- m("div", Rn, [
1422
+ fn: V(({ openFileDialog: w }) => [
1423
+ m("div", Un, [
1436
1424
  m("div", {
1437
1425
  class: ee([
1438
1426
  "fm-corner-radius-md p-16 flex items-center gap-16",
@@ -1443,11 +1431,11 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1443
1431
  }
1444
1432
  ])
1445
1433
  }, [
1446
- n.value ? (f(), P(U, {
1434
+ n.value ? (f(), B(U, {
1447
1435
  key: 0,
1448
1436
  size: "md",
1449
1437
  color: "neutral-gray-200"
1450
- })) : (f(), P(I, {
1438
+ })) : (f(), B(I, {
1451
1439
  key: 1,
1452
1440
  name: h.value ? "error" : "attach_file",
1453
1441
  outline: "",
@@ -1462,19 +1450,19 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1462
1450
  }
1463
1451
  ])
1464
1452
  }, [
1465
- m("div", Tn, A(o.value.name), 1)
1453
+ m("div", Rn, A(o.value.name), 1)
1466
1454
  ], 2),
1467
- n.value ? O("", !0) : (f(), T("div", An, [
1468
- c(B, {
1455
+ n.value ? j("", !0) : (f(), T("div", Tn, [
1456
+ c(N, {
1469
1457
  label: d(g)("inventory.ingredient.import.replaceFile"),
1470
1458
  variant: h.value ? "destructive" : "secondary",
1471
1459
  "prepend-icon": h.value ? void 0 : "autorenew",
1472
- onClick: F
1460
+ onClick: w
1473
1461
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1474
1462
  ]))
1475
1463
  ], 2),
1476
- l.value.length ? (f(), T("div", Dn, [
1477
- (f(!0), T(X, null, ie(l.value, (v, R) => (f(), T("div", {
1464
+ l.value.length ? (f(), T("div", An, [
1465
+ (f(!0), T(X, null, re(l.value, (v, R) => (f(), T("div", {
1478
1466
  key: R,
1479
1467
  class: "flex gap-8 items-center"
1480
1468
  }, [
@@ -1483,49 +1471,49 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1483
1471
  size: "sm",
1484
1472
  color: "system-error-300"
1485
1473
  }),
1486
- m("div", Pn, A(v), 1)
1474
+ m("div", Dn, A(v), 1)
1487
1475
  ]))), 128))
1488
- ])) : O("", !0)
1476
+ ])) : j("", !0)
1489
1477
  ])
1490
1478
  ]),
1491
1479
  key: "0"
1492
1480
  } : void 0
1493
1481
  ]), 1032, ["class", "label", "button-label"]),
1494
- k.value ? (f(), T("div", Bn, [
1495
- m("div", Nn, A(d(g)("inventory.ingredient.import.summary")), 1),
1496
- (f(!0), T(X, null, ie(i.value, (F) => (f(), P(qe, {
1497
- key: F.sku._id,
1498
- code: F.sku.code,
1499
- name: F.sku.name,
1500
- errors: F.errors,
1482
+ k.value ? (f(), T("div", Pn, [
1483
+ m("div", Bn, A(d(g)("inventory.ingredient.import.summary")), 1),
1484
+ (f(!0), T(X, null, re(i.value, (w) => (f(), B(qe, {
1485
+ key: w.sku._id,
1486
+ code: w.sku.code,
1487
+ name: w.sku.name,
1488
+ errors: w.errors,
1501
1489
  type: "create"
1502
1490
  }, null, 8, ["code", "name", "errors"]))), 128)),
1503
- (f(!0), T(X, null, ie(a.value, (F) => (f(), P(qe, {
1504
- key: F.sku._id,
1505
- code: F.sku.code,
1506
- name: F.sku.name,
1507
- errors: F.errors,
1491
+ (f(!0), T(X, null, re(a.value, (w) => (f(), B(qe, {
1492
+ key: w.sku._id,
1493
+ code: w.sku.code,
1494
+ name: w.sku.name,
1495
+ errors: w.errors,
1508
1496
  type: "update"
1509
1497
  }, null, 8, ["code", "name", "errors"]))), 128))
1510
- ])) : O("", !0)
1498
+ ])) : j("", !0)
1511
1499
  ]);
1512
1500
  };
1513
1501
  }
1514
- }), Ln = { class: "flex flex-col py-8" }, Hn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, On = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lo = /* @__PURE__ */ ne({
1502
+ }), zn = { class: "flex flex-col py-8" }, Ln = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Hn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, oo = /* @__PURE__ */ te({
1515
1503
  __name: "IngredientsView",
1516
1504
  setup(u) {
1517
- const o = oe(), y = S(() => o.skus), r = xt(), n = et(), l = Ve(), i = Ee(), { t: a } = le(), { createIngredient: h, updateIngredient: k } = Ie(), { ingredientDialogProps: g, ingredientViewLoading: b } = Et(Ie()), { columnDefs: s } = At();
1505
+ const o = ne(), y = S(() => o.skus), r = _t(), n = Xe(), l = ke(), i = Ie(), { t: a } = oe(), { createIngredient: h, updateIngredient: k } = Fe(), { ingredientDialogProps: g, ingredientViewLoading: b } = $t(Fe()), { columnDefs: s } = Tt();
1518
1506
  function x(D) {
1519
1507
  switch (D) {
1520
1508
  case "add":
1521
1509
  return i.isEnabled ? void 0 : h();
1522
1510
  case "import":
1523
- return de();
1511
+ return se();
1524
1512
  case "export":
1525
- return J();
1513
+ return Q();
1526
1514
  }
1527
1515
  }
1528
- const U = Y(""), I = Y(!1), B = S(() => I.value || b.value), { breakpoints: F } = Ft(), v = S(() => F.value.xs || F.value.sm), R = S(() => v.value ? 10 : 20), Z = kt(), K = Y(!1), L = [
1516
+ const U = q(""), I = q(!1), N = S(() => I.value || b.value), { breakpoints: w } = wt(), v = S(() => w.value.xs || w.value.sm), R = S(() => v.value ? 10 : 20), J = xt(), Z = q(!1), L = [
1529
1517
  {
1530
1518
  value: "import",
1531
1519
  label: a("common.import")
@@ -1535,12 +1523,12 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1535
1523
  label: a("common.export")
1536
1524
  }
1537
1525
  ];
1538
- function j(D) {
1539
- switch (K.value = !1, D) {
1526
+ function Y(D) {
1527
+ switch (Z.value = !1, D) {
1540
1528
  case "import":
1541
- return de();
1529
+ return se();
1542
1530
  case "export":
1543
- return J();
1531
+ return Q();
1544
1532
  }
1545
1533
  }
1546
1534
  const H = S(() => [
@@ -1555,18 +1543,18 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1555
1543
  ],
1556
1544
  { label: a("common.export"), value: "export" }
1557
1545
  ]);
1558
- function J() {
1559
- const D = kn();
1546
+ function Q() {
1547
+ const D = xn();
1560
1548
  l.open({
1561
1549
  title: a("inventory.ingredient.export.success"),
1562
1550
  message: a("inventory.ingredient.export.filename", [D]),
1563
1551
  type: "success"
1564
1552
  });
1565
1553
  }
1566
- function de() {
1554
+ function se() {
1567
1555
  n.open({
1568
1556
  title: a("inventory.ingredient.import.title"),
1569
- contentComponent: zn,
1557
+ contentComponent: Nn,
1570
1558
  overlay: !0,
1571
1559
  closeButton: !0,
1572
1560
  primaryActions: {
@@ -1606,29 +1594,29 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1606
1594
  });
1607
1595
  return;
1608
1596
  }
1609
- n.close(), ge(D);
1610
- }).onTertiary(Vn);
1597
+ n.close(), ye(D);
1598
+ }).onTertiary(kn);
1611
1599
  }
1612
- async function ge(D) {
1600
+ async function ye(D) {
1613
1601
  I.value = !0;
1614
1602
  try {
1615
1603
  const $ = [
1616
- ...D.importCreateResult.map(({ sku: N }) => ({ type: "create", sku: N })),
1617
- ...D.importUpdateResult.map(({ sku: N }) => ({ type: "update", sku: N }))
1618
- ], ue = 100;
1619
- let ae = 0;
1620
- const re = () => {
1621
- ae += ue, l.open({
1604
+ ...D.importCreateResult.map(({ sku: P }) => ({ type: "create", sku: P })),
1605
+ ...D.importUpdateResult.map(({ sku: P }) => ({ type: "update", sku: P }))
1606
+ ], ie = 100;
1607
+ let le = 0;
1608
+ const de = () => {
1609
+ le += ie, l.open({
1622
1610
  title: a("inventory.ingredient.import.progress", [
1623
- Math.min(ae, $.length),
1611
+ Math.min(le, $.length),
1624
1612
  $.length
1625
1613
  ])
1626
1614
  });
1627
1615
  };
1628
- for (const N of $.chunk(100))
1629
- re(), await o.importSkus({
1630
- create: N.filter((z) => z.type === "create").map((z) => z.sku),
1631
- update: N.filter((z) => z.type === "update").map((z) => z.sku)
1616
+ for (const P of $.chunk(100))
1617
+ de(), await o.importSkus({
1618
+ create: P.filter((z) => z.type === "create").map((z) => z.sku),
1619
+ update: P.filter((z) => z.type === "update").map((z) => z.sku)
1632
1620
  });
1633
1621
  l.open({
1634
1622
  title: a("inventory.ingredient.import.success"),
@@ -1645,8 +1633,8 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1645
1633
  }
1646
1634
  }
1647
1635
  return (D, $) => {
1648
- const ue = C("FmTable"), ae = C("FmCollapsibleTabs"), re = C("FmBottomSheet");
1649
- return f(), P(Vt, {
1636
+ const ie = C("FmTable"), le = C("FmCollapsibleTabs"), de = C("FmBottomSheet");
1637
+ return f(), B(kt, {
1650
1638
  title: d(a)("inventory.ingredient.title"),
1651
1639
  actions: H.value,
1652
1640
  "onClick:action": x
@@ -1661,40 +1649,40 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1661
1649
  }
1662
1650
  ])
1663
1651
  }, [
1664
- c(St, {
1652
+ c(Vt, {
1665
1653
  searchable: "",
1666
1654
  search: U.value,
1667
- "onUpdate:search": $[0] || ($[0] = (N) => U.value = N)
1655
+ "onUpdate:search": $[0] || ($[0] = (P) => U.value = P)
1668
1656
  }, null, 8, ["search"]),
1669
- c(ue, {
1670
- style: st(d(Z).tableHeight),
1657
+ c(ie, {
1658
+ style: rt(d(J).tableHeight),
1671
1659
  "column-defs": d(s),
1672
1660
  "row-data": y.value,
1673
1661
  "search-value": U.value,
1674
- loading: !d(r)._currentLocation || B.value,
1662
+ loading: !d(r)._currentLocation || N.value,
1675
1663
  "loading-text": "Loading",
1676
- onRowClick: $[1] || ($[1] = (N) => d(k)(N.original)),
1664
+ onRowClick: $[1] || ($[1] = (P) => d(k)(P.original)),
1677
1665
  "page-size": R.value
1678
1666
  }, {
1679
- "list-row": V((N) => [
1680
- c(Ct, {
1681
- row: N,
1667
+ "list-row": V((P) => [
1668
+ c(St, {
1669
+ row: P,
1682
1670
  onRowClick: d(k)
1683
- }, We({
1671
+ }, Ge({
1684
1672
  default: V((z) => {
1685
- var te, be, me, e, t, p, _, E, w, q;
1673
+ var ge, ue, t, e, p, _, E, F, O, G;
1686
1674
  return [
1687
- m("div", Ln, [
1688
- m("div", Hn, [
1689
- c(d(Oe), {
1690
- render: (me = (be = (te = z.code) == null ? void 0 : te.column) == null ? void 0 : be.columnDef) == null ? void 0 : me.cell,
1691
- props: (t = (e = z.code) == null ? void 0 : e.getContext) == null ? void 0 : t.call(e)
1675
+ m("div", zn, [
1676
+ m("div", Ln, [
1677
+ c(d(He), {
1678
+ render: (t = (ue = (ge = z.code) == null ? void 0 : ge.column) == null ? void 0 : ue.columnDef) == null ? void 0 : t.cell,
1679
+ props: (p = (e = z.code) == null ? void 0 : e.getContext) == null ? void 0 : p.call(e)
1692
1680
  }, null, 8, ["render", "props"])
1693
1681
  ]),
1694
- m("div", On, [
1695
- c(d(Oe), {
1696
- render: (E = (_ = (p = z.name) == null ? void 0 : p.column) == null ? void 0 : _.columnDef) == null ? void 0 : E.cell,
1697
- props: (q = (w = z.name) == null ? void 0 : w.getContext) == null ? void 0 : q.call(w)
1682
+ m("div", Hn, [
1683
+ c(d(He), {
1684
+ render: (F = (E = (_ = z.name) == null ? void 0 : _.column) == null ? void 0 : E.columnDef) == null ? void 0 : F.cell,
1685
+ props: (G = (O = z.name) == null ? void 0 : O.getContext) == null ? void 0 : G.call(O)
1698
1686
  }, null, 8, ["render", "props"])
1699
1687
  ])
1700
1688
  ])
@@ -1714,20 +1702,20 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1714
1702
  _: 1
1715
1703
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
1716
1704
  ], 2),
1717
- (f(), P(Ne, { to: "body" }, [
1718
- c(yn, it(dt(d(g))), null, 16)
1705
+ (f(), B(Pe, { to: "body" }, [
1706
+ c(fn, st(it(d(g))), null, 16)
1719
1707
  ])),
1720
- (f(), P(Ne, { to: "body" }, [
1721
- c(re, {
1708
+ (f(), B(Pe, { to: "body" }, [
1709
+ c(de, {
1722
1710
  "dismiss-away": "",
1723
- modelValue: K.value,
1724
- "onUpdate:modelValue": $[3] || ($[3] = (N) => K.value = N)
1711
+ modelValue: Z.value,
1712
+ "onUpdate:modelValue": $[3] || ($[3] = (P) => Z.value = P)
1725
1713
  }, {
1726
1714
  default: V(() => [
1727
- c(ae, {
1715
+ c(le, {
1728
1716
  class: "pb-8",
1729
1717
  items: L,
1730
- "onUpdate:modelValue": $[2] || ($[2] = (N) => j(N))
1718
+ "onUpdate:modelValue": $[2] || ($[2] = (P) => Y(P))
1731
1719
  })
1732
1720
  ]),
1733
1721
  _: 1
@@ -1740,5 +1728,5 @@ const wn = { class: "flex items-center gap-12 pl-8" }, Fn = { class: "flex flex-
1740
1728
  }
1741
1729
  });
1742
1730
  export {
1743
- lo as default
1731
+ oo as default
1744
1732
  };