@invoice-sdk/widget 1.113.5 → 1.114.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-DEx-Mogp.js → index-6mHhop5J.js} +2 -2
- package/dist/{index-BHzw2I84.js → index-DJ4GkllD.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +98 -98
- package/dist/{invoice-BABz3Rg6.js → invoice-v4lmivNg.js} +32 -31
- package/dist/{widget-CZOCNt5L.js → widget-Hh4kyvn-.js} +2325 -2347
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var a = (e, t, r) => new Promise((i,
|
|
1
|
+
var a = (e, t, r) => new Promise((i, c) => {
|
|
2
2
|
var s = (o) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
u(r.next(o));
|
|
5
|
+
} catch (d) {
|
|
6
|
+
c(d);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, g = (o) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
u(r.throw(o));
|
|
11
|
+
} catch (d) {
|
|
12
|
+
c(d);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, u = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(s, g);
|
|
15
|
+
u((r = r.apply(e, t)).next());
|
|
16
16
|
});
|
|
17
|
-
import { j as f, g as l, k as w, C as
|
|
17
|
+
import { j as f, g as l, k as w, C as R, G as m, l as E, I as v, S as C, n as y, a as I, o as T, p, q as O, O as h } from "./index-DJ4GkllD.js";
|
|
18
18
|
function N({
|
|
19
19
|
title: e,
|
|
20
20
|
isDisabled: t = !1,
|
|
21
21
|
handleClick: r = null,
|
|
22
22
|
type: i = "button",
|
|
23
|
-
className:
|
|
23
|
+
className: c = ""
|
|
24
24
|
} = {}) {
|
|
25
25
|
const s = document.createElement("button");
|
|
26
26
|
return s.type = i, s.disabled = t, s.className = [
|
|
@@ -33,14 +33,14 @@ function N({
|
|
|
33
33
|
"wgt:disabled:cursor-not-allowed",
|
|
34
34
|
"wgt:cursor-pointer",
|
|
35
35
|
"wgt:hover:text-primary-hover-text",
|
|
36
|
-
|
|
37
|
-
].filter(Boolean).join(" "), s.innerText = e, typeof r == "function" && s.addEventListener("click", (
|
|
36
|
+
c
|
|
37
|
+
].filter(Boolean).join(" "), s.innerText = e, typeof r == "function" && s.addEventListener("click", (g) => a(null, null, function* () {
|
|
38
38
|
if (!s.disabled) {
|
|
39
39
|
s.disabled = !0;
|
|
40
40
|
try {
|
|
41
|
-
yield r(
|
|
42
|
-
} catch (
|
|
43
|
-
console.error("Button click handler error:",
|
|
41
|
+
yield r(g);
|
|
42
|
+
} catch (u) {
|
|
43
|
+
console.error("Button click handler error:", u);
|
|
44
44
|
} finally {
|
|
45
45
|
s.disabled = !1;
|
|
46
46
|
}
|
|
@@ -65,7 +65,7 @@ function x(e) {
|
|
|
65
65
|
return a(this, null, function* () {
|
|
66
66
|
if (!e)
|
|
67
67
|
throw new Error("Tax code is required to fetch tax information.");
|
|
68
|
-
return yield n.get(
|
|
68
|
+
return yield n.get(E, {
|
|
69
69
|
params: {
|
|
70
70
|
tax: e
|
|
71
71
|
}
|
|
@@ -76,7 +76,7 @@ function $(e, t, r) {
|
|
|
76
76
|
return a(this, null, function* () {
|
|
77
77
|
if (!t)
|
|
78
78
|
throw new Error("Tax code is required to check new customer.");
|
|
79
|
-
return (yield n.get(
|
|
79
|
+
return (yield n.get(R, {
|
|
80
80
|
params: {
|
|
81
81
|
provider: e,
|
|
82
82
|
taxCode: t,
|
|
@@ -85,9 +85,9 @@ function $(e, t, r) {
|
|
|
85
85
|
})).data;
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function A(e, t) {
|
|
89
89
|
return a(this, null, function* () {
|
|
90
|
-
return (yield n.get(
|
|
90
|
+
return (yield n.get(m, {
|
|
91
91
|
params: {
|
|
92
92
|
provider: e,
|
|
93
93
|
taxCode: t
|
|
@@ -95,7 +95,7 @@ function b(e, t) {
|
|
|
95
95
|
})).data;
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
const
|
|
98
|
+
const b = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.114.0";
|
|
99
99
|
function U(r) {
|
|
100
100
|
return a(this, arguments, function* ({ search: e, bank: t }) {
|
|
101
101
|
return (yield n.get(`${p}`, {
|
|
@@ -119,15 +119,16 @@ function M(t) {
|
|
|
119
119
|
})).data;
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
function q(
|
|
123
|
-
return a(this, arguments, function* ({ bank: e, hasRenew: t }) {
|
|
122
|
+
function q(i) {
|
|
123
|
+
return a(this, arguments, function* ({ bank: e, hasRenew: t, isCashRegister: r }) {
|
|
124
124
|
return (yield n.get(`${p}`, {
|
|
125
125
|
params: {
|
|
126
126
|
isActive: !0,
|
|
127
127
|
type: "service",
|
|
128
128
|
bank: e,
|
|
129
129
|
hasRenew: t,
|
|
130
|
-
limit: 99
|
|
130
|
+
limit: 99,
|
|
131
|
+
isCashRegister: r
|
|
131
132
|
}
|
|
132
133
|
})).data;
|
|
133
134
|
});
|
|
@@ -155,18 +156,18 @@ function G(e) {
|
|
|
155
156
|
e.organizationRegistrationCert
|
|
156
157
|
), e.legalRepresentativeIdCard.forEach((i) => {
|
|
157
158
|
t.append("legalRepresentativeIdCard", i);
|
|
158
|
-
}), t.append("isRenew", e.isRenew), yield n.post(
|
|
159
|
+
}), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), yield n.post(y, t, {
|
|
159
160
|
headers: {
|
|
160
161
|
"Content-Type": "multipart/form-data",
|
|
161
162
|
"X-Invoice-Widget-Mode": I(),
|
|
162
|
-
"X-Invoice-Widget-Version":
|
|
163
|
+
"X-Invoice-Widget-Version": S
|
|
163
164
|
}
|
|
164
165
|
});
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
168
|
function j(e) {
|
|
168
169
|
return a(this, null, function* () {
|
|
169
|
-
return yield n.get(`${
|
|
170
|
+
return yield n.get(`${h}/${e}/status`);
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
function B() {
|
|
@@ -192,7 +193,7 @@ function W(e, t) {
|
|
|
192
193
|
return a(this, null, function* () {
|
|
193
194
|
try {
|
|
194
195
|
return yield n.post(
|
|
195
|
-
`${
|
|
196
|
+
`${C}/${encodeURIComponent(e)}`,
|
|
196
197
|
t
|
|
197
198
|
);
|
|
198
199
|
} catch (r) {
|
|
@@ -206,8 +207,8 @@ export {
|
|
|
206
207
|
N as c,
|
|
207
208
|
U as d,
|
|
208
209
|
G as e,
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
b as f,
|
|
211
|
+
A as g,
|
|
211
212
|
B as h,
|
|
212
213
|
M as i,
|
|
213
214
|
q as j,
|