@feedmepos/mf-inventory-portal 1.2.43 → 1.2.44-dev.1

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 (95) hide show
  1. package/dist/{App-DVsAv4k3.js → App-D6h4PbkJ.js} +3 -3
  2. package/dist/{ApprovalView-EHDiLsmL.js → ApprovalView-Bll-QWib.js} +5 -5
  3. package/dist/{BindingsDialog-DL2Dgzpf.js → BindingsDialog-cm-tG1Du.js} +8 -8
  4. package/dist/{BindingsPicker-BpdNqjSm.js → BindingsPicker-Ca0BxJKj.js} +3 -3
  5. package/dist/{BindingsTable-C6KWR_kl.js → BindingsTable-BBNWeq4W.js} +3 -3
  6. package/dist/{ClosingDraftView-Byx8Zp15.js → ClosingDraftView-r2C27qph.js} +766 -723
  7. package/dist/ClosingHistoryView-CGV72nOD.js +447 -0
  8. package/dist/{ClosingTemplateView-DqfxzSBi.js → ClosingTemplateView-Xij995aZ.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-DvaTq4XO.js → DeliveryOrderPrintPreview-BoBBu5lC.js} +9 -9
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dadg0d7W.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-SnXudMX4.js} +59 -60
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yp0tPBLr.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-ClY0PFyA.js} +2 -2
  12. package/dist/{FmMultiselectDialog-M-tcECkK.js → FmMultiselectDialog-BcZpbDMT.js} +2 -2
  13. package/dist/{FmMultiselectDialog-iXXJJ181.js → FmMultiselectDialog-C9g5u6Kk.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CzYmgtjx.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B-PD6CbF.js} +3 -3
  15. package/dist/{ImportView-BGbe571V.js → ImportView-CzMwJY2A.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-SkZJQR4H.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DgOrurbQ.js} +1 -1
  17. package/dist/{IngredientGroupView-B5AhZqGE.js → IngredientGroupView-DBbwP3E6.js} +5 -5
  18. package/dist/{IngredientsView-BkORfSgQ.js → IngredientsView-jRqkzOTc.js} +14 -14
  19. package/dist/{IntegrationView-DC1u6d1K.js → IntegrationView-B-_39POT.js} +12 -12
  20. package/dist/{InventoryBindingForm-D4ht1PMO.js → InventoryBindingForm-D14aWQqg.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CFWTE_sj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DtHtGqKw.js} +14 -14
  22. package/dist/{InventoryBindingSummary-DKYKoLOt.js → InventoryBindingSummary-B7Q-G4Fx.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D1hfyifk.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CqB7pkKN.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BfsTUKPQ.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BfHSMN6k.js} +2 -2
  25. package/dist/{PublishView-CMTQJ7Nv.js → PublishView-C_icogKG.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-CzYlYowQ.js → PurchaseOrderPrintPreview-BeXqhfRn.js} +9 -9
  27. package/dist/ReceiveRequestView-COdOrOyg.js +2894 -0
  28. package/dist/{RecipeView-CIwSZuEd.js → RecipeView-Desvtm1a.js} +8 -8
  29. package/dist/{StockView-DBY2sHlj.js → StockView-B1NDBHQh.js} +344 -341
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-VY2KygFc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CbCD3pOQ.js} +1 -1
  31. package/dist/{SupplierView-CGsqiXR4.js → SupplierView-CB6Gz5HH.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BUs4-nO6.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-3bruORgT.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-plLh-5S3.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C0Vd0X-5.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-C8DluFT4.js → TransferDetails.vue_vue_type_script_setup_true_lang-Bnt6-X4t.js} +306 -306
  35. package/dist/{TransferTemplateView-BEXsC7mp.js → TransferTemplateView-CLeLzBvW.js} +354 -354
  36. package/dist/{UnitView-BGRkT8Hr.js → UnitView-YM302P8g.js} +6 -6
  37. package/dist/{WarehouseView-D7og7WBg.js → WarehouseView-D69BsVsb.js} +5 -5
  38. package/dist/WastageTemplateView-DfP43M8-.js +2327 -0
  39. package/dist/api/stock.d.ts +2 -0
  40. package/dist/{app-CioeggUO.js → app-BuvV4n4w.js} +2344 -2296
  41. package/dist/app.js +7 -7
  42. package/dist/{closing-template-DrBlhTbC.js → closing-template-D1NlAV-G.js} +1 -1
  43. package/dist/{date2-mucf0HV-.js → date2-CkkGwYSP.js} +1 -1
  44. package/dist/{dayjs.min-C5lVIjQ1.js → dayjs.min-DFvOuCCo.js} +21 -21
  45. package/dist/{decimal-EYAs7CPT.js → decimal-D1O4-kbG.js} +2 -2
  46. package/dist/{defineDeepModel-BQ_3cF8o.js → defineDeepModel-s0no34Rq.js} +1 -1
  47. package/dist/{duplicate-template-K_oezMr4.js → duplicate-template-DJceVj9n.js} +1 -1
  48. package/dist/feature-AINxwcz_.js +25697 -0
  49. package/dist/{format-time-from-id-qnJY4xQY.js → format-time-from-id-CRiwabgV.js} +1 -1
  50. package/dist/{format-unit-display-6I_PHQ9C.js → format-unit-display-kd8gPWFg.js} +245 -246
  51. package/dist/helper/form.d.ts +1 -0
  52. package/dist/helper/object.d.ts +21 -0
  53. package/dist/helper/reactivity.d.ts +11 -0
  54. package/dist/helper/reactivity.spec.d.ts +1 -0
  55. package/dist/{import-export.helper-vmA8rXwv.js → import-export.helper-CtI9oUN_.js} +5 -5
  56. package/dist/{index-5yza2WJR.js → index-Af5Cs7r5.js} +1 -1
  57. package/dist/{index-DXJ9MIiE.js → index-BVBQnKv6.js} +9 -9
  58. package/dist/{index-DqMYKP87.js → index-DKTL7IN3.js} +3 -3
  59. package/dist/{lodash-D6iOSfR7.js → lodash-TAQPcjEK.js} +1 -1
  60. package/dist/{netsuite-DKE_ORM0.js → netsuite-CcC4Y1c-.js} +70 -70
  61. package/dist/{purchase-order-template-Brpbfw8K.js → purchase-order-template-B-Xuh5oQ.js} +1 -1
  62. package/dist/{rules-fd3m4inF.js → rules-DwOMpBOV.js} +3 -3
  63. package/dist/{stock-CLX4SKxt.js → stock-DolMZJgQ.js} +3 -3
  64. package/dist/{stock-8-vRigjE.js → stock-X1ADgvOm.js} +35 -27
  65. package/dist/{supplier-Dlv1Clk5.js → supplier-DTzECjWy.js} +2 -2
  66. package/dist/tsconfig.app.tsbuildinfo +1 -1
  67. package/dist/{use-ingredient-select-dialog-2j3Nbou_.js → use-ingredient-select-dialog-D7UCiLcS.js} +2 -2
  68. package/dist/{use-inventory-binding-dialog-_S2XGoVU.js → use-inventory-binding-dialog-uYYsTsLi.js} +2 -2
  69. package/dist/{use-template-enabled-locations-2-CWlQQnyD.js → use-template-enabled-locations-2-l2e5ocrp.js} +2 -2
  70. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +7 -0
  71. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
  72. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +1 -0
  73. package/dist/views/receive-request/components/netsuite/NetSuitePanel.vue.d.ts +3 -2
  74. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +3 -2
  75. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +6 -0
  76. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +628 -0
  77. package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +22 -0
  78. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +3 -2
  79. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
  80. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -6
  81. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
  82. package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +2 -2
  83. package/dist/views/receive-request/helper/get-transfer-type.d.ts +1 -2
  84. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +3 -2
  85. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +3 -2
  86. package/dist/views/transfer-template/helpers/import-export.helper.d.ts +4 -3
  87. package/dist/{vue-i18n-CCrvzsiW.js → vue-i18n-anAmA_v_.js} +376 -376
  88. package/dist/{xlsx-oL4emcgf.js → xlsx-CtBehOaB.js} +398 -398
  89. package/dist/{xlsx.util-JOeDOZ3P.js → xlsx.util-jpTCFIaP.js} +1 -1
  90. package/package.json +3 -3
  91. package/dist/ClosingHistoryView-BpFFNCqD.js +0 -391
  92. package/dist/ReceiveRequestView-CMHZZ9ul.js +0 -2841
  93. package/dist/WastageTemplateView-CwEUAwCw.js +0 -2287
  94. package/dist/feature-BkR98vGd.js +0 -20161
  95. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -3159
@@ -1,56 +1,56 @@
1
- import { defineComponent as Ee, ref as Y, computed as L, onMounted as qe, resolveComponent as z, openBlock as F, createElementBlock as E, Fragment as le, createTextVNode as oe, createBlock as ie, withCtx as Q, createElementVNode as c, toDisplayString as ae, unref as $, createVNode as w, createCommentVNode as ne, h as A, reactive as jt, watch as It, isRef as ft, normalizeClass as Fe, renderList as Be, normalizeStyle as pt, Teleport as Ut, mergeProps as Pt } from "vue";
2
- import { F as vt, u as Rt, _ as Mt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
- import { useCoreStore as gt, useI18n as yt } from "@feedmepos/mf-common";
4
- import { useSnackbar as We, useDialog as Vt, useProxiedModel as Lt, components as ke, useBreakpoints as Nt } from "@feedmepos/ui-library";
5
- import { o as Et, u as ze, G as O, s as V, H as bt, I as ve, z as Qe, t as Me, c as zt, a as Ht } from "./app-CioeggUO.js";
6
- import { defineStore as kt, storeToRefs as Ot } from "pinia";
7
- import { d as Le, e as ht, f as Yt, a as he } from "./date2-mucf0HV-.js";
8
- import { R as Kt, f as Ze, a as Ge, t as Qt, d as Te, o as Dt, p as xt, m as At, l as Gt } from "./rules-fd3m4inF.js";
9
- import { b as qt, d as Wt } from "./xlsx.util-JOeDOZ3P.js";
10
- import { u as _t } from "./stock-CLX4SKxt.js";
11
- import { u as Je } from "./stock-8-vRigjE.js";
12
- import { D as dt, R as Se } from "./row-action.enum-BcW_L_nE.js";
13
- import { c as Zt, _ as Jt, F as Re } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
14
- import { f as Xt } from "./format-time-from-id-qnJY4xQY.js";
15
- import { _ as ea } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yp0tPBLr.js";
16
- import { E as ta } from "./empty-placeholder-wf6-BWE8.js";
17
- const He = Et((r, s) => {
1
+ import { defineComponent as He, ref as Y, computed as L, onMounted as Ze, resolveComponent as z, openBlock as S, createElementBlock as E, Fragment as ie, createTextVNode as se, createBlock as oe, withCtx as Q, createElementVNode as c, toDisplayString as ne, unref as $, createVNode as A, createCommentVNode as te, h as x, reactive as It, watch as Ut, isRef as vt, normalizeClass as Fe, renderList as Te, normalizeStyle as gt, Teleport as Pt, mergeProps as Rt } from "vue";
2
+ import { F as Ge, u as Mt, _ as Vt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
+ import { useCoreStore as yt, useI18n as bt } from "@feedmepos/mf-common";
4
+ import { useSnackbar as Je, useDialog as Lt, useProxiedModel as Nt, components as ge, useBreakpoints as Et } from "@feedmepos/ui-library";
5
+ import { o as zt, u as Oe, H as O, s as V, I as ht, J as pe, A as Ve, v as Le, c as Ht, a as Ot } from "./app-BuvV4n4w.js";
6
+ import { defineStore as kt, storeToRefs as Yt } from "pinia";
7
+ import { d as Ee, e as Dt, f as Kt, a as ye } from "./date2-CkkGwYSP.js";
8
+ import { R as Qt, f as Xe, a as We, t as qt, d as je, o as xt, p as At, m as _t, l as Gt } from "./rules-DwOMpBOV.js";
9
+ import { b as Wt, d as Zt } from "./xlsx.util-jpTCFIaP.js";
10
+ import { u as wt } from "./stock-DolMZJgQ.js";
11
+ import { u as et } from "./stock-X1ADgvOm.js";
12
+ import { D as pt, R as Se } from "./row-action.enum-BcW_L_nE.js";
13
+ import { c as Jt, _ as Xt, F as Me } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
14
+ import { f as ea } from "./format-time-from-id-CRiwabgV.js";
15
+ import { _ as ta } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-ClY0PFyA.js";
16
+ import { E as aa } from "./empty-placeholder-wf6-BWE8.js";
17
+ const Ye = zt((l, s) => {
18
18
  function e() {
19
- return ze().currentLocation.dbName;
19
+ return Oe().currentLocation.dbName;
20
20
  }
21
21
  return {
22
- async getDraft(m) {
23
- const b = e(), g = `${r.inventoryBackendUrl}/${b}/closing-draft/${m}`;
24
- return s.get(g);
22
+ async getDraft(d) {
23
+ const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/${d}`;
24
+ return s.get(y);
25
25
  },
26
26
  async readDrafts() {
27
- const m = e(), b = `${r.inventoryBackendUrl}/${m}/closing-draft`;
28
- return s.get(b);
27
+ const d = e(), h = `${l.inventoryBackendUrl}/${d}/closing-draft`;
28
+ return s.get(h);
29
29
  },
30
- async runOperation(m) {
31
- const b = e(), g = `${r.inventoryBackendUrl}/${b}/closing-draft/run-operation`;
32
- return s.post(g, m);
30
+ async runOperation(d) {
31
+ const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/run-operation`;
32
+ return s.post(y, d);
33
33
  },
34
- async runOperationV1(m) {
35
- const b = e(), g = `${r.inventoryBackendUrl}/${b}/closing-draft/v1/run-operation`;
36
- return s.post(g, m);
34
+ async runOperationV1(d) {
35
+ const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/v1/run-operation`;
36
+ return s.post(y, d);
37
37
  },
38
- async sync(m) {
39
- const b = e(), g = `${r.inventoryBackendUrl}/${b}/closing-draft/sync`;
40
- return s.post(g, m);
38
+ async sync(d) {
39
+ const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/sync`;
40
+ return s.post(y, d);
41
41
  },
42
- async cloneDraft(m) {
43
- const b = e(), g = `${r.inventoryBackendUrl}/${b}/closing-draft/${m}/clone`;
44
- return s.post(g, {});
42
+ async cloneDraft(d) {
43
+ const h = e(), y = `${l.inventoryBackendUrl}/${h}/closing-draft/${d}/clone`;
44
+ return s.post(y, {});
45
45
  }
46
46
  };
47
- }), aa = { class: "fm-typo-en-body-lg-400" }, na = { class: "fm-typo-en-body-lg-600" }, oa = {
47
+ }), na = { class: "fm-typo-en-body-lg-400" }, oa = { class: "fm-typo-en-body-lg-600" }, sa = {
48
48
  key: 0,
49
49
  class: "flex flex-col"
50
- }, sa = {
50
+ }, ra = {
51
51
  key: 0,
52
52
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
53
- }, ra = { class: "flex gap-12 py-8 justify-end w-full" }, Ke = /* @__PURE__ */ Ee({
53
+ }, la = { class: "flex gap-12 py-8 justify-end w-full" }, qe = /* @__PURE__ */ He({
54
54
  __name: "ClosingDraftAction",
55
55
  props: {
56
56
  draft: {},
@@ -58,8 +58,8 @@ const He = Et((r, s) => {
58
58
  onCancel: { type: Function },
59
59
  onFinished: { type: Function }
60
60
  },
61
- setup(r) {
62
- const s = r, e = Y(), m = He(), b = We(), g = Y(!1), y = Y(null), I = Y(!1), N = L(() => {
61
+ setup(l) {
62
+ const s = l, e = Y(), d = Ye(), h = Je(), y = Y(!1), b = Y(null), I = Y(!1), M = L(() => {
63
63
  switch (s.action) {
64
64
  case O.enum.approveDraft:
65
65
  return "Approve";
@@ -80,221 +80,221 @@ const He = Et((r, s) => {
80
80
  }
81
81
  throw new Error(`Unknown action: ${s.action}`);
82
82
  });
83
- qe(() => {
83
+ Ze(() => {
84
84
  if (s.draft.effectiveAt)
85
- y.value = new Date(s.draft.effectiveAt);
85
+ b.value = new Date(s.draft.effectiveAt);
86
86
  else {
87
87
  const u = new Date(s.draft.createdAt);
88
- u.setHours(23, 59, 59, 999), y.value = u;
88
+ u.setHours(23, 59, 59, 999), b.value = u;
89
89
  }
90
90
  I.value = !0;
91
91
  });
92
- const D = L({
92
+ const k = L({
93
93
  get() {
94
- return y.value === null ? "" : Le(y.value);
94
+ return b.value === null ? "" : Ee(b.value);
95
95
  },
96
96
  set(u) {
97
97
  if (u) {
98
98
  const t = /* @__PURE__ */ new Date(`${u} ${P.value}`);
99
- t.setSeconds(59, 999), y.value = t;
99
+ t.setSeconds(59, 999), b.value = t;
100
100
  } else
101
- y.value = null;
101
+ b.value = null;
102
102
  }
103
103
  }), P = L({
104
104
  get() {
105
- return y.value === null ? "" : ht(y.value);
105
+ return b.value === null ? "" : Dt(b.value);
106
106
  },
107
107
  set(u) {
108
108
  if (u) {
109
- const t = /* @__PURE__ */ new Date(`${D.value} ${u}`);
110
- t.setSeconds(59, 999), y.value = t;
109
+ const t = /* @__PURE__ */ new Date(`${k.value} ${u}`);
110
+ t.setSeconds(59, 999), b.value = t;
111
111
  } else
112
- y.value = null;
112
+ b.value = null;
113
113
  }
114
- }), B = L(() => y.value ? y.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
115
- async function K(u) {
116
- g.value = !0;
114
+ }), B = L(() => b.value ? b.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
115
+ async function q(u) {
116
+ y.value = !0;
117
117
  try {
118
- u ? await m.runOperationV1({
118
+ u ? await d.runOperationV1({
119
119
  _id: s.draft._id,
120
120
  _rev: s.draft._rev ?? "",
121
121
  action: s.action,
122
122
  data: {
123
- effectiveAt: y.value ? y.value.toISOString() : null,
123
+ effectiveAt: b.value ? b.value.toISOString() : null,
124
124
  remark: e.value
125
125
  }
126
- }).delayed(500) : await m.runOperation({
126
+ }).delayed(500) : await d.runOperation({
127
127
  _id: s.draft._id,
128
128
  _rev: s.draft._rev ?? "",
129
129
  action: s.action,
130
130
  data: {
131
- effectiveAt: y.value ? y.value.toISOString() : null,
131
+ effectiveAt: b.value ? b.value.toISOString() : null,
132
132
  remark: e.value
133
133
  }
134
- }).delayed(500), b.open({
134
+ }).delayed(500), h.open({
135
135
  title: "Success",
136
136
  message: "Action submitted",
137
137
  type: "success"
138
138
  }), s.onFinished();
139
139
  } catch (t) {
140
- b.open({
140
+ h.open({
141
141
  title: "Something went wrong",
142
142
  message: (t == null ? void 0 : t.message) ?? "Unable to submit action. Please try again",
143
143
  type: "error"
144
144
  }), console.error("error on submit closing draft action", t);
145
145
  } finally {
146
- g.value = !1;
146
+ y.value = !1;
147
147
  }
148
148
  }
149
149
  return (u, t) => {
150
- const _ = z("FmLabel"), R = z("FmDatePicker"), k = z("FmTimePicker"), d = z("FmTextField"), h = z("FmButton"), M = z("FmForm");
151
- return I.value ? (F(), ie(M, {
150
+ const _ = z("FmLabel"), R = z("FmDatePicker"), N = z("FmTimePicker"), g = z("FmTextField"), m = z("FmButton"), F = z("FmForm");
151
+ return I.value ? (S(), oe(F, {
152
152
  key: 1,
153
- onValidationSuccess: K,
153
+ onValidationSuccess: q,
154
154
  class: "flex flex-col gap-32",
155
- disabled: g.value
155
+ disabled: y.value
156
156
  }, {
157
157
  default: Q(() => [
158
- c("div", aa, [
159
- t[5] || (t[5] = oe(" You are about to ")),
160
- c("span", na, ae(N.value), 1),
161
- t[6] || (t[6] = oe(" this draft. Please provide a remark to justify this action. "))
158
+ c("div", na, [
159
+ t[5] || (t[5] = se(" You are about to ")),
160
+ c("span", oa, ne(M.value), 1),
161
+ t[6] || (t[6] = se(" this draft. Please provide a remark to justify this action. "))
162
162
  ]),
163
- u.action === $(O).enum.approveDraft ? (F(), E("div", oa, [
164
- w(_, { class: "fm-typo-en-body-lg-600" }, {
163
+ u.action === $(O).enum.approveDraft ? (S(), E("div", sa, [
164
+ A(_, { class: "fm-typo-en-body-lg-600" }, {
165
165
  default: Q(() => t[7] || (t[7] = [
166
- oe("Closing Date")
166
+ se("Closing Date")
167
167
  ])),
168
168
  _: 1
169
169
  }),
170
- w(R, {
171
- modelValue: D.value,
172
- "onUpdate:modelValue": t[0] || (t[0] = (H) => D.value = H),
173
- max: $(Le)(/* @__PURE__ */ new Date())
170
+ A(R, {
171
+ modelValue: k.value,
172
+ "onUpdate:modelValue": t[0] || (t[0] = (H) => k.value = H),
173
+ max: $(Ee)(/* @__PURE__ */ new Date())
174
174
  }, null, 8, ["modelValue", "max"]),
175
- w(_, { class: "fm-typo-en-body-lg-600" }, {
175
+ A(_, { class: "fm-typo-en-body-lg-600" }, {
176
176
  default: Q(() => t[8] || (t[8] = [
177
- oe("Closing Time")
177
+ se("Closing Time")
178
178
  ])),
179
179
  _: 1
180
180
  }),
181
- w(k, {
181
+ A(N, {
182
182
  modelValue: P.value,
183
183
  "onUpdate:modelValue": t[1] || (t[1] = (H) => P.value = H)
184
184
  }, null, 8, ["modelValue"]),
185
- B.value ? (F(), E("div", sa, " Cannot select future date ")) : ne("", !0)
186
- ])) : ne("", !0),
187
- w(d, {
185
+ B.value ? (S(), E("div", ra, " Cannot select future date ")) : te("", !0)
186
+ ])) : te("", !0),
187
+ A(g, {
188
188
  modelValue: e.value,
189
189
  "onUpdate:modelValue": t[2] || (t[2] = (H) => e.value = H),
190
190
  label: "Remark",
191
191
  "label-mark": "required",
192
- rules: [$(Kt)()]
192
+ rules: [$(Qt)()]
193
193
  }, null, 8, ["modelValue", "rules"]),
194
- c("div", ra, [
195
- w(h, {
194
+ c("div", la, [
195
+ A(m, {
196
196
  label: "Cancel",
197
197
  variant: "tertiary",
198
198
  onClick: t[3] || (t[3] = (H) => u.onCancel())
199
199
  }),
200
- u.action === $(O).enum.approveDraft ? (F(), ie(vt, { key: 0 }, {
200
+ u.action === $(O).enum.approveDraft ? (S(), oe(Ge, { key: 0 }, {
201
201
  default: Q(() => [
202
- w(h, {
202
+ A(m, {
203
203
  label: "Approve (Legacy)",
204
204
  type: "button",
205
- onClick: t[4] || (t[4] = (H) => K(!0)),
205
+ onClick: t[4] || (t[4] = (H) => q(!0)),
206
206
  variant: U.value,
207
- loading: g.value,
207
+ loading: y.value,
208
208
  disabled: B.value
209
209
  }, null, 8, ["variant", "loading", "disabled"])
210
210
  ]),
211
211
  _: 1
212
- })) : ne("", !0),
213
- w(h, {
214
- label: N.value,
212
+ })) : te("", !0),
213
+ A(m, {
214
+ label: M.value,
215
215
  type: "submit",
216
216
  variant: U.value,
217
- loading: g.value
217
+ loading: y.value
218
218
  }, null, 8, ["label", "variant", "loading"])
219
219
  ])
220
220
  ]),
221
221
  _: 1
222
- }, 8, ["disabled"])) : (F(), E(le, { key: 0 }, [
223
- oe("Loading")
222
+ }, 8, ["disabled"])) : (S(), E(ie, { key: 0 }, [
223
+ se("Loading")
224
224
  ], 64));
225
225
  };
226
226
  }
227
- }), la = Te(0);
228
- function wt(r) {
229
- const s = r.measurementsAmounts.groupBy((m) => m.measurement.id), e = r.sku.unit.measurements.reduce((m, b) => {
230
- var I, N;
231
- const g = ((N = (I = s.get(b.id)) == null ? void 0 : I[0]) == null ? void 0 : N.amount) ?? la, y = Ze(b.conversion, g);
232
- return m + +Ge(y);
233
- }, +Ge(r.baseAmount));
234
- return Qt(e, r.baseAmount.precision);
227
+ }), ia = je(0);
228
+ function St(l) {
229
+ const s = l.measurementsAmounts.groupBy((d) => d.measurement.id), e = l.sku.unit.measurements.reduce((d, h) => {
230
+ var I, M;
231
+ const y = ((M = (I = s.get(h.id)) == null ? void 0 : I[0]) == null ? void 0 : M.amount) ?? ia, b = Xe(h.conversion, y);
232
+ return d + +We(b);
233
+ }, +We(l.baseAmount));
234
+ return qt(e, l.baseAmount.precision);
235
235
  }
236
- const ia = Te(0), ca = Te(100), St = "N/A";
237
- function ua(r, s, e, m, b, g) {
238
- var W, G, S, X, me;
239
- const y = wt(r), I = m ?? y, N = Dt(I, s), U = s.amount === 0 ? null : xt(N, {
236
+ const ca = je(0), ua = je(100), Ft = "N/A";
237
+ function ma(l, s, e, d, h, y) {
238
+ var K, J, w, X, me;
239
+ const b = St(l), I = d ?? b, M = xt(I, s), U = s.amount === 0 ? null : At(M, {
240
240
  ...s,
241
241
  amount: Math.abs(s.amount)
242
- }), D = U ? Ze(U, ca) : null, P = ((W = r.sku.defaultCost) == null ? void 0 : W.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(V.toFormatString({ value: P })), K = ((S = (G = r.sku.defaultCost) == null ? void 0 : G.measurement) == null ? void 0 : S.conversion) ?? {
242
+ }), k = U ? Xe(U, ua) : null, P = ((K = l.sku.defaultCost) == null ? void 0 : K.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(V.toFormatString({ value: P })), q = ((w = (J = l.sku.defaultCost) == null ? void 0 : J.measurement) == null ? void 0 : w.conversion) ?? {
243
243
  amount: 1,
244
244
  precision: 0
245
245
  }, u = Number(
246
- V.toFormatString({ value: K })
247
- ), t = b ? Number(V.toFormatString({ value: b })) : 0, _ = Number(V.toFormatString({ value: s })), R = Number(V.toFormatString({ value: I })), k = _ - R, d = k * B / u, h = R * B / u, M = _ * B / u;
246
+ V.toFormatString({ value: q })
247
+ ), t = h ? Number(V.toFormatString({ value: h })) : 0, _ = Number(V.toFormatString({ value: s })), R = Number(V.toFormatString({ value: I })), N = _ - R, g = N * B / u, m = R * B / u, F = _ * B / u;
248
248
  return {
249
- code: r.sku.code,
250
- name: r.sku.name,
251
- baseUnit: r.sku.unit.abbrev,
252
- costUnit: ((me = (X = r.sku.defaultCost) == null ? void 0 : X.measurement) == null ? void 0 : me.abbrev) ?? null,
253
- baseUnitAmount: Number(V.toFormatString({ value: r.baseAmount })),
254
- ...r.measurementsAmounts.filter(
255
- (ee) => ma(ee.measurement) && e.includes(ee.measurement.id)
249
+ code: l.sku.code,
250
+ name: l.sku.name,
251
+ baseUnit: l.sku.unit.abbrev,
252
+ costUnit: ((me = (X = l.sku.defaultCost) == null ? void 0 : X.measurement) == null ? void 0 : me.abbrev) ?? null,
253
+ baseUnitAmount: Number(V.toFormatString({ value: l.baseAmount })),
254
+ ...l.measurementsAmounts.filter(
255
+ (ae) => da(ae.measurement) && e.includes(ae.measurement.id)
256
256
  ).reduce(
257
- (ee, se, de) => (ee[`measurementAbbrev${de}`] = `(${se.measurement.abbrev}) × ${V.toFormatString({ value: se.measurement.conversion })}`, ee[`measurementAmount${de}`] = Number(V.toFormatString({ value: se.amount })), ee),
257
+ (ae, re, de) => (ae[`measurementAbbrev${de}`] = `(${re.measurement.abbrev}) × ${V.toFormatString({ value: re.measurement.conversion })}`, ae[`measurementAmount${de}`] = Number(V.toFormatString({ value: re.amount })), ae),
258
258
  {}
259
259
  ),
260
260
  systemBalance: _,
261
261
  physicalBalance: R,
262
- adjustedAmount: Number(V.toFormatString({ value: N })),
263
- adjustedDiffPercentage: D ? Number(
262
+ adjustedAmount: Number(V.toFormatString({ value: M })),
263
+ adjustedDiffPercentage: k ? Number(
264
264
  V.toFormatString({
265
- value: At(D, 2)
265
+ value: _t(k, 2)
266
266
  })
267
267
  ) : null,
268
268
  costPerUnit: B,
269
269
  opening: t,
270
- adjustmentTypes: g ?? St,
271
- varianceQty: k,
272
- varianceInCost: d,
273
- stockTakeValue: h,
274
- systemValue: M
270
+ adjustmentTypes: y ?? Ft,
271
+ varianceQty: N,
272
+ varianceInCost: g,
273
+ stockTakeValue: m,
274
+ systemValue: F
275
275
  };
276
276
  }
277
- function ma(r) {
278
- return !r.abbrev.toLocaleLowerCase().includes("inactive");
277
+ function da(l) {
278
+ return !l.abbrev.toLocaleLowerCase().includes("inactive");
279
279
  }
280
- function da(r) {
281
- const s = Ft(r);
282
- return r.reduce(
283
- (e, m) => {
284
- var b;
285
- return Math.max(e, ((b = s == null ? void 0 : s.get(m.sku._id)) == null ? void 0 : b[0].length) ?? 0);
280
+ function fa(l) {
281
+ const s = Ct(l);
282
+ return l.reduce(
283
+ (e, d) => {
284
+ var h;
285
+ return Math.max(e, ((h = s == null ? void 0 : s.get(d.sku._id)) == null ? void 0 : h[0].length) ?? 0);
286
286
  },
287
287
  0
288
288
  );
289
289
  }
290
- function Ft(r) {
291
- return r.groupBy(
290
+ function Ct(l) {
291
+ return l.groupBy(
292
292
  (s) => s.sku._id,
293
293
  (s) => s.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
294
294
  );
295
295
  }
296
- function fa(r) {
297
- const s = bt(), e = s === "MYR" ? "RM" : s;
296
+ function pa(l) {
297
+ const s = ht(), e = s === "MYR" ? "RM" : s;
298
298
  return [
299
299
  {
300
300
  id: "code",
@@ -360,175 +360,175 @@ function fa(r) {
360
360
  id: "baseUnitAmount",
361
361
  name: "Base unit amount"
362
362
  },
363
- ...Array.from({ length: r }).flatMap((b, g) => [
363
+ ...Array.from({ length: l }).flatMap((h, y) => [
364
364
  {
365
- id: `measurementAmount${g}`,
366
- name: `UOM amount ${g + 1}`
365
+ id: `measurementAmount${y}`,
366
+ name: `UOM amount ${y + 1}`
367
367
  },
368
368
  {
369
- id: `measurementAbbrev${g}`,
370
- name: `UOM ${g + 1}`
369
+ id: `measurementAbbrev${y}`,
370
+ name: `UOM ${y + 1}`
371
371
  }
372
372
  ])
373
373
  ];
374
374
  }
375
- function pa(r, s, e) {
376
- var k, d, h, M, H, W, G;
377
- const m = s.groupBy(
378
- (S) => S.id,
379
- (S) => S.balance
380
- ), b = e.groupBy(
381
- (S) => S.id,
382
- (S) => S.balance
383
- ), g = /* @__PURE__ */ new Map();
384
- if (r.opening)
385
- for (const S of r.opening)
386
- g.set(S.skuId, S.balance);
387
- const y = /* @__PURE__ */ new Map();
388
- if (r.adjustmentSnapshot)
389
- for (const S of r.adjustmentSnapshot) {
390
- const X = Object.keys(S.adjustmentsByType).join(", ");
391
- y.set(S.skuId, X || St);
375
+ function va(l, s, e) {
376
+ var N, g, m, F, H, K, J;
377
+ const d = s.groupBy(
378
+ (w) => w.id,
379
+ (w) => w.balance
380
+ ), h = e.groupBy(
381
+ (w) => w.id,
382
+ (w) => w.balance
383
+ ), y = /* @__PURE__ */ new Map();
384
+ if (l.opening)
385
+ for (const w of l.opening)
386
+ y.set(w.skuId, w.balance);
387
+ const b = /* @__PURE__ */ new Map();
388
+ if (l.adjustmentSnapshot)
389
+ for (const w of l.adjustmentSnapshot) {
390
+ const X = Object.keys(w.adjustmentsByType).join(", ");
391
+ b.set(w.skuId, X || Ft);
392
392
  }
393
- const I = [...r.items, ...r.negativeStockItems ?? []], N = Ft(I), U = I.map((S) => {
394
- var de, De, xe;
395
- const X = ((de = m.get(S.sku._id)) == null ? void 0 : de[0]) ?? ia, me = ((De = N == null ? void 0 : N.get(S.sku._id)) == null ? void 0 : De[0]) ?? [], ee = g.get(S.sku._id), se = y.get(S.sku._id);
396
- return ua(
397
- S,
393
+ const I = [...l.items, ...l.negativeStockItems ?? []], M = Ct(I), U = I.map((w) => {
394
+ var de, be, he;
395
+ const X = ((de = d.get(w.sku._id)) == null ? void 0 : de[0]) ?? ca, me = ((be = M == null ? void 0 : M.get(w.sku._id)) == null ? void 0 : be[0]) ?? [], ae = y.get(w.sku._id), re = b.get(w.sku._id);
396
+ return ma(
397
+ w,
398
398
  X,
399
399
  me,
400
- (xe = b.get(S.sku._id)) == null ? void 0 : xe[0],
401
- ee,
402
- se
400
+ (he = h.get(w.sku._id)) == null ? void 0 : he[0],
401
+ ae,
402
+ re
403
403
  );
404
- }), D = da(I), B = gt().currentBusiness.value, K = fa(D), u = [
404
+ }), k = fa(I), B = yt().currentBusiness.value, q = pa(k), u = [
405
405
  ["Business name:", B == null ? void 0 : B.name],
406
406
  ["Business ID:", B == null ? void 0 : B._id],
407
407
  ["Menu version", B == null ? void 0 : B.menuVersion],
408
- ["Created at", new Date(r.createdAt)],
409
- ["Created by", (k = r.createdBy) == null ? void 0 : k.name],
410
- ["Updated at", new Date(r.updatedAt)],
411
- ["Updated by", (d = r.updatedBy) == null ? void 0 : d.name],
412
- ["Recent action", r.approvedAt ? "Approve" : r.rejectionHistory ? "Reject" : ""],
408
+ ["Created at", new Date(l.createdAt)],
409
+ ["Created by", (N = l.createdBy) == null ? void 0 : N.name],
410
+ ["Updated at", new Date(l.updatedAt)],
411
+ ["Updated by", (g = l.updatedBy) == null ? void 0 : g.name],
412
+ ["Recent action", l.approvedAt ? "Approve" : l.rejectionHistory ? "Reject" : ""],
413
413
  [
414
414
  "Action by",
415
- r.approvedAt ? (h = r.approvedBy) == null ? void 0 : h.name : r.rejectionHistory ? (H = (M = r.rejectionHistory[0]) == null ? void 0 : M.rejectedBy) == null ? void 0 : H.name : ""
415
+ l.approvedAt ? (m = l.approvedBy) == null ? void 0 : m.name : l.rejectionHistory ? (H = (F = l.rejectionHistory[0]) == null ? void 0 : F.rejectedBy) == null ? void 0 : H.name : ""
416
416
  ],
417
417
  [
418
418
  "Action at",
419
- r.approvedAt ? new Date(r.approvedAt) : r.rejectionHistory ? new Date((W = r.rejectionHistory[0]) == null ? void 0 : W.rejectedAt) : ""
419
+ l.approvedAt ? new Date(l.approvedAt) : l.rejectionHistory ? new Date((K = l.rejectionHistory[0]) == null ? void 0 : K.rejectedAt) : ""
420
420
  ],
421
421
  [
422
422
  "Action remark",
423
- r.approvedAt ? r.approveRemark : r.rejectionHistory ? new Date((G = r.rejectionHistory[0]) == null ? void 0 : G.rejectRemark) : ""
423
+ l.approvedAt ? l.approveRemark : l.rejectionHistory ? new Date((J = l.rejectionHistory[0]) == null ? void 0 : J.rejectRemark) : ""
424
424
  ],
425
425
  [],
426
- K.map((S) => S.name),
427
- ...U.map((S) => K.map((X) => S[X.id]))
428
- ], t = K.map((S) => `system:${S.id}`), _ = qt(u, t), R = `[${B == null ? void 0 : B.name}] closing draft (${Yt(new Date(r.updatedAt))}).xlsx`;
429
- return Wt(_, R), R;
426
+ q.map((w) => w.name),
427
+ ...U.map((w) => q.map((X) => w[X.id]))
428
+ ], t = q.map((w) => `system:${w.id}`), _ = Wt(u, t), R = `[${B == null ? void 0 : B.name}] closing draft (${Kt(new Date(l.updatedAt))}).xlsx`;
429
+ return Zt(_, R), R;
430
430
  }
431
- const va = { class: "flex flex-col" }, ga = {
431
+ const ga = { class: "flex flex-col" }, ya = {
432
432
  key: 0,
433
433
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
434
- }, ya = { class: "flex gap-12 py-8 justify-end w-full" }, ba = /* @__PURE__ */ Ee({
434
+ }, ba = { class: "flex gap-12 py-8 justify-end w-full" }, ha = /* @__PURE__ */ He({
435
435
  __name: "RefreshBalanceAction",
436
436
  props: {
437
437
  draft: {},
438
438
  onCancel: { type: Function },
439
439
  onFinished: { type: Function }
440
440
  },
441
- setup(r) {
442
- const s = r;
443
- Je();
444
- const e = Y(!1), m = Y(null), b = Y(!1);
445
- qe(() => {
441
+ setup(l) {
442
+ const s = l;
443
+ et();
444
+ const e = Y(!1), d = Y(null), h = Y(!1);
445
+ Ze(() => {
446
446
  if (s.draft.effectiveAt)
447
- m.value = new Date(s.draft.effectiveAt);
447
+ d.value = new Date(s.draft.effectiveAt);
448
448
  else {
449
449
  const U = new Date(s.draft.createdAt);
450
- U.setHours(23, 59, 59, 999), m.value = U;
450
+ U.setHours(23, 59, 59, 999), d.value = U;
451
451
  }
452
- b.value = !0;
452
+ h.value = !0;
453
453
  });
454
- const g = L({
454
+ const y = L({
455
455
  get() {
456
- return m.value === null ? "" : Le(m.value);
456
+ return d.value === null ? "" : Ee(d.value);
457
457
  },
458
458
  set(U) {
459
459
  if (U) {
460
- const D = /* @__PURE__ */ new Date(`${U} ${y.value}`);
461
- D.setSeconds(59, 999), m.value = D;
460
+ const k = /* @__PURE__ */ new Date(`${U} ${b.value}`);
461
+ k.setSeconds(59, 999), d.value = k;
462
462
  } else
463
- m.value = null;
463
+ d.value = null;
464
464
  }
465
- }), y = L({
465
+ }), b = L({
466
466
  get() {
467
- return m.value === null ? "" : ht(m.value);
467
+ return d.value === null ? "" : Dt(d.value);
468
468
  },
469
469
  set(U) {
470
470
  if (U) {
471
- const D = /* @__PURE__ */ new Date(`${g.value} ${U}`);
472
- D.setSeconds(59, 999), m.value = D;
471
+ const k = /* @__PURE__ */ new Date(`${y.value} ${U}`);
472
+ k.setSeconds(59, 999), d.value = k;
473
473
  } else
474
- m.value = null;
474
+ d.value = null;
475
475
  }
476
- }), I = L(() => m.value ? m.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
477
- async function N() {
478
- e.value = !0, s.onFinished(m.value.toISOString());
476
+ }), I = L(() => d.value ? d.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
477
+ async function M() {
478
+ e.value = !0, s.onFinished(d.value.toISOString());
479
479
  }
480
- return (U, D) => {
481
- const P = z("FmLabel"), B = z("FmDatePicker"), K = z("FmTimePicker"), u = z("FmButton"), t = z("FmForm");
482
- return b.value ? (F(), ie(t, {
480
+ return (U, k) => {
481
+ const P = z("FmLabel"), B = z("FmDatePicker"), q = z("FmTimePicker"), u = z("FmButton"), t = z("FmForm");
482
+ return h.value ? (S(), oe(t, {
483
483
  key: 1,
484
- onValidationSuccess: N,
484
+ onValidationSuccess: M,
485
485
  class: "flex flex-col gap-32",
486
486
  disabled: e.value
487
487
  }, {
488
488
  default: Q(() => [
489
- D[5] || (D[5] = c("div", { class: "fm-typo-en-body-lg-400" }, [
489
+ k[5] || (k[5] = c("div", { class: "fm-typo-en-body-lg-400" }, [
490
490
  c("p", null, [
491
- oe(" Performing "),
491
+ se(" Performing "),
492
492
  c("span", { class: "fm-typo-en-body-lg-600" }, '"Refresh Balance"'),
493
- oe(" until closing effective date and time. ")
493
+ se(" until closing effective date and time. ")
494
494
  ]),
495
495
  c("p", { class: "mt-2" }, [
496
- oe(" Please note that this action will "),
496
+ se(" Please note that this action will "),
497
497
  c("b", null, "update"),
498
- oe(" the effective date and time. ")
498
+ se(" the effective date and time. ")
499
499
  ])
500
500
  ], -1)),
501
- c("div", va, [
502
- w(P, { class: "fm-typo-en-body-lg-600" }, {
503
- default: Q(() => D[3] || (D[3] = [
504
- oe("Closing Date")
501
+ c("div", ga, [
502
+ A(P, { class: "fm-typo-en-body-lg-600" }, {
503
+ default: Q(() => k[3] || (k[3] = [
504
+ se("Closing Date")
505
505
  ])),
506
506
  _: 1
507
507
  }),
508
- w(B, {
509
- modelValue: g.value,
510
- "onUpdate:modelValue": D[0] || (D[0] = (_) => g.value = _),
511
- max: $(Le)(/* @__PURE__ */ new Date())
508
+ A(B, {
509
+ modelValue: y.value,
510
+ "onUpdate:modelValue": k[0] || (k[0] = (_) => y.value = _),
511
+ max: $(Ee)(/* @__PURE__ */ new Date())
512
512
  }, null, 8, ["modelValue", "max"]),
513
- w(P, { class: "fm-typo-en-body-lg-600" }, {
514
- default: Q(() => D[4] || (D[4] = [
515
- oe("Closing Time")
513
+ A(P, { class: "fm-typo-en-body-lg-600" }, {
514
+ default: Q(() => k[4] || (k[4] = [
515
+ se("Closing Time")
516
516
  ])),
517
517
  _: 1
518
518
  }),
519
- w(K, {
520
- modelValue: y.value,
521
- "onUpdate:modelValue": D[1] || (D[1] = (_) => y.value = _)
519
+ A(q, {
520
+ modelValue: b.value,
521
+ "onUpdate:modelValue": k[1] || (k[1] = (_) => b.value = _)
522
522
  }, null, 8, ["modelValue"]),
523
- I.value ? (F(), E("div", ga, " Cannot select future date ")) : ne("", !0)
523
+ I.value ? (S(), E("div", ya, " Cannot select future date ")) : te("", !0)
524
524
  ]),
525
- c("div", ya, [
526
- w(u, {
525
+ c("div", ba, [
526
+ A(u, {
527
527
  label: "Cancel",
528
528
  variant: "tertiary",
529
- onClick: D[2] || (D[2] = (_) => U.onCancel())
529
+ onClick: k[2] || (k[2] = (_) => U.onCancel())
530
530
  }),
531
- w(u, {
531
+ A(u, {
532
532
  label: "Refresh balance",
533
533
  type: "submit",
534
534
  variant: "primary",
@@ -538,157 +538,172 @@ const va = { class: "flex flex-col" }, ga = {
538
538
  ])
539
539
  ]),
540
540
  _: 1
541
- }, 8, ["disabled"])) : (F(), E(le, { key: 0 }, [
542
- oe("Loading")
541
+ }, 8, ["disabled"])) : (S(), E(ie, { key: 0 }, [
542
+ se("Loading")
543
543
  ], 64));
544
544
  };
545
545
  }
546
- }), Ne = kt(
546
+ }), ze = kt(
547
547
  "closingDraftActions",
548
548
  function() {
549
- const s = Vt(), e = We(), m = Je(), b = He(), g = _t(), y = Y(!1), I = Y();
550
- function N(k) {
551
- const d = {
552
- draft: k
549
+ const s = Lt(), e = Je(), d = et(), h = Ye(), y = wt(), b = Y(!1), I = Y();
550
+ function M(g) {
551
+ const m = {
552
+ draft: g
553
553
  };
554
- I.value = d, y.value = !0;
554
+ I.value = m, b.value = !0;
555
555
  }
556
- async function U(k) {
557
- var h;
558
- if (k.status === ve.enum.COMPLETED) {
559
- const M = k.closingAdjustmentId;
560
- if (!M)
556
+ async function U(g) {
557
+ var F;
558
+ if (g.status === pe.enum.COMPLETED) {
559
+ const H = g.closingAdjustmentId;
560
+ if (!H)
561
561
  return e.open({
562
562
  title: "Something went wrong",
563
563
  message: "Closing draft is completed but closing document cannot be found.",
564
564
  type: "error"
565
565
  }), console.error("Closing draft is completed but closing document cannot be found.", {
566
- draftId: k._id
566
+ draftId: g._id
567
567
  }), [];
568
- const H = await m.readAdjustmentById(M);
569
- return ((H == null ? void 0 : H.skus) ?? []).map((G) => ({
570
- id: G.sku._id,
571
- balance: G.fromBalance,
572
- costs: G.fromCostBalances
568
+ const K = await d.readAdjustmentById(H);
569
+ return ((K == null ? void 0 : K.skus) ?? []).map((w) => ({
570
+ id: w.sku._id,
571
+ balance: w.fromBalance,
572
+ costs: w.fromCostBalances
573
573
  }));
574
574
  } else
575
- return await g.readStockBalance(), ((h = g.stockBalance) == null ? void 0 : h.skus) ?? [];
575
+ return await y.readStockBalance(), ((F = y.stockBalance) == null ? void 0 : F.skus) ?? [];
576
576
  }
577
- async function D(k, d, h) {
578
- d || (e.open({
577
+ async function k(g, m, F) {
578
+ m || (e.open({
579
579
  title: "Exporting",
580
580
  message: "Fetching data..."
581
- }), d = await U(k)), pa(k, d, h ?? []);
581
+ }), m = await U(g)), va(g, m, F ?? []);
582
582
  }
583
- function P(k, d) {
583
+ function P(g, m) {
584
584
  s.open({
585
585
  title: "Approve draft",
586
- contentComponent: Ke,
586
+ contentComponent: qe,
587
587
  contentComponentProps: {
588
- draft: k,
588
+ draft: g,
589
589
  action: O.enum.approveDraft,
590
590
  onFinished: () => {
591
- s.close(), d == null || d();
591
+ s.close(), m == null || m();
592
592
  },
593
593
  onCancel: () => s.close()
594
594
  }
595
595
  });
596
596
  }
597
- function B(k, d) {
597
+ function B(g, m) {
598
598
  s.open({
599
599
  title: "Reject draft",
600
- contentComponent: Ke,
600
+ contentComponent: qe,
601
601
  contentComponentProps: {
602
- draft: k,
602
+ draft: g,
603
603
  action: O.enum.rejectDraft,
604
604
  onFinished: () => {
605
- s.close(), d == null || d();
605
+ s.close(), m == null || m();
606
606
  },
607
607
  onCancel: () => s.close()
608
608
  }
609
609
  });
610
610
  }
611
- function K(k, d) {
611
+ function q(g, m) {
612
612
  s.open({
613
613
  title: "Mark draft as failed",
614
- contentComponent: Ke,
614
+ contentComponent: qe,
615
615
  contentComponentProps: {
616
- draft: k,
616
+ draft: g,
617
617
  action: O.enum.markAsFailed,
618
618
  onFinished: () => {
619
- s.close(), d == null || d();
619
+ s.close(), m == null || m();
620
620
  },
621
621
  onCancel: () => s.close()
622
622
  }
623
623
  });
624
624
  }
625
- async function u(k, d) {
626
- await b.sync({
627
- _id: k._id,
628
- _rev: k._rev ?? "",
625
+ async function u(g, m) {
626
+ await h.sync({
627
+ _id: g._id,
628
+ _rev: g._rev ?? "",
629
629
  action: O.enum.approveDraft,
630
630
  data: {
631
- remark: k.remark ?? ""
631
+ remark: g.remark ?? ""
632
632
  }
633
633
  }).delayed(500), e.open({
634
634
  title: "Success",
635
635
  message: "Sync requested",
636
636
  type: "success"
637
- }), d == null || d();
637
+ }), m == null || m();
638
638
  }
639
639
  function t() {
640
- y.value = !1;
640
+ b.value = !1;
641
641
  }
642
- async function _(k, d, h) {
642
+ async function _(g, m, F) {
643
643
  await s.open({
644
644
  title: "Refresh balance",
645
- contentComponent: ba,
645
+ contentComponent: ha,
646
646
  contentComponentProps: {
647
- draft: k,
648
- onFinished: (M) => {
649
- s.close(), h == null || h(M);
647
+ draft: g,
648
+ onFinished: (H) => {
649
+ s.close(), F == null || F(H);
650
650
  },
651
651
  onCancel: async () => {
652
- s.close(), d == null || d();
652
+ s.close(), m == null || m();
653
653
  }
654
654
  }
655
655
  });
656
656
  }
657
- async function R(k, d) {
657
+ async function R(g) {
658
+ await s.open({
659
+ title: "Invalidate closing draft cache",
660
+ message: "It will invalidate opening and stock movement cache for this draft.",
661
+ primaryActions: { text: "Proceed", close: !0 },
662
+ secondaryActions: { text: "Cancel", close: !0 }
663
+ }).onPrimary(async () => {
664
+ await d.recalculation.scheduleInvalidateClosingDraftCache([g._id]), e.open({
665
+ title: "Success",
666
+ message: "Invalidate cache requested",
667
+ type: "success"
668
+ });
669
+ });
670
+ }
671
+ async function N(g, m) {
658
672
  try {
659
673
  e.open({
660
674
  title: "Cloning",
661
675
  message: "Creating a copy of the draft..."
662
- }), await b.cloneDraft(k._id), e.open({
676
+ }), await h.cloneDraft(g._id), e.open({
663
677
  title: "Success",
664
678
  message: "Draft cloned successfully",
665
679
  type: "success"
666
- }), d == null || d();
667
- } catch (h) {
680
+ }), m == null || m();
681
+ } catch (F) {
668
682
  e.open({
669
683
  title: "Error",
670
- message: (h == null ? void 0 : h.message) || "Failed to clone draft",
684
+ message: (F == null ? void 0 : F.message) || "Failed to clone draft",
671
685
  type: "error"
672
686
  });
673
687
  }
674
688
  }
675
689
  return {
676
- viewDraft: N,
690
+ viewDraft: M,
677
691
  closeDraftDialog: t,
678
692
  approveDraft: P,
679
693
  rejectDraft: B,
680
- markAsFailed: K,
694
+ markAsFailed: q,
681
695
  syncDraft: u,
682
- exportDraft: D,
696
+ exportDraft: k,
683
697
  refreshBalance: _,
684
- cloneDraft: R,
685
- viewClosingDraftShow: y,
686
- viewClosingDraftProps: I
698
+ cloneDraft: N,
699
+ viewClosingDraftShow: b,
700
+ viewClosingDraftProps: I,
701
+ invalidateDraftCache: R
687
702
  };
688
703
  }
689
704
  );
690
- function Ve(r) {
691
- switch (r) {
705
+ function Ne(l) {
706
+ switch (l) {
692
707
  case "DRAFT":
693
708
  return "fm-status-badge-draft";
694
709
  case "PROCESSING":
@@ -702,59 +717,59 @@ function Ve(r) {
702
717
  const ka = kt(
703
718
  "closingDraftTable",
704
719
  function() {
705
- const { t: s } = yt(), e = gt(), m = Ne(), b = Y(new Array()), g = Y(!1), y = ze(), I = He();
706
- async function N() {
707
- if (b.value = [], !!y._currentLocation) {
708
- g.value = !0;
720
+ const { t: s } = bt(), e = yt(), d = ze(), h = Y(new Array()), y = Y(!1), b = Oe(), I = Ye();
721
+ async function M() {
722
+ if (h.value = [], !!b._currentLocation) {
723
+ y.value = !0;
709
724
  try {
710
725
  const [u] = await Promise.all([I.readDrafts()]).delayed(1e3);
711
- b.value = u.reverse();
726
+ h.value = u.reverse();
712
727
  } catch (u) {
713
728
  console.log("Something went wrong when fetching drafts:", u);
714
729
  } finally {
715
- g.value = !1;
730
+ y.value = !1;
716
731
  }
717
732
  }
718
733
  }
719
734
  async function U(u) {
720
- if (!b.value.find((t) => t._id) && y._currentLocation) {
721
- g.value = !0;
735
+ if (!h.value.find((t) => t._id) && b._currentLocation) {
736
+ y.value = !0;
722
737
  try {
723
738
  const [t] = await Promise.all([
724
739
  I.getDraft(u),
725
740
  new Promise((_) => setTimeout(_, 1e3))
726
741
  ]);
727
- b.value = [t];
742
+ h.value = [t];
728
743
  } catch (t) {
729
744
  console.log("Something went wrong when fetching drafts:", t);
730
745
  } finally {
731
- g.value = !1;
746
+ y.value = !1;
732
747
  }
733
748
  }
734
749
  }
735
- function D(u) {
736
- b.value = b.value.map((t) => t._id === u._id ? {
750
+ function k(u) {
751
+ h.value = h.value.map((t) => t._id === u._id ? {
737
752
  ...u,
738
753
  _rev: t._rev
739
754
  } : t);
740
755
  }
741
756
  function P() {
742
- m.closeDraftDialog(), N();
757
+ d.closeDraftDialog(), M();
743
758
  }
744
759
  function B(u, t) {
745
- switch (t = zt(t), u) {
760
+ switch (t = Ht(t), u) {
746
761
  case Se.Details:
747
- return m.viewDraft(t);
762
+ return d.viewDraft(t);
748
763
  case Se.Export:
749
- return m.exportDraft(t);
764
+ return d.exportDraft(t);
750
765
  case O.enum.approveDraft:
751
- return m.approveDraft(t, P);
766
+ return d.approveDraft(t, P);
752
767
  case O.enum.rejectDraft:
753
- return m.rejectDraft(t, P);
768
+ return d.rejectDraft(t, P);
754
769
  case O.enum.markAsFailed:
755
- return m.markAsFailed(t, P);
770
+ return d.markAsFailed(t, P);
756
771
  case Se.Duplicate:
757
- return m.cloneDraft(t, P);
772
+ return d.cloneDraft(t, P);
758
773
  }
759
774
  }
760
775
  return {
@@ -764,7 +779,7 @@ const ka = kt(
764
779
  accessorKey: "_id",
765
780
  header: () => s("inventory.closing.table.createdAt"),
766
781
  cell(u) {
767
- return Xt(`${u.getValue()}`);
782
+ return ea(`${u.getValue()}`);
768
783
  },
769
784
  enableSorting: !0
770
785
  },
@@ -774,14 +789,14 @@ const ka = kt(
774
789
  cell(u) {
775
790
  const t = u.row.original;
776
791
  let _ = u.getValue();
777
- return _ || (_ = Qe(t._id)), he(_);
792
+ return _ || (_ = Ve(t._id)), ye(_);
778
793
  },
779
794
  enableSorting: !0,
780
795
  size: 200
781
796
  },
782
797
  {
783
798
  id: "updatedAt",
784
- accessorFn: (u) => he(u.updatedAt),
799
+ accessorFn: (u) => ye(u.updatedAt),
785
800
  header: () => "Updated at",
786
801
  enableSorting: !0,
787
802
  size: 200
@@ -820,43 +835,43 @@ const ka = kt(
820
835
  header: () => s("inventory.closing.table.status"),
821
836
  enableSorting: !1,
822
837
  cell(u) {
823
- var h;
824
- const t = u.row.original, _ = t.status, R = new Date(t.updatedAt), k = (h = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : h.computeFirst((M) => M.rejectedAt), d = k ? new Date(k) : null;
825
- return _ === "DRAFT" && d ? d.getTime() > R.getTime() ? A(
838
+ var m;
839
+ const t = u.row.original, _ = t.status, R = new Date(t.updatedAt), N = (m = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : m.computeFirst((F) => F.rejectedAt), g = N ? new Date(N) : null;
840
+ return _ === "DRAFT" && g ? g.getTime() > R.getTime() ? x(
826
841
  "div",
827
842
  {
828
843
  class: "flex"
829
844
  },
830
- A(
845
+ x(
831
846
  "div",
832
847
  {
833
- class: ["fm-status-badge", Ve("FAILED")]
848
+ class: ["fm-status-badge", Ne("FAILED")]
834
849
  },
835
850
  "Rejected"
836
851
  )
837
- ) : A(
852
+ ) : x(
838
853
  "div",
839
854
  {
840
855
  class: "flex"
841
856
  },
842
- A(
857
+ x(
843
858
  "div",
844
859
  {
845
- class: ["fm-status-badge", Ve("PROCESSING")]
860
+ class: ["fm-status-badge", Ne("PROCESSING")]
846
861
  },
847
862
  "Updated"
848
863
  )
849
- ) : A(
864
+ ) : x(
850
865
  "div",
851
866
  {
852
867
  class: "flex"
853
868
  },
854
- A(
869
+ x(
855
870
  "div",
856
871
  {
857
- class: ["fm-status-badge", Ve(_)]
872
+ class: ["fm-status-badge", Ne(_)]
858
873
  },
859
- Me(_)
874
+ Le(_)
860
875
  )
861
876
  );
862
877
  }
@@ -864,11 +879,11 @@ const ka = kt(
864
879
  {
865
880
  id: "action",
866
881
  cell(u) {
867
- var h;
868
- const t = u.row.original, _ = ((h = e.sessionUser.value) == null ? void 0 : h.role.isAdmin) ?? !1, R = [
869
- dt[Se.Details],
870
- dt[Se.Export]
871
- ], k = [
882
+ var m;
883
+ const t = u.row.original, _ = ((m = e.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1, R = [
884
+ pt[Se.Details],
885
+ pt[Se.Export]
886
+ ], N = [
872
887
  {
873
888
  translationKey: "inventory.closing.draft.approveDraft",
874
889
  color: "text-fm-color-typo-primary",
@@ -884,20 +899,20 @@ const ka = kt(
884
899
  color: "text-fm-color-typo-error",
885
900
  value: O.enum.markAsFailed
886
901
  }
887
- ], d = _ && t.status !== ve.enum.DRAFT ? [
902
+ ], g = _ && t.status !== pe.enum.DRAFT ? [
888
903
  {
889
904
  translationKey: "inventory.closing.draft.cloneDraft",
890
905
  color: "text-fm-color-typo-primary",
891
906
  value: Se.Duplicate
892
907
  }
893
908
  ] : [];
894
- return Zt(
909
+ return Jt(
895
910
  [
896
911
  ...R,
897
- ...t.status === ve.enum.DRAFT ? k : []
912
+ ...t.status === pe.enum.DRAFT ? N : []
898
913
  ],
899
- (M) => B(M, t),
900
- d
914
+ (F) => B(F, t),
915
+ g
901
916
  );
902
917
  },
903
918
  enableSorting: !1,
@@ -908,91 +923,91 @@ const ka = kt(
908
923
  }
909
924
  }
910
925
  ],
911
- drafts: b,
912
- loading: g,
913
- fetchDrafts: N,
926
+ drafts: h,
927
+ loading: y,
928
+ fetchDrafts: M,
914
929
  loadDraft: U,
915
- updateDraftRef: D
930
+ updateDraftRef: k
916
931
  };
917
932
  }
918
- ), ha = { class: "w-full flex flex-col gap-32" }, Da = { class: "flex justify-between" }, xa = { class: "flex" }, Aa = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, _a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wa = { class: "flex gap-1" }, Sa = { class: "fm-typo-en-body-lg-600" }, Fa = { class: "flex flex-col gap-16" }, Ca = { class: "flex items-center" }, $a = {
933
+ ), Da = { class: "w-full flex flex-col gap-32" }, xa = { class: "flex justify-between" }, Aa = { class: "flex" }, _a = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sa = { class: "flex gap-1" }, Fa = { class: "fm-typo-en-body-lg-600" }, Ca = { class: "flex flex-col gap-16" }, $a = { class: "flex items-center" }, Ba = {
919
934
  key: 0,
920
935
  class: "flex gap-8"
921
- }, Ba = {
936
+ }, Ta = {
922
937
  key: 0,
923
938
  class: "w-full flex flex-col items-center"
924
- }, Ta = { class: "flex items-center gap-8" }, ja = { class: "flex flex-col gap-8" }, Ia = { class: "flex gap-8" }, Ua = {
939
+ }, ja = { class: "flex items-center gap-8" }, Ia = { class: "flex flex-col gap-8" }, Ua = { class: "flex gap-8" }, Pa = {
925
940
  key: 0,
926
941
  class: "flex gap-8"
927
- }, Pa = { class: "overflow-x-auto" }, Ra = {
942
+ }, Ra = { class: "overflow-x-auto" }, Ma = {
928
943
  key: 1,
929
944
  class: "flex-1 xs:w-screen xs:max-w-full"
930
- }, Ma = {
945
+ }, Va = {
931
946
  key: 0,
932
947
  class: "flex flex-col items-center gap-8 h-full"
933
- }, Va = ["src"], La = {
948
+ }, La = ["src"], Na = {
934
949
  key: 1,
935
950
  class: "px-4 flex flex-col"
936
- }, Na = { class: "flex gap-12 content-stretch" }, Ea = {
951
+ }, Ea = { class: "flex gap-12 content-stretch" }, za = {
937
952
  class: "flex flex-col w-24",
938
953
  name: "circles"
939
- }, za = { class: "flex-1 flex flex-col items-center" }, Ha = { class: "flex-1 flex flex-col items-center" }, Oa = {
954
+ }, Ha = { class: "flex-1 flex flex-col items-center" }, Oa = { class: "flex-1 flex flex-col items-center" }, Ya = {
940
955
  class: "py-12 flex flex-col gap-4",
941
956
  name: "received-at header"
942
- }, Ya = { class: "fm-typo-en-body-lg-400" }, Ka = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qa = { class: "flex gap-12 content-stretch" }, Ga = {
957
+ }, Ka = { class: "fm-typo-en-body-lg-400" }, Qa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, qa = { class: "flex gap-12 content-stretch" }, Ga = {
943
958
  class: "flex flex-col w-24",
944
959
  name: "circles"
945
- }, qa = { class: "flex-1 flex flex-col items-center" }, Wa = {
960
+ }, Wa = { class: "flex-1 flex flex-col items-center" }, Za = {
946
961
  class: "py-12 flex flex-col gap-4 flex-1",
947
962
  name: "delivery details"
948
- }, Za = { class: "flex flex-col gap-8" }, Ja = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Xa = { class: "flex flex-col gap-4" }, en = { class: "flex gap-8" }, tn = "N/A", an = /* @__PURE__ */ Ee({
963
+ }, Ja = { class: "flex flex-col gap-8" }, Xa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, en = { class: "flex flex-col gap-4" }, tn = { class: "flex gap-8" }, an = "N/A", nn = /* @__PURE__ */ He({
949
964
  __name: "ClosingDraftDialog",
950
965
  props: {
951
966
  show: { type: Boolean },
952
967
  draft: {}
953
968
  },
954
969
  emits: ["submitted", "refresh"],
955
- setup(r, { emit: s }) {
956
- const e = r, m = L(() => {
957
- const l = bt();
958
- return l === "MYR" ? "RM" : l;
959
- }), b = _t(), g = Ne(), y = Lt(e, "show"), I = Y(!1), N = Y(!1), U = Y(!1), D = Y(new Array()), P = Y(new Array()), B = Y([]), K = Je(), u = He(), t = We(), _ = Ht(), R = ze(), k = jt({}), d = L(() => new Set(
960
- _.skus.filter((l) => {
970
+ setup(l, { emit: s }) {
971
+ const e = l, d = L(() => {
972
+ const r = ht();
973
+ return r === "MYR" ? "RM" : r;
974
+ }), h = wt(), y = ze(), b = Nt(e, "show"), I = Y(!1), M = Y(!1), U = Y(!1), k = Y(new Array()), P = Y(new Array()), B = Y([]), q = et(), u = Ye(), t = Je(), _ = Ot(), R = Oe(), N = It({}), g = L(() => new Set(
975
+ _.skus.filter((r) => {
961
976
  var a;
962
- return k[(a = l.customAttributes) == null ? void 0 : a.tag];
963
- }).map((l) => l._id)
964
- )), h = s, M = Y({
977
+ return N[(a = r.customAttributes) == null ? void 0 : a.tag];
978
+ }).map((r) => r._id)
979
+ )), m = s, F = Y({
965
980
  templateItem: !0,
966
981
  nonTemplateItem: !0
967
982
  }), H = L(() => {
968
983
  var a, f;
969
- const l = [...((a = e.draft) == null ? void 0 : a.items) ?? [], ...((f = e.draft) == null ? void 0 : f.negativeStockItems) ?? []];
970
- return d.value.size ? l.filter((n) => d.value.has(n.sku._id)) : l;
971
- }), W = L(() => {
972
- const l = H.value.map((a) => a.sku);
973
- return l.sort((a, f) => a.code.localeCompare(f.code)), l;
974
- }), G = L(() => H.value.groupBy(
984
+ const r = [...((a = e.draft) == null ? void 0 : a.items) ?? [], ...((f = e.draft) == null ? void 0 : f.negativeStockItems) ?? []];
985
+ return g.value.size ? r.filter((n) => g.value.has(n.sku._id)) : r;
986
+ }), K = L(() => {
987
+ const r = H.value.map((a) => a.sku);
988
+ return r.sort((a, f) => a.code.localeCompare(f.code)), r;
989
+ }), J = L(() => H.value.groupBy(
975
990
  (a) => a.sku._id,
976
991
  (a) => a.measurementsAmounts.filter((f) => !f.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((f) => f.measurement.id)
977
992
  ));
978
- qe(me), It(
993
+ Ze(me), Ut(
979
994
  () => e.show,
980
- (l) => {
981
- l && (ye.value = ge[0], me(), M.value = {
995
+ (r) => {
996
+ r && (ke.value = _e[0], me(), F.value = {
982
997
  templateItem: !0,
983
998
  nonTemplateItem: !0
984
999
  });
985
1000
  }
986
1001
  );
987
- const S = Te(0), X = Te(100);
1002
+ const w = je(0), X = je(100);
988
1003
  async function me() {
989
1004
  var a, f, n, o;
990
1005
  if (!R._currentLocation) return;
991
1006
  I.value = !0;
992
- const l = ((a = e.draft) == null ? void 0 : a.status) === ve.enum.COMPLETED;
1007
+ const r = ((a = e.draft) == null ? void 0 : a.status) === pe.enum.COMPLETED;
993
1008
  P.value = [];
994
1009
  try {
995
- if (await _.init(), l) {
1010
+ if (await _.init(), r) {
996
1011
  const T = e.draft.closingAdjustmentId;
997
1012
  if (!T) {
998
1013
  t.open({
@@ -1004,9 +1019,9 @@ const ka = kt(
1004
1019
  });
1005
1020
  return;
1006
1021
  }
1007
- const j = await K.readAdjustmentById(T), re = (j == null ? void 0 : j.skus) ?? [];
1008
- for (const ce of re) {
1009
- const _e = {
1022
+ const j = await q.readAdjustmentById(T), le = (j == null ? void 0 : j.skus) ?? [];
1023
+ for (const ce of le) {
1024
+ const De = {
1010
1025
  id: ce.sku._id,
1011
1026
  balance: ce.fromBalance,
1012
1027
  costs: ce.fromCostBalances
@@ -1015,20 +1030,20 @@ const ka = kt(
1015
1030
  balance: ce.toBalance,
1016
1031
  costs: ce.toCostBalances
1017
1032
  };
1018
- D.value.push(_e), P.value.push(C);
1033
+ k.value.push(De), P.value.push(C);
1019
1034
  }
1020
1035
  } else
1021
- D.value = ((n = e.draft) == null ? void 0 : n.stockSnapshot) ?? [];
1036
+ k.value = ((n = e.draft) == null ? void 0 : n.stockSnapshot) ?? [];
1022
1037
  const i = /* @__PURE__ */ new Set();
1023
1038
  if ((o = e.draft) != null && o.adjustmentSnapshot)
1024
1039
  for (const T of e.draft.adjustmentSnapshot)
1025
1040
  T.adjustmentsByType && Object.keys(T.adjustmentsByType).forEach((j) => i.add(j));
1026
- const p = ["receive", "sales", "wastage"], x = [];
1041
+ const p = ["receive", "sales", "wastage"], D = [];
1027
1042
  p.forEach((T) => {
1028
- i.has(T) && (x.push(T), i.delete(T));
1043
+ i.has(T) && (D.push(T), i.delete(T));
1029
1044
  });
1030
1045
  const v = Array.from(i).sort();
1031
- B.value = [...x, ...v];
1046
+ B.value = [...D, ...v];
1032
1047
  } catch (i) {
1033
1048
  t.open({
1034
1049
  title: "Something went wrong",
@@ -1039,9 +1054,9 @@ const ka = kt(
1039
1054
  I.value = !1;
1040
1055
  }
1041
1056
  }
1042
- async function ee() {
1057
+ async function ae() {
1043
1058
  var a, f;
1044
- if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? Qe((f = e.draft) == null ? void 0 : f._id) : null))) {
1059
+ if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? Ve((f = e.draft) == null ? void 0 : f._id) : null))) {
1045
1060
  t.open({
1046
1061
  title: "Cannot refresh",
1047
1062
  message: "Effective date is not available for this draft.",
@@ -1049,16 +1064,16 @@ const ka = kt(
1049
1064
  });
1050
1065
  return;
1051
1066
  }
1052
- await g.refreshBalance(
1067
+ await y.refreshBalance(
1053
1068
  e.draft,
1054
1069
  () => {
1055
1070
  },
1056
1071
  async (n) => {
1057
- var x;
1058
- N.value = !0;
1059
- const o = (x = e.draft) == null ? void 0 : x._rev, i = 30, p = 2e3;
1072
+ var D;
1073
+ M.value = !0;
1074
+ const o = (D = e.draft) == null ? void 0 : D._rev, i = 30, p = 2e3;
1060
1075
  try {
1061
- await K.recalculation.scheduleCalculateStockSnapshotAtDate(n, e.draft._id);
1076
+ await q.recalculation.scheduleCalculateStockSnapshotAtDate(n, e.draft._id);
1062
1077
  let v = null;
1063
1078
  for (let T = 0; T < i && (v = await u.getDraft(e.draft._id).delayed(p), v._rev === o); T++)
1064
1079
  ;
@@ -1070,11 +1085,11 @@ const ka = kt(
1070
1085
  }), console.error("error refreshing stock balances: there is no change in _rev");
1071
1086
  return;
1072
1087
  }
1073
- h("refresh", v), D.value = v.stockSnapshot ?? [], t.open({
1088
+ m("refresh", v), k.value = v.stockSnapshot ?? [], t.open({
1074
1089
  title: "Balance refreshed",
1075
1090
  message: "Stock balance has been recalculated.",
1076
1091
  type: "success"
1077
- }), y.value = !1;
1092
+ }), b.value = !1;
1078
1093
  } catch (v) {
1079
1094
  t.open({
1080
1095
  title: "Refresh failed",
@@ -1082,41 +1097,53 @@ const ka = kt(
1082
1097
  type: "error"
1083
1098
  }), console.error("error refreshing stock balances", v);
1084
1099
  } finally {
1085
- N.value = !1;
1100
+ M.value = !1;
1086
1101
  }
1087
1102
  }
1088
1103
  );
1089
1104
  }
1090
- const se = L(
1091
- () => D.value.groupBy(
1092
- (l) => l.id,
1093
- (l) => l.balance
1105
+ async function re() {
1106
+ var a, f;
1107
+ if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? Ve((f = e.draft) == null ? void 0 : f._id) : null))) {
1108
+ t.open({
1109
+ title: "Cannot refresh",
1110
+ message: "Effective date is not available for this draft.",
1111
+ type: "error"
1112
+ });
1113
+ return;
1114
+ }
1115
+ await y.invalidateDraftCache(e.draft);
1116
+ }
1117
+ const de = L(
1118
+ () => k.value.groupBy(
1119
+ (r) => r.id,
1120
+ (r) => r.balance
1094
1121
  )
1095
- ), de = L(() => H.value.groupBy((l) => l.sku._id)), De = L(() => {
1096
- var l;
1097
- return (l = e.draft) != null && l.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((a) => [a.skuId, a.adjustmentsByType])) : /* @__PURE__ */ new Map();
1098
- }), xe = L(() => {
1099
- var l;
1100
- return (l = e.draft) != null && l.opening ? new Map(e.draft.opening.map((a) => [a.skuId, a.balance])) : /* @__PURE__ */ new Map();
1122
+ ), be = L(() => H.value.groupBy((r) => r.sku._id)), he = L(() => {
1123
+ var r;
1124
+ return (r = e.draft) != null && r.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((a) => [a.skuId, a.adjustmentsByType])) : /* @__PURE__ */ new Map();
1125
+ }), Ie = L(() => {
1126
+ var r;
1127
+ return (r = e.draft) != null && r.opening ? new Map(e.draft.opening.map((a) => [a.skuId, a.balance])) : /* @__PURE__ */ new Map();
1101
1128
  });
1102
- function te(l, a) {
1103
- return A(
1104
- ke.FmTooltip,
1129
+ function Z(r, a) {
1130
+ return x(
1131
+ ge.FmTooltip,
1105
1132
  { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
1106
1133
  {
1107
1134
  default() {
1108
- return l;
1135
+ return r;
1109
1136
  },
1110
1137
  content() {
1111
- return a || l;
1138
+ return a || r;
1112
1139
  }
1113
1140
  }
1114
1141
  );
1115
1142
  }
1116
- const Ae = L(() => {
1117
- const l = W.value.reduce((f, n) => {
1143
+ const Ce = L(() => {
1144
+ const r = K.value.reduce((f, n) => {
1118
1145
  var o, i;
1119
- return Math.max(f, ((i = (o = G.value) == null ? void 0 : o.get(n._id)) == null ? void 0 : i[0].length) ?? 0);
1146
+ return Math.max(f, ((i = (o = J.value) == null ? void 0 : o.get(n._id)) == null ? void 0 : i[0].length) ?? 0);
1120
1147
  }, 0);
1121
1148
  return [
1122
1149
  {
@@ -1125,8 +1152,8 @@ const ka = kt(
1125
1152
  header: () => "Name",
1126
1153
  size: 350,
1127
1154
  cell(f) {
1128
- const n = f.row.original, o = n.adjustedDiffPercentage, i = typeof o == "number" && Math.abs(o) > 10, p = A("div", { class: "flex flex-col gap-4" }, [
1129
- A(
1155
+ const n = f.row.original, o = n.adjustedDiffPercentage, i = typeof o == "number" && Math.abs(o) > 10, p = x("div", { class: "flex flex-col gap-4" }, [
1156
+ x(
1130
1157
  "div",
1131
1158
  {
1132
1159
  class: [
@@ -1136,7 +1163,7 @@ const ka = kt(
1136
1163
  },
1137
1164
  n.name
1138
1165
  ),
1139
- A(
1166
+ x(
1140
1167
  "div",
1141
1168
  {
1142
1169
  class: [
@@ -1147,8 +1174,8 @@ const ka = kt(
1147
1174
  n.code
1148
1175
  )
1149
1176
  ]);
1150
- return A(
1151
- ke.FmTooltip,
1177
+ return x(
1178
+ ge.FmTooltip,
1152
1179
  {
1153
1180
  zIndex: 51
1154
1181
  },
@@ -1157,7 +1184,7 @@ const ka = kt(
1157
1184
  return i ? "Adjustment difference is more than 10%." : `${n.code} - ${n.name}`;
1158
1185
  },
1159
1186
  default() {
1160
- return A("div", { class: "flex items-center gap-4 justify-start w-full" }, [
1187
+ return x("div", { class: "flex items-center gap-4 justify-start w-full" }, [
1161
1188
  p
1162
1189
  ]);
1163
1190
  }
@@ -1168,11 +1195,11 @@ const ka = kt(
1168
1195
  {
1169
1196
  id: "costPerUnit",
1170
1197
  accessorKey: "costPerUnit",
1171
- header: () => te("Cost per unit"),
1198
+ header: () => Z("Cost per unit"),
1172
1199
  size: 160,
1173
1200
  cell(f) {
1174
1201
  const n = f.row.original.costPerUnit;
1175
- return A("div", { class: "text-right" }, n.toFixed(2));
1202
+ return x("div", { class: "text-right" }, n.toFixed(2));
1176
1203
  },
1177
1204
  meta: {
1178
1205
  textAlign: "right"
@@ -1183,23 +1210,23 @@ const ka = kt(
1183
1210
  header: () => "UOM",
1184
1211
  size: 120,
1185
1212
  cell(f) {
1186
- var x;
1213
+ var D;
1187
1214
  const n = f.row.original, o = n.costUnit, i = n.baseUnit, p = o ?? i;
1188
1215
  if (o && o !== i) {
1189
- const v = W.value.find((j) => j._id === n.id), T = (x = v == null ? void 0 : v.defaultCost) == null ? void 0 : x.measurement;
1216
+ const v = K.value.find((j) => j._id === n.id), T = (D = v == null ? void 0 : v.defaultCost) == null ? void 0 : D.measurement;
1190
1217
  if (T) {
1191
1218
  const j = T.conversion.amount / Math.pow(10, T.conversion.precision);
1192
- return A("div", { class: "flex flex-col" }, [
1193
- A(
1219
+ return x("div", { class: "flex flex-col" }, [
1220
+ x(
1194
1221
  "span",
1195
1222
  { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
1196
1223
  p
1197
1224
  ),
1198
- A("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, [
1225
+ x("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, [
1199
1226
  "1 ",
1200
- A("span", { class: "fm-typo-en-body-sm-600" }, o),
1227
+ x("span", { class: "fm-typo-en-body-sm-600" }, o),
1201
1228
  ` = ${j} `,
1202
- A("span", { class: "fm-typo-en-body-sm-600" }, i)
1229
+ x("span", { class: "fm-typo-en-body-sm-600" }, i)
1203
1230
  ])
1204
1231
  ]);
1205
1232
  }
@@ -1210,11 +1237,11 @@ const ka = kt(
1210
1237
  {
1211
1238
  id: "opening",
1212
1239
  accessorKey: "opening",
1213
- header: () => te("Opening (B/F)", "The opening balance brought forward from previous period."),
1240
+ header: () => Z("Opening (B/F)", "The opening balance brought forward from previous period."),
1214
1241
  size: 150,
1215
1242
  cell(f) {
1216
1243
  const n = f.row.original.opening;
1217
- return A("div", { class: "text-right" }, n.toFixed(2));
1244
+ return x("div", { class: "text-right" }, n.toFixed(2));
1218
1245
  },
1219
1246
  meta: {
1220
1247
  textAlign: "right"
@@ -1225,11 +1252,11 @@ const ka = kt(
1225
1252
  (f) => ({
1226
1253
  id: `adjustment_${f}`,
1227
1254
  accessorFn: (n) => n.adjustmentAmounts[f] ?? { amount: 0, precision: 0 },
1228
- header: () => te(Me(f)),
1255
+ header: () => Z(Le(f)),
1229
1256
  size: 150,
1230
1257
  cell(n) {
1231
1258
  const o = n.row.original.adjustmentAmounts[f] ?? { amount: 0, precision: 0 };
1232
- return A("div", { class: "text-right" }, Ge(o));
1259
+ return x("div", { class: "text-right" }, We(o));
1233
1260
  },
1234
1261
  meta: {
1235
1262
  textAlign: "right"
@@ -1239,7 +1266,7 @@ const ka = kt(
1239
1266
  {
1240
1267
  id: "systemBalance",
1241
1268
  accessorKey: "systemBalance",
1242
- header: () => te("System Balance", "The system calculated balance before stock take."),
1269
+ header: () => Z("System Balance", "The system calculated balance before stock take."),
1243
1270
  size: 200,
1244
1271
  meta: {
1245
1272
  textAlign: "right"
@@ -1252,22 +1279,22 @@ const ka = kt(
1252
1279
  const n = (o = P.value.find((i) => i.id === f.id)) == null ? void 0 : o.balance;
1253
1280
  return n ? V.toFormatString({ value: n }) : f.physicalBalance;
1254
1281
  },
1255
- header: () => te("Stock Take balance", "The physical balance recorded during stock take."),
1282
+ header: () => Z("Stock Take balance", "The physical balance recorded during stock take."),
1256
1283
  cell(f) {
1257
1284
  var v;
1258
1285
  const n = f.row.original, o = V.fromNumber(n.physicalBalance);
1259
1286
  let i = !0, p = n.physicalBalance;
1260
- const x = (v = P.value.find((T) => T.id === n.id)) == null ? void 0 : v.balance;
1261
- return x && (V.equals({
1287
+ const D = (v = P.value.find((T) => T.id === n.id)) == null ? void 0 : v.balance;
1288
+ return D && (V.equals({
1262
1289
  a: o,
1263
- b: x
1264
- }) || (i = !1, p = Number(V.toFormatString({ value: x })))), A("div", { class: "flex flex-col" }, [
1265
- A(
1290
+ b: D
1291
+ }) || (i = !1, p = Number(V.toFormatString({ value: D })))), x("div", { class: "flex flex-col" }, [
1292
+ x(
1266
1293
  "span",
1267
1294
  { class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
1268
1295
  p
1269
1296
  ),
1270
- i ? null : A(
1297
+ i ? null : x(
1271
1298
  "span",
1272
1299
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1273
1300
  `Draft: ${n.physicalBalance.toString()}`
@@ -1282,7 +1309,7 @@ const ka = kt(
1282
1309
  {
1283
1310
  id: "adjustedAmount",
1284
1311
  accessorKey: "adjustedAmount",
1285
- header: () => te("Variance", "The difference between Stock Take balance and System Balance."),
1312
+ header: () => Z("Variance", "The difference between Stock Take balance and System Balance."),
1286
1313
  size: 200,
1287
1314
  meta: {
1288
1315
  textAlign: "right"
@@ -1291,11 +1318,11 @@ const ka = kt(
1291
1318
  {
1292
1319
  id: "varianceInCost",
1293
1320
  accessorKey: "varianceInCost",
1294
- header: () => te(`Variance (${m.value})`),
1321
+ header: () => Z(`Variance (${d.value})`),
1295
1322
  size: 150,
1296
1323
  cell(f) {
1297
1324
  const n = f.row.original.varianceInCost;
1298
- return A(
1325
+ return x(
1299
1326
  "div",
1300
1327
  { class: "text-right" },
1301
1328
  n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })
@@ -1308,20 +1335,20 @@ const ka = kt(
1308
1335
  {
1309
1336
  id: "adjustedDiffPercentage",
1310
1337
  accessorKey: "adjustedDiffPercentage",
1311
- header: () => te(
1338
+ header: () => Z(
1312
1339
  "Variance (%)",
1313
1340
  "Difference between Stock Take balance and System Balance in percentage."
1314
1341
  ),
1315
1342
  size: 200,
1316
1343
  cell(f) {
1317
1344
  const n = f.row.original.adjustedDiffPercentage;
1318
- if (!n) return tn;
1345
+ if (!n) return an;
1319
1346
  const o = n.toFixed(2);
1320
1347
  if (o === "0.00")
1321
- return A("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
1348
+ return x("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
1322
1349
  const i = n > 0;
1323
- return A("div", { class: "flex items-center gap-4 justify-end" }, [
1324
- A(ke.FmIcon, {
1350
+ return x("div", { class: "flex items-center gap-4 justify-end" }, [
1351
+ x(ge.FmIcon, {
1325
1352
  name: i ? "arrow_drop_up" : "arrow_drop_down",
1326
1353
  color: i ? "system-success-300" : "system-error-300",
1327
1354
  size: "md"
@@ -1336,22 +1363,22 @@ const ka = kt(
1336
1363
  {
1337
1364
  id: "stockTakeValue",
1338
1365
  accessorKey: "stockTakeValue",
1339
- header: () => te(`Stock take value (${m.value})`),
1366
+ header: () => Z(`Stock take value (${d.value})`),
1340
1367
  size: 180,
1341
1368
  cell(f) {
1342
1369
  var T;
1343
- const n = f.row.original, o = n.stockTakeValue, i = W.value.find((j) => j._id === n.id), p = (T = i == null ? void 0 : i.defaultCost) == null ? void 0 : T.measurement, x = n.physicalBalance, v = n.costPerUnit;
1370
+ const n = f.row.original, o = n.stockTakeValue, i = K.value.find((j) => j._id === n.id), p = (T = i == null ? void 0 : i.defaultCost) == null ? void 0 : T.measurement, D = n.physicalBalance, v = n.costPerUnit;
1344
1371
  if (p) {
1345
- const j = V.toFormatString({ value: p.conversion }), re = `${x.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${n.baseUnit} ÷ ${j} × ${v} ${m.value}`;
1346
- return A(
1347
- ke.FmTooltip,
1372
+ const j = V.toFormatString({ value: p.conversion }), le = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${n.baseUnit} ÷ ${j} × ${v} ${d.value}`;
1373
+ return x(
1374
+ ge.FmTooltip,
1348
1375
  { zIndex: 51 },
1349
1376
  {
1350
1377
  content() {
1351
- return re;
1378
+ return le;
1352
1379
  },
1353
1380
  default() {
1354
- return A(
1381
+ return x(
1355
1382
  "div",
1356
1383
  { class: "text-right" },
1357
1384
  o.toLocaleString("en-US", {
@@ -1363,16 +1390,16 @@ const ka = kt(
1363
1390
  }
1364
1391
  );
1365
1392
  } else {
1366
- const j = `${x.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${n.baseUnit} × ${v} ${m.value}`;
1367
- return A(
1368
- ke.FmTooltip,
1393
+ const j = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${n.baseUnit} × ${v} ${d.value}`;
1394
+ return x(
1395
+ ge.FmTooltip,
1369
1396
  { zIndex: 51 },
1370
1397
  {
1371
1398
  content() {
1372
1399
  return j;
1373
1400
  },
1374
1401
  default() {
1375
- return A(
1402
+ return x(
1376
1403
  "div",
1377
1404
  { class: "text-right" },
1378
1405
  o.toLocaleString("en-US", {
@@ -1392,22 +1419,22 @@ const ka = kt(
1392
1419
  {
1393
1420
  id: "systemValue",
1394
1421
  accessorKey: "systemValue",
1395
- header: () => te(`System value (${m.value})`),
1422
+ header: () => Z(`System value (${d.value})`),
1396
1423
  size: 180,
1397
1424
  cell(f) {
1398
1425
  var T;
1399
- const n = f.row.original, o = n.systemValue, i = W.value.find((j) => j._id === n.id), p = (T = i == null ? void 0 : i.defaultCost) == null ? void 0 : T.measurement, x = n.systemBalance, v = n.costPerUnit;
1426
+ const n = f.row.original, o = n.systemValue, i = K.value.find((j) => j._id === n.id), p = (T = i == null ? void 0 : i.defaultCost) == null ? void 0 : T.measurement, D = n.systemBalance, v = n.costPerUnit;
1400
1427
  if (p) {
1401
- const j = V.toFormatString({ value: p.conversion }), re = `${x.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${n.baseUnit} ÷ ${j} × ${v} ${m.value}`;
1402
- return A(
1403
- ke.FmTooltip,
1428
+ const j = V.toFormatString({ value: p.conversion }), le = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${n.baseUnit} ÷ ${j} × ${v} ${d.value}`;
1429
+ return x(
1430
+ ge.FmTooltip,
1404
1431
  { zIndex: 51 },
1405
1432
  {
1406
1433
  content() {
1407
- return re;
1434
+ return le;
1408
1435
  },
1409
1436
  default() {
1410
- return A(
1437
+ return x(
1411
1438
  "div",
1412
1439
  { class: "text-right" },
1413
1440
  o.toLocaleString("en-US", {
@@ -1419,16 +1446,16 @@ const ka = kt(
1419
1446
  }
1420
1447
  );
1421
1448
  } else {
1422
- const j = `${x.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${n.baseUnit} × ${v} ${m.value}`;
1423
- return A(
1424
- ke.FmTooltip,
1449
+ const j = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${n.baseUnit} × ${v} ${d.value}`;
1450
+ return x(
1451
+ ge.FmTooltip,
1425
1452
  { zIndex: 51 },
1426
1453
  {
1427
1454
  content() {
1428
1455
  return j;
1429
1456
  },
1430
1457
  default() {
1431
- return A(
1458
+ return x(
1432
1459
  "div",
1433
1460
  { class: "text-right" },
1434
1461
  o.toLocaleString("en-US", {
@@ -1450,41 +1477,41 @@ const ka = kt(
1450
1477
  header: () => "Amounts",
1451
1478
  enableSorting: !1,
1452
1479
  cell(f) {
1453
- const n = f.row.original, o = (p, x) => A(
1454
- ke.FmTooltip,
1480
+ const n = f.row.original, o = (p, D) => x(
1481
+ ge.FmTooltip,
1455
1482
  { zIndex: 50 },
1456
1483
  {
1457
1484
  default() {
1458
- return A(
1485
+ return x(
1459
1486
  "div",
1460
1487
  {
1461
1488
  class: "fm-typo-en-body-md-400 py-4 px-8 border-1 border-fm-color-typo-secondary fm-corner-radius-md line-clamp-1"
1462
1489
  },
1463
1490
  [
1464
- A("span", { class: "text-fm-color-typo-primary" }, `${p} `),
1465
- A(
1491
+ x("span", { class: "text-fm-color-typo-primary" }, `${p} `),
1492
+ x(
1466
1493
  "span",
1467
1494
  {
1468
1495
  class: "text-fm-color-typo-secondary",
1469
1496
  style: { maxWidth: "80px" }
1470
1497
  },
1471
- x
1498
+ D
1472
1499
  )
1473
1500
  ]
1474
1501
  );
1475
1502
  },
1476
1503
  content() {
1477
- return `${p} ${x}`;
1504
+ return `${p} ${D}`;
1478
1505
  }
1479
1506
  }
1480
1507
  );
1481
- let i = Array.from({ length: l }).map((p, x) => {
1482
- if (!n[`measurementAmount${x}`])
1508
+ let i = Array.from({ length: r }).map((p, D) => {
1509
+ if (!n[`measurementAmount${D}`])
1483
1510
  return null;
1484
- const v = n[`measurementAmount${x}`], T = n[`measurementAbbrev${x}`];
1511
+ const v = n[`measurementAmount${D}`], T = n[`measurementAbbrev${D}`];
1485
1512
  return o(v, T);
1486
1513
  }).filter((p) => p);
1487
- return (n.baseUnitAmount || !i.length) && (i = [o(n.baseUnitAmount, n.baseUnit), ...i]), A(
1514
+ return (n.baseUnitAmount || !i.length) && (i = [o(n.baseUnitAmount, n.baseUnit), ...i]), x(
1488
1515
  "div",
1489
1516
  {
1490
1517
  class: "flex gap-8 flex-nowrap",
@@ -1497,94 +1524,94 @@ const ka = kt(
1497
1524
  }
1498
1525
  }
1499
1526
  ];
1500
- }), je = L(() => Ae.value.map((l) => l.size ?? 0).reduce((l, a) => l + a)), we = Y(""), Ce = L(() => {
1527
+ }), Ue = L(() => Ce.value.map((r) => r.size ?? 0).reduce((r, a) => r + a)), xe = Y(""), $e = L(() => {
1501
1528
  var f, n;
1502
- const l = ((n = (f = e.draft) == null ? void 0 : f.negativeStockItems) == null ? void 0 : n.reduce(
1529
+ const r = ((n = (f = e.draft) == null ? void 0 : f.negativeStockItems) == null ? void 0 : n.reduce(
1503
1530
  (o, i) => (o[i.sku._id] = i, o),
1504
1531
  {}
1505
1532
  )) ?? {};
1506
- return W.value.map((o) => {
1507
- var tt, at, nt, ot, st, rt, lt, it, ct, ut, mt;
1508
- const i = (tt = de.value.get(o._id)) == null ? void 0 : tt[0], p = ((at = se.value.get(o._id)) == null ? void 0 : at[0]) ?? S, x = ((nt = o.defaultCost) == null ? void 0 : nt.costPerUnit) ?? S, v = Number(V.toFormatString({ value: x })), T = ((st = (ot = o.defaultCost) == null ? void 0 : ot.measurement) == null ? void 0 : st.conversion) ?? {
1533
+ return K.value.map((o) => {
1534
+ var nt, ot, st, rt, lt, it, ct, ut, mt, dt, ft;
1535
+ const i = (nt = be.value.get(o._id)) == null ? void 0 : nt[0], p = ((ot = de.value.get(o._id)) == null ? void 0 : ot[0]) ?? w, D = ((st = o.defaultCost) == null ? void 0 : st.costPerUnit) ?? w, v = Number(V.toFormatString({ value: D })), T = ((lt = (rt = o.defaultCost) == null ? void 0 : rt.measurement) == null ? void 0 : lt.conversion) ?? {
1509
1536
  amount: 1,
1510
1537
  precision: 0
1511
1538
  }, j = Number(
1512
1539
  V.toFormatString({ value: T })
1513
- ), re = xe.value.get(o._id), ce = re ? Number(V.toFormatString({ value: re })) : 0, _e = De.value.get(o._id), C = {};
1514
- if (B.value.forEach((Z) => {
1515
- const ue = C[Z] ?? { amount: 0, precision: 0 }, fe = _e == null ? void 0 : _e[Z];
1516
- fe && (C[Z] = Gt(ue, fe));
1540
+ ), le = Ie.value.get(o._id), ce = le ? Number(V.toFormatString({ value: le })) : 0, De = he.value.get(o._id), C = {};
1541
+ if (B.value.forEach((W) => {
1542
+ const ue = C[W] ?? { amount: 0, precision: 0 }, fe = De == null ? void 0 : De[W];
1543
+ fe && (C[W] = Gt(ue, fe));
1517
1544
  }), !i) {
1518
- const Z = Number(V.toFormatString({ value: p })), ue = Z - 0, fe = ue * v / j, Pe = 0, Tt = Z * v / j;
1545
+ const W = Number(V.toFormatString({ value: p })), ue = W - 0, fe = ue * v / j, Re = 0, jt = W * v / j;
1519
1546
  return {
1520
1547
  id: o._id,
1521
1548
  code: o.code,
1522
1549
  name: o.name,
1523
- costUnit: ((lt = (rt = o.defaultCost) == null ? void 0 : rt.measurement) == null ? void 0 : lt.abbrev) ?? null,
1550
+ costUnit: ((ct = (it = o.defaultCost) == null ? void 0 : it.measurement) == null ? void 0 : ct.abbrev) ?? null,
1524
1551
  baseUnit: o.unit.abbrev,
1525
1552
  baseUnitAmount: 0,
1526
- systemBalance: Z,
1553
+ systemBalance: W,
1527
1554
  physicalBalance: 0,
1528
- adjustedAmount: -Z,
1555
+ adjustedAmount: -W,
1529
1556
  adjustedDiffPercentage: -100,
1530
- isTemplateItem: !l[o._id],
1557
+ isTemplateItem: !r[o._id],
1531
1558
  costPerUnit: v,
1532
1559
  opening: ce,
1533
1560
  varianceQty: ue,
1534
1561
  varianceInCost: fe,
1535
- stockTakeValue: Pe,
1536
- systemValue: Tt,
1562
+ stockTakeValue: Re,
1563
+ systemValue: jt,
1537
1564
  adjustmentAmounts: C
1538
1565
  };
1539
1566
  }
1540
- const q = wt(i), J = (ct = (it = P.value) == null ? void 0 : it.find(
1541
- (Z) => Z.id === o._id
1542
- )) == null ? void 0 : ct.balance, pe = Dt(
1543
- J ?? q,
1567
+ const G = St(i), ee = (mt = (ut = P.value) == null ? void 0 : ut.find(
1568
+ (W) => W.id === o._id
1569
+ )) == null ? void 0 : mt.balance, ve = xt(
1570
+ ee ?? G,
1544
1571
  p
1545
- ), $e = p.amount === 0 ? null : xt(pe, {
1572
+ ), Be = p.amount === 0 ? null : At(ve, {
1546
1573
  ...p,
1547
1574
  amount: Math.abs(p.amount)
1548
- }), Ue = $e ? Ze($e, X) : null, Oe = Number(V.toFormatString({ value: p })), Ye = Number(V.toFormatString({ value: q })), et = Oe - Ye, Ct = et * v / j, $t = Ye * v / j, Bt = Oe * v / j;
1575
+ }), Pe = Be ? Xe(Be, X) : null, Ke = Number(V.toFormatString({ value: p })), Qe = Number(V.toFormatString({ value: G })), at = Ke - Qe, $t = at * v / j, Bt = Qe * v / j, Tt = Ke * v / j;
1549
1576
  return {
1550
1577
  id: o._id,
1551
1578
  code: o.code,
1552
1579
  name: o.name,
1553
- costUnit: ((mt = (ut = o.defaultCost) == null ? void 0 : ut.measurement) == null ? void 0 : mt.abbrev) ?? null,
1580
+ costUnit: ((ft = (dt = o.defaultCost) == null ? void 0 : dt.measurement) == null ? void 0 : ft.abbrev) ?? null,
1554
1581
  baseUnit: o.unit.abbrev,
1555
1582
  baseUnitAmount: Number(V.toFormatString({ value: i.baseAmount })),
1556
- ...i.measurementsAmounts.filter((Z) => {
1557
- var ue, fe, Pe;
1558
- return (Pe = (fe = (ue = G.value) == null ? void 0 : ue.get(o._id)) == null ? void 0 : fe[0]) == null ? void 0 : Pe.includes(Z.measurement.id);
1559
- }).reduce((Z, ue, fe) => (Z[`measurementAbbrev${fe}`] = `(${ue.measurement.abbrev}) × ${V.toFormatString({ value: ue.measurement.conversion })}`, Z[`measurementAmount${fe}`] = Number(V.toFormatString({ value: ue.amount })), Z), {}),
1560
- systemBalance: Oe,
1561
- physicalBalance: Ye,
1562
- adjustedAmount: Number(V.toFormatString({ value: pe })),
1563
- adjustedDiffPercentage: Ue ? Number(
1583
+ ...i.measurementsAmounts.filter((W) => {
1584
+ var ue, fe, Re;
1585
+ return (Re = (fe = (ue = J.value) == null ? void 0 : ue.get(o._id)) == null ? void 0 : fe[0]) == null ? void 0 : Re.includes(W.measurement.id);
1586
+ }).reduce((W, ue, fe) => (W[`measurementAbbrev${fe}`] = `(${ue.measurement.abbrev}) × ${V.toFormatString({ value: ue.measurement.conversion })}`, W[`measurementAmount${fe}`] = Number(V.toFormatString({ value: ue.amount })), W), {}),
1587
+ systemBalance: Ke,
1588
+ physicalBalance: Qe,
1589
+ adjustedAmount: Number(V.toFormatString({ value: ve })),
1590
+ adjustedDiffPercentage: Pe ? Number(
1564
1591
  V.toFormatString({
1565
- value: At(Ue, 2)
1592
+ value: _t(Pe, 2)
1566
1593
  })
1567
1594
  ) : null,
1568
- isTemplateItem: !l[o._id],
1595
+ isTemplateItem: !r[o._id],
1569
1596
  costPerUnit: v,
1570
1597
  opening: ce,
1571
- varianceQty: et,
1572
- varianceInCost: Ct,
1573
- stockTakeValue: $t,
1574
- systemValue: Bt,
1598
+ varianceQty: at,
1599
+ varianceInCost: $t,
1600
+ stockTakeValue: Bt,
1601
+ systemValue: Tt,
1575
1602
  adjustmentAmounts: C
1576
1603
  };
1577
- }).filter((o) => !!(o.isTemplateItem && M.value.templateItem || !o.isTemplateItem && M.value.nonTemplateItem));
1578
- }), Ie = L(() => {
1604
+ }).filter((o) => !!(o.isTemplateItem && F.value.templateItem || !o.isTemplateItem && F.value.nonTemplateItem));
1605
+ }), Ae = L(() => {
1579
1606
  var a, f, n, o, i;
1580
1607
  if (!e.draft) return [];
1581
- const l = e.draft.approvedAt ? {
1582
- action: `Approve at ${he(e.draft.approvedAt)}`,
1608
+ const r = e.draft.approvedAt ? {
1609
+ action: `Approve at ${ye(e.draft.approvedAt)}`,
1583
1610
  // actionAt: props.draft.approvedAt,
1584
1611
  actionBy: e.draft.approvedBy,
1585
1612
  remark: e.draft.approveRemark
1586
1613
  } : (a = e.draft.rejectionHistory) == null ? void 0 : a.computeFirst((p) => ({
1587
- action: `Reject at ${he(p.rejectedAt)}`,
1614
+ action: `Reject at ${ye(p.rejectedAt)}`,
1588
1615
  // actionAt: e.rejectedAt,
1589
1616
  actionBy: p.rejectedBy,
1590
1617
  remark: p.rejectRemark
@@ -1596,7 +1623,7 @@ const ka = kt(
1596
1623
  },
1597
1624
  {
1598
1625
  label: "Created at",
1599
- value: he(e.draft.createdAt)
1626
+ value: ye(e.draft.createdAt)
1600
1627
  },
1601
1628
  {
1602
1629
  label: "Created by",
@@ -1604,7 +1631,7 @@ const ka = kt(
1604
1631
  },
1605
1632
  {
1606
1633
  label: "Updated at",
1607
- value: he(e.draft.updatedAt)
1634
+ value: ye(e.draft.updatedAt)
1608
1635
  },
1609
1636
  {
1610
1637
  label: "Updated by",
@@ -1612,7 +1639,7 @@ const ka = kt(
1612
1639
  },
1613
1640
  {
1614
1641
  label: "Effective at",
1615
- value: he(e.draft.effectiveAt ?? Qe((n = e.draft) == null ? void 0 : n._id))
1642
+ value: ye(e.draft.effectiveAt ?? Ve((n = e.draft) == null ? void 0 : n._id))
1616
1643
  },
1617
1644
  {
1618
1645
  label: "Using template",
@@ -1622,20 +1649,20 @@ const ka = kt(
1622
1649
  label: "Remark",
1623
1650
  value: e.draft.remark
1624
1651
  } : null,
1625
- l ? {
1652
+ r ? {
1626
1653
  label: "Last action",
1627
- value: l.action
1654
+ value: r.action
1628
1655
  } : null,
1629
- l && l.actionBy ? {
1656
+ r && r.actionBy ? {
1630
1657
  label: "Last action by",
1631
- value: (i = l.actionBy) == null ? void 0 : i.name
1658
+ value: (i = r.actionBy) == null ? void 0 : i.name
1632
1659
  } : null,
1633
- l && l.remark ? {
1660
+ r && r.remark ? {
1634
1661
  label: "Action remark",
1635
- value: l.remark
1662
+ value: r.remark
1636
1663
  } : null
1637
1664
  ].filter((p) => p).map((p) => p);
1638
- }), ge = [
1665
+ }), _e = [
1639
1666
  {
1640
1667
  label: "Overview",
1641
1668
  value: "overview"
@@ -1644,32 +1671,32 @@ const ka = kt(
1644
1671
  label: "Action history",
1645
1672
  value: "history"
1646
1673
  }
1647
- ], ye = Y(ge[0]), be = L(() => {
1674
+ ], ke = Y(_e[0]), we = L(() => {
1648
1675
  var n, o, i;
1649
- const l = ((n = e.draft) == null ? void 0 : n.activityLogs) ?? [], a = ((o = e.draft) == null ? void 0 : o.rejectionHistory) ?? [];
1676
+ const r = ((n = e.draft) == null ? void 0 : n.activityLogs) ?? [], a = ((o = e.draft) == null ? void 0 : o.rejectionHistory) ?? [];
1650
1677
  for (const p of a)
1651
- l.find(
1678
+ r.find(
1652
1679
  (v) => `${v.action}_${v.performedAt}` == `${O.enum.rejectDraft}_${p.rejectedAt}`
1653
- ) || l.push({
1680
+ ) || r.push({
1654
1681
  action: O.enum.rejectDraft,
1655
1682
  performedAt: p.rejectedAt,
1656
1683
  performedBy: p.rejectedBy,
1657
1684
  remark: p.rejectRemark
1658
1685
  });
1659
- return (i = e.draft) != null && i.approvedAt && (l.find(
1660
- (x) => {
1686
+ return (i = e.draft) != null && i.approvedAt && (r.find(
1687
+ (D) => {
1661
1688
  var v;
1662
- return `${x.action}_${x.performedAt}` == `${O.enum.approveDraft}_${(v = e.draft) == null ? void 0 : v.approvedAt}`;
1689
+ return `${D.action}_${D.performedAt}` == `${O.enum.approveDraft}_${(v = e.draft) == null ? void 0 : v.approvedAt}`;
1663
1690
  }
1664
- ) || l.push({
1691
+ ) || r.push({
1665
1692
  action: O.enum.approveDraft,
1666
1693
  performedAt: e.draft.approvedAt,
1667
1694
  performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
1668
1695
  remark: e.draft.approveRemark
1669
- })), l.sort((p, x) => new Date(x.performedAt).getTime() - new Date(p.performedAt).getTime()).map(
1696
+ })), r.sort((p, D) => new Date(D.performedAt).getTime() - new Date(p.performedAt).getTime()).map(
1670
1697
  (p) => ({
1671
- header: Me(p.action),
1672
- date: he(p.performedAt),
1698
+ header: Le(p.action),
1699
+ date: ye(p.performedAt),
1673
1700
  info: [
1674
1701
  {
1675
1702
  label: "Performed by",
@@ -1682,127 +1709,127 @@ const ka = kt(
1682
1709
  ]
1683
1710
  })
1684
1711
  );
1685
- }), Xe = L(() => {
1686
- var o, i, p, x;
1712
+ }), tt = L(() => {
1713
+ var o, i, p, D;
1687
1714
  if (!((o = e.draft) != null && o.stockSnapshot)) return "Stock snapshot is not available.";
1688
- if (((i = e.draft) == null ? void 0 : i.status) !== ve.enum.DRAFT) return "Status is not draft.";
1689
- const l = Ce.value.some((v) => v.physicalBalance < 0), a = ((x = (p = b.stockBalance.skus) == null ? void 0 : p.filter((v) => v.balance.amount < 0)) == null ? void 0 : x.map((v) => v.id)) ?? [], f = new Set(W.value.map((v) => v._id)), n = a.filter((v) => !f.has(v)).length;
1715
+ if (((i = e.draft) == null ? void 0 : i.status) !== pe.enum.DRAFT) return "Status is not draft.";
1716
+ const r = $e.value.some((v) => v.physicalBalance < 0), a = ((D = (p = h.stockBalance.skus) == null ? void 0 : p.filter((v) => v.balance.amount < 0)) == null ? void 0 : D.map((v) => v.id)) ?? [], f = new Set(K.value.map((v) => v._id)), n = a.filter((v) => !f.has(v)).length;
1690
1717
  return [
1691
- l ? "Negative total exist." : null,
1718
+ r ? "Negative total exist." : null,
1692
1719
  n ? "Negative stock is not included in this draft. Please commit the draft to include these stocks." : null
1693
1720
  ].filter((v) => v).join(" ");
1694
1721
  });
1695
- return (l, a) => {
1696
- const f = z("FmButtonGroup"), n = z("FmMenuDivider"), o = z("FmCard"), i = z("FmButton"), p = z("FmCircularProgress"), x = z("FmChip"), v = z("FmTextField"), T = z("FmIcon"), j = z("FmTable"), re = z("FmSpacer"), ce = z("FmTooltip"), _e = z("FmSideSheet");
1697
- return F(), ie(_e, {
1722
+ return (r, a) => {
1723
+ const f = z("FmButtonGroup"), n = z("FmMenuDivider"), o = z("FmCard"), i = z("FmButton"), p = z("FmCircularProgress"), D = z("FmChip"), v = z("FmTextField"), T = z("FmIcon"), j = z("FmTable"), le = z("FmSpacer"), ce = z("FmTooltip"), De = z("FmSideSheet");
1724
+ return S(), oe(De, {
1698
1725
  "dismiss-away": "",
1699
1726
  "max-width": 9999,
1700
- "model-value": $(y),
1701
- "onUpdate:modelValue": a[10] || (a[10] = (C) => ft(y) ? y.value = C : null),
1727
+ "model-value": $(b),
1728
+ "onUpdate:modelValue": a[10] || (a[10] = (C) => vt(b) ? b.value = C : null),
1702
1729
  header: "Closing details"
1703
1730
  }, {
1704
1731
  "side-sheet-footer": Q(() => {
1705
- var C, q, J, pe;
1732
+ var C, G, ee, ve;
1706
1733
  return [
1707
- c("div", en, [
1708
- ((C = e.draft) == null ? void 0 : C.status) === $(ve).enum.DRAFT ? (F(), E(le, { key: 0 }, [
1709
- Xe.value ? (F(), ie(ce, {
1734
+ c("div", tn, [
1735
+ ((C = e.draft) == null ? void 0 : C.status) === $(pe).enum.DRAFT ? (S(), E(ie, { key: 0 }, [
1736
+ tt.value ? (S(), oe(ce, {
1710
1737
  key: 0,
1711
1738
  "z-index": 51,
1712
1739
  placement: "right"
1713
1740
  }, {
1714
1741
  content: Q(() => [
1715
- oe(ae(Xe.value), 1)
1742
+ se(ne(tt.value), 1)
1716
1743
  ]),
1717
1744
  default: Q(() => [
1718
- w(i, {
1745
+ A(i, {
1719
1746
  disabled: "",
1720
1747
  key: "approve key",
1721
1748
  label: "Approve",
1722
- onClick: a[5] || (a[5] = () => e.draft && $(g).approveDraft(e.draft, () => h("submitted")))
1749
+ onClick: a[5] || (a[5] = () => e.draft && $(y).approveDraft(e.draft, () => m("submitted")))
1723
1750
  })
1724
1751
  ]),
1725
1752
  _: 1
1726
- })) : (F(), ie(i, {
1753
+ })) : (S(), oe(i, {
1727
1754
  key: "approve key",
1728
1755
  label: "Approve",
1729
- onClick: a[6] || (a[6] = () => e.draft && $(g).approveDraft(e.draft, () => h("submitted")))
1756
+ onClick: a[6] || (a[6] = () => e.draft && $(y).approveDraft(e.draft, () => m("submitted")))
1730
1757
  }))
1731
- ], 64)) : ne("", !0),
1732
- ((q = e.draft) == null ? void 0 : q.status) === $(ve).enum.DRAFT ? (F(), ie(i, {
1758
+ ], 64)) : te("", !0),
1759
+ ((G = e.draft) == null ? void 0 : G.status) === $(pe).enum.DRAFT ? (S(), oe(i, {
1733
1760
  key: 1,
1734
1761
  label: "Reject",
1735
1762
  variant: "destructive",
1736
- onClick: a[7] || (a[7] = () => e.draft && $(g).rejectDraft(e.draft, () => h("submitted")))
1737
- })) : ne("", !0),
1738
- (J = e.draft) != null && J.approvedAt && ((pe = e.draft) == null ? void 0 : pe.status) !== $(ve).enum.COMPLETED ? (F(), ie(vt, { key: 2 }, {
1763
+ onClick: a[7] || (a[7] = () => e.draft && $(y).rejectDraft(e.draft, () => m("submitted")))
1764
+ })) : te("", !0),
1765
+ (ee = e.draft) != null && ee.approvedAt && ((ve = e.draft) == null ? void 0 : ve.status) !== $(pe).enum.COMPLETED ? (S(), oe(Ge, { key: 2 }, {
1739
1766
  default: Q(() => [
1740
- w(i, {
1767
+ A(i, {
1741
1768
  label: "Sync",
1742
1769
  loading: U.value,
1743
1770
  onClick: a[8] || (a[8] = () => {
1744
- e.draft && (U.value = !0, $(g).syncDraft(e.draft, () => {
1745
- U.value = !1, h("submitted");
1771
+ e.draft && (U.value = !0, $(y).syncDraft(e.draft, () => {
1772
+ U.value = !1, m("submitted");
1746
1773
  }));
1747
1774
  })
1748
1775
  }, null, 8, ["loading"])
1749
1776
  ]),
1750
1777
  _: 1
1751
- })) : ne("", !0),
1752
- w(i, {
1778
+ })) : te("", !0),
1779
+ A(i, {
1753
1780
  label: "Close",
1754
1781
  variant: "tertiary",
1755
- onClick: a[9] || (a[9] = ($e) => y.value = !1)
1782
+ onClick: a[9] || (a[9] = (Be) => b.value = !1)
1756
1783
  })
1757
1784
  ])
1758
1785
  ];
1759
1786
  }),
1760
1787
  default: Q(() => [
1761
- c("div", ha, [
1788
+ c("div", Da, [
1762
1789
  c("div", null, [
1763
- w(f, {
1764
- items: ge,
1765
- modelValue: ye.value,
1766
- "onUpdate:modelValue": a[0] || (a[0] = (C) => ye.value = C)
1790
+ A(f, {
1791
+ items: _e,
1792
+ modelValue: ke.value,
1793
+ "onUpdate:modelValue": a[0] || (a[0] = (C) => ke.value = C)
1767
1794
  }, null, 8, ["modelValue"])
1768
1795
  ]),
1769
- ye.value.value === "overview" ? (F(), E(le, { key: 0 }, [
1770
- w(o, {
1796
+ ke.value.value === "overview" ? (S(), E(ie, { key: 0 }, [
1797
+ A(o, {
1771
1798
  variant: "outlined",
1772
1799
  class: "flex flex-col gap-8 px-12 py-16"
1773
1800
  }, {
1774
1801
  default: Q(() => {
1775
- var C, q;
1802
+ var C, G;
1776
1803
  return [
1777
- c("div", Da, [
1804
+ c("div", xa, [
1778
1805
  a[11] || (a[11] = c("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
1779
- c("div", xa, [
1806
+ c("div", Aa, [
1780
1807
  c("div", {
1781
- class: Fe(["fm-status-badge", $(Ve)(((C = l.draft) == null ? void 0 : C.status) ?? "DRAFT")])
1782
- }, ae($(Me)(((q = l.draft) == null ? void 0 : q.status) ?? "")), 3)
1808
+ class: Fe(["fm-status-badge", $(Ne)(((C = r.draft) == null ? void 0 : C.status) ?? "DRAFT")])
1809
+ }, ne($(Le)(((G = r.draft) == null ? void 0 : G.status) ?? "")), 3)
1783
1810
  ])
1784
1811
  ]),
1785
- w(n),
1786
- c("div", Aa, [
1787
- (F(!0), E(le, null, Be(Ie.value, (J, pe) => (F(), E("div", {
1812
+ A(n),
1813
+ c("div", _a, [
1814
+ (S(!0), E(ie, null, Te(Ae.value, (ee, ve) => (S(), E("div", {
1788
1815
  class: "flex flex-col gap-4",
1789
- key: pe
1816
+ key: ve
1790
1817
  }, [
1791
- c("div", _a, [
1792
- c("div", wa, ae(J.label), 1)
1818
+ c("div", wa, [
1819
+ c("div", Sa, ne(ee.label), 1)
1793
1820
  ]),
1794
- c("div", Sa, ae(J.value), 1)
1821
+ c("div", Fa, ne(ee.value), 1)
1795
1822
  ]))), 128))
1796
1823
  ])
1797
1824
  ];
1798
1825
  }),
1799
1826
  _: 1
1800
1827
  }),
1801
- c("div", Fa, [
1802
- c("div", Ca, [
1828
+ c("div", Ca, [
1829
+ c("div", $a, [
1803
1830
  a[12] || (a[12] = c("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
1804
- I.value ? ne("", !0) : (F(), E("div", $a, [
1805
- l.draft && l.draft.status !== $(ve).enum.COMPLETED ? (F(), ie(i, {
1831
+ I.value ? te("", !0) : (S(), E("div", Ba, [
1832
+ r.draft && r.draft.status !== $(pe).enum.COMPLETED ? (S(), oe(i, {
1806
1833
  key: 0,
1807
1834
  label: "Refresh balance",
1808
1835
  "prepend-icon": "refresh",
@@ -1810,160 +1837,176 @@ const ka = kt(
1810
1837
  "text-color": "primary",
1811
1838
  "bg-color": "transparent",
1812
1839
  "border-color": "primary",
1813
- loading: N.value,
1814
- onClick: ee
1815
- }, null, 8, ["loading"])) : ne("", !0),
1816
- w(i, {
1840
+ loading: M.value,
1841
+ onClick: ae
1842
+ }, null, 8, ["loading"])) : te("", !0),
1843
+ A(Ge, null, {
1844
+ default: Q(() => [
1845
+ r.draft && r.draft.status !== $(pe).enum.COMPLETED ? (S(), oe(i, {
1846
+ key: 0,
1847
+ label: "Invalidate Draft Cache",
1848
+ "prepend-icon": "refresh",
1849
+ variant: "secondary",
1850
+ "text-color": "primary",
1851
+ "bg-color": "transparent",
1852
+ "border-color": "primary",
1853
+ loading: M.value,
1854
+ onClick: re
1855
+ }, null, 8, ["loading"])) : te("", !0)
1856
+ ]),
1857
+ _: 1
1858
+ }),
1859
+ A(i, {
1817
1860
  label: "Export data",
1818
1861
  "prepend-icon": "download",
1819
1862
  variant: "secondary",
1820
1863
  "text-color": "primary",
1821
1864
  "bg-color": "transparent",
1822
1865
  "border-color": "primary",
1823
- onClick: a[1] || (a[1] = (C) => l.draft ? $(g).exportDraft(
1824
- l.draft,
1825
- D.value,
1866
+ onClick: a[1] || (a[1] = (C) => r.draft ? $(y).exportDraft(
1867
+ r.draft,
1868
+ k.value,
1826
1869
  P.value
1827
1870
  ) : null)
1828
1871
  })
1829
1872
  ]))
1830
1873
  ]),
1831
- I.value ? (F(), E("div", Ba, [
1874
+ I.value ? (S(), E("div", Ta, [
1832
1875
  a[14] || (a[14] = c("div", { class: "h-80" }, null, -1)),
1833
- c("div", Ta, [
1876
+ c("div", ja, [
1834
1877
  c("div", null, [
1835
- w(p, { size: "md" })
1878
+ A(p, { size: "md" })
1836
1879
  ]),
1837
1880
  a[13] || (a[13] = c("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
1838
1881
  ]),
1839
1882
  a[15] || (a[15] = c("div", { class: "h-80" }, null, -1))
1840
- ])) : (F(), E(le, { key: 1 }, [
1841
- c("div", ja, [
1842
- c("div", Ia, [
1843
- w(x, {
1883
+ ])) : (S(), E(ie, { key: 1 }, [
1884
+ c("div", Ia, [
1885
+ c("div", Ua, [
1886
+ A(D, {
1844
1887
  label: "Template Item(s)",
1845
- selected: M.value.templateItem,
1846
- onClick: a[2] || (a[2] = (C) => M.value.templateItem = !M.value.templateItem)
1888
+ selected: F.value.templateItem,
1889
+ onClick: a[2] || (a[2] = (C) => F.value.templateItem = !F.value.templateItem)
1847
1890
  }, null, 8, ["selected"]),
1848
- w(x, {
1891
+ A(D, {
1849
1892
  label: "Non-template Item(s)",
1850
- selected: M.value.nonTemplateItem,
1851
- onClick: a[3] || (a[3] = (C) => M.value.nonTemplateItem = !M.value.nonTemplateItem)
1893
+ selected: F.value.nonTemplateItem,
1894
+ onClick: a[3] || (a[3] = (C) => F.value.nonTemplateItem = !F.value.nonTemplateItem)
1852
1895
  }, null, 8, ["selected"])
1853
1896
  ]),
1854
- w(v, {
1855
- modelValue: we.value,
1856
- "onUpdate:modelValue": a[4] || (a[4] = (C) => we.value = C),
1897
+ A(v, {
1898
+ modelValue: xe.value,
1899
+ "onUpdate:modelValue": a[4] || (a[4] = (C) => xe.value = C),
1857
1900
  placeholder: "Filter items"
1858
1901
  }, null, 8, ["modelValue"])
1859
1902
  ]),
1860
- $(_).skuTags.size ? (F(), E("div", Ua, [
1861
- (F(!0), E(le, null, Be($(_).skuTags.keys(), (C) => (F(), ie(x, {
1903
+ $(_).skuTags.size ? (S(), E("div", Pa, [
1904
+ (S(!0), E(ie, null, Te($(_).skuTags.keys(), (C) => (S(), oe(D, {
1862
1905
  key: `${C}`,
1863
1906
  label: `${C}`,
1864
1907
  selectable: "",
1865
- selected: k[`${C}`],
1866
- onClick: (q) => k[`${C}`] = !k[`${C}`]
1908
+ selected: N[`${C}`],
1909
+ onClick: (G) => N[`${C}`] = !N[`${C}`]
1867
1910
  }, {
1868
1911
  default: Q(() => [
1869
- k[`${C}`] ? (F(), ie(T, {
1912
+ N[`${C}`] ? (S(), oe(T, {
1870
1913
  key: 0,
1871
1914
  name: "check",
1872
1915
  class: "text-white",
1873
1916
  size: "sm"
1874
- })) : ne("", !0),
1917
+ })) : te("", !0),
1875
1918
  c("span", {
1876
1919
  class: Fe([
1877
1920
  "",
1878
1921
  {
1879
- "text-white fm-typo-en-body-md-600": k[`${C}`],
1880
- "text-fm-color-typo-primary fm-typo-en-body-md-400": !k[`${C}`]
1922
+ "text-white fm-typo-en-body-md-600": N[`${C}`],
1923
+ "text-fm-color-typo-primary fm-typo-en-body-md-400": !N[`${C}`]
1881
1924
  }
1882
1925
  ])
1883
- }, ae(C), 3)
1926
+ }, ne(C), 3)
1884
1927
  ]),
1885
1928
  _: 2
1886
1929
  }, 1032, ["label", "selected", "onClick"]))), 128))
1887
- ])) : ne("", !0),
1888
- c("div", Pa, [
1930
+ ])) : te("", !0),
1931
+ c("div", Ra, [
1889
1932
  c("div", {
1890
- style: pt({ height: "600px", minWidth: `${je.value}px` })
1933
+ style: gt({ height: "600px", minWidth: `${Ue.value}px` })
1891
1934
  }, [
1892
- w(j, {
1893
- "column-defs": Ae.value,
1894
- "row-data": Ce.value,
1895
- "search-value": we.value
1935
+ A(j, {
1936
+ "column-defs": Ce.value,
1937
+ "row-data": $e.value,
1938
+ "search-value": xe.value
1896
1939
  }, null, 8, ["column-defs", "row-data", "search-value"])
1897
1940
  ], 4)
1898
1941
  ])
1899
1942
  ], 64))
1900
1943
  ])
1901
- ], 64)) : ne("", !0),
1902
- ye.value.value === "history" ? (F(), E("div", Ra, [
1903
- be.value.length ? (F(), E("div", La, [
1904
- (F(!0), E(le, null, Be(be.value, (C, q) => (F(), E(le, { key: q }, [
1905
- c("div", Na, [
1906
- c("div", Ea, [
1907
- c("div", za, [
1944
+ ], 64)) : te("", !0),
1945
+ ke.value.value === "history" ? (S(), E("div", Ma, [
1946
+ we.value.length ? (S(), E("div", Na, [
1947
+ (S(!0), E(ie, null, Te(we.value, (C, G) => (S(), E(ie, { key: G }, [
1948
+ c("div", Ea, [
1949
+ c("div", za, [
1950
+ c("div", Ha, [
1908
1951
  c("div", {
1909
1952
  class: Fe([
1910
1953
  {
1911
- "bg-fm-color-primary": q !== 0,
1912
- "bg-white": q === 0
1954
+ "bg-fm-color-primary": G !== 0,
1955
+ "bg-white": G === 0
1913
1956
  },
1914
1957
  "w-[2px] h-full"
1915
1958
  ])
1916
1959
  }, null, 2)
1917
1960
  ]),
1918
1961
  a[18] || (a[18] = c("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1919
- c("div", Ha, [
1962
+ c("div", Oa, [
1920
1963
  c("div", {
1921
1964
  class: Fe([
1922
1965
  {
1923
- "bg-fm-color-primary": q < be.value.length - 1,
1924
- "bg-white": q >= be.value.length - 1
1966
+ "bg-fm-color-primary": G < we.value.length - 1,
1967
+ "bg-white": G >= we.value.length - 1
1925
1968
  },
1926
1969
  "w-[2px] h-full"
1927
1970
  ])
1928
1971
  }, null, 2)
1929
1972
  ])
1930
1973
  ]),
1931
- c("div", Oa, [
1932
- c("div", Ya, ae(C.header), 1),
1933
- c("div", Ka, ae(C.date), 1)
1974
+ c("div", Ya, [
1975
+ c("div", Ka, ne(C.header), 1),
1976
+ c("div", Qa, ne(C.date), 1)
1934
1977
  ])
1935
1978
  ]),
1936
- c("div", Qa, [
1979
+ c("div", qa, [
1937
1980
  c("div", Ga, [
1938
- c("div", qa, [
1981
+ c("div", Wa, [
1939
1982
  c("div", {
1940
1983
  class: Fe([
1941
1984
  {
1942
- "bg-fm-color-primary": q < be.value.length - 1,
1943
- "bg-white": q >= be.value.length - 1
1985
+ "bg-fm-color-primary": G < we.value.length - 1,
1986
+ "bg-white": G >= we.value.length - 1
1944
1987
  },
1945
1988
  "w-[2px] h-full"
1946
1989
  ])
1947
1990
  }, null, 2)
1948
1991
  ])
1949
1992
  ]),
1950
- c("div", Wa, [
1951
- w(o, {
1993
+ c("div", Za, [
1994
+ A(o, {
1952
1995
  variant: "outlined",
1953
1996
  class: "py-12 px-16"
1954
1997
  }, {
1955
1998
  default: Q(() => [
1956
- c("div", Za, [
1957
- (F(!0), E(le, null, Be(C.info, (J, pe) => (F(), E("div", {
1958
- key: pe,
1999
+ c("div", Ja, [
2000
+ (S(!0), E(ie, null, Te(C.info, (ee, ve) => (S(), E("div", {
2001
+ key: ve,
1959
2002
  class: "flex flex-col gap-4"
1960
2003
  }, [
1961
- c("div", Ja, ae(J == null ? void 0 : J.label), 1),
1962
- c("div", Xa, [
1963
- (F(!0), E(le, null, Be(J == null ? void 0 : J.values, ($e, Ue) => (F(), E("div", {
1964
- key: Ue,
2004
+ c("div", Xa, ne(ee == null ? void 0 : ee.label), 1),
2005
+ c("div", en, [
2006
+ (S(!0), E(ie, null, Te(ee == null ? void 0 : ee.values, (Be, Pe) => (S(), E("div", {
2007
+ key: Pe,
1965
2008
  class: "fm-typo-en-body-lg-600"
1966
- }, ae($e), 1))), 128))
2009
+ }, ne(Be), 1))), 128))
1967
2010
  ])
1968
2011
  ]))), 128))
1969
2012
  ])
@@ -1973,36 +2016,36 @@ const ka = kt(
1973
2016
  ])
1974
2017
  ])
1975
2018
  ], 64))), 128))
1976
- ])) : (F(), E("div", Ma, [
1977
- w(re),
2019
+ ])) : (S(), E("div", Va, [
2020
+ A(le),
1978
2021
  c("div", null, [
1979
2022
  c("img", {
1980
- src: $(ta),
2023
+ src: $(aa),
1981
2024
  alt: "List is empty"
1982
- }, null, 8, Va)
2025
+ }, null, 8, La)
1983
2026
  ]),
1984
- a[16] || (a[16] = c("div", { class: "fm-typo-en-body-lg-600" }, ae("No records found"), -1)),
1985
- a[17] || (a[17] = c("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, ae("You can track approval and rejection history here"), -1)),
1986
- w(re),
1987
- w(re)
2027
+ a[16] || (a[16] = c("div", { class: "fm-typo-en-body-lg-600" }, ne("No records found"), -1)),
2028
+ a[17] || (a[17] = c("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, ne("You can track approval and rejection history here"), -1)),
2029
+ A(le),
2030
+ A(le)
1988
2031
  ]))
1989
- ])) : ne("", !0)
2032
+ ])) : te("", !0)
1990
2033
  ])
1991
2034
  ]),
1992
2035
  _: 1
1993
2036
  }, 8, ["model-value"]);
1994
2037
  };
1995
2038
  }
1996
- }), nn = { class: "flex-1 flex flex-col gap-8" }, on = { class: "flex flex-col" }, sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ln = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, cn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Cn = /* @__PURE__ */ Ee({
2039
+ }), on = { class: "flex-1 flex flex-col gap-8" }, sn = { class: "flex flex-col" }, rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ln = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, cn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, un = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, $n = /* @__PURE__ */ He({
1997
2040
  __name: "ClosingDraftView",
1998
- setup(r) {
1999
- const { t: s } = yt(), { viewDraft: e } = Ne(), { viewClosingDraftProps: m, viewClosingDraftShow: b } = Ot(Ne()), g = ze(), y = ka(), I = Rt(), { breakpoints: N } = Nt();
2000
- g.watchLocation(y.fetchDrafts);
2001
- const U = L(() => y.loading), D = Y(""), P = L(() => N.value.xs || N.value.sm), B = L(() => P.value ? 10 : 20);
2002
- function K(_) {
2041
+ setup(l) {
2042
+ const { t: s } = bt(), { viewDraft: e } = ze(), { viewClosingDraftProps: d, viewClosingDraftShow: h } = Yt(ze()), y = Oe(), b = ka(), I = Mt(), { breakpoints: M } = Et();
2043
+ y.watchLocation(b.fetchDrafts);
2044
+ const U = L(() => b.loading), k = Y(""), P = L(() => M.value.xs || M.value.sm), B = L(() => P.value ? 10 : 20);
2045
+ function q(_) {
2003
2046
  switch (_) {
2004
2047
  case "refresh":
2005
- return y.fetchDrafts();
2048
+ return b.fetchDrafts();
2006
2049
  }
2007
2050
  }
2008
2051
  function u(_) {
@@ -2022,12 +2065,12 @@ const ka = kt(
2022
2065
  }
2023
2066
  ]);
2024
2067
  return (_, R) => {
2025
- const k = z("FmTable");
2026
- return F(), E(le, null, [
2027
- w(Mt, {
2068
+ const N = z("FmTable");
2069
+ return S(), E(ie, null, [
2070
+ A(Vt, {
2028
2071
  title: $(s)("inventory.closing.draft.title"),
2029
2072
  actions: t.value,
2030
- "onClick:action": K
2073
+ "onClick:action": q
2031
2074
  }, {
2032
2075
  default: Q(() => [
2033
2076
  c("div", {
@@ -2039,58 +2082,58 @@ const ka = kt(
2039
2082
  }
2040
2083
  ])
2041
2084
  }, [
2042
- w(ea, {
2085
+ A(ta, {
2043
2086
  "change-location": "",
2044
2087
  searchable: "",
2045
- search: D.value,
2046
- "onUpdate:search": R[0] || (R[0] = (d) => D.value = d)
2088
+ search: k.value,
2089
+ "onUpdate:search": R[0] || (R[0] = (g) => k.value = g)
2047
2090
  }, null, 8, ["search"]),
2048
- w(k, {
2049
- style: pt($(I).tableHeight),
2050
- "column-defs": $(y).columnDefs,
2051
- "row-data": $(y).drafts,
2052
- "search-value": D.value,
2091
+ A(N, {
2092
+ style: gt($(I).tableHeight),
2093
+ "column-defs": $(b).columnDefs,
2094
+ "row-data": $(b).drafts,
2095
+ "search-value": k.value,
2053
2096
  loading: U.value,
2054
- onRowClick: R[1] || (R[1] = (d) => $(e)(d.original)),
2097
+ onRowClick: R[1] || (R[1] = (g) => $(e)(g.original)),
2055
2098
  "page-size": B.value
2056
2099
  }, {
2057
- "list-row": Q((d) => [
2058
- w(Jt, {
2059
- row: d,
2060
- onRowClick: (h) => $(e)(h)
2100
+ "list-row": Q((g) => [
2101
+ A(Xt, {
2102
+ row: g,
2103
+ onRowClick: (m) => $(e)(m)
2061
2104
  }, {
2062
- default: Q((h) => {
2063
- var M, H, W, G, S, X, me, ee, se, de, De, xe, te, Ae, je, we, Ce, Ie, ge, ye;
2105
+ default: Q((m) => {
2106
+ var F, H, K, J, w, X, me, ae, re, de, be, he, Ie, Z, Ce, Ue, xe, $e, Ae, _e;
2064
2107
  return [
2065
- c("div", nn, [
2066
- c("div", on, [
2067
- c("div", sn, [
2068
- w($(Re), {
2069
- render: (W = (H = (M = h._id) == null ? void 0 : M.column) == null ? void 0 : H.columnDef) == null ? void 0 : W.cell,
2070
- props: (S = (G = h._id) == null ? void 0 : G.getContext) == null ? void 0 : S.call(G)
2108
+ c("div", on, [
2109
+ c("div", sn, [
2110
+ c("div", rn, [
2111
+ A($(Me), {
2112
+ render: (K = (H = (F = m._id) == null ? void 0 : F.column) == null ? void 0 : H.columnDef) == null ? void 0 : K.cell,
2113
+ props: (w = (J = m._id) == null ? void 0 : J.getContext) == null ? void 0 : w.call(J)
2071
2114
  }, null, 8, ["render", "props"])
2072
2115
  ]),
2073
- c("div", rn, [
2074
- w($(Re), {
2075
- render: (ee = (me = (X = h.name) == null ? void 0 : X.column) == null ? void 0 : me.columnDef) == null ? void 0 : ee.cell,
2076
- props: (de = (se = h.name) == null ? void 0 : se.getContext) == null ? void 0 : de.call(se)
2116
+ c("div", ln, [
2117
+ A($(Me), {
2118
+ render: (ae = (me = (X = m.name) == null ? void 0 : X.column) == null ? void 0 : me.columnDef) == null ? void 0 : ae.cell,
2119
+ props: (de = (re = m.name) == null ? void 0 : re.getContext) == null ? void 0 : de.call(re)
2077
2120
  }, null, 8, ["render", "props"])
2078
2121
  ]),
2079
- c("div", ln, ae([
2080
- ...d.original.items.slice(0, 3).map((be) => be.sku.name),
2081
- ...d.original.items.length >= 3 ? [`and ${d.original.items.length - 3} more items`] : []
2122
+ c("div", cn, ne([
2123
+ ...g.original.items.slice(0, 3).map((ke) => ke.sku.name),
2124
+ ...g.original.items.length >= 3 ? [`and ${g.original.items.length - 3} more items`] : []
2082
2125
  ].join(", ")), 1),
2083
- c("div", cn, [
2084
- w($(Re), {
2085
- render: (te = (xe = (De = h.ref) == null ? void 0 : De.column) == null ? void 0 : xe.columnDef) == null ? void 0 : te.cell,
2086
- props: (je = (Ae = h.ref) == null ? void 0 : Ae.getContext) == null ? void 0 : je.call(Ae)
2126
+ c("div", un, [
2127
+ A($(Me), {
2128
+ render: (Ie = (he = (be = m.ref) == null ? void 0 : be.column) == null ? void 0 : he.columnDef) == null ? void 0 : Ie.cell,
2129
+ props: (Ce = (Z = m.ref) == null ? void 0 : Z.getContext) == null ? void 0 : Ce.call(Z)
2087
2130
  }, null, 8, ["render", "props"])
2088
2131
  ])
2089
2132
  ]),
2090
2133
  c("div", null, [
2091
- w($(Re), {
2092
- render: (Ie = (Ce = (we = h.status) == null ? void 0 : we.column) == null ? void 0 : Ce.columnDef) == null ? void 0 : Ie.cell,
2093
- props: (ye = (ge = h.status) == null ? void 0 : ge.getContext) == null ? void 0 : ye.call(ge)
2134
+ A($(Me), {
2135
+ render: ($e = (xe = (Ue = m.status) == null ? void 0 : Ue.column) == null ? void 0 : xe.columnDef) == null ? void 0 : $e.cell,
2136
+ props: (_e = (Ae = m.status) == null ? void 0 : Ae.getContext) == null ? void 0 : _e.call(Ae)
2094
2137
  }, null, 8, ["render", "props"])
2095
2138
  ])
2096
2139
  ])
@@ -2105,12 +2148,12 @@ const ka = kt(
2105
2148
  ]),
2106
2149
  _: 1
2107
2150
  }, 8, ["title", "actions"]),
2108
- (F(), ie(Ut, { to: "body" }, [
2109
- w(an, Pt($(m), {
2110
- show: $(b),
2111
- "onUpdate:show": R[2] || (R[2] = (d) => ft(b) ? b.value = d : null),
2112
- onSubmitted: R[3] || (R[3] = () => (b.value = !1, $(y).fetchDrafts())),
2113
- onRefresh: R[4] || (R[4] = (d) => $(y).updateDraftRef(d))
2151
+ (S(), oe(Pt, { to: "body" }, [
2152
+ A(nn, Rt($(d), {
2153
+ show: $(h),
2154
+ "onUpdate:show": R[2] || (R[2] = (g) => vt(h) ? h.value = g : null),
2155
+ onSubmitted: R[3] || (R[3] = () => (h.value = !1, $(b).fetchDrafts())),
2156
+ onRefresh: R[4] || (R[4] = (g) => $(b).updateDraftRef(g))
2114
2157
  }), null, 16, ["show"])
2115
2158
  ]))
2116
2159
  ], 64);
@@ -2118,5 +2161,5 @@ const ka = kt(
2118
2161
  }
2119
2162
  });
2120
2163
  export {
2121
- Cn as default
2164
+ $n as default
2122
2165
  };