@feedmepos/mf-payment 1.11.3-dev → 1.11.5-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.
Files changed (54) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-v0SnPr5a.js → Actions.vue_vue_type_script_setup_true_lang-CaYfiHeE.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-DkWcXyh8.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-CGGazClM.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-CPT869Wj.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-DTbMceoX.js} +3 -3
  4. package/dist/{Chargeback-DBdMY6rF.js → Chargeback-BS3WIqFz.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-CC6od7-2.js → DocumentViewer.vue_vue_type_script_setup_true_lang-zoaRv68Y.js} +1 -1
  6. package/dist/{ExternalTerminal-C-fkxJM1.js → ExternalTerminal-DHd87yns.js} +6 -6
  7. package/dist/OnboardForm-BAqS4YTe.js +1805 -0
  8. package/dist/{OnboardForm-m-eFFjFa.js → OnboardForm-DybF2Xpq.js} +6 -6
  9. package/dist/{OnboardSubmission-CjdEUnwb.js → OnboardSubmission-Ekq71UtI.js} +3 -3
  10. package/dist/{OnboardSubmission-CWDie0Df.js → OnboardSubmission-c-T3mdsX.js} +6 -6
  11. package/dist/{PaymentCheckout-DeyXPwEF.js → PaymentCheckout-ljT0nlId.js} +2 -2
  12. package/dist/{PayoutAccount-C-tpgVwN.js → PayoutAccount-BKgfsrf4.js} +5 -5
  13. package/dist/{PayoutAccount-B1qD1gJN.js → PayoutAccount-DV8O33uo.js} +7 -7
  14. package/dist/{PayoutAccountSetting-CyTqnA_G.js → PayoutAccountSetting-CzfCvedQ.js} +6 -6
  15. package/dist/{Restaurant-DMK56dUY.js → Restaurant-CPtr4wkD.js} +4 -4
  16. package/dist/{RestaurantSetting-Cbz0p1Yf.js → RestaurantSetting-xxGl_dJX.js} +3 -3
  17. package/dist/{Settlement-CPP1bUR9.js → Settlement-BhX_a8E8.js} +4 -4
  18. package/dist/{Settlement-Bpa-abXS.js → Settlement-Bv7GHHCG.js} +3 -3
  19. package/dist/{SettlementTransactions-DIn7uIFk.js → SettlementTransactions-D1rHtfit.js} +5 -5
  20. package/dist/{SettlementTransactions-otdARkcC.js → SettlementTransactions-Duh2LsRY.js} +5 -5
  21. package/dist/{Status.vue_vue_type_script_setup_true_lang-DGlhkKxZ.js → Status.vue_vue_type_script_setup_true_lang-CVMiovZi.js} +1 -1
  22. package/dist/{Terminal-CGYKt4T3.js → Terminal-BAAmhFn3.js} +6 -6
  23. package/dist/{TerminalSetting-BMLsViC8.js → TerminalSetting-BD_E8Fmw.js} +7 -7
  24. package/dist/{TerminalTemplate-CVCkpNJo.js → TerminalTemplate-DBB60fPH.js} +5 -5
  25. package/dist/{TerminalTemplateSetting-C1PLbLc5.js → TerminalTemplateSetting-CY8lvkvb.js} +5 -5
  26. package/dist/{Transaction-Dk3hcOYl.js → Transaction-CPgBiDP9.js} +10 -10
  27. package/dist/{Transaction-Bi8WMK-J.js → Transaction-ezANQx5W.js} +12 -12
  28. package/dist/{TransactionOld-BI8VhSYc.js → TransactionOld-BHsqPlP6.js} +7 -7
  29. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-T772VqFe.js → TransactionStatus.vue_vue_type_script_setup_true_lang-BnRLxudT.js} +1 -1
  30. package/dist/api/onboard-submission/index.d.ts +1 -1
  31. package/dist/{app-B5h83d26.js → app-CcG9h_1h.js} +26 -26
  32. package/dist/app.js +1 -1
  33. package/dist/{assets-CQn4-mCk.js → assets-aOyz_Xdo.js} +1 -1
  34. package/dist/{grafana-DipV6jzB.js → grafana-Dd1q_or-.js} +1 -1
  35. package/dist/{index-zMzAjmwz.js → index-B5RVh7Dv.js} +1 -1
  36. package/dist/{index-Cs00ZYzD.js → index-BA4vV9PS.js} +1 -1
  37. package/dist/{index-B5eEeJe7.js → index-Bl5v_ygb.js} +1 -1
  38. package/dist/{index-CHBejTua.js → index-BxIurCFl.js} +1 -1
  39. package/dist/{index-rmD5hk67.js → index-CNL-EBVv.js} +1 -1
  40. package/dist/{index-CbRJWjTB.js → index-C_1f0U3Q.js} +1 -1
  41. package/dist/{index-e3vroquS.js → index-DF5J3ly5.js} +1 -1
  42. package/dist/{index-OJbHgXbS.js → index-DIqpeMJg.js} +1 -1
  43. package/dist/{index-BiTo3-CO.js → index-De1W4TpZ.js} +24 -24
  44. package/dist/{index-C07g4gZq.js → index-Dpbobspy.js} +1 -1
  45. package/dist/{index-CP7BTy-D.js → index-_0RCDI7E.js} +1 -1
  46. package/dist/{index.vue_vue_type_script_setup_true_lang-Cu7pAJFv.js → index.vue_vue_type_script_setup_true_lang-C8XtGjpP.js} +1 -1
  47. package/dist/{onboard-submission-CRJ6q1pV.js → onboard-submission-ytd4azQw.js} +1 -1
  48. package/dist/package.json +1 -1
  49. package/dist/{payout-account-BPRFi4QA.js → payout-account-3edqDHiA.js} +3 -3
  50. package/dist/style.css +1 -1
  51. package/dist/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/{useQuery-D1xFn41j.js → useQuery-mCN49hhF.js} +1 -1
  53. package/package.json +1 -1
  54. package/dist/OnboardForm-DE3bXb-m.js +0 -1757
@@ -0,0 +1,1805 @@
1
+ import { defineComponent as X, ref as B, computed as h, resolveComponent as P, openBlock as u, createElementBlock as k, createElementVNode as a, toDisplayString as N, createBlock as A, withCtx as x, createCommentVNode as T, createVNode as o, unref as e, onMounted as fe, watch as Re, Fragment as _, renderList as Q, normalizeClass as Ve, nextTick as Ue, createTextVNode as G, resolveDynamicComponent as qe } from "vue";
2
+ import { o as M } from "./index-De1W4TpZ.js";
3
+ import { u as ne, p as ke } from "./index-DF5J3ly5.js";
4
+ import { useRouter as Fe } from "vue-router";
5
+ import { z as p, a as b } from "./validator-CTlVogBQ.js";
6
+ import { D as De, P as Te } from "./payout-account-3edqDHiA.js";
7
+ import { a as Ee } from "./onboard-submission-ytd4azQw.js";
8
+ import { _ as Ce } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-zoaRv68Y.js";
9
+ import { s as $e } from "./vue-signature-pad.esm-IXPjf4fL.js";
10
+ import { _ as xe } from "./Status.vue_vue_type_script_setup_true_lang-CVMiovZi.js";
11
+ import { useSnackbar as de } from "@feedmepos/ui-library";
12
+ import { u as J } from "./error-K1CakhA9.js";
13
+ const Ae = ["src"], ce = ".png, .jpg, .jpeg", ge = ".pdf", D = /* @__PURE__ */ X({
14
+ __name: "UploadButton",
15
+ props: {
16
+ modelValue: {},
17
+ label: {},
18
+ type: {},
19
+ restaurantId: {}
20
+ },
21
+ emits: ["update:modelValue"],
22
+ setup(d, { emit: w }) {
23
+ const m = d, v = B(m.modelValue), c = w, C = (i) => {
24
+ const q = new FileReader();
25
+ q.onload = (g) => {
26
+ var I;
27
+ v.value = (I = g.target) == null ? void 0 : I.result, c("update:modelValue", i);
28
+ }, q.readAsDataURL(i);
29
+ }, y = (i) => {
30
+ window.open(i, "_blank", "noopener,noreferrer");
31
+ }, E = h(() => m.type === "image" ? ce : m.type === "pdf" ? ge : `${ce}, ${ge}`), s = (i) => m.type === "pdf" ? !0 : m.type === "image" ? !1 : i === "application/pdf";
32
+ return (i, q) => {
33
+ const g = P("FmButton"), I = P("FmDropField");
34
+ return u(), k("div", null, [
35
+ a("p", null, N(d.label), 1),
36
+ v.value ? (u(), A(Ce, {
37
+ key: 0,
38
+ document: v.value,
39
+ "restaurant-id": d.restaurantId
40
+ }, {
41
+ default: x(({ src: $, type: R }) => [
42
+ s(R) ? (u(), A(g, {
43
+ key: 1,
44
+ class: "mt-4 w-full",
45
+ "prepend-icon": "manage_accounts",
46
+ label: "View Document",
47
+ variant: "primary",
48
+ onVnodeMounted: () => y($),
49
+ onClick: () => y($)
50
+ }, null, 8, ["onVnodeMounted", "onClick"])) : (u(), k("img", {
51
+ key: 0,
52
+ src: $
53
+ }, null, 8, Ae))
54
+ ]),
55
+ _: 1
56
+ }, 8, ["document", "restaurant-id"])) : (u(), A(I, {
57
+ key: 1,
58
+ accept: E.value,
59
+ onFileUpload: C
60
+ }, null, 8, ["accept"]))
61
+ ]);
62
+ };
63
+ }
64
+ }), Le = ["src"], Be = {
65
+ key: 0,
66
+ class: "text-center text-red-700 py-4"
67
+ }, Oe = { class: "flex justify-evenly py-3" }, je = /* @__PURE__ */ X({
68
+ __name: "SignatureBoard",
69
+ props: {
70
+ modelValue: {},
71
+ label: {},
72
+ restaurantId: {}
73
+ },
74
+ emits: ["update:modelValue"],
75
+ setup(d, { emit: w }) {
76
+ const m = d, v = w, c = B(m.modelValue), C = B(!1), y = B(), E = B(!1);
77
+ function s(q, g) {
78
+ var j;
79
+ const I = q.split(","), $ = ((j = I[0].match(/:(.*?);/)) == null ? void 0 : j[1]) || "", R = atob(I[1]);
80
+ let O = R.length;
81
+ const f = new Uint8Array(O);
82
+ for (; O--; )
83
+ f[O] = R.charCodeAt(O);
84
+ return new File([f], g, { type: $ });
85
+ }
86
+ const i = function() {
87
+ const { isEmpty: q, data: g } = y.value.saveSignature();
88
+ if (q)
89
+ return C.value = !0;
90
+ c.value = g, E.value = !1, v("update:modelValue", s(g, "signature.png"));
91
+ };
92
+ return (q, g) => {
93
+ const I = P("FmButton"), $ = P("FmDialog");
94
+ return u(), k("div", null, [
95
+ a("p", null, N(d.label), 1),
96
+ c.value ? (u(), A(Ce, {
97
+ key: 0,
98
+ document: c.value,
99
+ "restaurant-id": d.restaurantId
100
+ }, {
101
+ default: x(({ src: R }) => [
102
+ a("img", {
103
+ src: R,
104
+ alt: "Signature Preview",
105
+ class: "w-full h-auto"
106
+ }, null, 8, Le)
107
+ ]),
108
+ _: 1
109
+ }, 8, ["document", "restaurant-id"])) : T("", !0),
110
+ c.value ? T("", !0) : (u(), A($, {
111
+ key: 1,
112
+ modelValue: E.value,
113
+ "onUpdate:modelValue": g[1] || (g[1] = (R) => E.value = R)
114
+ }, {
115
+ "dialog-button": x(() => [
116
+ o(I, {
117
+ "prepend-icon": "signature",
118
+ class: "w-full",
119
+ label: "Signature"
120
+ })
121
+ ]),
122
+ "dialog-header": x(() => [...g[2] || (g[2] = [
123
+ a("div", null, "Signature Board", -1)
124
+ ])]),
125
+ default: x(() => [
126
+ o(e($e), {
127
+ ref_key: "signaturePad",
128
+ ref: y,
129
+ height: "300px",
130
+ customStyle: { border: "2px solid #ccc", borderRadius: "3px" },
131
+ options: { penColor: "#000000" }
132
+ }, null, 512),
133
+ C.value ? (u(), k("p", Be, " Please sign your signature before saving. ")) : T("", !0),
134
+ a("div", Oe, [
135
+ o(I, {
136
+ variant: "destructive",
137
+ label: "Clear",
138
+ "prepend-icon": "delete",
139
+ onClick: g[0] || (g[0] = (R) => y.value.clearSignature())
140
+ }),
141
+ o(I, {
142
+ label: "Save",
143
+ "prepend-icon": "save",
144
+ onClick: i
145
+ })
146
+ ])
147
+ ]),
148
+ _: 1
149
+ }, 8, ["modelValue"]))
150
+ ]);
151
+ };
152
+ }
153
+ }), he = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), _e = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Me = new RegExp("(\\d)(\\p{Ll})", "gu"), ze = new RegExp("(\\p{L})(\\d)", "gu"), He = /[^\p{L}\d]+/giu, re = "$1\0$2";
154
+ function We(d, w = {}) {
155
+ let m = d.replace(he, re).replace(_e, re);
156
+ w.separateNumbers && (m = m.replace(Me, re).replace(ze, re)), m = m.replace(He, "\0");
157
+ let v = 0, c = m.length;
158
+ for (; m.charAt(v) === "\0"; )
159
+ v++;
160
+ if (v === c)
161
+ return [];
162
+ for (; m.charAt(c - 1) === "\0"; )
163
+ c--;
164
+ return m.slice(v, c).split(/\0/g);
165
+ }
166
+ function Ye(d) {
167
+ return (w) => w.toLocaleLowerCase(d);
168
+ }
169
+ function Ge(d) {
170
+ return (w) => w.toLocaleUpperCase(d);
171
+ }
172
+ function ye(d, w) {
173
+ const m = Ye(w == null ? void 0 : w.locale), v = Ge(w == null ? void 0 : w.locale);
174
+ return We(d).map((c, C) => C === 0 ? v(c[0]) + m(c.slice(1)) : m(c)).join(" ");
175
+ }
176
+ const Je = {
177
+ key: 0,
178
+ class: "text-sm text-gray-500"
179
+ }, Ke = { class: "flex min-w-max items-start pt-1" }, Qe = {
180
+ key: 0,
181
+ class: "absolute left-0 top-[7px] h-[2px] w-1/2 bg-gray-200"
182
+ }, Xe = {
183
+ key: 1,
184
+ class: "absolute right-0 top-[7px] h-[2px] w-1/2 bg-gray-200"
185
+ }, Ze = { class: "mt-1 text-sm font-medium leading-snug text-gray-900" }, el = {
186
+ key: 2,
187
+ class: "mt-1 rounded bg-gray-100 px-2 py-[2px] text-xs text-gray-600"
188
+ }, ll = { class: "mt-1 text-xs text-gray-500" }, tl = { class: "text-xs text-gray-500" }, al = {
189
+ key: 4,
190
+ class: "mt-1 text-xs text-gray-500"
191
+ }, sl = {
192
+ key: 5,
193
+ class: "mt-1 whitespace-pre-line break-words text-xs text-gray-700"
194
+ }, we = /* @__PURE__ */ X({
195
+ __name: "Timeline",
196
+ props: {
197
+ entries: {
198
+ type: Array,
199
+ default: () => []
200
+ }
201
+ },
202
+ setup(d) {
203
+ const w = d, m = {
204
+ submission: { label: "Submitted", icon: "upload_file", color: "bg-blue-400" },
205
+ resubmission: {
206
+ label: "Resubmitted",
207
+ icon: "upload_file",
208
+ color: "bg-blue-400"
209
+ },
210
+ "send-for-review": {
211
+ label: "Sent for Review",
212
+ icon: "send",
213
+ color: "bg-indigo-400"
214
+ },
215
+ "submission-review-approved": {
216
+ label: "Review Approved",
217
+ icon: "check_circle",
218
+ color: "bg-green-400"
219
+ },
220
+ "submission-review-rejected": {
221
+ label: "Review Rejected",
222
+ icon: "cancel",
223
+ color: "bg-red-400"
224
+ },
225
+ "submission-review-ready": {
226
+ label: "Marked as Ready",
227
+ icon: "task_alt",
228
+ color: "bg-green-400"
229
+ },
230
+ "additional-document": {
231
+ label: "Additional Document Added",
232
+ icon: "attach_file",
233
+ color: "bg-gray-400"
234
+ },
235
+ reminder: {
236
+ label: "Reminder Sent",
237
+ icon: "notifications",
238
+ color: "bg-yellow-400"
239
+ },
240
+ "pending-merchant": {
241
+ label: "Pending Merchant",
242
+ icon: "storefront",
243
+ color: "bg-yellow-400"
244
+ },
245
+ "pending-fasspay": {
246
+ label: "Pending FassPay",
247
+ icon: "hourglass_top",
248
+ color: "bg-orange-400"
249
+ },
250
+ "complete-fasspay": {
251
+ label: "FassPay Completed",
252
+ icon: "task_alt",
253
+ color: "bg-green-400"
254
+ },
255
+ "complete-credit-card": {
256
+ label: "Credit Card Completed",
257
+ icon: "credit_card",
258
+ color: "bg-green-400"
259
+ },
260
+ "provider-update": {
261
+ label: "Provider Update",
262
+ icon: "update",
263
+ color: "bg-orange-400"
264
+ }
265
+ }, v = {
266
+ approved: "bg-green-400",
267
+ ready: "bg-green-400",
268
+ rejected: "bg-red-400",
269
+ submitted: "bg-blue-400",
270
+ pending: "bg-yellow-400"
271
+ };
272
+ function c(s) {
273
+ const i = m[s];
274
+ if (i) return i;
275
+ if (s.startsWith("status-update-")) {
276
+ const q = s.replace("status-update-", "");
277
+ return {
278
+ label: `Status Updated to ${ye(q)}`,
279
+ icon: "sync",
280
+ color: v[q] ?? "bg-gray-400"
281
+ };
282
+ }
283
+ return {
284
+ label: ye(s.replace(/-/g, " ")),
285
+ icon: "radio_button_checked",
286
+ color: "bg-gray-400"
287
+ };
288
+ }
289
+ const C = h(
290
+ () => (w.entries ?? []).map((s) => ({
291
+ ...s,
292
+ ...c(s.action),
293
+ at: De(s.timestamp)
294
+ })).sort((s, i) => s.at.valueOf() - i.at.valueOf())
295
+ ), y = B(null), E = async () => {
296
+ await Ue(), y.value && (y.value.scrollLeft = y.value.scrollWidth);
297
+ };
298
+ return fe(E), Re(() => C.value.length, E), (s, i) => {
299
+ const q = P("FmIcon");
300
+ return C.value.length ? (u(), k("div", {
301
+ key: 1,
302
+ ref_key: "rail",
303
+ ref: y,
304
+ class: "overflow-x-auto mt-6 pb-6"
305
+ }, [
306
+ a("ol", Ke, [
307
+ (u(!0), k(_, null, Q(C.value, (g, I) => (u(), k("li", {
308
+ key: `${g.action}-${g.timestamp}-${I}`,
309
+ class: "relative flex w-[160px] shrink-0 flex-col items-center px-8 text-center"
310
+ }, [
311
+ I > 0 ? (u(), k("span", Qe)) : T("", !0),
312
+ I < C.value.length - 1 ? (u(), k("span", Xe)) : T("", !0),
313
+ a("span", {
314
+ class: Ve([
315
+ "relative z-10 h-4 w-4 rounded-full ring-4 ring-white",
316
+ g.color
317
+ ])
318
+ }, null, 2),
319
+ o(q, {
320
+ name: g.icon,
321
+ size: "sm",
322
+ class: "mt-3 text-gray-500"
323
+ }, null, 8, ["name"]),
324
+ a("span", Ze, N(g.label), 1),
325
+ I === C.value.length - 1 ? (u(), k("span", el, " Latest ")) : T("", !0),
326
+ g.at.isValid() ? (u(), k(_, { key: 3 }, [
327
+ a("span", ll, N(g.at.format("DD MMM YYYY")), 1),
328
+ a("span", tl, N(g.at.format("HH:mm")), 1)
329
+ ], 64)) : (u(), k("span", al, N(g.timestamp), 1)),
330
+ g.description ? (u(), k("span", sl, N(g.description), 1)) : T("", !0)
331
+ ]))), 128))
332
+ ])
333
+ ], 512)) : (u(), k("p", Je, " No activity recorded yet. "));
334
+ };
335
+ }
336
+ }), nl = { class: "space-y-2" }, ol = { class: "text-gray-900" }, rl = { class: "text-gray-900" }, il = { class: "text-gray-900" }, ul = { class: "text-gray-900" }, dl = { class: "text-gray-900" }, ml = { class: "text-gray-900" }, pl = { class: "flex items-center gap-2 border-b pb-1 mt-6 mb-6" }, bl = { class: "flex items-center justify-between gap-6" }, cl = { class: "flex gap-6" }, gl = { class: "flex gap-6" }, yl = { class: "grid grid-cols-4 gap-6" }, vl = ["src"], fl = {
337
+ key: 1,
338
+ class: "mt-2 truncate text-gray-700"
339
+ }, Vl = { key: 0 }, kl = {
340
+ key: 0,
341
+ class: "w-full flex justify-end mt-6"
342
+ }, Cl = { class: "mt-6 grid grid-cols-4 gap-24" }, xl = { class: "grid grid-cols-4 gap-6" }, wl = { class: "w-full flex justify-end mt-6" }, Nl = { class: "mt-6 grid grid-cols-4 gap-24" }, Sl = { class: "col-span-2" }, Pl = { class: "col-span-2" }, Il = { class: "col-span-2" }, Rl = { class: "col-span-2" }, Ul = { class: "col-span-2" }, ql = { class: "col-span-2" }, Fl = { class: "col-span-2" }, Dl = { class: "col-span-2" }, Tl = { class: "col-start-1 col-span-2" }, El = { class: "col-span-2" }, $l = { class: "col-span-2" }, Al = { class: "col-span-2" }, Ll = { class: "mt-6 grid grid-cols-4 gap-6" }, Bl = { class: "mt-6 grid grid-cols-4 gap-6" }, Ol = { class: "mt-6 grid grid-cols-4 gap-6" }, jl = { class: "mt-6 grid grid-cols-4 gap-6" }, hl = { class: "mt-6 grid grid-cols-4 gap-6" }, _l = { class: "mt-6 grid grid-cols-4 gap-6" }, Ml = {
343
+ key: 2,
344
+ class: "text-sm text-gray-500"
345
+ }, zl = { class: "mt-6 grid grid-cols-2 gap-24" }, ve = 30, Hl = /* @__PURE__ */ X({
346
+ __name: "SoftspaceSubmission",
347
+ props: {
348
+ submission: {
349
+ type: Object,
350
+ required: !0
351
+ }
352
+ },
353
+ emits: ["update:submission"],
354
+ setup(d, { emit: w }) {
355
+ var me;
356
+ const m = d, v = w, c = de(), C = B(!1), { isLoading: y, startAsyncCall: E } = ne(), { fields: s, documents: i, restaurantId: q, profile: g, status: I, statusReason: $ } = m.submission, R = B(""), O = B(
357
+ parseInt(((me = m.submission.fields) == null ? void 0 : me.numberOfDevices) ?? 1)
358
+ ), f = B(
359
+ m.submission.rates ? Object.fromEntries(
360
+ Object.entries(m.submission.rates).map(([V, l]) => [V, `${l}`])
361
+ ) : {
362
+ duitNow: "0.8",
363
+ mydebitCard: "0.5",
364
+ localDebit: "0.5",
365
+ localCredit: "1.1",
366
+ foreignCard: "3.0",
367
+ jcbStandard: "2.2",
368
+ jcbPlatinum: "2.2"
369
+ }
370
+ ), j = h(
371
+ () => Object.values(f.value).every((V) => parseFloat(V) > 0)
372
+ ), Z = h(
373
+ () => Object.keys(m.submission.documents).filter((V) => /^authorizedPersonID\d+$/.test(V)).sort(
374
+ (V, l) => Number(V.replace("authorizedPersonID", "")) - Number(l.replace("authorizedPersonID", ""))
375
+ )
376
+ ), { isLoading: ee, startAsyncCall: le } = ne(), z = B([]), ae = (V) => Number(V.replace("additionalDocument", "")), S = h(
377
+ () => Object.keys(m.submission.documents).filter((V) => /^additionalDocument\d+$/.test(V)).sort((V, l) => ae(V) - ae(l))
378
+ ), n = h(
379
+ () => S.value.length + z.value.length
380
+ ), F = (V) => {
381
+ if (!(n.value >= ve)) {
382
+ if (V.type.startsWith("image/")) {
383
+ const l = new FileReader();
384
+ l.onload = (L) => {
385
+ var W;
386
+ return z.value.push({
387
+ file: V,
388
+ preview: String(((W = L.target) == null ? void 0 : W.result) ?? "")
389
+ });
390
+ }, l.readAsDataURL(V);
391
+ return;
392
+ }
393
+ z.value.push({ file: V, preview: "" });
394
+ }
395
+ }, te = () => le(async () => {
396
+ try {
397
+ let V = S.value.reduce(
398
+ (L, W) => Math.max(L, ae(W)),
399
+ 0
400
+ );
401
+ const l = {};
402
+ for (const { file: L } of z.value) {
403
+ const W = `additionalDocument${++V}`;
404
+ l[W] = await M.uploadDocument(
405
+ q,
406
+ W,
407
+ L
408
+ );
409
+ }
410
+ v(
411
+ "update:submission",
412
+ await M.addAdditionalDocuments(
413
+ m.submission._id,
414
+ l
415
+ )
416
+ ), z.value = [], c.open({ type: "success", title: "Documents saved" });
417
+ } catch (V) {
418
+ c.open({
419
+ type: "error",
420
+ title: "Error occurs when sending additional documents",
421
+ message: J(V)
422
+ });
423
+ }
424
+ }), ie = () => E(async () => {
425
+ try {
426
+ const V = await M.reviewById(
427
+ m.submission._id,
428
+ {
429
+ numberOfDevices: O.value.toString(),
430
+ rates: {
431
+ duitNow: parseFloat(f.value.duitNow),
432
+ mydebitCard: parseFloat(f.value.mydebitCard),
433
+ localDebit: parseFloat(f.value.localDebit),
434
+ localCredit: parseFloat(f.value.localCredit),
435
+ foreignCard: parseFloat(f.value.foreignCard),
436
+ jcbStandard: parseFloat(f.value.jcbStandard),
437
+ jcbPlatinum: parseFloat(f.value.jcbPlatinum)
438
+ },
439
+ status: "approved"
440
+ }
441
+ );
442
+ v("update:submission", V), C.value = !1, c.open({
443
+ type: "success",
444
+ title: "Submission updated successfully"
445
+ });
446
+ } catch (V) {
447
+ c.open({
448
+ type: "error",
449
+ title: "Error occurs when updating submission",
450
+ message: J(V)
451
+ });
452
+ }
453
+ }), { isLoading: K, startAsyncCall: ue } = ne(), se = h(
454
+ () => m.submission.timelineStatus === "complete"
455
+ ), r = B(!1), H = B(""), oe = (V, l) => ue(async () => {
456
+ try {
457
+ v(
458
+ "update:submission",
459
+ await M.trackStatus(
460
+ m.submission._id,
461
+ V,
462
+ l
463
+ )
464
+ ), r.value = !1, H.value = "", c.open({
465
+ type: "success",
466
+ title: "Status tracking updated successfully"
467
+ });
468
+ } catch (L) {
469
+ c.open({
470
+ type: "error",
471
+ title: "Error occurs when updating status tracking",
472
+ message: J(L)
473
+ });
474
+ }
475
+ }), Ne = () => E(async () => {
476
+ try {
477
+ const V = await M.reviewById(
478
+ m.submission._id,
479
+ {
480
+ status: "rejected",
481
+ statusReason: R.value
482
+ }
483
+ );
484
+ v("update:submission", V), C.value = !1, c.open({
485
+ type: "success",
486
+ title: "Submission updated successfully"
487
+ });
488
+ } catch (V) {
489
+ c.open({
490
+ type: "error",
491
+ title: "Error occurs when updating submission",
492
+ message: J(V)
493
+ });
494
+ }
495
+ });
496
+ return (V, l) => {
497
+ const L = P("FmButton"), W = P("FmTextarea"), pe = P("FmDialog"), Se = P("FmDropField"), U = P("FmTextField"), Pe = P("FmPhoneNumber"), be = P("FmSelect"), Ie = P("FmForm");
498
+ return u(), k(_, null, [
499
+ a("div", nl, [
500
+ a("div", null, [
501
+ l[44] || (l[44] = a("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
502
+ a("span", ol, N(e(q)), 1)
503
+ ]),
504
+ a("div", null, [
505
+ l[45] || (l[45] = a("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
506
+ a("span", rl, N(e(g).name) + " ( " + N(e(g).legalName) + " )", 1)
507
+ ]),
508
+ a("div", null, [
509
+ l[46] || (l[46] = a("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
510
+ a("span", il, N(e(g).email), 1)
511
+ ]),
512
+ a("div", null, [
513
+ l[47] || (l[47] = a("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
514
+ a("span", ul, N(e(g).phoneNo), 1)
515
+ ]),
516
+ a("div", null, [
517
+ l[48] || (l[48] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
518
+ a("span", dl, [
519
+ o(xe, { data: e(I) }, null, 8, ["data"])
520
+ ])
521
+ ]),
522
+ a("div", null, [
523
+ l[49] || (l[49] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
524
+ a("span", ml, N(e($)), 1)
525
+ ])
526
+ ]),
527
+ a("div", pl, [
528
+ l[50] || (l[50] = a("h3", { class: "font-semibold text-lg" }, "Status Tracking", -1)),
529
+ a("span", {
530
+ class: Ve([
531
+ "rounded px-2 py-[2px] text-xs",
532
+ se.value ? "bg-green-100 text-green-700" : "bg-yellow-100 text-yellow-700"
533
+ ])
534
+ }, N(se.value ? "COMPLETE" : "PENDING"), 3)
535
+ ]),
536
+ a("div", bl, [
537
+ a("div", cl, [
538
+ o(pe, {
539
+ modelValue: r.value,
540
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => r.value = t)
541
+ }, {
542
+ "dialog-button": x(() => [
543
+ o(L, {
544
+ type: "button",
545
+ variant: "secondary",
546
+ "prepend-icon": "storefront",
547
+ label: "Pending Merchant",
548
+ loading: e(K)
549
+ }, null, 8, ["loading"])
550
+ ]),
551
+ "dialog-header": x(() => [...l[51] || (l[51] = [
552
+ a("div", null, "Pending Merchant", -1)
553
+ ])]),
554
+ default: x(() => [
555
+ o(W, {
556
+ modelValue: H.value,
557
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => H.value = t),
558
+ label: "Description",
559
+ "label-mark": "optional",
560
+ "helper-text": "What the merchant still owes us. Shown on the timeline."
561
+ }, null, 8, ["modelValue"]),
562
+ o(L, {
563
+ class: "mb-2 mt-6 w-full",
564
+ label: "Submit",
565
+ "prepend-icon": "save",
566
+ loading: e(K),
567
+ onClick: l[1] || (l[1] = (t) => oe("pending-merchant", H.value))
568
+ }, null, 8, ["loading"])
569
+ ]),
570
+ _: 1
571
+ }, 8, ["modelValue"]),
572
+ o(L, {
573
+ type: "button",
574
+ variant: "secondary",
575
+ "prepend-icon": "hourglass_top",
576
+ label: "Pending FassPay",
577
+ loading: e(K),
578
+ onClick: l[3] || (l[3] = (t) => oe("pending-fasspay"))
579
+ }, null, 8, ["loading"])
580
+ ]),
581
+ a("div", gl, [
582
+ o(L, {
583
+ type: "button",
584
+ variant: "tertiary",
585
+ "prepend-icon": "task_alt",
586
+ label: "Complete FassPay",
587
+ loading: e(K),
588
+ onClick: l[4] || (l[4] = (t) => oe("complete-fasspay"))
589
+ }, null, 8, ["loading"]),
590
+ o(L, {
591
+ type: "button",
592
+ variant: "primary",
593
+ "prepend-icon": "credit_card",
594
+ label: "Complete Credit Card",
595
+ loading: e(K),
596
+ disabled: se.value,
597
+ onClick: l[5] || (l[5] = (t) => oe("complete-credit-card"))
598
+ }, null, 8, ["loading", "disabled"])
599
+ ])
600
+ ]),
601
+ l[69] || (l[69] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Timeline", -1)),
602
+ o(we, {
603
+ entries: d.submission.timeline
604
+ }, null, 8, ["entries"]),
605
+ l[70] || (l[70] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " (SharePoint) Additional Requested Documents ", -1)),
606
+ a("div", yl, [
607
+ (u(!0), k(_, null, Q(S.value, (t) => (u(), A(D, {
608
+ key: t,
609
+ label: t.replace("additionalDocument", "Document "),
610
+ type: /\.pdf$/i.test(m.submission.documents[t]) ? "pdf" : "image",
611
+ modelValue: m.submission.documents[t],
612
+ "onUpdate:modelValue": (Y) => m.submission.documents[t] = Y,
613
+ "restaurant-id": e(q)
614
+ }, null, 8, ["label", "type", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128)),
615
+ (u(!0), k(_, null, Q(z.value, (t, Y) => (u(), k("div", {
616
+ key: `new-${Y}`
617
+ }, [
618
+ a("p", null, "Document " + N(S.value.length + Y + 1), 1),
619
+ t.file.type.startsWith("image/") ? (u(), k("img", {
620
+ key: 0,
621
+ src: t.preview,
622
+ class: "mt-2 rounded border"
623
+ }, null, 8, vl)) : (u(), k("p", fl, N(t.file.name), 1)),
624
+ o(L, {
625
+ class: "mt-4",
626
+ "prepend-icon": "delete",
627
+ label: "Remove",
628
+ variant: "destructive",
629
+ onClick: (Vt) => z.value.splice(Y, 1)
630
+ }, null, 8, ["onClick"])
631
+ ]))), 128)),
632
+ n.value < ve ? (u(), k("div", Vl, [
633
+ a("p", null, "Document " + N(n.value + 1), 1),
634
+ o(Se, {
635
+ accept: ".png, .jpg, .jpeg, .pdf",
636
+ onFileUpload: F
637
+ })
638
+ ])) : T("", !0)
639
+ ]),
640
+ z.value.length ? (u(), k("div", kl, [
641
+ o(L, {
642
+ type: "button",
643
+ variant: "primary",
644
+ "prepend-icon": "cloud_upload",
645
+ label: "Save documents",
646
+ loading: e(ee),
647
+ onClick: te
648
+ }, null, 8, ["loading"])
649
+ ])) : T("", !0),
650
+ l[71] || (l[71] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
651
+ a("div", Cl, [
652
+ o(U, {
653
+ modelValue: f.value.duitNow,
654
+ "onUpdate:modelValue": l[6] || (l[6] = (t) => f.value.duitNow = t),
655
+ label: "DuitNow QR",
656
+ "label-mark": "required",
657
+ type: "number",
658
+ inputmode: "numeric",
659
+ decimal: 2,
660
+ rules: e(p)(
661
+ e(b).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
662
+ )
663
+ }, {
664
+ append: x(() => [...l[52] || (l[52] = [
665
+ G("%", -1)
666
+ ])]),
667
+ _: 1
668
+ }, 8, ["modelValue", "rules"]),
669
+ o(U, {
670
+ modelValue: f.value.mydebitCard,
671
+ "onUpdate:modelValue": l[7] || (l[7] = (t) => f.value.mydebitCard = t),
672
+ label: "myDebit Card",
673
+ "label-mark": "required",
674
+ type: "number",
675
+ inputmode: "numeric",
676
+ decimal: 2,
677
+ rules: e(p)(
678
+ e(b).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
679
+ )
680
+ }, {
681
+ append: x(() => [...l[53] || (l[53] = [
682
+ G("%", -1)
683
+ ])]),
684
+ _: 1
685
+ }, 8, ["modelValue", "rules"]),
686
+ o(U, {
687
+ modelValue: f.value.localDebit,
688
+ "onUpdate:modelValue": l[8] || (l[8] = (t) => f.value.localDebit = t),
689
+ label: "Local Debit Card",
690
+ "label-mark": "required",
691
+ type: "number",
692
+ inputmode: "numeric",
693
+ decimal: 2,
694
+ rules: e(p)(
695
+ e(b).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
696
+ )
697
+ }, {
698
+ append: x(() => [...l[54] || (l[54] = [
699
+ G("%", -1)
700
+ ])]),
701
+ _: 1
702
+ }, 8, ["modelValue", "rules"]),
703
+ o(U, {
704
+ modelValue: f.value.localCredit,
705
+ "onUpdate:modelValue": l[9] || (l[9] = (t) => f.value.localCredit = t),
706
+ label: "Local Credit Card",
707
+ "label-mark": "required",
708
+ type: "number",
709
+ inputmode: "numeric",
710
+ decimal: 2,
711
+ rules: e(p)(
712
+ e(b).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
713
+ )
714
+ }, {
715
+ append: x(() => [...l[55] || (l[55] = [
716
+ G("%", -1)
717
+ ])]),
718
+ _: 1
719
+ }, 8, ["modelValue", "rules"]),
720
+ o(U, {
721
+ modelValue: f.value.foreignCard,
722
+ "onUpdate:modelValue": l[10] || (l[10] = (t) => f.value.foreignCard = t),
723
+ label: "Foreign Card",
724
+ "label-mark": "required",
725
+ type: "number",
726
+ inputmode: "numeric",
727
+ decimal: 2,
728
+ rules: e(p)(
729
+ e(b).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
730
+ )
731
+ }, {
732
+ append: x(() => [...l[56] || (l[56] = [
733
+ G("%", -1)
734
+ ])]),
735
+ _: 1
736
+ }, 8, ["modelValue", "rules"]),
737
+ o(U, {
738
+ modelValue: f.value.jcbStandard,
739
+ "onUpdate:modelValue": l[11] || (l[11] = (t) => f.value.jcbStandard = t),
740
+ label: "JCB Standard",
741
+ "label-mark": "required",
742
+ type: "number",
743
+ inputmode: "numeric",
744
+ decimal: 2,
745
+ rules: e(p)(
746
+ e(b).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
747
+ )
748
+ }, {
749
+ append: x(() => [...l[57] || (l[57] = [
750
+ G("%", -1)
751
+ ])]),
752
+ _: 1
753
+ }, 8, ["modelValue", "rules"]),
754
+ o(U, {
755
+ modelValue: f.value.jcbPlatinum,
756
+ "onUpdate:modelValue": l[12] || (l[12] = (t) => f.value.jcbPlatinum = t),
757
+ label: "JCB Platinum",
758
+ "label-mark": "required",
759
+ type: "number",
760
+ inputmode: "numeric",
761
+ decimal: 2,
762
+ rules: e(p)(
763
+ e(b).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
764
+ )
765
+ }, {
766
+ append: x(() => [...l[58] || (l[58] = [
767
+ G("%", -1)
768
+ ])]),
769
+ _: 1
770
+ }, 8, ["modelValue", "rules"])
771
+ ]),
772
+ l[72] || (l[72] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-6" }, "Extra Settings", -1)),
773
+ a("div", xl, [
774
+ o(U, {
775
+ modelValue: O.value,
776
+ "onUpdate:modelValue": l[13] || (l[13] = (t) => O.value = t),
777
+ label: "Number of Devices",
778
+ "label-mark": "required",
779
+ type: "number",
780
+ inputmode: "numeric"
781
+ }, null, 8, ["modelValue"])
782
+ ]),
783
+ a("div", wl, [
784
+ o(pe, {
785
+ modelValue: C.value,
786
+ "onUpdate:modelValue": l[15] || (l[15] = (t) => C.value = t)
787
+ }, {
788
+ "dialog-button": x(() => [
789
+ o(L, {
790
+ class: "mr-6",
791
+ type: "button",
792
+ variant: "destructive",
793
+ "prepend-icon": "block",
794
+ loading: e(y),
795
+ label: "Reject Submission"
796
+ }, null, 8, ["loading"])
797
+ ]),
798
+ "dialog-header": x(() => [...l[59] || (l[59] = [
799
+ a("div", null, "Rejecting Submission", -1)
800
+ ])]),
801
+ default: x(() => [
802
+ o(W, {
803
+ modelValue: R.value,
804
+ "onUpdate:modelValue": l[14] || (l[14] = (t) => R.value = t),
805
+ label: "Reason for Rejection",
806
+ "label-mark": "optional",
807
+ "helper-text": "Please provide a reason for rejection."
808
+ }, null, 8, ["modelValue"]),
809
+ o(L, {
810
+ class: "mb-2 mt-6 w-full",
811
+ label: "Submit",
812
+ "prepend-icon": "save",
813
+ onClick: Ne,
814
+ loading: e(y)
815
+ }, null, 8, ["loading"])
816
+ ]),
817
+ _: 1
818
+ }, 8, ["modelValue"]),
819
+ o(L, {
820
+ type: "button",
821
+ variant: "primary",
822
+ "prepend-icon": "approval",
823
+ disabled: !j.value,
824
+ label: "Approve Submission with Rates",
825
+ onClick: ie,
826
+ loading: e(y)
827
+ }, null, 8, ["disabled", "loading"])
828
+ ]),
829
+ o(Ie, { disabled: !0 }, {
830
+ default: x(() => [
831
+ l[60] || (l[60] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
832
+ a("div", Nl, [
833
+ a("div", Sl, [
834
+ o(U, {
835
+ modelValue: e(s).picName,
836
+ "onUpdate:modelValue": l[16] || (l[16] = (t) => e(s).picName = t),
837
+ label: "Owner/Director Name",
838
+ placeholder: "Enter your name",
839
+ "label-mark": "required",
840
+ rules: e(p)(e(b).string().min(1, "Owner/Director Name is required"))
841
+ }, null, 8, ["modelValue", "rules"])
842
+ ]),
843
+ a("div", Pl, [
844
+ o(U, {
845
+ modelValue: e(s).picRole,
846
+ "onUpdate:modelValue": l[17] || (l[17] = (t) => e(s).picRole = t),
847
+ label: "Owner/Director Role",
848
+ placeholder: "Enter your role",
849
+ "label-mark": "required",
850
+ rules: e(p)(e(b).string().min(1, "Owner/Director Role is required"))
851
+ }, null, 8, ["modelValue", "rules"])
852
+ ]),
853
+ a("div", Il, [
854
+ o(U, {
855
+ modelValue: e(s).picEmail,
856
+ "onUpdate:modelValue": l[18] || (l[18] = (t) => e(s).picEmail = t),
857
+ label: "Owner/Director Email",
858
+ type: "email",
859
+ placeholder: "Enter your email address",
860
+ "label-mark": "required",
861
+ rules: e(p)(e(b).string().min(1, "Owner/Director Email is required"))
862
+ }, null, 8, ["modelValue", "rules"])
863
+ ]),
864
+ a("div", Rl, [
865
+ o(Pe, {
866
+ "model-value": e(s).picContact,
867
+ "onUpdate:modelValue": l[19] || (l[19] = (t) => e(s).picContact = t),
868
+ "default-country": "MY",
869
+ label: "Owner/Director Contact",
870
+ "label-mark": "required",
871
+ rules: e(p)(e(b).string().min(1, "Owner/Director Contact is required"))
872
+ }, null, 8, ["model-value", "rules"])
873
+ ]),
874
+ a("div", Ul, [
875
+ o(U, {
876
+ modelValue: e(s).nric,
877
+ "onUpdate:modelValue": l[20] || (l[20] = (t) => e(s).nric = t),
878
+ label: "Owner/Director NRIC No",
879
+ placeholder: "Enter your NRIC number",
880
+ "label-mark": "required",
881
+ rules: e(p)(e(b).string().min(1, "NRIC No is required"))
882
+ }, null, 8, ["modelValue", "rules"])
883
+ ]),
884
+ a("div", ql, [
885
+ o(U, {
886
+ modelValue: e(s).tradingName,
887
+ "onUpdate:modelValue": l[21] || (l[21] = (t) => e(s).tradingName = t),
888
+ label: "Trading Name",
889
+ placeholder: "Enter trading name",
890
+ "label-mark": "required",
891
+ rules: e(p)(e(b).string().min(1, "Trading Name is required"))
892
+ }, null, 8, ["modelValue", "rules"])
893
+ ]),
894
+ a("div", Fl, [
895
+ o(U, {
896
+ modelValue: e(s).outletName,
897
+ "onUpdate:modelValue": l[22] || (l[22] = (t) => e(s).outletName = t),
898
+ label: "Registered Name",
899
+ placeholder: "Enter registered name",
900
+ "label-mark": "required",
901
+ rules: e(p)(e(b).string().min(1, "Registered Name is required"))
902
+ }, null, 8, ["modelValue", "rules"])
903
+ ]),
904
+ a("div", Dl, [
905
+ o(U, {
906
+ modelValue: e(s).outletAddress,
907
+ "onUpdate:modelValue": l[23] || (l[23] = (t) => e(s).outletAddress = t),
908
+ label: "Outlet Address",
909
+ placeholder: "Enter outlet address",
910
+ "label-mark": "required",
911
+ rules: e(p)(e(b).string().min(1, "Address is required"))
912
+ }, null, 8, ["modelValue", "rules"])
913
+ ]),
914
+ o(U, {
915
+ modelValue: e(s).outletPostCode,
916
+ "onUpdate:modelValue": l[24] || (l[24] = (t) => e(s).outletPostCode = t),
917
+ label: "Postal Code",
918
+ placeholder: "Enter postal code",
919
+ "label-mark": "required",
920
+ rules: e(p)(e(b).string().min(1, "Postal Code is required"))
921
+ }, null, 8, ["modelValue", "rules"]),
922
+ o(U, {
923
+ modelValue: e(s).outletState,
924
+ "onUpdate:modelValue": l[25] || (l[25] = (t) => e(s).outletState = t),
925
+ label: "State",
926
+ placeholder: "Enter state",
927
+ "label-mark": "required",
928
+ rules: e(p)(e(b).string().min(1, "State is required"))
929
+ }, null, 8, ["modelValue", "rules"]),
930
+ o(U, {
931
+ modelValue: e(s).outletCity,
932
+ "onUpdate:modelValue": l[26] || (l[26] = (t) => e(s).outletCity = t),
933
+ label: "City",
934
+ placeholder: "Enter city",
935
+ "label-mark": "required",
936
+ rules: e(p)(e(b).string().min(1, "City is required"))
937
+ }, null, 8, ["modelValue", "rules"]),
938
+ a("div", Tl, [
939
+ o(be, {
940
+ modelValue: e(s).businessType,
941
+ "onUpdate:modelValue": l[27] || (l[27] = (t) => e(s).businessType = t),
942
+ label: "Type",
943
+ placeholder: "Select business type",
944
+ "label-mark": "required",
945
+ rules: e(p)(e(b).string().min(1, "Business Type is required")),
946
+ items: [
947
+ { label: "Sole Proprietorship", value: "sole_proprietorship" },
948
+ { label: "Partnership", value: "partnership" },
949
+ {
950
+ label: "Private Limited Company (Sdn Bhd)",
951
+ value: "private_limited"
952
+ },
953
+ {
954
+ label: "Public Limited Company (Berhad)",
955
+ value: "public_limited"
956
+ }
957
+ ]
958
+ }, null, 8, ["modelValue", "rules"])
959
+ ]),
960
+ a("div", El, [
961
+ o(U, {
962
+ modelValue: e(s).businessRegNo,
963
+ "onUpdate:modelValue": l[28] || (l[28] = (t) => e(s).businessRegNo = t),
964
+ label: "Registration No",
965
+ placeholder: "Enter registration number",
966
+ "label-mark": "required",
967
+ rules: e(p)(e(b).string().min(1, "Reg No is required"))
968
+ }, null, 8, ["modelValue", "rules"])
969
+ ]),
970
+ a("div", $l, [
971
+ o(U, {
972
+ modelValue: e(s).tinNo,
973
+ "onUpdate:modelValue": l[29] || (l[29] = (t) => e(s).tinNo = t),
974
+ label: "Tax Identification No (TIN)",
975
+ placeholder: "Enter your TIN number",
976
+ "label-mark": "required",
977
+ rules: e(p)(e(b).string().min(1, "TIN is required"))
978
+ }, null, 8, ["modelValue", "rules"])
979
+ ]),
980
+ a("div", Al, [
981
+ o(U, {
982
+ modelValue: e(s).sstNo,
983
+ "onUpdate:modelValue": l[30] || (l[30] = (t) => e(s).sstNo = t),
984
+ label: "SST Registration No (SST)",
985
+ placeholder: "Enter your SST number",
986
+ "label-mark": "optional"
987
+ }, null, 8, ["modelValue"])
988
+ ])
989
+ ]),
990
+ l[61] || (l[61] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
991
+ a("div", Ll, [
992
+ o(be, {
993
+ modelValue: e(s).bankName,
994
+ "onUpdate:modelValue": l[31] || (l[31] = (t) => e(s).bankName = t),
995
+ label: "Bank",
996
+ placeholder: "Select bank type",
997
+ "label-mark": "required",
998
+ rules: e(p)(e(b).string().min(1, "Bank Type is required")),
999
+ items: e(Te).bankNameOptions()
1000
+ }, null, 8, ["modelValue", "rules", "items"]),
1001
+ o(U, {
1002
+ modelValue: e(s).bankHolderName,
1003
+ "onUpdate:modelValue": l[32] || (l[32] = (t) => e(s).bankHolderName = t),
1004
+ label: "Beneficiary Name",
1005
+ placeholder: "Enter Beneficiary Name",
1006
+ "label-mark": "required",
1007
+ rules: e(p)(e(b).string().min(1, "Beneficiary Name is required"))
1008
+ }, null, 8, ["modelValue", "rules"]),
1009
+ o(U, {
1010
+ modelValue: e(s).bankAccountNo,
1011
+ "onUpdate:modelValue": l[33] || (l[33] = (t) => e(s).bankAccountNo = t),
1012
+ label: "Account Number",
1013
+ placeholder: "Enter Account Number",
1014
+ "label-mark": "required",
1015
+ rules: e(p)(e(b).string().min(1, "Account Number is required"))
1016
+ }, null, 8, ["modelValue", "rules"])
1017
+ ]),
1018
+ l[62] || (l[62] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
1019
+ l[63] || (l[63] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 1. All Directors/Owner ICs ", -1)),
1020
+ a("div", Bl, [
1021
+ o(D, {
1022
+ label: "Authorized Person ID",
1023
+ modelValue: e(i).authorizedPersonID,
1024
+ "onUpdate:modelValue": l[34] || (l[34] = (t) => e(i).authorizedPersonID = t),
1025
+ type: "image",
1026
+ "restaurant-id": d.submission.restaurantId
1027
+ }, null, 8, ["modelValue", "restaurant-id"]),
1028
+ (u(!0), k(_, null, Q(Z.value, (t) => (u(), A(D, {
1029
+ key: t,
1030
+ label: `Authorized Person ID ${t.replace("authorizedPersonID", "")}`,
1031
+ modelValue: e(i)[t],
1032
+ "onUpdate:modelValue": (Y) => e(i)[t] = Y,
1033
+ type: "image",
1034
+ "restaurant-id": d.submission.restaurantId
1035
+ }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128))
1036
+ ]),
1037
+ l[64] || (l[64] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-6" }, " Section 2. Business Information ", -1)),
1038
+ a("div", Ol, [
1039
+ e(s).businessType === "private_limited" || e(s).businessType === "public_limited" ? (u(), A(D, {
1040
+ key: 0,
1041
+ label: "Superform",
1042
+ type: "pdf",
1043
+ modelValue: e(i).certificate,
1044
+ "onUpdate:modelValue": l[35] || (l[35] = (t) => e(i).certificate = t),
1045
+ "restaurant-id": d.submission.restaurantId
1046
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0),
1047
+ e(s).businessType === "sole_proprietorship" || e(s).businessType === "partnership" ? (u(), A(D, {
1048
+ key: 1,
1049
+ label: "Business Registration Document",
1050
+ type: "pdf",
1051
+ modelValue: e(i).certificate,
1052
+ "onUpdate:modelValue": l[36] || (l[36] = (t) => e(i).certificate = t),
1053
+ "restaurant-id": d.submission.restaurantId
1054
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0),
1055
+ e(i).interiorPhoto ? (u(), A(D, {
1056
+ key: 2,
1057
+ label: "Interior Photo",
1058
+ modelValue: e(i).interiorPhoto,
1059
+ "onUpdate:modelValue": l[37] || (l[37] = (t) => e(i).interiorPhoto = t),
1060
+ type: "image",
1061
+ "restaurant-id": d.submission.restaurantId
1062
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0),
1063
+ o(D, {
1064
+ label: "Outlet Photo",
1065
+ modelValue: e(i).outletPhoto,
1066
+ "onUpdate:modelValue": l[38] || (l[38] = (t) => e(i).outletPhoto = t),
1067
+ type: "image-or-pdf",
1068
+ "restaurant-id": d.submission.restaurantId
1069
+ }, null, 8, ["modelValue", "restaurant-id"])
1070
+ ]),
1071
+ l[65] || (l[65] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 3. Payout Information ", -1)),
1072
+ a("div", jl, [
1073
+ o(D, {
1074
+ label: "Latest Bank Statement",
1075
+ modelValue: e(i).bankStatement,
1076
+ "onUpdate:modelValue": l[39] || (l[39] = (t) => e(i).bankStatement = t),
1077
+ type: "pdf",
1078
+ "restaurant-id": d.submission.restaurantId
1079
+ }, null, 8, ["modelValue", "restaurant-id"])
1080
+ ]),
1081
+ l[66] || (l[66] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 4. Site Photos ", -1)),
1082
+ a("div", hl, [
1083
+ (u(!0), k(_, null, Q([1, 2, 3, 4, 5].filter(
1084
+ (t) => !!e(i)[`onsitePhoto${t}`]
1085
+ ), (t) => (u(), A(D, {
1086
+ key: t,
1087
+ label: e(Ee)[t - 1],
1088
+ modelValue: e(i)[`onsitePhoto${t}`],
1089
+ "onUpdate:modelValue": (Y) => e(i)[`onsitePhoto${t}`] = Y,
1090
+ type: "image",
1091
+ "restaurant-id": d.submission.restaurantId
1092
+ }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128))
1093
+ ]),
1094
+ l[67] || (l[67] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 5. Additional Documents ", -1)),
1095
+ a("div", _l, [
1096
+ e(i).liquorLicense ? (u(), A(D, {
1097
+ key: 0,
1098
+ label: "Liquor License",
1099
+ modelValue: e(i).liquorLicense,
1100
+ "onUpdate:modelValue": l[40] || (l[40] = (t) => e(i).liquorLicense = t),
1101
+ type: "image-or-pdf",
1102
+ "restaurant-id": d.submission.restaurantId
1103
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0),
1104
+ e(i).appendixC ? (u(), A(D, {
1105
+ key: 1,
1106
+ label: "Appendix C",
1107
+ modelValue: e(i).appendixC,
1108
+ "onUpdate:modelValue": l[41] || (l[41] = (t) => e(i).appendixC = t),
1109
+ type: "pdf",
1110
+ "restaurant-id": d.submission.restaurantId
1111
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0),
1112
+ !e(i).liquorLicense && !e(i).appendixC ? (u(), k("p", Ml, " No additional documents submitted. ")) : T("", !0)
1113
+ ]),
1114
+ l[68] || (l[68] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
1115
+ a("div", zl, [
1116
+ o(je, {
1117
+ modelValue: e(i).signature,
1118
+ "onUpdate:modelValue": l[42] || (l[42] = (t) => e(i).signature = t),
1119
+ "restaurant-id": d.submission.restaurantId,
1120
+ label: "Signature"
1121
+ }, null, 8, ["modelValue", "restaurant-id"]),
1122
+ o(D, {
1123
+ label: "Company Stamp",
1124
+ type: "image",
1125
+ modelValue: e(i).companyStamp,
1126
+ "onUpdate:modelValue": l[43] || (l[43] = (t) => e(i).companyStamp = t),
1127
+ "restaurant-id": d.submission.restaurantId
1128
+ }, null, 8, ["modelValue", "restaurant-id"])
1129
+ ])
1130
+ ]),
1131
+ _: 1
1132
+ })
1133
+ ], 64);
1134
+ };
1135
+ }
1136
+ }), Wl = { class: "space-y-2" }, Yl = { class: "text-gray-900" }, Gl = { class: "text-gray-900" }, Jl = { class: "text-gray-900" }, Kl = { class: "text-gray-900" }, Ql = { class: "text-gray-900" }, Xl = { class: "text-gray-900" }, Zl = { class: "mt-6 grid grid-cols-4 gap-24" }, et = { class: "w-full flex justify-end mt-6" }, lt = { class: "mt-6 grid grid-cols-4 gap-24" }, tt = { class: "col-span-2" }, at = { class: "col-span-2" }, st = { class: "col-span-2" }, nt = { class: "col-span-2" }, ot = { class: "mt-6 grid grid-cols-4 gap-24" }, rt = { class: "mt-6 grid grid-cols-4 gap-24" }, it = { class: "mt-6 grid grid-cols-4 gap-24" }, ut = { class: "col-span-2" }, dt = { class: "col-span-2" }, mt = { class: "col-span-2" }, pt = { class: "col-span-2" }, bt = { class: "col-span-2" }, ct = { class: "col-span-2" }, gt = /* @__PURE__ */ X({
1137
+ __name: "NTTSubmission",
1138
+ props: {
1139
+ submission: {
1140
+ type: Object,
1141
+ required: !0
1142
+ }
1143
+ },
1144
+ emits: ["update:submission"],
1145
+ setup(d, { emit: w }) {
1146
+ const m = d, v = w, c = de(), C = B(!1), { isLoading: y, startAsyncCall: E } = ne(), { fields: s, documents: i, restaurantId: q, profile: g, status: I, statusReason: $ } = m.submission, R = B(""), O = [
1147
+ { key: "localCardDebit", label: "Local Card (Debit)", defaultValue: "2.3" },
1148
+ {
1149
+ key: "localCardStandard",
1150
+ label: "Local Card (Standard)",
1151
+ defaultValue: "2.3"
1152
+ },
1153
+ {
1154
+ key: "localCardPremium",
1155
+ label: "Local Card (Premium)",
1156
+ defaultValue: "2.3"
1157
+ },
1158
+ {
1159
+ key: "localCardSuperPremium",
1160
+ label: "Local Card (Super Premium)",
1161
+ defaultValue: "2.3"
1162
+ },
1163
+ {
1164
+ key: "internationalCard",
1165
+ label: "International Card",
1166
+ defaultValue: "3.1"
1167
+ },
1168
+ { key: "upiCard", label: "UPI Card", defaultValue: "3" },
1169
+ { key: "jcbCard", label: "JCB Card", defaultValue: "3" },
1170
+ { key: "dciCard", label: "DCI Card", defaultValue: "3" },
1171
+ { key: "amexCard", label: "Amex Card", defaultValue: "3" },
1172
+ { key: "alipay", label: "Alipay", defaultValue: "2.3" },
1173
+ { key: "alipayPlus", label: "Alipay+", defaultValue: "2.3" },
1174
+ { key: "trueMoney", label: "TrueMoney", defaultValue: "2.3" },
1175
+ { key: "shopeePay", label: "ShopeePay", defaultValue: "2.3" },
1176
+ { key: "linePay", label: "LinePay", defaultValue: "2.1" },
1177
+ { key: "thaiQr", label: "ThaiQR", defaultValue: "0.5" }
1178
+ ], f = Object.fromEntries(
1179
+ O.map((S) => [S.key, S.defaultValue])
1180
+ ), j = B(
1181
+ m.submission.rates ? Object.fromEntries(
1182
+ Object.entries(m.submission.rates).map(([S, n]) => [S, `${n}`])
1183
+ ) : { ...f }
1184
+ ), Z = h(
1185
+ () => Object.values(j.value).every((S) => parseFloat(S) > 0)
1186
+ ), ee = h(() => s.businessType === "juristic" ? "Juristic" : s.businessType === "individual" ? "Individual" : s.businessType || "-"), le = () => E(async () => {
1187
+ try {
1188
+ const S = await M.reviewById(
1189
+ m.submission._id,
1190
+ {
1191
+ status: ke.FdoOnboardStatus.enum.ready
1192
+ }
1193
+ );
1194
+ v("update:submission", S), c.open({
1195
+ type: "success",
1196
+ title: "Submission marked as ready"
1197
+ });
1198
+ } catch (S) {
1199
+ c.open({
1200
+ type: "error",
1201
+ title: "Error occurs when marking submission as ready",
1202
+ message: J(S)
1203
+ });
1204
+ }
1205
+ }), z = () => E(async () => {
1206
+ try {
1207
+ const S = await M.reviewById(
1208
+ m.submission._id,
1209
+ {
1210
+ rates: Object.fromEntries(
1211
+ O.map((n) => [
1212
+ n.key,
1213
+ parseFloat(j.value[n.key])
1214
+ ])
1215
+ ),
1216
+ status: "approved"
1217
+ }
1218
+ );
1219
+ v("update:submission", S), c.open({
1220
+ type: "success",
1221
+ title: "Submission updated successfully"
1222
+ });
1223
+ } catch (S) {
1224
+ c.open({
1225
+ type: "error",
1226
+ title: "Error occurs when updating submission",
1227
+ message: J(S)
1228
+ });
1229
+ }
1230
+ }), ae = () => E(async () => {
1231
+ try {
1232
+ const S = await M.reviewById(
1233
+ m.submission._id,
1234
+ {
1235
+ status: "rejected",
1236
+ statusReason: R.value
1237
+ }
1238
+ );
1239
+ v("update:submission", S), C.value = !1, c.open({
1240
+ type: "success",
1241
+ title: "Submission updated successfully"
1242
+ });
1243
+ } catch (S) {
1244
+ c.open({
1245
+ type: "error",
1246
+ title: "Error occurs when updating submission",
1247
+ message: J(S)
1248
+ });
1249
+ }
1250
+ });
1251
+ return (S, n) => {
1252
+ const F = P("FmTextField"), te = P("FmButton"), ie = P("FmTextarea"), K = P("FmDialog"), ue = P("FmPhoneNumber"), se = P("FmForm");
1253
+ return u(), k(_, null, [
1254
+ a("div", Wl, [
1255
+ a("div", null, [
1256
+ n[31] || (n[31] = a("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
1257
+ a("span", Yl, N(e(q)), 1)
1258
+ ]),
1259
+ a("div", null, [
1260
+ n[32] || (n[32] = a("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
1261
+ a("span", Gl, N(e(g).name) + " ( " + N(e(g).legalName) + " )", 1)
1262
+ ]),
1263
+ a("div", null, [
1264
+ n[33] || (n[33] = a("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
1265
+ a("span", Jl, N(e(g).email), 1)
1266
+ ]),
1267
+ a("div", null, [
1268
+ n[34] || (n[34] = a("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
1269
+ a("span", Kl, N(e(g).phoneNo), 1)
1270
+ ]),
1271
+ a("div", null, [
1272
+ n[35] || (n[35] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
1273
+ a("span", Ql, [
1274
+ o(xe, { data: e(I) }, null, 8, ["data"])
1275
+ ])
1276
+ ]),
1277
+ a("div", null, [
1278
+ n[36] || (n[36] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
1279
+ a("span", Xl, N(e($)), 1)
1280
+ ])
1281
+ ]),
1282
+ n[43] || (n[43] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
1283
+ a("div", Zl, [
1284
+ (u(), k(_, null, Q(O, (r) => o(F, {
1285
+ key: r.key,
1286
+ modelValue: j.value[r.key],
1287
+ "onUpdate:modelValue": (H) => j.value[r.key] = H,
1288
+ label: r.label,
1289
+ "label-mark": "required",
1290
+ type: "number",
1291
+ inputmode: "numeric",
1292
+ decimal: 2,
1293
+ rules: e(p)(
1294
+ e(b).string().min(1, "Rate is required").transform((H) => parseFloat(H)).refine((H) => !isNaN(H), { message: "Rate must be a number" })
1295
+ )
1296
+ }, {
1297
+ append: x(() => [...n[37] || (n[37] = [
1298
+ G("%", -1)
1299
+ ])]),
1300
+ _: 1
1301
+ }, 8, ["modelValue", "onUpdate:modelValue", "label", "rules"])), 64))
1302
+ ]),
1303
+ a("div", et, [
1304
+ o(K, {
1305
+ modelValue: C.value,
1306
+ "onUpdate:modelValue": n[1] || (n[1] = (r) => C.value = r)
1307
+ }, {
1308
+ "dialog-button": x(() => [
1309
+ o(te, {
1310
+ class: "mr-6",
1311
+ type: "button",
1312
+ variant: "destructive",
1313
+ "prepend-icon": "block",
1314
+ loading: e(y),
1315
+ label: "Reject Submission"
1316
+ }, null, 8, ["loading"])
1317
+ ]),
1318
+ "dialog-header": x(() => [...n[38] || (n[38] = [
1319
+ a("div", null, "Rejecting Submission", -1)
1320
+ ])]),
1321
+ default: x(() => [
1322
+ o(ie, {
1323
+ modelValue: R.value,
1324
+ "onUpdate:modelValue": n[0] || (n[0] = (r) => R.value = r),
1325
+ label: "Reason for Rejection",
1326
+ "label-mark": "optional",
1327
+ "helper-text": "Please provide a reason for rejection."
1328
+ }, null, 8, ["modelValue"]),
1329
+ o(te, {
1330
+ class: "mb-2 mt-6 w-full",
1331
+ label: "Submit",
1332
+ "prepend-icon": "save",
1333
+ onClick: ae,
1334
+ loading: e(y)
1335
+ }, null, 8, ["loading"])
1336
+ ]),
1337
+ _: 1
1338
+ }, 8, ["modelValue"]),
1339
+ o(te, {
1340
+ type: "button",
1341
+ variant: "primary",
1342
+ "prepend-icon": "approval",
1343
+ label: "Approve Submission with Rates",
1344
+ disabled: !Z.value,
1345
+ onClick: z,
1346
+ loading: e(y)
1347
+ }, null, 8, ["disabled", "loading"]),
1348
+ e(I) === "approved" ? (u(), A(te, {
1349
+ key: 0,
1350
+ type: "button",
1351
+ variant: "secondary",
1352
+ "prepend-icon": "check_circle",
1353
+ label: "Mark as Ready",
1354
+ class: "ml-6",
1355
+ onClick: le,
1356
+ loading: e(y)
1357
+ }, null, 8, ["loading"])) : T("", !0)
1358
+ ]),
1359
+ o(se, { disabled: !0 }, {
1360
+ default: x(() => [
1361
+ n[39] || (n[39] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
1362
+ a("div", lt, [
1363
+ a("div", tt, [
1364
+ o(F, {
1365
+ modelValue: e(s).companyName,
1366
+ "onUpdate:modelValue": n[2] || (n[2] = (r) => e(s).companyName = r),
1367
+ label: "Company Name",
1368
+ "label-mark": "required",
1369
+ rules: e(p)(e(b).string().min(1, "Company Name is required"))
1370
+ }, null, 8, ["modelValue", "rules"])
1371
+ ]),
1372
+ a("div", at, [
1373
+ o(F, {
1374
+ modelValue: e(s).outletName,
1375
+ "onUpdate:modelValue": n[3] || (n[3] = (r) => e(s).outletName = r),
1376
+ label: "Outlet Name (Thai)",
1377
+ "label-mark": "required",
1378
+ rules: e(p)(e(b).string().min(1, "Outlet Name is required"))
1379
+ }, null, 8, ["modelValue", "rules"])
1380
+ ]),
1381
+ a("div", st, [
1382
+ o(F, {
1383
+ modelValue: e(s).outletNameEnglish,
1384
+ "onUpdate:modelValue": n[4] || (n[4] = (r) => e(s).outletNameEnglish = r),
1385
+ label: "Outlet Name (English)",
1386
+ "label-mark": "required",
1387
+ rules: e(p)(e(b).string().min(1, "Outlet Name English is required"))
1388
+ }, null, 8, ["modelValue", "rules"])
1389
+ ]),
1390
+ a("div", nt, [
1391
+ o(F, {
1392
+ modelValue: e(s).outletAddress,
1393
+ "onUpdate:modelValue": n[5] || (n[5] = (r) => e(s).outletAddress = r),
1394
+ label: "Outlet Address",
1395
+ "label-mark": "required",
1396
+ rules: e(p)(e(b).string().min(1, "Outlet Address is required"))
1397
+ }, null, 8, ["modelValue", "rules"])
1398
+ ]),
1399
+ o(F, {
1400
+ modelValue: e(s).outletPostCode,
1401
+ "onUpdate:modelValue": n[6] || (n[6] = (r) => e(s).outletPostCode = r),
1402
+ label: "Post Code",
1403
+ "label-mark": "required",
1404
+ rules: e(p)(e(b).string().min(1, "Post Code is required"))
1405
+ }, null, 8, ["modelValue", "rules"]),
1406
+ o(F, {
1407
+ modelValue: e(s).outletState,
1408
+ "onUpdate:modelValue": n[7] || (n[7] = (r) => e(s).outletState = r),
1409
+ label: "State",
1410
+ "label-mark": "required",
1411
+ rules: e(p)(e(b).string().min(1, "State is required"))
1412
+ }, null, 8, ["modelValue", "rules"]),
1413
+ o(F, {
1414
+ modelValue: e(s).outletCity,
1415
+ "onUpdate:modelValue": n[8] || (n[8] = (r) => e(s).outletCity = r),
1416
+ label: "City",
1417
+ "label-mark": "required",
1418
+ rules: e(p)(e(b).string().min(1, "City is required"))
1419
+ }, null, 8, ["modelValue", "rules"]),
1420
+ o(F, {
1421
+ "model-value": ee.value,
1422
+ label: "Business Type",
1423
+ "label-mark": "required"
1424
+ }, null, 8, ["model-value"]),
1425
+ o(F, {
1426
+ modelValue: e(s).numberOfDevices,
1427
+ "onUpdate:modelValue": n[9] || (n[9] = (r) => e(s).numberOfDevices = r),
1428
+ label: "Number of Devices",
1429
+ "label-mark": "required"
1430
+ }, null, 8, ["modelValue"])
1431
+ ]),
1432
+ n[40] || (n[40] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
1433
+ a("div", ot, [
1434
+ o(F, {
1435
+ modelValue: e(s).bankName,
1436
+ "onUpdate:modelValue": n[10] || (n[10] = (r) => e(s).bankName = r),
1437
+ label: "Bank Name",
1438
+ "label-mark": "required",
1439
+ rules: e(p)(e(b).string().min(1, "Bank Name is required"))
1440
+ }, null, 8, ["modelValue", "rules"]),
1441
+ o(F, {
1442
+ modelValue: e(s).bankHolderName,
1443
+ "onUpdate:modelValue": n[11] || (n[11] = (r) => e(s).bankHolderName = r),
1444
+ label: "Bank Holder Name",
1445
+ "label-mark": "required",
1446
+ rules: e(p)(e(b).string().min(1, "Bank Holder Name is required"))
1447
+ }, null, 8, ["modelValue", "rules"]),
1448
+ o(F, {
1449
+ modelValue: e(s).bankAccountNo,
1450
+ "onUpdate:modelValue": n[12] || (n[12] = (r) => e(s).bankAccountNo = r),
1451
+ label: "Bank Account No",
1452
+ "label-mark": "required",
1453
+ rules: e(p)(e(b).string().min(1, "Bank Account No is required"))
1454
+ }, null, 8, ["modelValue", "rules"]),
1455
+ o(F, {
1456
+ modelValue: e(s).bankBranch,
1457
+ "onUpdate:modelValue": n[13] || (n[13] = (r) => e(s).bankBranch = r),
1458
+ label: "Bank Branch",
1459
+ "label-mark": "required",
1460
+ rules: e(p)(e(b).string().min(1, "Bank Branch is required"))
1461
+ }, null, 8, ["modelValue", "rules"]),
1462
+ o(F, {
1463
+ modelValue: e(s).bankBranchCode,
1464
+ "onUpdate:modelValue": n[14] || (n[14] = (r) => e(s).bankBranchCode = r),
1465
+ label: "Bank Branch Code",
1466
+ "label-mark": "required",
1467
+ rules: e(p)(e(b).string().min(1, "Bank Branch Code is required"))
1468
+ }, null, 8, ["modelValue", "rules"])
1469
+ ]),
1470
+ n[41] || (n[41] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
1471
+ a("div", rt, [
1472
+ o(D, {
1473
+ label: "Authorized Person ID",
1474
+ modelValue: e(i).authorizedPersonID,
1475
+ "onUpdate:modelValue": n[15] || (n[15] = (r) => e(i).authorizedPersonID = r),
1476
+ type: "image",
1477
+ "restaurant-id": d.submission.restaurantId
1478
+ }, null, 8, ["modelValue", "restaurant-id"]),
1479
+ o(D, {
1480
+ label: "Outlet Photo",
1481
+ modelValue: e(i).outletPhoto,
1482
+ "onUpdate:modelValue": n[16] || (n[16] = (r) => e(i).outletPhoto = r),
1483
+ type: "image",
1484
+ "restaurant-id": d.submission.restaurantId
1485
+ }, null, 8, ["modelValue", "restaurant-id"]),
1486
+ o(D, {
1487
+ label: "Interior Photo",
1488
+ modelValue: e(i).interiorPhoto,
1489
+ "onUpdate:modelValue": n[17] || (n[17] = (r) => e(i).interiorPhoto = r),
1490
+ type: "image",
1491
+ "restaurant-id": d.submission.restaurantId
1492
+ }, null, 8, ["modelValue", "restaurant-id"]),
1493
+ o(D, {
1494
+ label: "Bank Statement",
1495
+ modelValue: e(i).bankStatement,
1496
+ "onUpdate:modelValue": n[18] || (n[18] = (r) => e(i).bankStatement = r),
1497
+ type: "pdf",
1498
+ "restaurant-id": d.submission.restaurantId
1499
+ }, null, 8, ["modelValue", "restaurant-id"]),
1500
+ e(s).businessType === "juristic" ? (u(), A(D, {
1501
+ key: 0,
1502
+ label: "Company Certificate",
1503
+ type: "pdf",
1504
+ modelValue: e(i).companyCertificate,
1505
+ "onUpdate:modelValue": n[19] || (n[19] = (r) => e(i).companyCertificate = r),
1506
+ "restaurant-id": d.submission.restaurantId
1507
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0),
1508
+ e(s).businessType === "juristic" ? (u(), A(D, {
1509
+ key: 1,
1510
+ label: "VAT Certificate",
1511
+ type: "pdf",
1512
+ modelValue: e(i).vatCertificate,
1513
+ "onUpdate:modelValue": n[20] || (n[20] = (r) => e(i).vatCertificate = r),
1514
+ "restaurant-id": d.submission.restaurantId
1515
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0),
1516
+ e(s).businessType === "individual" ? (u(), A(D, {
1517
+ key: 2,
1518
+ label: "Commercial Certificate",
1519
+ type: "pdf",
1520
+ modelValue: e(i).commercialCertificate,
1521
+ "onUpdate:modelValue": n[21] || (n[21] = (r) => e(i).commercialCertificate = r),
1522
+ "restaurant-id": d.submission.restaurantId
1523
+ }, null, 8, ["modelValue", "restaurant-id"])) : T("", !0)
1524
+ ]),
1525
+ n[42] || (n[42] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
1526
+ a("div", it, [
1527
+ a("div", ut, [
1528
+ o(F, {
1529
+ modelValue: e(s).picName,
1530
+ "onUpdate:modelValue": n[22] || (n[22] = (r) => e(s).picName = r),
1531
+ label: "PIC Name",
1532
+ "label-mark": "required",
1533
+ rules: e(p)(e(b).string().min(1, "PIC Name is required"))
1534
+ }, null, 8, ["modelValue", "rules"])
1535
+ ]),
1536
+ a("div", dt, [
1537
+ o(F, {
1538
+ modelValue: e(s).picRole,
1539
+ "onUpdate:modelValue": n[23] || (n[23] = (r) => e(s).picRole = r),
1540
+ label: "PIC Role",
1541
+ "label-mark": "required",
1542
+ rules: e(p)(e(b).string().min(1, "PIC Role is required"))
1543
+ }, null, 8, ["modelValue", "rules"])
1544
+ ]),
1545
+ a("div", mt, [
1546
+ o(F, {
1547
+ modelValue: e(s).picEmail,
1548
+ "onUpdate:modelValue": n[24] || (n[24] = (r) => e(s).picEmail = r),
1549
+ label: "PIC Email",
1550
+ "label-mark": "required",
1551
+ rules: e(p)(e(b).string().min(1, "PIC Email is required"))
1552
+ }, null, 8, ["modelValue", "rules"])
1553
+ ]),
1554
+ a("div", pt, [
1555
+ o(ue, {
1556
+ "model-value": e(s).picContact,
1557
+ "onUpdate:modelValue": n[25] || (n[25] = (r) => e(s).picContact = r),
1558
+ "default-country": "TH",
1559
+ label: "PIC Contact",
1560
+ "label-mark": "required",
1561
+ rules: e(p)(e(b).string().min(1, "PIC Contact is required"))
1562
+ }, null, 8, ["model-value", "rules"])
1563
+ ]),
1564
+ a("div", bt, [
1565
+ o(F, {
1566
+ modelValue: e(s).witnessName,
1567
+ "onUpdate:modelValue": n[26] || (n[26] = (r) => e(s).witnessName = r),
1568
+ label: "Witness Name",
1569
+ "label-mark": "required",
1570
+ rules: e(p)(e(b).string().min(1, "Witness Name is required"))
1571
+ }, null, 8, ["modelValue", "rules"])
1572
+ ]),
1573
+ a("div", ct, [
1574
+ o(F, {
1575
+ modelValue: e(s).witnessRole,
1576
+ "onUpdate:modelValue": n[27] || (n[27] = (r) => e(s).witnessRole = r),
1577
+ label: "Witness Role",
1578
+ "label-mark": "required",
1579
+ rules: e(p)(e(b).string().min(1, "Witness Role is required"))
1580
+ }, null, 8, ["modelValue", "rules"])
1581
+ ]),
1582
+ o(D, {
1583
+ label: "Signature",
1584
+ type: "image",
1585
+ modelValue: e(i).signature,
1586
+ "onUpdate:modelValue": n[28] || (n[28] = (r) => e(i).signature = r),
1587
+ "restaurant-id": d.submission.restaurantId
1588
+ }, null, 8, ["modelValue", "restaurant-id"]),
1589
+ o(D, {
1590
+ label: "Witness Signature",
1591
+ type: "image",
1592
+ modelValue: e(i).witnessSignature,
1593
+ "onUpdate:modelValue": n[29] || (n[29] = (r) => e(i).witnessSignature = r),
1594
+ "restaurant-id": d.submission.restaurantId
1595
+ }, null, 8, ["modelValue", "restaurant-id"]),
1596
+ o(D, {
1597
+ label: "Company Stamp",
1598
+ type: "image",
1599
+ modelValue: e(i).companyStamp,
1600
+ "onUpdate:modelValue": n[30] || (n[30] = (r) => e(i).companyStamp = r),
1601
+ "restaurant-id": d.submission.restaurantId
1602
+ }, null, 8, ["modelValue", "restaurant-id"])
1603
+ ])
1604
+ ]),
1605
+ _: 1
1606
+ })
1607
+ ], 64);
1608
+ };
1609
+ }
1610
+ }), yt = /* @__PURE__ */ X({
1611
+ __name: "TyroSubmission",
1612
+ props: {
1613
+ submission: {
1614
+ type: Object,
1615
+ required: !0
1616
+ }
1617
+ },
1618
+ emits: ["update:submission"],
1619
+ setup(d) {
1620
+ const w = d, m = h(() => {
1621
+ const v = w.submission.fields || {}, c = (C) => v[C] || "N/A";
1622
+ return [
1623
+ {
1624
+ label: "Tyro POS Reference ID",
1625
+ value: c("tyroPosReference")
1626
+ },
1627
+ {
1628
+ label: "Tyro Merchant ID",
1629
+ value: c("tyroMerchantId")
1630
+ },
1631
+ {
1632
+ label: "Tyro Merchant Name",
1633
+ value: c("tyroMerchantDisplayName")
1634
+ },
1635
+ {
1636
+ label: "Authorised",
1637
+ value: c("tyroIsAuthorised")
1638
+ }
1639
+ ];
1640
+ });
1641
+ return (v, c) => {
1642
+ const C = P("FmCardHeader"), y = P("FmCardSection"), E = P("FmCard");
1643
+ return u(), A(E, {
1644
+ class: "max-w-3xl mt-8 p-6",
1645
+ variant: "elevated"
1646
+ }, {
1647
+ default: x(() => [
1648
+ o(y, { class: "flex flex-col gap-16 justify-between" }, {
1649
+ default: x(() => [
1650
+ o(C, {
1651
+ class: "p-0",
1652
+ title: "Tyro Authorisation",
1653
+ subtitle: ""
1654
+ }),
1655
+ o(y, { class: "p-0" }, {
1656
+ default: x(() => [
1657
+ (u(!0), k(_, null, Q(m.value, (s) => (u(), k("p", {
1658
+ key: s.label,
1659
+ class: "text-sm text-gray-900 break-all mb-4 last:mb-0"
1660
+ }, [
1661
+ a("b", null, N(s.label), 1),
1662
+ G(": " + N(s.value), 1)
1663
+ ]))), 128))
1664
+ ]),
1665
+ _: 1
1666
+ })
1667
+ ]),
1668
+ _: 1
1669
+ })
1670
+ ]),
1671
+ _: 1
1672
+ });
1673
+ };
1674
+ }
1675
+ }), vt = {
1676
+ key: 0,
1677
+ class: "flex items-center justify-center min-h-[80vh]"
1678
+ }, ft = { class: "px-32 pb-32" }, Dt = /* @__PURE__ */ X({
1679
+ __name: "OnboardForm",
1680
+ props: {
1681
+ submissionId: {
1682
+ type: String,
1683
+ required: !0
1684
+ }
1685
+ },
1686
+ setup(d) {
1687
+ const { startAsyncCall: w, isLoading: m } = ne(), v = de(), c = d, C = Fe(), y = B(null), E = h(
1688
+ () => {
1689
+ var $;
1690
+ return (($ = y.value) == null ? void 0 : $.type) === ke.FdoOnboardType.enum.tyro;
1691
+ }
1692
+ ), s = () => {
1693
+ if (window.history.length > 1) {
1694
+ C.back();
1695
+ return;
1696
+ }
1697
+ C.push({ name: "mf-payment-admin.onboard-submission" });
1698
+ };
1699
+ fe(() => {
1700
+ w(async () => {
1701
+ y.value = await M.readById(c.submissionId);
1702
+ });
1703
+ });
1704
+ const i = h(() => {
1705
+ if (!y.value) return null;
1706
+ switch (y.value.type) {
1707
+ case "softspace":
1708
+ return Hl;
1709
+ case "ntt":
1710
+ return gt;
1711
+ case "tyro":
1712
+ return yt;
1713
+ default:
1714
+ return null;
1715
+ }
1716
+ }), q = B(0);
1717
+ function g($) {
1718
+ y.value = $, q.value = Date.now();
1719
+ }
1720
+ const I = async ($) => {
1721
+ var R, O;
1722
+ if (y.value)
1723
+ switch ($) {
1724
+ case "preview":
1725
+ let f;
1726
+ try {
1727
+ f = v.open({
1728
+ message: "Generating preview document...",
1729
+ type: "info"
1730
+ }), await M.previewDocument((R = y.value) == null ? void 0 : R._id);
1731
+ } catch (j) {
1732
+ v.open({
1733
+ type: "error",
1734
+ title: "Error occurs when generating submission document",
1735
+ message: J(j)
1736
+ });
1737
+ } finally {
1738
+ f && v.close(f);
1739
+ }
1740
+ break;
1741
+ case "send":
1742
+ try {
1743
+ v.open({
1744
+ message: "Sending onboarding document...",
1745
+ type: "info"
1746
+ }), await M.sendDocument((O = y.value) == null ? void 0 : O._id), v.open({
1747
+ type: "success",
1748
+ title: "Submission documents send successfully"
1749
+ });
1750
+ } catch (j) {
1751
+ v.open({
1752
+ type: "error",
1753
+ title: "Error occurs when sending document",
1754
+ message: J(j)
1755
+ });
1756
+ }
1757
+ break;
1758
+ }
1759
+ };
1760
+ return ($, R) => {
1761
+ var j, Z, ee, le;
1762
+ const O = P("FmCircularProgress"), f = P("FmPageHead");
1763
+ return e(m) ? (u(), k("div", vt, [
1764
+ o(O, { size: "xxl" })
1765
+ ])) : (u(), k(_, { key: 1 }, [
1766
+ o(f, {
1767
+ title: `Submission - ${(j = y.value) == null ? void 0 : j.type}`,
1768
+ description: `ID - ${(Z = y.value) == null ? void 0 : Z._id}`,
1769
+ "back-button": !0,
1770
+ "onClick:back": s,
1771
+ "onClick:action": I,
1772
+ actions: E.value ? [] : [
1773
+ {
1774
+ label: "Preview Document",
1775
+ value: "preview",
1776
+ prependIcon: "preview"
1777
+ },
1778
+ {
1779
+ label: "Send for Review",
1780
+ value: "send",
1781
+ isPrimary: !0,
1782
+ prependIcon: "send"
1783
+ }
1784
+ ]
1785
+ }, null, 8, ["title", "description", "actions"]),
1786
+ a("div", ft, [
1787
+ (u(), A(qe(i.value), {
1788
+ key: q.value,
1789
+ submission: y.value,
1790
+ "onUpdate:submission": g
1791
+ }, null, 40, ["submission"])),
1792
+ ((ee = y.value) == null ? void 0 : ee.type) !== "softspace" ? (u(), k(_, { key: 0 }, [
1793
+ R[0] || (R[0] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-6" }, "Timeline", -1)),
1794
+ o(we, {
1795
+ entries: (le = y.value) == null ? void 0 : le.timeline
1796
+ }, null, 8, ["entries"])
1797
+ ], 64)) : T("", !0)
1798
+ ])
1799
+ ], 64));
1800
+ };
1801
+ }
1802
+ });
1803
+ export {
1804
+ Dt as default
1805
+ };