@invoice-sdk/widget 1.125.2 → 1.125.5

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.
@@ -1,10 +1,10 @@
1
- import { k as g, i as p, l as d, C as l, G as w, n as m, p as f, I as E, q as R, S as y, r as C, d as I, u as v, w as o, x as T, O as h } from "./index-_YNp3gpX.js";
2
- function _({
1
+ import { k as g, i as p, l as d, G as l, C as w, n as m, p as f, q as E, I as R, r as y, S as C, u as I, d as T, w as v, x as i, y as h, O } from "./index-74nzrhoT.js";
2
+ function b({
3
3
  title: e,
4
4
  isDisabled: t = !1,
5
5
  handleClick: r = null,
6
6
  type: s = "button",
7
- className: i = ""
7
+ className: o = ""
8
8
  } = {}) {
9
9
  const a = document.createElement("button");
10
10
  return a.type = s, a.disabled = t, a.className = [
@@ -17,7 +17,7 @@ function _({
17
17
  "wgt:disabled:cursor-not-allowed",
18
18
  "wgt:cursor-pointer",
19
19
  "wgt:hover:text-primary-hover-text",
20
- i
20
+ o
21
21
  ].filter(Boolean).join(" "), a.innerText = e, typeof r == "function" && a.addEventListener("click", async (c) => {
22
22
  if (!a.disabled) {
23
23
  a.disabled = !0;
@@ -45,19 +45,19 @@ n.interceptors.request.use(
45
45
  }
46
46
  );
47
47
  d(n, {});
48
- async function b(e) {
48
+ async function N(e) {
49
49
  if (!e)
50
50
  throw new Error("Tax code is required to fetch tax information.");
51
- return await n.get(m, {
51
+ return await n.get(f, {
52
52
  params: {
53
53
  tax: e
54
54
  }
55
55
  });
56
56
  }
57
- async function N(e, t, r) {
57
+ async function U(e, t, r) {
58
58
  if (!t)
59
59
  throw new Error("Tax code is required to check new customer.");
60
- return (await n.get(l, {
60
+ return (await n.get(w, {
61
61
  params: {
62
62
  provider: e,
63
63
  taxCode: t,
@@ -65,41 +65,47 @@ async function N(e, t, r) {
65
65
  }
66
66
  })).data;
67
67
  }
68
- async function U(e, t) {
69
- return (await n.get(w, {
68
+ async function x(e, t) {
69
+ return (await n.get(m, {
70
70
  params: {
71
71
  provider: e,
72
72
  taxCode: t
73
73
  }
74
74
  })).data;
75
75
  }
76
- const x = (e) => new Intl.NumberFormat("vi-VN").format(e), O = "1.125.2";
77
- async function $({ search: e, bank: t }) {
78
- return (await n.get(`${o}`, {
76
+ async function $() {
77
+ return await n.get(l);
78
+ }
79
+ const k = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.125.5";
80
+ async function A({ search: e, bank: t, provider: r }) {
81
+ return (await n.get(`${i}`, {
79
82
  params: {
80
83
  isActive: !0,
81
84
  search: e || null,
82
85
  type: "service",
83
- bank: t
86
+ bank: t,
87
+ provider: r
84
88
  }
85
89
  })).data;
86
90
  }
87
- async function k({ bank: e }) {
88
- return (await n.get(`${o}`, {
91
+ async function M({ bank: e, provider: t }) {
92
+ return (await n.get(`${i}`, {
89
93
  params: {
90
94
  isActive: !0,
91
95
  type: "initial_fee",
92
- bank: e
96
+ bank: e,
97
+ provider: t
93
98
  }
94
99
  })).data;
95
100
  }
96
- async function A({
101
+ async function q({
97
102
  bank: e,
98
103
  hasRenew: t,
99
104
  isCashRegister: r,
100
- customerType: s
105
+ customerType: s,
106
+ provider: o
101
107
  }) {
102
- return (await n.get(`${o}`, {
108
+ return (await n.get(`${i}`, {
103
109
  params: {
104
110
  isActive: !0,
105
111
  type: "service",
@@ -107,21 +113,23 @@ async function A({
107
113
  hasRenew: t,
108
114
  limit: 99,
109
115
  isCashRegister: r,
110
- customerType: "ENTERPRISE"
116
+ customerType: "ENTERPRISE",
117
+ provider: o
111
118
  }
112
119
  })).data;
113
120
  }
114
- async function M({ bank: e }) {
115
- return (await n.get(`${o}`, {
121
+ async function B({ bank: e, provider: t }) {
122
+ return (await n.get(`${i}`, {
116
123
  params: {
117
124
  isActive: !0,
118
125
  type: "signature",
119
126
  bank: e,
120
- limit: 99
127
+ limit: 99,
128
+ provider: t
121
129
  }
122
130
  })).data;
123
131
  }
124
- async function q(e) {
132
+ async function G(e) {
125
133
  const t = new FormData();
126
134
  return t.append(
127
135
  "eInvoiceRegistration",
@@ -131,58 +139,63 @@ async function q(e) {
131
139
  e.organizationRegistrationCert
132
140
  ), e.legalRepresentativeIdCard.forEach((s) => {
133
141
  t.append("legalRepresentativeIdCard", s);
134
- }), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), await n.post(C, t, {
142
+ }), t.append("isRenew", e.isRenew), t.append("isCashRegister", e.isCashRegister), await n.post(I, t, {
135
143
  headers: {
136
144
  "Content-Type": "multipart/form-data",
137
- "X-Invoice-Widget-Mode": I(),
138
- "X-Invoice-Widget-Version": O
145
+ "X-Invoice-Widget-Mode": T(),
146
+ "X-Invoice-Widget-Version": S
139
147
  }
140
148
  });
141
149
  }
142
- async function B(e) {
143
- return await n.get(`${h}/${e}/status`);
150
+ async function W(e) {
151
+ return await n.get(`${O}/${e}/status`);
144
152
  }
145
- async function F({ isRenewable: e, serialNumber: t } = {}) {
146
- const r = {
153
+ async function F({
154
+ isRenewable: e,
155
+ serialNumber: t,
156
+ provider: r
157
+ } = {}) {
158
+ const s = {
147
159
  isRenewable: !!e,
148
- serialNumber: (t ?? "").trim()
160
+ serialNumber: (t ?? "").trim(),
161
+ provider: r
149
162
  };
150
- return console.log("PROMO params:", r), (await n.get(v, { params: r })).data;
151
- }
152
- async function G(e) {
153
- return await n.post(`${T}/${e}`);
163
+ return console.log("PROMO params:", s), (await n.get(v, { params: s })).data;
154
164
  }
155
165
  async function V(e) {
166
+ return await n.post(`${h}/${e}`);
167
+ }
168
+ async function j(e) {
156
169
  return await n.get(
157
- `${E}/${encodeURIComponent(e)}`
170
+ `${R}/${encodeURIComponent(e)}`
158
171
  );
159
172
  }
160
- async function j(e, t) {
173
+ async function D(e, t) {
161
174
  try {
162
175
  return await n.post(
163
- `${y}/${encodeURIComponent(e)}`,
176
+ `${C}/${encodeURIComponent(e)}`,
164
177
  t
165
178
  );
166
179
  } catch (r) {
167
180
  throw r;
168
181
  }
169
182
  }
170
- async function W(e) {
183
+ async function L(e) {
171
184
  return await n.get(
172
- `${f}/${encodeURIComponent(e)}`
185
+ `${E}/${encodeURIComponent(e)}`
173
186
  );
174
187
  }
175
- async function D(e, t) {
188
+ async function Q(e, t) {
176
189
  try {
177
190
  return await n.post(
178
- `${R}/${encodeURIComponent(e)}`,
191
+ `${y}/${encodeURIComponent(e)}`,
179
192
  t
180
193
  );
181
194
  } catch (r) {
182
195
  throw r;
183
196
  }
184
197
  }
185
- function L() {
198
+ function X() {
186
199
  const e = document.createElement("div");
187
200
  e.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", e.style.display = "none";
188
201
  const t = document.createElement("div");
@@ -199,22 +212,23 @@ function L() {
199
212
  };
200
213
  }
201
214
  export {
202
- N as a,
203
- b,
204
- _ as c,
205
- $ as d,
206
- L as e,
207
- x as f,
208
- U as g,
209
- q as h,
215
+ U as a,
216
+ N as b,
217
+ b as c,
218
+ A as d,
219
+ X as e,
220
+ k as f,
221
+ x as g,
222
+ G as h,
210
223
  F as i,
211
- k as j,
212
- A as k,
213
- M as l,
214
- G as m,
215
- B as n,
216
- W as o,
217
- V as p,
224
+ M as j,
225
+ q as k,
226
+ B as l,
227
+ V as m,
228
+ W as n,
229
+ $ as o,
230
+ L as p,
218
231
  j as q,
219
- D as s
232
+ D as r,
233
+ Q as s
220
234
  };