@feedmepos/mf-inventory-portal 0.0.23-dev.23 → 0.0.23-dev.25

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 (50) hide show
  1. package/dist/{App-BvEB-iR6.js → App-CNgj7enS.js} +49 -45
  2. package/dist/{ApprovalView-BmPYoGNQ.js → ApprovalView-CaVxfwVZ.js} +15 -15
  3. package/dist/{BindingsDialog-BqKMRdvl.js → BindingsDialog-jRZXoJFn.js} +9 -9
  4. package/dist/{BindingsPicker-BaEdafvS.js → BindingsPicker-B1HSa3PR.js} +5 -5
  5. package/dist/{BindingsTable--d-nM2Gv.js → BindingsTable-OF56C-md.js} +8 -8
  6. package/dist/ClosingDraftView-B6okKype.js +1134 -0
  7. package/dist/{ClosingTemplateView-BdUGSMOi.js → ClosingTemplateView-iX4shLcv.js} +251 -255
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CIk6CwoD.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bj2M9OAD.js} +13 -13
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Bt1hyXul.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CnPZaNTp.js} +46 -46
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-wYnVSXtH.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CGpmbbpm.js} +7 -7
  11. package/dist/{IngredientGroupView-0-nzZJcl.js → IngredientGroupView-BeW-0hWb.js} +40 -40
  12. package/dist/{IngredientsView-ClRyZ-cb.js → IngredientsView-CuVBlnOu.js} +207 -210
  13. package/dist/{IntegrationView-CgmsV7oX.js → IntegrationView-lDfeScNo.js} +89 -90
  14. package/dist/{InventoryBindingForm-DnnGejy0.js → InventoryBindingForm-D6EuWIkE.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CapSS-KQ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUpKKG4l.js} +27 -27
  16. package/dist/{InventoryBindingSummary-Dz-F2ofe.js → InventoryBindingSummary-CD60iCr_.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-glXw963h.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-7jkFhj27.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DpIyyZL-.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DDXsfGVf.js} +17 -18
  19. package/dist/{PurchaseOrderPrintPreview--hGI0aFU.js → PurchaseOrderPrintPreview-eJxn76Ir.js} +1 -1
  20. package/dist/{ReceiveRequestView-cPIOC0rj.js → ReceiveRequestView-D6Cdkd36.js} +26 -27
  21. package/dist/{RecipeView-BK74973y.js → RecipeView-BWy56DhW.js} +47 -48
  22. package/dist/{StockView-D6TYfv5x.js → StockView-BEXAvBjP.js} +7 -7
  23. package/dist/{SupplierView-BFwzHw7l.js → SupplierView-C4vwkzdX.js} +203 -206
  24. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-ChwtBdsS.js → TransferDetails.vue_vue_type_script_setup_true_lang-CIcj9NWg.js} +61 -62
  25. package/dist/{TransferTemplateView-De5sG12Q.js → TransferTemplateView-27Ng_EgG.js} +144 -145
  26. package/dist/{UnitView-CQoB6Uq_.js → UnitView-CXvkO_fh.js} +3 -3
  27. package/dist/{WarehouseView-Di4mLjoS.js → WarehouseView-Cl6HN1EW.js} +52 -52
  28. package/dist/app-Dt6Yd1pM.js +84133 -0
  29. package/dist/app.js +1 -1
  30. package/dist/{decimal-D2WMzK1d.js → decimal-D1M8NkLV.js} +1 -1
  31. package/dist/{feature-SYqA_m5m.js → feature-CqDcAtUy.js} +1 -1
  32. package/dist/{format-unit-display-D0G-LaQY.js → format-unit-display-BI9EVHb3.js} +50 -53
  33. package/dist/{index-Bj8PDCww.js → index-7V6E004u.js} +1 -1
  34. package/dist/{stock-CEexJdO3.js → stock-wjdjOqbM.js} +1 -1
  35. package/dist/style.css +1 -1
  36. package/dist/{supplier-BdB47EjI.js → supplier-D3-7dgm5.js} +1 -1
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{use-inventory-binding-dialog-n3khDS2D.js → use-inventory-binding-dialog-BLHffZgi.js} +1 -1
  39. package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +2 -0
  40. package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +18 -0
  41. package/dist/views/adjustment-template/import/export.d.ts +60 -0
  42. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +178 -8
  43. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1498 -478
  44. package/package.json +3 -3
  45. package/dist/ClosingDraftView-Clh7bujC.js +0 -1116
  46. package/dist/FmDroppableField-DHhcKcJf.js +0 -154
  47. package/dist/app-DpJictvi.js +0 -58871
  48. package/dist/netsuite-TWj-9PDj.js +0 -251
  49. package/dist/xlsx-Cbd5szA2.js +0 -24004
  50. package/dist/xlsx.util-hCH_XTAD.js +0 -78
@@ -1,11 +1,8 @@
1
- import { ref as M, h as F, defineComponent as O, resolveComponent as R, openBlock as k, createElementBlock as I, createElementVNode as _, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as v, createCommentVNode as G, createVNode as T, withCtx as P, Fragment as H, renderList as J, computed as E, watch as Re, createSlots as Pe, createBlock as V, isRef as je, normalizeStyle as Ye, Teleport as Ke, normalizeProps as Ge, guardReactiveProps as Je, mergeProps as We } from "vue";
2
- import { N as qe, u as le, a6 as Qe, D as Se, f as N, e as Xe, d as Ae, n as Ze, a as ae, o as et, c as z, v as j, w as tt, a7 as nt, k as ot, s as Ee, A as st, x as lt, _ as at, a8 as ne, p as rt, q as it, r as ct } from "./app-DpJictvi.js";
1
+ import { ref as D, h as F, defineComponent as O, resolveComponent as R, openBlock as k, createElementBlock as I, createElementVNode as _, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as v, createCommentVNode as K, createVNode as T, withCtx as P, Fragment as H, renderList as W, computed as E, watch as Re, createSlots as Pe, createBlock as V, isRef as je, normalizeStyle as Ye, Teleport as Ge, normalizeProps as Ke, guardReactiveProps as We, mergeProps as Je } from "vue";
2
+ import { W as qe, u as le, ac as Qe, D as Se, h as N, f as Xe, e as Ae, ad as oe, p as Ze, ae as Ee, q as Ue, a as ae, b as et, r as tt, s as Ve, v as nt, w as ot, d as z, E as j, G as st, af as lt, l as at, B as Ne, A as rt, H as it, _ as ct, ag as ne, x as mt, y as ut, z as dt } from "./app-Dt6Yd1pM.js";
3
3
  import { useCoreStore as re, useI18n as B } from "@feedmepos/mf-common";
4
- import { useDialogChild as mt, useSnackbar as Z, useDialog as ie, FmButtonVariant as Me, components as L, useProxiedModel as ut, useBreakpoints as dt } from "@feedmepos/ui-library";
5
- import { defineStore as Ue, storeToRefs as Ve } from "pinia";
6
- import { a as oe, b as Ne, d as Be, s as Le, r as pt } from "./xlsx.util-hCH_XTAD.js";
7
- import { F as ft } from "./FmDroppableField-DHhcKcJf.js";
8
- import { u as vt } from "./netsuite-TWj-9PDj.js";
4
+ import { useDialogChild as pt, useSnackbar as Z, useDialog as ie, FmButtonVariant as De, components as L, useProxiedModel as ft, useBreakpoints as vt } from "@feedmepos/ui-library";
5
+ import { defineStore as Be, storeToRefs as Le } from "pinia";
9
6
  const ee = qe((r, s) => {
10
7
  function o() {
11
8
  var t;
@@ -45,32 +42,32 @@ const ee = qe((r, s) => {
45
42
  return s.post(t, l);
46
43
  }
47
44
  };
48
- }), te = Ue(
45
+ }), te = Be(
49
46
  "closingTable",
50
47
  function() {
51
- const { t: s } = B(), o = se(), l = M({}), e = M(new Array()), t = M(!1), y = le(), p = ee();
52
- async function f() {
53
- if (e.value = [], !!y._currentLocation) {
48
+ const { t: s } = B(), o = se(), l = D({}), e = D(new Array()), t = D(!1), g = le(), f = ee();
49
+ async function p() {
50
+ if (e.value = [], !!g._currentLocation) {
54
51
  t.value = !0;
55
52
  try {
56
- const [g, h] = await Promise.all([
57
- p.readTemplates(),
58
- p.getRecentPublishingJob()
53
+ const [y, h] = await Promise.all([
54
+ f.readTemplates(),
55
+ f.getRecentPublishingJob()
59
56
  ]).delayed(1e3);
60
- e.value = g, l.value = h;
61
- } catch (g) {
62
- console.log("Something went wrong when fetching templates:", g);
57
+ e.value = y, l.value = h;
58
+ } catch (y) {
59
+ console.log("Something went wrong when fetching templates:", y);
63
60
  } finally {
64
61
  t.value = !1;
65
62
  }
66
63
  }
67
64
  }
68
- async function i(g) {
69
- if (!e.value.find((h) => h._id) && y._currentLocation) {
65
+ async function i(y) {
66
+ if (!e.value.find((h) => h._id) && g._currentLocation) {
70
67
  t.value = !0;
71
68
  try {
72
69
  const [h] = await Promise.all([
73
- p.getTemplate(g),
70
+ f.getTemplate(y),
74
71
  new Promise((u) => setTimeout(u, 1e3))
75
72
  ]);
76
73
  e.value = [h];
@@ -81,14 +78,14 @@ const ee = qe((r, s) => {
81
78
  }
82
79
  }
83
80
  }
84
- function d(g, h) {
85
- switch (h = Ae(h), g) {
81
+ function d(y, h) {
82
+ switch (h = Ae(h), y) {
86
83
  case N.Details:
87
84
  return o.viewTemplate(h);
88
85
  case N.Edit:
89
86
  return o.updateTemplate(h);
90
87
  case N.Delete:
91
- return o.deleteTemplate(h, t, f);
88
+ return o.deleteTemplate(h, t, p);
92
89
  }
93
90
  }
94
91
  return {
@@ -97,8 +94,8 @@ const ee = qe((r, s) => {
97
94
  id: "_id",
98
95
  accessorKey: "_id",
99
96
  header: () => s("inventory.closing.table.createdAt"),
100
- cell(g) {
101
- return Qe(`${g.getValue()}`);
97
+ cell(y) {
98
+ return Qe(`${y.getValue()}`);
102
99
  },
103
100
  enableSorting: !0
104
101
  },
@@ -123,9 +120,9 @@ const ee = qe((r, s) => {
123
120
  id: "enabledLocations",
124
121
  accessorKey: "locations.length",
125
122
  header: () => s("inventory.closing.table.enabledOutlets"),
126
- cell(g) {
123
+ cell(y) {
127
124
  var u;
128
- const h = (u = g.row.original.locations) == null ? void 0 : u.length;
125
+ const h = (u = y.row.original.locations) == null ? void 0 : u.length;
129
126
  return h ? `${h}` : "All";
130
127
  },
131
128
  enableSorting: !1,
@@ -145,9 +142,9 @@ const ee = qe((r, s) => {
145
142
  id: "status",
146
143
  header: () => s("inventory.closing.table.status"),
147
144
  enableSorting: !1,
148
- cell(g) {
145
+ cell(y) {
149
146
  var x;
150
- const h = g.row.original, u = h._rev, n = (x = l.value.publishedRevs) == null ? void 0 : x[h._id], a = u === n;
147
+ const h = y.row.original, u = h._rev, n = (x = l.value.publishedRevs) == null ? void 0 : x[h._id], a = u === n;
151
148
  return F(
152
149
  "div",
153
150
  {
@@ -168,8 +165,8 @@ const ee = qe((r, s) => {
168
165
  },
169
166
  {
170
167
  id: "action",
171
- cell(g) {
172
- const h = g.row.original, u = [
168
+ cell(y) {
169
+ const h = y.row.original, u = [
173
170
  Se[N.Edit],
174
171
  Se[N.Delete]
175
172
  ];
@@ -186,7 +183,7 @@ const ee = qe((r, s) => {
186
183
  recentPublish: l,
187
184
  templates: e,
188
185
  loading: t,
189
- fetchTemplates: f,
186
+ fetchTemplates: p,
190
187
  loadTemplate: i
191
188
  };
192
189
  }
@@ -228,40 +225,40 @@ function He() {
228
225
  ];
229
226
  }
230
227
  function gt(r) {
231
- var p;
232
- const o = re().currentBusiness.value, e = (p = r.map((f) => {
228
+ var f;
229
+ const o = re().currentBusiness.value, e = (f = r.map((p) => {
233
230
  var u;
234
- const i = f.items.flatMap(ze), d = He(), m = [
235
- ["Template ID", f._id],
236
- ["Template name", f.name],
231
+ const i = p.items.flatMap(ze), d = He(), m = [
232
+ ["Template ID", p._id],
233
+ ["Template name", p.name],
237
234
  ["Business name", o == null ? void 0 : o.name],
238
235
  ["Business ID", o == null ? void 0 : o._id],
239
236
  ["Menu version", o == null ? void 0 : o.menuVersion],
240
237
  [
241
238
  "Locations",
242
- ...(u = f.locations) != null && u.length ? [f.locations.map((n) => `${n.name} (${n.dbName})`)] : ["All"]
239
+ ...(u = p.locations) != null && u.length ? [p.locations.map((n) => `${n.name} (${n.dbName})`)] : ["All"]
243
240
  ],
244
- ["Reference", f.ref ?? ""],
241
+ ["Reference", p.ref ?? ""],
245
242
  [],
246
243
  d.map((n) => n.name),
247
244
  ...i.map((n) => d.map((a) => n[a.id]))
248
- ], g = d.map((n) => `system:${n.id}`), h = oe(m, g);
249
- return { name: f.name, sheet: h };
245
+ ], y = d.map((n) => `system:${n.id}`), h = oe(m, y);
246
+ return { name: p.name, sheet: h };
250
247
  }).reduce(
251
- (f, i) => {
248
+ (p, i) => {
252
249
  var m;
253
250
  const d = i.name.slice(0, 12);
254
- return (m = f.sheetOccurence)[d] ?? (m[d] = 0), f.sheetOccurence[d] += 1, f.sheets[`${d} (${f.sheetOccurence[d]})`] = i.sheet, f;
251
+ return (m = p.sheetOccurence)[d] ?? (m[d] = 0), p.sheetOccurence[d] += 1, p.sheets[`${d} (${p.sheetOccurence[d]})`] = i.sheet, p;
255
252
  },
256
253
  {
257
254
  sheets: {},
258
255
  sheetOccurence: {}
259
256
  }
260
- )) == null ? void 0 : p.sheets, t = `${o == null ? void 0 : o.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, y = Ne(e);
261
- return Be(y, t), t;
257
+ )) == null ? void 0 : f.sheets, t = `${o == null ? void 0 : o.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, g = Ee(e);
258
+ return Ue(g, t), t;
262
259
  }
263
260
  function yt() {
264
- const r = re(), s = ae(), o = vt(), l = ze({
261
+ const r = re(), s = ae(), o = et(), l = ze({
265
262
  sku: {
266
263
  unit: {
267
264
  _id: "",
@@ -274,7 +271,7 @@ function yt() {
274
271
  _id: "",
275
272
  name: "Sugar"
276
273
  }
277
- })[0], e = r.currentBusiness.value, t = He(), y = [
274
+ })[0], e = r.currentBusiness.value, t = He(), g = [
278
275
  ["Template ID (leave empty to create new)", ""],
279
276
  ["Template Name", "New template"],
280
277
  ["Business name", e == null ? void 0 : e.name],
@@ -289,7 +286,7 @@ function yt() {
289
286
  [],
290
287
  t.map((u) => u.name),
291
288
  t.map((u) => l[u.id])
292
- ], p = t.map((u) => `system:${u.id}`), f = oe(y, p), i = o.isEnabled ? o.state.setting.childItems ?? [] : [], d = i.reduce(
289
+ ], f = t.map((u) => `system:${u.id}`), p = oe(g, f), i = o.isEnabled ? o.state.setting.childItems ?? [] : [], d = i.reduce(
293
290
  (u, n) => {
294
291
  var b, w;
295
292
  const a = (b = o.netSuiteItemIdToSkuId.get(n.parentNetSuiteId)) == null ? void 0 : b[0], x = (w = o.netSuiteMeasurementIdToMeasurementId.get(
@@ -335,29 +332,29 @@ function yt() {
335
332
  "Enabled (true/false)",
336
333
  ...i.length ? ["Netsuite Parent"] : []
337
334
  ]
338
- ), g = Ne({
339
- Template: f,
335
+ ), y = Ee({
336
+ Template: p,
340
337
  Ingredients: m
341
338
  }), h = `${e == null ? void 0 : e.name} transfer templates import.xlsx`;
342
- return Be(g, h), h;
339
+ return Ue(y, h), h;
343
340
  }
344
341
  function ht(r) {
345
342
  if (!r.length || `${r[0]}`.toLocaleLowerCase() === "all")
346
343
  return [];
347
344
  const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, l = le().locationByDbName;
348
345
  return r.map((e) => {
349
- const t = new Array(), y = e.trim(), p = s.exec(y);
350
- if (!p)
351
- return t.push(`Enabled location value of ${y} cannot be read.`), {
346
+ const t = new Array(), g = e.trim(), f = s.exec(g);
347
+ if (!f)
348
+ return t.push(`Enabled location value of ${g} cannot be read.`), {
352
349
  errors: t
353
350
  };
354
- const f = p[1], i = p[2], d = l[i];
355
- return d ? (f !== d.name && t.push(
356
- `Location id ${i} has non-matching name. Found ${f} but expected ${d.name}`
351
+ const p = f[1], i = f[2], d = l[i];
352
+ return d ? (p !== d.name && t.push(
353
+ `Location id ${i} has non-matching name. Found ${p} but expected ${d.name}`
357
354
  ), {
358
355
  errors: t,
359
356
  location: d
360
- }) : (t.push(`Location (${f}) of id ${i} is not found.`), {
357
+ }) : (t.push(`Location (${p}) of id ${i} is not found.`), {
361
358
  errors: t
362
359
  });
363
360
  });
@@ -369,15 +366,15 @@ function bt(r) {
369
366
  l,
370
367
  e,
371
368
  t,
372
- y,
373
- p,
374
- f
375
- ] = Le(r);
369
+ g,
370
+ f,
371
+ p
372
+ ] = Ve(r);
376
373
  return {
377
374
  id: `${o[1] ?? ""}`.trim(),
378
375
  name: `${l[1] ?? ""}`.trim(),
379
- locations: p.slice(1).map((i) => `${i}`.trim()).filter((i) => i),
380
- reference: `${f[1] ?? ""}`.trim()
376
+ locations: f.slice(1).map((i) => `${i}`.trim()).filter((i) => i),
377
+ reference: `${p[1] ?? ""}`.trim()
381
378
  };
382
379
  }
383
380
  function _t(r) {
@@ -387,24 +384,24 @@ function _t(r) {
387
384
  l,
388
385
  e,
389
386
  t,
390
- y,
391
- p,
387
+ g,
392
388
  f,
389
+ p,
393
390
  i,
394
391
  d,
395
392
  ...m
396
- ] = Le(r);
393
+ ] = Ve(r);
397
394
  if (!s || !s.length || s.some((a) => a.length && !a.startsWith("system:")))
398
395
  throw new Error("Missing meta header. Excel file does not come from the template.");
399
- const g = s.map((a) => a.split(":")[1]), u = ["code", "name", "unit", "enabled"].filter((a) => !g.includes(a));
396
+ const y = s.map((a) => a.split(":")[1]), u = ["code", "name", "unit", "enabled"].filter((a) => !y.includes(a));
400
397
  if (u.length)
401
398
  throw new Error(
402
399
  `Missing meta headers (${u.join()}). Excel file does not come from the template.`
403
400
  );
404
401
  return m.map((a, x) => {
405
402
  const c = {};
406
- for (const $ in g) {
407
- const b = g[$];
403
+ for (const $ in y) {
404
+ const b = y[$];
408
405
  Object.assign(c, { [b]: a[$] });
409
406
  }
410
407
  return {
@@ -429,40 +426,39 @@ function wt(r) {
429
426
  return o.push(`Cannot find ingredient of code ${s.code} ${s.name}`), { errors: o };
430
427
  const t = {
431
428
  sku: e
432
- }, y = e.unit.measurements.find((f) => f.abbrev === s.unit);
433
- s.unit !== e.unit.abbrev && !y ? o.push(
429
+ }, g = /* @__PURE__ */ new Set([e.unit._id, ...e.unit.measurements.map((p) => p.id)]), f = e.unit.measurements.find((p) => p.abbrev === s.unit);
430
+ s.unit !== e.unit.abbrev && !f ? o.push(
434
431
  `Cannot find measurement unit of ${s.unit} for (${s.code}) ${s.name}.`
435
- ) : (!s.enabled || `${s.enabled}`.toLocaleLowerCase() === "false") && (t.disabledMeasurements ?? (t.disabledMeasurements = []), t.disabledMeasurements.push((y == null ? void 0 : y.id) ?? e.unit._id));
436
- for (const f of r.children) {
437
- const i = f.data, d = i.unit === e.unit.abbrev ? e.unit : void 0, m = e.unit.measurements.find((g) => g.abbrev === i.unit);
432
+ ) : (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && g.delete(e.unit._id);
433
+ for (const p of r.children) {
434
+ const i = p.data, d = i.unit === e.unit.abbrev ? e.unit : void 0, m = e.unit.measurements.find((y) => y.abbrev === i.unit);
438
435
  if (!m && !d) {
439
436
  o.push(
440
437
  `Cannot find measurement unit of ${i.unit} for (${s.code}) ${s.name}.`
441
438
  );
442
439
  continue;
443
440
  }
444
- (!i.enabled || `${i.enabled}`.toLocaleLowerCase() === "false") && (t.disabledMeasurements ?? (t.disabledMeasurements = []), t.disabledMeasurements.push((m == null ? void 0 : m.id) ?? (d == null ? void 0 : d._id) ?? ""));
441
+ (i.enabled === !0 || `${i.enabled}`.toLocaleLowerCase() === "true") && g.delete((m == null ? void 0 : m.id) ?? (d == null ? void 0 : d._id) ?? "");
445
442
  }
446
- const p = new Set(t.disabledMeasurements);
447
- return p.has(e.unit._id) && t.sku.unit.measurements.every((f) => p.has(f.id)) && o.push(`Ingredient ${e.code} - ${e.name} must have at least one unit enabled.`), { errors: o, templateItem: t };
443
+ return g.has(e.unit._id) && t.sku.unit.measurements.every((p) => g.has(p.id)) && o.push(`Ingredient ${e.code} - ${e.name} must have at least one unit enabled.`), t.disabledMeasurements = [...g], { errors: o, templateItem: t };
448
444
  }
449
445
  function kt(r) {
450
446
  const s = r.SheetNames.filter(
451
447
  (t) => !Object.values(ce).map(String).includes(t)
452
- ), l = te().templates, e = et(l, "_id");
448
+ ), l = te().templates, e = tt(l, "_id");
453
449
  try {
454
450
  return s.reduce(
455
- (t, y) => {
456
- const p = new Array(), f = r.Sheets[y], i = bt(f), d = ht(i.locations), m = d.filter((c) => c.location).map((c) => c.location);
457
- p.push(...d.flatMap((c) => c.errors));
458
- const g = _t(f).filter(
451
+ (t, g) => {
452
+ const f = new Array(), p = r.Sheets[g], i = bt(p), d = ht(i.locations), m = d.filter((c) => c.location).map((c) => c.location);
453
+ f.push(...d.flatMap((c) => c.errors));
454
+ const y = _t(p).filter(
459
455
  (c) => c.data.code || c.data.unit
460
- ), h = xt(g);
461
- p.push(...h.errors);
456
+ ), h = xt(y);
457
+ f.push(...h.errors);
462
458
  const u = h.result.map(
463
459
  (c) => wt(c)
464
460
  );
465
- p.push(...u.flatMap((c) => c.errors));
461
+ f.push(...u.flatMap((c) => c.errors));
466
462
  const n = u.filter((c) => c.templateItem).map((c) => c.templateItem);
467
463
  if (i.id) {
468
464
  const c = e[i.id];
@@ -470,15 +466,15 @@ function kt(r) {
470
466
  const b = {
471
467
  _id: i.id,
472
468
  _rev: "",
473
- name: i.name || `(unnamed from sheet ${y || "<unnamed sheet>"})`,
469
+ name: i.name || `(unnamed from sheet ${g || "<unnamed sheet>"})`,
474
470
  items: []
475
471
  };
476
- return p.push(`Template ID ${i.id} is not found.`), t.importUpdateResult.push({
472
+ return f.push(`Template ID ${i.id} is not found.`), t.importUpdateResult.push({
477
473
  type: "update",
478
474
  original: b,
479
475
  template: b,
480
- excelSheetName: y,
481
- errors: p
476
+ excelSheetName: g,
477
+ errors: f
482
478
  }), t;
483
479
  }
484
480
  const $ = {
@@ -491,8 +487,8 @@ function kt(r) {
491
487
  ref: i.reference,
492
488
  items: n
493
489
  },
494
- excelSheetName: y,
495
- errors: p
490
+ excelSheetName: g,
491
+ errors: f
496
492
  };
497
493
  return t.importUpdateResult.push($), t;
498
494
  }
@@ -504,8 +500,8 @@ function kt(r) {
504
500
  ref: i.reference,
505
501
  items: n
506
502
  },
507
- excelSheetName: y,
508
- errors: p
503
+ excelSheetName: g,
504
+ errors: f
509
505
  };
510
506
  return t.importCreateResult.push(x), t;
511
507
  },
@@ -527,7 +523,7 @@ function kt(r) {
527
523
  const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-col" }, Ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, It = {
528
524
  key: 0,
529
525
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
530
- }, St = { key: 0 }, De = /* @__PURE__ */ O({
526
+ }, St = { key: 0 }, Me = /* @__PURE__ */ O({
531
527
  __name: "ClosingTemplateImportItem",
532
528
  props: {
533
529
  type: {},
@@ -539,7 +535,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
539
535
  setup(r) {
540
536
  const { t: s } = B();
541
537
  return (o, l) => {
542
- var y, p, f;
538
+ var g, f, p;
543
539
  const e = R("FmIcon"), t = R("FmTooltip");
544
540
  return k(), I("div", Tt, [
545
541
  l[0] || (l[0] = _("div", null, "•", -1)),
@@ -551,13 +547,13 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
551
547
  })
552
548
  }, [
553
549
  Fe(C(o.name) + " ", 1),
554
- o.type === "create" ? (k(), I("span", It, "(" + C(v(s)("inventory.closing.template.import.new")) + ")", 1)) : G("", !0)
550
+ o.type === "create" ? (k(), I("span", It, "(" + C(v(s)("inventory.closing.template.import.new")) + ")", 1)) : K("", !0)
555
551
  ], 2),
556
552
  o.errors.length ? (k(), I("div", St, [
557
553
  T(t, { "z-index": 50 }, {
558
554
  content: P(() => [
559
555
  _("ol", null, [
560
- (k(!0), I(H, null, J(o.errors, (i, d) => (k(), I("li", { key: d }, C(i), 1))), 128))
556
+ (k(!0), I(H, null, W(o.errors, (i, d) => (k(), I("li", { key: d }, C(i), 1))), 128))
561
557
  ])
562
558
  ]),
563
559
  default: P(() => [
@@ -569,7 +565,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
569
565
  ]),
570
566
  _: 1
571
567
  })
572
- ])) : G("", !0)
568
+ ])) : K("", !0)
573
569
  ]),
574
570
  _("div", {
575
571
  class: Y([
@@ -579,12 +575,12 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
579
575
  "text-fm-color-typo-secondary": !o.errors.length
580
576
  }
581
577
  ])
582
- }, C((y = o.locations) != null && y.length ? v(s)("inventory.closing.template.import.nLocations", { count: (p = o.locations) == null ? void 0 : p.length }) : v(s)("inventory.closing.template.import.allLocations")) + ", " + C(v(s)("inventory.closing.template.import.nItems", { count: (f = o.items) == null ? void 0 : f.length })), 3)
578
+ }, C((g = o.locations) != null && g.length ? v(s)("inventory.closing.template.import.nLocations", { count: (f = o.locations) == null ? void 0 : f.length }) : v(s)("inventory.closing.template.import.allLocations")) + ", " + C(v(s)("inventory.closing.template.import.nItems", { count: (p = o.items) == null ? void 0 : p.length })), 3)
583
579
  ])
584
580
  ]);
585
581
  };
586
582
  }
587
- }), Mt = { class: "flex flex-col gap-24" }, Dt = { class: "fm-typo-en-body-md-400" }, Ft = {
583
+ }), Dt = { class: "flex flex-col gap-24" }, Mt = { class: "fm-typo-en-body-md-400" }, Ft = {
588
584
  key: 0,
589
585
  class: "flex items-center gap-8"
590
586
  }, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pt = { class: "flex flex-col gap-8" }, At = { class: "line-clamp-2 text-ellipsis break-all" }, Et = {
@@ -599,35 +595,35 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
599
595
  }, Bt = { class: "fm-typo-en-body-lg-600" }, Lt = /* @__PURE__ */ O({
600
596
  __name: "ClosingTemplateImport",
601
597
  setup(r) {
602
- const s = M(null), o = mt(), l = Z(), e = M(!1), t = M(!1), y = M(new Array()), p = M([]), f = M([]), i = E(
603
- () => !!y.value.length || p.value.some((h) => h.errors.length) || f.value.some((h) => h.errors.length)
598
+ const s = D(null), o = pt(), l = Z(), e = D(!1), t = D(!1), g = D(new Array()), f = D([]), p = D([]), i = E(
599
+ () => !!g.value.length || f.value.some((h) => h.errors.length) || p.value.some((h) => h.errors.length)
604
600
  ), d = E(
605
- () => !!p.value.length || !!f.value.length
601
+ () => !!f.value.length || !!p.value.length
606
602
  ), { t: m } = B();
607
- async function g(h) {
608
- y.value = [], p.value = [], f.value = [];
603
+ async function y(h) {
604
+ g.value = [], f.value = [], p.value = [];
609
605
  try {
610
606
  e.value = !0;
611
607
  const [u] = await Promise.all([
612
- pt(h),
608
+ ot(h),
613
609
  // fake buffer
614
610
  new Promise((c) => setTimeout(c, 1e3))
615
611
  ]);
616
612
  if (!u.SheetNames.filter(
617
613
  (c) => !Object.values(ce).map(String).includes(c)
618
614
  ).find((c) => c)) {
619
- y.value.push(m("inventory.ingredient.import.fileError.noSheet"));
615
+ g.value.push(m("inventory.ingredient.import.fileError.noSheet"));
620
616
  return;
621
617
  }
622
618
  const x = kt(u);
623
619
  if (x.invalidExcel) {
624
- y.value.push(
620
+ g.value.push(
625
621
  x.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel")
626
622
  );
627
623
  return;
628
624
  }
629
- if (p.value = x.importCreateResult, f.value = x.importUpdateResult, !p.value.length && !f.value.length) {
630
- y.value.push(m("inventory.ingredient.import.fileError.noData"));
625
+ if (f.value = x.importCreateResult, p.value = x.importUpdateResult, !f.value.length && !p.value.length) {
626
+ g.value.push(m("inventory.ingredient.import.fileError.noData"));
631
627
  return;
632
628
  }
633
629
  o.emitData(x);
@@ -638,18 +634,18 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
638
634
  type: "error"
639
635
  }), console.error("Error in reading file", u);
640
636
  } finally {
641
- y.value.length && l.open({
637
+ g.value.length && l.open({
642
638
  title: m("inventory.ingredient.import.fileError.invalidExcel"),
643
639
  type: "error"
644
640
  }), e.value = !1;
645
641
  }
646
642
  }
647
643
  return Re(s, (h) => {
648
- h && g(h);
644
+ h && y(h);
649
645
  }), (h, u) => {
650
646
  const n = R("FmCircularProgress"), a = R("FmIcon"), x = R("FmButton");
651
- return k(), I("div", Mt, [
652
- _("div", Dt, C(v(m)("inventory.closing.template.import.message")), 1),
647
+ return k(), I("div", Dt, [
648
+ _("div", Mt, C(v(m)("inventory.closing.template.import.message")), 1),
653
649
  t.value ? (k(), I("div", Ft, [
654
650
  _("div", null, [
655
651
  T(n, {
@@ -659,7 +655,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
659
655
  ]),
660
656
  _("div", Rt, C(v(m)("inventory.formField.loading")), 1)
661
657
  ])) : (k(), I(H, { key: 1 }, [
662
- T(ft, {
658
+ T(nt, {
663
659
  class: Y({
664
660
  "w-full": !0,
665
661
  "h-[200px]": !s.value
@@ -704,7 +700,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
704
700
  }, [
705
701
  _("div", At, C(s.value.name), 1)
706
702
  ], 2),
707
- e.value ? G("", !0) : (k(), I("div", Et, [
703
+ e.value ? K("", !0) : (k(), I("div", Et, [
708
704
  T(x, {
709
705
  label: v(m)("inventory.ingredient.import.replaceFile"),
710
706
  variant: i.value ? "destructive" : "secondary",
@@ -713,8 +709,8 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
713
709
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
714
710
  ]))
715
711
  ], 2),
716
- y.value.length ? (k(), I("div", Ut, [
717
- (k(!0), I(H, null, J(y.value, ($, b) => (k(), I("div", {
712
+ g.value.length ? (k(), I("div", Ut, [
713
+ (k(!0), I(H, null, W(g.value, ($, b) => (k(), I("div", {
718
714
  key: b,
719
715
  class: "flex gap-8 items-center"
720
716
  }, [
@@ -725,7 +721,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
725
721
  }),
726
722
  _("div", Vt, C($), 1)
727
723
  ]))), 128))
728
- ])) : G("", !0)
724
+ ])) : K("", !0)
729
725
  ])
730
726
  ]),
731
727
  key: "0"
@@ -733,7 +729,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
733
729
  ]), 1032, ["class", "label", "button-label"]),
734
730
  d.value ? (k(), I("div", Nt, [
735
731
  _("div", Bt, C(v(m)("inventory.ingredient.import.summary")), 1),
736
- (k(!0), I(H, null, J(p.value, (c, $) => (k(), V(De, {
732
+ (k(!0), I(H, null, W(f.value, (c, $) => (k(), V(Me, {
737
733
  key: $,
738
734
  name: c.template.name,
739
735
  locations: c.template.locations,
@@ -741,7 +737,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
741
737
  errors: c.errors,
742
738
  type: "create"
743
739
  }, null, 8, ["name", "locations", "items", "errors"]))), 128)),
744
- (k(!0), I(H, null, J(f.value, (c) => (k(), V(De, {
740
+ (k(!0), I(H, null, W(p.value, (c) => (k(), V(Me, {
745
741
  key: c.template._id,
746
742
  name: c.template.name,
747
743
  locations: c.template.locations,
@@ -749,29 +745,29 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
749
745
  errors: c.errors,
750
746
  type: "update"
751
747
  }, null, 8, ["name", "locations", "items", "errors"]))), 128))
752
- ])) : G("", !0)
748
+ ])) : K("", !0)
753
749
  ], 64))
754
750
  ]);
755
751
  };
756
752
  }
757
- }), se = Ue("closingTemplateActions", () => {
758
- const { t: r } = B(), s = ie(), o = Z(), l = ee(), e = te(), { loading: t } = Ve(e), y = M({});
759
- function p() {
760
- y.value = {
753
+ }), se = Be("closingTemplateActions", () => {
754
+ const { t: r } = B(), s = ie(), o = Z(), l = ee(), e = te(), { loading: t } = Le(e), g = D({});
755
+ function f() {
756
+ g.value = {
761
757
  mode: z.CREATE,
762
758
  show: !0,
763
759
  "onUpdate:show"(n) {
764
- y.value.show = n;
760
+ g.value.show = n;
765
761
  }
766
762
  };
767
763
  }
768
- function f(n) {
769
- y.value = {
764
+ function p(n) {
765
+ g.value = {
770
766
  mode: z.UPDATE,
771
767
  modelValue: n,
772
768
  show: !0,
773
769
  "onUpdate:show"(a) {
774
- y.value.show = a;
770
+ g.value.show = a;
775
771
  }
776
772
  };
777
773
  }
@@ -781,12 +777,12 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
781
777
  message: "Deleted template can no longer be retrieved",
782
778
  primaryActions: {
783
779
  text: "Delete",
784
- variant: Me.Destructive,
780
+ variant: De.Destructive,
785
781
  close: !0
786
782
  },
787
783
  secondaryActions: {
788
784
  text: "Cancel",
789
- variant: Me.Plain,
785
+ variant: De.Plain,
790
786
  close: !0
791
787
  }
792
788
  }).onPrimary(async () => {
@@ -816,7 +812,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
816
812
  }
817
813
  });
818
814
  }
819
- const d = M({});
815
+ const d = D({});
820
816
  function m(n) {
821
817
  d.value = {
822
818
  template: n,
@@ -825,11 +821,11 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
825
821
  d.value.show = a;
826
822
  },
827
823
  "onAction:edit"() {
828
- d.value.show = !1, f(Ae(n));
824
+ d.value.show = !1, p(Ae(n));
829
825
  }
830
826
  };
831
827
  }
832
- function g() {
828
+ function y() {
833
829
  if (!e.templates.length) {
834
830
  o.open({
835
831
  title: "No data to export",
@@ -927,17 +923,17 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
927
923
  }
928
924
  }
929
925
  return {
930
- createTemplate: p,
926
+ createTemplate: f,
931
927
  viewTemplate: m,
932
- updateTemplate: f,
928
+ updateTemplate: p,
933
929
  deleteTemplate: i,
934
- exportTemplates: g,
930
+ exportTemplates: y,
935
931
  importTemplates: h,
936
- templateDialogProps: y,
932
+ templateDialogProps: g,
937
933
  templateDetailsProps: d
938
934
  };
939
935
  });
940
- var K = /* @__PURE__ */ ((r) => (r.Name = "Name", r.Unit = "Unit", r.Delete = "Delete", r))(K || {});
936
+ var G = /* @__PURE__ */ ((r) => (r.Name = "Name", r.Unit = "Unit", r.Delete = "Delete", r))(G || {});
941
937
  function zt(r) {
942
938
  return {
943
939
  columnDefs: E(() => {
@@ -980,14 +976,14 @@ function zt(r) {
980
976
  minSize: 200,
981
977
  maxSize: 400,
982
978
  cell(e) {
983
- var y, p, f;
979
+ var g, f, p;
984
980
  const t = e.row.original;
985
981
  return F("div", { class: "flex items-center gap-32" }, [
986
982
  F(
987
983
  L.FmFormGroup,
988
984
  {
989
985
  value: t.sku.unit._id,
990
- modelValue: !((y = t.disabledMeasurements) != null && y.includes(t.sku.unit._id))
986
+ modelValue: !((g = t.disabledMeasurements) != null && g.includes(t.sku.unit._id))
991
987
  },
992
988
  F(
993
989
  "div",
@@ -998,8 +994,8 @@ function zt(r) {
998
994
  [
999
995
  F(L.FmCheckbox, {
1000
996
  value: t.sku.unit._id,
1001
- modelValue: !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)),
1002
- disabled: r.disabled || !((f = t.disabledMeasurements) != null && f.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
997
+ modelValue: !((f = t.disabledMeasurements) != null && f.includes(t.sku.unit._id)),
998
+ disabled: r.disabled || !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
1003
999
  (i) => {
1004
1000
  var d;
1005
1001
  return (d = t.disabledMeasurements) == null ? void 0 : d.includes(i.id);
@@ -1044,12 +1040,12 @@ function zt(r) {
1044
1040
  ),
1045
1041
  ...Array.from({ length: Math.max(o, 0) }).map((i, d) => {
1046
1042
  var h, u, n, a;
1047
- const m = e.row.original, g = m.sku.unit.measurements[d];
1048
- return g ? F(
1043
+ const m = e.row.original, y = m.sku.unit.measurements[d];
1044
+ return y ? F(
1049
1045
  L.FmFormGroup,
1050
1046
  {
1051
- modelValue: !((h = m.disabledMeasurements) != null && h.includes(g.id)),
1052
- value: g.id
1047
+ modelValue: !((h = m.disabledMeasurements) != null && h.includes(y.id)),
1048
+ value: y.id
1053
1049
  },
1054
1050
  F(
1055
1051
  "div",
@@ -1059,9 +1055,9 @@ function zt(r) {
1059
1055
  },
1060
1056
  [
1061
1057
  F(L.FmCheckbox, {
1062
- value: g.id,
1063
- modelValue: !((u = m.disabledMeasurements) != null && u.includes(g.id)),
1064
- disabled: r.disabled || !((n = m.disabledMeasurements) != null && n.includes(g.id)) && ((a = m.disabledMeasurements) == null ? void 0 : a.includes(m.sku.unit._id)) && m.sku.unit.measurements.filter((x) => x.id != g.id).every((x) => {
1058
+ value: y.id,
1059
+ modelValue: !((u = m.disabledMeasurements) != null && u.includes(y.id)),
1060
+ disabled: r.disabled || !((n = m.disabledMeasurements) != null && n.includes(y.id)) && ((a = m.disabledMeasurements) == null ? void 0 : a.includes(m.sku.unit._id)) && m.sku.unit.measurements.filter((x) => x.id != y.id).every((x) => {
1065
1061
  var c;
1066
1062
  return (c = m.disabledMeasurements) == null ? void 0 : c.includes(x.id);
1067
1063
  }),
@@ -1071,14 +1067,14 @@ function zt(r) {
1071
1067
  r.updateItem({
1072
1068
  ...m,
1073
1069
  disabledMeasurements: (c = m.disabledMeasurements) == null ? void 0 : c.filter(
1074
- ($) => $ !== g.id
1070
+ ($) => $ !== y.id
1075
1071
  )
1076
1072
  });
1077
1073
  else {
1078
1074
  const $ = m.disabledMeasurements ?? [];
1079
1075
  r.updateItem({
1080
1076
  ...m,
1081
- disabledMeasurements: [...$, g.id]
1077
+ disabledMeasurements: [...$, y.id]
1082
1078
  });
1083
1079
  }
1084
1080
  }
@@ -1088,13 +1084,13 @@ function zt(r) {
1088
1084
  { zIndex: 51 },
1089
1085
  {
1090
1086
  content() {
1091
- return g.abbrev;
1087
+ return y.abbrev;
1092
1088
  },
1093
1089
  default() {
1094
1090
  return F(
1095
1091
  "div",
1096
1092
  { class: "line-clamp-2 fm-typo-en-body-lg-400" },
1097
- g.abbrev
1093
+ y.abbrev
1098
1094
  );
1099
1095
  }
1100
1096
  }
@@ -1139,7 +1135,7 @@ function zt(r) {
1139
1135
  })
1140
1136
  };
1141
1137
  }
1142
- const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt = { class: "flex-1 flex flex-col" }, Yt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, Kt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Gt = { class: "flex flex-col gap-4" }, Jt = /* @__PURE__ */ O({
1138
+ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt = { class: "flex-1 flex flex-col" }, Yt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, Gt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Kt = { class: "flex flex-col gap-4" }, Wt = /* @__PURE__ */ O({
1143
1139
  __name: "ClosingTemplateItem",
1144
1140
  props: {
1145
1141
  cellByColId: {},
@@ -1147,32 +1143,32 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1147
1143
  },
1148
1144
  setup(r) {
1149
1145
  const s = r, o = E(() => s.row), l = E(
1150
- () => o.value.getVisibleCells().filter((e) => e.column.id !== K.Name && e.column.id !== K.Delete)
1146
+ () => o.value.getVisibleCells().filter((e) => e.column.id !== G.Name && e.column.id !== G.Delete)
1151
1147
  );
1152
1148
  return (e, t) => {
1153
- var y, p, f, i, d;
1149
+ var g, f, p, i, d;
1154
1150
  return k(), I("div", Ht, [
1155
1151
  _("div", Ot, [
1156
1152
  _("div", jt, [
1157
1153
  _("div", Yt, C(o.value.original.sku.name), 1),
1158
- _("div", Kt, C(o.value.original.sku.code), 1)
1154
+ _("div", Gt, C(o.value.original.sku.code), 1)
1159
1155
  ]),
1160
1156
  _("div", null, [
1161
1157
  T(v(j), {
1162
- render: (f = (p = (y = e.cellByColId[v(K).Delete]) == null ? void 0 : y.column) == null ? void 0 : p.columnDef) == null ? void 0 : f.cell,
1163
- props: (d = (i = e.cellByColId[v(K).Delete]) == null ? void 0 : i.getContext) == null ? void 0 : d.call(i)
1158
+ render: (p = (f = (g = e.cellByColId[v(G).Delete]) == null ? void 0 : g.column) == null ? void 0 : f.columnDef) == null ? void 0 : p.cell,
1159
+ props: (d = (i = e.cellByColId[v(G).Delete]) == null ? void 0 : i.getContext) == null ? void 0 : d.call(i)
1164
1160
  }, null, 8, ["render", "props"])
1165
1161
  ])
1166
1162
  ]),
1167
- _("div", Gt, [
1163
+ _("div", Kt, [
1168
1164
  t[0] || (t[0] = _("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
1169
- (k(!0), I(H, null, J(l.value, (m) => {
1170
- var g, h, u;
1165
+ (k(!0), I(H, null, W(l.value, (m) => {
1166
+ var y, h, u;
1171
1167
  return k(), I("div", {
1172
1168
  key: m.id
1173
1169
  }, [
1174
1170
  T(v(j), {
1175
- render: (h = (g = m.column) == null ? void 0 : g.columnDef) == null ? void 0 : h.cell,
1171
+ render: (h = (y = m.column) == null ? void 0 : y.columnDef) == null ? void 0 : h.cell,
1176
1172
  props: (u = m.getContext) == null ? void 0 : u.call(m)
1177
1173
  }, null, 8, ["render", "props"])
1178
1174
  ]);
@@ -1181,25 +1177,25 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1181
1177
  ]);
1182
1178
  };
1183
1179
  }
1184
- }), Wt = { class: "flex flex-col gap-16" }, qt = { class: "flex flex-col gap-24" }, Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center" }, Zt = { class: "flex-1 fm-typo-en-title-sm-600" }, en = { class: "flex flex-col gap-16" }, tn = { class: "flex items-center" }, nn = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, on = /* @__PURE__ */ O({
1180
+ }), Jt = { class: "flex flex-col gap-16" }, qt = { class: "flex flex-col gap-24" }, Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center" }, Zt = { class: "flex-1 fm-typo-en-title-sm-600" }, en = { class: "flex flex-col gap-16" }, tn = { class: "flex items-center" }, nn = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, on = /* @__PURE__ */ O({
1185
1181
  __name: "ClosingTemplateForm",
1186
1182
  props: {
1187
1183
  modelValue: {},
1188
1184
  disabled: { type: Boolean }
1189
1185
  },
1190
1186
  setup(r, { expose: s }) {
1191
- const o = r, l = tt(), { t: e } = B(), t = ae(), y = ie(), {
1192
- promptSelectLocations: p,
1193
- columnDefs: f,
1187
+ const o = r, l = st(), { t: e } = B(), t = ae(), g = ie(), {
1188
+ promptSelectLocations: f,
1189
+ columnDefs: p,
1194
1190
  rowData: i
1195
- } = nt({
1191
+ } = lt({
1196
1192
  getLocations() {
1197
1193
  return l.locations;
1198
1194
  },
1199
1195
  setLocations(n) {
1200
1196
  l.locations = n;
1201
1197
  }
1202
- }), d = M(), m = M("");
1198
+ }), d = D(), m = D("");
1203
1199
  s({
1204
1200
  validateInputs: () => {
1205
1201
  var n, a;
@@ -1214,7 +1210,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1214
1210
  (a = (n = d.value) == null ? void 0 : n.resetInputs) == null || a.call(n);
1215
1211
  }
1216
1212
  });
1217
- const g = zt({
1213
+ const y = zt({
1218
1214
  updateItem: (n) => {
1219
1215
  l.items = l.items.map((a) => a.sku._id !== n.sku._id ? a : n);
1220
1216
  },
@@ -1227,7 +1223,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1227
1223
  get disabled() {
1228
1224
  return o.disabled;
1229
1225
  }
1230
- }), h = E(() => g.columnDefs.value);
1226
+ }), h = E(() => y.columnDefs.value);
1231
1227
  function u() {
1232
1228
  const n = t.skus.map((x) => ({
1233
1229
  label: x.name,
@@ -1237,10 +1233,10 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1237
1233
  var c;
1238
1234
  return (c = l.items) == null ? void 0 : c.find(($) => $.sku._id === x.value._id);
1239
1235
  }).map((x) => x.value);
1240
- y.open({
1236
+ g.open({
1241
1237
  title: e("inventory.closing.form.items.selectItem"),
1242
1238
  closeButton: !0,
1243
- contentComponent: lt,
1239
+ contentComponent: it,
1244
1240
  contentComponentProps: {
1245
1241
  modelValue: a,
1246
1242
  items: n,
@@ -1257,7 +1253,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1257
1253
  }
1258
1254
  }).onPrimary((x) => {
1259
1255
  const c = l.items ?? [], $ = x.map((b) => {
1260
- const w = c.find((D) => D.sku._id === b._id);
1256
+ const w = c.find((M) => M.sku._id === b._id);
1261
1257
  return w || {
1262
1258
  sku: b
1263
1259
  };
@@ -1274,20 +1270,20 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1274
1270
  disabled: n.disabled
1275
1271
  }, {
1276
1272
  default: P(() => [
1277
- _("div", Wt, [
1273
+ _("div", Jt, [
1278
1274
  _("div", qt, [
1279
1275
  T(x, {
1280
1276
  label: v(e)("inventory.closing.form.name"),
1281
1277
  "label-mark": "required",
1282
1278
  modelValue: v(l).name,
1283
- "onUpdate:modelValue": a[0] || (a[0] = (D) => v(l).name = D),
1284
- rules: [v(ot)()]
1279
+ "onUpdate:modelValue": a[0] || (a[0] = (M) => v(l).name = M),
1280
+ rules: [v(at)()]
1285
1281
  }, null, 8, ["label", "modelValue", "rules"]),
1286
1282
  T(x, {
1287
1283
  label: v(e)("inventory.closing.form.reference"),
1288
1284
  "label-mark": "optional",
1289
1285
  modelValue: v(l).ref,
1290
- "onUpdate:modelValue": a[1] || (a[1] = (D) => v(l).ref = D)
1286
+ "onUpdate:modelValue": a[1] || (a[1] = (M) => v(l).ref = M)
1291
1287
  }, null, 8, ["label", "modelValue"])
1292
1288
  ])
1293
1289
  ]),
@@ -1300,14 +1296,14 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1300
1296
  "prepend-icon": "add",
1301
1297
  variant: "plain",
1302
1298
  class: "border-2 rounded-lg border-fm-color-primary",
1303
- onClick: v(p)
1299
+ onClick: v(f)
1304
1300
  }, null, 8, ["disabled", "label", "onClick"])
1305
1301
  ]),
1306
1302
  T($, {
1307
- "column-defs": v(f),
1303
+ "column-defs": v(p),
1308
1304
  "row-data": v(i),
1309
1305
  "shrink-at": 9999,
1310
- onRowClick: v(p),
1306
+ onRowClick: v(f),
1311
1307
  "hide-footer": ""
1312
1308
  }, null, 8, ["column-defs", "row-data", "onRowClick"])
1313
1309
  ]),
@@ -1320,21 +1316,21 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1320
1316
  "prepend-icon": "add",
1321
1317
  variant: "plain",
1322
1318
  class: "border-2 rounded-lg border-fm-color-primary",
1323
- onClick: a[2] || (a[2] = (D) => u()),
1319
+ onClick: a[2] || (a[2] = (M) => u()),
1324
1320
  size: "md"
1325
1321
  }, null, 8, ["disabled", "label"])
1326
1322
  ]),
1327
1323
  T(x, {
1328
1324
  placeholder: "Filter items",
1329
1325
  modelValue: m.value,
1330
- "onUpdate:modelValue": a[4] || (a[4] = (D) => m.value = D)
1326
+ "onUpdate:modelValue": a[4] || (a[4] = (M) => m.value = M)
1331
1327
  }, Pe({ _: 2 }, [
1332
1328
  m.value ? {
1333
1329
  name: "append",
1334
1330
  fn: P(() => [
1335
1331
  T(b, {
1336
1332
  name: "close",
1337
- onClick: a[3] || (a[3] = (D) => m.value = ""),
1333
+ onClick: a[3] || (a[3] = (M) => m.value = ""),
1338
1334
  class: "cursor-pointer"
1339
1335
  })
1340
1336
  ]),
@@ -1345,18 +1341,18 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1345
1341
  "search-value": m.value,
1346
1342
  "column-defs": h.value,
1347
1343
  "row-data": v(l).items,
1348
- key: v(l).items.map((D) => D.sku._id).join("."),
1344
+ key: v(l).items.map((M) => M.sku._id).join("."),
1349
1345
  "hide-footer": v(l).items.length <= 10,
1350
1346
  "page-size": Math.min(10, v(l).items.length)
1351
1347
  }, {
1352
- "list-row": P((D) => [
1353
- (k(), V(Ee, {
1354
- row: D,
1348
+ "list-row": P((M) => [
1349
+ (k(), V(Ne, {
1350
+ row: M,
1355
1351
  key: v(l).items.map((S) => S.sku._id).join(".")
1356
1352
  }, {
1357
1353
  default: P((S) => [
1358
- T(Jt, {
1359
- row: D,
1354
+ T(Wt, {
1355
+ row: M,
1360
1356
  "cell-by-col-id": S
1361
1357
  }, null, 8, ["row", "cell-by-col-id"])
1362
1358
  ]),
@@ -1367,7 +1363,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1367
1363
  }, 8, ["search-value", "column-defs", "row-data", "hide-footer", "page-size"])),
1368
1364
  T(w, {
1369
1365
  "model-value": v(l).items.length,
1370
- rules: [v(st)(1)]
1366
+ rules: [v(rt)(1)]
1371
1367
  }, null, 8, ["model-value", "rules"])
1372
1368
  ])
1373
1369
  ]),
@@ -1385,7 +1381,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1385
1381
  emits: ["update:show", "submitted"],
1386
1382
  setup(r, { expose: s, emit: o }) {
1387
1383
  var $;
1388
- const l = r, e = o, t = ee(), y = Z(), { t: p } = B(), f = ut(l, "show");
1384
+ const l = r, e = o, t = ee(), g = Z(), { t: f } = B(), p = ft(l, "show");
1389
1385
  function i() {
1390
1386
  return {
1391
1387
  _id: "",
@@ -1393,7 +1389,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1393
1389
  items: []
1394
1390
  };
1395
1391
  }
1396
- const d = M(l.modelValue ?? i()), m = M((($ = l.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
1392
+ const d = D(l.modelValue ?? i()), m = D((($ = l.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
1397
1393
  Re(
1398
1394
  () => l.show,
1399
1395
  (b) => {
@@ -1401,17 +1397,17 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1401
1397
  b && (d.value = l.modelValue ?? i(), m.value = ((w = l.modelValue) == null ? void 0 : w._id) ?? `${Math.random()}`);
1402
1398
  }
1403
1399
  );
1404
- const g = M(!1), h = E(() => {
1400
+ const y = D(!1), h = E(() => {
1405
1401
  switch (l.mode) {
1406
1402
  case z.READ:
1407
1403
  return "";
1408
1404
  case z.CREATE:
1409
- return p("inventory.closing.template.create.title");
1405
+ return f("inventory.closing.template.create.title");
1410
1406
  case z.UPDATE:
1411
- return p("inventory.closing.template.update.title");
1407
+ return f("inventory.closing.template.update.title");
1412
1408
  }
1413
1409
  return "";
1414
- }), u = M();
1410
+ }), u = D();
1415
1411
  s({
1416
1412
  validateInputs: () => {
1417
1413
  var b, w;
@@ -1429,45 +1425,45 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1429
1425
  async function n() {
1430
1426
  const b = d.value;
1431
1427
  if (b) {
1432
- g.value = !0;
1428
+ y.value = !0;
1433
1429
  try {
1434
- await t.createTemplate(b), await new Promise((w) => setTimeout(w, 1e3)), y.open({
1435
- title: p("inventory.closing.template.create.success"),
1436
- message: p("inventory.closing.template.create.successMessage"),
1430
+ await t.createTemplate(b), await new Promise((w) => setTimeout(w, 1e3)), g.open({
1431
+ title: f("inventory.closing.template.create.success"),
1432
+ message: f("inventory.closing.template.create.successMessage"),
1437
1433
  type: "success"
1438
1434
  }), e("update:show", !1), e("submitted");
1439
1435
  } catch (w) {
1440
- y.open({
1441
- title: p("inventory.closing.template.create.error"),
1442
- message: p("inventory.closing.template.create.errorMessage"),
1436
+ g.open({
1437
+ title: f("inventory.closing.template.create.error"),
1438
+ message: f("inventory.closing.template.create.errorMessage"),
1443
1439
  type: "error"
1444
1440
  }), console.error("Error in creating closing template", w);
1445
1441
  } finally {
1446
- g.value = !1;
1442
+ y.value = !1;
1447
1443
  }
1448
1444
  }
1449
1445
  }
1450
1446
  async function a() {
1451
1447
  const b = d.value;
1452
1448
  if (b) {
1453
- g.value = !0;
1449
+ y.value = !0;
1454
1450
  try {
1455
1451
  await t.updateTemplate({
1456
1452
  ...b,
1457
1453
  _rev: b._rev ?? ""
1458
- }), await new Promise((w) => setTimeout(w, 1e3)), y.open({
1459
- title: p("inventory.closing.template.update.success"),
1460
- message: p("inventory.closing.template.update.successMessage"),
1454
+ }), await new Promise((w) => setTimeout(w, 1e3)), g.open({
1455
+ title: f("inventory.closing.template.update.success"),
1456
+ message: f("inventory.closing.template.update.successMessage"),
1461
1457
  type: "success"
1462
1458
  }), e("update:show", !1), e("submitted");
1463
1459
  } catch (w) {
1464
- y.open({
1465
- title: p("inventory.closing.template.update.error"),
1466
- message: p("inventory.closing.template.update.errorMessage"),
1460
+ g.open({
1461
+ title: f("inventory.closing.template.update.error"),
1462
+ message: f("inventory.closing.template.update.errorMessage"),
1467
1463
  type: "error"
1468
1464
  }), console.error("Error in updating closing template", w);
1469
1465
  } finally {
1470
- g.value = !1;
1466
+ y.value = !1;
1471
1467
  }
1472
1468
  }
1473
1469
  }
@@ -1484,10 +1480,10 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1484
1480
  (w = (b = u.value) == null ? void 0 : b.validateInputs) == null || w.call(b);
1485
1481
  }
1486
1482
  return (b, w) => {
1487
- const A = R("FmButton"), D = R("FmSideSheet");
1488
- return k(), V(D, {
1489
- modelValue: v(f),
1490
- "onUpdate:modelValue": w[2] || (w[2] = (S) => je(f) ? f.value = S : null),
1483
+ const A = R("FmButton"), M = R("FmSideSheet");
1484
+ return k(), V(M, {
1485
+ modelValue: v(p),
1486
+ "onUpdate:modelValue": w[2] || (w[2] = (S) => je(p) ? p.value = S : null),
1491
1487
  "dismiss-away": "",
1492
1488
  "close-button": "",
1493
1489
  "max-width": 800
@@ -1505,21 +1501,21 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1505
1501
  onValidationSuccess: x,
1506
1502
  "model-value": d.value,
1507
1503
  "onUpdate:modelValue": w[0] || (w[0] = (S) => d.value = S),
1508
- disabled: g.value,
1504
+ disabled: y.value,
1509
1505
  key: m.value
1510
1506
  }, null, 8, ["model-value", "disabled"]))
1511
1507
  ]),
1512
1508
  "side-sheet-footer": P(() => [
1513
1509
  _("div", an, [
1514
1510
  T(A, {
1515
- loading: g.value,
1516
- label: v(p)("common.save"),
1511
+ loading: y.value,
1512
+ label: v(f)("common.save"),
1517
1513
  onClick: c
1518
1514
  }, null, 8, ["loading", "label"]),
1519
1515
  T(A, {
1520
- disabled: g.value,
1516
+ disabled: y.value,
1521
1517
  variant: "tertiary",
1522
- label: v(p)("common.close"),
1518
+ label: v(f)("common.close"),
1523
1519
  onClick: w[1] || (w[1] = (S) => e("update:show", !1))
1524
1520
  }, null, 8, ["disabled", "label"])
1525
1521
  ])
@@ -1532,7 +1528,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
1532
1528
  function mn(r, s) {
1533
1529
  return k(), I("div");
1534
1530
  }
1535
- const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-col gap-40" }, pn = { key: 0 }, fn = {
1531
+ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-col gap-40" }, pn = { key: 0 }, fn = {
1536
1532
  key: 1,
1537
1533
  class: "flex gap-8 items-center"
1538
1534
  }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, gn = {
@@ -1545,8 +1541,8 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1545
1541
  __name: "ClosingTemplatePublish",
1546
1542
  emits: ["close"],
1547
1543
  setup(r, { emit: s }) {
1548
- const o = M(!1), l = Z(), e = ee(), t = te(), { t: y } = B(), p = s;
1549
- async function f() {
1544
+ const o = D(!1), l = Z(), e = ee(), t = te(), { t: g } = B(), f = s;
1545
+ async function p() {
1550
1546
  o.value = !0;
1551
1547
  try {
1552
1548
  await e.startNewPublish().delayed(1e3), l.open({
@@ -1554,12 +1550,12 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1554
1550
  message: "You may refresh after a while to review publish status",
1555
1551
  type: "success"
1556
1552
  }), m();
1557
- } catch (g) {
1553
+ } catch (y) {
1558
1554
  l.open({
1559
1555
  title: "Something went wrong",
1560
1556
  message: "Please try again",
1561
1557
  type: "error"
1562
- }), console.error("error on creating publish task", g);
1558
+ }), console.error("error on creating publish task", y);
1563
1559
  } finally {
1564
1560
  o.value = !1;
1565
1561
  }
@@ -1568,9 +1564,9 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1568
1564
  () => t.templates.length && (!i.value || i.value.outlets.length === i.value.completed.length)
1569
1565
  );
1570
1566
  function m() {
1571
- p("close");
1567
+ f("close");
1572
1568
  }
1573
- return (g, h) => {
1569
+ return (y, h) => {
1574
1570
  const u = R("FmCircularProgress"), n = R("i18n-t"), a = R("FmButton");
1575
1571
  return k(), I("div", dn, [
1576
1572
  v(t).templates.length ? o.value ? (k(), I("div", fn, [
@@ -1581,7 +1577,7 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1581
1577
  })
1582
1578
  ]),
1583
1579
  _("div", vn, [
1584
- _("span", null, C(v(y)("inventory.closing.template.publish.publishing")), 1)
1580
+ _("span", null, C(v(g)("inventory.closing.template.publish.publishing")), 1)
1585
1581
  ])
1586
1582
  ])) : i.value ? i.value.outlets.length === i.value.completed.length ? (k(), I("div", yn, [
1587
1583
  T(n, {
@@ -1596,7 +1592,7 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1596
1592
  ]),
1597
1593
  _: 1
1598
1594
  }),
1599
- _("p", null, C(v(y)("inventory.closing.template.publish.message")), 1)
1595
+ _("p", null, C(v(g)("inventory.closing.template.publish.message")), 1)
1600
1596
  ])) : (k(), I("div", _n, [
1601
1597
  T(n, {
1602
1598
  keypath: "inventory.closing.template.publish.stillPublishing",
@@ -1612,17 +1608,17 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1612
1608
  }),
1613
1609
  Fe(" Your recent publishing task is still pending (" + C(i.value.completed.length) + " / " + C(i.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
1614
1610
  ])) : (k(), I("div", gn, [
1615
- _("p", null, C(v(y)("inventory.closing.template.publish.noRecentActivity")), 1),
1616
- _("p", null, C(v(y)("inventory.closing.template.publish.message")), 1)
1611
+ _("p", null, C(v(g)("inventory.closing.template.publish.noRecentActivity")), 1),
1612
+ _("p", null, C(v(g)("inventory.closing.template.publish.message")), 1)
1617
1613
  ])) : (k(), I("div", pn, [
1618
- _("p", null, C(v(y)("inventory.closing.template.publish.nothingToPublish")), 1)
1614
+ _("p", null, C(v(g)("inventory.closing.template.publish.nothingToPublish")), 1)
1619
1615
  ])),
1620
1616
  _("div", kn, [
1621
1617
  T(a, {
1622
1618
  disabled: !d.value,
1623
1619
  loading: o.value,
1624
1620
  label: "Publish to all outlets",
1625
- onClick: f
1621
+ onClick: p
1626
1622
  }, null, 8, ["disabled", "loading"]),
1627
1623
  T(a, {
1628
1624
  variant: "tertiary",
@@ -1633,12 +1629,12 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1633
1629
  ]);
1634
1630
  };
1635
1631
  }
1636
- }), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Dn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Bn = /* @__PURE__ */ O({
1632
+ }), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Dn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Mn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Un = /* @__PURE__ */ O({
1637
1633
  __name: "ClosingTemplateView",
1638
1634
  setup(r) {
1639
- const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps: y, templateDetailsProps: p } = Ve(se()), f = le(), i = ie(), d = te(), m = rt(), { breakpoints: g } = dt();
1640
- f.watchLocation(d.fetchTemplates);
1641
- const h = E(() => d.loading), u = M(""), n = E(() => g.value.xs || g.value.sm), a = E(() => n.value ? 10 : 20);
1635
+ const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps: g, templateDetailsProps: f } = Le(se()), p = le(), i = ie(), d = te(), m = mt(), { breakpoints: y } = vt();
1636
+ p.watchLocation(d.fetchTemplates);
1637
+ const h = E(() => d.loading), u = D(""), n = E(() => y.value.xs || y.value.sm), a = E(() => n.value ? 10 : 20);
1642
1638
  function x(w) {
1643
1639
  switch (w) {
1644
1640
  case N.Add:
@@ -1723,9 +1719,9 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1723
1719
  }
1724
1720
  ]);
1725
1721
  return (w, A) => {
1726
- const D = R("FmTable");
1722
+ const M = R("FmTable");
1727
1723
  return k(), I(H, null, [
1728
- T(it, {
1724
+ T(ut, {
1729
1725
  title: v(s)("inventory.closing.template.title"),
1730
1726
  actions: b.value,
1731
1727
  "onClick:action": x
@@ -1740,12 +1736,12 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1740
1736
  }
1741
1737
  ])
1742
1738
  }, [
1743
- T(ct, {
1739
+ T(dt, {
1744
1740
  searchable: "",
1745
1741
  search: u.value,
1746
1742
  "onUpdate:search": A[0] || (A[0] = (S) => u.value = S)
1747
1743
  }, null, 8, ["search"]),
1748
- T(D, {
1744
+ T(M, {
1749
1745
  style: Ye(v(m).tableHeight),
1750
1746
  "column-defs": v(d).columnDefs,
1751
1747
  "row-data": v(d).templates,
@@ -1755,19 +1751,19 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1755
1751
  "page-size": a.value
1756
1752
  }, {
1757
1753
  "list-row": P((S) => [
1758
- T(Ee, {
1754
+ T(Ne, {
1759
1755
  row: S,
1760
1756
  onRowClick: (U) => v(l)(U)
1761
1757
  }, {
1762
1758
  default: P((U) => {
1763
- var me, ue, de, W, pe, fe, ve, ge, q, ye, he, be, _e, xe, we, Q, ke, Te, $e, Ce, X, Ie;
1759
+ var me, ue, de, J, pe, fe, ve, ge, q, ye, he, be, _e, xe, we, Q, ke, Te, $e, Ce, X, Ie;
1764
1760
  return [
1765
1761
  _("div", $n, [
1766
1762
  _("div", Cn, [
1767
1763
  _("div", In, [
1768
1764
  T(v(j), {
1769
1765
  render: (de = (ue = (me = U._id) == null ? void 0 : me.column) == null ? void 0 : ue.columnDef) == null ? void 0 : de.cell,
1770
- props: (pe = (W = U._id) == null ? void 0 : W.getContext) == null ? void 0 : pe.call(W)
1766
+ props: (pe = (J = U._id) == null ? void 0 : J.getContext) == null ? void 0 : pe.call(J)
1771
1767
  }, null, 8, ["render", "props"])
1772
1768
  ]),
1773
1769
  _("div", Sn, [
@@ -1779,11 +1775,11 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1779
1775
  _("div", null, C((he = S.original.locations) != null && he.length ? v(s)("inventory.closing.table.enabledForN", {
1780
1776
  count: ((be = S.original.locations) == null ? void 0 : be.length) ?? 0
1781
1777
  }) : v(s)("inventory.closing.table.enabledForAll")), 1),
1782
- _("div", Mn, C([
1778
+ _("div", Dn, C([
1783
1779
  ...S.original.items.slice(0, 3).map((Oe) => Oe.sku.name),
1784
1780
  ...S.original.items.length >= 3 ? [`and ${S.original.items.length - 3} more items`] : []
1785
1781
  ].join(", ")), 1),
1786
- _("div", Dn, [
1782
+ _("div", Mn, [
1787
1783
  T(v(j), {
1788
1784
  render: (we = (xe = (_e = U.ref) == null ? void 0 : _e.column) == null ? void 0 : xe.columnDef) == null ? void 0 : we.cell,
1789
1785
  props: (ke = (Q = U.ref) == null ? void 0 : Q.getContext) == null ? void 0 : ke.call(Q)
@@ -1808,9 +1804,9 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1808
1804
  ]),
1809
1805
  _: 1
1810
1806
  }, 8, ["title", "actions"]),
1811
- (k(), V(Ke, { to: "body" }, [
1812
- T(un, Ge(Je(v(p))), null, 16),
1813
- T(rn, We(v(y), {
1807
+ (k(), V(Ge, { to: "body" }, [
1808
+ T(un, Ke(We(v(f))), null, 16),
1809
+ T(rn, Je(v(g), {
1814
1810
  onSubmitted: A[2] || (A[2] = (S) => v(d).fetchTemplates())
1815
1811
  }), null, 16)
1816
1812
  ]))
@@ -1819,5 +1815,5 @@ const un = /* @__PURE__ */ at(cn, [["render", mn]]), dn = { class: "flex flex-co
1819
1815
  }
1820
1816
  });
1821
1817
  export {
1822
- Bn as default
1818
+ Un as default
1823
1819
  };