@feedmepos/mf-report 5.4.36 → 5.5.0-beta.0

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 (30) hide show
  1. package/dist/{App-DcfI_XNW.js → App-Cgynv4z6.js} +42 -42
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-i3aSXdHt.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-Xex8S8XX.js} +2 -2
  3. package/dist/Default.vue_vue_type_script_setup_true_lang-DoZjQrXi.js +41 -0
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-9HLzKjix.js +1004 -0
  5. package/dist/{InsightView-PI6dgol0.js → InsightView-CazscxFM.js} +7 -7
  6. package/dist/{Integration-C1po_0N1.js → Integration-bg1bO0u3.js} +1319 -1319
  7. package/dist/{Integrations-BqqDb5qr.js → Integrations-B6ACZi86.js} +3 -3
  8. package/dist/{Layout-BUWlLMP4.js → Layout-B6nbTiWn.js} +1 -1
  9. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-CF4VlKJk.js → LocationSelect.vue_vue_type_script_setup_true_lang-BRAZAoJz.js} +2 -2
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-CkQjrXwQ.js → MenuTab.vue_vue_type_script_setup_true_lang-BdDMXz7S.js} +4 -4
  11. package/dist/NavigationTab.vue_vue_type_script_setup_true_lang-DfXW3V-Z.js +26466 -0
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-BFnX-1M0.js → NoData.vue_vue_type_script_setup_true_lang-DI4X_DSc.js} +1 -1
  13. package/dist/{OverviewView-CoubbhjM.js → OverviewView-D4f5GD94.js} +5 -5
  14. package/dist/{Report-bQSl3Plq.js → Report-t5C_RytN.js} +4 -4
  15. package/dist/{ReportEditor-DswBRaYe.js → ReportEditor-CyI-OeIq.js} +5 -5
  16. package/dist/{ReportView-BoipuiKU.js → ReportView-DSa6UBCG.js} +72 -61
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-C_5JqpZI.js → SelectComponent.vue_vue_type_script_setup_true_lang-BVs1C4af.js} +1 -1
  18. package/dist/{Setting-D1cxNFnN.js → Setting-C3cEoUqd.js} +4 -4
  19. package/dist/{TileEditor-BmWA9yaI.js → TileEditor-DpD-oLcv.js} +8 -8
  20. package/dist/{TransitionFade-Bl7Fs0Kr.js → TransitionFade-DGn_cYeQ.js} +264 -264
  21. package/dist/app.js +17 -14
  22. package/dist/{global-loader-j3FZYjO_.js → global-loader-BqFQzk46.js} +1021 -1023
  23. package/dist/{index-BsN83BDH.js → index-Cmh079Bh.js} +1 -1
  24. package/dist/{report-schema-Bk6c6uMR.js → report-schema-OJAFh4P6.js} +1 -1
  25. package/dist/{timeFormat-DJ-S2Pv8.js → timeFormat-CAyeO7-a.js} +1 -1
  26. package/dist/{v4-BdEILobK.js → v4-BDHq16P_.js} +427 -404
  27. package/package.json +1 -1
  28. package/dist/Default.vue_vue_type_script_setup_true_lang-BvcF29hM.js +0 -41
  29. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-B6izaIir.js +0 -999
  30. package/dist/NavigationTab.vue_vue_type_script_setup_true_lang-CoAZxwTP.js +0 -26128
@@ -1,11 +1,11 @@
1
- import { defineComponent as q, mergeModels as ye, useModel as X, computed as Y, resolveComponent as S, createElementBlock as C, openBlock as c, createElementVNode as t, createCommentVNode as N, normalizeClass as Ke, Fragment as L, renderList as H, createBlock as M, createVNode as i, withCtx as ge, toDisplayString as T, unref as v, ref as B, watch as ve, isRef as be, h as I, resolveDynamicComponent as xe, mergeProps as Le, onMounted as Ee } from "vue";
1
+ import { defineComponent as q, mergeModels as ye, useModel as X, computed as Y, resolveComponent as S, createElementBlock as F, openBlock as c, createElementVNode as t, createCommentVNode as N, normalizeClass as Ke, Fragment as L, renderList as H, createBlock as M, createVNode as r, withCtx as ge, toDisplayString as T, unref as p, ref as B, watch as ve, isRef as be, h as I, resolveDynamicComponent as xe, mergeProps as Le, onMounted as Ee } from "vue";
2
2
  import { useRouter as de, useRoute as ze } from "vue-router";
3
- import { u as J, I as ce, d as je, e as _e, f as we, b as pe, p as Ye, l as qe, o as he, q as Ve, s as ke, t as $e, v as Ae, w as He, x as Xe, y as Qe, A as fe, z as Pe, B as Ge, E as Je } from "./global-loader-j3FZYjO_.js";
3
+ import { u as J, I as ce, d as je, e as _e, f as we, b as pe, q as Ye, m as qe, p as he, r as Ve, s as ke, t as $e, v as Ae, w as He, x as Xe, y as Qe, A as fe, z as Pe, B as Ge, E as Je } from "./global-loader-BqFQzk46.js";
4
4
  import { u as Se } from "./message-dialog-UoMWOnil.js";
5
5
  import { useSnackbar as ue } from "@feedmepos/ui-library";
6
- import { s as We } from "./index-BsN83BDH.js";
6
+ import { s as We } from "./index-Cmh079Bh.js";
7
7
  import { storeToRefs as Ce } from "pinia";
8
- import { _ as Fe } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-i3aSXdHt.js";
8
+ import { _ as Fe } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-Xex8S8XX.js";
9
9
  const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-between" }, et = { class: "text-nowrap w-[100%] overflow-hidden text-ellipsis" }, tt = {
10
10
  key: 0,
11
11
  class: "w-[24px] flex items-center"
@@ -33,65 +33,65 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
33
33
  modelModifiers: {}
34
34
  }),
35
35
  emits: /* @__PURE__ */ ye(["remove"], ["update:modelValue"]),
36
- setup(g, { emit: o }) {
37
- const e = X(g, "modelValue"), n = g, k = Y(
38
- () => Object.keys(n.options).map((_) => {
39
- const F = n.options[_];
36
+ setup(f, { emit: o }) {
37
+ const e = X(f, "modelValue"), s = f, V = Y(
38
+ () => Object.keys(s.options).map((_) => {
39
+ const C = s.options[_];
40
40
  return {
41
- placeholder: F.placeholder,
41
+ placeholder: C.placeholder,
42
42
  key: _,
43
- editable: F.editable
43
+ editable: C.editable
44
44
  };
45
45
  })
46
- ), w = o;
47
- return (_, F) => {
48
- const h = S("FmTextField"), m = S("FmTooltip"), d = S("FmIcon");
49
- return c(), C("div", Ze, [
46
+ ), h = o;
47
+ return (_, C) => {
48
+ const b = S("FmTextField"), x = S("FmTooltip"), m = S("FmIcon");
49
+ return c(), F("div", Ze, [
50
50
  t("div", {
51
- class: Ke(`${g.removable ? "w-[calc(100%-24px)]" : "w-[100%]"} flex flex-row items-center gap-[4px]`)
51
+ class: Ke(`${f.removable ? "w-[calc(100%-24px)]" : "w-[100%]"} flex flex-row items-center gap-[4px]`)
52
52
  }, [
53
- (c(!0), C(L, null, H(k.value, (V) => {
54
- var b;
55
- return c(), C(L, {
56
- key: V.key
53
+ (c(!0), F(L, null, H(V.value, (w) => {
54
+ var k;
55
+ return c(), F(L, {
56
+ key: w.key
57
57
  }, [
58
- V.editable ? (c(), C("div", {
58
+ w.editable ? (c(), F("div", {
59
59
  key: 0,
60
- class: Ke(`${g.removable ? "w-[50%]" : "w-[100%]"}`)
60
+ class: Ke(`${f.removable ? "w-[50%]" : "w-[100%]"}`)
61
61
  }, [
62
- i(h, {
63
- "model-value": e.value[V.key],
64
- placeholder: V.placeholder,
65
- type: g.type,
66
- rules: g.rules,
67
- "onUpdate:modelValue": (u) => {
68
- let p = u;
69
- g.type === "number" && (p = Number(u)), e.value = {
62
+ r(b, {
63
+ "model-value": e.value[w.key],
64
+ placeholder: w.placeholder,
65
+ type: f.type,
66
+ rules: f.rules,
67
+ "onUpdate:modelValue": (d) => {
68
+ let y = d;
69
+ f.type === "number" && (y = Number(d)), e.value = {
70
70
  ...e.value,
71
- [V.key]: p
71
+ [w.key]: y
72
72
  };
73
73
  }
74
74
  }, null, 8, ["model-value", "placeholder", "type", "rules", "onUpdate:modelValue"])
75
- ], 2)) : (c(), M(m, {
75
+ ], 2)) : (c(), M(x, {
76
76
  key: 1,
77
- content: (b = e.value[V.key]) == null ? void 0 : b.toString(),
77
+ content: (k = e.value[w.key]) == null ? void 0 : k.toString(),
78
78
  class: "w-[50%]"
79
79
  }, {
80
80
  default: ge(() => [
81
- t("div", et, T(e.value[V.key]), 1)
81
+ t("div", et, T(e.value[w.key]), 1)
82
82
  ]),
83
83
  _: 2
84
84
  }, 1032, ["content"]))
85
85
  ], 64);
86
86
  }), 128))
87
87
  ], 2),
88
- g.removable ? (c(), C("div", tt, [
89
- i(d, {
88
+ f.removable ? (c(), F("div", tt, [
89
+ r(m, {
90
90
  color: "system-error-300",
91
91
  class: "cursor-pointer",
92
92
  name: "close",
93
93
  size: "md",
94
- onClick: F[0] || (F[0] = (V) => w("remove"))
94
+ onClick: C[0] || (C[0] = (w) => h("remove"))
95
95
  })
96
96
  ])) : N("", !0)
97
97
  ]);
@@ -119,8 +119,8 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
119
119
  modelModifiers: {}
120
120
  }),
121
121
  emits: ["update:modelValue"],
122
- setup(g) {
123
- const { t: o } = J(), e = X(g, "modelValue"), n = Y(() => {
122
+ setup(f) {
123
+ const { t: o } = J(), e = X(f, "modelValue"), s = Y(() => {
124
124
  switch (e.value.name) {
125
125
  case ce.AutoCount:
126
126
  case ce.SQL:
@@ -130,34 +130,34 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
130
130
  return !1;
131
131
  }
132
132
  });
133
- return (k, w) => {
134
- var m, d;
135
- const _ = S("FmSwitch"), F = S("FmTextField"), h = S("FmTimePicker");
136
- return c(), C(L, null, [
133
+ return (V, h) => {
134
+ var x, m;
135
+ const _ = S("FmSwitch"), C = S("FmTextField"), b = S("FmTimePicker");
136
+ return c(), F(L, null, [
137
137
  t("div", ot, [
138
- t("div", at, T(v(o)("report.integration.auto", { label: g.label })), 1),
139
- g.label == "upload" ? (c(), C("div", lt, T(v(o)("report.integration.lastUploadDate")) + ": " + T(g.lastUploadDate ? v(je)(g.lastUploadDate).format("MMMM D, YYYY h:mm A") : v(o)("report.integration.noData.title")), 1)) : N("", !0)
138
+ t("div", at, T(p(o)("report.integration.auto", { label: f.label })), 1),
139
+ f.label == "upload" ? (c(), F("div", lt, T(p(o)("report.integration.lastUploadDate")) + ": " + T(f.lastUploadDate ? p(je)(f.lastUploadDate).format("MMMM D, YYYY h:mm A") : p(o)("report.integration.noData.title")), 1)) : N("", !0)
140
140
  ]),
141
141
  t("div", nt, [
142
- t("div", st, T(v(o)("report.common.enable")), 1),
143
- i(_, {
142
+ t("div", st, T(p(o)("report.common.enable")), 1),
143
+ r(_, {
144
144
  modelValue: e.value.enable,
145
- "onUpdate:modelValue": w[0] || (w[0] = (V) => e.value.enable = V),
145
+ "onUpdate:modelValue": h[0] || (h[0] = (w) => e.value.enable = w),
146
146
  style: { gap: "0px" }
147
147
  }, null, 8, ["modelValue"])
148
148
  ]),
149
- n.value ? (c(), C("div", it, [
150
- t("div", rt, T(v(o)("report.common.email")), 1),
149
+ s.value ? (c(), F("div", it, [
150
+ t("div", rt, T(p(o)("report.common.email")), 1),
151
151
  t("div", mt, [
152
- i(F, {
152
+ r(C, {
153
153
  "model-value": (e.value.emails || []).join(","),
154
154
  placeholder: "Email",
155
- "onUpdate:modelValue": w[1] || (w[1] = (V) => {
155
+ "onUpdate:modelValue": h[1] || (h[1] = (w) => {
156
156
  switch (e.value.name) {
157
- case v(ce).AutoCount:
158
- case v(ce).SQL:
159
- case v(ce).iFlexi_HRMS:
160
- e.value.emails = V.split(",");
157
+ case p(ce).AutoCount:
158
+ case p(ce).SQL:
159
+ case p(ce).iFlexi_HRMS:
160
+ e.value.emails = w.split(",");
161
161
  break;
162
162
  }
163
163
  })
@@ -166,30 +166,30 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
166
166
  ])) : N("", !0),
167
167
  t("div", ct, [
168
168
  t("div", dt, [
169
- t("div", pt, T(v(We)(g.label)) + " time ", 1),
169
+ t("div", pt, T(p(We)(f.label)) + " time ", 1),
170
170
  t("div", ut, [
171
- i(h, {
171
+ r(b, {
172
172
  class: "gap-[0px]",
173
- "model-value": v(je)().hour(((m = e.value.triggerTime) == null ? void 0 : m.hour) ?? 0).minute(((d = e.value.triggerTime) == null ? void 0 : d.minute) ?? 0).format("HH:mm"),
174
- "onUpdate:modelValue": w[2] || (w[2] = (V) => {
175
- V && (e.value.triggerTime.hour = Number(V.split(":")[0]), e.value.triggerTime.minute = Number(V.split(":")[1]));
173
+ "model-value": p(je)().hour(((x = e.value.triggerTime) == null ? void 0 : x.hour) ?? 0).minute(((m = e.value.triggerTime) == null ? void 0 : m.minute) ?? 0).format("HH:mm"),
174
+ "onUpdate:modelValue": h[2] || (h[2] = (w) => {
175
+ w && (e.value.triggerTime.hour = Number(w.split(":")[0]), e.value.triggerTime.minute = Number(w.split(":")[1]));
176
176
  })
177
177
  }, null, 8, ["model-value"])
178
178
  ])
179
179
  ]),
180
- i(K, {
180
+ r(K, {
181
181
  "model-value": {
182
- label: v(o)("report.integration.delayDay"),
182
+ label: p(o)("report.integration.delayDay"),
183
183
  delayDay: e.value.delayDay
184
184
  },
185
185
  type: "number",
186
186
  options: {
187
- label: { placeholder: v(o)("report.integration.delayDay"), editable: !1 },
188
- delayDay: { placeholder: v(o)("report.integration.delayDay"), editable: !0 }
187
+ label: { placeholder: p(o)("report.integration.delayDay"), editable: !1 },
188
+ delayDay: { placeholder: p(o)("report.integration.delayDay"), editable: !0 }
189
189
  },
190
- rules: [(V) => V > 0 || "Delay days must be greater than 0"],
191
- "onUpdate:modelValue": w[3] || (w[3] = (V) => {
192
- e.value.delayDay = V.delayDay;
190
+ rules: [(w) => w > 0 || "Delay days must be greater than 0"],
191
+ "onUpdate:modelValue": h[3] || (h[3] = (w) => {
192
+ e.value.delayDay = w.delayDay;
193
193
  })
194
194
  }, null, 8, ["model-value", "options", "rules"])
195
195
  ])
@@ -230,70 +230,70 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
230
230
  modelModifiers: {}
231
231
  }),
232
232
  emits: /* @__PURE__ */ ye(["remove"], ["update:modelValue"]),
233
- setup(g, { emit: o }) {
234
- const e = X(g, "modelValue"), n = g, k = Y(
235
- () => Object.keys(n.options).map((m) => {
236
- const d = n.options[m];
233
+ setup(f, { emit: o }) {
234
+ const e = X(f, "modelValue"), s = f, V = Y(
235
+ () => Object.keys(s.options).map((x) => {
236
+ const m = s.options[x];
237
237
  return {
238
- placeholder: d.placeholder,
239
- key: m,
240
- editable: d.editable,
241
- dropdownOptions: d.dropdownOptions
238
+ placeholder: m.placeholder,
239
+ key: x,
240
+ editable: m.editable,
241
+ dropdownOptions: m.dropdownOptions
242
242
  };
243
243
  })
244
- ), w = (m, d) => {
245
- n.singleValueMode ? e.value = n.type === "number" ? Number(m) : m : d && (e.value = {
244
+ ), h = (x, m) => {
245
+ s.singleValueMode ? e.value = s.type === "number" ? Number(x) : x : m && (e.value = {
246
246
  ...e.value,
247
- [d]: n.type === "number" ? Number(m) : m
247
+ [m]: s.type === "number" ? Number(x) : x
248
248
  });
249
- }, _ = (m) => {
250
- var d;
251
- return n.singleValueMode ? n.options.key.placeholder : (d = e.value[m.key]) == null ? void 0 : d.toString();
252
- }, F = (m) => n.singleValueMode ? e.value : e.value[m.key], h = o;
253
- return (m, d) => {
254
- const V = S("FmSelect"), b = S("FmTextField"), u = S("FmTooltip"), p = S("FmIcon");
255
- return c(), C("div", ft, [
249
+ }, _ = (x) => {
250
+ var m;
251
+ return s.singleValueMode ? s.options.key.placeholder : (m = e.value[x.key]) == null ? void 0 : m.toString();
252
+ }, C = (x) => s.singleValueMode ? e.value : e.value[x.key], b = o;
253
+ return (x, m) => {
254
+ const w = S("FmSelect"), k = S("FmTextField"), d = S("FmTooltip"), y = S("FmIcon");
255
+ return c(), F("div", ft, [
256
256
  t("div", {
257
- class: Ke(`${g.removable ? "w-[calc(100%-24px)]" : "w-[100%]"} flex flex-row items-center gap-[4px]`)
257
+ class: Ke(`${f.removable ? "w-[calc(100%-24px)]" : "w-[100%]"} flex flex-row items-center gap-[4px]`)
258
258
  }, [
259
- (c(!0), C(L, null, H(k.value, (r) => (c(), C(L, {
260
- key: r.key
259
+ (c(!0), F(L, null, H(V.value, (n) => (c(), F(L, {
260
+ key: n.key
261
261
  }, [
262
- r.editable ? (c(), C("div", vt, [
263
- r.dropdownOptions ? (c(), M(V, {
262
+ n.editable ? (c(), F("div", vt, [
263
+ n.dropdownOptions ? (c(), M(w, {
264
264
  key: 0,
265
- "model-value": F(r),
266
- placeholder: r.placeholder,
267
- items: r.dropdownOptions,
265
+ "model-value": C(n),
266
+ placeholder: n.placeholder,
267
+ items: n.dropdownOptions,
268
268
  "shift-menu": !0,
269
- "onUpdate:modelValue": (x) => w(x, r.key)
270
- }, null, 8, ["model-value", "placeholder", "items", "onUpdate:modelValue"])) : (c(), M(b, {
269
+ "onUpdate:modelValue": (v) => h(v, n.key)
270
+ }, null, 8, ["model-value", "placeholder", "items", "onUpdate:modelValue"])) : (c(), M(k, {
271
271
  key: 1,
272
- "model-value": F(r),
273
- placeholder: r.placeholder,
274
- type: g.type,
275
- rules: g.rules,
276
- "onUpdate:modelValue": (x) => w(x, r.key)
272
+ "model-value": C(n),
273
+ placeholder: n.placeholder,
274
+ type: f.type,
275
+ rules: f.rules,
276
+ "onUpdate:modelValue": (v) => h(v, n.key)
277
277
  }, null, 8, ["model-value", "placeholder", "type", "rules", "onUpdate:modelValue"]))
278
- ])) : (c(), M(u, {
278
+ ])) : (c(), M(d, {
279
279
  key: 1,
280
- content: _(r),
280
+ content: _(n),
281
281
  class: "w-[50%]"
282
282
  }, {
283
283
  default: ge(() => [
284
- t("div", gt, T(_(r)), 1)
284
+ t("div", gt, T(_(n)), 1)
285
285
  ]),
286
286
  _: 2
287
287
  }, 1032, ["content"]))
288
288
  ], 64))), 128))
289
289
  ], 2),
290
- g.removable ? (c(), C("div", yt, [
291
- i(p, {
290
+ f.removable ? (c(), F("div", yt, [
291
+ r(y, {
292
292
  color: "system-error-300",
293
293
  class: "cursor-pointer",
294
294
  name: "close",
295
295
  size: "md",
296
- onClick: d[0] || (d[0] = (r) => h("remove"))
296
+ onClick: m[0] || (m[0] = (n) => b("remove"))
297
297
  })
298
298
  ])) : N("", !0)
299
299
  ]);
@@ -340,85 +340,85 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
340
340
  modelModifiers: {}
341
341
  }),
342
342
  emits: ["update:modelValue"],
343
- setup(g) {
344
- const { t: o } = J(), e = X(g, "modelValue"), n = ue(), k = _e(), w = de(), { promptLoader: _ } = we(), { promptMessage: F } = Se(), { restaurants: h } = pe(), m = B(!1), d = Y(
345
- () => h.map((f) => ({ label: f.name, value: f.id }))
346
- ), V = Y(() => {
347
- var f, s;
348
- return m.value ? "Connecting" : (s = (f = e.value) == null ? void 0 : f.platform) != null && s.accessToken ? "Disconnect" : "Connect";
349
- }), b = B(0);
350
- async function u() {
351
- var f;
352
- if (m.value)
353
- n.open({ type: "error", message: "Connecting in progress" });
354
- else if ((f = e.value.platform) != null && f.accessToken)
355
- await F({
343
+ setup(f) {
344
+ const { t: o } = J(), e = X(f, "modelValue"), s = ue(), V = _e(), h = de(), { promptLoader: _ } = we(), { promptMessage: C } = Se(), { restaurants: b } = pe(), x = B(!1), m = Y(
345
+ () => b.map((u) => ({ label: u.name, value: u.id }))
346
+ ), w = Y(() => {
347
+ var u, i;
348
+ return x.value ? "Connecting" : (i = (u = e.value) == null ? void 0 : u.platform) != null && i.accessToken ? "Disconnect" : "Connect";
349
+ }), k = B(0);
350
+ async function d() {
351
+ var u;
352
+ if (x.value)
353
+ s.open({ type: "error", message: "Connecting in progress" });
354
+ else if ((u = e.value.platform) != null && u.accessToken)
355
+ await C({
356
356
  message: o("report.integration.xero.confirmDisconnect", { name: e.value.name }),
357
357
  title: o("report.integration.xero.disconnectTitle")
358
- }) && (await Ye(e.value._id), await k.getSettings());
358
+ }) && (await Ye(e.value._id), await V.getSettings());
359
359
  else if (e.value._id)
360
360
  try {
361
- const s = await qe(e.value._id);
362
- m.value = !0;
361
+ const i = await qe(e.value._id);
362
+ x.value = !0;
363
363
  const A = setInterval(async () => {
364
364
  var P;
365
- b.value += 1;
365
+ k.value += 1;
366
366
  try {
367
- await k.getSettings();
367
+ await V.getSettings();
368
368
  } finally {
369
- (b.value === 12 || (P = e.value.platform) != null && P.accessToken) && (m.value = !1, A && clearInterval(A), b.value = 0);
369
+ (k.value === 12 || (P = e.value.platform) != null && P.accessToken) && (x.value = !1, A && clearInterval(A), k.value = 0);
370
370
  }
371
371
  }, 5e3);
372
- window.open(s.redirect, "_blank");
373
- } catch (s) {
374
- n.open({ type: "error", message: s.message });
372
+ window.open(i.redirect, "_blank");
373
+ } catch (i) {
374
+ s.open({ type: "error", message: i.message });
375
375
  }
376
376
  else
377
- n.open({ type: "error", message: `invalid accounting ${e.value._id}` });
377
+ s.open({ type: "error", message: `invalid accounting ${e.value._id}` });
378
378
  }
379
- async function p() {
380
- await F({
379
+ async function y() {
380
+ await C({
381
381
  message: `Confirm delete ${e.value.name}?`,
382
382
  title: "Delete"
383
383
  }) && await _(async () => {
384
384
  try {
385
- await he(e.value._id), await k.getSettings(), w.back();
386
- } catch (s) {
387
- n.open({ type: "error", message: s.message });
385
+ await he(e.value._id), await V.getSettings(), h.back();
386
+ } catch (i) {
387
+ s.open({ type: "error", message: i.message });
388
388
  }
389
389
  });
390
390
  }
391
- async function r() {
391
+ async function n() {
392
392
  await _(async () => {
393
393
  try {
394
- await Ve(e.value._id, e.value), await k.getSettings();
395
- } catch (f) {
396
- n.open({ type: "error", message: f.message });
394
+ await Ve(e.value._id, e.value), await V.getSettings();
395
+ } catch (u) {
396
+ s.open({ type: "error", message: u.message });
397
397
  }
398
398
  });
399
399
  }
400
- function x(f) {
401
- const s = g.tenantOptions.data.find((A) => A.value === f);
402
- s && e.value.platform && (e.value.platform.tenant = {
403
- id: s.value,
404
- name: s.label
400
+ function v(u) {
401
+ const i = f.tenantOptions.data.find((A) => A.value === u);
402
+ i && e.value.platform && (e.value.platform.tenant = {
403
+ id: i.value,
404
+ name: i.label
405
405
  });
406
406
  }
407
- function $(f, s) {
407
+ function $(u, i) {
408
408
  var A, P;
409
- (P = (A = e.value.platform) == null ? void 0 : A.mappings) != null && P[f] && (e.value.platform.mappings[f] = e.value.platform.mappings[f].filter(
410
- (Q, E) => E !== s
409
+ (P = (A = e.value.platform) == null ? void 0 : A.mappings) != null && P[u] && (e.value.platform.mappings[u] = e.value.platform.mappings[u].filter(
410
+ (Q, E) => E !== i
411
411
  ));
412
412
  }
413
- function l(f) {
414
- var s, A;
415
- (A = (s = e.value.platform) == null ? void 0 : s.mappings) != null && A[f] && (e.value.platform.mappings[f] = [
416
- ...e.value.platform.mappings[f],
417
- f === "items" ? {
413
+ function l(u) {
414
+ var i, A;
415
+ (A = (i = e.value.platform) == null ? void 0 : i.mappings) != null && A[u] && (e.value.platform.mappings[u] = [
416
+ ...e.value.platform.mappings[u],
417
+ u === "items" ? {
418
418
  feedmeKey: "",
419
419
  xeroAccount: "",
420
420
  name: ""
421
- } : f === "taxes" ? {
421
+ } : u === "taxes" ? {
422
422
  feedmeKey: "",
423
423
  xeroAccount: ""
424
424
  } : {
@@ -430,145 +430,145 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
430
430
  async function a() {
431
431
  await _(async () => {
432
432
  try {
433
- await ke(e.value._id), await k.getSettings();
434
- } catch (f) {
435
- n.open({ type: "error", message: f.message });
433
+ await ke(e.value._id), await V.getSettings();
434
+ } catch (u) {
435
+ s.open({ type: "error", message: u.message });
436
436
  }
437
437
  });
438
438
  }
439
- return (f, s) => {
440
- var z, W, Z, ee, te, oe, ae, le, ne, se, D, y, U, O, me, Ue, Te, Ne, Re, Oe, Be;
439
+ return (u, i) => {
440
+ var z, W, Z, ee, te, oe, ae, le, ne, se, D, g, U, O, me, Ue, Te, Ne, Re, Oe, Be;
441
441
  const A = S("FmIcon"), P = S("FmButton"), Q = S("FmMenuDivider"), E = S("FmCircularProgress"), G = S("FmSelect"), R = S("FmTextField"), j = S("FmSwitch");
442
- return (W = (z = e.value) == null ? void 0 : z.platform) != null && W.mappings ? (c(), C("div", xt, [
442
+ return (W = (z = e.value) == null ? void 0 : z.platform) != null && W.mappings ? (c(), F("div", xt, [
443
443
  t("div", _t, [
444
444
  t("div", bt, [
445
- s[10] || (s[10] = t("div", { class: "fm-typo-en-title-sm-800" }, "Connect", -1)),
445
+ i[10] || (i[10] = t("div", { class: "fm-typo-en-title-sm-800" }, "Connect", -1)),
446
446
  t("div", wt, [
447
447
  t("div", ht, [
448
- i(A, {
448
+ r(A, {
449
449
  name: "refresh",
450
450
  class: "p-2 bg-gray-100 rounded-full",
451
451
  onClick: a
452
452
  }),
453
- s[9] || (s[9] = t("span", { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, " Repopulate the fields based on the dates selected in Preview. ", -1))
453
+ i[9] || (i[9] = t("span", { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, " Repopulate the fields based on the dates selected in Preview. ", -1))
454
454
  ]),
455
- i(P, {
455
+ r(P, {
456
456
  variant: "tertiary",
457
457
  label: "Delete",
458
- onClick: p
458
+ onClick: y
459
459
  }),
460
- i(P, {
460
+ r(P, {
461
461
  variant: "primary",
462
462
  label: "Update",
463
- onClick: r
463
+ onClick: n
464
464
  })
465
465
  ])
466
466
  ])
467
467
  ]),
468
- i(Q, { style: { margin: 0 } }),
468
+ r(Q, { style: { margin: 0 } }),
469
469
  t("div", Vt, [
470
- s[21] || (s[21] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Authenticate with your official Xero account to enable FeedMe to securely upload data to Xero. ", -1)),
470
+ i[21] || (i[21] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Authenticate with your official Xero account to enable FeedMe to securely upload data to Xero. ", -1)),
471
471
  t("div", kt, [
472
472
  t("div", $t, [
473
- i(P, {
474
- disabled: m.value,
473
+ r(P, {
474
+ disabled: x.value,
475
475
  variant: "primary",
476
- label: V.value,
477
- onClick: u
476
+ label: w.value,
477
+ onClick: d
478
478
  }, null, 8, ["disabled", "label"])
479
479
  ]),
480
- !g.tenantOptions.isLoaded && ((Z = e.value.platform) != null && Z.accessToken) ? (c(), M(E, {
480
+ !f.tenantOptions.isLoaded && ((Z = e.value.platform) != null && Z.accessToken) ? (c(), M(E, {
481
481
  key: 0,
482
482
  size: "xl"
483
483
  })) : N("", !0),
484
- i(G, {
484
+ r(G, {
485
485
  class: "flex-grow",
486
- items: g.tenantOptions.data || [],
486
+ items: f.tenantOptions.data || [],
487
487
  "model-value": (ee = e.value.platform.tenant) == null ? void 0 : ee.id,
488
- placeholder: g.tenantOptions.data ? "Select tenant " : (te = e.value.platform.tenant) == null ? void 0 : te.name,
489
- "onUpdate:modelValue": x
488
+ placeholder: f.tenantOptions.data ? "Select tenant " : (te = e.value.platform.tenant) == null ? void 0 : te.name,
489
+ "onUpdate:modelValue": v
490
490
  }, null, 8, ["items", "model-value", "placeholder"])
491
491
  ]),
492
492
  t("div", St, [
493
- s[13] || (s[13] = t("div", { class: "flex flex-row items-center fm-typo-en-title-sm-800 h-[36px]" }, "General", -1)),
493
+ i[13] || (i[13] = t("div", { class: "flex flex-row items-center fm-typo-en-title-sm-800 h-[36px]" }, "General", -1)),
494
494
  t("div", Ct, [
495
- s[11] || (s[11] = t("div", { class: "w-[25%]" }, "Name", -1)),
495
+ i[11] || (i[11] = t("div", { class: "w-[25%]" }, "Name", -1)),
496
496
  t("div", Ft, [
497
- i(R, {
497
+ r(R, {
498
498
  modelValue: e.value.name,
499
- "onUpdate:modelValue": s[0] || (s[0] = (ie) => e.value.name = ie)
499
+ "onUpdate:modelValue": i[0] || (i[0] = (ie) => e.value.name = ie)
500
500
  }, null, 8, ["modelValue"])
501
501
  ])
502
502
  ]),
503
503
  t("div", Dt, [
504
- s[12] || (s[12] = t("div", { class: "w-[25%]" }, "Location", -1)),
505
- i(G, {
504
+ i[12] || (i[12] = t("div", { class: "w-[25%]" }, "Location", -1)),
505
+ r(G, {
506
506
  modelValue: e.value.platform.locationIds,
507
- "onUpdate:modelValue": s[1] || (s[1] = (ie) => e.value.platform.locationIds = ie),
507
+ "onUpdate:modelValue": i[1] || (i[1] = (ie) => e.value.platform.locationIds = ie),
508
508
  multiselect: !0,
509
- items: d.value,
509
+ items: m.value,
510
510
  placeholder: "Select location",
511
511
  class: "flex-grow"
512
512
  }, null, 8, ["modelValue", "items"])
513
513
  ])
514
514
  ]),
515
- i(De, {
515
+ r(De, {
516
516
  modelValue: e.value.platform,
517
- "onUpdate:modelValue": s[2] || (s[2] = (ie) => e.value.platform = ie),
517
+ "onUpdate:modelValue": i[2] || (i[2] = (ie) => e.value.platform = ie),
518
518
  label: "upload",
519
519
  "last-upload-date": (oe = e.value.platform) == null ? void 0 : oe.lastUploadDate
520
520
  }, null, 8, ["modelValue", "last-upload-date"]),
521
521
  t("div", Ut, [
522
- s[20] || (s[20] = t("div", { class: "flex flex-row items-center fm-typo-en-title-sm-800 h-[36px]" }, "Mapping", -1)),
522
+ i[20] || (i[20] = t("div", { class: "flex flex-row items-center fm-typo-en-title-sm-800 h-[36px]" }, "Mapping", -1)),
523
523
  t("div", Tt, [
524
- s[14] || (s[14] = t("div", { class: "w-[25%]" }, "Contact", -1)),
524
+ i[14] || (i[14] = t("div", { class: "w-[25%]" }, "Contact", -1)),
525
525
  t("div", It, [
526
- i(R, {
526
+ r(R, {
527
527
  modelValue: e.value.platform.mappings.contact.xeroAccount,
528
- "onUpdate:modelValue": s[3] || (s[3] = (ie) => e.value.platform.mappings.contact.xeroAccount = ie),
528
+ "onUpdate:modelValue": i[3] || (i[3] = (ie) => e.value.platform.mappings.contact.xeroAccount = ie),
529
529
  placeholder: "Contact account number"
530
530
  }, null, 8, ["modelValue"])
531
531
  ])
532
532
  ]),
533
533
  t("div", Mt, [
534
- s[15] || (s[15] = t("div", { class: "w-[25%]" }, "Discount as Item", -1)),
534
+ i[15] || (i[15] = t("div", { class: "w-[25%]" }, "Discount as Item", -1)),
535
535
  t("div", Kt, [
536
- i(j, {
536
+ r(j, {
537
537
  "model-value": e.value.platform.discountItem ?? !1,
538
538
  style: { gap: 0 },
539
- "onUpdate:modelValue": s[4] || (s[4] = (ie) => {
539
+ "onUpdate:modelValue": i[4] || (i[4] = (ie) => {
540
540
  e.value.platform.discountItem = ie;
541
541
  })
542
542
  }, null, 8, ["model-value"])
543
543
  ])
544
544
  ]),
545
545
  t("div", At, [
546
- s[16] || (s[16] = t("div", { class: "w-[25%]" }, "Combine Refund", -1)),
546
+ i[16] || (i[16] = t("div", { class: "w-[25%]" }, "Combine Refund", -1)),
547
547
  t("div", Pt, [
548
- i(j, {
548
+ r(j, {
549
549
  "model-value": e.value.platform.mappings.isCombineRefund ?? !1,
550
550
  style: { gap: 0 },
551
- "onUpdate:modelValue": s[5] || (s[5] = (ie) => {
551
+ "onUpdate:modelValue": i[5] || (i[5] = (ie) => {
552
552
  e.value.platform.mappings.isCombineRefund = ie;
553
553
  })
554
554
  }, null, 8, ["model-value"])
555
555
  ])
556
556
  ]),
557
557
  t("div", Nt, [
558
- s[17] || (s[17] = t("div", { class: "fm-typo-en-title-sm-800" }, "Taxes", -1)),
559
- i(P, {
558
+ i[17] || (i[17] = t("div", { class: "fm-typo-en-title-sm-800" }, "Taxes", -1)),
559
+ r(P, {
560
560
  variant: "primary",
561
561
  icon: "add",
562
- onClick: s[6] || (s[6] = () => l("taxes"))
562
+ onClick: i[6] || (i[6] = () => l("taxes"))
563
563
  })
564
564
  ]),
565
- g.taxOptions.isError || e.value.platform.accessToken == null ? (c(), C("div", Rt, " Error connecting xero. Please connect to your Xero account to view the setting options. ")) : N("", !0),
566
- !g.taxOptions.isLoaded && ((ae = e.value.platform) != null && ae.accessToken) ? (c(), M(E, {
565
+ f.taxOptions.isError || e.value.platform.accessToken == null ? (c(), F("div", Rt, " Error connecting xero. Please connect to your Xero account to view the setting options. ")) : N("", !0),
566
+ !f.taxOptions.isLoaded && ((ae = e.value.platform) != null && ae.accessToken) ? (c(), M(E, {
567
567
  key: 1,
568
568
  size: "xl"
569
569
  })) : N("", !0),
570
- ((le = g.taxOptions.data) == null ? void 0 : le.length) > 0 ? (c(), C("div", Ot, [
571
- (c(!0), C(L, null, H((D = (se = (ne = e.value) == null ? void 0 : ne.platform) == null ? void 0 : se.mappings) == null ? void 0 : D.taxes, (ie, re) => (c(), M(Me, {
570
+ ((le = f.taxOptions.data) == null ? void 0 : le.length) > 0 ? (c(), F("div", Ot, [
571
+ (c(!0), F(L, null, H((D = (se = (ne = e.value) == null ? void 0 : ne.platform) == null ? void 0 : se.mappings) == null ? void 0 : D.taxes, (ie, re) => (c(), M(Me, {
572
572
  key: `tax-${re}`,
573
573
  modelValue: e.value.platform.mappings.taxes[re],
574
574
  "onUpdate:modelValue": (Ie) => e.value.platform.mappings.taxes[re] = Ie,
@@ -577,7 +577,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
577
577
  xeroAccount: {
578
578
  placeholder: "Select Tax",
579
579
  editable: !0,
580
- dropdownOptions: g.taxOptions.data ?? []
580
+ dropdownOptions: f.taxOptions.data ?? []
581
581
  }
582
582
  },
583
583
  removable: !0,
@@ -585,20 +585,20 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
585
585
  }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "onRemove"]))), 128))
586
586
  ])) : N("", !0),
587
587
  t("div", Bt, [
588
- s[18] || (s[18] = t("div", { class: "fm-typo-en-title-sm-800" }, "Items", -1)),
589
- i(P, {
588
+ i[18] || (i[18] = t("div", { class: "fm-typo-en-title-sm-800" }, "Items", -1)),
589
+ r(P, {
590
590
  variant: "primary",
591
591
  icon: "add",
592
- onClick: s[7] || (s[7] = () => l("items"))
592
+ onClick: i[7] || (i[7] = () => l("items"))
593
593
  })
594
594
  ]),
595
- g.accountCodeOptions.isError || e.value.platform.accessToken == null ? (c(), C("div", jt, " Error connecting xero. Please connect to your Xero account to view the setting options. ")) : N("", !0),
596
- !g.accountCodeOptions.isLoaded && ((y = e.value.platform) != null && y.accessToken) ? (c(), M(E, {
595
+ f.accountCodeOptions.isError || e.value.platform.accessToken == null ? (c(), F("div", jt, " Error connecting xero. Please connect to your Xero account to view the setting options. ")) : N("", !0),
596
+ !f.accountCodeOptions.isLoaded && ((g = e.value.platform) != null && g.accessToken) ? (c(), M(E, {
597
597
  key: 4,
598
598
  size: "xl"
599
599
  })) : N("", !0),
600
- ((U = g.accountCodeOptions.data) == null ? void 0 : U.length) > 0 ? (c(), C("div", Lt, [
601
- (c(!0), C(L, null, H((Ue = (me = (O = e.value) == null ? void 0 : O.platform) == null ? void 0 : me.mappings) == null ? void 0 : Ue.items, (ie, re) => (c(), M(Me, {
600
+ ((U = f.accountCodeOptions.data) == null ? void 0 : U.length) > 0 ? (c(), F("div", Lt, [
601
+ (c(!0), F(L, null, H((Ue = (me = (O = e.value) == null ? void 0 : O.platform) == null ? void 0 : me.mappings) == null ? void 0 : Ue.items, (ie, re) => (c(), M(Me, {
602
602
  key: `item-${re}`,
603
603
  modelValue: e.value.platform.mappings.items[re],
604
604
  "onUpdate:modelValue": (Ie) => e.value.platform.mappings.items[re] = Ie,
@@ -607,7 +607,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
607
607
  xeroAccount: {
608
608
  placeholder: "Select Item Code",
609
609
  editable: !0,
610
- dropdownOptions: g.accountCodeOptions.data ?? []
610
+ dropdownOptions: f.accountCodeOptions.data ?? []
611
611
  }
612
612
  },
613
613
  removable: !0,
@@ -615,20 +615,20 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
615
615
  }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "onRemove"]))), 128))
616
616
  ])) : N("", !0),
617
617
  t("div", Et, [
618
- s[19] || (s[19] = t("div", { class: "fm-typo-en-title-sm-800" }, "Payments", -1)),
619
- i(P, {
618
+ i[19] || (i[19] = t("div", { class: "fm-typo-en-title-sm-800" }, "Payments", -1)),
619
+ r(P, {
620
620
  variant: "primary",
621
621
  icon: "add",
622
- onClick: s[8] || (s[8] = () => l("payments"))
622
+ onClick: i[8] || (i[8] = () => l("payments"))
623
623
  })
624
624
  ]),
625
- g.accountCodeOptions.isError || e.value.platform.accessToken == null ? (c(), C("div", zt, " Error connecting xero. Please connect to your Xero account to view the setting options. ")) : N("", !0),
626
- !g.accountCodeOptions.isLoaded && ((Te = e.value.platform) != null && Te.accessToken) ? (c(), M(E, {
625
+ f.accountCodeOptions.isError || e.value.platform.accessToken == null ? (c(), F("div", zt, " Error connecting xero. Please connect to your Xero account to view the setting options. ")) : N("", !0),
626
+ !f.accountCodeOptions.isLoaded && ((Te = e.value.platform) != null && Te.accessToken) ? (c(), M(E, {
627
627
  key: 7,
628
628
  size: "xl"
629
629
  })) : N("", !0),
630
- ((Ne = g.accountCodeOptions.data) == null ? void 0 : Ne.length) > 0 ? (c(), C("div", Yt, [
631
- (c(!0), C(L, null, H((Be = (Oe = (Re = e.value) == null ? void 0 : Re.platform) == null ? void 0 : Oe.mappings) == null ? void 0 : Be.payments, (ie, re) => (c(), M(Me, {
630
+ ((Ne = f.accountCodeOptions.data) == null ? void 0 : Ne.length) > 0 ? (c(), F("div", Yt, [
631
+ (c(!0), F(L, null, H((Be = (Oe = (Re = e.value) == null ? void 0 : Re.platform) == null ? void 0 : Oe.mappings) == null ? void 0 : Be.payments, (ie, re) => (c(), M(Me, {
632
632
  key: `payment-${re}`,
633
633
  modelValue: e.value.platform.mappings.payments[re],
634
634
  "onUpdate:modelValue": (Ie) => e.value.platform.mappings.payments[re] = Ie,
@@ -637,7 +637,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
637
637
  xeroAccount: {
638
638
  placeholder: "Select Payment Code",
639
639
  editable: !0,
640
- dropdownOptions: g.accountCodeOptions.data ?? []
640
+ dropdownOptions: f.accountCodeOptions.data ?? []
641
641
  }
642
642
  },
643
643
  removable: !0,
@@ -652,46 +652,46 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
652
652
  }), Ht = { class: "h-full flex flex-col gap-16" }, Xt = { class: "flex flex-row gap-2 justify-between items-center" }, Qt = {
653
653
  key: 0,
654
654
  class: "flex gap-24 w-full h-full justify-center items-center overflow-scroll"
655
- }, Gt = /* @__PURE__ */ q({
655
+ }, Gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jt = /* @__PURE__ */ q({
656
656
  __name: "Preview",
657
657
  props: {
658
658
  modelValue: { required: !0 },
659
659
  modelModifiers: {}
660
660
  },
661
661
  emits: ["update:modelValue"],
662
- setup(g) {
663
- const o = B([]), e = Y(
664
- () => o.value.reduce((m, d) => {
665
- const V = m.length, { invoice: b, payments: u } = d;
666
- m[V] = {
667
- date: b.Date,
668
- contact: b.Contact.ContactID,
669
- status: b.Status,
670
- ref: b.Reference
662
+ setup(f) {
663
+ const o = B([]), { t: e } = J(), s = Y(
664
+ () => o.value.reduce((m, w) => {
665
+ const k = m.length, { invoice: d, payments: y } = w;
666
+ m[k] = {
667
+ date: d.Date,
668
+ contact: d.Contact.ContactID,
669
+ status: d.Status,
670
+ ref: d.Reference
671
671
  };
672
- for (let p = 0; p < Math.max(b.LineItems.length, u.length); p++) {
673
- const r = V + p;
674
- m[r] || (m[r] = {}), b.LineItems[p] && (m[r] = {
675
- ...m[r],
676
- itemDescription: b.LineItems[p].Description,
677
- itemQuantity: b.LineItems[p].Quantity,
678
- itemUnitAmount: b.LineItems[p].UnitAmount,
672
+ for (let n = 0; n < Math.max(d.LineItems.length, y.length); n++) {
673
+ const v = k + n;
674
+ m[v] || (m[v] = {}), d.LineItems[n] && (m[v] = {
675
+ ...m[v],
676
+ itemDescription: d.LineItems[n].Description,
677
+ itemQuantity: d.LineItems[n].Quantity,
678
+ itemUnitAmount: d.LineItems[n].UnitAmount,
679
679
  // itemCode: invoice.LineItems[i].ItemCode,
680
- itemAccount: b.LineItems[p].AccountCode,
681
- itemTax: b.LineItems[p].TaxAmount,
682
- itemTaxType: b.LineItems[p].TaxType,
683
- itemAmount: b.LineItems[p].LineAmount,
684
- itemDiscount: b.LineItems[p].DiscountAmount
685
- }), u[p] && (m[r] = {
686
- ...m[r],
687
- paymentAccount: u[p].Account.Code,
688
- paymentReference: u[p].Reference,
689
- paymentAmount: u[p].Amount
680
+ itemAccount: d.LineItems[n].AccountCode,
681
+ itemTax: d.LineItems[n].TaxAmount,
682
+ itemTaxType: d.LineItems[n].TaxType,
683
+ itemAmount: d.LineItems[n].LineAmount,
684
+ itemDiscount: d.LineItems[n].DiscountAmount
685
+ }), y[n] && (m[v] = {
686
+ ...m[v],
687
+ paymentAccount: y[n].Account.Code,
688
+ paymentReference: y[n].Reference,
689
+ paymentAmount: y[n].Amount
690
690
  });
691
691
  }
692
692
  return m;
693
693
  }, [])
694
- ), n = [
694
+ ), V = [
695
695
  {
696
696
  accessorKey: "date",
697
697
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Date"),
@@ -767,69 +767,69 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
767
767
  header: "Payment Amount",
768
768
  enableSorting: !1
769
769
  }
770
- ], k = X(g, "modelValue"), w = B(!1), _ = ue(), { dateRange: F } = Ce(pe());
770
+ ], h = X(f, "modelValue"), _ = B(!1), C = ue(), { dateRange: b } = Ce(pe());
771
771
  ve(
772
- () => F.value,
772
+ () => b.value,
773
773
  async () => {
774
- if (k.value._id)
774
+ if (h.value._id)
775
775
  try {
776
- w.value = !0, o.value = await $e(k.value._id);
776
+ _.value = !0, o.value = await $e(h.value._id);
777
777
  } catch (m) {
778
- _.open({ message: m.message, type: "error" });
778
+ C.open({ message: m.message, type: "error" });
779
779
  } finally {
780
- w.value = !1;
780
+ _.value = !1;
781
781
  }
782
782
  },
783
783
  {
784
784
  immediate: !0
785
785
  }
786
786
  );
787
- async function h() {
787
+ async function x() {
788
788
  try {
789
- k.value._id ? (w.value = !0, await Ae(k.value._id), _.open({ message: "Upload successful", type: "success" })) : _.open({ message: "Invalid accounting setting", type: "error" });
789
+ h.value._id ? (_.value = !0, await Ae(h.value._id), C.open({ message: "Upload successful", type: "success" })) : C.open({ message: "Invalid accounting setting", type: "error" });
790
790
  } catch (m) {
791
- m.message && _.open({ message: m.message, type: "error" }), m.errors && m.errors.forEach((d) => _.open({ message: d.Message, type: "error" }));
791
+ m.message && C.open({ message: m.message, type: "error" }), m.errors && m.errors.forEach((w) => C.open({ message: w.Message, type: "error" }));
792
792
  } finally {
793
- w.value = !1;
793
+ _.value = !1;
794
794
  }
795
795
  }
796
- return (m, d) => {
797
- const V = S("FmButton"), b = S("FmCircularProgress"), u = S("FmTable");
798
- return c(), C("div", Ht, [
796
+ return (m, w) => {
797
+ const k = S("FmButton"), d = S("FmCircularProgress"), y = S("FmTable");
798
+ return c(), F("div", Ht, [
799
799
  t("div", Xt, [
800
- i(Fe, {
801
- "date-range": v(F),
802
- "onUpdate:dateRange": d[0] || (d[0] = (p) => be(F) ? F.value = p : null),
800
+ r(Fe, {
801
+ "date-range": p(b),
802
+ "onUpdate:dateRange": w[0] || (w[0] = (n) => be(b) ? b.value = n : null),
803
803
  compare: !1
804
804
  }, null, 8, ["date-range"]),
805
- i(V, {
806
- loading: w.value,
805
+ r(k, {
806
+ loading: _.value,
807
807
  variant: "primary",
808
808
  label: "Upload",
809
- onClick: h
809
+ onClick: x
810
810
  }, null, 8, ["loading"])
811
811
  ]),
812
- w.value ? (c(), C("div", Qt, [
813
- i(b, { size: "xl" }),
814
- d[1] || (d[1] = t("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Loading data... ", -1))
815
- ])) : e.value.length > 0 ? (c(), M(u, {
812
+ _.value ? (c(), F("div", Qt, [
813
+ r(d, { size: "xl" }),
814
+ t("span", Gt, T(p(e)("report.common.isLoading")), 1)
815
+ ])) : s.value.length > 0 ? (c(), M(y, {
816
816
  key: 1,
817
817
  class: "flex overflow-scroll",
818
- "row-data": e.value,
819
- "column-defs": n
818
+ "row-data": s.value,
819
+ "column-defs": V
820
820
  }, null, 8, ["row-data"])) : N("", !0)
821
821
  ]);
822
822
  };
823
823
  }
824
- }), Jt = { class: "h-full relative flex flex-col" }, Wt = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, Zt = /* @__PURE__ */ q({
824
+ }), Wt = { class: "h-full relative flex flex-col" }, Zt = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, eo = /* @__PURE__ */ q({
825
825
  __name: "Xero",
826
826
  props: {
827
827
  modelValue: { required: !0 },
828
828
  modelModifiers: {}
829
829
  },
830
830
  emits: ["update:modelValue"],
831
- setup(g) {
832
- const { t: o } = J(), e = X(g, "modelValue"), n = B("setting"), k = B({}), w = B({}), _ = B({}), F = [
831
+ setup(f) {
832
+ const { t: o } = J(), e = X(f, "modelValue"), s = B("setting"), V = B({}), h = B({}), _ = B({}), C = [
833
833
  {
834
834
  label: o("report.integration.setting"),
835
835
  value: "setting",
@@ -840,16 +840,16 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
840
840
  value: "preview",
841
841
  icon: "table"
842
842
  }
843
- ], h = de(), m = Y(() => {
844
- switch (n.value) {
843
+ ], b = de(), x = Y(() => {
844
+ switch (s.value) {
845
845
  case "preview":
846
- return { component: Gt };
846
+ return { component: Jt };
847
847
  case "setting":
848
848
  return {
849
849
  component: qt,
850
850
  props: {
851
- tenantOptions: k.value,
852
- taxOptions: w.value,
851
+ tenantOptions: V.value,
852
+ taxOptions: h.value,
853
853
  accountCodeOptions: _.value
854
854
  }
855
855
  };
@@ -857,141 +857,141 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
857
857
  return null;
858
858
  }
859
859
  });
860
- async function d() {
860
+ async function m() {
861
861
  if (e.value._id)
862
862
  try {
863
- const u = await He(e.value._id);
864
- k.value.data = u.map((p) => ({
865
- value: p.id,
866
- label: p.name
863
+ const d = await He(e.value._id);
864
+ V.value.data = d.map((y) => ({
865
+ value: y.id,
866
+ label: y.name
867
867
  }));
868
- } catch (u) {
869
- console.error("Failed to fetch tenants:", u), k.value.isError = !0;
868
+ } catch (d) {
869
+ console.error("Failed to fetch tenants:", d), V.value.isError = !0;
870
870
  } finally {
871
- k.value.isLoaded = !0;
871
+ V.value.isLoaded = !0;
872
872
  }
873
873
  }
874
- async function V() {
874
+ async function w() {
875
875
  if (e.value._id)
876
876
  try {
877
- const u = await Xe(e.value._id);
878
- w.value.data = u.map((p) => ({
879
- value: p.Name,
880
- label: `${p.Name} - (${p.EffectiveRate}%)`
877
+ const d = await Xe(e.value._id);
878
+ h.value.data = d.map((y) => ({
879
+ value: y.Name,
880
+ label: `${y.Name} - (${y.EffectiveRate}%)`
881
881
  }));
882
- } catch (u) {
883
- console.error("Failed to fetch taxes:", u), w.value.isError = !0;
882
+ } catch (d) {
883
+ console.error("Failed to fetch taxes:", d), h.value.isError = !0;
884
884
  } finally {
885
- w.value.isLoaded = !0;
885
+ h.value.isLoaded = !0;
886
886
  }
887
887
  }
888
- async function b() {
888
+ async function k() {
889
889
  if (e.value._id)
890
890
  try {
891
- const u = await Qe(e.value._id);
892
- _.value.data = u.map((p) => ({
893
- value: p.Code,
894
- label: `${p.Code} ${p.Name} - [${p.Class}_${p.Type}]`
891
+ const d = await Qe(e.value._id);
892
+ _.value.data = d.map((y) => ({
893
+ value: y.Code,
894
+ label: `${y.Code} ${y.Name} - [${y.Class}_${y.Type}]`
895
895
  }));
896
- } catch (u) {
897
- console.error("Failed to fetch accounts:", u), _.value.isError = !0;
896
+ } catch (d) {
897
+ console.error("Failed to fetch accounts:", d), _.value.isError = !0;
898
898
  } finally {
899
899
  _.value.isLoaded = !0;
900
900
  }
901
901
  }
902
902
  return ve(
903
903
  () => {
904
- var u;
905
- return (u = e.value.platform) == null ? void 0 : u.accessToken;
904
+ var d;
905
+ return (d = e.value.platform) == null ? void 0 : d.accessToken;
906
906
  },
907
- (u) => {
908
- u && (d(), V(), b());
907
+ (d) => {
908
+ d && (m(), w(), k());
909
909
  },
910
910
  { immediate: !0 }
911
- ), (u, p) => {
911
+ ), (d, y) => {
912
912
  var $, l, a;
913
- const r = S("FmPageHead"), x = S("FmTabs");
914
- return c(), C("div", Jt, [
915
- i(r, {
913
+ const n = S("FmPageHead"), v = S("FmTabs");
914
+ return c(), F("div", Wt, [
915
+ r(n, {
916
916
  title: (($ = e.value) == null ? void 0 : $.name) || "Xero",
917
917
  "back-button": !0,
918
918
  style: { paddingLeft: "0px", paddingRight: "0px" },
919
- "onClick:back": v(h).back
919
+ "onClick:back": p(b).back
920
920
  }, {
921
- description: ge(() => p[2] || (p[2] = [
921
+ description: ge(() => y[2] || (y[2] = [
922
922
  t("div", null, null, -1)
923
923
  ])),
924
924
  _: 1
925
925
  }, 8, ["title", "onClick:back"]),
926
- i(x, {
927
- "model-value": n.value,
928
- "onUpdate:modelValue": p[0] || (p[0] = (f) => n.value = f),
929
- items: F
926
+ r(v, {
927
+ "model-value": s.value,
928
+ "onUpdate:modelValue": y[0] || (y[0] = (u) => s.value = u),
929
+ items: C
930
930
  }, null, 8, ["model-value"]),
931
- t("div", Wt, [
932
- (c(), M(xe((l = m.value) == null ? void 0 : l.component), Le({
931
+ t("div", Zt, [
932
+ (c(), M(xe((l = x.value) == null ? void 0 : l.component), Le({
933
933
  modelValue: e.value,
934
- "onUpdate:modelValue": p[1] || (p[1] = (f) => e.value = f)
935
- }, (a = m.value) == null ? void 0 : a.props), null, 16, ["modelValue"]))
934
+ "onUpdate:modelValue": y[1] || (y[1] = (u) => e.value = u)
935
+ }, (a = x.value) == null ? void 0 : a.props), null, 16, ["modelValue"]))
936
936
  ])
937
937
  ]);
938
938
  };
939
939
  }
940
- }), eo = {
940
+ }), to = {
941
941
  key: 0,
942
942
  class: "flex flex-col h-full"
943
- }, to = { class: "flex flex-col gap-16 pb-[24px]" }, oo = { class: "flex flex-row justify-between items-center gap-2" }, ao = { class: "fm-typo-en-title-sm-800" }, lo = { class: "flex flex-row gap-2 items-center" }, no = { class: "relative group cursor-pointer" }, so = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, io = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, mo = { class: "flex flex-row items-center justify-between" }, co = { class: "w-[25%]" }, po = { class: "flex-grow" }, uo = { class: "flex flex-row items-center justify-between" }, fo = { class: "w-[25%]" }, vo = { class: "flex-grow" }, go = { class: "flex flex-col gap-16" }, yo = { class: "fm-typo-en-title-sm-800" }, xo = { class: "flex flex-row items-center max-w-[100%]" }, _o = { class: "w-[25%]" }, bo = { class: "flex-grow" }, wo = { class: "flex flex-row items-center max-w-[100%]" }, ho = { class: "w-[25%]" }, Vo = { class: "flex flex-row items-center max-w-[100%]" }, ko = { class: "w-[25%]" }, $o = { class: "flex flex-col gap-16" }, So = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Co = { class: "flex flex-row items-center gap-x-16" }, Fo = { class: "fm-typo-en-title-sm-800" }, Do = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Uo = { class: "flex flex-row items-center gap-x-16" }, To = { class: "fm-typo-en-title-sm-800" }, Io = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Mo = { class: "flex flex-row items-center gap-x-16" }, Ko = { class: "fm-typo-en-title-sm-800" }, Ao = /* @__PURE__ */ q({
943
+ }, oo = { class: "flex flex-col gap-16 pb-[24px]" }, ao = { class: "flex flex-row justify-between items-center gap-2" }, lo = { class: "fm-typo-en-title-sm-800" }, no = { class: "flex flex-row gap-2 items-center" }, so = { class: "relative group cursor-pointer" }, io = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, ro = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, mo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, co = { class: "flex flex-row items-center justify-between" }, po = { class: "w-[25%]" }, uo = { class: "flex-grow" }, fo = { class: "flex flex-row items-center justify-between" }, vo = { class: "w-[25%]" }, go = { class: "flex-grow" }, yo = { class: "flex flex-col gap-16" }, xo = { class: "fm-typo-en-title-sm-800" }, _o = { class: "flex flex-row items-center max-w-[100%]" }, bo = { class: "w-[25%]" }, wo = { class: "flex-grow" }, ho = { class: "flex flex-row items-center max-w-[100%]" }, Vo = { class: "w-[25%]" }, ko = { class: "flex flex-row items-center max-w-[100%]" }, $o = { class: "w-[25%]" }, So = { class: "flex flex-col gap-16" }, Co = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Fo = { class: "flex flex-row items-center gap-x-16" }, Do = { class: "fm-typo-en-title-sm-800" }, Uo = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, To = { class: "flex flex-row items-center gap-x-16" }, Io = { class: "fm-typo-en-title-sm-800" }, Mo = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Ko = { class: "flex flex-row items-center gap-x-16" }, Ao = { class: "fm-typo-en-title-sm-800" }, Po = /* @__PURE__ */ q({
944
944
  __name: "Setting",
945
945
  props: {
946
946
  modelValue: { required: !0 },
947
947
  modelModifiers: {}
948
948
  },
949
949
  emits: ["update:modelValue"],
950
- setup(g) {
951
- const o = X(g, "modelValue"), e = ue(), n = _e(), k = de(), { promptLoader: w } = we(), { promptMessage: _ } = Se(), { restaurants: F } = pe(), h = Y(
952
- () => F.map((l) => ({ label: l.name, value: l.id }))
953
- ), { t: m } = J();
954
- async function d() {
950
+ setup(f) {
951
+ const o = X(f, "modelValue"), e = ue(), s = _e(), V = de(), { promptLoader: h } = we(), { promptMessage: _ } = Se(), { restaurants: C } = pe(), b = Y(
952
+ () => C.map((l) => ({ label: l.name, value: l.id }))
953
+ ), { t: x } = J();
954
+ async function m() {
955
955
  await _({
956
- message: m("report.messages.confirmDelete", { name: o.value.name }),
957
- title: m("report.common.delete")
958
- }) && await w(async () => {
956
+ message: x("report.messages.confirmDelete", { name: o.value.name }),
957
+ title: x("report.common.delete")
958
+ }) && await h(async () => {
959
959
  try {
960
- await he(o.value._id), await n.getSettings(), k.back();
960
+ await he(o.value._id), await s.getSettings(), V.back();
961
961
  } catch (a) {
962
962
  e.open({ type: "error", message: a.message });
963
963
  }
964
964
  });
965
965
  }
966
- async function V() {
967
- await w(async () => {
966
+ async function w() {
967
+ await h(async () => {
968
968
  try {
969
- await Ve(o.value._id, o.value), await n.getSettings();
969
+ await Ve(o.value._id, o.value), await s.getSettings();
970
970
  } catch (l) {
971
971
  e.open({ type: "error", message: l.message });
972
972
  }
973
973
  });
974
974
  }
975
- function b(l, a) {
976
- var f, s;
977
- (s = (f = o.value.platform) == null ? void 0 : f.mappings) != null && s[l] && (o.value.platform.mappings[l] = o.value.platform.mappings[l].filter(
975
+ function k(l, a) {
976
+ var u, i;
977
+ (i = (u = o.value.platform) == null ? void 0 : u.mappings) != null && i[l] && (o.value.platform.mappings[l] = o.value.platform.mappings[l].filter(
978
978
  (A, P) => P !== a
979
979
  ));
980
980
  }
981
- function u(l) {
982
- var a, f;
983
- if ((f = (a = o.value.platform) == null ? void 0 : a.mappings) != null && f[l]) {
984
- let s;
981
+ function d(l) {
982
+ var a, u;
983
+ if ((u = (a = o.value.platform) == null ? void 0 : a.mappings) != null && u[l]) {
984
+ let i;
985
985
  switch (l) {
986
986
  case "items":
987
- s = {
987
+ i = {
988
988
  key: "",
989
989
  account: "",
990
990
  accountName: ""
991
991
  };
992
992
  break;
993
993
  case "payments":
994
- s = {
994
+ i = {
995
995
  key: "",
996
996
  account: "",
997
997
  accountName: "",
@@ -999,7 +999,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
999
999
  };
1000
1000
  break;
1001
1001
  default:
1002
- s = {
1002
+ i = {
1003
1003
  key: "",
1004
1004
  account: ""
1005
1005
  };
@@ -1007,45 +1007,45 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1007
1007
  }
1008
1008
  o.value.platform.mappings[l] = [
1009
1009
  ...o.value.platform.mappings[l],
1010
- s
1010
+ i
1011
1011
  ];
1012
1012
  }
1013
1013
  }
1014
- const p = [
1014
+ const y = [
1015
1015
  {
1016
- label: m("report.integration.grouping.byDay"),
1016
+ label: x("report.integration.grouping.byDay"),
1017
1017
  value: fe.BY_DAY
1018
1018
  },
1019
1019
  {
1020
- label: m("report.integration.grouping.byDayItem"),
1020
+ label: x("report.integration.grouping.byDayItem"),
1021
1021
  value: fe.BY_DAY_ITEM
1022
1022
  },
1023
1023
  {
1024
- label: m("report.integration.grouping.byInvoice"),
1024
+ label: x("report.integration.grouping.byInvoice"),
1025
1025
  value: fe.BY_INVOICE
1026
1026
  },
1027
1027
  {
1028
- label: m("report.integration.grouping.byDaySeparatePayment"),
1028
+ label: x("report.integration.grouping.byDaySeparatePayment"),
1029
1029
  value: fe.BY_DAY_SEPARATE_PAYMENT
1030
1030
  }
1031
1031
  ];
1032
- function r({
1032
+ function n({
1033
1033
  key: l,
1034
1034
  value: a
1035
1035
  }) {
1036
- var f, s;
1037
- (s = (f = o.value) == null ? void 0 : f.platform) != null && s.mappings && (o.value.platform.mappings[l] = a);
1036
+ var u, i;
1037
+ (i = (u = o.value) == null ? void 0 : u.platform) != null && i.mappings && (o.value.platform.mappings[l] = a);
1038
1038
  }
1039
- function x(l) {
1039
+ function v(l) {
1040
1040
  return {
1041
1041
  key: { placeholder: l, editable: !1 },
1042
1042
  account: { placeholder: l, editable: !0 }
1043
1043
  };
1044
1044
  }
1045
1045
  async function $() {
1046
- await w(async () => {
1046
+ await h(async () => {
1047
1047
  try {
1048
- await ke(o.value._id), await n.getSettings();
1048
+ await ke(o.value._id), await s.getSettings();
1049
1049
  } catch (l) {
1050
1050
  e.open({ type: "error", message: l.message });
1051
1051
  }
@@ -1053,93 +1053,93 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1053
1053
  }
1054
1054
  return (l, a) => {
1055
1055
  var E, G, R, j, z, W, Z, ee, te, oe, ae, le, ne, se, D;
1056
- const f = S("FmIcon"), s = S("FmButton"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmSelect");
1057
- return (G = (E = o.value) == null ? void 0 : E.platform) != null && G.mappings ? (c(), C("div", eo, [
1058
- t("div", to, [
1059
- t("div", oo, [
1060
- t("div", ao, T(v(m)("report.integration.bukku.connect")), 1),
1061
- t("div", lo, [
1062
- t("div", no, [
1063
- i(f, {
1056
+ const u = S("FmIcon"), i = S("FmButton"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmSelect");
1057
+ return (G = (E = o.value) == null ? void 0 : E.platform) != null && G.mappings ? (c(), F("div", to, [
1058
+ t("div", oo, [
1059
+ t("div", ao, [
1060
+ t("div", lo, T(p(x)("report.integration.bukku.connect")), 1),
1061
+ t("div", no, [
1062
+ t("div", so, [
1063
+ r(u, {
1064
1064
  name: "refresh",
1065
1065
  class: "p-2 bg-gray-100 rounded-full",
1066
1066
  onClick: $
1067
1067
  }),
1068
- t("span", so, T(v(m)("report.integration.refreshSetting")), 1)
1068
+ t("span", io, T(p(x)("report.integration.refreshSetting")), 1)
1069
1069
  ]),
1070
- i(s, {
1070
+ r(i, {
1071
1071
  variant: "tertiary",
1072
- label: v(m)("report.common.delete"),
1073
- onClick: d
1072
+ label: p(x)("report.common.delete"),
1073
+ onClick: m
1074
1074
  }, null, 8, ["label"]),
1075
- i(s, {
1075
+ r(i, {
1076
1076
  variant: "primary",
1077
- label: v(m)("report.common.update"),
1078
- onClick: V
1077
+ label: p(x)("report.common.update"),
1078
+ onClick: w
1079
1079
  }, null, 8, ["label"])
1080
1080
  ])
1081
1081
  ])
1082
1082
  ]),
1083
- i(A, { style: { margin: 0 } }),
1084
- t("div", io, [
1085
- t("div", ro, T(v(m)("report.integration.bukku.authentication")), 1),
1086
- t("div", mo, [
1087
- t("div", co, T(v(m)("report.integration.subdomain")), 1),
1088
- t("div", po, [
1089
- i(P, {
1083
+ r(A, { style: { margin: 0 } }),
1084
+ t("div", ro, [
1085
+ t("div", mo, T(p(x)("report.integration.bukku.authentication")), 1),
1086
+ t("div", co, [
1087
+ t("div", po, T(p(x)("report.integration.subdomain")), 1),
1088
+ t("div", uo, [
1089
+ r(P, {
1090
1090
  modelValue: o.value.platform.subdomain,
1091
- "onUpdate:modelValue": a[0] || (a[0] = (y) => o.value.platform.subdomain = y),
1092
- placeholder: v(m)("report.integration.subdomain")
1091
+ "onUpdate:modelValue": a[0] || (a[0] = (g) => o.value.platform.subdomain = g),
1092
+ placeholder: p(x)("report.integration.subdomain")
1093
1093
  }, null, 8, ["modelValue", "placeholder"])
1094
1094
  ])
1095
1095
  ]),
1096
- t("div", uo, [
1097
- t("div", fo, T(v(m)("report.integration.token")), 1),
1098
- t("div", vo, [
1099
- i(P, {
1096
+ t("div", fo, [
1097
+ t("div", vo, T(p(x)("report.integration.token")), 1),
1098
+ t("div", go, [
1099
+ r(P, {
1100
1100
  modelValue: o.value.platform.token,
1101
- "onUpdate:modelValue": a[1] || (a[1] = (y) => o.value.platform.token = y),
1102
- placeholder: v(m)("report.integration.token")
1101
+ "onUpdate:modelValue": a[1] || (a[1] = (g) => o.value.platform.token = g),
1102
+ placeholder: p(x)("report.integration.token")
1103
1103
  }, null, 8, ["modelValue", "placeholder"])
1104
1104
  ])
1105
1105
  ]),
1106
- t("div", go, [
1107
- t("div", yo, T(v(m)("report.integration.general")), 1),
1108
- t("div", xo, [
1109
- t("div", _o, T(v(m)("report.common.name")), 1),
1110
- t("div", bo, [
1111
- i(P, {
1106
+ t("div", yo, [
1107
+ t("div", xo, T(p(x)("report.integration.general")), 1),
1108
+ t("div", _o, [
1109
+ t("div", bo, T(p(x)("report.common.name")), 1),
1110
+ t("div", wo, [
1111
+ r(P, {
1112
1112
  modelValue: o.value.name,
1113
- "onUpdate:modelValue": a[2] || (a[2] = (y) => o.value.name = y)
1113
+ "onUpdate:modelValue": a[2] || (a[2] = (g) => o.value.name = g)
1114
1114
  }, null, 8, ["modelValue"])
1115
1115
  ])
1116
1116
  ]),
1117
- t("div", wo, [
1118
- t("div", ho, T(v(m)("report.common.location")), 1),
1119
- i(Q, {
1117
+ t("div", ho, [
1118
+ t("div", Vo, T(p(x)("report.common.location")), 1),
1119
+ r(Q, {
1120
1120
  modelValue: o.value.platform.locationIds,
1121
- "onUpdate:modelValue": a[3] || (a[3] = (y) => o.value.platform.locationIds = y),
1121
+ "onUpdate:modelValue": a[3] || (a[3] = (g) => o.value.platform.locationIds = g),
1122
1122
  multiselect: !0,
1123
- items: h.value,
1123
+ items: b.value,
1124
1124
  placeholder: "Select location",
1125
1125
  class: "flex-grow"
1126
1126
  }, null, 8, ["modelValue", "items"])
1127
1127
  ]),
1128
- t("div", Vo, [
1129
- t("div", ko, T(v(m)("report.integration.grouping.title")), 1),
1130
- i(Q, {
1128
+ t("div", ko, [
1129
+ t("div", $o, T(p(x)("report.integration.grouping.title")), 1),
1130
+ r(Q, {
1131
1131
  modelValue: o.value.platform.grouping,
1132
- "onUpdate:modelValue": a[4] || (a[4] = (y) => o.value.platform.grouping = y),
1132
+ "onUpdate:modelValue": a[4] || (a[4] = (g) => o.value.platform.grouping = g),
1133
1133
  multiselect: !1,
1134
- items: p,
1134
+ items: y,
1135
1135
  placeholder: "Select grouping",
1136
1136
  class: "flex-grow"
1137
1137
  }, null, 8, ["modelValue"])
1138
1138
  ])
1139
1139
  ]),
1140
- t("div", $o, [
1141
- t("div", So, [
1142
- i(K, {
1140
+ t("div", So, [
1141
+ t("div", Co, [
1142
+ r(K, {
1143
1143
  "model-value": {
1144
1144
  key: "Contact",
1145
1145
  account: o.value.platform.mappings.contact.account
@@ -1154,55 +1154,55 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1154
1154
  editable: !0
1155
1155
  }
1156
1156
  },
1157
- "onUpdate:modelValue": a[5] || (a[5] = (y) => {
1157
+ "onUpdate:modelValue": a[5] || (a[5] = (g) => {
1158
1158
  var U, O, me;
1159
- (me = (O = (U = o.value) == null ? void 0 : U.platform) == null ? void 0 : O.mappings) != null && me.contact && (o.value.platform.mappings.contact.account = y.account);
1159
+ (me = (O = (U = o.value) == null ? void 0 : U.platform) == null ? void 0 : O.mappings) != null && me.contact && (o.value.platform.mappings.contact.account = g.account);
1160
1160
  })
1161
1161
  }, null, 8, ["model-value"]),
1162
- i(K, {
1162
+ r(K, {
1163
1163
  "model-value": {
1164
1164
  key: "Invoice no",
1165
1165
  account: o.value.platform.mappings.invoiceDocNo
1166
1166
  },
1167
- options: x("Invoice no"),
1168
- "onUpdate:modelValue": a[6] || (a[6] = (y) => r({ key: "invoiceDocNo", value: y.account }))
1167
+ options: v("Invoice no"),
1168
+ "onUpdate:modelValue": a[6] || (a[6] = (g) => n({ key: "invoiceDocNo", value: g.account }))
1169
1169
  }, null, 8, ["model-value", "options"]),
1170
- i(K, {
1170
+ r(K, {
1171
1171
  "model-value": {
1172
1172
  key: "Credit note no",
1173
1173
  account: o.value.platform.mappings.creditNoteDocNo
1174
1174
  },
1175
- options: x("Credit note no"),
1176
- "onUpdate:modelValue": a[7] || (a[7] = (y) => r({ key: "creditNoteDocNo", value: y.account }))
1175
+ options: v("Credit note no"),
1176
+ "onUpdate:modelValue": a[7] || (a[7] = (g) => n({ key: "creditNoteDocNo", value: g.account }))
1177
1177
  }, null, 8, ["model-value", "options"]),
1178
- i(K, {
1178
+ r(K, {
1179
1179
  "model-value": {
1180
1180
  key: "Payment no",
1181
1181
  account: o.value.platform.mappings.paymentDocNo
1182
1182
  },
1183
- options: x("Payment no"),
1184
- "onUpdate:modelValue": a[8] || (a[8] = (y) => r({ key: "paymentDocNo", value: y.account }))
1183
+ options: v("Payment no"),
1184
+ "onUpdate:modelValue": a[8] || (a[8] = (g) => n({ key: "paymentDocNo", value: g.account }))
1185
1185
  }, null, 8, ["model-value", "options"]),
1186
- i(K, {
1186
+ r(K, {
1187
1187
  "model-value": {
1188
1188
  key: "Refund no",
1189
1189
  account: o.value.platform.mappings.refundDocNo
1190
1190
  },
1191
- options: x("Refund no"),
1192
- "onUpdate:modelValue": a[9] || (a[9] = (y) => r({ key: "refundDocNo", value: y.account }))
1191
+ options: v("Refund no"),
1192
+ "onUpdate:modelValue": a[9] || (a[9] = (g) => n({ key: "refundDocNo", value: g.account }))
1193
1193
  }, null, 8, ["model-value", "options"]),
1194
- i(K, {
1194
+ r(K, {
1195
1195
  "model-value": {
1196
1196
  key: "Rounding",
1197
1197
  account: o.value.platform.mappings.rounding.account
1198
1198
  },
1199
- options: x("Rounding"),
1200
- "onUpdate:modelValue": a[10] || (a[10] = (y) => {
1199
+ options: v("Rounding"),
1200
+ "onUpdate:modelValue": a[10] || (a[10] = (g) => {
1201
1201
  var U, O, me;
1202
- (me = (O = (U = o.value) == null ? void 0 : U.platform) == null ? void 0 : O.mappings) != null && me.rounding && (o.value.platform.mappings.rounding.account = y.account);
1202
+ (me = (O = (U = o.value) == null ? void 0 : U.platform) == null ? void 0 : O.mappings) != null && me.rounding && (o.value.platform.mappings.rounding.account = g.account);
1203
1203
  })
1204
1204
  }, null, 8, ["model-value", "options"]),
1205
- (c(!0), C(L, null, H((z = (j = (R = o.value) == null ? void 0 : R.platform) == null ? void 0 : j.mappings) == null ? void 0 : z.charges, (y, U) => (c(), M(K, {
1205
+ (c(!0), F(L, null, H((z = (j = (R = o.value) == null ? void 0 : R.platform) == null ? void 0 : j.mappings) == null ? void 0 : z.charges, (g, U) => (c(), M(K, {
1206
1206
  key: `charge-${U}`,
1207
1207
  modelValue: o.value.platform.mappings.charges[U],
1208
1208
  "onUpdate:modelValue": (O) => o.value.platform.mappings.charges[U] = O,
@@ -1219,22 +1219,22 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1219
1219
  }, null, 8, ["modelValue", "onUpdate:modelValue"]))), 128))
1220
1220
  ])
1221
1221
  ]),
1222
- i(De, {
1222
+ r(De, {
1223
1223
  modelValue: o.value.platform,
1224
- "onUpdate:modelValue": a[11] || (a[11] = (y) => o.value.platform = y),
1224
+ "onUpdate:modelValue": a[11] || (a[11] = (g) => o.value.platform = g),
1225
1225
  label: "upload",
1226
1226
  "last-upload-date": (W = o.value.platform) == null ? void 0 : W.lastUploadDate
1227
1227
  }, null, 8, ["modelValue", "last-upload-date"]),
1228
- t("div", Co, [
1229
- t("div", Fo, T(v(m)("report.integration.items")), 1),
1230
- i(s, {
1228
+ t("div", Fo, [
1229
+ t("div", Do, T(p(x)("report.integration.items")), 1),
1230
+ r(i, {
1231
1231
  variant: "primary",
1232
1232
  icon: "add",
1233
- onClick: a[12] || (a[12] = () => u("items"))
1233
+ onClick: a[12] || (a[12] = () => d("items"))
1234
1234
  })
1235
1235
  ]),
1236
- t("div", Do, [
1237
- (c(!0), C(L, null, H((te = (ee = (Z = o.value) == null ? void 0 : Z.platform) == null ? void 0 : ee.mappings) == null ? void 0 : te.items, (y, U) => (c(), M(K, {
1236
+ t("div", Uo, [
1237
+ (c(!0), F(L, null, H((te = (ee = (Z = o.value) == null ? void 0 : Z.platform) == null ? void 0 : ee.mappings) == null ? void 0 : te.items, (g, U) => (c(), M(K, {
1238
1238
  key: `item-${U}`,
1239
1239
  modelValue: o.value.platform.mappings.items[U],
1240
1240
  "onUpdate:modelValue": (O) => o.value.platform.mappings.items[U] = O,
@@ -1243,19 +1243,19 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1243
1243
  account: { placeholder: "Account code", editable: !0 }
1244
1244
  },
1245
1245
  removable: !0,
1246
- onRemove: () => b("items", U)
1246
+ onRemove: () => k("items", U)
1247
1247
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
1248
1248
  ]),
1249
- t("div", Uo, [
1250
- t("div", To, T(v(m)("report.integration.taxes")), 1),
1251
- i(s, {
1249
+ t("div", To, [
1250
+ t("div", Io, T(p(x)("report.integration.taxes")), 1),
1251
+ r(i, {
1252
1252
  variant: "primary",
1253
1253
  icon: "add",
1254
- onClick: a[13] || (a[13] = () => u("taxes"))
1254
+ onClick: a[13] || (a[13] = () => d("taxes"))
1255
1255
  })
1256
1256
  ]),
1257
- t("div", Io, [
1258
- (c(!0), C(L, null, H((le = (ae = (oe = o.value) == null ? void 0 : oe.platform) == null ? void 0 : ae.mappings) == null ? void 0 : le.taxes, (y, U) => (c(), M(K, {
1257
+ t("div", Mo, [
1258
+ (c(!0), F(L, null, H((le = (ae = (oe = o.value) == null ? void 0 : oe.platform) == null ? void 0 : ae.mappings) == null ? void 0 : le.taxes, (g, U) => (c(), M(K, {
1259
1259
  key: `tax-${U}`,
1260
1260
  modelValue: o.value.platform.mappings.taxes[U],
1261
1261
  "onUpdate:modelValue": (O) => o.value.platform.mappings.taxes[U] = O,
@@ -1264,22 +1264,22 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1264
1264
  account: { placeholder: "Account code", editable: !0 }
1265
1265
  },
1266
1266
  removable: !0,
1267
- onRemove: () => b("taxes", U)
1267
+ onRemove: () => k("taxes", U)
1268
1268
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
1269
1269
  ]),
1270
- t("div", Mo, [
1271
- t("div", Ko, T(v(m)("report.integration.payments")), 1),
1272
- i(s, {
1270
+ t("div", Ko, [
1271
+ t("div", Ao, T(p(x)("report.integration.payments")), 1),
1272
+ r(i, {
1273
1273
  variant: "primary",
1274
1274
  icon: "add",
1275
- onClick: a[14] || (a[14] = () => u("payments"))
1275
+ onClick: a[14] || (a[14] = () => d("payments"))
1276
1276
  })
1277
1277
  ]),
1278
- (c(!0), C(L, null, H((D = (se = (ne = o.value) == null ? void 0 : ne.platform) == null ? void 0 : se.mappings) == null ? void 0 : D.payments, (y, U) => (c(), C("div", {
1278
+ (c(!0), F(L, null, H((D = (se = (ne = o.value) == null ? void 0 : ne.platform) == null ? void 0 : se.mappings) == null ? void 0 : D.payments, (g, U) => (c(), F("div", {
1279
1279
  key: `payment-${U}`,
1280
1280
  class: "grid-cols-1 grid gap-x-16"
1281
1281
  }, [
1282
- i(K, {
1282
+ r(K, {
1283
1283
  modelValue: o.value.platform.mappings.payments[U],
1284
1284
  "onUpdate:modelValue": (O) => o.value.platform.mappings.payments[U] = O,
1285
1285
  options: {
@@ -1288,40 +1288,40 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1288
1288
  account: { placeholder: "Account code", editable: !0 }
1289
1289
  },
1290
1290
  removable: !0,
1291
- onRemove: () => b("payments", U)
1291
+ onRemove: () => k("payments", U)
1292
1292
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"])
1293
1293
  ]))), 128))
1294
1294
  ])
1295
1295
  ])) : N("", !0);
1296
1296
  };
1297
1297
  }
1298
- }), Po = { class: "h-full flex flex-col gap-16" }, No = { class: "flex flex-row gap-2 justify-between items-center" }, Ro = {
1298
+ }), No = { class: "h-full flex flex-col gap-16" }, Ro = { class: "flex flex-row gap-2 justify-between items-center" }, Oo = {
1299
1299
  key: 0,
1300
1300
  class: "flex gap-24 w-full h-full justify-center items-center overflow-scroll"
1301
- }, Oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bo = /* @__PURE__ */ q({
1301
+ }, Bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jo = /* @__PURE__ */ q({
1302
1302
  __name: "Preview",
1303
1303
  props: {
1304
1304
  modelValue: { required: !0 },
1305
1305
  modelModifiers: {}
1306
1306
  },
1307
1307
  emits: ["update:modelValue"],
1308
- setup(g) {
1308
+ setup(f) {
1309
1309
  const o = B([]), e = Y(
1310
- () => o.value.reduce((d, V) => {
1311
- const b = d.length, { invoice: u, payments: p } = V;
1312
- d[b] = {
1313
- no: u.number,
1314
- date: u.date,
1315
- contact: u._contact_name,
1316
- status: u.status,
1317
- title: u.title
1310
+ () => o.value.reduce((m, w) => {
1311
+ const k = m.length, { invoice: d, payments: y } = w;
1312
+ m[k] = {
1313
+ no: d.number,
1314
+ date: d.date,
1315
+ contact: d._contact_name,
1316
+ status: d.status,
1317
+ title: d.title
1318
1318
  };
1319
- for (let r = 0; r < Math.max(u.form_items.length, p.length); r++) {
1320
- const x = b + r;
1321
- d[x] || (d[x] = {});
1322
- const $ = u.form_items[r];
1323
- $ && (d[x] = {
1324
- ...d[x],
1319
+ for (let n = 0; n < Math.max(d.form_items.length, y.length); n++) {
1320
+ const v = k + n;
1321
+ m[v] || (m[v] = {});
1322
+ const $ = d.form_items[n];
1323
+ $ && (m[v] = {
1324
+ ...m[v],
1325
1325
  itemDescription: $.description,
1326
1326
  itemQuantity: $.quantity,
1327
1327
  itemUnitPrice: $.unit_price,
@@ -1329,9 +1329,9 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1329
1329
  itemTaxCode: $._tax_code_name,
1330
1330
  itemDiscount: $.discount
1331
1331
  });
1332
- const l = p[r];
1333
- l && (d[x] = {
1334
- ...d[x],
1332
+ const l = y[n];
1333
+ l && (m[v] = {
1334
+ ...m[v],
1335
1335
  paymentNo: l.number,
1336
1336
  paymentMethod: l.deposit_items[0]._payment_method_name,
1337
1337
  paymentAccount: l.deposit_items[0]._account_name,
@@ -1340,21 +1340,21 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1340
1340
  paymentSkip: l.skip
1341
1341
  });
1342
1342
  }
1343
- return d;
1343
+ return m;
1344
1344
  }, [])
1345
- ), { t: n } = J(), k = [
1345
+ ), { t: s } = J(), V = [
1346
1346
  {
1347
1347
  accessorKey: "date",
1348
1348
  header: () => I(
1349
1349
  "p",
1350
1350
  { class: "min-w-[90px] text-nowrap text-ellipsis" },
1351
- n("report.integration.table.date")
1351
+ s("report.integration.table.date")
1352
1352
  ),
1353
1353
  enableSorting: !1
1354
1354
  },
1355
1355
  {
1356
1356
  accessorKey: "no",
1357
- header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, n("report.integration.table.no")),
1357
+ header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, s("report.integration.table.no")),
1358
1358
  enableSorting: !1
1359
1359
  },
1360
1360
  {
@@ -1432,15 +1432,15 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1432
1432
  header: "Skip",
1433
1433
  enableSorting: !1
1434
1434
  }
1435
- ], w = X(g, "modelValue"), _ = B(!1), F = ue(), { dateRange: h } = Ce(pe());
1435
+ ], h = X(f, "modelValue"), _ = B(!1), C = ue(), { dateRange: b } = Ce(pe());
1436
1436
  ve(
1437
- () => h.value,
1437
+ () => b.value,
1438
1438
  async () => {
1439
- if (w.value._id)
1439
+ if (h.value._id)
1440
1440
  try {
1441
- _.value = !0, o.value = await $e(w.value._id);
1442
- } catch (d) {
1443
- F.open({ message: d.message, type: "error" });
1441
+ _.value = !0, o.value = await $e(h.value._id);
1442
+ } catch (m) {
1443
+ C.open({ message: m.message, type: "error" });
1444
1444
  } finally {
1445
1445
  _.value = !1;
1446
1446
  }
@@ -1449,52 +1449,52 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1449
1449
  immediate: !0
1450
1450
  }
1451
1451
  );
1452
- async function m() {
1452
+ async function x() {
1453
1453
  try {
1454
- w.value._id ? (_.value = !0, await Ae(w.value._id), F.open({ message: n("report.integration.uploadSuccess"), type: "success" })) : F.open({ message: n("report.integration.error.invalid"), type: "error" });
1455
- } catch (d) {
1456
- F.open({ message: d.message, type: "error" });
1454
+ h.value._id ? (_.value = !0, await Ae(h.value._id), C.open({ message: s("report.integration.uploadSuccess"), type: "success" })) : C.open({ message: s("report.integration.error.invalid"), type: "error" });
1455
+ } catch (m) {
1456
+ C.open({ message: m.message, type: "error" });
1457
1457
  } finally {
1458
1458
  _.value = !1;
1459
1459
  }
1460
1460
  }
1461
- return (d, V) => {
1462
- const b = S("FmButton"), u = S("FmCircularProgress"), p = S("FmTable");
1463
- return c(), C("div", Po, [
1464
- t("div", No, [
1465
- i(Fe, {
1466
- "date-range": v(h),
1467
- "onUpdate:dateRange": V[0] || (V[0] = (r) => be(h) ? h.value = r : null),
1461
+ return (m, w) => {
1462
+ const k = S("FmButton"), d = S("FmCircularProgress"), y = S("FmTable");
1463
+ return c(), F("div", No, [
1464
+ t("div", Ro, [
1465
+ r(Fe, {
1466
+ "date-range": p(b),
1467
+ "onUpdate:dateRange": w[0] || (w[0] = (n) => be(b) ? b.value = n : null),
1468
1468
  compare: !1
1469
1469
  }, null, 8, ["date-range"]),
1470
- i(b, {
1470
+ r(k, {
1471
1471
  loading: _.value,
1472
1472
  variant: "primary",
1473
- label: v(n)("report.common.upload"),
1474
- onClick: m
1473
+ label: p(s)("report.common.upload"),
1474
+ onClick: x
1475
1475
  }, null, 8, ["loading", "label"])
1476
1476
  ]),
1477
- _.value ? (c(), C("div", Ro, [
1478
- i(u, { size: "xl" }),
1479
- t("span", Oo, T(v(n)("report.integration.table.loading")), 1)
1480
- ])) : e.value.length > 0 ? (c(), M(p, {
1477
+ _.value ? (c(), F("div", Oo, [
1478
+ r(d, { size: "xl" }),
1479
+ t("span", Bo, T(p(s)("report.integration.table.loading")), 1)
1480
+ ])) : e.value.length > 0 ? (c(), M(y, {
1481
1481
  key: 1,
1482
1482
  class: "flex overflow-scroll",
1483
1483
  "row-data": e.value,
1484
- "column-defs": k
1484
+ "column-defs": V
1485
1485
  }, null, 8, ["row-data"])) : N("", !0)
1486
1486
  ]);
1487
1487
  };
1488
1488
  }
1489
- }), jo = { class: "h-full relative flex flex-col" }, Lo = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, Eo = /* @__PURE__ */ q({
1489
+ }), Lo = { class: "h-full relative flex flex-col" }, Eo = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, zo = /* @__PURE__ */ q({
1490
1490
  __name: "Bukku",
1491
1491
  props: {
1492
1492
  modelValue: {},
1493
1493
  modelModifiers: {}
1494
1494
  },
1495
1495
  emits: ["update:modelValue"],
1496
- setup(g) {
1497
- const { t: o } = J(), e = X(g, "modelValue"), n = B("setting"), k = [
1496
+ setup(f) {
1497
+ const { t: o } = J(), e = X(f, "modelValue"), s = B("setting"), V = [
1498
1498
  {
1499
1499
  label: o("report.integration.setting"),
1500
1500
  value: "setting",
@@ -1505,89 +1505,89 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1505
1505
  value: "preview",
1506
1506
  icon: "table"
1507
1507
  }
1508
- ], w = de(), _ = Y(() => {
1509
- switch (n.value) {
1508
+ ], h = de(), _ = Y(() => {
1509
+ switch (s.value) {
1510
1510
  case "preview":
1511
- return Bo;
1511
+ return jo;
1512
1512
  case "setting":
1513
- return Ao;
1513
+ return Po;
1514
1514
  default:
1515
1515
  return null;
1516
1516
  }
1517
1517
  });
1518
- return (F, h) => {
1519
- var V;
1520
- const m = S("FmPageHead"), d = S("FmTabs");
1521
- return c(), C("div", jo, [
1522
- i(m, {
1523
- title: ((V = e.value) == null ? void 0 : V.name) || "Bukku",
1518
+ return (C, b) => {
1519
+ var w;
1520
+ const x = S("FmPageHead"), m = S("FmTabs");
1521
+ return c(), F("div", Lo, [
1522
+ r(x, {
1523
+ title: ((w = e.value) == null ? void 0 : w.name) || "Bukku",
1524
1524
  "back-button": !0,
1525
1525
  style: { paddingLeft: "0px", paddingRight: "0px" },
1526
- "onClick:back": v(w).back
1526
+ "onClick:back": p(h).back
1527
1527
  }, {
1528
- description: ge(() => h[2] || (h[2] = [
1528
+ description: ge(() => b[2] || (b[2] = [
1529
1529
  t("div", null, null, -1)
1530
1530
  ])),
1531
1531
  _: 1
1532
1532
  }, 8, ["title", "onClick:back"]),
1533
- i(d, {
1534
- "model-value": n.value,
1535
- "onUpdate:modelValue": h[0] || (h[0] = (b) => n.value = b),
1536
- items: k
1533
+ r(m, {
1534
+ "model-value": s.value,
1535
+ "onUpdate:modelValue": b[0] || (b[0] = (k) => s.value = k),
1536
+ items: V
1537
1537
  }, null, 8, ["model-value"]),
1538
- t("div", Lo, [
1538
+ t("div", Eo, [
1539
1539
  (c(), M(xe(_.value), {
1540
1540
  modelValue: e.value,
1541
- "onUpdate:modelValue": h[1] || (h[1] = (b) => e.value = b)
1541
+ "onUpdate:modelValue": b[1] || (b[1] = (k) => e.value = k)
1542
1542
  }, null, 8, ["modelValue"]))
1543
1543
  ])
1544
1544
  ]);
1545
1545
  };
1546
1546
  }
1547
- }), zo = {
1547
+ }), Yo = {
1548
1548
  key: 0,
1549
1549
  class: "flex flex-col h-full"
1550
- }, Yo = { class: "flex flex-col gap-16 pb-[24px]" }, qo = { class: "flex flex-row justify-between items-center gap-2" }, Ho = { class: "flex flex-row gap-2 items-center" }, Xo = { class: "relative group cursor-pointer" }, Qo = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, Go = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, Jo = { class: "flex flex-col gap-16" }, Wo = { class: "fm-typo-en-title-sm-800" }, Zo = { class: "flex flex-row items-center max-w-[100%]" }, ea = { class: "w-[25%]" }, ta = { class: "flex-grow" }, oa = { class: "flex flex-row items-center max-w-[100%]" }, aa = { class: "w-[25%]" }, la = { class: "flex flex-row items-center max-w-[100%]" }, na = { class: "w-[25%]" }, sa = { class: "flex flex-col gap-16" }, ia = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, ra = { class: "flex flex-row items-center gap-x-16" }, ma = { class: "fm-typo-en-title-sm-800" }, ca = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, da = { class: "flex flex-row items-center gap-x-16" }, pa = { class: "fm-typo-en-title-sm-800" }, ua = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, fa = { class: "flex flex-row items-center gap-x-16" }, va = { class: "fm-typo-en-title-sm-800" }, ga = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, ya = /* @__PURE__ */ q({
1550
+ }, qo = { class: "flex flex-col gap-16 pb-[24px]" }, Ho = { class: "flex flex-row justify-between items-center gap-2" }, Xo = { class: "flex flex-row gap-2 items-center" }, Qo = { class: "relative group cursor-pointer" }, Go = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, Jo = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, Wo = { class: "flex flex-col gap-16" }, Zo = { class: "fm-typo-en-title-sm-800" }, ea = { class: "flex flex-row items-center max-w-[100%]" }, ta = { class: "w-[25%]" }, oa = { class: "flex-grow" }, aa = { class: "flex flex-row items-center max-w-[100%]" }, la = { class: "w-[25%]" }, na = { class: "flex flex-row items-center max-w-[100%]" }, sa = { class: "w-[25%]" }, ia = { class: "flex flex-col gap-16" }, ra = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, ma = { class: "flex flex-row items-center gap-x-16" }, ca = { class: "fm-typo-en-title-sm-800" }, da = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, pa = { class: "flex flex-row items-center gap-x-16" }, ua = { class: "fm-typo-en-title-sm-800" }, fa = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, va = { class: "flex flex-row items-center gap-x-16" }, ga = { class: "fm-typo-en-title-sm-800" }, ya = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, xa = /* @__PURE__ */ q({
1551
1551
  __name: "Setting",
1552
1552
  props: {
1553
1553
  modelValue: { required: !0 },
1554
1554
  modelModifiers: {}
1555
1555
  },
1556
1556
  emits: ["update:modelValue"],
1557
- setup(g) {
1558
- const { t: o } = J(), e = X(g, "modelValue"), n = ue(), k = _e(), w = de(), { promptLoader: _ } = we(), { promptMessage: F } = Se(), { restaurants: h } = pe(), m = Y(
1559
- () => h.map((l) => ({ label: l.name, value: l.id }))
1557
+ setup(f) {
1558
+ const { t: o } = J(), e = X(f, "modelValue"), s = ue(), V = _e(), h = de(), { promptLoader: _ } = we(), { promptMessage: C } = Se(), { restaurants: b } = pe(), x = Y(
1559
+ () => b.map((l) => ({ label: l.name, value: l.id }))
1560
1560
  );
1561
- async function d() {
1562
- await F({
1561
+ async function m() {
1562
+ await C({
1563
1563
  message: o("report.messages.confirmDelete", { name: e.value.name }),
1564
1564
  title: o("report.common.delete")
1565
1565
  }) && await _(async () => {
1566
1566
  try {
1567
- await he(e.value._id), await k.getSettings(), w.back();
1567
+ await he(e.value._id), await V.getSettings(), h.back();
1568
1568
  } catch (a) {
1569
- n.open({ type: "error", message: a.message });
1569
+ s.open({ type: "error", message: a.message });
1570
1570
  }
1571
1571
  });
1572
1572
  }
1573
- async function V() {
1573
+ async function w() {
1574
1574
  await _(async () => {
1575
1575
  try {
1576
- await Ve(e.value._id, e.value), await k.getSettings();
1576
+ await Ve(e.value._id, e.value), await V.getSettings();
1577
1577
  } catch (l) {
1578
- n.open({ type: "error", message: l.message });
1578
+ s.open({ type: "error", message: l.message });
1579
1579
  }
1580
1580
  });
1581
1581
  }
1582
- function b(l, a) {
1583
- var f, s;
1584
- (s = (f = e.value.platform) == null ? void 0 : f.mappings) != null && s[l] && (e.value.platform.mappings[l] = e.value.platform.mappings[l].filter(
1582
+ function k(l, a) {
1583
+ var u, i;
1584
+ (i = (u = e.value.platform) == null ? void 0 : u.mappings) != null && i[l] && (e.value.platform.mappings[l] = e.value.platform.mappings[l].filter(
1585
1585
  (A, P) => P !== a
1586
1586
  ));
1587
1587
  }
1588
- function u(l) {
1589
- var a, f;
1590
- (f = (a = e.value.platform) == null ? void 0 : a.mappings) != null && f[l] && (e.value.platform.mappings[l] = [
1588
+ function d(l) {
1589
+ var a, u;
1590
+ (u = (a = e.value.platform) == null ? void 0 : a.mappings) != null && u[l] && (e.value.platform.mappings[l] = [
1591
1591
  ...e.value.platform.mappings[l],
1592
1592
  l === "items" ? {
1593
1593
  key: "",
@@ -1599,7 +1599,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1599
1599
  }
1600
1600
  ]);
1601
1601
  }
1602
- const p = [
1602
+ const y = [
1603
1603
  {
1604
1604
  label: "By day",
1605
1605
  value: fe.BY_DAY
@@ -1613,14 +1613,14 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1613
1613
  value: fe.BY_DAY_CATEGORY
1614
1614
  }
1615
1615
  ];
1616
- function r({
1616
+ function n({
1617
1617
  key: l,
1618
1618
  value: a
1619
1619
  }) {
1620
- var f, s;
1621
- (s = (f = e.value) == null ? void 0 : f.platform) != null && s.mappings && (e.value.platform.mappings[l] = a);
1620
+ var u, i;
1621
+ (i = (u = e.value) == null ? void 0 : u.platform) != null && i.mappings && (e.value.platform.mappings[l] = a);
1622
1622
  }
1623
- function x(l) {
1623
+ function v(l) {
1624
1624
  return {
1625
1625
  key: { placeholder: l, editable: !1 },
1626
1626
  account: { placeholder: l, editable: !0 }
@@ -1629,137 +1629,137 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1629
1629
  async function $() {
1630
1630
  await _(async () => {
1631
1631
  try {
1632
- await ke(e.value._id), await k.getSettings();
1632
+ await ke(e.value._id), await V.getSettings();
1633
1633
  } catch (l) {
1634
- n.open({ type: "error", message: l.message });
1634
+ s.open({ type: "error", message: l.message });
1635
1635
  }
1636
1636
  });
1637
1637
  }
1638
1638
  return (l, a) => {
1639
1639
  var E, G, R, j, z, W, Z, ee, te, oe, ae, le, ne, se;
1640
- const f = S("FmIcon"), s = S("FmButton"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmSelect");
1641
- return (G = (E = e.value) == null ? void 0 : E.platform) != null && G.mappings ? (c(), C("div", zo, [
1642
- t("div", Yo, [
1643
- t("div", qo, [
1640
+ const u = S("FmIcon"), i = S("FmButton"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmSelect");
1641
+ return (G = (E = e.value) == null ? void 0 : E.platform) != null && G.mappings ? (c(), F("div", Yo, [
1642
+ t("div", qo, [
1643
+ t("div", Ho, [
1644
1644
  a[14] || (a[14] = t("div", { class: "fm-typo-en-title-sm-800" }, null, -1)),
1645
- t("div", Ho, [
1646
- t("div", Xo, [
1647
- i(f, {
1645
+ t("div", Xo, [
1646
+ t("div", Qo, [
1647
+ r(u, {
1648
1648
  name: "refresh",
1649
1649
  class: "p-2 bg-gray-100 rounded-full",
1650
1650
  onClick: $
1651
1651
  }),
1652
- t("span", Qo, T(v(o)("report.integration.refreshSetting")), 1)
1652
+ t("span", Go, T(p(o)("report.integration.refreshSetting")), 1)
1653
1653
  ]),
1654
- i(s, {
1654
+ r(i, {
1655
1655
  variant: "tertiary",
1656
- label: v(o)("report.common.remove"),
1657
- onClick: d
1656
+ label: p(o)("report.common.remove"),
1657
+ onClick: m
1658
1658
  }, null, 8, ["label"]),
1659
- i(s, {
1659
+ r(i, {
1660
1660
  variant: "primary",
1661
- label: v(o)("report.common.update"),
1662
- onClick: V
1661
+ label: p(o)("report.common.update"),
1662
+ onClick: w
1663
1663
  }, null, 8, ["label"])
1664
1664
  ])
1665
1665
  ])
1666
1666
  ]),
1667
- i(A, { style: { margin: 0 } }),
1668
- t("div", Go, [
1669
- t("div", Jo, [
1670
- t("div", Wo, T(v(o)("report.integration.general")), 1),
1671
- t("div", Zo, [
1672
- t("div", ea, T(v(o)("report.common.name")), 1),
1673
- t("div", ta, [
1674
- i(P, {
1667
+ r(A, { style: { margin: 0 } }),
1668
+ t("div", Jo, [
1669
+ t("div", Wo, [
1670
+ t("div", Zo, T(p(o)("report.integration.general")), 1),
1671
+ t("div", ea, [
1672
+ t("div", ta, T(p(o)("report.common.name")), 1),
1673
+ t("div", oa, [
1674
+ r(P, {
1675
1675
  modelValue: e.value.name,
1676
1676
  "onUpdate:modelValue": a[0] || (a[0] = (D) => e.value.name = D)
1677
1677
  }, null, 8, ["modelValue"])
1678
1678
  ])
1679
1679
  ]),
1680
- t("div", oa, [
1681
- t("div", aa, T(v(o)("report.integration.location")), 1),
1682
- i(Q, {
1680
+ t("div", aa, [
1681
+ t("div", la, T(p(o)("report.integration.location")), 1),
1682
+ r(Q, {
1683
1683
  modelValue: e.value.platform.locationIds,
1684
1684
  "onUpdate:modelValue": a[1] || (a[1] = (D) => e.value.platform.locationIds = D),
1685
1685
  multiselect: !0,
1686
- items: m.value,
1686
+ items: x.value,
1687
1687
  placeholder: "Select location",
1688
1688
  class: "flex-grow",
1689
1689
  rules: [(D) => D.length !== 0 || "Please select at least 1 location"]
1690
1690
  }, null, 8, ["modelValue", "items", "rules"])
1691
1691
  ]),
1692
- t("div", la, [
1693
- t("div", na, T(v(o)("report.integration.grouping.title")), 1),
1694
- i(Q, {
1692
+ t("div", na, [
1693
+ t("div", sa, T(p(o)("report.integration.grouping.title")), 1),
1694
+ r(Q, {
1695
1695
  modelValue: e.value.platform.grouping,
1696
1696
  "onUpdate:modelValue": a[2] || (a[2] = (D) => e.value.platform.grouping = D),
1697
1697
  multiselect: !1,
1698
- items: p,
1698
+ items: y,
1699
1699
  placeholder: "Select grouping",
1700
1700
  class: "flex-grow"
1701
1701
  }, null, 8, ["modelValue"])
1702
1702
  ])
1703
1703
  ]),
1704
- t("div", sa, [
1705
- t("div", ia, [
1706
- i(K, {
1704
+ t("div", ia, [
1705
+ t("div", ra, [
1706
+ r(K, {
1707
1707
  "model-value": { key: "Project", account: e.value.platform.mappings.project },
1708
- options: x("Project"),
1709
- "onUpdate:modelValue": a[3] || (a[3] = (D) => r({ key: "project", value: D.account }))
1708
+ options: v("Project"),
1709
+ "onUpdate:modelValue": a[3] || (a[3] = (D) => n({ key: "project", value: D.account }))
1710
1710
  }, null, 8, ["model-value", "options"]),
1711
- i(K, {
1711
+ r(K, {
1712
1712
  "model-value": { key: "Debtor", account: e.value.platform.mappings.debtor },
1713
- options: x("Debtor"),
1714
- "onUpdate:modelValue": a[4] || (a[4] = (D) => r({ key: "debtor", value: D.account }))
1713
+ options: v("Debtor"),
1714
+ "onUpdate:modelValue": a[4] || (a[4] = (D) => n({ key: "debtor", value: D.account }))
1715
1715
  }, null, 8, ["model-value", "options"]),
1716
- i(K, {
1716
+ r(K, {
1717
1717
  "model-value": {
1718
1718
  key: "Invoice no",
1719
1719
  account: e.value.platform.mappings.invoiceDocNo
1720
1720
  },
1721
- options: x("Invoice no"),
1722
- "onUpdate:modelValue": a[5] || (a[5] = (D) => r({ key: "invoiceDocNo", value: D.account }))
1721
+ options: v("Invoice no"),
1722
+ "onUpdate:modelValue": a[5] || (a[5] = (D) => n({ key: "invoiceDocNo", value: D.account }))
1723
1723
  }, null, 8, ["model-value", "options"]),
1724
- i(K, {
1724
+ r(K, {
1725
1725
  "model-value": {
1726
1726
  key: "Credit note no",
1727
1727
  account: e.value.platform.mappings.creditNoteDocNo
1728
1728
  },
1729
- options: x("Credit note no"),
1730
- "onUpdate:modelValue": a[6] || (a[6] = (D) => r({ key: "creditNoteDocNo", value: D.account }))
1729
+ options: v("Credit note no"),
1730
+ "onUpdate:modelValue": a[6] || (a[6] = (D) => n({ key: "creditNoteDocNo", value: D.account }))
1731
1731
  }, null, 8, ["model-value", "options"]),
1732
- i(K, {
1732
+ r(K, {
1733
1733
  "model-value": {
1734
1734
  key: "Payment no",
1735
1735
  account: e.value.platform.mappings.paymentDocNo
1736
1736
  },
1737
- options: x("Payment no"),
1738
- "onUpdate:modelValue": a[7] || (a[7] = (D) => r({ key: "paymentDocNo", value: D.account }))
1737
+ options: v("Payment no"),
1738
+ "onUpdate:modelValue": a[7] || (a[7] = (D) => n({ key: "paymentDocNo", value: D.account }))
1739
1739
  }, null, 8, ["model-value", "options"]),
1740
- i(K, {
1740
+ r(K, {
1741
1741
  "model-value": {
1742
1742
  key: "Refund no",
1743
1743
  account: e.value.platform.mappings.refundDocNo
1744
1744
  },
1745
- options: x("Refund no"),
1746
- "onUpdate:modelValue": a[8] || (a[8] = (D) => r({ key: "refundDocNo", value: D.account }))
1745
+ options: v("Refund no"),
1746
+ "onUpdate:modelValue": a[8] || (a[8] = (D) => n({ key: "refundDocNo", value: D.account }))
1747
1747
  }, null, 8, ["model-value", "options"]),
1748
- i(K, {
1748
+ r(K, {
1749
1749
  "model-value": {
1750
1750
  key: "Rounding",
1751
1751
  account: e.value.platform.mappings.rounding.account
1752
1752
  },
1753
- options: x("Rounding"),
1753
+ options: v("Rounding"),
1754
1754
  "onUpdate:modelValue": a[9] || (a[9] = (D) => {
1755
- var y, U, O;
1756
- (O = (U = (y = e.value) == null ? void 0 : y.platform) == null ? void 0 : U.mappings) != null && O.rounding && (e.value.platform.mappings.rounding.account = D.account);
1755
+ var g, U, O;
1756
+ (O = (U = (g = e.value) == null ? void 0 : g.platform) == null ? void 0 : U.mappings) != null && O.rounding && (e.value.platform.mappings.rounding.account = D.account);
1757
1757
  })
1758
1758
  }, null, 8, ["model-value", "options"]),
1759
- (c(!0), C(L, null, H((z = (j = (R = e.value) == null ? void 0 : R.platform) == null ? void 0 : j.mappings) == null ? void 0 : z.charges, (D, y) => (c(), M(K, {
1760
- key: `charge-${y}`,
1761
- modelValue: e.value.platform.mappings.charges[y],
1762
- "onUpdate:modelValue": (U) => e.value.platform.mappings.charges[y] = U,
1759
+ (c(!0), F(L, null, H((z = (j = (R = e.value) == null ? void 0 : R.platform) == null ? void 0 : j.mappings) == null ? void 0 : z.charges, (D, g) => (c(), M(K, {
1760
+ key: `charge-${g}`,
1761
+ modelValue: e.value.platform.mappings.charges[g],
1762
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.charges[g] = U,
1763
1763
  options: {
1764
1764
  key: { placeholder: "Key", editable: !1 },
1765
1765
  account: { placeholder: "Account code", editable: !0 }
@@ -1767,119 +1767,119 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1767
1767
  }, null, 8, ["modelValue", "onUpdate:modelValue"]))), 128))
1768
1768
  ])
1769
1769
  ]),
1770
- i(De, {
1770
+ r(De, {
1771
1771
  modelValue: e.value.platform,
1772
1772
  "onUpdate:modelValue": a[10] || (a[10] = (D) => e.value.platform = D),
1773
- label: v(o)("report.input.email")
1773
+ label: p(o)("report.input.email")
1774
1774
  }, null, 8, ["modelValue", "label"]),
1775
- t("div", ra, [
1776
- t("div", ma, T(v(o)("report.integration.items")), 1),
1777
- i(s, {
1775
+ t("div", ma, [
1776
+ t("div", ca, T(p(o)("report.integration.items")), 1),
1777
+ r(i, {
1778
1778
  variant: "primary",
1779
1779
  icon: "add",
1780
- onClick: a[11] || (a[11] = () => u("items"))
1780
+ onClick: a[11] || (a[11] = () => d("items"))
1781
1781
  })
1782
1782
  ]),
1783
- t("div", ca, [
1784
- (c(!0), C(L, null, H((ee = (Z = (W = e.value) == null ? void 0 : W.platform) == null ? void 0 : Z.mappings) == null ? void 0 : ee.items, (D, y) => (c(), M(K, {
1785
- key: `item-${y}`,
1786
- modelValue: e.value.platform.mappings.items[y],
1787
- "onUpdate:modelValue": (U) => e.value.platform.mappings.items[y] = U,
1783
+ t("div", da, [
1784
+ (c(!0), F(L, null, H((ee = (Z = (W = e.value) == null ? void 0 : W.platform) == null ? void 0 : Z.mappings) == null ? void 0 : ee.items, (D, g) => (c(), M(K, {
1785
+ key: `item-${g}`,
1786
+ modelValue: e.value.platform.mappings.items[g],
1787
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.items[g] = U,
1788
1788
  options: {
1789
1789
  key: { placeholder: "Key", editable: !0 },
1790
1790
  account: { placeholder: "Account code", editable: !0 }
1791
1791
  },
1792
1792
  removable: !0,
1793
- onRemove: () => b("items", y)
1793
+ onRemove: () => k("items", g)
1794
1794
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
1795
1795
  ]),
1796
- t("div", da, [
1797
- t("div", pa, T(v(o)("report.integration.taxes")), 1),
1798
- i(s, {
1796
+ t("div", pa, [
1797
+ t("div", ua, T(p(o)("report.integration.taxes")), 1),
1798
+ r(i, {
1799
1799
  variant: "primary",
1800
1800
  icon: "add",
1801
- onClick: a[12] || (a[12] = () => u("taxes"))
1801
+ onClick: a[12] || (a[12] = () => d("taxes"))
1802
1802
  })
1803
1803
  ]),
1804
- t("div", ua, [
1805
- (c(!0), C(L, null, H((ae = (oe = (te = e.value) == null ? void 0 : te.platform) == null ? void 0 : oe.mappings) == null ? void 0 : ae.taxes, (D, y) => (c(), M(K, {
1806
- key: `tax-${y}`,
1807
- modelValue: e.value.platform.mappings.taxes[y],
1808
- "onUpdate:modelValue": (U) => e.value.platform.mappings.taxes[y] = U,
1804
+ t("div", fa, [
1805
+ (c(!0), F(L, null, H((ae = (oe = (te = e.value) == null ? void 0 : te.platform) == null ? void 0 : oe.mappings) == null ? void 0 : ae.taxes, (D, g) => (c(), M(K, {
1806
+ key: `tax-${g}`,
1807
+ modelValue: e.value.platform.mappings.taxes[g],
1808
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.taxes[g] = U,
1809
1809
  options: {
1810
1810
  key: { placeholder: "Key", editable: !0 },
1811
1811
  account: { placeholder: "Account code", editable: !0 }
1812
1812
  },
1813
1813
  removable: !0,
1814
- onRemove: () => b("taxes", y)
1814
+ onRemove: () => k("taxes", g)
1815
1815
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
1816
1816
  ]),
1817
- t("div", fa, [
1818
- t("div", va, T(v(o)("report.integration.payments")), 1),
1819
- i(s, {
1817
+ t("div", va, [
1818
+ t("div", ga, T(p(o)("report.integration.payments")), 1),
1819
+ r(i, {
1820
1820
  variant: "primary",
1821
1821
  icon: "add",
1822
- onClick: a[13] || (a[13] = () => u("payments"))
1822
+ onClick: a[13] || (a[13] = () => d("payments"))
1823
1823
  })
1824
1824
  ]),
1825
- t("div", ga, [
1826
- (c(!0), C(L, null, H((se = (ne = (le = e.value) == null ? void 0 : le.platform) == null ? void 0 : ne.mappings) == null ? void 0 : se.payments, (D, y) => (c(), M(K, {
1827
- key: `payment-${y}`,
1828
- modelValue: e.value.platform.mappings.payments[y],
1829
- "onUpdate:modelValue": (U) => e.value.platform.mappings.payments[y] = U,
1825
+ t("div", ya, [
1826
+ (c(!0), F(L, null, H((se = (ne = (le = e.value) == null ? void 0 : le.platform) == null ? void 0 : ne.mappings) == null ? void 0 : se.payments, (D, g) => (c(), M(K, {
1827
+ key: `payment-${g}`,
1828
+ modelValue: e.value.platform.mappings.payments[g],
1829
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.payments[g] = U,
1830
1830
  options: {
1831
1831
  key: { placeholder: "Key", editable: !0 },
1832
1832
  account: { placeholder: "Payment name", editable: !0 }
1833
1833
  },
1834
1834
  removable: !0,
1835
- onRemove: () => b("payments", y)
1835
+ onRemove: () => k("payments", g)
1836
1836
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
1837
1837
  ])
1838
1838
  ])
1839
1839
  ])) : N("", !0);
1840
1840
  };
1841
1841
  }
1842
- }), xa = { class: "h-full flex flex-col gap-16" }, _a = { class: "flex flex-row gap-2 justify-between items-center" }, ba = {
1842
+ }), _a = { class: "h-full flex flex-col gap-16" }, ba = { class: "flex flex-row gap-2 justify-between items-center" }, wa = {
1843
1843
  key: 0,
1844
1844
  class: "flex gap-24 w-full h-full justify-center items-center overflow-scroll"
1845
- }, wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ha = /* @__PURE__ */ q({
1845
+ }, ha = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Va = /* @__PURE__ */ q({
1846
1846
  __name: "Preview",
1847
1847
  props: {
1848
1848
  modelValue: { required: !0 },
1849
1849
  modelModifiers: {}
1850
1850
  },
1851
1851
  emits: ["update:modelValue"],
1852
- setup(g) {
1853
- const { t: o } = J(), e = B([]), n = Y(
1854
- () => e.value.reduce((d, V) => {
1855
- const b = d.length, { invoice: u, payments: p } = V;
1856
- d[b] = {
1857
- date: u.DocDate,
1858
- docNo: u.DocNo,
1859
- projNo: u.ProjNo,
1860
- debtor: u.DebtorCode,
1861
- description: u.Description
1852
+ setup(f) {
1853
+ const { t: o } = J(), e = B([]), s = Y(
1854
+ () => e.value.reduce((m, w) => {
1855
+ const k = m.length, { invoice: d, payments: y } = w;
1856
+ m[k] = {
1857
+ date: d.DocDate,
1858
+ docNo: d.DocNo,
1859
+ projNo: d.ProjNo,
1860
+ debtor: d.DebtorCode,
1861
+ description: d.Description
1862
1862
  };
1863
- for (let r = 0; r < Math.max(u._items.length, p.length); r++) {
1864
- const x = b + r;
1865
- d[x] || (d[x] = {}), u._items[r] && (d[x] = {
1866
- ...d[x],
1867
- itemDescription: u._items[r].DetailDescription,
1868
- itemUnitPrice: u._items[r].Amount,
1869
- itemAccount: u._items[r].AccNo,
1870
- itemTaxCode: u._items[r].TaxType,
1871
- itemTax: u._items[r].Tax
1872
- }), p[r] && (d[x] = {
1873
- ...d[x],
1874
- paymentDocNo: p[r].DocNo,
1875
- paymentMethod: p[r].paymentMethod,
1876
- paymentDescription: p[r].Description,
1877
- paymentAmount: p[r].PaymentAmt
1863
+ for (let n = 0; n < Math.max(d._items.length, y.length); n++) {
1864
+ const v = k + n;
1865
+ m[v] || (m[v] = {}), d._items[n] && (m[v] = {
1866
+ ...m[v],
1867
+ itemDescription: d._items[n].DetailDescription,
1868
+ itemUnitPrice: d._items[n].Amount,
1869
+ itemAccount: d._items[n].AccNo,
1870
+ itemTaxCode: d._items[n].TaxType,
1871
+ itemTax: d._items[n].Tax
1872
+ }), y[n] && (m[v] = {
1873
+ ...m[v],
1874
+ paymentDocNo: y[n].DocNo,
1875
+ paymentMethod: y[n].paymentMethod,
1876
+ paymentDescription: y[n].Description,
1877
+ paymentAmount: y[n].PaymentAmt
1878
1878
  });
1879
1879
  }
1880
- return d;
1880
+ return m;
1881
1881
  }, [])
1882
- ), k = [
1882
+ ), V = [
1883
1883
  {
1884
1884
  accessorKey: "date",
1885
1885
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Date"),
@@ -1950,15 +1950,15 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1950
1950
  header: "Payment Amount",
1951
1951
  enableSorting: !1
1952
1952
  }
1953
- ], w = X(g, "modelValue"), _ = B(!1), F = ue(), { dateRange: h } = Ce(pe());
1953
+ ], h = X(f, "modelValue"), _ = B(!1), C = ue(), { dateRange: b } = Ce(pe());
1954
1954
  ve(
1955
- () => h.value,
1955
+ () => b.value,
1956
1956
  async () => {
1957
- if (w.value._id)
1957
+ if (h.value._id)
1958
1958
  try {
1959
- _.value = !0, e.value = await $e(w.value._id);
1960
- } catch (d) {
1961
- F.open({ message: d.message, type: "error" });
1959
+ _.value = !0, e.value = await $e(h.value._id);
1960
+ } catch (m) {
1961
+ C.open({ message: m.message, type: "error" });
1962
1962
  } finally {
1963
1963
  _.value = !1;
1964
1964
  }
@@ -1967,52 +1967,52 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
1967
1967
  immediate: !0
1968
1968
  }
1969
1969
  );
1970
- async function m() {
1970
+ async function x() {
1971
1971
  try {
1972
- w.value._id ? (_.value = !0, await Pe(w.value._id)) : F.open({ message: "Invalid accounting setting", type: "error" });
1973
- } catch (d) {
1974
- F.open({ message: d.message, type: "error" });
1972
+ h.value._id ? (_.value = !0, await Pe(h.value._id)) : C.open({ message: "Invalid accounting setting", type: "error" });
1973
+ } catch (m) {
1974
+ C.open({ message: m.message, type: "error" });
1975
1975
  } finally {
1976
1976
  _.value = !1;
1977
1977
  }
1978
1978
  }
1979
- return (d, V) => {
1980
- const b = S("FmButton"), u = S("FmCircularProgress"), p = S("FmTable");
1981
- return c(), C("div", xa, [
1982
- t("div", _a, [
1983
- i(Fe, {
1984
- "date-range": v(h),
1985
- "onUpdate:dateRange": V[0] || (V[0] = (r) => be(h) ? h.value = r : null),
1979
+ return (m, w) => {
1980
+ const k = S("FmButton"), d = S("FmCircularProgress"), y = S("FmTable");
1981
+ return c(), F("div", _a, [
1982
+ t("div", ba, [
1983
+ r(Fe, {
1984
+ "date-range": p(b),
1985
+ "onUpdate:dateRange": w[0] || (w[0] = (n) => be(b) ? b.value = n : null),
1986
1986
  compare: !1
1987
1987
  }, null, 8, ["date-range"]),
1988
- i(b, {
1988
+ r(k, {
1989
1989
  loading: _.value,
1990
1990
  variant: "primary",
1991
- label: v(o)("report.common.download"),
1992
- onClick: m
1991
+ label: p(o)("report.common.download"),
1992
+ onClick: x
1993
1993
  }, null, 8, ["loading", "label"])
1994
1994
  ]),
1995
- _.value ? (c(), C("div", ba, [
1996
- i(u, { size: "xl" }),
1997
- t("span", wa, T(v(o)("report.common.isLoading")), 1)
1998
- ])) : n.value.length > 0 ? (c(), M(p, {
1995
+ _.value ? (c(), F("div", wa, [
1996
+ r(d, { size: "xl" }),
1997
+ t("span", ha, T(p(o)("report.common.isLoading")), 1)
1998
+ ])) : s.value.length > 0 ? (c(), M(y, {
1999
1999
  key: 1,
2000
2000
  class: "flex overflow-scroll",
2001
- "row-data": n.value,
2002
- "column-defs": k
2001
+ "row-data": s.value,
2002
+ "column-defs": V
2003
2003
  }, null, 8, ["row-data"])) : N("", !0)
2004
2004
  ]);
2005
2005
  };
2006
2006
  }
2007
- }), Va = { class: "h-full relative flex flex-col" }, ka = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, $a = /* @__PURE__ */ q({
2007
+ }), ka = { class: "h-full relative flex flex-col" }, $a = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, Sa = /* @__PURE__ */ q({
2008
2008
  __name: "AutoCount",
2009
2009
  props: {
2010
2010
  modelValue: {},
2011
2011
  modelModifiers: {}
2012
2012
  },
2013
2013
  emits: ["update:modelValue"],
2014
- setup(g) {
2015
- const { t: o } = J(), e = X(g, "modelValue"), n = B("setting"), k = [
2014
+ setup(f) {
2015
+ const { t: o } = J(), e = X(f, "modelValue"), s = B("setting"), V = [
2016
2016
  {
2017
2017
  label: o("report.integration.setting"),
2018
2018
  value: "setting",
@@ -2023,89 +2023,89 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2023
2023
  value: "preview",
2024
2024
  icon: "table"
2025
2025
  }
2026
- ], w = de(), _ = Y(() => {
2027
- switch (n.value) {
2026
+ ], h = de(), _ = Y(() => {
2027
+ switch (s.value) {
2028
2028
  case "preview":
2029
- return ha;
2029
+ return Va;
2030
2030
  case "setting":
2031
- return ya;
2031
+ return xa;
2032
2032
  default:
2033
2033
  return null;
2034
2034
  }
2035
2035
  });
2036
- return (F, h) => {
2037
- var V;
2038
- const m = S("FmPageHead"), d = S("FmTabs");
2039
- return c(), C("div", Va, [
2040
- i(m, {
2041
- title: ((V = e.value) == null ? void 0 : V.name) || "AutoCount",
2036
+ return (C, b) => {
2037
+ var w;
2038
+ const x = S("FmPageHead"), m = S("FmTabs");
2039
+ return c(), F("div", ka, [
2040
+ r(x, {
2041
+ title: ((w = e.value) == null ? void 0 : w.name) || "AutoCount",
2042
2042
  "back-button": !0,
2043
2043
  style: { paddingLeft: "0px", paddingRight: "0px" },
2044
- "onClick:back": v(w).back
2044
+ "onClick:back": p(h).back
2045
2045
  }, {
2046
- description: ge(() => h[2] || (h[2] = [
2046
+ description: ge(() => b[2] || (b[2] = [
2047
2047
  t("div", null, null, -1)
2048
2048
  ])),
2049
2049
  _: 1
2050
2050
  }, 8, ["title", "onClick:back"]),
2051
- i(d, {
2052
- "model-value": n.value,
2053
- "onUpdate:modelValue": h[0] || (h[0] = (b) => n.value = b),
2054
- items: k
2051
+ r(m, {
2052
+ "model-value": s.value,
2053
+ "onUpdate:modelValue": b[0] || (b[0] = (k) => s.value = k),
2054
+ items: V
2055
2055
  }, null, 8, ["model-value"]),
2056
- t("div", ka, [
2056
+ t("div", $a, [
2057
2057
  (c(), M(xe(_.value), {
2058
2058
  modelValue: e.value,
2059
- "onUpdate:modelValue": h[1] || (h[1] = (b) => e.value = b)
2059
+ "onUpdate:modelValue": b[1] || (b[1] = (k) => e.value = k)
2060
2060
  }, null, 8, ["modelValue"]))
2061
2061
  ])
2062
2062
  ]);
2063
2063
  };
2064
2064
  }
2065
- }), Sa = {
2065
+ }), Ca = {
2066
2066
  key: 0,
2067
2067
  class: "flex flex-col h-full"
2068
- }, Ca = { class: "flex flex-col gap-16 pb-[24px]" }, Fa = { class: "flex flex-row justify-between items-center gap-2" }, Da = { class: "flex flex-row gap-2 items-center" }, Ua = { class: "relative group cursor-pointer" }, Ta = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, Ia = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, Ma = { class: "flex flex-col gap-16" }, Ka = { class: "fm-typo-en-title-sm-800" }, Aa = { class: "flex flex-row items-center max-w-[100%]" }, Pa = { class: "w-[25%]" }, Na = { class: "flex-grow" }, Ra = { class: "flex flex-row items-center max-w-[100%]" }, Oa = { class: "w-[25%]" }, Ba = { class: "flex flex-row items-center max-w-[100%]" }, ja = { class: "w-[25%]" }, La = { class: "flex flex-col gap-16" }, Ea = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, za = { class: "grid-cols-1 grid gap-16" }, Ya = { class: "flex flex-row items-center gap-x-16" }, qa = { class: "fm-typo-en-title-sm-800" }, Ha = { class: "grid-cols-1 grid gap-16" }, Xa = { class: "flex flex-row items-center gap-x-16" }, Qa = { class: "fm-typo-en-title-sm-800" }, Ga = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Ja = { class: "flex flex-row items-center gap-x-16" }, Wa = { class: "fm-typo-en-title-sm-800" }, Za = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, el = /* @__PURE__ */ q({
2068
+ }, Fa = { class: "flex flex-col gap-16 pb-[24px]" }, Da = { class: "flex flex-row justify-between items-center gap-2" }, Ua = { class: "flex flex-row gap-2 items-center" }, Ta = { class: "relative group cursor-pointer" }, Ia = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, Ma = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, Ka = { class: "flex flex-col gap-16" }, Aa = { class: "fm-typo-en-title-sm-800" }, Pa = { class: "flex flex-row items-center max-w-[100%]" }, Na = { class: "w-[25%]" }, Ra = { class: "flex-grow" }, Oa = { class: "flex flex-row items-center max-w-[100%]" }, Ba = { class: "w-[25%]" }, ja = { class: "flex flex-row items-center max-w-[100%]" }, La = { class: "w-[25%]" }, Ea = { class: "flex flex-col gap-16" }, za = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Ya = { class: "grid-cols-1 grid gap-16" }, qa = { class: "flex flex-row items-center gap-x-16" }, Ha = { class: "fm-typo-en-title-sm-800" }, Xa = { class: "grid-cols-1 grid gap-16" }, Qa = { class: "flex flex-row items-center gap-x-16" }, Ga = { class: "fm-typo-en-title-sm-800" }, Ja = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Wa = { class: "flex flex-row items-center gap-x-16" }, Za = { class: "fm-typo-en-title-sm-800" }, el = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, tl = /* @__PURE__ */ q({
2069
2069
  __name: "Setting",
2070
2070
  props: {
2071
2071
  modelValue: { required: !0 },
2072
2072
  modelModifiers: {}
2073
2073
  },
2074
2074
  emits: ["update:modelValue"],
2075
- setup(g) {
2076
- const { t: o } = J(), e = X(g, "modelValue"), n = ue(), k = _e(), w = de(), { promptLoader: _ } = we(), { promptMessage: F } = Se(), { restaurants: h } = pe(), m = Y(
2077
- () => h.map((l) => ({ label: l.name, value: l.id }))
2075
+ setup(f) {
2076
+ const { t: o } = J(), e = X(f, "modelValue"), s = ue(), V = _e(), h = de(), { promptLoader: _ } = we(), { promptMessage: C } = Se(), { restaurants: b } = pe(), x = Y(
2077
+ () => b.map((l) => ({ label: l.name, value: l.id }))
2078
2078
  );
2079
- async function d() {
2080
- await F({
2079
+ async function m() {
2080
+ await C({
2081
2081
  message: o("report.messages.confirmDelete", { name: e.value.name }),
2082
2082
  title: o("report.common.delete")
2083
2083
  }) && await _(async () => {
2084
2084
  try {
2085
- await he(e.value._id), await k.getSettings(), w.back();
2085
+ await he(e.value._id), await V.getSettings(), h.back();
2086
2086
  } catch (a) {
2087
- n.open({ type: "error", message: a.message });
2087
+ s.open({ type: "error", message: a.message });
2088
2088
  }
2089
2089
  });
2090
2090
  }
2091
- async function V() {
2091
+ async function w() {
2092
2092
  await _(async () => {
2093
2093
  try {
2094
- await Ve(e.value._id, e.value), await k.getSettings();
2094
+ await Ve(e.value._id, e.value), await V.getSettings();
2095
2095
  } catch (l) {
2096
- n.open({ type: "error", message: l.message });
2096
+ s.open({ type: "error", message: l.message });
2097
2097
  }
2098
2098
  });
2099
2099
  }
2100
- function b(l, a) {
2101
- var f, s;
2102
- (s = (f = e.value.platform) == null ? void 0 : f.mappings) != null && s[l] && (e.value.platform.mappings[l] = e.value.platform.mappings[l].filter(
2100
+ function k(l, a) {
2101
+ var u, i;
2102
+ (i = (u = e.value.platform) == null ? void 0 : u.mappings) != null && i[l] && (e.value.platform.mappings[l] = e.value.platform.mappings[l].filter(
2103
2103
  (A, P) => P !== a
2104
2104
  ));
2105
2105
  }
2106
- function u(l) {
2107
- var a, f;
2108
- (f = (a = e.value.platform) == null ? void 0 : a.mappings) != null && f[l] && (e.value.platform.mappings[l] = [
2106
+ function d(l) {
2107
+ var a, u;
2108
+ (u = (a = e.value.platform) == null ? void 0 : a.mappings) != null && u[l] && (e.value.platform.mappings[l] = [
2109
2109
  ...e.value.platform.mappings[l],
2110
2110
  l === "items" ? {
2111
2111
  key: "",
@@ -2118,7 +2118,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2118
2118
  }
2119
2119
  ]);
2120
2120
  }
2121
- const p = [
2121
+ const y = [
2122
2122
  {
2123
2123
  label: "By day",
2124
2124
  value: fe.BY_DAY
@@ -2132,14 +2132,14 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2132
2132
  value: fe.BY_DAY_CATEGORY
2133
2133
  }
2134
2134
  ];
2135
- function r({
2135
+ function n({
2136
2136
  key: l,
2137
2137
  value: a
2138
2138
  }) {
2139
- var f, s;
2140
- (s = (f = e.value) == null ? void 0 : f.platform) != null && s.mappings && (e.value.platform.mappings[l] = a);
2139
+ var u, i;
2140
+ (i = (u = e.value) == null ? void 0 : u.platform) != null && i.mappings && (e.value.platform.mappings[l] = a);
2141
2141
  }
2142
- function x(l) {
2142
+ function v(l) {
2143
2143
  return {
2144
2144
  key: { placeholder: l, editable: !1 },
2145
2145
  account: { placeholder: l, editable: !0 }
@@ -2148,136 +2148,136 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2148
2148
  async function $() {
2149
2149
  await _(async () => {
2150
2150
  try {
2151
- await ke(e.value._id), await k.getSettings();
2151
+ await ke(e.value._id), await V.getSettings();
2152
2152
  } catch (l) {
2153
- n.open({ type: "error", message: l.message });
2153
+ s.open({ type: "error", message: l.message });
2154
2154
  }
2155
2155
  });
2156
2156
  }
2157
2157
  return (l, a) => {
2158
2158
  var E, G, R, j, z, W, Z, ee, te, oe, ae, le, ne, se;
2159
- const f = S("FmIcon"), s = S("FmButton"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmSelect");
2160
- return (G = (E = e.value) == null ? void 0 : E.platform) != null && G.mappings ? (c(), C("div", Sa, [
2161
- t("div", Ca, [
2162
- t("div", Fa, [
2159
+ const u = S("FmIcon"), i = S("FmButton"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmSelect");
2160
+ return (G = (E = e.value) == null ? void 0 : E.platform) != null && G.mappings ? (c(), F("div", Ca, [
2161
+ t("div", Fa, [
2162
+ t("div", Da, [
2163
2163
  a[15] || (a[15] = t("div", { class: "fm-typo-en-title-sm-800" }, null, -1)),
2164
- t("div", Da, [
2165
- t("div", Ua, [
2166
- i(f, {
2164
+ t("div", Ua, [
2165
+ t("div", Ta, [
2166
+ r(u, {
2167
2167
  name: "refresh",
2168
2168
  class: "p-2 bg-gray-100 rounded-full",
2169
2169
  onClick: $
2170
2170
  }),
2171
- t("span", Ta, T(v(o)("report.integration.refreshSetting")), 1)
2171
+ t("span", Ia, T(p(o)("report.integration.refreshSetting")), 1)
2172
2172
  ]),
2173
- i(s, {
2173
+ r(i, {
2174
2174
  variant: "tertiary",
2175
- label: v(o)("report.common.delete"),
2176
- onClick: d
2175
+ label: p(o)("report.common.delete"),
2176
+ onClick: m
2177
2177
  }, null, 8, ["label"]),
2178
- i(s, {
2178
+ r(i, {
2179
2179
  variant: "primary",
2180
- label: v(o)("report.common.update"),
2181
- onClick: V
2180
+ label: p(o)("report.common.update"),
2181
+ onClick: w
2182
2182
  }, null, 8, ["label"])
2183
2183
  ])
2184
2184
  ])
2185
2185
  ]),
2186
- i(A, { style: { margin: 0 } }),
2187
- t("div", Ia, [
2188
- t("div", Ma, [
2189
- t("div", Ka, T(v(o)("report.integration.general")), 1),
2190
- t("div", Aa, [
2191
- t("div", Pa, T(v(o)("report.common.name")), 1),
2192
- t("div", Na, [
2193
- i(P, {
2186
+ r(A, { style: { margin: 0 } }),
2187
+ t("div", Ma, [
2188
+ t("div", Ka, [
2189
+ t("div", Aa, T(p(o)("report.integration.general")), 1),
2190
+ t("div", Pa, [
2191
+ t("div", Na, T(p(o)("report.common.name")), 1),
2192
+ t("div", Ra, [
2193
+ r(P, {
2194
2194
  modelValue: e.value.name,
2195
2195
  "onUpdate:modelValue": a[0] || (a[0] = (D) => e.value.name = D)
2196
2196
  }, null, 8, ["modelValue"])
2197
2197
  ])
2198
2198
  ]),
2199
- t("div", Ra, [
2200
- t("div", Oa, T(v(o)("report.integration.location")), 1),
2201
- i(Q, {
2199
+ t("div", Oa, [
2200
+ t("div", Ba, T(p(o)("report.integration.location")), 1),
2201
+ r(Q, {
2202
2202
  modelValue: e.value.platform.locationIds,
2203
2203
  "onUpdate:modelValue": a[1] || (a[1] = (D) => e.value.platform.locationIds = D),
2204
2204
  multiselect: !0,
2205
- items: m.value,
2205
+ items: x.value,
2206
2206
  placeholder: "Select location",
2207
2207
  class: "flex-grow",
2208
2208
  rules: [(D) => D.length !== 0 || "Please select at least 1 location"]
2209
2209
  }, null, 8, ["modelValue", "items", "rules"])
2210
2210
  ]),
2211
- t("div", Ba, [
2212
- t("div", ja, T(v(o)("report.integration.grouping.title")), 1),
2213
- i(Q, {
2211
+ t("div", ja, [
2212
+ t("div", La, T(p(o)("report.integration.grouping.title")), 1),
2213
+ r(Q, {
2214
2214
  modelValue: e.value.platform.grouping,
2215
2215
  "onUpdate:modelValue": a[2] || (a[2] = (D) => e.value.platform.grouping = D),
2216
2216
  multiselect: !1,
2217
- items: p,
2217
+ items: y,
2218
2218
  placeholder: "Select grouping",
2219
2219
  class: "flex-grow"
2220
2220
  }, null, 8, ["modelValue"])
2221
2221
  ])
2222
2222
  ]),
2223
- t("div", La, [
2224
- t("div", Ea, [
2225
- i(K, {
2223
+ t("div", Ea, [
2224
+ t("div", za, [
2225
+ r(K, {
2226
2226
  "model-value": { key: "Debtor", account: e.value.platform.mappings.debtor },
2227
- options: x("Debtor"),
2228
- "onUpdate:modelValue": a[3] || (a[3] = (D) => r({ key: "debtor", value: D.account }))
2227
+ options: v("Debtor"),
2228
+ "onUpdate:modelValue": a[3] || (a[3] = (D) => n({ key: "debtor", value: D.account }))
2229
2229
  }, null, 8, ["model-value", "options"]),
2230
- i(K, {
2230
+ r(K, {
2231
2231
  "model-value": {
2232
2232
  key: "Invoice no",
2233
2233
  account: e.value.platform.mappings.invoiceDocNo
2234
2234
  },
2235
- options: x("Invoice no"),
2236
- "onUpdate:modelValue": a[4] || (a[4] = (D) => r({ key: "invoiceDocNo", value: D.account }))
2235
+ options: v("Invoice no"),
2236
+ "onUpdate:modelValue": a[4] || (a[4] = (D) => n({ key: "invoiceDocNo", value: D.account }))
2237
2237
  }, null, 8, ["model-value", "options"]),
2238
- i(K, {
2238
+ r(K, {
2239
2239
  "model-value": {
2240
2240
  key: "Credit note no",
2241
2241
  account: e.value.platform.mappings.creditNoteDocNo
2242
2242
  },
2243
- options: x("Credit note no"),
2244
- "onUpdate:modelValue": a[5] || (a[5] = (D) => r({ key: "creditNoteDocNo", value: D.account }))
2243
+ options: v("Credit note no"),
2244
+ "onUpdate:modelValue": a[5] || (a[5] = (D) => n({ key: "creditNoteDocNo", value: D.account }))
2245
2245
  }, null, 8, ["model-value", "options"]),
2246
- i(K, {
2246
+ r(K, {
2247
2247
  "model-value": {
2248
2248
  key: "Payment no",
2249
2249
  account: e.value.platform.mappings.paymentDocNo
2250
2250
  },
2251
- options: x("Payment no"),
2252
- "onUpdate:modelValue": a[6] || (a[6] = (D) => r({ key: "paymentDocNo", value: D.account }))
2251
+ options: v("Payment no"),
2252
+ "onUpdate:modelValue": a[6] || (a[6] = (D) => n({ key: "paymentDocNo", value: D.account }))
2253
2253
  }, null, 8, ["model-value", "options"]),
2254
- i(K, {
2254
+ r(K, {
2255
2255
  "model-value": {
2256
2256
  key: "Refund no",
2257
2257
  account: e.value.platform.mappings.refundDocNo
2258
2258
  },
2259
- options: x("Refund no"),
2260
- "onUpdate:modelValue": a[7] || (a[7] = (D) => r({ key: "refundDocNo", value: D.account }))
2259
+ options: v("Refund no"),
2260
+ "onUpdate:modelValue": a[7] || (a[7] = (D) => n({ key: "refundDocNo", value: D.account }))
2261
2261
  }, null, 8, ["model-value", "options"]),
2262
- i(K, {
2262
+ r(K, {
2263
2263
  "model-value": {
2264
2264
  key: "Project header",
2265
2265
  account: e.value.platform.mappings.projectHeader
2266
2266
  },
2267
- options: x("Project header"),
2268
- "onUpdate:modelValue": a[8] || (a[8] = (D) => r({ key: "projectHeader", value: D.account }))
2267
+ options: v("Project header"),
2268
+ "onUpdate:modelValue": a[8] || (a[8] = (D) => n({ key: "projectHeader", value: D.account }))
2269
2269
  }, null, 8, ["model-value", "options"]),
2270
- i(K, {
2270
+ r(K, {
2271
2271
  "model-value": {
2272
2272
  key: "Project detail",
2273
2273
  account: e.value.platform.mappings.projectDetail
2274
2274
  },
2275
- options: x("Project detail"),
2276
- "onUpdate:modelValue": a[9] || (a[9] = (D) => r({ key: "projectDetail", value: D.account }))
2275
+ options: v("Project detail"),
2276
+ "onUpdate:modelValue": a[9] || (a[9] = (D) => n({ key: "projectDetail", value: D.account }))
2277
2277
  }, null, 8, ["model-value", "options"])
2278
2278
  ]),
2279
- t("div", za, [
2280
- i(K, {
2279
+ t("div", Ya, [
2280
+ r(K, {
2281
2281
  "model-value": {
2282
2282
  key: "Rounding",
2283
2283
  account: e.value.platform.mappings.rounding.account,
@@ -2289,14 +2289,14 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2289
2289
  code: { placeholder: "Item code", editable: !0 }
2290
2290
  },
2291
2291
  "onUpdate:modelValue": a[10] || (a[10] = (D) => {
2292
- var y, U, O;
2293
- (O = (U = (y = e.value) == null ? void 0 : y.platform) == null ? void 0 : U.mappings) != null && O.rounding && (e.value.platform.mappings.rounding.account = D.account, e.value.platform.mappings.rounding.code = D.code);
2292
+ var g, U, O;
2293
+ (O = (U = (g = e.value) == null ? void 0 : g.platform) == null ? void 0 : U.mappings) != null && O.rounding && (e.value.platform.mappings.rounding.account = D.account, e.value.platform.mappings.rounding.code = D.code);
2294
2294
  })
2295
2295
  }, null, 8, ["model-value"]),
2296
- (c(!0), C(L, null, H((z = (j = (R = e.value) == null ? void 0 : R.platform) == null ? void 0 : j.mappings) == null ? void 0 : z.charges, (D, y) => (c(), M(K, {
2297
- key: `charge-${y}`,
2298
- modelValue: e.value.platform.mappings.charges[y],
2299
- "onUpdate:modelValue": (U) => e.value.platform.mappings.charges[y] = U,
2296
+ (c(!0), F(L, null, H((z = (j = (R = e.value) == null ? void 0 : R.platform) == null ? void 0 : j.mappings) == null ? void 0 : z.charges, (D, g) => (c(), M(K, {
2297
+ key: `charge-${g}`,
2298
+ modelValue: e.value.platform.mappings.charges[g],
2299
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.charges[g] = U,
2300
2300
  options: {
2301
2301
  key: { placeholder: "Key", editable: !1 },
2302
2302
  account: { placeholder: "Account code", editable: !0 },
@@ -2305,120 +2305,120 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2305
2305
  }, null, 8, ["modelValue", "onUpdate:modelValue"]))), 128))
2306
2306
  ])
2307
2307
  ]),
2308
- i(De, {
2308
+ r(De, {
2309
2309
  modelValue: e.value.platform,
2310
2310
  "onUpdate:modelValue": a[11] || (a[11] = (D) => e.value.platform = D),
2311
2311
  label: "email"
2312
2312
  }, null, 8, ["modelValue"]),
2313
- t("div", Ya, [
2314
- t("div", qa, T(v(o)("report.integration.items")), 1),
2315
- i(s, {
2313
+ t("div", qa, [
2314
+ t("div", Ha, T(p(o)("report.integration.items")), 1),
2315
+ r(i, {
2316
2316
  variant: "primary",
2317
2317
  icon: "add",
2318
- onClick: a[12] || (a[12] = () => u("items"))
2318
+ onClick: a[12] || (a[12] = () => d("items"))
2319
2319
  })
2320
2320
  ]),
2321
- t("div", Ha, [
2322
- (c(!0), C(L, null, H((ee = (Z = (W = e.value) == null ? void 0 : W.platform) == null ? void 0 : Z.mappings) == null ? void 0 : ee.items, (D, y) => (c(), M(K, {
2323
- key: `item-${y}`,
2324
- modelValue: e.value.platform.mappings.items[y],
2325
- "onUpdate:modelValue": (U) => e.value.platform.mappings.items[y] = U,
2321
+ t("div", Xa, [
2322
+ (c(!0), F(L, null, H((ee = (Z = (W = e.value) == null ? void 0 : W.platform) == null ? void 0 : Z.mappings) == null ? void 0 : ee.items, (D, g) => (c(), M(K, {
2323
+ key: `item-${g}`,
2324
+ modelValue: e.value.platform.mappings.items[g],
2325
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.items[g] = U,
2326
2326
  options: {
2327
2327
  key: { placeholder: "Key", editable: !0 },
2328
2328
  account: { placeholder: "Account code", editable: !0 },
2329
2329
  code: { placeholder: "Item code", editable: !0 }
2330
2330
  },
2331
2331
  removable: !0,
2332
- onRemove: () => b("items", y)
2332
+ onRemove: () => k("items", g)
2333
2333
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
2334
2334
  ]),
2335
- t("div", Xa, [
2336
- t("div", Qa, T(v(o)("report.integration.taxes")), 1),
2337
- i(s, {
2335
+ t("div", Qa, [
2336
+ t("div", Ga, T(p(o)("report.integration.taxes")), 1),
2337
+ r(i, {
2338
2338
  variant: "primary",
2339
2339
  icon: "add",
2340
- onClick: a[13] || (a[13] = () => u("taxes"))
2340
+ onClick: a[13] || (a[13] = () => d("taxes"))
2341
2341
  })
2342
2342
  ]),
2343
- t("div", Ga, [
2344
- (c(!0), C(L, null, H((ae = (oe = (te = e.value) == null ? void 0 : te.platform) == null ? void 0 : oe.mappings) == null ? void 0 : ae.taxes, (D, y) => (c(), M(K, {
2345
- key: `tax-${y}`,
2346
- modelValue: e.value.platform.mappings.taxes[y],
2347
- "onUpdate:modelValue": (U) => e.value.platform.mappings.taxes[y] = U,
2343
+ t("div", Ja, [
2344
+ (c(!0), F(L, null, H((ae = (oe = (te = e.value) == null ? void 0 : te.platform) == null ? void 0 : oe.mappings) == null ? void 0 : ae.taxes, (D, g) => (c(), M(K, {
2345
+ key: `tax-${g}`,
2346
+ modelValue: e.value.platform.mappings.taxes[g],
2347
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.taxes[g] = U,
2348
2348
  options: {
2349
2349
  key: { placeholder: "Key", editable: !0 },
2350
2350
  account: { placeholder: "Account code", editable: !0 }
2351
2351
  },
2352
2352
  removable: !0,
2353
- onRemove: () => b("taxes", y)
2353
+ onRemove: () => k("taxes", g)
2354
2354
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
2355
2355
  ]),
2356
- t("div", Ja, [
2357
- t("div", Wa, T(v(o)("report.integration.payments")), 1),
2358
- i(s, {
2356
+ t("div", Wa, [
2357
+ t("div", Za, T(p(o)("report.integration.payments")), 1),
2358
+ r(i, {
2359
2359
  variant: "primary",
2360
2360
  icon: "add",
2361
- onClick: a[14] || (a[14] = () => u("payments"))
2361
+ onClick: a[14] || (a[14] = () => d("payments"))
2362
2362
  })
2363
2363
  ]),
2364
- t("div", Za, [
2365
- (c(!0), C(L, null, H((se = (ne = (le = e.value) == null ? void 0 : le.platform) == null ? void 0 : ne.mappings) == null ? void 0 : se.payments, (D, y) => (c(), M(K, {
2366
- key: `payment-${y}`,
2367
- modelValue: e.value.platform.mappings.payments[y],
2368
- "onUpdate:modelValue": (U) => e.value.platform.mappings.payments[y] = U,
2364
+ t("div", el, [
2365
+ (c(!0), F(L, null, H((se = (ne = (le = e.value) == null ? void 0 : le.platform) == null ? void 0 : ne.mappings) == null ? void 0 : se.payments, (D, g) => (c(), M(K, {
2366
+ key: `payment-${g}`,
2367
+ modelValue: e.value.platform.mappings.payments[g],
2368
+ "onUpdate:modelValue": (U) => e.value.platform.mappings.payments[g] = U,
2369
2369
  options: {
2370
2370
  key: { placeholder: "Key", editable: !0 },
2371
2371
  account: { placeholder: "Method", editable: !0 }
2372
2372
  },
2373
2373
  removable: !0,
2374
- onRemove: () => b("payments", y)
2374
+ onRemove: () => k("payments", g)
2375
2375
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
2376
2376
  ])
2377
2377
  ])
2378
2378
  ])) : N("", !0);
2379
2379
  };
2380
2380
  }
2381
- }), tl = { class: "h-full flex flex-col gap-16" }, ol = { class: "flex flex-row gap-2 justify-between items-center" }, al = {
2381
+ }), ol = { class: "h-full flex flex-col gap-16" }, al = { class: "flex flex-row gap-2 justify-between items-center" }, ll = {
2382
2382
  key: 0,
2383
2383
  class: "flex gap-24 w-full h-full justify-center items-center overflow-scroll"
2384
- }, ll = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nl = /* @__PURE__ */ q({
2384
+ }, nl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, sl = /* @__PURE__ */ q({
2385
2385
  __name: "Preview",
2386
2386
  props: {
2387
2387
  modelValue: { required: !0 },
2388
2388
  modelModifiers: {}
2389
2389
  },
2390
2390
  emits: ["update:modelValue"],
2391
- setup(g) {
2392
- const { t: o } = J(), e = B([]), n = Y(
2393
- () => e.value.reduce((d, V) => {
2394
- const b = d.length, { invoice: u, payments: p } = V;
2395
- d[b] = {
2396
- date: u.DocDate,
2397
- docNo: u.DocNo,
2398
- debtor: u.Code,
2399
- description: u.Description_HDR
2391
+ setup(f) {
2392
+ const { t: o } = J(), e = B([]), s = Y(
2393
+ () => e.value.reduce((m, w) => {
2394
+ const k = m.length, { invoice: d, payments: y } = w;
2395
+ m[k] = {
2396
+ date: d.DocDate,
2397
+ docNo: d.DocNo,
2398
+ debtor: d.Code,
2399
+ description: d.Description_HDR
2400
2400
  };
2401
- for (let r = 0; r < Math.max(u._items.length, p.length); r++) {
2402
- const x = b + r;
2403
- d[x] || (d[x] = {}), u._items[r] && (d[x] = {
2404
- ...d[x],
2405
- itemDescription: u._items[r].Description_DTL,
2406
- itemUnitPrice: u._items[r].UnitPrice,
2407
- itemAccount: u._items[r].ACCOUNT,
2408
- itemTaxCode: u._items[r].Tax,
2409
- itemTax: u._items[r].TaxAmt
2410
- }), p[r] && (d[x] = {
2411
- ...d[x],
2412
- paymentDocNo: p[r].DOCNO_Header,
2413
- paymentMethod: p[r].PAYMENTMETHOD,
2414
- paymentAccount: p[r].CODE,
2415
- paymentDescription: p[r].DESCRIPTION,
2416
- paymentAmount: p[r].KOAMT
2401
+ for (let n = 0; n < Math.max(d._items.length, y.length); n++) {
2402
+ const v = k + n;
2403
+ m[v] || (m[v] = {}), d._items[n] && (m[v] = {
2404
+ ...m[v],
2405
+ itemDescription: d._items[n].Description_DTL,
2406
+ itemUnitPrice: d._items[n].UnitPrice,
2407
+ itemAccount: d._items[n].ACCOUNT,
2408
+ itemTaxCode: d._items[n].Tax,
2409
+ itemTax: d._items[n].TaxAmt
2410
+ }), y[n] && (m[v] = {
2411
+ ...m[v],
2412
+ paymentDocNo: y[n].DOCNO_Header,
2413
+ paymentMethod: y[n].PAYMENTMETHOD,
2414
+ paymentAccount: y[n].CODE,
2415
+ paymentDescription: y[n].DESCRIPTION,
2416
+ paymentAmount: y[n].KOAMT
2417
2417
  });
2418
2418
  }
2419
- return d;
2419
+ return m;
2420
2420
  }, [])
2421
- ), k = [
2421
+ ), V = [
2422
2422
  {
2423
2423
  accessorKey: "date",
2424
2424
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Date"),
@@ -2484,15 +2484,15 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2484
2484
  header: "Payment Amount",
2485
2485
  enableSorting: !1
2486
2486
  }
2487
- ], w = X(g, "modelValue"), _ = B(!1), F = ue(), { dateRange: h } = Ce(pe());
2487
+ ], h = X(f, "modelValue"), _ = B(!1), C = ue(), { dateRange: b } = Ce(pe());
2488
2488
  ve(
2489
- () => h.value,
2489
+ () => b.value,
2490
2490
  async () => {
2491
- if (w.value._id)
2491
+ if (h.value._id)
2492
2492
  try {
2493
- _.value = !0, e.value = await $e(w.value._id);
2494
- } catch (d) {
2495
- F.open({ message: d.message, type: "error" });
2493
+ _.value = !0, e.value = await $e(h.value._id);
2494
+ } catch (m) {
2495
+ C.open({ message: m.message, type: "error" });
2496
2496
  } finally {
2497
2497
  _.value = !1;
2498
2498
  }
@@ -2501,52 +2501,52 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2501
2501
  immediate: !0
2502
2502
  }
2503
2503
  );
2504
- async function m() {
2504
+ async function x() {
2505
2505
  try {
2506
- w.value._id ? (_.value = !0, await Pe(w.value._id)) : F.open({ message: "Invalid accounting setting", type: "error" });
2507
- } catch (d) {
2508
- F.open({ message: d.message, type: "error" });
2506
+ h.value._id ? (_.value = !0, await Pe(h.value._id)) : C.open({ message: "Invalid accounting setting", type: "error" });
2507
+ } catch (m) {
2508
+ C.open({ message: m.message, type: "error" });
2509
2509
  } finally {
2510
2510
  _.value = !1;
2511
2511
  }
2512
2512
  }
2513
- return (d, V) => {
2514
- const b = S("FmButton"), u = S("FmCircularProgress"), p = S("FmTable");
2515
- return c(), C("div", tl, [
2516
- t("div", ol, [
2517
- i(Fe, {
2518
- "date-range": v(h),
2519
- "onUpdate:dateRange": V[0] || (V[0] = (r) => be(h) ? h.value = r : null),
2513
+ return (m, w) => {
2514
+ const k = S("FmButton"), d = S("FmCircularProgress"), y = S("FmTable");
2515
+ return c(), F("div", ol, [
2516
+ t("div", al, [
2517
+ r(Fe, {
2518
+ "date-range": p(b),
2519
+ "onUpdate:dateRange": w[0] || (w[0] = (n) => be(b) ? b.value = n : null),
2520
2520
  compare: !1
2521
2521
  }, null, 8, ["date-range"]),
2522
- i(b, {
2522
+ r(k, {
2523
2523
  loading: _.value,
2524
2524
  variant: "primary",
2525
- label: v(o)("report.common.download"),
2526
- onClick: m
2525
+ label: p(o)("report.common.download"),
2526
+ onClick: x
2527
2527
  }, null, 8, ["loading", "label"])
2528
2528
  ]),
2529
- _.value ? (c(), C("div", al, [
2530
- i(u, { size: "xl" }),
2531
- t("span", ll, T(v(o)("report.common.isLoading")), 1)
2532
- ])) : n.value.length > 0 ? (c(), M(p, {
2529
+ _.value ? (c(), F("div", ll, [
2530
+ r(d, { size: "xl" }),
2531
+ t("span", nl, T(p(o)("report.common.isLoading")), 1)
2532
+ ])) : s.value.length > 0 ? (c(), M(y, {
2533
2533
  key: 1,
2534
2534
  class: "flex overflow-scroll",
2535
- "row-data": n.value,
2536
- "column-defs": k
2535
+ "row-data": s.value,
2536
+ "column-defs": V
2537
2537
  }, null, 8, ["row-data"])) : N("", !0)
2538
2538
  ]);
2539
2539
  };
2540
2540
  }
2541
- }), sl = { class: "h-full relative flex flex-col" }, il = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, rl = /* @__PURE__ */ q({
2541
+ }), il = { class: "h-full relative flex flex-col" }, rl = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, ml = /* @__PURE__ */ q({
2542
2542
  __name: "SQL",
2543
2543
  props: {
2544
2544
  modelValue: {},
2545
2545
  modelModifiers: {}
2546
2546
  },
2547
2547
  emits: ["update:modelValue"],
2548
- setup(g) {
2549
- const { t: o } = J(), e = X(g, "modelValue"), n = B("setting"), k = [
2548
+ setup(f) {
2549
+ const { t: o } = J(), e = X(f, "modelValue"), s = B("setting"), V = [
2550
2550
  {
2551
2551
  label: o("report.integration.setting"),
2552
2552
  value: "setting",
@@ -2557,64 +2557,64 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2557
2557
  value: "preview",
2558
2558
  icon: "table"
2559
2559
  }
2560
- ], w = de(), _ = Y(() => {
2561
- switch (n.value) {
2560
+ ], h = de(), _ = Y(() => {
2561
+ switch (s.value) {
2562
2562
  case "preview":
2563
- return nl;
2563
+ return sl;
2564
2564
  case "setting":
2565
- return el;
2565
+ return tl;
2566
2566
  default:
2567
2567
  return null;
2568
2568
  }
2569
2569
  });
2570
- return (F, h) => {
2571
- var V;
2572
- const m = S("FmPageHead"), d = S("FmTabs");
2573
- return c(), C("div", sl, [
2574
- i(m, {
2575
- title: ((V = e.value) == null ? void 0 : V.name) || "SQL",
2570
+ return (C, b) => {
2571
+ var w;
2572
+ const x = S("FmPageHead"), m = S("FmTabs");
2573
+ return c(), F("div", il, [
2574
+ r(x, {
2575
+ title: ((w = e.value) == null ? void 0 : w.name) || "SQL",
2576
2576
  "back-button": !0,
2577
2577
  style: { paddingLeft: "0px", paddingRight: "0px" },
2578
- "onClick:back": v(w).back
2578
+ "onClick:back": p(h).back
2579
2579
  }, {
2580
- description: ge(() => h[2] || (h[2] = [
2580
+ description: ge(() => b[2] || (b[2] = [
2581
2581
  t("div", null, null, -1)
2582
2582
  ])),
2583
2583
  _: 1
2584
2584
  }, 8, ["title", "onClick:back"]),
2585
- i(d, {
2586
- "model-value": n.value,
2587
- "onUpdate:modelValue": h[0] || (h[0] = (b) => n.value = b),
2588
- items: k
2585
+ r(m, {
2586
+ "model-value": s.value,
2587
+ "onUpdate:modelValue": b[0] || (b[0] = (k) => s.value = k),
2588
+ items: V
2589
2589
  }, null, 8, ["model-value"]),
2590
- t("div", il, [
2590
+ t("div", rl, [
2591
2591
  (c(), M(xe(_.value), {
2592
2592
  modelValue: e.value,
2593
- "onUpdate:modelValue": h[1] || (h[1] = (b) => e.value = b)
2593
+ "onUpdate:modelValue": b[1] || (b[1] = (k) => e.value = k)
2594
2594
  }, null, 8, ["modelValue"]))
2595
2595
  ])
2596
2596
  ]);
2597
2597
  };
2598
2598
  }
2599
- }), ml = {
2599
+ }), cl = {
2600
2600
  key: 0,
2601
2601
  class: "flex flex-col h-full"
2602
- }, cl = { class: "flex flex-col gap-16 pb-[24px]" }, dl = { class: "flex flex-row justify-between items-center gap-2" }, pl = { class: "fm-typo-en-title-sm-800" }, ul = { class: "flex flex-row gap-2 items-center" }, fl = { class: "flex flex-row gap-2 items-center" }, vl = { class: "relative group cursor-pointer" }, gl = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, yl = { class: "flex flex-col gap-24 pt-[24px] overflow-y-auto overflow-x-hidden" }, xl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _l = { class: "flex flex-row items-center max-w-[100%]" }, bl = { class: "w-[25%]" }, wl = { class: "flex-grow" }, hl = { class: "flex flex-col gap-24 pt-[24px] overflow-y-auto overflow-x-hidden" }, Vl = { class: "flex flex-row items-center justify-between" }, kl = { class: "w-[25%]" }, $l = { class: "flex-grow" }, Sl = { class: "flex flex-row items-center justify-between" }, Cl = { class: "w-[25%]" }, Fl = { class: "flex-grow" }, Dl = { class: "flex flex-col gap-16" }, Ul = { class: "fm-typo-en-title-sm-800" }, Tl = { class: "flex flex-row items-center max-w-[100%]" }, Il = { class: "w-[25%]" }, Ml = { class: "flex-grow" }, Kl = { class: "flex flex-row items-center max-w-[100%]" }, Al = { class: "w-[25%]" }, Pl = { class: "flex flex-row items-center max-w-[100%]" }, Nl = { class: "w-[25%]" }, Rl = {
2602
+ }, dl = { class: "flex flex-col gap-16 pb-[24px]" }, pl = { class: "flex flex-row justify-between items-center gap-2" }, ul = { class: "fm-typo-en-title-sm-800" }, fl = { class: "flex flex-row gap-2 items-center" }, vl = { class: "flex flex-row gap-2 items-center" }, gl = { class: "relative group cursor-pointer" }, yl = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, xl = { class: "flex flex-col gap-24 pt-[24px] overflow-y-auto overflow-x-hidden" }, _l = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, bl = { class: "flex flex-row items-center max-w-[100%]" }, wl = { class: "w-[25%]" }, hl = { class: "flex-grow" }, Vl = { class: "flex flex-col gap-24 pt-[24px] overflow-y-auto overflow-x-hidden" }, kl = { class: "flex flex-row items-center justify-between" }, $l = { class: "w-[25%]" }, Sl = { class: "flex-grow" }, Cl = { class: "flex flex-row items-center justify-between" }, Fl = { class: "w-[25%]" }, Dl = { class: "flex-grow" }, Ul = { class: "flex flex-col gap-16" }, Tl = { class: "fm-typo-en-title-sm-800" }, Il = { class: "flex flex-row items-center max-w-[100%]" }, Ml = { class: "w-[25%]" }, Kl = { class: "flex-grow" }, Al = { class: "flex flex-row items-center max-w-[100%]" }, Pl = { class: "w-[25%]" }, Nl = { class: "flex flex-row items-center max-w-[100%]" }, Rl = { class: "w-[25%]" }, Ol = {
2603
2603
  key: 0,
2604
2604
  class: "flex flex-row items-center max-w-[100%]"
2605
- }, Ol = { class: "flex flex-col gap-16" }, Bl = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, jl = { key: 1 }, Ll = { class: "flex flex-row items-center gap-x-16" }, El = { class: "fm-typo-en-title-sm-800" }, zl = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Yl = { class: "flex flex-row items-center gap-x-16" }, ql = { class: "fm-typo-en-title-sm-800" }, Hl = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Xl = { class: "flex flex-row items-center gap-x-16" }, Ql = { class: "fm-typo-en-title-sm-800" }, Gl = { class: "flex flex-row items-center justify-between" }, Jl = { class: "flex-grow" }, Wl = {
2605
+ }, Bl = { class: "flex flex-col gap-16" }, jl = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Ll = { key: 1 }, El = { class: "flex flex-row items-center gap-x-16" }, zl = { class: "fm-typo-en-title-sm-800" }, Yl = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, ql = { class: "flex flex-row items-center gap-x-16" }, Hl = { class: "fm-typo-en-title-sm-800" }, Xl = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Ql = { class: "flex flex-row items-center gap-x-16" }, Gl = { class: "fm-typo-en-title-sm-800" }, Jl = { class: "flex flex-row items-center justify-between" }, Wl = { class: "flex-grow" }, Zl = {
2606
2606
  key: 0,
2607
2607
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2608
- }, Zl = {
2608
+ }, en = {
2609
2609
  key: 1,
2610
2610
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2611
- }, en = {
2611
+ }, tn = {
2612
2612
  key: 3,
2613
2613
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2614
- }, tn = {
2614
+ }, on = {
2615
2615
  key: 0,
2616
2616
  class: "flex flex-row items-center"
2617
- }, on = /* @__PURE__ */ q({
2617
+ }, an = /* @__PURE__ */ q({
2618
2618
  __name: "Setting",
2619
2619
  props: /* @__PURE__ */ ye({
2620
2620
  retrievedMethods: {
@@ -2630,46 +2630,46 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2630
2630
  modelModifiers: {}
2631
2631
  }),
2632
2632
  emits: ["update:modelValue"],
2633
- setup(g) {
2634
- const { t: o } = J(), e = X(g, "modelValue"), n = ue(), k = _e(), w = de(), { promptLoader: _ } = we(), { promptMessage: F } = Se(), { restaurants: h } = pe(), m = Y(
2635
- () => h.map(($) => ({ label: $.name, value: $.id }))
2633
+ setup(f) {
2634
+ const { t: o } = J(), e = X(f, "modelValue"), s = ue(), V = _e(), h = de(), { promptLoader: _ } = we(), { promptMessage: C } = Se(), { restaurants: b } = pe(), x = Y(
2635
+ () => b.map(($) => ({ label: $.name, value: $.id }))
2636
2636
  );
2637
- function d($) {
2637
+ function m($) {
2638
2638
  var l;
2639
- !((l = g.retrievedMethods) != null && l.data) || !Array.isArray(g.retrievedMethods.data) || $.forEach((a) => {
2640
- const f = g.retrievedMethods.data.find((s) => s.value == a.id);
2641
- f && (a.cnId = f.cnId);
2639
+ !((l = f.retrievedMethods) != null && l.data) || !Array.isArray(f.retrievedMethods.data) || $.forEach((a) => {
2640
+ const u = f.retrievedMethods.data.find((i) => i.value == a.id);
2641
+ u && (a.cnId = u.cnId);
2642
2642
  });
2643
2643
  }
2644
- async function V() {
2645
- await F({
2644
+ async function w() {
2645
+ await C({
2646
2646
  message: o("report.messages.confirmDelete", { name: e.value.name }),
2647
2647
  title: o("report.common.delete")
2648
2648
  }) && await _(async () => {
2649
2649
  try {
2650
- await he(e.value._id), await k.getSettings(), w.back();
2650
+ await he(e.value._id), await V.getSettings(), h.back();
2651
2651
  } catch (l) {
2652
- n.open({ type: "error", message: l.message });
2652
+ s.open({ type: "error", message: l.message });
2653
2653
  }
2654
2654
  });
2655
2655
  }
2656
- async function b() {
2656
+ async function k() {
2657
2657
  await _(async () => {
2658
2658
  var $, l, a;
2659
2659
  try {
2660
- (a = (l = ($ = e.value) == null ? void 0 : $.platform) == null ? void 0 : l.mappings) != null && a.paymentMethods && d(e.value.platform.mappings.paymentMethods), await Ve(e.value._id, e.value), await k.getSettings();
2661
- } catch (f) {
2662
- n.open({ type: "error", message: f.message });
2660
+ (a = (l = ($ = e.value) == null ? void 0 : $.platform) == null ? void 0 : l.mappings) != null && a.paymentMethods && m(e.value.platform.mappings.paymentMethods), await Ve(e.value._id, e.value), await V.getSettings();
2661
+ } catch (u) {
2662
+ s.open({ type: "error", message: u.message });
2663
2663
  }
2664
2664
  });
2665
2665
  }
2666
- function u($, l) {
2667
- var a, f;
2668
- (f = (a = e.value.platform) == null ? void 0 : a.mappings) != null && f[$] && (e.value.platform.mappings[$] = e.value.platform.mappings[$].filter(
2669
- (s, A) => A !== l
2666
+ function d($, l) {
2667
+ var a, u;
2668
+ (u = (a = e.value.platform) == null ? void 0 : a.mappings) != null && u[$] && (e.value.platform.mappings[$] = e.value.platform.mappings[$].filter(
2669
+ (i, A) => A !== l
2670
2670
  ));
2671
2671
  }
2672
- function p($) {
2672
+ function y($) {
2673
2673
  var l, a;
2674
2674
  (a = (l = e.value.platform) == null ? void 0 : l.mappings) != null && a[$] && (e.value.platform.mappings[$] = [
2675
2675
  ...e.value.platform.mappings[$],
@@ -2686,7 +2686,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2686
2686
  }
2687
2687
  ]);
2688
2688
  }
2689
- const r = [
2689
+ const n = [
2690
2690
  {
2691
2691
  label: "By day",
2692
2692
  value: fe.BY_DAY
@@ -2700,23 +2700,23 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2700
2700
  ($) => {
2701
2701
  $ && $.forEach((l, a) => {
2702
2702
  var A;
2703
- const f = l.key || "";
2704
- let s = l.account;
2705
- if (!s && f) {
2706
- switch (f) {
2703
+ const u = l.key || "";
2704
+ let i = l.account;
2705
+ if (!i && u) {
2706
+ switch (u) {
2707
2707
  case "SST_SV":
2708
- s = "SST-6";
2708
+ i = "SST-6";
2709
2709
  break;
2710
2710
  case "SST_SV8":
2711
- s = "SST-8";
2711
+ i = "SST-8";
2712
2712
  break;
2713
2713
  case "SST_EX":
2714
- s = "SST-0";
2714
+ i = "SST-0";
2715
2715
  break;
2716
2716
  }
2717
2717
  (A = e.value.platform) != null && A.mappings && (e.value.platform.mappings.taxes[a] = {
2718
2718
  ...l,
2719
- account: s
2719
+ account: i
2720
2720
  });
2721
2721
  }
2722
2722
  });
@@ -2728,62 +2728,62 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2728
2728
  return (a = (l = ($ = e.value) == null ? void 0 : $.platform) == null ? void 0 : l.mappings) == null ? void 0 : a.version;
2729
2729
  },
2730
2730
  ($) => {
2731
- var l, a, f, s, A;
2732
- $ === "v1" && !((f = (a = (l = e.value) == null ? void 0 : l.platform) == null ? void 0 : a.mappings) != null && f.payee) && (A = (s = e.value) == null ? void 0 : s.platform) != null && A.mappings && (e.value.platform.mappings.payee = {
2731
+ var l, a, u, i, A;
2732
+ $ === "v1" && !((u = (a = (l = e.value) == null ? void 0 : l.platform) == null ? void 0 : a.mappings) != null && u.payee) && (A = (i = e.value) == null ? void 0 : i.platform) != null && A.mappings && (e.value.platform.mappings.payee = {
2733
2733
  id: 1,
2734
2734
  name: ""
2735
2735
  });
2736
2736
  },
2737
2737
  { immediate: !0 }
2738
2738
  );
2739
- async function x() {
2739
+ async function v() {
2740
2740
  await _(async () => {
2741
2741
  try {
2742
- await ke(e.value._id), await k.getSettings();
2742
+ await ke(e.value._id), await V.getSettings();
2743
2743
  } catch ($) {
2744
- n.open({ type: "error", message: $.message });
2744
+ s.open({ type: "error", message: $.message });
2745
2745
  }
2746
2746
  });
2747
2747
  }
2748
2748
  return ($, l) => {
2749
2749
  var G, R, j, z, W, Z, ee, te, oe, ae, le, ne, se, D;
2750
- const a = S("FmIcon"), f = S("FmButton"), s = S("FmSelect"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmCircularProgress"), E = S("FmCheckbox");
2751
- return (R = (G = e.value) == null ? void 0 : G.platform) != null && R.mappings ? (c(), C("div", ml, [
2752
- t("div", cl, [
2753
- t("div", dl, [
2754
- t("div", pl, T(v(o)("report.integration.connect")), 1),
2755
- t("div", ul, [
2756
- t("div", fl, [
2757
- t("div", vl, [
2758
- i(a, {
2750
+ const a = S("FmIcon"), u = S("FmButton"), i = S("FmSelect"), A = S("FmMenuDivider"), P = S("FmTextField"), Q = S("FmCircularProgress"), E = S("FmCheckbox");
2751
+ return (R = (G = e.value) == null ? void 0 : G.platform) != null && R.mappings ? (c(), F("div", cl, [
2752
+ t("div", dl, [
2753
+ t("div", pl, [
2754
+ t("div", ul, T(p(o)("report.integration.connect")), 1),
2755
+ t("div", fl, [
2756
+ t("div", vl, [
2757
+ t("div", gl, [
2758
+ r(a, {
2759
2759
  name: "refresh",
2760
2760
  class: "p-2 bg-gray-100 rounded-full",
2761
- onClick: x
2761
+ onClick: v
2762
2762
  }),
2763
- t("span", gl, T(v(o)("report.integration.refreshSetting")), 1)
2763
+ t("span", yl, T(p(o)("report.integration.refreshSetting")), 1)
2764
2764
  ]),
2765
- i(f, {
2765
+ r(u, {
2766
2766
  variant: "tertiary",
2767
- label: v(o)("report.common.delete"),
2768
- onClick: V
2767
+ label: p(o)("report.common.delete"),
2768
+ onClick: w
2769
2769
  }, null, 8, ["label"]),
2770
- i(f, {
2770
+ r(u, {
2771
2771
  variant: "primary",
2772
- label: v(o)("report.common.update"),
2773
- onClick: b
2772
+ label: p(o)("report.common.update"),
2773
+ onClick: k
2774
2774
  }, null, 8, ["label"])
2775
2775
  ])
2776
2776
  ])
2777
2777
  ])
2778
2778
  ]),
2779
- t("div", yl, [
2780
- t("div", xl, T(v(o)("report.integration.biztory.authenticate")), 1),
2781
- t("div", _l, [
2782
- t("div", bl, "Biztory " + T(v(o)("report.integration.biztory.version")), 1),
2783
- t("div", wl, [
2784
- i(s, {
2779
+ t("div", xl, [
2780
+ t("div", _l, T(p(o)("report.integration.biztory.authenticate")), 1),
2781
+ t("div", bl, [
2782
+ t("div", wl, "Biztory " + T(p(o)("report.integration.biztory.version")), 1),
2783
+ t("div", hl, [
2784
+ r(i, {
2785
2785
  modelValue: e.value.platform.mappings.version,
2786
- "onUpdate:modelValue": l[0] || (l[0] = (y) => e.value.platform.mappings.version = y),
2786
+ "onUpdate:modelValue": l[0] || (l[0] = (g) => e.value.platform.mappings.version = g),
2787
2787
  items: [
2788
2788
  { label: "v1", value: "v1" },
2789
2789
  { label: "v2", value: "v2" }
@@ -2792,68 +2792,68 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2792
2792
  }, null, 8, ["modelValue"])
2793
2793
  ])
2794
2794
  ]),
2795
- i(A, { style: { margin: 0 } }),
2796
- t("div", hl, [
2797
- t("div", Vl, [
2798
- t("div", kl, T(v(o)("report.integration.biztory.subdomain")), 1),
2799
- t("div", $l, [
2800
- i(P, {
2795
+ r(A, { style: { margin: 0 } }),
2796
+ t("div", Vl, [
2797
+ t("div", kl, [
2798
+ t("div", $l, T(p(o)("report.integration.biztory.subdomain")), 1),
2799
+ t("div", Sl, [
2800
+ r(P, {
2801
2801
  modelValue: e.value.platform.subdomain,
2802
- "onUpdate:modelValue": l[1] || (l[1] = (y) => e.value.platform.subdomain = y),
2802
+ "onUpdate:modelValue": l[1] || (l[1] = (g) => e.value.platform.subdomain = g),
2803
2803
  placeholder: "Subdomain"
2804
2804
  }, null, 8, ["modelValue"])
2805
2805
  ])
2806
2806
  ]),
2807
- t("div", Sl, [
2808
- t("div", Cl, T(v(o)("report.integration.biztory.apiKey")), 1),
2809
- t("div", Fl, [
2810
- i(P, {
2807
+ t("div", Cl, [
2808
+ t("div", Fl, T(p(o)("report.integration.biztory.apiKey")), 1),
2809
+ t("div", Dl, [
2810
+ r(P, {
2811
2811
  modelValue: e.value.platform.api_key,
2812
- "onUpdate:modelValue": l[2] || (l[2] = (y) => e.value.platform.api_key = y),
2812
+ "onUpdate:modelValue": l[2] || (l[2] = (g) => e.value.platform.api_key = g),
2813
2813
  placeholder: "API Key"
2814
2814
  }, null, 8, ["modelValue"])
2815
2815
  ])
2816
2816
  ]),
2817
- t("div", Dl, [
2818
- t("div", Ul, T(v(o)("report.integration.general")), 1),
2819
- t("div", Tl, [
2820
- t("div", Il, T(v(o)("report.common.name")), 1),
2821
- t("div", Ml, [
2822
- i(P, {
2817
+ t("div", Ul, [
2818
+ t("div", Tl, T(p(o)("report.integration.general")), 1),
2819
+ t("div", Il, [
2820
+ t("div", Ml, T(p(o)("report.common.name")), 1),
2821
+ t("div", Kl, [
2822
+ r(P, {
2823
2823
  modelValue: e.value.name,
2824
- "onUpdate:modelValue": l[3] || (l[3] = (y) => e.value.name = y)
2824
+ "onUpdate:modelValue": l[3] || (l[3] = (g) => e.value.name = g)
2825
2825
  }, null, 8, ["modelValue"])
2826
2826
  ])
2827
2827
  ]),
2828
- t("div", Kl, [
2829
- t("div", Al, T(v(o)("report.common.location")), 1),
2830
- i(s, {
2828
+ t("div", Al, [
2829
+ t("div", Pl, T(p(o)("report.common.location")), 1),
2830
+ r(i, {
2831
2831
  modelValue: e.value.platform.locationIds,
2832
- "onUpdate:modelValue": l[4] || (l[4] = (y) => e.value.platform.locationIds = y),
2832
+ "onUpdate:modelValue": l[4] || (l[4] = (g) => e.value.platform.locationIds = g),
2833
2833
  multiselect: !0,
2834
- items: m.value,
2835
- placeholder: v(o)("report.common.location"),
2834
+ items: x.value,
2835
+ placeholder: p(o)("report.common.location"),
2836
2836
  class: "flex-grow"
2837
2837
  }, null, 8, ["modelValue", "items", "placeholder"])
2838
2838
  ]),
2839
- t("div", Pl, [
2840
- t("div", Nl, T(v(o)("report.integration.grouping.title")), 1),
2841
- i(s, {
2839
+ t("div", Nl, [
2840
+ t("div", Rl, T(p(o)("report.integration.grouping.title")), 1),
2841
+ r(i, {
2842
2842
  modelValue: e.value.platform.grouping,
2843
- "onUpdate:modelValue": l[5] || (l[5] = (y) => e.value.platform.grouping = y),
2843
+ "onUpdate:modelValue": l[5] || (l[5] = (g) => e.value.platform.grouping = g),
2844
2844
  multiselect: !1,
2845
- items: r,
2846
- placeholder: v(o)("report.integration.grouping.title"),
2845
+ items: n,
2846
+ placeholder: p(o)("report.integration.grouping.title"),
2847
2847
  class: "flex-grow",
2848
2848
  disabled: ""
2849
2849
  }, null, 8, ["modelValue", "placeholder"])
2850
2850
  ]),
2851
- e.value.platform.mappings.version == "v1" ? (c(), C("div", Rl, [
2851
+ e.value.platform.mappings.version == "v1" ? (c(), F("div", Ol, [
2852
2852
  l[13] || (l[13] = t("div", { class: "w-[33%]" }, "Payee ID", -1)),
2853
2853
  e.value.platform.mappings.version == "v1" ? (c(), M(K, {
2854
2854
  key: 0,
2855
2855
  modelValue: e.value.platform.mappings.payee,
2856
- "onUpdate:modelValue": l[6] || (l[6] = (y) => e.value.platform.mappings.payee = y),
2856
+ "onUpdate:modelValue": l[6] || (l[6] = (g) => e.value.platform.mappings.payee = g),
2857
2857
  options: {
2858
2858
  id: { placeholder: "ID", editable: !0 }
2859
2859
  },
@@ -2861,23 +2861,23 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2861
2861
  }, null, 8, ["modelValue"])) : N("", !0)
2862
2862
  ])) : N("", !0)
2863
2863
  ]),
2864
- t("div", Ol, [
2865
- t("div", Bl, [
2866
- !g.retrievedCustomers.isLoaded && e.value.platform.mappings.version == "v2" ? (c(), M(Q, {
2864
+ t("div", Bl, [
2865
+ t("div", jl, [
2866
+ !f.retrievedCustomers.isLoaded && e.value.platform.mappings.version == "v2" ? (c(), M(Q, {
2867
2867
  key: 0,
2868
2868
  size: "xl"
2869
2869
  })) : N("", !0),
2870
- g.retrievedCustomers.isLoaded && g.retrievedCustomers.data && ((j = g.retrievedCustomers.data) == null ? void 0 : j.length) != 0 ? (c(), C("div", jl, [
2870
+ f.retrievedCustomers.isLoaded && f.retrievedCustomers.data && ((j = f.retrievedCustomers.data) == null ? void 0 : j.length) != 0 ? (c(), F("div", Ll, [
2871
2871
  e.value.platform.mappings.version == "v2" ? (c(), M(Me, {
2872
2872
  key: 0,
2873
2873
  modelValue: e.value.platform.mappings.payeeId,
2874
- "onUpdate:modelValue": l[7] || (l[7] = (y) => e.value.platform.mappings.payeeId = y),
2874
+ "onUpdate:modelValue": l[7] || (l[7] = (g) => e.value.platform.mappings.payeeId = g),
2875
2875
  options: {
2876
2876
  key: { placeholder: "Payee", editable: !1 },
2877
2877
  customer: {
2878
2878
  placeholder: "Select payee",
2879
2879
  editable: !0,
2880
- dropdownOptions: ((z = g.retrievedCustomers) == null ? void 0 : z.data) ?? []
2880
+ dropdownOptions: ((z = f.retrievedCustomers) == null ? void 0 : z.data) ?? []
2881
2881
  }
2882
2882
  },
2883
2883
  removable: !1,
@@ -2886,22 +2886,22 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2886
2886
  ])) : N("", !0)
2887
2887
  ])
2888
2888
  ]),
2889
- i(De, {
2889
+ r(De, {
2890
2890
  modelValue: e.value.platform,
2891
- "onUpdate:modelValue": l[8] || (l[8] = (y) => e.value.platform = y),
2891
+ "onUpdate:modelValue": l[8] || (l[8] = (g) => e.value.platform = g),
2892
2892
  label: "upload",
2893
2893
  "last-upload-date": (W = e.value.platform) == null ? void 0 : W.lastUploadDate
2894
2894
  }, null, 8, ["modelValue", "last-upload-date"]),
2895
- t("div", Ll, [
2896
- t("div", El, T(v(o)("report.integration.biztory.items")), 1),
2897
- i(f, {
2895
+ t("div", El, [
2896
+ t("div", zl, T(p(o)("report.integration.biztory.items")), 1),
2897
+ r(u, {
2898
2898
  variant: "primary",
2899
2899
  icon: "add",
2900
- onClick: l[9] || (l[9] = () => p("items"))
2900
+ onClick: l[9] || (l[9] = () => y("items"))
2901
2901
  })
2902
2902
  ]),
2903
- t("div", zl, [
2904
- (c(!0), C(L, null, H((te = (ee = (Z = e.value) == null ? void 0 : Z.platform) == null ? void 0 : ee.mappings) == null ? void 0 : te.items, (y, U) => (c(), M(K, {
2903
+ t("div", Yl, [
2904
+ (c(!0), F(L, null, H((te = (ee = (Z = e.value) == null ? void 0 : Z.platform) == null ? void 0 : ee.mappings) == null ? void 0 : te.items, (g, U) => (c(), M(K, {
2905
2905
  key: `item-${U}`,
2906
2906
  modelValue: e.value.platform.mappings.items[U],
2907
2907
  "onUpdate:modelValue": (O) => e.value.platform.mappings.items[U] = O,
@@ -2910,19 +2910,19 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2910
2910
  code: { placeholder: "Account code", editable: !0 }
2911
2911
  },
2912
2912
  removable: !0,
2913
- onRemove: () => u("items", U)
2913
+ onRemove: () => d("items", U)
2914
2914
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
2915
2915
  ]),
2916
- t("div", Yl, [
2917
- t("div", ql, T(v(o)("report.integration.biztory.taxes")), 1),
2918
- i(f, {
2916
+ t("div", ql, [
2917
+ t("div", Hl, T(p(o)("report.integration.biztory.taxes")), 1),
2918
+ r(u, {
2919
2919
  variant: "primary",
2920
2920
  icon: "add",
2921
- onClick: l[10] || (l[10] = () => p("taxes"))
2921
+ onClick: l[10] || (l[10] = () => y("taxes"))
2922
2922
  })
2923
2923
  ]),
2924
- t("div", Hl, [
2925
- (c(!0), C(L, null, H((le = (ae = (oe = e.value) == null ? void 0 : oe.platform) == null ? void 0 : ae.mappings) == null ? void 0 : le.taxes, (y, U) => (c(), M(K, {
2924
+ t("div", Xl, [
2925
+ (c(!0), F(L, null, H((le = (ae = (oe = e.value) == null ? void 0 : oe.platform) == null ? void 0 : ae.mappings) == null ? void 0 : le.taxes, (g, U) => (c(), M(K, {
2926
2926
  key: `tax-${U}`,
2927
2927
  modelValue: e.value.platform.mappings.taxes[U],
2928
2928
  "onUpdate:modelValue": (O) => e.value.platform.mappings.taxes[U] = O,
@@ -2931,23 +2931,23 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2931
2931
  account: { placeholder: "Account code", editable: !0 }
2932
2932
  },
2933
2933
  removable: !0,
2934
- onRemove: () => u("taxes", U)
2934
+ onRemove: () => d("taxes", U)
2935
2935
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
2936
2936
  ]),
2937
- t("div", Xl, [
2938
- t("div", Ql, T(v(o)("report.integration.biztory.payments")), 1),
2939
- i(f, {
2937
+ t("div", Ql, [
2938
+ t("div", Gl, T(p(o)("report.integration.biztory.payments")), 1),
2939
+ r(u, {
2940
2940
  variant: "primary",
2941
2941
  icon: "add",
2942
- onClick: l[11] || (l[11] = () => p("paymentMethods"))
2942
+ onClick: l[11] || (l[11] = () => y("paymentMethods"))
2943
2943
  })
2944
2944
  ]),
2945
- t("div", Gl, [
2945
+ t("div", Jl, [
2946
2946
  l[14] || (l[14] = t("div", { class: "w-[25%]" }, "Payment Term", -1)),
2947
- t("div", Jl, [
2948
- i(K, {
2947
+ t("div", Wl, [
2948
+ r(K, {
2949
2949
  modelValue: e.value.platform.mappings.paymentTerm,
2950
- "onUpdate:modelValue": l[12] || (l[12] = (y) => e.value.platform.mappings.paymentTerm = y),
2950
+ "onUpdate:modelValue": l[12] || (l[12] = (g) => e.value.platform.mappings.paymentTerm = g),
2951
2951
  options: {
2952
2952
  id: { placeholder: "ID", editable: !0 },
2953
2953
  name: { placeholder: "Name", editable: !0 }
@@ -2956,21 +2956,21 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2956
2956
  }, null, 8, ["modelValue"])
2957
2957
  ])
2958
2958
  ]),
2959
- g.retrievedMethods.isError ? N("", !0) : (c(), C("div", Wl, T(v(o)("report.integration.biztory.paymentTerm")), 1)),
2960
- g.retrievedMethods.isLoaded && g.retrievedMethods.data && g.retrievedMethods.data.length == 0 && !g.retrievedMethods.isError ? (c(), C("span", Zl, T(v(o)("report.integration.biztory.noPaymentMethods")), 1)) : N("", !0),
2961
- g.retrievedMethods.isLoaded ? N("", !0) : (c(), M(Q, {
2959
+ f.retrievedMethods.isError ? N("", !0) : (c(), F("div", Zl, T(p(o)("report.integration.biztory.paymentTerm")), 1)),
2960
+ f.retrievedMethods.isLoaded && f.retrievedMethods.data && f.retrievedMethods.data.length == 0 && !f.retrievedMethods.isError ? (c(), F("span", en, T(p(o)("report.integration.biztory.noPaymentMethods")), 1)) : N("", !0),
2961
+ f.retrievedMethods.isLoaded ? N("", !0) : (c(), M(Q, {
2962
2962
  key: 2,
2963
2963
  size: "xl"
2964
2964
  })),
2965
- g.retrievedMethods.isError ? (c(), C("span", en, T(v(o)("report.integration.biztory.error")), 1)) : N("", !0),
2966
- (c(!0), C(L, null, H((D = (se = (ne = e.value) == null ? void 0 : ne.platform) == null ? void 0 : se.mappings) == null ? void 0 : D.paymentMethods, (y, U) => {
2965
+ f.retrievedMethods.isError ? (c(), F("span", tn, T(p(o)("report.integration.biztory.error")), 1)) : N("", !0),
2966
+ (c(!0), F(L, null, H((D = (se = (ne = e.value) == null ? void 0 : ne.platform) == null ? void 0 : se.mappings) == null ? void 0 : D.paymentMethods, (g, U) => {
2967
2967
  var O;
2968
- return c(), C("div", {
2968
+ return c(), F("div", {
2969
2969
  key: `payment-${U}`,
2970
2970
  class: "grid-cols-1 grid gap-x-16"
2971
2971
  }, [
2972
- g.retrievedMethods.isLoaded && g.retrievedMethods.data && ((O = g.retrievedMethods.data) == null ? void 0 : O.length) != 0 ? (c(), C("div", tn, [
2973
- i(E, {
2972
+ f.retrievedMethods.isLoaded && f.retrievedMethods.data && ((O = f.retrievedMethods.data) == null ? void 0 : O.length) != 0 ? (c(), F("div", on, [
2973
+ r(E, {
2974
2974
  "model-value": !e.value.platform.mappings.paymentMethods[U].skip,
2975
2975
  value: "",
2976
2976
  "onUpdate:modelValue": (me) => {
@@ -2978,7 +2978,7 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2978
2978
  (Te = (Ue = e.value.platform) == null ? void 0 : Ue.mappings) != null && Te.paymentMethods[U] && (e.value.platform.mappings.paymentMethods[U].skip = !me);
2979
2979
  }
2980
2980
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2981
- i(Me, {
2981
+ r(Me, {
2982
2982
  modelValue: e.value.platform.mappings.paymentMethods[U],
2983
2983
  "onUpdate:modelValue": (me) => e.value.platform.mappings.paymentMethods[U] = me,
2984
2984
  options: {
@@ -2989,11 +2989,11 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
2989
2989
  id: {
2990
2990
  placeholder: "Select mapping",
2991
2991
  editable: !0,
2992
- dropdownOptions: g.retrievedMethods.data
2992
+ dropdownOptions: f.retrievedMethods.data
2993
2993
  }
2994
2994
  },
2995
2995
  removable: !0,
2996
- onRemove: () => u("paymentMethods", U)
2996
+ onRemove: () => d("paymentMethods", U)
2997
2997
  }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "onRemove"])
2998
2998
  ])) : N("", !0)
2999
2999
  ]);
@@ -3004,30 +3004,30 @@ const Ze = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
3004
3004
  };
3005
3005
  }
3006
3006
  });
3007
- function an(g) {
3008
- return g.reduce((o, e) => {
3009
- var w, _, F, h, m, d, V, b, u, p, r, x, $, l, a, f, s, A, P, Q, E, G;
3010
- const { invoice: n } = e, k = o.length;
3011
- o[k] = {
3012
- invoice_date: n.invoice_date,
3013
- ref_num: n.ref_num,
3014
- grandTotal: n.grandTotal,
3007
+ function ln(f) {
3008
+ return f.reduce((o, e) => {
3009
+ var h, _, C, b, x, m, w, k, d, y, n, v, $, l, a, u, i, A, P, Q, E, G;
3010
+ const { invoice: s } = e, V = o.length;
3011
+ o[V] = {
3012
+ invoice_date: s.invoice_date,
3013
+ ref_num: s.ref_num,
3014
+ grandTotal: s.grandTotal,
3015
3015
  // tax_code: invoice.tax[0].tax_code,
3016
3016
  // tax: invoice.tax.reduce((sum, tax) => sum + tax.tax, 0),
3017
3017
  // service_charge: invoice.service_charge.total,
3018
- item_code: (w = n.items[0]) == null ? void 0 : w.code,
3019
- item_desc: (_ = n.items[0]) == null ? void 0 : _.description,
3020
- item_price: (F = n.items[0]) == null ? void 0 : F.price,
3021
- item_tax: (h = n.items[0]) == null ? void 0 : h.total_tax,
3022
- item_tax_label: ((m = n.items[0]) == null ? void 0 : m.tax_label) || "-",
3023
- payment_amount: ((V = (d = n.transactions) == null ? void 0 : d[0]) == null ? void 0 : V.amount) || void 0,
3024
- payment_method: ((u = (b = n.transactions) == null ? void 0 : b[0]) == null ? void 0 : u.payment_method) || "-",
3025
- payment_term: ((p = n == null ? void 0 : n.payment_term) == null ? void 0 : p.name) || ""
3018
+ item_code: (h = s.items[0]) == null ? void 0 : h.code,
3019
+ item_desc: (_ = s.items[0]) == null ? void 0 : _.description,
3020
+ item_price: (C = s.items[0]) == null ? void 0 : C.price,
3021
+ item_tax: (b = s.items[0]) == null ? void 0 : b.total_tax,
3022
+ item_tax_label: ((x = s.items[0]) == null ? void 0 : x.tax_label) || "-",
3023
+ payment_amount: ((w = (m = s.transactions) == null ? void 0 : m[0]) == null ? void 0 : w.amount) || void 0,
3024
+ payment_method: ((d = (k = s.transactions) == null ? void 0 : k[0]) == null ? void 0 : d.payment_method) || "-",
3025
+ payment_term: ((y = s == null ? void 0 : s.payment_term) == null ? void 0 : y.name) || ""
3026
3026
  };
3027
- for (let R = 1; R < Math.max(((r = n.items) == null ? void 0 : r.length) || 0, ((x = n.transactions) == null ? void 0 : x.length) || 0); R++) {
3028
- const j = k + R;
3027
+ for (let R = 1; R < Math.max(((n = s.items) == null ? void 0 : n.length) || 0, ((v = s.transactions) == null ? void 0 : v.length) || 0); R++) {
3028
+ const j = V + R;
3029
3029
  o[j] || (o[j] = {});
3030
- const z = n.items[R];
3030
+ const z = s.items[R];
3031
3031
  z ? o[j] = {
3032
3032
  ...o[j],
3033
3033
  item_code: z.code,
@@ -3035,19 +3035,19 @@ function an(g) {
3035
3035
  item_price: z.price,
3036
3036
  item_tax: z.total_tax,
3037
3037
  item_tax_label: z.tax_label || "-",
3038
- payment_amount: ((l = ($ = n.transactions) == null ? void 0 : $[R]) == null ? void 0 : l.amount) || void 0,
3039
- payment_method: ((f = (a = n.transactions) == null ? void 0 : a[R]) == null ? void 0 : f.payment_method) || "-",
3040
- payment_term: ((s = n == null ? void 0 : n.payment_term) == null ? void 0 : s.name) || ""
3038
+ payment_amount: ((l = ($ = s.transactions) == null ? void 0 : $[R]) == null ? void 0 : l.amount) || void 0,
3039
+ payment_method: ((u = (a = s.transactions) == null ? void 0 : a[R]) == null ? void 0 : u.payment_method) || "-",
3040
+ payment_term: ((i = s == null ? void 0 : s.payment_term) == null ? void 0 : i.name) || ""
3041
3041
  } : o[j] = {
3042
- payment_amount: ((P = (A = n.transactions) == null ? void 0 : A[R]) == null ? void 0 : P.amount) || void 0,
3043
- payment_method: ((E = (Q = n.transactions) == null ? void 0 : Q[R]) == null ? void 0 : E.payment_method) || "-",
3044
- payment_term: ((G = n == null ? void 0 : n.payment_term) == null ? void 0 : G.name) || ""
3042
+ payment_amount: ((P = (A = s.transactions) == null ? void 0 : A[R]) == null ? void 0 : P.amount) || void 0,
3043
+ payment_method: ((E = (Q = s.transactions) == null ? void 0 : Q[R]) == null ? void 0 : E.payment_method) || "-",
3044
+ payment_term: ((G = s == null ? void 0 : s.payment_term) == null ? void 0 : G.name) || ""
3045
3045
  };
3046
3046
  }
3047
3047
  return o;
3048
3048
  }, []);
3049
3049
  }
3050
- const ln = [
3050
+ const nn = [
3051
3051
  {
3052
3052
  accessorKey: "invoice_date",
3053
3053
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Date"),
@@ -3119,34 +3119,34 @@ const ln = [
3119
3119
  enableSorting: !1
3120
3120
  }
3121
3121
  ];
3122
- function nn(g) {
3123
- return g.reduce((o, e) => {
3124
- var F, h, m, d, V, b, u, p, r, x;
3125
- const { invoice: n, payments: k } = e, w = o.length;
3126
- o[w] = {
3127
- invoice_date: n.invoice_date,
3128
- ref_num: n.ref_num,
3129
- total: n.total,
3130
- item_code: (F = n.items[0]) == null ? void 0 : F.code,
3131
- item_description: (h = n.items[0]) == null ? void 0 : h.description,
3132
- item_price: (m = n.items[0]) == null ? void 0 : m.price,
3133
- item_tax_label: ((d = n.items[0]) == null ? void 0 : d.tax_label) ?? "",
3134
- item_tax_amount: ((V = n.items[0]) == null ? void 0 : V.total_tax) ?? "",
3135
- service_charge_amount: ((b = n.service_charges[0]) == null ? void 0 : b.total) ?? "",
3136
- rounding: n.rounding ?? 0,
3137
- payment_term_id: n.payment_term.name ?? "",
3138
- payment_term_amount: ((u = n.terms[w]) == null ? void 0 : u.amount) ?? "",
3139
- payment_method: ((p = k[0]) == null ? void 0 : p.payment_method_name) || ""
3122
+ function sn(f) {
3123
+ return f.reduce((o, e) => {
3124
+ var C, b, x, m, w, k, d, y, n, v;
3125
+ const { invoice: s, payments: V } = e, h = o.length;
3126
+ o[h] = {
3127
+ invoice_date: s.invoice_date,
3128
+ ref_num: s.ref_num,
3129
+ total: s.total,
3130
+ item_code: (C = s.items[0]) == null ? void 0 : C.code,
3131
+ item_description: (b = s.items[0]) == null ? void 0 : b.description,
3132
+ item_price: (x = s.items[0]) == null ? void 0 : x.price,
3133
+ item_tax_label: ((m = s.items[0]) == null ? void 0 : m.tax_label) ?? "",
3134
+ item_tax_amount: ((w = s.items[0]) == null ? void 0 : w.total_tax) ?? "",
3135
+ service_charge_amount: ((k = s.service_charges[0]) == null ? void 0 : k.total) ?? "",
3136
+ rounding: s.rounding ?? 0,
3137
+ payment_term_id: s.payment_term.name ?? "",
3138
+ payment_term_amount: ((d = s.terms[h]) == null ? void 0 : d.amount) ?? "",
3139
+ payment_method: ((y = V[0]) == null ? void 0 : y.payment_method_name) || ""
3140
3140
  };
3141
3141
  const _ = Math.max(
3142
- ((r = n.items) == null ? void 0 : r.length) || 0,
3143
- ((x = n.terms) == null ? void 0 : x.length) || 0,
3144
- (k == null ? void 0 : k.length) || 0
3142
+ ((n = s.items) == null ? void 0 : n.length) || 0,
3143
+ ((v = s.terms) == null ? void 0 : v.length) || 0,
3144
+ (V == null ? void 0 : V.length) || 0
3145
3145
  );
3146
3146
  for (let $ = 1; $ < _; $++) {
3147
- const l = w + $;
3147
+ const l = h + $;
3148
3148
  o[l] || (o[l] = {});
3149
- const a = n.items[$], f = n.terms[$], s = k[$];
3149
+ const a = s.items[$], u = s.terms[$], i = V[$];
3150
3150
  a ? o[l] = {
3151
3151
  ...o[l],
3152
3152
  item_code: a.code,
@@ -3154,19 +3154,19 @@ function nn(g) {
3154
3154
  item_price: a.total,
3155
3155
  item_tax_label: a.tax_label == "?" ? "" : a.tax_label ?? "",
3156
3156
  item_tax_amount: a.total_tax ?? "",
3157
- payment_term_id: n.payment_term.name ?? "",
3158
- payment_term_amount: (f == null ? void 0 : f.amount) ?? "",
3159
- payment_method: (s == null ? void 0 : s.payment_method_name) || ""
3157
+ payment_term_id: s.payment_term.name ?? "",
3158
+ payment_term_amount: (u == null ? void 0 : u.amount) ?? "",
3159
+ payment_method: (i == null ? void 0 : i.payment_method_name) || ""
3160
3160
  } : o[l] = {
3161
- payment_term_id: n.payment_term.name ?? "",
3162
- payment_term_amount: (f == null ? void 0 : f.amount) ?? "",
3163
- payment_method: (s == null ? void 0 : s.payment_method_name) || ""
3161
+ payment_term_id: s.payment_term.name ?? "",
3162
+ payment_term_amount: (u == null ? void 0 : u.amount) ?? "",
3163
+ payment_method: (i == null ? void 0 : i.payment_method_name) || ""
3164
3164
  };
3165
3165
  }
3166
3166
  return o;
3167
3167
  }, []);
3168
3168
  }
3169
- const sn = [
3169
+ const rn = [
3170
3170
  {
3171
3171
  accessorKey: "invoice_date",
3172
3172
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Date"),
@@ -3232,97 +3232,97 @@ const sn = [
3232
3232
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Payment Method (ID)"),
3233
3233
  enableSorting: !1
3234
3234
  }
3235
- ], rn = { class: "h-full flex flex-col gap-16" }, mn = { class: "flex flex-row gap-2 justify-between items-center" }, cn = {
3235
+ ], mn = { class: "h-full flex flex-col gap-16" }, cn = { class: "flex flex-row gap-2 justify-between items-center" }, dn = {
3236
3236
  key: 0,
3237
3237
  class: "flex gap-24 w-full h-full justify-center items-center overflow-scroll"
3238
- }, dn = /* @__PURE__ */ q({
3238
+ }, pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, un = /* @__PURE__ */ q({
3239
3239
  __name: "Preview",
3240
3240
  props: {
3241
3241
  modelValue: { required: !0 },
3242
3242
  modelModifiers: {}
3243
3243
  },
3244
3244
  emits: ["update:modelValue"],
3245
- setup(g) {
3246
- const o = X(g, "modelValue"), e = B(!1), n = ue(), { dateRange: k } = Ce(pe()), w = B([]);
3245
+ setup(f) {
3246
+ const { t: o } = J(), e = X(f, "modelValue"), s = B(!1), V = ue(), { dateRange: h } = Ce(pe()), _ = B([]);
3247
3247
  ve(
3248
- () => k.value,
3248
+ () => h.value,
3249
3249
  async () => {
3250
- if (o.value._id)
3250
+ if (e.value._id)
3251
3251
  try {
3252
- e.value = !0, w.value = await $e(o.value._id);
3252
+ s.value = !0, _.value = await $e(e.value._id);
3253
3253
  } catch (m) {
3254
- n.open({ message: m.message, type: "error" });
3254
+ V.open({ message: m.message, type: "error" });
3255
3255
  } finally {
3256
- e.value = !1;
3256
+ s.value = !1;
3257
3257
  }
3258
3258
  },
3259
3259
  {
3260
3260
  immediate: !0
3261
3261
  }
3262
3262
  );
3263
- const _ = Y(() => {
3264
- switch (o.value.platform.mappings.version) {
3263
+ const C = Y(() => {
3264
+ switch (e.value.platform.mappings.version) {
3265
3265
  case "v1":
3266
- return an(w.value);
3266
+ return ln(_.value);
3267
3267
  case "v2":
3268
- return nn(w.value);
3268
+ return sn(_.value);
3269
3269
  }
3270
3270
  return [];
3271
- }), F = Y(() => {
3272
- switch (o.value.platform.mappings.version) {
3271
+ }), b = Y(() => {
3272
+ switch (e.value.platform.mappings.version) {
3273
3273
  case "v1":
3274
- return ln;
3274
+ return nn;
3275
3275
  case "v2":
3276
- return sn;
3276
+ return rn;
3277
3277
  }
3278
3278
  return [];
3279
3279
  });
3280
- async function h() {
3280
+ async function x() {
3281
3281
  try {
3282
- o.value._id && o.value.platform.subdomain && o.value.platform.api_key ? (e.value = !0, await Ae(o.value._id), n.open({ message: "Upload successful", type: "success" })) : n.open({ message: "Invalid accounting setting", type: "error" });
3282
+ e.value._id && e.value.platform.subdomain && e.value.platform.api_key ? (s.value = !0, await Ae(e.value._id), V.open({ message: "Upload successful", type: "success" })) : V.open({ message: "Invalid accounting setting", type: "error" });
3283
3283
  } catch (m) {
3284
- m.message && n.open({ message: m.message, type: "error" }), m.errors && m.errors.forEach((d) => n.open({ message: d, type: "error" }));
3284
+ m.message && V.open({ message: m.message, type: "error" }), m.errors && m.errors.forEach((w) => V.open({ message: w, type: "error" }));
3285
3285
  } finally {
3286
- e.value = !1;
3286
+ s.value = !1;
3287
3287
  }
3288
3288
  }
3289
- return (m, d) => {
3290
- const V = S("FmButton"), b = S("FmCircularProgress"), u = S("FmTable");
3291
- return c(), C("div", rn, [
3292
- t("div", mn, [
3293
- i(Fe, {
3294
- "date-range": v(k),
3295
- "onUpdate:dateRange": d[0] || (d[0] = (p) => be(k) ? k.value = p : null),
3289
+ return (m, w) => {
3290
+ const k = S("FmButton"), d = S("FmCircularProgress"), y = S("FmTable");
3291
+ return c(), F("div", mn, [
3292
+ t("div", cn, [
3293
+ r(Fe, {
3294
+ "date-range": p(h),
3295
+ "onUpdate:dateRange": w[0] || (w[0] = (n) => be(h) ? h.value = n : null),
3296
3296
  compare: !1
3297
3297
  }, null, 8, ["date-range"]),
3298
- i(V, {
3299
- loading: e.value,
3298
+ r(k, {
3299
+ loading: s.value,
3300
3300
  variant: "primary",
3301
3301
  label: "Upload",
3302
- onClick: h
3302
+ onClick: x
3303
3303
  }, null, 8, ["loading"])
3304
3304
  ]),
3305
- e.value ? (c(), C("div", cn, [
3306
- i(b, { size: "xl" }),
3307
- d[1] || (d[1] = t("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Loading data... ", -1))
3308
- ])) : (c(), M(u, {
3305
+ s.value ? (c(), F("div", dn, [
3306
+ r(d, { size: "xl" }),
3307
+ t("span", pn, T(p(o)("report.common.isLoading")), 1)
3308
+ ])) : (c(), M(y, {
3309
3309
  key: 1,
3310
3310
  class: "flex overflow-scroll",
3311
- "row-data": _.value,
3312
- "column-defs": F.value
3311
+ "row-data": C.value,
3312
+ "column-defs": b.value
3313
3313
  }, null, 8, ["row-data", "column-defs"]))
3314
3314
  ]);
3315
3315
  };
3316
3316
  }
3317
- }), pn = { class: "h-full relative flex flex-col" }, un = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, fn = /* @__PURE__ */ q({
3317
+ }), fn = { class: "h-full relative flex flex-col" }, vn = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, gn = /* @__PURE__ */ q({
3318
3318
  __name: "Biztory",
3319
3319
  props: {
3320
3320
  modelValue: { required: !0 },
3321
3321
  modelModifiers: {}
3322
3322
  },
3323
3323
  emits: ["update:modelValue"],
3324
- setup(g) {
3325
- const { t: o } = J(), e = X(g, "modelValue"), n = B("setting"), k = [
3324
+ setup(f) {
3325
+ const { t: o } = J(), e = X(f, "modelValue"), s = B("setting"), V = [
3326
3326
  {
3327
3327
  label: o("report.integration.setting"),
3328
3328
  value: "setting",
@@ -3333,127 +3333,127 @@ const sn = [
3333
3333
  value: "preview",
3334
3334
  icon: "table"
3335
3335
  }
3336
- ], w = de(), _ = Y(() => {
3337
- switch (n.value) {
3336
+ ], h = de(), _ = Y(() => {
3337
+ switch (s.value) {
3338
3338
  case "preview":
3339
3339
  return {
3340
- component: dn
3340
+ component: un
3341
3341
  };
3342
3342
  case "setting":
3343
3343
  return {
3344
- component: on,
3344
+ component: an,
3345
3345
  props: {
3346
- retrievedMethods: F.value,
3347
- retrievedCustomers: h.value
3346
+ retrievedMethods: C.value,
3347
+ retrievedCustomers: b.value
3348
3348
  }
3349
3349
  };
3350
3350
  default:
3351
3351
  return null;
3352
3352
  }
3353
- }), F = B({}), h = B({}), m = (p, r) => p.map((x) => ({
3354
- label: r.length > 2 ? `ID:${x[r[2]]} [${x[r[0]]}] ${x[r[1]]}` : `[${x[r[0]]}] ${x[r[1]]}`,
3355
- value: x.id,
3356
- cnId: x.cnId ? x.cnId : null
3357
- })), d = (p) => m(p, ["wallet", "name"]), V = (p) => m(p, ["id", "name"]), b = async (p, r, x, $) => {
3353
+ }), C = B({}), b = B({}), x = (y, n) => y.map((v) => ({
3354
+ label: n.length > 2 ? `ID:${v[n[2]]} [${v[n[0]]}] ${v[n[1]]}` : `[${v[n[0]]}] ${v[n[1]]}`,
3355
+ value: v.id,
3356
+ cnId: v.cnId ? v.cnId : null
3357
+ })), m = (y) => x(y, ["wallet", "name"]), w = (y) => x(y, ["id", "name"]), k = async (y, n, v, $) => {
3358
3358
  try {
3359
- const l = await p(e.value._id);
3360
- x.value.data = r(l);
3359
+ const l = await y(e.value._id);
3360
+ v.value.data = n(l);
3361
3361
  } catch (l) {
3362
- console.error($, l), x.value.isError = !0;
3362
+ console.error($, l), v.value.isError = !0;
3363
3363
  } finally {
3364
- x.value.isLoaded = !0;
3364
+ v.value.isLoaded = !0;
3365
3365
  }
3366
- }, u = async () => {
3367
- var p, r;
3368
- (p = e.value.platform.mappings) != null && p.version && await b(
3366
+ }, d = async () => {
3367
+ var y, n;
3368
+ (y = e.value.platform.mappings) != null && y.version && await k(
3369
3369
  Ge,
3370
- d,
3371
- F,
3370
+ m,
3371
+ C,
3372
3372
  "Failed to fetch payment methods:"
3373
- ), ((r = e.value.platform.mappings) == null ? void 0 : r.version) == "v2" && await b(
3373
+ ), ((n = e.value.platform.mappings) == null ? void 0 : n.version) == "v2" && await k(
3374
3374
  Je,
3375
- V,
3376
- h,
3375
+ w,
3376
+ b,
3377
3377
  "Failed to fetch customers:"
3378
- ), F.value.isLoaded = !0, h.value.isLoaded = !0;
3378
+ ), C.value.isLoaded = !0, b.value.isLoaded = !0;
3379
3379
  };
3380
- return Ee(u), ve(() => {
3381
- var p;
3382
- return (p = e.value.platform.mappings) == null ? void 0 : p.version;
3383
- }, u), (p, r) => {
3384
- var l, a, f;
3385
- const x = S("FmPageHead"), $ = S("FmTabs");
3386
- return c(), C("div", pn, [
3387
- i(x, {
3380
+ return Ee(d), ve(() => {
3381
+ var y;
3382
+ return (y = e.value.platform.mappings) == null ? void 0 : y.version;
3383
+ }, d), (y, n) => {
3384
+ var l, a, u;
3385
+ const v = S("FmPageHead"), $ = S("FmTabs");
3386
+ return c(), F("div", fn, [
3387
+ r(v, {
3388
3388
  title: ((l = e.value) == null ? void 0 : l.name) || "Biztory",
3389
3389
  "back-button": !0,
3390
3390
  style: { paddingLeft: "0px", paddingRight: "0px" },
3391
- "onClick:back": v(w).back
3391
+ "onClick:back": p(h).back
3392
3392
  }, {
3393
- description: ge(() => r[2] || (r[2] = [
3393
+ description: ge(() => n[2] || (n[2] = [
3394
3394
  t("div", null, null, -1)
3395
3395
  ])),
3396
3396
  _: 1
3397
3397
  }, 8, ["title", "onClick:back"]),
3398
- i($, {
3399
- "model-value": n.value,
3400
- "onUpdate:modelValue": r[0] || (r[0] = (s) => n.value = s),
3401
- items: k
3398
+ r($, {
3399
+ "model-value": s.value,
3400
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => s.value = i),
3401
+ items: V
3402
3402
  }, null, 8, ["model-value"]),
3403
- t("div", un, [
3403
+ t("div", vn, [
3404
3404
  (c(), M(xe((a = _.value) == null ? void 0 : a.component), Le({
3405
3405
  modelValue: e.value,
3406
- "onUpdate:modelValue": r[1] || (r[1] = (s) => e.value = s)
3407
- }, (f = _.value) == null ? void 0 : f.props), null, 16, ["modelValue"]))
3406
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => e.value = i)
3407
+ }, (u = _.value) == null ? void 0 : u.props), null, 16, ["modelValue"]))
3408
3408
  ])
3409
3409
  ]);
3410
3410
  };
3411
3411
  }
3412
- }), vn = {
3412
+ }), yn = {
3413
3413
  key: 0,
3414
3414
  class: "flex flex-col h-full"
3415
- }, gn = { class: "flex flex-col gap-16 pb-[24px]" }, yn = { class: "flex flex-row justify-between items-center gap-2" }, xn = { class: "flex flex-row gap-2 items-center" }, _n = { class: "relative group cursor-pointer" }, bn = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, wn = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, hn = { class: "flex flex-col gap-16" }, Vn = { class: "fm-typo-en-title-sm-800" }, kn = { class: "flex flex-row items-center max-w-[100%]" }, $n = { class: "w-[25%]" }, Sn = { class: "flex-grow" }, Cn = { class: "flex flex-row items-center max-w-[100%]" }, Fn = { class: "w-[25%]" }, Dn = { class: "flex flex-row items-center gap-x-16" }, Un = { class: "fm-typo-en-title-sm-800" }, Tn = { class: "grid-cols-1 grid gap-16" }, In = /* @__PURE__ */ q({
3415
+ }, xn = { class: "flex flex-col gap-16 pb-[24px]" }, _n = { class: "flex flex-row justify-between items-center gap-2" }, bn = { class: "flex flex-row gap-2 items-center" }, wn = { class: "relative group cursor-pointer" }, hn = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, Vn = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, kn = { class: "flex flex-col gap-16" }, $n = { class: "fm-typo-en-title-sm-800" }, Sn = { class: "flex flex-row items-center max-w-[100%]" }, Cn = { class: "w-[25%]" }, Fn = { class: "flex-grow" }, Dn = { class: "flex flex-row items-center max-w-[100%]" }, Un = { class: "w-[25%]" }, Tn = { class: "flex flex-row items-center gap-x-16" }, In = { class: "fm-typo-en-title-sm-800" }, Mn = { class: "grid-cols-1 grid gap-16" }, Kn = /* @__PURE__ */ q({
3416
3416
  __name: "Setting",
3417
3417
  props: {
3418
3418
  modelValue: { required: !0 },
3419
3419
  modelModifiers: {}
3420
3420
  },
3421
3421
  emits: ["update:modelValue"],
3422
- setup(g) {
3423
- const { t: o } = J(), e = X(g, "modelValue"), n = ue(), k = _e(), w = de(), { promptLoader: _ } = we(), { promptMessage: F } = Se(), { restaurants: h } = pe(), m = Y(
3424
- () => h.map((r) => ({ label: r.name, value: r.id }))
3422
+ setup(f) {
3423
+ const { t: o } = J(), e = X(f, "modelValue"), s = ue(), V = _e(), h = de(), { promptLoader: _ } = we(), { promptMessage: C } = Se(), { restaurants: b } = pe(), x = Y(
3424
+ () => b.map((n) => ({ label: n.name, value: n.id }))
3425
3425
  );
3426
- async function d() {
3427
- await F({
3426
+ async function m() {
3427
+ await C({
3428
3428
  message: o("report.messages.confirmDelete", { name: e.value.name }),
3429
3429
  title: o("report.common.delete")
3430
3430
  }) && await _(async () => {
3431
3431
  try {
3432
- await he(e.value._id), await k.getSettings(), w.back();
3433
- } catch (x) {
3434
- n.open({ type: "error", message: x.message });
3432
+ await he(e.value._id), await V.getSettings(), h.back();
3433
+ } catch (v) {
3434
+ s.open({ type: "error", message: v.message });
3435
3435
  }
3436
3436
  });
3437
3437
  }
3438
- async function V() {
3438
+ async function w() {
3439
3439
  await _(async () => {
3440
3440
  try {
3441
- await Ve(e.value._id, e.value), await k.getSettings();
3442
- } catch (r) {
3443
- n.open({ type: "error", message: r.message });
3441
+ await Ve(e.value._id, e.value), await V.getSettings();
3442
+ } catch (n) {
3443
+ s.open({ type: "error", message: n.message });
3444
3444
  }
3445
3445
  });
3446
3446
  }
3447
- function b(r, x) {
3447
+ function k(n, v) {
3448
3448
  var $, l;
3449
- (l = ($ = e.value.platform) == null ? void 0 : $.mappings) != null && l[r] && (e.value.platform.mappings[r] = e.value.platform.mappings[r].filter(
3450
- (a, f) => f !== x
3449
+ (l = ($ = e.value.platform) == null ? void 0 : $.mappings) != null && l[n] && (e.value.platform.mappings[n] = e.value.platform.mappings[n].filter(
3450
+ (a, u) => u !== v
3451
3451
  ));
3452
3452
  }
3453
- function u(r) {
3454
- var x, $;
3455
- ($ = (x = e.value.platform) == null ? void 0 : x.mappings) != null && $[r] && (e.value.platform.mappings[r] = [
3456
- ...e.value.platform.mappings[r],
3453
+ function d(n) {
3454
+ var v, $;
3455
+ ($ = (v = e.value.platform) == null ? void 0 : v.mappings) != null && $[n] && (e.value.platform.mappings[n] = [
3456
+ ...e.value.platform.mappings[n],
3457
3457
  {
3458
3458
  key: "",
3459
3459
  name: "",
@@ -3462,84 +3462,84 @@ const sn = [
3462
3462
  }
3463
3463
  ]);
3464
3464
  }
3465
- async function p() {
3465
+ async function y() {
3466
3466
  await _(async () => {
3467
3467
  try {
3468
- await ke(e.value._id), await k.getSettings();
3469
- } catch (r) {
3470
- n.open({ type: "error", message: r.message });
3468
+ await ke(e.value._id), await V.getSettings();
3469
+ } catch (n) {
3470
+ s.open({ type: "error", message: n.message });
3471
3471
  }
3472
3472
  });
3473
3473
  }
3474
- return (r, x) => {
3474
+ return (n, v) => {
3475
3475
  var A, P, Q, E, G;
3476
- const $ = S("FmIcon"), l = S("FmButton"), a = S("FmMenuDivider"), f = S("FmTextField"), s = S("FmSelect");
3477
- return (P = (A = e.value) == null ? void 0 : A.platform) != null && P.mappings ? (c(), C("div", vn, [
3478
- t("div", gn, [
3479
- t("div", yn, [
3480
- x[4] || (x[4] = t("div", { class: "fm-typo-en-title-sm-800" }, null, -1)),
3481
- t("div", xn, [
3482
- t("div", _n, [
3483
- i($, {
3476
+ const $ = S("FmIcon"), l = S("FmButton"), a = S("FmMenuDivider"), u = S("FmTextField"), i = S("FmSelect");
3477
+ return (P = (A = e.value) == null ? void 0 : A.platform) != null && P.mappings ? (c(), F("div", yn, [
3478
+ t("div", xn, [
3479
+ t("div", _n, [
3480
+ v[4] || (v[4] = t("div", { class: "fm-typo-en-title-sm-800" }, null, -1)),
3481
+ t("div", bn, [
3482
+ t("div", wn, [
3483
+ r($, {
3484
3484
  name: "refresh",
3485
3485
  class: "p-2 bg-gray-100 rounded-full",
3486
- onClick: p
3486
+ onClick: y
3487
3487
  }),
3488
- t("span", bn, T(v(o)("report.integration.refreshSetting")), 1)
3488
+ t("span", hn, T(p(o)("report.integration.refreshSetting")), 1)
3489
3489
  ]),
3490
- i(l, {
3490
+ r(l, {
3491
3491
  variant: "tertiary",
3492
- label: v(o)("report.common.delete"),
3493
- onClick: d
3492
+ label: p(o)("report.common.delete"),
3493
+ onClick: m
3494
3494
  }, null, 8, ["label"]),
3495
- i(l, {
3495
+ r(l, {
3496
3496
  variant: "primary",
3497
- label: v(o)("report.common.update"),
3498
- onClick: V
3497
+ label: p(o)("report.common.update"),
3498
+ onClick: w
3499
3499
  }, null, 8, ["label"])
3500
3500
  ])
3501
3501
  ])
3502
3502
  ]),
3503
- i(a, { style: { margin: 0 } }),
3504
- t("div", wn, [
3505
- t("div", hn, [
3506
- t("div", Vn, T(v(o)("report.integration.general")), 1),
3507
- t("div", kn, [
3508
- t("div", $n, T(v(o)("report.common.name")), 1),
3509
- t("div", Sn, [
3510
- i(f, {
3503
+ r(a, { style: { margin: 0 } }),
3504
+ t("div", Vn, [
3505
+ t("div", kn, [
3506
+ t("div", $n, T(p(o)("report.integration.general")), 1),
3507
+ t("div", Sn, [
3508
+ t("div", Cn, T(p(o)("report.common.name")), 1),
3509
+ t("div", Fn, [
3510
+ r(u, {
3511
3511
  modelValue: e.value.name,
3512
- "onUpdate:modelValue": x[0] || (x[0] = (R) => e.value.name = R)
3512
+ "onUpdate:modelValue": v[0] || (v[0] = (R) => e.value.name = R)
3513
3513
  }, null, 8, ["modelValue"])
3514
3514
  ])
3515
3515
  ]),
3516
- t("div", Cn, [
3517
- t("div", Fn, T(v(o)("report.integration.location")), 1),
3518
- i(s, {
3516
+ t("div", Dn, [
3517
+ t("div", Un, T(p(o)("report.integration.location")), 1),
3518
+ r(i, {
3519
3519
  "model-value": e.value.platform.locationIds[0],
3520
3520
  multiselect: !1,
3521
- items: m.value,
3521
+ items: x.value,
3522
3522
  placeholder: "Select location",
3523
3523
  class: "flex-grow",
3524
- "onUpdate:modelValue": x[1] || (x[1] = (R) => e.value.platform.locationIds[0] = R)
3524
+ "onUpdate:modelValue": v[1] || (v[1] = (R) => e.value.platform.locationIds[0] = R)
3525
3525
  }, null, 8, ["model-value", "items"])
3526
3526
  ])
3527
3527
  ]),
3528
- i(De, {
3528
+ r(De, {
3529
3529
  modelValue: e.value.platform,
3530
- "onUpdate:modelValue": x[2] || (x[2] = (R) => e.value.platform = R),
3531
- label: v(o)("report.input.email")
3530
+ "onUpdate:modelValue": v[2] || (v[2] = (R) => e.value.platform = R),
3531
+ label: p(o)("report.input.email")
3532
3532
  }, null, 8, ["modelValue", "label"]),
3533
- t("div", Dn, [
3534
- t("div", Un, T(v(o)("report.integration.iflexiHrms.employee")), 1),
3535
- i(l, {
3533
+ t("div", Tn, [
3534
+ t("div", In, T(p(o)("report.integration.iflexiHrms.employee")), 1),
3535
+ r(l, {
3536
3536
  variant: "primary",
3537
3537
  icon: "add",
3538
- onClick: x[3] || (x[3] = () => u("employees"))
3538
+ onClick: v[3] || (v[3] = () => d("employees"))
3539
3539
  })
3540
3540
  ]),
3541
- t("div", Tn, [
3542
- (c(!0), C(L, null, H((G = (E = (Q = e.value) == null ? void 0 : Q.platform) == null ? void 0 : E.mappings) == null ? void 0 : G.employees, (R, j) => (c(), M(K, {
3541
+ t("div", Mn, [
3542
+ (c(!0), F(L, null, H((G = (E = (Q = e.value) == null ? void 0 : Q.platform) == null ? void 0 : E.mappings) == null ? void 0 : G.employees, (R, j) => (c(), M(K, {
3543
3543
  key: `employee-${j}`,
3544
3544
  modelValue: e.value.platform.mappings.employees[j],
3545
3545
  "onUpdate:modelValue": (z) => e.value.platform.mappings.employees[j] = z,
@@ -3549,25 +3549,25 @@ const sn = [
3549
3549
  employeeNo: { placeholder: "Employee No", editable: !0 }
3550
3550
  },
3551
3551
  removable: !0,
3552
- onRemove: () => b("employees", j)
3552
+ onRemove: () => k("employees", j)
3553
3553
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onRemove"]))), 128))
3554
3554
  ])
3555
3555
  ])
3556
3556
  ])) : N("", !0);
3557
3557
  };
3558
3558
  }
3559
- }), Mn = { class: "h-full flex flex-col gap-16" }, Kn = { class: "flex flex-row gap-2 justify-between items-center" }, An = {
3559
+ }), An = { class: "h-full flex flex-col gap-16" }, Pn = { class: "flex flex-row gap-2 justify-between items-center" }, Nn = {
3560
3560
  key: 0,
3561
3561
  class: "flex gap-24 w-full h-full justify-center items-center overflow-scroll"
3562
- }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Nn = /* @__PURE__ */ q({
3562
+ }, Rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, On = /* @__PURE__ */ q({
3563
3563
  __name: "Preview",
3564
3564
  props: {
3565
3565
  modelValue: { required: !0 },
3566
3566
  modelModifiers: {}
3567
3567
  },
3568
3568
  emits: ["update:modelValue"],
3569
- setup(g) {
3570
- const { t: o } = J(), e = B([]), n = [
3569
+ setup(f) {
3570
+ const { t: o } = J(), e = B([]), s = [
3571
3571
  {
3572
3572
  accessorKey: "name",
3573
3573
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Name"),
@@ -3593,69 +3593,69 @@ const sn = [
3593
3593
  header: () => I("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Time"),
3594
3594
  enableSorting: !1
3595
3595
  }
3596
- ], k = X(g, "modelValue"), w = B(!1), _ = ue(), { dateRange: F } = Ce(pe());
3596
+ ], V = X(f, "modelValue"), h = B(!1), _ = ue(), { dateRange: C } = Ce(pe());
3597
3597
  ve(
3598
- () => F.value,
3598
+ () => C.value,
3599
3599
  async () => {
3600
- if (k.value._id)
3600
+ if (V.value._id)
3601
3601
  try {
3602
- w.value = !0, e.value = await $e(k.value._id);
3603
- } catch (m) {
3604
- _.open({ message: m.message, type: "error" });
3602
+ h.value = !0, e.value = await $e(V.value._id);
3603
+ } catch (x) {
3604
+ _.open({ message: x.message, type: "error" });
3605
3605
  } finally {
3606
- w.value = !1;
3606
+ h.value = !1;
3607
3607
  }
3608
3608
  },
3609
3609
  {
3610
3610
  immediate: !0
3611
3611
  }
3612
3612
  );
3613
- async function h() {
3613
+ async function b() {
3614
3614
  try {
3615
- k.value._id ? (w.value = !0, await Pe(k.value._id)) : _.open({ message: "Invalid setting", type: "error" });
3616
- } catch (m) {
3617
- _.open({ message: m.message, type: "error" });
3615
+ V.value._id ? (h.value = !0, await Pe(V.value._id)) : _.open({ message: "Invalid setting", type: "error" });
3616
+ } catch (x) {
3617
+ _.open({ message: x.message, type: "error" });
3618
3618
  } finally {
3619
- w.value = !1;
3619
+ h.value = !1;
3620
3620
  }
3621
3621
  }
3622
- return (m, d) => {
3623
- const V = S("FmButton"), b = S("FmCircularProgress"), u = S("FmTable");
3624
- return c(), C("div", Mn, [
3625
- t("div", Kn, [
3626
- i(Fe, {
3627
- "date-range": v(F),
3628
- "onUpdate:dateRange": d[0] || (d[0] = (p) => be(F) ? F.value = p : null),
3622
+ return (x, m) => {
3623
+ const w = S("FmButton"), k = S("FmCircularProgress"), d = S("FmTable");
3624
+ return c(), F("div", An, [
3625
+ t("div", Pn, [
3626
+ r(Fe, {
3627
+ "date-range": p(C),
3628
+ "onUpdate:dateRange": m[0] || (m[0] = (y) => be(C) ? C.value = y : null),
3629
3629
  compare: !1
3630
3630
  }, null, 8, ["date-range"]),
3631
- i(V, {
3632
- loading: w.value,
3631
+ r(w, {
3632
+ loading: h.value,
3633
3633
  variant: "primary",
3634
- label: v(o)("report.common.download"),
3635
- onClick: h
3634
+ label: p(o)("report.common.download"),
3635
+ onClick: b
3636
3636
  }, null, 8, ["loading", "label"])
3637
3637
  ]),
3638
- w.value ? (c(), C("div", An, [
3639
- i(b, { size: "xl" }),
3640
- t("span", Pn, T(v(o)("report.common.isLoading")), 1)
3641
- ])) : e.value.length > 0 ? (c(), M(u, {
3638
+ h.value ? (c(), F("div", Nn, [
3639
+ r(k, { size: "xl" }),
3640
+ t("span", Rn, T(p(o)("report.common.isLoading")), 1)
3641
+ ])) : e.value.length > 0 ? (c(), M(d, {
3642
3642
  key: 1,
3643
3643
  class: "flex overflow-scroll",
3644
3644
  "row-data": e.value,
3645
- "column-defs": n
3645
+ "column-defs": s
3646
3646
  }, null, 8, ["row-data"])) : N("", !0)
3647
3647
  ]);
3648
3648
  };
3649
3649
  }
3650
- }), Rn = { class: "h-full relative flex flex-col" }, On = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, Bn = /* @__PURE__ */ q({
3650
+ }), Bn = { class: "h-full relative flex flex-col" }, jn = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, Ln = /* @__PURE__ */ q({
3651
3651
  __name: "IFlexiHRMS",
3652
3652
  props: {
3653
3653
  modelValue: {},
3654
3654
  modelModifiers: {}
3655
3655
  },
3656
3656
  emits: ["update:modelValue"],
3657
- setup(g) {
3658
- const { t: o } = J(), e = X(g, "modelValue"), n = B("setting"), k = [
3657
+ setup(f) {
3658
+ const { t: o } = J(), e = X(f, "modelValue"), s = B("setting"), V = [
3659
3659
  {
3660
3660
  label: o("report.integration.setting"),
3661
3661
  value: "setting",
@@ -3666,86 +3666,86 @@ const sn = [
3666
3666
  value: "preview",
3667
3667
  icon: "table"
3668
3668
  }
3669
- ], w = de(), _ = Y(() => {
3670
- switch (n.value) {
3669
+ ], h = de(), _ = Y(() => {
3670
+ switch (s.value) {
3671
3671
  case "preview":
3672
- return Nn;
3672
+ return On;
3673
3673
  case "setting":
3674
- return In;
3674
+ return Kn;
3675
3675
  default:
3676
3676
  return null;
3677
3677
  }
3678
3678
  });
3679
- return (F, h) => {
3680
- var V;
3681
- const m = S("FmPageHead"), d = S("FmTabs");
3682
- return c(), C("div", Rn, [
3683
- i(m, {
3684
- title: ((V = e.value) == null ? void 0 : V.name) || "AutoCount",
3679
+ return (C, b) => {
3680
+ var w;
3681
+ const x = S("FmPageHead"), m = S("FmTabs");
3682
+ return c(), F("div", Bn, [
3683
+ r(x, {
3684
+ title: ((w = e.value) == null ? void 0 : w.name) || "AutoCount",
3685
3685
  "back-button": !0,
3686
3686
  style: { paddingLeft: "0px", paddingRight: "0px" },
3687
- "onClick:back": v(w).back
3687
+ "onClick:back": p(h).back
3688
3688
  }, {
3689
- description: ge(() => h[2] || (h[2] = [
3689
+ description: ge(() => b[2] || (b[2] = [
3690
3690
  t("div", null, null, -1)
3691
3691
  ])),
3692
3692
  _: 1
3693
3693
  }, 8, ["title", "onClick:back"]),
3694
- i(d, {
3695
- "model-value": n.value,
3696
- "onUpdate:modelValue": h[0] || (h[0] = (b) => n.value = b),
3697
- items: k
3694
+ r(m, {
3695
+ "model-value": s.value,
3696
+ "onUpdate:modelValue": b[0] || (b[0] = (k) => s.value = k),
3697
+ items: V
3698
3698
  }, null, 8, ["model-value"]),
3699
- t("div", On, [
3699
+ t("div", jn, [
3700
3700
  (c(), M(xe(_.value), {
3701
3701
  modelValue: e.value,
3702
- "onUpdate:modelValue": h[1] || (h[1] = (b) => e.value = b)
3702
+ "onUpdate:modelValue": b[1] || (b[1] = (k) => e.value = k)
3703
3703
  }, null, 8, ["modelValue"]))
3704
3704
  ])
3705
3705
  ]);
3706
3706
  };
3707
3707
  }
3708
- }), jn = { class: "px-24 h-full relative" }, Gn = /* @__PURE__ */ q({
3708
+ }), En = { class: "px-24 h-full relative" }, Wn = /* @__PURE__ */ q({
3709
3709
  __name: "Integration",
3710
- setup(g) {
3711
- const o = B(void 0), { params: e } = ze(), n = _e(), k = B();
3710
+ setup(f) {
3711
+ const o = B(void 0), { params: e } = ze(), s = _e(), V = B();
3712
3712
  Ee(async () => {
3713
- n.settings.length === 0 && await n.getSettings();
3713
+ s.settings.length === 0 && await s.getSettings();
3714
3714
  }), ve(
3715
- () => n.settings,
3715
+ () => s.settings,
3716
3716
  (_) => {
3717
- var h;
3718
- const F = _.find((m) => m._id === e.id);
3719
- F && (k.value = F, o.value = (h = k.value.platform) == null ? void 0 : h.name);
3717
+ var b;
3718
+ const C = _.find((x) => x._id === e.id);
3719
+ C && (V.value = C, o.value = (b = V.value.platform) == null ? void 0 : b.name);
3720
3720
  },
3721
3721
  { immediate: !0 }
3722
3722
  );
3723
- const w = Y(() => {
3723
+ const h = Y(() => {
3724
3724
  switch (o.value) {
3725
3725
  case ce.Xero:
3726
- return Zt;
3726
+ return eo;
3727
3727
  case ce.Bukku:
3728
- return Eo;
3728
+ return zo;
3729
3729
  case ce.AutoCount:
3730
- return $a;
3730
+ return Sa;
3731
3731
  case ce.SQL:
3732
- return rl;
3732
+ return ml;
3733
3733
  case ce.iFlexi_HRMS:
3734
- return Bn;
3734
+ return Ln;
3735
3735
  case ce.Biztory:
3736
- return fn;
3736
+ return gn;
3737
3737
  default:
3738
3738
  return null;
3739
3739
  }
3740
3740
  });
3741
- return (_, F) => (c(), C("div", jn, [
3742
- (c(), M(xe(w.value), {
3743
- modelValue: k.value,
3744
- "onUpdate:modelValue": F[0] || (F[0] = (h) => k.value = h)
3741
+ return (_, C) => (c(), F("div", En, [
3742
+ (c(), M(xe(h.value), {
3743
+ modelValue: V.value,
3744
+ "onUpdate:modelValue": C[0] || (C[0] = (b) => V.value = b)
3745
3745
  }, null, 8, ["modelValue"]))
3746
3746
  ]));
3747
3747
  }
3748
3748
  });
3749
3749
  export {
3750
- Gn as default
3750
+ Wn as default
3751
3751
  };