@feedmepos/mf-inventory-portal 1.2.46 → 1.2.48

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 (96) hide show
  1. package/dist/{App-DBd4DVaZ.js → App-DPGaFV4B.js} +3 -3
  2. package/dist/{ApprovalView-C-XcEiMZ.js → ApprovalView-833HS5kH.js} +5 -5
  3. package/dist/{BindingsDialog-CXKDYmmR.js → BindingsDialog-ChODu5A1.js} +2 -2
  4. package/dist/{BindingsPicker-Cq1yHJhJ.js → BindingsPicker-DvX4GyKv.js} +3 -3
  5. package/dist/{BindingsTable-BL8DhipQ.js → BindingsTable-DNAiQ3jC.js} +3 -3
  6. package/dist/ClosingDraftView-BNmLpJEn.js +2421 -0
  7. package/dist/{ClosingHistoryView-BC8ZP51z.js → ClosingHistoryView-BWCsFzL4.js} +3 -3
  8. package/dist/{ClosingTemplateView-B4jnOrpc.js → ClosingTemplateView-oZwROzRq.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-Bxy5xIrP.js → DeliveryOrderPrintPreview-CgF6Ah_t.js} +4 -4
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D5DApGXT.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-COu3S25S.js} +12 -12
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHS5LMuy.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Br-AzVal.js} +2 -2
  12. package/dist/{FmMultiselectDialog-C6OzbsWu.js → FmMultiselectDialog-BcnuMvBx.js} +2 -2
  13. package/dist/{FmMultiselectDialog-C7DVf8cL.js → FmMultiselectDialog-nOXJfHcT.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BtN3UL40.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B0TLNBD_.js} +3 -3
  15. package/dist/{ImportView-BhmfI7Am.js → ImportView-DiCAaSmP.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BXSO5UKK.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CjzJ3O5a.js} +1 -1
  17. package/dist/{IngredientGroupView-DfAt-7Fz.js → IngredientGroupView-DJ_gq48z.js} +5 -5
  18. package/dist/{IngredientsView-4MNLuMhd.js → IngredientsView-B2tdcbaR.js} +916 -910
  19. package/dist/{IntegrationView-CvgAJIaG.js → IntegrationView-siGNamS4.js} +12 -12
  20. package/dist/{InventoryBindingForm-CQB1X3d5.js → InventoryBindingForm-CMH2losI.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Sebvr-gm.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-D68w7k0f.js} +4 -4
  22. package/dist/{InventoryBindingSummary-_-dkvb4N.js → InventoryBindingSummary-DAGsx_Mo.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BGsjKOls.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cyl5cUO6.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D9goSrss.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CNze8ZJ7.js} +2 -2
  25. package/dist/{PublishView-BFdsGmRf.js → PublishView-D1AKbuKs.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-DpaV5GjO.js → PurchaseOrderPrintPreview-BzGcJK1f.js} +10 -10
  27. package/dist/{ReceiveRequestView-DNimgIgR.js → ReceiveRequestView-hvDCU729.js} +896 -889
  28. package/dist/{RecipeView-D8CH2rJC.js → RecipeView-BcnjGf_a.js} +8 -8
  29. package/dist/StockView-DdgYT4_P.js +2497 -0
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bb-yJBxo.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DRPzgTm4.js} +1 -1
  31. package/dist/{SupplierView-Bl0JNI44.js → SupplierView-LRNOgWQk.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-C-VmXiM3.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CQJJ3XRC.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DqmlOtC4.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-KBs8Dq8C.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D-4LyU74.js → TransferDetails.vue_vue_type_script_setup_true_lang-bP-1-mLN.js} +99 -99
  35. package/dist/{TransferTemplateView-COJEXmF0.js → TransferTemplateView-Dp2W2doS.js} +412 -412
  36. package/dist/{UnitView-ecUANF8x.js → UnitView-N5l93VfY.js} +6 -6
  37. package/dist/{WarehouseView-DZ9OCali.js → WarehouseView-D7FGBKUP.js} +5 -5
  38. package/dist/{WastageTemplateView-DXu5bayJ.js → WastageTemplateView-BmSNPRPI.js} +14 -14
  39. package/dist/api/inventory.d.ts +10 -10
  40. package/dist/api/stock.d.ts +1 -0
  41. package/dist/{app-aLZoWUfQ.js → app-CfCaSzjl.js} +4623 -5097
  42. package/dist/app.d.ts +176 -834
  43. package/dist/app.js +1 -1
  44. package/dist/{closing-template-D-cf9Vnu.js → closing-template-CJ4VCKvB.js} +1 -1
  45. package/dist/{date2-DluMG3-3.js → date2-BcmOfaME.js} +1 -1
  46. package/dist/{dayjs.min-UuQWuDkU.js → dayjs.min-CiFpY16f.js} +13 -13
  47. package/dist/{decimal-B2f58cUQ.js → decimal-DtLL5qsA.js} +2 -2
  48. package/dist/{defineDeepModel-DUvW0g9M.js → defineDeepModel-DBV1M6fx.js} +1 -1
  49. package/dist/{duplicate-template-BiGYHuPK.js → duplicate-template-DjhY01M8.js} +1 -1
  50. package/dist/{feature-B-rekKRC.js → feature-0OR7WTHu.js} +2 -2
  51. package/dist/{format-time-from-id-CMm14GBq.js → format-time-from-id-DATUhiz_.js} +1 -1
  52. package/dist/{format-unit-display-DeHfXVX_.js → format-unit-display-9qQdeD4R.js} +10 -10
  53. package/dist/{import-export.helper-rXmKqRlR.js → import-export.helper-isWO7OKw.js} +5 -5
  54. package/dist/{index-CYdIQDVa.js → index-BvtrCC8o.js} +1 -1
  55. package/dist/{index-DGs4MBmv.js → index-CG0HXAUt.js} +3 -3
  56. package/dist/{index-CEK6OlSE.js → index-YLMXpUuG.js} +1 -1
  57. package/dist/{lodash-DO8ShgBV.js → lodash-D1GaTimh.js} +1 -1
  58. package/dist/{netsuite-NShFW2SJ.js → netsuite-C3C6Uju7.js} +3 -3
  59. package/dist/{purchase-order-template-COeJz9vK.js → purchase-order-template-C8k-zHLA.js} +1 -1
  60. package/dist/{rules-C_U2Ahtv.js → rules-DCfupVMX.js} +3 -3
  61. package/dist/{stock-B9KGLNAt.js → stock-AXiQCAeU.js} +3 -3
  62. package/dist/{stock-DdZuie8e.js → stock-BwYeYuFG.js} +7 -1
  63. package/dist/stores/inventory.d.ts +13 -13
  64. package/dist/stores/stock.d.ts +5 -5
  65. package/dist/stores/supplier.d.ts +24 -24
  66. package/dist/{supplier-BCfa74hz.js → supplier-p9r9OqFz.js} +2 -2
  67. package/dist/tsconfig.app.tsbuildinfo +1 -1
  68. package/dist/{use-ingredient-select-dialog-CoAP08vZ.js → use-ingredient-select-dialog-Cpmsu92V.js} +2 -2
  69. package/dist/{use-inventory-binding-dialog-BPXhlhVD.js → use-inventory-binding-dialog-BPm1TXkw.js} +2 -2
  70. package/dist/{use-template-enabled-locations-2-CYfkmGP5.js → use-template-enabled-locations-2-Batk5Jq7.js} +2 -2
  71. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +29 -0
  72. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +20 -20
  73. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +3 -3
  74. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +60 -60
  75. package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +2 -2
  76. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +1 -1
  77. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +6 -6
  78. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +12 -12
  79. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +2 -2
  80. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +2 -2
  81. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +12 -12
  82. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +14 -14
  83. package/dist/views/stock/components/StockRecordCard.vue.d.ts +29 -6
  84. package/dist/views/supplier/components/SupplierForm.vue.d.ts +2 -2
  85. package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +2 -2
  86. package/dist/views/supplier/composables/use-supplier-table.d.ts +1 -1
  87. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +2 -2
  88. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  89. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +12 -12
  90. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +12 -12
  91. package/dist/{vue-i18n-Cn8L1Fah.js → vue-i18n-Xu3ISvbS.js} +258 -258
  92. package/dist/{xlsx-jqtV3ziP.js → xlsx-DTdVIUTe.js} +1 -1
  93. package/dist/{xlsx.util-BBey-FqO.js → xlsx.util-twnxgS4l.js} +1 -1
  94. package/package.json +1 -1
  95. package/dist/ClosingDraftView-nwQQl4U1.js +0 -2164
  96. package/dist/StockView-cXMeYZEU.js +0 -2407
@@ -1,105 +1,105 @@
1
- import { ref as B, defineComponent as pe, computed as g, resolveComponent as F, openBlock as u, createElementBlock as w, Fragment as X, unref as l, createVNode as a, withModifiers as Bt, createCommentVNode as L, withCtx as y, createElementVNode as o, toDisplayString as A, normalizeClass as te, renderList as ue, createBlock as O, h as Q, renderSlot as xe, createSlots as Ye, createTextVNode as Ge, mergeModels as it, onMounted as Dt, watch as kt, useModel as Ot, isRef as dt, normalizeStyle as Nt, Teleport as ut, normalizeProps as zt, guardReactiveProps as Lt } from "vue";
2
- import { a as Ce, c as Tt, S as jt, d as ct, e as mt, f as Wt, h as pt, i as vt, j as ft, k as yt, u as Ht, l as qt } from "./app-aLZoWUfQ.js";
3
- import { useDialog as Re, useSnackbar as Fe, components as Oe, useProxiedModel as gt, useDialogChild as Yt, useBreakpoints as Gt } from "@feedmepos/ui-library";
1
+ import { ref as B, defineComponent as pe, computed as b, resolveComponent as C, openBlock as c, createElementBlock as T, Fragment as X, unref as l, createVNode as s, withModifiers as Bt, createCommentVNode as L, withCtx as g, createElementVNode as n, toDisplayString as F, normalizeClass as te, renderList as ue, createBlock as O, h as Q, renderSlot as xe, createSlots as qe, createTextVNode as Ye, mergeModels as dt, onMounted as Dt, watch as Tt, useModel as Ot, isRef as ut, normalizeStyle as Nt, Teleport as ct, normalizeProps as zt, guardReactiveProps as Lt } from "vue";
2
+ import { a as Ce, c as wt, S as jt, d as mt, e as pt, f as Wt, h as vt, i as ft, j as yt, k as gt, u as Ht, l as qt } from "./app-CfCaSzjl.js";
3
+ import { useDialog as Ge, useSnackbar as Fe, components as Oe, useProxiedModel as bt, useDialogChild as Yt, useBreakpoints as Gt } from "@feedmepos/ui-library";
4
4
  import { i as Kt, _ as Zt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
5
  import { F as H } from "./form-mode.enum-BKiNVH6A.js";
6
- import { useI18n as ve, useCoreStore as wt } from "@feedmepos/mf-common";
6
+ import { useI18n as ve, useCoreStore as Ke } from "@feedmepos/mf-common";
7
7
  import { defineStore as Jt, storeToRefs as Qt } from "pinia";
8
- import { D as bt, R as Me } from "./row-action.enum-BcW_L_nE.js";
9
- import { c as Xt, _ as en, F as ht } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
10
- import { u as Ae, _ as tn } from "./netsuite-NShFW2SJ.js";
11
- import { F as He, u as nn, _ as on } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
12
- import { A as Pe, a as ln, t as an, R as Ne, U as sn, M as rn, g as dn } from "./rules-C_U2Ahtv.js";
13
- import { g as un, _ as ze, S as Le, a as cn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bb-yJBxo.js";
14
- import { _ as mn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-Sebvr-gm.js";
15
- import { _ as je } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-BXSO5UKK.js";
16
- import { u as Vt } from "./feature-B-rekKRC.js";
8
+ import { D as ht, R as Me } from "./row-action.enum-BcW_L_nE.js";
9
+ import { c as Xt, _ as en, F as _t } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
10
+ import { u as Ae, _ as tn } from "./netsuite-C3C6Uju7.js";
11
+ import { F as Re, u as nn, _ as on } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
12
+ import { A as Pe, a as ln, t as an, R as Ne, U as sn, M as rn, g as dn } from "./rules-DCfupVMX.js";
13
+ import { g as un, _ as ze, S as Le, a as cn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DRPzgTm4.js";
14
+ import { _ as mn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-D68w7k0f.js";
15
+ import { _ as je } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-CjzJ3O5a.js";
16
+ import { u as Vt } from "./feature-0OR7WTHu.js";
17
17
  import { _ as he } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
18
- import { d as Ue, g as pn, e as vn, a as fn } from "./import-export.helper-rXmKqRlR.js";
18
+ import { d as Ue, g as pn, e as vn, a as fn } from "./import-export.helper-isWO7OKw.js";
19
19
  import { _ as yn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
20
- import { F as gn, a as We } from "./FmMultiselectDialog-C6OzbsWu.js";
21
- import { u as It } from "./purchase-order-template-COeJz9vK.js";
22
- import { u as St, a as Ct } from "./closing-template-D-cf9Vnu.js";
23
- import { r as bn } from "./xlsx.util-BBey-FqO.js";
20
+ import { F as gn, a as We } from "./FmMultiselectDialog-BcnuMvBx.js";
21
+ import { u as It } from "./purchase-order-template-C8k-zHLA.js";
22
+ import { u as St, a as Ct } from "./closing-template-CJ4VCKvB.js";
23
+ import { r as bn } from "./xlsx.util-twnxgS4l.js";
24
24
  import { F as hn } from "./FmDroppableField-J0xUsOTV.js";
25
- import { _ as _n } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHS5LMuy.js";
26
- import { u as xn } from "./FmMultiselectDialog-C7DVf8cL.js";
25
+ import { _ as _n } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Br-AzVal.js";
26
+ import { u as xn } from "./FmMultiselectDialog-nOXJfHcT.js";
27
27
  import { N as kn, H as Tn } from "./app-uBuHtW8m.js";
28
- const qe = Jt("ingredientForm", function() {
29
- const s = Re(), T = Fe(), r = Ce(), b = B(!1), { t: S } = ve(), U = B();
30
- function k() {
31
- const i = {
28
+ const He = Jt("ingredientForm", function() {
29
+ const r = Ge(), k = Fe(), d = Ce(), h = B(!1), { t: I } = ve(), E = B();
30
+ function P() {
31
+ const a = {
32
32
  sku: {},
33
33
  mode: H.CREATE,
34
34
  show: !0,
35
- "onUpdate:show"(d) {
36
- U.value.show = d;
35
+ "onUpdate:show"(i) {
36
+ E.value.show = i;
37
37
  }
38
38
  };
39
- U.value = i;
39
+ E.value = a;
40
40
  }
41
- async function n(i) {
42
- const d = {
43
- sku: Tt(i),
41
+ async function o(a) {
42
+ const i = {
43
+ sku: wt(a),
44
44
  mode: H.UPDATE,
45
45
  show: !0,
46
46
  "onUpdate:show"(m) {
47
- U.value.show = m;
47
+ E.value.show = m;
48
48
  }
49
49
  };
50
- U.value = d;
50
+ E.value = i;
51
51
  }
52
- async function c(i) {
53
- b.value = !0;
52
+ async function u(a) {
53
+ h.value = !0;
54
54
  try {
55
- await r.deleteSku(i), T.open({
55
+ await d.deleteSku(a), k.open({
56
56
  title: "Success",
57
- message: `Deleted ${i.name}`,
57
+ message: `Deleted ${a.name}`,
58
58
  type: "success"
59
59
  });
60
- } catch (d) {
61
- d instanceof jt && Kt(d) ? s.open({
60
+ } catch (i) {
61
+ i instanceof jt && Kt(i) ? r.open({
62
62
  title: "Cannot delete ingredient",
63
63
  contentComponent: Zt,
64
64
  contentComponentProps: {
65
- subject: (i == null ? void 0 : i.name) ?? "",
66
- items: d.errorResponse.message
65
+ subject: (a == null ? void 0 : a.name) ?? "",
66
+ items: i.errorResponse.message
67
67
  },
68
68
  secondaryActions: {
69
69
  text: "Close",
70
70
  close: !0
71
71
  }
72
- }) : console.log("unable to delete ingredient", d), T.open({
73
- title: `Cannot delete ${i.name}`,
72
+ }) : console.log("unable to delete ingredient", i), k.open({
73
+ title: `Cannot delete ${a.name}`,
74
74
  message: "Please try again.",
75
75
  type: "error"
76
- }), console.error("failed to delete ingredient", d);
76
+ }), console.error("failed to delete ingredient", i);
77
77
  } finally {
78
- b.value = !1;
78
+ h.value = !1;
79
79
  }
80
80
  }
81
- function _(i) {
82
- s.open({
83
- title: S("inventory.ingredient.delete.title", [(i == null ? void 0 : i.name) ?? ""]),
81
+ function p(a) {
82
+ r.open({
83
+ title: I("inventory.ingredient.delete.title", [(a == null ? void 0 : a.name) ?? ""]),
84
84
  closeButton: !1,
85
- message: S("inventory.ingredient.delete.message"),
85
+ message: I("inventory.ingredient.delete.message"),
86
86
  primaryActions: {
87
- text: S("common.delete"),
87
+ text: I("common.delete"),
88
88
  close: !0,
89
89
  variant: "destructive"
90
90
  },
91
91
  secondaryActions: {
92
- text: S("common.cancel"),
92
+ text: I("common.cancel"),
93
93
  close: !0
94
94
  }
95
- }).onPrimary(() => c(i));
95
+ }).onPrimary(() => u(a));
96
96
  }
97
97
  return {
98
- createIngredient: k,
99
- updateIngredient: n,
100
- deleteIngredient: _,
101
- ingredientDialogProps: U,
102
- ingredientViewLoading: b
98
+ createIngredient: P,
99
+ updateIngredient: o,
100
+ deleteIngredient: p,
101
+ ingredientDialogProps: E,
102
+ ingredientViewLoading: h
103
103
  };
104
104
  }), wn = {
105
105
  key: 0,
@@ -118,109 +118,109 @@ const qe = Jt("ingredientForm", function() {
118
118
  itemCode: {}
119
119
  },
120
120
  setup(W) {
121
- const s = W, { t: T } = ve(), r = wt(), b = Ae(), S = B(!1), U = g(() => {
121
+ const r = W, { t: k } = ve(), d = Ke(), h = Ae(), I = B(!1), E = b(() => {
122
122
  var m;
123
- return ((m = r.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1;
124
- }), k = g(() => b.getSkuSubsidiaries(s.skuId)), n = g(() => {
123
+ return ((m = d.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1;
124
+ }), P = b(() => h.getSkuSubsidiaries(r.skuId)), o = b(() => {
125
125
  const m = /* @__PURE__ */ new Set();
126
- function v(E) {
127
- for (const p of E)
128
- p.isAssigned && (m.add(p.id), k.value.includeChildren && V(p)), p.children && p.children.length > 0 && v(p.children);
126
+ function f(A) {
127
+ for (const v of A)
128
+ v.isAssigned && (m.add(v.id), P.value.includeChildren && w(v)), v.children && v.children.length > 0 && f(v.children);
129
129
  }
130
- function V(E) {
131
- if (E.children)
132
- for (const p of E.children)
133
- m.add(p.id), V(p);
130
+ function w(A) {
131
+ if (A.children)
132
+ for (const v of A.children)
133
+ m.add(v.id), w(v);
134
134
  }
135
- return v(k.value.subsidiaryTree), m;
135
+ return f(P.value.subsidiaryTree), m;
136
136
  });
137
- function c(m, v = [], V = !1) {
138
- const E = [];
139
- return m.forEach((p, N) => {
140
- const D = N === m.length - 1, fe = [...v, D];
137
+ function u(m, f = [], w = !1) {
138
+ const A = [];
139
+ return m.forEach((v, N) => {
140
+ const D = N === m.length - 1, fe = [...f, D];
141
141
  let ne = "";
142
- for (let ee = 0; ee < v.length; ee++)
143
- ne += v[ee] ? " " : "│ ";
142
+ for (let ee = 0; ee < f.length; ee++)
143
+ ne += f[ee] ? " " : "│ ";
144
144
  ne += D ? "└── " : "├── ";
145
- const ce = n.value.has(p.id), oe = p.isAssigned === !0, le = V && !oe;
146
- if (E.push({
147
- id: p.id,
148
- name: p.name,
149
- prefix: v.length === 0 ? "" : ne,
145
+ const ce = o.value.has(v.id), oe = v.isAssigned === !0, le = w && !oe;
146
+ if (A.push({
147
+ id: v.id,
148
+ name: v.name,
149
+ prefix: f.length === 0 ? "" : ne,
150
150
  isHighlighted: ce,
151
151
  isDirectlyBound: oe,
152
152
  isParentIncludedChild: le,
153
- isRoot: v.length === 0
154
- }), p.children && p.children.length > 0) {
155
- const ee = V || oe && k.value.includeChildren;
156
- E.push(...c(p.children, fe, ee));
153
+ isRoot: f.length === 0
154
+ }), v.children && v.children.length > 0) {
155
+ const ee = w || oe && P.value.includeChildren;
156
+ A.push(...u(v.children, fe, ee));
157
157
  }
158
- }), E;
158
+ }), A;
159
159
  }
160
- function _(m, v = []) {
161
- const V = /* @__PURE__ */ new Set();
162
- for (const E of m) {
163
- const p = [...v, E.id];
164
- E.isAssigned === !0 && p.forEach((N) => V.add(N)), E.children && E.children.length > 0 && _(E.children, p).forEach((D) => V.add(D));
160
+ function p(m, f = []) {
161
+ const w = /* @__PURE__ */ new Set();
162
+ for (const A of m) {
163
+ const v = [...f, A.id];
164
+ A.isAssigned === !0 && v.forEach((N) => w.add(N)), A.children && A.children.length > 0 && p(A.children, v).forEach((D) => w.add(D));
165
165
  }
166
- return V;
166
+ return w;
167
167
  }
168
- function i(m, v) {
169
- return m.map((V) => v.has(V.id) || V.isAssigned === !0 ? {
170
- ...V,
168
+ function a(m, f) {
169
+ return m.map((w) => f.has(w.id) || w.isAssigned === !0 ? {
170
+ ...w,
171
171
  // Recursively filter children
172
- children: V.children ? i(V.children, v) : []
172
+ children: w.children ? a(w.children, f) : []
173
173
  } : null).filter(Boolean);
174
174
  }
175
- const d = g(() => {
176
- let m = k.value.subsidiaryTree;
177
- if ((!m || m.length === 0) && (m = b.getBusinessSubsidiaryTree()), !U.value) {
178
- const v = _(m);
179
- m = i(m, v);
175
+ const i = b(() => {
176
+ let m = P.value.subsidiaryTree;
177
+ if ((!m || m.length === 0) && (m = h.getBusinessSubsidiaryTree()), !E.value) {
178
+ const f = p(m);
179
+ m = a(m, f);
180
180
  }
181
- return c(m, []);
181
+ return u(m, []);
182
182
  });
183
- return (m, v) => {
184
- const V = F("FmButton"), E = F("FmDialog");
185
- return u(), w(X, null, [
186
- l(b).isEnabled ? (u(), w("div", wn, [
187
- a(V, {
183
+ return (m, f) => {
184
+ const w = C("FmButton"), A = C("FmDialog");
185
+ return c(), T(X, null, [
186
+ l(h).isEnabled ? (c(), T("div", wn, [
187
+ s(w, {
188
188
  "prepend-icon": "info",
189
189
  variant: "tertiary",
190
- onClick: v[0] || (v[0] = Bt((p) => S.value = !0, ["stop"]))
190
+ onClick: f[0] || (f[0] = Bt((v) => I.value = !0, ["stop"]))
191
191
  })
192
192
  ])) : L("", !0),
193
- a(E, {
194
- modelValue: S.value,
195
- "onUpdate:modelValue": v[1] || (v[1] = (p) => S.value = p),
193
+ s(A, {
194
+ modelValue: I.value,
195
+ "onUpdate:modelValue": f[1] || (f[1] = (v) => I.value = v),
196
196
  "close-button": "",
197
197
  dismissAway: ""
198
198
  }, {
199
- "dialog-header": y(() => [
200
- o("div", Vn, [
201
- o("div", In, A(l(T)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
202
- o("p", Sn, " Name: " + A(s.itemName), 1),
203
- o("p", Cn, " Code: " + A(s.itemCode), 1),
204
- U.value ? (u(), w("p", Fn, " All subsidiaries are shown since you are an admin. ")) : (u(), w("p", An, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
205
- o("div", En, [
206
- o("div", $n, [
207
- v[2] || (v[2] = o("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
208
- o("span", {
199
+ "dialog-header": g(() => [
200
+ n("div", Vn, [
201
+ n("div", In, F(l(k)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
202
+ n("p", Sn, " Name: " + F(r.itemName), 1),
203
+ n("p", Cn, " Code: " + F(r.itemCode), 1),
204
+ E.value ? (c(), T("p", Fn, " All subsidiaries are shown since you are an admin. ")) : (c(), T("p", An, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
205
+ n("div", En, [
206
+ n("div", $n, [
207
+ f[2] || (f[2] = n("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
208
+ n("span", {
209
209
  class: te(
210
- k.value.includeChildren ? "text-green-600 font-semibold" : "text-red-600 font-semibold"
210
+ P.value.includeChildren ? "text-green-600 font-semibold" : "text-red-600 font-semibold"
211
211
  )
212
- }, A(k.value.includeChildren ? "Yes" : "No"), 3)
212
+ }, F(P.value.includeChildren ? "Yes" : "No"), 3)
213
213
  ]),
214
- o("div", Mn, [
215
- v[4] || (v[4] = o("div", { class: "flex items-center gap-2 px-2 py-1 bg-fm-color-bg-brand-secondary rounded-md" }, [
216
- o("span", { class: "w-3 h-3 rounded-sm bg-green-400" }),
217
- o("span", { class: "fm-typo-en-body-sm-400" }, "Directly Bound")
214
+ n("div", Mn, [
215
+ f[4] || (f[4] = n("div", { class: "flex items-center gap-2 px-2 py-1 bg-fm-color-bg-brand-secondary rounded-md" }, [
216
+ n("span", { class: "w-3 h-3 rounded-sm bg-green-400" }),
217
+ n("span", { class: "fm-typo-en-body-sm-400" }, "Directly Bound")
218
218
  ], -1)),
219
- a(He, null, {
220
- default: y(() => v[3] || (v[3] = [
221
- o("div", { class: "flex items-center gap-2 px-2 py-1 rounded-md" }, [
222
- o("span", { class: "w-3 h-3 rounded-sm bg-blue-400" }),
223
- o("span", { class: "fm-typo-en-body-sm-400" }, "Included as Child")
219
+ s(Re, null, {
220
+ default: g(() => f[3] || (f[3] = [
221
+ n("div", { class: "flex items-center gap-2 px-2 py-1 rounded-md" }, [
222
+ n("span", { class: "w-3 h-3 rounded-sm bg-blue-400" }),
223
+ n("span", { class: "fm-typo-en-body-sm-400" }, "Included as Child")
224
224
  ], -1)
225
225
  ])),
226
226
  _: 1
@@ -229,36 +229,36 @@ const qe = Jt("ingredientForm", function() {
229
229
  ])
230
230
  ])
231
231
  ]),
232
- default: y(() => [
233
- o("div", Un, [
234
- o("div", Pn, [
235
- (u(!0), w(X, null, ue(d.value, (p) => (u(), w("div", {
236
- key: p.id,
232
+ default: g(() => [
233
+ n("div", Un, [
234
+ n("div", Pn, [
235
+ (c(!0), T(X, null, ue(i.value, (v) => (c(), T("div", {
236
+ key: v.id,
237
237
  class: "flex items-stretch"
238
238
  }, [
239
- o("span", Rn, A(p.prefix), 1),
240
- p.isParentIncludedChild ? (u(), O(He, {
239
+ n("span", Rn, F(v.prefix), 1),
240
+ v.isParentIncludedChild ? (c(), O(Re, {
241
241
  key: 0,
242
242
  class: "flex-1"
243
243
  }, {
244
- default: y(() => [
245
- o("div", Bn, [
246
- o("span", Dn, A(p.name), 1)
244
+ default: g(() => [
245
+ n("div", Bn, [
246
+ n("span", Dn, F(v.name), 1)
247
247
  ])
248
248
  ]),
249
249
  _: 2
250
- }, 1024)) : (u(), w("div", {
250
+ }, 1024)) : (c(), T("div", {
251
251
  key: 1,
252
252
  class: te([
253
253
  "px-2 py-1 rounded-md flex-1",
254
- p.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
254
+ v.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
255
255
  ])
256
256
  }, [
257
- o("span", {
257
+ n("span", {
258
258
  class: te([
259
- p.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
259
+ v.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
260
260
  ])
261
- }, A(p.name), 3)
261
+ }, F(v.name), 3)
262
262
  ], 2))
263
263
  ]))), 128))
264
264
  ])
@@ -271,38 +271,44 @@ const qe = Jt("ingredientForm", function() {
271
271
  }
272
272
  });
273
273
  function Nn() {
274
- const { updateIngredient: W, deleteIngredient: s } = qe(), T = Ce(), r = Ae();
275
- Re();
276
- const { t: b } = ve();
277
- async function S(k, n) {
278
- const c = Tt(n);
279
- if (k === Me.Edit) {
280
- await W(c);
274
+ var o;
275
+ const { updateIngredient: W, deleteIngredient: r } = He(), k = Ce(), d = Ae(), { t: h } = ve(), I = Ke();
276
+ async function E(u, p) {
277
+ const a = wt(p);
278
+ if (u === Me.Edit) {
279
+ await W(a);
281
280
  return;
282
281
  }
283
- if (k === Me.Delete) {
284
- await s(c);
282
+ if (u === Me.Delete) {
283
+ await r(a);
285
284
  return;
286
285
  }
287
286
  }
288
287
  return { columnDefs: [
288
+ ...(o = I.sessionUser.value) != null && o.role.isAdmin ? [
289
+ {
290
+ accessorKey: "_id",
291
+ header: () => Q(Re, {}, () => "ID"),
292
+ size: 200
293
+ }
294
+ ] : [],
289
295
  {
290
296
  accessorKey: "code",
291
- header: () => b("inventory.ingredient.code"),
297
+ header: () => h("inventory.ingredient.code"),
292
298
  enableSorting: !0,
293
299
  size: 200
294
300
  },
295
301
  {
296
302
  accessorKey: "name",
297
- header: () => b("inventory.ingredient.name"),
303
+ header: () => h("inventory.ingredient.name"),
298
304
  enableSorting: !0,
299
305
  size: 300,
300
- cell(k) {
301
- const n = k.row.original, c = T.skuBindingFlattenCache[n._id], _ = c == null ? void 0 : c.inventoryBindings.some(
302
- (i) => "error" in i && i.reason === "circularDependency"
306
+ cell(u) {
307
+ const p = u.row.original, a = k.skuBindingFlattenCache[p._id], i = a == null ? void 0 : a.inventoryBindings.some(
308
+ (m) => "error" in m && m.reason === "circularDependency"
303
309
  );
304
310
  return Q("div", { class: "flex items-center w-full gap-4" }, [
305
- _ ? Q(
311
+ i ? Q(
306
312
  Oe.FmTooltip,
307
313
  { class: "text-left" },
308
314
  {
@@ -314,29 +320,29 @@ function Nn() {
314
320
  });
315
321
  },
316
322
  content() {
317
- return b("inventory.inventoryBindings.circularError");
323
+ return h("inventory.inventoryBindings.circularError");
318
324
  }
319
325
  }
320
326
  ) : null,
321
- n.name
327
+ p.name
322
328
  ]);
323
329
  }
324
330
  },
325
331
  {
326
332
  id: "unit",
327
- header: () => b("inventory.ingredient.unit"),
328
- accessorFn: (k) => _t(k),
329
- cell(k) {
330
- const n = k.row.original, c = _t(n);
333
+ header: () => h("inventory.ingredient.unit"),
334
+ accessorFn: (u) => xt(u),
335
+ cell(u) {
336
+ const p = u.row.original, a = xt(p);
331
337
  return Q(
332
338
  Oe.FmTooltip,
333
- { zIndex: 51, content: c },
339
+ { zIndex: 51, content: a },
334
340
  Q(
335
341
  "span",
336
342
  {
337
343
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
338
344
  },
339
- c
345
+ a
340
346
  )
341
347
  );
342
348
  },
@@ -345,37 +351,37 @@ function Nn() {
345
351
  },
346
352
  {
347
353
  accessorKey: "isInactive",
348
- header: () => b("inventory.ingredient.status.title"),
349
- cell(k) {
350
- const n = k.row.original.isInactive;
354
+ header: () => h("inventory.ingredient.status.title"),
355
+ cell(u) {
356
+ const p = u.row.original.isInactive;
351
357
  return Q(
352
358
  "span",
353
359
  {
354
360
  class: [
355
361
  "inline-block px-3 py-1 rounded-full text-xs font-semibold",
356
- n ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
362
+ p ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
357
363
  ].join(" ")
358
364
  },
359
- b(n ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
365
+ h(p ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
360
366
  );
361
367
  },
362
368
  enableSorting: !0
363
369
  },
364
370
  {
365
371
  id: "netsuiteSubsidiary",
366
- accessorFn: (k) => r.getSkuSubsidiaries(k._id),
372
+ accessorFn: (u) => d.getSkuSubsidiaries(u._id),
367
373
  header: () => "NetSuite Subsidiary",
368
- cell(k) {
369
- const n = k.row.original, { flattenedSubsidiaryNames: c } = r.getSkuSubsidiaries(n._id);
374
+ cell(u) {
375
+ const p = u.row.original, { flattenedSubsidiaryNames: a } = d.getSkuSubsidiaries(p._id);
370
376
  return Q("div", { class: "flex gap-2 items-start" }, [
371
377
  Q(
372
378
  "span",
373
379
  {
374
380
  class: "flex-1 line-clamp-2 text-ellipsis break-all whitespace-pre-wrap"
375
381
  },
376
- c.join(", ")
382
+ a.join(", ")
377
383
  ),
378
- Q(On, { skuId: n._id, itemName: n.name, itemCode: n.code })
384
+ Q(On, { skuId: p._id, itemName: p.name, itemCode: p.code })
379
385
  ]);
380
386
  },
381
387
  enableSorting: !1,
@@ -384,11 +390,11 @@ function Nn() {
384
390
  {
385
391
  id: "action",
386
392
  header: "",
387
- cell(k) {
393
+ cell(u) {
388
394
  return Xt(
389
- [bt[Me.Edit], bt[Me.Delete]],
390
- (n) => {
391
- S(n, k.row.original);
395
+ [ht[Me.Edit], ht[Me.Delete]],
396
+ (p) => {
397
+ E(p, u.row.original);
392
398
  }
393
399
  );
394
400
  },
@@ -401,12 +407,12 @@ function Nn() {
401
407
  }
402
408
  ] };
403
409
  }
404
- function _t(W) {
405
- var s;
410
+ function xt(W) {
411
+ var r;
406
412
  if (W.trackingMeasurement) {
407
- const T = (s = W.unit.measurements) == null ? void 0 : s.find((r) => r.id === W.trackingMeasurement);
408
- if (T)
409
- return `${T.name} (${T.abbrev})`;
413
+ const k = (r = W.unit.measurements) == null ? void 0 : r.find((d) => d.id === W.trackingMeasurement);
414
+ if (k)
415
+ return `${k.name} (${k.abbrev})`;
410
416
  }
411
417
  return `${W.unit.name} (${W.unit.abbrev})`;
412
418
  }
@@ -419,72 +425,72 @@ const zn = /* @__PURE__ */ pe({
419
425
  readonly: { type: Boolean }
420
426
  },
421
427
  emits: ["update:modelValue"],
422
- setup(W, { emit: s }) {
423
- const T = W, r = g(() => {
424
- var d;
425
- return (d = T.rootValue) == null ? void 0 : d.unit;
426
- }), b = g(() => {
427
- var d;
428
- return (d = T.rootValue) == null ? void 0 : d._id;
429
- }), S = s, { t: U } = ve(), k = g({
428
+ setup(W, { emit: r }) {
429
+ const k = W, d = b(() => {
430
+ var i;
431
+ return (i = k.rootValue) == null ? void 0 : i.unit;
432
+ }), h = b(() => {
433
+ var i;
434
+ return (i = k.rootValue) == null ? void 0 : i._id;
435
+ }), I = r, { t: E } = ve(), P = b({
430
436
  get() {
431
- return !!T.modelValue;
437
+ return !!k.modelValue;
432
438
  },
433
- set(d) {
434
- d ? S("update:modelValue", {
439
+ set(i) {
440
+ i ? I("update:modelValue", {
435
441
  measurement: null,
436
442
  inventoryBindings: []
437
- }) : S("update:modelValue", null);
443
+ }) : I("update:modelValue", null);
438
444
  }
439
- }), n = g(() => un(r.value));
440
- function c(d) {
441
- const m = T.modelValue ?? {};
442
- m.measurement = d ? `${d}` : null, S("update:modelValue", m);
445
+ }), o = b(() => un(d.value));
446
+ function u(i) {
447
+ const m = k.modelValue ?? {};
448
+ m.measurement = i ? `${i}` : null, I("update:modelValue", m);
443
449
  }
444
- function _(d) {
445
- const m = T.modelValue ?? {};
446
- m.inventoryBindings = d, S("update:modelValue", m);
450
+ function p(i) {
451
+ const m = k.modelValue ?? {};
452
+ m.inventoryBindings = i, I("update:modelValue", m);
447
453
  }
448
- const i = g(() => {
449
- if (!T.modelValue) return null;
450
- const d = T.modelValue;
451
- return d.measurement ? n.value.find((m) => m.value === d.measurement) ?? null : n.value.find((m) => m.value === null) ?? null;
454
+ const a = b(() => {
455
+ if (!k.modelValue) return null;
456
+ const i = k.modelValue;
457
+ return i.measurement ? o.value.find((m) => m.value === i.measurement) ?? null : o.value.find((m) => m.value === null) ?? null;
452
458
  });
453
- return (d, m) => {
454
- const v = F("FmSwitch"), V = F("FmSelect"), E = F("FmCard");
455
- return u(), O(E, {
459
+ return (i, m) => {
460
+ const f = C("FmSwitch"), w = C("FmSelect"), A = C("FmCard");
461
+ return c(), O(A, {
456
462
  variant: "outlined",
457
463
  class: "p-16 flex flex-col gap-16"
458
464
  }, {
459
- default: y(() => {
460
- var p, N;
465
+ default: g(() => {
466
+ var v, N;
461
467
  return [
462
- a(v, {
468
+ s(f, {
463
469
  value: "",
464
- "model-value": k.value,
465
- "onUpdate:modelValue": m[0] || (m[0] = (D) => k.value = D),
466
- label: l(U)("inventory.ingredient.convertible.title"),
467
- sublabel: l(U)("inventory.ingredient.convertible.subtitle"),
470
+ "model-value": P.value,
471
+ "onUpdate:modelValue": m[0] || (m[0] = (D) => P.value = D),
472
+ label: l(E)("inventory.ingredient.convertible.title"),
473
+ sublabel: l(E)("inventory.ingredient.convertible.subtitle"),
468
474
  labelPlacement: "right",
469
- disabled: d.readonly
475
+ disabled: i.readonly
470
476
  }, null, 8, ["model-value", "label", "sublabel", "disabled"]),
471
- k.value ? (u(), w(X, { key: 0 }, [
472
- o("div", null, [
473
- a(V, {
474
- label: l(U)("inventory.ingredient.convertible.convertTo"),
475
- modelValue: (p = i.value) == null ? void 0 : p.value,
476
- "onUpdate:modelValue": c,
477
- items: n.value,
478
- disabled: d.readonly
477
+ P.value ? (c(), T(X, { key: 0 }, [
478
+ n("div", null, [
479
+ s(w, {
480
+ label: l(E)("inventory.ingredient.convertible.convertTo"),
481
+ modelValue: (v = a.value) == null ? void 0 : v.value,
482
+ "onUpdate:modelValue": u,
483
+ items: o.value,
484
+ disabled: i.readonly
479
485
  }, null, 8, ["label", "modelValue", "items", "disabled"])
480
486
  ]),
481
- a(mn, {
482
- id: b.value,
483
- "model-value": ((N = d.modelValue) == null ? void 0 : N.inventoryBindings) ?? [],
484
- "onUpdate:modelValue": _,
485
- "exclude-binding-id": b.value,
487
+ s(mn, {
488
+ id: h.value,
489
+ "model-value": ((N = i.modelValue) == null ? void 0 : N.inventoryBindings) ?? [],
490
+ "onUpdate:modelValue": p,
491
+ "exclude-binding-id": h.value,
486
492
  rules: [l(Pe)(1)],
487
- readonly: d.readonly
493
+ readonly: i.readonly
488
494
  }, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
489
495
  ], 64)) : L("", !0)
490
496
  ];
@@ -510,71 +516,71 @@ const zn = /* @__PURE__ */ pe({
510
516
  appendText: {}
511
517
  },
512
518
  setup(W) {
513
- return (s, T) => {
514
- const r = F("FmLabel"), b = F("FmIcon"), S = F("FmTooltip"), U = F("FmField");
515
- return s.locked ? (u(), w("div", Ln, [
516
- xe(s.$slots, "label", {}, () => [
517
- a(r, {
518
- label: s.label,
519
- disabled: s.disabled
519
+ return (r, k) => {
520
+ const d = C("FmLabel"), h = C("FmIcon"), I = C("FmTooltip"), E = C("FmField");
521
+ return r.locked ? (c(), T("div", Ln, [
522
+ xe(r.$slots, "label", {}, () => [
523
+ s(d, {
524
+ label: r.label,
525
+ disabled: r.disabled
520
526
  }, null, 8, ["label", "disabled"])
521
527
  ]),
522
- xe(s.$slots, "field", {}, () => [
523
- a(U, { disabled: s.disabled }, Ye({
524
- prepend: y(() => [
525
- s.tooltipMessage ? (u(), O(S, {
528
+ xe(r.$slots, "field", {}, () => [
529
+ s(E, { disabled: r.disabled }, qe({
530
+ prepend: g(() => [
531
+ r.tooltipMessage ? (c(), O(I, {
526
532
  key: 0,
527
- placement: s.tooltipPlacement,
528
- "z-index": s.tooltipZIndex
533
+ placement: r.tooltipPlacement,
534
+ "z-index": r.tooltipZIndex
529
535
  }, {
530
- content: y(() => [
531
- Ge(A(s.tooltipMessage), 1)
536
+ content: g(() => [
537
+ Ye(F(r.tooltipMessage), 1)
532
538
  ]),
533
- default: y(() => [
534
- a(b, {
539
+ default: g(() => [
540
+ s(h, {
535
541
  name: "lock",
536
542
  color: "neutral-gray-400"
537
543
  })
538
544
  ]),
539
545
  _: 1
540
- }, 8, ["placement", "z-index"])) : (u(), O(b, {
546
+ }, 8, ["placement", "z-index"])) : (c(), O(h, {
541
547
  key: 1,
542
548
  name: "lock",
543
549
  color: "neutral-gray-400"
544
550
  }))
545
551
  ]),
546
- default: y(() => [
547
- xe(s.$slots, "modelValue", {}, () => [
548
- o("div", {
552
+ default: g(() => [
553
+ xe(r.$slots, "modelValue", {}, () => [
554
+ n("div", {
549
555
  class: te([
550
- s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
556
+ r.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
551
557
  "line-clamp-1 text-ellipsis break-all"
552
558
  ])
553
- }, A(s.modelValue), 3)
559
+ }, F(r.modelValue), 3)
554
560
  ])
555
561
  ]),
556
562
  _: 2
557
563
  }, [
558
- s.appendText || s.$slots.fieldAppend ? {
564
+ r.appendText || r.$slots.fieldAppend ? {
559
565
  name: "append",
560
- fn: y(() => [
561
- xe(s.$slots, "fieldAppend", {}, () => [
562
- o("div", jn, A(s.appendText), 1)
566
+ fn: g(() => [
567
+ xe(r.$slots, "fieldAppend", {}, () => [
568
+ n("div", jn, F(r.appendText), 1)
563
569
  ])
564
570
  ]),
565
571
  key: "0"
566
572
  } : void 0
567
573
  ]), 1032, ["disabled"])
568
574
  ]),
569
- xe(s.$slots, "helper-text", {}, () => [
570
- o("div", {
575
+ xe(r.$slots, "helper-text", {}, () => [
576
+ n("div", {
571
577
  class: te([
572
578
  "fm-typo-en-body-sm-400 line-clamp-1",
573
- s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
579
+ r.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
574
580
  ])
575
- }, A(s.helperText), 3)
581
+ }, F(r.helperText), 3)
576
582
  ])
577
- ])) : xe(s.$slots, "default", { key: 1 });
583
+ ])) : xe(r.$slots, "default", { key: 1 });
578
584
  };
579
585
  }
580
586
  }), Wn = { class: "flex gap-8" }, Hn = { class: "flex-1" }, qn = { class: "flex-1" }, Yn = { class: "flex flex-col gap-5" }, Gn = { class: "text-fm-color-typo-secondary" }, Kn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Zn = {
@@ -603,7 +609,7 @@ const zn = /* @__PURE__ */ pe({
603
609
  class: "flex flex-col gap-8"
604
610
  }, Oo = { class: "flex flex-wrap gap-8" }, No = /* @__PURE__ */ pe({
605
611
  __name: "IngredientForm",
606
- props: /* @__PURE__ */ it({
612
+ props: /* @__PURE__ */ dt({
607
613
  mode: {},
608
614
  modelValue: {},
609
615
  disabled: { type: Boolean },
@@ -614,34 +620,34 @@ const zn = /* @__PURE__ */ pe({
614
620
  search: {},
615
621
  searchModifiers: {}
616
622
  }),
617
- emits: /* @__PURE__ */ it(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
618
- setup(W, { expose: s, emit: T }) {
619
- var et;
620
- const { t: r } = ve(), b = Re();
623
+ emits: /* @__PURE__ */ dt(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
624
+ setup(W, { expose: r, emit: k }) {
625
+ var tt;
626
+ const { t: d } = ve(), h = Ge();
621
627
  Fe();
622
- const S = It(), U = St(), k = Ct(), n = W, c = T, _ = Ce(), i = wt(), d = Vt(), m = Ae(), v = g(() => m.isEnabled);
628
+ const I = It(), E = St(), P = Ct(), o = W, u = k, p = Ce(), a = Ke(), i = Vt(), m = Ae(), f = b(() => m.isEnabled);
623
629
  B(void 0);
624
- const V = B([]), E = B([]), p = B([]), N = B(!1);
630
+ const w = B([]), A = B([]), v = B([]), N = B(!1);
625
631
  function D(e) {
626
632
  if (e.length === 0) return;
627
- const t = e[0], x = n.modelValue ?? {
628
- unit: _.units.find((C) => C)
633
+ const t = e[0], x = o.modelValue ?? {
634
+ unit: p.units.find((S) => S)
629
635
  };
630
- x.unit || (x.unit = t, c("update:modelValue", x));
636
+ x.unit || (x.unit = t, u("update:modelValue", x));
631
637
  }
632
638
  Dt(() => {
633
- D(_.units), n.mode === H.CREATE && (d.mustUsePoTemplate && ne(), d.enableWastageTemplate && ce(), d.enableClosingTemplate && oe());
634
- }), kt([() => _.units], ([e]) => {
639
+ D(p.units), o.mode === H.CREATE && (i.mustUsePoTemplate && ne(), i.enableWastageTemplate && ce(), i.enableClosingTemplate && oe());
640
+ }), Tt([() => p.units], ([e]) => {
635
641
  D(e);
636
642
  });
637
643
  function fe() {
638
- c("click:submit");
644
+ u("click:submit");
639
645
  }
640
646
  async function ne() {
641
- V.value = [], N.value = !0;
647
+ w.value = [], N.value = !0;
642
648
  try {
643
- const [e] = await Promise.all([S.readTemplates()]).delayed(1e3);
644
- V.value = e;
649
+ const [e] = await Promise.all([I.readTemplates()]).delayed(1e3);
650
+ w.value = e;
645
651
  } catch (e) {
646
652
  console.log("Something went wrong when fetching templates:", e);
647
653
  } finally {
@@ -649,12 +655,12 @@ const zn = /* @__PURE__ */ pe({
649
655
  }
650
656
  }
651
657
  async function ce() {
652
- E.value = [], N.value = !0;
658
+ A.value = [], N.value = !0;
653
659
  try {
654
- const [e] = await Promise.all([U.readTemplates()]).delayed(
660
+ const [e] = await Promise.all([E.readTemplates()]).delayed(
655
661
  1e3
656
662
  );
657
- E.value = e;
663
+ A.value = e;
658
664
  } catch (e) {
659
665
  console.log("Something went wrong when fetching wastage templates:", e);
660
666
  } finally {
@@ -662,92 +668,92 @@ const zn = /* @__PURE__ */ pe({
662
668
  }
663
669
  }
664
670
  async function oe() {
665
- p.value = [], N.value = !0;
671
+ v.value = [], N.value = !0;
666
672
  try {
667
- const [e] = await Promise.all([k.readTemplates()]).delayed(
673
+ const [e] = await Promise.all([P.readTemplates()]).delayed(
668
674
  1e3
669
675
  );
670
- p.value = e;
676
+ v.value = e;
671
677
  } catch (e) {
672
678
  console.log("Something went wrong when fetching closing templates:", e);
673
679
  } finally {
674
680
  N.value = !1;
675
681
  }
676
682
  }
677
- const le = g({
683
+ const le = b({
678
684
  get() {
679
685
  var e;
680
- return ((e = n.modelValue) == null ? void 0 : e.code) ?? "";
686
+ return ((e = o.modelValue) == null ? void 0 : e.code) ?? "";
681
687
  },
682
688
  set(e) {
683
- const t = n.modelValue ? {
684
- ...n.modelValue
689
+ const t = o.modelValue ? {
690
+ ...o.modelValue
685
691
  } : {};
686
- t.code = e, c("update:modelValue", t);
692
+ t.code = e, u("update:modelValue", t);
687
693
  }
688
- }), ee = g({
694
+ }), ee = b({
689
695
  get() {
690
696
  var e;
691
- return ((e = n.modelValue) == null ? void 0 : e.isInactive) ?? !1;
697
+ return ((e = o.modelValue) == null ? void 0 : e.isInactive) ?? !1;
692
698
  },
693
699
  set(e) {
694
- const t = n.modelValue ? {
695
- ...n.modelValue
700
+ const t = o.modelValue ? {
701
+ ...o.modelValue
696
702
  } : {};
697
- t.isInactive = e, c("update:modelValue", t);
703
+ t.isInactive = e, u("update:modelValue", t);
698
704
  }
699
- }), ae = g({
705
+ }), ae = b({
700
706
  get() {
701
707
  var e;
702
- return ((e = n.modelValue) == null ? void 0 : e.name) ?? "";
708
+ return ((e = o.modelValue) == null ? void 0 : e.name) ?? "";
703
709
  },
704
710
  set(e) {
705
- const t = n.modelValue ? {
706
- ...n.modelValue
711
+ const t = o.modelValue ? {
712
+ ...o.modelValue
707
713
  } : {};
708
- t.name = e, c("update:modelValue", t);
714
+ t.name = e, u("update:modelValue", t);
709
715
  }
710
- }), ye = g({
716
+ }), ye = b({
711
717
  get() {
712
718
  var t, x;
713
- const e = (x = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : x.costPerUnit;
719
+ const e = (x = (t = o.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : x.costPerUnit;
714
720
  return e ? +ln(e) : 0;
715
721
  },
716
722
  set(e) {
717
- var x, C, Y, z;
718
- const t = n.modelValue ? {
719
- ...n.modelValue
723
+ var x, S, Y, z;
724
+ const t = o.modelValue ? {
725
+ ...o.modelValue
720
726
  } : {};
721
727
  t.defaultCost ?? (t.defaultCost = {
722
728
  costPerUnit: {
723
729
  amount: 0,
724
730
  precision: 2,
725
- currency: ((x = ct(i.currentCountry.value)) == null ? void 0 : x.currency) ?? "MYR"
731
+ currency: ((x = mt(a.currentCountry.value)) == null ? void 0 : x.currency) ?? "MYR"
726
732
  },
727
- measurement: (z = (Y = (C = n.modelValue) == null ? void 0 : C.unit) == null ? void 0 : Y.measurements) == null ? void 0 : z.find(
733
+ measurement: (z = (Y = (S = o.modelValue) == null ? void 0 : S.unit) == null ? void 0 : Y.measurements) == null ? void 0 : z.find(
728
734
  (re) => {
729
735
  var ie;
730
- return re.id === ((ie = n.modelValue) == null ? void 0 : ie.trackingMeasurement);
736
+ return re.id === ((ie = o.modelValue) == null ? void 0 : ie.trackingMeasurement);
731
737
  }
732
738
  )
733
739
  }), t.defaultCost.costPerUnit = {
734
740
  ...t.defaultCost.costPerUnit,
735
741
  ...an(+e, 4)
736
- }, c("update:modelValue", t);
742
+ }, u("update:modelValue", t);
737
743
  }
738
- }), ge = g(() => {
739
- var t, x, C;
740
- const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? _.units.find((Y) => Y);
744
+ }), ge = b(() => {
745
+ var t, x, S;
746
+ const e = ((t = o.modelValue) == null ? void 0 : t.unit) ?? p.units.find((Y) => Y);
741
747
  return e ? {
742
748
  _id: e._id,
743
- measurement: (x = n.modelValue) == null ? void 0 : x.trackingMeasurement,
744
- name: ((C = e.measurements.find((Y) => {
749
+ measurement: (x = o.modelValue) == null ? void 0 : x.trackingMeasurement,
750
+ name: ((S = e.measurements.find((Y) => {
745
751
  var z;
746
- return Y.id === ((z = n.modelValue) == null ? void 0 : z.trackingMeasurement);
747
- })) == null ? void 0 : C.name) ?? e.name
752
+ return Y.id === ((z = o.modelValue) == null ? void 0 : z.trackingMeasurement);
753
+ })) == null ? void 0 : S.name) ?? e.name
748
754
  } : null;
749
- }), ke = g(
750
- () => _.units.flatMap(({ name: e, _id: t, abbrev: x, measurements: C }) => [
755
+ }), ke = b(
756
+ () => p.units.flatMap(({ name: e, _id: t, abbrev: x, measurements: S }) => [
751
757
  {
752
758
  label: `${e}`,
753
759
  value: null,
@@ -758,83 +764,83 @@ const zn = /* @__PURE__ */ pe({
758
764
  value: { _id: t },
759
765
  displayAsSection: !1
760
766
  },
761
- ...C.map(({ id: Y, name: z, abbrev: re }) => ({
767
+ ...S.map(({ id: Y, name: z, abbrev: re }) => ({
762
768
  label: `${z} (${re})`,
763
769
  value: { _id: t, measurement: Y },
764
770
  displayAsSection: !1
765
771
  }))
766
772
  ])
767
- ), h = Ot(W, "search"), P = g(
773
+ ), _ = Ot(W, "search"), U = b(
768
774
  () => new gn(ke.value, ["label", "value"], {
769
775
  caseSensitive: !1,
770
776
  sort: !0
771
777
  })
772
- ), G = g(() => P.value.search(h.value));
778
+ ), G = b(() => U.value.search(_.value));
773
779
  function $(e) {
774
- var t, x, C, Y, z;
775
- return ((x = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : x._id) === ((C = e.value) == null ? void 0 : C._id) && ((Y = n.modelValue) == null ? void 0 : Y.trackingMeasurement) === ((z = e.value) == null ? void 0 : z.measurement);
780
+ var t, x, S, Y, z;
781
+ return ((x = (t = o.modelValue) == null ? void 0 : t.unit) == null ? void 0 : x._id) === ((S = e.value) == null ? void 0 : S._id) && ((Y = o.modelValue) == null ? void 0 : Y.trackingMeasurement) === ((z = e.value) == null ? void 0 : z.measurement);
776
782
  }
777
- function f(e) {
783
+ function y(e) {
778
784
  var re, ie;
779
785
  if (!e) return;
780
- const { _id: t, measurement: x } = e, C = x || void 0, Y = _.units.find((Ie) => Ie._id === t);
786
+ const { _id: t, measurement: x } = e, S = x || void 0, Y = p.units.find((Ie) => Ie._id === t);
781
787
  if (!Y)
782
788
  return;
783
- const z = n.modelValue ?? {};
784
- z.unit = Y, z.trackingMeasurement = C, z.convert && (z.convert.measurement = C || null), d.enableTotalCost && (z.defaultCost = {
785
- measurement: Y.measurements.find((Ie) => Ie.id === C),
789
+ const z = o.modelValue ?? {};
790
+ z.unit = Y, z.trackingMeasurement = S, z.convert && (z.convert.measurement = S || null), i.enableTotalCost && (z.defaultCost = {
791
+ measurement: Y.measurements.find((Ie) => Ie.id === S),
786
792
  costPerUnit: {
787
793
  ...((re = z.defaultCost) == null ? void 0 : re.costPerUnit) ?? {
788
794
  amount: 0,
789
795
  precision: 2,
790
- currency: ((ie = ct(i.currentCountry.value)) == null ? void 0 : ie.currency) ?? "MYR"
796
+ currency: ((ie = mt(a.currentCountry.value)) == null ? void 0 : ie.currency) ?? "MYR"
791
797
  }
792
798
  }
793
- }), c("update:modelValue", z);
799
+ }), u("update:modelValue", z);
794
800
  }
795
- const j = g({
801
+ const j = b({
796
802
  get() {
797
803
  var e;
798
- return ((e = n.modelValue) == null ? void 0 : e.convert) ?? null;
804
+ return ((e = o.modelValue) == null ? void 0 : e.convert) ?? null;
799
805
  },
800
806
  set(e) {
801
- const t = n.modelValue ? {
802
- ...n.modelValue
807
+ const t = o.modelValue ? {
808
+ ...o.modelValue
803
809
  } : {};
804
- e ? t.convert = e : t.convert = null, c("update:modelValue", t);
810
+ e ? t.convert = e : t.convert = null, u("update:modelValue", t);
805
811
  }
806
- }), K = g(() => mt.options.filter(
812
+ }), K = b(() => pt.options.filter(
807
813
  (e) => (
808
814
  // e === F_INVENTORY_VALUATION_METHODS.enum.FIFO ||
809
- e === mt.enum.WAVG
815
+ e === pt.enum.WAVG
810
816
  )
811
817
  ).map((e) => ({
812
- label: r(`inventory.ingredient.valuationMethod.${e}`),
818
+ label: d(`inventory.ingredient.valuationMethod.${e}`),
813
819
  value: e
814
- }))), me = g({
820
+ }))), me = b({
815
821
  get() {
816
822
  var e;
817
- return ((e = n.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
823
+ return ((e = o.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
818
824
  },
819
825
  set(e) {
820
- const t = n.modelValue ? {
821
- ...n.modelValue
826
+ const t = o.modelValue ? {
827
+ ...o.modelValue
822
828
  } : {};
823
- t.valuation = e, c("update:modelValue", t);
829
+ t.valuation = e, u("update:modelValue", t);
824
830
  }
825
- }), Z = g({
831
+ }), Z = b({
826
832
  get() {
827
833
  var e;
828
- return ((e = n.modelValue) == null ? void 0 : e.customAttributes) ?? {};
834
+ return ((e = o.modelValue) == null ? void 0 : e.customAttributes) ?? {};
829
835
  },
830
836
  set(e) {
831
- const t = n.modelValue ? {
832
- ...n.modelValue
837
+ const t = o.modelValue ? {
838
+ ...o.modelValue
833
839
  } : {};
834
- t.customAttributes = e, c("update:modelValue", t);
840
+ t.customAttributes = e, u("update:modelValue", t);
835
841
  }
836
842
  }), M = B();
837
- s({
843
+ r({
838
844
  validateInputs: () => {
839
845
  var e, t;
840
846
  (t = (e = M.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
@@ -848,151 +854,151 @@ const zn = /* @__PURE__ */ pe({
848
854
  (t = (e = M.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
849
855
  }
850
856
  });
851
- const R = B(!1), q = g(
857
+ const R = B(!1), q = b(
852
858
  () => {
853
859
  var e, t, x;
854
- return (e = n.modelValue) != null && e._id ? ((x = _.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
855
- (C) => C.from === "INGREDIENT"
860
+ return (e = o.modelValue) != null && e._id ? ((x = p.menu.bindedBySkuId[(t = o.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
861
+ (S) => S.from === "INGREDIENT"
856
862
  )) ?? [] : [];
857
863
  }
858
- ), de = g(
864
+ ), de = b(
859
865
  () => {
860
866
  var e, t, x;
861
- return (e = n.modelValue) != null && e._id ? ((x = _.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
862
- (C) => C.from === "RECIPE"
867
+ return (e = o.modelValue) != null && e._id ? ((x = p.menu.bindedBySkuId[(t = o.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
868
+ (S) => S.from === "RECIPE"
863
869
  )) ?? [] : [];
864
870
  }
865
- ), Te = g(
871
+ ), Te = b(
866
872
  () => {
867
873
  var e, t, x;
868
- return (e = n.modelValue) != null && e._id ? ((x = _.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter((C) => C.from === "MENU")) ?? [] : [];
874
+ return (e = o.modelValue) != null && e._id ? ((x = p.menu.bindedBySkuId[(t = o.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter((S) => S.from === "MENU")) ?? [] : [];
869
875
  }
870
- ), _e = g(
871
- () => _.skus.map((e) => ({ label: e.name, value: e.code }))
872
- ), Ee = B((et = n.modelValue) == null ? void 0 : et.code);
876
+ ), _e = b(
877
+ () => p.skus.map((e) => ({ label: e.name, value: e.code }))
878
+ ), Ee = B((tt = o.modelValue) == null ? void 0 : tt.code);
873
879
  function $e(e) {
874
880
  var x;
875
881
  const t = e.el;
876
882
  t && ((x = t.querySelector("[x-should-scroll-into=true]")) == null || x.scrollIntoView());
877
883
  }
878
- const we = g(
884
+ const we = b(
879
885
  () => {
880
- var e, t, x, C, Y, z;
881
- return ((C = (x = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : x.find(
886
+ var e, t, x, S, Y, z;
887
+ return ((S = (x = (t = (e = o.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : x.find(
882
888
  (re) => {
883
889
  var ie;
884
- return re.id === ((ie = n.modelValue) == null ? void 0 : ie.trackingMeasurement);
890
+ return re.id === ((ie = o.modelValue) == null ? void 0 : ie.trackingMeasurement);
885
891
  }
886
- )) == null ? void 0 : C.abbrev) ?? ((z = (Y = n.modelValue) == null ? void 0 : Y.unit) == null ? void 0 : z.abbrev);
892
+ )) == null ? void 0 : S.abbrev) ?? ((z = (Y = o.modelValue) == null ? void 0 : Y.unit) == null ? void 0 : z.abbrev);
887
893
  }
888
- ), be = g({
894
+ ), be = b({
889
895
  get() {
890
896
  var e, t;
891
- return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? Ue().low;
897
+ return ((t = (e = o.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? Ue().low;
892
898
  },
893
899
  set(e) {
894
- var C;
895
- const t = ((C = n.modelValue) == null ? void 0 : C.thresholds) ?? Ue();
900
+ var S;
901
+ const t = ((S = o.modelValue) == null ? void 0 : S.thresholds) ?? Ue();
896
902
  t.low = e;
897
- const x = n.modelValue ? {
898
- ...n.modelValue
903
+ const x = o.modelValue ? {
904
+ ...o.modelValue
899
905
  } : {};
900
- x.thresholds = t, c("update:modelValue", x);
906
+ x.thresholds = t, u("update:modelValue", x);
901
907
  }
902
- }), se = g({
908
+ }), se = b({
903
909
  get() {
904
910
  var e, t;
905
- return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? Ue().mid;
911
+ return ((t = (e = o.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? Ue().mid;
906
912
  },
907
913
  set(e) {
908
- var C;
909
- const t = ((C = n.modelValue) == null ? void 0 : C.thresholds) ?? Ue();
914
+ var S;
915
+ const t = ((S = o.modelValue) == null ? void 0 : S.thresholds) ?? Ue();
910
916
  t.mid = e;
911
- const x = n.modelValue ? {
912
- ...n.modelValue
917
+ const x = o.modelValue ? {
918
+ ...o.modelValue
913
919
  } : {};
914
- x.thresholds = t, c("update:modelValue", x);
920
+ x.thresholds = t, u("update:modelValue", x);
915
921
  }
916
- }), Ve = g(() => d.mustUsePoTemplate && n.mode === H.CREATE && V.value.length > 0 ? V.value.map((e) => ({
922
+ }), Ve = b(() => i.mustUsePoTemplate && o.mode === H.CREATE && w.value.length > 0 ? w.value.map((e) => ({
917
923
  label: e.name || "Template",
918
924
  value: e._id || "template_" + e.name
919
- })) : []), Ke = g(() => Ve.value.filter(
920
- (e) => (n.purchaseOrderTemplateIds ?? []).includes(e.value)
921
- )), Ze = g(() => d.enableWastageTemplate && n.mode === H.CREATE && E.value.length > 0 ? E.value.map((e) => ({
925
+ })) : []), Ze = b(() => Ve.value.filter(
926
+ (e) => (o.purchaseOrderTemplateIds ?? []).includes(e.value)
927
+ )), Je = b(() => i.enableWastageTemplate && o.mode === H.CREATE && A.value.length > 0 ? A.value.map((e) => ({
922
928
  label: e.name || "Template",
923
929
  value: e._id || "template_" + e.name
924
- })) : []), Je = g(() => Ze.value.filter(
925
- (e) => (n.wastageTemplateIds ?? []).includes(e.value)
926
- )), Qe = g(() => d.enableClosingTemplate && n.mode === H.CREATE && p.value.length > 0 ? p.value.map((e) => ({
930
+ })) : []), Qe = b(() => Je.value.filter(
931
+ (e) => (o.wastageTemplateIds ?? []).includes(e.value)
932
+ )), Xe = b(() => i.enableClosingTemplate && o.mode === H.CREATE && v.value.length > 0 ? v.value.map((e) => ({
927
933
  label: e.name || "Template",
928
934
  value: e._id || "template_" + e.name
929
- })) : []), Xe = g(() => Qe.value.filter(
930
- (e) => (n.closingTemplateIds ?? []).includes(e.value)
935
+ })) : []), et = b(() => Xe.value.filter(
936
+ (e) => (o.closingTemplateIds ?? []).includes(e.value)
931
937
  ));
932
938
  function Ft() {
933
- b.open({
934
- title: r("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
939
+ h.open({
940
+ title: d("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
935
941
  closeButton: !0,
936
942
  contentComponent: We,
937
943
  contentComponentProps: {
938
- modelValue: n.purchaseOrderTemplateIds ?? [],
944
+ modelValue: o.purchaseOrderTemplateIds ?? [],
939
945
  items: Ve.value
940
946
  },
941
947
  primaryActions: {
942
- text: r("common.confirm"),
948
+ text: d("common.confirm"),
943
949
  close: !0
944
950
  },
945
951
  secondaryActions: {
946
- text: r("common.cancel"),
952
+ text: d("common.cancel"),
947
953
  close: !0,
948
954
  variant: "tertiary"
949
955
  }
950
956
  }).onPrimary((e) => {
951
- c("update:purchaseOrderTemplateIds", e);
957
+ u("update:purchaseOrderTemplateIds", e);
952
958
  });
953
959
  }
954
960
  function At() {
955
- b.open({
956
- title: r("inventory.ingredient.wastageTemplates.selectTitle"),
961
+ h.open({
962
+ title: d("inventory.ingredient.wastageTemplates.selectTitle"),
957
963
  closeButton: !0,
958
964
  contentComponent: We,
959
965
  contentComponentProps: {
960
- modelValue: n.wastageTemplateIds ?? [],
961
- items: Ze.value
966
+ modelValue: o.wastageTemplateIds ?? [],
967
+ items: Je.value
962
968
  },
963
969
  primaryActions: {
964
- text: r("common.confirm"),
970
+ text: d("common.confirm"),
965
971
  close: !0
966
972
  },
967
973
  secondaryActions: {
968
- text: r("common.cancel"),
974
+ text: d("common.cancel"),
969
975
  close: !0,
970
976
  variant: "tertiary"
971
977
  }
972
978
  }).onPrimary((e) => {
973
- c("update:wastageTemplateIds", e);
979
+ u("update:wastageTemplateIds", e);
974
980
  });
975
981
  }
976
982
  function Et() {
977
- b.open({
978
- title: r("inventory.ingredient.closingTemplates.selectTitle"),
983
+ h.open({
984
+ title: d("inventory.ingredient.closingTemplates.selectTitle"),
979
985
  closeButton: !0,
980
986
  contentComponent: We,
981
987
  contentComponentProps: {
982
- modelValue: n.closingTemplateIds ?? [],
983
- items: Qe.value
988
+ modelValue: o.closingTemplateIds ?? [],
989
+ items: Xe.value
984
990
  },
985
991
  primaryActions: {
986
- text: r("common.confirm"),
992
+ text: d("common.confirm"),
987
993
  close: !0
988
994
  },
989
995
  secondaryActions: {
990
- text: r("common.cancel"),
996
+ text: d("common.cancel"),
991
997
  close: !0,
992
998
  variant: "tertiary"
993
999
  }
994
1000
  }).onPrimary((e) => {
995
- c("update:closingTemplateIds", e);
1001
+ u("update:closingTemplateIds", e);
996
1002
  });
997
1003
  }
998
1004
  function $t() {
@@ -1001,33 +1007,33 @@ const zn = /* @__PURE__ */ pe({
1001
1007
  };
1002
1008
  }
1003
1009
  return (e, t) => {
1004
- const x = F("FmTextField"), C = F("FmLabel"), Y = F("FmField"), z = F("FmIcon"), re = F("FmMenuHeader"), ie = F("FmMenuDivider"), Ie = F("FmMenuItem"), Mt = F("FmMenu"), tt = F("FmFormGroup"), Ut = F("FmSelect"), nt = F("FmSwitch"), ot = F("FmStepperField"), Be = F("FmButton"), De = F("FmChip"), Pt = F("FmForm");
1005
- return u(), O(Pt, {
1010
+ const x = C("FmTextField"), S = C("FmLabel"), Y = C("FmField"), z = C("FmIcon"), re = C("FmMenuHeader"), ie = C("FmMenuDivider"), Ie = C("FmMenuItem"), Mt = C("FmMenu"), nt = C("FmFormGroup"), Ut = C("FmSelect"), ot = C("FmSwitch"), lt = C("FmStepperField"), Be = C("FmButton"), De = C("FmChip"), Pt = C("FmForm");
1011
+ return c(), O(Pt, {
1006
1012
  disabled: e.disabled,
1007
1013
  ref_key: "formRef",
1008
1014
  ref: M,
1009
1015
  class: "flex flex-col gap-32",
1010
1016
  onValidationSuccess: fe
1011
1017
  }, {
1012
- default: y(() => {
1013
- var lt, at, st, rt;
1018
+ default: g(() => {
1019
+ var at, st, rt, it;
1014
1020
  return [
1015
- o("div", Wn, [
1016
- o("div", Hn, [
1017
- a(Se, {
1021
+ n("div", Wn, [
1022
+ n("div", Hn, [
1023
+ s(Se, {
1018
1024
  "tooltip-message": "This field is managed by NetSuite",
1019
1025
  "tooltip-z-index": 50,
1020
- label: l(r)("inventory.ingredient.code"),
1026
+ label: l(d)("inventory.ingredient.code"),
1021
1027
  "model-value": le.value,
1022
- "onUpdate:modelValue": t[1] || (t[1] = (I) => le.value = I),
1023
- locked: v.value,
1028
+ "onUpdate:modelValue": t[1] || (t[1] = (V) => le.value = V),
1029
+ locked: f.value,
1024
1030
  disabled: e.disabled
1025
1031
  }, {
1026
- default: y(() => [
1027
- a(x, {
1028
- label: l(r)("inventory.ingredient.code"),
1032
+ default: g(() => [
1033
+ s(x, {
1034
+ label: l(d)("inventory.ingredient.code"),
1029
1035
  "model-value": le.value,
1030
- "onUpdate:modelValue": t[0] || (t[0] = (I) => le.value = I),
1036
+ "onUpdate:modelValue": t[0] || (t[0] = (V) => le.value = V),
1031
1037
  rules: [l(Ne)(), l(sn)(_e.value, Ee.value)],
1032
1038
  "label-mark": "required"
1033
1039
  }, null, 8, ["label", "model-value", "rules"])
@@ -1035,21 +1041,21 @@ const zn = /* @__PURE__ */ pe({
1035
1041
  _: 1
1036
1042
  }, 8, ["label", "model-value", "locked", "disabled"])
1037
1043
  ]),
1038
- o("div", qn, [
1039
- a(Se, {
1044
+ n("div", qn, [
1045
+ s(Se, {
1040
1046
  "tooltip-message": "This field is managed by NetSuite",
1041
1047
  "tooltip-z-index": 50,
1042
- label: l(r)("inventory.ingredient.name"),
1048
+ label: l(d)("inventory.ingredient.name"),
1043
1049
  "model-value": ae.value,
1044
- "onUpdate:modelValue": t[3] || (t[3] = (I) => ae.value = I),
1045
- locked: v.value,
1050
+ "onUpdate:modelValue": t[3] || (t[3] = (V) => ae.value = V),
1051
+ locked: f.value,
1046
1052
  disabled: e.disabled
1047
1053
  }, {
1048
- default: y(() => [
1049
- a(x, {
1050
- label: l(r)("inventory.ingredient.name"),
1054
+ default: g(() => [
1055
+ s(x, {
1056
+ label: l(d)("inventory.ingredient.name"),
1051
1057
  "model-value": ae.value,
1052
- "onUpdate:modelValue": t[2] || (t[2] = (I) => ae.value = I),
1058
+ "onUpdate:modelValue": t[2] || (t[2] = (V) => ae.value = V),
1053
1059
  rules: [l(Ne)()],
1054
1060
  "label-mark": "required"
1055
1061
  }, null, 8, ["label", "model-value", "rules"])
@@ -1058,30 +1064,30 @@ const zn = /* @__PURE__ */ pe({
1058
1064
  }, 8, ["label", "model-value", "locked", "disabled"])
1059
1065
  ])
1060
1066
  ]),
1061
- a(Se, {
1067
+ s(Se, {
1062
1068
  "tooltip-message": "This field is managed by NetSuite",
1063
1069
  "tooltip-z-index": 50,
1064
- label: l(r)("inventory.ingredient.unit"),
1065
- "helper-text": (lt = e.modelValue) != null && lt.trackingMeasurement ? `Base unit: ${(st = (at = e.modelValue) == null ? void 0 : at.unit) == null ? void 0 : st.name}` : void 0,
1066
- "model-value": (rt = ge.value) == null ? void 0 : rt.name,
1067
- locked: v.value,
1070
+ label: l(d)("inventory.ingredient.unit"),
1071
+ "helper-text": (at = e.modelValue) != null && at.trackingMeasurement ? `Base unit: ${(rt = (st = e.modelValue) == null ? void 0 : st.unit) == null ? void 0 : rt.name}` : void 0,
1072
+ "model-value": (it = ge.value) == null ? void 0 : it.name,
1073
+ locked: f.value,
1068
1074
  disabled: e.disabled
1069
1075
  }, {
1070
- default: y(() => [
1071
- a(tt, {
1076
+ default: g(() => [
1077
+ s(nt, {
1072
1078
  "model-value": ge.value,
1073
1079
  rules: [l(Ne)()],
1074
1080
  "label-mark": "required"
1075
1081
  }, {
1076
- label: y(() => [
1077
- a(C, {
1078
- label: l(r)("inventory.ingredient.unit")
1082
+ label: g(() => [
1083
+ s(S, {
1084
+ label: l(d)("inventory.ingredient.unit")
1079
1085
  }, null, 8, ["label"])
1080
1086
  ]),
1081
- default: y(({ invalid: I }) => [
1082
- a(Mt, null, {
1083
- "menu-button": y(() => [
1084
- a(Y, {
1087
+ default: g(({ invalid: V }) => [
1088
+ s(Mt, null, {
1089
+ "menu-button": g(() => [
1090
+ s(Y, {
1085
1091
  class: te([
1086
1092
  "fm-typo-en-body-lg-400",
1087
1093
  {
@@ -1089,45 +1095,45 @@ const zn = /* @__PURE__ */ pe({
1089
1095
  "text-fm-color-typo-disabled": e.disabled
1090
1096
  }
1091
1097
  ]),
1092
- invalid: I,
1098
+ invalid: V,
1093
1099
  "append-icon": "expand_more"
1094
1100
  }, {
1095
- default: y(() => {
1101
+ default: g(() => {
1096
1102
  var J;
1097
1103
  return [
1098
- Ge(A((J = ge.value) == null ? void 0 : J.name), 1)
1104
+ Ye(F((J = ge.value) == null ? void 0 : J.name), 1)
1099
1105
  ];
1100
1106
  }),
1101
1107
  _: 2
1102
1108
  }, 1032, ["class", "invalid"])
1103
1109
  ]),
1104
- default: y(() => [
1105
- o("div", Yn, [
1106
- a(x, {
1107
- modelValue: h.value,
1108
- "onUpdate:modelValue": t[4] || (t[4] = (J) => h.value = J),
1110
+ default: g(() => [
1111
+ n("div", Yn, [
1112
+ s(x, {
1113
+ modelValue: _.value,
1114
+ "onUpdate:modelValue": t[4] || (t[4] = (J) => _.value = J),
1109
1115
  placeholder: "Filter options"
1110
1116
  }, {
1111
- prepend: y(() => [
1112
- a(z, { name: "search" })
1117
+ prepend: g(() => [
1118
+ s(z, { name: "search" })
1113
1119
  ]),
1114
1120
  _: 1
1115
1121
  }, 8, ["modelValue"]),
1116
- o("div", {
1122
+ n("div", {
1117
1123
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
1118
1124
  onVnodeMounted: $e
1119
1125
  }, [
1120
- (u(!0), w(X, null, ue(G.value, (J, Rt) => (u(), w(X, { key: Rt }, [
1121
- J.displayAsSection ? (u(), w(X, { key: 0 }, [
1122
- a(re, {
1126
+ (c(!0), T(X, null, ue(G.value, (J, Rt) => (c(), T(X, { key: Rt }, [
1127
+ J.displayAsSection ? (c(), T(X, { key: 0 }, [
1128
+ s(re, {
1123
1129
  label: J.label
1124
1130
  }, null, 8, ["label"]),
1125
- a(ie)
1126
- ], 64)) : (u(), O(Ie, {
1131
+ s(ie)
1132
+ ], 64)) : (c(), O(Ie, {
1127
1133
  key: 1,
1128
1134
  label: J.label,
1129
1135
  "model-value": $(J),
1130
- onClick: (cl) => f(J.value),
1136
+ onClick: (cl) => y(J.value),
1131
1137
  "x-should-scroll-into": `${$(J)}`
1132
1138
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
1133
1139
  ], 64))), 128))
@@ -1142,161 +1148,161 @@ const zn = /* @__PURE__ */ pe({
1142
1148
  ]),
1143
1149
  _: 1
1144
1150
  }, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
1145
- l(d).enableTotalCost ? (u(), O(Se, {
1151
+ l(i).enableTotalCost ? (c(), O(Se, {
1146
1152
  key: 0,
1147
1153
  "tooltip-message": "This field is managed by NetSuite",
1148
1154
  "tooltip-z-index": 50,
1149
- label: l(r)("inventory.ingredient.valuationMethod.title"),
1150
- "model-value": l(r)("inventory.ingredient.valuationMethod." + me.value),
1151
- locked: v.value,
1155
+ label: l(d)("inventory.ingredient.valuationMethod.title"),
1156
+ "model-value": l(d)("inventory.ingredient.valuationMethod." + me.value),
1157
+ locked: f.value,
1152
1158
  disabled: e.disabled
1153
1159
  }, {
1154
- label: y(() => [
1155
- a(he, { "z-index": 50 }, {
1156
- default: y(() => [
1157
- a(C, {
1158
- label: l(r)("inventory.ingredient.valuationMethod.title")
1160
+ label: g(() => [
1161
+ s(he, { "z-index": 50 }, {
1162
+ default: g(() => [
1163
+ s(S, {
1164
+ label: l(d)("inventory.ingredient.valuationMethod.title")
1159
1165
  }, null, 8, ["label"])
1160
1166
  ]),
1161
1167
  _: 1
1162
1168
  })
1163
1169
  ]),
1164
- default: y(() => [
1165
- a(Ut, {
1170
+ default: g(() => [
1171
+ s(Ut, {
1166
1172
  class: "col-span-2",
1167
- label: l(r)("inventory.ingredient.valuationMethod.title"),
1173
+ label: l(d)("inventory.ingredient.valuationMethod.title"),
1168
1174
  "model-value": me.value,
1169
- "onUpdate:modelValue": t[5] || (t[5] = (I) => me.value = I),
1175
+ "onUpdate:modelValue": t[5] || (t[5] = (V) => me.value = V),
1170
1176
  items: K.value
1171
1177
  }, null, 8, ["label", "model-value", "items"])
1172
1178
  ]),
1173
1179
  _: 1
1174
1180
  }, 8, ["label", "model-value", "locked", "disabled"])) : L("", !0),
1175
- l(d).enableTotalCost ? (u(), O(Se, {
1181
+ l(i).enableTotalCost ? (c(), O(Se, {
1176
1182
  key: 1,
1177
1183
  "tooltip-message": "This field is managed by NetSuite",
1178
1184
  "tooltip-z-index": 50,
1179
1185
  "model-value": `${l(Wt)()} ${ye.value}`,
1180
- locked: v.value,
1186
+ locked: f.value,
1181
1187
  "append-text": `/ ${we.value}`,
1182
1188
  disabled: e.disabled
1183
1189
  }, {
1184
- label: y(() => [
1185
- a(he, { "z-index": 50 }, {
1186
- default: y(() => [
1187
- a(C, {
1188
- label: l(r)("inventory.ingredient.pricePerUnit")
1190
+ label: g(() => [
1191
+ s(he, { "z-index": 50 }, {
1192
+ default: g(() => [
1193
+ s(S, {
1194
+ label: l(d)("inventory.ingredient.pricePerUnit")
1189
1195
  }, null, 8, ["label"])
1190
1196
  ]),
1191
1197
  _: 1
1192
1198
  })
1193
1199
  ]),
1194
- default: y(() => [
1195
- a(x, {
1200
+ default: g(() => [
1201
+ s(x, {
1196
1202
  "model-value": ye.value,
1197
- "onUpdate:modelValue": t[6] || (t[6] = (I) => ye.value = I),
1203
+ "onUpdate:modelValue": t[6] || (t[6] = (V) => ye.value = V),
1198
1204
  rules: [l(Pe)(0), l(rn)(4)]
1199
1205
  }, {
1200
- label: y(() => [
1201
- a(he, { "z-index": 50 }, {
1202
- default: y(() => [
1203
- a(C, {
1204
- label: l(r)("inventory.ingredient.pricePerUnit")
1206
+ label: g(() => [
1207
+ s(he, { "z-index": 50 }, {
1208
+ default: g(() => [
1209
+ s(S, {
1210
+ label: l(d)("inventory.ingredient.pricePerUnit")
1205
1211
  }, null, 8, ["label"])
1206
1212
  ]),
1207
1213
  _: 1
1208
1214
  })
1209
1215
  ]),
1210
- prepend: y(() => {
1211
- var I, J;
1216
+ prepend: g(() => {
1217
+ var V, J;
1212
1218
  return [
1213
- o("div", Gn, A(l(pt)(((I = l(i).currentCountry) == null ? void 0 : I.value) ?? l(vt)) === "MYR" ? "RM" : l(pt)(((J = l(i).currentCountry) == null ? void 0 : J.value) ?? l(vt))), 1)
1219
+ n("div", Gn, F(l(vt)(((V = l(a).currentCountry) == null ? void 0 : V.value) ?? l(ft)) === "MYR" ? "RM" : l(vt)(((J = l(a).currentCountry) == null ? void 0 : J.value) ?? l(ft))), 1)
1214
1220
  ];
1215
1221
  }),
1216
- append: y(() => [
1217
- o("div", Kn, " / " + A(we.value), 1)
1222
+ append: g(() => [
1223
+ n("div", Kn, " / " + F(we.value), 1)
1218
1224
  ]),
1219
1225
  _: 1
1220
1226
  }, 8, ["model-value", "rules"])
1221
1227
  ]),
1222
1228
  _: 1
1223
1229
  }, 8, ["model-value", "locked", "append-text", "disabled"])) : L("", !0),
1224
- !v.value || j.value ? (u(), O(zn, {
1230
+ !f.value || j.value ? (c(), O(zn, {
1225
1231
  key: 2,
1226
1232
  "model-value": j.value,
1227
- "onUpdate:modelValue": t[7] || (t[7] = (I) => j.value = I),
1233
+ "onUpdate:modelValue": t[7] || (t[7] = (V) => j.value = V),
1228
1234
  "root-value": e.modelValue,
1229
- readonly: v.value
1235
+ readonly: f.value
1230
1236
  }, null, 8, ["model-value", "root-value", "readonly"])) : L("", !0),
1231
- e.mode !== l(H).CREATE ? (u(), w("div", Zn, [
1232
- a(nt, {
1233
- label: l(r)("inventory.ingredient.status.inactive"),
1237
+ e.mode !== l(H).CREATE ? (c(), T("div", Zn, [
1238
+ s(ot, {
1239
+ label: l(d)("inventory.ingredient.status.inactive"),
1234
1240
  "model-value": ee.value,
1235
- "onUpdate:modelValue": t[8] || (t[8] = (I) => ee.value = I),
1241
+ "onUpdate:modelValue": t[8] || (t[8] = (V) => ee.value = V),
1236
1242
  "label-placement": "right",
1237
- disabled: v.value
1243
+ disabled: f.value
1238
1244
  }, null, 8, ["label", "model-value", "disabled"]),
1239
- o("div", Jn, [
1240
- o("div", Qn, A(l(r)("inventory.ingredient.status.preventFromOrder")), 1)
1245
+ n("div", Jn, [
1246
+ n("div", Qn, F(l(d)("inventory.ingredient.status.preventFromOrder")), 1)
1241
1247
  ])
1242
1248
  ])) : L("", !0),
1243
- e.mode !== l(H).CREATE ? (u(), w("div", Xn, [
1244
- o("div", null, [
1245
- a(nt, {
1246
- label: l(r)("inventory.ingredient.bindedItems.title"),
1249
+ e.mode !== l(H).CREATE ? (c(), T("div", Xn, [
1250
+ n("div", null, [
1251
+ s(ot, {
1252
+ label: l(d)("inventory.ingredient.bindedItems.title"),
1247
1253
  modelValue: R.value,
1248
- "onUpdate:modelValue": t[9] || (t[9] = (I) => R.value = I),
1254
+ "onUpdate:modelValue": t[9] || (t[9] = (V) => R.value = V),
1249
1255
  "label-placement": "right"
1250
1256
  }, null, 8, ["label", "modelValue"])
1251
1257
  ]),
1252
- R.value && q.value.length ? (u(), O(je, {
1258
+ R.value && q.value.length ? (c(), O(je, {
1253
1259
  key: 0,
1254
- name: l(r)("inventory.ingredient.bindedItems.ingredient"),
1260
+ name: l(d)("inventory.ingredient.bindedItems.ingredient"),
1255
1261
  bindings: q.value
1256
1262
  }, null, 8, ["name", "bindings"])) : L("", !0),
1257
- R.value && de.value.length ? (u(), O(je, {
1263
+ R.value && de.value.length ? (c(), O(je, {
1258
1264
  key: 1,
1259
- name: l(r)("inventory.ingredient.bindedItems.recipe"),
1265
+ name: l(d)("inventory.ingredient.bindedItems.recipe"),
1260
1266
  bindings: de.value
1261
1267
  }, null, 8, ["name", "bindings"])) : L("", !0),
1262
- R.value && Te.value.length ? (u(), O(je, {
1268
+ R.value && Te.value.length ? (c(), O(je, {
1263
1269
  key: 2,
1264
- name: l(r)("inventory.ingredient.bindedItems.menu"),
1270
+ name: l(d)("inventory.ingredient.bindedItems.menu"),
1265
1271
  bindings: Te.value
1266
1272
  }, null, 8, ["name", "bindings"])) : L("", !0)
1267
1273
  ])) : L("", !0),
1268
- o("div", eo, [
1269
- o("div", to, [
1270
- a(he, null, {
1271
- default: y(() => [
1272
- o("div", no, A(l(r)("inventory.ingredient.threshold.title")), 1)
1274
+ n("div", eo, [
1275
+ n("div", to, [
1276
+ s(he, null, {
1277
+ default: g(() => [
1278
+ n("div", no, F(l(d)("inventory.ingredient.threshold.title")), 1)
1273
1279
  ]),
1274
1280
  _: 1
1275
1281
  }),
1276
- o("div", oo, A(l(r)("inventory.ingredient.threshold.subtitle")), 1)
1282
+ n("div", oo, F(l(d)("inventory.ingredient.threshold.subtitle")), 1)
1277
1283
  ]),
1278
- o("div", lo, [
1279
- a(tt, {
1284
+ n("div", lo, [
1285
+ s(nt, {
1280
1286
  "model-value": { low: be.value, mid: se.value },
1281
1287
  rules: [$t()]
1282
1288
  }, null, 8, ["model-value", "rules"]),
1283
- o("div", ao, [
1284
- o("div", so, [
1285
- o("div", ro, [
1286
- a(ze, {
1289
+ n("div", ao, [
1290
+ n("div", so, [
1291
+ n("div", ro, [
1292
+ s(ze, {
1287
1293
  days: be.value,
1288
1294
  level: l(Le).low
1289
1295
  }, null, 8, ["days", "level"])
1290
1296
  ]),
1291
- o("div", io, [
1292
- o("div", uo, A(l(r)("inventory.ingredient.threshold.whenRemaining")), 1),
1293
- a(ot, {
1297
+ n("div", io, [
1298
+ n("div", uo, F(l(d)("inventory.ingredient.threshold.whenRemaining")), 1),
1299
+ s(lt, {
1294
1300
  modelValue: be.value,
1295
- "onUpdate:modelValue": t[10] || (t[10] = (I) => be.value = I),
1301
+ "onUpdate:modelValue": t[10] || (t[10] = (V) => be.value = V),
1296
1302
  rules: [l(Pe)(0)]
1297
1303
  }, {
1298
- append: y(() => t[13] || (t[13] = [
1299
- o("div", {
1304
+ append: g(() => t[13] || (t[13] = [
1305
+ n("div", {
1300
1306
  class: "text-fm-color-typo-secondary",
1301
1307
  style: { "padding-right": "32px" }
1302
1308
  }, "days", -1)
@@ -1305,31 +1311,31 @@ const zn = /* @__PURE__ */ pe({
1305
1311
  }, 8, ["modelValue", "rules"])
1306
1312
  ])
1307
1313
  ]),
1308
- t[15] || (t[15] = o("div", {
1314
+ t[15] || (t[15] = n("div", {
1309
1315
  class: "h-full bg-fm-color-neutral-gray-200 relative",
1310
1316
  style: { width: "1px" }
1311
1317
  }, [
1312
- o("div", {
1318
+ n("div", {
1313
1319
  class: "absolute bg-white",
1314
1320
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
1315
1321
  }, " < ")
1316
1322
  ], -1)),
1317
- o("div", co, [
1318
- o("div", mo, [
1319
- a(ze, {
1323
+ n("div", co, [
1324
+ n("div", mo, [
1325
+ s(ze, {
1320
1326
  days: se.value,
1321
1327
  level: l(Le).mid
1322
1328
  }, null, 8, ["days", "level"])
1323
1329
  ]),
1324
- o("div", po, [
1325
- o("div", vo, A(l(r)("inventory.ingredient.threshold.whenRemaining")), 1),
1326
- a(ot, {
1330
+ n("div", po, [
1331
+ n("div", vo, F(l(d)("inventory.ingredient.threshold.whenRemaining")), 1),
1332
+ s(lt, {
1327
1333
  modelValue: se.value,
1328
- "onUpdate:modelValue": t[11] || (t[11] = (I) => se.value = I),
1334
+ "onUpdate:modelValue": t[11] || (t[11] = (V) => se.value = V),
1329
1335
  rules: [l(Pe)(0)]
1330
1336
  }, {
1331
- append: y(() => t[14] || (t[14] = [
1332
- o("div", {
1337
+ append: g(() => t[14] || (t[14] = [
1338
+ n("div", {
1333
1339
  class: "text-fm-color-typo-secondary",
1334
1340
  style: { "padding-right": "32px" }
1335
1341
  }, "days", -1)
@@ -1338,39 +1344,39 @@ const zn = /* @__PURE__ */ pe({
1338
1344
  }, 8, ["modelValue", "rules"])
1339
1345
  ])
1340
1346
  ]),
1341
- t[16] || (t[16] = o("div", {
1347
+ t[16] || (t[16] = n("div", {
1342
1348
  class: "h-full bg-fm-color-neutral-gray-200 relative",
1343
1349
  style: { width: "1px" }
1344
1350
  }, [
1345
- o("div", {
1351
+ n("div", {
1346
1352
  class: "absolute bg-white",
1347
1353
  style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
1348
1354
  }, " < ")
1349
1355
  ], -1)),
1350
- o("div", fo, [
1351
- o("div", yo, [
1352
- a(ze, {
1356
+ n("div", fo, [
1357
+ n("div", yo, [
1358
+ s(ze, {
1353
1359
  days: se.value + 1,
1354
1360
  level: l(Le).high
1355
1361
  }, null, 8, ["days", "level"])
1356
1362
  ]),
1357
- o("div", go, [
1358
- o("div", bo, A(l(r)("inventory.ingredient.threshold.stockIsStaple")), 1)
1363
+ n("div", go, [
1364
+ n("div", bo, F(l(d)("inventory.ingredient.threshold.stockIsStaple")), 1)
1359
1365
  ])
1360
1366
  ])
1361
1367
  ])
1362
1368
  ])
1363
1369
  ]),
1364
- l(d).mustUsePoTemplate && e.mode === l(H).CREATE ? (u(), w("div", ho, [
1365
- o("div", _o, [
1366
- o("div", xo, [
1367
- a(he, null, {
1368
- default: y(() => [
1369
- o("div", ko, A(l(r)("inventory.ingredient.purchaseOrderTemplates.title")), 1)
1370
+ l(i).mustUsePoTemplate && e.mode === l(H).CREATE ? (c(), T("div", ho, [
1371
+ n("div", _o, [
1372
+ n("div", xo, [
1373
+ s(he, null, {
1374
+ default: g(() => [
1375
+ n("div", ko, F(l(d)("inventory.ingredient.purchaseOrderTemplates.title")), 1)
1370
1376
  ]),
1371
1377
  _: 1
1372
1378
  }),
1373
- a(Be, {
1379
+ s(Be, {
1374
1380
  variant: "secondary",
1375
1381
  "text-color": "primary",
1376
1382
  "border-color": "primary",
@@ -1378,29 +1384,29 @@ const zn = /* @__PURE__ */ pe({
1378
1384
  onClick: Ft
1379
1385
  })
1380
1386
  ]),
1381
- o("div", To, A(l(r)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
1387
+ n("div", To, F(l(d)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
1382
1388
  ]),
1383
- Ke.value.length > 0 ? (u(), w("div", wo, [
1384
- o("div", Vo, [
1385
- (u(!0), w(X, null, ue(Ke.value, (I) => (u(), O(De, {
1386
- key: I.value,
1387
- label: I.label,
1389
+ Ze.value.length > 0 ? (c(), T("div", wo, [
1390
+ n("div", Vo, [
1391
+ (c(!0), T(X, null, ue(Ze.value, (V) => (c(), O(De, {
1392
+ key: V.value,
1393
+ label: V.label,
1388
1394
  variant: "info",
1389
1395
  compact: ""
1390
1396
  }, null, 8, ["label"]))), 128))
1391
1397
  ])
1392
1398
  ])) : L("", !0)
1393
1399
  ])) : L("", !0),
1394
- l(d).enableWastageTemplate && e.mode === l(H).CREATE ? (u(), w("div", Io, [
1395
- o("div", So, [
1396
- o("div", Co, [
1397
- a(he, null, {
1398
- default: y(() => [
1399
- o("div", Fo, A(l(r)("inventory.ingredient.wastageTemplates.title")), 1)
1400
+ l(i).enableWastageTemplate && e.mode === l(H).CREATE ? (c(), T("div", Io, [
1401
+ n("div", So, [
1402
+ n("div", Co, [
1403
+ s(he, null, {
1404
+ default: g(() => [
1405
+ n("div", Fo, F(l(d)("inventory.ingredient.wastageTemplates.title")), 1)
1400
1406
  ]),
1401
1407
  _: 1
1402
1408
  }),
1403
- a(Be, {
1409
+ s(Be, {
1404
1410
  variant: "secondary",
1405
1411
  "text-color": "primary",
1406
1412
  "border-color": "primary",
@@ -1408,29 +1414,29 @@ const zn = /* @__PURE__ */ pe({
1408
1414
  onClick: At
1409
1415
  })
1410
1416
  ]),
1411
- o("div", Ao, A(l(r)("inventory.ingredient.wastageTemplates.description")), 1)
1417
+ n("div", Ao, F(l(d)("inventory.ingredient.wastageTemplates.description")), 1)
1412
1418
  ]),
1413
- Je.value.length > 0 ? (u(), w("div", Eo, [
1414
- o("div", $o, [
1415
- (u(!0), w(X, null, ue(Je.value, (I) => (u(), O(De, {
1416
- key: I.value,
1417
- label: I.label,
1419
+ Qe.value.length > 0 ? (c(), T("div", Eo, [
1420
+ n("div", $o, [
1421
+ (c(!0), T(X, null, ue(Qe.value, (V) => (c(), O(De, {
1422
+ key: V.value,
1423
+ label: V.label,
1418
1424
  variant: "info",
1419
1425
  compact: ""
1420
1426
  }, null, 8, ["label"]))), 128))
1421
1427
  ])
1422
1428
  ])) : L("", !0)
1423
1429
  ])) : L("", !0),
1424
- l(d).enableClosingTemplate && e.mode === l(H).CREATE ? (u(), w("div", Mo, [
1425
- o("div", Uo, [
1426
- o("div", Po, [
1427
- a(he, null, {
1428
- default: y(() => [
1429
- o("div", Ro, A(l(r)("inventory.ingredient.closingTemplates.title")), 1)
1430
+ l(i).enableClosingTemplate && e.mode === l(H).CREATE ? (c(), T("div", Mo, [
1431
+ n("div", Uo, [
1432
+ n("div", Po, [
1433
+ s(he, null, {
1434
+ default: g(() => [
1435
+ n("div", Ro, F(l(d)("inventory.ingredient.closingTemplates.title")), 1)
1430
1436
  ]),
1431
1437
  _: 1
1432
1438
  }),
1433
- a(Be, {
1439
+ s(Be, {
1434
1440
  variant: "secondary",
1435
1441
  "text-color": "primary",
1436
1442
  "border-color": "primary",
@@ -1438,24 +1444,24 @@ const zn = /* @__PURE__ */ pe({
1438
1444
  onClick: Et
1439
1445
  })
1440
1446
  ]),
1441
- o("div", Bo, A(l(r)("inventory.ingredient.closingTemplates.description")), 1)
1447
+ n("div", Bo, F(l(d)("inventory.ingredient.closingTemplates.description")), 1)
1442
1448
  ]),
1443
- Xe.value.length > 0 ? (u(), w("div", Do, [
1444
- o("div", Oo, [
1445
- (u(!0), w(X, null, ue(Xe.value, (I) => (u(), O(De, {
1446
- key: I.value,
1447
- label: I.label,
1449
+ et.value.length > 0 ? (c(), T("div", Do, [
1450
+ n("div", Oo, [
1451
+ (c(!0), T(X, null, ue(et.value, (V) => (c(), O(De, {
1452
+ key: V.value,
1453
+ label: V.label,
1448
1454
  variant: "info",
1449
1455
  compact: ""
1450
1456
  }, null, 8, ["label"]))), 128))
1451
1457
  ])
1452
1458
  ])) : L("", !0)
1453
1459
  ])) : L("", !0),
1454
- o("div", null, [
1455
- a(yn, {
1460
+ n("div", null, [
1461
+ s(yn, {
1456
1462
  entity: "inventorySku",
1457
1463
  modelValue: Z.value,
1458
- "onUpdate:modelValue": t[12] || (t[12] = (I) => Z.value = I)
1464
+ "onUpdate:modelValue": t[12] || (t[12] = (V) => Z.value = V)
1459
1465
  }, null, 8, ["modelValue"])
1460
1466
  ])
1461
1467
  ];
@@ -1476,46 +1482,46 @@ const zn = /* @__PURE__ */ pe({
1476
1482
  },
1477
1483
  emits: ["update:show"],
1478
1484
  setup(W) {
1479
- const s = W, T = Ce(), r = Vt(), b = Ae(), S = It(), U = St(), k = Ct(), n = Fe(), { t: c } = ve(), _ = gt(s, "show"), i = gt(s, "sku"), d = B([]), m = B([]), v = B([]), V = g(
1485
+ const r = W, k = Ce(), d = Vt(), h = Ae(), I = It(), E = St(), P = Ct(), o = Fe(), { t: u } = ve(), p = bt(r, "show"), a = bt(r, "sku"), i = B([]), m = B([]), f = B([]), w = b(
1480
1486
  () => {
1481
- var h;
1482
- return b.isEnabled && b.netSuiteItemBySkuId.has((h = s.sku) == null ? void 0 : h._id);
1487
+ var _;
1488
+ return h.isEnabled && h.netSuiteItemBySkuId.has((_ = r.sku) == null ? void 0 : _._id);
1483
1489
  }
1484
- ), E = g(() => {
1485
- switch (s.mode) {
1490
+ ), A = b(() => {
1491
+ switch (r.mode) {
1486
1492
  case H.READ:
1487
1493
  return "";
1488
1494
  case H.UPDATE:
1489
- return c("inventory.ingredient.update.title");
1495
+ return u("inventory.ingredient.update.title");
1490
1496
  case H.CREATE:
1491
- return c("inventory.ingredient.create.title");
1497
+ return u("inventory.ingredient.create.title");
1492
1498
  }
1493
1499
  return "";
1494
- }), p = g(() => {
1495
- switch (s.mode) {
1500
+ }), v = b(() => {
1501
+ switch (r.mode) {
1496
1502
  case H.READ:
1497
1503
  return "";
1498
1504
  case H.UPDATE:
1499
- return c("common.save");
1505
+ return u("common.save");
1500
1506
  case H.CREATE:
1501
- return c("common.add");
1507
+ return u("common.add");
1502
1508
  }
1503
1509
  return "";
1504
1510
  }), N = B(), D = B(!1);
1505
1511
  async function fe() {
1506
1512
  D.value = !0;
1507
1513
  try {
1508
- await T.createSku(i.value);
1509
- const h = T.skuByCode[i.value.code];
1510
- r.enablePoTemplate && d.value.length > 0 && await ce(h), r.enableWastageTemplate && m.value.length > 0 && await oe(h), r.enableClosingTemplate && v.value.length > 0 && await le(h), _.value = !1, n.open({
1511
- title: c("inventory.common.success"),
1512
- message: c("inventory.ingredient.create.success", { name: i.value.name }),
1514
+ await k.createSku(a.value);
1515
+ const _ = k.skuByCode[a.value.code];
1516
+ d.enablePoTemplate && i.value.length > 0 && await ce(_), d.enableWastageTemplate && m.value.length > 0 && await oe(_), d.enableClosingTemplate && f.value.length > 0 && await le(_), p.value = !1, o.open({
1517
+ title: u("inventory.common.success"),
1518
+ message: u("inventory.ingredient.create.success", { name: a.value.name }),
1513
1519
  type: "success"
1514
1520
  });
1515
- } catch (h) {
1516
- h instanceof ft || n.open({
1517
- title: c("inventory.ingredient.create.error.title"),
1518
- message: c("inventory.ingredient.create.error.message"),
1521
+ } catch (_) {
1522
+ _ instanceof yt || o.open({
1523
+ title: u("inventory.ingredient.create.error.title"),
1524
+ message: u("inventory.ingredient.create.error.message"),
1519
1525
  type: "error"
1520
1526
  });
1521
1527
  } finally {
@@ -1525,41 +1531,41 @@ const zn = /* @__PURE__ */ pe({
1525
1531
  async function ne() {
1526
1532
  D.value = !0;
1527
1533
  try {
1528
- await T.updateSku(i.value), D.value = !1, _.value = !1, n.open({
1529
- title: c("inventory.common.success"),
1530
- message: c("inventory.ingredient.update.success", { name: i.value.name }),
1534
+ await k.updateSku(a.value), D.value = !1, p.value = !1, o.open({
1535
+ title: u("inventory.common.success"),
1536
+ message: u("inventory.ingredient.update.success", { name: a.value.name }),
1531
1537
  type: "success"
1532
1538
  });
1533
- } catch (h) {
1534
- h instanceof ft || n.open({
1535
- title: c("inventory.ingredient.update.error.title"),
1536
- message: c("inventory.ingredient.update.error.message"),
1539
+ } catch (_) {
1540
+ _ instanceof yt || o.open({
1541
+ title: u("inventory.ingredient.update.error.title"),
1542
+ message: u("inventory.ingredient.update.error.message"),
1537
1543
  type: "error"
1538
1544
  });
1539
1545
  } finally {
1540
1546
  D.value = !1;
1541
1547
  }
1542
1548
  }
1543
- async function ce(h) {
1544
- var P, G, $, f;
1549
+ async function ce(_) {
1550
+ var U, G, $, y;
1545
1551
  try {
1546
- for (const j of d.value) {
1547
- const K = await S.getTemplate(j);
1552
+ for (const j of i.value) {
1553
+ const K = await I.getTemplate(j);
1548
1554
  if (!K) {
1549
1555
  console.warn(`Template with ID ${j} not found`);
1550
1556
  continue;
1551
1557
  }
1552
1558
  if (!K.purchaseOrder.items.find(
1553
- (Z) => Z.sku._id === h._id
1559
+ (Z) => Z.sku._id === _._id
1554
1560
  )) {
1555
- const Z = { amount: 1, precision: dn(h.unit) }, M = {
1556
- sku: h,
1557
- name: h.name,
1558
- code: h.code,
1561
+ const Z = { amount: 1, precision: dn(_.unit) }, M = {
1562
+ sku: _,
1563
+ name: _.name,
1564
+ code: _.code,
1559
1565
  quantity: Z,
1560
1566
  minimumQuantity: Z,
1561
1567
  quantityStep: Z,
1562
- measurement: ((G = (P = h.unit) == null ? void 0 : P.measurements) == null ? void 0 : G[0]) || null
1568
+ measurement: ((G = (U = _.unit) == null ? void 0 : U.measurements) == null ? void 0 : G[0]) || null
1563
1569
  }, R = {
1564
1570
  ...K,
1565
1571
  purchaseOrder: {
@@ -1567,81 +1573,81 @@ const zn = /* @__PURE__ */ pe({
1567
1573
  items: [...K.purchaseOrder.items, M]
1568
1574
  }
1569
1575
  };
1570
- ((($ = R.purchaseOrder.supplier) == null ? void 0 : $.internal) === yt.enum.warehouse || ((f = R.purchaseOrder.supplier) == null ? void 0 : f.internal) === yt.enum.restaurant) && (R.purchaseOrder.items = R.purchaseOrder.items.map(
1576
+ ((($ = R.purchaseOrder.supplier) == null ? void 0 : $.internal) === gt.enum.warehouse || ((y = R.purchaseOrder.supplier) == null ? void 0 : y.internal) === gt.enum.restaurant) && (R.purchaseOrder.items = R.purchaseOrder.items.map(
1571
1577
  ({ totalCost: q, ...de }) => de
1572
- )), await S.updateTemplate(R), await new Promise((q) => setTimeout(q, 1e3));
1578
+ )), await I.updateTemplate(R), await new Promise((q) => setTimeout(q, 1e3));
1573
1579
  }
1574
1580
  }
1575
1581
  } catch (j) {
1576
- n.open({
1577
- title: c("inventory.transfer.template.update.error"),
1578
- message: c("inventory.transfer.template.update.errorMessage"),
1582
+ o.open({
1583
+ title: u("inventory.transfer.template.update.error"),
1584
+ message: u("inventory.transfer.template.update.errorMessage"),
1579
1585
  type: "error"
1580
1586
  }), console.error("Error in updating transfer template", j);
1581
1587
  }
1582
1588
  }
1583
- async function oe(h) {
1589
+ async function oe(_) {
1584
1590
  try {
1585
- for (const P of m.value) {
1586
- const G = await U.getTemplate(P);
1591
+ for (const U of m.value) {
1592
+ const G = await E.getTemplate(U);
1587
1593
  if (!G) {
1588
- console.warn(`Wastage Template with ID ${P} not found`);
1594
+ console.warn(`Wastage Template with ID ${U} not found`);
1589
1595
  continue;
1590
1596
  }
1591
- if (!G.items.find((f) => f.id === h._id)) {
1592
- const f = {
1593
- id: h._id,
1594
- name: h.name,
1595
- code: h.code,
1597
+ if (!G.items.find((y) => y.id === _._id)) {
1598
+ const y = {
1599
+ id: _._id,
1600
+ name: _.name,
1601
+ code: _.code,
1596
1602
  type: "sku",
1597
1603
  disabledMeasurements: []
1598
1604
  }, j = {
1599
1605
  ...G,
1600
- items: [...G.items, f]
1606
+ items: [...G.items, y]
1601
1607
  };
1602
- await U.updateTemplate(j), await new Promise((K) => setTimeout(K, 1e3));
1608
+ await E.updateTemplate(j), await new Promise((K) => setTimeout(K, 1e3));
1603
1609
  }
1604
1610
  }
1605
- } catch (P) {
1606
- n.open({
1607
- title: c("inventory.wastage.template.update.error"),
1608
- message: c("inventory.wastage.template.update.errorMessage"),
1611
+ } catch (U) {
1612
+ o.open({
1613
+ title: u("inventory.wastage.template.update.error"),
1614
+ message: u("inventory.wastage.template.update.errorMessage"),
1609
1615
  type: "error"
1610
- }), console.error("Error in updating wastage template", P);
1616
+ }), console.error("Error in updating wastage template", U);
1611
1617
  }
1612
1618
  }
1613
- async function le(h) {
1619
+ async function le(_) {
1614
1620
  try {
1615
- for (const P of v.value) {
1616
- const G = await k.getTemplate(P);
1621
+ for (const U of f.value) {
1622
+ const G = await P.getTemplate(U);
1617
1623
  if (!G) {
1618
- console.warn(`Closing Template with ID ${P} not found`);
1624
+ console.warn(`Closing Template with ID ${U} not found`);
1619
1625
  continue;
1620
1626
  }
1621
- if (!G.items.find((f) => f.sku._id === h._id)) {
1622
- const f = {
1623
- sku: h
1627
+ if (!G.items.find((y) => y.sku._id === _._id)) {
1628
+ const y = {
1629
+ sku: _
1624
1630
  }, j = {
1625
1631
  ...G,
1626
- items: [...G.items, f]
1632
+ items: [...G.items, y]
1627
1633
  };
1628
- await k.updateTemplate(j), await new Promise((K) => setTimeout(K, 1e3));
1634
+ await P.updateTemplate(j), await new Promise((K) => setTimeout(K, 1e3));
1629
1635
  }
1630
1636
  }
1631
- } catch (P) {
1632
- n.open({
1633
- title: c("inventory.closing.template.update.error"),
1634
- message: c("inventory.closing.template.update.errorMessage"),
1637
+ } catch (U) {
1638
+ o.open({
1639
+ title: u("inventory.closing.template.update.error"),
1640
+ message: u("inventory.closing.template.update.errorMessage"),
1635
1641
  type: "error"
1636
- }), console.error("Error in updating closing template", P);
1642
+ }), console.error("Error in updating closing template", U);
1637
1643
  }
1638
1644
  }
1639
1645
  function ee() {
1640
- var h, P;
1641
- (P = (h = N.value) == null ? void 0 : h.validateInputs) == null || P.call(h);
1646
+ var _, U;
1647
+ (U = (_ = N.value) == null ? void 0 : _.validateInputs) == null || U.call(_);
1642
1648
  }
1643
1649
  function ae() {
1644
- switch (s.mode) {
1650
+ switch (r.mode) {
1645
1651
  case H.READ:
1646
1652
  return;
1647
1653
  case H.UPDATE:
@@ -1650,65 +1656,65 @@ const zn = /* @__PURE__ */ pe({
1650
1656
  return fe();
1651
1657
  }
1652
1658
  }
1653
- function ye(h) {
1654
- d.value = h;
1659
+ function ye(_) {
1660
+ i.value = _;
1655
1661
  }
1656
- function ge(h) {
1657
- m.value = h;
1662
+ function ge(_) {
1663
+ m.value = _;
1658
1664
  }
1659
- function ke(h) {
1660
- v.value = h;
1665
+ function ke(_) {
1666
+ f.value = _;
1661
1667
  }
1662
- return (h, P) => {
1663
- const G = F("FmChip"), $ = F("FmButton"), f = F("FmSideSheet");
1664
- return u(), O(f, {
1665
- "model-value": l(_),
1666
- "onUpdate:modelValue": P[3] || (P[3] = (j) => dt(_) ? _.value = j : null),
1667
- header: E.value,
1668
+ return (_, U) => {
1669
+ const G = C("FmChip"), $ = C("FmButton"), y = C("FmSideSheet");
1670
+ return c(), O(y, {
1671
+ "model-value": l(p),
1672
+ "onUpdate:modelValue": U[3] || (U[3] = (j) => ut(p) ? p.value = j : null),
1673
+ header: A.value,
1668
1674
  "close-button": "",
1669
1675
  "dismiss-away": "",
1670
1676
  "max-width": 500
1671
1677
  }, {
1672
- "side-sheet-footer": y(() => [
1673
- o("div", jo, [
1674
- a($, {
1678
+ "side-sheet-footer": g(() => [
1679
+ n("div", jo, [
1680
+ s($, {
1675
1681
  loading: D.value,
1676
- label: p.value,
1682
+ label: v.value,
1677
1683
  onClick: ee
1678
1684
  }, null, 8, ["loading", "label"]),
1679
- a($, {
1685
+ s($, {
1680
1686
  disabled: D.value,
1681
- label: l(c)("common.close"),
1687
+ label: l(u)("common.close"),
1682
1688
  variant: "tertiary",
1683
- onClick: P[2] || (P[2] = (j) => _.value = !1)
1689
+ onClick: U[2] || (U[2] = (j) => p.value = !1)
1684
1690
  }, null, 8, ["disabled", "label"])
1685
1691
  ])
1686
1692
  ]),
1687
- default: y(() => [
1688
- o("div", zo, [
1689
- V.value ? (u(), w("div", Lo, [
1690
- a(G, {
1693
+ default: g(() => [
1694
+ n("div", zo, [
1695
+ w.value ? (c(), T("div", Lo, [
1696
+ s(G, {
1691
1697
  label: "Managed by Netsuite",
1692
1698
  compact: ""
1693
1699
  }),
1694
- a(tn, {
1700
+ s(tn, {
1695
1701
  readonly: "",
1696
- sku: h.sku,
1697
- settingOptions: l(b).skuSettingOptions
1702
+ sku: _.sku,
1703
+ settingOptions: l(h).skuSettingOptions
1698
1704
  }, null, 8, ["sku", "settingOptions"])
1699
1705
  ])) : L("", !0),
1700
- a(No, {
1706
+ s(No, {
1701
1707
  class: "w-full",
1702
1708
  ref_key: "hasValidationExpose",
1703
1709
  ref: N,
1704
- modelValue: l(i),
1705
- "onUpdate:modelValue": P[0] || (P[0] = (j) => dt(i) ? i.value = j : null),
1706
- mode: h.mode,
1710
+ modelValue: l(a),
1711
+ "onUpdate:modelValue": U[0] || (U[0] = (j) => ut(a) ? a.value = j : null),
1712
+ mode: _.mode,
1707
1713
  disabled: D.value,
1708
- purchaseOrderTemplateIds: d.value,
1714
+ purchaseOrderTemplateIds: i.value,
1709
1715
  wastageTemplateIds: m.value,
1710
- closingTemplateIds: v.value,
1711
- "onClick:submit": P[1] || (P[1] = (j) => ae()),
1716
+ closingTemplateIds: f.value,
1717
+ "onClick:submit": U[1] || (U[1] = (j) => ae()),
1712
1718
  "onUpdate:purchaseOrderTemplateIds": ye,
1713
1719
  "onUpdate:wastageTemplateIds": ge,
1714
1720
  "onUpdate:closingTemplateIds": ke
@@ -1722,7 +1728,7 @@ const zn = /* @__PURE__ */ pe({
1722
1728
  }), Ho = { class: "flex items-center gap-12 pl-8" }, qo = { class: "flex flex-col" }, Yo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Go = {
1723
1729
  key: 0,
1724
1730
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1725
- }, Ko = { key: 0 }, xt = /* @__PURE__ */ pe({
1731
+ }, Ko = { key: 0 }, kt = /* @__PURE__ */ pe({
1726
1732
  __name: "ImportIngredientItem",
1727
1733
  props: {
1728
1734
  type: {},
@@ -1731,29 +1737,29 @@ const zn = /* @__PURE__ */ pe({
1731
1737
  errors: {}
1732
1738
  },
1733
1739
  setup(W) {
1734
- return (s, T) => {
1735
- const r = F("FmIcon"), b = F("FmTooltip");
1736
- return u(), w("div", Ho, [
1737
- T[0] || (T[0] = o("div", null, "•", -1)),
1738
- o("div", qo, [
1739
- o("div", Yo, [
1740
- o("div", {
1740
+ return (r, k) => {
1741
+ const d = C("FmIcon"), h = C("FmTooltip");
1742
+ return c(), T("div", Ho, [
1743
+ k[0] || (k[0] = n("div", null, "•", -1)),
1744
+ n("div", qo, [
1745
+ n("div", Yo, [
1746
+ n("div", {
1741
1747
  class: te({
1742
- "text-fm-color-system-error-300": s.errors.length
1748
+ "text-fm-color-system-error-300": r.errors.length
1743
1749
  })
1744
1750
  }, [
1745
- Ge(A(s.name) + " ", 1),
1746
- s.type === "create" ? (u(), w("span", Go, "(new)")) : L("", !0)
1751
+ Ye(F(r.name) + " ", 1),
1752
+ r.type === "create" ? (c(), T("span", Go, "(new)")) : L("", !0)
1747
1753
  ], 2),
1748
- s.errors.length ? (u(), w("div", Ko, [
1749
- a(b, { "z-index": 50 }, {
1750
- content: y(() => [
1751
- o("ol", null, [
1752
- (u(!0), w(X, null, ue(s.errors, (S, U) => (u(), w("li", { key: U }, A(S), 1))), 128))
1754
+ r.errors.length ? (c(), T("div", Ko, [
1755
+ s(h, { "z-index": 50 }, {
1756
+ content: g(() => [
1757
+ n("ol", null, [
1758
+ (c(!0), T(X, null, ue(r.errors, (I, E) => (c(), T("li", { key: E }, F(I), 1))), 128))
1753
1759
  ])
1754
1760
  ]),
1755
- default: y(() => [
1756
- a(r, {
1761
+ default: g(() => [
1762
+ s(d, {
1757
1763
  name: "error",
1758
1764
  size: "sm",
1759
1765
  color: "system-error-300"
@@ -1763,15 +1769,15 @@ const zn = /* @__PURE__ */ pe({
1763
1769
  })
1764
1770
  ])) : L("", !0)
1765
1771
  ]),
1766
- o("div", {
1772
+ n("div", {
1767
1773
  class: te([
1768
1774
  "fm-typo-en-body-sm-400",
1769
1775
  {
1770
- "text-fm-color-system-error-200": s.errors.length,
1771
- "text-fm-color-typo-secondary": !s.errors.length
1776
+ "text-fm-color-system-error-200": r.errors.length,
1777
+ "text-fm-color-typo-secondary": !r.errors.length
1772
1778
  }
1773
1779
  ])
1774
- }, A(s.code), 3)
1780
+ }, F(r.code), 3)
1775
1781
  ])
1776
1782
  ]);
1777
1783
  };
@@ -1788,118 +1794,118 @@ const zn = /* @__PURE__ */ pe({
1788
1794
  }, ll = { class: "fm-typo-en-body-lg-600" }, al = /* @__PURE__ */ pe({
1789
1795
  __name: "ImportIngredients",
1790
1796
  setup(W) {
1791
- const s = B(null), T = Yt(), r = Fe(), b = B(!1), S = B(new Array()), U = B([]), k = B([]), n = g(
1792
- () => !!S.value.length || U.value.some((d) => d.errors.length) || k.value.some((d) => d.errors.length)
1793
- ), c = g(
1794
- () => !!U.value.length || !!k.value.length
1795
- ), { t: _ } = ve();
1796
- async function i(d) {
1797
- S.value = [], U.value = [], k.value = [];
1797
+ const r = B(null), k = Yt(), d = Fe(), h = B(!1), I = B(new Array()), E = B([]), P = B([]), o = b(
1798
+ () => !!I.value.length || E.value.some((i) => i.errors.length) || P.value.some((i) => i.errors.length)
1799
+ ), u = b(
1800
+ () => !!E.value.length || !!P.value.length
1801
+ ), { t: p } = ve();
1802
+ async function a(i) {
1803
+ I.value = [], E.value = [], P.value = [];
1798
1804
  try {
1799
- b.value = !0;
1805
+ h.value = !0;
1800
1806
  const [m] = await Promise.all([
1801
- bn(d),
1807
+ bn(i),
1802
1808
  // fake buffer
1803
- new Promise((E) => setTimeout(E, 1e3))
1804
- ]), v = m.SheetNames.find((E) => E);
1805
- if (!v) {
1806
- S.value.push(_("inventory.ingredient.import.fileError.noSheet"));
1809
+ new Promise((A) => setTimeout(A, 1e3))
1810
+ ]), f = m.SheetNames.find((A) => A);
1811
+ if (!f) {
1812
+ I.value.push(p("inventory.ingredient.import.fileError.noSheet"));
1807
1813
  return;
1808
1814
  }
1809
- const V = pn(m.Sheets[v]);
1810
- if (V.invalidExcel) {
1811
- S.value.push(V.invalidExcelMessage ?? _("inventory.ingredient.import.fileError.invalidExcel"));
1815
+ const w = pn(m.Sheets[f]);
1816
+ if (w.invalidExcel) {
1817
+ I.value.push(w.invalidExcelMessage ?? p("inventory.ingredient.import.fileError.invalidExcel"));
1812
1818
  return;
1813
1819
  }
1814
- if (U.value = V.importCreateResult, k.value = V.importUpdateResult, !U.value.length && !k.value.length) {
1815
- S.value.push(_("inventory.ingredient.import.fileError.noData"));
1820
+ if (E.value = w.importCreateResult, P.value = w.importUpdateResult, !E.value.length && !P.value.length) {
1821
+ I.value.push(p("inventory.ingredient.import.fileError.noData"));
1816
1822
  return;
1817
1823
  }
1818
- T.emitData(V);
1824
+ k.emitData(w);
1819
1825
  } catch (m) {
1820
- r.open({
1821
- title: _("inventory.ingredient.import.fileError.unableToRead"),
1826
+ d.open({
1827
+ title: p("inventory.ingredient.import.fileError.unableToRead"),
1822
1828
  message: m == null ? void 0 : m.message,
1823
1829
  type: "error"
1824
1830
  }), console.error("Error in reading file", m);
1825
1831
  } finally {
1826
- S.value.length && r.open({
1827
- title: _("inventory.ingredient.import.fileError.invalidExcel"),
1832
+ I.value.length && d.open({
1833
+ title: p("inventory.ingredient.import.fileError.invalidExcel"),
1828
1834
  type: "error"
1829
- }), b.value = !1;
1835
+ }), h.value = !1;
1830
1836
  }
1831
1837
  }
1832
- return kt(s, (d) => {
1833
- d && i(d);
1834
- }), (d, m) => {
1835
- const v = F("FmCircularProgress"), V = F("FmIcon"), E = F("FmButton");
1836
- return u(), w("div", Zo, [
1837
- o("div", Jo, A(l(_)("inventory.ingredient.import.uploadDescription")), 1),
1838
- a(hn, {
1838
+ return Tt(r, (i) => {
1839
+ i && a(i);
1840
+ }), (i, m) => {
1841
+ const f = C("FmCircularProgress"), w = C("FmIcon"), A = C("FmButton");
1842
+ return c(), T("div", Zo, [
1843
+ n("div", Jo, F(l(p)("inventory.ingredient.import.uploadDescription")), 1),
1844
+ s(hn, {
1839
1845
  class: te({
1840
1846
  "w-full": !0,
1841
- "h-[200px]": !s.value
1847
+ "h-[200px]": !r.value
1842
1848
  }),
1843
1849
  accept: ".xlsx",
1844
- onFileUpload: m[0] || (m[0] = (p) => s.value = p),
1845
- label: l(_)("inventory.ingredient.import.uploadTemplate"),
1846
- "button-label": l(_)("inventory.ingredient.import.selectFile")
1847
- }, Ye({ _: 2 }, [
1848
- s.value ? {
1850
+ onFileUpload: m[0] || (m[0] = (v) => r.value = v),
1851
+ label: l(p)("inventory.ingredient.import.uploadTemplate"),
1852
+ "button-label": l(p)("inventory.ingredient.import.selectFile")
1853
+ }, qe({ _: 2 }, [
1854
+ r.value ? {
1849
1855
  name: "default",
1850
- fn: y(({ openFileDialog: p }) => [
1851
- o("div", Qo, [
1852
- o("div", {
1856
+ fn: g(({ openFileDialog: v }) => [
1857
+ n("div", Qo, [
1858
+ n("div", {
1853
1859
  class: te([
1854
1860
  "fm-corner-radius-md p-16 flex items-center gap-16",
1855
1861
  {
1856
- "border border-fm-color-neutral-gray-100": b.value,
1857
- "border border-fm-color-neutral-gray-200": !b.value && !n.value,
1858
- "border border-fm-color-system-error-200": n.value
1862
+ "border border-fm-color-neutral-gray-100": h.value,
1863
+ "border border-fm-color-neutral-gray-200": !h.value && !o.value,
1864
+ "border border-fm-color-system-error-200": o.value
1859
1865
  }
1860
1866
  ])
1861
1867
  }, [
1862
- b.value ? (u(), O(v, {
1868
+ h.value ? (c(), O(f, {
1863
1869
  key: 0,
1864
1870
  size: "md",
1865
1871
  color: "neutral-gray-200"
1866
- })) : (u(), O(V, {
1872
+ })) : (c(), O(w, {
1867
1873
  key: 1,
1868
- name: n.value ? "error" : "attach_file",
1874
+ name: o.value ? "error" : "attach_file",
1869
1875
  outline: "",
1870
- color: n.value ? "system-error-300" : void 0
1876
+ color: o.value ? "system-error-300" : void 0
1871
1877
  }, null, 8, ["name", "color"])),
1872
- o("div", {
1878
+ n("div", {
1873
1879
  class: te([
1874
1880
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
1875
1881
  {
1876
- "text-fm-color-typo-disabled": b.value,
1877
- "text-fm-color-typo-primary": !b.value
1882
+ "text-fm-color-typo-disabled": h.value,
1883
+ "text-fm-color-typo-primary": !h.value
1878
1884
  }
1879
1885
  ])
1880
1886
  }, [
1881
- o("div", Xo, A(s.value.name), 1)
1887
+ n("div", Xo, F(r.value.name), 1)
1882
1888
  ], 2),
1883
- b.value ? L("", !0) : (u(), w("div", el, [
1884
- a(E, {
1885
- label: l(_)("inventory.ingredient.import.replaceFile"),
1886
- variant: n.value ? "destructive" : "secondary",
1887
- "prepend-icon": n.value ? void 0 : "autorenew",
1888
- onClick: p
1889
+ h.value ? L("", !0) : (c(), T("div", el, [
1890
+ s(A, {
1891
+ label: l(p)("inventory.ingredient.import.replaceFile"),
1892
+ variant: o.value ? "destructive" : "secondary",
1893
+ "prepend-icon": o.value ? void 0 : "autorenew",
1894
+ onClick: v
1889
1895
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
1890
1896
  ]))
1891
1897
  ], 2),
1892
- S.value.length ? (u(), w("div", tl, [
1893
- (u(!0), w(X, null, ue(S.value, (N, D) => (u(), w("div", {
1898
+ I.value.length ? (c(), T("div", tl, [
1899
+ (c(!0), T(X, null, ue(I.value, (N, D) => (c(), T("div", {
1894
1900
  key: D,
1895
1901
  class: "flex gap-8 items-center"
1896
1902
  }, [
1897
- a(V, {
1903
+ s(w, {
1898
1904
  name: "error",
1899
1905
  size: "sm",
1900
1906
  color: "system-error-300"
1901
1907
  }),
1902
- o("div", nl, A(N), 1)
1908
+ n("div", nl, F(N), 1)
1903
1909
  ]))), 128))
1904
1910
  ])) : L("", !0)
1905
1911
  ])
@@ -1907,20 +1913,20 @@ const zn = /* @__PURE__ */ pe({
1907
1913
  key: "0"
1908
1914
  } : void 0
1909
1915
  ]), 1032, ["class", "label", "button-label"]),
1910
- c.value ? (u(), w("div", ol, [
1911
- o("div", ll, A(l(_)("inventory.ingredient.import.summary")), 1),
1912
- (u(!0), w(X, null, ue(U.value, (p) => (u(), O(xt, {
1913
- key: p.sku._id,
1914
- code: p.sku.code,
1915
- name: p.sku.name,
1916
- errors: p.errors,
1916
+ u.value ? (c(), T("div", ol, [
1917
+ n("div", ll, F(l(p)("inventory.ingredient.import.summary")), 1),
1918
+ (c(!0), T(X, null, ue(E.value, (v) => (c(), O(kt, {
1919
+ key: v.sku._id,
1920
+ code: v.sku.code,
1921
+ name: v.sku.name,
1922
+ errors: v.errors,
1917
1923
  type: "create"
1918
1924
  }, null, 8, ["code", "name", "errors"]))), 128)),
1919
- (u(!0), w(X, null, ue(k.value, (p) => (u(), O(xt, {
1920
- key: p.sku._id,
1921
- code: p.sku.code,
1922
- name: p.sku.name,
1923
- errors: p.errors,
1925
+ (c(!0), T(X, null, ue(P.value, (v) => (c(), O(kt, {
1926
+ key: v.sku._id,
1927
+ code: v.sku.code,
1928
+ name: v.sku.name,
1929
+ errors: v.errors,
1924
1930
  type: "update"
1925
1931
  }, null, 8, ["code", "name", "errors"]))), 128))
1926
1932
  ])) : L("", !0)
@@ -1933,18 +1939,18 @@ const zn = /* @__PURE__ */ pe({
1933
1939
  }, rl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, il = { class: "flex flex-col py-8" }, dl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ul = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ol = /* @__PURE__ */ pe({
1934
1940
  __name: "IngredientsView",
1935
1941
  setup(W) {
1936
- const s = Ce(), T = Ae(), r = g(() => [
1942
+ const r = Ce(), k = Ae(), d = b(() => [
1937
1943
  {
1938
1944
  type: "string",
1939
1945
  key: "skuCode",
1940
1946
  entity: "sku",
1941
- values: s.skus.map((f) => f.code)
1947
+ values: r.skus.map((y) => y.code)
1942
1948
  },
1943
1949
  {
1944
1950
  type: "string",
1945
1951
  key: "skuUnitAbbrev",
1946
1952
  entity: "sku",
1947
- values: s.units.map((f) => f.abbrev)
1953
+ values: r.units.map((y) => y.abbrev)
1948
1954
  },
1949
1955
  {
1950
1956
  type: "string",
@@ -1952,7 +1958,7 @@ const zn = /* @__PURE__ */ pe({
1952
1958
  entity: "sku",
1953
1959
  values: ["Active", "Inactive"]
1954
1960
  }
1955
- ]), b = B({
1961
+ ]), h = B({
1956
1962
  logic: "AND",
1957
1963
  rules: [
1958
1964
  {
@@ -1962,135 +1968,135 @@ const zn = /* @__PURE__ */ pe({
1962
1968
  type: "string"
1963
1969
  }
1964
1970
  ]
1965
- }), S = g(
1966
- () => new Set(T.getAvailableItems(T.businessSubsidiaryId))
1967
- ), U = g(() => {
1968
- if (!b.value)
1969
- return s.skus;
1970
- const $ = kn.build(b.value);
1971
- return s.skus.filter((f) => T.isEnabled && ne.value && S.value && !S.value.has(f._id) ? !1 : Tn(
1971
+ }), I = b(
1972
+ () => new Set(k.getAvailableItems(k.businessSubsidiaryId))
1973
+ ), E = b(() => {
1974
+ if (!h.value)
1975
+ return r.skus;
1976
+ const $ = kn.build(h.value);
1977
+ return r.skus.filter((y) => k.isEnabled && ne.value && I.value && !I.value.has(y._id) ? !1 : Tn(
1972
1978
  {
1973
- skuCode: f.code,
1974
- skuUnitAbbrev: f.unit.abbrev,
1975
- status: f.isInactive ? "Inactive" : "Active"
1979
+ skuCode: y.code,
1980
+ skuUnitAbbrev: y.unit.abbrev,
1981
+ status: y.isInactive ? "Inactive" : "Active"
1976
1982
  },
1977
1983
  $
1978
1984
  ));
1979
- }), k = Ht(), n = Re(), c = xn(), _ = Fe(), { t: i } = ve(), { createIngredient: d, updateIngredient: m } = qe(), { ingredientDialogProps: v, ingredientViewLoading: V } = Qt(qe()), { columnDefs: E } = Nn();
1980
- function p($) {
1985
+ }), P = Ht(), o = Ge(), u = xn(), p = Fe(), { t: a } = ve(), { createIngredient: i, updateIngredient: m } = He(), { ingredientDialogProps: f, ingredientViewLoading: w } = Qt(He()), { columnDefs: A } = Nn();
1986
+ function v($) {
1981
1987
  switch ($) {
1982
1988
  case "add":
1983
- return T.isEnabled ? void 0 : d();
1989
+ return k.isEnabled ? void 0 : i();
1984
1990
  case "import":
1985
- return P();
1991
+ return U();
1986
1992
  case "export":
1987
- return h();
1993
+ return _();
1988
1994
  }
1989
1995
  }
1990
- const N = B(""), D = B(!1), fe = g(() => D.value || V.value), ne = B(!0), { breakpoints: ce } = Gt(), oe = g(() => ce.value.xs || ce.value.sm), le = g(() => oe.value ? 10 : 20), ee = nn(), ae = B(!1), ye = [
1996
+ const N = B(""), D = B(!1), fe = b(() => D.value || w.value), ne = B(!0), { breakpoints: ce } = Gt(), oe = b(() => ce.value.xs || ce.value.sm), le = b(() => oe.value ? 10 : 20), ee = nn(), ae = B(!1), ye = [
1991
1997
  {
1992
1998
  value: "import",
1993
- label: i("common.import")
1999
+ label: a("common.import")
1994
2000
  },
1995
2001
  {
1996
2002
  value: "export",
1997
- label: i("common.export")
2003
+ label: a("common.export")
1998
2004
  }
1999
2005
  ];
2000
2006
  function ge($) {
2001
2007
  switch (ae.value = !1, $) {
2002
2008
  case "import":
2003
- return P();
2009
+ return U();
2004
2010
  case "export":
2005
- return h();
2011
+ return _();
2006
2012
  }
2007
2013
  }
2008
- const ke = g(() => [
2009
- ...T.isEnabled ? [] : [
2014
+ const ke = b(() => [
2015
+ ...k.isEnabled ? [] : [
2010
2016
  {
2011
- label: i("inventory.ingredient.create.title"),
2017
+ label: a("inventory.ingredient.create.title"),
2012
2018
  value: "add",
2013
2019
  isPrimary: !0,
2014
2020
  prependIcon: "add"
2015
2021
  }
2016
2022
  ],
2017
- { label: i("common.import"), value: "import" },
2018
- { label: i("common.export"), value: "export" }
2023
+ { label: a("common.import"), value: "import" },
2024
+ { label: a("common.export"), value: "export" }
2019
2025
  ]);
2020
- function h() {
2026
+ function _() {
2021
2027
  const $ = vn();
2022
- _.open({
2023
- title: i("inventory.ingredient.export.success"),
2024
- message: i("inventory.ingredient.export.filename", [$]),
2028
+ p.open({
2029
+ title: a("inventory.ingredient.export.success"),
2030
+ message: a("inventory.ingredient.export.filename", [$]),
2025
2031
  type: "success"
2026
2032
  });
2027
2033
  }
2028
- function P() {
2029
- n.open({
2030
- title: i("inventory.ingredient.import.title"),
2034
+ function U() {
2035
+ o.open({
2036
+ title: a("inventory.ingredient.import.title"),
2031
2037
  contentComponent: al,
2032
2038
  overlay: !0,
2033
2039
  closeButton: !0,
2034
2040
  primaryActions: {
2035
- text: i("common.import"),
2041
+ text: a("common.import"),
2036
2042
  close: !1
2037
2043
  },
2038
2044
  secondaryActions: {
2039
- text: i("common.close"),
2045
+ text: a("common.close"),
2040
2046
  close: !0
2041
2047
  },
2042
2048
  tertiaryActions: {
2043
- text: i("inventory.ingredient.import.actions.downloadTemplate"),
2049
+ text: a("inventory.ingredient.import.actions.downloadTemplate"),
2044
2050
  close: !1,
2045
2051
  variant: "plain"
2046
2052
  }
2047
2053
  }).onPrimary(($) => {
2048
2054
  if (!$) {
2049
- _.open({
2050
- title: i("inventory.ingredient.import.error.noData"),
2055
+ p.open({
2056
+ title: a("inventory.ingredient.import.error.noData"),
2051
2057
  type: "error"
2052
2058
  });
2053
2059
  return;
2054
2060
  }
2055
2061
  if (!$.importCreateResult.length && !$.importUpdateResult.length) {
2056
- _.open({
2057
- title: i("inventory.ingredient.import.error.invalidContent"),
2058
- message: i("inventory.ingredient.import.error.noImportData"),
2062
+ p.open({
2063
+ title: a("inventory.ingredient.import.error.invalidContent"),
2064
+ message: a("inventory.ingredient.import.error.noImportData"),
2059
2065
  type: "error"
2060
2066
  });
2061
2067
  return;
2062
2068
  }
2063
- if ($.importCreateResult.some((f) => f.errors.length) || $.importUpdateResult.some((f) => f.errors.length)) {
2064
- _.open({
2065
- title: i("inventory.ingredient.import.error.invalidContent"),
2066
- message: i("inventory.ingredient.import.error.hasErrors"),
2069
+ if ($.importCreateResult.some((y) => y.errors.length) || $.importUpdateResult.some((y) => y.errors.length)) {
2070
+ p.open({
2071
+ title: a("inventory.ingredient.import.error.invalidContent"),
2072
+ message: a("inventory.ingredient.import.error.hasErrors"),
2067
2073
  type: "error"
2068
2074
  });
2069
2075
  return;
2070
2076
  }
2071
- n.close(), G($);
2077
+ o.close(), G($);
2072
2078
  }).onTertiary(fn);
2073
2079
  }
2074
2080
  async function G($) {
2075
2081
  D.value = !0;
2076
2082
  try {
2077
- const f = [
2083
+ const y = [
2078
2084
  ...$.importCreateResult.map(({ sku: M }) => ({ type: "create", sku: M })),
2079
2085
  ...$.importUpdateResult.map(({ sku: M }) => ({ type: "update", sku: M }))
2080
2086
  ], j = 100;
2081
2087
  let K = 0;
2082
2088
  const me = () => {
2083
- K += j, _.open({
2084
- title: i("inventory.ingredient.import.progress", [
2085
- Math.min(K, f.length),
2086
- f.length
2089
+ K += j, p.open({
2090
+ title: a("inventory.ingredient.import.progress", [
2091
+ Math.min(K, y.length),
2092
+ y.length
2087
2093
  ])
2088
2094
  });
2089
2095
  }, Z = new Array();
2090
- for (const M of f.chunk(100)) {
2096
+ for (const M of y.chunk(100)) {
2091
2097
  me();
2092
2098
  try {
2093
- const R = await s.importSkus({
2099
+ const R = await r.importSkus({
2094
2100
  create: M.filter((q) => q.type === "create").map((q) => q.sku),
2095
2101
  update: M.filter((q) => q.type === "update").map((q) => q.sku)
2096
2102
  });
@@ -2112,10 +2118,10 @@ const zn = /* @__PURE__ */ pe({
2112
2118
  );
2113
2119
  }
2114
2120
  }
2115
- _.open({
2116
- title: i("inventory.ingredient.import.success"),
2121
+ p.open({
2122
+ title: a("inventory.ingredient.import.success"),
2117
2123
  type: "success"
2118
- }), Z.length && c.alert(
2124
+ }), Z.length && u.alert(
2119
2125
  "Some operation failed",
2120
2126
  Q(
2121
2127
  "div",
@@ -2132,25 +2138,25 @@ const zn = /* @__PURE__ */ pe({
2132
2138
  )
2133
2139
  )
2134
2140
  );
2135
- } catch (f) {
2136
- _.open({
2137
- title: i("inventory.ingredient.import.error.failed"),
2138
- message: i("inventory.ingredient.import.error.systemMessage", [f == null ? void 0 : f.message]),
2141
+ } catch (y) {
2142
+ p.open({
2143
+ title: a("inventory.ingredient.import.error.failed"),
2144
+ message: a("inventory.ingredient.import.error.systemMessage", [y == null ? void 0 : y.message]),
2139
2145
  type: "error"
2140
- }), console.error("Error in importing skus", $, f);
2146
+ }), console.error("Error in importing skus", $, y);
2141
2147
  } finally {
2142
2148
  D.value = !1;
2143
2149
  }
2144
2150
  }
2145
- return ($, f) => {
2146
- const j = F("FmSwitch"), K = F("FmTable"), me = F("FmCollapsibleTabs"), Z = F("FmBottomSheet");
2147
- return u(), O(on, {
2148
- title: l(i)("inventory.ingredient.title"),
2151
+ return ($, y) => {
2152
+ const j = C("FmSwitch"), K = C("FmTable"), me = C("FmCollapsibleTabs"), Z = C("FmBottomSheet");
2153
+ return c(), O(on, {
2154
+ title: l(a)("inventory.ingredient.title"),
2149
2155
  actions: ke.value,
2150
- "onClick:action": p
2156
+ "onClick:action": v
2151
2157
  }, {
2152
- default: y(() => [
2153
- o("div", {
2158
+ default: g(() => [
2159
+ n("div", {
2154
2160
  class: te([
2155
2161
  "flex flex-col gap-8 max-h-full",
2156
2162
  {
@@ -2159,24 +2165,24 @@ const zn = /* @__PURE__ */ pe({
2159
2165
  }
2160
2166
  ])
2161
2167
  }, [
2162
- a(_n, {
2168
+ s(_n, {
2163
2169
  searchable: "",
2164
2170
  search: N.value,
2165
- "onUpdate:search": f[1] || (f[1] = (M) => N.value = M),
2171
+ "onUpdate:search": y[1] || (y[1] = (M) => N.value = M),
2166
2172
  filterable: "",
2167
- "filter-attributes": r.value,
2168
- filter: b.value,
2169
- "onUpdate:filter": f[2] || (f[2] = (M) => b.value = M)
2173
+ "filter-attributes": d.value,
2174
+ filter: h.value,
2175
+ "onUpdate:filter": y[2] || (y[2] = (M) => h.value = M)
2170
2176
  }, {
2171
- default: y(() => [
2172
- l(T).isEnabled ? (u(), w("div", sl, [
2173
- o("span", rl, A(l(i)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2174
- a(cn),
2175
- a(He, null, {
2176
- default: y(() => [
2177
- a(j, {
2177
+ default: g(() => [
2178
+ l(k).isEnabled ? (c(), T("div", sl, [
2179
+ n("span", rl, F(l(a)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2180
+ s(cn),
2181
+ s(Re, null, {
2182
+ default: g(() => [
2183
+ s(j, {
2178
2184
  modelValue: ne.value,
2179
- "onUpdate:modelValue": f[0] || (f[0] = (M) => ne.value = M)
2185
+ "onUpdate:modelValue": y[0] || (y[0] = (M) => ne.value = M)
2180
2186
  }, null, 8, ["modelValue"])
2181
2187
  ]),
2182
2188
  _: 1
@@ -2185,37 +2191,37 @@ const zn = /* @__PURE__ */ pe({
2185
2191
  ]),
2186
2192
  _: 1
2187
2193
  }, 8, ["search", "filter-attributes", "filter"]),
2188
- (u(), O(K, {
2189
- key: JSON.stringify(b.value),
2194
+ (c(), O(K, {
2195
+ key: JSON.stringify(h.value),
2190
2196
  style: Nt(l(ee).tableHeight),
2191
- "column-defs": l(E),
2192
- "row-data": U.value,
2197
+ "column-defs": l(A),
2198
+ "row-data": E.value,
2193
2199
  "search-value": N.value,
2194
2200
  columnVisibility: {
2195
- netsuiteSubsidiary: l(T).isEnabled
2201
+ netsuiteSubsidiary: l(k).isEnabled
2196
2202
  },
2197
- loading: (!l(k)._currentLocation || fe.value) && l(T).isReady,
2203
+ loading: (!l(P)._currentLocation || fe.value) && l(k).isReady,
2198
2204
  "loading-text": "Loading",
2199
- onRowClick: f[3] || (f[3] = (M) => l(m)(M.original)),
2205
+ onRowClick: y[3] || (y[3] = (M) => l(m)(M.original)),
2200
2206
  "page-size": le.value
2201
2207
  }, {
2202
- "list-row": y((M) => [
2203
- a(en, {
2208
+ "list-row": g((M) => [
2209
+ s(en, {
2204
2210
  row: M,
2205
2211
  onRowClick: l(m)
2206
- }, Ye({
2207
- default: y((R) => {
2212
+ }, qe({
2213
+ default: g((R) => {
2208
2214
  var q, de, Te, _e, Ee, $e, we, be, se, Ve;
2209
2215
  return [
2210
- o("div", il, [
2211
- o("div", dl, [
2212
- a(l(ht), {
2216
+ n("div", il, [
2217
+ n("div", dl, [
2218
+ s(l(_t), {
2213
2219
  render: (Te = (de = (q = R.code) == null ? void 0 : q.column) == null ? void 0 : de.columnDef) == null ? void 0 : Te.cell,
2214
2220
  props: (Ee = (_e = R.code) == null ? void 0 : _e.getContext) == null ? void 0 : Ee.call(_e)
2215
2221
  }, null, 8, ["render", "props"])
2216
2222
  ]),
2217
- o("div", ul, [
2218
- a(l(ht), {
2223
+ n("div", ul, [
2224
+ s(l(_t), {
2219
2225
  render: (be = (we = ($e = R.name) == null ? void 0 : $e.column) == null ? void 0 : we.columnDef) == null ? void 0 : be.cell,
2220
2226
  props: (Ve = (se = R.name) == null ? void 0 : se.getContext) == null ? void 0 : Ve.call(se)
2221
2227
  }, null, 8, ["render", "props"])
@@ -2227,8 +2233,8 @@ const zn = /* @__PURE__ */ pe({
2227
2233
  }, [
2228
2234
  D.value ? {
2229
2235
  name: "loading-text",
2230
- fn: y(() => [
2231
- o("div", null, A(l(i)("inventory.ingredient.table.importing")), 1)
2236
+ fn: g(() => [
2237
+ n("div", null, F(l(a)("inventory.ingredient.table.importing")), 1)
2232
2238
  ]),
2233
2239
  key: "0"
2234
2240
  } : void 0
@@ -2237,20 +2243,20 @@ const zn = /* @__PURE__ */ pe({
2237
2243
  _: 1
2238
2244
  }, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "page-size"]))
2239
2245
  ], 2),
2240
- (u(), O(ut, { to: "body" }, [
2241
- a(Wo, zt(Lt(l(v))), null, 16)
2246
+ (c(), O(ct, { to: "body" }, [
2247
+ s(Wo, zt(Lt(l(f))), null, 16)
2242
2248
  ])),
2243
- (u(), O(ut, { to: "body" }, [
2244
- a(Z, {
2249
+ (c(), O(ct, { to: "body" }, [
2250
+ s(Z, {
2245
2251
  "dismiss-away": "",
2246
2252
  modelValue: ae.value,
2247
- "onUpdate:modelValue": f[5] || (f[5] = (M) => ae.value = M)
2253
+ "onUpdate:modelValue": y[5] || (y[5] = (M) => ae.value = M)
2248
2254
  }, {
2249
- default: y(() => [
2250
- a(me, {
2255
+ default: g(() => [
2256
+ s(me, {
2251
2257
  class: "pb-8",
2252
2258
  items: ye,
2253
- "onUpdate:modelValue": f[4] || (f[4] = (M) => ge(M))
2259
+ "onUpdate:modelValue": y[4] || (y[4] = (M) => ge(M))
2254
2260
  })
2255
2261
  ]),
2256
2262
  _: 1