@feedmepos/mf-payment 1.2.5 → 1.2.6

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 (60) hide show
  1. package/dist/{PayoutAccount-D9LY7i1J.js → PayoutAccount-CFFgQ_65.js} +6 -6
  2. package/dist/{PayoutAccount-DEoI6K0j.js → PayoutAccount-CSm0Ldg9.js} +5 -5
  3. package/dist/{PayoutAccountSetting-5lrvWFIz.js → PayoutAccountSetting-rO11Afiw.js} +3 -3
  4. package/dist/{Restaurant-AxoM-AsE.js → Restaurant-CoNFB1rk.js} +4 -4
  5. package/dist/RestaurantSetting-BQvg8S_p.js +628 -0
  6. package/dist/{Settlement-D4CsP3fg.js → Settlement-DEKvU0zP.js} +3 -3
  7. package/dist/{Settlement-DDwe_w3m.js → Settlement-DpmBq0V9.js} +3 -3
  8. package/dist/{SettlementTransactions-Cmv7dqVI.js → SettlementTransactions-3alZwucT.js} +3 -3
  9. package/dist/{SettlementTransactions-Dp3nN442.js → SettlementTransactions-DugNdpd2.js} +3 -3
  10. package/dist/{Terminal-B8UQH6ga.js → Terminal-Dv7zS_te.js} +5 -5
  11. package/dist/{TerminalSetting-yRok1Iuc.js → TerminalSetting-ChM9jB-O.js} +3 -3
  12. package/dist/{Transaction-KkfCz4Cu.js → Transaction-CT8Be7FS.js} +7 -7
  13. package/dist/{Transaction-BZ7H6oB_.js → Transaction-DCKhuoVw.js} +5 -5
  14. package/dist/{TransactionOld-BLpQHFH1.js → TransactionOld-jkTy7Aeb.js} +4 -4
  15. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-C4Bb203Q.js → TransactionTable.vue_vue_type_script_setup_true_lang-B_By7BvK.js} +3 -3
  16. package/dist/api/payment-gateway/index.d.ts +3 -0
  17. package/dist/{app-I2TNuZCs.js → app-CiHNgoQY.js} +181 -181
  18. package/dist/app.js +1 -1
  19. package/dist/{assets-D5Qc4r7j.js → assets-BqjaEXmB.js} +2 -2
  20. package/dist/{grafana-BAbIv4CF.js → grafana-Bwx9Kj61.js} +1 -1
  21. package/dist/{index-D209n4gS.js → index-1q4ZbRix.js} +4203 -4162
  22. package/dist/{index-CnGVTtwu.js → index-BIDuwnm_.js} +1 -1
  23. package/dist/{index-Cc0abuxv.js → index-C3fxBVdz.js} +1 -1
  24. package/dist/{index-DGcRvKvr.js → index-CCIVpogO.js} +1 -1
  25. package/dist/{index-CguRXKmG.js → index-CN50SqVG.js} +1 -1
  26. package/dist/{index-bOlAWIVP.js → index-CZrwq9oF.js} +1 -1
  27. package/dist/{index-1NP0WkxZ.js → index-CyMElhGL.js} +2 -2
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-HYqCCZsZ.js → index.vue_vue_type_script_setup_true_lang-DT8A92zR.js} +1 -1
  29. package/dist/package.json +2 -2
  30. package/dist/{payout-account-DNGKjfY1.js → payout-account-cg0CKkbk.js} +3 -3
  31. package/dist/stores/payoutAccount.d.ts +18 -18
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +18 -18
  34. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +44 -44
  35. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +44 -44
  36. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +18 -18
  37. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +18 -18
  38. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +44 -44
  39. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  40. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  41. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  42. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +10 -10
  43. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +10 -10
  44. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +46 -0
  45. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +10 -10
  46. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +8 -8
  47. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +4 -4
  48. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +18 -18
  49. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +18 -18
  50. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +18 -18
  51. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +18 -18
  52. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +18 -18
  53. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +18 -18
  54. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +18 -18
  55. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +36 -36
  56. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +36 -36
  57. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +18 -18
  58. package/dist/views/settlement/SettlementTable.vue.d.ts +4 -4
  59. package/package.json +2 -2
  60. package/dist/RestaurantSetting-B6LQF664.js +0 -501
@@ -3,11 +3,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
3
3
  data: {
4
4
  type: PropType<{
5
5
  createdAt: Date;
6
- remark?: string | null | undefined;
7
6
  store?: {
8
7
  id: string;
9
8
  event: "ORDERING" | "MARKETING";
10
9
  } | null | undefined;
10
+ remark?: string | null | undefined;
11
11
  _id: string;
12
12
  beneficiaryBank: {
13
13
  name: string;
@@ -40,11 +40,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
40
40
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
41
41
  "row-click": (payment: {
42
42
  createdAt: Date;
43
- remark?: string | null | undefined;
44
43
  store?: {
45
44
  id: string;
46
45
  event: "ORDERING" | "MARKETING";
47
46
  } | null | undefined;
47
+ remark?: string | null | undefined;
48
48
  _id: string;
49
49
  beneficiaryBank: {
50
50
  name: string;
@@ -72,11 +72,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
72
72
  data: {
73
73
  type: PropType<{
74
74
  createdAt: Date;
75
- remark?: string | null | undefined;
76
75
  store?: {
77
76
  id: string;
78
77
  event: "ORDERING" | "MARKETING";
79
78
  } | null | undefined;
79
+ remark?: string | null | undefined;
80
80
  _id: string;
81
81
  beneficiaryBank: {
82
82
  name: string;
@@ -109,11 +109,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
109
109
  }>> & Readonly<{
110
110
  "onRow-click"?: ((payment: {
111
111
  createdAt: Date;
112
- remark?: string | null | undefined;
113
112
  store?: {
114
113
  id: string;
115
114
  event: "ORDERING" | "MARKETING";
116
115
  } | null | undefined;
116
+ remark?: string | null | undefined;
117
117
  _id: string;
118
118
  beneficiaryBank: {
119
119
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -34,7 +34,7 @@
34
34
  "@feedmepos/core": "^2.6.0",
35
35
  "@feedmepos/mf-common": "^1.26.8",
36
36
  "vue-i18n": "10.0.5",
37
- "@feedmepos/payment-entity": "^0.1.8",
37
+ "@feedmepos/payment-entity": "^0.1.9",
38
38
  "@feedmepos/ui-library": "^1.6.8",
39
39
  "axios": "^0.27.2",
40
40
  "buffer": "^6.0.3",
@@ -1,501 +0,0 @@
1
- import { defineComponent as C, ref as U, resolveComponent as d, openBlock as v, createBlock as F, withCtx as D, createVNode as o, unref as a, createElementVNode as k, createCommentVNode as S, onMounted as q, computed as M, createElementBlock as P, Fragment as E, resolveDynamicComponent as K, normalizeProps as O, mergeProps as $, isRef as A } from "vue";
2
- import { g as N, b as R, e as _, u as B } from "./index-D209n4gS.js";
3
- import { _ as Y } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
4
- import { useRouter as L } from "vue-router";
5
- import { u as j } from "./index-Cc0abuxv.js";
6
- import { z as i, a as m } from "./validator-D5jtpt9A.js";
7
- import { useCoreStore as z } from "@feedmepos/mf-common";
8
- import { r as H } from "./index-DGcRvKvr.js";
9
- const x = {
10
- async get(n) {
11
- return N(
12
- await R().get(
13
- `restaurants/${n}/payment-gateway`
14
- )
15
- );
16
- },
17
- async upsert(n, V) {
18
- return N(
19
- await R().post(
20
- `restaurants/${n}/payment-gateway`,
21
- { data: V }
22
- )
23
- );
24
- },
25
- async delete(n, V) {
26
- return N(
27
- await R().delete(
28
- `restaurants/${n}/payment-gateway/${V}`
29
- )
30
- );
31
- }
32
- }, Q = { class: "flex mt-6 space-x-6" }, Z = /* @__PURE__ */ C({
33
- __name: "FiuuGateway",
34
- props: {
35
- onUpdate: {
36
- type: Function,
37
- required: !0
38
- },
39
- onDelete: {
40
- type: Function,
41
- required: !0
42
- },
43
- gateway: {
44
- type: Object,
45
- required: !0
46
- }
47
- },
48
- setup(n) {
49
- var y;
50
- const e = U(((y = n.gateway) == null ? void 0 : y.config) || {
51
- merchantId: "",
52
- uniqueId: "",
53
- verifyKey: "",
54
- secretKey: "",
55
- applicationCode: "",
56
- offlineSecret: ""
57
- });
58
- return (w, t) => {
59
- const l = d("FmTextField"), u = d("FmButton"), f = d("FmForm");
60
- return v(), F(f, {
61
- ref: "form",
62
- class: "flex flex-col gap-16",
63
- onValidationSuccess: t[6] || (t[6] = () => n.onUpdate(e.value))
64
- }, {
65
- default: D(() => [
66
- o(l, {
67
- modelValue: e.value.merchantId,
68
- "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value.merchantId = r),
69
- label: "Merchant ID",
70
- rules: a(i)(a(m).string())
71
- }, null, 8, ["modelValue", "rules"]),
72
- o(l, {
73
- modelValue: e.value.uniqueId,
74
- "onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.uniqueId = r),
75
- label: "Unique ID",
76
- rules: a(i)(a(m).string())
77
- }, null, 8, ["modelValue", "rules"]),
78
- o(l, {
79
- modelValue: e.value.verifyKey,
80
- "onUpdate:modelValue": t[2] || (t[2] = (r) => e.value.verifyKey = r),
81
- label: "Verify Key",
82
- rules: a(i)(a(m).string())
83
- }, null, 8, ["modelValue", "rules"]),
84
- o(l, {
85
- modelValue: e.value.secretKey,
86
- "onUpdate:modelValue": t[3] || (t[3] = (r) => e.value.secretKey = r),
87
- label: "Secret Key",
88
- rules: a(i)(a(m).string())
89
- }, null, 8, ["modelValue", "rules"]),
90
- o(l, {
91
- modelValue: e.value.applicationCode,
92
- "onUpdate:modelValue": t[4] || (t[4] = (r) => e.value.applicationCode = r),
93
- label: "Application Code ( Offline )",
94
- rules: a(i)(a(m).string())
95
- }, null, 8, ["modelValue", "rules"]),
96
- o(l, {
97
- modelValue: e.value.offlineSecret,
98
- "onUpdate:modelValue": t[5] || (t[5] = (r) => e.value.offlineSecret = r),
99
- label: "Offline Secret ( Offline )",
100
- rules: a(i)(a(m).string())
101
- }, null, 8, ["modelValue", "rules"]),
102
- k("div", Q, [
103
- n.gateway ? (v(), F(u, {
104
- key: 0,
105
- class: "flex-1",
106
- variant: "secondary",
107
- label: "Delete",
108
- onclick: () => n.onDelete(n.gateway)
109
- }, null, 8, ["onclick"])) : S("", !0),
110
- o(u, {
111
- type: "submit",
112
- class: "flex-1",
113
- variant: "primary",
114
- label: "Save"
115
- })
116
- ])
117
- ]),
118
- _: 1
119
- }, 512);
120
- };
121
- }
122
- }), J = { class: "flex mt-6 space-x-6" }, W = /* @__PURE__ */ C({
123
- __name: "RevenueMonsterGateway",
124
- props: {
125
- onUpdate: {
126
- type: Function,
127
- required: !0
128
- },
129
- onDelete: {
130
- type: Function,
131
- required: !0
132
- },
133
- gateway: {
134
- type: Object,
135
- required: !0
136
- }
137
- },
138
- setup(n) {
139
- var y;
140
- const e = U(((y = n.gateway) == null ? void 0 : y.config) || {
141
- storeId: "",
142
- clientId: "",
143
- clientSecret: "",
144
- clientPrivateKey: ""
145
- });
146
- return (w, t) => {
147
- const l = d("FmTextField"), u = d("FmTextarea"), f = d("FmButton"), r = d("FmForm");
148
- return v(), F(r, {
149
- ref: "form",
150
- class: "flex flex-col gap-16",
151
- onValidationSuccess: t[4] || (t[4] = () => n.onUpdate(e.value))
152
- }, {
153
- default: D(() => [
154
- o(l, {
155
- modelValue: e.value.storeId,
156
- "onUpdate:modelValue": t[0] || (t[0] = (s) => e.value.storeId = s),
157
- label: "Store ID",
158
- rules: a(i)(a(m).string())
159
- }, null, 8, ["modelValue", "rules"]),
160
- o(l, {
161
- modelValue: e.value.clientId,
162
- "onUpdate:modelValue": t[1] || (t[1] = (s) => e.value.clientId = s),
163
- label: "Client ID",
164
- rules: a(i)(a(m).string())
165
- }, null, 8, ["modelValue", "rules"]),
166
- o(l, {
167
- modelValue: e.value.clientSecret,
168
- "onUpdate:modelValue": t[2] || (t[2] = (s) => e.value.clientSecret = s),
169
- label: "Client Secret",
170
- rules: a(i)(a(m).string())
171
- }, null, 8, ["modelValue", "rules"]),
172
- o(u, {
173
- modelValue: e.value.clientPrivateKey,
174
- "onUpdate:modelValue": t[3] || (t[3] = (s) => e.value.clientPrivateKey = s),
175
- label: "Client Private Key"
176
- }, null, 8, ["modelValue"]),
177
- k("div", J, [
178
- n.gateway ? (v(), F(f, {
179
- key: 0,
180
- class: "flex-1",
181
- variant: "secondary",
182
- label: "Delete",
183
- onclick: () => n.onDelete(n.gateway)
184
- }, null, 8, ["onclick"])) : S("", !0),
185
- o(f, {
186
- type: "submit",
187
- class: "flex-1",
188
- variant: "primary",
189
- label: "Save"
190
- })
191
- ])
192
- ]),
193
- _: 1
194
- }, 512);
195
- };
196
- }
197
- }), X = { class: "flex mt-6 space-x-6" }, h = /* @__PURE__ */ C({
198
- __name: "GhlGateway",
199
- props: {
200
- onUpdate: {
201
- type: Function,
202
- required: !0
203
- },
204
- onDelete: {
205
- type: Function,
206
- required: !0
207
- },
208
- gateway: {
209
- type: Object,
210
- required: !0
211
- }
212
- },
213
- setup(n) {
214
- var y;
215
- const e = U(((y = n.gateway) == null ? void 0 : y.config) || {
216
- merchantId: "",
217
- terminalId: "",
218
- privateKey: ""
219
- });
220
- return (w, t) => {
221
- const l = d("FmTextField"), u = d("FmTextarea"), f = d("FmButton"), r = d("FmForm");
222
- return v(), F(r, {
223
- ref: "form",
224
- class: "flex flex-col gap-16",
225
- onValidationSuccess: t[3] || (t[3] = () => n.onUpdate(e.value))
226
- }, {
227
- default: D(() => [
228
- o(l, {
229
- modelValue: e.value.merchantId,
230
- "onUpdate:modelValue": t[0] || (t[0] = (s) => e.value.merchantId = s),
231
- label: "Merchant ID",
232
- rules: a(i)(a(m).string())
233
- }, null, 8, ["modelValue", "rules"]),
234
- o(l, {
235
- modelValue: e.value.terminalId,
236
- "onUpdate:modelValue": t[1] || (t[1] = (s) => e.value.terminalId = s),
237
- label: "Terminal ID",
238
- rules: a(i)(a(m).string())
239
- }, null, 8, ["modelValue", "rules"]),
240
- o(u, {
241
- id: "ghl_pkey",
242
- modelValue: e.value.privateKey,
243
- "onUpdate:modelValue": t[2] || (t[2] = (s) => e.value.privateKey = s),
244
- label: "Private Key",
245
- rules: a(i)(a(m).string())
246
- }, null, 8, ["modelValue", "rules"]),
247
- k("div", X, [
248
- n.gateway ? (v(), F(f, {
249
- key: 0,
250
- class: "flex-1",
251
- variant: "secondary",
252
- label: "Delete",
253
- onclick: () => n.onDelete(n.gateway)
254
- }, null, 8, ["onclick"])) : S("", !0),
255
- o(f, {
256
- type: "submit",
257
- class: "flex-1",
258
- variant: "primary",
259
- label: "Save"
260
- })
261
- ])
262
- ]),
263
- _: 1
264
- }, 512);
265
- };
266
- }
267
- }), ee = { class: "flex mt-6 space-x-6" }, te = /* @__PURE__ */ C({
268
- __name: "MacauPassGateway",
269
- props: {
270
- onUpdate: {
271
- type: Function,
272
- required: !0
273
- },
274
- onDelete: {
275
- type: Function,
276
- required: !0
277
- },
278
- gateway: {
279
- type: Object,
280
- required: !0
281
- }
282
- },
283
- setup(n) {
284
- var y;
285
- const e = U(((y = n.gateway) == null ? void 0 : y.config) || {
286
- merchantId: "",
287
- merchantName: "",
288
- merchantCategoryCode: "",
289
- storeID: "",
290
- storeName: ""
291
- });
292
- return (w, t) => {
293
- const l = d("FmTextField"), u = d("FmButton"), f = d("FmForm");
294
- return v(), F(f, {
295
- ref: "form",
296
- class: "flex flex-col gap-16",
297
- onValidationSuccess: t[5] || (t[5] = () => n.onUpdate(e.value))
298
- }, {
299
- default: D(() => [
300
- o(l, {
301
- modelValue: e.value.merchantId,
302
- "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value.merchantId = r),
303
- label: "Merchant ID",
304
- rules: a(i)(a(m).string())
305
- }, null, 8, ["modelValue", "rules"]),
306
- o(l, {
307
- modelValue: e.value.merchantName,
308
- "onUpdate:modelValue": t[1] || (t[1] = (r) => e.value.merchantName = r),
309
- label: "Merchant Name",
310
- rules: a(i)(a(m).string())
311
- }, null, 8, ["modelValue", "rules"]),
312
- o(l, {
313
- modelValue: e.value.merchantCategoryCode,
314
- "onUpdate:modelValue": t[2] || (t[2] = (r) => e.value.merchantCategoryCode = r),
315
- label: "Merchant MCC",
316
- rules: a(i)(a(m).string())
317
- }, null, 8, ["modelValue", "rules"]),
318
- o(l, {
319
- modelValue: e.value.storeID,
320
- "onUpdate:modelValue": t[3] || (t[3] = (r) => e.value.storeID = r),
321
- label: "Store ID",
322
- rules: a(i)(a(m).string())
323
- }, null, 8, ["modelValue", "rules"]),
324
- o(l, {
325
- modelValue: e.value.storeName,
326
- "onUpdate:modelValue": t[4] || (t[4] = (r) => e.value.storeName = r),
327
- label: "Store Name",
328
- rules: a(i)(a(m).string())
329
- }, null, 8, ["modelValue", "rules"]),
330
- k("div", ee, [
331
- n.gateway ? (v(), F(u, {
332
- key: 0,
333
- class: "flex-1",
334
- variant: "secondary",
335
- label: "Delete",
336
- onclick: () => n.onDelete(n.gateway)
337
- }, null, 8, ["onclick"])) : S("", !0),
338
- o(u, {
339
- type: "submit",
340
- class: "flex-1",
341
- variant: "primary",
342
- label: "Save"
343
- })
344
- ])
345
- ]),
346
- _: 1
347
- }, 512);
348
- };
349
- }
350
- }), ae = {
351
- key: 0,
352
- class: "flex items-center justify-center min-h-[80vh]"
353
- }, le = /* @__PURE__ */ C({
354
- __name: "PaymentGateway",
355
- props: {
356
- restaurant: {
357
- type: Object,
358
- required: !0
359
- }
360
- },
361
- setup(n) {
362
- const V = [
363
- {
364
- label: "Fiuu",
365
- value: "RAZER_MERCHANT_SERVICE",
366
- form: Z,
367
- region: [_.F_COUNTRY.enum.MY, _.F_COUNTRY.enum.SG]
368
- },
369
- {
370
- label: "Revenue Monster",
371
- value: "REVENUE_MONSTER",
372
- form: W,
373
- region: [_.F_COUNTRY.enum.MY]
374
- },
375
- {
376
- label: "GHL",
377
- value: "E_GHL",
378
- form: h,
379
- region: [_.F_COUNTRY.enum.MY]
380
- },
381
- {
382
- label: "Macau Pass",
383
- value: "MACAU_PASS",
384
- form: te,
385
- region: [_.F_COUNTRY.enum.MO]
386
- }
387
- ], e = n, y = z(), { isLoading: w, startAsyncCall: t } = B(), l = U(), u = U([]);
388
- function f() {
389
- t(async () => {
390
- var p;
391
- u.value = await x.get(e.restaurant._id), l.value = (p = u.value.find((c) => c.active)) == null ? void 0 : p.paymentGateway;
392
- });
393
- }
394
- async function r(p) {
395
- await t(async () => {
396
- var G;
397
- const c = {
398
- _id: "",
399
- _rev: "",
400
- paymentGateway: l.value,
401
- config: p,
402
- active: !0
403
- }, b = u.value.find((g) => g.paymentGateway === l.value);
404
- b && (c._id = b._id, c._rev = b._rev), await Promise.all(
405
- u.value.map(async (g) => {
406
- g.paymentGateway || await x.delete(e.restaurant._id, g._id), g.active && g.paymentGateway !== c.paymentGateway && await x.upsert(e.restaurant._id, {
407
- ...g,
408
- active: !1
409
- });
410
- })
411
- ), await x.upsert(e.restaurant._id, c), u.value = await x.get(e.restaurant._id), l.value = (G = u.value.find((g) => g.active)) == null ? void 0 : G.paymentGateway;
412
- });
413
- }
414
- async function s(p) {
415
- t(async () => {
416
- var c;
417
- await x.delete(e.restaurant._id, p._id), u.value = await x.get(e.restaurant._id), l.value = (c = u.value.find((b) => b.active)) == null ? void 0 : c.paymentGateway;
418
- });
419
- }
420
- q(f);
421
- const I = M(() => {
422
- var p;
423
- return (p = V.find((c) => c.value === l.value)) == null ? void 0 : p.form;
424
- }), T = M(() => V.filter((p) => p.region.includes(y.currentCountry.value ?? _.F_COUNTRY.enum.MY)));
425
- return (p, c) => {
426
- const b = d("FmCircularProgress"), G = d("FmSelect");
427
- return v(), P(E, null, [
428
- a(w) ? (v(), P("div", ae, [
429
- o(b, { size: "xxl" })
430
- ])) : (v(), F(G, {
431
- key: 1,
432
- modelValue: l.value,
433
- "onUpdate:modelValue": c[0] || (c[0] = (g) => l.value = g),
434
- class: "mb-6",
435
- label: "Payment Service Provider",
436
- items: T.value
437
- }, null, 8, ["modelValue", "items"])),
438
- l.value ? (v(), F(K(I.value), O($({ key: 2 }, {
439
- gateway: u.value.find((g) => g.paymentGateway === l.value),
440
- onDelete: s,
441
- onUpdate: r
442
- })), null, 16)) : S("", !0)
443
- ], 64);
444
- };
445
- }
446
- }), ce = /* @__PURE__ */ C({
447
- __name: "RestaurantSetting",
448
- props: {
449
- restaurantId: {
450
- type: String,
451
- required: !0
452
- }
453
- },
454
- setup(n) {
455
- const V = n, { tab: e } = j({
456
- tab: "payment-gateway"
457
- }), { isLoading: y, startAsyncCall: w } = B(!0), t = L(), l = U(), u = [
458
- {
459
- label: "Payment Gateway",
460
- value: "payment-gateway",
461
- icon: "assured_workload",
462
- render: le
463
- }
464
- ];
465
- function f() {
466
- w(async () => {
467
- l.value = await H.readRestaurantById(V.restaurantId);
468
- });
469
- }
470
- q(f);
471
- const r = M(() => {
472
- var s;
473
- return (s = u.find((I) => I.value === e.value)) == null ? void 0 : s.render;
474
- });
475
- return (s, I) => {
476
- var p;
477
- const T = d("FmTabs");
478
- return v(), F(Y, {
479
- title: `Restaurant (${(p = l.value) == null ? void 0 : p._id})`,
480
- loading: a(y),
481
- onBack: a(t).back
482
- }, {
483
- default: D(() => [
484
- o(T, {
485
- "model-value": a(e),
486
- "onUpdate:modelValue": I[0] || (I[0] = (c) => A(e) ? e.value = c : null),
487
- class: "mb-6",
488
- items: u
489
- }, null, 8, ["model-value"]),
490
- a(e) && l.value ? (v(), F(K(r.value), O($({ key: 0 }, {
491
- restaurant: l.value
492
- })), null, 16)) : S("", !0)
493
- ]),
494
- _: 1
495
- }, 8, ["title", "loading", "onBack"]);
496
- };
497
- }
498
- });
499
- export {
500
- ce as default
501
- };