@invoice-sdk/widget 1.115.6 → 1.116.0
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.
- package/dist/{index-BInljDkt.js → index-Ba_b4M50.js} +3 -3
- package/dist/{index-B3BxLLGz.js → index-DfRo2uNU.js} +329 -323
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +58 -58
- package/dist/loading-BHrUW4gA.js +237 -0
- package/dist/{widget-Bg4h17Ae.js → widget-DVCT2ZIV.js} +188 -208
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/dist/invoice-QZ5cgmMz.js +0 -220
|
@@ -19,7 +19,7 @@ var mh = (t, n) => {
|
|
|
19
19
|
n.indexOf(c) < 0 && oh.call(t, c) && (e[c] = t[c]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var ln = (t, n, e) => new Promise((c, h) => {
|
|
23
23
|
var a = (A) => {
|
|
24
24
|
try {
|
|
25
25
|
o(e.next(A));
|
|
@@ -35,8 +35,8 @@ var sn = (t, n, e) => new Promise((c, h) => {
|
|
|
35
35
|
}, o = (A) => A.done ? c(A.value) : Promise.resolve(A.value).then(a, u);
|
|
36
36
|
o((e = e.apply(t, n)).next());
|
|
37
37
|
});
|
|
38
|
-
import { t as g, g as jh, a as Uh, b as Et, s as Ut, c as It, d as rc, e as Tc, f as xc, m as dc, h as wc, i as pc, v as Cc } from "./index-
|
|
39
|
-
import { c as yt, a as _h, g as _t, b as fc, f as Sn, d as Xc, e as
|
|
38
|
+
import { t as g, g as jh, a as Uh, b as Et, s as Ut, c as It, d as rc, e as Tc, f as xc, m as dc, h as wc, i as pc, v as Cc } from "./index-Ba_b4M50.js";
|
|
39
|
+
import { c as yt, a as _h, g as _t, b as fc, f as Sn, d as Xc, e as t0, h as Bc, i as Nc, j as Ec, k as Hc, l as yc, m as Pc, n as kc } from "./loading-BHrUW4gA.js";
|
|
40
40
|
import { g as $h } from "./_commonjsHelpers-bAxELxBV.js";
|
|
41
41
|
function qh({ steps: t = [], currentStep: n = 1 } = {}) {
|
|
42
42
|
const e = document.createElement("div");
|
|
@@ -183,7 +183,7 @@ function vc({ steps: t = [], currentStep: n = 1 } = {}) {
|
|
|
183
183
|
updateTitle: o
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function h0({
|
|
187
187
|
name: t,
|
|
188
188
|
value: n = "",
|
|
189
189
|
label: e = "",
|
|
@@ -303,7 +303,7 @@ function Lc({
|
|
|
303
303
|
d.className = "wgt:w-[1px] wgt:h-8 wgt:bg-border-light";
|
|
304
304
|
const I = document.createElement("label");
|
|
305
305
|
I.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase", I.innerText = s.name, l.appendChild(x), l.appendChild(d), l.appendChild(I);
|
|
306
|
-
const { container: k } =
|
|
306
|
+
const { container: k } = h0({
|
|
307
307
|
checked: r,
|
|
308
308
|
onChange: (b) => {
|
|
309
309
|
b && (n = s.route, typeof e == "function" && e(s), u());
|
|
@@ -1381,9 +1381,9 @@ function Dc() {
|
|
|
1381
1381
|
for (var U = m === 0 ? 11 : m - 1, cn = m === 11 ? 0 : m + 1, Y = m === 0 ? T - 1 : T, rn = m === 11 ? T + 1 : T, Z = k(Y, U), An = M + D, Tn = An; Tn > 7; )
|
|
1382
1382
|
Tn -= 7;
|
|
1383
1383
|
An += 7 - Tn;
|
|
1384
|
-
for (var Mn = !1,
|
|
1385
|
-
var Xn = new Date(T, m, 1 + (
|
|
1386
|
-
nt && (
|
|
1384
|
+
for (var Mn = !1, sn = 0, mt = 0; sn < An; sn++) {
|
|
1385
|
+
var Xn = new Date(T, m, 1 + (sn - D)), qt = x(this._d) ? w(Xn, this._d) : !1, zn = w(Xn, v), Un = E.events.indexOf(Xn.toDateString()) !== -1, nt = sn < D || sn >= M + D, Qn = 1 + (sn - D), Rn = m, _n = T, On = E.startRange && w(E.startRange, Xn), tt = E.endRange && w(E.endRange, Xn), dt = E.startRange && E.endRange && E.startRange < Xn && Xn < E.endRange, st = E.minDate && Xn < E.minDate || E.maxDate && Xn > E.maxDate || E.disableWeekends && d(Xn) || E.disableDayFn && E.disableDayFn(Xn);
|
|
1386
|
+
nt && (sn < D ? (Qn = Z + Qn, Rn = U, _n = Y) : (Qn = Qn - M, Rn = cn, _n = rn));
|
|
1387
1387
|
var ht = {
|
|
1388
1388
|
day: Qn,
|
|
1389
1389
|
month: Rn,
|
|
@@ -1399,7 +1399,7 @@ function Dc() {
|
|
|
1399
1399
|
showDaysInNextAndPreviousMonths: E.showDaysInNextAndPreviousMonths,
|
|
1400
1400
|
enableSelectionDaysInNextAndPreviousMonths: E.enableSelectionDaysInNextAndPreviousMonths
|
|
1401
1401
|
};
|
|
1402
|
-
E.pickWholeWeek && qt && (Mn = !0), O.push(y(ht)), ++mt === 7 && (E.showWeekNumber && O.unshift(V(
|
|
1402
|
+
E.pickWholeWeek && qt && (Mn = !0), O.push(y(ht)), ++mt === 7 && (E.showWeekNumber && O.unshift(V(sn - D, m, T, E.firstWeekOfYearMinDays)), j.push(L(O, E.isRTL, E.pickWholeWeek, Mn)), O = [], mt = 0, Mn = !1);
|
|
1403
1403
|
}
|
|
1404
1404
|
return G(E, j, P);
|
|
1405
1405
|
},
|
|
@@ -2042,7 +2042,7 @@ function xh(t) {
|
|
|
2042
2042
|
return e > 1 ? !1 : e === 1 ? /^\d{10}-\d{3}$/.test(n) : /^(\d{10}|\d{12}|\d{13})$/.test(n);
|
|
2043
2043
|
}
|
|
2044
2044
|
function g1(l) {
|
|
2045
|
-
return
|
|
2045
|
+
return ln(this, arguments, function* ({
|
|
2046
2046
|
onSubmit: t,
|
|
2047
2047
|
registrationData: n,
|
|
2048
2048
|
theme: e = "ocb",
|
|
@@ -2074,9 +2074,9 @@ function g1(l) {
|
|
|
2074
2074
|
S.className = "wgt:text-sm wgt:leading-relaxed", S.style.color = "#FF8447", S.innerHTML = g(
|
|
2075
2075
|
"register_note",
|
|
2076
2076
|
"Mã số thuế này đã được đăng ký trên M-Invoice, vì vậy bạn không thể tạo mới với thông tin này."
|
|
2077
|
-
), x.appendChild(S),
|
|
2077
|
+
), x.appendChild(S), sn && sn.firstChild && (sn.insertBefore(
|
|
2078
2078
|
x,
|
|
2079
|
-
|
|
2079
|
+
sn.firstChild
|
|
2080
2080
|
), setTimeout(() => {
|
|
2081
2081
|
x.style.opacity = "1";
|
|
2082
2082
|
}, 50));
|
|
@@ -2118,16 +2118,16 @@ function g1(l) {
|
|
|
2118
2118
|
onInput: (J) => {
|
|
2119
2119
|
const S = J.target.value, hn = S.replace(/[^\d-]/g, "");
|
|
2120
2120
|
hn !== S && (J.target.value = hn);
|
|
2121
|
-
const
|
|
2122
|
-
if (n._userHasEditedTaxCode = !0, I(),
|
|
2123
|
-
p.setError(g("errorRequired", "Mã số thuế bắt buộc")),
|
|
2121
|
+
const mn = hn.trim();
|
|
2122
|
+
if (n._userHasEditedTaxCode = !0, I(), mn.length === 0) {
|
|
2123
|
+
p.setError(g("errorRequired", "Mã số thuế bắt buộc")), on();
|
|
2124
2124
|
return;
|
|
2125
2125
|
}
|
|
2126
|
-
if (!xh(
|
|
2127
|
-
p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")),
|
|
2126
|
+
if (!xh(mn)) {
|
|
2127
|
+
p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), on();
|
|
2128
2128
|
return;
|
|
2129
2129
|
}
|
|
2130
|
-
p.setError(null), Mn(
|
|
2130
|
+
p.setError(null), Mn(mn), on();
|
|
2131
2131
|
}
|
|
2132
2132
|
}), H = Kn({
|
|
2133
2133
|
name: "companyName",
|
|
@@ -2165,7 +2165,7 @@ function g1(l) {
|
|
|
2165
2165
|
horizontal: !0,
|
|
2166
2166
|
searchable: !0,
|
|
2167
2167
|
onChange: (J) => {
|
|
2168
|
-
J.target.id && a(J.target.id),
|
|
2168
|
+
J.target.id && a(J.target.id), on();
|
|
2169
2169
|
}
|
|
2170
2170
|
}), h) {
|
|
2171
2171
|
const J = rn.find(
|
|
@@ -2182,7 +2182,7 @@ function g1(l) {
|
|
|
2182
2182
|
required: !1,
|
|
2183
2183
|
file: (n == null ? void 0 : n.logo) || null,
|
|
2184
2184
|
onFileChange: (J) => {
|
|
2185
|
-
|
|
2185
|
+
on();
|
|
2186
2186
|
},
|
|
2187
2187
|
error: null
|
|
2188
2188
|
}), L = Kn({
|
|
@@ -2215,14 +2215,14 @@ function g1(l) {
|
|
|
2215
2215
|
field: f.inputEl,
|
|
2216
2216
|
format: "DD/MM/YYYY",
|
|
2217
2217
|
toString(J) {
|
|
2218
|
-
const S = String(J.getMonth() + 1).padStart(2, "0"), hn = String(J.getDate()).padStart(2, "0"),
|
|
2219
|
-
return `${hn}/${S}/${
|
|
2218
|
+
const S = String(J.getMonth() + 1).padStart(2, "0"), hn = String(J.getDate()).padStart(2, "0"), mn = J.getFullYear();
|
|
2219
|
+
return `${hn}/${S}/${mn}`;
|
|
2220
2220
|
},
|
|
2221
2221
|
onSelect: (J) => {
|
|
2222
|
-
f.setError(null),
|
|
2222
|
+
f.setError(null), on();
|
|
2223
2223
|
},
|
|
2224
2224
|
onClose: () => {
|
|
2225
|
-
f.inputEl.value ? f.setError(null) : f.setError(g("errorRequired")),
|
|
2225
|
+
f.inputEl.value ? f.setError(null) : f.setError(g("errorRequired")), on();
|
|
2226
2226
|
},
|
|
2227
2227
|
maxDate: /* @__PURE__ */ new Date(),
|
|
2228
2228
|
showMonthDropdown: !0,
|
|
@@ -2280,12 +2280,12 @@ function g1(l) {
|
|
|
2280
2280
|
value: ((J0 = (M0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : M0.legalRepresentative) == null ? void 0 : J0.phone) || "",
|
|
2281
2281
|
onInput: (J) => {
|
|
2282
2282
|
let S = J.target.value;
|
|
2283
|
-
const hn = S.replace(/[^\d+().\-\s]/g, ""),
|
|
2284
|
-
if (hn !== S && (J.target.value = hn, S = hn),
|
|
2283
|
+
const hn = S.replace(/[^\d+().\-\s]/g, ""), mn = hn.replace(/[\s.\-()]/g, "");
|
|
2284
|
+
if (hn !== S && (J.target.value = hn, S = hn), mn.trim() === "") {
|
|
2285
2285
|
z.setError(g("errorRequired", "Số điện thoại bắt buộc"));
|
|
2286
2286
|
return;
|
|
2287
2287
|
}
|
|
2288
|
-
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(
|
|
2288
|
+
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(mn) ? z.setError(null) : z.setError(
|
|
2289
2289
|
g("errorInvalidPhone", "Số điện thoại không hợp lệ.")
|
|
2290
2290
|
);
|
|
2291
2291
|
}
|
|
@@ -2325,7 +2325,7 @@ function g1(l) {
|
|
|
2325
2325
|
required: !0,
|
|
2326
2326
|
file: (n == null ? void 0 : n.license) || null,
|
|
2327
2327
|
onFileChange: (J) => {
|
|
2328
|
-
|
|
2328
|
+
on();
|
|
2329
2329
|
},
|
|
2330
2330
|
error: null,
|
|
2331
2331
|
accept: "image/png, image/jpeg, image/jpg, .pdf"
|
|
@@ -2388,14 +2388,14 @@ function g1(l) {
|
|
|
2388
2388
|
value: ((Z0 = (R0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : R0.contactPerson) == null ? void 0 : Z0.phone) || "",
|
|
2389
2389
|
onInput: (J) => {
|
|
2390
2390
|
let S = J.target.value;
|
|
2391
|
-
const hn = S.replace(/[^\d+().\-\s]/g, ""),
|
|
2392
|
-
if (hn !== S && (J.target.value = hn, S = hn),
|
|
2391
|
+
const hn = S.replace(/[^\d+().\-\s]/g, ""), mn = hn.replace(/[\s.\-()]/g, "");
|
|
2392
|
+
if (hn !== S && (J.target.value = hn, S = hn), mn.trim() === "") {
|
|
2393
2393
|
Q.setError(
|
|
2394
2394
|
g("errorRequired", "Số điện thoại bắt buộc")
|
|
2395
2395
|
);
|
|
2396
2396
|
return;
|
|
2397
2397
|
}
|
|
2398
|
-
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(
|
|
2398
|
+
/^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/.test(mn) ? Q.setError(null) : Q.setError(
|
|
2399
2399
|
g("errorInvalidPhone", "Số điện thoại Việt Nam không hợp lệ.")
|
|
2400
2400
|
);
|
|
2401
2401
|
}
|
|
@@ -2437,10 +2437,10 @@ function g1(l) {
|
|
|
2437
2437
|
isRenewal: i,
|
|
2438
2438
|
initialValue: r || (($0 = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : $0.invoiceSymbol) || "1C26TYY",
|
|
2439
2439
|
onChange: (J) => {
|
|
2440
|
-
An.inputEl.value = J,
|
|
2440
|
+
An.inputEl.value = J, on();
|
|
2441
2441
|
}
|
|
2442
2442
|
}), E = document.createElement("input"), E.type = "checkbox", E.name = "hasUsedEInvoiceCB", E.className = "wgt:cursor-pointer", E.checked = (nh = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : nh.hasUsedEInvoice, E.addEventListener("change", (J) => {
|
|
2443
|
-
J.target.checked ? (
|
|
2443
|
+
J.target.checked ? (Nn.appendChild(tn), Nn.appendChild(F)) : (v.checked = !1, D.inputEl.value = "", D.setError(null), M && (M.inputEl.value = "", M.setError(null), F.contains(M.container) && F.removeChild(M.container)), Nn.removeChild(tn), Nn.removeChild(F));
|
|
2444
2444
|
}), v = document.createElement("input"), v.type = "checkbox", v.name = "hasUsedEInvoiceBeforeCB", v.className = "wgt:cursor-pointer", v.checked = (th = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : th.isUsedEInvoiceBefore, v.addEventListener("change", (J) => {
|
|
2445
2445
|
J.target.checked ? F.appendChild(M.container) : (M.inputEl.value = "", M.setError(null), F.contains(M.container) && F.removeChild(M.container));
|
|
2446
2446
|
}), M = Kn({
|
|
@@ -2494,12 +2494,12 @@ function g1(l) {
|
|
|
2494
2494
|
});
|
|
2495
2495
|
let Tn = 0;
|
|
2496
2496
|
function Mn(J) {
|
|
2497
|
-
return
|
|
2497
|
+
return ln(this, null, function* () {
|
|
2498
2498
|
const S = ++Tn;
|
|
2499
2499
|
p.setError(null);
|
|
2500
2500
|
try {
|
|
2501
2501
|
const hn = yield fc(J.trim());
|
|
2502
|
-
let
|
|
2502
|
+
let mn = {
|
|
2503
2503
|
name: "",
|
|
2504
2504
|
address: "",
|
|
2505
2505
|
taxAuthority: "",
|
|
@@ -2516,10 +2516,10 @@ function g1(l) {
|
|
|
2516
2516
|
Ln.value,
|
|
2517
2517
|
Ln.label,
|
|
2518
2518
|
Ln.id
|
|
2519
|
-
),
|
|
2519
|
+
), mn.taxAuthority = Ln.id || "", C.setDisabled(!1));
|
|
2520
2520
|
} else
|
|
2521
2521
|
C.setValue && C.setValue("", "", ""), C.setDisabled(!1);
|
|
2522
|
-
return
|
|
2522
|
+
return mn.name = hn.ten_cty || "", mn.address = hn.dia_chi || "", mn.taxCode = J, p.setError(null), mn;
|
|
2523
2523
|
} catch (hn) {
|
|
2524
2524
|
S === Tn && (pt.error(
|
|
2525
2525
|
g("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế."),
|
|
@@ -2532,18 +2532,18 @@ function g1(l) {
|
|
|
2532
2532
|
g("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế.")
|
|
2533
2533
|
));
|
|
2534
2534
|
} finally {
|
|
2535
|
-
S === Tn &&
|
|
2535
|
+
S === Tn && on();
|
|
2536
2536
|
}
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2539
|
+
const sn = document.createElement("div");
|
|
2540
|
+
sn.className = "wgt:space-y-3";
|
|
2541
2541
|
const mt = document.createElement("h3");
|
|
2542
|
-
mt.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", mt.innerText = g("unitInfo", "1. Thông tin đơn vị"),
|
|
2542
|
+
mt.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", mt.innerText = g("unitInfo", "1. Thông tin đơn vị"), sn.appendChild(mt), setTimeout(() => d(), 50);
|
|
2543
2543
|
const Xn = document.createElement("div");
|
|
2544
|
-
Xn.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-y-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50",
|
|
2544
|
+
Xn.className = "wgt:grid wgt:@max-2xl:grid-cols-1 wgt:@max-2xl:p-4 wgt:@max-2xl:gap-y-3 wgt:grid-cols-2 wgt:gap-y-2 wgt:gap-x-4 wgt:px-6 wgt:py-4 wgt:rounded-xl wgt:bg-weak-50", sn.appendChild(Xn), Xn.appendChild(p.container), Xn.appendChild(H.container), Xn.appendChild(N.container), Xn.appendChild(C.container);
|
|
2545
2545
|
const qt = document.createElement("div");
|
|
2546
|
-
qt.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4",
|
|
2546
|
+
qt.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", sn.appendChild(qt), qt.appendChild(j.container), w.appendChild(sn);
|
|
2547
2547
|
const zn = document.createElement("div");
|
|
2548
2548
|
zn.className = "wgt:space-y-4";
|
|
2549
2549
|
const Un = document.createElement("h3");
|
|
@@ -2569,7 +2569,7 @@ function g1(l) {
|
|
|
2569
2569
|
Qn = !1, Rn = !1, On();
|
|
2570
2570
|
const hn = () => {
|
|
2571
2571
|
G.inputEl.value = "", L.inputEl.value = "", f.inputEl.value = "", m.inputEl.value = "", B.selectEl.value = "", T.selectEl.value = "", G.setError(null), L.setError(null), f.setError(null), m.setError(null), B.setError(null), T.setError(null), u && typeof u.setDate == "function" && u.setDate(null);
|
|
2572
|
-
},
|
|
2572
|
+
}, mn = (xn) => {
|
|
2573
2573
|
if (!xn) return "";
|
|
2574
2574
|
if (/^\d{8}$/.test(xn)) {
|
|
2575
2575
|
const Nt = xn.slice(0, 2), A0 = xn.slice(2, 4), sc = xn.slice(4, 8);
|
|
@@ -2580,7 +2580,7 @@ function g1(l) {
|
|
|
2580
2580
|
const e0 = String(Bt.getDate()).padStart(2, "0"), Kt = String(Bt.getMonth() + 1).padStart(2, "0"), Wt = Bt.getFullYear();
|
|
2581
2581
|
return `${e0}/${Kt}/${Wt}`;
|
|
2582
2582
|
}, vn = new Image();
|
|
2583
|
-
vn.src = URL.createObjectURL(J), vn.onload = () =>
|
|
2583
|
+
vn.src = URL.createObjectURL(J), vn.onload = () => ln(null, null, function* () {
|
|
2584
2584
|
try {
|
|
2585
2585
|
const xn = yield l1(vn).then((Ln) => JSON.parse(Ln).status !== "success" ? (Qn = !0, Rn = !1, hn(), On(), null) : JSON.parse(Ln).data);
|
|
2586
2586
|
if (xn || S({ success: !1, reason: "No data detected" }), xn) {
|
|
@@ -2592,7 +2592,7 @@ function g1(l) {
|
|
|
2592
2592
|
const { address: xt, date_of_birth: Bt, full_name: e0, id_number: Kt, sex: Wt } = xn;
|
|
2593
2593
|
if (!Kt || !/^\d{12}$/.test(Kt) ? (Vt(
|
|
2594
2594
|
g("errorInvalidCard", "Số CCCD phải có 12 chữ số")
|
|
2595
|
-
), G.inputEl.value = "") : (G.inputEl.value = Kt, G.setError(null)), L.inputEl.value = e0 || "", f.inputEl.value =
|
|
2595
|
+
), G.inputEl.value = "") : (G.inputEl.value = Kt, G.setError(null)), L.inputEl.value = e0 || "", f.inputEl.value = mn(Bt), m.inputEl.value = xt || "", Wt) {
|
|
2596
2596
|
const Nt = ih.find(
|
|
2597
2597
|
(A0) => A0.label.toLowerCase() === Wt.toLowerCase()
|
|
2598
2598
|
);
|
|
@@ -2603,15 +2603,15 @@ function g1(l) {
|
|
|
2603
2603
|
} catch (xn) {
|
|
2604
2604
|
console.error("readIdentityCard failed", xn);
|
|
2605
2605
|
} finally {
|
|
2606
|
-
|
|
2606
|
+
on();
|
|
2607
2607
|
}
|
|
2608
2608
|
});
|
|
2609
2609
|
});
|
|
2610
2610
|
}
|
|
2611
2611
|
function dt(J, S, hn) {
|
|
2612
|
-
const
|
|
2613
|
-
|
|
2614
|
-
yield A1(
|
|
2612
|
+
const mn = new Image();
|
|
2613
|
+
mn.src = URL.createObjectURL(J), mn.onload = () => ln(null, null, function* () {
|
|
2614
|
+
yield A1(mn).then((vn) => {
|
|
2615
2615
|
var Ln, jn;
|
|
2616
2616
|
const xn = JSON.parse(vn);
|
|
2617
2617
|
S && !((Ln = xn == null ? void 0 : xn.data) != null && Ln.isFront) ? Vt(
|
|
@@ -2633,26 +2633,26 @@ function g1(l) {
|
|
|
2633
2633
|
} = Vc({
|
|
2634
2634
|
frontFile: n == null ? void 0 : n.idCard,
|
|
2635
2635
|
backFile: n == null ? void 0 : n.idCardBack,
|
|
2636
|
-
onFrontChange: (J) =>
|
|
2637
|
-
var hn,
|
|
2636
|
+
onFrontChange: (J) => ln(null, null, function* () {
|
|
2637
|
+
var hn, mn;
|
|
2638
2638
|
if (U = J, dt(J, !0, !1), ht() || lt() || !a0()) {
|
|
2639
|
-
Qn = !1, Rn = !1, On(),
|
|
2639
|
+
Qn = !1, Rn = !1, On(), on();
|
|
2640
2640
|
return;
|
|
2641
2641
|
}
|
|
2642
|
-
if ((
|
|
2643
|
-
|
|
2642
|
+
if ((mn = (hn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : hn.legalRepresentative) == null ? void 0 : mn.idCard) {
|
|
2643
|
+
on();
|
|
2644
2644
|
return;
|
|
2645
2645
|
}
|
|
2646
2646
|
tt(J);
|
|
2647
2647
|
}),
|
|
2648
|
-
onBackChange: (J) =>
|
|
2649
|
-
var
|
|
2648
|
+
onBackChange: (J) => ln(null, null, function* () {
|
|
2649
|
+
var mn, vn;
|
|
2650
2650
|
if (cn = J, dt(J, !1, !0), ht() || lt() || !Gt()) {
|
|
2651
|
-
Qn = !1, Rn = !1, On(),
|
|
2651
|
+
Qn = !1, Rn = !1, On(), on();
|
|
2652
2652
|
return;
|
|
2653
2653
|
}
|
|
2654
|
-
if ((vn = (
|
|
2655
|
-
|
|
2654
|
+
if ((vn = (mn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : mn.legalRepresentative) == null ? void 0 : vn.idCardBack) {
|
|
2655
|
+
on();
|
|
2656
2656
|
return;
|
|
2657
2657
|
}
|
|
2658
2658
|
(yield tt(Gt())).success || tt(J);
|
|
@@ -2685,15 +2685,15 @@ function g1(l) {
|
|
|
2685
2685
|
vt.className = "wgt:text-lg wgt:font-semibold wgt:mb-2", vt.innerText = g("invoiceUsageInfo", "4. THÔNG TIN SỬ DỤNG HDDT:"), at.appendChild(vt), w.appendChild(at);
|
|
2686
2686
|
const Zn = document.createElement("div");
|
|
2687
2687
|
Zn.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", Zn.appendChild(P.container), Zn.appendChild(An.container), at.appendChild(Zn);
|
|
2688
|
-
const
|
|
2689
|
-
|
|
2688
|
+
const Nn = document.createElement("div");
|
|
2689
|
+
Nn.className = "wgt:flex wgt:flex-col wgt:space-y-4 wgt:border wgt:border-soft-200 wgt:px-6 wgt:py-4 wgt:rounded-xl", i || w.appendChild(Nn);
|
|
2690
2690
|
const Xt = document.createElement("div");
|
|
2691
2691
|
Xt.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", Xt.appendChild(E);
|
|
2692
2692
|
const W = document.createElement("h4");
|
|
2693
2693
|
W.className = "wgt:font-semibold wgt:italic", W.innerText = g(
|
|
2694
2694
|
"hasUsedEInvoice",
|
|
2695
2695
|
"Bạn đã sử dụng hoá đơn điện tử?"
|
|
2696
|
-
), Xt.appendChild(W), i ||
|
|
2696
|
+
), Xt.appendChild(W), i || Nn.appendChild(Xt), E.checked = i, E.disabled = i;
|
|
2697
2697
|
const tn = document.createElement("div");
|
|
2698
2698
|
if (tn.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", !i) {
|
|
2699
2699
|
tn.appendChild(v);
|
|
@@ -2725,13 +2725,13 @@ function g1(l) {
|
|
|
2725
2725
|
].join(" ");
|
|
2726
2726
|
const en = "http://www.w3.org/2000/svg", _ = document.createElementNS(en, "svg");
|
|
2727
2727
|
_.setAttribute("viewBox", "0 0 24 24"), _.setAttribute("class", "wgt:w-4 wgt:h-4 wgt:text-white");
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2728
|
+
const qn = document.createElementNS(en, "path");
|
|
2729
|
+
qn.setAttribute("fill-rule", "evenodd"), qn.setAttribute("clip-rule", "evenodd"), qn.setAttribute(
|
|
2730
2730
|
"d",
|
|
2731
2731
|
"M5.23 12.03a.75.75 0 011.06.02L10 15.94l7.71-7.71a.75.75 0 111.06 1.06l-8.24 8.24a.75.75 0 01-1.06 0L5.21 13.09a.75.75 0 01.02-1.06z"
|
|
2732
|
-
),
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2732
|
+
), qn.setAttribute("fill", "white"), _.appendChild(qn), $.appendChild(_);
|
|
2733
|
+
const gn = document.createElement("label");
|
|
2734
|
+
gn.className = "wgt:text-sm wgt:text-strong-950 wgt:leading-tight", gn.appendChild(
|
|
2735
2735
|
document.createTextNode(g("agreeWith", "Tôi đồng ý với ") + " ")
|
|
2736
2736
|
);
|
|
2737
2737
|
const Bn = (J) => {
|
|
@@ -2740,13 +2740,13 @@ function g1(l) {
|
|
|
2740
2740
|
hn.preventDefault(), typeof c == "function" && c();
|
|
2741
2741
|
}, S;
|
|
2742
2742
|
}, In = Ic(e);
|
|
2743
|
-
|
|
2743
|
+
gn.appendChild(
|
|
2744
2744
|
Bn(g("termsAndUsagePolicy", "Điều khoản và Chính sách sử dụng"))
|
|
2745
|
-
),
|
|
2746
|
-
an = !an, an ? ($.classList.add("wgt:bg-primary"), _.classList.remove("wgt:hidden")) : ($.classList.remove("wgt:bg-primary"), _.classList.add("wgt:hidden")),
|
|
2745
|
+
), gn.appendChild(document.createTextNode(` ${g("of", "của")} ${In}.`)), nn.appendChild($), nn.appendChild(gn), w.appendChild(nn), $.addEventListener("click", () => {
|
|
2746
|
+
an = !an, an ? ($.classList.add("wgt:bg-primary"), _.classList.remove("wgt:hidden")) : ($.classList.remove("wgt:bg-primary"), _.classList.add("wgt:hidden")), on();
|
|
2747
2747
|
});
|
|
2748
|
-
const
|
|
2749
|
-
|
|
2748
|
+
const En = document.createElement("div");
|
|
2749
|
+
En.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", Y.type = "submit", Y.innerText = g("next"), Y.className = [
|
|
2750
2750
|
"wgt:bg-primary",
|
|
2751
2751
|
"wgt:hover:bg-primary-dark",
|
|
2752
2752
|
"wgt:text-text-primary",
|
|
@@ -2757,7 +2757,7 @@ function g1(l) {
|
|
|
2757
2757
|
"wgt:disabled:cursor-not-allowed",
|
|
2758
2758
|
"wgt:cursor-pointer",
|
|
2759
2759
|
"wgt:hover:text-primary-hover-text"
|
|
2760
|
-
].join(" "),
|
|
2760
|
+
].join(" "), En.appendChild(Y), b.appendChild(En);
|
|
2761
2761
|
function Dn() {
|
|
2762
2762
|
const J = Fn(), S = J.eInvoiceRegistration, hn = (S.organization.taxCode || "").trim();
|
|
2763
2763
|
if (!S.contactPerson.address || !S.organization.name || !S.organization.address || !hn || !S.organization.taxAuthority || !S.contactPerson.name || !S.contactPerson.email || !S.contactPerson.phone || !S.legalRepresentative.name || !S.legalRepresentative.dob || !S.legalRepresentative.gender || !S.legalRepresentative.phone || !S.legalRepresentative.idCard || !S.legalRepresentative.permanentAddress || !S.invoiceSymbol || !i && S.hasUsedEInvoice && !S.taxAuthorityCode || S.isUsedEInvoiceBefore && !S.previousEInvoiceProvider || !Ft(S.contactPerson.name) || !Ft(S.legalRepresentative.name) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(S.contactPerson.address) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(
|
|
@@ -2773,7 +2773,7 @@ function g1(l) {
|
|
|
2773
2773
|
), jn = S.legalRepresentative.phone.replace(/[^\d+().\-\s]/g, "").replace(/[\s.\-()]/g, ""), xt = /^(?:\+84|0)(?:2\d|3\d|5\d|7\d|8\d|9\d)\d{7}$/;
|
|
2774
2774
|
return !(!xt.test(xn) || !xt.test(jn) || !/^\d{12}$/.test(S.legalRepresentative.idCard) || !new RegExp("^(?!\\.)(?!.*\\.\\.)[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}(?<!\\.)@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z0-9-]{2,63}$").test(S.contactPerson.email) || !/^[1-9][CK]\d{2}[TDLMNBGHX][A-Z]{2}$/.test(S.invoiceSymbol) || !J.license || !J.idCard || !J.idCardBack);
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function on() {
|
|
2777
2777
|
const J = e === "bvb" && !i && A === !1 && !n._userHasEditedTaxCode;
|
|
2778
2778
|
Y.disabled = !Dn() || !an || ht() || lt() || j.getError() || O.getError() || J;
|
|
2779
2779
|
}
|
|
@@ -2831,12 +2831,12 @@ function g1(l) {
|
|
|
2831
2831
|
D,
|
|
2832
2832
|
M
|
|
2833
2833
|
].forEach((J) => {
|
|
2834
|
-
J.inputEl.addEventListener("input",
|
|
2834
|
+
J.inputEl.addEventListener("input", on);
|
|
2835
2835
|
}), [B, C].forEach((J) => {
|
|
2836
|
-
J.selectEl.addEventListener("change",
|
|
2836
|
+
J.selectEl.addEventListener("change", on);
|
|
2837
2837
|
}), [E, v].forEach((J) => {
|
|
2838
|
-
J.addEventListener("change",
|
|
2839
|
-
}), Y.addEventListener("click", (J) =>
|
|
2838
|
+
J.addEventListener("change", on);
|
|
2839
|
+
}), Y.addEventListener("click", (J) => ln(null, null, function* () {
|
|
2840
2840
|
if (J.preventDefault(), !Dn()) return;
|
|
2841
2841
|
const S = p.getValue().trim();
|
|
2842
2842
|
if (!xh(S)) {
|
|
@@ -2860,7 +2860,7 @@ function g1(l) {
|
|
|
2860
2860
|
return;
|
|
2861
2861
|
}
|
|
2862
2862
|
Y.disabled = !0;
|
|
2863
|
-
let hn = null,
|
|
2863
|
+
let hn = null, mn = !1;
|
|
2864
2864
|
try {
|
|
2865
2865
|
const vn = (n == null ? void 0 : n.provider) || "m-invoice";
|
|
2866
2866
|
if (console.log("Current theme:", e), console.log("Provider being used:", vn), hn = (yield _h(vn, S, "HDTT")).isNewCustomer, hn)
|
|
@@ -2882,11 +2882,11 @@ function g1(l) {
|
|
|
2882
2882
|
});
|
|
2883
2883
|
}
|
|
2884
2884
|
} catch (vn) {
|
|
2885
|
-
|
|
2885
|
+
mn = !0, console.error("Error checking customer:", vn);
|
|
2886
2886
|
} finally {
|
|
2887
2887
|
Y.disabled = !1, Y.innerText = g("next");
|
|
2888
2888
|
}
|
|
2889
|
-
|
|
2889
|
+
mn || hn === !1 || hn === !0 && (Gn(Wn.STEP1_COMPLETED, {
|
|
2890
2890
|
theme: e,
|
|
2891
2891
|
isRenewal: !1,
|
|
2892
2892
|
isNewCustomer: !0,
|
|
@@ -2894,14 +2894,14 @@ function g1(l) {
|
|
|
2894
2894
|
}), t(Fn()));
|
|
2895
2895
|
}));
|
|
2896
2896
|
const $n = (((eh = (ah = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : ah.organization) == null ? void 0 : eh.taxCode) || "").trim();
|
|
2897
|
-
return $n.length >= 10 && Mn($n), cc(Uh(), jh().invoiceHubBaseUrl), n != null && n.idCard && (U = n == null ? void 0 : n.idCard),
|
|
2897
|
+
return $n.length >= 10 && Mn($n), cc(Uh(), jh().invoiceHubBaseUrl), n != null && n.idCard && (U = n == null ? void 0 : n.idCard), on(), {
|
|
2898
2898
|
container: b,
|
|
2899
2899
|
getValues: Fn
|
|
2900
2900
|
};
|
|
2901
2901
|
});
|
|
2902
2902
|
}
|
|
2903
2903
|
function r1(h) {
|
|
2904
|
-
return
|
|
2904
|
+
return ln(this, arguments, function* ({
|
|
2905
2905
|
providerProps: t,
|
|
2906
2906
|
formProps: n,
|
|
2907
2907
|
isRenewal: e,
|
|
@@ -2977,7 +2977,7 @@ function x1({
|
|
|
2977
2977
|
N.className = "wgt:w-fit wgt:px-2 wgt:py-0.5 wgt:rounded wgt:bg-primary wgt:text-white wgt:bg-gradient-to-r wgt:from-[#FF8447] wgt:to-[#F6B51E] wgt:text-sm wgt:font-semibold", N.innerText = c, s.appendChild(N);
|
|
2978
2978
|
}
|
|
2979
2979
|
q.appendChild(s);
|
|
2980
|
-
const { container: i } =
|
|
2980
|
+
const { container: i } = h0({
|
|
2981
2981
|
checked: h,
|
|
2982
2982
|
onChange: (N) => {
|
|
2983
2983
|
}
|
|
@@ -3141,7 +3141,7 @@ function d1({
|
|
|
3141
3141
|
"wgt:-mt-4",
|
|
3142
3142
|
"wgt:@max-2xl:px-0"
|
|
3143
3143
|
].join(" ");
|
|
3144
|
-
const A =
|
|
3144
|
+
const A = h0({
|
|
3145
3145
|
name: t,
|
|
3146
3146
|
value: n,
|
|
3147
3147
|
checked: a,
|
|
@@ -3173,22 +3173,6 @@ function d1({
|
|
|
3173
3173
|
const i = document.createElement("p");
|
|
3174
3174
|
return i.className = "wgt:text-text-soft-400 wgt:text-sm", i.textContent = h, q.appendChild(i), o.appendChild(q), { container: o };
|
|
3175
3175
|
}
|
|
3176
|
-
function h0() {
|
|
3177
|
-
const t = document.createElement("div");
|
|
3178
|
-
t.className = "wgt:absolute wgt:inset-0 wgt:bg-white/80 wgt:items-center wgt:justify-center wgt:z-50 wgt:w-full wgt:h-full wgt:backdrop-blur-sm", t.style.display = "none";
|
|
3179
|
-
const n = document.createElement("div");
|
|
3180
|
-
n.className = "wgt:flex wgt:flex-col wgt:items-center wgt:gap-4 wgt:bg-white wgt:rounded-lg wgt:p-6 wgt:shadow-lg";
|
|
3181
|
-
const e = document.createElement("div");
|
|
3182
|
-
return e.className = "wgt:h-12 wgt:w-12 wgt:animate-spin wgt:rounded-full wgt:border-4 wgt:border-solid wgt:border-primary wgt:border-t-transparent", n.appendChild(e), t.appendChild(n), {
|
|
3183
|
-
container: t,
|
|
3184
|
-
open: () => {
|
|
3185
|
-
t.style.display = "flex";
|
|
3186
|
-
},
|
|
3187
|
-
close: () => {
|
|
3188
|
-
t.style.display = "none";
|
|
3189
|
-
}
|
|
3190
|
-
};
|
|
3191
|
-
}
|
|
3192
3176
|
function w1({
|
|
3193
3177
|
promotion: t,
|
|
3194
3178
|
onSelect: n,
|
|
@@ -3221,7 +3205,7 @@ function w1({
|
|
|
3221
3205
|
].join(" ");
|
|
3222
3206
|
const q = Yt(Et());
|
|
3223
3207
|
A.textContent = t[q], u.appendChild(A);
|
|
3224
|
-
const { container: s } =
|
|
3208
|
+
const { container: s } = h0({
|
|
3225
3209
|
checked: t.isSelected,
|
|
3226
3210
|
onChange: () => {
|
|
3227
3211
|
let i = !t.isSelected;
|
|
@@ -3256,8 +3240,8 @@ function p1({
|
|
|
3256
3240
|
const q = document.createElement("span");
|
|
3257
3241
|
q.className = "wgt:text-sm wgt:text-red-500 wgt:ml-1", q.innerText = "*", A.appendChild(q), o.appendChild(A);
|
|
3258
3242
|
function s() {
|
|
3259
|
-
return
|
|
3260
|
-
n && clearTimeout(n), e !== "" ? n = setTimeout(() =>
|
|
3243
|
+
return ln(this, null, function* () {
|
|
3244
|
+
n && clearTimeout(n), e !== "" ? n = setTimeout(() => ln(null, null, function* () {
|
|
3261
3245
|
try {
|
|
3262
3246
|
const b = e.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g, "."), w = yield Xc({ search: b, bank: t });
|
|
3263
3247
|
w && (a = w), c && c();
|
|
@@ -3405,7 +3389,7 @@ function X1() {
|
|
|
3405
3389
|
}
|
|
3406
3390
|
const B1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFmSURBVHgBjVJLUsJAEH2dTAzu4gmEG+gNYKFxGU9gbqAuLaEqVVDllhuAJyDuQBfEE1CeADiBcaESyWTsJCKfIOXbzPT3db9qAkN5VQvG3iUUVUEoYxcUJlDJC+TcIy8IReY0zA4STKHp15gnYeYTKuCGLiQXrEJnAmK/MHts1Uh5jgXxMab648EaUcv2EUduyrJ1kJb9yvGKgDmzEFMhieoDB7vxBpQsDVEphMYdm/Y402LB0Dxpr9ob7Ff8HKZ/jTw/pNtBBaSeeS93OYLmpAyF4uapw0KmgtfI60/EWjShrftu4IgTH6jxFKSGyEQ0PkdI1BTJzF9SqS4QFRtqwkciezxJCPnVJnV3VkashtTgNf6JrEaqEYt/nItIqrhry+78JSLd9Cf5bxbST/KQH74weQ8Z50Fh8iFJ99dewDAsKO2Cqyp8O04uYrx/Dv3d4wU9LiwvqfQuhL5OnyhuSAFk5KbmN7eYmgg1dFx4AAAAAElFTkSuQmCC";
|
|
3407
3391
|
function N1(N) {
|
|
3408
|
-
return
|
|
3392
|
+
return ln(this, arguments, function* ({
|
|
3409
3393
|
onNext: t,
|
|
3410
3394
|
onPrev: n,
|
|
3411
3395
|
selectedInitPackage: e,
|
|
@@ -3458,40 +3442,36 @@ function N1(N) {
|
|
|
3458
3442
|
an.className = "wgt:text-sm wgt:font-medium wgt:text-black", an.innerHTML = `${g("businessRegistrationType") || "Hình thức đăng ký kinh doanh"} <span class="wgt:text-red-500">*</span>`, nn.appendChild(an);
|
|
3459
3443
|
const $ = document.createElement("div");
|
|
3460
3444
|
$.className = "wgt:inline-flex wgt:items-center wgt:rounded-xl wgt:bg-white wgt:border wgt:border-soft-200 wgt:p-1 wgt:gap-1", nn.appendChild($);
|
|
3461
|
-
function en(
|
|
3462
|
-
const
|
|
3463
|
-
|
|
3445
|
+
function en(En, Dn) {
|
|
3446
|
+
const on = document.createElement("button");
|
|
3447
|
+
on.type = "button", on.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:px-4 wgt:py-2 wgt:rounded-lg wgt:text-sm wgt:font-medium wgt:transition wgt:hover:bg-weak-50";
|
|
3464
3448
|
const Fn = document.createElement("span");
|
|
3465
3449
|
Fn.className = "wgt:h-4 wgt:w-4 wgt:rounded-full wgt:border wgt:flex wgt:items-center wgt:justify-center";
|
|
3466
3450
|
const $n = document.createElement("span");
|
|
3467
3451
|
$n.className = "wgt:h-2 wgt:w-2 wgt:rounded-full ", $n.style.backgroundColor = "#1e2a7b", $n.style.opacity = "0", Fn.appendChild($n);
|
|
3468
3452
|
const et = document.createElement("span");
|
|
3469
|
-
return et.className = "wgt:text-sm wgt:font-semibold", et.innerText =
|
|
3453
|
+
return et.className = "wgt:text-sm wgt:font-semibold", et.innerText = En, on.appendChild(Fn), on.appendChild(et), on.addEventListener("click", () => {
|
|
3470
3454
|
F = Dn, Bn(), W != null && W.eInvoiceRegistration && (W.eInvoiceRegistration.businessType = F), tn == null || tn(F);
|
|
3471
|
-
}), { btn:
|
|
3455
|
+
}), { btn: on, inner: $n, textSpan: et, value: Dn };
|
|
3472
3456
|
}
|
|
3473
|
-
const _ = en(g("company") || "Doanh nghiệp", "company"),
|
|
3457
|
+
const _ = en(g("company") || "Doanh nghiệp", "company"), qn = en(
|
|
3474
3458
|
g("householdBusiness") || "Hộ kinh doanh",
|
|
3475
3459
|
"household"
|
|
3476
3460
|
);
|
|
3477
|
-
$.appendChild(_.btn), $.appendChild(
|
|
3478
|
-
function
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
), Nn.inner.parentElement.classList.toggle(
|
|
3483
|
-
"wgt:border-soft-300",
|
|
3484
|
-
!Dn
|
|
3485
|
-
), Nn.textSpan.style.color = Dn ? "#1e2a7b" : "", Nn.textSpan.classList.toggle("wgt:text-text-sub-600", !Dn);
|
|
3461
|
+
$.appendChild(_.btn), $.appendChild(qn.btn);
|
|
3462
|
+
function gn(En, Dn) {
|
|
3463
|
+
En.btn.classList.toggle("wgt:bg-weak-50", Dn), En.inner.style.opacity = Dn ? "1" : "0";
|
|
3464
|
+
const on = En.inner.parentElement;
|
|
3465
|
+
on.classList.toggle("wgt:border-[#1e2a7b]", Dn), on.classList.toggle("wgt:border-[#D0D5DD]", !Dn), En.textSpan.style.color = Dn ? "#1e2a7b" : "", En.textSpan.classList.toggle("wgt:text-text-sub-600", !Dn);
|
|
3486
3466
|
}
|
|
3487
3467
|
function Bn() {
|
|
3488
|
-
|
|
3468
|
+
gn(_, F === "company"), gn(qn, F === "household");
|
|
3489
3469
|
}
|
|
3490
3470
|
return Bn(), {
|
|
3491
3471
|
container: nn,
|
|
3492
3472
|
getValue: () => F,
|
|
3493
|
-
setValue: (
|
|
3494
|
-
F =
|
|
3473
|
+
setValue: (En) => {
|
|
3474
|
+
F = En, Bn();
|
|
3495
3475
|
}
|
|
3496
3476
|
};
|
|
3497
3477
|
}
|
|
@@ -3504,7 +3484,7 @@ function N1(N) {
|
|
|
3504
3484
|
container: U,
|
|
3505
3485
|
open: cn,
|
|
3506
3486
|
close: Y
|
|
3507
|
-
} =
|
|
3487
|
+
} = t0();
|
|
3508
3488
|
O.appendChild(U);
|
|
3509
3489
|
let rn = null;
|
|
3510
3490
|
if (X) {
|
|
@@ -3513,7 +3493,7 @@ function N1(N) {
|
|
|
3513
3493
|
onChange: (tn) => {
|
|
3514
3494
|
var nn;
|
|
3515
3495
|
const F = Q(y, tn);
|
|
3516
|
-
Mn(F || []), Xn(F || []), L = ((nn = F == null ? void 0 : F[0]) == null ? void 0 : nn._id) || null, at(), ct(), Tt(), Zn(),
|
|
3496
|
+
Mn(F || []), Xn(F || []), L = ((nn = F == null ? void 0 : F[0]) == null ? void 0 : nn._id) || null, at(), ct(), Tt(), Zn(), Nn();
|
|
3517
3497
|
}
|
|
3518
3498
|
});
|
|
3519
3499
|
const W = document.createElement("div");
|
|
@@ -3525,7 +3505,7 @@ function N1(N) {
|
|
|
3525
3505
|
container: An,
|
|
3526
3506
|
invoiceSelectorWrapper: Tn,
|
|
3527
3507
|
setInvoicePackages: Mn,
|
|
3528
|
-
getInvoicePackages:
|
|
3508
|
+
getInvoicePackages: sn,
|
|
3529
3509
|
getFilteredInvoiceOptions: mt,
|
|
3530
3510
|
setFilteredInvoiceOptions: Xn,
|
|
3531
3511
|
findInvoiceById: qt,
|
|
@@ -3535,7 +3515,7 @@ function N1(N) {
|
|
|
3535
3515
|
debounceTimer: m,
|
|
3536
3516
|
typedUnits: V,
|
|
3537
3517
|
onSearchComplete: () => {
|
|
3538
|
-
ct(),
|
|
3518
|
+
ct(), Nn();
|
|
3539
3519
|
}
|
|
3540
3520
|
});
|
|
3541
3521
|
Z.appendChild(An);
|
|
@@ -3561,7 +3541,7 @@ function N1(N) {
|
|
|
3561
3541
|
ht.className = "wgt:flex wgt:justify-between wgt:gap-2", O.appendChild(ht);
|
|
3562
3542
|
const lt = document.createElement("button");
|
|
3563
3543
|
lt.type = "button", lt.innerText = g("back"), lt.className = "wgt:bg-transparent wgt:text-primary wgt:hover:text-primary-dark wgt:hover:bg-transparent wgt:underline", lt.addEventListener("click", n), ht.appendChild(lt);
|
|
3564
|
-
const Vt = (W, tn, F, nn) =>
|
|
3544
|
+
const Vt = (W, tn, F, nn) => ln(null, null, function* () {
|
|
3565
3545
|
cn();
|
|
3566
3546
|
const _ = x.eInvoiceRegistration, { isUsedEInvoiceBefore: an } = _, $ = mh(_, ["isUsedEInvoiceBefore"]);
|
|
3567
3547
|
let en = [
|
|
@@ -3579,9 +3559,9 @@ function N1(N) {
|
|
|
3579
3559
|
code: W.code,
|
|
3580
3560
|
quantity: W.quantity,
|
|
3581
3561
|
isCashRegister: X
|
|
3582
|
-
}), nn.length > 0 && nn.forEach((
|
|
3583
|
-
const
|
|
3584
|
-
|
|
3562
|
+
}), nn.length > 0 && nn.forEach((qn) => {
|
|
3563
|
+
const gn = R[qn];
|
|
3564
|
+
gn.reward.packageCodes.length > 0 && gn.reward.packageCodes.forEach((Bn) => {
|
|
3585
3565
|
en.push({
|
|
3586
3566
|
code: Bn,
|
|
3587
3567
|
quantity: 1,
|
|
@@ -3590,7 +3570,7 @@ function N1(N) {
|
|
|
3590
3570
|
});
|
|
3591
3571
|
}), I(en), k(nn);
|
|
3592
3572
|
try {
|
|
3593
|
-
const
|
|
3573
|
+
const qn = yield Bc({
|
|
3594
3574
|
eInvoiceRegistration: yn({}, $),
|
|
3595
3575
|
bank: x.bank,
|
|
3596
3576
|
provider: i.route,
|
|
@@ -3604,9 +3584,9 @@ function N1(N) {
|
|
|
3604
3584
|
promotionCodes: nn,
|
|
3605
3585
|
isRenew: H,
|
|
3606
3586
|
isCashRegister: X
|
|
3607
|
-
}),
|
|
3608
|
-
A(
|
|
3609
|
-
} catch (
|
|
3587
|
+
}), gn = qn.orderId, Bn = qn.amount || 0;
|
|
3588
|
+
A(gn), s ? s(Bn) : console.warn("setOrderAmount is not defined!"), yield new Promise((In) => setTimeout(In, 100)), Y(), t();
|
|
3589
|
+
} catch (qn) {
|
|
3610
3590
|
Ut(g("errorCreatingOrder") || "Failed to create order"), Y();
|
|
3611
3591
|
return;
|
|
3612
3592
|
}
|
|
@@ -3614,8 +3594,8 @@ function N1(N) {
|
|
|
3614
3594
|
type: "button",
|
|
3615
3595
|
title: g("next"),
|
|
3616
3596
|
className: "wgt:text-text-primary wgt:bg-primary",
|
|
3617
|
-
handleClick: () =>
|
|
3618
|
-
const W =
|
|
3597
|
+
handleClick: () => ln(null, null, function* () {
|
|
3598
|
+
const W = sn().find(
|
|
3619
3599
|
($) => $._id === L
|
|
3620
3600
|
), tn = z.find(
|
|
3621
3601
|
($) => $._id === f
|
|
@@ -3643,7 +3623,7 @@ function N1(N) {
|
|
|
3643
3623
|
});
|
|
3644
3624
|
ht.appendChild(c0);
|
|
3645
3625
|
function Gt() {
|
|
3646
|
-
return
|
|
3626
|
+
return ln(this, null, function* () {
|
|
3647
3627
|
var W, tn;
|
|
3648
3628
|
try {
|
|
3649
3629
|
const [
|
|
@@ -3683,16 +3663,16 @@ function N1(N) {
|
|
|
3683
3663
|
reward: en.reward
|
|
3684
3664
|
});
|
|
3685
3665
|
}), Object.keys(R).length > 0 && (B = l ? [...l] : [], vt())) : console.error("Failed to load promotions:", F.reason), an.status === "fulfilled") {
|
|
3686
|
-
y = (H ? an.value.filter((
|
|
3666
|
+
y = (H ? an.value.filter((qn) => qn.renewPrice !== 0) : an.value) || [];
|
|
3687
3667
|
const _ = X ? Q(
|
|
3688
3668
|
y,
|
|
3689
3669
|
rn.getValue()
|
|
3690
3670
|
) : y;
|
|
3691
3671
|
if (Mn(_ || []), Xn(_ || []), Mn(_ || []), an.value.length > 0) {
|
|
3692
|
-
const
|
|
3693
|
-
(
|
|
3672
|
+
const qn = _.find(
|
|
3673
|
+
(gn) => T.includes(gn.code)
|
|
3694
3674
|
);
|
|
3695
|
-
L = c ? c._id :
|
|
3675
|
+
L = c ? c._id : qn ? qn._id : _ == null ? void 0 : _[0]._id, Xn(_);
|
|
3696
3676
|
}
|
|
3697
3677
|
zn();
|
|
3698
3678
|
} else
|
|
@@ -3731,7 +3711,7 @@ function N1(N) {
|
|
|
3731
3711
|
});
|
|
3732
3712
|
}
|
|
3733
3713
|
function a0() {
|
|
3734
|
-
at(), ct(), H || St(), Tt(), Zn(),
|
|
3714
|
+
at(), ct(), H || St(), Tt(), Zn(), Nn();
|
|
3735
3715
|
}
|
|
3736
3716
|
function ft(W, tn, F) {
|
|
3737
3717
|
const nn = Object.values(R).find(
|
|
@@ -3740,7 +3720,7 @@ function N1(N) {
|
|
|
3740
3720
|
(_) => _.bank === r && _.appliedPackages.includes(tn)
|
|
3741
3721
|
), en = $ && !$.isDisabled && !($.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && $.limit !== $.used;
|
|
3742
3722
|
if (an && !en) {
|
|
3743
|
-
const { container: _, open:
|
|
3723
|
+
const { container: _, open: qn } = It({
|
|
3744
3724
|
message: g("errorDiscountPackage"),
|
|
3745
3725
|
description: g("errorDiscountPackageDes"),
|
|
3746
3726
|
okLabel: g("ok"),
|
|
@@ -3750,7 +3730,7 @@ function N1(N) {
|
|
|
3750
3730
|
isSuccess: !1,
|
|
3751
3731
|
theme: r
|
|
3752
3732
|
});
|
|
3753
|
-
O.appendChild(_),
|
|
3733
|
+
O.appendChild(_), qn();
|
|
3754
3734
|
} else
|
|
3755
3735
|
F();
|
|
3756
3736
|
}
|
|
@@ -3767,11 +3747,11 @@ function N1(N) {
|
|
|
3767
3747
|
isRenew: H,
|
|
3768
3748
|
handlePackageSelect: (W) => {
|
|
3769
3749
|
var nn, an;
|
|
3770
|
-
let tn = (nn =
|
|
3750
|
+
let tn = (nn = sn().find(
|
|
3771
3751
|
($) => $._id === L
|
|
3772
|
-
)) == null ? void 0 : nn.code, F = (an =
|
|
3752
|
+
)) == null ? void 0 : nn.code, F = (an = sn().find(($) => $._id === W)) == null ? void 0 : an.code;
|
|
3773
3753
|
ft(tn, F, () => {
|
|
3774
|
-
L = W, it.setSelectedPackageId(W), at(), Tt(), Zn(),
|
|
3754
|
+
L = W, it.setSelectedPackageId(W), at(), Tt(), Zn(), Nn();
|
|
3775
3755
|
});
|
|
3776
3756
|
}
|
|
3777
3757
|
}), Tn.appendChild(it.container);
|
|
@@ -3798,11 +3778,11 @@ function N1(N) {
|
|
|
3798
3778
|
($) => $._id === f
|
|
3799
3779
|
)) == null ? void 0 : nn.code, F = (an = z.find(($) => $._id === W)) == null ? void 0 : an.code;
|
|
3800
3780
|
if (H && f === W) {
|
|
3801
|
-
f = null, gt.setSelectedPackageId(null), at(), Tt(), Zn(),
|
|
3781
|
+
f = null, gt.setSelectedPackageId(null), at(), Tt(), Zn(), Nn();
|
|
3802
3782
|
return;
|
|
3803
3783
|
}
|
|
3804
3784
|
ft(tn, F, () => {
|
|
3805
|
-
f = W, gt.setSelectedPackageId(W), Xn(
|
|
3785
|
+
f = W, gt.setSelectedPackageId(W), Xn(sn()), at(), Tt(), Zn(), Nn();
|
|
3806
3786
|
});
|
|
3807
3787
|
}
|
|
3808
3788
|
}), Un.appendChild(gt.container);
|
|
@@ -3815,7 +3795,7 @@ function N1(N) {
|
|
|
3815
3795
|
rt.className = "wgt:w-full", Z.appendChild(rt);
|
|
3816
3796
|
function Tt() {
|
|
3817
3797
|
Qn.remove(), rt.innerHTML = "";
|
|
3818
|
-
const W =
|
|
3798
|
+
const W = sn().find(
|
|
3819
3799
|
(tn) => tn._id === L
|
|
3820
3800
|
);
|
|
3821
3801
|
if (G.length > 0) {
|
|
@@ -3839,7 +3819,7 @@ function N1(N) {
|
|
|
3839
3819
|
const Jn = document.createElement("div");
|
|
3840
3820
|
Jn.className = "promotion-wrapper wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
|
|
3841
3821
|
function at() {
|
|
3842
|
-
const W =
|
|
3822
|
+
const W = sn().find(
|
|
3843
3823
|
(an) => an._id === L
|
|
3844
3824
|
), tn = z.find(
|
|
3845
3825
|
(an) => an._id === f
|
|
@@ -3849,15 +3829,15 @@ function N1(N) {
|
|
|
3849
3829
|
const $ = R[an];
|
|
3850
3830
|
if ($.bank !== r) {
|
|
3851
3831
|
$.isDisabled = !0, B = B.filter(
|
|
3852
|
-
(
|
|
3832
|
+
(En) => En !== $.code
|
|
3853
3833
|
);
|
|
3854
3834
|
return;
|
|
3855
3835
|
}
|
|
3856
|
-
const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = $.limit <= $.used,
|
|
3857
|
-
(
|
|
3858
|
-
)) && !en && !_ && !
|
|
3836
|
+
const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = $.limit <= $.used, qn = !$.isActive, Bn = ((In = $.appliedPackages) == null ? void 0 : In.some(
|
|
3837
|
+
(En) => nn.includes(En)
|
|
3838
|
+
)) && !en && !_ && !qn;
|
|
3859
3839
|
$.isDisabled = !Bn, Bn ? Bn && !B.includes($.code) && B.push($.code) : B = B.filter(
|
|
3860
|
-
(
|
|
3840
|
+
(En) => En !== $.code
|
|
3861
3841
|
);
|
|
3862
3842
|
}), vt();
|
|
3863
3843
|
}
|
|
@@ -3883,28 +3863,28 @@ function N1(N) {
|
|
|
3883
3863
|
const F = document.createElement("div");
|
|
3884
3864
|
F.className = "wgt:w-full wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";
|
|
3885
3865
|
const nn = document.createElement("div");
|
|
3886
|
-
nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit", F.appendChild(nn), B && B.length > 0 && B.filter((
|
|
3887
|
-
const
|
|
3888
|
-
(Bn) => Bn.code ===
|
|
3866
|
+
nn.className = "wgt:flex wgt:min-w-[500px] wgt:h-11 wgt:items-center wgt:gap-3 wgt:px-3 wgt:py-2 wgt:rounded-lg wgt:bg-white wgt:border wgt:border-[#E4E7EC] wgt:@max-2xl:min-w-full wgt:@max-2xl:flex-wrap wgt:@max-2xl:h-fit", F.appendChild(nn), B && B.length > 0 && B.filter((qn) => {
|
|
3867
|
+
const gn = Object.values(R).find(
|
|
3868
|
+
(Bn) => Bn.code === qn
|
|
3889
3869
|
);
|
|
3890
|
-
return
|
|
3891
|
-
}).forEach((
|
|
3892
|
-
const
|
|
3893
|
-
|
|
3870
|
+
return gn && gn.bank === r;
|
|
3871
|
+
}).forEach((qn) => {
|
|
3872
|
+
const gn = document.createElement("div");
|
|
3873
|
+
gn.className = "wgt:flex wgt:w-fit wgt:h-fit wgt:items-center wgt:gap-2 wgt:px-2 wgt:py-1.5 wgt:rounded-md wgt:bg-primary/10 wgt:border wgt:border-primary wgt:text-sm wgt:font-medium wgt:text-primary", gn.innerText = qn;
|
|
3894
3874
|
const Bn = yt({
|
|
3895
3875
|
type: "button",
|
|
3896
3876
|
title: "x",
|
|
3897
3877
|
handleClick: () => {
|
|
3898
3878
|
B = B.filter(
|
|
3899
|
-
(In) => In !==
|
|
3900
|
-
), Zn(),
|
|
3879
|
+
(In) => In !== qn
|
|
3880
|
+
), Zn(), Nn();
|
|
3901
3881
|
}
|
|
3902
3882
|
});
|
|
3903
3883
|
Bn.className = "wgt:w-fit wgt:h-fit wgt:p-0 wgt:bg-transparent wgt:cursor-pointer", Bn.innerHTML = `<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3904
3884
|
<path d="M1.17157 1.17163L6.82842 6.82848" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3905
3885
|
<path d="M1.17158 6.82849L6.82843 1.17163" stroke="#0E121B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3906
3886
|
</svg>
|
|
3907
|
-
`,
|
|
3887
|
+
`, gn.appendChild(Bn), nn.appendChild(gn);
|
|
3908
3888
|
});
|
|
3909
3889
|
const an = yt({
|
|
3910
3890
|
type: "button",
|
|
@@ -3922,27 +3902,27 @@ function N1(N) {
|
|
|
3922
3902
|
);
|
|
3923
3903
|
if (en.length > 0)
|
|
3924
3904
|
en.forEach((_) => {
|
|
3925
|
-
const { container:
|
|
3905
|
+
const { container: qn } = w1({
|
|
3926
3906
|
promotion: Yn(yn({}, _), {
|
|
3927
3907
|
isSelected: B.includes(_.code)
|
|
3928
3908
|
}),
|
|
3929
|
-
onSelect: (
|
|
3930
|
-
Bn ? B.push(
|
|
3931
|
-
(In) => In !==
|
|
3932
|
-
), Zn(),
|
|
3909
|
+
onSelect: (gn, Bn) => {
|
|
3910
|
+
Bn ? B.push(gn) : B = B.filter(
|
|
3911
|
+
(In) => In !== gn
|
|
3912
|
+
), Zn(), Nn();
|
|
3933
3913
|
},
|
|
3934
3914
|
isDisabled: _.isDisabled || _.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || _.limit === _.used
|
|
3935
3915
|
});
|
|
3936
|
-
$.appendChild(
|
|
3916
|
+
$.appendChild(qn);
|
|
3937
3917
|
});
|
|
3938
3918
|
else {
|
|
3939
3919
|
const _ = document.createElement("span");
|
|
3940
3920
|
_.className = "wgt:text-text-sub-600", _.innerText = g("noPromotionFound"), Jn.appendChild(_);
|
|
3941
3921
|
}
|
|
3942
3922
|
}
|
|
3943
|
-
function
|
|
3944
|
-
var
|
|
3945
|
-
if (M(), On.innerHTML = "", Z.appendChild(_n), Z.appendChild(tt), Z.appendChild(Rn),
|
|
3923
|
+
function Nn() {
|
|
3924
|
+
var En, Dn, on, Fn, $n, et, Mt, Jt, Dt;
|
|
3925
|
+
if (M(), On.innerHTML = "", Z.appendChild(_n), Z.appendChild(tt), Z.appendChild(Rn), sn().length === 0 && z.length === 0) {
|
|
3946
3926
|
const K = document.createElement("tr");
|
|
3947
3927
|
K.innerHTML = `
|
|
3948
3928
|
<td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
|
|
@@ -3951,7 +3931,7 @@ function N1(N) {
|
|
|
3951
3931
|
`, On.appendChild(K), q(0);
|
|
3952
3932
|
return;
|
|
3953
3933
|
}
|
|
3954
|
-
const W =
|
|
3934
|
+
const W = sn().find(
|
|
3955
3935
|
(K) => K._id === L
|
|
3956
3936
|
);
|
|
3957
3937
|
if (!H && (G == null ? void 0 : G.length) > 0 && !(W != null && W.withoutInitialFee)) {
|
|
@@ -3967,16 +3947,16 @@ function N1(N) {
|
|
|
3967
3947
|
fn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
|
|
3968
3948
|
const wn = document.createElement("button");
|
|
3969
3949
|
wn.type = "button", wn.ariaLabel = g("decrease"), wn.disabled = !0, wn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", wn.innerText = "–", wn.addEventListener("click", () => {
|
|
3970
|
-
P > 1 && (P -= 1,
|
|
3950
|
+
P > 1 && (P -= 1, Nn());
|
|
3971
3951
|
}), fn.appendChild(wn);
|
|
3972
3952
|
const pn = document.createElement("span");
|
|
3973
3953
|
pn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", pn.innerText = P, fn.appendChild(pn);
|
|
3974
3954
|
const Cn = document.createElement("button");
|
|
3975
3955
|
Cn.type = "button", Cn.ariaLabel = g("increase"), Cn.disabled = !0, Cn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:cursor-not-allowed wgt:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", Cn.innerText = "+", Cn.addEventListener("click", () => {
|
|
3976
|
-
P += 1,
|
|
3956
|
+
P += 1, Nn();
|
|
3977
3957
|
}), fn.appendChild(Cn), bn.appendChild(fn), K.appendChild(bn);
|
|
3978
3958
|
const kn = document.createElement("td");
|
|
3979
|
-
kn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", kn.innerText = Sn((
|
|
3959
|
+
kn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", kn.innerText = Sn((En = G[0]) == null ? void 0 : En.price) + " VND", K.appendChild(kn);
|
|
3980
3960
|
const Hn = document.createElement("td");
|
|
3981
3961
|
Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:min-w-[16rem] wgt:@max-2xl:hidden", Hn.innerText = Sn(((Dn = G[0]) == null ? void 0 : Dn.price) * P) + " VND", K.appendChild(Hn);
|
|
3982
3962
|
const Vn = document.createElement("div");
|
|
@@ -3984,7 +3964,7 @@ function N1(N) {
|
|
|
3984
3964
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
3985
3965
|
<span>${g("unitPrice")}:</span>
|
|
3986
3966
|
<span class="wgt:font-medium">${Sn(
|
|
3987
|
-
(
|
|
3967
|
+
(on = G[0]) == null ? void 0 : on.price
|
|
3988
3968
|
)} VND</span>
|
|
3989
3969
|
</div>
|
|
3990
3970
|
<div class="wgt:flex wgt:justify-between wgt:text-base wgt:font-semibold wgt:text-strong-950">
|
|
@@ -4012,13 +3992,13 @@ function N1(N) {
|
|
|
4012
3992
|
pn.type = "button", pn.ariaLabel = g("decrease");
|
|
4013
3993
|
const Cn = b ? ($n = K == null ? void 0 : K.price) != null ? $n : 0 : (et = K == null ? void 0 : K.renewPrice) != null ? et : 0;
|
|
4014
3994
|
pn.disabled = E <= 1 || Cn === 0, pn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", pn.innerText = "–", pn.addEventListener("click", () => {
|
|
4015
|
-
E > 1 && (E -= 1,
|
|
3995
|
+
E > 1 && (E -= 1, Nn());
|
|
4016
3996
|
}), wn.appendChild(pn);
|
|
4017
3997
|
const kn = document.createElement("span");
|
|
4018
3998
|
kn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", kn.innerText = Cn === 0 ? 1 : E, wn.appendChild(kn);
|
|
4019
3999
|
const Hn = document.createElement("button");
|
|
4020
4000
|
Hn.type = "button", Hn.ariaLabel = g("increase"), Hn.disabled = (K == null ? void 0 : K.price) === 0, Hn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", Hn.innerText = "+", Hn.addEventListener("click", () => {
|
|
4021
|
-
Cn !== 0 && (E += 1,
|
|
4001
|
+
Cn !== 0 && (E += 1, Nn());
|
|
4022
4002
|
}), wn.appendChild(Hn), fn.appendChild(wn), un.appendChild(fn);
|
|
4023
4003
|
const Vn = document.createElement("td");
|
|
4024
4004
|
Vn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", Vn.innerText = Sn(Cn * (K == null ? void 0 : K.limit)) + " VND", un.appendChild(Vn);
|
|
@@ -4057,13 +4037,13 @@ function N1(N) {
|
|
|
4057
4037
|
wn.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
|
|
4058
4038
|
const pn = document.createElement("button");
|
|
4059
4039
|
pn.type = "button", pn.ariaLabel = g("decrease"), pn.disabled = v <= 1, pn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold" + (v <= 1 ? " wgt:cursor-not-allowed wgt:opacity-50" : ""), pn.innerText = "–", pn.addEventListener("click", () => {
|
|
4060
|
-
v > 1 && (v -= 1,
|
|
4040
|
+
v > 1 && (v -= 1, Nn());
|
|
4061
4041
|
}), wn.appendChild(pn);
|
|
4062
4042
|
const Cn = document.createElement("span");
|
|
4063
4043
|
Cn.className = "wgt:max-w-10 wgt:text-center wgt:text-sm wgt:font-medium wgt:text-text-black wgt:focus:outline-none wgt:@max-2xl:text-lg wgt:@max-2xl:min-w-[60px] wgt:@max-2xl:font-semibold", Cn.innerText = v, wn.appendChild(Cn);
|
|
4064
4044
|
const kn = document.createElement("button");
|
|
4065
4045
|
kn.type = "button", kn.ariaLabel = g("increase"), kn.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", kn.innerText = "+", kn.addEventListener("click", () => {
|
|
4066
|
-
v += 1,
|
|
4046
|
+
v += 1, Nn();
|
|
4067
4047
|
}), wn.appendChild(kn), fn.appendChild(wn), un.appendChild(fn);
|
|
4068
4048
|
const Hn = document.createElement("td");
|
|
4069
4049
|
Hn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-5 wgt:text-left wgt:text-sm wgt:text-strong-950 wgt:font-medium wgt:@max-2xl:hidden", Hn.innerText = Sn((K == null ? void 0 : K.limit) * (K == null ? void 0 : K.price)) + " VND", un.appendChild(Hn);
|
|
@@ -4112,7 +4092,7 @@ function N1(N) {
|
|
|
4112
4092
|
"package"
|
|
4113
4093
|
)} ${(Vn = (Hn = K == null ? void 0 : K.reward) == null ? void 0 : Hn.packageCodes) == null ? void 0 : Vn.join(", ")}`, fn.style.color = "#12B76A") : fn.innerText = "", un.appendChild(fn), On.appendChild(un);
|
|
4114
4094
|
});
|
|
4115
|
-
const nn = !H && G.length > 0 && !(W != null && W.withoutInitialFee) ? ((Mt = G[0]) == null ? void 0 : Mt.price) * P : 0, an = qt(L), $ = an ? H ? (Dt = an.renewPrice) != null ? Dt : 0 : (Jt = an.price) != null ? Jt : 0 : 0, en = an ? $ * an.limit * E : 0, _ = j(f),
|
|
4095
|
+
const nn = !H && G.length > 0 && !(W != null && W.withoutInitialFee) ? ((Mt = G[0]) == null ? void 0 : Mt.price) * P : 0, an = qt(L), $ = an ? H ? (Dt = an.renewPrice) != null ? Dt : 0 : (Jt = an.price) != null ? Jt : 0 : 0, en = an ? $ * an.limit * E : 0, _ = j(f), qn = _ ? _.price * _.limit * v : 0, gn = nn + en + qn, Bn = Math.min(F, gn), In = Math.max(gn - Bn, 0);
|
|
4116
4096
|
q(In);
|
|
4117
4097
|
{
|
|
4118
4098
|
const K = document.createElement("tr");
|
|
@@ -4314,8 +4294,8 @@ function k1({
|
|
|
4314
4294
|
An.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", An.innerText = g("promotion");
|
|
4315
4295
|
const Tn = document.createElement("div");
|
|
4316
4296
|
Tn.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", a.forEach((Mn) => {
|
|
4317
|
-
const
|
|
4318
|
-
|
|
4297
|
+
const sn = document.createElement("div");
|
|
4298
|
+
sn.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", sn.innerText = Mn, Tn.appendChild(sn);
|
|
4319
4299
|
}), Z.appendChild(An), Z.appendChild(Tn), w.appendChild(Z);
|
|
4320
4300
|
}
|
|
4321
4301
|
const B = document.createElement("hr");
|
|
@@ -4356,12 +4336,12 @@ function k1({
|
|
|
4356
4336
|
container: O,
|
|
4357
4337
|
open: U,
|
|
4358
4338
|
close: cn
|
|
4359
|
-
} =
|
|
4339
|
+
} = t0();
|
|
4360
4340
|
document.body.appendChild(O);
|
|
4361
4341
|
const Y = yt({
|
|
4362
4342
|
title: A ? g("confirmFreeOrder") || "Xác nhận đơn hàng" : g("cancelTransaction") || "Hủy giao dịch",
|
|
4363
4343
|
className: A ? "wgt:flex-1 wgt:py-3 wgt:rounded-lg wgt:bg-primary wgt:text-white hover:wgt:bg-primary-dark" : "wgt:w-full wgt:py-3 wgt:rounded-lg wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary hover:wgt:bg-transparent",
|
|
4364
|
-
handleClick: A ? () =>
|
|
4344
|
+
handleClick: A ? () => ln(null, null, function* () {
|
|
4365
4345
|
Y.disabled = !0;
|
|
4366
4346
|
const Z = Y.textContent;
|
|
4367
4347
|
Y.textContent = g("processing") || "Đang xử lý...", U();
|
|
@@ -6195,7 +6175,7 @@ function ca({
|
|
|
6195
6175
|
}
|
|
6196
6176
|
const aa = 5;
|
|
6197
6177
|
function ea(o) {
|
|
6198
|
-
return
|
|
6178
|
+
return ln(this, arguments, function* ({
|
|
6199
6179
|
onNext: t,
|
|
6200
6180
|
onPrev: n,
|
|
6201
6181
|
step: e,
|
|
@@ -6214,7 +6194,7 @@ function ea(o) {
|
|
|
6214
6194
|
container: C,
|
|
6215
6195
|
open: X,
|
|
6216
6196
|
close: y
|
|
6217
|
-
} =
|
|
6197
|
+
} = t0();
|
|
6218
6198
|
N.appendChild(C);
|
|
6219
6199
|
const Q = document.createElement("div");
|
|
6220
6200
|
Q.className = "wgt:w-full wgt:flex wgt:items-start wgt:gap-6 wgt:@max-2xl:flex-col-reverse";
|
|
@@ -6266,7 +6246,7 @@ function ea(o) {
|
|
|
6266
6246
|
}), n && (clearInterval(s), s = null, n());
|
|
6267
6247
|
}), G.appendChild(R), N.appendChild(G);
|
|
6268
6248
|
function T() {
|
|
6269
|
-
return
|
|
6249
|
+
return ln(this, null, function* () {
|
|
6270
6250
|
const M = (h == null ? void 0 : h.totalAmountText) || 0;
|
|
6271
6251
|
d = M, x = M === 0, Gn(Wn.STEP3_VIEWED, {
|
|
6272
6252
|
orderId: r,
|
|
@@ -6278,7 +6258,7 @@ function ea(o) {
|
|
|
6278
6258
|
});
|
|
6279
6259
|
}
|
|
6280
6260
|
function m(M) {
|
|
6281
|
-
return
|
|
6261
|
+
return ln(this, null, function* () {
|
|
6282
6262
|
var D, j, O, U;
|
|
6283
6263
|
if (!(i || x)) {
|
|
6284
6264
|
i = !0, X();
|
|
@@ -6344,7 +6324,7 @@ function ea(o) {
|
|
|
6344
6324
|
});
|
|
6345
6325
|
}
|
|
6346
6326
|
function P() {
|
|
6347
|
-
x || s || (s = setInterval(() =>
|
|
6327
|
+
x || s || (s = setInterval(() => ln(null, null, function* () {
|
|
6348
6328
|
var M, D, j, O, U, cn;
|
|
6349
6329
|
try {
|
|
6350
6330
|
const Y = yield kc(r);
|
|
@@ -6610,7 +6590,7 @@ function ga() {
|
|
|
6610
6590
|
};
|
|
6611
6591
|
}
|
|
6612
6592
|
function Rh(c) {
|
|
6613
|
-
return
|
|
6593
|
+
return ln(this, arguments, function* ({
|
|
6614
6594
|
orderId: t,
|
|
6615
6595
|
callbackUrl: n,
|
|
6616
6596
|
onCompleteSignature: e
|
|
@@ -6878,7 +6858,7 @@ function da({
|
|
|
6878
6858
|
return { container: i, open: V, close: L };
|
|
6879
6859
|
}
|
|
6880
6860
|
function L0(t, n, e, c = !1, h = "ocb", a = "") {
|
|
6881
|
-
return
|
|
6861
|
+
return ln(this, null, function* () {
|
|
6882
6862
|
var u, o;
|
|
6883
6863
|
try {
|
|
6884
6864
|
if (h !== "bvb") {
|
|
@@ -6899,7 +6879,7 @@ function L0(t, n, e, c = !1, h = "ocb", a = "") {
|
|
|
6899
6879
|
// },
|
|
6900
6880
|
onCancel: () => {
|
|
6901
6881
|
},
|
|
6902
|
-
onConfirm: () =>
|
|
6882
|
+
onConfirm: () => ln(null, null, function* () {
|
|
6903
6883
|
const i = yield _t(t, n);
|
|
6904
6884
|
e(!1, i);
|
|
6905
6885
|
}),
|
|
@@ -6915,7 +6895,7 @@ function L0(t, n, e, c = !1, h = "ocb", a = "") {
|
|
|
6915
6895
|
});
|
|
6916
6896
|
}
|
|
6917
6897
|
function Xa(t, n, e, c, h, a) {
|
|
6918
|
-
return
|
|
6898
|
+
return ln(this, null, function* () {
|
|
6919
6899
|
var v, M;
|
|
6920
6900
|
const o = [
|
|
6921
6901
|
{ name: "M-Invoice", route: "m-invoice", logoUrl: dc },
|
|
@@ -7075,7 +7055,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7075
7055
|
});
|
|
7076
7056
|
}
|
|
7077
7057
|
function G(D, j) {
|
|
7078
|
-
return
|
|
7058
|
+
return ln(this, null, function* () {
|
|
7079
7059
|
D ? d = Yn(yn({}, d), {
|
|
7080
7060
|
eInvoiceRegistration: {
|
|
7081
7061
|
organization: yn({}, D.organization),
|
|
@@ -7089,7 +7069,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7089
7069
|
});
|
|
7090
7070
|
}
|
|
7091
7071
|
function R(D) {
|
|
7092
|
-
return
|
|
7072
|
+
return ln(this, null, function* () {
|
|
7093
7073
|
if (D === 1) {
|
|
7094
7074
|
const { container: j } = yield r1({
|
|
7095
7075
|
isNewCustomer: k,
|
|
@@ -7097,7 +7077,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7097
7077
|
providerProps: {
|
|
7098
7078
|
providers: o,
|
|
7099
7079
|
selectedRoute: x.route,
|
|
7100
|
-
onProviderChange: (O) =>
|
|
7080
|
+
onProviderChange: (O) => ln(null, null, function* () {
|
|
7101
7081
|
var U, cn;
|
|
7102
7082
|
x = O, yield L0(
|
|
7103
7083
|
O.route,
|
|
@@ -7159,7 +7139,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7159
7139
|
isNewCustomer: k
|
|
7160
7140
|
});
|
|
7161
7141
|
const { container: j } = yield N1({
|
|
7162
|
-
onNext: () =>
|
|
7142
|
+
onNext: () => ln(null, null, function* () {
|
|
7163
7143
|
Gn(Wn.STEP2_COMPLETED, {
|
|
7164
7144
|
theme: h,
|
|
7165
7145
|
provider: x == null ? void 0 : x.route,
|
|
@@ -7269,11 +7249,11 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7269
7249
|
}
|
|
7270
7250
|
});
|
|
7271
7251
|
}
|
|
7272
|
-
const { container: T, open: m } =
|
|
7252
|
+
const { container: T, open: m } = t0();
|
|
7273
7253
|
I && (i(T), m()), yield L0(
|
|
7274
7254
|
x.route,
|
|
7275
7255
|
(M = (v = d == null ? void 0 : d.eInvoiceRegistration) == null ? void 0 : v.organization) == null ? void 0 : M.taxCode,
|
|
7276
|
-
(D, j) =>
|
|
7256
|
+
(D, j) => ln(null, null, function* () {
|
|
7277
7257
|
I = !1, k = D, G(j), q.updateTitle(
|
|
7278
7258
|
a ? g("eInvoiceRenewal") : g("eInvoiceRegister")
|
|
7279
7259
|
);
|
|
@@ -7294,12 +7274,12 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7294
7274
|
});
|
|
7295
7275
|
}
|
|
7296
7276
|
function Ba(t, n, e, c) {
|
|
7297
|
-
return
|
|
7277
|
+
return ln(this, null, function* () {
|
|
7298
7278
|
const { container: h, setContent: a } = ga(), u = e == null ? void 0 : e.orderId, o = (e == null ? void 0 : e.callbackUrl) || `${window.location.origin}/dashboard`, { container: A } = yield Rh({
|
|
7299
7279
|
orderId: u,
|
|
7300
7280
|
callbackUrl: o,
|
|
7301
7281
|
// onCompleteSignature,
|
|
7302
|
-
onCompleteSignature: (...i) =>
|
|
7282
|
+
onCompleteSignature: (...i) => ln(null, null, function* () {
|
|
7303
7283
|
c && (yield c(...i)), r();
|
|
7304
7284
|
})
|
|
7305
7285
|
});
|