@feedmepos/mf-inventory-portal 1.7.9-dev.2 → 1.7.9-dev.3

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 (97) hide show
  1. package/dist/App-DownW83F.js +1434 -0
  2. package/dist/{ApprovalView-pmI_SFo7.js → ApprovalView-B5amT80y.js} +9 -9
  3. package/dist/{BindingsDialog-D902flPr.js → BindingsDialog-CEUoxncy.js} +2 -2
  4. package/dist/{BindingsPicker-JEKsY59b.js → BindingsPicker-Dw5JyYmq.js} +2 -2
  5. package/dist/{BindingsTable-DqlzOIxF.js → BindingsTable-dmxUVOtK.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-Chw7ma2k.js → BulkReceiveRequestView-CY7UPaI2.js} +19 -19
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Cct8Ko19.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-imaNFowE.js} +1 -1
  8. package/dist/{ClosingDraftView-D1ymRsd2.js → ClosingDraftView-DYxcWU3G.js} +19 -19
  9. package/dist/{ClosingHistoryView-5yr_itIV.js → ClosingHistoryView-DAb7Pchk.js} +5 -5
  10. package/dist/{ClosingTemplateView-MDl5Zq-g.js → ClosingTemplateView-BQT2KXP8.js} +16 -16
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BcG0gWV4.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-UsXIW4vc.js} +1 -1
  12. package/dist/{DefaultView-dOfbL3iF.js → DefaultView-B9cjZltR.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-BfVgQOx8.js → DeliveryOrderPrintPreview-B6RRZ_xx.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DHspOJQW.js → EmailDialog.vue_vue_type_script_setup_true_lang-6SAcd-Lu.js} +23 -23
  15. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B7NLu0us.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BKIR8ZLY.js} +1 -1
  16. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C0nunKjx.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CTivpMb5.js} +2 -2
  17. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CMst9tkA.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-rVm8WLNZ.js} +2 -2
  18. package/dist/{FmMultiselectDialog-Dt54hvqw.js → FmMultiselectDialog-Bf4g4osy.js} +2 -2
  19. package/dist/{FmMultiselectDialog-BjBx94pY.js → FmMultiselectDialog-DBZYeMI9.js} +1 -1
  20. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DtG9Ieo_.js → FmUnitInput.vue_vue_type_script_setup_true_lang-gf1UDVVJ.js} +6 -6
  21. package/dist/{ImportView-CdZN8k_Y.js → ImportView-CvTEgn9i.js} +499 -496
  22. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-iCpYEneM.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C_Ro5Q3e.js} +1 -1
  23. package/dist/{IngredientGroupView-BBVS1mKn.js → IngredientGroupView-BfQj9xKV.js} +5 -5
  24. package/dist/{IngredientsView-BGOaAUzR.js → IngredientsView-uISbT62R.js} +15 -15
  25. package/dist/{IntegrationExplorerView-UUBCmqdR.js → IntegrationExplorerView-0GXFfKHM.js} +4 -4
  26. package/dist/{IntegrationView-B2YowH-i.js → IntegrationView-6qKc8DLs.js} +14 -14
  27. package/dist/{InventoryBindingForm-kDx6Mvhn.js → InventoryBindingForm-Cg4xgKgC.js} +1 -1
  28. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-C8bktmYH.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B78sgTc8.js} +5 -5
  29. package/dist/{InventoryBindingSummary-DJrBTa8_.js → InventoryBindingSummary-CygEJTQk.js} +1 -1
  30. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DHk9uEAP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B9i4xUkA.js} +1 -1
  31. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Dx1VktdW.js → PremiumBadge.vue_vue_type_script_setup_true_lang-IYfWAX3U.js} +1 -1
  32. package/dist/{ProductionView-CxUcsRBP.js → ProductionView-B9tfb0__.js} +7 -7
  33. package/dist/{PublishView-DtP-Ms7q.js → PublishView-DSz5DFu7.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-C_qC2KF5.js → PurchaseOrderPrintPreview-CVGcA1NI.js} +2 -2
  35. package/dist/{ReceiveRequestView-Dy3BpqsP.js → ReceiveRequestView-DweKCvrP.js} +14 -14
  36. package/dist/{RecipeView-DeR7pqj8.js → RecipeView-M1iR-IGf.js} +17 -17
  37. package/dist/{SettingsView-C7ZXmatO.js → SettingsView-wWaJ1hSv.js} +4 -4
  38. package/dist/{StockView-wFLnNSRr.js → StockView-RffrZC0S.js} +21 -21
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Fxh3-Nqi.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BC1aoZ4v.js} +1 -1
  40. package/dist/{SupplierView-CeTDNDDK.js → SupplierView-CEuRDvnA.js} +12 -12
  41. package/dist/{SurchargeView-BQJnCdPA.js → SurchargeView-CnZsFwuM.js} +6 -6
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D1zxuH66.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DTz--8q9.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BFkh3Ubb.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C5T6eC6g.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CZVDhXNz.js → TransferDetails.vue_vue_type_script_setup_true_lang-BWzeUGhD.js} +20 -20
  45. package/dist/{TransferTemplateView-XaI2T5fa.js → TransferTemplateView-BuUv4UwP.js} +20 -20
  46. package/dist/{UnitCostHistoryView-DTNW7-mk.js → UnitCostHistoryView-JpsZaM24.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-vRsEjVJc.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Bt_Ydj8q.js} +4 -4
  48. package/dist/{UnitView-DXnyzkj3.js → UnitView-CDfmfOJd.js} +7 -7
  49. package/dist/{WarehouseView-iEHFgIqh.js → WarehouseView-CZJKpVYV.js} +5 -5
  50. package/dist/{WastageTemplateView-CGDUCPbr.js → WastageTemplateView-q0-8E264.js} +14 -14
  51. package/dist/api/changelog.d.ts +1 -1
  52. package/dist/{app-BIXJtvvD.js → app-806v4udw.js} +19 -15
  53. package/dist/app.d.ts +4 -0
  54. package/dist/app.js +1 -1
  55. package/dist/{closing-template-CLY-r6Cf.js → closing-template-1foridZ5.js} +1 -1
  56. package/dist/{date2-DbYQycSa.js → date2-D9lNDN0F.js} +1 -1
  57. package/dist/{dayjs.min-Dv7-fEed.js → dayjs.min-DU83C2ko.js} +1 -1
  58. package/dist/{decimal-B8YR17QC.js → decimal-C7jB4XJl.js} +2 -2
  59. package/dist/{defineDeepModel-C5ncgNxj.js → defineDeepModel-DBtE8i8j.js} +1 -1
  60. package/dist/{duplicate-template-CAlG1nzV.js → duplicate-template-C19hkOiT.js} +1 -1
  61. package/dist/{feature-BLSNLI5y.js → feature-DZXUs6TN.js} +2 -2
  62. package/dist/{format-time-from-id-D5DcWpHS.js → format-time-from-id-Yeedyd8O.js} +1 -1
  63. package/dist/{format-unit-display-Ch97dVXx.js → format-unit-display-D9AGU7Yr.js} +12 -12
  64. package/dist/{import-export.helper-CvUFSOa1.js → import-export.helper-DY1Vc5tk.js} +6 -6
  65. package/dist/{index-rRPErzP4.js → index-DBwfoE2e.js} +1 -1
  66. package/dist/{index-Bk8DOv4n.js → index-DXIyCaXQ.js} +1 -1
  67. package/dist/{index-CXzVUrJS.js → index-vAc_wEUQ.js} +3 -3
  68. package/dist/{inventory-core-dart.default-Cj7CxnpK.js → inventory-core-dart.default-C7P3Kz0T.js} +1 -1
  69. package/dist/{lz-string-DWkGPESZ.js → lz-string-CUIRjCEm.js} +1 -1
  70. package/dist/{netsuite-Cn0y1rH3.js → netsuite-Dd2pky4L.js} +2 -2
  71. package/dist/{number-CxbQxQwj.js → number-DTLt_eRR.js} +3 -3
  72. package/dist/{predefined-templates-CrSoG3R9.js → predefined-templates-V6hy-60C.js} +1 -1
  73. package/dist/{purchase-order-template-BmQQnrEl.js → purchase-order-template-FF9OAmuC.js} +1 -1
  74. package/dist/{recalculationUtils-CSnowXma.js → recalculationUtils-Cvf1yOQH.js} +1 -1
  75. package/dist/{rules-CurdOAcA.js → rules-DhlafJxm.js} +2 -2
  76. package/dist/{stock-BiqEgcgU.js → stock-BmFPsc4d.js} +3 -3
  77. package/dist/{stock-BdDR_L8p.js → stock-DBxX_D-9.js} +1 -1
  78. package/dist/style.css +1 -1
  79. package/dist/{supplier-CsjbmP_P.js → supplier-DH-sc9h0.js} +2 -2
  80. package/dist/{surcharge--kBjIIst.js → surcharge-BJ1QU6ll.js} +1 -1
  81. package/dist/tsconfig.app.tsbuildinfo +1 -1
  82. package/dist/{uom-rules-D8UPS06O.js → uom-rules-B3-B6cp2.js} +1 -1
  83. package/dist/{use-ingredient-select-dialog-BZdrpLOE.js → use-ingredient-select-dialog-CK0RFvcL.js} +2 -2
  84. package/dist/{use-inventory-binding-dialog-CkNxixT2.js → use-inventory-binding-dialog-Cp5MGmpQ.js} +2 -2
  85. package/dist/{use-template-enabled-locations-Dkl1_1F-.js → use-template-enabled-locations-Cco8sx4I.js} +2 -2
  86. package/dist/{use-transfer-locations-Bmj4zTJj.js → use-transfer-locations-B3xCMiEX.js} +2 -2
  87. package/dist/{useHrmPermission-DcBe_-Q6.js → useHrmPermission-CqJ0E15x.js} +1 -1
  88. package/dist/{useNavigationMenu-CsRbtAc7.js → useNavigationMenu-BItQaHE7.js} +2 -2
  89. package/dist/{useSseClient-hl2SQF5b.js → useSseClient-CwVHj0zJ.js} +1 -1
  90. package/dist/views/changelog/composables/use-changelog.d.ts +2 -0
  91. package/dist/views/changelog/composables/use-changelog.spec.d.ts +1 -0
  92. package/dist/views/import/helper/submit-rows.d.ts +13 -0
  93. package/dist/views/import/helper/submit-rows.spec.d.ts +1 -0
  94. package/dist/{vue-i18n-yL99yI4f.js → vue-i18n-H3LGoV9N.js} +269 -269
  95. package/dist/{xlsx.util-B8azJxkS.js → xlsx.util-_HpAAREu.js} +2 -2
  96. package/package.json +3 -3
  97. package/dist/App-BYCW0L94.js +0 -1403
@@ -1,58 +1,58 @@
1
- import { defineComponent as De, ref as F, computed as J, watch as ze, resolveComponent as Y, createElementBlock as D, openBlock as N, createVNode as A, createCommentVNode as Z, unref as i, normalizeClass as ce, createSlots as Ke, withCtx as Q, createElementVNode as n, createBlock as se, toDisplayString as a, Fragment as Be, renderList as Pe, shallowRef as $e, h as Ie, createTextVNode as k } from "vue";
2
- import { u as Ve, _ as ke } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
3
- import { useCoreStore as Re, useI18n as je } from "@feedmepos/mf-common";
4
- import { useDialogChild as We, useSnackbar as Oe, useDialog as Le, useBreakpoints as Je } from "@feedmepos/ui-library";
5
- import { u as Xe } from "./feature-BLSNLI5y.js";
6
- import { a as ie } from "./app-BIXJtvvD.js";
7
- import "./dayjs.min-Dv7-fEed.js";
1
+ import { defineComponent as Te, ref as F, computed as L, watch as Be, resolveComponent as Q, createElementBlock as D, openBlock as T, createVNode as A, createCommentVNode as Y, unref as i, normalizeClass as ce, createSlots as Pe, withCtx as q, createElementVNode as n, createBlock as se, toDisplayString as a, Fragment as Me, renderList as $e, shallowRef as Ue, h as Ie, createTextVNode as C } from "vue";
2
+ import { u as je, _ as ke } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
3
+ import { useCoreStore as Re, useI18n as Fe } from "@feedmepos/mf-common";
4
+ import { useDialogChild as Oe, useSnackbar as Ae, useDialog as He, useBreakpoints as ze } from "@feedmepos/ui-library";
5
+ import { u as Ke } from "./feature-DZXUs6TN.js";
6
+ import { a as ie } from "./app-806v4udw.js";
7
+ import "./dayjs.min-DU83C2ko.js";
8
8
  import "./app-C39bYJmq.js";
9
9
  import "./FmAdminBadge-DlplQOHb.js";
10
- import { s as He, a as qe, d as Qe, t as Ce, r as Ye } from "./xlsx.util-B8azJxkS.js";
11
- import { s as Ze, g as et, b as tt, d as Fe } from "./import-export.helper-CvUFSOa1.js";
12
- import { r as nt } from "./random-CSbEbElR.js";
13
- import { c as Ae, a as pe } from "./number-CxbQxQwj.js";
14
- import { F as ot } from "./FmDroppableField-J0tG_U3w.js";
10
+ import { s as De, a as Ve, d as We, t as Ce, r as Le } from "./xlsx.util-_HpAAREu.js";
11
+ import { s as Je, g as Xe, b as qe, d as Ge } from "./import-export.helper-DY1Vc5tk.js";
12
+ import { r as Qe } from "./random-CSbEbElR.js";
13
+ import { c as Ne, a as pe } from "./number-DTLt_eRR.js";
14
+ import { F as Ye } from "./FmDroppableField-J0tG_U3w.js";
15
15
  function Ee() {
16
- return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${nt()}`;
16
+ return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${Qe()}`;
17
17
  }
18
- function rt(U) {
18
+ function Ze(U) {
19
19
  const [
20
20
  e,
21
- R,
22
- g,
21
+ S,
22
+ y,
23
+ b,
24
+ k,
23
25
  h,
24
- E,
25
- x,
26
26
  ...r
27
- ] = He(U);
28
- if (!e || !e.length || e.some((p) => p.length && !p.startsWith("system:")))
27
+ ] = De(U);
28
+ if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
29
29
  throw new Error("Missing meta header. Excel file does not come from the template.");
30
- const l = e.map((p) => p.split(":")[1]), u = ["name", "symbol", "precision"].filter((p) => !l.includes(p));
30
+ const l = e.map((c) => c.split(":")[1]), u = ["name", "symbol", "precision"].filter((c) => !l.includes(c));
31
31
  if (u.length)
32
32
  throw new Error(
33
33
  `Missing meta headers (${u.join()}). Excel file does not come from the template.`
34
34
  );
35
- return r.map((p, b) => {
36
- const f = {};
35
+ return r.map((c, f) => {
36
+ const g = {};
37
37
  for (const d in l) {
38
38
  const o = l[d];
39
- Object.assign(f, { [o]: p[d] });
39
+ Object.assign(g, { [o]: c[d] });
40
40
  }
41
41
  return {
42
- index: b,
43
- data: f
42
+ index: f,
43
+ data: g
44
44
  };
45
45
  });
46
46
  }
47
- function st(U) {
47
+ function et(U) {
48
48
  try {
49
- const e = rt(U).filter((r) => {
50
- const { name: l, symbol: s, precision: u, measurement_name: v, measurement_symbol: p, measurement_conversion: b } = r.data;
51
- return l || s || u || v || p || b;
52
- }), g = ie().units, h = [], E = [], x = {};
49
+ const e = Ze(U).filter((r) => {
50
+ const { name: l, symbol: s, precision: u, measurement_name: p, measurement_symbol: c, measurement_conversion: f } = r.data;
51
+ return l || s || u || p || c || f;
52
+ }), y = ie().units, b = [], k = [], h = {};
53
53
  for (const r of e)
54
54
  if (r.data.name && r.data.symbol)
55
- x[r.data.name] = {
55
+ h[r.data.name] = {
56
56
  unit: {
57
57
  name: r.data.name,
58
58
  abbrev: r.data.symbol,
@@ -60,33 +60,33 @@ function st(U) {
60
60
  measurements: []
61
61
  },
62
62
  rowNumber: r.index
63
- }, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && x[r.data.name].unit.measurements.push({
63
+ }, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && h[r.data.name].unit.measurements.push({
64
64
  id: Ee(),
65
65
  name: r.data.measurement_name,
66
66
  abbrev: r.data.measurement_symbol,
67
67
  conversion: {
68
- amount: Math.round(r.data.measurement_conversion * Math.pow(10, x[r.data.name].unit.precision)),
69
- precision: x[r.data.name].unit.precision
68
+ amount: Math.round(r.data.measurement_conversion * Math.pow(10, h[r.data.name].unit.precision)),
69
+ precision: h[r.data.name].unit.precision
70
70
  }
71
71
  });
72
72
  else {
73
- const l = Object.keys(x)[Object.keys(x).length - 1];
74
- l && x[l] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && x[l].unit.measurements.push({
73
+ const l = Object.keys(h)[Object.keys(h).length - 1];
74
+ l && h[l] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && h[l].unit.measurements.push({
75
75
  id: Ee(),
76
76
  name: r.data.measurement_name,
77
77
  abbrev: r.data.measurement_symbol,
78
78
  conversion: {
79
- amount: Math.round(r.data.measurement_conversion * Math.pow(10, x[l].unit.precision)),
80
- precision: x[l].unit.precision
79
+ amount: Math.round(r.data.measurement_conversion * Math.pow(10, h[l].unit.precision)),
80
+ precision: h[l].unit.precision
81
81
  }
82
82
  });
83
83
  }
84
- for (const [r, { unit: l, rowNumber: s }] of Object.entries(x)) {
85
- const u = g.find((v) => {
86
- var p, b;
87
- return v.abbrev === l.abbrev && ((p = v.name) == null ? void 0 : p.trim()) === ((b = l.name) == null ? void 0 : b.trim());
84
+ for (const [r, { unit: l, rowNumber: s }] of Object.entries(h)) {
85
+ const u = y.find((p) => {
86
+ var c, f;
87
+ return p.abbrev === l.abbrev && ((c = p.name) == null ? void 0 : c.trim()) === ((f = l.name) == null ? void 0 : f.trim());
88
88
  });
89
- u ? E.push({
89
+ u ? k.push({
90
90
  type: "update",
91
91
  original: u,
92
92
  unit: {
@@ -94,18 +94,18 @@ function st(U) {
94
94
  name: l.name || u.name,
95
95
  abbrev: l.abbrev || u.abbrev,
96
96
  precision: l.precision !== void 0 ? l.precision : u.precision,
97
- measurements: l.measurements.map((v) => {
98
- const p = u.measurements.find((b) => b.name === v.name && b.abbrev === v.abbrev);
99
- return p ? { ...p, ...v, id: p.id } : { ...v, id: Ee() };
97
+ measurements: l.measurements.map((p) => {
98
+ const c = u.measurements.find((f) => f.name === p.name && f.abbrev === p.abbrev);
99
+ return c ? { ...c, ...p, id: c.id } : { ...p, id: Ee() };
100
100
  })
101
101
  },
102
102
  errors: [],
103
103
  excelRowNumber: s
104
- }) : h.push({
104
+ }) : b.push({
105
105
  type: "create",
106
106
  unit: {
107
107
  ...l,
108
- measurements: l.measurements.map((v) => ({ ...v, id: Ee() }))
108
+ measurements: l.measurements.map((p) => ({ ...p, id: Ee() }))
109
109
  },
110
110
  errors: [],
111
111
  excelRowNumber: s
@@ -113,8 +113,8 @@ function st(U) {
113
113
  }
114
114
  return {
115
115
  invalidExcel: !1,
116
- importCreateResult: h,
117
- importUpdateResult: E
116
+ importCreateResult: b,
117
+ importUpdateResult: k
118
118
  };
119
119
  } catch (e) {
120
120
  return {
@@ -125,130 +125,130 @@ function st(U) {
125
125
  };
126
126
  }
127
127
  }
128
- function it(U, { ignoreErrors: e = !1 } = {}) {
129
- var R;
128
+ function tt(U, { ignoreErrors: e = !1 } = {}) {
129
+ var S;
130
130
  try {
131
- const g = ie(), h = g.skuByCode, E = g.recipeByName, x = g.skuGroupById, r = g.skuGroups, l = g.units, s = [], u = {};
131
+ const y = ie(), b = y.skuByCode, k = y.recipeByName, h = y.skuGroupById, r = y.skuGroups, l = y.units, s = [], u = {};
132
132
  for (const o of U) {
133
- const y = [];
134
- let _ = "";
133
+ const v = [];
134
+ let w = "";
135
135
  if (o.data.type === "INGREDIENT") {
136
- const w = h[o.data.code];
137
- w ? _ = w._id : y.push(`Ingredient with code '${o.data.code}' not found`);
136
+ const I = b[o.data.code];
137
+ I ? w = I._id : v.push(`Ingredient with code '${o.data.code}' not found`);
138
138
  } else if (o.data.type === "RECIPE") {
139
- const w = E[o.data.name];
140
- w ? _ = w._id : y.push(`Recipe with name '${o.data.name}' not found`);
139
+ const I = k[o.data.name];
140
+ I ? w = I._id : v.push(`Recipe with name '${o.data.name}' not found`);
141
141
  } else if (o.data.type === "SKU_GROUP") {
142
- const w = r.find((I) => I.ref === o.data.code || I.name === o.data.name);
143
- w ? _ = w._id : y.push(`SKU Group with ref '${o.data.code}' or name '${o.data.name}' not found`);
142
+ const I = r.find((E) => E.ref === o.data.code || E.name === o.data.name);
143
+ I ? w = I._id : v.push(`SKU Group with ref '${o.data.code}' or name '${o.data.name}' not found`);
144
144
  } else
145
- y.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT', 'RECIPE', or 'SKU_GROUP'`);
146
- o.data.amount || y.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
147
- let G;
148
- if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && o.data.type !== "SKU_GROUP" && (G = l.find((w) => {
149
- var I, ee;
150
- return w.abbrev === o.data.baseUnit && ((I = w.name) == null ? void 0 : I.trim()) === ((ee = o.data.unit) == null ? void 0 : ee.trim());
151
- }), G || (o.data.baseUnit && o.data.unit ? y.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? y.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && y.push(`Cannot find unit with name '${o.data.unit}'`))), y.length > 0 && s.push(`Row ${o.index + 6}: ${y.join(", ")}`), e || y.length === 0) {
152
- let w;
153
- if (o.data.type === "RECIPE" || o.data.type === "SKU_GROUP" ? w = void 0 : w = (R = G == null ? void 0 : G.measurements) == null ? void 0 : R.find((I) => I.abbrev === o.data.measurementName), o.data.recipeName)
145
+ v.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT', 'RECIPE', or 'SKU_GROUP'`);
146
+ o.data.amount || v.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
147
+ let N;
148
+ if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && o.data.type !== "SKU_GROUP" && (N = l.find((I) => {
149
+ var E, Z;
150
+ return I.abbrev === o.data.baseUnit && ((E = I.name) == null ? void 0 : E.trim()) === ((Z = o.data.unit) == null ? void 0 : Z.trim());
151
+ }), N || (o.data.baseUnit && o.data.unit ? v.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? v.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && v.push(`Cannot find unit with name '${o.data.unit}'`))), v.length > 0 && s.push(`Row ${o.index + 6}: ${v.join(", ")}`), e || v.length === 0) {
152
+ let I;
153
+ if (o.data.type === "RECIPE" || o.data.type === "SKU_GROUP" ? I = void 0 : I = (S = N == null ? void 0 : N.measurements) == null ? void 0 : S.find((E) => E.abbrev === o.data.measurementName), o.data.recipeName)
154
154
  u[o.data.recipeName] = {
155
155
  name: o.data.recipeName,
156
- customAttributes: o.data.customAttributes ? Ze(o.data.customAttributes) : {},
156
+ customAttributes: o.data.customAttributes ? Je(o.data.customAttributes) : {},
157
157
  contains: [{
158
158
  type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
159
- id: _,
160
- amount: Ae(+o.data.amount),
161
- measurement: w || void 0
159
+ id: w,
160
+ amount: Ne(+o.data.amount),
161
+ measurement: I || void 0
162
162
  }]
163
- }, s[o.data.recipeName] = y.length > 0 ? `Row ${o.index + 6}: ${y.join(", ")}` : [];
163
+ }, s[o.data.recipeName] = v.length > 0 ? `Row ${o.index + 6}: ${v.join(", ")}` : [];
164
164
  else {
165
- const I = Object.keys(u)[Object.keys(u).length - 1];
166
- I && u[I] && (u[I] = {
167
- ...u[I],
165
+ const E = Object.keys(u)[Object.keys(u).length - 1];
166
+ E && u[E] && (u[E] = {
167
+ ...u[E],
168
168
  contains: [
169
- ...u[I].contains,
169
+ ...u[E].contains,
170
170
  {
171
171
  type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
172
- id: _,
173
- amount: Ae(+o.data.amount),
174
- measurement: w || void 0
172
+ id: w,
173
+ amount: Ne(+o.data.amount),
174
+ measurement: I || void 0
175
175
  }
176
176
  ]
177
- }, s[I] = y.length > 0 ? s[I] ? `${s[I]}, Row ${o.index + 6}: ${y.join(", ")}` : `Row ${o.index + 6}: ${y.join(", ")}` : []);
177
+ }, s[E] = v.length > 0 ? s[E] ? `${s[E]}, Row ${o.index + 6}: ${v.join(", ")}` : `Row ${o.index + 6}: ${v.join(", ")}` : []);
178
178
  }
179
179
  }
180
180
  }
181
- const v = Object.values(u), p = v.filter((o) => !E[o.name]), b = v.filter((o) => E[o.name]), f = p.map((o, y) => ({
181
+ const p = Object.values(u), c = p.filter((o) => !k[o.name]), f = p.filter((o) => k[o.name]), g = c.map((o, v) => ({
182
182
  type: "create",
183
183
  recipe: o,
184
184
  // Type assertion - _id will be assigned by backend
185
185
  errors: s[o.name],
186
- excelRowNumber: y + 6
186
+ excelRowNumber: v + 6
187
187
  // Assuming header rows
188
- })), d = b.map((o, y) => {
189
- const _ = E[o.name];
188
+ })), d = f.map((o, v) => {
189
+ const w = k[o.name];
190
190
  return {
191
191
  type: "update",
192
- original: _,
192
+ original: w,
193
193
  recipe: {
194
- ..._,
195
- name: o.name || _.name,
196
- contains: o.contains.length > 0 ? o.contains : _.contains,
197
- customAttributes: o.customAttributes || _.customAttributes
194
+ ...w,
195
+ name: o.name || w.name,
196
+ contains: o.contains.length > 0 ? o.contains : w.contains,
197
+ customAttributes: o.customAttributes || w.customAttributes
198
198
  },
199
199
  errors: s[o.name],
200
- excelRowNumber: y + 6
200
+ excelRowNumber: v + 6
201
201
  };
202
202
  });
203
203
  return {
204
204
  invalidExcel: s.length > 0,
205
205
  invalidExcelMessage: s.length > 0 ? `Import completed with ${s.length} error(s): ${s.join("; ")}` : void 0,
206
- importCreateResult: f,
206
+ importCreateResult: g,
207
207
  importUpdateResult: d
208
208
  };
209
- } catch (g) {
209
+ } catch (y) {
210
210
  return {
211
211
  invalidExcel: !0,
212
- invalidExcelMessage: g instanceof Error ? g.message : "Unknown error occurred",
212
+ invalidExcelMessage: y instanceof Error ? y.message : "Unknown error occurred",
213
213
  importCreateResult: [],
214
214
  importUpdateResult: []
215
215
  };
216
216
  }
217
217
  }
218
- function at(U) {
218
+ function nt(U) {
219
219
  const [
220
220
  e,
221
- R,
222
- g,
221
+ S,
222
+ y,
223
+ b,
224
+ k,
223
225
  h,
224
- E,
225
- x,
226
226
  ...r
227
- ] = He(U);
228
- if (!e || !e.length || e.some((p) => p.length && !p.startsWith("system:")))
227
+ ] = De(U);
228
+ if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
229
229
  throw new Error("Missing meta header. Excel file does not come from the template.");
230
- const l = e.map((p) => p.split(":")[1]), u = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((p) => !l.includes(p));
230
+ const l = e.map((c) => c.split(":")[1]), u = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((c) => !l.includes(c));
231
231
  if (u.length)
232
232
  throw new Error(
233
233
  `Missing meta headers (${u.join()}). Excel file does not come from the template.`
234
234
  );
235
- return r.map((p, b) => {
236
- const f = {};
235
+ return r.map((c, f) => {
236
+ const g = {};
237
237
  for (const d in l) {
238
238
  const o = l[d];
239
- Object.assign(f, { [o]: p[d] });
239
+ Object.assign(g, { [o]: c[d] });
240
240
  }
241
241
  return {
242
- index: b,
243
- data: f
242
+ index: f,
243
+ data: g
244
244
  };
245
- }).filter((p) => {
246
- const { recipeName: b, type: f, code: d, name: o, amount: y, unit: _, baseUnit: G, measurementName: w, customAttributes: I } = p.data;
247
- return b || f || d || o || y || _ || G || w || I;
245
+ }).filter((c) => {
246
+ const { recipeName: f, type: g, code: d, name: o, amount: v, unit: w, baseUnit: N, measurementName: I, customAttributes: E } = c.data;
247
+ return f || g || d || o || v || w || N || I || E;
248
248
  });
249
249
  }
250
- function lt() {
251
- const e = Re().currentBusiness.value, R = ie(), g = [
250
+ function ot() {
251
+ const e = Re().currentBusiness.value, S = ie(), y = [
252
252
  { id: "name", name: "Unit Name" },
253
253
  { id: "symbol", name: "Symbol" },
254
254
  { id: "precision", name: "Precision" },
@@ -256,10 +256,10 @@ function lt() {
256
256
  { id: "measurement_symbol", name: "Measurement Symbol" },
257
257
  { id: "measurement_conversion", name: "Measurement Conversion" }
258
258
  ];
259
- let h = [];
260
- R.units.length > 0 ? R.units.forEach((r) => {
259
+ let b = [];
260
+ S.units.length > 0 ? S.units.forEach((r) => {
261
261
  if (r.measurements.length === 0)
262
- h.push([
262
+ b.push([
263
263
  r.name,
264
264
  r.abbrev,
265
265
  r.precision,
@@ -268,7 +268,7 @@ function lt() {
268
268
  ""
269
269
  ]);
270
270
  else {
271
- h.push([
271
+ b.push([
272
272
  r.name,
273
273
  r.abbrev,
274
274
  r.precision,
@@ -277,7 +277,7 @@ function lt() {
277
277
  +pe(r.measurements[0].conversion)
278
278
  ]);
279
279
  for (let l = 1; l < r.measurements.length; l++)
280
- h.push([
280
+ b.push([
281
281
  "",
282
282
  "",
283
283
  "",
@@ -286,7 +286,7 @@ function lt() {
286
286
  +pe(r.measurements[l].conversion)
287
287
  ]);
288
288
  }
289
- }) : h = [
289
+ }) : b = [
290
290
  ["Length", "m", 2, "Meter", "m", 1],
291
291
  ["", "", "", "Centimeter", "cm", 0.01],
292
292
  ["", "", "", "Millimeter", "mm", 1e-3],
@@ -294,48 +294,48 @@ function lt() {
294
294
  ["", "", "", "Gram", "g", 1e-3],
295
295
  ["", "", "", "Pound", "lb", 0.453592]
296
296
  ];
297
- const E = [
297
+ const k = [
298
298
  ["Business name:", e == null ? void 0 : e.name],
299
299
  ["Business ID:", e == null ? void 0 : e._id],
300
300
  ["Menu version", e == null ? void 0 : e.menuVersion],
301
301
  [],
302
- g.map((r) => r.name),
303
- ...h
304
- ], x = g.map((r) => `system:${r.id}`);
305
- return Ce(E, x);
302
+ y.map((r) => r.name),
303
+ ...b
304
+ ], h = y.map((r) => `system:${r.id}`);
305
+ return Ce(k, h);
306
306
  }
307
- function mt() {
308
- const e = Re().currentBusiness.value, R = ie(), g = tt();
309
- let h = [];
310
- R.skus.length > 0 ? h = R.skus.map((r) => {
311
- var l, s, u, v, p, b, f, d;
307
+ function rt() {
308
+ const e = Re().currentBusiness.value, S = ie(), y = qe();
309
+ let b = [];
310
+ S.skus.length > 0 ? b = S.skus.map((r) => {
311
+ var l, s, u, p, c, f, g, d;
312
312
  return [
313
313
  r.code,
314
314
  r.name,
315
315
  ((l = r.unit) == null ? void 0 : l.name) || "",
316
316
  ((s = r.unit) == null ? void 0 : s.abbrev) || "",
317
- ((v = (u = r.unit) == null ? void 0 : u.measurements.find((o) => o.id === r.trackingMeasurement)) == null ? void 0 : v.abbrev) ?? r.unit.abbrev,
317
+ ((p = (u = r.unit) == null ? void 0 : u.measurements.find((o) => o.id === r.trackingMeasurement)) == null ? void 0 : p.abbrev) ?? r.unit.abbrev,
318
318
  r.valuation || "WAVG",
319
- (p = r.defaultCost) != null && p.costPerUnit ? +pe((b = r.defaultCost) == null ? void 0 : b.costPerUnit) : 0,
320
- ((f = r.thresholds) == null ? void 0 : f.low) ?? Fe().low,
321
- ((d = r.thresholds) == null ? void 0 : d.mid) ?? Fe().mid,
322
- r.customAttributes ? Object.entries(r.customAttributes).map(([o, y]) => `${o}:${y}`).join("|") : ""
319
+ (c = r.defaultCost) != null && c.costPerUnit ? +pe((f = r.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
320
+ ((g = r.thresholds) == null ? void 0 : g.low) ?? Ge().low,
321
+ ((d = r.thresholds) == null ? void 0 : d.mid) ?? Ge().mid,
322
+ r.customAttributes ? Object.entries(r.customAttributes).map(([o, v]) => `${o}:${v}`).join("|") : ""
323
323
  ];
324
- }) : h = [
324
+ }) : b = [
325
325
  ["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
326
326
  ];
327
- const E = [
327
+ const k = [
328
328
  ["Business name:", e == null ? void 0 : e.name],
329
329
  ["Business ID:", e == null ? void 0 : e._id],
330
330
  ["Menu version", e == null ? void 0 : e.menuVersion],
331
331
  [],
332
- g.map((r) => r.name),
333
- ...h
334
- ], x = g.map((r) => `system:${r.id}`);
335
- return Ce(E, x);
332
+ y.map((r) => r.name),
333
+ ...b
334
+ ], h = y.map((r) => `system:${r.id}`);
335
+ return Ce(k, h);
336
336
  }
337
- function ut() {
338
- const e = Re().currentBusiness.value, R = ie(), g = [
337
+ function st() {
338
+ const e = Re().currentBusiness.value, S = ie(), y = [
339
339
  { id: "recipeName", name: "Recipe Name" },
340
340
  { id: "type", name: "Type" },
341
341
  { id: "code", name: "Code" },
@@ -346,58 +346,58 @@ function ut() {
346
346
  { id: "measurementName", name: "Measurement Symbol" },
347
347
  { id: "customAttributes", name: "Custom Attributes" }
348
348
  ];
349
- let h = [];
350
- if (R.recipes.length > 0) {
351
- const r = R.recipeById, l = R.skuById, s = R.skuGroupById;
352
- h = R.recipes.flatMap((u) => {
353
- var p;
354
- const v = u.customAttributes ? Object.entries(u.customAttributes).map(([b, f]) => `${b}:${f}`).join("|") : "";
355
- if ((p = u.contains) != null && p.length) {
356
- const b = u.contains.filter((o) => o.type === "RECIPE"), f = u.contains.filter((o) => o.type === "SKU"), d = u.contains.filter((o) => o.type === "SKU_GROUP");
349
+ let b = [];
350
+ if (S.recipes.length > 0) {
351
+ const r = S.recipeById, l = S.skuById, s = S.skuGroupById;
352
+ b = S.recipes.flatMap((u) => {
353
+ var c;
354
+ const p = u.customAttributes ? Object.entries(u.customAttributes).map(([f, g]) => `${f}:${g}`).join("|") : "";
355
+ if ((c = u.contains) != null && c.length) {
356
+ const f = u.contains.filter((o) => o.type === "RECIPE"), g = u.contains.filter((o) => o.type === "SKU"), d = u.contains.filter((o) => o.type === "SKU_GROUP");
357
357
  return [
358
- ...b.map((o, y) => {
359
- var _;
358
+ ...f.map((o, v) => {
359
+ var w;
360
360
  return [
361
- y === 0 ? u.name : "",
361
+ v === 0 ? u.name : "",
362
362
  "RECIPE",
363
363
  "",
364
- ((_ = r[o.id]) == null ? void 0 : _.name) || "",
364
+ ((w = r[o.id]) == null ? void 0 : w.name) || "",
365
365
  o.amount.amount,
366
366
  "",
367
367
  "unit",
368
368
  "Unit",
369
- y === 0 ? v : ""
369
+ v === 0 ? p : ""
370
370
  ];
371
371
  }),
372
- ...f.map((o, y) => {
373
- var _, G, w, I, ee, ve, ye, ge, fe, ae, be, le, he, xe, _e, we;
372
+ ...g.map((o, v) => {
373
+ var w, N, I, E, Z, ve, ye, ge, fe, ae, be, le, he, xe, _e, we;
374
374
  return [
375
- !b.length && y === 0 ? u.name : "",
375
+ !f.length && v === 0 ? u.name : "",
376
376
  "INGREDIENT",
377
- ((_ = l[o.id]) == null ? void 0 : _.code) || "",
378
- ((G = l[o.id]) == null ? void 0 : G.name) || "",
377
+ ((w = l[o.id]) == null ? void 0 : w.code) || "",
378
+ ((N = l[o.id]) == null ? void 0 : N.name) || "",
379
379
  +pe(o.amount),
380
- o.measurement ? ((I = (w = l[o.id]) == null ? void 0 : w.unit) == null ? void 0 : I.name) || "" : ((ve = (ee = l[o.id]) == null ? void 0 : ee.unit) == null ? void 0 : ve.name) || "",
380
+ o.measurement ? ((E = (I = l[o.id]) == null ? void 0 : I.unit) == null ? void 0 : E.name) || "" : ((ve = (Z = l[o.id]) == null ? void 0 : Z.unit) == null ? void 0 : ve.name) || "",
381
381
  o.measurement ? ((ge = (ye = l[o.id]) == null ? void 0 : ye.unit) == null ? void 0 : ge.abbrev) || "" : ((ae = (fe = l[o.id]) == null ? void 0 : fe.unit) == null ? void 0 : ae.abbrev) || "",
382
382
  o.measurement ? o.measurement.abbrev : ((xe = (he = (le = (be = l[o.id]) == null ? void 0 : be.unit) == null ? void 0 : le.measurements) == null ? void 0 : he.find((Se) => {
383
383
  var m;
384
384
  return Se.id === ((m = l[o.id]) == null ? void 0 : m.trackingMeasurement);
385
385
  })) == null ? void 0 : xe.abbrev) || ((we = (_e = l[o.id]) == null ? void 0 : _e.unit) == null ? void 0 : we.abbrev) || "",
386
- !b.length && y === 0 ? v : ""
386
+ !f.length && v === 0 ? p : ""
387
387
  ];
388
388
  }),
389
- ...d.map((o, y) => {
390
- var _, G;
389
+ ...d.map((o, v) => {
390
+ var w, N;
391
391
  return [
392
- b.length === 0 && f.length === 0 && y === 0 ? u.name : "",
392
+ f.length === 0 && g.length === 0 && v === 0 ? u.name : "",
393
393
  "SKU_GROUP",
394
- ((_ = s[o.id]) == null ? void 0 : _.ref) || "",
395
- ((G = s[o.id]) == null ? void 0 : G.name) || "",
394
+ ((w = s[o.id]) == null ? void 0 : w.ref) || "",
395
+ ((N = s[o.id]) == null ? void 0 : N.name) || "",
396
396
  +pe(o.amount),
397
397
  "",
398
398
  "unit",
399
399
  "Unit",
400
- b.length === 0 && f.length === 0 && y === 0 ? v : ""
400
+ f.length === 0 && g.length === 0 && v === 0 ? p : ""
401
401
  ];
402
402
  })
403
403
  ];
@@ -405,153 +405,156 @@ function ut() {
405
405
  return [];
406
406
  });
407
407
  } else
408
- h = [
408
+ b = [
409
409
  ["Pizza Dough", "INGREDIENT", "FLOUR001", "Flour", "500", "Weight", "g", "Gram", "difficulty:easy, category:italian"],
410
410
  ["", "INGREDIENT", "WATER001", "Water", "300", "Volume", "ml", "Milliliter", ""],
411
411
  ["", "INGREDIENT", "SALT001", "Salt", "10", "Weight", "g", "Gram", ""]
412
412
  ];
413
- const E = [
413
+ const k = [
414
414
  ["Business name:", e == null ? void 0 : e.name],
415
415
  ["Business ID:", e == null ? void 0 : e._id],
416
416
  ["Menu version", e == null ? void 0 : e.menuVersion],
417
417
  [],
418
- g.map((r) => r.name),
419
- ...h
420
- ], x = g.map((r) => `system:${r.id}`);
421
- return Ce(E, x);
418
+ y.map((r) => r.name),
419
+ ...b
420
+ ], h = y.map((r) => `system:${r.id}`);
421
+ return Ce(k, h);
422
422
  }
423
- function dt() {
424
- const U = qe({
425
- unit: lt(),
426
- ingredient: mt(),
427
- recipe: ut()
423
+ function it() {
424
+ const U = Ve({
425
+ unit: ot(),
426
+ ingredient: rt(),
427
+ recipe: st()
428
428
  }), e = "FeedMe comprehensive template.xlsx";
429
- return Qe(U, e), e;
429
+ return We(U, e), e;
430
430
  }
431
- async function ct(U) {
431
+ async function at(U) {
432
432
  if (!U) return null;
433
433
  try {
434
- return st(U);
434
+ return et(U);
435
435
  } catch (e) {
436
436
  throw console.error("Error in processUnitsSheet:", e), e;
437
437
  }
438
438
  }
439
- async function pt(U) {
439
+ async function lt(U) {
440
440
  if (!U) return null;
441
441
  try {
442
- return et(U);
442
+ return Xe(U);
443
443
  } catch (e) {
444
444
  throw console.error("Error in processIngredientsSheet:", e), e;
445
445
  }
446
446
  }
447
- async function vt(U) {
447
+ async function mt(U) {
448
448
  if (!U) return null;
449
449
  try {
450
- const e = at(U);
451
- return it(e, { ignoreErrors: !0 });
450
+ const e = nt(U);
451
+ return tt(e, { ignoreErrors: !0 });
452
452
  } catch (e) {
453
453
  throw console.error("Error in processRecipesSheet:", e), e;
454
454
  }
455
455
  }
456
- const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8" }, ft = { class: "flex flex-col flex-1 gap-4" }, bt = { class: "fm-typo-en-body-md-600" }, ht = {
456
+ function re(U) {
457
+ return (U ?? []).filter((e) => !e.errors || e.errors.length === 0).map(({ errors: e, ...S }) => S);
458
+ }
459
+ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8" }, ct = { class: "flex flex-col flex-1 gap-4" }, pt = { class: "fm-typo-en-body-md-600" }, vt = {
457
460
  key: 2,
458
461
  class: "shrink-0"
459
- }, xt = {
462
+ }, yt = {
460
463
  key: 0,
461
464
  class: "flex flex-col"
462
- }, _t = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, wt = {
465
+ }, gt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ft = {
463
466
  key: 0,
464
467
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
465
- }, It = { class: "fm-typo-en-body-lg-600" }, Et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, St = /* @__PURE__ */ De({
468
+ }, bt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, xt = /* @__PURE__ */ Te({
466
469
  __name: "ImportDialog",
467
470
  setup(U) {
468
- const e = F(null), R = We();
469
- Oe();
470
- const g = F(!1), h = F(new Array()), E = F(null), x = F([]), r = F([]), l = J(() => !!h.value.length), s = J(() => !!E.value && x.value.length > 0), { t: u } = je();
471
- async function v(f) {
472
- h.value = [], E.value = null, x.value = [], r.value = [];
471
+ const e = F(null), S = Oe();
472
+ Ae();
473
+ const y = F(!1), b = F(new Array()), k = F(null), h = F([]), r = F([]), l = L(() => !!b.value.length), s = L(() => !!k.value && h.value.length > 0), { t: u } = Fe();
474
+ async function p(g) {
475
+ b.value = [], k.value = null, h.value = [], r.value = [];
473
476
  try {
474
- g.value = !0;
477
+ y.value = !0;
475
478
  const [d] = await Promise.all([
476
- Ye(f),
479
+ Le(g),
477
480
  // fake buffer for UX
478
481
  new Promise((o) => setTimeout(o, 1e3))
479
482
  ]);
480
- E.value = d, p();
483
+ k.value = d, c();
481
484
  } catch (d) {
482
- console.error("Error parsing Excel file:", d), h.value.push((d == null ? void 0 : d.message) || "Unknown error occurred");
485
+ console.error("Error parsing Excel file:", d), b.value.push((d == null ? void 0 : d.message) || "Unknown error occurred");
483
486
  } finally {
484
- g.value = !1;
487
+ y.value = !1;
485
488
  }
486
489
  }
487
- function p() {
488
- if (h.value = [], !E.value) return;
489
- const d = ["unit", "ingredient", "recipe"].filter((o) => E.value.Sheets[o]);
490
+ function c() {
491
+ if (b.value = [], !k.value) return;
492
+ const d = ["unit", "ingredient", "recipe"].filter((o) => k.value.Sheets[o]);
490
493
  if (d.length === 0) {
491
- h.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
494
+ b.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
492
495
  return;
493
496
  }
494
- x.value = d, R.emitData({ availableSheets: d, workbook: E.value });
497
+ h.value = d, S.emitData({ availableSheets: d, workbook: k.value });
495
498
  }
496
- ze(e, (f) => {
497
- f && v(f);
499
+ Be(e, (g) => {
500
+ g && p(g);
498
501
  });
499
- function b() {
500
- if (!E.value || x.value.length === 0) return "";
501
- const f = [];
502
- return x.value.forEach((d) => {
502
+ function f() {
503
+ if (!k.value || h.value.length === 0) return "";
504
+ const g = [];
505
+ return h.value.forEach((d) => {
503
506
  switch (d) {
504
507
  case "unit":
505
- f.push("Units sheet found");
508
+ g.push("Units sheet found");
506
509
  break;
507
510
  case "ingredient":
508
- f.push("Ingredients sheet found");
511
+ g.push("Ingredients sheet found");
509
512
  break;
510
513
  case "recipe":
511
- f.push("Recipes sheet found");
514
+ g.push("Recipes sheet found");
512
515
  break;
513
516
  }
514
- }), f.length > 0 ? `Ready to process: ${f.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
517
+ }), g.length > 0 ? `Ready to process: ${g.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
515
518
  }
516
- return (f, d) => {
517
- const o = Y("FmCircularProgress"), y = Y("FmIcon"), _ = Y("FmButton");
518
- return N(), D("div", yt, [
519
- A(ot, {
519
+ return (g, d) => {
520
+ const o = Q("FmCircularProgress"), v = Q("FmIcon"), w = Q("FmButton");
521
+ return T(), D("div", ut, [
522
+ A(Ye, {
520
523
  class: ce({
521
524
  "w-full": !0,
522
525
  "h-[200px]": !e.value
523
526
  }),
524
527
  accept: ".xlsx,.xls",
525
- onFileUpload: d[0] || (d[0] = (G) => e.value = G),
528
+ onFileUpload: d[0] || (d[0] = (N) => e.value = N),
526
529
  label: i(u)("inventory.ingredient.import.uploadTemplate"),
527
530
  "button-label": i(u)("inventory.ingredient.import.selectFile")
528
- }, Ke({ _: 2 }, [
531
+ }, Pe({ _: 2 }, [
529
532
  e.value ? {
530
533
  name: "default",
531
- fn: Q(({ openFileDialog: G }) => [
532
- n("div", gt, [
534
+ fn: q(({ openFileDialog: N }) => [
535
+ n("div", dt, [
533
536
  n("div", {
534
537
  class: ce([
535
538
  "fm-corner-radius-md p-16 flex items-center gap-16",
536
539
  {
537
- "border border-fm-color-neutral-gray-100": g.value,
538
- "border border-fm-color-neutral-gray-200": !g.value && !l.value,
540
+ "border border-fm-color-neutral-gray-100": y.value,
541
+ "border border-fm-color-neutral-gray-200": !y.value && !l.value,
539
542
  "border border-fm-color-system-error-200": l.value
540
543
  }
541
544
  ])
542
545
  }, [
543
- g.value ? (N(), se(o, {
546
+ y.value ? (T(), se(o, {
544
547
  key: 0,
545
548
  size: "md",
546
549
  color: "neutral-gray-200"
547
- })) : (N(), se(y, {
550
+ })) : (T(), se(v, {
548
551
  key: 1,
549
552
  name: l.value ? "error" : "check_circle",
550
553
  color: l.value ? "system-error-300" : "system-success-400",
551
554
  size: "lg"
552
555
  }, null, 8, ["name", "color"])),
553
- n("div", ft, [
554
- n("div", bt, a(e.value.name), 1),
556
+ n("div", ct, [
557
+ n("div", pt, a(e.value.name), 1),
555
558
  n("div", {
556
559
  class: ce([
557
560
  "fm-typo-en-body-sm-400",
@@ -562,105 +565,105 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
562
565
  ])
563
566
  }, a(l.value ? i(u)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
564
567
  ]),
565
- g.value ? Z("", !0) : (N(), D("div", ht, [
566
- A(_, {
568
+ y.value ? Y("", !0) : (T(), D("div", vt, [
569
+ A(w, {
567
570
  label: i(u)("inventory.ingredient.import.replaceFile"),
568
571
  variant: l.value ? "destructive" : "secondary",
569
572
  "prepend-icon": l.value ? void 0 : "autorenew",
570
- onClick: G
573
+ onClick: N
571
574
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
572
575
  ]))
573
576
  ], 2),
574
- h.value.length ? (N(), D("div", xt, [
575
- (N(!0), D(Be, null, Pe(h.value, (w, I) => (N(), D("div", {
576
- key: I,
577
+ b.value.length ? (T(), D("div", yt, [
578
+ (T(!0), D(Me, null, $e(b.value, (I, E) => (T(), D("div", {
579
+ key: E,
577
580
  class: "flex gap-8 items-center"
578
581
  }, [
579
- A(y, {
582
+ A(v, {
580
583
  name: "error",
581
584
  size: "sm",
582
585
  color: "system-error-300"
583
586
  }),
584
- n("div", _t, a(w), 1)
587
+ n("div", gt, a(I), 1)
585
588
  ]))), 128))
586
- ])) : Z("", !0)
589
+ ])) : Y("", !0)
587
590
  ])
588
591
  ]),
589
592
  key: "0"
590
593
  } : void 0
591
594
  ]), 1032, ["class", "label", "button-label"]),
592
- s.value ? (N(), D("div", wt, [
593
- n("div", It, a(i(u)("inventory.ingredient.import.summary")), 1),
594
- n("div", Et, a(b()), 1)
595
- ])) : Z("", !0)
595
+ s.value ? (T(), D("div", ft, [
596
+ n("div", bt, a(i(u)("inventory.ingredient.import.summary")), 1),
597
+ n("div", ht, a(f()), 1)
598
+ ])) : Y("", !0)
596
599
  ]);
597
600
  };
598
601
  }
599
- }), kt = {
602
+ }), _t = {
600
603
  key: 0,
601
604
  class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
602
- }, Rt = { class: "flex items-start gap-12" }, Ct = { class: "flex flex-col gap-8" }, Ut = { class: "fm-typo-en-body-md-400 text-blue-800" }, Gt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Nt = { class: "mb-8" }, Tt = ["innerHTML"], Mt = ["innerHTML"], $t = { class: "mb-8" }, Ft = { class: "mb-12" }, At = { class: "mb-12" }, Dt = { class: "mb-8" }, Bt = { class: "text-orange-600" }, Pt = {
605
+ }, wt = { class: "flex items-start gap-12" }, It = { class: "flex flex-col gap-8" }, Et = { class: "fm-typo-en-body-md-400 text-blue-800" }, St = { class: "fm-typo-en-body-sm-400 text-blue-700" }, kt = { class: "mb-8" }, Rt = ["innerHTML"], Ct = ["innerHTML"], Ut = { class: "mb-8" }, Gt = { class: "mb-12" }, Nt = { class: "mb-12" }, Tt = { class: "mb-8" }, Mt = { class: "text-orange-600" }, $t = {
603
606
  key: 1,
604
607
  class: "bg-white rounded-lg shadow"
605
- }, jt = { class: "flex items-center justify-between p-16 border-b" }, Ot = { class: "fm-typo-en-title-md-600" }, Ht = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, zt = {
608
+ }, Ft = { class: "flex items-center justify-between p-16 border-b" }, At = { class: "fm-typo-en-title-md-600" }, Dt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Bt = {
606
609
  key: 0,
607
610
  class: "text-red-600"
608
- }, Kt = {
611
+ }, Pt = {
609
612
  key: 1,
610
613
  class: "text-orange-600"
611
- }, Vt = {
614
+ }, jt = {
612
615
  key: 2,
613
616
  class: "text-green-600"
614
- }, Wt = { class: "flex gap-8" }, Lt = { class: "p-16" }, Jt = {
617
+ }, Ot = { class: "flex gap-8" }, Ht = { class: "p-16" }, zt = {
615
618
  key: 2,
616
619
  class: "bg-white rounded-lg shadow"
617
- }, Xt = { class: "flex items-center justify-between p-16 border-b" }, qt = { class: "fm-typo-en-title-md-600 text-red-800" }, Qt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Yt = { class: "flex gap-8" }, Zt = { class: "p-16" }, en = {
620
+ }, Kt = { class: "flex items-center justify-between p-16 border-b" }, Vt = { class: "fm-typo-en-title-md-600 text-red-800" }, Wt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Lt = { class: "flex gap-8" }, Jt = { class: "p-16" }, Xt = {
618
621
  key: 0,
619
622
  class: "flex flex-col gap-16 p-16"
620
- }, tn = { class: "fm-typo-en-title-sm-600 mb-12" }, nn = { class: "grid grid-cols-2 gap-12" }, on = { class: "fm-typo-en-body-sm-400 text-gray-600" }, rn = { class: "fm-typo-en-body-md-600" }, sn = { key: 0 }, an = { class: "fm-typo-en-body-sm-400 text-gray-600" }, ln = { class: "fm-typo-en-body-md-600" }, mn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, un = { class: "fm-typo-en-body-md-600" }, dn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, cn = { class: "fm-typo-en-body-md-600" }, pn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, vn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, yn = { class: "space-y-8" }, gn = { class: "fm-typo-en-body-md-400 text-red-800" }, fn = { class: "fm-typo-en-title-sm-600 mb-12" }, bn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, hn = { class: "text-sm" }, xn = { class: "flex gap-8" }, _n = { class: "flex flex-col items-center justify-center h-64 gap-16" }, wn = { class: "text-center" }, In = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, En = { class: "flex flex-col items-center justify-center h-64 gap-16" }, Sn = { class: "text-center" }, kn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, Rn = { class: "fm-typo-en-body-md-400 text-gray-500" }, Hn = /* @__PURE__ */ De({
623
+ }, qt = { class: "fm-typo-en-title-sm-600 mb-12" }, Qt = { class: "grid grid-cols-2 gap-12" }, Yt = { class: "fm-typo-en-body-sm-400 text-gray-600" }, Zt = { class: "fm-typo-en-body-md-600" }, en = { key: 0 }, tn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, nn = { class: "fm-typo-en-body-md-600" }, on = { class: "fm-typo-en-body-sm-400 text-gray-600" }, rn = { class: "fm-typo-en-body-md-600" }, sn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, an = { class: "fm-typo-en-body-md-600" }, ln = { class: "fm-typo-en-body-sm-400 text-gray-600" }, mn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, un = { class: "space-y-8" }, dn = { class: "fm-typo-en-body-md-400 text-red-800" }, cn = { class: "fm-typo-en-title-sm-600 mb-12" }, pn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, vn = { class: "text-sm" }, yn = { class: "flex gap-8" }, gn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, fn = { class: "text-center" }, bn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, hn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, xn = { class: "text-center" }, _n = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, wn = { class: "fm-typo-en-body-md-400 text-gray-500" }, Dn = /* @__PURE__ */ Te({
621
624
  __name: "ImportView",
622
625
  setup(U) {
623
- const { t: e } = je(), R = Le(), g = Oe();
624
- Ve();
625
- const h = Xe(), { breakpoints: E } = Je(), x = ie(), r = F("");
626
+ const { t: e } = Fe(), S = He(), y = Ae();
627
+ je();
628
+ const b = Ke(), { breakpoints: k } = ze(), h = ie(), r = F("");
626
629
  F(!1);
627
- const l = F(!1), s = F(null), u = F(!1), v = F(null), p = F(!1), b = F([]), f = F(null), d = F([]), o = F(!1), y = J(() => E.value.xs || E.value.sm), _ = J(() => y.value ? 10 : 20), G = J(() => {
630
+ const l = F(!1), s = F(null), u = F(!1), p = F(null), c = F(!1), f = F([]), g = F(null), d = F([]), o = F(!1), v = L(() => k.value.xs || k.value.sm), w = L(() => v.value ? 10 : 20), N = L(() => {
628
631
  const m = s.value;
629
632
  if (!m) return [];
630
- const t = [], { units: C, skus: B, recipes: W, _invalidExcel: z, _invalidExcelMessage: X } = m, q = (M) => {
633
+ const t = [], { units: G, skus: B, recipes: V, _invalidExcel: z, _invalidExcelMessage: J } = m, X = ($) => {
631
634
  var j;
632
- return ((j = M.errors) == null ? void 0 : j.length) > 0 ? Array.isArray(M.errors) ? M.errors.join(", ") : M.errors || e("inventory.common.validationFailed") : z ? X || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
633
- }, H = (M, O) => {
634
- if (M)
635
+ return ((j = $.errors) == null ? void 0 : j.length) > 0 ? Array.isArray($.errors) ? $.errors.join(", ") : $.errors || e("inventory.common.validationFailed") : z ? J || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
636
+ }, H = ($, O) => {
637
+ if ($)
635
638
  for (const j of ["create", "update"]) {
636
- const K = M[j];
639
+ const K = $[j];
637
640
  if (K)
638
641
  for (const P of K)
639
642
  t.push({
640
643
  name: P.name || P.abbrev || P.code || e("inventory.common.unknown"),
641
644
  type: O,
642
645
  operation: e(j === "create" ? "inventory.common.create" : "inventory.common.update"),
643
- status: q(P),
646
+ status: X(P),
644
647
  errors: P.errors || [],
645
648
  details: P
646
649
  });
647
650
  }
648
651
  };
649
- return H(C, e("inventory.common.unit")), H(B, e("inventory.common.ingredient")), H(W, e("inventory.common.recipe")), t;
650
- }), w = J(() => G.value.some(
652
+ return H(G, e("inventory.common.unit")), H(B, e("inventory.common.ingredient")), H(V, e("inventory.common.recipe")), t;
653
+ }), I = L(() => N.value.some(
651
654
  (m) => m.errors && m.errors.length > 0
652
- )), I = J(() => G.value.some(
655
+ )), E = L(() => N.value.some(
653
656
  (m) => m.status && m.status.includes("Invalid Excel")
654
- )), ee = J(() => {
655
- const m = G.value.find(
657
+ )), Z = L(() => {
658
+ const m = N.value.find(
656
659
  (t) => t.status && t.status.includes("Invalid Excel")
657
660
  );
658
661
  return (m == null ? void 0 : m.status) || e("inventory.common.invalidExcelFormatDetected");
659
- }), ve = J(() => !d.value || d.value.length === 0 ? [] : d.value.map((m, t) => {
660
- var C, B;
662
+ }), ve = L(() => !d.value || d.value.length === 0 ? [] : d.value.map((m, t) => {
663
+ var G, B;
661
664
  return {
662
665
  id: t + 1,
663
- name: ((C = m.error.data) == null ? void 0 : C.name) || e("inventory.common.unknown"),
666
+ name: ((G = m.error.data) == null ? void 0 : G.name) || e("inventory.common.unknown"),
664
667
  type: m.type || e("inventory.common.general"),
665
668
  message: ((B = m.error) == null ? void 0 : B.message) || JSON.stringify(m.error)
666
669
  };
@@ -672,9 +675,9 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
672
675
  }
673
676
  }
674
677
  function ge() {
675
- R.open({
678
+ S.open({
676
679
  title: e("inventory.common.import"),
677
- contentComponent: St,
680
+ contentComponent: xt,
678
681
  overlay: !0,
679
682
  closeButton: !0,
680
683
  primaryActions: {
@@ -691,17 +694,17 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
691
694
  variant: "plain"
692
695
  }
693
696
  }).onPrimary(async (m) => {
694
- m && m.workbook && m.availableSheets && (await fe(m), R.close()), b.value.length === 0 && R.close();
697
+ m && m.workbook && m.availableSheets && (await fe(m), S.close()), f.value.length === 0 && S.close();
695
698
  }).onTertiary(() => {
696
699
  try {
697
- const m = dt();
698
- g.open({
700
+ const m = it();
701
+ y.open({
699
702
  title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
700
703
  message: e("inventory.common.templateDownloaded", [m]),
701
704
  type: "success"
702
705
  });
703
706
  } catch (m) {
704
- g.open({
707
+ y.open({
705
708
  title: e("inventory.common.downloadFailed"),
706
709
  message: e("inventory.common.failedDownloadTemplate"),
707
710
  type: "error"
@@ -710,78 +713,78 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
710
713
  });
711
714
  }
712
715
  async function fe(m) {
713
- f.value = m.workbook, b.value = [...m.availableSheets], s.value = {}, d.value = [], await ae();
716
+ g.value = m.workbook, f.value = [...m.availableSheets], s.value = {}, d.value = [], await ae();
714
717
  }
715
718
  async function ae() {
716
- var t, C, B, W, z, X, q, H, M, O, j, K, P, me, ue;
717
- if (!f.value || b.value.length === 0) {
719
+ var t, G, B, V, z, J, X, H, $, O, j, K, P, me, ue;
720
+ if (!g.value || f.value.length === 0) {
718
721
  u.value = !0;
719
722
  return;
720
723
  }
721
- const m = b.value[0];
724
+ const m = f.value[0];
722
725
  try {
723
726
  switch (m) {
724
727
  case "unit": {
725
- const L = f.value.Sheets.unit, S = await ct(L);
726
- S && (s.value = {
728
+ const W = g.value.Sheets.unit, R = await at(W);
729
+ R && (s.value = {
727
730
  ...s.value,
728
- _invalidExcel: S.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
729
- _invalidExcelMessage: S.invalidExcelMessage || ((C = s.value) == null ? void 0 : C._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
730
- units: S.importCreateResult || S.importUpdateResult ? {
731
- create: ((B = S.importCreateResult) == null ? void 0 : B.map(($) => ({
732
- ...$.unit,
733
- errors: $.errors
731
+ _invalidExcel: R.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
732
+ _invalidExcelMessage: R.invalidExcelMessage || ((G = s.value) == null ? void 0 : G._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
733
+ units: R.importCreateResult || R.importUpdateResult ? {
734
+ create: ((B = R.importCreateResult) == null ? void 0 : B.map((x) => ({
735
+ ...x.unit,
736
+ errors: x.errors
734
737
  }))) || [],
735
- update: ((W = S.importUpdateResult) == null ? void 0 : W.map(($) => ({
736
- ...$.unit,
737
- errors: $.errors
738
+ update: ((V = R.importUpdateResult) == null ? void 0 : V.map((x) => ({
739
+ ...x.unit,
740
+ errors: x.errors
738
741
  }))) || []
739
742
  } : (z = s.value) == null ? void 0 : z.units
740
743
  });
741
744
  break;
742
745
  }
743
746
  case "ingredient": {
744
- const L = f.value.Sheets.ingredient, S = await pt(L);
745
- S && (s.value = {
747
+ const W = g.value.Sheets.ingredient, R = await lt(W);
748
+ R && (s.value = {
746
749
  ...s.value,
747
- _invalidExcel: S.invalidExcel || ((X = s.value) == null ? void 0 : X._invalidExcel),
748
- _invalidExcelMessage: S.invalidExcelMessage || ((q = s.value) == null ? void 0 : q._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
749
- skus: S.importCreateResult || S.importUpdateResult ? {
750
- create: ((H = S.importCreateResult) == null ? void 0 : H.map(($) => ({
751
- ...$.sku,
752
- errors: $.errors
750
+ _invalidExcel: R.invalidExcel || ((J = s.value) == null ? void 0 : J._invalidExcel),
751
+ _invalidExcelMessage: R.invalidExcelMessage || ((X = s.value) == null ? void 0 : X._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
752
+ skus: R.importCreateResult || R.importUpdateResult ? {
753
+ create: ((H = R.importCreateResult) == null ? void 0 : H.map((x) => ({
754
+ ...x.sku,
755
+ errors: x.errors
753
756
  }))) || [],
754
- update: ((M = S.importUpdateResult) == null ? void 0 : M.map(($) => ({
755
- ...$.sku,
756
- errors: $.errors
757
+ update: (($ = R.importUpdateResult) == null ? void 0 : $.map((x) => ({
758
+ ...x.sku,
759
+ errors: x.errors
757
760
  }))) || []
758
761
  } : (O = s.value) == null ? void 0 : O.skus
759
762
  });
760
763
  break;
761
764
  }
762
765
  case "recipe": {
763
- const L = f.value.Sheets.recipe, S = await vt(L);
764
- S && (s.value = {
766
+ const W = g.value.Sheets.recipe, R = await mt(W);
767
+ R && (s.value = {
765
768
  ...s.value,
766
- _invalidExcel: S.invalidExcel || ((j = s.value) == null ? void 0 : j._invalidExcel),
767
- _invalidExcelMessage: S.invalidExcelMessage || ((K = s.value) == null ? void 0 : K._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
768
- recipes: S.importCreateResult || S.importUpdateResult ? {
769
- create: ((P = S.importCreateResult) == null ? void 0 : P.map(($) => ({
770
- ...$.recipe,
771
- errors: $.errors
769
+ _invalidExcel: R.invalidExcel || ((j = s.value) == null ? void 0 : j._invalidExcel),
770
+ _invalidExcelMessage: R.invalidExcelMessage || ((K = s.value) == null ? void 0 : K._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
771
+ recipes: R.importCreateResult || R.importUpdateResult ? {
772
+ create: ((P = R.importCreateResult) == null ? void 0 : P.map((x) => ({
773
+ ...x.recipe,
774
+ errors: x.errors
772
775
  }))) || [],
773
- update: ((me = S.importUpdateResult) == null ? void 0 : me.map(($) => ({
774
- ...$.recipe,
775
- errors: $.errors
776
+ update: ((me = R.importUpdateResult) == null ? void 0 : me.map((x) => ({
777
+ ...x.recipe,
778
+ errors: x.errors
776
779
  }))) || []
777
780
  } : (ue = s.value) == null ? void 0 : ue.recipes
778
781
  });
779
782
  break;
780
783
  }
781
784
  }
782
- b.value.shift(), u.value = !0;
783
- } catch (L) {
784
- console.error(`Error processing ${m} sheet:`, L), g.open({
785
+ f.value.shift(), u.value = !0;
786
+ } catch (W) {
787
+ console.error(`Error processing ${m} sheet:`, W), y.open({
785
788
  title: e("inventory.common.processingError"),
786
789
  message: e("inventory.common.failedToProcessSheet", [m]),
787
790
  type: "error"
@@ -789,18 +792,18 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
789
792
  }
790
793
  }
791
794
  async function be() {
792
- var m, t, C, B, W, z, X, q, H, M, O, j, K, P, me, ue, L, S, $, Ue, Ge, Ne, Te, Me;
795
+ var m, t, G, B, V, z, J, X, H, $, O, j, K, P, me, ue, W, R;
793
796
  if (s.value) {
794
- if (I.value) {
795
- g.open({
797
+ if (E.value) {
798
+ y.open({
796
799
  title: e("inventory.common.invalidExcelFormatTitle"),
797
- message: ee.value,
800
+ message: Z.value,
798
801
  type: "error"
799
802
  });
800
803
  return;
801
804
  }
802
- if (w.value) {
803
- g.open({
805
+ if (I.value) {
806
+ y.open({
804
807
  title: e("inventory.ingredient.import.error.invalidContent"),
805
808
  message: e("inventory.ingredient.import.error.hasErrors"),
806
809
  type: "error"
@@ -809,115 +812,115 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
809
812
  }
810
813
  l.value = !0;
811
814
  try {
812
- let V = 0, oe = "";
815
+ let x = 0, ne = "";
813
816
  if (s.value.units && ((m = s.value.units.create) != null && m.length || (t = s.value.units.update) != null && t.length)) {
814
- const T = {
815
- create: ((C = s.value.units.create) == null ? void 0 : C.filter((c) => !c.errors || c.errors.length === 0)) || [],
816
- update: ((B = s.value.units.update) == null ? void 0 : B.filter((c) => !c.errors || c.errors.length === 0)) || []
817
+ const M = {
818
+ create: re(s.value.units.create),
819
+ update: re(s.value.units.update)
817
820
  };
818
- if (T.create.length || T.update.length) {
819
- const c = await x.importUnits(T);
820
- ((W = c == null ? void 0 : c.errors) == null ? void 0 : W.length) > 0 && d.value.push(...c.errors.map((re) => ({
821
+ if (M.create.length || M.update.length) {
822
+ const _ = await h.importUnits(M);
823
+ ((G = _ == null ? void 0 : _.errors) == null ? void 0 : G.length) > 0 && d.value.push(..._.errors.map((oe) => ({
821
824
  type: "units",
822
- error: re
825
+ error: oe
823
826
  })));
824
- const te = T.create.length + T.update.length, ne = ((z = c == null ? void 0 : c.errors) == null ? void 0 : z.length) || 0;
825
- V = te - ne, oe = "units", s.value = {
827
+ const ee = M.create.length + M.update.length, te = ((B = _ == null ? void 0 : _.errors) == null ? void 0 : B.length) || 0;
828
+ x = ee - te, ne = "units", s.value = {
826
829
  ...s.value,
827
830
  units: null
828
831
  };
829
832
  }
830
- } else if (s.value.skus && ((X = s.value.skus.create) != null && X.length || (q = s.value.skus.update) != null && q.length)) {
831
- const T = {
832
- create: ((H = s.value.skus.create) == null ? void 0 : H.filter((c) => !c.errors || c.errors.length === 0)) || [],
833
- update: ((M = s.value.skus.update) == null ? void 0 : M.filter((c) => !c.errors || c.errors.length === 0)) || []
833
+ } else if (s.value.skus && ((V = s.value.skus.create) != null && V.length || (z = s.value.skus.update) != null && z.length)) {
834
+ const M = {
835
+ create: re(s.value.skus.create),
836
+ update: re(s.value.skus.update)
834
837
  };
835
- if (T.create.length || T.update.length) {
836
- const c = await x.importSkus(T);
837
- ((O = c == null ? void 0 : c.errors) == null ? void 0 : O.length) > 0 && d.value.push(...c.errors.map((re) => ({
838
+ if (M.create.length || M.update.length) {
839
+ const _ = await h.importSkus(M);
840
+ ((J = _ == null ? void 0 : _.errors) == null ? void 0 : J.length) > 0 && d.value.push(..._.errors.map((oe) => ({
838
841
  type: "ingredients",
839
- error: re
842
+ error: oe
840
843
  })));
841
- const te = T.create.length + T.update.length, ne = ((j = c == null ? void 0 : c.errors) == null ? void 0 : j.length) || 0;
842
- V = te - ne, oe = "ingredients", s.value = {
844
+ const ee = M.create.length + M.update.length, te = ((X = _ == null ? void 0 : _.errors) == null ? void 0 : X.length) || 0;
845
+ x = ee - te, ne = "ingredients", s.value = {
843
846
  ...s.value,
844
847
  skus: null
845
848
  };
846
849
  }
847
- } else if (s.value.recipes && ((K = s.value.recipes.create) != null && K.length || (P = s.value.recipes.update) != null && P.length)) {
848
- const T = {
849
- create: ((me = s.value.recipes.create) == null ? void 0 : me.filter((c) => !c.errors || c.errors.length === 0)) || [],
850
- update: ((ue = s.value.recipes.update) == null ? void 0 : ue.filter((c) => !c.errors || c.errors.length === 0)) || []
850
+ } else if (s.value.recipes && ((H = s.value.recipes.create) != null && H.length || ($ = s.value.recipes.update) != null && $.length)) {
851
+ const M = {
852
+ create: re(s.value.recipes.create),
853
+ update: re(s.value.recipes.update)
851
854
  };
852
- if (T.create.length || T.update.length) {
853
- const c = await x.importRecipes(T);
854
- ((L = c == null ? void 0 : c.errors) == null ? void 0 : L.length) > 0 && d.value.push(...c.errors.map((re) => ({
855
+ if (M.create.length || M.update.length) {
856
+ const _ = await h.importRecipes(M);
857
+ ((O = _ == null ? void 0 : _.errors) == null ? void 0 : O.length) > 0 && d.value.push(..._.errors.map((oe) => ({
855
858
  type: "recipes",
856
- error: re
859
+ error: oe
857
860
  })));
858
- const te = T.create.length + T.update.length, ne = ((S = c == null ? void 0 : c.errors) == null ? void 0 : S.length) || 0;
859
- V = te - ne, oe = "recipes", s.value = {
861
+ const ee = M.create.length + M.update.length, te = ((j = _ == null ? void 0 : _.errors) == null ? void 0 : j.length) || 0;
862
+ x = ee - te, ne = "recipes", s.value = {
860
863
  ...s.value,
861
864
  recipes: null
862
865
  };
863
866
  }
864
867
  }
865
- if (V > 0) {
866
- const T = d.value.filter((c) => c.type === oe);
867
- T.length > 0 ? g.open({
868
+ if (x > 0) {
869
+ const M = d.value.filter((_) => _.type === ne);
870
+ M.length > 0 ? y.open({
868
871
  title: e("inventory.common.importCompletedWithIssues"),
869
- message: e("inventory.common.successfullyImported", [V, oe, T.length, oe]),
872
+ message: e("inventory.common.successfullyImported", [x, ne, M.length, ne]),
870
873
  type: "warning"
871
- }) : g.open({
874
+ }) : y.open({
872
875
  title: e("inventory.ingredient.import.success"),
873
- message: e("inventory.common.successfullyImported", [V, oe, "0", ""]),
876
+ message: e("inventory.common.successfullyImported", [x, ne, "0", ""]),
874
877
  type: "success"
875
878
  });
876
879
  }
877
- if (b.value.length > 0)
880
+ if (f.value.length > 0)
878
881
  await ae();
879
- else if (!(s.value.units && ((($ = s.value.units.create) == null ? void 0 : $.length) || ((Ue = s.value.units.update) == null ? void 0 : Ue.length)) || s.value.skus && (((Ge = s.value.skus.create) == null ? void 0 : Ge.length) || ((Ne = s.value.skus.update) == null ? void 0 : Ne.length)) || s.value.recipes && (((Te = s.value.recipes.create) == null ? void 0 : Te.length) || ((Me = s.value.recipes.update) == null ? void 0 : Me.length))))
882
+ else if (!(s.value.units && (((K = s.value.units.create) == null ? void 0 : K.length) || ((P = s.value.units.update) == null ? void 0 : P.length)) || s.value.skus && (((me = s.value.skus.create) == null ? void 0 : me.length) || ((ue = s.value.skus.update) == null ? void 0 : ue.length)) || s.value.recipes && (((W = s.value.recipes.create) == null ? void 0 : W.length) || ((R = s.value.recipes.update) == null ? void 0 : R.length))))
880
883
  if (le(), d.value.length > 0) {
881
- const c = d.value.filter((de) => de.type === "units").length, te = d.value.filter((de) => de.type === "ingredients").length, ne = d.value.filter((de) => de.type === "recipes").length, re = c + te + ne;
882
- o.value = !0, g.open({
884
+ const _ = d.value.filter((de) => de.type === "units").length, ee = d.value.filter((de) => de.type === "ingredients").length, te = d.value.filter((de) => de.type === "recipes").length, oe = _ + ee + te;
885
+ o.value = !0, y.open({
883
886
  title: e("inventory.common.importCompletedWithIssues"),
884
- message: e("inventory.common.importFinishedWithFailedItems", [re, c, te, ne]),
887
+ message: e("inventory.common.importFinishedWithFailedItems", [oe, _, ee, te]),
885
888
  type: "warning"
886
889
  }), console.error("Import errors:", d.value);
887
890
  } else
888
- g.open({
891
+ y.open({
889
892
  title: e("inventory.common.importComplete"),
890
893
  message: e("inventory.common.allDataSuccessfullyImported"),
891
894
  type: "success"
892
895
  });
893
- } catch (V) {
894
- g.open({
896
+ } catch (x) {
897
+ y.open({
895
898
  title: e("inventory.ingredient.import.error.failed"),
896
- message: (V == null ? void 0 : V.message) || e("inventory.common.unknownErrorOccurred"),
899
+ message: (x == null ? void 0 : x.message) || e("inventory.common.unknownErrorOccurred"),
897
900
  type: "error"
898
- }), console.error("Error during import:", V);
901
+ }), console.error("Error during import:", x);
899
902
  } finally {
900
903
  l.value = !1;
901
904
  }
902
905
  }
903
906
  }
904
907
  function le() {
905
- u.value = !1, o.value = !1, s.value = null, b.value = [], f.value = null;
908
+ u.value = !1, o.value = !1, s.value = null, f.value = [], g.value = null;
906
909
  }
907
910
  function he() {
908
911
  o.value = !1, d.value = [];
909
912
  }
910
913
  function xe() {
911
- p.value = !1, v.value = null;
914
+ c.value = !1, p.value = null;
912
915
  }
913
- const _e = J(() => [
916
+ const _e = L(() => [
914
917
  {
915
918
  label: e("inventory.common.import"),
916
919
  value: "import",
917
920
  isPrimary: !1,
918
921
  prependIcon: "upload"
919
922
  }
920
- ]), we = $e([
923
+ ]), we = Ue([
921
924
  {
922
925
  id: "name",
923
926
  accessorKey: "name",
@@ -943,11 +946,11 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
943
946
  size: 120,
944
947
  cell: (m) => {
945
948
  const t = m.row.original.status;
946
- let C = "px-8 py-4 rounded";
947
- return t === e("inventory.common.readyToImport") ? C += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? C += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? C += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? C += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), C += " bg-red-100 text-red-800 border border-red-200"), Ie("div", { class: C, title: t }, t);
949
+ let G = "px-8 py-4 rounded";
950
+ return t === e("inventory.common.readyToImport") ? G += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? G += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? G += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? G += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), G += " bg-red-100 text-red-800 border border-red-200"), Ie("div", { class: G, title: t }, t);
948
951
  }
949
952
  }
950
- ]), Se = $e([
953
+ ]), Se = Ue([
951
954
  {
952
955
  id: "name",
953
956
  accessorKey: "name",
@@ -959,8 +962,8 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
959
962
  accessorKey: "type",
960
963
  header: () => e("inventory.common.errorType"),
961
964
  cell: (m) => {
962
- const t = m.row.original.type, C = e(t === "units" ? "inventory.common.unit" : t === "ingredients" ? "inventory.common.ingredient" : t === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
963
- return Ie("div", { class: "text-gray-800 text-sm py-2" }, C);
965
+ const t = m.row.original.type, G = e(t === "units" ? "inventory.common.unit" : t === "ingredients" ? "inventory.common.ingredient" : t === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
966
+ return Ie("div", { class: "text-gray-800 text-sm py-2" }, G);
964
967
  }
965
968
  },
966
969
  {
@@ -975,140 +978,140 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
975
978
  }
976
979
  ]);
977
980
  return (m, t) => {
978
- const C = Y("FmIcon"), B = Y("FmButton"), W = Y("FmTable"), z = Y("FmCard"), X = Y("FmSideSheet"), q = Y("FmSpinner");
979
- return i(h).isLoaded && i(h).enableBulkImport ? (N(), se(ke, {
981
+ const G = Q("FmIcon"), B = Q("FmButton"), V = Q("FmTable"), z = Q("FmCard"), J = Q("FmSideSheet"), X = Q("FmSpinner");
982
+ return i(b).isLoaded && i(b).enableBulkImport ? (T(), se(ke, {
980
983
  key: 0,
981
984
  title: i(e)("inventory.common.import"),
982
985
  actions: _e.value,
983
986
  "onClick:action": ye
984
987
  }, {
985
- default: Q(() => {
988
+ default: q(() => {
986
989
  var H;
987
990
  return [
988
991
  n("div", {
989
992
  class: ce([
990
993
  "flex flex-col gap-8 max-h-full",
991
994
  {
992
- "p-0": y.value,
993
- "px-24": !y.value
995
+ "p-0": v.value,
996
+ "px-24": !v.value
994
997
  }
995
998
  ])
996
999
  }, [
997
- u.value ? Z("", !0) : (N(), D("div", kt, [
998
- n("div", Rt, [
999
- A(C, {
1000
+ u.value ? Y("", !0) : (T(), D("div", _t, [
1001
+ n("div", wt, [
1002
+ A(G, {
1000
1003
  name: "info",
1001
1004
  class: "text-blue-600 mt-2"
1002
1005
  }),
1003
- n("div", Ct, [
1004
- n("div", Ut, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
1005
- n("div", Gt, [
1006
- n("div", Nt, [
1006
+ n("div", It, [
1007
+ n("div", Et, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
1008
+ n("div", St, [
1009
+ n("div", kt, [
1007
1010
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1008
1011
  ]),
1009
- t[39] || (t[39] = k(" 1. ")),
1012
+ t[39] || (t[39] = C(" 1. ")),
1010
1013
  n("span", {
1011
1014
  innerHTML: i(e)("inventory.ingredient.import.importInstructions.step1")
1012
- }, null, 8, Tt),
1015
+ }, null, 8, Rt),
1013
1016
  t[40] || (t[40] = n("br", null, null, -1)),
1014
- t[41] || (t[41] = k(" 2. ")),
1017
+ t[41] || (t[41] = C(" 2. ")),
1015
1018
  n("span", {
1016
1019
  innerHTML: i(e)("inventory.ingredient.import.importInstructions.step2")
1017
- }, null, 8, Mt),
1020
+ }, null, 8, Ct),
1018
1021
  t[42] || (t[42] = n("br", null, null, -1)),
1019
- k(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1022
+ C(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1020
1023
  t[43] || (t[43] = n("br", null, null, -1)),
1021
- k(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1024
+ C(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1022
1025
  t[44] || (t[44] = n("br", null, null, -1)),
1023
1026
  t[45] || (t[45] = n("br", null, null, -1)),
1024
- n("div", $t, [
1027
+ n("div", Ut, [
1025
1028
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1026
1029
  ]),
1027
- n("div", Ft, [
1030
+ n("div", Gt, [
1028
1031
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
1029
- k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1032
+ C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1030
1033
  t[1] || (t[1] = n("br", null, null, -1)),
1031
- t[2] || (t[2] = k(" • ")),
1034
+ t[2] || (t[2] = C(" • ")),
1032
1035
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col1")), 1),
1033
1036
  t[3] || (t[3] = n("br", null, null, -1)),
1034
- t[4] || (t[4] = k(" • ")),
1037
+ t[4] || (t[4] = C(" • ")),
1035
1038
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col2")), 1),
1036
1039
  t[5] || (t[5] = n("br", null, null, -1)),
1037
- t[6] || (t[6] = k(" • ")),
1040
+ t[6] || (t[6] = C(" • ")),
1038
1041
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col3")), 1),
1039
1042
  t[7] || (t[7] = n("br", null, null, -1)),
1040
- t[8] || (t[8] = k(" • ")),
1043
+ t[8] || (t[8] = C(" • ")),
1041
1044
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col4")), 1),
1042
1045
  t[9] || (t[9] = n("br", null, null, -1)),
1043
- t[10] || (t[10] = k(" • ")),
1046
+ t[10] || (t[10] = C(" • ")),
1044
1047
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col5")), 1),
1045
1048
  t[11] || (t[11] = n("br", null, null, -1)),
1046
- t[12] || (t[12] = k(" • ")),
1049
+ t[12] || (t[12] = C(" • ")),
1047
1050
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
1048
1051
  ]),
1049
- n("div", At, [
1052
+ n("div", Nt, [
1050
1053
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
1051
- k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1054
+ C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1052
1055
  t[13] || (t[13] = n("br", null, null, -1)),
1053
- t[14] || (t[14] = k(" • ")),
1056
+ t[14] || (t[14] = C(" • ")),
1054
1057
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col1")), 1),
1055
1058
  t[15] || (t[15] = n("br", null, null, -1)),
1056
- t[16] || (t[16] = k(" • ")),
1059
+ t[16] || (t[16] = C(" • ")),
1057
1060
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col2")), 1),
1058
1061
  t[17] || (t[17] = n("br", null, null, -1)),
1059
- t[18] || (t[18] = k(" • ")),
1062
+ t[18] || (t[18] = C(" • ")),
1060
1063
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col3")), 1),
1061
1064
  t[19] || (t[19] = n("br", null, null, -1)),
1062
- t[20] || (t[20] = k(" • ")),
1065
+ t[20] || (t[20] = C(" • ")),
1063
1066
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col4")), 1),
1064
1067
  t[21] || (t[21] = n("br", null, null, -1)),
1065
- t[22] || (t[22] = k(" • ")),
1068
+ t[22] || (t[22] = C(" • ")),
1066
1069
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
1067
1070
  ]),
1068
- n("div", Dt, [
1071
+ n("div", Tt, [
1069
1072
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
1070
- k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1073
+ C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1071
1074
  t[23] || (t[23] = n("br", null, null, -1)),
1072
- t[24] || (t[24] = k(" • ")),
1075
+ t[24] || (t[24] = C(" • ")),
1073
1076
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col1")), 1),
1074
1077
  t[25] || (t[25] = n("br", null, null, -1)),
1075
- t[26] || (t[26] = k(" • ")),
1078
+ t[26] || (t[26] = C(" • ")),
1076
1079
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col2")), 1),
1077
1080
  t[27] || (t[27] = n("br", null, null, -1)),
1078
- t[28] || (t[28] = k(" • ")),
1081
+ t[28] || (t[28] = C(" • ")),
1079
1082
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col3")), 1),
1080
1083
  t[29] || (t[29] = n("br", null, null, -1)),
1081
- t[30] || (t[30] = k(" • ")),
1084
+ t[30] || (t[30] = C(" • ")),
1082
1085
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col4")), 1),
1083
1086
  t[31] || (t[31] = n("br", null, null, -1)),
1084
- t[32] || (t[32] = k(" • ")),
1087
+ t[32] || (t[32] = C(" • ")),
1085
1088
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col5")), 1),
1086
1089
  t[33] || (t[33] = n("br", null, null, -1)),
1087
- t[34] || (t[34] = k(" • ")),
1090
+ t[34] || (t[34] = C(" • ")),
1088
1091
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col6")), 1),
1089
1092
  t[35] || (t[35] = n("br", null, null, -1)),
1090
- t[36] || (t[36] = k(" • ")),
1093
+ t[36] || (t[36] = C(" • ")),
1091
1094
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col7")), 1),
1092
1095
  t[37] || (t[37] = n("br", null, null, -1)),
1093
- t[38] || (t[38] = k(" • ")),
1096
+ t[38] || (t[38] = C(" • ")),
1094
1097
  n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
1095
1098
  ]),
1096
- n("div", Bt, [
1099
+ n("div", Mt, [
1097
1100
  n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
1098
1101
  ])
1099
1102
  ])
1100
1103
  ])
1101
1104
  ])
1102
1105
  ])),
1103
- u.value ? (N(), D("div", Pt, [
1104
- n("div", jt, [
1106
+ u.value ? (T(), D("div", $t, [
1107
+ n("div", Ft, [
1105
1108
  n("div", null, [
1106
- n("div", Ot, a(i(e)("inventory.common.importPreview")), 1),
1107
- n("div", Ht, [
1108
- I.value ? (N(), D("span", zt, a(i(e)("inventory.common.errorExist")) + ": " + a(ee.value), 1)) : w.value ? (N(), D("span", Kt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (N(), D("span", Vt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
1109
+ n("div", At, a(i(e)("inventory.common.importPreview")), 1),
1110
+ n("div", Dt, [
1111
+ E.value ? (T(), D("span", Bt, a(i(e)("inventory.common.errorExist")) + ": " + a(Z.value), 1)) : I.value ? (T(), D("span", Pt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (T(), D("span", jt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
1109
1112
  ])
1110
1113
  ]),
1111
- n("div", Wt, [
1114
+ n("div", Ot, [
1112
1115
  A(B, {
1113
1116
  variant: "secondary",
1114
1117
  onClick: le,
@@ -1118,29 +1121,29 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
1118
1121
  variant: "primary",
1119
1122
  onClick: be,
1120
1123
  loading: l.value,
1121
- disabled: l.value || w.value || I.value,
1124
+ disabled: l.value || I.value || E.value,
1122
1125
  label: i(e)("inventory.common.import")
1123
1126
  }, null, 8, ["loading", "disabled", "label"])
1124
1127
  ])
1125
1128
  ]),
1126
- n("div", Lt, [
1127
- A(W, {
1129
+ n("div", Ht, [
1130
+ A(V, {
1128
1131
  "column-defs": we.value,
1129
- "row-data": G.value,
1130
- "page-size": _.value,
1132
+ "row-data": N.value,
1133
+ "page-size": w.value,
1131
1134
  "search-value": r.value,
1132
1135
  loading: !1,
1133
1136
  "row-hover": ""
1134
1137
  }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1135
1138
  ])
1136
- ])) : Z("", !0),
1137
- o.value && d.value.length > 0 ? (N(), D("div", Jt, [
1138
- n("div", Xt, [
1139
+ ])) : Y("", !0),
1140
+ o.value && d.value.length > 0 ? (T(), D("div", zt, [
1141
+ n("div", Kt, [
1139
1142
  n("div", null, [
1140
- n("div", qt, a(i(e)("inventory.common.importErrors")), 1),
1141
- n("div", Qt, a(d.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
1143
+ n("div", Vt, a(i(e)("inventory.common.importErrors")), 1),
1144
+ n("div", Wt, a(d.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
1142
1145
  ]),
1143
- n("div", Yt, [
1146
+ n("div", Lt, [
1144
1147
  A(B, {
1145
1148
  variant: "secondary",
1146
1149
  onClick: he,
@@ -1148,27 +1151,27 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
1148
1151
  }, null, 8, ["label"])
1149
1152
  ])
1150
1153
  ]),
1151
- n("div", Zt, [
1152
- A(W, {
1154
+ n("div", Jt, [
1155
+ A(V, {
1153
1156
  "column-defs": Se.value,
1154
1157
  "row-data": ve.value,
1155
- "page-size": _.value,
1158
+ "page-size": w.value,
1156
1159
  "search-value": r.value,
1157
1160
  loading: !1,
1158
1161
  "row-hover": ""
1159
1162
  }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1160
1163
  ])
1161
- ])) : Z("", !0)
1164
+ ])) : Y("", !0)
1162
1165
  ], 2),
1163
- A(X, {
1164
- "model-value": p.value,
1165
- "onUpdate:modelValue": t[0] || (t[0] = (M) => p.value = M),
1166
- header: `${(H = v.value) == null ? void 0 : H.type} Details`,
1166
+ A(J, {
1167
+ "model-value": c.value,
1168
+ "onUpdate:modelValue": t[0] || (t[0] = ($) => c.value = $),
1169
+ header: `${(H = p.value) == null ? void 0 : H.type} Details`,
1167
1170
  "max-width": 600,
1168
1171
  "dismiss-away": ""
1169
1172
  }, {
1170
- "side-sheet-footer": Q(() => [
1171
- n("div", xn, [
1173
+ "side-sheet-footer": q(() => [
1174
+ n("div", yn, [
1172
1175
  A(B, {
1173
1176
  label: i(e)("inventory.common.close"),
1174
1177
  variant: "tertiary",
@@ -1176,116 +1179,116 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
1176
1179
  }, null, 8, ["label"])
1177
1180
  ])
1178
1181
  ]),
1179
- default: Q(() => [
1180
- v.value != null ? (N(), D("div", en, [
1182
+ default: q(() => [
1183
+ p.value != null ? (T(), D("div", Xt, [
1181
1184
  A(z, {
1182
1185
  variant: "outlined",
1183
1186
  class: "p-16"
1184
1187
  }, {
1185
- default: Q(() => {
1186
- var M, O, j, K, P;
1188
+ default: q(() => {
1189
+ var $, O, j, K, P;
1187
1190
  return [
1188
- n("div", tn, a(i(e)("inventory.common.basicInformation")), 1),
1189
- n("div", nn, [
1191
+ n("div", qt, a(i(e)("inventory.common.basicInformation")), 1),
1192
+ n("div", Qt, [
1190
1193
  n("div", null, [
1191
- n("div", on, a(i(e)("inventory.common.name")), 1),
1192
- n("div", rn, a(((O = (M = v.value) == null ? void 0 : M.details) == null ? void 0 : O.name) || ((j = v.value) == null ? void 0 : j.name)), 1)
1194
+ n("div", Yt, a(i(e)("inventory.common.name")), 1),
1195
+ n("div", Zt, a(((O = ($ = p.value) == null ? void 0 : $.details) == null ? void 0 : O.name) || ((j = p.value) == null ? void 0 : j.name)), 1)
1193
1196
  ]),
1194
- (P = (K = v.value) == null ? void 0 : K.details) != null && P.code ? (N(), D("div", sn, [
1195
- n("div", an, a(i(e)("inventory.common.code")), 1),
1196
- n("div", ln, a(v.value.details.code), 1)
1197
- ])) : Z("", !0),
1197
+ (P = (K = p.value) == null ? void 0 : K.details) != null && P.code ? (T(), D("div", en, [
1198
+ n("div", tn, a(i(e)("inventory.common.code")), 1),
1199
+ n("div", nn, a(p.value.details.code), 1)
1200
+ ])) : Y("", !0),
1198
1201
  n("div", null, [
1199
- n("div", mn, a(i(e)("inventory.common.type")), 1),
1200
- n("div", un, a(v.value.type), 1)
1202
+ n("div", on, a(i(e)("inventory.common.type")), 1),
1203
+ n("div", rn, a(p.value.type), 1)
1201
1204
  ]),
1202
1205
  n("div", null, [
1203
- n("div", dn, a(i(e)("inventory.common.operation")), 1),
1204
- n("div", cn, a(v.value.operation), 1)
1206
+ n("div", sn, a(i(e)("inventory.common.operation")), 1),
1207
+ n("div", an, a(p.value.operation), 1)
1205
1208
  ]),
1206
1209
  n("div", null, [
1207
- n("div", pn, a(i(e)("inventory.common.status")), 1),
1210
+ n("div", ln, a(i(e)("inventory.common.status")), 1),
1208
1211
  n("div", {
1209
1212
  class: ce([
1210
1213
  "inline-block px-8 py-4 rounded text-sm",
1211
- v.value.status !== i(e)("inventory.common.readyToImport") ? "bg-red-100 text-red-800 border border-red-200" : "bg-green-100 text-green-800 border border-green-200"
1214
+ p.value.status !== i(e)("inventory.common.readyToImport") ? "bg-red-100 text-red-800 border border-red-200" : "bg-green-100 text-green-800 border border-green-200"
1212
1215
  ])
1213
- }, a(v.value.status), 3)
1216
+ }, a(p.value.status), 3)
1214
1217
  ])
1215
1218
  ])
1216
1219
  ];
1217
1220
  }),
1218
1221
  _: 1
1219
1222
  }),
1220
- v.value.errors && v.value.errors.length > 0 ? (N(), se(z, {
1223
+ p.value.errors && p.value.errors.length > 0 ? (T(), se(z, {
1221
1224
  key: 0,
1222
1225
  variant: "outlined",
1223
1226
  class: "p-16"
1224
1227
  }, {
1225
- default: Q(() => [
1226
- n("div", vn, a(i(e)("inventory.common.validationErrors")), 1),
1227
- n("div", yn, [
1228
- (N(!0), D(Be, null, Pe(v.value.errors, (M, O) => (N(), D("div", {
1228
+ default: q(() => [
1229
+ n("div", mn, a(i(e)("inventory.common.validationErrors")), 1),
1230
+ n("div", un, [
1231
+ (T(!0), D(Me, null, $e(p.value.errors, ($, O) => (T(), D("div", {
1229
1232
  key: O,
1230
1233
  class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
1231
1234
  }, [
1232
- A(C, {
1235
+ A(G, {
1233
1236
  name: "error",
1234
1237
  class: "text-red-600 mt-2",
1235
1238
  size: "sm"
1236
1239
  }),
1237
- n("div", gn, a(M), 1)
1240
+ n("div", dn, a($), 1)
1238
1241
  ]))), 128))
1239
1242
  ])
1240
1243
  ]),
1241
1244
  _: 1
1242
- })) : Z("", !0),
1245
+ })) : Y("", !0),
1243
1246
  A(z, {
1244
1247
  variant: "outlined",
1245
1248
  class: "p-16"
1246
1249
  }, {
1247
- default: Q(() => [
1248
- n("div", fn, a(i(e)("inventory.common.rawData")), 1),
1249
- n("div", bn, [
1250
- n("pre", hn, a(JSON.stringify(v.value.details, null, 2)), 1)
1250
+ default: q(() => [
1251
+ n("div", cn, a(i(e)("inventory.common.rawData")), 1),
1252
+ n("div", pn, [
1253
+ n("pre", vn, a(JSON.stringify(p.value.details, null, 2)), 1)
1251
1254
  ])
1252
1255
  ]),
1253
1256
  _: 1
1254
1257
  })
1255
- ])) : Z("", !0)
1258
+ ])) : Y("", !0)
1256
1259
  ]),
1257
1260
  _: 1
1258
1261
  }, 8, ["model-value", "header"])
1259
1262
  ];
1260
1263
  }),
1261
1264
  _: 1
1262
- }, 8, ["title", "actions"])) : i(h).isLoaded ? (N(), se(ke, {
1265
+ }, 8, ["title", "actions"])) : i(b).isLoaded ? (T(), se(ke, {
1263
1266
  key: 2,
1264
1267
  title: i(e)("inventory.common.import")
1265
1268
  }, {
1266
- default: Q(() => [
1267
- n("div", En, [
1268
- A(C, {
1269
+ default: q(() => [
1270
+ n("div", hn, [
1271
+ A(G, {
1269
1272
  name: "block",
1270
1273
  class: "text-gray-400",
1271
1274
  size: "xl"
1272
1275
  }),
1273
- n("div", Sn, [
1274
- n("div", kn, a(i(e)("inventory.common.featureNotAvailable")), 1),
1275
- n("div", Rn, a(i(e)("inventory.common.bulkImportNotEnabled")), 1)
1276
+ n("div", xn, [
1277
+ n("div", _n, a(i(e)("inventory.common.featureNotAvailable")), 1),
1278
+ n("div", wn, a(i(e)("inventory.common.bulkImportNotEnabled")), 1)
1276
1279
  ])
1277
1280
  ])
1278
1281
  ]),
1279
1282
  _: 1
1280
- }, 8, ["title"])) : (N(), se(ke, {
1283
+ }, 8, ["title"])) : (T(), se(ke, {
1281
1284
  key: 1,
1282
1285
  title: i(e)("inventory.common.import")
1283
1286
  }, {
1284
- default: Q(() => [
1285
- n("div", _n, [
1286
- A(q, { size: "lg" }),
1287
- n("div", wn, [
1288
- n("div", In, a(i(e)("inventory.common.loading")), 1)
1287
+ default: q(() => [
1288
+ n("div", gn, [
1289
+ A(X, { size: "lg" }),
1290
+ n("div", fn, [
1291
+ n("div", bn, a(i(e)("inventory.common.loading")), 1)
1289
1292
  ])
1290
1293
  ])
1291
1294
  ]),
@@ -1295,5 +1298,5 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
1295
1298
  }
1296
1299
  });
1297
1300
  export {
1298
- Hn as default
1301
+ Dn as default
1299
1302
  };