@invoice-sdk/widget 1.115.7 → 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-D49c2XoX.js → index--3k30XIL.js} +395 -386
- package/dist/{index-DUTxhky5.js → index-964gT5_D.js} +469 -488
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +107 -108
- package/dist/loading-Cb7pkXB0.js +237 -0
- package/dist/{widget-C-3zhC6p.js → widget-wh_CEDP0.js} +11 -27
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/dist/invoice-DUiIiOd_.js +0 -220
package/dist/invoice-DUiIiOd_.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
var a = (e, t, r) => new Promise((i, c) => {
|
|
2
|
-
var s = (o) => {
|
|
3
|
-
try {
|
|
4
|
-
u(r.next(o));
|
|
5
|
-
} catch (d) {
|
|
6
|
-
c(d);
|
|
7
|
-
}
|
|
8
|
-
}, g = (o) => {
|
|
9
|
-
try {
|
|
10
|
-
u(r.throw(o));
|
|
11
|
-
} catch (d) {
|
|
12
|
-
c(d);
|
|
13
|
-
}
|
|
14
|
-
}, u = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(s, g);
|
|
15
|
-
u((r = r.apply(e, t)).next());
|
|
16
|
-
});
|
|
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-DUTxhky5.js";
|
|
18
|
-
function N({
|
|
19
|
-
title: e,
|
|
20
|
-
isDisabled: t = !1,
|
|
21
|
-
handleClick: r = null,
|
|
22
|
-
type: i = "button",
|
|
23
|
-
className: c = ""
|
|
24
|
-
} = {}) {
|
|
25
|
-
const s = document.createElement("button");
|
|
26
|
-
return s.type = i, s.disabled = t, s.className = [
|
|
27
|
-
"wgt:bg-primary",
|
|
28
|
-
"wgt:hover:bg-primary-dark",
|
|
29
|
-
"wgt:px-6",
|
|
30
|
-
"wgt:py-2",
|
|
31
|
-
"wgt:rounded-lg",
|
|
32
|
-
"wgt:disabled:opacity-50",
|
|
33
|
-
"wgt:disabled:cursor-not-allowed",
|
|
34
|
-
"wgt:cursor-pointer",
|
|
35
|
-
"wgt:hover:text-primary-hover-text",
|
|
36
|
-
c
|
|
37
|
-
].filter(Boolean).join(" "), s.innerText = e, typeof r == "function" && s.addEventListener("click", (g) => a(null, null, function* () {
|
|
38
|
-
if (!s.disabled) {
|
|
39
|
-
s.disabled = !0;
|
|
40
|
-
try {
|
|
41
|
-
yield r(g);
|
|
42
|
-
} catch (u) {
|
|
43
|
-
console.error("Button click handler error:", u);
|
|
44
|
-
} finally {
|
|
45
|
-
s.disabled = !1;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
})), s;
|
|
49
|
-
}
|
|
50
|
-
const n = f.create({
|
|
51
|
-
headers: {
|
|
52
|
-
Accept: "application/json"
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
n.interceptors.request.use(
|
|
56
|
-
function(e) {
|
|
57
|
-
return e.baseURL = l().invoiceHubBaseUrl, e;
|
|
58
|
-
},
|
|
59
|
-
function(e) {
|
|
60
|
-
return Promise.reject(e);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
w(n, {});
|
|
64
|
-
function x(e) {
|
|
65
|
-
return a(this, null, function* () {
|
|
66
|
-
if (!e)
|
|
67
|
-
throw new Error("Tax code is required to fetch tax information.");
|
|
68
|
-
return yield n.get(E, {
|
|
69
|
-
params: {
|
|
70
|
-
tax: e
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function $(e, t, r) {
|
|
76
|
-
return a(this, null, function* () {
|
|
77
|
-
if (!t)
|
|
78
|
-
throw new Error("Tax code is required to check new customer.");
|
|
79
|
-
return (yield n.get(R, {
|
|
80
|
-
params: {
|
|
81
|
-
provider: e,
|
|
82
|
-
taxCode: t,
|
|
83
|
-
invoiceType: r
|
|
84
|
-
}
|
|
85
|
-
})).data;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
function A(e, t) {
|
|
89
|
-
return a(this, null, function* () {
|
|
90
|
-
return (yield n.get(m, {
|
|
91
|
-
params: {
|
|
92
|
-
provider: e,
|
|
93
|
-
taxCode: t
|
|
94
|
-
}
|
|
95
|
-
})).data;
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const b = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.115.7";
|
|
99
|
-
function U(r) {
|
|
100
|
-
return a(this, arguments, function* ({ search: e, bank: t }) {
|
|
101
|
-
return (yield n.get(`${p}`, {
|
|
102
|
-
params: {
|
|
103
|
-
isActive: !0,
|
|
104
|
-
search: e || null,
|
|
105
|
-
type: "service",
|
|
106
|
-
bank: t
|
|
107
|
-
}
|
|
108
|
-
})).data;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function M(t) {
|
|
112
|
-
return a(this, arguments, function* ({ bank: e }) {
|
|
113
|
-
return (yield n.get(`${p}`, {
|
|
114
|
-
params: {
|
|
115
|
-
isActive: !0,
|
|
116
|
-
type: "initial_fee",
|
|
117
|
-
bank: e
|
|
118
|
-
}
|
|
119
|
-
})).data;
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function q(i) {
|
|
123
|
-
return a(this, arguments, function* ({ bank: e, hasRenew: t, isCashRegister: r }) {
|
|
124
|
-
return (yield n.get(`${p}`, {
|
|
125
|
-
params: {
|
|
126
|
-
isActive: !0,
|
|
127
|
-
type: "service",
|
|
128
|
-
bank: e,
|
|
129
|
-
hasRenew: t,
|
|
130
|
-
limit: 99,
|
|
131
|
-
isCashRegister: r
|
|
132
|
-
}
|
|
133
|
-
})).data;
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function F(t) {
|
|
137
|
-
return a(this, arguments, function* ({ bank: e }) {
|
|
138
|
-
return (yield n.get(`${p}`, {
|
|
139
|
-
params: {
|
|
140
|
-
isActive: !0,
|
|
141
|
-
type: "signature",
|
|
142
|
-
bank: e,
|
|
143
|
-
limit: 99
|
|
144
|
-
}
|
|
145
|
-
})).data;
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
function G(e) {
|
|
149
|
-
return a(this, null, function* () {
|
|
150
|
-
const t = new FormData();
|
|
151
|
-
return t.append(
|
|
152
|
-
"eInvoiceRegistration",
|
|
153
|
-
JSON.stringify(e.eInvoiceRegistration)
|
|
154
|
-
), t.append("provider", e.provider), t.append("bank", e.bank), t.append("packages", JSON.stringify(e.packages)), t.append("promotionCodes", JSON.stringify(e.promotionCodes)), t.append("logo", e.logo), t.append(
|
|
155
|
-
"organizationRegistrationCert",
|
|
156
|
-
e.organizationRegistrationCert
|
|
157
|
-
), e.legalRepresentativeIdCard.forEach((i) => {
|
|
158
|
-
t.append("legalRepresentativeIdCard", i);
|
|
159
|
-
}), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), yield n.post(y, t, {
|
|
160
|
-
headers: {
|
|
161
|
-
"Content-Type": "multipart/form-data",
|
|
162
|
-
"X-Invoice-Widget-Mode": I(),
|
|
163
|
-
"X-Invoice-Widget-Version": S
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
function j(e) {
|
|
169
|
-
return a(this, null, function* () {
|
|
170
|
-
return yield n.get(`${h}/${e}/status`);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
function B() {
|
|
174
|
-
return a(this, arguments, function* ({ isRenewable: e } = {}) {
|
|
175
|
-
return (yield n.get(T, {
|
|
176
|
-
params: e === !0 ? { isRenewable: !0 } : void 0
|
|
177
|
-
})).data;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
function D(e) {
|
|
181
|
-
return a(this, null, function* () {
|
|
182
|
-
return yield n.post(`${O}/${e}`);
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
function V(e) {
|
|
186
|
-
return a(this, null, function* () {
|
|
187
|
-
return yield n.get(
|
|
188
|
-
`${v}/${encodeURIComponent(e)}`
|
|
189
|
-
);
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
function W(e, t) {
|
|
193
|
-
return a(this, null, function* () {
|
|
194
|
-
try {
|
|
195
|
-
return yield n.post(
|
|
196
|
-
`${C}/${encodeURIComponent(e)}`,
|
|
197
|
-
t
|
|
198
|
-
);
|
|
199
|
-
} catch (r) {
|
|
200
|
-
throw r;
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
export {
|
|
205
|
-
$ as a,
|
|
206
|
-
x as b,
|
|
207
|
-
N as c,
|
|
208
|
-
U as d,
|
|
209
|
-
G as e,
|
|
210
|
-
b as f,
|
|
211
|
-
A as g,
|
|
212
|
-
B as h,
|
|
213
|
-
M as i,
|
|
214
|
-
q as j,
|
|
215
|
-
F as k,
|
|
216
|
-
D as l,
|
|
217
|
-
j as m,
|
|
218
|
-
V as n,
|
|
219
|
-
W as s
|
|
220
|
-
};
|