@feedmepos/mf-payment 1.5.9-dev → 1.5.10-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1158 @@
1
+ import { defineComponent as M, ref as R, computed as W, resolveComponent as k, openBlock as C, createElementBlock as A, createElementVNode as o, toDisplayString as I, createBlock as T, withCtx as v, createCommentVNode as D, createVNode as n, unref as e, Fragment as K, createTextVNode as O, onMounted as _, resolveDynamicComponent as ee } from "vue";
2
+ import { o as L } from "./index-BqR-1lMt.js";
3
+ import { u as Q } from "./index-CPRFae6C.js";
4
+ import { useRouter as le } from "vue-router";
5
+ import { z as u, a as d } from "./validator-DzjyJnvv.js";
6
+ import { P as te } from "./payout-account-Cuyubk9y.js";
7
+ import { _ as X } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-BOeGeY7m.js";
8
+ import { s as ae } from "./vue-signature-pad.esm-IXPjf4fL.js";
9
+ import { _ as Z } from "./Status.vue_vue_type_script_setup_true_lang-D8XZZvTw.js";
10
+ import { useSnackbar as Y } from "@feedmepos/ui-library";
11
+ import { u as z } from "./error-K1CakhA9.js";
12
+ const se = ["src"], P = /* @__PURE__ */ M({
13
+ __name: "UploadButton",
14
+ props: {
15
+ modelValue: {},
16
+ label: {},
17
+ type: {},
18
+ restaurantId: {}
19
+ },
20
+ emits: ["update:modelValue"],
21
+ setup(p, { emit: $ }) {
22
+ const w = p, N = R(w.modelValue), q = $, S = (s) => {
23
+ const i = new FileReader();
24
+ i.onload = (F) => {
25
+ var b;
26
+ N.value = (b = F.target) == null ? void 0 : b.result, q("update:modelValue", s);
27
+ }, i.readAsDataURL(s);
28
+ }, g = (s) => {
29
+ window.open(s, "_blank", "noopener,noreferrer");
30
+ }, U = W(() => w.type === "image" ? ".png, .jpg, .jpeg" : ".pdf");
31
+ return (s, i) => {
32
+ const F = k("FmButton"), b = k("FmDropField");
33
+ return C(), A("div", null, [
34
+ o("p", null, I(p.label), 1),
35
+ N.value ? (C(), T(X, {
36
+ key: 0,
37
+ document: N.value,
38
+ "restaurant-id": p.restaurantId
39
+ }, {
40
+ default: v(({ src: f }) => [
41
+ p.type === "image" ? (C(), A("img", {
42
+ key: 0,
43
+ src: f
44
+ }, null, 8, se)) : D("", !0),
45
+ p.type === "pdf" ? (C(), T(F, {
46
+ key: 1,
47
+ class: "mt-4 w-full",
48
+ "prepend-icon": "manage_accounts",
49
+ label: "View Document",
50
+ variant: "primary",
51
+ onVnodeMounted: () => g(f),
52
+ onClick: () => g(f)
53
+ }, null, 8, ["onVnodeMounted", "onClick"])) : D("", !0)
54
+ ]),
55
+ _: 1
56
+ }, 8, ["document", "restaurant-id"])) : (C(), T(b, {
57
+ key: 1,
58
+ accept: U.value,
59
+ onFileUpload: S
60
+ }, null, 8, ["accept"]))
61
+ ]);
62
+ };
63
+ }
64
+ }), oe = ["src"], ne = {
65
+ key: 0,
66
+ class: "text-center text-red-700 py-4"
67
+ }, re = { class: "flex justify-evenly py-3" }, ie = /* @__PURE__ */ M({
68
+ __name: "SignatureBoard",
69
+ props: {
70
+ modelValue: {},
71
+ label: {},
72
+ restaurantId: {}
73
+ },
74
+ emits: ["update:modelValue"],
75
+ setup(p, { emit: $ }) {
76
+ const w = p, N = $, q = R(w.modelValue), S = R(!1), g = R(), U = R(!1);
77
+ function s(F, b) {
78
+ var j;
79
+ const f = F.split(","), B = ((j = f[0].match(/:(.*?);/)) == null ? void 0 : j[1]) || "", y = atob(f[1]);
80
+ let m = y.length;
81
+ const x = new Uint8Array(m);
82
+ for (; m--; )
83
+ x[m] = y.charCodeAt(m);
84
+ return new File([x], b, { type: B });
85
+ }
86
+ const i = function() {
87
+ const { isEmpty: F, data: b } = g.value.saveSignature();
88
+ if (F)
89
+ return S.value = !0;
90
+ q.value = b, U.value = !1, N("update:modelValue", s(b, "signature.png"));
91
+ };
92
+ return (F, b) => {
93
+ const f = k("FmButton"), B = k("FmDialog");
94
+ return C(), A("div", null, [
95
+ o("p", null, I(p.label), 1),
96
+ q.value ? (C(), T(X, {
97
+ key: 0,
98
+ document: q.value,
99
+ "restaurant-id": p.restaurantId
100
+ }, {
101
+ default: v(({ src: y }) => [
102
+ o("img", {
103
+ src: y,
104
+ alt: "Signature Preview",
105
+ class: "w-full h-auto"
106
+ }, null, 8, oe)
107
+ ]),
108
+ _: 1
109
+ }, 8, ["document", "restaurant-id"])) : D("", !0),
110
+ q.value ? D("", !0) : (C(), T(B, {
111
+ key: 1,
112
+ modelValue: U.value,
113
+ "onUpdate:modelValue": b[1] || (b[1] = (y) => U.value = y)
114
+ }, {
115
+ "dialog-button": v(() => [
116
+ n(f, {
117
+ "prepend-icon": "signature",
118
+ class: "w-full",
119
+ label: "Signature"
120
+ })
121
+ ]),
122
+ "dialog-header": v(() => [...b[2] || (b[2] = [
123
+ o("div", null, "Signature Board", -1)
124
+ ])]),
125
+ default: v(() => [
126
+ n(e(ae), {
127
+ ref_key: "signaturePad",
128
+ ref: g,
129
+ height: "300px",
130
+ customStyle: { border: "2px solid #ccc", borderRadius: "3px" },
131
+ options: { penColor: "#000000" }
132
+ }, null, 512),
133
+ S.value ? (C(), A("p", ne, " Please sign your signature before saving. ")) : D("", !0),
134
+ o("div", re, [
135
+ n(f, {
136
+ variant: "destructive",
137
+ label: "Clear",
138
+ "prepend-icon": "delete",
139
+ onClick: b[0] || (b[0] = (y) => g.value.clearSignature())
140
+ }),
141
+ n(f, {
142
+ label: "Save",
143
+ "prepend-icon": "save",
144
+ onClick: i
145
+ })
146
+ ])
147
+ ]),
148
+ _: 1
149
+ }, 8, ["modelValue"]))
150
+ ]);
151
+ };
152
+ }
153
+ }), ue = { class: "space-y-2" }, de = { class: "text-gray-900" }, me = { class: "text-gray-900" }, pe = { class: "text-gray-900" }, be = { class: "text-gray-900" }, ge = { class: "text-gray-900" }, ce = { class: "text-gray-900" }, Ve = { class: "mt-6 grid grid-cols-4 gap-24" }, ye = { class: "w-full flex justify-end mt-6" }, ve = { class: "mt-6 grid grid-cols-4 gap-24" }, fe = { class: "col-span-2" }, ke = { class: "col-span-2" }, Ce = { class: "col-span-2" }, Ne = { class: "col-span-2" }, qe = { class: "col-span-2" }, Se = { class: "col-span-2" }, Pe = { class: "col-start-1 col-span-2" }, we = { class: "col-span-2" }, Fe = { class: "col-span-2" }, Ie = { class: "col-span-2" }, Ue = { class: "mt-6 grid grid-cols-4 gap-24" }, xe = { class: "mt-6 grid grid-cols-2 gap-24" }, Re = /* @__PURE__ */ M({
154
+ __name: "SoftspaceSubmission",
155
+ props: {
156
+ submission: {
157
+ type: Object,
158
+ required: !0
159
+ }
160
+ },
161
+ emits: ["update:submission"],
162
+ setup(p, { emit: $ }) {
163
+ const w = p, N = $, q = Y(), S = R(!1), { isLoading: g, startAsyncCall: U } = Q(), { fields: s, documents: i, restaurantId: F, profile: b, status: f, statusReason: B } = w.submission, y = R(""), m = R(
164
+ w.submission.rates ? Object.fromEntries(
165
+ Object.entries(w.submission.rates).map(([t, l]) => [t, `${l}`])
166
+ ) : {
167
+ duitNow: "0.8",
168
+ mydebitCard: "0.5",
169
+ localDebit: "0.5",
170
+ localCredit: "1.1",
171
+ foreignCard: "3.2",
172
+ jcbStandard: "2.2",
173
+ jcbPlatinum: "2.2"
174
+ }
175
+ ), x = W(
176
+ () => Object.values(m.value).every((t) => parseFloat(t) > 0)
177
+ ), j = () => U(async () => {
178
+ try {
179
+ const t = await L.reviewById(
180
+ w.submission._id,
181
+ {
182
+ rates: {
183
+ duitNow: parseFloat(m.value.duitNow),
184
+ mydebitCard: parseFloat(m.value.mydebitCard),
185
+ localDebit: parseFloat(m.value.localDebit),
186
+ localCredit: parseFloat(m.value.localCredit),
187
+ foreignCard: parseFloat(m.value.foreignCard),
188
+ jcbStandard: parseFloat(m.value.jcbStandard),
189
+ jcbPlatinum: parseFloat(m.value.jcbPlatinum)
190
+ },
191
+ status: "approved"
192
+ }
193
+ );
194
+ N("update:submission", t), S.value = !1, q.open({
195
+ type: "success",
196
+ title: "Submission updated successfully"
197
+ });
198
+ } catch (t) {
199
+ q.open({
200
+ type: "error",
201
+ title: "Error occurs when updating submission",
202
+ message: z(t)
203
+ });
204
+ }
205
+ }), E = () => U(async () => {
206
+ try {
207
+ const t = await L.reviewById(
208
+ w.submission._id,
209
+ {
210
+ status: "rejected",
211
+ statusReason: y.value
212
+ }
213
+ );
214
+ N("update:submission", t), S.value = !1, q.open({
215
+ type: "success",
216
+ title: "Submission updated successfully"
217
+ });
218
+ } catch (t) {
219
+ q.open({
220
+ type: "error",
221
+ title: "Error occurs when updating submission",
222
+ message: z(t)
223
+ });
224
+ }
225
+ });
226
+ return (t, l) => {
227
+ const c = k("FmTextField"), H = k("FmButton"), V = k("FmTextarea"), J = k("FmDialog"), G = k("FmPhoneNumber"), r = k("FmSelect"), h = k("FmForm");
228
+ return C(), A(K, null, [
229
+ o("div", ue, [
230
+ o("div", null, [
231
+ l[33] || (l[33] = o("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
232
+ o("span", de, I(e(F)), 1)
233
+ ]),
234
+ o("div", null, [
235
+ l[34] || (l[34] = o("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
236
+ o("span", me, I(e(b).name) + " ( " + I(e(b).legalName) + " )", 1)
237
+ ]),
238
+ o("div", null, [
239
+ l[35] || (l[35] = o("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
240
+ o("span", pe, I(e(b).email), 1)
241
+ ]),
242
+ o("div", null, [
243
+ l[36] || (l[36] = o("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
244
+ o("span", be, I(e(b).phoneNo), 1)
245
+ ]),
246
+ o("div", null, [
247
+ l[37] || (l[37] = o("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
248
+ o("span", ge, [
249
+ n(Z, { data: e(f) }, null, 8, ["data"])
250
+ ])
251
+ ]),
252
+ o("div", null, [
253
+ l[38] || (l[38] = o("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
254
+ o("span", ce, I(e(B)), 1)
255
+ ])
256
+ ]),
257
+ l[50] || (l[50] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
258
+ o("div", Ve, [
259
+ n(c, {
260
+ modelValue: m.value.duitNow,
261
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => m.value.duitNow = a),
262
+ label: "DuitNow QR",
263
+ "label-mark": "required",
264
+ type: "number",
265
+ inputmode: "numeric",
266
+ decimal: 2,
267
+ rules: e(u)(
268
+ e(d).string().min(1, "Rate is required").transform((a) => parseFloat(a)).refine((a) => !isNaN(a), { message: "Rate must be a number" })
269
+ )
270
+ }, {
271
+ append: v(() => [...l[39] || (l[39] = [
272
+ O("%", -1)
273
+ ])]),
274
+ _: 1
275
+ }, 8, ["modelValue", "rules"]),
276
+ n(c, {
277
+ modelValue: m.value.mydebitCard,
278
+ "onUpdate:modelValue": l[1] || (l[1] = (a) => m.value.mydebitCard = a),
279
+ label: "myDebit Card",
280
+ "label-mark": "required",
281
+ type: "number",
282
+ inputmode: "numeric",
283
+ decimal: 2,
284
+ rules: e(u)(
285
+ e(d).string().min(1, "Rate is required").transform((a) => parseFloat(a)).refine((a) => !isNaN(a), { message: "Rate must be a number" })
286
+ )
287
+ }, {
288
+ append: v(() => [...l[40] || (l[40] = [
289
+ O("%", -1)
290
+ ])]),
291
+ _: 1
292
+ }, 8, ["modelValue", "rules"]),
293
+ n(c, {
294
+ modelValue: m.value.localDebit,
295
+ "onUpdate:modelValue": l[2] || (l[2] = (a) => m.value.localDebit = a),
296
+ label: "Local Debit Card",
297
+ "label-mark": "required",
298
+ type: "number",
299
+ inputmode: "numeric",
300
+ decimal: 2,
301
+ rules: e(u)(
302
+ e(d).string().min(1, "Rate is required").transform((a) => parseFloat(a)).refine((a) => !isNaN(a), { message: "Rate must be a number" })
303
+ )
304
+ }, {
305
+ append: v(() => [...l[41] || (l[41] = [
306
+ O("%", -1)
307
+ ])]),
308
+ _: 1
309
+ }, 8, ["modelValue", "rules"]),
310
+ n(c, {
311
+ modelValue: m.value.localCredit,
312
+ "onUpdate:modelValue": l[3] || (l[3] = (a) => m.value.localCredit = a),
313
+ label: "Local Credit Card",
314
+ "label-mark": "required",
315
+ type: "number",
316
+ inputmode: "numeric",
317
+ decimal: 2,
318
+ rules: e(u)(
319
+ e(d).string().min(1, "Rate is required").transform((a) => parseFloat(a)).refine((a) => !isNaN(a), { message: "Rate must be a number" })
320
+ )
321
+ }, {
322
+ append: v(() => [...l[42] || (l[42] = [
323
+ O("%", -1)
324
+ ])]),
325
+ _: 1
326
+ }, 8, ["modelValue", "rules"]),
327
+ n(c, {
328
+ modelValue: m.value.foreignCard,
329
+ "onUpdate:modelValue": l[4] || (l[4] = (a) => m.value.foreignCard = a),
330
+ label: "Foreign Card",
331
+ "label-mark": "required",
332
+ type: "number",
333
+ inputmode: "numeric",
334
+ decimal: 2,
335
+ rules: e(u)(
336
+ e(d).string().min(1, "Rate is required").transform((a) => parseFloat(a)).refine((a) => !isNaN(a), { message: "Rate must be a number" })
337
+ )
338
+ }, {
339
+ append: v(() => [...l[43] || (l[43] = [
340
+ O("%", -1)
341
+ ])]),
342
+ _: 1
343
+ }, 8, ["modelValue", "rules"]),
344
+ n(c, {
345
+ modelValue: m.value.jcbStandard,
346
+ "onUpdate:modelValue": l[5] || (l[5] = (a) => m.value.jcbStandard = a),
347
+ label: "JCB Standard",
348
+ "label-mark": "required",
349
+ type: "number",
350
+ inputmode: "numeric",
351
+ decimal: 2,
352
+ rules: e(u)(
353
+ e(d).string().min(1, "Rate is required").transform((a) => parseFloat(a)).refine((a) => !isNaN(a), { message: "Rate must be a number" })
354
+ )
355
+ }, {
356
+ append: v(() => [...l[44] || (l[44] = [
357
+ O("%", -1)
358
+ ])]),
359
+ _: 1
360
+ }, 8, ["modelValue", "rules"]),
361
+ n(c, {
362
+ modelValue: m.value.jcbPlatinum,
363
+ "onUpdate:modelValue": l[6] || (l[6] = (a) => m.value.jcbPlatinum = a),
364
+ label: "JCB Platinum",
365
+ "label-mark": "required",
366
+ type: "number",
367
+ inputmode: "numeric",
368
+ decimal: 2,
369
+ rules: e(u)(
370
+ e(d).string().min(1, "Rate is required").transform((a) => parseFloat(a)).refine((a) => !isNaN(a), { message: "Rate must be a number" })
371
+ )
372
+ }, {
373
+ append: v(() => [...l[45] || (l[45] = [
374
+ O("%", -1)
375
+ ])]),
376
+ _: 1
377
+ }, 8, ["modelValue", "rules"])
378
+ ]),
379
+ o("div", ye, [
380
+ n(J, {
381
+ modelValue: S.value,
382
+ "onUpdate:modelValue": l[8] || (l[8] = (a) => S.value = a)
383
+ }, {
384
+ "dialog-button": v(() => [
385
+ n(H, {
386
+ class: "mr-6",
387
+ type: "button",
388
+ variant: "destructive",
389
+ "prepend-icon": "block",
390
+ loading: e(g),
391
+ label: "Reject Submission"
392
+ }, null, 8, ["loading"])
393
+ ]),
394
+ "dialog-header": v(() => [...l[46] || (l[46] = [
395
+ o("div", null, "Rejecting Submission", -1)
396
+ ])]),
397
+ default: v(() => [
398
+ n(V, {
399
+ modelValue: y.value,
400
+ "onUpdate:modelValue": l[7] || (l[7] = (a) => y.value = a),
401
+ label: "Reason for Rejection",
402
+ "label-mark": "optional",
403
+ "helper-text": "Please provide a reason for rejection."
404
+ }, null, 8, ["modelValue"]),
405
+ n(H, {
406
+ class: "mb-2 mt-6 w-full",
407
+ label: "Submit",
408
+ "prepend-icon": "save",
409
+ onClick: E,
410
+ loading: e(g)
411
+ }, null, 8, ["loading"])
412
+ ]),
413
+ _: 1
414
+ }, 8, ["modelValue"]),
415
+ n(H, {
416
+ type: "button",
417
+ variant: "primary",
418
+ "prepend-icon": "approval",
419
+ disabled: !x.value,
420
+ label: "Approve Submission with Rates",
421
+ onClick: j,
422
+ loading: e(g)
423
+ }, null, 8, ["disabled", "loading"])
424
+ ]),
425
+ n(h, { disabled: !0 }, {
426
+ default: v(() => [
427
+ l[47] || (l[47] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
428
+ o("div", ve, [
429
+ o("div", fe, [
430
+ n(c, {
431
+ modelValue: e(s).picName,
432
+ "onUpdate:modelValue": l[9] || (l[9] = (a) => e(s).picName = a),
433
+ label: "PIC Name",
434
+ placeholder: "Enter your name",
435
+ "label-mark": "required",
436
+ rules: e(u)(e(d).string().min(1, "PIC Name is required"))
437
+ }, null, 8, ["modelValue", "rules"])
438
+ ]),
439
+ o("div", ke, [
440
+ n(c, {
441
+ modelValue: e(s).picRole,
442
+ "onUpdate:modelValue": l[10] || (l[10] = (a) => e(s).picRole = a),
443
+ label: "PIC Role",
444
+ placeholder: "Enter your role",
445
+ "label-mark": "required",
446
+ rules: e(u)(e(d).string().min(1, "PIC Role is required"))
447
+ }, null, 8, ["modelValue", "rules"])
448
+ ]),
449
+ o("div", Ce, [
450
+ n(c, {
451
+ modelValue: e(s).picEmail,
452
+ "onUpdate:modelValue": l[11] || (l[11] = (a) => e(s).picEmail = a),
453
+ label: "PIC Email",
454
+ type: "email",
455
+ placeholder: "Enter your email address",
456
+ "label-mark": "required",
457
+ rules: e(u)(e(d).string().min(1, "PIC Email is required"))
458
+ }, null, 8, ["modelValue", "rules"])
459
+ ]),
460
+ o("div", Ne, [
461
+ n(G, {
462
+ "model-value": e(s).picContact,
463
+ "onUpdate:modelValue": l[12] || (l[12] = (a) => e(s).picContact = a),
464
+ "default-country": "MY",
465
+ label: "PIC Contact",
466
+ "label-mark": "required",
467
+ rules: e(u)(e(d).string().min(1, "PIC Contact is required"))
468
+ }, null, 8, ["model-value", "rules"])
469
+ ]),
470
+ o("div", qe, [
471
+ n(c, {
472
+ modelValue: e(s).outletName,
473
+ "onUpdate:modelValue": l[13] || (l[13] = (a) => e(s).outletName = a),
474
+ label: "Outlet Name",
475
+ placeholder: "Enter outlet name",
476
+ "label-mark": "required",
477
+ rules: e(u)(e(d).string().min(1, "Outlet Name is required"))
478
+ }, null, 8, ["modelValue", "rules"])
479
+ ]),
480
+ o("div", Se, [
481
+ n(c, {
482
+ modelValue: e(s).outletAddress,
483
+ "onUpdate:modelValue": l[14] || (l[14] = (a) => e(s).outletAddress = a),
484
+ label: "Outlet Address",
485
+ placeholder: "Enter outlet address",
486
+ "label-mark": "required",
487
+ rules: e(u)(e(d).string().min(1, "Address is required"))
488
+ }, null, 8, ["modelValue", "rules"])
489
+ ]),
490
+ n(c, {
491
+ modelValue: e(s).outletPostCode,
492
+ "onUpdate:modelValue": l[15] || (l[15] = (a) => e(s).outletPostCode = a),
493
+ label: "Postal Code",
494
+ placeholder: "Enter postal code",
495
+ "label-mark": "required",
496
+ rules: e(u)(e(d).string().min(1, "Postal Code is required"))
497
+ }, null, 8, ["modelValue", "rules"]),
498
+ n(c, {
499
+ modelValue: e(s).outletState,
500
+ "onUpdate:modelValue": l[16] || (l[16] = (a) => e(s).outletState = a),
501
+ label: "State",
502
+ placeholder: "Enter state",
503
+ "label-mark": "required",
504
+ rules: e(u)(e(d).string().min(1, "State is required"))
505
+ }, null, 8, ["modelValue", "rules"]),
506
+ n(c, {
507
+ modelValue: e(s).outletCity,
508
+ "onUpdate:modelValue": l[17] || (l[17] = (a) => e(s).outletCity = a),
509
+ label: "City",
510
+ placeholder: "Enter city",
511
+ "label-mark": "required",
512
+ rules: e(u)(e(d).string().min(1, "City is required"))
513
+ }, null, 8, ["modelValue", "rules"]),
514
+ o("div", Pe, [
515
+ n(r, {
516
+ modelValue: e(s).businessType,
517
+ "onUpdate:modelValue": l[18] || (l[18] = (a) => e(s).businessType = a),
518
+ label: "Type",
519
+ placeholder: "Select business type",
520
+ "label-mark": "required",
521
+ rules: e(u)(e(d).string().min(1, "Business Type is required")),
522
+ items: [
523
+ { label: "Sole Proprietorship", value: "sole_proprietorship" },
524
+ { label: "Partnership", value: "partnership" },
525
+ {
526
+ label: "Private Limited Company (Sdn Bhd)",
527
+ value: "private_limited"
528
+ },
529
+ {
530
+ label: "Public Limited Company (Berhad)",
531
+ value: "public_limited"
532
+ }
533
+ ]
534
+ }, null, 8, ["modelValue", "rules"])
535
+ ]),
536
+ o("div", we, [
537
+ n(c, {
538
+ modelValue: e(s).businessRegNo,
539
+ "onUpdate:modelValue": l[19] || (l[19] = (a) => e(s).businessRegNo = a),
540
+ label: "Registration No",
541
+ placeholder: "Enter registration number",
542
+ "label-mark": "required",
543
+ rules: e(u)(e(d).string().min(1, "Reg No is required"))
544
+ }, null, 8, ["modelValue", "rules"])
545
+ ]),
546
+ o("div", Fe, [
547
+ n(c, {
548
+ modelValue: e(s).tinNo,
549
+ "onUpdate:modelValue": l[20] || (l[20] = (a) => e(s).tinNo = a),
550
+ label: "Tax Identification No (TIN)",
551
+ placeholder: "Enter your TIN number",
552
+ "label-mark": "required",
553
+ rules: e(u)(e(d).string().min(1, "TIN is required"))
554
+ }, null, 8, ["modelValue", "rules"])
555
+ ]),
556
+ o("div", Ie, [
557
+ n(c, {
558
+ modelValue: e(s).sstNo,
559
+ "onUpdate:modelValue": l[21] || (l[21] = (a) => e(s).sstNo = a),
560
+ label: "SST Registration No (SST)",
561
+ placeholder: "Enter your SST number",
562
+ "label-mark": "optional"
563
+ }, null, 8, ["modelValue"])
564
+ ])
565
+ ]),
566
+ l[48] || (l[48] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information & Documents ", -1)),
567
+ o("div", Ue, [
568
+ n(r, {
569
+ modelValue: e(s).bankName,
570
+ "onUpdate:modelValue": l[22] || (l[22] = (a) => e(s).bankName = a),
571
+ label: "Bank",
572
+ placeholder: "Select bank type",
573
+ "label-mark": "required",
574
+ rules: e(u)(e(d).string().min(1, "Bank Type is required")),
575
+ items: e(te).bankNameOptions()
576
+ }, null, 8, ["modelValue", "rules", "items"]),
577
+ n(c, {
578
+ modelValue: e(s).bankHolderName,
579
+ "onUpdate:modelValue": l[23] || (l[23] = (a) => e(s).bankHolderName = a),
580
+ label: "Beneficiary Name",
581
+ placeholder: "Enter Beneficiary Name",
582
+ "label-mark": "required",
583
+ rules: e(u)(e(d).string().min(1, "Beneficiary Name is required"))
584
+ }, null, 8, ["modelValue", "rules"]),
585
+ n(c, {
586
+ modelValue: e(s).bankAccountNo,
587
+ "onUpdate:modelValue": l[24] || (l[24] = (a) => e(s).bankAccountNo = a),
588
+ label: "Account Number",
589
+ placeholder: "Enter Account Number",
590
+ "label-mark": "required",
591
+ rules: e(u)(e(d).string().min(1, "Account Number is required"))
592
+ }, null, 8, ["modelValue", "rules"]),
593
+ n(P, {
594
+ label: "Authorized Person ID",
595
+ modelValue: e(i).authorizedPersonID,
596
+ "onUpdate:modelValue": l[25] || (l[25] = (a) => e(i).authorizedPersonID = a),
597
+ type: "image",
598
+ "restaurant-id": p.submission.restaurantId
599
+ }, null, 8, ["modelValue", "restaurant-id"]),
600
+ n(P, {
601
+ label: "Outlet Photo",
602
+ modelValue: e(i).outletPhoto,
603
+ "onUpdate:modelValue": l[26] || (l[26] = (a) => e(i).outletPhoto = a),
604
+ type: "image",
605
+ "restaurant-id": p.submission.restaurantId
606
+ }, null, 8, ["modelValue", "restaurant-id"]),
607
+ n(P, {
608
+ label: "Interior Photo",
609
+ modelValue: e(i).interiorPhoto,
610
+ "onUpdate:modelValue": l[27] || (l[27] = (a) => e(i).interiorPhoto = a),
611
+ type: "image",
612
+ "restaurant-id": p.submission.restaurantId
613
+ }, null, 8, ["modelValue", "restaurant-id"]),
614
+ n(P, {
615
+ label: "Latest Bank Statement",
616
+ modelValue: e(i).bankStatement,
617
+ "onUpdate:modelValue": l[28] || (l[28] = (a) => e(i).bankStatement = a),
618
+ type: "pdf",
619
+ "restaurant-id": p.submission.restaurantId
620
+ }, null, 8, ["modelValue", "restaurant-id"]),
621
+ e(s).businessType === "private_limited" || e(s).businessType === "public_limited" ? (C(), T(P, {
622
+ key: 0,
623
+ label: "Superform",
624
+ type: "pdf",
625
+ modelValue: e(i).certificate,
626
+ "onUpdate:modelValue": l[29] || (l[29] = (a) => e(i).certificate = a),
627
+ "restaurant-id": p.submission.restaurantId
628
+ }, null, 8, ["modelValue", "restaurant-id"])) : D("", !0),
629
+ e(s).businessType === "sole_proprietorship" || e(s).businessType === "partnership" ? (C(), T(P, {
630
+ key: 1,
631
+ label: "SSM Certificate & Info",
632
+ type: "pdf",
633
+ modelValue: e(i).certificate,
634
+ "onUpdate:modelValue": l[30] || (l[30] = (a) => e(i).certificate = a),
635
+ "restaurant-id": p.submission.restaurantId
636
+ }, null, 8, ["modelValue", "restaurant-id"])) : D("", !0)
637
+ ]),
638
+ l[49] || (l[49] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
639
+ o("div", xe, [
640
+ n(ie, {
641
+ modelValue: e(i).signature,
642
+ "onUpdate:modelValue": l[31] || (l[31] = (a) => e(i).signature = a),
643
+ "restaurant-id": p.submission.restaurantId,
644
+ label: "Signature"
645
+ }, null, 8, ["modelValue", "restaurant-id"]),
646
+ n(P, {
647
+ label: "Company Stamp",
648
+ type: "image",
649
+ modelValue: e(i).companyStamp,
650
+ "onUpdate:modelValue": l[32] || (l[32] = (a) => e(i).companyStamp = a),
651
+ "restaurant-id": p.submission.restaurantId
652
+ }, null, 8, ["modelValue", "restaurant-id"])
653
+ ])
654
+ ]),
655
+ _: 1
656
+ })
657
+ ], 64);
658
+ };
659
+ }
660
+ }), Be = { class: "space-y-2" }, Te = { class: "text-gray-900" }, Ee = { class: "text-gray-900" }, De = { class: "text-gray-900" }, $e = { class: "text-gray-900" }, je = { class: "text-gray-900" }, Ae = { class: "text-gray-900" }, Oe = { class: "w-full flex justify-end mt-6" }, Le = { class: "mt-6 grid grid-cols-4 gap-24" }, ze = { class: "col-span-2" }, He = { class: "col-span-2" }, Me = { class: "col-span-2" }, We = { class: "col-span-2" }, Je = { class: "mt-6 grid grid-cols-4 gap-24" }, Ge = { class: "mt-6 grid grid-cols-4 gap-24" }, Ke = { class: "mt-6 grid grid-cols-4 gap-24" }, Qe = { class: "col-span-2" }, Ye = { class: "col-span-2" }, Xe = { class: "col-span-2" }, Ze = { class: "col-span-2" }, he = { class: "col-span-2" }, _e = { class: "col-span-2" }, el = /* @__PURE__ */ M({
661
+ __name: "NTTSubmission",
662
+ props: {
663
+ submission: {
664
+ type: Object,
665
+ required: !0
666
+ }
667
+ },
668
+ emits: ["update:submission"],
669
+ setup(p, { emit: $ }) {
670
+ const w = p, N = $, q = Y(), S = R(!1), { isLoading: g, startAsyncCall: U } = Q(), { fields: s, documents: i, restaurantId: F, profile: b, status: f, statusReason: B } = w.submission, y = R(""), m = W(() => s.businessType === "juristic" ? "Juristic" : s.businessType === "individual" ? "Individual" : s.businessType || "-"), x = () => U(async () => {
671
+ try {
672
+ const E = await L.reviewById(
673
+ w.submission._id,
674
+ {
675
+ status: "approved"
676
+ }
677
+ );
678
+ N("update:submission", E), S.value = !1, q.open({
679
+ type: "success",
680
+ title: "Submission updated successfully"
681
+ });
682
+ } catch (E) {
683
+ q.open({
684
+ type: "error",
685
+ title: "Error occurs when updating submission",
686
+ message: z(E)
687
+ });
688
+ }
689
+ }), j = () => U(async () => {
690
+ try {
691
+ const E = await L.reviewById(
692
+ w.submission._id,
693
+ {
694
+ status: "rejected",
695
+ statusReason: y.value
696
+ }
697
+ );
698
+ N("update:submission", E), S.value = !1, q.open({
699
+ type: "success",
700
+ title: "Submission updated successfully"
701
+ });
702
+ } catch (E) {
703
+ q.open({
704
+ type: "error",
705
+ title: "Error occurs when updating submission",
706
+ message: z(E)
707
+ });
708
+ }
709
+ });
710
+ return (E, t) => {
711
+ const l = k("FmButton"), c = k("FmTextarea"), H = k("FmDialog"), V = k("FmTextField"), J = k("FmPhoneNumber"), G = k("FmForm");
712
+ return C(), A(K, null, [
713
+ o("div", Be, [
714
+ o("div", null, [
715
+ t[31] || (t[31] = o("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
716
+ o("span", Te, I(e(F)), 1)
717
+ ]),
718
+ o("div", null, [
719
+ t[32] || (t[32] = o("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
720
+ o("span", Ee, I(e(b).name) + " ( " + I(e(b).legalName) + " )", 1)
721
+ ]),
722
+ o("div", null, [
723
+ t[33] || (t[33] = o("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
724
+ o("span", De, I(e(b).email), 1)
725
+ ]),
726
+ o("div", null, [
727
+ t[34] || (t[34] = o("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
728
+ o("span", $e, I(e(b).phoneNo), 1)
729
+ ]),
730
+ o("div", null, [
731
+ t[35] || (t[35] = o("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
732
+ o("span", je, [
733
+ n(Z, { data: e(f) }, null, 8, ["data"])
734
+ ])
735
+ ]),
736
+ o("div", null, [
737
+ t[36] || (t[36] = o("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
738
+ o("span", Ae, I(e(B)), 1)
739
+ ])
740
+ ]),
741
+ o("div", Oe, [
742
+ n(H, {
743
+ modelValue: S.value,
744
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => S.value = r)
745
+ }, {
746
+ "dialog-button": v(() => [
747
+ n(l, {
748
+ class: "mr-6",
749
+ type: "button",
750
+ variant: "destructive",
751
+ "prepend-icon": "block",
752
+ loading: e(g),
753
+ label: "Reject Submission"
754
+ }, null, 8, ["loading"])
755
+ ]),
756
+ "dialog-header": v(() => [...t[37] || (t[37] = [
757
+ o("div", null, "Rejecting Submission", -1)
758
+ ])]),
759
+ default: v(() => [
760
+ n(c, {
761
+ modelValue: y.value,
762
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => y.value = r),
763
+ label: "Reason for Rejection",
764
+ "label-mark": "optional",
765
+ "helper-text": "Please provide a reason for rejection."
766
+ }, null, 8, ["modelValue"]),
767
+ n(l, {
768
+ class: "mb-2 mt-6 w-full",
769
+ label: "Submit",
770
+ "prepend-icon": "save",
771
+ onClick: j,
772
+ loading: e(g)
773
+ }, null, 8, ["loading"])
774
+ ]),
775
+ _: 1
776
+ }, 8, ["modelValue"]),
777
+ n(l, {
778
+ type: "button",
779
+ variant: "primary",
780
+ "prepend-icon": "approval",
781
+ label: "Approve Submission",
782
+ onClick: x,
783
+ loading: e(g)
784
+ }, null, 8, ["loading"])
785
+ ]),
786
+ n(G, { disabled: !0 }, {
787
+ default: v(() => [
788
+ t[38] || (t[38] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
789
+ o("div", Le, [
790
+ o("div", ze, [
791
+ n(V, {
792
+ modelValue: e(s).companyName,
793
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => e(s).companyName = r),
794
+ label: "Company Name",
795
+ "label-mark": "required",
796
+ rules: e(u)(e(d).string().min(1, "Company Name is required"))
797
+ }, null, 8, ["modelValue", "rules"])
798
+ ]),
799
+ o("div", He, [
800
+ n(V, {
801
+ modelValue: e(s).outletName,
802
+ "onUpdate:modelValue": t[3] || (t[3] = (r) => e(s).outletName = r),
803
+ label: "Outlet Name (Thai)",
804
+ "label-mark": "required",
805
+ rules: e(u)(e(d).string().min(1, "Outlet Name is required"))
806
+ }, null, 8, ["modelValue", "rules"])
807
+ ]),
808
+ o("div", Me, [
809
+ n(V, {
810
+ modelValue: e(s).outletNameEnglish,
811
+ "onUpdate:modelValue": t[4] || (t[4] = (r) => e(s).outletNameEnglish = r),
812
+ label: "Outlet Name (English)",
813
+ "label-mark": "required",
814
+ rules: e(u)(e(d).string().min(1, "Outlet Name English is required"))
815
+ }, null, 8, ["modelValue", "rules"])
816
+ ]),
817
+ o("div", We, [
818
+ n(V, {
819
+ modelValue: e(s).outletAddress,
820
+ "onUpdate:modelValue": t[5] || (t[5] = (r) => e(s).outletAddress = r),
821
+ label: "Outlet Address",
822
+ "label-mark": "required",
823
+ rules: e(u)(e(d).string().min(1, "Outlet Address is required"))
824
+ }, null, 8, ["modelValue", "rules"])
825
+ ]),
826
+ n(V, {
827
+ modelValue: e(s).outletPostCode,
828
+ "onUpdate:modelValue": t[6] || (t[6] = (r) => e(s).outletPostCode = r),
829
+ label: "Post Code",
830
+ "label-mark": "required",
831
+ rules: e(u)(e(d).string().min(1, "Post Code is required"))
832
+ }, null, 8, ["modelValue", "rules"]),
833
+ n(V, {
834
+ modelValue: e(s).outletState,
835
+ "onUpdate:modelValue": t[7] || (t[7] = (r) => e(s).outletState = r),
836
+ label: "State",
837
+ "label-mark": "required",
838
+ rules: e(u)(e(d).string().min(1, "State is required"))
839
+ }, null, 8, ["modelValue", "rules"]),
840
+ n(V, {
841
+ modelValue: e(s).outletCity,
842
+ "onUpdate:modelValue": t[8] || (t[8] = (r) => e(s).outletCity = r),
843
+ label: "City",
844
+ "label-mark": "required",
845
+ rules: e(u)(e(d).string().min(1, "City is required"))
846
+ }, null, 8, ["modelValue", "rules"]),
847
+ n(V, {
848
+ "model-value": m.value,
849
+ label: "Business Type",
850
+ "label-mark": "required"
851
+ }, null, 8, ["model-value"]),
852
+ n(V, {
853
+ modelValue: e(s).numberOfDevices,
854
+ "onUpdate:modelValue": t[9] || (t[9] = (r) => e(s).numberOfDevices = r),
855
+ label: "Number of Devices",
856
+ "label-mark": "required"
857
+ }, null, 8, ["modelValue"])
858
+ ]),
859
+ t[39] || (t[39] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
860
+ o("div", Je, [
861
+ n(V, {
862
+ modelValue: e(s).bankName,
863
+ "onUpdate:modelValue": t[10] || (t[10] = (r) => e(s).bankName = r),
864
+ label: "Bank Name",
865
+ "label-mark": "required",
866
+ rules: e(u)(e(d).string().min(1, "Bank Name is required"))
867
+ }, null, 8, ["modelValue", "rules"]),
868
+ n(V, {
869
+ modelValue: e(s).bankHolderName,
870
+ "onUpdate:modelValue": t[11] || (t[11] = (r) => e(s).bankHolderName = r),
871
+ label: "Bank Holder Name",
872
+ "label-mark": "required",
873
+ rules: e(u)(e(d).string().min(1, "Bank Holder Name is required"))
874
+ }, null, 8, ["modelValue", "rules"]),
875
+ n(V, {
876
+ modelValue: e(s).bankAccountNo,
877
+ "onUpdate:modelValue": t[12] || (t[12] = (r) => e(s).bankAccountNo = r),
878
+ label: "Bank Account No",
879
+ "label-mark": "required",
880
+ rules: e(u)(e(d).string().min(1, "Bank Account No is required"))
881
+ }, null, 8, ["modelValue", "rules"]),
882
+ n(V, {
883
+ modelValue: e(s).bankBranch,
884
+ "onUpdate:modelValue": t[13] || (t[13] = (r) => e(s).bankBranch = r),
885
+ label: "Bank Branch",
886
+ "label-mark": "required",
887
+ rules: e(u)(e(d).string().min(1, "Bank Branch is required"))
888
+ }, null, 8, ["modelValue", "rules"]),
889
+ n(V, {
890
+ modelValue: e(s).bankBranchCode,
891
+ "onUpdate:modelValue": t[14] || (t[14] = (r) => e(s).bankBranchCode = r),
892
+ label: "Bank Branch Code",
893
+ "label-mark": "required",
894
+ rules: e(u)(e(d).string().min(1, "Bank Branch Code is required"))
895
+ }, null, 8, ["modelValue", "rules"])
896
+ ]),
897
+ t[40] || (t[40] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
898
+ o("div", Ge, [
899
+ n(P, {
900
+ label: "Authorized Person ID",
901
+ modelValue: e(i).authorizedPersonID,
902
+ "onUpdate:modelValue": t[15] || (t[15] = (r) => e(i).authorizedPersonID = r),
903
+ type: "image",
904
+ "restaurant-id": p.submission.restaurantId
905
+ }, null, 8, ["modelValue", "restaurant-id"]),
906
+ n(P, {
907
+ label: "Outlet Photo",
908
+ modelValue: e(i).outletPhoto,
909
+ "onUpdate:modelValue": t[16] || (t[16] = (r) => e(i).outletPhoto = r),
910
+ type: "image",
911
+ "restaurant-id": p.submission.restaurantId
912
+ }, null, 8, ["modelValue", "restaurant-id"]),
913
+ n(P, {
914
+ label: "Interior Photo",
915
+ modelValue: e(i).interiorPhoto,
916
+ "onUpdate:modelValue": t[17] || (t[17] = (r) => e(i).interiorPhoto = r),
917
+ type: "image",
918
+ "restaurant-id": p.submission.restaurantId
919
+ }, null, 8, ["modelValue", "restaurant-id"]),
920
+ n(P, {
921
+ label: "Bank Statement",
922
+ modelValue: e(i).bankStatement,
923
+ "onUpdate:modelValue": t[18] || (t[18] = (r) => e(i).bankStatement = r),
924
+ type: "pdf",
925
+ "restaurant-id": p.submission.restaurantId
926
+ }, null, 8, ["modelValue", "restaurant-id"]),
927
+ e(s).businessType === "juristic" ? (C(), T(P, {
928
+ key: 0,
929
+ label: "Company Certificate",
930
+ type: "pdf",
931
+ modelValue: e(i).companyCertificate,
932
+ "onUpdate:modelValue": t[19] || (t[19] = (r) => e(i).companyCertificate = r),
933
+ "restaurant-id": p.submission.restaurantId
934
+ }, null, 8, ["modelValue", "restaurant-id"])) : D("", !0),
935
+ e(s).businessType === "juristic" ? (C(), T(P, {
936
+ key: 1,
937
+ label: "VAT Certificate",
938
+ type: "pdf",
939
+ modelValue: e(i).vatCertificate,
940
+ "onUpdate:modelValue": t[20] || (t[20] = (r) => e(i).vatCertificate = r),
941
+ "restaurant-id": p.submission.restaurantId
942
+ }, null, 8, ["modelValue", "restaurant-id"])) : D("", !0),
943
+ e(s).businessType === "individual" ? (C(), T(P, {
944
+ key: 2,
945
+ label: "Commercial Certificate",
946
+ type: "pdf",
947
+ modelValue: e(i).commercialCertificate,
948
+ "onUpdate:modelValue": t[21] || (t[21] = (r) => e(i).commercialCertificate = r),
949
+ "restaurant-id": p.submission.restaurantId
950
+ }, null, 8, ["modelValue", "restaurant-id"])) : D("", !0)
951
+ ]),
952
+ t[41] || (t[41] = o("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
953
+ o("div", Ke, [
954
+ o("div", Qe, [
955
+ n(V, {
956
+ modelValue: e(s).picName,
957
+ "onUpdate:modelValue": t[22] || (t[22] = (r) => e(s).picName = r),
958
+ label: "PIC Name",
959
+ "label-mark": "required",
960
+ rules: e(u)(e(d).string().min(1, "PIC Name is required"))
961
+ }, null, 8, ["modelValue", "rules"])
962
+ ]),
963
+ o("div", Ye, [
964
+ n(V, {
965
+ modelValue: e(s).picRole,
966
+ "onUpdate:modelValue": t[23] || (t[23] = (r) => e(s).picRole = r),
967
+ label: "PIC Role",
968
+ "label-mark": "required",
969
+ rules: e(u)(e(d).string().min(1, "PIC Role is required"))
970
+ }, null, 8, ["modelValue", "rules"])
971
+ ]),
972
+ o("div", Xe, [
973
+ n(V, {
974
+ modelValue: e(s).picEmail,
975
+ "onUpdate:modelValue": t[24] || (t[24] = (r) => e(s).picEmail = r),
976
+ label: "PIC Email",
977
+ "label-mark": "required",
978
+ rules: e(u)(e(d).string().min(1, "PIC Email is required"))
979
+ }, null, 8, ["modelValue", "rules"])
980
+ ]),
981
+ o("div", Ze, [
982
+ n(J, {
983
+ "model-value": e(s).picContact,
984
+ "onUpdate:modelValue": t[25] || (t[25] = (r) => e(s).picContact = r),
985
+ "default-country": "TH",
986
+ label: "PIC Contact",
987
+ "label-mark": "required",
988
+ rules: e(u)(e(d).string().min(1, "PIC Contact is required"))
989
+ }, null, 8, ["model-value", "rules"])
990
+ ]),
991
+ o("div", he, [
992
+ n(V, {
993
+ modelValue: e(s).witnessName,
994
+ "onUpdate:modelValue": t[26] || (t[26] = (r) => e(s).witnessName = r),
995
+ label: "Witness Name",
996
+ "label-mark": "required",
997
+ rules: e(u)(e(d).string().min(1, "Witness Name is required"))
998
+ }, null, 8, ["modelValue", "rules"])
999
+ ]),
1000
+ o("div", _e, [
1001
+ n(V, {
1002
+ modelValue: e(s).witnessRole,
1003
+ "onUpdate:modelValue": t[27] || (t[27] = (r) => e(s).witnessRole = r),
1004
+ label: "Witness Role",
1005
+ "label-mark": "required",
1006
+ rules: e(u)(e(d).string().min(1, "Witness Role is required"))
1007
+ }, null, 8, ["modelValue", "rules"])
1008
+ ]),
1009
+ n(P, {
1010
+ label: "Signature",
1011
+ type: "image",
1012
+ modelValue: e(i).signature,
1013
+ "onUpdate:modelValue": t[28] || (t[28] = (r) => e(i).signature = r),
1014
+ "restaurant-id": p.submission.restaurantId
1015
+ }, null, 8, ["modelValue", "restaurant-id"]),
1016
+ n(P, {
1017
+ label: "Witness Signature",
1018
+ type: "image",
1019
+ modelValue: e(i).witnessSignature,
1020
+ "onUpdate:modelValue": t[29] || (t[29] = (r) => e(i).witnessSignature = r),
1021
+ "restaurant-id": p.submission.restaurantId
1022
+ }, null, 8, ["modelValue", "restaurant-id"]),
1023
+ n(P, {
1024
+ label: "Company Stamp",
1025
+ type: "image",
1026
+ modelValue: e(i).companyStamp,
1027
+ "onUpdate:modelValue": t[30] || (t[30] = (r) => e(i).companyStamp = r),
1028
+ "restaurant-id": p.submission.restaurantId
1029
+ }, null, 8, ["modelValue", "restaurant-id"])
1030
+ ])
1031
+ ]),
1032
+ _: 1
1033
+ })
1034
+ ], 64);
1035
+ };
1036
+ }
1037
+ }), ll = {
1038
+ key: 0,
1039
+ class: "flex items-center justify-center min-h-[80vh]"
1040
+ }, tl = { class: "px-32 pb-32" }, gl = /* @__PURE__ */ M({
1041
+ __name: "OnboardForm",
1042
+ props: {
1043
+ submissionId: {
1044
+ type: String,
1045
+ required: !0
1046
+ }
1047
+ },
1048
+ setup(p) {
1049
+ const { startAsyncCall: $, isLoading: w } = Q(), N = Y(), q = p, S = le(), g = R(null), U = () => {
1050
+ if (window.history.length > 1) {
1051
+ S.back();
1052
+ return;
1053
+ }
1054
+ S.push({ name: "mf-payment-admin.onboard-submission" });
1055
+ };
1056
+ _(() => {
1057
+ $(async () => {
1058
+ g.value = await L.readById(q.submissionId);
1059
+ });
1060
+ });
1061
+ const s = W(() => {
1062
+ if (!g.value) return null;
1063
+ switch (g.value.type) {
1064
+ case "softspace":
1065
+ return Re;
1066
+ case "ntt":
1067
+ return el;
1068
+ default:
1069
+ return null;
1070
+ }
1071
+ }), i = R(0);
1072
+ function F(f) {
1073
+ g.value = f, i.value = Date.now();
1074
+ }
1075
+ const b = async (f) => {
1076
+ var B, y;
1077
+ if (g.value)
1078
+ switch (f) {
1079
+ case "preview":
1080
+ let m;
1081
+ try {
1082
+ m = N.open({
1083
+ message: "Generating preview document...",
1084
+ type: "info"
1085
+ }), await L.previewDocument(
1086
+ (B = g.value) == null ? void 0 : B._id
1087
+ );
1088
+ } catch (x) {
1089
+ N.open({
1090
+ type: "error",
1091
+ title: "Error occurs when generating submission document",
1092
+ message: z(x)
1093
+ });
1094
+ } finally {
1095
+ m && N.close(m);
1096
+ }
1097
+ break;
1098
+ case "send":
1099
+ try {
1100
+ N.open({
1101
+ message: "Sending onboarding document...",
1102
+ type: "info"
1103
+ }), await L.sendDocument(
1104
+ (y = g.value) == null ? void 0 : y._id
1105
+ ), N.open({
1106
+ type: "success",
1107
+ title: "Submission documents send successfully"
1108
+ });
1109
+ } catch (x) {
1110
+ N.open({
1111
+ type: "error",
1112
+ title: "Error occurs when sending document",
1113
+ message: z(x)
1114
+ });
1115
+ }
1116
+ break;
1117
+ }
1118
+ };
1119
+ return (f, B) => {
1120
+ var x, j;
1121
+ const y = k("FmCircularProgress"), m = k("FmPageHead");
1122
+ return e(w) ? (C(), A("div", ll, [
1123
+ n(y, { size: "xxl" })
1124
+ ])) : (C(), A(K, { key: 1 }, [
1125
+ n(m, {
1126
+ title: `Submission - ${(x = g.value) == null ? void 0 : x.type}`,
1127
+ description: `ID - ${(j = g.value) == null ? void 0 : j._id}`,
1128
+ "back-button": !0,
1129
+ "onClick:back": U,
1130
+ "onClick:action": b,
1131
+ actions: [
1132
+ {
1133
+ label: "Preview Document",
1134
+ value: "preview",
1135
+ prependIcon: "preview"
1136
+ },
1137
+ {
1138
+ label: "Send for Review",
1139
+ value: "send",
1140
+ isPrimary: !0,
1141
+ prependIcon: "send"
1142
+ }
1143
+ ]
1144
+ }, null, 8, ["title", "description"]),
1145
+ o("div", tl, [
1146
+ (C(), T(ee(s.value), {
1147
+ key: i.value,
1148
+ submission: g.value,
1149
+ "onUpdate:submission": F
1150
+ }, null, 40, ["submission"]))
1151
+ ])
1152
+ ], 64));
1153
+ };
1154
+ }
1155
+ });
1156
+ export {
1157
+ gl as default
1158
+ };