@feedmepos/mf-payment 1.5.75-dev → 1.5.77

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 (119) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-Clq0gK8F.js → Actions.vue_vue_type_script_setup_true_lang-D_PoXVbz.js} +1 -1
  2. package/dist/{Chargeback-B0NVPvX4.js → Chargeback-CzwL8PJv.js} +7 -7
  3. package/dist/{DateRangePicker.vue_vue_type_script_setup_true_lang-BNVnvrVY.js → DateRangePicker.vue_vue_type_script_setup_true_lang-CDjdQf-E.js} +1 -1
  4. package/dist/DocumentViewer.vue_vue_type_script_setup_true_lang-KebV8Zws.js +94 -0
  5. package/dist/Forbidden-1aaq-Ilm.js +38 -0
  6. package/dist/{OnboardForm--EzInjiZ.js → OnboardForm-C6LuVVyr.js} +6 -6
  7. package/dist/{OnboardForm-CLixHoAD.js → OnboardForm-DZeWRzRD.js} +482 -554
  8. package/dist/{OnboardSubmission-C13NgJ_c.js → OnboardSubmission-C2BYK2p1.js} +27 -27
  9. package/dist/OnboardSubmission-DvWwQFy6.js +222 -0
  10. package/dist/{PayoutAccount-D8-JYW4l.js → PayoutAccount-BMQZ5bOZ.js} +5 -5
  11. package/dist/{PayoutAccount-C_NgECbv.js → PayoutAccount-VbRd7cmv.js} +102 -101
  12. package/dist/PayoutAccountSetting-DzzABgzs.js +1765 -0
  13. package/dist/{Restaurant-CeLGtOhN.js → Restaurant-4cO60aVP.js} +4 -4
  14. package/dist/{RestaurantSetting-CokkKQf1.js → RestaurantSetting-Bvk0dnCI.js} +243 -325
  15. package/dist/{Settlement-BaVdCbhk.js → Settlement-CklF8pz7.js} +4 -4
  16. package/dist/{Settlement-IzzxWS1Y.js → Settlement-Cme1wMB-.js} +5 -5
  17. package/dist/{SettlementTransactions-ClWROLAZ.js → SettlementTransactions-3F4EOoyz.js} +4 -4
  18. package/dist/{SettlementTransactions-BBiA4hjd.js → SettlementTransactions-DD285bSJ.js} +4 -4
  19. package/dist/{Status.vue_vue_type_script_setup_true_lang-CMK3yXwC.js → Status.vue_vue_type_script_setup_true_lang-CUnCf_fx.js} +1 -1
  20. package/dist/{Terminal-BFi2UmMt.js → Terminal-CK6ULW6U.js} +6 -6
  21. package/dist/{TerminalSetting-AMhDLMFF.js → TerminalSetting-CEQG3OV6.js} +712 -887
  22. package/dist/{TextInputDialog.vue_vue_type_script_setup_true_lang-D8W8_SO2.js → TextInputDialog.vue_vue_type_script_setup_true_lang-BvGYVca0.js} +1 -1
  23. package/dist/Transaction-D-Z3zRd7.js +517 -0
  24. package/dist/{Transaction-6wkXIJe6.js → Transaction-DjzWqLtN.js} +102 -99
  25. package/dist/TransactionOld-BXjA15Dd.js +314 -0
  26. package/dist/api/onboard-submission/index.d.ts +1 -3
  27. package/dist/api/terminal/index.d.ts +0 -1
  28. package/dist/app-CEy5Ojtg.js +7661 -0
  29. package/dist/app.d.ts +1 -91
  30. package/dist/app.js +4 -5
  31. package/dist/{assets-DPrEWC9w.js → assets-DIbq1BVX.js} +79 -81
  32. package/dist/{grafana-C0ylC9Dp.js → grafana-B0iQmK6j.js} +1 -1
  33. package/dist/{index-Bd57_1iM.js → index-B0L21J1j.js} +1 -1
  34. package/dist/{index-B9ASzUdx.js → index-BHCs_NnD.js} +1 -1
  35. package/dist/{index-BTy0uOXW.js → index-BkQ7t3F6.js} +1 -1
  36. package/dist/{index-HHaDD7PZ.js → index-C80a7-Ks.js} +1 -1
  37. package/dist/{index-Co2hdn_t.js → index-C_Y5Sfc9.js} +1 -1
  38. package/dist/{index-YMOHOygz.js → index-CnN_MV2-.js} +9 -24
  39. package/dist/{index-Bm1sygad.js → index-CxnWUe_K.js} +3 -3
  40. package/dist/{index-Cj2vufH8.js → index-D0j1LZAB.js} +9264 -9427
  41. package/dist/index-XTdSN6CV.js +60 -0
  42. package/dist/{index.vue_vue_type_script_setup_true_lang-Dtwo4sVt.js → index.vue_vue_type_script_setup_true_lang-BksGFeSf.js} +1 -1
  43. package/dist/main.d.ts +0 -1
  44. package/dist/model/payout-account.d.ts +2 -2
  45. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-DzWdVh1k.js → no-data-BRmo6XOO.js} +2 -92
  46. package/dist/package.json +3 -4
  47. package/dist/{payout-account-sqOaU3lp.js → payout-account-B7OikYn5.js} +37 -37
  48. package/dist/softspace-D9cEyOQT.js +4 -0
  49. package/dist/stores/payoutAccount.d.ts +34 -44
  50. package/dist/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/{validator-DzjyJnvv.js → validator-CTlVogBQ.js} +1 -0
  52. package/dist/views/admin/onboard-submission/forms/NTTSubmission.vue.d.ts +16 -16
  53. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +16 -16
  54. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +34 -44
  55. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +54 -64
  56. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +54 -64
  57. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +34 -44
  58. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +43 -44
  59. package/dist/views/admin/payout-account/tabs/SettlementEditDialog.vue.d.ts +56 -0
  60. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +54 -64
  61. package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +2 -2
  62. package/dist/views/admin/payout-account/tabs/gateway/DigioGateway.vue.d.ts +2 -2
  63. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +2 -2
  64. package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +4 -4
  65. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +2 -2
  66. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  67. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  68. package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  69. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +4 -4
  70. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  71. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +4 -4
  72. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +4 -4
  73. package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +6 -6
  74. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  75. package/dist/views/admin/restaurant/tabs/gateway/MaybankGateway.vue.d.ts +6 -6
  76. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
  77. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +4 -6
  78. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +24 -24
  79. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +2 -2
  80. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +2 -2
  81. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +2 -2
  82. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +2 -2
  83. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +2 -2
  84. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +4 -4
  85. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +2 -2
  86. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +2 -2
  87. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +2 -2
  88. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +2 -2
  89. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +2 -2
  90. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +2 -2
  91. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +2 -2
  92. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +2 -2
  93. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +2 -2
  94. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +2 -2
  95. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +2 -2
  96. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +2 -2
  97. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +2 -2
  98. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +2 -2
  99. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +68 -88
  100. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +84 -84
  101. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +42 -42
  102. package/dist/views/settlement/SettlementTable.vue.d.ts +24 -24
  103. package/dist/views/transaction/TransactionTable.vue.d.ts +2 -2
  104. package/package.json +3 -4
  105. package/dist/OnboardSubmission-Vrq1v0BQ.js +0 -446
  106. package/dist/PayoutAccountSetting-uv82IM9I.js +0 -1502
  107. package/dist/Transaction-ajQzNDfS.js +0 -507
  108. package/dist/TransactionOld--JDqFNem.js +0 -313
  109. package/dist/app-BWWQuKIi.js +0 -9153
  110. package/dist/composable/async-poller/index.d.ts +0 -22
  111. package/dist/index-BbyGIYO2.js +0 -63
  112. package/dist/index-MdV54cWO.js +0 -58
  113. package/dist/tyro-BovmsorS.js +0 -5
  114. package/dist/utils/permission.d.ts +0 -1
  115. package/dist/views/admin/onboard-submission/forms/TyroSubmission.vue.d.ts +0 -81
  116. package/dist/views/admin/payout-account/tabs/gateway/TyroGateway.vue.d.ts +0 -39
  117. package/dist/views/admin/restaurant/tabs/gateway/MonetapayGateway.vue.d.ts +0 -48
  118. package/dist/views/admin/terminal/tabs/useTyroSoftposGateway.d.ts +0 -12
  119. package/dist/views/onboard-submission/tyro-submission-polling.d.ts +0 -27
@@ -0,0 +1,1765 @@
1
+ import { defineComponent as R, resolveComponent as y, openBlock as g, createElementBlock as G, Fragment as j, createElementVNode as s, createVNode as a, withCtx as k, createTextVNode as P, toDisplayString as _, unref as r, reactive as de, ref as U, createBlock as w, watch as te, computed as Y, isRef as W, createCommentVNode as $, h as H, onMounted as re, resolveDynamicComponent as ne, normalizeProps as ae, mergeProps as le } from "vue";
2
+ import { p as O } from "./index-C80a7-Ks.js";
3
+ import { u as X, e as h } from "./index-D0j1LZAB.js";
4
+ import { _ as pe } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
5
+ import { useRouter as ye } from "vue-router";
6
+ import { u as ee } from "./index-BkQ7t3F6.js";
7
+ import { _ as Z } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-KebV8Zws.js";
8
+ import { h as be } from "./moment-h96o7c8I.js";
9
+ import { useDialogChild as fe, useDialog as ie, useSnackbar as J, components as ve } from "@feedmepos/ui-library";
10
+ import { P as Q } from "./PDFViewer-CIPPbzWD.js";
11
+ import { u as z } from "./error-K1CakhA9.js";
12
+ import { P as ge } from "./payout-account-B7OikYn5.js";
13
+ import { d as se } from "./index-CxnWUe_K.js";
14
+ import { s as L, o as Fe, z as A, a as C } from "./validator-CTlVogBQ.js";
15
+ import { _ as xe } from "./TextInputDialog.vue_vue_type_script_setup_true_lang-BvGYVca0.js";
16
+ import { useCoreStore as me } from "@feedmepos/mf-common";
17
+ const ke = { class: "flex gap-16 mb-6" }, Ve = { class: "flex gap-16 mb-6" }, we = /* @__PURE__ */ R({
18
+ __name: "Information",
19
+ props: {
20
+ payoutAccount: {
21
+ type: Object,
22
+ required: !0
23
+ }
24
+ },
25
+ setup(t) {
26
+ return (u, e) => {
27
+ var m, v;
28
+ const b = y("FmCardHeader"), o = y("FmCardSection"), n = y("FmCard");
29
+ return g(), G(j, null, [
30
+ s("div", ke, [
31
+ a(n, {
32
+ horizontal: "",
33
+ class: "flex-1 p-6",
34
+ variant: "elevated"
35
+ }, {
36
+ default: k(() => [
37
+ a(o, { class: "flex flex-col gap-16 justify-between" }, {
38
+ default: k(() => [
39
+ a(b, {
40
+ class: "p-0",
41
+ title: "Account Info",
42
+ subtitle: ""
43
+ }),
44
+ a(o, { class: "p-0" }, {
45
+ default: k(() => {
46
+ var p, i, d, l, c;
47
+ return [
48
+ e[0] || (e[0] = s("b", null, "For", -1)),
49
+ P(": " + _((i = (p = t.payoutAccount) == null ? void 0 : p.store) == null ? void 0 : i.event) + " ", 1),
50
+ e[1] || (e[1] = s("br", null, null, -1)),
51
+ e[2] || (e[2] = s("b", null, "Reference", -1)),
52
+ P(": " + _((l = (d = t.payoutAccount) == null ? void 0 : d.store) == null ? void 0 : l.id), 1),
53
+ e[3] || (e[3] = s("br", null, null, -1)),
54
+ e[4] || (e[4] = s("b", null, "Business", -1)),
55
+ P(": " + _((c = t.payoutAccount) == null ? void 0 : c.businessId), 1),
56
+ e[5] || (e[5] = s("br", null, null, -1))
57
+ ];
58
+ }),
59
+ _: 1
60
+ })
61
+ ]),
62
+ _: 1
63
+ })
64
+ ]),
65
+ _: 1
66
+ }),
67
+ a(n, {
68
+ horizontal: "",
69
+ class: "flex-1 p-6",
70
+ variant: "elevated"
71
+ }, {
72
+ default: k(() => [
73
+ a(o, { class: "flex flex-col gap-16 justify-between" }, {
74
+ default: k(() => [
75
+ a(b, {
76
+ class: "p-0",
77
+ title: "Key Person",
78
+ subtitle: ""
79
+ }),
80
+ a(o, { class: "p-0" }, {
81
+ default: k(() => {
82
+ var p, i, d, l, c, f, F, S;
83
+ return [
84
+ e[6] || (e[6] = s("b", null, "Email", -1)),
85
+ P(": " + _((d = (i = (p = t.payoutAccount) == null ? void 0 : p.store) == null ? void 0 : i.keyPerson) == null ? void 0 : d.email) + " ", 1),
86
+ e[7] || (e[7] = s("br", null, null, -1)),
87
+ e[8] || (e[8] = s("b", null, "Name", -1)),
88
+ P(": " + _((f = (c = (l = t.payoutAccount) == null ? void 0 : l.store) == null ? void 0 : c.keyPerson) == null ? void 0 : f.name), 1),
89
+ e[9] || (e[9] = s("br", null, null, -1)),
90
+ e[10] || (e[10] = s("b", null, "Phone", -1)),
91
+ P(": " + _((S = (F = t.payoutAccount) == null ? void 0 : F.store.keyPerson) == null ? void 0 : S.phone), 1),
92
+ e[11] || (e[11] = s("br", null, null, -1))
93
+ ];
94
+ }),
95
+ _: 1
96
+ })
97
+ ]),
98
+ _: 1
99
+ })
100
+ ]),
101
+ _: 1
102
+ })
103
+ ]),
104
+ s("div", Ve, [
105
+ a(n, {
106
+ horizontal: "",
107
+ class: "flex-1 p-6",
108
+ variant: "elevated"
109
+ }, {
110
+ default: k(() => [
111
+ a(o, { class: "flex flex-col gap-16 justify-between" }, {
112
+ default: k(() => [
113
+ a(b, {
114
+ class: "p-0",
115
+ title: "Status Info",
116
+ subtitle: ""
117
+ }),
118
+ a(o, { class: "p-0" }, {
119
+ default: k(() => {
120
+ var p, i, d;
121
+ return [
122
+ e[12] || (e[12] = s("b", null, "Submission Date", -1)),
123
+ P(": " + _((p = t.payoutAccount) != null && p.submissionDate ? r(be)(t.payoutAccount.submissionDate).format(
124
+ "YYYY-MM-DD HH:mm:ss"
125
+ ) : "—"), 1),
126
+ e[13] || (e[13] = s("br", null, null, -1)),
127
+ e[14] || (e[14] = s("b", null, "Status By", -1)),
128
+ P(": " + _(((i = t.payoutAccount) == null ? void 0 : i.statusBy) ?? "—"), 1),
129
+ e[15] || (e[15] = s("br", null, null, -1)),
130
+ e[16] || (e[16] = s("b", null, "Status Reason", -1)),
131
+ P(": " + _(((d = t.payoutAccount) == null ? void 0 : d.statusReason) ?? "—"), 1),
132
+ e[17] || (e[17] = s("br", null, null, -1))
133
+ ];
134
+ }),
135
+ _: 1
136
+ })
137
+ ]),
138
+ _: 1
139
+ })
140
+ ]),
141
+ _: 1
142
+ })
143
+ ]),
144
+ e[18] || (e[18] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
145
+ a(Z, {
146
+ document: t.payoutAccount.store.exteriorPhoto,
147
+ "business-id": t.payoutAccount.businessId,
148
+ "restaurant-id": ((v = (m = t.payoutAccount) == null ? void 0 : m.store) == null ? void 0 : v.event) === "ORDERING" ? t.payoutAccount.store.id : void 0
149
+ }, null, 8, ["document", "business-id", "restaurant-id"])
150
+ ], 64);
151
+ };
152
+ }
153
+ }), Ae = { class: "flex flex-col gap-8" }, Se = { class: "flex flex-col gap-8" }, Ne = { class: "flex justify-end mb-2" }, Ce = /* @__PURE__ */ R({
154
+ __name: "SettlementEditDialog",
155
+ props: {
156
+ initialValue: {
157
+ type: Object,
158
+ required: !0
159
+ },
160
+ bankNameOptions: {
161
+ type: Array,
162
+ required: !0
163
+ },
164
+ businessId: {
165
+ type: String,
166
+ required: !0
167
+ },
168
+ restaurantId: {
169
+ type: String,
170
+ default: void 0
171
+ }
172
+ },
173
+ setup(t) {
174
+ const u = t, { emitAction: e, emitData: b } = fe(), o = de({
175
+ companyName: u.initialValue.companyName,
176
+ regNo: u.initialValue.regNo,
177
+ bankName: u.initialValue.bankName,
178
+ bankHolderName: u.initialValue.bankHolderName,
179
+ bankAccountNumber: u.initialValue.bankAccountNumber,
180
+ ssm: u.initialValue.ssm,
181
+ bankStatement: u.initialValue.bankStatement
182
+ }), n = U(), m = U(), v = U(o.ssm ?? ""), p = U(o.bankStatement ?? ""), i = L().trim().min(1, "Company name is required"), d = L().trim().min(1, "Registration number is required"), l = L().trim().min(1, "Bank name is required"), c = L().trim().min(1, "Bank holder name is required"), f = L().trim().min(1, "Bank account number is required"), F = Fe({
183
+ companyName: i,
184
+ regNo: d,
185
+ bankName: l,
186
+ bankHolderName: c,
187
+ bankAccountNumber: f
188
+ }), S = () => {
189
+ const V = F.safeParse(o);
190
+ V.success && (b({
191
+ ...V.data,
192
+ ssm: o.ssm,
193
+ bankStatement: o.bankStatement,
194
+ newSSM: n.value,
195
+ newBankStatement: m.value
196
+ }), e("primary"));
197
+ };
198
+ async function N(V) {
199
+ const x = new FileReader();
200
+ return new Promise((q) => {
201
+ x.onload = (K) => {
202
+ var E;
203
+ q((E = K.target) == null ? void 0 : E.result);
204
+ }, x.readAsDataURL(V);
205
+ });
206
+ }
207
+ const I = async (V) => {
208
+ n.value = V, v.value = V ? await N(V) : "";
209
+ }, D = async (V) => {
210
+ m.value = V, p.value = V ? await N(V) : "";
211
+ }, T = () => {
212
+ n.value = void 0, v.value = "";
213
+ }, B = () => {
214
+ m.value = void 0, p.value = "";
215
+ };
216
+ return (V, x) => {
217
+ const q = y("FmTextField"), K = y("FmSelect"), E = y("FmButton"), oe = y("FmFormGroup"), ue = y("FmDropField"), ce = y("FmForm");
218
+ return g(), w(ce, {
219
+ class: "flex flex-col gap-16",
220
+ onValidationSuccess: S
221
+ }, {
222
+ default: k(() => [
223
+ x[9] || (x[9] = s("div", { class: "flex items-center my-2" }, [
224
+ s("hr", { class: "w-[80px] border-t border-gray-300" }),
225
+ s("span", { class: "text-left mx-6 text-gray-500" }, "Account"),
226
+ s("hr", { class: "flex-grow border-t border-gray-300" })
227
+ ], -1)),
228
+ a(q, {
229
+ modelValue: o.regNo,
230
+ "onUpdate:modelValue": x[0] || (x[0] = (M) => o.regNo = M),
231
+ label: "Registration Number",
232
+ "label-mark": "required",
233
+ "helper-text": "Registration Number must match uploaded SSM registration number.",
234
+ rules: r(A)(r(d)),
235
+ autofocus: ""
236
+ }, null, 8, ["modelValue", "rules"]),
237
+ a(q, {
238
+ modelValue: o.companyName,
239
+ "onUpdate:modelValue": x[1] || (x[1] = (M) => o.companyName = M),
240
+ label: "Company Name",
241
+ "label-mark": "required",
242
+ "helper-text": "Company Name must match uploaded SSM registration name.",
243
+ rules: r(A)(r(i))
244
+ }, null, 8, ["modelValue", "rules"]),
245
+ x[10] || (x[10] = s("div", { class: "flex items-center my-2" }, [
246
+ s("hr", { class: "w-[80px] border-t border-gray-300" }),
247
+ s("span", { class: "text-left mx-6 text-gray-500" }, "Bank"),
248
+ s("hr", { class: "flex-grow border-t border-gray-300" })
249
+ ], -1)),
250
+ a(K, {
251
+ modelValue: o.bankName,
252
+ "onUpdate:modelValue": x[2] || (x[2] = (M) => o.bankName = M),
253
+ label: "Bank",
254
+ "label-mark": "required",
255
+ items: u.bankNameOptions,
256
+ rules: r(A)(r(l))
257
+ }, null, 8, ["modelValue", "items", "rules"]),
258
+ a(q, {
259
+ modelValue: o.bankHolderName,
260
+ "onUpdate:modelValue": x[3] || (x[3] = (M) => o.bankHolderName = M),
261
+ label: "Bank Holder",
262
+ "label-mark": "required",
263
+ rules: r(A)(r(c))
264
+ }, null, 8, ["modelValue", "rules"]),
265
+ a(q, {
266
+ modelValue: o.bankAccountNumber,
267
+ "onUpdate:modelValue": x[4] || (x[4] = (M) => o.bankAccountNumber = M),
268
+ label: "Bank Account Number",
269
+ "label-mark": "required",
270
+ type: "number",
271
+ rules: r(A)(r(f))
272
+ }, null, 8, ["modelValue", "rules"]),
273
+ x[11] || (x[11] = s("div", { class: "flex items-center my-2" }, [
274
+ s("hr", { class: "w-[80px] border-t border-gray-300" }),
275
+ s("span", { class: "text-left mx-6 text-gray-500" }, "Document"),
276
+ s("hr", { class: "flex-grow border-t border-gray-300" })
277
+ ], -1)),
278
+ s("div", Ae, [
279
+ x[7] || (x[7] = s("p", { class: "fm-typo-en-body-md-500" }, "SSM (PDF)", -1)),
280
+ v.value ? (g(), w(oe, {
281
+ key: 0,
282
+ modelValue: v.value,
283
+ "onUpdate:modelValue": x[5] || (x[5] = (M) => v.value = M),
284
+ label: "SSM"
285
+ }, {
286
+ default: k(() => [
287
+ a(Z, {
288
+ document: v.value,
289
+ "business-id": t.businessId,
290
+ "restaurant-id": t.restaurantId
291
+ }, {
292
+ default: k(({ src: M }) => [
293
+ a(Q, {
294
+ height: 300,
295
+ pdf: M,
296
+ "disable-text-layer": !0,
297
+ "disable-annotation-layer": !0
298
+ }, null, 8, ["pdf"])
299
+ ]),
300
+ _: 1
301
+ }, 8, ["document", "business-id", "restaurant-id"]),
302
+ a(E, {
303
+ type: "button",
304
+ variant: "tertiary",
305
+ label: "Remove",
306
+ size: "md",
307
+ "prepend-icon": "delete",
308
+ onClick: T
309
+ })
310
+ ]),
311
+ _: 1
312
+ }, 8, ["modelValue"])) : (g(), w(ue, {
313
+ key: 1,
314
+ accept: ".pdf",
315
+ onFileUpload: I
316
+ }))
317
+ ]),
318
+ s("div", Se, [
319
+ x[8] || (x[8] = s("p", { class: "fm-typo-en-body-md-500" }, "Bank Statement (PDF)", -1)),
320
+ p.value ? (g(), w(oe, {
321
+ key: 0,
322
+ modelValue: p.value,
323
+ "onUpdate:modelValue": x[6] || (x[6] = (M) => p.value = M),
324
+ label: "Bank Statement"
325
+ }, {
326
+ default: k(() => [
327
+ a(Z, {
328
+ document: p.value,
329
+ "business-id": t.businessId,
330
+ "restaurant-id": t.restaurantId
331
+ }, {
332
+ default: k(({ src: M }) => [
333
+ a(Q, {
334
+ height: 300,
335
+ pdf: M,
336
+ "disable-text-layer": !0,
337
+ "disable-annotation-layer": !0
338
+ }, null, 8, ["pdf"])
339
+ ]),
340
+ _: 1
341
+ }, 8, ["document", "business-id", "restaurant-id"]),
342
+ a(E, {
343
+ type: "button",
344
+ variant: "tertiary",
345
+ label: "Remove",
346
+ size: "md",
347
+ "prepend-icon": "delete",
348
+ onClick: B
349
+ })
350
+ ]),
351
+ _: 1
352
+ }, 8, ["modelValue"])) : (g(), w(ue, {
353
+ key: 1,
354
+ accept: ".pdf",
355
+ onFileUpload: D
356
+ }))
357
+ ]),
358
+ s("div", Ne, [
359
+ a(E, {
360
+ type: "submit",
361
+ variant: "primary",
362
+ label: "Save"
363
+ })
364
+ ])
365
+ ]),
366
+ _: 1
367
+ });
368
+ };
369
+ }
370
+ }), Ue = { class: "flex justify-end mb-6" }, Ie = { class: "flex gap-16 mb-6" }, De = { class: "flex gap-16" }, Te = { class: "flex-1" }, Re = { class: "flex-1" }, Pe = /* @__PURE__ */ R({
371
+ __name: "Settlement",
372
+ props: {
373
+ onUpdate: {
374
+ type: Function,
375
+ required: !0
376
+ },
377
+ payoutAccount: {
378
+ type: Object,
379
+ required: !0
380
+ }
381
+ },
382
+ setup(t) {
383
+ const u = t, e = U(!1), b = ie(), o = J(), n = ge.bankNameOptions(), m = () => {
384
+ var d, l, c, f, F, S, N, I, D, T;
385
+ return {
386
+ companyName: ((d = u.payoutAccount.store) == null ? void 0 : d.companyName) ?? "",
387
+ regNo: ((l = u.payoutAccount.store) == null ? void 0 : l.regNo) ?? "",
388
+ bankName: ((f = (c = u.payoutAccount.store) == null ? void 0 : c.bank) == null ? void 0 : f.name) ?? "",
389
+ bankHolderName: ((S = (F = u.payoutAccount.store) == null ? void 0 : F.bank) == null ? void 0 : S.holderName) ?? "",
390
+ bankAccountNumber: ((I = (N = u.payoutAccount.store) == null ? void 0 : N.bank) == null ? void 0 : I.accountNumber) ?? "",
391
+ ssm: ((D = u.payoutAccount.store) == null ? void 0 : D.ssm) ?? "",
392
+ bankStatement: ((T = u.payoutAccount.store) == null ? void 0 : T.bankStatement) ?? ""
393
+ };
394
+ }, v = async (d, l) => {
395
+ var F;
396
+ const c = (/* @__PURE__ */ new Date()).toISOString();
397
+ if (((F = u.payoutAccount.store) == null ? void 0 : F.event) === "ORDERING")
398
+ return await se.upload(
399
+ `restaurant/${u.payoutAccount.store.id}/documents/${d}/${c}.pdf`,
400
+ l,
401
+ u.payoutAccount.store.id
402
+ );
403
+ const f = u.payoutAccount.businessId || u.payoutAccount.store.id;
404
+ return await se.upload(
405
+ `business/${f}/documents/${d}/${c}.pdf`,
406
+ l
407
+ );
408
+ }, p = async (d) => {
409
+ if (!u.payoutAccount.store) return;
410
+ let l = u.payoutAccount.store.ssm;
411
+ d.newSSM && (l = await v("ssm", d.newSSM));
412
+ let c = u.payoutAccount.store.bankStatement;
413
+ d.newBankStatement && (c = await v(
414
+ "bankStatement",
415
+ d.newBankStatement
416
+ ));
417
+ const f = {
418
+ ...u.payoutAccount,
419
+ store: {
420
+ ...u.payoutAccount.store,
421
+ companyName: d.companyName,
422
+ regNo: d.regNo,
423
+ bank: {
424
+ ...u.payoutAccount.store.bank ?? {},
425
+ name: d.bankName,
426
+ holderName: d.bankHolderName,
427
+ accountNumber: d.bankAccountNumber
428
+ },
429
+ ssm: l,
430
+ bankStatement: c
431
+ }
432
+ };
433
+ try {
434
+ e.value = !0, await u.onUpdate(f), o.open({
435
+ type: "success",
436
+ title: "Settlement info updated successfully"
437
+ }), b.close();
438
+ } catch (F) {
439
+ o.open({
440
+ type: "error",
441
+ title: "Failed to update settlement info",
442
+ message: z(F)
443
+ });
444
+ } finally {
445
+ e.value = !1;
446
+ }
447
+ }, i = () => {
448
+ var d;
449
+ b.close(), b.open({
450
+ title: "Edit Settlement Info",
451
+ closeButton: !0,
452
+ overlay: !0,
453
+ contentComponent: Ce,
454
+ contentComponentProps: {
455
+ initialValue: m(),
456
+ bankNameOptions: n,
457
+ businessId: u.payoutAccount.businessId,
458
+ restaurantId: ((d = u.payoutAccount.store) == null ? void 0 : d.event) === "ORDERING" ? u.payoutAccount.store.id : void 0
459
+ }
460
+ }).onPrimary((l) => {
461
+ p(l);
462
+ });
463
+ };
464
+ return (d, l) => {
465
+ var N, I, D, T;
466
+ const c = y("FmButton"), f = y("FmCardHeader"), F = y("FmCardSection"), S = y("FmCard");
467
+ return g(), G(j, null, [
468
+ s("div", Ue, [
469
+ a(c, {
470
+ variant: "primary",
471
+ label: "Edit Settlement Info",
472
+ loading: e.value,
473
+ onclick: i
474
+ }, null, 8, ["loading"])
475
+ ]),
476
+ s("div", Ie, [
477
+ a(S, {
478
+ horizontal: "",
479
+ class: "flex-1 p-6",
480
+ variant: "elevated"
481
+ }, {
482
+ default: k(() => [
483
+ a(F, { class: "flex flex-col gap-16 justify-between" }, {
484
+ default: k(() => [
485
+ a(f, {
486
+ class: "p-0",
487
+ title: "Company Info",
488
+ subtitle: ""
489
+ }),
490
+ a(F, { class: "p-0" }, {
491
+ default: k(() => {
492
+ var B, V;
493
+ return [
494
+ l[0] || (l[0] = s("b", null, "Name", -1)),
495
+ P(": " + _((B = t.payoutAccount) == null ? void 0 : B.store.companyName), 1),
496
+ l[1] || (l[1] = s("br", null, null, -1)),
497
+ l[2] || (l[2] = s("b", null, "Registration Number", -1)),
498
+ P(": " + _((V = t.payoutAccount) == null ? void 0 : V.store.regNo), 1),
499
+ l[3] || (l[3] = s("br", null, null, -1))
500
+ ];
501
+ }),
502
+ _: 1
503
+ })
504
+ ]),
505
+ _: 1
506
+ })
507
+ ]),
508
+ _: 1
509
+ }),
510
+ a(S, {
511
+ horizontal: "",
512
+ class: "flex-1 p-6",
513
+ variant: "elevated"
514
+ }, {
515
+ default: k(() => [
516
+ a(F, { class: "flex flex-col gap-16 justify-between" }, {
517
+ default: k(() => [
518
+ a(f, {
519
+ class: "p-0",
520
+ title: "Bank Info",
521
+ subtitle: ""
522
+ }),
523
+ a(F, { class: "p-0" }, {
524
+ default: k(() => {
525
+ var B, V, x, q, K, E;
526
+ return [
527
+ l[4] || (l[4] = s("b", null, "Bank", -1)),
528
+ P(": " + _((V = (B = t.payoutAccount) == null ? void 0 : B.store.bank) == null ? void 0 : V.name), 1),
529
+ l[5] || (l[5] = s("br", null, null, -1)),
530
+ l[6] || (l[6] = s("b", null, "Name", -1)),
531
+ P(": " + _((q = (x = t.payoutAccount) == null ? void 0 : x.store.bank) == null ? void 0 : q.holderName), 1),
532
+ l[7] || (l[7] = s("br", null, null, -1)),
533
+ l[8] || (l[8] = s("b", null, "Number", -1)),
534
+ P(": " + _((E = (K = t.payoutAccount) == null ? void 0 : K.store.bank) == null ? void 0 : E.accountNumber), 1)
535
+ ];
536
+ }),
537
+ _: 1
538
+ })
539
+ ]),
540
+ _: 1
541
+ })
542
+ ]),
543
+ _: 1
544
+ })
545
+ ]),
546
+ s("div", De, [
547
+ s("div", Te, [
548
+ l[9] || (l[9] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
549
+ a(Z, {
550
+ "business-id": t.payoutAccount.businessId,
551
+ "restaurant-id": ((I = (N = t.payoutAccount) == null ? void 0 : N.store) == null ? void 0 : I.event) === "ORDERING" ? t.payoutAccount.store.id : void 0,
552
+ document: t.payoutAccount.store.ssm
553
+ }, {
554
+ default: k(({ src: B }) => [
555
+ a(Q, {
556
+ pdf: B,
557
+ "disable-text-layer": !0,
558
+ "disable-annotation-layer": !0
559
+ }, null, 8, ["pdf"])
560
+ ]),
561
+ _: 1
562
+ }, 8, ["business-id", "restaurant-id", "document"])
563
+ ]),
564
+ s("div", Re, [
565
+ l[10] || (l[10] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
566
+ a(Z, {
567
+ "business-id": t.payoutAccount.businessId,
568
+ "restaurant-id": ((T = (D = t.payoutAccount) == null ? void 0 : D.store) == null ? void 0 : T.event) === "ORDERING" ? t.payoutAccount.store.id : void 0,
569
+ document: t.payoutAccount.store.bankStatement
570
+ }, {
571
+ default: k(({ src: B }) => [
572
+ a(Q, {
573
+ pdf: B,
574
+ "disable-text-layer": !0,
575
+ "disable-annotation-layer": !0
576
+ }, null, 8, ["pdf"])
577
+ ]),
578
+ _: 1
579
+ }, 8, ["business-id", "restaurant-id", "document"])
580
+ ])
581
+ ])
582
+ ], 64);
583
+ };
584
+ }
585
+ }), Be = /* @__PURE__ */ R({
586
+ __name: "RateInput",
587
+ props: {
588
+ data: {},
589
+ onChange: { type: Function }
590
+ },
591
+ setup(t) {
592
+ const u = t, e = U(u.data.toString());
593
+ return te(e, (b) => {
594
+ u.onChange(parseFloat(b));
595
+ }), (b, o) => {
596
+ const n = y("FmTextField");
597
+ return g(), w(n, {
598
+ inputmode: "decimal",
599
+ modelValue: e.value,
600
+ "onUpdate:modelValue": o[0] || (o[0] = (m) => e.value = m)
601
+ }, {
602
+ append: k(() => [...o[1] || (o[1] = [
603
+ P("%", -1)
604
+ ])]),
605
+ _: 1
606
+ }, 8, ["modelValue"]);
607
+ };
608
+ }
609
+ }), Me = /* @__PURE__ */ R({
610
+ __name: "TPlusInput",
611
+ props: {
612
+ data: {},
613
+ onChange: { type: Function }
614
+ },
615
+ setup(t) {
616
+ const u = t, e = U(u.data.toString());
617
+ return te(e, (b) => {
618
+ u.onChange(parseInt(b));
619
+ }), (b, o) => {
620
+ const n = y("FmTextField");
621
+ return g(), w(n, {
622
+ inputmode: "numeric",
623
+ modelValue: e.value,
624
+ "onUpdate:modelValue": o[0] || (o[0] = (m) => e.value = m)
625
+ }, null, 8, ["modelValue"]);
626
+ };
627
+ }
628
+ }), _e = /* @__PURE__ */ R({
629
+ __name: "MinimumFeeInput",
630
+ props: {
631
+ data: {},
632
+ onChange: { type: Function }
633
+ },
634
+ setup(t) {
635
+ const u = t, e = U(u.data.toString());
636
+ return te(e, (b) => {
637
+ u.onChange(parseFloat(b));
638
+ }), (b, o) => {
639
+ const n = y("FmTextField");
640
+ return g(), w(n, {
641
+ inputmode: "numeric",
642
+ modelValue: e.value,
643
+ "onUpdate:modelValue": o[0] || (o[0] = (m) => e.value = m)
644
+ }, {
645
+ prepend: k(() => [...o[1] || (o[1] = [
646
+ P("$", -1)
647
+ ])]),
648
+ _: 1
649
+ }, 8, ["modelValue"]);
650
+ };
651
+ }
652
+ }), $e = { class: "flex gap-16 mt-6" }, he = { class: "flex-1" }, qe = { class: "flex-1" }, Ee = { class: "my-6 w-full flex justify-end" }, Ge = { class: "w-[320px]" }, Oe = /* @__PURE__ */ R({
653
+ __name: "PaymentStatus",
654
+ props: {
655
+ onUpdate: {
656
+ type: Function,
657
+ required: !0
658
+ },
659
+ payoutAccount: {
660
+ type: Object,
661
+ required: !0
662
+ }
663
+ },
664
+ setup(t) {
665
+ const u = t, e = U(!1), b = J(), o = ie(), n = async (l) => {
666
+ try {
667
+ e.value = !0, await u.onUpdate(l), b.open({
668
+ type: "success",
669
+ title: "Payout account update succesfully"
670
+ });
671
+ } catch (c) {
672
+ b.open({
673
+ type: "error",
674
+ title: "Error occurs when updating payout account",
675
+ message: z(c)
676
+ });
677
+ } finally {
678
+ e.value = !1;
679
+ }
680
+ }, m = async () => {
681
+ o.close(), o.open({
682
+ title: "Rejection Reason",
683
+ closeButton: !0,
684
+ overlay: !0,
685
+ contentComponent: xe,
686
+ contentComponentProps: {
687
+ label: "Reason",
688
+ placeholder: "Enter reason for rejection..."
689
+ }
690
+ }).onPrimary((l) => {
691
+ u.payoutAccount.enable = !1, u.payoutAccount.status = "REJECTED", u.payoutAccount.statusReason = l, n(u.payoutAccount), o.close();
692
+ });
693
+ }, { search: v } = ee({
694
+ search: ""
695
+ }), p = Y(() => {
696
+ const { ssm: l, bank: c, bankStatement: f } = u.payoutAccount.store;
697
+ return l && c && c.name && c.accountNumber && c.holderName && f;
698
+ }), i = U(""), d = [
699
+ {
700
+ header: () => "Payment Method",
701
+ accessorKey: "issuer",
702
+ cell: (l) => `${l.row.original.issuer} (${l.row.original.variant})`
703
+ },
704
+ {
705
+ header: () => "Rate",
706
+ accessorKey: "rate",
707
+ cell: ({ row: l }) => {
708
+ let c = 0;
709
+ return l.original.rate && (c = l.original.rate.amount / Math.pow(10, l.original.rate.precision)), H(Be, {
710
+ data: c,
711
+ onChange: (f) => {
712
+ const F = u.payoutAccount.methods.at(l.index);
713
+ F.rate || (F.rate = {
714
+ amount: 0,
715
+ precision: 4
716
+ }), F.rate.amount = f * Math.pow(10, F.rate.precision);
717
+ }
718
+ });
719
+ }
720
+ },
721
+ {
722
+ header: () => "Minimum Fee",
723
+ accessorKey: "minimumFee",
724
+ cell: ({ row: l }) => {
725
+ let c = 0;
726
+ return l.original.minimumFee && (c = l.original.minimumFee.amount / Math.pow(10, l.original.minimumFee.precision)), H(_e, {
727
+ data: c,
728
+ onChange: (f) => {
729
+ const F = u.payoutAccount.methods.at(l.index);
730
+ F.minimumFee || (F.minimumFee = {
731
+ amount: 0,
732
+ precision: 2
733
+ }), F.minimumFee.amount = f * Math.pow(10, F.minimumFee.precision);
734
+ }
735
+ });
736
+ }
737
+ },
738
+ {
739
+ header: () => "T plus",
740
+ accessorKey: "tPlus",
741
+ cell: ({ row: l }) => H(Me, {
742
+ data: l.original.tPlus ?? 0,
743
+ onChange: (c) => {
744
+ const f = u.payoutAccount.methods.at(l.index);
745
+ f.tPlus = c;
746
+ }
747
+ })
748
+ }
749
+ ];
750
+ return (l, c) => {
751
+ const f = y("FmRadio"), F = y("FmRadioGroup"), S = y("FmSwitch"), N = y("FmSearch"), I = y("FmTable"), D = y("FmButton");
752
+ return g(), G(j, null, [
753
+ s("div", $e, [
754
+ s("div", he, [
755
+ a(F, {
756
+ modelValue: t.payoutAccount.status,
757
+ "onUpdate:modelValue": c[0] || (c[0] = (T) => t.payoutAccount.status = T),
758
+ label: "Account Status"
759
+ }, {
760
+ default: k(() => [
761
+ a(f, {
762
+ value: "PENDING",
763
+ label: "Pending"
764
+ }),
765
+ a(f, {
766
+ value: "APPROVED",
767
+ label: "Approved"
768
+ }),
769
+ a(f, {
770
+ value: "REJECTED",
771
+ label: "Rejected",
772
+ onClick: m
773
+ })
774
+ ]),
775
+ _: 1
776
+ }, 8, ["modelValue"])
777
+ ]),
778
+ s("div", qe, [
779
+ a(S, {
780
+ modelValue: t.payoutAccount.enable,
781
+ "onUpdate:modelValue": c[1] || (c[1] = (T) => t.payoutAccount.enable = T),
782
+ disabled: !p.value,
783
+ label: "Enabled",
784
+ sublabel: "Merchant can use online features such as e-payment, settlement"
785
+ }, null, 8, ["modelValue", "disabled"])
786
+ ])
787
+ ]),
788
+ t.payoutAccount.enable ? (g(), G(j, { key: 0 }, [
789
+ s("div", Ee, [
790
+ s("div", Ge, [
791
+ a(N, {
792
+ modelValue: r(v),
793
+ "onUpdate:modelValue": c[2] || (c[2] = (T) => W(v) ? v.value = T : null),
794
+ placeholder: "Search Method ..."
795
+ }, null, 8, ["modelValue"])
796
+ ])
797
+ ]),
798
+ a(I, {
799
+ class: "mt-6",
800
+ modelValue: i.value,
801
+ "onUpdate:modelValue": c[3] || (c[3] = (T) => i.value = T),
802
+ "shrink-at": !1,
803
+ "search-value": r(v),
804
+ "row-data": t.payoutAccount.methods,
805
+ "column-defs": d
806
+ }, null, 8, ["modelValue", "search-value", "row-data"])
807
+ ], 64)) : $("", !0),
808
+ a(D, {
809
+ class: "w-full mt-6",
810
+ variant: "primary",
811
+ label: "Save",
812
+ loading: e.value,
813
+ onclick: () => n(t.payoutAccount)
814
+ }, null, 8, ["loading", "onclick"])
815
+ ], 64);
816
+ };
817
+ }
818
+ }), Ke = { class: "flex" }, je = /* @__PURE__ */ R({
819
+ __name: "Actions",
820
+ emits: ["edit", "delete"],
821
+ setup(t, { emit: u }) {
822
+ const e = u;
823
+ return (b, o) => {
824
+ const n = y("FmButton");
825
+ return g(), G("div", Ke, [
826
+ a(n, {
827
+ variant: "plain",
828
+ "prepend-icon": "delete",
829
+ onClick: o[0] || (o[0] = (m) => {
830
+ m.stopPropagation(), e("delete");
831
+ })
832
+ })
833
+ ]);
834
+ };
835
+ }
836
+ }), Ye = { class: "flex justify-end px-6 pb-6" }, He = /* @__PURE__ */ R({
837
+ __name: "PaymentChannel",
838
+ props: {
839
+ payoutAccount: {
840
+ type: Object,
841
+ required: !0
842
+ }
843
+ },
844
+ setup(t) {
845
+ const u = J(), e = t, { isLoading: b, startAsyncCall: o } = X(), n = U([]);
846
+ function m() {
847
+ o(async () => {
848
+ n.value = await O.getChannels(e.payoutAccount._id);
849
+ });
850
+ }
851
+ re(m);
852
+ function v() {
853
+ o(async () => {
854
+ try {
855
+ await O.updateChannels(e.payoutAccount._id, n.value), u.open({
856
+ type: "success",
857
+ title: "Payout account channels update succesfully"
858
+ });
859
+ } catch (d) {
860
+ u.open({
861
+ type: "error",
862
+ title: "Error occurs when updating payout account channels",
863
+ message: z(d)
864
+ });
865
+ }
866
+ });
867
+ }
868
+ function p() {
869
+ o(async () => {
870
+ try {
871
+ await O.resetChannels(e.payoutAccount._id), n.value = await O.getChannels(e.payoutAccount._id), u.open({
872
+ type: "success",
873
+ title: "Payout account channels reset succesfully"
874
+ });
875
+ } catch (d) {
876
+ u.open({
877
+ type: "error",
878
+ title: "Error occurs when reset payout account channels",
879
+ message: z(d)
880
+ });
881
+ }
882
+ });
883
+ }
884
+ const i = [
885
+ {
886
+ header: () => "Gateway",
887
+ accessorKey: "gateway"
888
+ },
889
+ {
890
+ header: () => "Payment Type",
891
+ accessorKey: "type"
892
+ },
893
+ {
894
+ header: () => "Display",
895
+ accessorKey: "icon",
896
+ cell: ({ row: d }) => H("img", { src: d.original.icon, width: 32, height: 32 })
897
+ },
898
+ {
899
+ header: () => "Label",
900
+ accessorKey: "label",
901
+ cell: ({ row: d }) => H(ve.FmTextField, {
902
+ modelValue: d.original.label,
903
+ "onUpdate:modelValue": (l) => d.original.label = l
904
+ })
905
+ },
906
+ {
907
+ id: "actions",
908
+ header: () => "Actions",
909
+ cell: ({ row: d }) => H(je, {
910
+ onDelete: () => n.value.splice(d.index, 1)
911
+ })
912
+ }
913
+ ];
914
+ return (d, l) => {
915
+ const c = y("FmButton"), f = y("FmTable");
916
+ return g(), G(j, null, [
917
+ s("div", Ye, [
918
+ a(c, {
919
+ class: "mx-4",
920
+ variant: "destructive",
921
+ size: "md",
922
+ icon: "history",
923
+ label: "Reset",
924
+ onClick: p
925
+ }),
926
+ a(c, {
927
+ variant: "primary",
928
+ size: "md",
929
+ icon: "save",
930
+ label: "Save",
931
+ onClick: v
932
+ })
933
+ ]),
934
+ a(f, {
935
+ loading: r(b),
936
+ "row-data": n.value,
937
+ "column-defs": i,
938
+ "shrink-at": !1
939
+ }, null, 8, ["loading", "row-data"])
940
+ ], 64);
941
+ };
942
+ }
943
+ }), ze = { class: "flex mt-6 space-x-6" }, Le = /* @__PURE__ */ R({
944
+ __name: "FiuuGateway",
945
+ props: {
946
+ gateway: {
947
+ type: Object,
948
+ required: !0
949
+ },
950
+ onUpdate: {
951
+ type: Function,
952
+ required: !0
953
+ },
954
+ onDelete: {
955
+ type: Function,
956
+ required: !0
957
+ }
958
+ },
959
+ setup(t) {
960
+ var b;
961
+ const e = U(((b = t.gateway) == null ? void 0 : b.config) || {
962
+ merchantId: "",
963
+ verifyKey: "",
964
+ secretKey: ""
965
+ });
966
+ return (o, n) => {
967
+ const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
968
+ return g(), w(p, {
969
+ ref: "form",
970
+ class: "flex flex-col gap-16",
971
+ onValidationSuccess: n[3] || (n[3] = () => t.onUpdate(e.value))
972
+ }, {
973
+ default: k(() => [
974
+ a(m, {
975
+ modelValue: e.value.merchantId,
976
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => e.value.merchantId = i),
977
+ label: "Merchant ID",
978
+ rules: r(A)(r(C).string())
979
+ }, null, 8, ["modelValue", "rules"]),
980
+ a(m, {
981
+ modelValue: e.value.verifyKey,
982
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => e.value.verifyKey = i),
983
+ label: "Verify Key",
984
+ rules: r(A)(r(C).string())
985
+ }, null, 8, ["modelValue", "rules"]),
986
+ a(m, {
987
+ modelValue: e.value.secretKey,
988
+ "onUpdate:modelValue": n[2] || (n[2] = (i) => e.value.secretKey = i),
989
+ label: "Secret Key",
990
+ rules: r(A)(r(C).string())
991
+ }, null, 8, ["modelValue", "rules"]),
992
+ s("div", ze, [
993
+ t.gateway ? (g(), w(v, {
994
+ key: 0,
995
+ class: "flex-1",
996
+ variant: "secondary",
997
+ label: "Delete",
998
+ onclick: () => t.onDelete()
999
+ }, null, 8, ["onclick"])) : $("", !0),
1000
+ a(v, {
1001
+ type: "submit",
1002
+ class: "flex-1",
1003
+ variant: "primary",
1004
+ label: "Save"
1005
+ })
1006
+ ])
1007
+ ]),
1008
+ _: 1
1009
+ }, 512);
1010
+ };
1011
+ }
1012
+ }), Ze = { class: "flex mt-6 space-x-6" }, Je = /* @__PURE__ */ R({
1013
+ __name: "MacauPassGateway",
1014
+ props: {
1015
+ gateway: {
1016
+ type: Object,
1017
+ required: !0
1018
+ },
1019
+ onUpdate: {
1020
+ type: Function,
1021
+ required: !0
1022
+ },
1023
+ onDelete: {
1024
+ type: Function,
1025
+ required: !0
1026
+ }
1027
+ },
1028
+ setup(t) {
1029
+ var b;
1030
+ const e = U(((b = t.gateway) == null ? void 0 : b.config) || {
1031
+ merchantId: "",
1032
+ merchantName: "",
1033
+ merchantCategoryCode: "",
1034
+ storeID: "",
1035
+ storeName: ""
1036
+ });
1037
+ return (o, n) => {
1038
+ const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
1039
+ return g(), w(p, {
1040
+ ref: "form",
1041
+ class: "flex flex-col gap-16",
1042
+ onValidationSuccess: n[5] || (n[5] = () => t.onUpdate(e.value))
1043
+ }, {
1044
+ default: k(() => [
1045
+ a(m, {
1046
+ modelValue: e.value.merchantId,
1047
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => e.value.merchantId = i),
1048
+ label: "Merchant ID",
1049
+ rules: r(A)(r(C).string())
1050
+ }, null, 8, ["modelValue", "rules"]),
1051
+ a(m, {
1052
+ modelValue: e.value.merchantName,
1053
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => e.value.merchantName = i),
1054
+ label: "Merchant Name",
1055
+ rules: r(A)(r(C).string())
1056
+ }, null, 8, ["modelValue", "rules"]),
1057
+ a(m, {
1058
+ modelValue: e.value.merchantCategoryCode,
1059
+ "onUpdate:modelValue": n[2] || (n[2] = (i) => e.value.merchantCategoryCode = i),
1060
+ label: "Merchant MCC",
1061
+ rules: r(A)(r(C).string())
1062
+ }, null, 8, ["modelValue", "rules"]),
1063
+ a(m, {
1064
+ modelValue: e.value.storeID,
1065
+ "onUpdate:modelValue": n[3] || (n[3] = (i) => e.value.storeID = i),
1066
+ label: "Store ID",
1067
+ rules: r(A)(r(C).string())
1068
+ }, null, 8, ["modelValue", "rules"]),
1069
+ a(m, {
1070
+ modelValue: e.value.storeName,
1071
+ "onUpdate:modelValue": n[4] || (n[4] = (i) => e.value.storeName = i),
1072
+ label: "Store Name",
1073
+ rules: r(A)(r(C).string())
1074
+ }, null, 8, ["modelValue", "rules"]),
1075
+ s("div", Ze, [
1076
+ t.gateway ? (g(), w(v, {
1077
+ key: 0,
1078
+ class: "flex-1",
1079
+ variant: "secondary",
1080
+ label: "Delete",
1081
+ onclick: () => t.onDelete()
1082
+ }, null, 8, ["onclick"])) : $("", !0),
1083
+ a(v, {
1084
+ type: "submit",
1085
+ class: "flex-1",
1086
+ variant: "primary",
1087
+ label: "Save"
1088
+ })
1089
+ ])
1090
+ ]),
1091
+ _: 1
1092
+ }, 512);
1093
+ };
1094
+ }
1095
+ }), Qe = { class: "flex mt-6 space-x-6" }, We = /* @__PURE__ */ R({
1096
+ __name: "DigioGateway",
1097
+ props: {
1098
+ gateway: {
1099
+ type: Object,
1100
+ required: !0
1101
+ },
1102
+ onUpdate: {
1103
+ type: Function,
1104
+ required: !0
1105
+ },
1106
+ onDelete: {
1107
+ type: Function,
1108
+ required: !0
1109
+ }
1110
+ },
1111
+ setup(t) {
1112
+ var b;
1113
+ const e = U(((b = t.gateway) == null ? void 0 : b.config) || {
1114
+ merchantId: "",
1115
+ cardMerchantId: ""
1116
+ });
1117
+ return (o, n) => {
1118
+ const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
1119
+ return g(), w(p, {
1120
+ ref: "form",
1121
+ class: "flex flex-col gap-16",
1122
+ onValidationSuccess: n[2] || (n[2] = () => t.onUpdate(e.value))
1123
+ }, {
1124
+ default: k(() => [
1125
+ a(m, {
1126
+ modelValue: e.value.merchantId,
1127
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => e.value.merchantId = i),
1128
+ label: "Merchant ID",
1129
+ rules: r(A)(r(C).string())
1130
+ }, null, 8, ["modelValue", "rules"]),
1131
+ a(m, {
1132
+ modelValue: e.value.cardMerchantId,
1133
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => e.value.cardMerchantId = i),
1134
+ label: "Card Merchant ID",
1135
+ rules: r(A)(r(C).string())
1136
+ }, null, 8, ["modelValue", "rules"]),
1137
+ s("div", Qe, [
1138
+ t.gateway ? (g(), w(v, {
1139
+ key: 0,
1140
+ class: "flex-1",
1141
+ variant: "secondary",
1142
+ label: "Delete",
1143
+ onclick: () => t.onDelete()
1144
+ }, null, 8, ["onclick"])) : $("", !0),
1145
+ a(v, {
1146
+ type: "submit",
1147
+ class: "flex-1",
1148
+ variant: "primary",
1149
+ label: "Save"
1150
+ })
1151
+ ])
1152
+ ]),
1153
+ _: 1
1154
+ }, 512);
1155
+ };
1156
+ }
1157
+ }), Xe = { class: "flex mt-6 space-x-6" }, et = /* @__PURE__ */ R({
1158
+ __name: "AdyenGateway",
1159
+ props: {
1160
+ gateway: {
1161
+ type: Object,
1162
+ required: !0
1163
+ },
1164
+ onUpdate: {
1165
+ type: Function,
1166
+ required: !0
1167
+ },
1168
+ onDelete: {
1169
+ type: Function,
1170
+ required: !0
1171
+ }
1172
+ },
1173
+ setup(t) {
1174
+ var b;
1175
+ const e = U(((b = t.gateway) == null ? void 0 : b.config) || {
1176
+ merchantAccount: "",
1177
+ username: "",
1178
+ apiKey: "",
1179
+ clientKey: "",
1180
+ endpoint: "",
1181
+ hmacKey: ""
1182
+ });
1183
+ return (o, n) => {
1184
+ const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
1185
+ return g(), w(p, {
1186
+ ref: "form",
1187
+ class: "flex flex-col gap-16",
1188
+ onValidationSuccess: n[6] || (n[6] = () => t.onUpdate(e.value))
1189
+ }, {
1190
+ default: k(() => [
1191
+ a(m, {
1192
+ modelValue: e.value.endpoint,
1193
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => e.value.endpoint = i),
1194
+ label: "Endpoint",
1195
+ rules: r(A)(r(C).string())
1196
+ }, null, 8, ["modelValue", "rules"]),
1197
+ a(m, {
1198
+ modelValue: e.value.merchantAccount,
1199
+ "onUpdate:modelValue": n[1] || (n[1] = (i) => e.value.merchantAccount = i),
1200
+ label: "Merchant Account",
1201
+ rules: r(A)(r(C).string())
1202
+ }, null, 8, ["modelValue", "rules"]),
1203
+ a(m, {
1204
+ modelValue: e.value.username,
1205
+ "onUpdate:modelValue": n[2] || (n[2] = (i) => e.value.username = i),
1206
+ label: "Username",
1207
+ rules: r(A)(r(C).string())
1208
+ }, null, 8, ["modelValue", "rules"]),
1209
+ a(m, {
1210
+ modelValue: e.value.apiKey,
1211
+ "onUpdate:modelValue": n[3] || (n[3] = (i) => e.value.apiKey = i),
1212
+ label: "API Key",
1213
+ rules: r(A)(r(C).string())
1214
+ }, null, 8, ["modelValue", "rules"]),
1215
+ a(m, {
1216
+ modelValue: e.value.clientKey,
1217
+ "onUpdate:modelValue": n[4] || (n[4] = (i) => e.value.clientKey = i),
1218
+ label: "Client Key",
1219
+ rules: r(A)(r(C).string())
1220
+ }, null, 8, ["modelValue", "rules"]),
1221
+ a(m, {
1222
+ modelValue: e.value.hmacKey,
1223
+ "onUpdate:modelValue": n[5] || (n[5] = (i) => e.value.hmacKey = i),
1224
+ label: "HMac Key"
1225
+ }, null, 8, ["modelValue"]),
1226
+ s("div", Xe, [
1227
+ t.gateway ? (g(), w(v, {
1228
+ key: 0,
1229
+ class: "flex-1",
1230
+ variant: "secondary",
1231
+ label: "Delete",
1232
+ onclick: () => t.onDelete()
1233
+ }, null, 8, ["onclick"])) : $("", !0),
1234
+ a(v, {
1235
+ type: "submit",
1236
+ class: "flex-1",
1237
+ variant: "primary",
1238
+ label: "Save"
1239
+ })
1240
+ ])
1241
+ ]),
1242
+ _: 1
1243
+ }, 512);
1244
+ };
1245
+ }
1246
+ }), tt = { class: "flex mt-6 space-x-6" }, nt = /* @__PURE__ */ R({
1247
+ __name: "KsherGateway",
1248
+ props: {
1249
+ gateway: {
1250
+ type: Object,
1251
+ required: !0
1252
+ },
1253
+ onUpdate: {
1254
+ type: Function,
1255
+ required: !0
1256
+ },
1257
+ onDelete: {
1258
+ type: Function,
1259
+ required: !0
1260
+ }
1261
+ },
1262
+ setup(t) {
1263
+ var b;
1264
+ const e = U(((b = t.gateway) == null ? void 0 : b.config) || {
1265
+ appId: "",
1266
+ privateKey: ""
1267
+ });
1268
+ return (o, n) => {
1269
+ const m = y("FmTextField"), v = y("FmTextarea"), p = y("FmButton"), i = y("FmForm");
1270
+ return g(), w(i, {
1271
+ ref: "form",
1272
+ class: "flex flex-col gap-16",
1273
+ onValidationSuccess: n[2] || (n[2] = () => t.onUpdate(e.value))
1274
+ }, {
1275
+ default: k(() => [
1276
+ a(m, {
1277
+ modelValue: e.value.appId,
1278
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => e.value.appId = d),
1279
+ label: "App ID",
1280
+ rules: r(A)(r(C).string())
1281
+ }, null, 8, ["modelValue", "rules"]),
1282
+ a(v, {
1283
+ modelValue: e.value.privateKey,
1284
+ "onUpdate:modelValue": n[1] || (n[1] = (d) => e.value.privateKey = d),
1285
+ label: "Private Key",
1286
+ placeholder: "Paste your private key including BEGIN and END markers",
1287
+ rules: r(A)(r(C).string())
1288
+ }, null, 8, ["modelValue", "rules"]),
1289
+ s("div", tt, [
1290
+ t.gateway ? (g(), w(p, {
1291
+ key: 0,
1292
+ class: "flex-1",
1293
+ variant: "secondary",
1294
+ label: "Delete",
1295
+ onclick: () => t.onDelete()
1296
+ }, null, 8, ["onclick"])) : $("", !0),
1297
+ a(p, {
1298
+ type: "submit",
1299
+ class: "flex-1",
1300
+ variant: "primary",
1301
+ label: "Save"
1302
+ })
1303
+ ])
1304
+ ]),
1305
+ _: 1
1306
+ }, 512);
1307
+ };
1308
+ }
1309
+ }), at = {
1310
+ key: 0,
1311
+ className: "mt-1 my-6 text-gray-600"
1312
+ }, lt = {
1313
+ key: 1,
1314
+ class: "flex items-center justify-center min-h-[80vh]"
1315
+ }, ot = /* @__PURE__ */ R({
1316
+ __name: "PaymentGateway",
1317
+ props: {
1318
+ payoutAccount: {
1319
+ type: Object,
1320
+ required: !0
1321
+ }
1322
+ },
1323
+ setup(t) {
1324
+ const u = me().currentCountry, e = u.value, b = J(), { isLoading: o, startAsyncCall: n } = X(), { gatewayTab: m } = ee({
1325
+ gatewayTab: ""
1326
+ }), v = t, p = [
1327
+ {
1328
+ label: "Fiuu",
1329
+ value: "RAZER_MERCHANT_SERVICE",
1330
+ render: Le,
1331
+ region: [h.F_COUNTRY.enum.MY, h.F_COUNTRY.enum.SG]
1332
+ },
1333
+ {
1334
+ label: "Macau Pass",
1335
+ value: "MACAU_PASS",
1336
+ render: Je,
1337
+ region: [h.F_COUNTRY.enum.MO]
1338
+ },
1339
+ {
1340
+ label: "Digio",
1341
+ value: "DIGIO",
1342
+ render: We,
1343
+ region: [h.F_COUNTRY.enum.TH]
1344
+ },
1345
+ {
1346
+ label: "Ksher",
1347
+ value: "KSHER",
1348
+ render: nt,
1349
+ region: [h.F_COUNTRY.enum.TH]
1350
+ },
1351
+ {
1352
+ label: "Adyen",
1353
+ value: "ADYEN",
1354
+ render: et,
1355
+ region: [h.F_COUNTRY.enum.MY, h.F_COUNTRY.enum.SG]
1356
+ }
1357
+ ], i = U(
1358
+ v.payoutAccount.gateways ?? []
1359
+ ), d = Y(() => p.find((S) => S.value === m.value)), l = Y(() => p.filter(
1360
+ (S) => S.region.includes(u.value ?? h.F_COUNTRY.enum.MY)
1361
+ ));
1362
+ async function c(S) {
1363
+ await n(async () => {
1364
+ try {
1365
+ await O.updateGateway(v.payoutAccount._id, S), b.open({
1366
+ type: "success",
1367
+ title: "Payout account gateways update succesfully"
1368
+ }), f.value = S.length === 0;
1369
+ } catch (N) {
1370
+ b.open({
1371
+ type: "error",
1372
+ title: "Error occurs when updating payout account gateways",
1373
+ message: z(N)
1374
+ });
1375
+ }
1376
+ });
1377
+ }
1378
+ const f = U((v.payoutAccount.gateways ?? []).length === 0), F = Y(() => e !== "MY" || !f.value);
1379
+ return (S, N) => {
1380
+ var B;
1381
+ const I = y("FmCircularProgress"), D = y("FmSwitch"), T = y("FmTabs");
1382
+ return g(), G(j, null, [
1383
+ r(e) ? (g(), G("p", at, [...N[2] || (N[2] = [
1384
+ s("b", null, "Note: ", -1),
1385
+ P(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ", -1)
1386
+ ])])) : $("", !0),
1387
+ r(o) ? (g(), G("div", lt, [
1388
+ a(I, { size: "xxl" })
1389
+ ])) : (g(), G(j, { key: 2 }, [
1390
+ r(e) === "MY" ? (g(), w(D, {
1391
+ key: 0,
1392
+ modelValue: f.value,
1393
+ "onUpdate:modelValue": N[0] || (N[0] = (V) => f.value = V),
1394
+ style: { "padding-bottom": "12px" },
1395
+ label: "Use FeedMe's Fiuu Account?"
1396
+ }, null, 8, ["modelValue"])) : $("", !0),
1397
+ F.value ? (g(), w(T, {
1398
+ key: 1,
1399
+ "model-value": r(m),
1400
+ "onUpdate:modelValue": N[1] || (N[1] = (V) => W(m) ? m.value = V : null),
1401
+ class: "mb-6",
1402
+ items: l.value
1403
+ }, null, 8, ["model-value", "items"])) : $("", !0),
1404
+ F.value && r(m) ? (g(), w(ne((B = d.value) == null ? void 0 : B.render), ae(le({ key: 2 }, {
1405
+ gateway: i.value.find(
1406
+ (V) => {
1407
+ var x;
1408
+ return V.paymentGateway === ((x = d.value) == null ? void 0 : x.value);
1409
+ }
1410
+ ),
1411
+ onDelete: async () => {
1412
+ i.value = i.value.filter(
1413
+ (V) => {
1414
+ var x;
1415
+ return V.paymentGateway !== ((x = d.value) == null ? void 0 : x.value);
1416
+ }
1417
+ ), c(i.value);
1418
+ },
1419
+ onUpdate: (V) => {
1420
+ var q;
1421
+ let x = i.value.find(
1422
+ (K) => {
1423
+ var E;
1424
+ return K.paymentGateway === ((E = d.value) == null ? void 0 : E.value);
1425
+ }
1426
+ );
1427
+ x ? x.config = V : i.value.push({
1428
+ paymentGateway: (q = d.value) == null ? void 0 : q.value,
1429
+ config: V
1430
+ }), c(i.value);
1431
+ }
1432
+ })), null, 16)) : $("", !0)
1433
+ ], 64))
1434
+ ], 64);
1435
+ };
1436
+ }
1437
+ }), ut = { class: "flex mt-6 space-x-6" }, st = /* @__PURE__ */ R({
1438
+ __name: "GooglePayToken",
1439
+ props: {
1440
+ gateway: {
1441
+ type: Object,
1442
+ required: !0
1443
+ },
1444
+ onUpdate: {
1445
+ type: Function,
1446
+ required: !0
1447
+ },
1448
+ onDelete: {
1449
+ type: Function,
1450
+ required: !0
1451
+ }
1452
+ },
1453
+ setup(t) {
1454
+ const e = U(
1455
+ t.gateway || {
1456
+ type: "googlePay",
1457
+ gateway: "RAZER_MERCHANT_SERVICE",
1458
+ config: {
1459
+ gateway: "molpay",
1460
+ gatewayMerchantId: "molpay"
1461
+ }
1462
+ }
1463
+ );
1464
+ return (b, o) => {
1465
+ const n = y("FmTextField"), m = y("FmButton"), v = y("FmForm");
1466
+ return g(), w(v, {
1467
+ ref: "form",
1468
+ class: "flex flex-col gap-16",
1469
+ onValidationSuccess: o[3] || (o[3] = () => t.onUpdate(e.value))
1470
+ }, {
1471
+ default: k(() => [
1472
+ a(n, {
1473
+ modelValue: e.value.gateway,
1474
+ "onUpdate:modelValue": o[0] || (o[0] = (p) => e.value.gateway = p),
1475
+ label: "Gateway",
1476
+ disabled: !0,
1477
+ rules: r(A)(r(C).string())
1478
+ }, null, 8, ["modelValue", "rules"]),
1479
+ a(n, {
1480
+ modelValue: e.value.config.gateway,
1481
+ "onUpdate:modelValue": o[1] || (o[1] = (p) => e.value.config.gateway = p),
1482
+ label: "Gateway ID",
1483
+ disabled: !0,
1484
+ rules: r(A)(r(C).string())
1485
+ }, null, 8, ["modelValue", "rules"]),
1486
+ a(n, {
1487
+ modelValue: e.value.config.gatewayMerchantId,
1488
+ "onUpdate:modelValue": o[2] || (o[2] = (p) => e.value.config.gatewayMerchantId = p),
1489
+ label: "Gateway Merchant ID",
1490
+ disabled: !0,
1491
+ rules: r(A)(r(C).string())
1492
+ }, null, 8, ["modelValue", "rules"]),
1493
+ s("div", ut, [
1494
+ t.gateway ? (g(), w(m, {
1495
+ key: 0,
1496
+ class: "flex-1",
1497
+ variant: "secondary",
1498
+ label: "Delete",
1499
+ onclick: () => t.onDelete()
1500
+ }, null, 8, ["onclick"])) : $("", !0),
1501
+ a(m, {
1502
+ type: "submit",
1503
+ class: "flex-1",
1504
+ variant: "primary",
1505
+ label: "Save"
1506
+ })
1507
+ ])
1508
+ ]),
1509
+ _: 1
1510
+ }, 512);
1511
+ };
1512
+ }
1513
+ }), rt = { class: "flex mt-6 space-x-6" }, it = /* @__PURE__ */ R({
1514
+ __name: "ApplePayToken",
1515
+ props: {
1516
+ gateway: {
1517
+ type: Object,
1518
+ required: !0
1519
+ },
1520
+ onUpdate: {
1521
+ type: Function,
1522
+ required: !0
1523
+ },
1524
+ onDelete: {
1525
+ type: Function,
1526
+ required: !0
1527
+ }
1528
+ },
1529
+ setup(t) {
1530
+ const e = U(
1531
+ t.gateway || {
1532
+ type: "applePay",
1533
+ gateway: "RAZER_MERCHANT_SERVICE",
1534
+ config: {
1535
+ merchantId: "FMfeedme"
1536
+ }
1537
+ }
1538
+ );
1539
+ return (b, o) => {
1540
+ const n = y("FmTextField"), m = y("FmButton"), v = y("FmForm");
1541
+ return g(), w(v, {
1542
+ ref: "form",
1543
+ class: "flex flex-col gap-16",
1544
+ onValidationSuccess: o[2] || (o[2] = () => t.onUpdate(e.value))
1545
+ }, {
1546
+ default: k(() => [
1547
+ a(n, {
1548
+ modelValue: e.value.gateway,
1549
+ "onUpdate:modelValue": o[0] || (o[0] = (p) => e.value.gateway = p),
1550
+ label: "Gateway",
1551
+ disabled: !0,
1552
+ rules: r(A)(r(C).string())
1553
+ }, null, 8, ["modelValue", "rules"]),
1554
+ a(n, {
1555
+ modelValue: e.value.config.merchantId,
1556
+ "onUpdate:modelValue": o[1] || (o[1] = (p) => e.value.config.merchantId = p),
1557
+ label: "Merchant ID",
1558
+ disabled: !0,
1559
+ rules: r(A)(r(C).string())
1560
+ }, null, 8, ["modelValue", "rules"]),
1561
+ s("div", rt, [
1562
+ t.gateway ? (g(), w(m, {
1563
+ key: 0,
1564
+ class: "flex-1",
1565
+ variant: "secondary",
1566
+ label: "Delete",
1567
+ onclick: () => t.onDelete()
1568
+ }, null, 8, ["onclick"])) : $("", !0),
1569
+ a(m, {
1570
+ type: "submit",
1571
+ class: "flex-1",
1572
+ variant: "primary",
1573
+ label: "Save"
1574
+ })
1575
+ ])
1576
+ ]),
1577
+ _: 1
1578
+ }, 512);
1579
+ };
1580
+ }
1581
+ }), mt = {
1582
+ key: 0,
1583
+ class: "flex items-center justify-center min-h-[80vh]"
1584
+ }, ct = /* @__PURE__ */ R({
1585
+ __name: "TokenGateway",
1586
+ props: {
1587
+ payoutAccount: {
1588
+ type: Object,
1589
+ required: !0
1590
+ }
1591
+ },
1592
+ setup(t) {
1593
+ const u = me().currentCountry, e = J(), { isLoading: b, startAsyncCall: o } = X(), { tokenTab: n } = ee({
1594
+ tokenTab: ""
1595
+ }), m = t, v = [
1596
+ {
1597
+ label: "Google Pay",
1598
+ value: "googlePay",
1599
+ icon: "android",
1600
+ render: st,
1601
+ region: [h.F_COUNTRY.enum.MY, h.F_COUNTRY.enum.SG]
1602
+ },
1603
+ {
1604
+ label: "Apple Pay",
1605
+ value: "applePay",
1606
+ icon: "iOS",
1607
+ render: it,
1608
+ region: [h.F_COUNTRY.enum.MY, h.F_COUNTRY.enum.SG]
1609
+ }
1610
+ ], p = U(m.payoutAccount.tokens ?? []), i = Y(() => v.find((c) => c.value === n.value)), d = Y(() => v.filter(
1611
+ (c) => c.region.includes(u.value ?? h.F_COUNTRY.enum.MY)
1612
+ ));
1613
+ async function l(c) {
1614
+ await o(async () => {
1615
+ try {
1616
+ await O.updateTokens(m.payoutAccount._id, c), e.open({
1617
+ type: "success",
1618
+ title: "Payout account tokens gateway update succesfully"
1619
+ });
1620
+ } catch (f) {
1621
+ e.open({
1622
+ type: "error",
1623
+ title: "Error occurs when updating payout account tokens",
1624
+ message: z(f)
1625
+ });
1626
+ }
1627
+ });
1628
+ }
1629
+ return (c, f) => {
1630
+ var N;
1631
+ const F = y("FmCircularProgress"), S = y("FmTabs");
1632
+ return g(), G(j, null, [
1633
+ f[1] || (f[1] = s("p", { className: "mt-1 my-6 text-gray-600" }, [
1634
+ s("b", null, "Note: "),
1635
+ P(" Token gateways appear above other online payment channels to comply with provider branding requirements. Configuration is standardized, so you generally only need to select the provider. "),
1636
+ s("br"),
1637
+ s("br"),
1638
+ s("b", null, ` Token payments are automatically enabled for "Pay-First" merchants. You do not need to adjust settings here unless you're modifying for a non-Pay-First merchant who wishes to manually enable this feature. `),
1639
+ s("br")
1640
+ ], -1)),
1641
+ r(b) ? (g(), G("div", mt, [
1642
+ a(F, { size: "xxl" })
1643
+ ])) : (g(), w(S, {
1644
+ key: 1,
1645
+ "model-value": r(n),
1646
+ "onUpdate:modelValue": f[0] || (f[0] = (I) => W(n) ? n.value = I : null),
1647
+ class: "mb-6 mt-6",
1648
+ items: d.value
1649
+ }, null, 8, ["model-value", "items"])),
1650
+ r(n) ? (g(), w(ne((N = i.value) == null ? void 0 : N.render), ae(le({ key: 2 }, {
1651
+ gateway: p.value.find((I) => {
1652
+ var D;
1653
+ return I.type === ((D = i.value) == null ? void 0 : D.value);
1654
+ }),
1655
+ onDelete: async () => {
1656
+ p.value = p.value.filter((I) => {
1657
+ var D;
1658
+ return I.type !== ((D = i.value) == null ? void 0 : D.value);
1659
+ }), l(p.value);
1660
+ },
1661
+ onUpdate: (I) => {
1662
+ let D = p.value.find((T) => {
1663
+ var B;
1664
+ return T.type === ((B = i.value) == null ? void 0 : B.value);
1665
+ });
1666
+ D ? D.config = I : p.value.push(I), l(p.value);
1667
+ }
1668
+ })), null, 16)) : $("", !0)
1669
+ ], 64);
1670
+ };
1671
+ }
1672
+ }), Ut = /* @__PURE__ */ R({
1673
+ __name: "PayoutAccountSetting",
1674
+ props: {
1675
+ accountId: {
1676
+ type: String,
1677
+ required: !0
1678
+ }
1679
+ },
1680
+ setup(t) {
1681
+ const u = t, { tab: e } = ee({
1682
+ tab: "information"
1683
+ }), { isLoading: b, startAsyncCall: o } = X(!0), n = ye(), m = U();
1684
+ async function v(l) {
1685
+ await O.updateById(
1686
+ u.accountId,
1687
+ l
1688
+ ), m.value = await O.readById(u.accountId);
1689
+ }
1690
+ const p = [
1691
+ {
1692
+ label: "Information",
1693
+ value: "information",
1694
+ icon: "overview",
1695
+ render: we
1696
+ },
1697
+ {
1698
+ label: "Settlement",
1699
+ value: "settlement",
1700
+ icon: "payments",
1701
+ render: Pe
1702
+ },
1703
+ {
1704
+ label: "MDR Status",
1705
+ value: "payment",
1706
+ icon: "account_box",
1707
+ render: Oe
1708
+ },
1709
+ {
1710
+ label: "Online Gateways",
1711
+ icon: "assured_workload",
1712
+ value: "gateways",
1713
+ render: ot
1714
+ },
1715
+ {
1716
+ label: "Token Gateways",
1717
+ value: "tokens",
1718
+ icon: "wallet",
1719
+ render: ct
1720
+ },
1721
+ {
1722
+ label: "Online Channels",
1723
+ icon: "shopping_cart",
1724
+ value: "channels",
1725
+ render: He
1726
+ }
1727
+ ];
1728
+ function i() {
1729
+ o(async () => {
1730
+ m.value = await O.readById(u.accountId);
1731
+ });
1732
+ }
1733
+ re(i);
1734
+ const d = Y(() => {
1735
+ const l = p.reduce((c, f) => c || (f.children ? f.children.find((F) => F.value === e.value) || null : f.value === e.value ? f : null), null);
1736
+ return l == null ? void 0 : l.render;
1737
+ });
1738
+ return (l, c) => {
1739
+ var F;
1740
+ const f = y("FmTabs");
1741
+ return g(), w(pe, {
1742
+ title: `Payout Account (${(F = m.value) == null ? void 0 : F._id})`,
1743
+ loading: r(b),
1744
+ onBack: r(n).back
1745
+ }, {
1746
+ default: k(() => [
1747
+ a(f, {
1748
+ "model-value": r(e),
1749
+ "onUpdate:modelValue": c[0] || (c[0] = (S) => W(e) ? e.value = S : null),
1750
+ class: "mb-6",
1751
+ items: p
1752
+ }, null, 8, ["model-value"]),
1753
+ r(e) ? (g(), w(ne(d.value), ae(le({ key: 0 }, {
1754
+ payoutAccount: m.value,
1755
+ onUpdate: v
1756
+ })), null, 16)) : $("", !0)
1757
+ ]),
1758
+ _: 1
1759
+ }, 8, ["title", "loading", "onBack"]);
1760
+ };
1761
+ }
1762
+ });
1763
+ export {
1764
+ Ut as default
1765
+ };