@feedmepos/mf-payment 1.7.9-dev → 1.7.12-dev

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 (82) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-DWLo1wcm.js → Actions.vue_vue_type_script_setup_true_lang-DdBG90HC.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-Cr5NV0ER.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-C2J73WMk.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-B78DrbUV.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-tYdz0j81.js} +18 -18
  4. package/dist/{Chargeback-By_S7vnJ.js → Chargeback-D_wFz2p4.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-B3O4-wkG.js → DocumentViewer.vue_vue_type_script_setup_true_lang-CGNrd4fE.js} +484 -489
  6. package/dist/{OnboardForm-m31RX8SN.js → OnboardForm-B102bmRL.js} +12 -11
  7. package/dist/{OnboardForm-BYh2dN26.js → OnboardForm-CMRWUCyg.js} +5 -5
  8. package/dist/{OnboardSubmission-CjZWeW_E.js → OnboardSubmission-CPMns68t.js} +17 -17
  9. package/dist/{OnboardSubmission-BjlAVowH.js → OnboardSubmission-DpkSlN4r.js} +3 -3
  10. package/dist/{PayoutAccount-BfyuYYzs.js → PayoutAccount-BNGyzqNn.js} +5 -5
  11. package/dist/{PayoutAccount-C6km-4G3.js → PayoutAccount-D6eA7HmO.js} +42 -42
  12. package/dist/{PayoutAccountSetting-DWfjVMLb.js → PayoutAccountSetting-DS78fsR3.js} +6 -6
  13. package/dist/{Restaurant-Brhh_fMP.js → Restaurant-Cio7VUkb.js} +4 -4
  14. package/dist/{RestaurantSetting-C-GNgMOs.js → RestaurantSetting-B6gL7KQL.js} +3 -3
  15. package/dist/{Settlement-CScOnw9b.js → Settlement-DeFs2PQv.js} +3 -3
  16. package/dist/{Settlement-BcDMYdw_.js → Settlement-Dp5vZd70.js} +4 -4
  17. package/dist/{SettlementTransactions-C31RnVCZ.js → SettlementTransactions-CIxhmKO6.js} +11 -10
  18. package/dist/{SettlementTransactions-BPSCKH8z.js → SettlementTransactions-Dp8voo7Z.js} +11 -10
  19. package/dist/{Status.vue_vue_type_script_setup_true_lang-DC9_-kUz.js → Status.vue_vue_type_script_setup_true_lang-pJqWxDgv.js} +4 -4
  20. package/dist/{Terminal-nXbZ8iVQ.js → Terminal-l_eDclB4.js} +5 -5
  21. package/dist/TerminalSetting-xEgYGJQR.js +6863 -0
  22. package/dist/{Transaction-6NZwr5Df.js → Transaction-CY7_Dise.js} +10 -10
  23. package/dist/{Transaction-CYoFufei.js → Transaction-Cquf2CrF.js} +37 -36
  24. package/dist/{TransactionOld-CTdPTMGh.js → TransactionOld-BP_TbT0Z.js} +7 -7
  25. package/dist/TransactionStatus.vue_vue_type_script_setup_true_lang-C949IMDd.js +89 -0
  26. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  27. package/dist/{app-D57WXCrH.js → app-C1R-s4Ra.js} +36 -36
  28. package/dist/app.js +1 -1
  29. package/dist/assets-C0Lm2EH8.js +92 -0
  30. package/dist/{grafana-BYnm1r5S.js → grafana-B85M84CD.js} +1 -1
  31. package/dist/{index-CuTTkcVR.js → index-BBVX5lcY.js} +1 -1
  32. package/dist/{index-Cb4fwFWy.js → index-DW5Pjtqn.js} +1 -1
  33. package/dist/{index-CZ10wUcS.js → index-DYGKTL5K.js} +2 -2
  34. package/dist/{index-BpSlgd3s.js → index-DjwoAOnA.js} +11510 -11016
  35. package/dist/{index-PcsmeEGJ.js → index-DpHk2KjO.js} +1 -1
  36. package/dist/{index-B0sdc-mA.js → index-DrvpGxk3.js} +1 -1
  37. package/dist/{index-DAun0yIF.js → index-OIrlcwQj.js} +1 -1
  38. package/dist/{index-CP93polV.js → index-Oou8q_A6.js} +1 -1
  39. package/dist/{index-6C22iquA.js → index-llYeDBcp.js} +1 -1
  40. package/dist/{index.vue_vue_type_script_setup_true_lang-Di0E4edn.js → index.vue_vue_type_script_setup_true_lang-7YqB76ok.js} +1 -1
  41. package/dist/{onboard-submission-DL10gjS7.js → onboard-submission-BvMXI4-2.js} +3 -3
  42. package/dist/package.json +2 -2
  43. package/dist/{payout-account-BCKw7oJN.js → payout-account-DS6DzoQ6.js} +19 -19
  44. package/dist/stores/payoutAccount.d.ts +22 -22
  45. package/dist/style.css +1 -1
  46. package/dist/tsconfig.app.tsbuildinfo +1 -1
  47. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +22 -22
  48. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +26 -26
  49. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +26 -26
  50. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +22 -22
  51. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +22 -22
  52. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +26 -26
  53. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  54. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  55. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +34 -0
  56. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +34 -0
  57. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +34 -0
  58. package/dist/views/admin/terminal/tabs/PaymentCheckout.vue.d.ts +174 -0
  59. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +34 -0
  60. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +34 -0
  61. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +34 -0
  62. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +34 -0
  63. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +34 -0
  64. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +34 -0
  65. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +34 -0
  66. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +34 -0
  67. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +34 -0
  68. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +34 -0
  69. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +34 -0
  70. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +34 -0
  71. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +34 -0
  72. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +34 -0
  73. package/dist/views/admin/terminal/tabs/ecr/RevenueGateway.vue.d.ts +34 -0
  74. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +34 -0
  75. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +34 -0
  76. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +34 -0
  77. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +44 -44
  78. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +12 -12
  79. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +6 -6
  80. package/package.json +2 -2
  81. package/dist/TerminalSetting-D4d4jfHO.js +0 -2269
  82. package/dist/assets-CoMF0iyt.js +0 -177
@@ -1,2269 +0,0 @@
1
- import { defineComponent as R, openBlock as y, createElementBlock as S, Fragment as P, createElementVNode as I, createTextVNode as j, toDisplayString as W, ref as b, resolveComponent as g, createVNode as v, createCommentVNode as V, unref as M, computed as k, isRef as Z, createBlock as F, resolveDynamicComponent as ee, normalizeProps as ae, mergeProps as te, watch as q, onBeforeUnmount as ve, toRef as A, onMounted as G, withCtx as O, renderList as B } from "vue";
2
- import { u as le, p as ye, e as U } from "./index-BpSlgd3s.js";
3
- import { useRouter as fe } from "vue-router";
4
- import { t as K } from "./index-CP93polV.js";
5
- import { _ as ge } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
6
- import { u as ne } from "./index-6C22iquA.js";
7
- import { useSnackbar as se } from "@feedmepos/ui-library";
8
- import { u as X } from "./error-K1CakhA9.js";
9
- import { useI18n as be, useCoreStore as oe } from "@feedmepos/mf-common";
10
- import { o as Te } from "./index-CZ10wUcS.js";
11
- import { c as _e } from "./index-MdV54cWO.js";
12
- import { z as ue, a as ce } from "./validator-CTlVogBQ.js";
13
- const Ie = /* @__PURE__ */ R({
14
- __name: "Information",
15
- props: {
16
- terminal: {
17
- type: Object,
18
- required: !0
19
- }
20
- },
21
- setup(_) {
22
- return (p, a) => (y(), S(P, null, [
23
- a[0] || (a[0] = I("b", null, "Name", -1)),
24
- j(": " + W(_.terminal.name), 1),
25
- a[1] || (a[1] = I("br", null, null, -1)),
26
- a[2] || (a[2] = I("b", null, "Status", -1)),
27
- j(": " + W(_.terminal.status), 1),
28
- a[3] || (a[3] = I("br", null, null, -1)),
29
- a[4] || (a[4] = I("b", null, "Device ID", -1)),
30
- j(": " + W(_.terminal.deviceId ?? "-"), 1),
31
- a[5] || (a[5] = I("br", null, null, -1)),
32
- a[6] || (a[6] = I("b", null, "Device Type", -1)),
33
- j(": " + W(_.terminal.deviceType ?? "-"), 1),
34
- a[7] || (a[7] = I("br", null, null, -1))
35
- ], 64));
36
- }
37
- }), Fe = { key: 0 }, we = { class: "mt-6 space-x-6" }, xe = /* @__PURE__ */ R({
38
- __name: "KioskMode",
39
- props: {
40
- terminal: {
41
- type: Object,
42
- required: !0
43
- }
44
- },
45
- setup(_) {
46
- const { isLoading: p, startAsyncCall: a } = le(!1), T = se(), l = b({
47
- enable: !1,
48
- password: []
49
- }), r = _;
50
- function e() {
51
- return l.value.enable && l.value.password.filter((m) => !!m).length !== 6 ? T.open({
52
- type: "error",
53
- message: "Unlock PIN is required when setting up kiosk mode for terminal."
54
- }) : a(async () => {
55
- const m = { enable: l.value.enable };
56
- m.enable && Object.assign(m, {
57
- password: l.value.password.join("")
58
- });
59
- const c = await K.kioskModeRequest(r.terminal._id, m);
60
- if (c === "OK")
61
- return T.open({ type: "info", message: "Kiosk mode applied successfully." });
62
- let f = c;
63
- return c === "client_not_connected" && (f = "Terminal not connected to the websocket server."), c.startsWith("terminal: ") && (f = c.replaceAll("terminal: ", "")), T.open({
64
- type: "error",
65
- message: f
66
- });
67
- });
68
- }
69
- return (m, c) => {
70
- const f = g("FmSwitch"), u = g("FmPinField"), s = g("FmButton");
71
- return y(), S(P, null, [
72
- v(f, {
73
- modelValue: l.value.enable,
74
- "onUpdate:modelValue": c[0] || (c[0] = (t) => l.value.enable = t),
75
- label: "Enable Kiosk Mode?"
76
- }, null, 8, ["modelValue"]),
77
- l.value.enable ? (y(), S("div", Fe, [
78
- c[2] || (c[2] = I("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
79
- v(u, {
80
- modelValue: l.value.password,
81
- "onUpdate:modelValue": c[1] || (c[1] = (t) => l.value.password = t)
82
- }, null, 8, ["modelValue"])
83
- ])) : V("", !0),
84
- I("div", we, [
85
- v(s, {
86
- variant: "primary",
87
- label: "Send",
88
- icon: "send",
89
- loading: M(p),
90
- onclick: e
91
- }, null, 8, ["loading"])
92
- ])
93
- ], 64);
94
- };
95
- }
96
- }), Ne = /* @__PURE__ */ R({
97
- __name: "SettingRequest",
98
- props: {
99
- terminal: {
100
- type: Object,
101
- required: !0
102
- }
103
- },
104
- setup(_) {
105
- const { settingTab: p } = ne({
106
- settingTab: "kiosk_mode"
107
- }), a = [
108
- {
109
- label: "Kiosk Mode",
110
- value: "kiosk_mode",
111
- render: xe
112
- }
113
- ], T = _, l = k(() => a.find((r) => r.value === p.value));
114
- return (r, e) => {
115
- var c;
116
- const m = g("FmTabs");
117
- return y(), S(P, null, [
118
- e[1] || (e[1] = I("p", { className: "mt-1 my-6 text-gray-600" }, [
119
- I("b", null, "Note: "),
120
- j(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
121
- ], -1)),
122
- v(m, {
123
- "model-value": M(p),
124
- "onUpdate:modelValue": e[0] || (e[0] = (f) => Z(p) ? p.value = f : null),
125
- class: "mb-6",
126
- items: a
127
- }, null, 8, ["model-value"]),
128
- M(p) ? (y(), F(ee((c = l.value) == null ? void 0 : c.render), ae(te({ key: 0 }, { terminal: T.terminal })), null, 16)) : V("", !0)
129
- ], 64);
130
- };
131
- }
132
- }), Ce = 2e3, ke = 12e4, Ve = "Timed out waiting for the Tyro reader to sync. Please try again.";
133
- function Ue(_) {
134
- const { isLoading: p, startLoading: a, stopLoading: T } = le(!1), { t: l } = be(), r = se(), e = b(null), m = k(() => {
135
- var $, E;
136
- const C = ($ = _.value.gateways) == null ? void 0 : $.find(
137
- (D) => D.gateway === "Tyro"
138
- );
139
- return ((E = C == null ? void 0 : C.config) == null ? void 0 : E.uniqueId) || "";
140
- }), c = k(() => !!m.value), f = k(() => {
141
- var C;
142
- return ((C = e.value) == null ? void 0 : C.status) === "ready";
143
- }), u = k(() => {
144
- var C, $;
145
- return f.value && !!(($ = (C = e.value) == null ? void 0 : C.fields) != null && $.tyroLocationId) && !!_.value.deviceId && !c.value;
146
- }), s = k(() => !f.value && !c.value), t = k(
147
- () => l("payment.onboard-submission.tyro.syncDisabledHint")
148
- ), o = k(() => c.value ? "Synced" : "Sync");
149
- async function i() {
150
- if (!_.value.referenceId) {
151
- e.value = null;
152
- return;
153
- }
154
- try {
155
- const C = await Te.getByRestaurant(
156
- _.value.referenceId
157
- );
158
- e.value = C.find(
159
- ($) => $.type === ye.FdoOnboardType.enum.tyro
160
- ) ?? null;
161
- } catch (C) {
162
- e.value = null, r.open({
163
- type: "error",
164
- message: X(C)
165
- });
166
- }
167
- }
168
- const d = _e({
169
- intervalMs: Ce,
170
- timeoutMs: ke,
171
- onTick: async ({ isCurrentRun: C, stop: $ }) => {
172
- var H, z;
173
- const E = await K.readById(_.value._id);
174
- if (!C())
175
- return;
176
- const D = (H = E.gateways) == null ? void 0 : H.find((Q) => Q.gateway === "Tyro");
177
- (D == null ? void 0 : D.gateway) === "Tyro" && ((z = D == null ? void 0 : D.config) != null && z.uniqueId) && ($({ invalidate: !1 }), T(), Object.assign(_.value, E), r.open({
178
- type: "success",
179
- message: "Tyro reader created successfully"
180
- }));
181
- },
182
- onTimeout: () => {
183
- T(), r.open({
184
- type: "error",
185
- message: Ve
186
- });
187
- },
188
- onError: (C) => {
189
- T(), r.open({
190
- type: "error",
191
- message: X(C)
192
- });
193
- }
194
- }), x = d.isPolling;
195
- function n() {
196
- d.stop(), T();
197
- }
198
- function w() {
199
- n(), a(), d.start();
200
- }
201
- async function L() {
202
- if (!u.value) {
203
- r.open({
204
- type: "error",
205
- message: "Tyro reader sync is not available"
206
- });
207
- return;
208
- }
209
- try {
210
- a(), await K.syncTyroReader(_.value._id), w();
211
- } catch (C) {
212
- n(), r.open({
213
- type: "error",
214
- message: X(C)
215
- });
216
- }
217
- }
218
- return q(
219
- () => _.value.referenceId,
220
- async () => {
221
- await i();
222
- },
223
- { immediate: !0 }
224
- ), ve(() => {
225
- n();
226
- }), {
227
- isLoading: p,
228
- isPollingTyroReader: x,
229
- uniqueId: m,
230
- canSyncTyroReader: u,
231
- showTyroSyncPopover: s,
232
- tyroSyncPopoverMessage: t,
233
- tyroSyncButtonLabel: o,
234
- syncTyroReader: L
235
- };
236
- }
237
- const Se = {
238
- key: 0,
239
- class: "text-sm text-gray-500"
240
- }, Re = { class: "flex mt-6 space-x-6" }, he = { class: "flex-1" }, Me = /* @__PURE__ */ R({
241
- __name: "SoftposGateway",
242
- props: {
243
- terminal: {
244
- type: Object,
245
- required: !0
246
- },
247
- onUpdate: {
248
- type: Function,
249
- required: !0
250
- }
251
- },
252
- setup(_) {
253
- const p = _, a = oe().currentCountry, T = [
254
- {
255
- label: "Fiuu Malaysia",
256
- value: "cc.feedme.payment.rms",
257
- region: U.F_COUNTRY.enum.MY,
258
- gateway: "Fiuu",
259
- isLegacy: !0,
260
- isOutdated: !0
261
- },
262
- {
263
- label: "Fiuu Malaysia V2",
264
- value: "cc.feedme.payment.fiuu_my",
265
- region: U.F_COUNTRY.enum.MY,
266
- gateway: "Fiuu",
267
- isLegacy: !0
268
- },
269
- {
270
- label: "Fiuu Singapore",
271
- value: "cc.feedme.payment.fiuu_sg",
272
- region: U.F_COUNTRY.enum.SG,
273
- gateway: "Fiuu",
274
- isLegacy: !0
275
- },
276
- {
277
- label: "Softspace Malaysia",
278
- value: "cc.feedme.payment.softspace_my",
279
- gateway: "Softspace",
280
- region: U.F_COUNTRY.enum.MY
281
- },
282
- {
283
- label: "Digio Thailand",
284
- value: "cc.feedme.payment.digio_th",
285
- gateway: "Digio",
286
- region: U.F_COUNTRY.enum.TH
287
- },
288
- {
289
- label: "Tyro Australia",
290
- value: "cc.feedme.payment.tyro_au",
291
- gateway: "Tyro",
292
- region: U.F_COUNTRY.enum.AU
293
- }
294
- ], l = A(() => p.terminal), r = b(), e = b({
295
- packageId: "",
296
- uniqueId: "",
297
- developerId: "",
298
- isUat: !1
299
- }), m = () => {
300
- e.value.uniqueId = "", e.value.packageId = "", e.value.developerId = "", e.value.isUat = !1;
301
- }, c = k(() => T.filter((N) => N.region === a.value)), f = k(() => c.value.find(
302
- (N) => N.value === e.value.packageId
303
- )), u = k(
304
- () => {
305
- var N;
306
- return ((N = f.value) == null ? void 0 : N.gateway) === "Tyro";
307
- }
308
- ), {
309
- isLoading: s,
310
- isPollingTyroReader: t,
311
- uniqueId: o,
312
- canSyncTyroReader: i,
313
- showTyroSyncPopover: d,
314
- tyroSyncPopoverMessage: x,
315
- tyroSyncButtonLabel: n,
316
- syncTyroReader: w
317
- } = Ue(l), L = k(() => u.value ? "button" : "submit"), C = k(() => u.value ? n.value : "Save"), $ = k(() => u.value ? s.value : !1), E = k(() => u.value ? !i.value || t.value : !1), D = () => {
318
- if (!l.value.gateways || l.value.gateways.length === 0)
319
- return m();
320
- const N = l.value.gateways[0];
321
- if (!N.config)
322
- return m();
323
- if (N.gateway === "Tyro") {
324
- e.value = {
325
- packageId: N.config.packageId,
326
- uniqueId: N.config.uniqueId,
327
- developerId: "",
328
- isUat: !1
329
- };
330
- return;
331
- }
332
- switch (N.gateway) {
333
- case "Fiuu":
334
- e.value = {
335
- packageId: N.config.packageId,
336
- uniqueId: N.config.uniqueId,
337
- developerId: "",
338
- isUat: !1
339
- };
340
- break;
341
- case "Softspace":
342
- case "Digio":
343
- const h = JSON.parse(N.config.uniqueId);
344
- e.value = {
345
- packageId: N.config.packageId,
346
- uniqueId: h.uniqueId,
347
- developerId: h.developerId,
348
- isUat: h.isUat
349
- };
350
- return;
351
- }
352
- };
353
- q(l, D), G(D);
354
- async function H() {
355
- const N = f.value;
356
- if (!N)
357
- return;
358
- let h = e.value.uniqueId;
359
- N.isLegacy || (h = JSON.stringify({
360
- uniqueId: e.value.uniqueId,
361
- developerId: e.value.developerId,
362
- isUat: e.value.isUat
363
- }));
364
- const re = {
365
- gateway: N.gateway,
366
- config: {
367
- packageId: N.value,
368
- uniqueId: h
369
- }
370
- };
371
- (!l.value.gateways || l.value.gateways.length > 1) && (l.value.gateways = []), l.value.gateways[0] = re, await p.onUpdate(l.value);
372
- }
373
- async function z(N) {
374
- var h;
375
- (h = l.value.gateways) == null || h.splice(N, 1), p.onUpdate(l.value);
376
- }
377
- function Q() {
378
- u.value && w();
379
- }
380
- return (N, h) => {
381
- const re = g("FmSelect"), J = g("FmTextField"), de = g("FmCheckbox"), ie = g("FmButton"), pe = g("FmTooltip"), me = g("FmForm");
382
- return y(), F(me, {
383
- ref: r.value,
384
- class: "flex flex-col gap-16 w-[500px]",
385
- onValidationSuccess: H
386
- }, {
387
- default: O(() => [
388
- v(re, {
389
- modelValue: e.value.packageId,
390
- "onUpdate:modelValue": h[0] || (h[0] = (Y) => e.value.packageId = Y),
391
- label: "Package ID",
392
- items: c.value
393
- }, null, 8, ["modelValue", "items"]),
394
- f.value ? (y(), S(P, { key: 0 }, [
395
- u.value ? (y(), F(J, {
396
- key: 0,
397
- "model-value": M(o),
398
- label: "Unique ID (Reader ID)",
399
- disabled: ""
400
- }, null, 8, ["model-value"])) : f.value && f.value.isLegacy ? (y(), S(P, { key: 1 }, [
401
- v(J, {
402
- modelValue: e.value.uniqueId,
403
- "onUpdate:modelValue": h[1] || (h[1] = (Y) => e.value.uniqueId = Y),
404
- label: "Unique ID (TID)"
405
- }, null, 8, ["modelValue"]),
406
- f.value.isOutdated ? (y(), S("span", Se, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : V("", !0)
407
- ], 64)) : (y(), S(P, { key: 2 }, [
408
- v(J, {
409
- modelValue: e.value.developerId,
410
- "onUpdate:modelValue": h[2] || (h[2] = (Y) => e.value.developerId = Y),
411
- label: "Developer ID (MID)"
412
- }, null, 8, ["modelValue"]),
413
- v(J, {
414
- modelValue: e.value.uniqueId,
415
- "onUpdate:modelValue": h[3] || (h[3] = (Y) => e.value.uniqueId = Y),
416
- label: "Unique ID (TID)"
417
- }, null, 8, ["modelValue"]),
418
- v(de, {
419
- modelValue: e.value.isUat,
420
- "onUpdate:modelValue": h[4] || (h[4] = (Y) => e.value.isUat = Y),
421
- label: "Is UAT (Test)",
422
- value: "1"
423
- }, null, 8, ["modelValue"])
424
- ], 64)),
425
- I("div", Re, [
426
- l.value.gateways && l.value.gateways.length > 0 ? (y(), F(ie, {
427
- key: 0,
428
- class: "flex-1",
429
- variant: "secondary",
430
- label: "Delete",
431
- onclick: () => z(0)
432
- }, null, 8, ["onclick"])) : V("", !0),
433
- u.value && M(d) && E.value ? (y(), F(pe, {
434
- key: 1,
435
- class: "flex-1",
436
- variant: "plain",
437
- placement: "top",
438
- content: M(x)
439
- }, {
440
- default: O(() => [
441
- I("div", he, [
442
- v(ie, {
443
- type: L.value,
444
- class: "w-full",
445
- variant: "primary",
446
- loading: $.value,
447
- disabled: E.value,
448
- label: C.value,
449
- onClick: Q
450
- }, null, 8, ["type", "loading", "disabled", "label"])
451
- ])
452
- ]),
453
- _: 1
454
- }, 8, ["content"])) : (y(), F(ie, {
455
- key: 2,
456
- type: L.value,
457
- class: "flex-1",
458
- variant: "primary",
459
- loading: $.value,
460
- disabled: E.value,
461
- label: C.value,
462
- onClick: Q
463
- }, null, 8, ["type", "loading", "disabled", "label"]))
464
- ])
465
- ], 64)) : V("", !0)
466
- ]),
467
- _: 1
468
- }, 512);
469
- };
470
- }
471
- }), Oe = {
472
- key: 0,
473
- class: "flex items-center justify-center min-h-[80vh]"
474
- }, Pe = { class: "flex mt-6 space-x-6" }, qe = /* @__PURE__ */ R({
475
- __name: "TerminalGateway",
476
- props: {
477
- terminal: {
478
- type: Object,
479
- required: !0
480
- },
481
- onUpdate: {
482
- type: Function,
483
- required: !0
484
- }
485
- },
486
- setup(_) {
487
- const { isLoading: p, startAsyncCall: a } = le(), T = _, l = A(() => T.terminal), r = b(), e = b(), m = b(-1), c = b({
488
- terminalId: ""
489
- }), f = () => {
490
- c.value.terminalId = "", m.value = -1;
491
- }, u = () => {
492
- if (a(async () => {
493
- r.value = await K.getRestaurantTerminals(T.terminal.referenceId);
494
- }), !T.terminal.ecrs)
495
- return f();
496
- const o = T.terminal.ecrs.findIndex((d) => d && d.gateway && d.gateway === "FeedMe");
497
- if (o === -1)
498
- return f();
499
- m.value = o;
500
- const i = T.terminal.ecrs.at(o);
501
- i.gateway === "FeedMe" && i.config && (c.value = {
502
- terminalId: i.config.terminalId
503
- });
504
- };
505
- q(l, u), G(u);
506
- const s = k(() => (r.value ?? []).map((o) => ({
507
- label: o.name ?? o._id,
508
- value: o._id
509
- })));
510
- async function t(o) {
511
- var i;
512
- (i = T.terminal.ecrs) == null || i.splice(o, 1), T.onUpdate(T.terminal);
513
- }
514
- return (o, i) => {
515
- const d = g("FmCircularProgress"), x = g("FmSelect"), n = g("FmButton"), w = g("FmForm");
516
- return M(p) ? (y(), S("div", Oe, [
517
- v(d, { size: "xxl" })
518
- ])) : (y(), F(w, {
519
- key: 1,
520
- ref: e.value,
521
- class: "flex flex-col gap-16 w-[500px]",
522
- onValidationSuccess: i[1] || (i[1] = () => {
523
- m.value > -1 ? l.value.ecrs[m.value] = { gateway: "FeedMe", config: c.value } : (l.value.ecrs || (l.value.ecrs = []), l.value.ecrs.push({ gateway: "FeedMe", config: c.value })), T.onUpdate(l.value);
524
- })
525
- }, {
526
- default: O(() => [
527
- v(x, {
528
- modelValue: c.value.terminalId,
529
- "onUpdate:modelValue": i[0] || (i[0] = (L) => c.value.terminalId = L),
530
- label: "Terminal ID",
531
- items: s.value,
532
- rules: M(ue)(M(ce).string())
533
- }, null, 8, ["modelValue", "items", "rules"]),
534
- I("div", Pe, [
535
- m.value > -1 ? (y(), F(n, {
536
- key: 0,
537
- class: "flex-1",
538
- variant: "secondary",
539
- label: "Delete",
540
- onclick: () => t(m.value)
541
- }, null, 8, ["onclick"])) : V("", !0),
542
- v(n, {
543
- type: "submit",
544
- class: "flex-1",
545
- variant: "primary",
546
- label: "Save"
547
- })
548
- ])
549
- ]),
550
- _: 1
551
- }, 512));
552
- };
553
- }
554
- }), Ge = { class: "flex mt-6 space-x-6" }, Ae = /* @__PURE__ */ R({
555
- __name: "GhlGateway",
556
- props: {
557
- terminal: {
558
- type: Object,
559
- required: !0
560
- },
561
- onUpdate: {
562
- type: Function,
563
- required: !0
564
- }
565
- },
566
- setup(_) {
567
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b({
568
- merchantId: "",
569
- terminalId: "",
570
- privateKey: ""
571
- }), e = () => {
572
- r.value.merchantId = "", r.value.terminalId = "", r.value.privateKey = "", l.value = -1;
573
- }, m = () => {
574
- if (!a.value.ecrs)
575
- return e();
576
- const f = a.value.ecrs.findIndex((s) => s && s.gateway && s.gateway === "Ghl");
577
- if (f === -1)
578
- return e();
579
- l.value = f;
580
- const u = a.value.ecrs.at(f);
581
- u.gateway === "Ghl" && u.config && (r.value = {
582
- merchantId: u.config.merchantId,
583
- terminalId: u.config.terminalId,
584
- privateKey: u.config.privateKey || ""
585
- });
586
- };
587
- q(a, m), G(m);
588
- async function c(f) {
589
- var u;
590
- (u = a.value.ecrs) == null || u.splice(f, 1), p.onUpdate(a.value);
591
- }
592
- return (f, u) => {
593
- const s = g("FmTextField"), t = g("FmTextarea"), o = g("FmButton"), i = g("FmForm");
594
- return y(), F(i, {
595
- ref: T.value,
596
- class: "flex flex-col gap-16 w-[500px]",
597
- onValidationSuccess: u[3] || (u[3] = () => {
598
- l.value > -1 ? a.value.ecrs[l.value] = { gateway: "Ghl", config: r.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "Ghl", config: r.value })), p.onUpdate(a.value);
599
- })
600
- }, {
601
- default: O(() => [
602
- v(s, {
603
- modelValue: r.value.merchantId,
604
- "onUpdate:modelValue": u[0] || (u[0] = (d) => r.value.merchantId = d),
605
- label: "Merchant ID"
606
- }, null, 8, ["modelValue"]),
607
- v(s, {
608
- modelValue: r.value.terminalId,
609
- "onUpdate:modelValue": u[1] || (u[1] = (d) => r.value.terminalId = d),
610
- label: "Terminal ID"
611
- }, null, 8, ["modelValue"]),
612
- v(t, {
613
- modelValue: r.value.privateKey,
614
- "onUpdate:modelValue": u[2] || (u[2] = (d) => r.value.privateKey = d),
615
- label: "Private Key",
616
- "label-mark": "optional",
617
- "label-info": "Default will use FeedMe Private Key"
618
- }, null, 8, ["modelValue"]),
619
- I("div", Ge, [
620
- l.value > -1 ? (y(), F(o, {
621
- key: 0,
622
- class: "flex-1",
623
- variant: "secondary",
624
- label: "Delete",
625
- onclick: () => c(l.value)
626
- }, null, 8, ["onclick"])) : V("", !0),
627
- v(o, {
628
- type: "submit",
629
- class: "flex-1",
630
- variant: "primary",
631
- label: "Save"
632
- })
633
- ])
634
- ]),
635
- _: 1
636
- }, 512);
637
- };
638
- }
639
- }), $e = { class: "flex items-end" }, De = { class: "flex flex-wrap gap-8 items-center mt-4" }, Be = { class: "flex mt-6 space-x-6" }, Le = /* @__PURE__ */ R({
640
- __name: "MaybankGateway",
641
- props: {
642
- terminal: {
643
- type: Object,
644
- required: !0
645
- },
646
- onUpdate: {
647
- type: Function,
648
- required: !0
649
- }
650
- },
651
- setup(_) {
652
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
653
- ip: "",
654
- receiptName: "",
655
- cardTypes: []
656
- }), m = () => {
657
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
658
- }, c = () => {
659
- var i;
660
- if (!a.value.ecrIntegrations)
661
- return m();
662
- const s = a.value.ecrIntegrations, t = s.findIndex((d) => d && d.gateway && d.gateway === "Maybank");
663
- if (t === -1)
664
- return m();
665
- l.value = t;
666
- const o = s.at(t);
667
- o.gateway === "Maybank" && o.config && (e.value = {
668
- ip: o.config.ip ?? "",
669
- receiptName: o.receiptName ?? "",
670
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
671
- });
672
- };
673
- q(a, c), G(c);
674
- async function f(s) {
675
- var t;
676
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
677
- }
678
- async function u() {
679
- e.value.cardTypes.push(r.value), r.value = "";
680
- }
681
- return (s, t) => {
682
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
683
- return y(), F(x, {
684
- ref: T.value,
685
- class: "flex flex-col gap-16 w-[500px]",
686
- onValidationSuccess: t[3] || (t[3] = () => {
687
- var n, w;
688
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
689
- gateway: "Maybank",
690
- config: { ip: e.value.ip },
691
- receiptName: e.value.receiptName,
692
- dialogConfig: {
693
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
694
- cardTypes: e.value.cardTypes
695
- }
696
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
697
- gateway: "Maybank",
698
- config: { ip: e.value.ip },
699
- receiptName: e.value.receiptName,
700
- dialogConfig: {
701
- cardTypes: e.value.cardTypes
702
- }
703
- })), p.onUpdate(a.value);
704
- })
705
- }, {
706
- default: O(() => [
707
- v(o, {
708
- modelValue: e.value.ip,
709
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
710
- label: "IP Address"
711
- }, null, 8, ["modelValue"]),
712
- v(o, {
713
- modelValue: e.value.receiptName,
714
- "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
715
- label: "Receipt Payment Name",
716
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
717
- }, null, 8, ["modelValue"]),
718
- I("div", $e, [
719
- v(o, {
720
- modelValue: r.value,
721
- "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
722
- label: "Fallback Card Types",
723
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
724
- }, null, 8, ["modelValue"]),
725
- v(i, {
726
- class: "ml-4",
727
- icon: "add",
728
- onClick: u
729
- })
730
- ]),
731
- I("div", De, [
732
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
733
- key: n,
734
- label: n,
735
- removable: !0,
736
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
737
- }, null, 8, ["label", "onChipClosed"]))), 128))
738
- ]),
739
- I("div", Be, [
740
- l.value > -1 ? (y(), F(i, {
741
- key: 0,
742
- class: "flex-1",
743
- variant: "secondary",
744
- label: "Delete",
745
- onclick: () => f(l.value)
746
- }, null, 8, ["onclick"])) : V("", !0),
747
- v(i, {
748
- type: "submit",
749
- class: "flex-1",
750
- variant: "primary",
751
- label: "Save"
752
- })
753
- ])
754
- ]),
755
- _: 1
756
- }, 512);
757
- };
758
- }
759
- }), Ee = { class: "flex items-end" }, Ye = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ke = { class: "flex mt-6 space-x-6" }, je = /* @__PURE__ */ R({
760
- __name: "Maybank2Gateway",
761
- props: {
762
- terminal: {
763
- type: Object,
764
- required: !0
765
- },
766
- onUpdate: {
767
- type: Function,
768
- required: !0
769
- }
770
- },
771
- setup(_) {
772
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
773
- ip: "",
774
- receiptName: "",
775
- cardTypes: []
776
- }), m = () => {
777
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
778
- }, c = () => {
779
- var i;
780
- if (!a.value.ecrIntegrations)
781
- return m();
782
- const s = a.value.ecrIntegrations, t = s.findIndex((d) => d && d.gateway && d.gateway === "Maybank2");
783
- if (t === -1)
784
- return m();
785
- l.value = t;
786
- const o = s.at(t);
787
- o.gateway === "Maybank2" && o.config && (e.value = {
788
- ip: o.config.ip ?? "",
789
- receiptName: o.receiptName ?? "",
790
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
791
- });
792
- };
793
- q(a, c), G(c);
794
- async function f(s) {
795
- var t;
796
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
797
- }
798
- async function u() {
799
- e.value.cardTypes.push(r.value), r.value = "";
800
- }
801
- return (s, t) => {
802
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
803
- return y(), F(x, {
804
- ref: T.value,
805
- class: "flex flex-col gap-16 w-[500px]",
806
- onValidationSuccess: t[3] || (t[3] = () => {
807
- var n, w;
808
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
809
- gateway: "Maybank2",
810
- config: { ip: e.value.ip },
811
- receiptName: e.value.receiptName,
812
- dialogConfig: {
813
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
814
- cardTypes: e.value.cardTypes
815
- }
816
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
817
- gateway: "Maybank2",
818
- config: { ip: e.value.ip },
819
- receiptName: e.value.receiptName,
820
- dialogConfig: {
821
- cardTypes: e.value.cardTypes
822
- }
823
- })), p.onUpdate(a.value);
824
- })
825
- }, {
826
- default: O(() => [
827
- v(o, {
828
- modelValue: e.value.ip,
829
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
830
- label: "IP Address"
831
- }, null, 8, ["modelValue"]),
832
- v(o, {
833
- modelValue: e.value.receiptName,
834
- "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
835
- label: "Receipt Payment Name",
836
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
837
- }, null, 8, ["modelValue"]),
838
- I("div", Ee, [
839
- v(o, {
840
- modelValue: r.value,
841
- "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
842
- label: "Fallback Card Types",
843
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
844
- }, null, 8, ["modelValue"]),
845
- v(i, {
846
- class: "ml-4",
847
- icon: "add",
848
- onClick: u
849
- })
850
- ]),
851
- I("div", Ye, [
852
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
853
- key: n,
854
- label: n,
855
- removable: !0,
856
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
857
- }, null, 8, ["label", "onChipClosed"]))), 128))
858
- ]),
859
- I("div", Ke, [
860
- l.value > -1 ? (y(), F(i, {
861
- key: 0,
862
- class: "flex-1",
863
- variant: "secondary",
864
- label: "Delete",
865
- onclick: () => f(l.value)
866
- }, null, 8, ["onclick"])) : V("", !0),
867
- v(i, {
868
- type: "submit",
869
- class: "flex-1",
870
- variant: "primary",
871
- label: "Save"
872
- })
873
- ])
874
- ]),
875
- _: 1
876
- }, 512);
877
- };
878
- }
879
- }), He = { class: "flex items-end" }, ze = { class: "flex flex-wrap gap-8 items-center mt-4" }, Qe = { class: "flex mt-6 space-x-6" }, Je = /* @__PURE__ */ R({
880
- __name: "Maybank3Gateway",
881
- props: {
882
- terminal: {
883
- type: Object,
884
- required: !0
885
- },
886
- onUpdate: {
887
- type: Function,
888
- required: !0
889
- }
890
- },
891
- setup(_) {
892
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
893
- receiptName: "",
894
- config: {},
895
- cardTypes: []
896
- }), m = () => {
897
- e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
898
- }, c = () => {
899
- var i;
900
- if (!a.value.ecrIntegrations)
901
- return m();
902
- const s = a.value.ecrIntegrations, t = s.findIndex((d) => d && d.gateway && d.gateway === "Maybank3");
903
- if (t === -1)
904
- return m();
905
- l.value = t;
906
- const o = s.at(t);
907
- o.gateway === "Maybank3" && o.config && (e.value = {
908
- config: o.config,
909
- receiptName: o.receiptName ?? "",
910
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
911
- });
912
- };
913
- q(a, c), G(c);
914
- async function f(s) {
915
- var t;
916
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
917
- }
918
- async function u() {
919
- e.value.cardTypes.push(r.value), r.value = "";
920
- }
921
- return (s, t) => {
922
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
923
- return y(), F(x, {
924
- ref: T.value,
925
- class: "flex flex-col gap-16 w-[500px]",
926
- onValidationSuccess: t[2] || (t[2] = () => {
927
- var n, w;
928
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
929
- gateway: "Maybank3",
930
- config: e.value.config,
931
- receiptName: e.value.receiptName,
932
- dialogConfig: {
933
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
934
- cardTypes: e.value.cardTypes
935
- }
936
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
937
- gateway: "Maybank3",
938
- config: e.value.config,
939
- receiptName: e.value.receiptName,
940
- dialogConfig: {
941
- cardTypes: e.value.cardTypes
942
- }
943
- })), p.onUpdate(a.value);
944
- })
945
- }, {
946
- default: O(() => [
947
- v(o, {
948
- modelValue: e.value.receiptName,
949
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
950
- label: "Receipt Payment Name",
951
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
952
- }, null, 8, ["modelValue"]),
953
- I("div", He, [
954
- v(o, {
955
- modelValue: r.value,
956
- "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
957
- label: "Fallback Card Types",
958
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
959
- }, null, 8, ["modelValue"]),
960
- v(i, {
961
- class: "ml-4",
962
- icon: "add",
963
- onClick: u
964
- })
965
- ]),
966
- I("div", ze, [
967
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
968
- key: n,
969
- label: n,
970
- removable: !0,
971
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
972
- }, null, 8, ["label", "onChipClosed"]))), 128))
973
- ]),
974
- I("div", Qe, [
975
- l.value > -1 ? (y(), F(i, {
976
- key: 0,
977
- class: "flex-1",
978
- variant: "secondary",
979
- label: "Delete",
980
- onclick: () => f(l.value)
981
- }, null, 8, ["onclick"])) : V("", !0),
982
- v(i, {
983
- type: "submit",
984
- class: "flex-1",
985
- variant: "primary",
986
- label: "Save"
987
- })
988
- ])
989
- ]),
990
- _: 1
991
- }, 512);
992
- };
993
- }
994
- }), We = { class: "flex items-end" }, Xe = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ze = { class: "flex mt-6 space-x-6" }, ea = /* @__PURE__ */ R({
995
- __name: "NetsGateway",
996
- props: {
997
- terminal: {
998
- type: Object,
999
- required: !0
1000
- },
1001
- onUpdate: {
1002
- type: Function,
1003
- required: !0
1004
- }
1005
- },
1006
- setup(_) {
1007
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
1008
- ip: "",
1009
- receiptName: "",
1010
- cardTypes: []
1011
- }), m = () => {
1012
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1013
- }, c = () => {
1014
- var i;
1015
- if (!a.value.ecrIntegrations)
1016
- return m();
1017
- const s = a.value.ecrIntegrations, t = s.findIndex((d) => d && d.gateway && d.gateway === "Nets");
1018
- if (t === -1)
1019
- return m();
1020
- l.value = t;
1021
- const o = s.at(t);
1022
- o.gateway === "Nets" && o.config && (e.value = {
1023
- ip: o.config.ip ?? "",
1024
- receiptName: o.receiptName ?? "",
1025
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1026
- });
1027
- };
1028
- q(a, c), G(c);
1029
- async function f(s) {
1030
- var t;
1031
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1032
- }
1033
- async function u() {
1034
- e.value.cardTypes.push(r.value), r.value = "";
1035
- }
1036
- return (s, t) => {
1037
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
1038
- return y(), F(x, {
1039
- ref: T.value,
1040
- class: "flex flex-col gap-16 w-[500px]",
1041
- onValidationSuccess: t[3] || (t[3] = () => {
1042
- var n, w;
1043
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1044
- gateway: "Nets",
1045
- config: { ip: e.value.ip },
1046
- receiptName: e.value.receiptName,
1047
- dialogConfig: {
1048
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
1049
- cardTypes: e.value.cardTypes
1050
- }
1051
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1052
- gateway: "Nets",
1053
- config: { ip: e.value.ip },
1054
- receiptName: e.value.receiptName,
1055
- dialogConfig: {
1056
- cardTypes: e.value.cardTypes
1057
- }
1058
- })), p.onUpdate(a.value);
1059
- })
1060
- }, {
1061
- default: O(() => [
1062
- v(o, {
1063
- modelValue: e.value.ip,
1064
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
1065
- label: "IP Address"
1066
- }, null, 8, ["modelValue"]),
1067
- v(o, {
1068
- modelValue: e.value.receiptName,
1069
- "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
1070
- label: "Receipt Payment Name",
1071
- "label-info": "Default receipt display will be 'TERMINAL_NETS'"
1072
- }, null, 8, ["modelValue"]),
1073
- I("div", We, [
1074
- v(o, {
1075
- modelValue: r.value,
1076
- "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
1077
- label: "Fallback Card Types",
1078
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1079
- }, null, 8, ["modelValue"]),
1080
- v(i, {
1081
- class: "ml-4",
1082
- icon: "add",
1083
- onClick: u
1084
- })
1085
- ]),
1086
- I("div", Xe, [
1087
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
1088
- key: n,
1089
- label: n,
1090
- removable: !0,
1091
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1092
- }, null, 8, ["label", "onChipClosed"]))), 128))
1093
- ]),
1094
- I("div", Ze, [
1095
- l.value > -1 ? (y(), F(i, {
1096
- key: 0,
1097
- class: "flex-1",
1098
- variant: "secondary",
1099
- label: "Delete",
1100
- onclick: () => f(l.value)
1101
- }, null, 8, ["onclick"])) : V("", !0),
1102
- v(i, {
1103
- type: "submit",
1104
- class: "flex-1",
1105
- variant: "primary",
1106
- label: "Save"
1107
- })
1108
- ])
1109
- ]),
1110
- _: 1
1111
- }, 512);
1112
- };
1113
- }
1114
- }), aa = { class: "flex items-end" }, ta = { class: "flex flex-wrap gap-8 items-center mt-4" }, la = { class: "flex mt-6 space-x-6" }, na = /* @__PURE__ */ R({
1115
- __name: "KBankGateway",
1116
- props: {
1117
- terminal: {
1118
- type: Object,
1119
- required: !0
1120
- },
1121
- onUpdate: {
1122
- type: Function,
1123
- required: !0
1124
- }
1125
- },
1126
- setup(_) {
1127
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
1128
- receiptName: "",
1129
- cardTypes: []
1130
- }), m = () => {
1131
- e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1132
- }, c = () => {
1133
- var i;
1134
- if (!a.value.ecrIntegrations)
1135
- return m();
1136
- const s = a.value.ecrIntegrations, t = s.findIndex((d) => d && d.gateway && d.gateway === "Kbank");
1137
- if (t === -1)
1138
- return m();
1139
- l.value = t;
1140
- const o = s.at(t);
1141
- o.gateway === "Kbank" && o.config && (e.value = {
1142
- receiptName: o.receiptName ?? "",
1143
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1144
- });
1145
- };
1146
- q(a, c), G(c);
1147
- async function f(s) {
1148
- var t;
1149
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1150
- }
1151
- async function u() {
1152
- e.value.cardTypes.push(r.value), r.value = "";
1153
- }
1154
- return (s, t) => {
1155
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
1156
- return y(), F(x, {
1157
- ref: T.value,
1158
- class: "flex flex-col gap-16 w-[500px]",
1159
- onValidationSuccess: t[2] || (t[2] = () => {
1160
- var n, w;
1161
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1162
- gateway: "Kbank",
1163
- config: {},
1164
- receiptName: e.value.receiptName,
1165
- dialogConfig: {
1166
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
1167
- cardTypes: e.value.cardTypes
1168
- }
1169
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1170
- gateway: "Kbank",
1171
- config: {},
1172
- receiptName: e.value.receiptName,
1173
- dialogConfig: {
1174
- cardTypes: e.value.cardTypes
1175
- }
1176
- })), p.onUpdate(a.value);
1177
- })
1178
- }, {
1179
- default: O(() => [
1180
- v(o, {
1181
- modelValue: e.value.receiptName,
1182
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1183
- label: "Receipt Payment Name",
1184
- "label-info": "Default receipt display will be 'TERMINAL_KBANK'"
1185
- }, null, 8, ["modelValue"]),
1186
- I("div", aa, [
1187
- v(o, {
1188
- modelValue: r.value,
1189
- "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1190
- label: "Fallback Card Types",
1191
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1192
- }, null, 8, ["modelValue"]),
1193
- v(i, {
1194
- class: "ml-4",
1195
- icon: "add",
1196
- onClick: u
1197
- })
1198
- ]),
1199
- I("div", ta, [
1200
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
1201
- key: n,
1202
- label: n,
1203
- removable: !0,
1204
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1205
- }, null, 8, ["label", "onChipClosed"]))), 128))
1206
- ]),
1207
- I("div", la, [
1208
- l.value > -1 ? (y(), F(i, {
1209
- key: 0,
1210
- class: "flex-1",
1211
- variant: "secondary",
1212
- label: "Delete",
1213
- onclick: () => f(l.value)
1214
- }, null, 8, ["onclick"])) : V("", !0),
1215
- v(i, {
1216
- type: "submit",
1217
- class: "flex-1",
1218
- variant: "primary",
1219
- label: "Save"
1220
- })
1221
- ])
1222
- ]),
1223
- _: 1
1224
- }, 512);
1225
- };
1226
- }
1227
- }), oa = { class: "flex mt-6 space-x-6" }, ra = /* @__PURE__ */ R({
1228
- __name: "Ghl2Gateway",
1229
- props: {
1230
- terminal: {
1231
- type: Object,
1232
- required: !0
1233
- },
1234
- onUpdate: {
1235
- type: Function,
1236
- required: !0
1237
- }
1238
- },
1239
- setup(_) {
1240
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b({
1241
- ip: "",
1242
- receiptName: ""
1243
- }), e = () => {
1244
- r.value.ip = "", r.value.receiptName = "", l.value = -1;
1245
- }, m = () => {
1246
- if (!a.value.ecrIntegrations)
1247
- return e();
1248
- const f = a.value.ecrIntegrations, u = f.findIndex((t) => t && t.gateway && t.gateway === "Ghl2");
1249
- if (u === -1)
1250
- return e();
1251
- l.value = u;
1252
- const s = f.at(u);
1253
- s.gateway === "Ghl2" && s.config && (r.value = {
1254
- ip: s.config.ip ?? "",
1255
- receiptName: s.receiptName ?? ""
1256
- });
1257
- };
1258
- q(a, m), G(m);
1259
- async function c(f) {
1260
- var u;
1261
- (u = a.value.ecrIntegrations) == null || u.splice(f, 1), p.onUpdate(a.value);
1262
- }
1263
- return (f, u) => {
1264
- const s = g("FmTextField"), t = g("FmButton"), o = g("FmForm");
1265
- return y(), F(o, {
1266
- ref: T.value,
1267
- class: "flex flex-col gap-16 w-[500px]",
1268
- onValidationSuccess: u[2] || (u[2] = () => {
1269
- a.value.ecrIntegrations || (a.value.ecrIntegrations = []), l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1270
- gateway: "Ghl2",
1271
- config: { ip: r.value.ip },
1272
- receiptName: r.value.receiptName
1273
- } : a.value.ecrIntegrations.push({
1274
- gateway: "Ghl2",
1275
- config: { ip: r.value.ip },
1276
- receiptName: r.value.receiptName
1277
- }), p.onUpdate(a.value);
1278
- })
1279
- }, {
1280
- default: O(() => [
1281
- v(s, {
1282
- modelValue: r.value.ip,
1283
- "onUpdate:modelValue": u[0] || (u[0] = (i) => r.value.ip = i),
1284
- label: "IP Address"
1285
- }, null, 8, ["modelValue"]),
1286
- v(s, {
1287
- modelValue: r.value.receiptName,
1288
- "onUpdate:modelValue": u[1] || (u[1] = (i) => r.value.receiptName = i),
1289
- label: "Receipt Payment Name",
1290
- "label-info": "Default receipt display will be 'TERMINAL_GHL_2'"
1291
- }, null, 8, ["modelValue"]),
1292
- I("div", oa, [
1293
- l.value > -1 ? (y(), F(t, {
1294
- key: 0,
1295
- class: "flex-1",
1296
- variant: "secondary",
1297
- label: "Delete",
1298
- onclick: () => c(l.value)
1299
- }, null, 8, ["onclick"])) : V("", !0),
1300
- v(t, {
1301
- type: "submit",
1302
- class: "flex-1",
1303
- variant: "primary",
1304
- label: "Save"
1305
- })
1306
- ])
1307
- ]),
1308
- _: 1
1309
- }, 512);
1310
- };
1311
- }
1312
- }), ia = { class: "flex items-end" }, sa = { class: "flex flex-wrap gap-8 items-center mt-4" }, ua = { class: "flex mt-6 space-x-6" }, ca = /* @__PURE__ */ R({
1313
- __name: "Ghl3Gateway",
1314
- props: {
1315
- terminal: {
1316
- type: Object,
1317
- required: !0
1318
- },
1319
- onUpdate: {
1320
- type: Function,
1321
- required: !0
1322
- }
1323
- },
1324
- setup(_) {
1325
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
1326
- receiptName: "",
1327
- config: {},
1328
- cardTypes: []
1329
- }), m = () => {
1330
- e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1331
- }, c = () => {
1332
- var i;
1333
- if (!a.value.ecrIntegrations)
1334
- return m();
1335
- const s = a.value.ecrIntegrations, t = s.findIndex(
1336
- (d) => d && d.gateway && d.gateway === "Ghl3"
1337
- );
1338
- if (t === -1)
1339
- return m();
1340
- l.value = t;
1341
- const o = s.at(t);
1342
- o.gateway === "Ghl3" && o.config && (e.value = {
1343
- config: o.config,
1344
- receiptName: o.receiptName ?? "",
1345
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1346
- });
1347
- };
1348
- q(a, c), G(c);
1349
- async function f(s) {
1350
- var t;
1351
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1352
- }
1353
- async function u() {
1354
- e.value.cardTypes.push(r.value), r.value = "";
1355
- }
1356
- return (s, t) => {
1357
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
1358
- return y(), F(x, {
1359
- ref: T.value,
1360
- class: "flex flex-col gap-16 w-[500px]",
1361
- onValidationSuccess: t[2] || (t[2] = () => {
1362
- var n, w;
1363
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1364
- gateway: "Ghl3",
1365
- config: e.value.config,
1366
- receiptName: e.value.receiptName,
1367
- dialogConfig: {
1368
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
1369
- cardTypes: e.value.cardTypes
1370
- }
1371
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1372
- gateway: "Ghl3",
1373
- config: e.value.config,
1374
- receiptName: e.value.receiptName,
1375
- dialogConfig: {
1376
- cardTypes: e.value.cardTypes
1377
- }
1378
- })), p.onUpdate(a.value);
1379
- })
1380
- }, {
1381
- default: O(() => [
1382
- v(o, {
1383
- modelValue: e.value.receiptName,
1384
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1385
- label: "Receipt Payment Name",
1386
- "label-info": "Default receipt display will be 'TERMINAL_GHL'"
1387
- }, null, 8, ["modelValue"]),
1388
- I("div", ia, [
1389
- v(o, {
1390
- modelValue: r.value,
1391
- "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1392
- label: "Fallback Card Types",
1393
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1394
- }, null, 8, ["modelValue"]),
1395
- v(i, {
1396
- class: "ml-4",
1397
- icon: "add",
1398
- onClick: u
1399
- })
1400
- ]),
1401
- I("div", sa, [
1402
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
1403
- key: n,
1404
- label: n,
1405
- removable: !0,
1406
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1407
- }, null, 8, ["label", "onChipClosed"]))), 128))
1408
- ]),
1409
- I("div", ua, [
1410
- l.value > -1 ? (y(), F(i, {
1411
- key: 0,
1412
- class: "flex-1",
1413
- variant: "secondary",
1414
- label: "Delete",
1415
- onclick: () => f(l.value)
1416
- }, null, 8, ["onclick"])) : V("", !0),
1417
- v(i, {
1418
- type: "submit",
1419
- class: "flex-1",
1420
- variant: "primary",
1421
- label: "Save"
1422
- })
1423
- ])
1424
- ]),
1425
- _: 1
1426
- }, 512);
1427
- };
1428
- }
1429
- }), da = { class: "flex items-end" }, pa = { class: "flex flex-wrap gap-8 items-center mt-4" }, ma = { class: "flex mt-6 space-x-6" }, va = /* @__PURE__ */ R({
1430
- __name: "HlbbGateway",
1431
- props: {
1432
- terminal: {
1433
- type: Object,
1434
- required: !0
1435
- },
1436
- onUpdate: {
1437
- type: Function,
1438
- required: !0
1439
- }
1440
- },
1441
- setup(_) {
1442
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
1443
- receiptName: "",
1444
- config: {},
1445
- cardTypes: []
1446
- }), m = () => {
1447
- e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1448
- }, c = () => {
1449
- var i;
1450
- if (!a.value.ecrIntegrations)
1451
- return m();
1452
- const s = a.value.ecrIntegrations, t = s.findIndex(
1453
- (d) => d && d.gateway && d.gateway === "Hlbb"
1454
- );
1455
- if (t === -1)
1456
- return m();
1457
- l.value = t;
1458
- const o = s.at(t);
1459
- o.gateway === "Hlbb" && o.config && (e.value = {
1460
- config: o.config,
1461
- receiptName: o.receiptName ?? "",
1462
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1463
- });
1464
- };
1465
- q(a, c), G(c);
1466
- async function f(s) {
1467
- var t;
1468
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1469
- }
1470
- async function u() {
1471
- e.value.cardTypes.push(r.value), r.value = "";
1472
- }
1473
- return (s, t) => {
1474
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
1475
- return y(), F(x, {
1476
- ref: T.value,
1477
- class: "flex flex-col gap-16 w-[500px]",
1478
- onValidationSuccess: t[2] || (t[2] = () => {
1479
- var n, w;
1480
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1481
- gateway: "Hlbb",
1482
- config: e.value.config,
1483
- receiptName: e.value.receiptName,
1484
- dialogConfig: {
1485
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
1486
- cardTypes: e.value.cardTypes
1487
- }
1488
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1489
- gateway: "Hlbb",
1490
- config: e.value.config,
1491
- receiptName: e.value.receiptName,
1492
- dialogConfig: {
1493
- cardTypes: e.value.cardTypes
1494
- }
1495
- })), p.onUpdate(a.value);
1496
- })
1497
- }, {
1498
- default: O(() => [
1499
- v(o, {
1500
- modelValue: e.value.receiptName,
1501
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1502
- label: "Receipt Payment Name",
1503
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
1504
- }, null, 8, ["modelValue"]),
1505
- I("div", da, [
1506
- v(o, {
1507
- modelValue: r.value,
1508
- "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1509
- label: "Fallback Card Types",
1510
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1511
- }, null, 8, ["modelValue"]),
1512
- v(i, {
1513
- class: "ml-4",
1514
- icon: "add",
1515
- onClick: u
1516
- })
1517
- ]),
1518
- I("div", pa, [
1519
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
1520
- key: n,
1521
- label: n,
1522
- removable: !0,
1523
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1524
- }, null, 8, ["label", "onChipClosed"]))), 128))
1525
- ]),
1526
- I("div", ma, [
1527
- l.value > -1 ? (y(), F(i, {
1528
- key: 0,
1529
- class: "flex-1",
1530
- variant: "secondary",
1531
- label: "Delete",
1532
- onclick: () => f(l.value)
1533
- }, null, 8, ["onclick"])) : V("", !0),
1534
- v(i, {
1535
- type: "submit",
1536
- class: "flex-1",
1537
- variant: "primary",
1538
- label: "Save"
1539
- })
1540
- ])
1541
- ]),
1542
- _: 1
1543
- }, 512);
1544
- };
1545
- }
1546
- }), ya = { class: "flex items-end" }, fa = { class: "flex flex-wrap gap-8 items-center mt-4" }, ga = { class: "flex mt-6 space-x-6" }, ba = /* @__PURE__ */ R({
1547
- __name: "GlobalPaymentsGateway",
1548
- props: {
1549
- terminal: {
1550
- type: Object,
1551
- required: !0
1552
- },
1553
- onUpdate: {
1554
- type: Function,
1555
- required: !0
1556
- }
1557
- },
1558
- setup(_) {
1559
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
1560
- ip: "",
1561
- receiptName: "",
1562
- cardTypes: []
1563
- }), m = () => {
1564
- e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1565
- }, c = () => {
1566
- var i;
1567
- if (!a.value.ecrIntegrations)
1568
- return m();
1569
- const s = a.value.ecrIntegrations, t = s.findIndex(
1570
- (d) => d && d.gateway && d.gateway === "GlobalPayments"
1571
- );
1572
- if (t === -1)
1573
- return m();
1574
- l.value = t;
1575
- const o = s.at(t);
1576
- o.gateway === "GlobalPayments" && o.config && (e.value = {
1577
- ip: o.config.ip ?? "",
1578
- receiptName: o.receiptName ?? "",
1579
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1580
- });
1581
- };
1582
- q(a, c), G(c);
1583
- async function f(s) {
1584
- var t;
1585
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1586
- }
1587
- async function u() {
1588
- e.value.cardTypes.push(r.value), r.value = "";
1589
- }
1590
- return (s, t) => {
1591
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
1592
- return y(), F(x, {
1593
- ref: T.value,
1594
- class: "flex flex-col gap-16 w-[500px]",
1595
- onValidationSuccess: t[3] || (t[3] = () => {
1596
- var n, w;
1597
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1598
- gateway: "GlobalPayments",
1599
- config: { ip: e.value.ip },
1600
- receiptName: e.value.receiptName,
1601
- dialogConfig: {
1602
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
1603
- cardTypes: e.value.cardTypes
1604
- }
1605
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1606
- gateway: "GlobalPayments",
1607
- config: { ip: e.value.ip },
1608
- receiptName: e.value.receiptName,
1609
- dialogConfig: {
1610
- cardTypes: e.value.cardTypes
1611
- }
1612
- })), p.onUpdate(a.value);
1613
- })
1614
- }, {
1615
- default: O(() => [
1616
- v(o, {
1617
- modelValue: e.value.ip,
1618
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
1619
- label: "IP Address"
1620
- }, null, 8, ["modelValue"]),
1621
- v(o, {
1622
- modelValue: e.value.receiptName,
1623
- "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
1624
- label: "Receipt Payment Name",
1625
- "label-info": "Default receipt display will be 'TERMINAL_GP'"
1626
- }, null, 8, ["modelValue"]),
1627
- I("div", ya, [
1628
- v(o, {
1629
- modelValue: r.value,
1630
- "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
1631
- label: "Fallback Card Types",
1632
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1633
- }, null, 8, ["modelValue"]),
1634
- v(i, {
1635
- class: "ml-4",
1636
- icon: "add",
1637
- onClick: u
1638
- })
1639
- ]),
1640
- I("div", fa, [
1641
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
1642
- key: n,
1643
- label: n,
1644
- removable: !0,
1645
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1646
- }, null, 8, ["label", "onChipClosed"]))), 128))
1647
- ]),
1648
- I("div", ga, [
1649
- l.value > -1 ? (y(), F(i, {
1650
- key: 0,
1651
- class: "flex-1",
1652
- variant: "secondary",
1653
- label: "Delete",
1654
- onclick: () => f(l.value)
1655
- }, null, 8, ["onclick"])) : V("", !0),
1656
- v(i, {
1657
- type: "submit",
1658
- class: "flex-1",
1659
- variant: "primary",
1660
- label: "Save"
1661
- })
1662
- ])
1663
- ]),
1664
- _: 1
1665
- }, 512);
1666
- };
1667
- }
1668
- }), Ta = { class: "flex items-end" }, _a = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ia = { class: "flex mt-6 space-x-6" }, Fa = /* @__PURE__ */ R({
1669
- __name: "OmaGateway",
1670
- props: {
1671
- terminal: {
1672
- type: Object,
1673
- required: !0
1674
- },
1675
- onUpdate: {
1676
- type: Function,
1677
- required: !0
1678
- }
1679
- },
1680
- setup(_) {
1681
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
1682
- receiptName: "",
1683
- cardTypes: []
1684
- }), m = () => {
1685
- e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
1686
- }, c = () => {
1687
- var i;
1688
- if (!a.value.ecrIntegrations)
1689
- return m();
1690
- const s = a.value.ecrIntegrations, t = s.findIndex(
1691
- (d) => d && d.gateway && d.gateway === "Oma"
1692
- );
1693
- if (t === -1)
1694
- return m();
1695
- l.value = t;
1696
- const o = s.at(t);
1697
- o.gateway === "Oma" && o.config && (e.value = {
1698
- receiptName: o.receiptName ?? "",
1699
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1700
- });
1701
- };
1702
- q(a, c), G(c);
1703
- async function f(s) {
1704
- var t;
1705
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1706
- }
1707
- async function u() {
1708
- e.value.cardTypes.push(r.value), r.value = "";
1709
- }
1710
- return (s, t) => {
1711
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
1712
- return y(), F(x, {
1713
- ref: T.value,
1714
- class: "flex flex-col gap-16 w-[500px]",
1715
- onValidationSuccess: t[2] || (t[2] = () => {
1716
- var n, w;
1717
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1718
- gateway: "Oma",
1719
- config: {},
1720
- receiptName: e.value.receiptName,
1721
- dialogConfig: {
1722
- ...(w = (n = a.value.ecrIntegrations) == null ? void 0 : n[l.value]) == null ? void 0 : w.dialogConfig,
1723
- cardTypes: e.value.cardTypes
1724
- }
1725
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1726
- gateway: "Oma",
1727
- config: {},
1728
- receiptName: e.value.receiptName,
1729
- dialogConfig: {
1730
- cardTypes: e.value.cardTypes
1731
- }
1732
- })), p.onUpdate(a.value);
1733
- })
1734
- }, {
1735
- default: O(() => [
1736
- v(o, {
1737
- modelValue: e.value.receiptName,
1738
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.receiptName = n),
1739
- label: "Receipt Payment Name",
1740
- "label-info": "Default receipt display will be 'TERMINAL_OMA'"
1741
- }, null, 8, ["modelValue"]),
1742
- I("div", Ta, [
1743
- v(o, {
1744
- modelValue: r.value,
1745
- "onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
1746
- label: "Fallback Card Types",
1747
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1748
- }, null, 8, ["modelValue"]),
1749
- v(i, {
1750
- class: "ml-4",
1751
- icon: "add",
1752
- onClick: u
1753
- })
1754
- ]),
1755
- I("div", _a, [
1756
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
1757
- key: n,
1758
- label: n,
1759
- removable: !0,
1760
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1761
- }, null, 8, ["label", "onChipClosed"]))), 128))
1762
- ]),
1763
- I("div", Ia, [
1764
- l.value > -1 ? (y(), F(i, {
1765
- key: 0,
1766
- class: "flex-1",
1767
- variant: "secondary",
1768
- label: "Delete",
1769
- onclick: () => f(l.value)
1770
- }, null, 8, ["onclick"])) : V("", !0),
1771
- v(i, {
1772
- type: "submit",
1773
- class: "flex-1",
1774
- variant: "primary",
1775
- label: "Save"
1776
- })
1777
- ])
1778
- ]),
1779
- _: 1
1780
- }, 512);
1781
- };
1782
- }
1783
- }), wa = { class: "flex items-end" }, xa = { class: "flex flex-wrap gap-8 items-center mt-4" }, Na = { class: "flex mt-6 space-x-6" }, Ca = /* @__PURE__ */ R({
1784
- __name: "RevenueGateway",
1785
- props: {
1786
- terminal: {
1787
- type: Object,
1788
- required: !0
1789
- },
1790
- onUpdate: {
1791
- type: Function,
1792
- required: !0
1793
- }
1794
- },
1795
- setup(_) {
1796
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b(), e = b({
1797
- receiptName: "",
1798
- ip: "",
1799
- cardTypes: []
1800
- }), m = () => {
1801
- e.value.receiptName = "", e.value.ip = "", e.value.cardTypes = [], l.value = -1;
1802
- }, c = () => {
1803
- var i;
1804
- if (!a.value.ecrIntegrations)
1805
- return m();
1806
- const s = a.value.ecrIntegrations, t = s.findIndex(
1807
- (d) => d && d.gateway && d.gateway === "Revenue"
1808
- );
1809
- if (t === -1)
1810
- return m();
1811
- l.value = t;
1812
- const o = s.at(t);
1813
- o.gateway === "Revenue" && o.config && (e.value = {
1814
- receiptName: o.receiptName ?? "",
1815
- ip: o.config.ip ?? "",
1816
- cardTypes: ((i = o.dialogConfig) == null ? void 0 : i.cardTypes) ?? []
1817
- });
1818
- };
1819
- q(a, c), G(c);
1820
- async function f(s) {
1821
- var t;
1822
- (t = a.value.ecrIntegrations) == null || t.splice(s, 1), p.onUpdate(a.value);
1823
- }
1824
- async function u() {
1825
- e.value.cardTypes.push(r.value), r.value = "";
1826
- }
1827
- return (s, t) => {
1828
- const o = g("FmTextField"), i = g("FmButton"), d = g("FmChip"), x = g("FmForm");
1829
- return y(), F(x, {
1830
- ref: T.value,
1831
- class: "flex flex-col gap-16 w-[500px]",
1832
- onValidationSuccess: t[3] || (t[3] = () => {
1833
- var w, L;
1834
- const n = {
1835
- type: "tcp",
1836
- ip: e.value.ip
1837
- };
1838
- l.value > -1 ? a.value.ecrIntegrations[l.value] = {
1839
- gateway: "Revenue",
1840
- config: n,
1841
- receiptName: e.value.receiptName,
1842
- dialogConfig: {
1843
- ...(L = (w = a.value.ecrIntegrations) == null ? void 0 : w[l.value]) == null ? void 0 : L.dialogConfig,
1844
- cardTypes: e.value.cardTypes
1845
- }
1846
- } : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
1847
- gateway: "Revenue",
1848
- config: n,
1849
- receiptName: e.value.receiptName,
1850
- dialogConfig: {
1851
- cardTypes: e.value.cardTypes
1852
- }
1853
- })), p.onUpdate(a.value);
1854
- })
1855
- }, {
1856
- default: O(() => [
1857
- v(o, {
1858
- modelValue: e.value.ip,
1859
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.value.ip = n),
1860
- label: "Terminal IP Address",
1861
- "label-info": "Terminal WiFi IP with optional port, e.g. 192.168.1.50:8080 (defaults to port 8080)",
1862
- rules: M(ue)(M(ce).string().min(1))
1863
- }, null, 8, ["modelValue", "rules"]),
1864
- v(o, {
1865
- modelValue: e.value.receiptName,
1866
- "onUpdate:modelValue": t[1] || (t[1] = (n) => e.value.receiptName = n),
1867
- label: "Receipt Payment Name",
1868
- "label-info": "Default receipt display will be 'TERMINAL_REVENUE'"
1869
- }, null, 8, ["modelValue"]),
1870
- I("div", wa, [
1871
- v(o, {
1872
- modelValue: r.value,
1873
- "onUpdate:modelValue": t[2] || (t[2] = (n) => r.value = n),
1874
- label: "Fallback Card Types",
1875
- "label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
1876
- }, null, 8, ["modelValue"]),
1877
- v(i, {
1878
- class: "ml-4",
1879
- icon: "add",
1880
- onClick: u
1881
- })
1882
- ]),
1883
- I("div", xa, [
1884
- (y(!0), S(P, null, B(e.value.cardTypes, (n) => (y(), F(d, {
1885
- key: n,
1886
- label: n,
1887
- removable: !0,
1888
- onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(n), 1)
1889
- }, null, 8, ["label", "onChipClosed"]))), 128))
1890
- ]),
1891
- I("div", Na, [
1892
- l.value > -1 ? (y(), F(i, {
1893
- key: 0,
1894
- class: "flex-1",
1895
- variant: "secondary",
1896
- label: "Delete",
1897
- onclick: () => f(l.value)
1898
- }, null, 8, ["onclick"])) : V("", !0),
1899
- v(i, {
1900
- type: "submit",
1901
- class: "flex-1",
1902
- variant: "primary",
1903
- label: "Save"
1904
- })
1905
- ])
1906
- ]),
1907
- _: 1
1908
- }, 512);
1909
- };
1910
- }
1911
- }), ka = { class: "flex items-center" }, Va = { class: "w-[260px] self-start" }, Ua = { class: "flex-1" }, Sa = /* @__PURE__ */ R({
1912
- __name: "EcrGateway",
1913
- props: {
1914
- terminal: {
1915
- type: Object,
1916
- required: !0
1917
- },
1918
- onUpdate: {
1919
- type: Function,
1920
- required: !0
1921
- }
1922
- },
1923
- setup(_) {
1924
- var m;
1925
- const p = _, a = [
1926
- {
1927
- label: "FeedMe Terminal",
1928
- value: "terminal",
1929
- render: qe
1930
- },
1931
- {
1932
- label: "GHL Terminal",
1933
- value: "ghl",
1934
- render: Ae,
1935
- region: [U.F_COUNTRY.enum.MY]
1936
- },
1937
- {
1938
- label: "GHL2 Terminal",
1939
- value: "ghl2",
1940
- render: ra,
1941
- region: [U.F_COUNTRY.enum.MY]
1942
- },
1943
- {
1944
- label: "ITB Maybank Terminal",
1945
- value: "mb-itb",
1946
- render: Le,
1947
- region: [U.F_COUNTRY.enum.MY]
1948
- },
1949
- {
1950
- label: "PMA Maybank Terminal",
1951
- value: "mb-pma",
1952
- render: je,
1953
- region: [U.F_COUNTRY.enum.MY]
1954
- },
1955
- {
1956
- label: "Paysys Maybank Terminal",
1957
- value: "mb-paysys",
1958
- render: Je,
1959
- region: [U.F_COUNTRY.enum.MY]
1960
- },
1961
- {
1962
- label: "Nets Terminal",
1963
- value: "nets",
1964
- render: ea,
1965
- region: [U.F_COUNTRY.enum.SG]
1966
- },
1967
- {
1968
- label: "KBank Terminal",
1969
- value: "kbank",
1970
- render: na,
1971
- region: [U.F_COUNTRY.enum.TH]
1972
- },
1973
- {
1974
- label: "GHL Terminal",
1975
- value: "ghl3",
1976
- render: ca,
1977
- region: [U.F_COUNTRY.enum.TH]
1978
- },
1979
- {
1980
- label: "Paysys HLBB Terminal",
1981
- value: "hlbb",
1982
- render: va,
1983
- region: [U.F_COUNTRY.enum.MY]
1984
- },
1985
- {
1986
- label: "GPAP Terminal",
1987
- value: "globalpayments",
1988
- render: ba,
1989
- region: [U.F_COUNTRY.enum.SG]
1990
- },
1991
- {
1992
- label: "OMA Terminal",
1993
- value: "oma",
1994
- render: Fa,
1995
- region: [U.F_COUNTRY.enum.PK]
1996
- },
1997
- {
1998
- label: "Revenue PBB Terminal",
1999
- value: "revenue",
2000
- render: Ca,
2001
- region: [U.F_COUNTRY.enum.MY]
2002
- }
2003
- ], T = k(() => a.find((c) => c.value === e.value)), l = oe().currentCountry, r = k(() => a.filter(
2004
- (c) => !c.region || c.region.includes(l.value ?? U.F_COUNTRY.enum.MY)
2005
- )), { gatewayTab: e } = ne({
2006
- gatewayTab: (m = r.value[0]) == null ? void 0 : m.value
2007
- });
2008
- return (c, f) => {
2009
- var s;
2010
- const u = g("FmTabs");
2011
- return y(), S("div", ka, [
2012
- I("div", Va, [
2013
- v(u, {
2014
- "model-value": M(e),
2015
- "onUpdate:modelValue": f[0] || (f[0] = (t) => Z(e) ? e.value = t : null),
2016
- class: "mb-6",
2017
- vertical: !0,
2018
- items: r.value,
2019
- "show-more-at": Number.POSITIVE_INFINITY
2020
- }, null, 8, ["model-value", "items", "show-more-at"])
2021
- ]),
2022
- I("div", Ua, [
2023
- M(e) ? (y(), F(ee((s = T.value) == null ? void 0 : s.render), ae(te({ key: 0 }, {
2024
- terminal: p.terminal,
2025
- onUpdate: p.onUpdate
2026
- })), null, 16)) : V("", !0)
2027
- ])
2028
- ]);
2029
- };
2030
- }
2031
- }), Ra = { class: "flex mt-6 space-x-6" }, ha = /* @__PURE__ */ R({
2032
- __name: "PromptPayGateway",
2033
- props: {
2034
- terminal: {
2035
- type: Object,
2036
- required: !0
2037
- },
2038
- onUpdate: {
2039
- type: Function,
2040
- required: !0
2041
- }
2042
- },
2043
- setup(_) {
2044
- const p = _, a = A(() => p.terminal), T = b(), l = b(-1), r = b({
2045
- account: "",
2046
- receiptName: ""
2047
- }), e = () => {
2048
- r.value.account = "", r.value.receiptName = "", l.value = -1;
2049
- }, m = () => {
2050
- if (!a.value.qrIntegrations)
2051
- return e();
2052
- const f = a.value.qrIntegrations, u = f.findIndex((t) => t && t.gateway && t.gateway === "PROMPTPAY");
2053
- if (u === -1)
2054
- return e();
2055
- l.value = u;
2056
- const s = f.at(u);
2057
- s.gateway === "PROMPTPAY" && s.config && (r.value = {
2058
- account: s.config.account ?? "",
2059
- receiptName: s.receiptName ?? ""
2060
- });
2061
- };
2062
- q(a, m), G(m);
2063
- async function c(f) {
2064
- var u;
2065
- (u = a.value.qrIntegrations) == null || u.splice(f, 1), p.onUpdate(a.value);
2066
- }
2067
- return (f, u) => {
2068
- const s = g("FmTextField"), t = g("FmButton"), o = g("FmForm");
2069
- return y(), F(o, {
2070
- ref: T.value,
2071
- class: "flex flex-col gap-16 w-[500px]",
2072
- onValidationSuccess: u[2] || (u[2] = () => {
2073
- l.value > -1 ? a.value.qrIntegrations[l.value] = { gateway: "PROMPTPAY", config: { account: r.value.account }, receiptName: r.value.receiptName } : (a.value.qrIntegrations || (a.value.qrIntegrations = []), a.value.qrIntegrations.push({ gateway: "PROMPTPAY", config: { account: r.value.account }, receiptName: r.value.receiptName })), p.onUpdate(a.value);
2074
- })
2075
- }, {
2076
- default: O(() => [
2077
- v(s, {
2078
- modelValue: r.value.account,
2079
- "onUpdate:modelValue": u[0] || (u[0] = (i) => r.value.account = i),
2080
- label: "Thai Phone Number / Thai Naitonal ID",
2081
- "label-info": "Thai Phone Number can be prefixed with 66 or 0 will be fine both will works well."
2082
- }, null, 8, ["modelValue"]),
2083
- v(s, {
2084
- modelValue: r.value.receiptName,
2085
- "onUpdate:modelValue": u[1] || (u[1] = (i) => r.value.receiptName = i),
2086
- label: "Receipt Payment Name",
2087
- "label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
2088
- }, null, 8, ["modelValue"]),
2089
- I("div", Ra, [
2090
- l.value > -1 ? (y(), F(t, {
2091
- key: 0,
2092
- class: "flex-1",
2093
- variant: "secondary",
2094
- label: "Delete",
2095
- onclick: () => c(l.value)
2096
- }, null, 8, ["onclick"])) : V("", !0),
2097
- v(t, {
2098
- type: "submit",
2099
- class: "flex-1",
2100
- variant: "primary",
2101
- label: "Save"
2102
- })
2103
- ])
2104
- ]),
2105
- _: 1
2106
- }, 512);
2107
- };
2108
- }
2109
- }), Ma = { class: "flex items-center" }, Oa = { class: "w-[260px] self-start" }, Pa = { class: "flex-1" }, qa = /* @__PURE__ */ R({
2110
- __name: "QrGateway",
2111
- props: {
2112
- terminal: {
2113
- type: Object,
2114
- required: !0
2115
- },
2116
- onUpdate: {
2117
- type: Function,
2118
- required: !0
2119
- }
2120
- },
2121
- setup(_) {
2122
- var m;
2123
- const p = _, a = [
2124
- {
2125
- label: "PromptPay",
2126
- value: "promptpay",
2127
- render: ha,
2128
- region: [U.F_COUNTRY.enum.TH]
2129
- }
2130
- ], T = k(() => a.find((c) => c.value === e.value)), l = oe().currentCountry, r = k(() => a.filter((c) => !c.region || c.region.includes(l.value ?? U.F_COUNTRY.enum.MY))), { gatewayTab: e } = ne({
2131
- gatewayTab: (m = r.value[0]) == null ? void 0 : m.value
2132
- });
2133
- return (c, f) => {
2134
- var s;
2135
- const u = g("FmTabs");
2136
- return y(), S("div", Ma, [
2137
- I("div", Oa, [
2138
- v(u, {
2139
- "model-value": M(e),
2140
- "onUpdate:modelValue": f[0] || (f[0] = (t) => Z(e) ? e.value = t : null),
2141
- class: "mb-6",
2142
- vertical: !0,
2143
- items: r.value
2144
- }, null, 8, ["model-value", "items"])
2145
- ]),
2146
- I("div", Pa, [
2147
- M(e) ? (y(), F(ee((s = T.value) == null ? void 0 : s.render), ae(te({ key: 0 }, {
2148
- terminal: p.terminal,
2149
- onUpdate: p.onUpdate
2150
- })), null, 16)) : V("", !0)
2151
- ])
2152
- ]);
2153
- };
2154
- }
2155
- }), Qa = /* @__PURE__ */ R({
2156
- __name: "TerminalSetting",
2157
- props: {
2158
- terminalId: {
2159
- type: String,
2160
- required: !0
2161
- }
2162
- },
2163
- setup(_) {
2164
- const p = _, { tab: a } = ne({
2165
- tab: "information"
2166
- }), { isLoading: T, startAsyncCall: l } = le(!0), r = fe(), e = se(), m = b();
2167
- async function c(o) {
2168
- l(async () => {
2169
- try {
2170
- await K.updateById(
2171
- p.terminalId,
2172
- {
2173
- name: o.name,
2174
- status: o.status,
2175
- ecrs: o.ecrs ?? [],
2176
- gateways: o.gateways ?? [],
2177
- ecrIntegrations: o.ecrIntegrations ?? [],
2178
- qrIntegrations: o.qrIntegrations ?? []
2179
- }
2180
- ), m.value = await K.readById(p.terminalId), e.open({
2181
- type: "success",
2182
- message: "Terminal updated successfully"
2183
- });
2184
- } catch (i) {
2185
- e.open({
2186
- type: "error",
2187
- title: "Error occurs when update terminal",
2188
- message: X(i)
2189
- });
2190
- }
2191
- });
2192
- }
2193
- const f = [
2194
- {
2195
- label: "Information",
2196
- value: "information",
2197
- icon: "overview",
2198
- render: Ie
2199
- },
2200
- {
2201
- label: "Setting Request",
2202
- value: "settings",
2203
- icon: "settings",
2204
- render: Ne,
2205
- onlyFor: ["TERMINAL"]
2206
- },
2207
- {
2208
- label: "SoftPos Gateway",
2209
- value: "softpos",
2210
- icon: "payment",
2211
- render: Me
2212
- },
2213
- {
2214
- label: "ECR Gateway",
2215
- value: "ecr",
2216
- icon: "point_of_sale",
2217
- render: Sa,
2218
- onlyFor: ["POS", "KIOSK"]
2219
- },
2220
- {
2221
- label: "QR Gateway",
2222
- value: "qr",
2223
- icon: "qr_code",
2224
- render: qa,
2225
- onlyFor: ["POS", "KIOSK"]
2226
- }
2227
- ];
2228
- oe().currentCountry;
2229
- const u = k(() => {
2230
- var o;
2231
- return (o = f.find((i) => i.value === a.value)) == null ? void 0 : o.render;
2232
- });
2233
- async function s() {
2234
- l(async () => {
2235
- m.value = await K.readById(p.terminalId);
2236
- });
2237
- }
2238
- const t = k(() => f.filter((o) => {
2239
- var i;
2240
- return !o.onlyFor || o.onlyFor.includes(((i = m.value) == null ? void 0 : i.deviceType) ?? "");
2241
- }));
2242
- return G(s), (o, i) => {
2243
- var x, n;
2244
- const d = g("FmTabs");
2245
- return y(), F(ge, {
2246
- title: `${(x = m.value) == null ? void 0 : x.deviceType} (${(n = m.value) == null ? void 0 : n._id})`,
2247
- loading: M(T),
2248
- onBack: M(r).back
2249
- }, {
2250
- default: O(() => [
2251
- v(d, {
2252
- "model-value": M(a),
2253
- "onUpdate:modelValue": i[0] || (i[0] = (w) => Z(a) ? a.value = w : null),
2254
- class: "mb-6",
2255
- items: t.value
2256
- }, null, 8, ["model-value", "items"]),
2257
- M(a) ? (y(), F(ee(u.value), ae(te({ key: 0 }, {
2258
- terminal: m.value,
2259
- onUpdate: c
2260
- })), null, 16)) : V("", !0)
2261
- ]),
2262
- _: 1
2263
- }, 8, ["title", "loading", "onBack"]);
2264
- };
2265
- }
2266
- });
2267
- export {
2268
- Qa as default
2269
- };