@feedmepos/mf-payment 1.1.14 → 1.1.16

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 (55) hide show
  1. package/dist/{PayoutAccount-B-XpzTqu.js → PayoutAccount-BwhhHyk0.js} +8 -7
  2. package/dist/{PayoutAccount-CuGn640K.js → PayoutAccount-uCgOv-C2.js} +7 -6
  3. package/dist/{PayoutAccountSetting-CmlqySTp.js → PayoutAccountSetting-DrgoYi10.js} +3 -3
  4. package/dist/{Restaurant-CbXVnwaT.js → Restaurant-BMxfnL42.js} +4 -4
  5. package/dist/{RestaurantSetting-DBgztIry.js → RestaurantSetting-D0L2llJi.js} +3 -3
  6. package/dist/{Settlement-BskRF_Qk.js → Settlement-C8I6P7da.js} +3 -3
  7. package/dist/{Settlement-ChMZqkYo.js → Settlement-CiK9GGpf.js} +3 -3
  8. package/dist/{SettlementTransactions-CiqJyr1g.js → SettlementTransactions-BIbtfCK3.js} +3 -3
  9. package/dist/{SettlementTransactions-BvU4bVd3.js → SettlementTransactions-De1rkkml.js} +3 -3
  10. package/dist/{Terminal-C4rFd_FC.js → Terminal-CckLRjSd.js} +5 -5
  11. package/dist/TerminalSetting-BCJvBD-X.js +598 -0
  12. package/dist/{Transaction-C5ULLdoi.js → Transaction-AQpb7piu.js} +9 -8
  13. package/dist/{Transaction-DTe3ST6p.js → Transaction-B8-b54yS.js} +5 -5
  14. package/dist/{TransactionOld-BTqo9lii.js → TransactionOld-DMoKPlnI.js} +4 -4
  15. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-D8HsRsbZ.js → TransactionTable.vue_vue_type_script_setup_true_lang-CGqkicKX.js} +3 -3
  16. package/dist/{app-Dit06Jr6.js → app-CLUCi0WU.js} +256 -256
  17. package/dist/app.js +1 -1
  18. package/dist/{assets-B7sgKcul.js → assets-Dd9LE4oF.js} +30 -28
  19. package/dist/{grafana-wm93DnN2.js → grafana-B60ooFW-.js} +1 -1
  20. package/dist/{index-DP7VUbrW.js → index-BFT3LjfW.js} +1 -1
  21. package/dist/{index-jDKnGfXk.js → index-BZWYrMcd.js} +1 -1
  22. package/dist/{index-De79N6Ur.js → index-BiYmAqRO.js} +4 -3
  23. package/dist/{index-C-M1CL9P.js → index-Bx8UIw8Z.js} +11923 -11325
  24. package/dist/{index-DcZShqtg.js → index-C0dQg29_.js} +1 -1
  25. package/dist/{index-DUM9Y_Ap.js → index-ZHTRfFqF.js} +1 -1
  26. package/dist/index-cdgGCMdI.js +162 -0
  27. package/dist/{index.vue_vue_type_script_setup_true_lang-Du_N-XKk.js → index.vue_vue_type_script_setup_true_lang-0J3a24fn.js} +1 -1
  28. package/dist/model/transaction.d.ts +1 -2
  29. package/dist/package.json +2 -2
  30. package/dist/payout-account-CPBlSoPB.js +1953 -0
  31. package/dist/stores/payoutAccount.d.ts +4 -4
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
  34. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +16 -16
  35. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +16 -16
  36. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
  37. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
  38. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  39. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  40. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +6 -6
  41. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
  42. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +22 -28
  43. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +22 -28
  44. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +22 -28
  45. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +22 -28
  46. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +22 -28
  47. package/dist/views/admin/terminal/tabs/SoftspaceGateway.vue.d.ts +90 -0
  48. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +22 -28
  49. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +22 -28
  50. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
  51. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +40 -40
  52. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +20 -20
  53. package/package.json +2 -2
  54. package/dist/TerminalSetting-MNCHf9x9.js +0 -497
  55. package/dist/payout-account-COpn8ige.js +0 -1819
@@ -0,0 +1,598 @@
1
+ import { defineComponent as V, openBlock as w, createElementBlock as C, Fragment as R, createElementVNode as F, createTextVNode as U, toDisplayString as N, toRef as D, ref as b, watch as G, onMounted as O, computed as B, resolveComponent as f, unref as _, createVNode as g, createBlock as k, withCtx as M, createCommentVNode as T, isRef as P, resolveDynamicComponent as $, normalizeProps as j, mergeProps as L } from "vue";
2
+ import { u as Y, e as x } from "./index-Bx8UIw8Z.js";
3
+ import { useRouter as J } from "vue-router";
4
+ import { t as q } from "./index-BFT3LjfW.js";
5
+ import { _ as H } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
+ import { u as A } from "./index-ZHTRfFqF.js";
7
+ import { useSnackbar as E } from "@feedmepos/ui-library";
8
+ import { u as Q } from "./error-K1CakhA9.js";
9
+ import { z as W, a as X } from "./validator-D5jtpt9A.js";
10
+ import { useCoreStore as K } from "@feedmepos/mf-common";
11
+ const Z = /* @__PURE__ */ V({
12
+ __name: "Information",
13
+ props: {
14
+ terminal: {
15
+ type: Object,
16
+ required: !0
17
+ }
18
+ },
19
+ setup(I) {
20
+ return (p, t) => (w(), C(R, null, [
21
+ t[0] || (t[0] = F("b", null, "Name", -1)),
22
+ U(": " + N(I.terminal.name), 1),
23
+ t[1] || (t[1] = F("br", null, null, -1)),
24
+ t[2] || (t[2] = F("b", null, "Status", -1)),
25
+ U(": " + N(I.terminal.status), 1),
26
+ t[3] || (t[3] = F("br", null, null, -1)),
27
+ t[4] || (t[4] = F("b", null, "Device ID", -1)),
28
+ U(": " + N(I.terminal.deviceId ?? "-"), 1),
29
+ t[5] || (t[5] = F("br", null, null, -1)),
30
+ t[6] || (t[6] = F("b", null, "Device Type", -1)),
31
+ U(": " + N(I.terminal.deviceType ?? "-"), 1),
32
+ t[7] || (t[7] = F("br", null, null, -1))
33
+ ], 64));
34
+ }
35
+ }), ee = {
36
+ key: 0,
37
+ class: "flex items-center justify-center min-h-[80vh]"
38
+ }, ae = { class: "flex mt-6 space-x-6" }, te = /* @__PURE__ */ V({
39
+ __name: "TerminalGateway",
40
+ props: {
41
+ terminal: {
42
+ type: Object,
43
+ required: !0
44
+ },
45
+ onUpdate: {
46
+ type: Function,
47
+ required: !0
48
+ }
49
+ },
50
+ setup(I) {
51
+ const { isLoading: p, startAsyncCall: t } = Y(), v = I, e = D(() => v.terminal), m = b(), u = b(), a = b(-1), o = b({
52
+ terminalId: ""
53
+ }), c = () => {
54
+ o.value.terminalId = "", a.value = -1;
55
+ }, s = () => {
56
+ if (t(async () => {
57
+ m.value = await q.getRestaurantTerminals(v.terminal.referenceId);
58
+ }), !v.terminal.ecrs)
59
+ return c();
60
+ const l = v.terminal.ecrs.findIndex((y) => y && y.gateway && y.gateway === "FeedMe");
61
+ if (l === -1)
62
+ return c();
63
+ a.value = l;
64
+ const r = v.terminal.ecrs.at(l);
65
+ r.gateway === "FeedMe" && r.config && (o.value = {
66
+ terminalId: r.config.terminalId
67
+ });
68
+ };
69
+ G(e, s), O(s);
70
+ const d = B(() => (m.value ?? []).map((l) => ({
71
+ label: l.name ?? l._id,
72
+ value: l._id
73
+ })));
74
+ async function n(l) {
75
+ var r;
76
+ (r = v.terminal.ecrs) == null || r.splice(l, 1), v.onUpdate(v.terminal);
77
+ }
78
+ return (l, r) => {
79
+ const y = f("FmCircularProgress"), S = f("FmSelect"), i = f("FmButton"), z = f("FmForm");
80
+ return _(p) ? (w(), C("div", ee, [
81
+ g(y, { size: "xxl" })
82
+ ])) : (w(), k(z, {
83
+ key: 1,
84
+ ref: u.value,
85
+ class: "flex flex-col gap-16 w-[500px]",
86
+ onValidationSuccess: r[1] || (r[1] = () => {
87
+ a.value > -1 ? e.value.ecrs[a.value] = { gateway: "FeedMe", config: o.value } : (e.value.ecrs || (e.value.ecrs = []), e.value.ecrs.push({ gateway: "FeedMe", config: o.value })), v.onUpdate(e.value);
88
+ })
89
+ }, {
90
+ default: M(() => [
91
+ g(S, {
92
+ modelValue: o.value.terminalId,
93
+ "onUpdate:modelValue": r[0] || (r[0] = (h) => o.value.terminalId = h),
94
+ label: "Terminal ID",
95
+ items: d.value,
96
+ rules: _(W)(_(X).string())
97
+ }, null, 8, ["modelValue", "items", "rules"]),
98
+ F("div", ae, [
99
+ a.value > -1 ? (w(), k(i, {
100
+ key: 0,
101
+ class: "flex-1",
102
+ variant: "secondary",
103
+ label: "Delete",
104
+ onclick: () => n(a.value)
105
+ }, null, 8, ["onclick"])) : T("", !0),
106
+ g(i, {
107
+ type: "submit",
108
+ class: "flex-1",
109
+ variant: "primary",
110
+ label: "Save"
111
+ })
112
+ ])
113
+ ]),
114
+ _: 1
115
+ }, 512));
116
+ };
117
+ }
118
+ }), ne = { class: "flex mt-6 space-x-6" }, le = /* @__PURE__ */ V({
119
+ __name: "FiuuGateway",
120
+ props: {
121
+ terminal: {
122
+ type: Object,
123
+ required: !0
124
+ },
125
+ onUpdate: {
126
+ type: Function,
127
+ required: !0
128
+ }
129
+ },
130
+ setup(I) {
131
+ const p = I, t = K().currentCountry, v = [
132
+ {
133
+ label: "Fiuu Malaysia",
134
+ value: "cc.feedme.payment.rms",
135
+ region: x.F_COUNTRY.enum.MY
136
+ },
137
+ {
138
+ label: "Fiuu Malaysia V2",
139
+ value: "cc.feedme.payment.fiuu_my",
140
+ region: x.F_COUNTRY.enum.MY
141
+ },
142
+ {
143
+ label: "Fiuu Singapore",
144
+ value: "cc.feedme.payment.fiuu_sg",
145
+ region: x.F_COUNTRY.enum.SG
146
+ }
147
+ ], e = D(() => p.terminal), m = b(), u = b(-1), a = b({
148
+ packageId: "",
149
+ uniqueId: ""
150
+ }), o = () => {
151
+ a.value.uniqueId = "", a.value.packageId = "", u.value = -1;
152
+ }, c = () => {
153
+ if (!e.value.gateways)
154
+ return o();
155
+ const d = e.value.gateways.findIndex((l) => l && l.gateway && l.gateway === "Fiuu");
156
+ if (d === -1)
157
+ return o();
158
+ u.value = d;
159
+ const n = e.value.gateways.at(d);
160
+ n.gateway === "Fiuu" && n.config && (a.value = {
161
+ packageId: n.config.packageId,
162
+ uniqueId: n.config.uniqueId
163
+ });
164
+ };
165
+ G(e, c), O(c);
166
+ async function s(d) {
167
+ var n;
168
+ (n = e.value.gateways) == null || n.splice(d, 1), p.onUpdate(e.value);
169
+ }
170
+ return (d, n) => {
171
+ const l = f("FmSelect"), r = f("FmTextField"), y = f("FmButton"), S = f("FmForm");
172
+ return w(), k(S, {
173
+ ref: m.value,
174
+ class: "flex flex-col gap-16 w-[500px]",
175
+ onValidationSuccess: n[2] || (n[2] = () => {
176
+ u.value > -1 ? e.value.gateways[u.value] = { gateway: "Fiuu", config: a.value } : (e.value.gateways || (e.value.gateways = []), e.value.gateways.push({ gateway: "Fiuu", config: a.value })), p.onUpdate(e.value);
177
+ })
178
+ }, {
179
+ default: M(() => [
180
+ g(l, {
181
+ modelValue: a.value.packageId,
182
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => a.value.packageId = i),
183
+ label: "Package ID",
184
+ items: v.filter((i) => i.region === _(t))
185
+ }, null, 8, ["modelValue", "items"]),
186
+ g(r, {
187
+ modelValue: a.value.uniqueId,
188
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => a.value.uniqueId = i),
189
+ label: "Unique ID"
190
+ }, null, 8, ["modelValue"]),
191
+ F("div", ne, [
192
+ u.value > -1 ? (w(), k(y, {
193
+ key: 0,
194
+ class: "flex-1",
195
+ variant: "secondary",
196
+ label: "Delete",
197
+ onclick: () => s(u.value)
198
+ }, null, 8, ["onclick"])) : T("", !0),
199
+ g(y, {
200
+ type: "submit",
201
+ class: "flex-1",
202
+ variant: "primary",
203
+ label: "Save"
204
+ })
205
+ ])
206
+ ]),
207
+ _: 1
208
+ }, 512);
209
+ };
210
+ }
211
+ }), oe = { class: "flex mt-6 space-x-6" }, re = /* @__PURE__ */ V({
212
+ __name: "GhlGateway",
213
+ props: {
214
+ terminal: {
215
+ type: Object,
216
+ required: !0
217
+ },
218
+ onUpdate: {
219
+ type: Function,
220
+ required: !0
221
+ }
222
+ },
223
+ setup(I) {
224
+ const p = I, t = D(() => p.terminal), v = b(), e = b(-1), m = b({
225
+ merchantId: "",
226
+ terminalId: "",
227
+ privateKey: ""
228
+ }), u = () => {
229
+ m.value.merchantId = "", m.value.terminalId = "", m.value.privateKey = "", e.value = -1;
230
+ }, a = () => {
231
+ if (!t.value.ecrs)
232
+ return u();
233
+ const c = t.value.ecrs.findIndex((d) => d && d.gateway && d.gateway === "Ghl");
234
+ if (c === -1)
235
+ return u();
236
+ e.value = c;
237
+ const s = t.value.ecrs.at(c);
238
+ s.gateway === "Ghl" && s.config && (m.value = {
239
+ merchantId: s.config.merchantId,
240
+ terminalId: s.config.terminalId,
241
+ privateKey: s.config.privateKey
242
+ });
243
+ };
244
+ G(t, a), O(a);
245
+ async function o(c) {
246
+ var s;
247
+ (s = t.value.ecrs) == null || s.splice(c, 1), p.onUpdate(t.value);
248
+ }
249
+ return (c, s) => {
250
+ const d = f("FmTextField"), n = f("FmTextarea"), l = f("FmButton"), r = f("FmForm");
251
+ return w(), k(r, {
252
+ ref: v.value,
253
+ class: "flex flex-col gap-16 w-[500px]",
254
+ onValidationSuccess: s[3] || (s[3] = () => {
255
+ e.value > -1 ? t.value.ecrs[e.value] = { gateway: "Ghl", config: m.value } : (t.value.ecrs || (t.value.ecrs = []), t.value.ecrs.push({ gateway: "Ghl", config: m.value })), p.onUpdate(t.value);
256
+ })
257
+ }, {
258
+ default: M(() => [
259
+ g(d, {
260
+ modelValue: m.value.merchantId,
261
+ "onUpdate:modelValue": s[0] || (s[0] = (y) => m.value.merchantId = y),
262
+ label: "Merchant ID"
263
+ }, null, 8, ["modelValue"]),
264
+ g(d, {
265
+ modelValue: m.value.terminalId,
266
+ "onUpdate:modelValue": s[1] || (s[1] = (y) => m.value.terminalId = y),
267
+ label: "Terminal ID"
268
+ }, null, 8, ["modelValue"]),
269
+ g(n, {
270
+ modelValue: m.value.privateKey,
271
+ "onUpdate:modelValue": s[2] || (s[2] = (y) => m.value.privateKey = y),
272
+ label: "Private Key"
273
+ }, null, 8, ["modelValue"]),
274
+ F("div", oe, [
275
+ e.value > -1 ? (w(), k(l, {
276
+ key: 0,
277
+ class: "flex-1",
278
+ variant: "secondary",
279
+ label: "Delete",
280
+ onclick: () => o(e.value)
281
+ }, null, 8, ["onclick"])) : T("", !0),
282
+ g(l, {
283
+ type: "submit",
284
+ class: "flex-1",
285
+ variant: "primary",
286
+ label: "Save"
287
+ })
288
+ ])
289
+ ]),
290
+ _: 1
291
+ }, 512);
292
+ };
293
+ }
294
+ }), ue = { key: 0 }, se = { class: "mt-6 space-x-6" }, ie = /* @__PURE__ */ V({
295
+ __name: "KioskMode",
296
+ props: {
297
+ terminal: {
298
+ type: Object,
299
+ required: !0
300
+ }
301
+ },
302
+ setup(I) {
303
+ const { isLoading: p, startAsyncCall: t } = Y(!1), v = E(), e = b({
304
+ enable: !1,
305
+ password: []
306
+ }), m = I;
307
+ function u() {
308
+ return e.value.enable && e.value.password.filter((a) => !!a).length !== 6 ? v.open({
309
+ type: "error",
310
+ message: "Unlock PIN is required when setting up kiosk mode for terminal."
311
+ }) : t(async () => {
312
+ const a = { enable: e.value.enable };
313
+ a.enable && Object.assign(a, {
314
+ password: e.value.password.join("")
315
+ });
316
+ const o = await q.kioskModeRequest(m.terminal._id, a);
317
+ if (o === "OK")
318
+ return v.open({ type: "info", message: "Kiosk mode applied successfully." });
319
+ let c = o;
320
+ return o === "client_not_connected" && (c = "Terminal not connected to the websocket server."), o.startsWith("terminal: ") && (c = o.replaceAll("terminal: ", "")), v.open({
321
+ type: "error",
322
+ message: c
323
+ });
324
+ });
325
+ }
326
+ return (a, o) => {
327
+ const c = f("FmSwitch"), s = f("FmPinField"), d = f("FmButton");
328
+ return w(), C(R, null, [
329
+ g(c, {
330
+ modelValue: e.value.enable,
331
+ "onUpdate:modelValue": o[0] || (o[0] = (n) => e.value.enable = n),
332
+ label: "Enable Kiosk Mode?"
333
+ }, null, 8, ["modelValue"]),
334
+ e.value.enable ? (w(), C("div", ue, [
335
+ o[2] || (o[2] = F("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
336
+ g(s, {
337
+ modelValue: e.value.password,
338
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => e.value.password = n)
339
+ }, null, 8, ["modelValue"])
340
+ ])) : T("", !0),
341
+ F("div", se, [
342
+ g(d, {
343
+ variant: "primary",
344
+ label: "Send",
345
+ icon: "send",
346
+ loading: _(p),
347
+ onclick: u
348
+ }, null, 8, ["loading"])
349
+ ])
350
+ ], 64);
351
+ };
352
+ }
353
+ }), me = /* @__PURE__ */ V({
354
+ __name: "SettingRequest",
355
+ props: {
356
+ terminal: {
357
+ type: Object,
358
+ required: !0
359
+ }
360
+ },
361
+ setup(I) {
362
+ const { settingTab: p } = A({
363
+ settingTab: "kiosk_mode"
364
+ }), t = [
365
+ {
366
+ label: "Kiosk Mode",
367
+ value: "kiosk_mode",
368
+ render: ie
369
+ }
370
+ ], v = I, e = B(() => t.find((m) => m.value === p.value));
371
+ return (m, u) => {
372
+ var o;
373
+ const a = f("FmTabs");
374
+ return w(), C(R, null, [
375
+ u[1] || (u[1] = F("p", { className: "mt-1 my-6 text-gray-600" }, [
376
+ F("b", null, "Note: "),
377
+ U(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
378
+ ], -1)),
379
+ g(a, {
380
+ "model-value": _(p),
381
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => P(p) ? p.value = c : null),
382
+ class: "mb-6",
383
+ items: t
384
+ }, null, 8, ["model-value"]),
385
+ _(p) ? (w(), k($((o = e.value) == null ? void 0 : o.render), j(L({ key: 0 }, { terminal: v.terminal })), null, 16)) : T("", !0)
386
+ ], 64);
387
+ };
388
+ }
389
+ }), ce = { class: "flex mt-6 space-x-6" }, de = /* @__PURE__ */ V({
390
+ __name: "SoftspaceGateway",
391
+ props: {
392
+ terminal: {
393
+ type: Object,
394
+ required: !0
395
+ },
396
+ onUpdate: {
397
+ type: Function,
398
+ required: !0
399
+ }
400
+ },
401
+ setup(I) {
402
+ const p = I, t = K().currentCountry, v = [
403
+ {
404
+ label: "Softspace Malaysia",
405
+ value: "cc.feedme.payment.softspace_my",
406
+ region: x.F_COUNTRY.enum.MY
407
+ }
408
+ ], e = D(() => p.terminal), m = b(), u = b(-1), a = b({
409
+ packageId: "",
410
+ uniqueId: "",
411
+ developerId: ""
412
+ }), o = () => {
413
+ a.value.uniqueId = "", a.value.packageId = "", u.value = -1;
414
+ }, c = () => {
415
+ if (!e.value.gateways)
416
+ return o();
417
+ const d = e.value.gateways.findIndex((r) => r && r.gateway && r.gateway === "Softspace");
418
+ if (d === -1)
419
+ return o();
420
+ u.value = d;
421
+ const n = e.value.gateways.at(d);
422
+ if (n.gateway !== "Softspace" || !n.config)
423
+ return;
424
+ const l = JSON.parse(n.config.uniqueId);
425
+ a.value = {
426
+ packageId: n.config.packageId,
427
+ uniqueId: l.uniqueId,
428
+ developerId: l.developerId
429
+ };
430
+ };
431
+ G(e, c), O(c);
432
+ async function s(d) {
433
+ var n;
434
+ (n = e.value.gateways) == null || n.splice(d, 1), p.onUpdate(e.value);
435
+ }
436
+ return (d, n) => {
437
+ const l = f("FmSelect"), r = f("FmTextField"), y = f("FmButton"), S = f("FmForm");
438
+ return w(), k(S, {
439
+ ref: m.value,
440
+ class: "flex flex-col gap-16 w-[500px]",
441
+ onValidationSuccess: n[3] || (n[3] = () => {
442
+ const i = { gateway: "Softspace", config: { packageId: a.value.packageId, uniqueId: JSON.stringify({ uniqueId: a.value.uniqueId, developerId: a.value.developerId }) } };
443
+ u.value > -1 ? e.value.gateways[u.value] = i : (e.value.gateways || (e.value.gateways = []), e.value.gateways.push(i)), console.log(e.value.gateways);
444
+ })
445
+ }, {
446
+ default: M(() => [
447
+ g(l, {
448
+ modelValue: a.value.packageId,
449
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => a.value.packageId = i),
450
+ label: "Package ID",
451
+ items: v.filter((i) => i.region === _(t))
452
+ }, null, 8, ["modelValue", "items"]),
453
+ g(r, {
454
+ modelValue: a.value.developerId,
455
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => a.value.developerId = i),
456
+ label: "Developer ID (MID)"
457
+ }, null, 8, ["modelValue"]),
458
+ g(r, {
459
+ modelValue: a.value.uniqueId,
460
+ "onUpdate:modelValue": n[2] || (n[2] = (i) => a.value.uniqueId = i),
461
+ label: "Unique ID (TID)"
462
+ }, null, 8, ["modelValue"]),
463
+ F("div", ce, [
464
+ u.value > -1 ? (w(), k(y, {
465
+ key: 0,
466
+ class: "flex-1",
467
+ variant: "secondary",
468
+ label: "Delete",
469
+ onclick: () => s(u.value)
470
+ }, null, 8, ["onclick"])) : T("", !0),
471
+ g(y, {
472
+ type: "submit",
473
+ class: "flex-1",
474
+ variant: "primary",
475
+ label: "Save"
476
+ })
477
+ ])
478
+ ]),
479
+ _: 1
480
+ }, 512);
481
+ };
482
+ }
483
+ }), ke = /* @__PURE__ */ V({
484
+ __name: "TerminalSetting",
485
+ props: {
486
+ terminalId: {
487
+ type: String,
488
+ required: !0
489
+ }
490
+ },
491
+ setup(I) {
492
+ const p = I, { tab: t } = A({
493
+ tab: "information"
494
+ }), { isLoading: v, startAsyncCall: e } = Y(!0), m = J(), u = E(), a = b();
495
+ async function o(l) {
496
+ e(async () => {
497
+ try {
498
+ await q.updateById(
499
+ p.terminalId,
500
+ {
501
+ name: l.name,
502
+ status: l.status,
503
+ ecrs: l.ecrs ?? [],
504
+ gateways: l.gateways ?? []
505
+ }
506
+ ), a.value = await q.readById(p.terminalId), u.open({
507
+ type: "success",
508
+ message: "Terminal updated successfully"
509
+ });
510
+ } catch (r) {
511
+ u.open({
512
+ type: "error",
513
+ title: "Error occurs when update terminal",
514
+ message: Q(r)
515
+ });
516
+ }
517
+ });
518
+ }
519
+ const c = [
520
+ {
521
+ label: "Information",
522
+ value: "information",
523
+ icon: "overview",
524
+ render: Z
525
+ },
526
+ {
527
+ label: "Setting Request",
528
+ value: "settings",
529
+ icon: "settings",
530
+ render: me,
531
+ onlyFor: ["TERMINAL"]
532
+ },
533
+ {
534
+ label: "Fiuu",
535
+ value: "fiuu",
536
+ icon: "payment",
537
+ render: le,
538
+ region: [x.F_COUNTRY.enum.MY, x.F_COUNTRY.enum.SG]
539
+ },
540
+ {
541
+ label: "Softspace",
542
+ value: "softspace",
543
+ icon: "payment",
544
+ render: de,
545
+ region: [x.F_COUNTRY.enum.MY, x.F_COUNTRY.enum.SG]
546
+ },
547
+ {
548
+ label: "FeedMe Terminal",
549
+ value: "terminal",
550
+ icon: "shopping_cart_checkout",
551
+ render: te,
552
+ onlyFor: ["POS", "KIOSK"]
553
+ },
554
+ {
555
+ label: "GHL Terminal (V2)",
556
+ value: "ghl",
557
+ icon: "shopping_cart_checkout",
558
+ render: re,
559
+ onlyFor: ["POS", "KIOSK"],
560
+ region: [x.F_COUNTRY.enum.MY]
561
+ }
562
+ ], s = K().currentCountry, d = B(() => {
563
+ var l;
564
+ return (l = c.find((r) => r.value === t.value)) == null ? void 0 : l.render;
565
+ });
566
+ async function n() {
567
+ e(async () => {
568
+ a.value = await q.readById(p.terminalId);
569
+ });
570
+ }
571
+ return O(n), (l, r) => {
572
+ var S;
573
+ const y = f("FmTabs");
574
+ return w(), k(H, {
575
+ title: `Terminal (${(S = a.value) == null ? void 0 : S._id})`,
576
+ loading: _(v),
577
+ onBack: _(m).back
578
+ }, {
579
+ default: M(() => [
580
+ g(y, {
581
+ "model-value": _(t),
582
+ "onUpdate:modelValue": r[0] || (r[0] = (i) => P(t) ? t.value = i : null),
583
+ class: "mb-6",
584
+ items: c.filter((i) => !i.onlyFor || i.onlyFor.includes(a.value.deviceType)).filter((i) => !i.region || i.region.includes(_(s) ?? _(x.F_COUNTRY).enum.MY))
585
+ }, null, 8, ["model-value", "items"]),
586
+ _(t) ? (w(), k($(d.value), j(L({ key: 0 }, {
587
+ terminal: a.value,
588
+ onUpdate: o
589
+ })), null, 16)) : T("", !0)
590
+ ]),
591
+ _: 1
592
+ }, 8, ["title", "loading", "onBack"]);
593
+ };
594
+ }
595
+ });
596
+ export {
597
+ ke as default
598
+ };
@@ -1,16 +1,17 @@
1
1
  import { defineComponent as B, ref as g, watch as E, computed as I, onMounted as J, resolveComponent as b, openBlock as v, createElementBlock as P, Fragment as Y, unref as t, createBlock as N, createCommentVNode as O, withCtx as T, createVNode as i, renderList as k, createElementVNode as V, isRef as y } from "vue";
2
- import { t as L, b as G } from "./assets-B7sgKcul.js";
3
- import { u as K, _ as C } from "./index-C-M1CL9P.js";
4
- import { _ as Q } from "./TransactionTable.vue_vue_type_script_setup_true_lang-D8HsRsbZ.js";
2
+ import { t as L, b as G } from "./assets-Dd9LE4oF.js";
3
+ import { u as K } from "./index-Bx8UIw8Z.js";
4
+ import { _ as Q } from "./TransactionTable.vue_vue_type_script_setup_true_lang-CGqkicKX.js";
5
5
  import { h as $ } from "./moment-h96o7c8I.js";
6
6
  import { useI18n as j, useCoreStore as q } from "@feedmepos/mf-common";
7
7
  import { _ as H } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
8
- import { u as W } from "./index-DUM9Y_Ap.js";
8
+ import { u as W } from "./index-ZHTRfFqF.js";
9
9
  import { _ as X } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
10
10
  import { _ as Z } from "./SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js";
11
11
  import { _ as ee } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
12
- import { p as te } from "./index-De79N6Ur.js";
13
- import { t as ae } from "./index-DP7VUbrW.js";
12
+ import { p as te } from "./index-BiYmAqRO.js";
13
+ import { t as ae } from "./index-BFT3LjfW.js";
14
+ import { _ as C } from "./index-cdgGCMdI.js";
14
15
  const ne = /* @__PURE__ */ B({
15
16
  __name: "SourceSelector",
16
17
  props: {
@@ -111,7 +112,7 @@ const ne = /* @__PURE__ */ B({
111
112
  ], 64);
112
113
  };
113
114
  }
114
- }), le = { class: "flex justify-between mb-6 items-center" }, oe = { class: "flex space-x-8 items-start" }, se = { class: "flex space-x-4 self-center" }, re = { class: "flex space-x-12 mb-6" }, Ce = /* @__PURE__ */ B({
115
+ }), le = { class: "flex justify-between mb-6 items-center" }, oe = { class: "flex space-x-8 items-start" }, se = { class: "flex space-x-4 self-center" }, re = { class: "flex space-x-12 mb-6" }, Ne = /* @__PURE__ */ B({
115
116
  __name: "Transaction",
116
117
  setup(z) {
117
118
  const { isLoading: x, startAsyncCall: F } = K(!0), { currentBusiness: f } = q(), { t: s } = j(), { dateRange: m, searchKey: r, status: l, id: c, by: p } = W({
@@ -246,5 +247,5 @@ const ne = /* @__PURE__ */ B({
246
247
  }
247
248
  });
248
249
  export {
249
- Ce as default
250
+ Ne as default
250
251
  };
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as b, resolveComponent as h, openBlock as m, createBlock as F, normalizeClass as R, withCtx as w, createElementVNode as _, toDisplayString as V, createElementBlock as S, unref as d, createVNode as f, Fragment as Y, renderList as C, ref as O, watch as v, isRef as I, h as y } from "vue";
2
- import { g as P, a as U, t as g, b as B, c as N } from "./assets-B7sgKcul.js";
2
+ import { g as P, a as U, t as g, b as B, c as N } from "./assets-Dd9LE4oF.js";
3
3
  import { h as T } from "./moment-h96o7c8I.js";
4
- import { u as G } from "./index-DUM9Y_Ap.js";
4
+ import { u as G } from "./index-ZHTRfFqF.js";
5
5
  import { _ as L } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
6
6
  import { _ as j } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
7
7
  import { useSnackbar as Q, useDialog as z } from "@feedmepos/ui-library";
8
8
  import { w as k } from "./Modal-DB8M9o1T.js";
9
9
  import { u as x } from "./error-K1CakhA9.js";
10
10
  import { _ as H } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
11
- import { g as J } from "./grafana-wm93DnN2.js";
12
- import { _ as W } from "./index.vue_vue_type_script_setup_true_lang-Du_N-XKk.js";
13
- import { e as D } from "./index-C-M1CL9P.js";
11
+ import { g as J } from "./grafana-B60ooFW-.js";
12
+ import { _ as W } from "./index.vue_vue_type_script_setup_true_lang-0J3a24fn.js";
13
+ import { e as D } from "./index-Bx8UIw8Z.js";
14
14
  import { _ as X } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
15
15
  const Z = /* @__PURE__ */ b({
16
16
  __name: "Status",
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as T, ref as y, onMounted as Y, watch as f, resolveComponent as V, openBlock as C, createBlock as M, unref as t, withCtx as O, createElementVNode as u, createVNode as i, isRef as h } from "vue";
2
- import { t as g, b as S } from "./assets-B7sgKcul.js";
3
- import { u as $ } from "./index-C-M1CL9P.js";
4
- import { _ as N } from "./TransactionTable.vue_vue_type_script_setup_true_lang-D8HsRsbZ.js";
2
+ import { t as g, b as S } from "./assets-Dd9LE4oF.js";
3
+ import { u as $ } from "./index-Bx8UIw8Z.js";
4
+ import { _ as N } from "./TransactionTable.vue_vue_type_script_setup_true_lang-CGqkicKX.js";
5
5
  import { h as x } from "./moment-h96o7c8I.js";
6
6
  import { useCoreStore as k, useI18n as E } from "@feedmepos/mf-common";
7
7
  import { _ as L } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
8
- import { u as P } from "./index-DUM9Y_Ap.js";
8
+ import { u as P } from "./index-ZHTRfFqF.js";
9
9
  import { _ as A } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
10
10
  import { _ as B } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-DyLnqQYe.js";
11
11
  import { _ as F } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as m, resolveComponent as d, openBlock as l, createBlock as f, normalizeClass as v, withCtx as y, createElementVNode as x, toDisplayString as P, createElementBlock as w, unref as E, createVNode as q, Fragment as R, renderList as V, ref as D, h as p } from "vue";
2
2
  import { useSnackbar as U, useDialog as B } from "@feedmepos/ui-library";
3
- import { g as $, a as L, t as b, c as N } from "./assets-B7sgKcul.js";
4
- import { e as h } from "./index-C-M1CL9P.js";
5
- import { g as G } from "./grafana-wm93DnN2.js";
3
+ import { g as $, a as L, t as b, c as N } from "./assets-Dd9LE4oF.js";
4
+ import { e as h } from "./index-Bx8UIw8Z.js";
5
+ import { g as G } from "./grafana-B60ooFW-.js";
6
6
  import { w as k } from "./Modal-DB8M9o1T.js";
7
7
  import { u as T } from "./error-K1CakhA9.js";
8
8
  import { useCoreStore as O, useI18n as Y } from "@feedmepos/mf-common";