@invoice-sdk/widget 1.116.0 → 1.117.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-DfRo2uNU.js → index--3k30XIL.js} +112 -109
- package/dist/{index-Ba_b4M50.js → index-964gT5_D.js} +469 -488
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +99 -100
- package/dist/{loading-BHrUW4gA.js → loading-Cb7pkXB0.js} +2 -2
- package/dist/{widget-DVCT2ZIV.js → widget-wh_CEDP0.js} +2 -2
- package/dist/widget.css +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var X = Object.defineProperty;
|
|
2
2
|
var $ = Object.getOwnPropertySymbols;
|
|
3
3
|
var G = Object.prototype.hasOwnProperty, J = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var z = (
|
|
4
|
+
var z = (n, a, e) => a in n ? X(n, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[a] = e, q = (n, a) => {
|
|
5
5
|
for (var e in a || (a = {}))
|
|
6
|
-
G.call(a, e) && z(
|
|
6
|
+
G.call(a, e) && z(n, e, a[e]);
|
|
7
7
|
if ($)
|
|
8
8
|
for (var e of $(a))
|
|
9
|
-
J.call(a, e) && z(
|
|
10
|
-
return
|
|
9
|
+
J.call(a, e) && z(n, e, a[e]);
|
|
10
|
+
return n;
|
|
11
11
|
};
|
|
12
|
-
var Z = (
|
|
12
|
+
var Z = (n, a, e) => new Promise((t, s) => {
|
|
13
13
|
var o = (d) => {
|
|
14
14
|
try {
|
|
15
15
|
c(e.next(d));
|
|
@@ -23,16 +23,16 @@ var Z = (i, a, e) => new Promise((t, s) => {
|
|
|
23
23
|
s(h);
|
|
24
24
|
}
|
|
25
25
|
}, c = (d) => d.done ? t(d.value) : Promise.resolve(d.value).then(o, r);
|
|
26
|
-
c((e = e.apply(
|
|
26
|
+
c((e = e.apply(n, a)).next());
|
|
27
27
|
});
|
|
28
|
-
import { c as P, f as
|
|
29
|
-
import { t as
|
|
30
|
-
function I({ defaultValues:
|
|
28
|
+
import { c as P, f as O, e as K, b as Q, o as D, s as Y } from "./loading-Cb7pkXB0.js";
|
|
29
|
+
import { t as i, c as R } from "./index-964gT5_D.js";
|
|
30
|
+
function I({ defaultValues: n = {}, onChange: a } = {}) {
|
|
31
31
|
const e = {
|
|
32
|
-
representativeName:
|
|
33
|
-
buyerAddress:
|
|
34
|
-
email:
|
|
35
|
-
phone:
|
|
32
|
+
representativeName: n.representativeName || "",
|
|
33
|
+
buyerAddress: n.buyerAddress || "",
|
|
34
|
+
email: n.email || "",
|
|
35
|
+
phone: n.phone || ""
|
|
36
36
|
}, t = document.createElement("div");
|
|
37
37
|
t.className = "wgt:space-y-2";
|
|
38
38
|
function s() {
|
|
@@ -52,21 +52,21 @@ function I({ defaultValues: i = {}, onChange: a } = {}) {
|
|
|
52
52
|
}), w.appendChild(u), w.appendChild(C), { field: w, input: C };
|
|
53
53
|
}
|
|
54
54
|
const { field: r, input: c } = o({
|
|
55
|
-
label:
|
|
55
|
+
label: i("representativeName"),
|
|
56
56
|
required: !0,
|
|
57
57
|
name: "representativeName",
|
|
58
|
-
placeholder:
|
|
58
|
+
placeholder: i("representativeName_input")
|
|
59
59
|
}), { field: d } = o({
|
|
60
|
-
label:
|
|
60
|
+
label: i("buyerAddress"),
|
|
61
61
|
required: !1,
|
|
62
62
|
name: "buyerAddress",
|
|
63
|
-
placeholder:
|
|
63
|
+
placeholder: i("buyerAddress_input")
|
|
64
64
|
}), { field: h, input: g } = o({
|
|
65
|
-
label:
|
|
65
|
+
label: i("email"),
|
|
66
66
|
required: !0,
|
|
67
67
|
name: "email",
|
|
68
68
|
type: "email",
|
|
69
|
-
placeholder:
|
|
69
|
+
placeholder: i("email_input")
|
|
70
70
|
});
|
|
71
71
|
t.appendChild(r), t.appendChild(d), t.appendChild(h);
|
|
72
72
|
function N() {
|
|
@@ -85,18 +85,18 @@ function I({ defaultValues: i = {}, onChange: a } = {}) {
|
|
|
85
85
|
return { container: t, getValues: f, validate: N };
|
|
86
86
|
}
|
|
87
87
|
function ee({
|
|
88
|
-
defaultValues:
|
|
88
|
+
defaultValues: n = {},
|
|
89
89
|
onChange: a,
|
|
90
90
|
onFetchByTaxCode: e
|
|
91
91
|
} = {}) {
|
|
92
92
|
const t = {
|
|
93
|
-
noTaxCode: !!
|
|
94
|
-
taxCode:
|
|
95
|
-
representativeName:
|
|
96
|
-
buyerAddress:
|
|
97
|
-
performerName:
|
|
98
|
-
email:
|
|
99
|
-
phone:
|
|
93
|
+
noTaxCode: !!n.noTaxCode,
|
|
94
|
+
taxCode: n.taxCode || "",
|
|
95
|
+
representativeName: n.representativeName || "",
|
|
96
|
+
buyerAddress: n.buyerAddress || "",
|
|
97
|
+
performerName: n.performerName || "",
|
|
98
|
+
email: n.email || "",
|
|
99
|
+
phone: n.phone || ""
|
|
100
100
|
}, s = document.createElement("div");
|
|
101
101
|
s.className = "wgt:space-y-2";
|
|
102
102
|
function o() {
|
|
@@ -120,17 +120,17 @@ function ee({
|
|
|
120
120
|
const d = document.createElement("input");
|
|
121
121
|
d.type = "checkbox", d.className = "wgt:h-4 wgt:w-4 wgt:rounded wgt:border-[#E4E7EC] focus:wgt:outline-none focus:wgt:ring-primary", d.checked = t.noTaxCode;
|
|
122
122
|
const h = document.createElement("span");
|
|
123
|
-
h.textContent =
|
|
123
|
+
h.textContent = i("business_noTaxCode"), h.className = "wgt:italic wgt:font-normal wgt:text-[14px] wgt:leading-[20px] wgt:tracking-[0px] wgt:align-middle wgt:text-[#525866]", h.style.fontFamily = "Inter, sans-serif", d.addEventListener("change", () => {
|
|
124
124
|
t.noTaxCode = d.checked, p.disabled = t.noTaxCode, L.disabled = t.noTaxCode, o();
|
|
125
125
|
}), c.appendChild(d), c.appendChild(h);
|
|
126
126
|
const g = document.createElement("div");
|
|
127
127
|
g.className = "wgt:space-y-2";
|
|
128
128
|
const N = document.createElement("label");
|
|
129
|
-
N.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 ", N.innerHTML =
|
|
129
|
+
N.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950 ", N.innerHTML = i("confirmation_popup_taxCode") + '<span class="wgt:text-[#ED1C24]">*</span>';
|
|
130
130
|
const f = document.createElement("div");
|
|
131
131
|
f.className = "wgt:flex wgt:gap-2 wgt:mt-2";
|
|
132
132
|
const p = document.createElement("input");
|
|
133
|
-
p.type = "text", p.name = "taxCode", p.placeholder =
|
|
133
|
+
p.type = "text", p.name = "taxCode", p.placeholder = i("taxCode_input"), p.value = t.taxCode, p.className = "wgt:flex-1 wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:bg-white wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:text-strong-950 focus:wgt:outline-none focus:wgt:border-primary focus:wgt:ring-1 focus:wgt:ring-primary", p.addEventListener("input", () => {
|
|
134
134
|
t.taxCode = p.value, p.classList.remove(
|
|
135
135
|
"wgt:border-semantic-error",
|
|
136
136
|
"wgt:bg-semantic-error-50"
|
|
@@ -138,7 +138,7 @@ function ee({
|
|
|
138
138
|
});
|
|
139
139
|
const L = P({
|
|
140
140
|
type: "button",
|
|
141
|
-
title:
|
|
141
|
+
title: i("fetch_info"),
|
|
142
142
|
className: "wgt:px-3 wgt:py-2.5 wgt:text-sm wgt:font-semibold wgt:rounded-lg wgt:flex-shrink-0 wgt:text-primary wgt:bg-white wgt:border wgt:border-primary",
|
|
143
143
|
handleClick: () => Z(null, null, function* () {
|
|
144
144
|
if (t.noTaxCode || typeof e != "function")
|
|
@@ -168,32 +168,32 @@ function ee({
|
|
|
168
168
|
});
|
|
169
169
|
f.appendChild(p), f.appendChild(L), g.appendChild(N), g.appendChild(f);
|
|
170
170
|
const { field: b, input: _ } = r({
|
|
171
|
-
label:
|
|
171
|
+
label: i("representativeName"),
|
|
172
172
|
required: !0,
|
|
173
173
|
name: "representativeName",
|
|
174
|
-
placeholder:
|
|
174
|
+
placeholder: i("representativeName_input")
|
|
175
175
|
}), { field: E, input: w } = r({
|
|
176
|
-
label:
|
|
176
|
+
label: i("buyerAddress"),
|
|
177
177
|
required: !1,
|
|
178
178
|
name: "buyerAddress",
|
|
179
|
-
placeholder:
|
|
179
|
+
placeholder: i("buyerAddress_input")
|
|
180
180
|
}), { field: u, input: C } = r({
|
|
181
|
-
label:
|
|
181
|
+
label: i("performerName"),
|
|
182
182
|
required: !0,
|
|
183
183
|
name: "performerName",
|
|
184
|
-
placeholder:
|
|
184
|
+
placeholder: i("performerName_input")
|
|
185
185
|
}), { field: B, input: S } = r({
|
|
186
|
-
label:
|
|
186
|
+
label: i("email"),
|
|
187
187
|
required: !0,
|
|
188
188
|
name: "email",
|
|
189
189
|
type: "email",
|
|
190
|
-
placeholder:
|
|
190
|
+
placeholder: i("email_input")
|
|
191
191
|
}), { field: k, input: T } = r({
|
|
192
|
-
label:
|
|
192
|
+
label: i("phone"),
|
|
193
193
|
required: !0,
|
|
194
194
|
name: "phone",
|
|
195
195
|
type: "tel",
|
|
196
|
-
placeholder:
|
|
196
|
+
placeholder: i("phone_input")
|
|
197
197
|
});
|
|
198
198
|
s.appendChild(c), s.appendChild(g), s.appendChild(b), s.appendChild(E), s.appendChild(u), s.appendChild(B), s.appendChild(k), p.disabled = t.noTaxCode, L.disabled = t.noTaxCode;
|
|
199
199
|
function A() {
|
|
@@ -213,7 +213,7 @@ function ee({
|
|
|
213
213
|
return { container: s, getValues: H, validate: A };
|
|
214
214
|
}
|
|
215
215
|
function te({
|
|
216
|
-
type:
|
|
216
|
+
type: n,
|
|
217
217
|
data: a,
|
|
218
218
|
orderInfo: e,
|
|
219
219
|
theme: t,
|
|
@@ -230,9 +230,9 @@ function te({
|
|
|
230
230
|
const d = document.createElement("div");
|
|
231
231
|
d.className = "wgt:px-6 wgt:pt-6 wgt:pb-4 wgt:space-y-2";
|
|
232
232
|
const h = document.createElement("h3");
|
|
233
|
-
h.className = "wgt:text-xl wgt:font-semibold wgt:text-center wgt:text-strong-950", h.textContent =
|
|
233
|
+
h.className = "wgt:text-xl wgt:font-semibold wgt:text-center wgt:text-strong-950", h.textContent = i("confirmation_popup_title");
|
|
234
234
|
const g = document.createElement("p");
|
|
235
|
-
g.className = "wgt:text-sm wgt:text-center wgt:text-[#525866]", g.textContent =
|
|
235
|
+
g.className = "wgt:text-sm wgt:text-center wgt:text-[#525866]", g.textContent = i("confirmation_popup_subtitle"), d.appendChild(h), d.appendChild(g), c.appendChild(d);
|
|
236
236
|
const N = document.createElement("div");
|
|
237
237
|
N.className = "wgt:px-6 wgt:pb-4";
|
|
238
238
|
const f = document.createElement("div");
|
|
@@ -253,20 +253,20 @@ function te({
|
|
|
253
253
|
f.appendChild(
|
|
254
254
|
p(
|
|
255
255
|
L,
|
|
256
|
-
|
|
256
|
+
i("confirmation_popup_orderCode"),
|
|
257
257
|
e == null ? void 0 : e.billNo
|
|
258
258
|
)
|
|
259
259
|
), f.appendChild(
|
|
260
260
|
p(
|
|
261
261
|
b,
|
|
262
|
-
|
|
262
|
+
i("confirmation_popup_address"),
|
|
263
263
|
e == null ? void 0 : e.merchantAddress
|
|
264
264
|
)
|
|
265
265
|
), f.appendChild(
|
|
266
266
|
p(
|
|
267
267
|
_,
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
i("confirmation_popup_totalAmount"),
|
|
269
|
+
O(e == null ? void 0 : e.amount) + " VND"
|
|
270
270
|
)
|
|
271
271
|
), N.appendChild(f), c.appendChild(N);
|
|
272
272
|
const E = document.createElement("div");
|
|
@@ -281,30 +281,30 @@ function te({
|
|
|
281
281
|
const y = document.createElement("span");
|
|
282
282
|
return y.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", y.textContent = T || "-", A.appendChild(H), A.appendChild(y), A;
|
|
283
283
|
}
|
|
284
|
-
|
|
285
|
-
u(
|
|
284
|
+
n === "business" ? (w.appendChild(
|
|
285
|
+
u(i("confirmation_popup_taxCode"), a.taxCode)
|
|
286
286
|
), w.appendChild(
|
|
287
287
|
u(
|
|
288
|
-
|
|
288
|
+
i("confirmation_popup_representativeName"),
|
|
289
289
|
a.representativeName
|
|
290
290
|
)
|
|
291
291
|
), w.appendChild(
|
|
292
|
-
u(
|
|
292
|
+
u(i("confirmation_popup_buyerAddress"), a.buyerAddress)
|
|
293
293
|
), w.appendChild(
|
|
294
|
-
u(
|
|
294
|
+
u(i("confirmation_popup_performerName"), a.performerName)
|
|
295
295
|
), w.appendChild(
|
|
296
|
-
u(
|
|
296
|
+
u(i("confirmation_popup_email"), a.email)
|
|
297
297
|
), w.appendChild(
|
|
298
|
-
u(
|
|
298
|
+
u(i("confirmation_popup_phone"), a.phone)
|
|
299
299
|
)) : (w.appendChild(
|
|
300
300
|
u(
|
|
301
|
-
|
|
301
|
+
i("confirmation_popup_representativeName"),
|
|
302
302
|
a.representativeName
|
|
303
303
|
)
|
|
304
304
|
), w.appendChild(
|
|
305
|
-
u(
|
|
305
|
+
u(i("confirmation_popup_buyerAddress"), a.buyerAddress)
|
|
306
306
|
), w.appendChild(
|
|
307
|
-
u(
|
|
307
|
+
u(i("confirmation_popup_email"), a.email)
|
|
308
308
|
)), E.appendChild(w), c.appendChild(E);
|
|
309
309
|
const C = document.createElement("div");
|
|
310
310
|
C.className = "wgt:px-6 wgt:pb-6 wgt:flex wgt:gap-3";
|
|
@@ -320,7 +320,7 @@ function te({
|
|
|
320
320
|
title: "Xác nhận",
|
|
321
321
|
className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-primary wgt:text-white",
|
|
322
322
|
handleClick: () => {
|
|
323
|
-
typeof o == "function" && o({ type:
|
|
323
|
+
typeof o == "function" && o({ type: n, data: a }), r.remove();
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
326
|
return C.appendChild(B), C.appendChild(S), c.appendChild(C), r.appendChild(c), r.addEventListener("click", (k) => {
|
|
@@ -328,7 +328,7 @@ function te({
|
|
|
328
328
|
}), { overlay: r };
|
|
329
329
|
}
|
|
330
330
|
function ne({
|
|
331
|
-
orderInfo:
|
|
331
|
+
orderInfo: n,
|
|
332
332
|
onPreview: a,
|
|
333
333
|
theme: e,
|
|
334
334
|
onSubmit: t,
|
|
@@ -347,9 +347,9 @@ function ne({
|
|
|
347
347
|
const g = document.createElement("div");
|
|
348
348
|
g.className = "wgt:space-y-1";
|
|
349
349
|
const N = document.createElement("h3");
|
|
350
|
-
N.className = "wgt:text-2xl wgt:font-semibold wgt:text-text-black wgt:text-center wgt:justify-center", N.textContent =
|
|
350
|
+
N.className = "wgt:text-2xl wgt:font-semibold wgt:text-text-black wgt:text-center wgt:justify-center", N.textContent = i("invoiceform_title");
|
|
351
351
|
const f = document.createElement("p");
|
|
352
|
-
f.className = "wgt:text-sm wgt:text-weak-700 wgt:text-center wgt:justify-center", f.textContent =
|
|
352
|
+
f.className = "wgt:text-sm wgt:text-weak-700 wgt:text-center wgt:justify-center", f.textContent = i("invoiceform_subtitle"), g.appendChild(N), g.appendChild(f), r.appendChild(g);
|
|
353
353
|
const p = document.createElement("div");
|
|
354
354
|
p.className = "wgt:mt-2 wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-6 wgt:py-6";
|
|
355
355
|
function L(l, m) {
|
|
@@ -360,17 +360,17 @@ function ne({
|
|
|
360
360
|
const F = document.createElement("span");
|
|
361
361
|
F.className = "wgt:inline-flex wgt:items-center wgt:justify-center wgt:w-4 wgt:h-4 wgt:text-icon-primary";
|
|
362
362
|
let x = "";
|
|
363
|
-
l ===
|
|
363
|
+
l === i("orderCode") ? x = `
|
|
364
364
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
365
365
|
<path d="M12.7996 14H3.19961C3.04048 14 2.88787 13.9368 2.77535 13.8243C2.66282 13.7117 2.59961 13.5591 2.59961 13.4V2.6C2.59961 2.44087 2.66282 2.28826 2.77535 2.17574C2.88787 2.06321 3.04048 2 3.19961 2H12.7996C12.9587 2 13.1114 2.06321 13.2239 2.17574C13.3364 2.28826 13.3996 2.44087 13.3996 2.6V13.4C13.3996 13.5591 13.3364 13.7117 13.2239 13.8243C13.1114 13.9368 12.9587 14 12.7996 14ZM12.1996 12.8V3.2H3.79961V12.8H12.1996ZM5.59961 6.2H10.3996V7.4H5.59961V6.2ZM5.59961 8.6H10.3996V9.8H5.59961V8.6Z" fill="currentColor"/>
|
|
366
366
|
</svg>
|
|
367
367
|
|
|
368
|
-
` : l ===
|
|
368
|
+
` : l === i("address_form") ? x = `
|
|
369
369
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
370
370
|
<path d="M7.99961 13.34L10.9696 10.37C11.557 9.78256 11.9569 9.03419 12.1189 8.21948C12.281 7.40477 12.1978 6.56031 11.8799 5.79289C11.562 5.02546 11.0236 4.36954 10.333 3.90805C9.64229 3.44657 8.83028 3.20026 7.99961 3.20026C7.16895 3.20026 6.35694 3.44657 5.66626 3.90805C4.97558 4.36954 4.43726 5.02546 4.11936 5.79289C3.80146 6.56031 3.71826 7.40477 3.88028 8.21948C4.04231 9.03419 4.44227 9.78256 5.02961 10.37L7.99961 13.34ZM7.99961 15.0368L4.18121 11.2184C3.42602 10.4631 2.91172 9.50096 2.70337 8.45346C2.49501 7.40597 2.60195 6.32021 3.01067 5.33349C3.41938 4.34678 4.11152 3.50342 4.99954 2.91006C5.88756 2.3167 6.9316 2 7.99961 2C9.06763 2 10.1117 2.3167 10.9997 2.91006C11.8877 3.50342 12.5798 4.34678 12.9886 5.33349C13.3973 6.32021 13.5042 7.40597 13.2959 8.45346C13.0875 9.50096 12.5732 10.4631 11.818 11.2184L7.99961 15.0368ZM7.99961 8.59995C8.31787 8.59995 8.6231 8.47353 8.84814 8.24848C9.07318 8.02344 9.19961 7.71821 9.19961 7.39995C9.19961 7.08169 9.07318 6.77647 8.84814 6.55143C8.6231 6.32638 8.31787 6.19995 7.99961 6.19995C7.68135 6.19995 7.37613 6.32638 7.15108 6.55143C6.92604 6.77647 6.79961 7.08169 6.79961 7.39995C6.79961 7.71821 6.92604 8.02344 7.15108 8.24848C7.37613 8.47353 7.68135 8.59995 7.99961 8.59995ZM7.99961 9.79995C7.36309 9.79995 6.75264 9.5471 6.30256 9.09701C5.85247 8.64692 5.59961 8.03647 5.59961 7.39995C5.59961 6.76343 5.85247 6.15298 6.30256 5.7029C6.75264 5.25281 7.36309 4.99995 7.99961 4.99995C8.63613 4.99995 9.24658 5.25281 9.69667 5.7029C10.1468 6.15298 10.3996 6.76343 10.3996 7.39995C10.3996 8.03647 10.1468 8.64692 9.69667 9.09701C9.24658 9.5471 8.63613 9.79995 7.99961 9.79995Z" fill="currentColor"/>
|
|
371
371
|
</svg>
|
|
372
372
|
|
|
373
|
-
` : l ===
|
|
373
|
+
` : l === i("total_amount") && (x = `
|
|
374
374
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
375
375
|
<path d="M8 14C4.6862 14 2 11.3138 2 8C2 4.6862 4.6862 2 8 2C11.3138 2 14 4.6862 14 8C14 11.3138 11.3138 14 8 14ZM8 12.8C9.27304 12.8 10.4939 12.2943 11.3941 11.3941C12.2943 10.4939 12.8 9.27304 12.8 8C12.8 6.72696 12.2943 5.50606 11.3941 4.60589C10.4939 3.70571 9.27304 3.2 8 3.2C6.72696 3.2 5.50606 3.70571 4.60589 4.60589C3.70571 5.50606 3.2 6.72696 3.2 8C3.2 9.27304 3.70571 10.4939 4.60589 11.3941C5.50606 12.2943 6.72696 12.8 8 12.8V12.8ZM5.9 9.2H9.2C9.27957 9.2 9.35587 9.16839 9.41213 9.11213C9.46839 9.05587 9.5 8.97957 9.5 8.9C9.5 8.82044 9.46839 8.74413 9.41213 8.68787C9.35587 8.63161 9.27957 8.6 9.2 8.6H6.8C6.40218 8.6 6.02064 8.44197 5.73934 8.16066C5.45804 7.87936 5.3 7.49783 5.3 7.1C5.3 6.70218 5.45804 6.32065 5.73934 6.03934C6.02064 5.75804 6.40218 5.6 6.8 5.6H7.4V4.4H8.6V5.6H10.1V6.8H6.8C6.72044 6.8 6.64413 6.83161 6.58787 6.88787C6.53161 6.94413 6.5 7.02044 6.5 7.1C6.5 7.17957 6.53161 7.25587 6.58787 7.31213C6.64413 7.36839 6.72044 7.4 6.8 7.4H9.2C9.59783 7.4 9.97936 7.55804 10.2607 7.83934C10.542 8.12065 10.7 8.50218 10.7 8.9C10.7 9.29783 10.542 9.67936 10.2607 9.96066C9.97936 10.242 9.59783 10.4 9.2 10.4H8.6V11.6H7.4V10.4H5.9V9.2Z" fill="currentColor"/>
|
|
376
376
|
</svg>
|
|
@@ -381,12 +381,12 @@ function ne({
|
|
|
381
381
|
const j = document.createElement("span");
|
|
382
382
|
return j.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:w-2/3 wgt:text-right", j.textContent = m, M.appendChild(V), M.appendChild(j), M;
|
|
383
383
|
}
|
|
384
|
-
p.appendChild(L(
|
|
385
|
-
L(
|
|
384
|
+
p.appendChild(L(i("orderCode"), n == null ? void 0 : n.billNo)), p.appendChild(
|
|
385
|
+
L(i("address_form"), n == null ? void 0 : n.merchantAddress)
|
|
386
386
|
), p.appendChild(
|
|
387
387
|
L(
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
i("total_amount"),
|
|
389
|
+
O(n == null ? void 0 : n.amount) + " VND"
|
|
390
390
|
)
|
|
391
391
|
), r.appendChild(p);
|
|
392
392
|
const b = document.createElement("div");
|
|
@@ -400,7 +400,7 @@ function ne({
|
|
|
400
400
|
<path d="M10 12C11.4587 12 12.8572 12.5799 13.8887 13.6113C14.8016 14.5242 15.3592 15.7247 15.4756 17H14.9746C14.8598 15.8576 14.3542 14.7839 13.5352 13.9648C12.5975 13.0272 11.3261 12.5 10 12.5C8.67392 12.5 7.40253 13.0272 6.46484 13.9648C5.64577 14.7839 5.14018 15.8576 5.02539 17H4.52441C4.64082 15.7247 5.19843 14.5242 6.11133 13.6113C7.07838 12.6443 8.36805 12.0742 9.72754 12.0068L10 12ZM10 2.25C12.2101 2.25 14 4.03989 14 6.25C14 8.46011 12.2101 10.25 10 10.25C7.78989 10.25 6 8.46011 6 6.25C6 4.03989 7.78989 2.25 10 2.25ZM10 2.75C8.06636 2.75 6.5 4.31636 6.5 6.25C6.5 8.18364 8.06636 9.75 10 9.75C11.9336 9.75 13.5 8.18364 13.5 6.25C13.5 4.31636 11.9336 2.75 10 2.75Z" fill="currentColor" stroke="currentColor"/>
|
|
401
401
|
</svg>
|
|
402
402
|
|
|
403
|
-
${
|
|
403
|
+
${i("individual")}
|
|
404
404
|
</span>
|
|
405
405
|
`;
|
|
406
406
|
const w = document.createElement("button");
|
|
@@ -410,7 +410,7 @@ function ne({
|
|
|
410
410
|
<path d="M4 3.875H11.5C11.5332 3.875 11.5654 3.88769 11.5889 3.91113C11.6123 3.93457 11.625 3.96685 11.625 4V15.875H15.875V8.625H14.375V8.375H16C16.0332 8.375 16.0654 8.38769 16.0889 8.41113C16.1123 8.43457 16.125 8.46685 16.125 8.5V15.875H17.625V16.125H2.375V15.875H3.875V4C3.875 3.96685 3.88769 3.93457 3.91113 3.91113C3.93457 3.88769 3.96685 3.875 4 3.875ZM4.125 15.875H11.375V4.125H4.125V15.875ZM8.625 9.875V10.125H6.875V9.875H8.625ZM8.625 6.875V7.125H6.875V6.875H8.625Z" fill="currentColor" stroke="currentColor" stroke-width="1.25"/>
|
|
411
411
|
</svg>
|
|
412
412
|
|
|
413
|
-
${
|
|
413
|
+
${i("business")}
|
|
414
414
|
</span>
|
|
415
415
|
`, _.appendChild(E), _.appendChild(w);
|
|
416
416
|
const u = document.createElement("div");
|
|
@@ -434,12 +434,12 @@ function ne({
|
|
|
434
434
|
}
|
|
435
435
|
E.addEventListener("click", () => T("individual")), w.addEventListener("click", () => T("business")), T("individual");
|
|
436
436
|
const A = document.createElement("p");
|
|
437
|
-
A.className = "wgt:mt-2 wgt:text-xs wgt:text-[#FF8447] wgt:text-left wgt:justify-center", A.textContent =
|
|
437
|
+
A.className = "wgt:mt-2 wgt:text-xs wgt:text-[#FF8447] wgt:text-left wgt:justify-center", A.textContent = i("invoiceform_note"), r.appendChild(A);
|
|
438
438
|
const H = document.createElement("div");
|
|
439
439
|
H.className = "wgt:mt-6 wgt:w-full wgt:flex wgt:justify-center wgt:items-center";
|
|
440
440
|
const y = P({
|
|
441
441
|
type: "button",
|
|
442
|
-
title:
|
|
442
|
+
title: i("btn_preview"),
|
|
443
443
|
className: "wgt:min-w-[163px] wgt:text-white",
|
|
444
444
|
handleClick: () => {
|
|
445
445
|
if (!k.validate())
|
|
@@ -450,7 +450,7 @@ function ne({
|
|
|
450
450
|
}, { overlay: m } = te({
|
|
451
451
|
type: l.type,
|
|
452
452
|
data: l.data,
|
|
453
|
-
orderInfo:
|
|
453
|
+
orderInfo: n,
|
|
454
454
|
theme: e,
|
|
455
455
|
onClose: () => {
|
|
456
456
|
console.log("Popup closed");
|
|
@@ -466,30 +466,33 @@ function ne({
|
|
|
466
466
|
}), v = (F = (V = (M = x == null ? void 0 : x.finalData) != null ? M : x == null ? void 0 : x.data) != null ? V : x) != null ? F : {}, j = String((v == null ? void 0 : v.status) || "").trim().toLowerCase();
|
|
467
467
|
if (h(), j === "invoiced") {
|
|
468
468
|
R({
|
|
469
|
-
message:
|
|
470
|
-
description:
|
|
471
|
-
okLabel:
|
|
469
|
+
message: i("invoice_success"),
|
|
470
|
+
description: i("invoice_description"),
|
|
471
|
+
// okLabel: t('close'),
|
|
472
472
|
isSuccess: !0,
|
|
473
|
+
hideOkButton: !0,
|
|
473
474
|
theme: e
|
|
474
475
|
}).open();
|
|
475
476
|
return;
|
|
476
477
|
}
|
|
477
478
|
if (j === "failed") {
|
|
478
479
|
R({
|
|
479
|
-
message:
|
|
480
|
-
description:
|
|
481
|
-
okLabel:
|
|
480
|
+
message: i("invoice_failed"),
|
|
481
|
+
description: i("invoice_description_failed"),
|
|
482
|
+
// okLabel: t('close'),
|
|
482
483
|
isSuccess: !1,
|
|
484
|
+
hideOkButton: !0,
|
|
483
485
|
theme: e
|
|
484
486
|
}).open();
|
|
485
487
|
return;
|
|
486
488
|
}
|
|
487
489
|
} catch (x) {
|
|
488
490
|
h(), R({
|
|
489
|
-
message:
|
|
490
|
-
description:
|
|
491
|
-
okLabel:
|
|
491
|
+
message: i("invoice_failed"),
|
|
492
|
+
description: i("invoice_description_failed"),
|
|
493
|
+
// okLabel: t('close'),
|
|
492
494
|
isSuccess: !1,
|
|
495
|
+
hideOkButton: !0,
|
|
493
496
|
theme: e
|
|
494
497
|
}).open(), console.error(x);
|
|
495
498
|
}
|
|
@@ -500,9 +503,9 @@ function ne({
|
|
|
500
503
|
});
|
|
501
504
|
return H.appendChild(y), r.appendChild(H), { container: o };
|
|
502
505
|
}
|
|
503
|
-
function ie({ theme:
|
|
506
|
+
function ie({ theme: n, onClose: a } = {}) {
|
|
504
507
|
const e = document.createElement("div");
|
|
505
|
-
e.className = " wgt:flex wgt:h-screen wgt:bg-[#F3F4F6] wgt:p-4",
|
|
508
|
+
e.className = " wgt:flex wgt:h-screen wgt:bg-[#F3F4F6] wgt:p-4", n && e.setAttribute("data-theme", n);
|
|
506
509
|
const t = document.createElement("div");
|
|
507
510
|
t.className = "wgt:w-full wgt:max-w-md wgt:max-h-[208px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:p-8 wgt:text-center";
|
|
508
511
|
const s = document.createElement("div");
|
|
@@ -515,13 +518,13 @@ function ie({ theme: i, onClose: a } = {}) {
|
|
|
515
518
|
|
|
516
519
|
`, s.appendChild(o), t.appendChild(s);
|
|
517
520
|
const r = document.createElement("h2");
|
|
518
|
-
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent =
|
|
521
|
+
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent = i("invoiceCheckout_title"), t.appendChild(r);
|
|
519
522
|
const c = document.createElement("p");
|
|
520
|
-
return c.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed", c.textContent =
|
|
523
|
+
return c.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed", c.textContent = i("invoiceCheckout_description"), t.appendChild(c), e.appendChild(t), { container: e };
|
|
521
524
|
}
|
|
522
|
-
function ae({ theme:
|
|
525
|
+
function ae({ theme: n, onClose: a } = {}) {
|
|
523
526
|
const e = document.createElement("div");
|
|
524
|
-
e.className = "wgt:min-h-screen wgt:flex wgt:bg-[#F3F4F6] wgt:p-4",
|
|
527
|
+
e.className = "wgt:min-h-screen wgt:flex wgt:bg-[#F3F4F6] wgt:p-4", n && e.setAttribute("data-theme", n);
|
|
525
528
|
const t = document.createElement("div");
|
|
526
529
|
t.className = "wgt:w-full wgt:max-w-md wgt:max-h-[252px] wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:px-4 wgt:py-5 wgt:text-center";
|
|
527
530
|
const s = document.createElement("div");
|
|
@@ -547,15 +550,15 @@ function ae({ theme: i, onClose: a } = {}) {
|
|
|
547
550
|
|
|
548
551
|
`, s.appendChild(o), t.appendChild(s);
|
|
549
552
|
const r = document.createElement("h2");
|
|
550
|
-
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent =
|
|
553
|
+
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent = i("invoiceExpired_title"), t.appendChild(r);
|
|
551
554
|
const c = document.createElement("p");
|
|
552
|
-
c.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed wgt:px-2 wgt:mb-3", c.textContent =
|
|
555
|
+
c.className = "wgt:text-sm wgt:text-[#525866] wgt:leading-relaxed wgt:px-2 wgt:mb-3", c.textContent = i("invoiceExpired_description"), t.appendChild(c);
|
|
553
556
|
const d = document.createElement("p");
|
|
554
|
-
return d.className = "wgt:text-sm wgt:text-[#99A0AE] wgt:italic wgt:leading-relaxed wgt:px-4", d.textContent =
|
|
557
|
+
return d.className = "wgt:text-sm wgt:text-[#99A0AE] wgt:italic wgt:leading-relaxed wgt:px-4", d.textContent = i("invoiceExpired_note"), t.appendChild(d), e.appendChild(t), { container: e };
|
|
555
558
|
}
|
|
556
|
-
function W({ theme:
|
|
559
|
+
function W({ theme: n, onClose: a } = {}) {
|
|
557
560
|
const e = document.createElement("div");
|
|
558
|
-
e.className = "wgt:min-h-screen wgt:flex wgt:items-center wgt:bg-[#F3F4F6] wgt:p-4 wgt:justify-center",
|
|
561
|
+
e.className = "wgt:min-h-screen wgt:flex wgt:items-center wgt:bg-[#F3F4F6] wgt:p-4 wgt:justify-center", n && e.setAttribute("data-theme", n);
|
|
559
562
|
const t = document.createElement("div");
|
|
560
563
|
t.className = "wgt:w-full wgt:items-center wgt:flex wgt:flex-col wgt:min-h-screen wgt:justify-center wgt:bg-white wgt:rounded-2xl wgt:shadow-sm wgt:px-4 wgt:py-5 wgt:text-center";
|
|
561
564
|
const s = document.createElement("div");
|
|
@@ -579,12 +582,12 @@ function W({ theme: i, onClose: a } = {}) {
|
|
|
579
582
|
|
|
580
583
|
`, s.appendChild(o), t.appendChild(s);
|
|
581
584
|
const r = document.createElement("h2");
|
|
582
|
-
return r.className = "wgt:text-base wgt:font-medium wgt:text-[#99A0AE] wgt:mb-2", r.textContent =
|
|
585
|
+
return r.className = "wgt:text-base wgt:font-medium wgt:text-[#99A0AE] wgt:mb-2", r.textContent = i("order_not_found_title"), t.appendChild(r), e.appendChild(t), { container: e };
|
|
583
586
|
}
|
|
584
|
-
function U(
|
|
585
|
-
return String(
|
|
587
|
+
function U(n) {
|
|
588
|
+
return String(n || "").trim().toLowerCase();
|
|
586
589
|
}
|
|
587
|
-
function ge({ uuid:
|
|
590
|
+
function ge({ uuid: n, orderInfo: a, theme: e }) {
|
|
588
591
|
const t = document.createElement("div");
|
|
589
592
|
t.className = "wgt:w-full wgt:min-h-screen";
|
|
590
593
|
let s = !1;
|
|
@@ -597,7 +600,7 @@ function ge({ uuid: i, orderInfo: a, theme: e }) {
|
|
|
597
600
|
theme: e,
|
|
598
601
|
onSubmit: (L) => Z(null, [L], function* ({ type: f, data: p }) {
|
|
599
602
|
const b = oe(f, p);
|
|
600
|
-
return yield Y(
|
|
603
|
+
return yield Y(n, b), { ok: !0, finalData: yield se(n, {
|
|
601
604
|
maxTries: 20,
|
|
602
605
|
intervalMs: 1500
|
|
603
606
|
}) };
|
|
@@ -607,7 +610,7 @@ function ge({ uuid: i, orderInfo: a, theme: e }) {
|
|
|
607
610
|
}
|
|
608
611
|
function c() {
|
|
609
612
|
return Z(this, null, function* () {
|
|
610
|
-
const g = yield
|
|
613
|
+
const g = yield D(n);
|
|
611
614
|
if (String((g == null ? void 0 : g.message) || "").trim())
|
|
612
615
|
return o(W({ theme: e }).container);
|
|
613
616
|
const f = U(g == null ? void 0 : g.status);
|
|
@@ -616,7 +619,7 @@ function ge({ uuid: i, orderInfo: a, theme: e }) {
|
|
|
616
619
|
}
|
|
617
620
|
function d() {
|
|
618
621
|
return Z(this, null, function* () {
|
|
619
|
-
if (!
|
|
622
|
+
if (!n)
|
|
620
623
|
return o(W({ theme: e }).container);
|
|
621
624
|
try {
|
|
622
625
|
yield c();
|
|
@@ -630,23 +633,23 @@ function ge({ uuid: i, orderInfo: a, theme: e }) {
|
|
|
630
633
|
}
|
|
631
634
|
return { container: t, init: d, destroy: h };
|
|
632
635
|
}
|
|
633
|
-
function re(
|
|
634
|
-
const a = String(
|
|
636
|
+
function re(n) {
|
|
637
|
+
const a = String(n || "").trim().toLowerCase();
|
|
635
638
|
return "individual";
|
|
636
639
|
}
|
|
637
|
-
function oe(
|
|
640
|
+
function oe(n, a) {
|
|
638
641
|
return {
|
|
639
|
-
invoiceType: re(
|
|
642
|
+
invoiceType: re(n),
|
|
640
643
|
buyerName: (a == null ? void 0 : a.representativeName) || "",
|
|
641
644
|
address: (a == null ? void 0 : a.buyerAddress) || "",
|
|
642
645
|
email: (a == null ? void 0 : a.email) || ""
|
|
643
646
|
};
|
|
644
647
|
}
|
|
645
648
|
function se(t) {
|
|
646
|
-
return Z(this, arguments, function* (
|
|
649
|
+
return Z(this, arguments, function* (n, { maxTries: a = 20, intervalMs: e = 1500 } = {}) {
|
|
647
650
|
for (let o = 0; o < a; o++) {
|
|
648
651
|
yield le(e);
|
|
649
|
-
const r = yield
|
|
652
|
+
const r = yield D(n), c = U(r == null ? void 0 : r.status);
|
|
650
653
|
if (c === "invoiced")
|
|
651
654
|
return r;
|
|
652
655
|
if (c === "expired") {
|
|
@@ -658,8 +661,8 @@ function se(t) {
|
|
|
658
661
|
throw s.code = "POLL_TIMEOUT", s;
|
|
659
662
|
});
|
|
660
663
|
}
|
|
661
|
-
function le(
|
|
662
|
-
return new Promise((a) => setTimeout(a,
|
|
664
|
+
function le(n) {
|
|
665
|
+
return new Promise((a) => setTimeout(a, n));
|
|
663
666
|
}
|
|
664
667
|
export {
|
|
665
668
|
ge as createInvoiceRequestFlow
|