@feedmepos/mf-payment 1.2.6 → 1.2.7

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