@invoice-sdk/widget 1.115.5 → 1.115.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-C9FKdqPq.js → index-B3BxLLGz.js} +2 -2
- package/dist/{index-C-62FO8g.js → index-BInljDkt.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +18 -18
- package/dist/{invoice-CHFiEOk7.js → invoice-QZ5cgmMz.js} +2 -2
- package/dist/{widget-CHPpGsNJ.js → widget-Bg4h17Ae.js} +114 -108
- package/dist/widget.css +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ var Ah = (t, n, e) => n in t ? lc(t, n, { enumerable: !0, configurable: !0, writ
|
|
|
9
9
|
for (var e of zt(n))
|
|
10
10
|
oh.call(n, e) && Ah(t, e, n[e]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
12
|
+
}, Yn = (t, n) => ic(t, gc(n));
|
|
13
13
|
var mh = (t, n) => {
|
|
14
14
|
var e = {};
|
|
15
15
|
for (var c in t)
|
|
@@ -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 Bc, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc } from "./invoice-
|
|
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-BInljDkt.js";
|
|
39
|
+
import { c as yt, a as _h, g as _t, b as fc, f as Sn, d as Xc, e as Bc, h as Nc, i as Ec, j as Hc, k as yc, l as Pc, m as kc } from "./invoice-QZ5cgmMz.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");
|
|
@@ -335,7 +335,7 @@ function Lc({
|
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Kn({
|
|
339
339
|
name: t,
|
|
340
340
|
value: n = "",
|
|
341
341
|
type: e = "text",
|
|
@@ -1382,7 +1382,7 @@ function Dc() {
|
|
|
1382
1382
|
Tn -= 7;
|
|
1383
1383
|
An += 7 - Tn;
|
|
1384
1384
|
for (var Mn = !1, qn = 0, mt = 0; qn < An; qn++) {
|
|
1385
|
-
var Xn = new Date(T, m, 1 + (qn - D)), qt = x(this._d) ? w(Xn, this._d) : !1, zn = w(Xn, v), Un = E.events.indexOf(Xn.toDateString()) !== -1, nt = qn < D || qn >= M + D, Qn = 1 + (qn - D), Rn = m, _n = T,
|
|
1385
|
+
var Xn = new Date(T, m, 1 + (qn - D)), qt = x(this._d) ? w(Xn, this._d) : !1, zn = w(Xn, v), Un = E.events.indexOf(Xn.toDateString()) !== -1, nt = qn < D || qn >= M + D, Qn = 1 + (qn - 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
1386
|
nt && (qn < D ? (Qn = Z + Qn, Rn = U, _n = Y) : (Qn = Qn - M, Rn = cn, _n = rn));
|
|
1387
1387
|
var ht = {
|
|
1388
1388
|
day: Qn,
|
|
@@ -1393,7 +1393,7 @@ function Dc() {
|
|
|
1393
1393
|
isToday: zn,
|
|
1394
1394
|
isDisabled: st,
|
|
1395
1395
|
isEmpty: nt,
|
|
1396
|
-
isStartRange:
|
|
1396
|
+
isStartRange: On,
|
|
1397
1397
|
isEndRange: tt,
|
|
1398
1398
|
isInRange: dt,
|
|
1399
1399
|
showDaysInNextAndPreviousMonths: E.showDaysInNextAndPreviousMonths,
|
|
@@ -1547,10 +1547,10 @@ function Fc() {
|
|
|
1547
1547
|
tc(), Pn && Pn.parentNode && Pn.parentNode.removeChild(Pn), Ht && window.removeEventListener("resize", Ht), Pn = null, Ht = null, Ct = [];
|
|
1548
1548
|
}
|
|
1549
1549
|
const pt = {
|
|
1550
|
-
info: (t, n = {}) => Rt(t,
|
|
1551
|
-
success: (t, n = {}) => Rt(t,
|
|
1552
|
-
warning: (t, n = {}) => Rt(t,
|
|
1553
|
-
error: (t, n = {}) => Rt(t,
|
|
1550
|
+
info: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "info" })),
|
|
1551
|
+
success: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "success" })),
|
|
1552
|
+
warning: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "warning" })),
|
|
1553
|
+
error: (t, n = {}) => Rt(t, Yn(yn({}, n), { type: "error" })),
|
|
1554
1554
|
clear: tc,
|
|
1555
1555
|
destroy: Fc
|
|
1556
1556
|
};
|
|
@@ -1898,7 +1898,7 @@ function l1(t, n = "sourceCanvas") {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
});
|
|
1900
1900
|
}
|
|
1901
|
-
const i1 = () => typeof window != "undefined" && typeof window.umami != "undefined",
|
|
1901
|
+
const i1 = () => typeof window != "undefined" && typeof window.umami != "undefined", Gn = (t, n = {}) => {
|
|
1902
1902
|
if (!i1())
|
|
1903
1903
|
if (console.warn("[Analytics] Umami not loaded, using PostMessage fallback"), typeof window != "undefined" && window.parent && window.parent !== window)
|
|
1904
1904
|
try {
|
|
@@ -1906,7 +1906,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1906
1906
|
type: "UMAMI_TRACK",
|
|
1907
1907
|
payload: {
|
|
1908
1908
|
eventName: t,
|
|
1909
|
-
eventData:
|
|
1909
|
+
eventData: Yn(yn({}, n), {
|
|
1910
1910
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1911
1911
|
source: "sdk-widget"
|
|
1912
1912
|
})
|
|
@@ -1919,7 +1919,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1919
1919
|
else
|
|
1920
1920
|
return console.error("❌ [Analytics] Not in iframe, cannot send PostMessage"), !1;
|
|
1921
1921
|
try {
|
|
1922
|
-
return window.umami.track(t,
|
|
1922
|
+
return window.umami.track(t, Yn(yn({}, n), {
|
|
1923
1923
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1924
1924
|
source: "sdk-widget"
|
|
1925
1925
|
})), !0;
|
|
@@ -1929,7 +1929,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1929
1929
|
e
|
|
1930
1930
|
), !1;
|
|
1931
1931
|
}
|
|
1932
|
-
},
|
|
1932
|
+
}, Wn = {
|
|
1933
1933
|
// ==================== STEP 1: Registration ====================
|
|
1934
1934
|
STEP1_VIEWED: "einv_view_registration_form",
|
|
1935
1935
|
STEP1_COMPLETED: "einv_button_click_register",
|
|
@@ -1945,7 +1945,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1945
1945
|
STEP3_PAYMENT_WRONG_AMOUNT: "einv_payment_wrong_amount"
|
|
1946
1946
|
}, Zt = {
|
|
1947
1947
|
success(t) {
|
|
1948
|
-
|
|
1948
|
+
Gn(Wn.STEP3_PAYMENT_SUCCESS, {
|
|
1949
1949
|
orderId: t.orderId,
|
|
1950
1950
|
amount: t.amount,
|
|
1951
1951
|
transactionId: t.transactionId,
|
|
@@ -1956,7 +1956,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1956
1956
|
});
|
|
1957
1957
|
},
|
|
1958
1958
|
failed(t) {
|
|
1959
|
-
|
|
1959
|
+
Gn(Wn.STEP3_PAYMENT_FAILED, {
|
|
1960
1960
|
orderId: t.orderId,
|
|
1961
1961
|
amount: t.amount,
|
|
1962
1962
|
errorCode: t.errorCode,
|
|
@@ -1968,7 +1968,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1968
1968
|
});
|
|
1969
1969
|
},
|
|
1970
1970
|
wrongAmount(t) {
|
|
1971
|
-
|
|
1971
|
+
Gn(Wn.STEP3_PAYMENT_WRONG_AMOUNT, {
|
|
1972
1972
|
orderId: t.orderId,
|
|
1973
1973
|
expectedAmount: t.expectedAmount,
|
|
1974
1974
|
receivedAmount: t.receivedAmount,
|
|
@@ -1991,7 +1991,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
1991
1991
|
// });
|
|
1992
1992
|
// },
|
|
1993
1993
|
freeOrderConfirmed(t) {
|
|
1994
|
-
|
|
1994
|
+
Gn(Wn.STEP3_FREE_ORDER_CONFIRMED, {
|
|
1995
1995
|
orderId: t.orderId,
|
|
1996
1996
|
totalAmount: t.totalAmount,
|
|
1997
1997
|
orderAmount: t.orderAmount,
|
|
@@ -2001,7 +2001,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
2001
2001
|
}
|
|
2002
2002
|
}, rh = {
|
|
2003
2003
|
success(t) {
|
|
2004
|
-
|
|
2004
|
+
Gn(Wn.STEP3_QR_GENERATION_SUCCESS, {
|
|
2005
2005
|
orderId: t.orderId,
|
|
2006
2006
|
amount: t.amount,
|
|
2007
2007
|
qrUrl: t.qrUrl,
|
|
@@ -2012,7 +2012,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
2012
2012
|
});
|
|
2013
2013
|
},
|
|
2014
2014
|
failed(t) {
|
|
2015
|
-
|
|
2015
|
+
Gn(Wn.STEP3_QR_GENERATION_FAILED, {
|
|
2016
2016
|
orderId: t.orderId,
|
|
2017
2017
|
amount: t.amount,
|
|
2018
2018
|
errorCode: t.errorCode,
|
|
@@ -2024,7 +2024,7 @@ const i1 = () => typeof window != "undefined" && typeof window.umami != "undefin
|
|
|
2024
2024
|
}
|
|
2025
2025
|
}, Th = {
|
|
2026
2026
|
stopped(t) {
|
|
2027
|
-
|
|
2027
|
+
Gn(Wn.STEP3_POLLING_STOPPED, {
|
|
2028
2028
|
orderId: t.orderId,
|
|
2029
2029
|
reason: t.reason,
|
|
2030
2030
|
duration: t.duration,
|
|
@@ -2059,7 +2059,7 @@ function g1(l) {
|
|
|
2059
2059
|
isRenewal: i = !1
|
|
2060
2060
|
}) {
|
|
2061
2061
|
var et, Mt, Jt, Dt, K, un, dn, bn, fn, wn, pn, Cn, kn, Hn, Vn, At, Lt, S0, M0, J0, D0, K0, O0, Y0, G0, W0, z0, F0, R0, Z0, j0, U0, _0, $0, nh, th, hh, ch, ah, eh;
|
|
2062
|
-
|
|
2062
|
+
Gn(Wn.STEP1_VIEWED, {
|
|
2063
2063
|
theme: e,
|
|
2064
2064
|
isRenewal: i
|
|
2065
2065
|
});
|
|
@@ -2097,13 +2097,13 @@ function g1(l) {
|
|
|
2097
2097
|
b.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
|
|
2098
2098
|
const w = document.createElement("form");
|
|
2099
2099
|
w.className = "wgt:w-full wgt:max-w-[1072px] wgt:mx-auto wgt:space-y-4", w.addEventListener("submit", (J) => {
|
|
2100
|
-
if (J.preventDefault(), !
|
|
2100
|
+
if (J.preventDefault(), !Dn()) return;
|
|
2101
2101
|
const S = Fn();
|
|
2102
2102
|
typeof t == "function" && t(S);
|
|
2103
2103
|
}), b.appendChild(w);
|
|
2104
2104
|
let p, H, N, C, X, y, Q, V, L, f, B, z, G, R, T, m, P, E, v, M, D, j, O, U, cn;
|
|
2105
2105
|
const Y = document.createElement("button");
|
|
2106
|
-
p =
|
|
2106
|
+
p = Kn({
|
|
2107
2107
|
name: "taxCode",
|
|
2108
2108
|
label: g("taxCode"),
|
|
2109
2109
|
required: !0,
|
|
@@ -2129,7 +2129,7 @@ function g1(l) {
|
|
|
2129
2129
|
}
|
|
2130
2130
|
p.setError(null), Mn(on), gn();
|
|
2131
2131
|
}
|
|
2132
|
-
}), H =
|
|
2132
|
+
}), H = Kn({
|
|
2133
2133
|
name: "companyName",
|
|
2134
2134
|
label: g("companyName"),
|
|
2135
2135
|
required: !0,
|
|
@@ -2139,7 +2139,7 @@ function g1(l) {
|
|
|
2139
2139
|
value: ((Dt = (Jt = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : Jt.organization) == null ? void 0 : Dt.name) || "",
|
|
2140
2140
|
readOnly: !1,
|
|
2141
2141
|
horizontal: !0
|
|
2142
|
-
}), N =
|
|
2142
|
+
}), N = Kn({
|
|
2143
2143
|
name: "companyAddressDetail",
|
|
2144
2144
|
label: g("address"),
|
|
2145
2145
|
required: !0,
|
|
@@ -2185,7 +2185,7 @@ function g1(l) {
|
|
|
2185
2185
|
gn();
|
|
2186
2186
|
},
|
|
2187
2187
|
error: null
|
|
2188
|
-
}), L =
|
|
2188
|
+
}), L = Kn({
|
|
2189
2189
|
name: "repName",
|
|
2190
2190
|
label: g("fullName"),
|
|
2191
2191
|
required: !0,
|
|
@@ -2201,7 +2201,7 @@ function g1(l) {
|
|
|
2201
2201
|
}
|
|
2202
2202
|
Ft(S) ? L.setError(null) : L.setError(g("errorInvalidName"));
|
|
2203
2203
|
}
|
|
2204
|
-
}), f =
|
|
2204
|
+
}), f = Kn({
|
|
2205
2205
|
name: "repDob",
|
|
2206
2206
|
label: g("dateOfBirth"),
|
|
2207
2207
|
required: !0,
|
|
@@ -2243,7 +2243,7 @@ function g1(l) {
|
|
|
2243
2243
|
onChange: (J) => {
|
|
2244
2244
|
J.target.value;
|
|
2245
2245
|
}
|
|
2246
|
-
}), G =
|
|
2246
|
+
}), G = Kn({
|
|
2247
2247
|
name: "repIdCardField",
|
|
2248
2248
|
label: g("idNumber"),
|
|
2249
2249
|
required: !0,
|
|
@@ -2262,7 +2262,7 @@ function g1(l) {
|
|
|
2262
2262
|
g("errorInvalidIdCard", "Số CCCD phải có 12 chữ số")
|
|
2263
2263
|
);
|
|
2264
2264
|
}
|
|
2265
|
-
}), R =
|
|
2265
|
+
}), R = Kn({
|
|
2266
2266
|
name: "repPassportNumberField",
|
|
2267
2267
|
label: g("passport", "Hộ chiếu"),
|
|
2268
2268
|
required: !1,
|
|
@@ -2270,7 +2270,7 @@ function g1(l) {
|
|
|
2270
2270
|
placeholder: g("enterPassport", "Nhập số hộ chiếu"),
|
|
2271
2271
|
type: "text",
|
|
2272
2272
|
value: ((S0 = (Lt = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : Lt.legalRepresentative) == null ? void 0 : S0.passportNumber) || ""
|
|
2273
|
-
}), z =
|
|
2273
|
+
}), z = Kn({
|
|
2274
2274
|
name: "repPhone",
|
|
2275
2275
|
label: g("phone"),
|
|
2276
2276
|
required: !0,
|
|
@@ -2299,7 +2299,7 @@ function g1(l) {
|
|
|
2299
2299
|
onChange: (J) => {
|
|
2300
2300
|
J.target.value;
|
|
2301
2301
|
}
|
|
2302
|
-
}), m =
|
|
2302
|
+
}), m = Kn({
|
|
2303
2303
|
name: "contactAddressDetail",
|
|
2304
2304
|
label: g("permanentAddress"),
|
|
2305
2305
|
required: !0,
|
|
@@ -2329,7 +2329,7 @@ function g1(l) {
|
|
|
2329
2329
|
},
|
|
2330
2330
|
error: null,
|
|
2331
2331
|
accept: "image/png, image/jpeg, image/jpg, .pdf"
|
|
2332
|
-
}), X =
|
|
2332
|
+
}), X = Kn({
|
|
2333
2333
|
name: "name",
|
|
2334
2334
|
label: g("fullName"),
|
|
2335
2335
|
required: !0,
|
|
@@ -2347,7 +2347,7 @@ function g1(l) {
|
|
|
2347
2347
|
g("errorInvalidName", "Họ và tên không hợp lệ.")
|
|
2348
2348
|
);
|
|
2349
2349
|
}
|
|
2350
|
-
}), y =
|
|
2350
|
+
}), y = Kn({
|
|
2351
2351
|
name: "email",
|
|
2352
2352
|
label: g("email"),
|
|
2353
2353
|
required: !0,
|
|
@@ -2378,7 +2378,7 @@ function g1(l) {
|
|
|
2378
2378
|
g("errorInvalidEmail", "Email không hợp lệ")
|
|
2379
2379
|
);
|
|
2380
2380
|
}
|
|
2381
|
-
}), Q =
|
|
2381
|
+
}), Q = Kn({
|
|
2382
2382
|
name: "phone",
|
|
2383
2383
|
label: g("phone"),
|
|
2384
2384
|
required: !0,
|
|
@@ -2399,7 +2399,7 @@ function g1(l) {
|
|
|
2399
2399
|
g("errorInvalidPhone", "Số điện thoại Việt Nam không hợp lệ.")
|
|
2400
2400
|
);
|
|
2401
2401
|
}
|
|
2402
|
-
}), V =
|
|
2402
|
+
}), V = Kn({
|
|
2403
2403
|
name: "contactAddressDetail",
|
|
2404
2404
|
label: g("permanentAddress"),
|
|
2405
2405
|
required: !0,
|
|
@@ -2421,7 +2421,7 @@ function g1(l) {
|
|
|
2421
2421
|
) : V.setError(null);
|
|
2422
2422
|
}
|
|
2423
2423
|
});
|
|
2424
|
-
const An =
|
|
2424
|
+
const An = Kn({
|
|
2425
2425
|
name: "invoiceSymbol",
|
|
2426
2426
|
label: g("invoiceSymbol", "Ký hiệu hóa đơn"),
|
|
2427
2427
|
required: !0,
|
|
@@ -2440,10 +2440,10 @@ function g1(l) {
|
|
|
2440
2440
|
An.inputEl.value = J, gn();
|
|
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 ? (En.appendChild(tn), En.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)), En.removeChild(tn), En.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
|
-
}), M =
|
|
2446
|
+
}), M = Kn({
|
|
2447
2447
|
name: "previousOtherProviderNameField",
|
|
2448
2448
|
label: g("providerName", "Tên NCC"),
|
|
2449
2449
|
required: !0,
|
|
@@ -2467,7 +2467,7 @@ function g1(l) {
|
|
|
2467
2467
|
)
|
|
2468
2468
|
);
|
|
2469
2469
|
}
|
|
2470
|
-
}), D =
|
|
2470
|
+
}), D = Kn({
|
|
2471
2471
|
name: "previousIssuedByTaxCodeField",
|
|
2472
2472
|
label: g("taxAuthorityCode", "Mã CQT đã phát hành hóa đơn"),
|
|
2473
2473
|
required: !0,
|
|
@@ -2555,7 +2555,7 @@ function g1(l) {
|
|
|
2555
2555
|
nt.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4 wgt:space-y-2";
|
|
2556
2556
|
let Qn = !1, Rn = !1;
|
|
2557
2557
|
const _n = document.createElement("div");
|
|
2558
|
-
function
|
|
2558
|
+
function On() {
|
|
2559
2559
|
_n.className = "wgt:text-yellow-500 wgt:text-sm wgt:font-medium wgt:text-center", Qn ? _n.innerText = g(
|
|
2560
2560
|
"warningIdCard",
|
|
2561
2561
|
"Vui lòng tải lên ảnh CMND/CCCD hợp lệ"
|
|
@@ -2566,7 +2566,7 @@ function g1(l) {
|
|
|
2566
2566
|
}
|
|
2567
2567
|
function tt(J) {
|
|
2568
2568
|
return new Promise((S) => {
|
|
2569
|
-
Qn = !1, Rn = !1,
|
|
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
|
}, on = (xn) => {
|
|
@@ -2582,9 +2582,9 @@ function g1(l) {
|
|
|
2582
2582
|
}, vn = new Image();
|
|
2583
2583
|
vn.src = URL.createObjectURL(J), vn.onload = () => sn(null, null, function* () {
|
|
2584
2584
|
try {
|
|
2585
|
-
const xn = yield l1(vn).then((Ln) => JSON.parse(Ln).status !== "success" ? (Qn = !0, Rn = !1, hn(),
|
|
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) {
|
|
2587
|
-
Qn = !1, Rn = !0,
|
|
2587
|
+
Qn = !1, Rn = !0, On();
|
|
2588
2588
|
const jn = Object.values(xn).every((Nt) => !Nt);
|
|
2589
2589
|
hn(), jn && (Vt(
|
|
2590
2590
|
g("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
|
|
@@ -2636,7 +2636,7 @@ function g1(l) {
|
|
|
2636
2636
|
onFrontChange: (J) => sn(null, null, function* () {
|
|
2637
2637
|
var hn, on;
|
|
2638
2638
|
if (U = J, dt(J, !0, !1), ht() || lt() || !a0()) {
|
|
2639
|
-
Qn = !1, Rn = !1,
|
|
2639
|
+
Qn = !1, Rn = !1, On(), gn();
|
|
2640
2640
|
return;
|
|
2641
2641
|
}
|
|
2642
2642
|
if ((on = (hn = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : hn.legalRepresentative) == null ? void 0 : on.idCard) {
|
|
@@ -2648,7 +2648,7 @@ function g1(l) {
|
|
|
2648
2648
|
onBackChange: (J) => sn(null, null, function* () {
|
|
2649
2649
|
var on, vn;
|
|
2650
2650
|
if (cn = J, dt(J, !1, !0), ht() || lt() || !Gt()) {
|
|
2651
|
-
Qn = !1, Rn = !1,
|
|
2651
|
+
Qn = !1, Rn = !1, On(), gn();
|
|
2652
2652
|
return;
|
|
2653
2653
|
}
|
|
2654
2654
|
if ((vn = (on = n == null ? void 0 : n.eInvoiceRegistration) == null ? void 0 : on.legalRepresentative) == null ? void 0 : vn.idCardBack) {
|
|
@@ -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 En = document.createElement("div");
|
|
2689
|
+
En.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(En);
|
|
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 || En.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);
|
|
@@ -2745,8 +2745,8 @@ function g1(l) {
|
|
|
2745
2745
|
), ln.appendChild(document.createTextNode(` ${g("of", "của")} ${In}.`)), nn.appendChild($), nn.appendChild(ln), w.appendChild(nn), $.addEventListener("click", () => {
|
|
2746
2746
|
an = !an, an ? ($.classList.add("wgt:bg-primary"), _.classList.remove("wgt:hidden")) : ($.classList.remove("wgt:bg-primary"), _.classList.add("wgt:hidden")), gn();
|
|
2747
2747
|
});
|
|
2748
|
-
const
|
|
2749
|
-
|
|
2748
|
+
const Nn = document.createElement("div");
|
|
2749
|
+
Nn.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,8 +2757,8 @@ 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(" "),
|
|
2761
|
-
function
|
|
2760
|
+
].join(" "), Nn.appendChild(Y), b.appendChild(Nn);
|
|
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(
|
|
2764
2764
|
S.legalRepresentative.permanentAddress
|
|
@@ -2775,7 +2775,7 @@ function g1(l) {
|
|
|
2775
2775
|
}
|
|
2776
2776
|
function gn() {
|
|
2777
2777
|
const J = e === "bvb" && !i && A === !1 && !n._userHasEditedTaxCode;
|
|
2778
|
-
Y.disabled = !
|
|
2778
|
+
Y.disabled = !Dn() || !an || ht() || lt() || j.getError() || O.getError() || J;
|
|
2779
2779
|
}
|
|
2780
2780
|
function Fn() {
|
|
2781
2781
|
var J, S;
|
|
@@ -2837,14 +2837,14 @@ function g1(l) {
|
|
|
2837
2837
|
}), [E, v].forEach((J) => {
|
|
2838
2838
|
J.addEventListener("change", gn);
|
|
2839
2839
|
}), Y.addEventListener("click", (J) => sn(null, null, function* () {
|
|
2840
|
-
if (J.preventDefault(), !
|
|
2840
|
+
if (J.preventDefault(), !Dn()) return;
|
|
2841
2841
|
const S = p.getValue().trim();
|
|
2842
2842
|
if (!xh(S)) {
|
|
2843
2843
|
p.setError(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), pt.error(g("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), k();
|
|
2844
2844
|
return;
|
|
2845
2845
|
}
|
|
2846
2846
|
if (i) {
|
|
2847
|
-
|
|
2847
|
+
Gn(Wn.STEP1_COMPLETED, {
|
|
2848
2848
|
theme: e,
|
|
2849
2849
|
isRenewal: !0,
|
|
2850
2850
|
taxCode: S
|
|
@@ -2852,7 +2852,7 @@ function g1(l) {
|
|
|
2852
2852
|
return;
|
|
2853
2853
|
}
|
|
2854
2854
|
if (e !== "bvb") {
|
|
2855
|
-
|
|
2855
|
+
Gn(Wn.STEP1_COMPLETED, {
|
|
2856
2856
|
theme: e,
|
|
2857
2857
|
isRenewal: !1,
|
|
2858
2858
|
taxCode: S
|
|
@@ -2886,7 +2886,7 @@ function g1(l) {
|
|
|
2886
2886
|
} finally {
|
|
2887
2887
|
Y.disabled = !1, Y.innerText = g("next");
|
|
2888
2888
|
}
|
|
2889
|
-
on || hn === !1 || hn === !0 && (
|
|
2889
|
+
on || hn === !1 || hn === !0 && (Gn(Wn.STEP1_COMPLETED, {
|
|
2890
2890
|
theme: e,
|
|
2891
2891
|
isRenewal: !1,
|
|
2892
2892
|
isNewCustomer: !0,
|
|
@@ -3458,25 +3458,31 @@ function N1(N) {
|
|
|
3458
3458
|
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
3459
|
const $ = document.createElement("div");
|
|
3460
3460
|
$.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(
|
|
3461
|
+
function en(Nn, Dn) {
|
|
3462
3462
|
const gn = document.createElement("button");
|
|
3463
3463
|
gn.type = "button", gn.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
3464
|
const Fn = document.createElement("span");
|
|
3465
|
-
Fn.className = "wgt:h-4 wgt:w-4 wgt:rounded-full wgt:border wgt:
|
|
3465
|
+
Fn.className = "wgt:h-4 wgt:w-4 wgt:rounded-full wgt:border wgt:flex wgt:items-center wgt:justify-center";
|
|
3466
3466
|
const $n = document.createElement("span");
|
|
3467
|
-
$n.className = "wgt:h-2 wgt:w-2 wgt:rounded-full", $n.style.backgroundColor = "#1e2a7b", $n.style.opacity = "0", Fn.appendChild($n);
|
|
3467
|
+
$n.className = "wgt:h-2 wgt:w-2 wgt:rounded-full ", $n.style.backgroundColor = "#1e2a7b", $n.style.opacity = "0", Fn.appendChild($n);
|
|
3468
3468
|
const et = document.createElement("span");
|
|
3469
|
-
return et.className = "wgt:text-sm wgt:font-semibold", et.innerText =
|
|
3470
|
-
F =
|
|
3471
|
-
}), { btn: gn, inner: $n, textSpan: et, value:
|
|
3469
|
+
return et.className = "wgt:text-sm wgt:font-semibold", et.innerText = Nn, gn.appendChild(Fn), gn.appendChild(et), gn.addEventListener("click", () => {
|
|
3470
|
+
F = Dn, Bn(), W != null && W.eInvoiceRegistration && (W.eInvoiceRegistration.businessType = F), tn == null || tn(F);
|
|
3471
|
+
}), { btn: gn, inner: $n, textSpan: et, value: Dn };
|
|
3472
3472
|
}
|
|
3473
3473
|
const _ = en(g("company") || "Doanh nghiệp", "company"), mn = en(
|
|
3474
3474
|
g("householdBusiness") || "Hộ kinh doanh",
|
|
3475
3475
|
"household"
|
|
3476
3476
|
);
|
|
3477
3477
|
$.appendChild(_.btn), $.appendChild(mn.btn);
|
|
3478
|
-
function ln(
|
|
3479
|
-
|
|
3478
|
+
function ln(Nn, Dn) {
|
|
3479
|
+
Nn.btn.classList.toggle("wgt:bg-weak-50", Dn), Nn.inner.style.opacity = Dn ? "1" : "0", Nn.inner.parentElement.classList.toggle(
|
|
3480
|
+
"wgt:border-[#1e2a7b]",
|
|
3481
|
+
Dn
|
|
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);
|
|
3480
3486
|
}
|
|
3481
3487
|
function Bn() {
|
|
3482
3488
|
ln(_, F === "company"), ln(mn, F === "household");
|
|
@@ -3484,8 +3490,8 @@ function N1(N) {
|
|
|
3484
3490
|
return Bn(), {
|
|
3485
3491
|
container: nn,
|
|
3486
3492
|
getValue: () => F,
|
|
3487
|
-
setValue: (
|
|
3488
|
-
F =
|
|
3493
|
+
setValue: (Nn) => {
|
|
3494
|
+
F = Nn, Bn();
|
|
3489
3495
|
}
|
|
3490
3496
|
};
|
|
3491
3497
|
}
|
|
@@ -3507,7 +3513,7 @@ function N1(N) {
|
|
|
3507
3513
|
onChange: (tn) => {
|
|
3508
3514
|
var nn;
|
|
3509
3515
|
const F = Q(y, tn);
|
|
3510
|
-
Mn(F || []), Xn(F || []), L = ((nn = F == null ? void 0 : F[0]) == null ? void 0 : nn._id) || null, at(), ct(), Tt(), Zn(),
|
|
3516
|
+
Mn(F || []), Xn(F || []), L = ((nn = F == null ? void 0 : F[0]) == null ? void 0 : nn._id) || null, at(), ct(), Tt(), Zn(), En();
|
|
3511
3517
|
}
|
|
3512
3518
|
});
|
|
3513
3519
|
const W = document.createElement("div");
|
|
@@ -3529,7 +3535,7 @@ function N1(N) {
|
|
|
3529
3535
|
debounceTimer: m,
|
|
3530
3536
|
typedUnits: V,
|
|
3531
3537
|
onSearchComplete: () => {
|
|
3532
|
-
ct(),
|
|
3538
|
+
ct(), En();
|
|
3533
3539
|
}
|
|
3534
3540
|
});
|
|
3535
3541
|
Z.appendChild(An);
|
|
@@ -3545,7 +3551,7 @@ function N1(N) {
|
|
|
3545
3551
|
<span class="wgt:text-sm wgt:text-text-sub-600">${g("loading")}...</span>
|
|
3546
3552
|
</div>
|
|
3547
3553
|
`, Z.appendChild(Qn);
|
|
3548
|
-
const { container: Rn } = f1(), { container: _n, tbody:
|
|
3554
|
+
const { container: Rn } = f1(), { container: _n, tbody: On } = X1(), tt = document.createElement("div");
|
|
3549
3555
|
tt.className = "wgt:hidden wgt:@max-2xl:flex wgt:items-center wgt:justify-between wgt:w-full wgt:bg-white wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:px-6 wgt:py-5 wgt:shadow-lg";
|
|
3550
3556
|
const dt = document.createElement("span");
|
|
3551
3557
|
dt.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", dt.innerText = g("total"), tt.appendChild(dt);
|
|
@@ -3619,10 +3625,10 @@ function N1(N) {
|
|
|
3619
3625
|
return;
|
|
3620
3626
|
}
|
|
3621
3627
|
let F = null;
|
|
3622
|
-
!H && !(W != null && W.withoutInitialFee) ? (F =
|
|
3628
|
+
!H && !(W != null && W.withoutInitialFee) ? (F = Yn(yn({}, G[0]), {
|
|
3623
3629
|
quantity: P
|
|
3624
3630
|
}), a(F)) : a(null);
|
|
3625
|
-
let nn =
|
|
3631
|
+
let nn = Yn(yn({}, W), { quantity: E }), an = tn ? Yn(yn({}, tn), { quantity: v }) : null;
|
|
3626
3632
|
u(nn), o(an), d(B), M(), p && p({
|
|
3627
3633
|
qtyRegFee: P,
|
|
3628
3634
|
qtyInvoicePkg: E,
|
|
@@ -3725,7 +3731,7 @@ function N1(N) {
|
|
|
3725
3731
|
});
|
|
3726
3732
|
}
|
|
3727
3733
|
function a0() {
|
|
3728
|
-
at(), ct(), H || St(), Tt(), Zn(),
|
|
3734
|
+
at(), ct(), H || St(), Tt(), Zn(), En();
|
|
3729
3735
|
}
|
|
3730
3736
|
function ft(W, tn, F) {
|
|
3731
3737
|
const nn = Object.values(R).find(
|
|
@@ -3765,7 +3771,7 @@ function N1(N) {
|
|
|
3765
3771
|
($) => $._id === L
|
|
3766
3772
|
)) == null ? void 0 : nn.code, F = (an = qn().find(($) => $._id === W)) == null ? void 0 : an.code;
|
|
3767
3773
|
ft(tn, F, () => {
|
|
3768
|
-
L = W, it.setSelectedPackageId(W), at(), Tt(), Zn(),
|
|
3774
|
+
L = W, it.setSelectedPackageId(W), at(), Tt(), Zn(), En();
|
|
3769
3775
|
});
|
|
3770
3776
|
}
|
|
3771
3777
|
}), Tn.appendChild(it.container);
|
|
@@ -3792,11 +3798,11 @@ function N1(N) {
|
|
|
3792
3798
|
($) => $._id === f
|
|
3793
3799
|
)) == null ? void 0 : nn.code, F = (an = z.find(($) => $._id === W)) == null ? void 0 : an.code;
|
|
3794
3800
|
if (H && f === W) {
|
|
3795
|
-
f = null, gt.setSelectedPackageId(null), at(), Tt(), Zn(),
|
|
3801
|
+
f = null, gt.setSelectedPackageId(null), at(), Tt(), Zn(), En();
|
|
3796
3802
|
return;
|
|
3797
3803
|
}
|
|
3798
3804
|
ft(tn, F, () => {
|
|
3799
|
-
f = W, gt.setSelectedPackageId(W), Xn(qn()), at(), Tt(), Zn(),
|
|
3805
|
+
f = W, gt.setSelectedPackageId(W), Xn(qn()), at(), Tt(), Zn(), En();
|
|
3800
3806
|
});
|
|
3801
3807
|
}
|
|
3802
3808
|
}), Un.appendChild(gt.container);
|
|
@@ -3843,15 +3849,15 @@ function N1(N) {
|
|
|
3843
3849
|
const $ = R[an];
|
|
3844
3850
|
if ($.bank !== r) {
|
|
3845
3851
|
$.isDisabled = !0, B = B.filter(
|
|
3846
|
-
(
|
|
3852
|
+
(Nn) => Nn !== $.code
|
|
3847
3853
|
);
|
|
3848
3854
|
return;
|
|
3849
3855
|
}
|
|
3850
3856
|
const en = $.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = $.limit <= $.used, mn = !$.isActive, Bn = ((In = $.appliedPackages) == null ? void 0 : In.some(
|
|
3851
|
-
(
|
|
3857
|
+
(Nn) => nn.includes(Nn)
|
|
3852
3858
|
)) && !en && !_ && !mn;
|
|
3853
3859
|
$.isDisabled = !Bn, Bn ? Bn && !B.includes($.code) && B.push($.code) : B = B.filter(
|
|
3854
|
-
(
|
|
3860
|
+
(Nn) => Nn !== $.code
|
|
3855
3861
|
);
|
|
3856
3862
|
}), vt();
|
|
3857
3863
|
}
|
|
@@ -3891,7 +3897,7 @@ function N1(N) {
|
|
|
3891
3897
|
handleClick: () => {
|
|
3892
3898
|
B = B.filter(
|
|
3893
3899
|
(In) => In !== mn
|
|
3894
|
-
), Zn(),
|
|
3900
|
+
), Zn(), En();
|
|
3895
3901
|
}
|
|
3896
3902
|
});
|
|
3897
3903
|
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">
|
|
@@ -3917,13 +3923,13 @@ function N1(N) {
|
|
|
3917
3923
|
if (en.length > 0)
|
|
3918
3924
|
en.forEach((_) => {
|
|
3919
3925
|
const { container: mn } = w1({
|
|
3920
|
-
promotion:
|
|
3926
|
+
promotion: Yn(yn({}, _), {
|
|
3921
3927
|
isSelected: B.includes(_.code)
|
|
3922
3928
|
}),
|
|
3923
3929
|
onSelect: (ln, Bn) => {
|
|
3924
3930
|
Bn ? B.push(ln) : B = B.filter(
|
|
3925
3931
|
(In) => In !== ln
|
|
3926
|
-
), Zn(),
|
|
3932
|
+
), Zn(), En();
|
|
3927
3933
|
},
|
|
3928
3934
|
isDisabled: _.isDisabled || _.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || _.limit === _.used
|
|
3929
3935
|
});
|
|
@@ -3934,15 +3940,15 @@ function N1(N) {
|
|
|
3934
3940
|
_.className = "wgt:text-text-sub-600", _.innerText = g("noPromotionFound"), Jn.appendChild(_);
|
|
3935
3941
|
}
|
|
3936
3942
|
}
|
|
3937
|
-
function
|
|
3938
|
-
var
|
|
3939
|
-
if (M(),
|
|
3943
|
+
function En() {
|
|
3944
|
+
var Nn, Dn, gn, Fn, $n, et, Mt, Jt, Dt;
|
|
3945
|
+
if (M(), On.innerHTML = "", Z.appendChild(_n), Z.appendChild(tt), Z.appendChild(Rn), qn().length === 0 && z.length === 0) {
|
|
3940
3946
|
const K = document.createElement("tr");
|
|
3941
3947
|
K.innerHTML = `
|
|
3942
3948
|
<td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
|
|
3943
3949
|
${g("noDataAvailable") || "No data available"}
|
|
3944
3950
|
</td>
|
|
3945
|
-
`,
|
|
3951
|
+
`, On.appendChild(K), q(0);
|
|
3946
3952
|
return;
|
|
3947
3953
|
}
|
|
3948
3954
|
const W = qn().find(
|
|
@@ -3961,18 +3967,18 @@ function N1(N) {
|
|
|
3961
3967
|
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";
|
|
3962
3968
|
const wn = document.createElement("button");
|
|
3963
3969
|
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", () => {
|
|
3964
|
-
P > 1 && (P -= 1,
|
|
3970
|
+
P > 1 && (P -= 1, En());
|
|
3965
3971
|
}), fn.appendChild(wn);
|
|
3966
3972
|
const pn = document.createElement("span");
|
|
3967
3973
|
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);
|
|
3968
3974
|
const Cn = document.createElement("button");
|
|
3969
3975
|
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", () => {
|
|
3970
|
-
P += 1,
|
|
3976
|
+
P += 1, En();
|
|
3971
3977
|
}), fn.appendChild(Cn), bn.appendChild(fn), K.appendChild(bn);
|
|
3972
3978
|
const kn = document.createElement("td");
|
|
3973
|
-
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((
|
|
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((Nn = G[0]) == null ? void 0 : Nn.price) + " VND", K.appendChild(kn);
|
|
3974
3980
|
const Hn = document.createElement("td");
|
|
3975
|
-
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(((
|
|
3981
|
+
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);
|
|
3976
3982
|
const Vn = document.createElement("div");
|
|
3977
3983
|
Vn.className = "wgt:hidden wgt:@max-2xl:flex wgt:flex-col wgt:gap-1 wgt:mt-2 wgt:pt-2 wgt:border-t wgt:border-soft-200", Vn.innerHTML = `
|
|
3978
3984
|
<div class="wgt:flex wgt:justify-between wgt:text-sm wgt:text-text-sub-600">
|
|
@@ -3987,7 +3993,7 @@ function N1(N) {
|
|
|
3987
3993
|
((Fn = G[0]) == null ? void 0 : Fn.price) * P
|
|
3988
3994
|
)} VND</span>
|
|
3989
3995
|
</div>
|
|
3990
|
-
`, un.appendChild(Vn),
|
|
3996
|
+
`, un.appendChild(Vn), On.appendChild(K);
|
|
3991
3997
|
}
|
|
3992
3998
|
{
|
|
3993
3999
|
const K = qt(L);
|
|
@@ -4006,13 +4012,13 @@ function N1(N) {
|
|
|
4006
4012
|
pn.type = "button", pn.ariaLabel = g("decrease");
|
|
4007
4013
|
const Cn = b ? ($n = K == null ? void 0 : K.price) != null ? $n : 0 : (et = K == null ? void 0 : K.renewPrice) != null ? et : 0;
|
|
4008
4014
|
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", () => {
|
|
4009
|
-
E > 1 && (E -= 1,
|
|
4015
|
+
E > 1 && (E -= 1, En());
|
|
4010
4016
|
}), wn.appendChild(pn);
|
|
4011
4017
|
const kn = document.createElement("span");
|
|
4012
4018
|
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);
|
|
4013
4019
|
const Hn = document.createElement("button");
|
|
4014
4020
|
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", () => {
|
|
4015
|
-
Cn !== 0 && (E += 1,
|
|
4021
|
+
Cn !== 0 && (E += 1, En());
|
|
4016
4022
|
}), wn.appendChild(Hn), fn.appendChild(wn), un.appendChild(fn);
|
|
4017
4023
|
const Vn = document.createElement("td");
|
|
4018
4024
|
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);
|
|
@@ -4032,7 +4038,7 @@ function N1(N) {
|
|
|
4032
4038
|
Cn * (K == null ? void 0 : K.limit) * E
|
|
4033
4039
|
)} VND</span>
|
|
4034
4040
|
</div>
|
|
4035
|
-
`, dn.appendChild(Lt),
|
|
4041
|
+
`, dn.appendChild(Lt), On.appendChild(un);
|
|
4036
4042
|
}
|
|
4037
4043
|
}
|
|
4038
4044
|
{
|
|
@@ -4051,13 +4057,13 @@ function N1(N) {
|
|
|
4051
4057
|
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";
|
|
4052
4058
|
const pn = document.createElement("button");
|
|
4053
4059
|
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", () => {
|
|
4054
|
-
v > 1 && (v -= 1,
|
|
4060
|
+
v > 1 && (v -= 1, En());
|
|
4055
4061
|
}), wn.appendChild(pn);
|
|
4056
4062
|
const Cn = document.createElement("span");
|
|
4057
4063
|
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);
|
|
4058
4064
|
const kn = document.createElement("button");
|
|
4059
4065
|
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", () => {
|
|
4060
|
-
v += 1,
|
|
4066
|
+
v += 1, En();
|
|
4061
4067
|
}), wn.appendChild(kn), fn.appendChild(wn), un.appendChild(fn);
|
|
4062
4068
|
const Hn = document.createElement("td");
|
|
4063
4069
|
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);
|
|
@@ -4077,7 +4083,7 @@ function N1(N) {
|
|
|
4077
4083
|
(K == null ? void 0 : K.limit) * (K == null ? void 0 : K.price) * v
|
|
4078
4084
|
)} VND</span>
|
|
4079
4085
|
</div>
|
|
4080
|
-
`, dn.appendChild(At),
|
|
4086
|
+
`, dn.appendChild(At), On.appendChild(un);
|
|
4081
4087
|
}
|
|
4082
4088
|
}
|
|
4083
4089
|
const tn = B.map(
|
|
@@ -4104,7 +4110,7 @@ function N1(N) {
|
|
|
4104
4110
|
(wn = K == null ? void 0 : K.reward) == null ? void 0 : wn.discountAmount
|
|
4105
4111
|
)} VND`, fn.style.color = "#F04438", F += (pn = K == null ? void 0 : K.reward) == null ? void 0 : pn.discountAmount) : (K == null ? void 0 : K.type) === "free_item" ? (fn.innerText = `+${(kn = (Cn = K == null ? void 0 : K.reward) == null ? void 0 : Cn.packageCodes) == null ? void 0 : kn.length} ${g(
|
|
4106
4112
|
"package"
|
|
4107
|
-
)} ${(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),
|
|
4113
|
+
)} ${(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);
|
|
4108
4114
|
});
|
|
4109
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), mn = _ ? _.price * _.limit * v : 0, ln = nn + en + mn, Bn = Math.min(F, ln), In = Math.max(ln - Bn, 0);
|
|
4110
4116
|
q(In);
|
|
@@ -4114,7 +4120,7 @@ function N1(N) {
|
|
|
4114
4120
|
const un = document.createElement("td");
|
|
4115
4121
|
un.colSpan = 4, un.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950 wgt:col-span-4", un.innerText = g("total"), K.appendChild(un);
|
|
4116
4122
|
const dn = document.createElement("td");
|
|
4117
|
-
dn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", dn.innerText = Sn(In) + " VND", K.appendChild(dn),
|
|
4123
|
+
dn.className = "wgt:whitespace-nowrap wgt:px-3 wgt:py-3 wgt:text-left wgt:text-base wgt:font-semibold wgt:text-strong-950", dn.innerText = Sn(In) + " VND", K.appendChild(dn), On.appendChild(K);
|
|
4118
4124
|
}
|
|
4119
4125
|
st.innerText = Sn(In) + " VND";
|
|
4120
4126
|
}
|
|
@@ -6215,7 +6221,7 @@ function ea(o) {
|
|
|
6215
6221
|
const V = document.createElement("div");
|
|
6216
6222
|
V.className = "wgt:flex-1 wgt:@max-2xl:w-full";
|
|
6217
6223
|
let L, f;
|
|
6218
|
-
const { container: B } = k1(
|
|
6224
|
+
const { container: B } = k1(Yn(yn({}, h), {
|
|
6219
6225
|
selectedPromotions: (h == null ? void 0 : h.selectedPromotions) || [],
|
|
6220
6226
|
onResetToStep1: () => {
|
|
6221
6227
|
s && (clearInterval(s), s = null), h != null && h.onResetToStep1 && h.onResetToStep1();
|
|
@@ -6235,7 +6241,7 @@ function ea(o) {
|
|
|
6235
6241
|
Q.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-center wgt:min-h-[400px]", Q.appendChild(B);
|
|
6236
6242
|
else {
|
|
6237
6243
|
Q.className = "wgt:w-full wgt:flex wgt:items-start wgt:gap-6 wgt:@max-2xl:flex-col-reverse";
|
|
6238
|
-
const M = H1(
|
|
6244
|
+
const M = H1(Yn(yn({
|
|
6239
6245
|
qrSrc: "",
|
|
6240
6246
|
accountName: "",
|
|
6241
6247
|
accountNumber: "",
|
|
@@ -6252,7 +6258,7 @@ function ea(o) {
|
|
|
6252
6258
|
G.className = "wgt:flex wgt:items-center wgt:justify-between wgt:gap-2";
|
|
6253
6259
|
const R = document.createElement("button");
|
|
6254
6260
|
R.type = "button", R.className = "wgt:bg-transparent wgt:!text-primary wgt:hover:bg-transparent wgt:underline", R.textContent = g("back"), R.addEventListener("click", () => {
|
|
6255
|
-
|
|
6261
|
+
Gn(Wn.STEP3_BACK_CLICKED, {
|
|
6256
6262
|
orderId: r,
|
|
6257
6263
|
provider: I,
|
|
6258
6264
|
theme: u,
|
|
@@ -6262,7 +6268,7 @@ function ea(o) {
|
|
|
6262
6268
|
function T() {
|
|
6263
6269
|
return sn(this, null, function* () {
|
|
6264
6270
|
const M = (h == null ? void 0 : h.totalAmountText) || 0;
|
|
6265
|
-
d = M, x = M === 0,
|
|
6271
|
+
d = M, x = M === 0, Gn(Wn.STEP3_VIEWED, {
|
|
6266
6272
|
orderId: r,
|
|
6267
6273
|
amount: d,
|
|
6268
6274
|
provider: I,
|
|
@@ -7022,7 +7028,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7022
7028
|
address: "",
|
|
7023
7029
|
taxCode: (c == null ? void 0 : c.taxCode) || "",
|
|
7024
7030
|
taxAuthority: ""
|
|
7025
|
-
}), d =
|
|
7031
|
+
}), d = Yn(yn({}, d), {
|
|
7026
7032
|
eInvoiceRegistration: {
|
|
7027
7033
|
organization: {
|
|
7028
7034
|
name: (D == null ? void 0 : D.name) || "",
|
|
@@ -7070,7 +7076,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7070
7076
|
}
|
|
7071
7077
|
function G(D, j) {
|
|
7072
7078
|
return sn(this, null, function* () {
|
|
7073
|
-
D ? d =
|
|
7079
|
+
D ? d = Yn(yn({}, d), {
|
|
7074
7080
|
eInvoiceRegistration: {
|
|
7075
7081
|
organization: yn({}, D.organization),
|
|
7076
7082
|
contactPerson: a ? yn({}, D.contactPerson) : d.eInvoiceRegistration.contactPerson,
|
|
@@ -7146,7 +7152,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7146
7152
|
});
|
|
7147
7153
|
i(j);
|
|
7148
7154
|
} else if (D === 2) {
|
|
7149
|
-
|
|
7155
|
+
Gn(Wn.STEP2_VIEWED, {
|
|
7150
7156
|
theme: h,
|
|
7151
7157
|
isRenewal: a,
|
|
7152
7158
|
provider: x == null ? void 0 : x.route,
|
|
@@ -7154,7 +7160,7 @@ function Xa(t, n, e, c, h, a) {
|
|
|
7154
7160
|
});
|
|
7155
7161
|
const { container: j } = yield N1({
|
|
7156
7162
|
onNext: () => sn(null, null, function* () {
|
|
7157
|
-
|
|
7163
|
+
Gn(Wn.STEP2_COMPLETED, {
|
|
7158
7164
|
theme: h,
|
|
7159
7165
|
provider: x == null ? void 0 : x.route,
|
|
7160
7166
|
totalAmount: N,
|