@feedmepos/mf-inventory-portal 0.0.23-dev.24 → 0.0.23-dev.26

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 (49) hide show
  1. package/dist/{App-dQy0_X6Q.js → App-C0hXAs5E.js} +49 -45
  2. package/dist/{ApprovalView-CxwAuXae.js → ApprovalView-Db5Aq3gK.js} +15 -15
  3. package/dist/{BindingsDialog-BX8J03Uc.js → BindingsDialog-dKNKrWKv.js} +9 -9
  4. package/dist/{BindingsPicker-CAW_3sSv.js → BindingsPicker-dN1bNnc0.js} +5 -5
  5. package/dist/{BindingsTable-7UmxSmdW.js → BindingsTable-BA461fcU.js} +8 -8
  6. package/dist/{ClosingDraftView-DukJAMlK.js → ClosingDraftView-aRHVKTA6.js} +68 -69
  7. package/dist/{ClosingTemplateView-Dm7_gMTo.js → ClosingTemplateView-BYnC4Whw.js} +58 -61
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DN3N20Nb.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BdjeCWX1.js} +13 -13
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BrPRiS_u.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CP2euPwM.js} +46 -46
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bln1lReW.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C4aYGbW2.js} +7 -7
  11. package/dist/{IngredientGroupView-BKIJHeh9.js → IngredientGroupView-vdG6npct.js} +40 -40
  12. package/dist/{IngredientsView-Blnohl3I.js → IngredientsView-DWRAoLHx.js} +207 -210
  13. package/dist/{IntegrationView-Dna4bUA7.js → IntegrationView-Dp_A-Swf.js} +89 -90
  14. package/dist/{InventoryBindingForm-D6HSF8Wn.js → InventoryBindingForm-D_wSUUKv.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CnWvwNjJ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-2Mnqz6HN.js} +27 -27
  16. package/dist/{InventoryBindingSummary-CNNCv8NX.js → InventoryBindingSummary-oyRdM7Pd.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CrMkMTAt.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CSabNdfV.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Cw3E2NKS.js → PremiumBadge.vue_vue_type_script_setup_true_lang-tu1Al7wM.js} +17 -18
  19. package/dist/{PurchaseOrderPrintPreview-PEN03dZK.js → PurchaseOrderPrintPreview-B4m8t90I.js} +1 -1
  20. package/dist/{ReceiveRequestView-rTUhjMLY.js → ReceiveRequestView-DIJb_dU2.js} +26 -27
  21. package/dist/{RecipeView-V1hx1AUG.js → RecipeView-Ch5KMGLJ.js} +47 -48
  22. package/dist/{StockView-B5nDn8nO.js → StockView-BVuzsMG7.js} +7 -7
  23. package/dist/{SupplierView-DyyRxm6k.js → SupplierView-DEC2LmtN.js} +203 -206
  24. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D6oZOwHL.js → TransferDetails.vue_vue_type_script_setup_true_lang-9UZWws3P.js} +61 -62
  25. package/dist/{TransferTemplateView-OTR9Re51.js → TransferTemplateView-DAMQ_Whn.js} +144 -145
  26. package/dist/{UnitView-DGhm1JXD.js → UnitView-CFwHRgQ-.js} +3 -3
  27. package/dist/{WarehouseView-DMAvFisd.js → WarehouseView-HE71bVOX.js} +52 -52
  28. package/dist/app-CRSuR04o.js +84133 -0
  29. package/dist/app.js +1 -1
  30. package/dist/{decimal-DuJEFEYp.js → decimal-B5DqWjel.js} +1 -1
  31. package/dist/{feature-BRqas45f.js → feature-DxNphYNO.js} +1 -1
  32. package/dist/{format-unit-display-G6VtlQe7.js → format-unit-display-D40MKAIU.js} +50 -53
  33. package/dist/{index-D3f51k-I.js → index-BWDsx2Ik.js} +1 -1
  34. package/dist/{stock-DZkj2LE0.js → stock-BAPZYfON.js} +1 -1
  35. package/dist/style.css +1 -1
  36. package/dist/{supplier-Cm5Cw3u7.js → supplier-Bp7xaTFX.js} +1 -1
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{use-inventory-binding-dialog-DCt0wUiw.js → use-inventory-binding-dialog-cxY29PPx.js} +1 -1
  39. package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +2 -0
  40. package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +18 -0
  41. package/dist/views/adjustment-template/import/export.d.ts +60 -0
  42. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1 -1
  43. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +1 -1
  44. package/package.json +1 -1
  45. package/dist/FmDroppableField-BqZcDO2v.js +0 -154
  46. package/dist/app-DQRbwx-z.js +0 -58903
  47. package/dist/netsuite-D4b5JceM.js +0 -251
  48. package/dist/xlsx-9Gc42bxv.js +0 -24004
  49. package/dist/xlsx.util-CEvUL8mk.js +0 -78
@@ -1,20 +1,17 @@
1
- import { ref as q, defineComponent as me, computed as V, resolveComponent as $, openBlock as v, createBlock as A, withCtx as S, createVNode as f, unref as d, createElementBlock as R, Fragment as J, createElementVNode as u, createCommentVNode as H, onMounted as nt, watch as ze, normalizeClass as le, createTextVNode as He, toDisplayString as N, renderList as te, isRef as Ee, createSlots as Oe, normalizeStyle as ot, Teleport as Re, normalizeProps as lt, guardReactiveProps as rt } from "vue";
2
- import { a as re, c as W, d as je, S as at, e as st, D as Ae, f as ge, A as be, h as Ye, i as he, t as qe, j as ve, k as xe, U as it, M as ut, l as De, C as Ve, m as Te, n as dt, o as mt, I as ct, u as pt, p as vt, q as ft, r as yt, s as gt, v as Pe } from "./app-DQRbwx-z.js";
3
- import { useDialog as Ge, useSnackbar as _e, useProxiedModel as Be, useDialogChild as bt, useBreakpoints as ht } from "@feedmepos/ui-library";
4
- import { i as _t, _ as xt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { useI18n as ae, useCoreStore as fe } from "@feedmepos/mf-common";
6
- import { defineStore as Vt, storeToRefs as kt } from "pinia";
7
- import { g as St, _ as ke, S as Se } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
- import { _ as Ct } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CnWvwNjJ.js";
9
- import { _ as Ce } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bln1lReW.js";
10
- import { u as We } from "./feature-BRqas45f.js";
1
+ import { ref as q, defineComponent as me, computed as V, resolveComponent as $, openBlock as v, createBlock as A, withCtx as S, createVNode as f, unref as d, createElementBlock as R, Fragment as J, createElementVNode as u, createCommentVNode as H, onMounted as nt, watch as ze, normalizeClass as le, createTextVNode as He, toDisplayString as N, renderList as te, isRef as Ue, createSlots as Oe, normalizeStyle as ot, Teleport as Re, normalizeProps as lt, guardReactiveProps as at } from "vue";
2
+ import { a as ae, d as W, e as je, S as rt, f as st, D as Ae, h as ge, A as be, i as Ye, j as he, t as qe, k as ve, l as xe, U as it, M as ut, m as De, C as Ve, b as dt, n as Te, o as Ge, p as mt, q as We, r as ct, s as pt, I as vt, v as ft, w as yt, u as gt, x as bt, y as ht, z as _t, B as xt, E as Pe } from "./app-CRSuR04o.js";
3
+ import { useDialog as Ke, useSnackbar as _e, useProxiedModel as Be, useDialogChild as Vt, useBreakpoints as kt } from "@feedmepos/ui-library";
4
+ import { i as St, _ as Ct } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
+ import { useI18n as re, useCoreStore as fe } from "@feedmepos/mf-common";
6
+ import { defineStore as wt, storeToRefs as Mt } from "pinia";
7
+ import { g as It, _ as ke, S as Se } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
8
+ import { _ as Ft } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-2Mnqz6HN.js";
9
+ import { _ as Ce } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-C4aYGbW2.js";
10
+ import { u as Je } from "./feature-DxNphYNO.js";
11
11
  import { _ as we } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
- import { u as wt } from "./netsuite-D4b5JceM.js";
13
- import { t as Ke, d as Je, s as Mt, r as Ft } from "./xlsx.util-CEvUL8mk.js";
14
- import { F as It } from "./FmDroppableField-BqZcDO2v.js";
15
12
  import "./array-hChJVZLE.js";
16
- const Me = Vt("ingredientForm", function() {
17
- const r = Ge(), g = _e(), s = re(), n = q(!1), { t: l } = ae(), o = q();
13
+ const Me = wt("ingredientForm", function() {
14
+ const a = Ke(), g = _e(), s = ae(), n = q(!1), { t: l } = re(), o = q();
18
15
  function m() {
19
16
  const b = {
20
17
  unit: {},
@@ -46,9 +43,9 @@ const Me = Vt("ingredientForm", function() {
46
43
  type: "success"
47
44
  });
48
45
  } catch (i) {
49
- i instanceof at && _t(i) ? r.open({
46
+ i instanceof rt && St(i) ? a.open({
50
47
  title: "Cannot delete ingredient",
51
- contentComponent: xt,
48
+ contentComponent: Ct,
52
49
  contentComponentProps: {
53
50
  subject: (b == null ? void 0 : b.name) ?? "",
54
51
  items: i.errorResponse.message
@@ -67,7 +64,7 @@ const Me = Vt("ingredientForm", function() {
67
64
  }
68
65
  }
69
66
  function x(b) {
70
- r.open({
67
+ a.open({
71
68
  title: l("inventory.ingredient.delete.title", [(b == null ? void 0 : b.name) ?? ""]),
72
69
  closeButton: !1,
73
70
  message: l("inventory.ingredient.delete.message"),
@@ -91,15 +88,15 @@ const Me = Vt("ingredientForm", function() {
91
88
  };
92
89
  });
93
90
  function $t() {
94
- const { updateIngredient: a, deleteIngredient: r } = Me(), { t: g } = ae();
91
+ const { updateIngredient: r, deleteIngredient: a } = Me(), { t: g } = re();
95
92
  async function s(l, o) {
96
93
  const m = je(o);
97
94
  if (l === ge.Edit) {
98
- await a(m);
95
+ await r(m);
99
96
  return;
100
97
  }
101
98
  if (l === ge.Delete) {
102
- await r(m);
99
+ await a(m);
103
100
  return;
104
101
  }
105
102
  }
@@ -154,7 +151,7 @@ function $t() {
154
151
  }
155
152
  ] };
156
153
  }
157
- const Ut = /* @__PURE__ */ me({
154
+ const Et = /* @__PURE__ */ me({
158
155
  __name: "ConvertForm",
159
156
  props: {
160
157
  modelValue: {},
@@ -162,14 +159,14 @@ const Ut = /* @__PURE__ */ me({
162
159
  disabled: { type: Boolean }
163
160
  },
164
161
  emits: ["update:modelValue"],
165
- setup(a, { emit: r }) {
166
- const g = a, s = V(() => {
162
+ setup(r, { emit: a }) {
163
+ const g = r, s = V(() => {
167
164
  var i;
168
165
  return (i = g.rootValue) == null ? void 0 : i.unit;
169
166
  }), n = V(() => {
170
167
  var i;
171
168
  return (i = g.rootValue) == null ? void 0 : i._id;
172
- }), l = r, { t: o } = ae(), m = V({
169
+ }), l = a, { t: o } = re(), m = V({
173
170
  get() {
174
171
  return !!g.modelValue;
175
172
  },
@@ -179,7 +176,7 @@ const Ut = /* @__PURE__ */ me({
179
176
  inventoryBindings: []
180
177
  }) : l("update:modelValue", null);
181
178
  }
182
- }), y = V(() => St(s.value));
179
+ }), y = V(() => It(s.value));
183
180
  function _(i) {
184
181
  const p = g.modelValue ?? {};
185
182
  p.measurement = i ? `${i}` : null, l("update:modelValue", p);
@@ -205,7 +202,7 @@ const Ut = /* @__PURE__ */ me({
205
202
  f(D, {
206
203
  value: "",
207
204
  "model-value": m.value,
208
- "onUpdate:modelValue": p[0] || (p[0] = (F) => m.value = F),
205
+ "onUpdate:modelValue": p[0] || (p[0] = (I) => m.value = I),
209
206
  label: d(o)("inventory.ingredient.convertible.title"),
210
207
  sublabel: d(o)("inventory.ingredient.convertible.subtitle"),
211
208
  labelPlacement: "right"
@@ -219,7 +216,7 @@ const Ut = /* @__PURE__ */ me({
219
216
  items: y.value
220
217
  }, null, 8, ["label", "modelValue", "items"])
221
218
  ]),
222
- f(Ct, {
219
+ f(Ft, {
223
220
  id: n.value,
224
221
  "model-value": ((M = i.modelValue) == null ? void 0 : M.inventoryBindings) ?? [],
225
222
  "onUpdate:modelValue": x,
@@ -240,14 +237,14 @@ function de() {
240
237
  mid: 14
241
238
  };
242
239
  }
243
- const Et = { class: "flex gap-8" }, Rt = { class: "flex-1" }, At = { class: "flex-1" }, Dt = { class: "text-fm-color-typo-secondary" }, Tt = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Pt = {
240
+ const Ut = { class: "flex gap-8" }, Rt = { class: "flex-1" }, At = { class: "flex-1" }, Dt = { class: "text-fm-color-typo-secondary" }, Tt = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Pt = {
244
241
  type: "button",
245
242
  class: "inline-flex h-32 items-center"
246
243
  }, Bt = {
247
244
  key: 2,
248
245
  class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
249
246
  }, Nt = { class: "flex flex-col gap-12" }, Lt = { class: "flex flex-col gap-4" }, zt = { class: "fm-typo-en-title-sm-600" }, Ht = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ot = { class: "flex flex-col gap-4" }, jt = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Yt = { class: "flex-1 p-12 flex flex-col gap-8" }, qt = { class: "mx-auto" }, Gt = { class: "flex flex-col" }, Wt = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Kt = { 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" }, Zt = { 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" };
250
- var Fe = /* @__PURE__ */ ((a) => (a.Daily = "Daily", a.Consumables = "Consumables", a.ShortTerm = "Short term", a.Kitchen = "Kitchen", a))(Fe || {});
247
+ var Ie = /* @__PURE__ */ ((r) => (r.Daily = "Daily", r.Consumables = "Consumables", r.ShortTerm = "Short term", r.Kitchen = "Kitchen", r))(Ie || {});
251
248
  const on = /* @__PURE__ */ me({
252
249
  __name: "IngredientForm",
253
250
  props: {
@@ -256,9 +253,9 @@ const on = /* @__PURE__ */ me({
256
253
  disabled: { type: Boolean }
257
254
  },
258
255
  emits: ["update:modelValue", "click:submit"],
259
- setup(a, { expose: r, emit: g }) {
256
+ setup(r, { expose: a, emit: g }) {
260
257
  var oe;
261
- const { t: s } = ae(), n = a, l = g, o = re(), m = fe(), y = We();
258
+ const { t: s } = re(), n = r, l = g, o = ae(), m = fe(), y = Je();
262
259
  function _(e) {
263
260
  if (e.length === 0) return;
264
261
  const t = e[0], c = n.modelValue ?? {
@@ -303,7 +300,7 @@ const on = /* @__PURE__ */ me({
303
300
  return e ? +Ye(e) : 0;
304
301
  },
305
302
  set(e) {
306
- var c, h, U, I;
303
+ var c, h, E, F;
307
304
  const t = n.modelValue ? {
308
305
  ...n.modelValue
309
306
  } : {};
@@ -313,7 +310,7 @@ const on = /* @__PURE__ */ me({
313
310
  precision: 2,
314
311
  currency: ((c = he(m.currentCountry.value)) == null ? void 0 : c.currency) ?? "MYR"
315
312
  },
316
- measurement: (I = (U = (h = n.modelValue) == null ? void 0 : h.unit) == null ? void 0 : U.measurements) == null ? void 0 : I.find(
313
+ measurement: (F = (E = (h = n.modelValue) == null ? void 0 : h.unit) == null ? void 0 : E.measurements) == null ? void 0 : F.find(
317
314
  (Q) => {
318
315
  var K;
319
316
  return Q.id === ((K = n.modelValue) == null ? void 0 : K.trackingMeasurement);
@@ -326,13 +323,13 @@ const on = /* @__PURE__ */ me({
326
323
  }
327
324
  }), D = V(() => {
328
325
  var t, c, h;
329
- const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? o.units.find((U) => U);
326
+ const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? o.units.find((E) => E);
330
327
  return e ? {
331
328
  _id: e._id,
332
329
  measurement: (c = n.modelValue) == null ? void 0 : c.trackingMeasurement,
333
- name: ((h = e.measurements.find((U) => {
334
- var I;
335
- return U.id === ((I = n.modelValue) == null ? void 0 : I.trackingMeasurement);
330
+ name: ((h = e.measurements.find((E) => {
331
+ var F;
332
+ return E.id === ((F = n.modelValue) == null ? void 0 : F.trackingMeasurement);
336
333
  })) == null ? void 0 : h.name) ?? e.name
337
334
  } : null;
338
335
  }), w = V({
@@ -349,7 +346,7 @@ const on = /* @__PURE__ */ me({
349
346
  }), L = V(
350
347
  () => [
351
348
  ...new Set(
352
- o.skus.map((e) => e.operationalGroup ?? "").filter((e) => e && !Object.values(Fe).includes(e))
349
+ o.skus.map((e) => e.operationalGroup ?? "").filter((e) => e && !Object.values(Ie).includes(e))
353
350
  )
354
351
  ].sort()
355
352
  ), C = V({
@@ -371,34 +368,34 @@ const on = /* @__PURE__ */ me({
371
368
  value: { _id: t },
372
369
  displayAsSection: !1
373
370
  },
374
- ...h.map(({ id: U, name: I, abbrev: Q }) => ({
375
- label: `${I} (${Q})`,
376
- value: { _id: t, measurement: U },
371
+ ...h.map(({ id: E, name: F, abbrev: Q }) => ({
372
+ label: `${F} (${Q})`,
373
+ value: { _id: t, measurement: E },
377
374
  displayAsSection: !1
378
375
  }))
379
376
  ])
380
377
  );
381
- function F(e) {
382
- var t, c, h, U, I;
383
- return ((c = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : c._id) === ((h = e.value) == null ? void 0 : h._id) && ((U = n.modelValue) == null ? void 0 : U.trackingMeasurement) === ((I = e.value) == null ? void 0 : I.measurement);
378
+ function I(e) {
379
+ var t, c, h, E, F;
380
+ return ((c = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : c._id) === ((h = e.value) == null ? void 0 : h._id) && ((E = n.modelValue) == null ? void 0 : E.trackingMeasurement) === ((F = e.value) == null ? void 0 : F.measurement);
384
381
  }
385
382
  function P(e) {
386
383
  var Q, K;
387
384
  if (!e) return;
388
- const { _id: t, measurement: c } = e, h = c || void 0, U = o.units.find((ue) => ue._id === t);
389
- if (!U)
385
+ const { _id: t, measurement: c } = e, h = c || void 0, E = o.units.find((ue) => ue._id === t);
386
+ if (!E)
390
387
  return;
391
- const I = n.modelValue ?? {};
392
- I.unit = U, I.trackingMeasurement = h, I.convert && (I.convert.measurement = h || null), y.enableTotalCost && (I.defaultCost = {
393
- measurement: U.measurements.find((ue) => ue.id === h),
388
+ const F = n.modelValue ?? {};
389
+ F.unit = E, F.trackingMeasurement = h, F.convert && (F.convert.measurement = h || null), y.enableTotalCost && (F.defaultCost = {
390
+ measurement: E.measurements.find((ue) => ue.id === h),
394
391
  costPerUnit: {
395
- ...((Q = I.defaultCost) == null ? void 0 : Q.costPerUnit) ?? {
392
+ ...((Q = F.defaultCost) == null ? void 0 : Q.costPerUnit) ?? {
396
393
  amount: 0,
397
394
  precision: 2,
398
395
  currency: ((K = he(m.currentCountry.value)) == null ? void 0 : K.currency) ?? "MYR"
399
396
  }
400
397
  }
401
- }), l("update:modelValue", I);
398
+ }), l("update:modelValue", F);
402
399
  }
403
400
  const X = V({
404
401
  get() {
@@ -428,7 +425,7 @@ const on = /* @__PURE__ */ me({
428
425
  t.valuation = e, l("update:modelValue", t);
429
426
  }
430
427
  }), O = q();
431
- r({
428
+ a({
432
429
  validateInputs: () => {
433
430
  var e, t;
434
431
  (t = (e = O.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
@@ -456,7 +453,7 @@ const on = /* @__PURE__ */ me({
456
453
  (h) => h.from === "RECIPE"
457
454
  )) ?? [] : [];
458
455
  }
459
- ), E = V(
456
+ ), U = V(
460
457
  () => {
461
458
  var e, t, c;
462
459
  return (e = n.modelValue) != null && e._id ? ((c = o.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : c.filter((h) => h.from === "MENU")) ?? [] : [];
@@ -483,13 +480,13 @@ const on = /* @__PURE__ */ me({
483
480
  }
484
481
  const G = V(
485
482
  () => {
486
- var e, t, c, h, U, I;
483
+ var e, t, c, h, E, F;
487
484
  return ((h = (c = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : c.find(
488
485
  (Q) => {
489
486
  var K;
490
487
  return Q.id === ((K = n.modelValue) == null ? void 0 : K.trackingMeasurement);
491
488
  }
492
- )) == null ? void 0 : h.abbrev) ?? ((I = (U = n.modelValue) == null ? void 0 : U.unit) == null ? void 0 : I.abbrev);
489
+ )) == null ? void 0 : h.abbrev) ?? ((F = (E = n.modelValue) == null ? void 0 : E.unit) == null ? void 0 : F.abbrev);
493
490
  }
494
491
  ), ne = V({
495
492
  get() {
@@ -526,7 +523,7 @@ const on = /* @__PURE__ */ me({
526
523
  };
527
524
  }
528
525
  return (e, t) => {
529
- const c = $("FmTextField"), h = $("FmLabel"), U = $("FmField"), I = $("FmMenuHeader"), Q = $("FmMenuDivider"), K = $("FmMenuItem"), ue = $("FmMenu"), Ie = $("FmFormGroup"), Xe = $("FmSelect"), $e = $("FmSwitch"), Ze = $("FmIcon"), et = $("FmCard"), Ue = $("FmStepperField"), tt = $("FmForm");
526
+ const c = $("FmTextField"), h = $("FmLabel"), E = $("FmField"), F = $("FmMenuHeader"), Q = $("FmMenuDivider"), K = $("FmMenuItem"), ue = $("FmMenu"), Fe = $("FmFormGroup"), Xe = $("FmSelect"), $e = $("FmSwitch"), Ze = $("FmIcon"), et = $("FmCard"), Ee = $("FmStepperField"), tt = $("FmForm");
530
527
  return v(), A(tt, {
531
528
  disabled: e.disabled,
532
529
  ref_key: "formRef",
@@ -535,7 +532,7 @@ const on = /* @__PURE__ */ me({
535
532
  onValidationSuccess: x
536
533
  }, {
537
534
  default: S(() => [
538
- u("div", Et, [
535
+ u("div", Ut, [
539
536
  u("div", Rt, [
540
537
  f(c, {
541
538
  label: d(s)("inventory.ingredient.code"),
@@ -555,7 +552,7 @@ const on = /* @__PURE__ */ me({
555
552
  }, null, 8, ["label", "model-value", "rules"])
556
553
  ])
557
554
  ]),
558
- f(Ie, {
555
+ f(Fe, {
559
556
  "model-value": D.value,
560
557
  rules: [d(xe)()],
561
558
  "label-mark": "required"
@@ -568,7 +565,7 @@ const on = /* @__PURE__ */ me({
568
565
  default: S(({ invalid: k }) => [
569
566
  f(ue, null, {
570
567
  "menu-button": S(() => [
571
- f(U, {
568
+ f(E, {
572
569
  class: le([
573
570
  "fm-typo-en-body-lg-400",
574
571
  {
@@ -597,16 +594,16 @@ const on = /* @__PURE__ */ me({
597
594
  key: Y.label
598
595
  }, [
599
596
  Y.displayAsSection ? (v(), R(J, { key: 0 }, [
600
- f(I, {
597
+ f(F, {
601
598
  label: Y.label
602
599
  }, null, 8, ["label"]),
603
600
  f(Q)
604
601
  ], 64)) : (v(), A(K, {
605
602
  key: 1,
606
603
  label: Y.label,
607
- "model-value": F(Y),
604
+ "model-value": I(Y),
608
605
  onClick: (Nn) => P(Y.value),
609
- "x-should-scroll-into": `${F(Y)}`
606
+ "x-should-scroll-into": `${I(Y)}`
610
607
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
611
608
  ], 64))), 128))
612
609
  ], 512)
@@ -692,14 +689,14 @@ const on = /* @__PURE__ */ me({
692
689
  }, 8, ["modelValue"])
693
690
  ]),
694
691
  default: S(() => [
695
- f(I, { label: "Preset" }),
696
- (v(!0), R(J, null, te(Object.values(Fe), (k) => (v(), A(K, {
692
+ f(F, { label: "Preset" }),
693
+ (v(!0), R(J, null, te(Object.values(Ie), (k) => (v(), A(K, {
697
694
  key: k,
698
695
  label: k,
699
696
  "model-value": w.value === k,
700
697
  onClick: (Y) => w.value = k
701
698
  }, null, 8, ["label", "model-value", "onClick"]))), 128)),
702
- L.value.length ? (v(), A(I, {
699
+ L.value.length ? (v(), A(F, {
703
700
  key: 0,
704
701
  label: "Custom"
705
702
  })) : H("", !0),
@@ -715,7 +712,7 @@ const on = /* @__PURE__ */ me({
715
712
  ]),
716
713
  _: 1
717
714
  }),
718
- f(Ut, {
715
+ f(Et, {
719
716
  "model-value": X.value,
720
717
  "onUpdate:modelValue": t[6] || (t[6] = (k) => X.value = k),
721
718
  "root-value": e.modelValue
@@ -739,10 +736,10 @@ const on = /* @__PURE__ */ me({
739
736
  name: d(s)("inventory.ingredient.bindedItems.recipe"),
740
737
  bindings: T.value
741
738
  }, null, 8, ["name", "bindings"])) : H("", !0),
742
- z.value && E.value.length ? (v(), A(Ce, {
739
+ z.value && U.value.length ? (v(), A(Ce, {
743
740
  key: 2,
744
741
  name: d(s)("inventory.ingredient.bindedItems.menu"),
745
- bindings: E.value
742
+ bindings: U.value
746
743
  }, null, 8, ["name", "bindings"])) : H("", !0)
747
744
  ])) : H("", !0),
748
745
  u("div", Nt, [
@@ -756,7 +753,7 @@ const on = /* @__PURE__ */ me({
756
753
  u("div", Ht, N(d(s)("inventory.ingredient.threshold.subtitle")), 1)
757
754
  ]),
758
755
  u("div", Ot, [
759
- f(Ie, {
756
+ f(Fe, {
760
757
  "model-value": { low: ne.value, mid: ee.value },
761
758
  rules: [ye()]
762
759
  }, null, 8, ["model-value", "rules"]),
@@ -770,7 +767,7 @@ const on = /* @__PURE__ */ me({
770
767
  ]),
771
768
  u("div", Gt, [
772
769
  u("div", Wt, N(d(s)("inventory.ingredient.threshold.whenRemaining")), 1),
773
- f(Ue, {
770
+ f(Ee, {
774
771
  modelValue: ne.value,
775
772
  "onUpdate:modelValue": t[8] || (t[8] = (k) => ne.value = k),
776
773
  rules: [d(be)(0)]
@@ -803,7 +800,7 @@ const on = /* @__PURE__ */ me({
803
800
  ]),
804
801
  u("div", Qt, [
805
802
  u("div", Xt, N(d(s)("inventory.ingredient.threshold.whenRemaining")), 1),
806
- f(Ue, {
803
+ f(Ee, {
807
804
  modelValue: ee.value,
808
805
  "onUpdate:modelValue": t[9] || (t[9] = (k) => ee.value = k),
809
806
  rules: [d(be)(0)]
@@ -846,10 +843,10 @@ const on = /* @__PURE__ */ me({
846
843
  }, 8, ["disabled"]);
847
844
  };
848
845
  }
849
- }), ln = { class: "flex flex-col gap-32" }, rn = {
846
+ }), ln = { class: "flex flex-col gap-32" }, an = {
850
847
  key: 0,
851
848
  class: "flex flex-col gap-12"
852
- }, an = { class: "flex flex-col gap-4" }, sn = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, un = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, dn = { class: "flex gap-4" }, mn = /* @__PURE__ */ me({
849
+ }, rn = { class: "flex flex-col gap-4" }, sn = { class: "flex-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, un = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, dn = { class: "flex gap-4" }, mn = /* @__PURE__ */ me({
853
850
  __name: "IngredientDialog",
854
851
  props: {
855
852
  show: { type: Boolean },
@@ -857,17 +854,17 @@ const on = /* @__PURE__ */ me({
857
854
  mode: { default: W.READ }
858
855
  },
859
856
  emits: ["update:show"],
860
- setup(a) {
861
- const r = a, g = re(), s = wt(), n = _e(), { t: l } = ae(), o = Be(r, "show"), m = Be(r, "unit"), y = V(
857
+ setup(r) {
858
+ const a = r, g = ae(), s = dt(), n = _e(), { t: l } = re(), o = Be(a, "show"), m = Be(a, "unit"), y = V(
862
859
  () => {
863
- var F;
864
- return s.isEnabled && s.netSuiteItemBySkuId.has((F = r.unit) == null ? void 0 : F._id);
860
+ var I;
861
+ return s.isEnabled && s.netSuiteItemBySkuId.has((I = a.unit) == null ? void 0 : I._id);
865
862
  }
866
863
  ), _ = V(() => {
867
- var F;
868
- return !((F = r.unit) != null && F._id) || !y.value;
864
+ var I;
865
+ return !((I = a.unit) != null && I._id) || !y.value;
869
866
  }), x = V(() => {
870
- switch (r.mode) {
867
+ switch (a.mode) {
871
868
  case W.READ:
872
869
  return "";
873
870
  case W.UPDATE:
@@ -877,7 +874,7 @@ const on = /* @__PURE__ */ me({
877
874
  }
878
875
  return "";
879
876
  }), b = V(() => {
880
- switch (r.mode) {
877
+ switch (a.mode) {
881
878
  case W.READ:
882
879
  return "";
883
880
  case W.UPDATE:
@@ -895,8 +892,8 @@ const on = /* @__PURE__ */ me({
895
892
  message: l("inventory.ingredient.create.success", { name: m.value.name }),
896
893
  type: "success"
897
894
  });
898
- } catch (F) {
899
- F instanceof Te || n.open({
895
+ } catch (I) {
896
+ I instanceof Te || n.open({
900
897
  title: l("inventory.ingredient.create.error.title"),
901
898
  message: l("inventory.ingredient.create.error.message"),
902
899
  type: "error"
@@ -913,8 +910,8 @@ const on = /* @__PURE__ */ me({
913
910
  message: l("inventory.ingredient.update.success", { name: m.value.name }),
914
911
  type: "success"
915
912
  });
916
- } catch (F) {
917
- F instanceof Te || n.open({
913
+ } catch (I) {
914
+ I instanceof Te || n.open({
918
915
  title: l("inventory.ingredient.update.error.title"),
919
916
  message: l("inventory.ingredient.update.error.message"),
920
917
  type: "error"
@@ -924,11 +921,11 @@ const on = /* @__PURE__ */ me({
924
921
  }
925
922
  }
926
923
  function L() {
927
- var F, P;
928
- (P = (F = i.value) == null ? void 0 : F.validateInputs) == null || P.call(F);
924
+ var I, P;
925
+ (P = (I = i.value) == null ? void 0 : I.validateInputs) == null || P.call(I);
929
926
  }
930
927
  function C() {
931
- switch (r.mode) {
928
+ switch (a.mode) {
932
929
  case W.READ:
933
930
  return;
934
931
  case W.UPDATE:
@@ -939,10 +936,10 @@ const on = /* @__PURE__ */ me({
939
936
  }
940
937
  const M = V(() => {
941
938
  var X, Z;
942
- if (!s.isEnabled || !((X = r.unit) != null && X._id)) return null;
943
- const F = (Z = s.netSuiteItemBySkuId.get(r.unit._id)) == null ? void 0 : Z[0];
944
- return F ? s.state.setting.childItems.filter(
945
- (j) => j.parentNetSuiteId === F.netSuiteId
939
+ if (!s.isEnabled || !((X = a.unit) != null && X._id)) return null;
940
+ const I = (Z = s.netSuiteItemBySkuId.get(a.unit._id)) == null ? void 0 : Z[0];
941
+ return I ? s.state.setting.childItems.filter(
942
+ (j) => j.parentNetSuiteId === I.netSuiteId
946
943
  ).map((j) => {
947
944
  var z;
948
945
  const O = (z = s.measurementByNetsuiteId.get(j.unitOfMeasureId)) == null ? void 0 : z[0];
@@ -952,11 +949,11 @@ const on = /* @__PURE__ */ me({
952
949
  } : null;
953
950
  }).filter((j) => j).map((j) => j) : null;
954
951
  });
955
- return (F, P) => {
952
+ return (I, P) => {
956
953
  const X = $("FmChip"), Z = $("FmButton"), j = $("FmSideSheet");
957
954
  return v(), A(j, {
958
955
  "model-value": d(o),
959
- "onUpdate:modelValue": P[3] || (P[3] = (O) => Ee(o) ? o.value = O : null),
956
+ "onUpdate:modelValue": P[3] || (P[3] = (O) => Ue(o) ? o.value = O : null),
960
957
  header: x.value,
961
958
  "close-button": "",
962
959
  "dismiss-away": "",
@@ -994,14 +991,14 @@ const on = /* @__PURE__ */ me({
994
991
  ref_key: "hasValidationExpose",
995
992
  ref: i,
996
993
  modelValue: d(m),
997
- "onUpdate:modelValue": P[0] || (P[0] = (z) => Ee(m) ? m.value = z : null),
998
- mode: F.mode,
994
+ "onUpdate:modelValue": P[0] || (P[0] = (z) => Ue(m) ? m.value = z : null),
995
+ mode: I.mode,
999
996
  disabled: p.value,
1000
997
  "onClick:submit": P[1] || (P[1] = (z) => C())
1001
998
  }, null, 8, ["modelValue", "mode", "disabled"]),
1002
- (O = M.value) != null && O.length ? (v(), R("div", rn, [
999
+ (O = M.value) != null && O.length ? (v(), R("div", an, [
1003
1000
  P[4] || (P[4] = u("div", { class: "fm-typo-en-title-sm-600" }, N("NetSuite info"), -1)),
1004
- u("div", an, [
1001
+ u("div", rn, [
1005
1002
  (v(!0), R(J, null, te(M.value, (z, se) => (v(), R("div", {
1006
1003
  key: se,
1007
1004
  class: "flex items-center"
@@ -1019,12 +1016,12 @@ const on = /* @__PURE__ */ me({
1019
1016
  };
1020
1017
  }
1021
1018
  });
1022
- function* cn(a) {
1019
+ function* cn(r) {
1023
1020
  for (; ; )
1024
- yield a[Math.floor(Math.random() * a.length)];
1021
+ yield r[Math.floor(Math.random() * r.length)];
1025
1022
  }
1026
- function pn(a = 4, r = cn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1027
- return Array.from({ length: a }).map(() => r.next().value).join("");
1023
+ function pn(r = 4, a = cn("qwertyuiopasdfghjklzxcvbnm".split(""))) {
1024
+ return Array.from({ length: r }).map(() => a.next().value).join("");
1028
1025
  }
1029
1026
  function vn() {
1030
1027
  return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${pn()}`;
@@ -1036,22 +1033,22 @@ const fn = {
1036
1033
  precision: 0,
1037
1034
  measurements: []
1038
1035
  };
1039
- function yn(a) {
1036
+ function yn(r) {
1040
1037
  var g, s, n, l, o;
1041
1038
  return {
1042
- code: a.code,
1043
- name: a.name,
1044
- unit: ((g = a.unit.measurements.find((m) => m.id === a.trackingMeasurement)) == null ? void 0 : g.abbrev) ?? a.unit.abbrev,
1045
- baseUnit: a.unit.abbrev,
1046
- valuationMethod: a.valuation ?? "WAVG",
1047
- pricePerUnit: (s = a.defaultCost) != null && s.costPerUnit ? +Ye((n = a.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1048
- thresholdLow: ((l = a.thresholds) == null ? void 0 : l.low) ?? de().low,
1049
- thresholdMid: ((o = a.thresholds) == null ? void 0 : o.mid) ?? de().mid
1039
+ code: r.code,
1040
+ name: r.name,
1041
+ unit: ((g = r.unit.measurements.find((m) => m.id === r.trackingMeasurement)) == null ? void 0 : g.abbrev) ?? r.unit.abbrev,
1042
+ baseUnit: r.unit.abbrev,
1043
+ valuationMethod: r.valuation ?? "WAVG",
1044
+ pricePerUnit: (s = r.defaultCost) != null && s.costPerUnit ? +Ye((n = r.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
1045
+ thresholdLow: ((l = r.thresholds) == null ? void 0 : l.low) ?? de().low,
1046
+ thresholdMid: ((o = r.thresholds) == null ? void 0 : o.mid) ?? de().mid
1050
1047
  };
1051
1048
  }
1052
1049
  function Qe() {
1053
1050
  var n;
1054
- const a = [
1051
+ const r = [
1055
1052
  {
1056
1053
  id: "code",
1057
1054
  name: "Code"
@@ -1068,8 +1065,8 @@ function Qe() {
1068
1065
  id: "baseUnit",
1069
1066
  name: "Base unit"
1070
1067
  }
1071
- ], r = We(), g = fe(), s = he(g.currentCountry.value);
1072
- return r.enableTotalCost && a.push(
1068
+ ], a = Je(), g = fe(), s = he(g.currentCountry.value);
1069
+ return a.enableTotalCost && r.push(
1073
1070
  {
1074
1071
  id: "valuationMethod",
1075
1072
  name: "Valuation method"
@@ -1078,7 +1075,7 @@ function Qe() {
1078
1075
  id: "pricePerUnit",
1079
1076
  name: `Price per unit (${s == null ? void 0 : s.currency})`
1080
1077
  }
1081
- ), ((n = g.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && a.push(
1078
+ ), ((n = g.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && r.push(
1082
1079
  {
1083
1080
  id: "thresholdLow",
1084
1081
  name: "Show RED when remaining"
@@ -1087,42 +1084,42 @@ function Qe() {
1087
1084
  id: "thresholdMid",
1088
1085
  name: "Show YELLOW when remaining"
1089
1086
  }
1090
- ), a;
1087
+ ), r;
1091
1088
  }
1092
1089
  function gn() {
1093
- const r = re().skus.map(yn), s = fe().currentBusiness.value, n = Qe(), l = [
1090
+ const a = ae().skus.map(yn), s = fe().currentBusiness.value, n = Qe(), l = [
1094
1091
  ["Business name:", s == null ? void 0 : s.name],
1095
1092
  ["Business ID:", s == null ? void 0 : s._id],
1096
1093
  ["Menu version", s == null ? void 0 : s.menuVersion],
1097
1094
  [],
1098
1095
  n.map((_) => _.name),
1099
- ...r.map((_) => n.map((x) => _[x.id]))
1100
- ], o = n.map((_) => `system:${_.id}`), m = Ke(l, o), y = `${s == null ? void 0 : s.name} ingredients (${dt(/* @__PURE__ */ new Date())}).xlsx`;
1101
- return Je(m, y), y;
1096
+ ...a.map((_) => n.map((x) => _[x.id]))
1097
+ ], o = n.map((_) => `system:${_.id}`), m = Ge(l, o), y = `${s == null ? void 0 : s.name} ingredients (${mt(/* @__PURE__ */ new Date())}).xlsx`;
1098
+ return We(m, y), y;
1102
1099
  }
1103
1100
  function bn() {
1104
- const r = fe().currentBusiness.value, g = Qe(), s = [
1105
- ["Business name:", r == null ? void 0 : r.name],
1106
- ["Business ID:", r == null ? void 0 : r._id],
1107
- ["Menu version", r == null ? void 0 : r.menuVersion],
1101
+ const a = fe().currentBusiness.value, g = Qe(), s = [
1102
+ ["Business name:", a == null ? void 0 : a.name],
1103
+ ["Business ID:", a == null ? void 0 : a._id],
1104
+ ["Menu version", a == null ? void 0 : a.menuVersion],
1108
1105
  [],
1109
1106
  g.map((m) => m.name)
1110
- ], n = g.map((m) => `system:${m.id}`), l = Ke(s, n), o = "FeedMe ingredients template.xlsx";
1111
- return Je(l, o), o;
1107
+ ], n = g.map((m) => `system:${m.id}`), l = Ge(s, n), o = "FeedMe ingredients template.xlsx";
1108
+ return We(l, o), o;
1112
1109
  }
1113
- function hn(a) {
1110
+ function hn(r) {
1114
1111
  const [
1115
- r,
1112
+ a,
1116
1113
  g,
1117
1114
  s,
1118
1115
  n,
1119
1116
  l,
1120
1117
  o,
1121
1118
  ...m
1122
- ] = Mt(a);
1123
- if (!r || !r.length || r.some((i) => i.length && !i.startsWith("system:")))
1119
+ ] = pt(r);
1120
+ if (!a || !a.length || a.some((i) => i.length && !i.startsWith("system:")))
1124
1121
  throw new Error("Missing meta header. Excel file does not come from the template.");
1125
- const y = r.map((i) => i.split(":")[1]), x = ["code", "name", "unit", "baseUnit"].filter((i) => !y.includes(i));
1122
+ const y = a.map((i) => i.split(":")[1]), x = ["code", "name", "unit", "baseUnit"].filter((i) => !y.includes(i));
1126
1123
  if (x.length)
1127
1124
  throw new Error(
1128
1125
  `Missing meta headers (${x.join()}). Excel file does not come from the template.`
@@ -1139,41 +1136,41 @@ function hn(a) {
1139
1136
  };
1140
1137
  });
1141
1138
  }
1142
- function Ne(a, r, g) {
1139
+ function Ne(r, a, g) {
1143
1140
  var C;
1144
- const n = re().units, l = new Array(), o = g.filter((M) => M.data.code === a.code);
1141
+ const n = ae().units, l = new Array(), o = g.filter((M) => M.data.code === r.code);
1145
1142
  o.length > 1 && l.push(
1146
- `Code ${a.code} is already used in row ${o.map((M) => M.index + 6).join()}.`
1143
+ `Code ${r.code} is already used in row ${o.map((M) => M.index + 6).join()}.`
1147
1144
  );
1148
- const m = n.find((M) => M.abbrev === a.baseUnit), y = m == null ? void 0 : m.measurements.find((M) => M.abbrev === a.unit);
1145
+ const m = n.find((M) => M.abbrev === r.baseUnit), y = m == null ? void 0 : m.measurements.find((M) => M.abbrev === r.unit);
1149
1146
  if (!m)
1150
- l.push(`Cannot find base unit of symbol ${a.baseUnit}.`);
1151
- else if (a.baseUnit !== a.unit && !y) {
1152
- const M = `Cannot find unit conversion for ${a.baseUnit} with symbol ${a.unit || "[empty]"}.`;
1147
+ l.push(`Cannot find base unit of symbol ${r.baseUnit}.`);
1148
+ else if (r.baseUnit !== r.unit && !y) {
1149
+ const M = `Cannot find unit conversion for ${r.baseUnit} with symbol ${r.unit || "[empty]"}.`;
1153
1150
  l.push(M);
1154
1151
  }
1155
1152
  const _ = ve.options.find(
1156
- (M) => M === a.valuationMethod
1153
+ (M) => M === r.valuationMethod
1157
1154
  );
1158
- a.valuationMethod && !_ && l.push(
1159
- `Expected valuation method to be one of ${ve.options.join()} but got ${a.valuationMethod} instead.`
1155
+ r.valuationMethod && !_ && l.push(
1156
+ `Expected valuation method to be one of ${ve.options.join()} but got ${r.valuationMethod} instead.`
1160
1157
  );
1161
- const b = fe().currentCountry.value, i = (M) => `${M}`.length && ct()(M) === !0, p = i(`${a.pricePerUnit}`) === !0 ? {
1158
+ const b = fe().currentCountry.value, i = (M) => `${M}`.length && vt()(M) === !0, p = i(`${r.pricePerUnit}`) === !0 ? {
1162
1159
  costPerUnit: {
1163
- ...qe(Number(a.pricePerUnit) || 0),
1160
+ ...qe(Number(r.pricePerUnit) || 0),
1164
1161
  currency: ((C = he(b)) == null ? void 0 : C.currency) ?? "MYR"
1165
1162
  },
1166
1163
  measurement: y
1167
- } : void 0, D = i(`${a.thresholdLow}`) && i(`${a.thresholdMid}`) ? {
1168
- low: Number(a.thresholdLow) || 0,
1169
- mid: Number(a.thresholdMid) || 0
1164
+ } : void 0, D = i(`${r.thresholdLow}`) && i(`${r.thresholdMid}`) ? {
1165
+ low: Number(r.thresholdLow) || 0,
1166
+ mid: Number(r.thresholdMid) || 0
1170
1167
  } : void 0;
1171
1168
  return {
1172
1169
  type: "create",
1173
1170
  sku: {
1174
1171
  _id: vn(),
1175
- code: a.code,
1176
- name: a.name,
1172
+ code: r.code,
1173
+ name: r.name,
1177
1174
  unit: m ?? n.find((M) => M) ?? fn,
1178
1175
  trackingMeasurement: y == null ? void 0 : y.id,
1179
1176
  valuation: _,
@@ -1181,15 +1178,15 @@ function Ne(a, r, g) {
1181
1178
  thresholds: D
1182
1179
  },
1183
1180
  errors: l,
1184
- excelRowNumber: r + 6
1181
+ excelRowNumber: a + 6
1185
1182
  };
1186
1183
  }
1187
- function _n(a) {
1184
+ function _n(r) {
1188
1185
  try {
1189
- const r = hn(a).filter((_) => _.data.code), s = re().skus, n = mt(s, "code"), l = r.filter((_) => !n[_.data.code]), o = r.filter((_) => n[_.data.code]), m = l.map(
1190
- (_) => Ne(_.data, _.index, r)
1186
+ const a = hn(r).filter((_) => _.data.code), s = ae().skus, n = ct(s, "code"), l = a.filter((_) => !n[_.data.code]), o = a.filter((_) => n[_.data.code]), m = l.map(
1187
+ (_) => Ne(_.data, _.index, a)
1191
1188
  ), y = o.map((_) => {
1192
- const x = Ne(_.data, _.index, r), b = n[_.data.code];
1189
+ const x = Ne(_.data, _.index, a), b = n[_.data.code];
1193
1190
  return {
1194
1191
  ...x,
1195
1192
  type: "update",
@@ -1212,10 +1209,10 @@ function _n(a) {
1212
1209
  importCreateResult: m,
1213
1210
  importUpdateResult: y
1214
1211
  };
1215
- } catch (r) {
1212
+ } catch (a) {
1216
1213
  return {
1217
1214
  invalidExcel: !0,
1218
- invalidExcelMessage: (r == null ? void 0 : r.message) ?? "Invalid excel",
1215
+ invalidExcelMessage: (a == null ? void 0 : a.message) ?? "Invalid excel",
1219
1216
  importCreateResult: [],
1220
1217
  importUpdateResult: []
1221
1218
  };
@@ -1232,8 +1229,8 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1232
1229
  name: {},
1233
1230
  errors: {}
1234
1231
  },
1235
- setup(a) {
1236
- return (r, g) => {
1232
+ setup(r) {
1233
+ return (a, g) => {
1237
1234
  const s = $("FmIcon"), n = $("FmTooltip");
1238
1235
  return v(), R("div", xn, [
1239
1236
  g[0] || (g[0] = u("div", null, "•", -1)),
@@ -1241,17 +1238,17 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1241
1238
  u("div", kn, [
1242
1239
  u("div", {
1243
1240
  class: le({
1244
- "text-fm-color-system-error-300": r.errors.length
1241
+ "text-fm-color-system-error-300": a.errors.length
1245
1242
  })
1246
1243
  }, [
1247
- He(N(r.name) + " ", 1),
1248
- r.type === "create" ? (v(), R("span", Sn, "(new)")) : H("", !0)
1244
+ He(N(a.name) + " ", 1),
1245
+ a.type === "create" ? (v(), R("span", Sn, "(new)")) : H("", !0)
1249
1246
  ], 2),
1250
- r.errors.length ? (v(), R("div", Cn, [
1247
+ a.errors.length ? (v(), R("div", Cn, [
1251
1248
  f(n, { "z-index": 50 }, {
1252
1249
  content: S(() => [
1253
1250
  u("ol", null, [
1254
- (v(!0), R(J, null, te(r.errors, (l, o) => (v(), R("li", { key: o }, N(l), 1))), 128))
1251
+ (v(!0), R(J, null, te(a.errors, (l, o) => (v(), R("li", { key: o }, N(l), 1))), 128))
1255
1252
  ])
1256
1253
  ]),
1257
1254
  default: S(() => [
@@ -1269,38 +1266,38 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1269
1266
  class: le([
1270
1267
  "fm-typo-en-body-sm-400",
1271
1268
  {
1272
- "text-fm-color-system-error-200": r.errors.length,
1273
- "text-fm-color-typo-secondary": !r.errors.length
1269
+ "text-fm-color-system-error-200": a.errors.length,
1270
+ "text-fm-color-typo-secondary": !a.errors.length
1274
1271
  }
1275
1272
  ])
1276
- }, N(r.code), 3)
1273
+ }, N(a.code), 3)
1277
1274
  ])
1278
1275
  ]);
1279
1276
  };
1280
1277
  }
1281
- }), wn = { class: "flex flex-col gap-24" }, Mn = { class: "fm-typo-en-body-md-400" }, Fn = { class: "flex flex-col gap-8" }, In = { class: "line-clamp-2 text-ellipsis break-all" }, $n = {
1278
+ }), wn = { class: "flex flex-col gap-24" }, Mn = { class: "fm-typo-en-body-md-400" }, In = { class: "flex flex-col gap-8" }, Fn = { class: "line-clamp-2 text-ellipsis break-all" }, $n = {
1282
1279
  key: 2,
1283
1280
  class: "shrink-0"
1284
- }, Un = {
1281
+ }, En = {
1285
1282
  key: 0,
1286
1283
  class: "flex flex-col"
1287
- }, En = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Rn = {
1284
+ }, Un = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Rn = {
1288
1285
  key: 0,
1289
1286
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
1290
1287
  }, An = { class: "fm-typo-en-body-lg-600" }, Dn = /* @__PURE__ */ me({
1291
1288
  __name: "ImportIngredients",
1292
- setup(a) {
1293
- const r = q(null), g = bt(), s = _e(), n = q(!1), l = q(new Array()), o = q([]), m = q([]), y = V(
1289
+ setup(r) {
1290
+ const a = q(null), g = Vt(), s = _e(), n = q(!1), l = q(new Array()), o = q([]), m = q([]), y = V(
1294
1291
  () => !!l.value.length || o.value.some((i) => i.errors.length) || m.value.some((i) => i.errors.length)
1295
1292
  ), _ = V(
1296
1293
  () => !!o.value.length || !!m.value.length
1297
- ), { t: x } = ae();
1294
+ ), { t: x } = re();
1298
1295
  async function b(i) {
1299
1296
  l.value = [], o.value = [], m.value = [];
1300
1297
  try {
1301
1298
  n.value = !0;
1302
1299
  const [p] = await Promise.all([
1303
- Ft(i),
1300
+ yt(i),
1304
1301
  // fake buffer
1305
1302
  new Promise((L) => setTimeout(L, 1e3))
1306
1303
  ]), D = p.SheetNames.find((L) => L);
@@ -1331,26 +1328,26 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1331
1328
  }), n.value = !1;
1332
1329
  }
1333
1330
  }
1334
- return ze(r, (i) => {
1331
+ return ze(a, (i) => {
1335
1332
  i && b(i);
1336
1333
  }), (i, p) => {
1337
1334
  const D = $("FmCircularProgress"), w = $("FmIcon"), L = $("FmButton");
1338
1335
  return v(), R("div", wn, [
1339
1336
  u("div", Mn, N(d(x)("inventory.ingredient.import.uploadDescription")), 1),
1340
- f(It, {
1337
+ f(ft, {
1341
1338
  class: le({
1342
1339
  "w-full": !0,
1343
- "h-[200px]": !r.value
1340
+ "h-[200px]": !a.value
1344
1341
  }),
1345
1342
  accept: ".xlsx",
1346
- onFileUpload: p[0] || (p[0] = (C) => r.value = C),
1343
+ onFileUpload: p[0] || (p[0] = (C) => a.value = C),
1347
1344
  label: d(x)("inventory.ingredient.import.uploadTemplate"),
1348
1345
  "button-label": d(x)("inventory.ingredient.import.selectFile")
1349
1346
  }, Oe({ _: 2 }, [
1350
- r.value ? {
1347
+ a.value ? {
1351
1348
  name: "default",
1352
1349
  fn: S(({ openFileDialog: C }) => [
1353
- u("div", Fn, [
1350
+ u("div", In, [
1354
1351
  u("div", {
1355
1352
  class: le([
1356
1353
  "fm-corner-radius-md p-16 flex items-center gap-16",
@@ -1380,7 +1377,7 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1380
1377
  }
1381
1378
  ])
1382
1379
  }, [
1383
- u("div", In, N(r.value.name), 1)
1380
+ u("div", Fn, N(a.value.name), 1)
1384
1381
  ], 2),
1385
1382
  n.value ? H("", !0) : (v(), R("div", $n, [
1386
1383
  f(L, {
@@ -1391,9 +1388,9 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1391
1388
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1392
1389
  ]))
1393
1390
  ], 2),
1394
- l.value.length ? (v(), R("div", Un, [
1395
- (v(!0), R(J, null, te(l.value, (M, F) => (v(), R("div", {
1396
- key: F,
1391
+ l.value.length ? (v(), R("div", En, [
1392
+ (v(!0), R(J, null, te(l.value, (M, I) => (v(), R("div", {
1393
+ key: I,
1397
1394
  class: "flex gap-8 items-center"
1398
1395
  }, [
1399
1396
  f(w, {
@@ -1401,7 +1398,7 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1401
1398
  size: "sm",
1402
1399
  color: "system-error-300"
1403
1400
  }),
1404
- u("div", En, N(M), 1)
1401
+ u("div", Un, N(M), 1)
1405
1402
  ]))), 128))
1406
1403
  ])) : H("", !0)
1407
1404
  ])
@@ -1429,10 +1426,10 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1429
1426
  ]);
1430
1427
  };
1431
1428
  }
1432
- }), Tn = { class: "flex flex-col py-8" }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, to = /* @__PURE__ */ me({
1429
+ }), Tn = { class: "flex flex-col py-8" }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xn = /* @__PURE__ */ me({
1433
1430
  __name: "IngredientsView",
1434
- setup(a) {
1435
- const r = re(), g = V(() => r.skus), s = pt(), n = Ge(), l = _e(), { t: o } = ae(), { createIngredient: m, updateIngredient: y } = Me(), { ingredientDialogProps: _, ingredientViewLoading: x } = kt(Me()), { columnDefs: b } = $t();
1431
+ setup(r) {
1432
+ const a = ae(), g = V(() => a.skus), s = gt(), n = Ke(), l = _e(), { t: o } = re(), { createIngredient: m, updateIngredient: y } = Me(), { ingredientDialogProps: _, ingredientViewLoading: x } = Mt(Me()), { columnDefs: b } = $t();
1436
1433
  function i(T) {
1437
1434
  switch (T) {
1438
1435
  case "add":
@@ -1443,7 +1440,7 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1443
1440
  return O();
1444
1441
  }
1445
1442
  }
1446
- const p = q(""), D = q(!1), w = V(() => D.value || x.value), { breakpoints: L } = ht(), C = V(() => L.value.xs || L.value.sm), M = V(() => C.value ? 10 : 20), F = vt(), P = q(!1), X = [
1443
+ const p = q(""), D = q(!1), w = V(() => D.value || x.value), { breakpoints: L } = kt(), C = V(() => L.value.xs || L.value.sm), M = V(() => C.value ? 10 : 20), I = bt(), P = q(!1), X = [
1447
1444
  {
1448
1445
  value: "import",
1449
1446
  label: o("common.import")
@@ -1514,7 +1511,7 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1514
1511
  });
1515
1512
  return;
1516
1513
  }
1517
- if (T.importCreateResult.some((E) => E.errors.length) || T.importUpdateResult.some((E) => E.errors.length)) {
1514
+ if (T.importCreateResult.some((U) => U.errors.length) || T.importUpdateResult.some((U) => U.errors.length)) {
1518
1515
  l.open({
1519
1516
  title: o("inventory.ingredient.import.error.invalidContent"),
1520
1517
  message: o("inventory.ingredient.import.error.hasErrors"),
@@ -1528,7 +1525,7 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1528
1525
  async function se(T) {
1529
1526
  D.value = !0;
1530
1527
  try {
1531
- const E = [
1528
+ const U = [
1532
1529
  ...T.importCreateResult.map(({ sku: B }) => ({ type: "create", sku: B })),
1533
1530
  ...T.importUpdateResult.map(({ sku: B }) => ({ type: "update", sku: B }))
1534
1531
  ], ce = 100;
@@ -1536,13 +1533,13 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1536
1533
  const pe = () => {
1537
1534
  ie += ce, l.open({
1538
1535
  title: o("inventory.ingredient.import.progress", [
1539
- Math.min(ie, E.length),
1540
- E.length
1536
+ Math.min(ie, U.length),
1537
+ U.length
1541
1538
  ])
1542
1539
  });
1543
1540
  };
1544
- for (const B of E.chunk(100))
1545
- pe(), await r.importSkus({
1541
+ for (const B of U.chunk(100))
1542
+ pe(), await a.importSkus({
1546
1543
  create: B.filter((G) => G.type === "create").map((G) => G.sku),
1547
1544
  update: B.filter((G) => G.type === "update").map((G) => G.sku)
1548
1545
  });
@@ -1550,19 +1547,19 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1550
1547
  title: o("inventory.ingredient.import.success"),
1551
1548
  type: "success"
1552
1549
  });
1553
- } catch (E) {
1550
+ } catch (U) {
1554
1551
  l.open({
1555
1552
  title: o("inventory.ingredient.import.error.failed"),
1556
- message: o("inventory.ingredient.import.error.systemMessage", [E == null ? void 0 : E.message]),
1553
+ message: o("inventory.ingredient.import.error.systemMessage", [U == null ? void 0 : U.message]),
1557
1554
  type: "error"
1558
- }), console.error("Error in importing skus", T, E);
1555
+ }), console.error("Error in importing skus", T, U);
1559
1556
  } finally {
1560
1557
  D.value = !1;
1561
1558
  }
1562
1559
  }
1563
- return (T, E) => {
1560
+ return (T, U) => {
1564
1561
  const ce = $("FmTable"), ie = $("FmCollapsibleTabs"), pe = $("FmBottomSheet");
1565
- return v(), A(ft, {
1562
+ return v(), A(ht, {
1566
1563
  title: d(o)("inventory.ingredient.title"),
1567
1564
  actions: j.value,
1568
1565
  "onClick:action": i
@@ -1577,28 +1574,28 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1577
1574
  }
1578
1575
  ])
1579
1576
  }, [
1580
- f(yt, {
1577
+ f(_t, {
1581
1578
  searchable: "",
1582
1579
  search: p.value,
1583
- "onUpdate:search": E[0] || (E[0] = (B) => p.value = B)
1580
+ "onUpdate:search": U[0] || (U[0] = (B) => p.value = B)
1584
1581
  }, null, 8, ["search"]),
1585
1582
  f(ce, {
1586
- style: ot(d(F).tableHeight),
1583
+ style: ot(d(I).tableHeight),
1587
1584
  "column-defs": d(b),
1588
1585
  "row-data": g.value,
1589
1586
  "search-value": p.value,
1590
1587
  loading: !d(s)._currentLocation || w.value,
1591
1588
  "loading-text": "Loading",
1592
- onRowClick: E[1] || (E[1] = (B) => d(y)(B.original)),
1589
+ onRowClick: U[1] || (U[1] = (B) => d(y)(B.original)),
1593
1590
  "page-size": M.value
1594
1591
  }, {
1595
1592
  "list-row": S((B) => [
1596
- f(gt, {
1593
+ f(xt, {
1597
1594
  row: B,
1598
1595
  onRowClick: d(y)
1599
1596
  }, Oe({
1600
1597
  default: S((G) => {
1601
- var ne, ee, ye, oe, e, t, c, h, U, I;
1598
+ var ne, ee, ye, oe, e, t, c, h, E, F;
1602
1599
  return [
1603
1600
  u("div", Tn, [
1604
1601
  u("div", Pn, [
@@ -1610,7 +1607,7 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1610
1607
  u("div", Bn, [
1611
1608
  f(d(Pe), {
1612
1609
  render: (h = (c = (t = G.name) == null ? void 0 : t.column) == null ? void 0 : c.columnDef) == null ? void 0 : h.cell,
1613
- props: (I = (U = G.name) == null ? void 0 : U.getContext) == null ? void 0 : I.call(U)
1610
+ props: (F = (E = G.name) == null ? void 0 : E.getContext) == null ? void 0 : F.call(E)
1614
1611
  }, null, 8, ["render", "props"])
1615
1612
  ])
1616
1613
  ])
@@ -1631,19 +1628,19 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1631
1628
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
1632
1629
  ], 2),
1633
1630
  (v(), A(Re, { to: "body" }, [
1634
- f(mn, lt(rt(d(_))), null, 16)
1631
+ f(mn, lt(at(d(_))), null, 16)
1635
1632
  ])),
1636
1633
  (v(), A(Re, { to: "body" }, [
1637
1634
  f(pe, {
1638
1635
  "dismiss-away": "",
1639
1636
  modelValue: P.value,
1640
- "onUpdate:modelValue": E[3] || (E[3] = (B) => P.value = B)
1637
+ "onUpdate:modelValue": U[3] || (U[3] = (B) => P.value = B)
1641
1638
  }, {
1642
1639
  default: S(() => [
1643
1640
  f(ie, {
1644
1641
  class: "pb-8",
1645
1642
  items: X,
1646
- "onUpdate:modelValue": E[2] || (E[2] = (B) => Z(B))
1643
+ "onUpdate:modelValue": U[2] || (U[2] = (B) => Z(B))
1647
1644
  })
1648
1645
  ]),
1649
1646
  _: 1
@@ -1656,5 +1653,5 @@ const xn = { class: "flex items-center gap-12 pl-8" }, Vn = { class: "flex flex-
1656
1653
  }
1657
1654
  });
1658
1655
  export {
1659
- to as default
1656
+ Xn as default
1660
1657
  };