@feedmepos/mf-inventory-portal 1.2.19-dev.2 → 1.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/{App-Bq3VbOg4.js → App-Dhgx7rrQ.js} +1 -1
  2. package/dist/{ApprovalView-0rdBk4Ga.js → ApprovalView-BrXrU7td.js} +2 -2
  3. package/dist/{BindingsDialog-D9dfQy9F.js → BindingsDialog-D-4th4Wv.js} +2 -2
  4. package/dist/{BindingsPicker-C5qh7Kjp.js → BindingsPicker-OZ2oXC9f.js} +1 -1
  5. package/dist/{BindingsTable-CMEWGAmH.js → BindingsTable-D8GYWCmf.js} +1 -1
  6. package/dist/{ClosingDraftView-D5dgVQLQ.js → ClosingDraftView-s8x2c2nr.js} +2 -2
  7. package/dist/{ClosingTemplateView-BCrbXt1O.js → ClosingTemplateView-C31q0m8r.js} +770 -758
  8. package/dist/{DeliveryOrderPrintPreview-DzP9MsW6.js → DeliveryOrderPrintPreview-Ba1kMUkZ.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-lL_Je_aP.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSbH9guj.js} +3 -3
  10. package/dist/{FmMultiselectDialog-B39wWYKL.js → FmMultiselectDialog-Ct6hmHG_.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DTLkc1KI.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BvH4jEs4.js} +1 -1
  12. package/dist/{ImportView-DSlXRo6h.js → ImportView-BSGSSm53.js} +6 -6
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-EUSjFuu0.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BZTaw7SF.js} +1 -1
  14. package/dist/{IngredientGroupView-N1SA4h33.js → IngredientGroupView-DTkMPiSZ.js} +2 -2
  15. package/dist/{IngredientsView-CXk0pFuq.js → IngredientsView-CcHZgOrI.js} +119 -122
  16. package/dist/{IntegrationView-D0-VCjXw.js → IntegrationView-DmRECDHP.js} +3 -3
  17. package/dist/{InventoryBindingForm-DqQKgRFD.js → InventoryBindingForm-CIpxfX3b.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CxsiIFB7.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BuZXOBId.js} +3 -3
  19. package/dist/{InventoryBindingSummary-4kCjgPon.js → InventoryBindingSummary-BQ_E25cU.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CapjT1PG.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-N-pD1zaw.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BTr8giUF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DN6RNqGG.js} +1 -1
  22. package/dist/{PublishView-cxD30ANP.js → PublishView-CzyD-kX6.js} +1 -1
  23. package/dist/{PurchaseOrderPrintPreview-C25EwRvq.js → PurchaseOrderPrintPreview-Gsv5_VRS.js} +1 -1
  24. package/dist/{ReceiveRequestView-DG79qu-Q.js → ReceiveRequestView-nYf3RhYt.js} +185 -193
  25. package/dist/{RecipeView-Dd3Gzx_7.js → RecipeView-CUPc7FL_.js} +3 -3
  26. package/dist/{StockView-DUPQoRbk.js → StockView-DbWduR8-.js} +283 -283
  27. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-yBT7sh32.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-HRRCXy1F.js} +1 -1
  28. package/dist/{SupplierView-CftbqjSM.js → SupplierView-DbNV6wBz.js} +4 -4
  29. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CsG99iyc.js → TransferDetails.vue_vue_type_script_setup_true_lang-Td4cUzwp.js} +5 -5
  30. package/dist/{TransferTemplateView-Bg3WZG4x.js → TransferTemplateView-BnFKuI1M.js} +7 -7
  31. package/dist/{UnitView-DDOjic5i.js → UnitView-BBsLnc3y.js} +3 -3
  32. package/dist/{WarehouseView-xXj5gNkv.js → WarehouseView-BvHckwu3.js} +1 -1
  33. package/dist/{app-C5xhmSdT.js → app-DLWtkyIk.js} +13634 -13689
  34. package/dist/app.js +1 -1
  35. package/dist/{closing-template-CTnmZmwR.js → closing-template-BVGsZA5Q.js} +1 -1
  36. package/dist/{decimal-ByvJmvuR.js → decimal-C_fA5VTE.js} +1 -1
  37. package/dist/{format-unit-display-Y9dmvD9H.js → format-unit-display-CIadAESY.js} +3 -3
  38. package/dist/{import-export.helper-BNdJmogm.js → import-export.helper-CGvZQkvF.js} +1 -1
  39. package/dist/{index-B-8jCooy.js → index-DOGCbX7z.js} +1 -1
  40. package/dist/{index-BN9dlUFp.js → index-cdGBnn3K.js} +2 -2
  41. package/dist/{purchase-order-template-B8d4uElQ.js → purchase-order-template-BBnGvesc.js} +1 -1
  42. package/dist/{stock-nuJyCyEZ.js → stock-BKkz6GYk.js} +1 -1
  43. package/dist/style.css +1 -1
  44. package/dist/{supplier-1Y0Es3Q1.js → supplier-CIOzcvBf.js} +1 -1
  45. package/dist/{use-ingredient-select-dialog-D4xzg9Cj.js → use-ingredient-select-dialog-8VdP7aHB.js} +1 -1
  46. package/dist/{use-inventory-binding-dialog-BCEJrcXb.js → use-inventory-binding-dialog-CniGmXxR.js} +1 -1
  47. package/dist/views/closing-template/helpers/import-export.helper.d.ts +1 -1
  48. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +2 -2
  49. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -3
  50. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +3 -3
  51. package/package.json +2 -2
@@ -1,93 +1,93 @@
1
- import { ref as P, h as R, defineComponent as H, resolveComponent as A, openBlock as $, createElementBlock as M, createElementVNode as h, normalizeClass as G, createTextVNode as Fe, toDisplayString as S, unref as d, createCommentVNode as Y, createVNode as C, withCtx as E, Fragment as O, renderList as q, computed as V, watch as Ae, createSlots as Ee, createBlock as N, isRef as Ye, normalizeStyle as Ke, Teleport as Ge, normalizeProps as We, guardReactiveProps as qe, mergeProps as Je } from "vue";
2
- import { u as ce, am as Xe, D as ee, j as U, i as Qe, f as Ve, an as Ze, ao as ne, X as Ue, ap as me, W as ue, a as de, b as et, aq as tt, ar as Ne, B as nt, C as ot, as as st, e as z, K, P as lt, at, q as rt, J as Le, A as it, au as ct, a8 as ie, E as mt, G as ut, I as dt } from "./app-C5xhmSdT.js";
3
- import { useI18n as j, useCoreStore as pe } from "@feedmepos/mf-common";
1
+ import { ref as P, h as R, defineComponent as H, resolveComponent as A, openBlock as $, createElementBlock as M, createElementVNode as b, normalizeClass as G, createTextVNode as Fe, toDisplayString as I, unref as v, createCommentVNode as Y, createVNode as C, withCtx as E, Fragment as j, renderList as q, computed as V, watch as Ae, createSlots as Ee, createBlock as N, isRef as Ye, normalizeStyle as Ke, Teleport as Ge, normalizeProps as We, guardReactiveProps as qe, mergeProps as Je } from "vue";
2
+ import { u as ce, am as Xe, D as ee, j as U, i as Qe, f as Ve, an as Ze, ao as ne, X as Ue, ap as me, W as ue, a as de, b as et, aq as tt, ar as Ne, B as nt, C as ot, as as st, e as z, K, P as lt, at, q as rt, J as Le, A as it, au as ct, a8 as ie, E as mt, G as ut, I as dt } from "./app-DLWtkyIk.js";
3
+ import { useI18n as O, useCoreStore as pe } from "@feedmepos/mf-common";
4
4
  import { useDialog as se, useDialogChild as pt, useSnackbar as le, FmButtonVariant as te, components as B, useProxiedModel as ft, useBreakpoints as vt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Be, storeToRefs as ze } from "pinia";
6
- import { u as ae } from "./closing-template-CTnmZmwR.js";
7
- import { u as gt } from "./use-ingredient-select-dialog-D4xzg9Cj.js";
6
+ import { u as ae } from "./closing-template-BVGsZA5Q.js";
7
+ import { u as gt } from "./use-ingredient-select-dialog-8VdP7aHB.js";
8
8
  const re = Be(
9
9
  "closingTemplateTable",
10
10
  function() {
11
- const { t: s } = j(), l = se(), i = P({}), n = oe(), t = P({}), y = P(new Array()), p = P(!1), r = ce(), o = ae();
12
- function f(m) {
13
- const v = {
14
- title: m.name,
15
- doc: m,
11
+ const { t: l } = O(), o = se(), m = P({}), t = oe(), n = P({}), d = P(new Array()), y = P(!1), c = ce(), s = ae();
12
+ function f(r) {
13
+ const p = {
14
+ title: r.name,
15
+ doc: r,
16
16
  controller: {
17
17
  publishAll: async () => {
18
18
  var e;
19
- const u = await o.publishSingleDoc(
20
- m._id,
21
- (e = m.locations) == null ? void 0 : e.map((_) => _.dbName)
19
+ const u = await s.publishSingleDoc(
20
+ r._id,
21
+ (e = r.locations) == null ? void 0 : e.map((x) => x.dbName)
22
22
  );
23
- return i.value = u.publishedRevByLocation || {}, i.value;
23
+ return m.value = u.publishedRevByLocation || {}, m.value;
24
24
  },
25
25
  publishAtLocation: async (u) => {
26
- const e = await o.publishSingleDoc(m._id, [u.dbName]);
27
- return i.value = e.publishedRevByLocation || {}, i.value;
26
+ const e = await s.publishSingleDoc(r._id, [u.dbName]);
27
+ return m.value = e.publishedRevByLocation || {}, m.value;
28
28
  }
29
29
  },
30
- initialPublishedRev: i.value,
31
- locations: r.locations,
32
- enabledLocations: m.locations
30
+ initialPublishedRev: m.value,
31
+ locations: c.locations,
32
+ enabledLocations: r.locations
33
33
  };
34
- l.open({
34
+ o.open({
35
35
  title: "Publish template",
36
36
  contentComponent: Ze,
37
- contentComponentProps: v,
37
+ contentComponentProps: p,
38
38
  closeButton: !0,
39
39
  primaryActions: {
40
- text: s("common.close"),
40
+ text: l("common.close"),
41
41
  close: !0,
42
42
  variant: "tertiary"
43
43
  }
44
44
  });
45
45
  }
46
46
  async function a() {
47
- if (y.value = [], !!r._currentLocation) {
48
- p.value = !0;
47
+ if (d.value = [], !!c._currentLocation) {
48
+ y.value = !0;
49
49
  try {
50
- const [m, v, u] = await Promise.all([
51
- o.readTemplates(),
52
- o.getRecentPublishingJob(),
53
- o.getRecentPublishInfo()
50
+ const [r, p, u] = await Promise.all([
51
+ s.readTemplates(),
52
+ s.getRecentPublishingJob(),
53
+ s.getRecentPublishInfo()
54
54
  ]).delayed(1e3);
55
- y.value = m, t.value = v, i.value = u.publishedRevByLocation || {};
56
- } catch (m) {
57
- console.log("Something went wrong when fetching templates:", m);
55
+ d.value = r, n.value = p, m.value = u.publishedRevByLocation || {};
56
+ } catch (r) {
57
+ console.log("Something went wrong when fetching templates:", r);
58
58
  } finally {
59
- p.value = !1;
59
+ y.value = !1;
60
60
  }
61
61
  }
62
62
  }
63
- async function w(m) {
64
- if (!y.value.find((v) => v._id) && r._currentLocation) {
65
- p.value = !0;
63
+ async function _(r) {
64
+ if (!d.value.find((p) => p._id) && c._currentLocation) {
65
+ y.value = !0;
66
66
  try {
67
- const [v] = await Promise.all([
68
- o.getTemplate(m),
67
+ const [p] = await Promise.all([
68
+ s.getTemplate(r),
69
69
  new Promise((u) => setTimeout(u, 1e3))
70
70
  ]);
71
- y.value = [v];
72
- } catch (v) {
73
- console.log("Something went wrong when fetching templates:", v);
71
+ d.value = [p];
72
+ } catch (p) {
73
+ console.log("Something went wrong when fetching templates:", p);
74
74
  } finally {
75
- p.value = !1;
75
+ y.value = !1;
76
76
  }
77
77
  }
78
78
  }
79
- function k(m, v) {
80
- switch (v = Ve(v), m) {
79
+ function w(r, p) {
80
+ switch (p = Ve(p), r) {
81
81
  case U.Details:
82
- return n.viewTemplate(v);
82
+ return t.viewTemplate(p);
83
83
  case U.Edit:
84
- return n.updateTemplate(v);
84
+ return t.updateTemplate(p);
85
85
  case U.Delete:
86
- return n.deleteTemplate(v, p, a);
86
+ return t.deleteTemplate(p, y, a);
87
87
  case U.Publish:
88
- return f(v);
88
+ return f(p);
89
89
  case U.Duplicate:
90
- return n.duplicateTemplate(v, p, a);
90
+ return t.duplicateTemplate(p, y, a);
91
91
  }
92
92
  }
93
93
  return {
@@ -95,23 +95,23 @@ const re = Be(
95
95
  {
96
96
  id: "_id",
97
97
  accessorKey: "_id",
98
- header: () => s("inventory.closing.table.createdAt"),
99
- cell(m) {
100
- return Xe(`${m.getValue()}`);
98
+ header: () => l("inventory.closing.table.createdAt"),
99
+ cell(r) {
100
+ return Xe(`${r.getValue()}`);
101
101
  },
102
102
  enableSorting: !0
103
103
  },
104
104
  {
105
105
  id: "name",
106
106
  accessorKey: "name",
107
- header: () => s("inventory.closing.table.name"),
107
+ header: () => l("inventory.closing.table.name"),
108
108
  enableSorting: !0,
109
109
  size: 200
110
110
  },
111
111
  {
112
112
  id: "noOfItems",
113
113
  accessorKey: "items.length",
114
- header: () => s("inventory.closing.table.noOfItems"),
114
+ header: () => l("inventory.closing.table.noOfItems"),
115
115
  enableSorting: !1,
116
116
  meta: {
117
117
  width: "10rem",
@@ -121,11 +121,11 @@ const re = Be(
121
121
  {
122
122
  id: "enabledLocations",
123
123
  accessorKey: "locations.length",
124
- header: () => s("inventory.closing.table.enabledOutlets"),
125
- cell(m) {
124
+ header: () => l("inventory.closing.table.enabledOutlets"),
125
+ cell(r) {
126
126
  var u;
127
- const v = (u = m.row.original.locations) == null ? void 0 : u.length;
128
- return v ? `${v}` : "All";
127
+ const p = (u = r.row.original.locations) == null ? void 0 : u.length;
128
+ return p ? `${p}` : "All";
129
129
  },
130
130
  enableSorting: !1,
131
131
  meta: {
@@ -136,16 +136,16 @@ const re = Be(
136
136
  {
137
137
  id: "ref",
138
138
  accessorKey: "ref",
139
- header: () => s("inventory.closing.table.reference"),
139
+ header: () => l("inventory.closing.table.reference"),
140
140
  enableSorting: !1,
141
141
  size: "auto"
142
142
  },
143
143
  {
144
144
  id: "status",
145
- header: () => s("inventory.adjustment.template.table.status"),
145
+ header: () => l("inventory.adjustment.template.table.status"),
146
146
  enableSorting: !1,
147
- cell(m) {
148
- const v = m.row.original, u = v._rev, e = m.row.original.locations || r.locations, I = e.filter((T) => !!(i.value[T.dbName] || []).find((x) => x._id === v._id && x._rev === u)).length === e.length;
147
+ cell(r) {
148
+ const p = r.row.original, u = p._rev, e = r.row.original.locations || c.locations, S = e.filter((T) => !!(m.value[T.dbName] || []).find((k) => k._id === p._id && k._rev === u)).length === e.length;
149
149
  return R(
150
150
  "div",
151
151
  {
@@ -156,24 +156,24 @@ const re = Be(
156
156
  {
157
157
  class: [
158
158
  "fm-status-badge",
159
- I ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
159
+ S ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
160
160
  ]
161
161
  },
162
- I ? "Published" : "Unpublished"
162
+ S ? "Published" : "Unpublished"
163
163
  )
164
164
  );
165
165
  }
166
166
  },
167
167
  {
168
168
  id: "action",
169
- cell(m) {
170
- const v = m.row.original, u = [
169
+ cell(r) {
170
+ const p = r.row.original, u = [
171
171
  ee[U.Edit],
172
172
  ee[U.Duplicate],
173
173
  ee[U.Delete],
174
174
  ee[U.Publish]
175
175
  ];
176
- return Qe(u, (e) => k(e, v));
176
+ return Qe(u, (e) => w(e, p));
177
177
  },
178
178
  enableSorting: !1,
179
179
  size: 40,
@@ -183,31 +183,31 @@ const re = Be(
183
183
  }
184
184
  }
185
185
  ],
186
- recentPublish: t,
187
- templates: y,
188
- loading: p,
186
+ recentPublish: n,
187
+ templates: d,
188
+ loading: y,
189
189
  fetchTemplates: a,
190
- loadTemplate: w
190
+ loadTemplate: _
191
191
  };
192
192
  }
193
193
  );
194
- var fe = /* @__PURE__ */ ((c) => (c.Ingredients = "Ingredients", c))(fe || {});
195
- function He(c) {
196
- const s = c.sku, l = new Set(c.disabledMeasurements);
194
+ var fe = /* @__PURE__ */ ((i) => (i.Ingredients = "Ingredients", i))(fe || {});
195
+ function He(i) {
196
+ const l = i.sku, o = new Set(i.disabledMeasurements);
197
197
  return [
198
198
  {
199
- code: s.code,
200
- name: s.name,
201
- unit: s.unit.abbrev,
202
- enabled: !l.has(s.unit._id)
199
+ code: l.code,
200
+ name: l.name,
201
+ unit: l.unit.abbrev,
202
+ enabled: !o.has(l.unit._id)
203
203
  },
204
- ...s.unit.measurements.map((t) => ({
205
- unit: t.abbrev,
206
- enabled: !l.has(t.id)
204
+ ...l.unit.measurements.map((n) => ({
205
+ unit: n.abbrev,
206
+ enabled: !o.has(n.id)
207
207
  }))
208
208
  ];
209
209
  }
210
- function je() {
210
+ function Oe() {
211
211
  return [
212
212
  {
213
213
  id: "code",
@@ -227,81 +227,93 @@ function je() {
227
227
  }
228
228
  ];
229
229
  }
230
- function yt(c) {
231
- var p;
232
- const l = pe().currentBusiness.value, n = (p = c.map((r) => {
233
- var b;
234
- const o = r.items.flatMap(He), f = je(), a = [
235
- ["Template ID", r._id],
236
- ["Template name", r.name],
237
- ["Business name", l == null ? void 0 : l.name],
238
- ["Business ID", l == null ? void 0 : l._id],
239
- ["Menu version", l == null ? void 0 : l.menuVersion],
230
+ function yt(i) {
231
+ var y;
232
+ const o = pe().currentBusiness.value, t = (y = i.map((c) => {
233
+ var h;
234
+ const s = c.items.flatMap(He), f = Oe(), a = [
235
+ ["Template ID", c._id],
236
+ ["Template name", c.name],
237
+ ["Business name", o == null ? void 0 : o.name],
238
+ ["Business ID", o == null ? void 0 : o._id],
239
+ ["Menu version", o == null ? void 0 : o.menuVersion],
240
240
  [
241
241
  "Locations",
242
- ...(b = r.locations) != null && b.length ? r.locations.map((m) => `${m.name} (${m.dbName})`) : ["All"]
242
+ ...(h = c.locations) != null && h.length ? c.locations.map((r) => `${r.name} (${r.dbName})`) : ["All"]
243
243
  ],
244
- ["Reference", r.ref ?? ""],
244
+ ["Reference", c.ref ?? ""],
245
245
  [],
246
- f.map((m) => m.name),
247
- ...o.map((m) => f.map((v) => m[v.id]))
248
- ], w = f.map((m) => `system:${m.id}`), k = ne(a, w);
249
- return { name: r.name, sheet: k };
246
+ f.map((r) => r.name),
247
+ ...s.map((r) => f.map((p) => r[p.id]))
248
+ ], _ = f.map((r) => `system:${r.id}`), w = ne(a, _);
249
+ return { name: c.name, sheet: w };
250
250
  }).reduce(
251
- (r, o) => {
251
+ (c, s) => {
252
252
  var a;
253
- const f = o.name.slice(0, 12);
254
- return (a = r.sheetOccurence)[f] ?? (a[f] = 0), r.sheetOccurence[f] += 1, r.sheets[`${f} (${r.sheetOccurence[f]})`] = o.sheet, r;
253
+ const f = s.name.slice(0, 12);
254
+ return (a = c.sheetOccurence)[f] ?? (a[f] = 0), c.sheetOccurence[f] += 1, c.sheets[`${f} (${c.sheetOccurence[f]})`] = s.sheet, c;
255
255
  },
256
256
  {
257
257
  sheets: {},
258
258
  sheetOccurence: {}
259
259
  }
260
- )) == null ? void 0 : p.sheets, t = `${l == null ? void 0 : l.name} closing templates (${Ue(/* @__PURE__ */ new Date())}).xlsx`, y = me(n);
261
- return ue(y, t), t;
260
+ )) == null ? void 0 : y.sheets, n = `${o == null ? void 0 : o.name} closing templates (${Ue(/* @__PURE__ */ new Date())}).xlsx`, d = me(t);
261
+ return ue(d, n), n;
262
262
  }
263
- function ht(c) {
263
+ function ht(i) {
264
264
  pe().currentBusiness.value;
265
- const l = [
266
- ["Template:", c.name],
267
- ["Reference:", c.ref ?? ""],
265
+ const o = 3, m = (a) => {
266
+ const _ = [], w = a.sku, h = new Set(a.disabledMeasurements || []);
267
+ h.has(w.unit._id) || _.push(w.unit.abbrev);
268
+ for (const r of w.unit.measurements) {
269
+ if (_.length >= o) break;
270
+ h.has(r.id) || _.push(r.abbrev);
271
+ }
272
+ return _;
273
+ }, t = ["#", "Code", "Name", "UOM"], n = [
274
+ ["Template:", i.name],
275
+ ["Reference:", i.ref ?? ""],
268
276
  [],
269
- ["#", "Code", "Name", ""],
270
- // Header row with blank column for notes
271
- ...c.items.map((r, o) => [
272
- o + 1,
273
- // Index starting from 1
274
- r.sku.code,
275
- r.sku.name,
276
- ""
277
- // Blank column for manual entry
278
- ])
279
- ], i = ne(l, ["#", "Code", "Name", ""]);
280
- if (i["!ref"]) {
281
- const r = {
277
+ t,
278
+ ...i.items.map((a, _) => {
279
+ const w = m(a);
280
+ return [
281
+ _ + 1,
282
+ // Index starting from 1
283
+ a.sku.code,
284
+ a.sku.name,
285
+ // Add UOM columns (up to MAX_UOM_COLUMNS)
286
+ ...Array(o).fill("").map(
287
+ (h, r) => w[r] ? `_____ ${w[r]}` : ""
288
+ )
289
+ ];
290
+ })
291
+ ], d = ne(n, t);
292
+ if (d["!ref"]) {
293
+ const a = {
282
294
  top: { style: "thin", color: { rgb: "000000" } },
283
295
  bottom: { style: "thin", color: { rgb: "000000" } },
284
296
  left: { style: "thin", color: { rgb: "000000" } },
285
297
  right: { style: "thin", color: { rgb: "000000" } }
286
- }, o = 4, f = o + c.items.length;
287
- for (let a = o; a <= f; a++)
288
- ["A", "B", "C", "D"].forEach((w) => {
289
- const k = `${w}${a}`;
290
- i[k] || (i[k] = { t: "s", v: "" }), i[k].s = {
291
- border: r
298
+ }, _ = 4, w = _ + i.items.length, h = t.map((r, p) => String.fromCharCode(65 + p));
299
+ for (let r = _; r <= w; r++)
300
+ h.forEach((p) => {
301
+ const u = `${p}${r}`;
302
+ d[u] || (d[u] = { t: "s", v: "" }), d[u].s = {
303
+ border: a
292
304
  };
293
305
  });
294
306
  }
295
- i["!cols"] = [
307
+ d["!cols"] = [
296
308
  { wch: 5 },
297
309
  // Index column - narrow
298
310
  { wch: 15 },
299
311
  // Code column
300
- { wch: 40 },
301
- // Name column - wider for readability
302
- { wch: 20 }
303
- // Blank column for notes
304
- ], i["!margins"] = {
312
+ { wch: 30 },
313
+ // Name column - adjusted for more columns
314
+ ...Array.from({ length: o }, () => ({ wch: 15 }))
315
+ // UOM columns
316
+ ], d["!margins"] = {
305
317
  left: 0.7,
306
318
  right: 0.7,
307
319
  top: 0.75,
@@ -309,11 +321,11 @@ function ht(c) {
309
321
  header: 0.3,
310
322
  footer: 0.3
311
323
  };
312
- const t = c.name.slice(0, 31), y = me({ [t]: i }), p = `${c.name} - Closing Template (${Ue(/* @__PURE__ */ new Date())}).xlsx`;
313
- return ue(y, p), p;
324
+ const c = i.name.slice(0, 31), s = me({ [c]: d }), f = `${i.name} - Closing Template (${Ue(/* @__PURE__ */ new Date())}).xlsx`;
325
+ return ue(s, f), f;
314
326
  }
315
327
  function bt() {
316
- const c = pe(), s = de(), l = et(), i = He({
328
+ const i = pe(), l = de(), o = et(), m = He({
317
329
  sku: {
318
330
  unit: {
319
331
  _id: "",
@@ -326,12 +338,12 @@ function bt() {
326
338
  _id: "",
327
339
  name: "Sugar"
328
340
  }
329
- })[0], n = c.currentBusiness.value, t = je(), y = [
341
+ })[0], t = i.currentBusiness.value, n = Oe(), d = [
330
342
  ["Template ID (leave empty to create new)", ""],
331
343
  ["Template Name", "New template"],
332
- ["Business name", n == null ? void 0 : n.name],
333
- ["Business ID", n == null ? void 0 : n._id],
334
- ["Menu version", n == null ? void 0 : n.menuVersion],
344
+ ["Business name", t == null ? void 0 : t.name],
345
+ ["Business ID", t == null ? void 0 : t._id],
346
+ ["Menu version", t == null ? void 0 : t.menuVersion],
335
347
  [
336
348
  "Location codes (leave empty to enable all)",
337
349
  "Example outlet (restaurant_xxx)",
@@ -339,45 +351,45 @@ function bt() {
339
351
  ],
340
352
  ["Reference:"],
341
353
  [],
342
- t.map((b) => b.name),
343
- t.map((b) => i[b.id])
344
- ], p = t.map((b) => `system:${b.id}`), r = ne(y, p), o = l.isEnabled ? l.state.setting.childItems ?? [] : [], f = o.reduce(
345
- (b, m) => {
346
- var I, T;
347
- const v = (I = l.netSuiteItemIdToSkuId.get(m.parentNetSuiteId)) == null ? void 0 : I[0], u = (T = l.netSuiteMeasurementIdToMeasurementId.get(
348
- m.unitOfMeasureId
354
+ n.map((h) => h.name),
355
+ n.map((h) => m[h.id])
356
+ ], y = n.map((h) => `system:${h.id}`), c = ne(d, y), s = o.isEnabled ? o.state.setting.childItems ?? [] : [], f = s.reduce(
357
+ (h, r) => {
358
+ var S, T;
359
+ const p = (S = o.netSuiteItemIdToSkuId.get(r.parentNetSuiteId)) == null ? void 0 : S[0], u = (T = o.netSuiteMeasurementIdToMeasurementId.get(
360
+ r.unitOfMeasureId
349
361
  )) == null ? void 0 : T[0];
350
- if (!m.externalId)
351
- return b;
352
- if (!v)
353
- return console.error(`Item ${m.externalId} cannot be mapped to parent FdoInventorySku.`, m), b;
354
- const e = s.skuById[v], _ = e.unit.measurements.find((g) => g.id === u);
355
- return _ ? (b[m.externalId] = {
362
+ if (!r.externalId)
363
+ return h;
364
+ if (!p)
365
+ return console.error(`Item ${r.externalId} cannot be mapped to parent FdoInventorySku.`, r), h;
366
+ const e = l.skuById[p], x = e.unit.measurements.find((g) => g.id === u);
367
+ return x ? (h[r.externalId] = {
356
368
  sku: e,
357
- measurement: _
358
- }, b) : (console.error(
359
- `Item ${m.externalId} found parent FdoInventorySku of ${e.code} ${e.name} but the measurement of netsuite id ${m.unitOfMeasureId} cannot be found.`,
360
- m
361
- ), b);
369
+ measurement: x
370
+ }, h) : (console.error(
371
+ `Item ${r.externalId} found parent FdoInventorySku of ${e.code} ${e.name} but the measurement of netsuite id ${r.unitOfMeasureId} cannot be found.`,
372
+ r
373
+ ), h);
362
374
  },
363
375
  {}
364
376
  ), a = ne(
365
377
  [
366
- ...s.skus.flatMap((b) => [
367
- [b.code, b.name, b.unit.abbrev, !0],
368
- ...b.unit.measurements.map((v) => [
378
+ ...l.skus.flatMap((h) => [
379
+ [h.code, h.name, h.unit.abbrev, !0],
380
+ ...h.unit.measurements.map((p) => [
369
381
  "",
370
382
  "",
371
- v.abbrev,
372
- !v.abbrev.toLocaleLowerCase("en-us").includes("inactive")
383
+ p.abbrev,
384
+ !p.abbrev.toLocaleLowerCase("en-us").includes("inactive")
373
385
  ])
374
386
  ]),
375
- ...Object.entries(f).map(([b, { sku: m, measurement: v }]) => [
376
- m.code,
377
- m.name,
378
- v.abbrev,
379
- !v.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
380
- b
387
+ ...Object.entries(f).map(([h, { sku: r, measurement: p }]) => [
388
+ r.code,
389
+ r.name,
390
+ p.abbrev,
391
+ !p.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
392
+ h
381
393
  ])
382
394
  ],
383
395
  [
@@ -385,79 +397,79 @@ function bt() {
385
397
  "Name",
386
398
  "Units",
387
399
  "Enabled (true/false)",
388
- ...o.length ? ["Netsuite Parent"] : []
400
+ ...s.length ? ["Netsuite Parent"] : []
389
401
  ]
390
- ), w = me({
391
- Template: r,
402
+ ), _ = me({
403
+ Template: c,
392
404
  Ingredients: a
393
- }), k = `${n == null ? void 0 : n.name} transfer templates import.xlsx`;
394
- return ue(w, k), k;
405
+ }), w = `${t == null ? void 0 : t.name} transfer templates import.xlsx`;
406
+ return ue(_, w), w;
395
407
  }
396
- function _t(c) {
397
- if (!c.length || `${c[0]}`.toLocaleLowerCase() === "all")
408
+ function _t(i) {
409
+ if (!i.length || `${i[0]}`.toLocaleLowerCase() === "all")
398
410
  return [];
399
- const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, i = ce().locationByDbName;
400
- return c.map((n) => {
401
- const t = new Array(), y = n.trim(), p = s.exec(y);
402
- if (!p)
403
- return t.push(`Enabled location value of ${y} cannot be read.`), {
404
- errors: t
411
+ const l = /(.*) \(((warehouse_|restaurant_).{24,})\)/, m = ce().locationByDbName;
412
+ return i.map((t) => {
413
+ const n = new Array(), d = t.trim(), y = l.exec(d);
414
+ if (!y)
415
+ return n.push(`Enabled location value of ${d} cannot be read.`), {
416
+ errors: n
405
417
  };
406
- const r = p[1], o = p[2], f = i[o];
407
- return f ? (r !== f.name && t.push(
408
- `Location id ${o} has non-matching name. Found ${r} but expected ${f.name}`
418
+ const c = y[1], s = y[2], f = m[s];
419
+ return f ? (c !== f.name && n.push(
420
+ `Location id ${s} has non-matching name. Found ${c} but expected ${f.name}`
409
421
  ), {
410
- errors: t,
422
+ errors: n,
411
423
  location: f
412
- }) : (t.push(`Location (${r}) of id ${o} is not found.`), {
413
- errors: t
424
+ }) : (n.push(`Location (${c}) of id ${s} is not found.`), {
425
+ errors: n
414
426
  });
415
427
  });
416
428
  }
417
- function xt(c) {
429
+ function xt(i) {
418
430
  const [
419
- s,
420
431
  l,
421
- i,
422
- n,
432
+ o,
433
+ m,
423
434
  t,
435
+ n,
436
+ d,
424
437
  y,
425
- p,
426
- r
427
- ] = Ne(c);
438
+ c
439
+ ] = Ne(i);
428
440
  return {
429
- id: `${l[1] ?? ""}`.trim(),
430
- name: `${i[1] ?? ""}`.trim(),
431
- locations: p.slice(1).map((o) => `${o}`.trim()).filter((o) => o),
432
- reference: `${r[1] ?? ""}`.trim()
441
+ id: `${o[1] ?? ""}`.trim(),
442
+ name: `${m[1] ?? ""}`.trim(),
443
+ locations: y.slice(1).map((s) => `${s}`.trim()).filter((s) => s),
444
+ reference: `${c[1] ?? ""}`.trim()
433
445
  };
434
446
  }
435
- function wt(c) {
447
+ function wt(i) {
436
448
  const [
437
- s,
438
449
  l,
439
- i,
440
- n,
450
+ o,
451
+ m,
441
452
  t,
453
+ n,
454
+ d,
442
455
  y,
443
- p,
444
- r,
445
- o,
456
+ c,
457
+ s,
446
458
  f,
447
459
  ...a
448
- ] = Ne(c);
449
- if (!s || !s.length || s.some((v) => v.length && !v.startsWith("system:")))
460
+ ] = Ne(i);
461
+ if (!l || !l.length || l.some((p) => p.length && !p.startsWith("system:")))
450
462
  throw new Error("Missing meta header. Excel file does not come from the template.");
451
- const w = s.map((v) => v.split(":")[1]), b = ["code", "name", "unit", "enabled"].filter((v) => !w.includes(v));
452
- if (b.length)
463
+ const _ = l.map((p) => p.split(":")[1]), h = ["code", "name", "unit", "enabled"].filter((p) => !_.includes(p));
464
+ if (h.length)
453
465
  throw new Error(
454
- `Missing meta headers (${b.join()}). Excel file does not come from the template.`
466
+ `Missing meta headers (${h.join()}). Excel file does not come from the template.`
455
467
  );
456
- return a.map((v, u) => {
468
+ return a.map((p, u) => {
457
469
  const e = {};
458
- for (const _ in w) {
459
- const I = w[_];
460
- Object.assign(e, { [I]: v[_] });
470
+ for (const x in _) {
471
+ const S = _[x];
472
+ Object.assign(e, { [S]: p[x] });
461
473
  }
462
474
  return {
463
475
  index: u,
@@ -465,100 +477,100 @@ function wt(c) {
465
477
  };
466
478
  });
467
479
  }
468
- function kt(c) {
469
- return c.reduce(
470
- (s, l) => {
471
- var t;
472
- const i = l.data, n = l.index;
473
- return i.unit && (i.code ? s.result.push({ parent: l, children: [] }) : s.result.length ? (t = s.result.at(-1)) == null || t.children.push(l) : s.errors.push(`Cannot find parent for row ${n + 9}`)), s;
480
+ function kt(i) {
481
+ return i.reduce(
482
+ (l, o) => {
483
+ var n;
484
+ const m = o.data, t = o.index;
485
+ return m.unit && (m.code ? l.result.push({ parent: o, children: [] }) : l.result.length ? (n = l.result.at(-1)) == null || n.children.push(o) : l.errors.push(`Cannot find parent for row ${t + 9}`)), l;
474
486
  },
475
487
  { result: new Array(), errors: new Array() }
476
488
  );
477
489
  }
478
- function Tt(c) {
479
- const s = c.parent.data, l = new Array(), n = de().skuByCode[s.code ?? ""];
480
- if (!n)
481
- return l.push(`Cannot find ingredient of code ${s.code} ${s.name}`), { errors: l };
482
- const t = {
483
- sku: n
484
- }, y = /* @__PURE__ */ new Set([n.unit._id, ...n.unit.measurements.map((r) => r.id)]), p = n.unit.measurements.find((r) => r.abbrev === s.unit);
485
- s.unit !== n.unit.abbrev && !p ? l.push(
486
- `Cannot find measurement unit of ${s.unit} for (${s.code}) ${s.name}.`
487
- ) : (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && y.delete(n.unit._id);
488
- for (const r of c.children) {
489
- const o = r.data, f = o.unit === n.unit.abbrev ? n.unit : void 0, a = n.unit.measurements.find((w) => w.abbrev === o.unit);
490
+ function Tt(i) {
491
+ const l = i.parent.data, o = new Array(), t = de().skuByCode[l.code ?? ""];
492
+ if (!t)
493
+ return o.push(`Cannot find ingredient of code ${l.code} ${l.name}`), { errors: o };
494
+ const n = {
495
+ sku: t
496
+ }, d = /* @__PURE__ */ new Set([t.unit._id, ...t.unit.measurements.map((c) => c.id)]), y = t.unit.measurements.find((c) => c.abbrev === l.unit);
497
+ l.unit !== t.unit.abbrev && !y ? o.push(
498
+ `Cannot find measurement unit of ${l.unit} for (${l.code}) ${l.name}.`
499
+ ) : (l.enabled === !0 || `${l.enabled}`.toLocaleLowerCase() === "true") && d.delete(t.unit._id);
500
+ for (const c of i.children) {
501
+ const s = c.data, f = s.unit === t.unit.abbrev ? t.unit : void 0, a = t.unit.measurements.find((_) => _.abbrev === s.unit);
490
502
  if (!a && !f) {
491
- l.push(
492
- `Cannot find measurement unit of ${o.unit} for (${s.code}) ${s.name}.`
503
+ o.push(
504
+ `Cannot find measurement unit of ${s.unit} for (${l.code}) ${l.name}.`
493
505
  );
494
506
  continue;
495
507
  }
496
- (o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") && y.delete((a == null ? void 0 : a.id) ?? (f == null ? void 0 : f._id) ?? "");
508
+ (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && d.delete((a == null ? void 0 : a.id) ?? (f == null ? void 0 : f._id) ?? "");
497
509
  }
498
- return y.has(n.unit._id) && t.sku.unit.measurements.every((r) => y.has(r.id)) && l.push(`Ingredient ${n.code} - ${n.name} must have at least one unit enabled.`), t.disabledMeasurements = [...y], { errors: l, templateItem: t };
510
+ return d.has(t.unit._id) && n.sku.unit.measurements.every((c) => d.has(c.id)) && o.push(`Ingredient ${t.code} - ${t.name} must have at least one unit enabled.`), n.disabledMeasurements = [...d], { errors: o, templateItem: n };
499
511
  }
500
- function $t(c) {
501
- const s = c.SheetNames.filter(
502
- (t) => !Object.values(fe).map(String).includes(t)
503
- ), i = re().templates, n = tt(i, "_id");
512
+ function $t(i) {
513
+ const l = i.SheetNames.filter(
514
+ (n) => !Object.values(fe).map(String).includes(n)
515
+ ), m = re().templates, t = tt(m, "_id");
504
516
  try {
505
- return s.reduce(
506
- (t, y) => {
507
- const p = new Array(), r = c.Sheets[y], o = xt(r), f = _t(o.locations), a = f.filter((e) => e.location).map((e) => e.location);
508
- p.push(...f.flatMap((e) => e.errors));
509
- const w = wt(r).filter(
517
+ return l.reduce(
518
+ (n, d) => {
519
+ const y = new Array(), c = i.Sheets[d], s = xt(c), f = _t(s.locations), a = f.filter((e) => e.location).map((e) => e.location);
520
+ y.push(...f.flatMap((e) => e.errors));
521
+ const _ = wt(c).filter(
510
522
  (e) => e.data.code || e.data.unit
511
- ), k = kt(w);
512
- p.push(...k.errors);
513
- const b = k.result.map(
523
+ ), w = kt(_);
524
+ y.push(...w.errors);
525
+ const h = w.result.map(
514
526
  (e) => Tt(e)
515
527
  );
516
- p.push(...b.flatMap((e) => e.errors));
517
- const m = b.filter((e) => e.templateItem).map((e) => e.templateItem);
518
- if (o.id) {
519
- const e = n[o.id];
528
+ y.push(...h.flatMap((e) => e.errors));
529
+ const r = h.filter((e) => e.templateItem).map((e) => e.templateItem);
530
+ if (s.id) {
531
+ const e = t[s.id];
520
532
  if (!e) {
521
- const I = {
522
- _id: o.id,
533
+ const S = {
534
+ _id: s.id,
523
535
  _rev: "",
524
- name: o.name || `(unnamed from sheet ${y || "<unnamed sheet>"})`,
536
+ name: s.name || `(unnamed from sheet ${d || "<unnamed sheet>"})`,
525
537
  items: []
526
538
  };
527
- return p.push(`Template ID ${o.id} is not found.`), t.importUpdateResult.push({
539
+ return y.push(`Template ID ${s.id} is not found.`), n.importUpdateResult.push({
528
540
  type: "update",
529
- original: I,
530
- template: I,
531
- excelSheetName: y,
532
- errors: p
533
- }), t;
541
+ original: S,
542
+ template: S,
543
+ excelSheetName: d,
544
+ errors: y
545
+ }), n;
534
546
  }
535
- const _ = {
547
+ const x = {
536
548
  type: "update",
537
549
  original: e,
538
550
  template: {
539
551
  ...e,
540
- name: o.name,
552
+ name: s.name,
541
553
  locations: a.length ? a : null,
542
- ref: o.reference,
543
- items: m
554
+ ref: s.reference,
555
+ items: r
544
556
  },
545
- excelSheetName: y,
546
- errors: p
557
+ excelSheetName: d,
558
+ errors: y
547
559
  };
548
- return t.importUpdateResult.push(_), t;
560
+ return n.importUpdateResult.push(x), n;
549
561
  }
550
562
  const u = {
551
563
  type: "create",
552
564
  template: {
553
- name: o.name,
565
+ name: s.name,
554
566
  locations: a.length ? a : null,
555
- ref: o.reference,
556
- items: m
567
+ ref: s.reference,
568
+ items: r
557
569
  },
558
- excelSheetName: y,
559
- errors: p
570
+ excelSheetName: d,
571
+ errors: y
560
572
  };
561
- return t.importCreateResult.push(u), t;
573
+ return n.importCreateResult.push(u), n;
562
574
  },
563
575
  {
564
576
  invalidExcel: !1,
@@ -566,16 +578,16 @@ function $t(c) {
566
578
  importUpdateResult: new Array()
567
579
  }
568
580
  );
569
- } catch (t) {
581
+ } catch (n) {
570
582
  return {
571
583
  invalidExcel: !0,
572
- invalidExcelMessage: (t == null ? void 0 : t.message) ?? "Invalid excel",
584
+ invalidExcelMessage: (n == null ? void 0 : n.message) ?? "Invalid excel",
573
585
  importCreateResult: [],
574
586
  importUpdateResult: []
575
587
  };
576
588
  }
577
589
  }
578
- const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-col" }, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Dt = {
590
+ const Ct = { class: "flex items-center gap-12 pl-8" }, St = { class: "flex flex-col" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Dt = {
579
591
  key: 0,
580
592
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
581
593
  }, Mt = { key: 0 }, Re = /* @__PURE__ */ H({
@@ -587,32 +599,32 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
587
599
  items: {},
588
600
  errors: {}
589
601
  },
590
- setup(c) {
591
- const { t: s } = j();
592
- return (l, i) => {
593
- var y, p, r;
594
- const n = A("FmIcon"), t = A("FmTooltip");
602
+ setup(i) {
603
+ const { t: l } = O();
604
+ return (o, m) => {
605
+ var d, y, c;
606
+ const t = A("FmIcon"), n = A("FmTooltip");
595
607
  return $(), M("div", Ct, [
596
- i[0] || (i[0] = h("div", null, "•", -1)),
597
- h("div", It, [
598
- h("div", St, [
599
- h("div", {
608
+ m[0] || (m[0] = b("div", null, "•", -1)),
609
+ b("div", St, [
610
+ b("div", It, [
611
+ b("div", {
600
612
  class: G({
601
- "text-fm-color-system-error-300": l.errors.length
613
+ "text-fm-color-system-error-300": o.errors.length
602
614
  })
603
615
  }, [
604
- Fe(S(l.name) + " ", 1),
605
- l.type === "create" ? ($(), M("span", Dt, "(" + S(d(s)("inventory.closing.template.import.new")) + ")", 1)) : Y("", !0)
616
+ Fe(I(o.name) + " ", 1),
617
+ o.type === "create" ? ($(), M("span", Dt, "(" + I(v(l)("inventory.closing.template.import.new")) + ")", 1)) : Y("", !0)
606
618
  ], 2),
607
- l.errors.length ? ($(), M("div", Mt, [
608
- C(t, { "z-index": 50 }, {
619
+ o.errors.length ? ($(), M("div", Mt, [
620
+ C(n, { "z-index": 50 }, {
609
621
  content: E(() => [
610
- h("ol", null, [
611
- ($(!0), M(O, null, q(l.errors, (o, f) => ($(), M("li", { key: f }, S(o), 1))), 128))
622
+ b("ol", null, [
623
+ ($(!0), M(j, null, q(o.errors, (s, f) => ($(), M("li", { key: f }, I(s), 1))), 128))
612
624
  ])
613
625
  ]),
614
626
  default: E(() => [
615
- C(n, {
627
+ C(t, {
616
628
  name: "error",
617
629
  size: "sm",
618
630
  color: "system-error-300"
@@ -622,15 +634,15 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
622
634
  })
623
635
  ])) : Y("", !0)
624
636
  ]),
625
- h("div", {
637
+ b("div", {
626
638
  class: G([
627
639
  "fm-typo-en-body-sm-400",
628
640
  {
629
- "text-fm-color-system-error-200": l.errors.length,
630
- "text-fm-color-typo-secondary": !l.errors.length
641
+ "text-fm-color-system-error-200": o.errors.length,
642
+ "text-fm-color-typo-secondary": !o.errors.length
631
643
  }
632
644
  ])
633
- }, S((y = l.locations) != null && y.length ? d(s)("inventory.closing.template.import.nLocations", { count: (p = l.locations) == null ? void 0 : p.length }) : d(s)("inventory.closing.template.import.allLocations")) + ", " + S(d(s)("inventory.closing.template.import.nItems", { count: (r = l.items) == null ? void 0 : r.length })), 3)
645
+ }, I((d = o.locations) != null && d.length ? v(l)("inventory.closing.template.import.nLocations", { count: (y = o.locations) == null ? void 0 : y.length }) : v(l)("inventory.closing.template.import.allLocations")) + ", " + I(v(l)("inventory.closing.template.import.nItems", { count: (c = o.items) == null ? void 0 : c.length })), 3)
634
646
  ])
635
647
  ]);
636
648
  };
@@ -649,132 +661,132 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
649
661
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
650
662
  }, zt = { class: "fm-typo-en-body-lg-600" }, Ht = /* @__PURE__ */ H({
651
663
  __name: "ClosingTemplateImport",
652
- setup(c) {
653
- const s = P(null), l = pt(), i = le(), n = P(!1), t = P(!1), y = P(new Array()), p = P([]), r = P([]), o = V(
654
- () => !!y.value.length || p.value.some((k) => k.errors.length) || r.value.some((k) => k.errors.length)
664
+ setup(i) {
665
+ const l = P(null), o = pt(), m = le(), t = P(!1), n = P(!1), d = P(new Array()), y = P([]), c = P([]), s = V(
666
+ () => !!d.value.length || y.value.some((w) => w.errors.length) || c.value.some((w) => w.errors.length)
655
667
  ), f = V(
656
- () => !!p.value.length || !!r.value.length
657
- ), { t: a } = j();
658
- async function w(k) {
659
- y.value = [], p.value = [], r.value = [];
668
+ () => !!y.value.length || !!c.value.length
669
+ ), { t: a } = O();
670
+ async function _(w) {
671
+ d.value = [], y.value = [], c.value = [];
660
672
  try {
661
- n.value = !0;
662
- const [b] = await Promise.all([
663
- ot(k),
673
+ t.value = !0;
674
+ const [h] = await Promise.all([
675
+ ot(w),
664
676
  // fake buffer
665
677
  new Promise((e) => setTimeout(e, 1e3))
666
678
  ]);
667
- if (!b.SheetNames.filter(
679
+ if (!h.SheetNames.filter(
668
680
  (e) => !Object.values(fe).map(String).includes(e)
669
681
  ).find((e) => e)) {
670
- y.value.push(a("inventory.ingredient.import.fileError.noSheet"));
682
+ d.value.push(a("inventory.ingredient.import.fileError.noSheet"));
671
683
  return;
672
684
  }
673
- const u = $t(b);
685
+ const u = $t(h);
674
686
  if (u.invalidExcel) {
675
- y.value.push(
687
+ d.value.push(
676
688
  u.invalidExcelMessage ?? a("inventory.ingredient.import.fileError.invalidExcel")
677
689
  );
678
690
  return;
679
691
  }
680
- if (p.value = u.importCreateResult, r.value = u.importUpdateResult, !p.value.length && !r.value.length) {
681
- y.value.push(a("inventory.ingredient.import.fileError.noData"));
692
+ if (y.value = u.importCreateResult, c.value = u.importUpdateResult, !y.value.length && !c.value.length) {
693
+ d.value.push(a("inventory.ingredient.import.fileError.noData"));
682
694
  return;
683
695
  }
684
- l.emitData(u);
685
- } catch (b) {
686
- i.open({
696
+ o.emitData(u);
697
+ } catch (h) {
698
+ m.open({
687
699
  title: a("inventory.ingredient.import.fileError.unableToRead"),
688
- message: b == null ? void 0 : b.message,
700
+ message: h == null ? void 0 : h.message,
689
701
  type: "error"
690
- }), console.error("Error in reading file", b);
702
+ }), console.error("Error in reading file", h);
691
703
  } finally {
692
- y.value.length && i.open({
704
+ d.value.length && m.open({
693
705
  title: a("inventory.ingredient.import.fileError.invalidExcel"),
694
706
  type: "error"
695
- }), n.value = !1;
707
+ }), t.value = !1;
696
708
  }
697
709
  }
698
- return Ae(s, (k) => {
699
- k && w(k);
700
- }), (k, b) => {
701
- const m = A("FmCircularProgress"), v = A("FmIcon"), u = A("FmButton");
710
+ return Ae(l, (w) => {
711
+ w && _(w);
712
+ }), (w, h) => {
713
+ const r = A("FmCircularProgress"), p = A("FmIcon"), u = A("FmButton");
702
714
  return $(), M("div", Pt, [
703
- h("div", Rt, S(d(a)("inventory.closing.template.import.message")), 1),
704
- t.value ? ($(), M("div", Ft, [
705
- h("div", null, [
706
- C(m, {
715
+ b("div", Rt, I(v(a)("inventory.closing.template.import.message")), 1),
716
+ n.value ? ($(), M("div", Ft, [
717
+ b("div", null, [
718
+ C(r, {
707
719
  size: "md",
708
720
  color: "neutral-gray-200"
709
721
  })
710
722
  ]),
711
- h("div", At, S(d(a)("inventory.formField.loading")), 1)
712
- ])) : ($(), M(O, { key: 1 }, [
723
+ b("div", At, I(v(a)("inventory.formField.loading")), 1)
724
+ ])) : ($(), M(j, { key: 1 }, [
713
725
  C(nt, {
714
726
  class: G({
715
727
  "w-full": !0,
716
- "h-[200px]": !s.value
728
+ "h-[200px]": !l.value
717
729
  }),
718
730
  accept: ".xlsx",
719
- onFileUpload: b[0] || (b[0] = (e) => s.value = e),
720
- label: d(a)("inventory.ingredient.import.uploadTemplate"),
721
- "button-label": d(a)("inventory.ingredient.import.selectFile")
731
+ onFileUpload: h[0] || (h[0] = (e) => l.value = e),
732
+ label: v(a)("inventory.ingredient.import.uploadTemplate"),
733
+ "button-label": v(a)("inventory.ingredient.import.selectFile")
722
734
  }, Ee({ _: 2 }, [
723
- s.value ? {
735
+ l.value ? {
724
736
  name: "default",
725
737
  fn: E(({ openFileDialog: e }) => [
726
- h("div", Et, [
727
- h("div", {
738
+ b("div", Et, [
739
+ b("div", {
728
740
  class: G([
729
741
  "fm-corner-radius-md p-16 flex items-center gap-16",
730
742
  {
731
- "border border-fm-color-neutral-gray-100": n.value,
732
- "border border-fm-color-neutral-gray-200": !n.value && !o.value,
733
- "border border-fm-color-system-error-200": o.value
743
+ "border border-fm-color-neutral-gray-100": t.value,
744
+ "border border-fm-color-neutral-gray-200": !t.value && !s.value,
745
+ "border border-fm-color-system-error-200": s.value
734
746
  }
735
747
  ])
736
748
  }, [
737
- n.value ? ($(), N(m, {
749
+ t.value ? ($(), N(r, {
738
750
  key: 0,
739
751
  size: "md",
740
752
  color: "neutral-gray-200"
741
- })) : ($(), N(v, {
753
+ })) : ($(), N(p, {
742
754
  key: 1,
743
- name: o.value ? "error" : "attach_file",
755
+ name: s.value ? "error" : "attach_file",
744
756
  outline: "",
745
- color: o.value ? "system-error-300" : void 0
757
+ color: s.value ? "system-error-300" : void 0
746
758
  }, null, 8, ["name", "color"])),
747
- h("div", {
759
+ b("div", {
748
760
  class: G([
749
761
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
750
762
  {
751
- "text-fm-color-typo-disabled": n.value,
752
- "text-fm-color-typo-primary": !n.value
763
+ "text-fm-color-typo-disabled": t.value,
764
+ "text-fm-color-typo-primary": !t.value
753
765
  }
754
766
  ])
755
767
  }, [
756
- h("div", Vt, S(s.value.name), 1)
768
+ b("div", Vt, I(l.value.name), 1)
757
769
  ], 2),
758
- n.value ? Y("", !0) : ($(), M("div", Ut, [
770
+ t.value ? Y("", !0) : ($(), M("div", Ut, [
759
771
  C(u, {
760
- label: d(a)("inventory.ingredient.import.replaceFile"),
761
- variant: o.value ? "destructive" : "secondary",
762
- "prepend-icon": o.value ? void 0 : "autorenew",
772
+ label: v(a)("inventory.ingredient.import.replaceFile"),
773
+ variant: s.value ? "destructive" : "secondary",
774
+ "prepend-icon": s.value ? void 0 : "autorenew",
763
775
  onClick: e
764
776
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
765
777
  ]))
766
778
  ], 2),
767
- y.value.length ? ($(), M("div", Nt, [
768
- ($(!0), M(O, null, q(y.value, (_, I) => ($(), M("div", {
769
- key: I,
779
+ d.value.length ? ($(), M("div", Nt, [
780
+ ($(!0), M(j, null, q(d.value, (x, S) => ($(), M("div", {
781
+ key: S,
770
782
  class: "flex gap-8 items-center"
771
783
  }, [
772
- C(v, {
784
+ C(p, {
773
785
  name: "error",
774
786
  size: "sm",
775
787
  color: "system-error-300"
776
788
  }),
777
- h("div", Lt, S(_), 1)
789
+ b("div", Lt, I(x), 1)
778
790
  ]))), 128))
779
791
  ])) : Y("", !0)
780
792
  ])
@@ -783,16 +795,16 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
783
795
  } : void 0
784
796
  ]), 1032, ["class", "label", "button-label"]),
785
797
  f.value ? ($(), M("div", Bt, [
786
- h("div", zt, S(d(a)("inventory.ingredient.import.summary")), 1),
787
- ($(!0), M(O, null, q(p.value, (e, _) => ($(), N(Re, {
788
- key: _,
798
+ b("div", zt, I(v(a)("inventory.ingredient.import.summary")), 1),
799
+ ($(!0), M(j, null, q(y.value, (e, x) => ($(), N(Re, {
800
+ key: x,
789
801
  name: e.template.name,
790
802
  locations: e.template.locations,
791
803
  items: e.template.items,
792
804
  errors: e.errors,
793
805
  type: "create"
794
806
  }, null, 8, ["name", "locations", "items", "errors"]))), 128)),
795
- ($(!0), M(O, null, q(r.value, (e) => ($(), N(Re, {
807
+ ($(!0), M(j, null, q(c.value, (e) => ($(), N(Re, {
796
808
  key: e.template._id,
797
809
  name: e.template.name,
798
810
  locations: e.template.locations,
@@ -806,28 +818,28 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
806
818
  };
807
819
  }
808
820
  }), oe = Be("closingTemplateActions", () => {
809
- const { t: c } = j(), s = se(), l = le(), i = ae(), n = st(), t = re(), { loading: y } = ze(t), p = P({});
810
- function r() {
811
- p.value = {
821
+ const { t: i } = O(), l = se(), o = le(), m = ae(), t = st(), n = re(), { loading: d } = ze(n), y = P({});
822
+ function c() {
823
+ y.value = {
812
824
  mode: z.CREATE,
813
825
  show: !0,
814
826
  "onUpdate:show"(e) {
815
- p.value.show = e;
827
+ y.value.show = e;
816
828
  }
817
829
  };
818
830
  }
819
- function o(e) {
820
- p.value = {
831
+ function s(e) {
832
+ y.value = {
821
833
  mode: z.UPDATE,
822
834
  modelValue: e,
823
835
  show: !0,
824
- "onUpdate:show"(_) {
825
- p.value.show = _;
836
+ "onUpdate:show"(x) {
837
+ y.value.show = x;
826
838
  }
827
839
  };
828
840
  }
829
- function f(e, _, I) {
830
- s.open({
841
+ function f(e, x, S) {
842
+ l.open({
831
843
  title: `Confirm deleting template ${e.name}?`,
832
844
  message: "Deleted template can no longer be retrieved",
833
845
  primaryActions: {
@@ -841,35 +853,35 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
841
853
  close: !0
842
854
  }
843
855
  }).onPrimary(async () => {
844
- l.open({
856
+ o.open({
845
857
  title: `Deleting ${e.name}`,
846
858
  type: "info"
847
859
  });
848
860
  try {
849
- _.value = !0;
861
+ x.value = !0;
850
862
  const [T] = await Promise.allSettled([
851
- i.deleteTemplate(e),
863
+ m.deleteTemplate(e),
852
864
  new Promise((g) => setTimeout(g, 1e3))
853
865
  ]);
854
866
  if (T.status === "rejected") throw T.reason;
855
- l.open({
867
+ o.open({
856
868
  title: `Deleted ${e.name}`,
857
869
  type: "success"
858
870
  });
859
871
  } catch (T) {
860
- l.open({
872
+ o.open({
861
873
  title: `Unable to delete ${e.name}`,
862
874
  message: `See error from server: ${T}`,
863
875
  type: "error"
864
876
  }), console.error("error on deleting closing template", T);
865
877
  } finally {
866
- _.value = !1, I();
878
+ x.value = !1, S();
867
879
  }
868
880
  });
869
881
  }
870
- function a(e, _, I) {
882
+ function a(e, x, S) {
871
883
  let T;
872
- s.open({
884
+ l.open({
873
885
  title: `Confirm duplicating template "${e.name}"?`,
874
886
  message: "Duplicated template can be edited after creation",
875
887
  primaryActions: {
@@ -888,7 +900,7 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
888
900
  setup(g) {
889
901
  return () => R(B.FmTextField, {
890
902
  modelValue: g.modelValue,
891
- "onUpdate:modelValue": (x) => T = x,
903
+ "onUpdate:modelValue": (k) => T = k,
892
904
  label: "New Template Name",
893
905
  size: "md",
894
906
  variant: "primary"
@@ -896,175 +908,175 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
896
908
  }
897
909
  })
898
910
  }).onPrimary(async () => {
899
- l.open({
911
+ o.open({
900
912
  title: `Duplicating "${e.name}"`,
901
913
  type: "info"
902
914
  });
903
915
  try {
904
- _.value = !0;
916
+ x.value = !0;
905
917
  const [g] = await Promise.allSettled([
906
- n.duplicateClosingTemplate(e._id, T),
907
- new Promise((x) => setTimeout(x, 1e3))
918
+ t.duplicateClosingTemplate(e._id, T),
919
+ new Promise((k) => setTimeout(k, 1e3))
908
920
  ]);
909
921
  if (g.status === "rejected") throw g.reason;
910
- l.open({
922
+ o.open({
911
923
  title: `Duplicated "${e.name}"`,
912
924
  type: "success"
913
925
  });
914
926
  } catch (g) {
915
- l.open({
927
+ o.open({
916
928
  title: `Unable to duplicate "${e.name}"`,
917
929
  message: `See error from server: ${g}`,
918
930
  type: "error"
919
931
  }), console.error("error on duplicating closing template", g);
920
932
  } finally {
921
- _.value = !1, I();
933
+ x.value = !1, S();
922
934
  }
923
935
  });
924
936
  }
925
- const w = P({});
926
- function k(e) {
927
- w.value = {
937
+ const _ = P({});
938
+ function w(e) {
939
+ _.value = {
928
940
  template: e,
929
941
  show: !0,
930
- "onUpdate:show"(_) {
931
- w.value.show = _;
942
+ "onUpdate:show"(x) {
943
+ _.value.show = x;
932
944
  },
933
945
  "onAction:edit"() {
934
- w.value.show = !1, o(Ve(e));
946
+ _.value.show = !1, s(Ve(e));
935
947
  }
936
948
  };
937
949
  }
938
- function b() {
939
- if (!t.templates.length) {
940
- l.open({
950
+ function h() {
951
+ if (!n.templates.length) {
952
+ o.open({
941
953
  title: "No data to export",
942
954
  type: "error"
943
955
  });
944
956
  return;
945
957
  }
946
- const e = yt(t.templates);
947
- l.open({
948
- title: c("inventory.ingredient.export.success"),
949
- message: c("inventory.ingredient.export.filename", [e]),
958
+ const e = yt(n.templates);
959
+ o.open({
960
+ title: i("inventory.ingredient.export.success"),
961
+ message: i("inventory.ingredient.export.filename", [e]),
950
962
  type: "success"
951
963
  });
952
964
  }
953
- function m(e) {
965
+ function r(e) {
954
966
  if (!e.items.length) {
955
- l.open({
967
+ o.open({
956
968
  title: "No items in template to export",
957
969
  type: "error"
958
970
  });
959
971
  return;
960
972
  }
961
- const _ = ht(e);
962
- l.open({
963
- title: c("inventory.ingredient.export.success"),
964
- message: c("inventory.ingredient.export.filename", [_]),
973
+ const x = ht(e);
974
+ o.open({
975
+ title: i("inventory.ingredient.export.success"),
976
+ message: i("inventory.ingredient.export.filename", [x]),
965
977
  type: "success"
966
978
  });
967
979
  }
968
- function v() {
969
- t.loading || s.open({
970
- title: c("inventory.ingredient.import.title"),
980
+ function p() {
981
+ n.loading || l.open({
982
+ title: i("inventory.ingredient.import.title"),
971
983
  contentComponent: Ht,
972
984
  overlay: !0,
973
985
  closeButton: !0,
974
986
  primaryActions: {
975
- text: c("common.import"),
987
+ text: i("common.import"),
976
988
  close: !1
977
989
  },
978
990
  secondaryActions: {
979
- text: c("common.close"),
991
+ text: i("common.close"),
980
992
  close: !0
981
993
  },
982
994
  tertiaryActions: {
983
- text: c("inventory.ingredient.import.actions.downloadTemplate"),
995
+ text: i("inventory.ingredient.import.actions.downloadTemplate"),
984
996
  close: !1,
985
997
  variant: "plain"
986
998
  }
987
999
  }).onPrimary((e) => {
988
1000
  if (!e) {
989
- l.open({
990
- title: c("inventory.ingredient.import.error.noData"),
1001
+ o.open({
1002
+ title: i("inventory.ingredient.import.error.noData"),
991
1003
  type: "error"
992
1004
  });
993
1005
  return;
994
1006
  }
995
1007
  if (!e.importCreateResult.length && !e.importUpdateResult.length) {
996
- l.open({
997
- title: c("inventory.ingredient.import.error.invalidContent"),
998
- message: c("inventory.ingredient.import.error.noImportData"),
1008
+ o.open({
1009
+ title: i("inventory.ingredient.import.error.invalidContent"),
1010
+ message: i("inventory.ingredient.import.error.noImportData"),
999
1011
  type: "error"
1000
1012
  });
1001
1013
  return;
1002
1014
  }
1003
- if (e.importCreateResult.some((_) => _.errors.length) || e.importUpdateResult.some((_) => _.errors.length)) {
1004
- l.open({
1005
- title: c("inventory.ingredient.import.error.invalidContent"),
1006
- message: c("inventory.ingredient.import.error.hasErrors"),
1015
+ if (e.importCreateResult.some((x) => x.errors.length) || e.importUpdateResult.some((x) => x.errors.length)) {
1016
+ o.open({
1017
+ title: i("inventory.ingredient.import.error.invalidContent"),
1018
+ message: i("inventory.ingredient.import.error.hasErrors"),
1007
1019
  type: "error"
1008
1020
  });
1009
1021
  return;
1010
1022
  }
1011
- s.close(), u(e);
1023
+ l.close(), u(e);
1012
1024
  }).onTertiary(bt);
1013
1025
  }
1014
1026
  async function u(e) {
1015
- y.value = !0;
1027
+ d.value = !0;
1016
1028
  try {
1017
- const _ = [
1029
+ const x = [
1018
1030
  ...e.importCreateResult.map(
1019
- (x) => x.template
1031
+ (k) => k.template
1020
1032
  ),
1021
1033
  ...e.importUpdateResult.map(
1022
- (x) => x.template
1034
+ (k) => k.template
1023
1035
  )
1024
- ], I = 100;
1036
+ ], S = 100;
1025
1037
  let T = 0;
1026
1038
  const g = () => {
1027
- T += I, l.open({
1028
- title: c("inventory.ingredient.import.progress", [
1029
- Math.min(T, _.length),
1030
- _.length
1039
+ T += S, o.open({
1040
+ title: i("inventory.ingredient.import.progress", [
1041
+ Math.min(T, x.length),
1042
+ x.length
1031
1043
  ])
1032
1044
  });
1033
1045
  };
1034
- for (const x of _.chunk(100))
1035
- g(), await i.importTemplates(x);
1036
- l.open({
1037
- title: c("inventory.ingredient.import.success"),
1046
+ for (const k of x.chunk(100))
1047
+ g(), await m.importTemplates(k);
1048
+ o.open({
1049
+ title: i("inventory.ingredient.import.success"),
1038
1050
  type: "success"
1039
1051
  });
1040
- } catch (_) {
1041
- l.open({
1042
- title: c("inventory.ingredient.import.error.failed"),
1043
- message: c("inventory.ingredient.import.error.systemMessage", [_ == null ? void 0 : _.message]),
1052
+ } catch (x) {
1053
+ o.open({
1054
+ title: i("inventory.ingredient.import.error.failed"),
1055
+ message: i("inventory.ingredient.import.error.systemMessage", [x == null ? void 0 : x.message]),
1044
1056
  type: "error"
1045
- }), console.error("Error in importing skus", e, _);
1057
+ }), console.error("Error in importing skus", e, x);
1046
1058
  } finally {
1047
- y.value = !1, t.fetchTemplates();
1059
+ d.value = !1, n.fetchTemplates();
1048
1060
  }
1049
1061
  }
1050
1062
  return {
1051
- createTemplate: r,
1052
- viewTemplate: k,
1053
- updateTemplate: o,
1063
+ createTemplate: c,
1064
+ viewTemplate: w,
1065
+ updateTemplate: s,
1054
1066
  deleteTemplate: f,
1055
1067
  duplicateTemplate: a,
1056
- exportTemplates: b,
1057
- exportSingleTemplate: m,
1058
- importTemplates: v,
1059
- templateDialogProps: p,
1060
- templateDetailsProps: w
1068
+ exportTemplates: h,
1069
+ exportSingleTemplate: r,
1070
+ importTemplates: p,
1071
+ templateDialogProps: y,
1072
+ templateDetailsProps: _
1061
1073
  };
1062
1074
  });
1063
- var W = /* @__PURE__ */ ((c) => (c.Name = "Name", c.Unit = "Unit", c.Delete = "Delete", c))(W || {});
1064
- function jt(c) {
1075
+ var W = /* @__PURE__ */ ((i) => (i.Name = "Name", i.Unit = "Unit", i.Delete = "Delete", i))(W || {});
1076
+ function Ot(i) {
1065
1077
  return {
1066
1078
  columnDefs: V(() => {
1067
- const l = c.items.map((n) => n.sku.unit.measurements.length).reduce((n, t) => Math.max(n, t), 0);
1079
+ const o = i.items.map((t) => t.sku.unit.measurements.length).reduce((t, n) => Math.max(t, n), 0);
1068
1080
  return [
1069
1081
  {
1070
1082
  id: "Name",
@@ -1072,9 +1084,9 @@ function jt(c) {
1072
1084
  enableSorting: !1,
1073
1085
  size: 400,
1074
1086
  minSize: 400,
1075
- accessorFn: (n) => `${n.sku.name} ${n.sku.code}`,
1076
- cell(n) {
1077
- const t = n.row.original;
1087
+ accessorFn: (t) => `${t.sku.name} ${t.sku.code}`,
1088
+ cell(t) {
1089
+ const n = t.row.original;
1078
1090
  return R(
1079
1091
  "div",
1080
1092
  {
@@ -1085,12 +1097,12 @@ function jt(c) {
1085
1097
  R(
1086
1098
  "span",
1087
1099
  { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary line-clamp-1" },
1088
- t.sku.name
1100
+ n.sku.name
1089
1101
  ),
1090
1102
  R(
1091
1103
  "span",
1092
1104
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" },
1093
- t.sku.code
1105
+ n.sku.code
1094
1106
  )
1095
1107
  ]
1096
1108
  );
@@ -1102,15 +1114,15 @@ function jt(c) {
1102
1114
  enableSorting: !1,
1103
1115
  minSize: 200,
1104
1116
  maxSize: 400,
1105
- cell(n) {
1106
- var y, p, r;
1107
- const t = n.row.original;
1117
+ cell(t) {
1118
+ var d, y, c;
1119
+ const n = t.row.original;
1108
1120
  return R("div", { class: "flex items-center gap-32" }, [
1109
1121
  R(
1110
1122
  B.FmFormGroup,
1111
1123
  {
1112
- value: t.sku.unit._id,
1113
- modelValue: !((y = t.disabledMeasurements) != null && y.includes(t.sku.unit._id))
1124
+ value: n.sku.unit._id,
1125
+ modelValue: !((d = n.disabledMeasurements) != null && d.includes(n.sku.unit._id))
1114
1126
  },
1115
1127
  R(
1116
1128
  "div",
@@ -1120,28 +1132,28 @@ function jt(c) {
1120
1132
  },
1121
1133
  [
1122
1134
  R(B.FmCheckbox, {
1123
- value: t.sku.unit._id,
1124
- modelValue: !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)),
1125
- disabled: c.disabled || !((r = t.disabledMeasurements) != null && r.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
1126
- (o) => {
1135
+ value: n.sku.unit._id,
1136
+ modelValue: !((y = n.disabledMeasurements) != null && y.includes(n.sku.unit._id)),
1137
+ disabled: i.disabled || !((c = n.disabledMeasurements) != null && c.includes(n.sku.unit._id)) && n.sku.unit.measurements.every(
1138
+ (s) => {
1127
1139
  var f;
1128
- return (f = t.disabledMeasurements) == null ? void 0 : f.includes(o.id);
1140
+ return (f = n.disabledMeasurements) == null ? void 0 : f.includes(s.id);
1129
1141
  }
1130
1142
  ),
1131
- "onUpdate:modelValue"(o) {
1143
+ "onUpdate:modelValue"(s) {
1132
1144
  var f;
1133
- if (o)
1134
- c.updateItem({
1135
- ...t,
1136
- disabledMeasurements: (f = t.disabledMeasurements) == null ? void 0 : f.filter(
1137
- (a) => a !== t.sku.unit._id
1145
+ if (s)
1146
+ i.updateItem({
1147
+ ...n,
1148
+ disabledMeasurements: (f = n.disabledMeasurements) == null ? void 0 : f.filter(
1149
+ (a) => a !== n.sku.unit._id
1138
1150
  )
1139
1151
  });
1140
1152
  else {
1141
- const a = t.disabledMeasurements ?? [];
1142
- c.updateItem({
1143
- ...t,
1144
- disabledMeasurements: [...a, t.sku.unit._id]
1153
+ const a = n.disabledMeasurements ?? [];
1154
+ i.updateItem({
1155
+ ...n,
1156
+ disabledMeasurements: [...a, n.sku.unit._id]
1145
1157
  });
1146
1158
  }
1147
1159
  }
@@ -1151,13 +1163,13 @@ function jt(c) {
1151
1163
  { zIndex: 51 },
1152
1164
  {
1153
1165
  content() {
1154
- return t.sku.unit.abbrev;
1166
+ return n.sku.unit.abbrev;
1155
1167
  },
1156
1168
  default() {
1157
1169
  return R(
1158
1170
  "div",
1159
1171
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1160
- t.sku.unit.abbrev
1172
+ n.sku.unit.abbrev
1161
1173
  );
1162
1174
  }
1163
1175
  }
@@ -1165,14 +1177,14 @@ function jt(c) {
1165
1177
  ]
1166
1178
  )
1167
1179
  ),
1168
- ...Array.from({ length: Math.max(l, 0) }).map((o, f) => {
1169
- var k, b, m, v;
1170
- const a = n.row.original, w = a.sku.unit.measurements[f];
1171
- return w ? R(
1180
+ ...Array.from({ length: Math.max(o, 0) }).map((s, f) => {
1181
+ var w, h, r, p;
1182
+ const a = t.row.original, _ = a.sku.unit.measurements[f];
1183
+ return _ ? R(
1172
1184
  B.FmFormGroup,
1173
1185
  {
1174
- modelValue: !((k = a.disabledMeasurements) != null && k.includes(w.id)),
1175
- value: w.id
1186
+ modelValue: !((w = a.disabledMeasurements) != null && w.includes(_.id)),
1187
+ value: _.id
1176
1188
  },
1177
1189
  R(
1178
1190
  "div",
@@ -1182,26 +1194,26 @@ function jt(c) {
1182
1194
  },
1183
1195
  [
1184
1196
  R(B.FmCheckbox, {
1185
- value: w.id,
1186
- modelValue: !((b = a.disabledMeasurements) != null && b.includes(w.id)),
1187
- disabled: c.disabled || !((m = a.disabledMeasurements) != null && m.includes(w.id)) && ((v = a.disabledMeasurements) == null ? void 0 : v.includes(a.sku.unit._id)) && a.sku.unit.measurements.filter((u) => u.id != w.id).every((u) => {
1197
+ value: _.id,
1198
+ modelValue: !((h = a.disabledMeasurements) != null && h.includes(_.id)),
1199
+ disabled: i.disabled || !((r = a.disabledMeasurements) != null && r.includes(_.id)) && ((p = a.disabledMeasurements) == null ? void 0 : p.includes(a.sku.unit._id)) && a.sku.unit.measurements.filter((u) => u.id != _.id).every((u) => {
1188
1200
  var e;
1189
1201
  return (e = a.disabledMeasurements) == null ? void 0 : e.includes(u.id);
1190
1202
  }),
1191
1203
  "onUpdate:modelValue"(u) {
1192
1204
  var e;
1193
1205
  if (u)
1194
- c.updateItem({
1206
+ i.updateItem({
1195
1207
  ...a,
1196
1208
  disabledMeasurements: (e = a.disabledMeasurements) == null ? void 0 : e.filter(
1197
- (_) => _ !== w.id
1209
+ (x) => x !== _.id
1198
1210
  )
1199
1211
  });
1200
1212
  else {
1201
- const _ = a.disabledMeasurements ?? [];
1202
- c.updateItem({
1213
+ const x = a.disabledMeasurements ?? [];
1214
+ i.updateItem({
1203
1215
  ...a,
1204
- disabledMeasurements: [..._, w.id]
1216
+ disabledMeasurements: [...x, _.id]
1205
1217
  });
1206
1218
  }
1207
1219
  }
@@ -1211,13 +1223,13 @@ function jt(c) {
1211
1223
  { zIndex: 51 },
1212
1224
  {
1213
1225
  content() {
1214
- return w.abbrev;
1226
+ return _.abbrev;
1215
1227
  },
1216
1228
  default() {
1217
1229
  return R(
1218
1230
  "div",
1219
1231
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1220
- w.abbrev
1232
+ _.abbrev
1221
1233
  );
1222
1234
  }
1223
1235
  }
@@ -1232,21 +1244,21 @@ function jt(c) {
1232
1244
  {
1233
1245
  id: "Delete",
1234
1246
  header: "",
1235
- cell(n) {
1236
- const t = n.row.original;
1247
+ cell(t) {
1248
+ const n = t.row.original;
1237
1249
  return R(
1238
1250
  "div",
1239
1251
  { class: "w-full flex justify-end" },
1240
1252
  R(B.FmButton, {
1241
1253
  class: "delete-button",
1242
- key: t.sku._id,
1254
+ key: n.sku._id,
1243
1255
  type: "button",
1244
1256
  icon: "delete",
1245
1257
  variant: "tertiary",
1246
1258
  size: "md",
1247
- disabled: c.disabled,
1259
+ disabled: i.disabled,
1248
1260
  onClick: () => {
1249
- c.deleteItem(t);
1261
+ i.deleteItem(n);
1250
1262
  }
1251
1263
  })
1252
1264
  );
@@ -1262,41 +1274,41 @@ function jt(c) {
1262
1274
  })
1263
1275
  };
1264
1276
  }
1265
- const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt = { class: "flex-1 flex flex-col" }, Gt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, Wt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, qt = { class: "flex flex-col gap-4" }, Jt = /* @__PURE__ */ H({
1277
+ const jt = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt = { class: "flex-1 flex flex-col" }, Gt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, Wt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, qt = { class: "flex flex-col gap-4" }, Jt = /* @__PURE__ */ H({
1266
1278
  __name: "ClosingTemplateItem",
1267
1279
  props: {
1268
1280
  cellByColId: {},
1269
1281
  row: {}
1270
1282
  },
1271
- setup(c) {
1272
- const s = c, l = V(() => s.row), i = V(
1273
- () => l.value.getVisibleCells().filter((n) => n.column.id !== W.Name && n.column.id !== W.Delete)
1283
+ setup(i) {
1284
+ const l = i, o = V(() => l.row), m = V(
1285
+ () => o.value.getVisibleCells().filter((t) => t.column.id !== W.Name && t.column.id !== W.Delete)
1274
1286
  );
1275
- return (n, t) => {
1276
- var y, p, r, o, f;
1277
- return $(), M("div", Ot, [
1278
- h("div", Yt, [
1279
- h("div", Kt, [
1280
- h("div", Gt, S(l.value.original.sku.name), 1),
1281
- h("div", Wt, S(l.value.original.sku.code), 1)
1287
+ return (t, n) => {
1288
+ var d, y, c, s, f;
1289
+ return $(), M("div", jt, [
1290
+ b("div", Yt, [
1291
+ b("div", Kt, [
1292
+ b("div", Gt, I(o.value.original.sku.name), 1),
1293
+ b("div", Wt, I(o.value.original.sku.code), 1)
1282
1294
  ]),
1283
- h("div", null, [
1284
- C(d(K), {
1285
- render: (r = (p = (y = n.cellByColId[d(W).Delete]) == null ? void 0 : y.column) == null ? void 0 : p.columnDef) == null ? void 0 : r.cell,
1286
- props: (f = (o = n.cellByColId[d(W).Delete]) == null ? void 0 : o.getContext) == null ? void 0 : f.call(o)
1295
+ b("div", null, [
1296
+ C(v(K), {
1297
+ render: (c = (y = (d = t.cellByColId[v(W).Delete]) == null ? void 0 : d.column) == null ? void 0 : y.columnDef) == null ? void 0 : c.cell,
1298
+ props: (f = (s = t.cellByColId[v(W).Delete]) == null ? void 0 : s.getContext) == null ? void 0 : f.call(s)
1287
1299
  }, null, 8, ["render", "props"])
1288
1300
  ])
1289
1301
  ]),
1290
- h("div", qt, [
1291
- t[0] || (t[0] = h("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
1292
- ($(!0), M(O, null, q(i.value, (a) => {
1293
- var w, k, b;
1302
+ b("div", qt, [
1303
+ n[0] || (n[0] = b("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
1304
+ ($(!0), M(j, null, q(m.value, (a) => {
1305
+ var _, w, h;
1294
1306
  return $(), M("div", {
1295
1307
  key: a.id
1296
1308
  }, [
1297
- C(d(K), {
1298
- render: (k = (w = a.column) == null ? void 0 : w.columnDef) == null ? void 0 : k.cell,
1299
- props: (b = a.getContext) == null ? void 0 : b.call(a)
1309
+ C(v(K), {
1310
+ render: (w = (_ = a.column) == null ? void 0 : _.columnDef) == null ? void 0 : w.cell,
1311
+ props: (h = a.getContext) == null ? void 0 : h.call(a)
1300
1312
  }, null, 8, ["render", "props"])
1301
1313
  ]);
1302
1314
  }), 128))
@@ -1310,130 +1322,130 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
1310
1322
  modelValue: {},
1311
1323
  disabled: { type: Boolean }
1312
1324
  },
1313
- setup(c, { expose: s }) {
1314
- const l = c, i = lt(), { t: n } = j(), t = de();
1325
+ setup(i, { expose: l }) {
1326
+ const o = i, m = lt(), { t } = O(), n = de();
1315
1327
  se();
1316
1328
  const {
1317
- promptSelectLocations: y,
1318
- columnDefs: p,
1319
- rowData: r
1329
+ promptSelectLocations: d,
1330
+ columnDefs: y,
1331
+ rowData: c
1320
1332
  } = at({
1321
1333
  getLocations() {
1322
- return i.locations;
1334
+ return m.locations;
1323
1335
  },
1324
1336
  setLocations(u) {
1325
- i.locations = u;
1337
+ m.locations = u;
1326
1338
  }
1327
- }), o = P(), f = P(""), a = P(!1), w = P(null);
1328
- s({
1339
+ }), s = P(), f = P(""), a = P(!1), _ = P(null);
1340
+ l({
1329
1341
  validateInputs: () => {
1330
1342
  var u, e;
1331
- (e = (u = o.value) == null ? void 0 : u.validateInputs) == null || e.call(u);
1343
+ (e = (u = s.value) == null ? void 0 : u.validateInputs) == null || e.call(u);
1332
1344
  },
1333
1345
  resetInputsValidation: () => {
1334
1346
  var u, e;
1335
- (e = (u = o.value) == null ? void 0 : u.resetInputsValidation) == null || e.call(u);
1347
+ (e = (u = s.value) == null ? void 0 : u.resetInputsValidation) == null || e.call(u);
1336
1348
  },
1337
1349
  resetInputs: () => {
1338
1350
  var u, e;
1339
- (e = (u = o.value) == null ? void 0 : u.resetInputs) == null || e.call(u);
1351
+ (e = (u = s.value) == null ? void 0 : u.resetInputs) == null || e.call(u);
1340
1352
  }
1341
1353
  });
1342
- const k = jt({
1354
+ const w = Ot({
1343
1355
  updateItem: (u) => {
1344
- i.items = i.items.map((e) => e.sku._id !== u.sku._id ? e : u);
1356
+ m.items = m.items.map((e) => e.sku._id !== u.sku._id ? e : u);
1345
1357
  },
1346
1358
  deleteItem: (u) => {
1347
- i.items = i.items.filter((e) => e.sku._id !== u.sku._id);
1359
+ m.items = m.items.filter((e) => e.sku._id !== u.sku._id);
1348
1360
  },
1349
1361
  get items() {
1350
- return i.items;
1362
+ return m.items;
1351
1363
  },
1352
1364
  get disabled() {
1353
- return l.disabled;
1365
+ return o.disabled;
1354
1366
  }
1355
- }), b = V(() => k.columnDefs.value), { promptSelectIngredients: m } = gt();
1356
- async function v() {
1357
- const e = t.skus.map((T) => ({
1367
+ }), h = V(() => w.columnDefs.value), { promptSelectIngredients: r } = gt();
1368
+ async function p() {
1369
+ const e = n.skus.map((T) => ({
1358
1370
  label: T.name,
1359
1371
  sublabel: T.code,
1360
1372
  value: T
1361
1373
  })).filter((T) => {
1362
1374
  var g;
1363
- return (g = i.items) == null ? void 0 : g.find((x) => x.sku._id === T.value._id);
1364
- }).map((T) => T.value), _ = i.items ?? [], I = await m(
1375
+ return (g = m.items) == null ? void 0 : g.find((k) => k.sku._id === T.value._id);
1376
+ }).map((T) => T.value), x = m.items ?? [], S = await r(
1365
1377
  e.map((T) => T._id),
1366
1378
  (T) => {
1367
- const g = t.skuById[T], x = _.find((D) => D.sku._id === g._id);
1368
- return x || {
1379
+ const g = n.skuById[T], k = x.find((D) => D.sku._id === g._id);
1380
+ return k || {
1369
1381
  sku: g
1370
1382
  };
1371
1383
  }
1372
1384
  );
1373
- I && (I.sort((T, g) => T.sku.code.localeCompare(g.sku.code)), i.items = I);
1385
+ S && (S.sort((T, g) => T.sku.code.localeCompare(g.sku.code)), m.items = S);
1374
1386
  }
1375
1387
  return (u, e) => {
1376
- const _ = A("FmTextField"), I = A("FmButton"), T = A("FmTable"), g = A("FmIcon"), x = A("FmFormGroup"), F = A("FmForm");
1388
+ const x = A("FmTextField"), S = A("FmButton"), T = A("FmTable"), g = A("FmIcon"), k = A("FmFormGroup"), F = A("FmForm");
1377
1389
  return $(), N(F, {
1378
1390
  ref_key: "formRef",
1379
- ref: o,
1391
+ ref: s,
1380
1392
  class: "flex flex-col gap-32",
1381
1393
  disabled: u.disabled
1382
1394
  }, {
1383
1395
  default: E(() => [
1384
- h("div", Xt, [
1385
- h("div", Qt, [
1386
- C(_, {
1387
- label: d(n)("inventory.closing.form.name"),
1396
+ b("div", Xt, [
1397
+ b("div", Qt, [
1398
+ C(x, {
1399
+ label: v(t)("inventory.closing.form.name"),
1388
1400
  "label-mark": "required",
1389
- modelValue: d(i).name,
1390
- "onUpdate:modelValue": e[0] || (e[0] = (D) => d(i).name = D),
1391
- rules: [d(rt)()]
1401
+ modelValue: v(m).name,
1402
+ "onUpdate:modelValue": e[0] || (e[0] = (D) => v(m).name = D),
1403
+ rules: [v(rt)()]
1392
1404
  }, null, 8, ["label", "modelValue", "rules"]),
1393
- C(_, {
1394
- label: d(n)("inventory.closing.form.reference"),
1405
+ C(x, {
1406
+ label: v(t)("inventory.closing.form.reference"),
1395
1407
  "label-mark": "optional",
1396
- modelValue: d(i).ref,
1397
- "onUpdate:modelValue": e[1] || (e[1] = (D) => d(i).ref = D)
1408
+ modelValue: v(m).ref,
1409
+ "onUpdate:modelValue": e[1] || (e[1] = (D) => v(m).ref = D)
1398
1410
  }, null, 8, ["label", "modelValue"])
1399
1411
  ])
1400
1412
  ]),
1401
- h("div", Zt, [
1402
- h("div", en, [
1403
- h("div", tn, S(d(n)("inventory.closing.form.locations")), 1),
1404
- C(I, {
1413
+ b("div", Zt, [
1414
+ b("div", en, [
1415
+ b("div", tn, I(v(t)("inventory.closing.form.locations")), 1),
1416
+ C(S, {
1405
1417
  disabled: u.disabled,
1406
- label: d(n)("inventory.closing.form.selectLocation"),
1418
+ label: v(t)("inventory.closing.form.selectLocation"),
1407
1419
  "prepend-icon": "add",
1408
1420
  variant: "plain",
1409
1421
  class: "border-2 rounded-lg border-fm-color-primary",
1410
- onClick: d(y)
1422
+ onClick: v(d)
1411
1423
  }, null, 8, ["disabled", "label", "onClick"])
1412
1424
  ]),
1413
1425
  C(T, {
1414
- "column-defs": d(p),
1415
- "row-data": d(r),
1426
+ "column-defs": v(y),
1427
+ "row-data": v(c),
1416
1428
  "shrink-at": 9999,
1417
- onRowClick: d(y),
1429
+ onRowClick: v(d),
1418
1430
  "hide-footer": ""
1419
1431
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
1420
1432
  ]),
1421
- h("div", nn, [
1422
- h("div", on, [
1423
- h("div", sn, S(d(n)("inventory.closing.form.items.title")), 1),
1424
- h("div", ln, [
1425
- C(I, {
1433
+ b("div", nn, [
1434
+ b("div", on, [
1435
+ b("div", sn, I(v(t)("inventory.closing.form.items.title")), 1),
1436
+ b("div", ln, [
1437
+ C(S, {
1426
1438
  disabled: u.disabled || a.value,
1427
- label: d(n)("inventory.closing.form.items.addItem"),
1439
+ label: v(t)("inventory.closing.form.items.addItem"),
1428
1440
  "prepend-icon": "add",
1429
1441
  variant: "plain",
1430
1442
  class: "border-2 rounded-lg border-fm-color-primary",
1431
- onClick: e[2] || (e[2] = (D) => v()),
1443
+ onClick: e[2] || (e[2] = (D) => p()),
1432
1444
  size: "md"
1433
1445
  }, null, 8, ["disabled", "label"])
1434
1446
  ])
1435
1447
  ]),
1436
- C(_, {
1448
+ C(x, {
1437
1449
  placeholder: "Filter items",
1438
1450
  modelValue: f.value,
1439
1451
  "onUpdate:modelValue": e[4] || (e[4] = (D) => f.value = D),
@@ -1451,31 +1463,31 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
1451
1463
  key: "0"
1452
1464
  } : void 0
1453
1465
  ]), 1032, ["modelValue", "disabled"]),
1454
- h("div", {
1466
+ b("div", {
1455
1467
  ref_key: "itemsTableRef",
1456
- ref: w
1468
+ ref: _
1457
1469
  }, [
1458
1470
  ($(), N(T, {
1459
1471
  "search-value": a.value ? "" : f.value,
1460
- "column-defs": b.value,
1461
- "row-data": d(i).items,
1462
- key: d(i).items.map((D) => D.sku._id).join("."),
1463
- "hide-footer": d(i).items.length <= 10,
1464
- "page-size": a.value ? d(i).items.length : Math.min(10, d(i).items.length)
1472
+ "column-defs": h.value,
1473
+ "row-data": v(m).items,
1474
+ key: v(m).items.map((D) => D.sku._id).join("."),
1475
+ "hide-footer": v(m).items.length <= 10,
1476
+ "page-size": a.value ? v(m).items.length : Math.min(10, v(m).items.length)
1465
1477
  }, {
1466
1478
  "list-row": E((D) => [
1467
1479
  ($(), N(Le, {
1468
1480
  row: D,
1469
- key: d(i).items.map((L) => L.sku._id).join(".")
1481
+ key: v(m).items.map((L) => L.sku._id).join(".")
1470
1482
  }, {
1471
1483
  default: E((L) => [
1472
- h("div", an, [
1484
+ b("div", an, [
1473
1485
  a.value ? ($(), N(g, {
1474
1486
  key: 0,
1475
1487
  name: "drag_indicator",
1476
1488
  class: "drag-handle cursor-move text-fm-color-typo-secondary"
1477
1489
  })) : Y("", !0),
1478
- h("div", rn, [
1490
+ b("div", rn, [
1479
1491
  C(Jt, {
1480
1492
  row: D,
1481
1493
  "cell-by-col-id": L
@@ -1489,9 +1501,9 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
1489
1501
  _: 1
1490
1502
  }, 8, ["search-value", "column-defs", "row-data", "hide-footer", "page-size"]))
1491
1503
  ], 512),
1492
- C(x, {
1493
- "model-value": d(i).items.length,
1494
- rules: [d(it)(1)]
1504
+ C(k, {
1505
+ "model-value": v(m).items.length,
1506
+ rules: [v(it)(1)]
1495
1507
  }, null, 8, ["model-value", "rules"])
1496
1508
  ])
1497
1509
  ]),
@@ -1507,9 +1519,9 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
1507
1519
  show: { type: Boolean }
1508
1520
  },
1509
1521
  emits: ["update:show", "submitted"],
1510
- setup(c, { expose: s, emit: l }) {
1522
+ setup(i, { expose: l, emit: o }) {
1511
1523
  var T;
1512
- const i = c, n = l, t = ae(), y = oe(), p = le(), { t: r } = j(), o = ft(i, "show");
1524
+ const m = i, t = o, n = ae(), d = oe(), y = le(), { t: c } = O(), s = ft(m, "show");
1513
1525
  function f() {
1514
1526
  return {
1515
1527
  _id: "",
@@ -1517,145 +1529,145 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
1517
1529
  items: []
1518
1530
  };
1519
1531
  }
1520
- const a = P(i.modelValue ?? f()), w = P(((T = i.modelValue) == null ? void 0 : T._id) ?? `${Math.random()}`);
1532
+ const a = P(m.modelValue ?? f()), _ = P(((T = m.modelValue) == null ? void 0 : T._id) ?? `${Math.random()}`);
1521
1533
  Ae(
1522
- () => i.show,
1534
+ () => m.show,
1523
1535
  (g) => {
1524
- var x;
1525
- g && (a.value = i.modelValue ?? f(), w.value = ((x = i.modelValue) == null ? void 0 : x._id) ?? `${Math.random()}`);
1536
+ var k;
1537
+ g && (a.value = m.modelValue ?? f(), _.value = ((k = m.modelValue) == null ? void 0 : k._id) ?? `${Math.random()}`);
1526
1538
  }
1527
1539
  );
1528
- const k = P(!1), b = V(() => {
1529
- switch (i.mode) {
1540
+ const w = P(!1), h = V(() => {
1541
+ switch (m.mode) {
1530
1542
  case z.READ:
1531
1543
  return "";
1532
1544
  case z.CREATE:
1533
- return r("inventory.closing.template.create.title");
1545
+ return c("inventory.closing.template.create.title");
1534
1546
  case z.UPDATE:
1535
- return r("inventory.closing.template.update.title");
1547
+ return c("inventory.closing.template.update.title");
1536
1548
  }
1537
1549
  return "";
1538
- }), m = P();
1539
- s({
1550
+ }), r = P();
1551
+ l({
1540
1552
  validateInputs: () => {
1541
- var g, x;
1542
- (x = (g = m.value) == null ? void 0 : g.validateInputs) == null || x.call(g);
1553
+ var g, k;
1554
+ (k = (g = r.value) == null ? void 0 : g.validateInputs) == null || k.call(g);
1543
1555
  },
1544
1556
  resetInputsValidation: () => {
1545
- var g, x;
1546
- (x = (g = m.value) == null ? void 0 : g.resetInputsValidation) == null || x.call(g);
1557
+ var g, k;
1558
+ (k = (g = r.value) == null ? void 0 : g.resetInputsValidation) == null || k.call(g);
1547
1559
  },
1548
1560
  resetInputs: () => {
1549
- var g, x;
1550
- (x = (g = m.value) == null ? void 0 : g.resetInputs) == null || x.call(g);
1561
+ var g, k;
1562
+ (k = (g = r.value) == null ? void 0 : g.resetInputs) == null || k.call(g);
1551
1563
  }
1552
1564
  });
1553
- async function v() {
1565
+ async function p() {
1554
1566
  const g = a.value;
1555
1567
  if (g) {
1556
- k.value = !0;
1568
+ w.value = !0;
1557
1569
  try {
1558
- await t.createTemplate(g), await new Promise((x) => setTimeout(x, 1e3)), p.open({
1559
- title: r("inventory.closing.template.create.success"),
1560
- message: r("inventory.closing.template.create.successMessage"),
1570
+ await n.createTemplate(g), await new Promise((k) => setTimeout(k, 1e3)), y.open({
1571
+ title: c("inventory.closing.template.create.success"),
1572
+ message: c("inventory.closing.template.create.successMessage"),
1561
1573
  type: "success"
1562
- }), n("update:show", !1), n("submitted");
1563
- } catch (x) {
1564
- p.open({
1565
- title: r("inventory.closing.template.create.error"),
1566
- message: r("inventory.closing.template.create.errorMessage"),
1574
+ }), t("update:show", !1), t("submitted");
1575
+ } catch (k) {
1576
+ y.open({
1577
+ title: c("inventory.closing.template.create.error"),
1578
+ message: c("inventory.closing.template.create.errorMessage"),
1567
1579
  type: "error"
1568
- }), console.error("Error in creating closing template", x);
1580
+ }), console.error("Error in creating closing template", k);
1569
1581
  } finally {
1570
- k.value = !1;
1582
+ w.value = !1;
1571
1583
  }
1572
1584
  }
1573
1585
  }
1574
1586
  async function u() {
1575
1587
  const g = a.value;
1576
1588
  if (g) {
1577
- k.value = !0;
1589
+ w.value = !0;
1578
1590
  try {
1579
- await t.updateTemplate({
1591
+ await n.updateTemplate({
1580
1592
  ...g,
1581
1593
  _rev: g._rev ?? ""
1582
- }), await new Promise((x) => setTimeout(x, 1e3)), p.open({
1583
- title: r("inventory.closing.template.update.success"),
1584
- message: r("inventory.closing.template.update.successMessage"),
1594
+ }), await new Promise((k) => setTimeout(k, 1e3)), y.open({
1595
+ title: c("inventory.closing.template.update.success"),
1596
+ message: c("inventory.closing.template.update.successMessage"),
1585
1597
  type: "success"
1586
- }), n("update:show", !1), n("submitted");
1587
- } catch (x) {
1588
- p.open({
1589
- title: r("inventory.closing.template.update.error"),
1590
- message: r("inventory.closing.template.update.errorMessage"),
1598
+ }), t("update:show", !1), t("submitted");
1599
+ } catch (k) {
1600
+ y.open({
1601
+ title: c("inventory.closing.template.update.error"),
1602
+ message: c("inventory.closing.template.update.errorMessage"),
1591
1603
  type: "error"
1592
- }), console.error("Error in updating closing template", x);
1604
+ }), console.error("Error in updating closing template", k);
1593
1605
  } finally {
1594
- k.value = !1;
1606
+ w.value = !1;
1595
1607
  }
1596
1608
  }
1597
1609
  }
1598
1610
  function e() {
1599
- switch (i.mode) {
1611
+ switch (m.mode) {
1600
1612
  case z.CREATE:
1601
- return v();
1613
+ return p();
1602
1614
  case z.UPDATE:
1603
1615
  return u();
1604
1616
  }
1605
1617
  }
1606
- function _() {
1607
- var g, x;
1608
- (x = (g = m.value) == null ? void 0 : g.validateInputs) == null || x.call(g);
1618
+ function x() {
1619
+ var g, k;
1620
+ (k = (g = r.value) == null ? void 0 : g.validateInputs) == null || k.call(g);
1609
1621
  }
1610
- function I() {
1611
- a.value && y.exportSingleTemplate(a.value);
1622
+ function S() {
1623
+ a.value && d.exportSingleTemplate(a.value);
1612
1624
  }
1613
- return (g, x) => {
1625
+ return (g, k) => {
1614
1626
  const F = A("FmButton"), D = A("FmSideSheet");
1615
1627
  return $(), N(D, {
1616
- modelValue: d(o),
1617
- "onUpdate:modelValue": x[2] || (x[2] = (L) => Ye(o) ? o.value = L : null),
1628
+ modelValue: v(s),
1629
+ "onUpdate:modelValue": k[2] || (k[2] = (L) => Ye(s) ? s.value = L : null),
1618
1630
  "dismiss-away": "",
1619
1631
  "close-button": "",
1620
1632
  "max-width": 800
1621
1633
  }, {
1622
1634
  "side-sheet-header": E(() => [
1623
- h("div", mn, [
1624
- h("div", un, S(b.value), 1)
1635
+ b("div", mn, [
1636
+ b("div", un, I(h.value), 1)
1625
1637
  ])
1626
1638
  ]),
1627
1639
  default: E(() => [
1628
1640
  ($(), N(cn, {
1629
1641
  class: "w-full",
1630
1642
  ref_key: "formRef",
1631
- ref: m,
1643
+ ref: r,
1632
1644
  onValidationSuccess: e,
1633
1645
  "model-value": a.value,
1634
- "onUpdate:modelValue": x[0] || (x[0] = (L) => a.value = L),
1635
- disabled: k.value,
1636
- key: w.value
1646
+ "onUpdate:modelValue": k[0] || (k[0] = (L) => a.value = L),
1647
+ disabled: w.value,
1648
+ key: _.value
1637
1649
  }, null, 8, ["model-value", "disabled"]))
1638
1650
  ]),
1639
1651
  "side-sheet-footer": E(() => [
1640
- h("div", dn, [
1652
+ b("div", dn, [
1641
1653
  C(F, {
1642
- loading: k.value,
1643
- label: d(r)("common.save"),
1644
- onClick: _
1654
+ loading: w.value,
1655
+ label: v(c)("common.save"),
1656
+ onClick: x
1645
1657
  }, null, 8, ["loading", "label"]),
1646
- g.mode === d(z).UPDATE ? ($(), N(F, {
1658
+ g.mode === v(z).UPDATE ? ($(), N(F, {
1647
1659
  key: 0,
1648
- disabled: k.value,
1660
+ disabled: w.value,
1649
1661
  variant: "secondary",
1650
- label: d(r)("inventory.common.export"),
1662
+ label: v(c)("inventory.common.export"),
1651
1663
  "prepend-icon": "download",
1652
- onClick: I
1664
+ onClick: S
1653
1665
  }, null, 8, ["disabled", "label"])) : Y("", !0),
1654
1666
  C(F, {
1655
- disabled: k.value,
1667
+ disabled: w.value,
1656
1668
  variant: "tertiary",
1657
- label: d(r)("common.close"),
1658
- onClick: x[1] || (x[1] = (L) => n("update:show", !1))
1669
+ label: v(c)("common.close"),
1670
+ onClick: k[1] || (k[1] = (L) => t("update:show", !1))
1659
1671
  }, null, 8, ["disabled", "label"])
1660
1672
  ])
1661
1673
  ]),
@@ -1664,7 +1676,7 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
1664
1676
  };
1665
1677
  }
1666
1678
  }), fn = {};
1667
- function vn(c, s) {
1679
+ function vn(i, l) {
1668
1680
  return $(), M("div");
1669
1681
  }
1670
1682
  const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-col gap-40" }, hn = { key: 0 }, bn = {
@@ -1676,90 +1688,90 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
1676
1688
  }, wn = {
1677
1689
  key: 3,
1678
1690
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
1679
- }, kn = { class: "fm-typo-en-body-md-600" }, Tn = { class: "fm-typo-en-body-md-600" }, $n = { key: 4 }, Cn = { class: "fm-typo-en-body-md-600" }, In = { class: "fm-typo-en-body-md-600" }, Sn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Dn = /* @__PURE__ */ H({
1691
+ }, kn = { class: "fm-typo-en-body-md-600" }, Tn = { class: "fm-typo-en-body-md-600" }, $n = { key: 4 }, Cn = { class: "fm-typo-en-body-md-600" }, Sn = { class: "fm-typo-en-body-md-600" }, In = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Dn = /* @__PURE__ */ H({
1680
1692
  __name: "ClosingTemplatePublish",
1681
1693
  emits: ["close"],
1682
- setup(c, { emit: s }) {
1683
- const l = P(!1), i = le(), n = ae(), t = re(), { t: y } = j(), p = s;
1684
- async function r() {
1685
- l.value = !0;
1694
+ setup(i, { emit: l }) {
1695
+ const o = P(!1), m = le(), t = ae(), n = re(), { t: d } = O(), y = l;
1696
+ async function c() {
1697
+ o.value = !0;
1686
1698
  try {
1687
- await n.startNewPublish().delayed(1e3), i.open({
1699
+ await t.startNewPublish().delayed(1e3), m.open({
1688
1700
  title: "Success",
1689
1701
  message: "You may refresh after a while to review publish status",
1690
1702
  type: "success"
1691
1703
  }), a();
1692
- } catch (w) {
1693
- i.open({
1704
+ } catch (_) {
1705
+ m.open({
1694
1706
  title: "Something went wrong",
1695
1707
  message: "Please try again",
1696
1708
  type: "error"
1697
- }), console.error("error on creating publish task", w);
1709
+ }), console.error("error on creating publish task", _);
1698
1710
  } finally {
1699
- l.value = !1;
1711
+ o.value = !1;
1700
1712
  }
1701
1713
  }
1702
- const o = V(() => t.recentPublish.recentJob), f = V(
1703
- () => t.templates.length && (!o.value || o.value.outlets.length === o.value.completed.length)
1714
+ const s = V(() => n.recentPublish.recentJob), f = V(
1715
+ () => n.templates.length && (!s.value || s.value.outlets.length === s.value.completed.length)
1704
1716
  );
1705
1717
  function a() {
1706
- p("close");
1718
+ y("close");
1707
1719
  }
1708
- return (w, k) => {
1709
- const b = A("FmCircularProgress"), m = A("i18n-t"), v = A("FmButton");
1720
+ return (_, w) => {
1721
+ const h = A("FmCircularProgress"), r = A("i18n-t"), p = A("FmButton");
1710
1722
  return $(), M("div", yn, [
1711
- d(t).templates.length ? l.value ? ($(), M("div", bn, [
1712
- h("div", null, [
1713
- C(b, {
1723
+ v(n).templates.length ? o.value ? ($(), M("div", bn, [
1724
+ b("div", null, [
1725
+ C(h, {
1714
1726
  size: "md",
1715
1727
  color: "neutral-gray-300"
1716
1728
  })
1717
1729
  ]),
1718
- h("div", _n, [
1719
- h("span", null, S(d(y)("inventory.closing.template.publish.publishing")), 1)
1730
+ b("div", _n, [
1731
+ b("span", null, I(v(d)("inventory.closing.template.publish.publishing")), 1)
1720
1732
  ])
1721
- ])) : o.value ? o.value.outlets.length === o.value.completed.length ? ($(), M("div", wn, [
1722
- C(m, {
1733
+ ])) : s.value ? s.value.outlets.length === s.value.completed.length ? ($(), M("div", wn, [
1734
+ C(r, {
1723
1735
  keypath: "inventory.closing.template.publish.recentlyPublishedAt",
1724
1736
  tag: "p"
1725
1737
  }, {
1726
1738
  started: E(() => [
1727
- h("span", kn, S(d(ie)(new Date(o.value.createdAt))), 1)
1739
+ b("span", kn, I(v(ie)(new Date(s.value.createdAt))), 1)
1728
1740
  ]),
1729
1741
  finished: E(() => [
1730
- h("span", Tn, S(d(ie)(new Date(o.value.updatedAt))), 1)
1742
+ b("span", Tn, I(v(ie)(new Date(s.value.updatedAt))), 1)
1731
1743
  ]),
1732
1744
  _: 1
1733
1745
  }),
1734
- h("p", null, S(d(y)("inventory.closing.template.publish.message")), 1)
1746
+ b("p", null, I(v(d)("inventory.closing.template.publish.message")), 1)
1735
1747
  ])) : ($(), M("div", $n, [
1736
- C(m, {
1748
+ C(r, {
1737
1749
  keypath: "inventory.closing.template.publish.stillPublishing",
1738
1750
  tag: "p"
1739
1751
  }, {
1740
1752
  started: E(() => [
1741
- h("span", Cn, S(d(ie)(new Date(o.value.createdAt))), 1)
1753
+ b("span", Cn, I(v(ie)(new Date(s.value.createdAt))), 1)
1742
1754
  ]),
1743
1755
  progress: E(() => [
1744
- h("span", In, " (" + S(o.value.completed.length) + "/" + S(o.value.outlets.length) + " completed) ", 1)
1756
+ b("span", Sn, " (" + I(s.value.completed.length) + "/" + I(s.value.outlets.length) + " completed) ", 1)
1745
1757
  ]),
1746
1758
  _: 1
1747
1759
  }),
1748
- Fe(" Your recent publishing task is still pending (" + S(o.value.completed.length) + " / " + S(o.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1760
+ Fe(" Your recent publishing task is still pending (" + I(s.value.completed.length) + " / " + I(s.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1749
1761
  ])) : ($(), M("div", xn, [
1750
- h("p", null, S(d(y)("inventory.closing.template.publish.noRecentActivity")), 1),
1751
- h("p", null, S(d(y)("inventory.closing.template.publish.message")), 1)
1762
+ b("p", null, I(v(d)("inventory.closing.template.publish.noRecentActivity")), 1),
1763
+ b("p", null, I(v(d)("inventory.closing.template.publish.message")), 1)
1752
1764
  ])) : ($(), M("div", hn, [
1753
- h("p", null, S(d(y)("inventory.closing.template.publish.nothingToPublish")), 1)
1765
+ b("p", null, I(v(d)("inventory.closing.template.publish.nothingToPublish")), 1)
1754
1766
  ])),
1755
- h("div", Sn, [
1756
- C(v, {
1767
+ b("div", In, [
1768
+ C(p, {
1757
1769
  disabled: !f.value,
1758
- loading: l.value,
1770
+ loading: o.value,
1759
1771
  label: "Publish to all outlets",
1760
- onClick: r
1772
+ onClick: c
1761
1773
  }, null, 8, ["disabled", "loading"]),
1762
- C(v, {
1774
+ C(p, {
1763
1775
  variant: "tertiary",
1764
1776
  label: "Close",
1765
1777
  onClick: a
@@ -1768,166 +1780,166 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
1768
1780
  ]);
1769
1781
  };
1770
1782
  }
1771
- }), Mn = { class: "flex-1 flex flex-col gap-8" }, Pn = { class: "flex flex-col" }, Rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, An = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, En = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, jn = /* @__PURE__ */ H({
1783
+ }), Mn = { class: "flex-1 flex flex-col gap-8" }, Pn = { class: "flex flex-col" }, Rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, An = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, En = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, On = /* @__PURE__ */ H({
1772
1784
  __name: "ClosingTemplateView",
1773
- setup(c) {
1774
- const { t: s } = j(), { createTemplate: l, updateTemplate: i, exportTemplates: n, importTemplates: t } = oe(), { templateDialogProps: y, templateDetailsProps: p } = ze(oe()), r = ce(), o = se(), f = re(), a = mt(), { breakpoints: w } = vt();
1775
- r.watchLocation(f.fetchTemplates);
1776
- const k = V(() => f.loading), b = P(""), m = V(() => w.value.xs || w.value.sm), v = V(() => m.value ? 10 : 20);
1785
+ setup(i) {
1786
+ const { t: l } = O(), { createTemplate: o, updateTemplate: m, exportTemplates: t, importTemplates: n } = oe(), { templateDialogProps: d, templateDetailsProps: y } = ze(oe()), c = ce(), s = se(), f = re(), a = mt(), { breakpoints: _ } = vt();
1787
+ c.watchLocation(f.fetchTemplates);
1788
+ const w = V(() => f.loading), h = P(""), r = V(() => _.value.xs || _.value.sm), p = V(() => r.value ? 10 : 20);
1777
1789
  function u(T) {
1778
1790
  switch (T) {
1779
1791
  case U.Add:
1780
- return l();
1792
+ return o();
1781
1793
  case "publish":
1782
1794
  return e();
1783
1795
  case "import":
1784
- return t();
1785
- case "export":
1786
1796
  return n();
1797
+ case "export":
1798
+ return t();
1787
1799
  case "refresh":
1788
1800
  return f.fetchTemplates();
1789
1801
  }
1790
1802
  }
1791
1803
  function e() {
1792
- o.open({
1804
+ s.open({
1793
1805
  title: "Publish closing templates",
1794
1806
  contentComponent: Dn,
1795
1807
  contentComponentProps: {
1796
1808
  onClose() {
1797
- o.close();
1809
+ s.close();
1798
1810
  }
1799
1811
  }
1800
1812
  });
1801
1813
  }
1802
- function _(T) {
1814
+ function x(T) {
1803
1815
  return T;
1804
1816
  }
1805
- const I = V(() => m.value ? [
1817
+ const S = V(() => r.value ? [
1806
1818
  {
1807
- label: s("inventory.closing.template.create.title"),
1819
+ label: l("inventory.closing.template.create.title"),
1808
1820
  value: U.Add,
1809
1821
  isPrimary: !0,
1810
1822
  prependIcon: "add"
1811
1823
  },
1812
1824
  {
1813
- label: s("inventory.common.refresh"),
1825
+ label: l("inventory.common.refresh"),
1814
1826
  value: "refresh",
1815
1827
  isPrimary: !1
1816
1828
  },
1817
1829
  {
1818
- label: s("inventory.common.publish"),
1830
+ label: l("inventory.common.publish"),
1819
1831
  value: "publish",
1820
1832
  isPrimary: !1
1821
1833
  },
1822
1834
  {
1823
- label: s("inventory.common.import"),
1835
+ label: l("inventory.common.import"),
1824
1836
  value: "import",
1825
1837
  isPrimary: !1
1826
1838
  },
1827
1839
  {
1828
- label: s("inventory.common.export"),
1840
+ label: l("inventory.common.export"),
1829
1841
  value: "export",
1830
1842
  isPrimary: !1
1831
1843
  }
1832
1844
  ] : [
1833
1845
  {
1834
- label: s("inventory.closing.template.create.title"),
1846
+ label: l("inventory.closing.template.create.title"),
1835
1847
  value: U.Add,
1836
1848
  isPrimary: !0,
1837
1849
  prependIcon: "add"
1838
1850
  },
1839
1851
  {
1840
- label: s("inventory.common.publish"),
1852
+ label: l("inventory.common.publish"),
1841
1853
  value: "publish",
1842
1854
  isPrimary: !1
1843
1855
  },
1844
1856
  {
1845
- label: s("inventory.common.import"),
1857
+ label: l("inventory.common.import"),
1846
1858
  value: "import",
1847
1859
  isPrimary: !1
1848
1860
  },
1849
1861
  {
1850
- label: s("inventory.common.refresh"),
1862
+ label: l("inventory.common.refresh"),
1851
1863
  value: "refresh",
1852
1864
  isPrimary: !1
1853
1865
  },
1854
1866
  {
1855
- label: s("inventory.common.export"),
1867
+ label: l("inventory.common.export"),
1856
1868
  value: "export",
1857
1869
  isPrimary: !1
1858
1870
  }
1859
1871
  ]);
1860
1872
  return (T, g) => {
1861
- const x = A("FmTable");
1862
- return $(), M(O, null, [
1873
+ const k = A("FmTable");
1874
+ return $(), M(j, null, [
1863
1875
  C(ut, {
1864
- title: d(s)("inventory.closing.template.title"),
1865
- actions: I.value,
1876
+ title: v(l)("inventory.closing.template.title"),
1877
+ actions: S.value,
1866
1878
  "onClick:action": u
1867
1879
  }, {
1868
1880
  default: E(() => [
1869
- h("div", {
1881
+ b("div", {
1870
1882
  class: G([
1871
1883
  "flex flex-col gap-8 max-h-full",
1872
1884
  {
1873
- "p-0": m.value,
1874
- "px-24 ": !m.value
1885
+ "p-0": r.value,
1886
+ "px-24 ": !r.value
1875
1887
  }
1876
1888
  ])
1877
1889
  }, [
1878
1890
  C(dt, {
1879
1891
  searchable: "",
1880
- search: b.value,
1881
- "onUpdate:search": g[0] || (g[0] = (F) => b.value = F)
1892
+ search: h.value,
1893
+ "onUpdate:search": g[0] || (g[0] = (F) => h.value = F)
1882
1894
  }, null, 8, ["search"]),
1883
- C(x, {
1884
- style: Ke(d(a).tableHeight),
1885
- "column-defs": d(f).columnDefs,
1886
- "row-data": d(f).templates,
1887
- "search-value": b.value,
1888
- loading: k.value,
1889
- onRowClick: g[1] || (g[1] = (F) => d(i)(F.original)),
1890
- "page-size": v.value
1895
+ C(k, {
1896
+ style: Ke(v(a).tableHeight),
1897
+ "column-defs": v(f).columnDefs,
1898
+ "row-data": v(f).templates,
1899
+ "search-value": h.value,
1900
+ loading: w.value,
1901
+ onRowClick: g[1] || (g[1] = (F) => v(m)(F.original)),
1902
+ "page-size": p.value
1891
1903
  }, {
1892
1904
  "list-row": E((F) => [
1893
1905
  C(Le, {
1894
1906
  row: F,
1895
- onRowClick: (D) => d(i)(D)
1907
+ onRowClick: (D) => v(m)(D)
1896
1908
  }, {
1897
1909
  default: E((D) => {
1898
- var L, ve, ge, J, ye, he, be, _e, X, xe, we, ke, Te, $e, Ce, Q, Ie, Se, De, Me, Z, Pe;
1910
+ var L, ve, ge, J, ye, he, be, _e, X, xe, we, ke, Te, $e, Ce, Q, Se, Ie, De, Me, Z, Pe;
1899
1911
  return [
1900
- h("div", Mn, [
1901
- h("div", Pn, [
1902
- h("div", Rn, [
1903
- C(d(K), {
1912
+ b("div", Mn, [
1913
+ b("div", Pn, [
1914
+ b("div", Rn, [
1915
+ C(v(K), {
1904
1916
  render: (ge = (ve = (L = D._id) == null ? void 0 : L.column) == null ? void 0 : ve.columnDef) == null ? void 0 : ge.cell,
1905
1917
  props: (ye = (J = D._id) == null ? void 0 : J.getContext) == null ? void 0 : ye.call(J)
1906
1918
  }, null, 8, ["render", "props"])
1907
1919
  ]),
1908
- h("div", Fn, [
1909
- C(d(K), {
1920
+ b("div", Fn, [
1921
+ C(v(K), {
1910
1922
  render: (_e = (be = (he = D.name) == null ? void 0 : he.column) == null ? void 0 : be.columnDef) == null ? void 0 : _e.cell,
1911
1923
  props: (xe = (X = D.name) == null ? void 0 : X.getContext) == null ? void 0 : xe.call(X)
1912
1924
  }, null, 8, ["render", "props"])
1913
1925
  ]),
1914
- h("div", null, S((we = F.original.locations) != null && we.length ? d(s)("inventory.closing.table.enabledForN", {
1926
+ b("div", null, I((we = F.original.locations) != null && we.length ? v(l)("inventory.closing.table.enabledForN", {
1915
1927
  count: ((ke = F.original.locations) == null ? void 0 : ke.length) ?? 0
1916
- }) : d(s)("inventory.closing.table.enabledForAll")), 1),
1917
- h("div", An, S([
1918
- ...F.original.items.slice(0, 3).map((Oe) => Oe.sku.name),
1928
+ }) : v(l)("inventory.closing.table.enabledForAll")), 1),
1929
+ b("div", An, I([
1930
+ ...F.original.items.slice(0, 3).map((je) => je.sku.name),
1919
1931
  ...F.original.items.length >= 3 ? [`and ${F.original.items.length - 3} more items`] : []
1920
1932
  ].join(", ")), 1),
1921
- h("div", En, [
1922
- C(d(K), {
1933
+ b("div", En, [
1934
+ C(v(K), {
1923
1935
  render: (Ce = ($e = (Te = D.ref) == null ? void 0 : Te.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Ce.cell,
1924
- props: (Ie = (Q = D.ref) == null ? void 0 : Q.getContext) == null ? void 0 : Ie.call(Q)
1936
+ props: (Se = (Q = D.ref) == null ? void 0 : Q.getContext) == null ? void 0 : Se.call(Q)
1925
1937
  }, null, 8, ["render", "props"])
1926
1938
  ])
1927
1939
  ]),
1928
- h("div", null, [
1929
- C(d(K), {
1930
- render: (Me = (De = (Se = D.status) == null ? void 0 : Se.column) == null ? void 0 : De.columnDef) == null ? void 0 : Me.cell,
1940
+ b("div", null, [
1941
+ C(v(K), {
1942
+ render: (Me = (De = (Ie = D.status) == null ? void 0 : Ie.column) == null ? void 0 : De.columnDef) == null ? void 0 : Me.cell,
1931
1943
  props: (Pe = (Z = D.status) == null ? void 0 : Z.getContext) == null ? void 0 : Pe.call(Z)
1932
1944
  }, null, 8, ["render", "props"])
1933
1945
  ])
@@ -1944,9 +1956,9 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
1944
1956
  _: 1
1945
1957
  }, 8, ["title", "actions"]),
1946
1958
  ($(), N(Ge, { to: "body" }, [
1947
- C(gn, We(qe(d(p))), null, 16),
1948
- C(pn, Je(d(y), {
1949
- onSubmitted: g[2] || (g[2] = (F) => d(f).fetchTemplates())
1959
+ C(gn, We(qe(v(y))), null, 16),
1960
+ C(pn, Je(v(d), {
1961
+ onSubmitted: g[2] || (g[2] = (F) => v(f).fetchTemplates())
1950
1962
  }), null, 16)
1951
1963
  ]))
1952
1964
  ], 64);
@@ -1954,5 +1966,5 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
1954
1966
  }
1955
1967
  });
1956
1968
  export {
1957
- jn as default
1969
+ On as default
1958
1970
  };