@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
|
@@ -1,527 +1,536 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var X = Object.defineProperty;
|
|
2
|
+
var $ = Object.getOwnPropertySymbols;
|
|
3
|
+
var G = Object.prototype.hasOwnProperty, J = Object.prototype.propertyIsEnumerable;
|
|
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
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
|
|
10
|
-
return
|
|
6
|
+
G.call(a, e) && z(n, e, a[e]);
|
|
7
|
+
if ($)
|
|
8
|
+
for (var e of $(a))
|
|
9
|
+
J.call(a, e) && z(n, e, a[e]);
|
|
10
|
+
return n;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var Z = (n, a, e) => new Promise((t, s) => {
|
|
13
|
+
var o = (d) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
c(e.next(d));
|
|
16
|
+
} catch (h) {
|
|
17
|
+
s(h);
|
|
18
18
|
}
|
|
19
19
|
}, r = (d) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
21
|
+
c(e.throw(d));
|
|
22
|
+
} catch (h) {
|
|
23
|
+
s(h);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, c = (d) => d.done ? t(d.value) : Promise.resolve(d.value).then(o, r);
|
|
26
|
+
c((e = e.apply(n, a)).next());
|
|
27
27
|
});
|
|
28
|
-
import { c as
|
|
29
|
-
import { t as
|
|
30
|
-
function
|
|
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
|
-
function
|
|
39
|
-
typeof a == "function" && a(
|
|
38
|
+
function s() {
|
|
39
|
+
typeof a == "function" && a(q({}, e));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
e[
|
|
41
|
+
function o({ label: p, required: L, name: b, type: _ = "text", placeholder: E }) {
|
|
42
|
+
const w = document.createElement("div");
|
|
43
|
+
w.className = "";
|
|
44
|
+
const u = document.createElement("label");
|
|
45
|
+
u.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", u.htmlFor = b, u.innerHTML = L ? `${p} <span class="wgt:text-semantic-error wgt:text-[#ED1C24]">*</span>` : p;
|
|
46
|
+
const C = document.createElement("input");
|
|
47
|
+
return C.id = b, C.name = b, C.type = _, C.placeholder = E || "", C.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 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", C.value = e[b] || "", C.addEventListener("input", () => {
|
|
48
|
+
e[b] = C.value, C.classList.remove(
|
|
49
49
|
"wgt:border-semantic-error",
|
|
50
50
|
"wgt:bg-semantic-error-50"
|
|
51
|
-
),
|
|
52
|
-
}),
|
|
51
|
+
), s();
|
|
52
|
+
}), w.appendChild(u), w.appendChild(C), { field: w, input: C };
|
|
53
53
|
}
|
|
54
|
-
const { field: r, input:
|
|
55
|
-
label:
|
|
54
|
+
const { field: r, input: c } = o({
|
|
55
|
+
label: i("representativeName"),
|
|
56
56
|
required: !0,
|
|
57
57
|
name: "representativeName",
|
|
58
|
-
placeholder:
|
|
59
|
-
}), { field: d } =
|
|
60
|
-
label:
|
|
58
|
+
placeholder: i("representativeName_input")
|
|
59
|
+
}), { field: d } = o({
|
|
60
|
+
label: i("buyerAddress"),
|
|
61
61
|
required: !1,
|
|
62
62
|
name: "buyerAddress",
|
|
63
|
-
placeholder:
|
|
64
|
-
}), { field:
|
|
65
|
-
label:
|
|
63
|
+
placeholder: i("buyerAddress_input")
|
|
64
|
+
}), { field: h, input: g } = o({
|
|
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
|
-
t.appendChild(r), t.appendChild(d), t.appendChild(
|
|
72
|
-
function
|
|
73
|
-
let
|
|
74
|
-
function
|
|
75
|
-
|
|
71
|
+
t.appendChild(r), t.appendChild(d), t.appendChild(h);
|
|
72
|
+
function N() {
|
|
73
|
+
let p = !0;
|
|
74
|
+
function L(b) {
|
|
75
|
+
b.classList.add(
|
|
76
76
|
"wgt:border-semantic-error",
|
|
77
77
|
"wgt:bg-semantic-error-50"
|
|
78
|
-
),
|
|
78
|
+
), p = !1;
|
|
79
79
|
}
|
|
80
|
-
return e.representativeName.trim() ||
|
|
80
|
+
return e.representativeName.trim() || L(c), e.email.trim() || L(g), p;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
82
|
+
function f() {
|
|
83
|
+
return q({}, e);
|
|
84
84
|
}
|
|
85
|
-
return { container: t, getValues:
|
|
85
|
+
return { container: t, getValues: f, validate: N };
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
defaultValues:
|
|
87
|
+
function ee({
|
|
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:
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
function
|
|
103
|
-
typeof a == "function" && a(
|
|
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
|
+
}, s = document.createElement("div");
|
|
101
|
+
s.className = "wgt:space-y-2";
|
|
102
|
+
function o() {
|
|
103
|
+
typeof a == "function" && a(q({}, t));
|
|
104
104
|
}
|
|
105
|
-
function r({ label:
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
return
|
|
112
|
-
t[
|
|
105
|
+
function r({ label: y, required: l, name: m, type: M = "text", placeholder: V }) {
|
|
106
|
+
const F = document.createElement("div");
|
|
107
|
+
F.className = "";
|
|
108
|
+
const x = document.createElement("label");
|
|
109
|
+
x.className = "wgt:text-sm wgt:font-medium wgt:text-strong-950", x.htmlFor = m, x.innerHTML = l ? `${y} <span class="wgt:text-[#ED1C24]">*</span>` : y;
|
|
110
|
+
const v = document.createElement("input");
|
|
111
|
+
return v.id = m, v.name = m, v.type = M, v.placeholder = V || "", v.className = "wgt:w-full wgt:rounded-lg wgt:border wgt:border-[#E4E7EC] wgt:mt-2 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", v.value = t[m] || "", v.addEventListener("input", () => {
|
|
112
|
+
t[m] = v.value, v.classList.remove(
|
|
113
113
|
"wgt:border-semantic-error",
|
|
114
114
|
"wgt:bg-semantic-error-50"
|
|
115
|
-
),
|
|
116
|
-
}),
|
|
115
|
+
), o();
|
|
116
|
+
}), F.appendChild(x), F.appendChild(v), { field: F, input: v };
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
118
|
+
const c = document.createElement("label");
|
|
119
|
+
c.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:font-medium wgt:text-strong-950 wgt:text-sm";
|
|
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
|
-
const
|
|
123
|
-
|
|
124
|
-
t.noTaxCode = d.checked,
|
|
125
|
-
}),
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
t.taxCode =
|
|
122
|
+
const h = document.createElement("span");
|
|
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
|
+
t.noTaxCode = d.checked, p.disabled = t.noTaxCode, L.disabled = t.noTaxCode, o();
|
|
125
|
+
}), c.appendChild(d), c.appendChild(h);
|
|
126
|
+
const g = document.createElement("div");
|
|
127
|
+
g.className = "wgt:space-y-2";
|
|
128
|
+
const N = document.createElement("label");
|
|
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
|
+
const f = document.createElement("div");
|
|
131
|
+
f.className = "wgt:flex wgt:gap-2 wgt:mt-2";
|
|
132
|
+
const p = document.createElement("input");
|
|
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
|
+
t.taxCode = p.value, p.classList.remove(
|
|
135
135
|
"wgt:border-semantic-error",
|
|
136
136
|
"wgt:bg-semantic-error-50"
|
|
137
|
-
),
|
|
137
|
+
), o();
|
|
138
138
|
});
|
|
139
|
-
const
|
|
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
|
-
handleClick: () =>
|
|
143
|
+
handleClick: () => Z(null, null, function* () {
|
|
144
144
|
if (t.noTaxCode || typeof e != "function")
|
|
145
145
|
return;
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
148
|
-
|
|
146
|
+
const y = String(t.taxCode || "").trim();
|
|
147
|
+
if (!y) {
|
|
148
|
+
p.classList.add(
|
|
149
149
|
"wgt:border-semantic-error",
|
|
150
150
|
"wgt:bg-semantic-error-50"
|
|
151
151
|
);
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
try {
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
if (!
|
|
158
|
-
|
|
159
|
-
} catch (
|
|
160
|
-
|
|
155
|
+
L.disabled = !0;
|
|
156
|
+
const l = yield e(y, q({}, t));
|
|
157
|
+
if (!l || typeof l != "object") return;
|
|
158
|
+
l.representativeName != null && (t.representativeName = String(l.representativeName || ""), _.value = t.representativeName), l.buyerAddress != null && (t.buyerAddress = String(l.buyerAddress || ""), w.value = t.buyerAddress), o();
|
|
159
|
+
} catch (l) {
|
|
160
|
+
p.classList.add(
|
|
161
161
|
"wgt:border-semantic-error",
|
|
162
162
|
"wgt:bg-semantic-error-50"
|
|
163
163
|
);
|
|
164
164
|
} finally {
|
|
165
|
-
|
|
165
|
+
L.disabled = t.noTaxCode;
|
|
166
166
|
}
|
|
167
167
|
})
|
|
168
168
|
});
|
|
169
|
-
|
|
170
|
-
const { field:
|
|
171
|
-
label:
|
|
169
|
+
f.appendChild(p), f.appendChild(L), g.appendChild(N), g.appendChild(f);
|
|
170
|
+
const { field: b, input: _ } = r({
|
|
171
|
+
label: i("representativeName"),
|
|
172
172
|
required: !0,
|
|
173
173
|
name: "representativeName",
|
|
174
|
-
placeholder:
|
|
175
|
-
}), { field:
|
|
176
|
-
label:
|
|
174
|
+
placeholder: i("representativeName_input")
|
|
175
|
+
}), { field: E, input: w } = r({
|
|
176
|
+
label: i("buyerAddress"),
|
|
177
177
|
required: !1,
|
|
178
178
|
name: "buyerAddress",
|
|
179
|
-
placeholder:
|
|
180
|
-
}), { field:
|
|
181
|
-
label:
|
|
179
|
+
placeholder: i("buyerAddress_input")
|
|
180
|
+
}), { field: u, input: C } = r({
|
|
181
|
+
label: i("performerName"),
|
|
182
182
|
required: !0,
|
|
183
183
|
name: "performerName",
|
|
184
|
-
placeholder:
|
|
185
|
-
}), { field:
|
|
186
|
-
label:
|
|
184
|
+
placeholder: i("performerName_input")
|
|
185
|
+
}), { field: B, input: S } = r({
|
|
186
|
+
label: i("email"),
|
|
187
187
|
required: !0,
|
|
188
188
|
name: "email",
|
|
189
189
|
type: "email",
|
|
190
|
-
placeholder:
|
|
191
|
-
}), { field:
|
|
192
|
-
label:
|
|
190
|
+
placeholder: i("email_input")
|
|
191
|
+
}), { field: k, input: T } = r({
|
|
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
|
-
|
|
199
|
-
function
|
|
200
|
-
let
|
|
201
|
-
function
|
|
202
|
-
|
|
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
|
+
function A() {
|
|
200
|
+
let y = !0;
|
|
201
|
+
function l(m) {
|
|
202
|
+
m.classList.add(
|
|
203
203
|
"wgt:border-semantic-error",
|
|
204
204
|
"wgt:bg-semantic-error-50 ",
|
|
205
205
|
"wgt:mt-2"
|
|
206
|
-
),
|
|
206
|
+
), y = !1;
|
|
207
207
|
}
|
|
208
|
-
return !t.noTaxCode && !t.taxCode.trim() && p
|
|
208
|
+
return !t.noTaxCode && !t.taxCode.trim() && l(p), t.representativeName.trim() || l(_), t.performerName.trim() || l(C), t.email.trim() || l(S), t.phone.trim() || l(T), y;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
return
|
|
210
|
+
function H() {
|
|
211
|
+
return q({}, t);
|
|
212
212
|
}
|
|
213
|
-
return { container:
|
|
213
|
+
return { container: s, getValues: H, validate: A };
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
type:
|
|
215
|
+
function te({
|
|
216
|
+
type: n,
|
|
217
217
|
data: a,
|
|
218
218
|
orderInfo: e,
|
|
219
219
|
theme: t,
|
|
220
|
-
onClose:
|
|
221
|
-
onConfirm:
|
|
220
|
+
onClose: s,
|
|
221
|
+
onConfirm: o
|
|
222
222
|
}) {
|
|
223
223
|
const r = document.createElement("div");
|
|
224
224
|
r.className = "wgt:fixed wgt:inset-0 wgt:flex wgt:items-center wgt:justify-center wgt:z-50 wgt:p-4", r.style.cssText = `
|
|
225
225
|
background-color: rgba(0, 0, 0, 0.5);
|
|
226
226
|
backdrop-filter: blur(4px);
|
|
227
227
|
`, t && r.setAttribute("data-theme", t);
|
|
228
|
-
const
|
|
229
|
-
|
|
228
|
+
const c = document.createElement("div");
|
|
229
|
+
c.className = "wgt:w-full wgt:max-w-md wgt:bg-white wgt:rounded-2xl wgt:shadow-xl wgt:max-h-[90vh] wgt:overflow-y-auto";
|
|
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
|
-
const
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
function
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
const g = document.createElement("span");
|
|
244
|
-
g.className = "wgt:text-primary wgt:flex-shrink-0", g.innerHTML = _;
|
|
245
|
-
const p = document.createElement("div");
|
|
246
|
-
p.className = "wgt:flex wgt:items-start wgt:justify-between wgt:flex-1 wgt:gap-2";
|
|
247
|
-
const N = document.createElement("span");
|
|
248
|
-
N.className = "wgt:text-sm wgt:text-[#525866] wgt:w-1/3", N.textContent = B;
|
|
232
|
+
const h = document.createElement("h3");
|
|
233
|
+
h.className = "wgt:text-xl wgt:font-semibold wgt:text-center wgt:text-strong-950", h.textContent = i("confirmation_popup_title");
|
|
234
|
+
const g = document.createElement("p");
|
|
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
|
+
const N = document.createElement("div");
|
|
237
|
+
N.className = "wgt:px-6 wgt:pb-4";
|
|
238
|
+
const f = document.createElement("div");
|
|
239
|
+
f.className = "wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-4 wgt:py-3";
|
|
240
|
+
function p(k, T, A) {
|
|
241
|
+
const H = document.createElement("div");
|
|
242
|
+
H.className = "wgt:flex wgt:items-start wgt:gap-3";
|
|
249
243
|
const y = document.createElement("span");
|
|
250
|
-
|
|
244
|
+
y.className = "wgt:text-primary wgt:flex-shrink-0", y.innerHTML = k;
|
|
245
|
+
const l = document.createElement("div");
|
|
246
|
+
l.className = "wgt:flex wgt:items-start wgt:justify-between wgt:flex-1 wgt:gap-2";
|
|
247
|
+
const m = document.createElement("span");
|
|
248
|
+
m.className = "wgt:text-sm wgt:text-[#525866] wgt:w-1/3", m.textContent = T;
|
|
249
|
+
const M = document.createElement("span");
|
|
250
|
+
return M.className = "wgt:text-sm wgt:font-semibold wgt:text-strong-950 wgt:text-right wgt:w-2/3", M.textContent = A || "-", l.appendChild(m), l.appendChild(M), H.appendChild(y), H.appendChild(l), H;
|
|
251
251
|
}
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
const L = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>', b = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" /></svg>', _ = '<svg class="wgt:w-4 wgt:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';
|
|
253
|
+
f.appendChild(
|
|
254
|
+
p(
|
|
255
|
+
L,
|
|
256
|
+
i("confirmation_popup_orderCode"),
|
|
257
257
|
e == null ? void 0 : e.billNo
|
|
258
258
|
)
|
|
259
|
-
),
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
), f.appendChild(
|
|
260
|
+
p(
|
|
261
|
+
b,
|
|
262
|
+
i("confirmation_popup_address"),
|
|
263
263
|
e == null ? void 0 : e.merchantAddress
|
|
264
264
|
)
|
|
265
|
-
),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
), f.appendChild(
|
|
266
|
+
p(
|
|
267
|
+
_,
|
|
268
|
+
i("confirmation_popup_totalAmount"),
|
|
269
|
+
O(e == null ? void 0 : e.amount) + " VND"
|
|
270
270
|
)
|
|
271
|
-
),
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
function
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
return
|
|
271
|
+
), N.appendChild(f), c.appendChild(N);
|
|
272
|
+
const E = document.createElement("div");
|
|
273
|
+
E.className = "wgt:px-6 wgt:pb-6";
|
|
274
|
+
const w = document.createElement("div");
|
|
275
|
+
w.className = "wgt:space-y-3 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:px-4 wgt:py-4";
|
|
276
|
+
function u(k, T) {
|
|
277
|
+
const A = document.createElement("div");
|
|
278
|
+
A.className = "wgt:flex wgt:items-start wgt:justify-between wgt:gap-4";
|
|
279
|
+
const H = document.createElement("span");
|
|
280
|
+
H.className = "wgt:text-sm wgt:text-[#0E121B] wgt:w-1/3", H.textContent = k;
|
|
281
|
+
const y = document.createElement("span");
|
|
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
|
-
|
|
286
|
-
),
|
|
287
|
-
|
|
288
|
-
|
|
284
|
+
n === "business" ? (w.appendChild(
|
|
285
|
+
u(i("confirmation_popup_taxCode"), a.taxCode)
|
|
286
|
+
), w.appendChild(
|
|
287
|
+
u(
|
|
288
|
+
i("confirmation_popup_representativeName"),
|
|
289
289
|
a.representativeName
|
|
290
290
|
)
|
|
291
|
-
),
|
|
292
|
-
|
|
293
|
-
),
|
|
294
|
-
|
|
295
|
-
),
|
|
296
|
-
|
|
297
|
-
),
|
|
298
|
-
|
|
299
|
-
)) : (
|
|
300
|
-
|
|
301
|
-
|
|
291
|
+
), w.appendChild(
|
|
292
|
+
u(i("confirmation_popup_buyerAddress"), a.buyerAddress)
|
|
293
|
+
), w.appendChild(
|
|
294
|
+
u(i("confirmation_popup_performerName"), a.performerName)
|
|
295
|
+
), w.appendChild(
|
|
296
|
+
u(i("confirmation_popup_email"), a.email)
|
|
297
|
+
), w.appendChild(
|
|
298
|
+
u(i("confirmation_popup_phone"), a.phone)
|
|
299
|
+
)) : (w.appendChild(
|
|
300
|
+
u(
|
|
301
|
+
i("confirmation_popup_representativeName"),
|
|
302
302
|
a.representativeName
|
|
303
303
|
)
|
|
304
|
-
),
|
|
305
|
-
|
|
306
|
-
),
|
|
307
|
-
|
|
308
|
-
)),
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
const
|
|
304
|
+
), w.appendChild(
|
|
305
|
+
u(i("confirmation_popup_buyerAddress"), a.buyerAddress)
|
|
306
|
+
), w.appendChild(
|
|
307
|
+
u(i("confirmation_popup_email"), a.email)
|
|
308
|
+
)), E.appendChild(w), c.appendChild(E);
|
|
309
|
+
const C = document.createElement("div");
|
|
310
|
+
C.className = "wgt:px-6 wgt:pb-6 wgt:flex wgt:gap-3";
|
|
311
|
+
const B = P({
|
|
312
312
|
type: "button",
|
|
313
313
|
title: "Đóng",
|
|
314
314
|
className: "wgt:flex-1 wgt:py-3 wgt:text-sm wgt:font-semibold wgt:rounded-[8px] wgt:bg-white wgt:text-primary wgt:border wgt:border-primary",
|
|
315
315
|
handleClick: () => {
|
|
316
|
-
typeof
|
|
316
|
+
typeof s == "function" && s();
|
|
317
317
|
}
|
|
318
|
-
}),
|
|
318
|
+
}), S = P({
|
|
319
319
|
type: "button",
|
|
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
|
|
323
|
+
typeof o == "function" && o({ type: n, data: a }), r.remove();
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
|
-
return
|
|
327
|
-
|
|
326
|
+
return C.appendChild(B), C.appendChild(S), c.appendChild(C), r.appendChild(c), r.addEventListener("click", (k) => {
|
|
327
|
+
k.target === r && (typeof s == "function" && s(), r.remove());
|
|
328
328
|
}), { overlay: r };
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
orderInfo:
|
|
330
|
+
function ne({
|
|
331
|
+
orderInfo: n,
|
|
332
332
|
onPreview: a,
|
|
333
333
|
theme: e,
|
|
334
334
|
onSubmit: t,
|
|
335
|
-
taxCode:
|
|
335
|
+
taxCode: s = ""
|
|
336
336
|
}) {
|
|
337
|
-
const
|
|
338
|
-
|
|
337
|
+
const o = document.createElement("div");
|
|
338
|
+
o.className = "wgt:flex wgt:flex-col wgt:items-center wgt:justify-between wgt:h-full wgt:shadow wgt:rounded-xl", e && o.setAttribute("data-theme", e);
|
|
339
339
|
const r = document.createElement("div");
|
|
340
|
-
r.className = "wgt:w-full wgt:max-w-md wgt:space-y-4 wgt:rounded-xl wgt:bg-white wgt:p-4",
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
340
|
+
r.className = "wgt:w-full wgt:max-w-md wgt:space-y-4 wgt:rounded-xl wgt:bg-white wgt:p-4", o.appendChild(r);
|
|
341
|
+
const {
|
|
342
|
+
container: c,
|
|
343
|
+
open: d,
|
|
344
|
+
close: h
|
|
345
|
+
} = K();
|
|
346
|
+
o.style.position = o.style.position || "relative", o.appendChild(c);
|
|
347
|
+
const g = document.createElement("div");
|
|
348
|
+
g.className = "wgt:space-y-1";
|
|
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 = i("invoiceform_title");
|
|
351
|
+
const f = document.createElement("p");
|
|
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
|
+
const p = document.createElement("div");
|
|
354
|
+
p.className = "wgt:mt-2 wgt:space-y-3 wgt:rounded-xl wgt:bg-weak-50 wgt:px-6 wgt:py-6";
|
|
355
|
+
function L(l, m) {
|
|
356
|
+
const M = document.createElement("div");
|
|
357
|
+
M.className = "wgt:flex wgt:items-start";
|
|
358
|
+
const V = document.createElement("div");
|
|
359
|
+
V.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:w-1/3";
|
|
360
|
+
const F = document.createElement("span");
|
|
361
|
+
F.className = "wgt:inline-flex wgt:items-center wgt:justify-center wgt:w-4 wgt:h-4 wgt:text-icon-primary";
|
|
362
|
+
let x = "";
|
|
363
|
+
l === i("orderCode") ? x = `
|
|
358
364
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
359
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"/>
|
|
360
366
|
</svg>
|
|
361
367
|
|
|
362
|
-
` :
|
|
368
|
+
` : l === i("address_form") ? x = `
|
|
363
369
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
364
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"/>
|
|
365
371
|
</svg>
|
|
366
372
|
|
|
367
|
-
` :
|
|
373
|
+
` : l === i("total_amount") && (x = `
|
|
368
374
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
369
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"/>
|
|
370
376
|
</svg>
|
|
371
377
|
|
|
372
|
-
`),
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
const
|
|
376
|
-
return
|
|
378
|
+
`), F.innerHTML = x;
|
|
379
|
+
const v = document.createElement("span");
|
|
380
|
+
v.className = "wgt:text-sm wgt:text-weak-700", v.textContent = l, V.appendChild(F), V.appendChild(v);
|
|
381
|
+
const j = document.createElement("span");
|
|
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;
|
|
377
383
|
}
|
|
378
|
-
|
|
379
|
-
L(
|
|
380
|
-
),
|
|
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
|
+
), p.appendChild(
|
|
381
387
|
L(
|
|
382
|
-
|
|
383
|
-
|
|
388
|
+
i("total_amount"),
|
|
389
|
+
O(n == null ? void 0 : n.amount) + " VND"
|
|
384
390
|
)
|
|
385
|
-
), r.appendChild(
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
|
|
391
|
+
), r.appendChild(p);
|
|
392
|
+
const b = document.createElement("div");
|
|
393
|
+
b.className = "wgt:mt-4 wgt:rounded-xl wgt:border wgt:border-[#E1E4EA] wgt:bg-white wgt:pb-6", r.appendChild(b);
|
|
394
|
+
const _ = document.createElement("div");
|
|
395
|
+
_.className = "wgt:flex wgt:border-b wgt:border-[#E1E4EA]", b.appendChild(_);
|
|
396
|
+
const E = document.createElement("button");
|
|
397
|
+
E.type = "button", E.className = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold ", E.innerHTML = `
|
|
392
398
|
<span class="wgt:flex wgt:items-center wgt:justify-center wgt:gap-2">
|
|
393
399
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
394
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"/>
|
|
395
401
|
</svg>
|
|
396
402
|
|
|
397
|
-
${
|
|
403
|
+
${i("individual")}
|
|
398
404
|
</span>
|
|
399
405
|
`;
|
|
400
|
-
const
|
|
401
|
-
|
|
406
|
+
const w = document.createElement("button");
|
|
407
|
+
w.type = "button", w.className = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold", w.innerHTML = `
|
|
402
408
|
<span class="wgt:flex wgt:items-center wgt:justify-center wgt:gap-2">
|
|
403
409
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
404
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"/>
|
|
405
411
|
</svg>
|
|
406
412
|
|
|
407
|
-
${
|
|
413
|
+
${i("business")}
|
|
408
414
|
</span>
|
|
409
|
-
`,
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
defaultValues: { taxCode:
|
|
414
|
-
onFetchByTaxCode: (
|
|
415
|
-
var
|
|
416
|
-
const
|
|
415
|
+
`, _.appendChild(E), _.appendChild(w);
|
|
416
|
+
const u = document.createElement("div");
|
|
417
|
+
u.className = "wgt:mt-4 wgt:px-4", b.appendChild(u);
|
|
418
|
+
const C = I(), B = ee({
|
|
419
|
+
defaultValues: { taxCode: s || "" },
|
|
420
|
+
onFetchByTaxCode: (l) => Z(null, null, function* () {
|
|
421
|
+
var M, V;
|
|
422
|
+
const m = yield Q(l);
|
|
417
423
|
return {
|
|
418
|
-
representativeName: (
|
|
419
|
-
buyerAddress: (
|
|
424
|
+
representativeName: (M = m.nguoi_dai_dien) != null ? M : "",
|
|
425
|
+
buyerAddress: (V = m.dia_chi) != null ? V : ""
|
|
420
426
|
};
|
|
421
427
|
})
|
|
422
428
|
});
|
|
423
|
-
let
|
|
424
|
-
function T(
|
|
425
|
-
|
|
426
|
-
const
|
|
427
|
-
|
|
429
|
+
let S = "individual", k = C;
|
|
430
|
+
function T(l) {
|
|
431
|
+
S = l, E.style.borderBottom = "none", w.style.borderBottom = "none";
|
|
432
|
+
const m = "wgt:relative wgt:flex-1 wgt:py-4 wgt:text-sm wgt:font-semibold";
|
|
433
|
+
l === "individual" ? (E.className = `${m} wgt:text-strong-950`, E.style.borderBottom = "2px solid var(--primary)", w.className = `${m} wgt:text-soft-400`, u.innerHTML = "", u.appendChild(C.container), k = C) : (w.className = `${m} wgt:text-strong-950`, w.style.borderBottom = "2px solid var(--primary)", E.className = `${m} wgt:text-soft-400`, u.innerHTML = "", u.appendChild(B.container), k = B);
|
|
428
434
|
}
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
+
E.addEventListener("click", () => T("individual")), w.addEventListener("click", () => T("business")), T("individual");
|
|
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 = i("invoiceform_note"), r.appendChild(A);
|
|
438
|
+
const H = document.createElement("div");
|
|
439
|
+
H.className = "wgt:mt-6 wgt:w-full wgt:flex wgt:justify-center wgt:items-center";
|
|
440
|
+
const y = P({
|
|
435
441
|
type: "button",
|
|
436
|
-
title:
|
|
442
|
+
title: i("btn_preview"),
|
|
437
443
|
className: "wgt:min-w-[163px] wgt:text-white",
|
|
438
444
|
handleClick: () => {
|
|
439
|
-
if (!
|
|
445
|
+
if (!k.validate())
|
|
440
446
|
return;
|
|
441
|
-
const
|
|
442
|
-
type:
|
|
443
|
-
data:
|
|
444
|
-
}, { overlay:
|
|
445
|
-
type:
|
|
446
|
-
data:
|
|
447
|
-
orderInfo:
|
|
447
|
+
const l = {
|
|
448
|
+
type: S,
|
|
449
|
+
data: k.getValues()
|
|
450
|
+
}, { overlay: m } = te({
|
|
451
|
+
type: l.type,
|
|
452
|
+
data: l.data,
|
|
453
|
+
orderInfo: n,
|
|
448
454
|
theme: e,
|
|
449
455
|
onClose: () => {
|
|
450
456
|
console.log("Popup closed");
|
|
451
457
|
},
|
|
452
|
-
onConfirm: () =>
|
|
453
|
-
var
|
|
454
|
-
|
|
458
|
+
onConfirm: () => Z(null, null, function* () {
|
|
459
|
+
var M, V, F;
|
|
460
|
+
m.remove(), d();
|
|
455
461
|
try {
|
|
456
462
|
if (typeof t != "function") return;
|
|
457
|
-
const
|
|
458
|
-
type:
|
|
459
|
-
data:
|
|
460
|
-
}),
|
|
461
|
-
if (
|
|
462
|
-
|
|
463
|
-
message:
|
|
464
|
-
description:
|
|
465
|
-
okLabel:
|
|
463
|
+
const x = yield t({
|
|
464
|
+
type: l.type,
|
|
465
|
+
data: l.data
|
|
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
|
+
if (h(), j === "invoiced") {
|
|
468
|
+
R({
|
|
469
|
+
message: i("invoice_success"),
|
|
470
|
+
description: i("invoice_description"),
|
|
471
|
+
// okLabel: t('close'),
|
|
466
472
|
isSuccess: !0,
|
|
473
|
+
hideOkButton: !0,
|
|
467
474
|
theme: e
|
|
468
475
|
}).open();
|
|
469
476
|
return;
|
|
470
477
|
}
|
|
471
|
-
if (
|
|
472
|
-
|
|
473
|
-
message:
|
|
474
|
-
description:
|
|
475
|
-
okLabel:
|
|
478
|
+
if (j === "failed") {
|
|
479
|
+
R({
|
|
480
|
+
message: i("invoice_failed"),
|
|
481
|
+
description: i("invoice_description_failed"),
|
|
482
|
+
// okLabel: t('close'),
|
|
476
483
|
isSuccess: !1,
|
|
484
|
+
hideOkButton: !0,
|
|
477
485
|
theme: e
|
|
478
486
|
}).open();
|
|
479
487
|
return;
|
|
480
488
|
}
|
|
481
|
-
} catch (
|
|
482
|
-
|
|
483
|
-
message:
|
|
484
|
-
description:
|
|
485
|
-
okLabel:
|
|
489
|
+
} catch (x) {
|
|
490
|
+
h(), R({
|
|
491
|
+
message: i("invoice_failed"),
|
|
492
|
+
description: i("invoice_description_failed"),
|
|
493
|
+
// okLabel: t('close'),
|
|
486
494
|
isSuccess: !1,
|
|
495
|
+
hideOkButton: !0,
|
|
487
496
|
theme: e
|
|
488
|
-
}).open(), console.error(
|
|
497
|
+
}).open(), console.error(x);
|
|
489
498
|
}
|
|
490
499
|
})
|
|
491
500
|
});
|
|
492
|
-
document.body.appendChild(
|
|
501
|
+
document.body.appendChild(m);
|
|
493
502
|
}
|
|
494
503
|
});
|
|
495
|
-
return
|
|
504
|
+
return H.appendChild(y), r.appendChild(H), { container: o };
|
|
496
505
|
}
|
|
497
|
-
function
|
|
506
|
+
function ie({ theme: n, onClose: a } = {}) {
|
|
498
507
|
const e = document.createElement("div");
|
|
499
|
-
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);
|
|
500
509
|
const t = document.createElement("div");
|
|
501
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";
|
|
502
|
-
const o = document.createElement("div");
|
|
503
|
-
o.className = "wgt:flex wgt:justify-center wgt:mb-4";
|
|
504
511
|
const s = document.createElement("div");
|
|
505
|
-
s.className = "wgt:
|
|
512
|
+
s.className = "wgt:flex wgt:justify-center wgt:mb-4";
|
|
513
|
+
const o = document.createElement("div");
|
|
514
|
+
o.className = "wgt:w-12 wgt:h-12 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center", o.style.backgroundColor = "#335CFF", o.innerHTML = `
|
|
506
515
|
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
507
516
|
<path d="M20.7996 22.75H5.19961C4.94102 22.75 4.69303 22.6473 4.51018 22.4644C4.32733 22.2816 4.22461 22.0336 4.22461 21.775V4.225C4.22461 3.96641 4.32733 3.71842 4.51018 3.53557C4.69303 3.35272 4.94102 3.25 5.19961 3.25H20.7996C21.0582 3.25 21.3062 3.35272 21.489 3.53557C21.6719 3.71842 21.7746 3.96641 21.7746 4.225V21.775C21.7746 22.0336 21.6719 22.2816 21.489 22.4644C21.3062 22.6473 21.0582 22.75 20.7996 22.75ZM9.09961 10.075V12.025H16.8996V10.075H9.09961ZM9.09961 13.975V15.925H16.8996V13.975H9.09961Z" fill="white"/>
|
|
508
517
|
</svg>
|
|
509
518
|
|
|
510
|
-
`,
|
|
519
|
+
`, s.appendChild(o), t.appendChild(s);
|
|
511
520
|
const r = document.createElement("h2");
|
|
512
|
-
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent =
|
|
513
|
-
const
|
|
514
|
-
return
|
|
521
|
+
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent = i("invoiceCheckout_title"), t.appendChild(r);
|
|
522
|
+
const c = document.createElement("p");
|
|
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 };
|
|
515
524
|
}
|
|
516
|
-
function
|
|
525
|
+
function ae({ theme: n, onClose: a } = {}) {
|
|
517
526
|
const e = document.createElement("div");
|
|
518
|
-
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);
|
|
519
528
|
const t = document.createElement("div");
|
|
520
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";
|
|
521
|
-
const o = document.createElement("div");
|
|
522
|
-
o.className = "wgt:flex wgt:justify-center wgt:mb-2";
|
|
523
530
|
const s = document.createElement("div");
|
|
524
|
-
s.
|
|
531
|
+
s.className = "wgt:flex wgt:justify-center wgt:mb-2";
|
|
532
|
+
const o = document.createElement("div");
|
|
533
|
+
o.innerHTML = `
|
|
525
534
|
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
526
535
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.1342 21.7247L55.1467 20.5742C56.1143 19.4756 55.9467 17.7277 54.7361 16.6283C53.5262 15.5258 51.7494 15.5022 50.7825 16.6009L49.7715 17.7521L54.1342 21.7247Z" fill="#525866"/>
|
|
527
536
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M36.6582 10.4023H40.9028V14.1966H36.6582V10.4023Z" fill="#99A0AE"/>
|
|
@@ -539,23 +548,23 @@ function ne({ theme: i, onClose: a } = {}) {
|
|
|
539
548
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.7788 33.9142C39.4439 33.9142 39.9696 34.4369 39.9696 35.1051C39.9696 35.7748 39.4447 36.2959 38.7788 36.2959C38.1144 36.2959 37.5879 35.7748 37.5879 35.1051C37.5879 34.4361 38.1144 33.9142 38.7788 33.9142ZM44.1494 28.6799C43.9468 28.6837 43.7479 28.7675 43.6039 28.9146L39.9376 32.59C39.5826 32.4232 39.1925 32.3234 38.7788 32.3234C37.2542 32.3234 36.0039 33.5813 36.0039 35.1051C36.0039 36.6296 37.2542 37.8891 38.7788 37.8891C40.3033 37.8891 41.5544 36.6296 41.5544 35.1051C41.5544 34.5679 41.3944 34.0712 41.1285 33.6445L44.727 30.0376C45.2367 29.5317 44.8702 28.6632 44.1494 28.6799Z" fill="#808080"/>
|
|
540
549
|
</svg>
|
|
541
550
|
|
|
542
|
-
`,
|
|
551
|
+
`, s.appendChild(o), t.appendChild(s);
|
|
543
552
|
const r = document.createElement("h2");
|
|
544
|
-
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent =
|
|
545
|
-
const
|
|
546
|
-
|
|
553
|
+
r.className = "wgt:text-base wgt:font-semibold wgt:text-[#0E121B] wgt:mb-2", r.textContent = i("invoiceExpired_title"), t.appendChild(r);
|
|
554
|
+
const c = document.createElement("p");
|
|
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);
|
|
547
556
|
const d = document.createElement("p");
|
|
548
|
-
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 };
|
|
549
558
|
}
|
|
550
|
-
function
|
|
559
|
+
function W({ theme: n, onClose: a } = {}) {
|
|
551
560
|
const e = document.createElement("div");
|
|
552
|
-
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);
|
|
553
562
|
const t = document.createElement("div");
|
|
554
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";
|
|
555
|
-
const o = document.createElement("div");
|
|
556
|
-
o.className = "wgt:flex wgt:justify-center wgt:mb-2 wgt:items-center wgt:justify-center";
|
|
557
564
|
const s = document.createElement("div");
|
|
558
|
-
s.
|
|
565
|
+
s.className = "wgt:flex wgt:justify-center wgt:mb-2 wgt:items-center wgt:justify-center";
|
|
566
|
+
const o = document.createElement("div");
|
|
567
|
+
o.innerHTML = `
|
|
559
568
|
<svg width="148" height="148" viewBox="0 0 148 148" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
560
569
|
<path d="M135.244 83.385C135.244 100.471 128.265 115.873 117.075 126.943C106.125 137.892 90.9645 144.51 74.2393 144.51C57.6344 144.51 42.4734 137.772 31.4035 126.943C20.2132 115.873 13.2344 100.471 13.2344 83.385C13.2344 49.5736 40.5482 22.2598 74.2393 22.2598C107.93 22.2598 135.244 49.6939 135.244 83.385Z" fill="#F1F3FA" stroke="#D5DAE5" stroke-width="1.58571" stroke-miterlimit="10"/>
|
|
561
570
|
<path d="M65.7815 28.5312L61.2562 44.4926L72.0884 51.9999L71.3267 70.3394L84.999 45.2472L78.6484 40.1734L85.9114 28.5312H94.065L118.732 55.3638L119.694 132.853C119.694 135.5 117.528 137.546 114.881 137.546H39.317C36.6697 137.546 34.5039 135.38 34.5039 132.853V33.224C34.5039 30.5768 36.6697 28.5312 39.317 28.5312H65.7815Z" fill="white" stroke="#D5DAE5" stroke-width="1.58571" stroke-miterlimit="10" stroke-linejoin="round"/>
|
|
@@ -571,90 +580,90 @@ function R({ theme: i, onClose: a } = {}) {
|
|
|
571
580
|
</svg>
|
|
572
581
|
|
|
573
582
|
|
|
574
|
-
`,
|
|
583
|
+
`, s.appendChild(o), t.appendChild(s);
|
|
575
584
|
const r = document.createElement("h2");
|
|
576
|
-
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 };
|
|
577
586
|
}
|
|
578
|
-
function
|
|
579
|
-
return String(
|
|
587
|
+
function U(n) {
|
|
588
|
+
return String(n || "").trim().toLowerCase();
|
|
580
589
|
}
|
|
581
|
-
function
|
|
590
|
+
function ge({ uuid: n, orderInfo: a, theme: e }) {
|
|
582
591
|
const t = document.createElement("div");
|
|
583
592
|
t.className = "wgt:w-full wgt:min-h-screen";
|
|
584
|
-
let
|
|
585
|
-
function
|
|
586
|
-
|
|
593
|
+
let s = !1;
|
|
594
|
+
function o(g) {
|
|
595
|
+
s || (t.innerHTML = "", t.appendChild(g));
|
|
587
596
|
}
|
|
588
|
-
function r(
|
|
589
|
-
const
|
|
590
|
-
orderInfo:
|
|
597
|
+
function r(g) {
|
|
598
|
+
const N = ne({
|
|
599
|
+
orderInfo: g || {},
|
|
591
600
|
theme: e,
|
|
592
|
-
onSubmit: (
|
|
593
|
-
const
|
|
594
|
-
return yield
|
|
601
|
+
onSubmit: (L) => Z(null, [L], function* ({ type: f, data: p }) {
|
|
602
|
+
const b = oe(f, p);
|
|
603
|
+
return yield Y(n, b), { ok: !0, finalData: yield se(n, {
|
|
595
604
|
maxTries: 20,
|
|
596
605
|
intervalMs: 1500
|
|
597
606
|
}) };
|
|
598
607
|
})
|
|
599
608
|
});
|
|
600
|
-
|
|
609
|
+
o(N.container);
|
|
601
610
|
}
|
|
602
|
-
function
|
|
603
|
-
return
|
|
604
|
-
const
|
|
605
|
-
if (String((
|
|
606
|
-
return
|
|
607
|
-
const
|
|
608
|
-
return
|
|
611
|
+
function c() {
|
|
612
|
+
return Z(this, null, function* () {
|
|
613
|
+
const g = yield D(n);
|
|
614
|
+
if (String((g == null ? void 0 : g.message) || "").trim())
|
|
615
|
+
return o(W({ theme: e }).container);
|
|
616
|
+
const f = U(g == null ? void 0 : g.status);
|
|
617
|
+
return f === "expired" ? o(ae({ theme: e }).container) : f === "invoiced" ? o(ie({ theme: e }).container) : r(g || a || {});
|
|
609
618
|
});
|
|
610
619
|
}
|
|
611
620
|
function d() {
|
|
612
|
-
return
|
|
613
|
-
if (!
|
|
614
|
-
return
|
|
621
|
+
return Z(this, null, function* () {
|
|
622
|
+
if (!n)
|
|
623
|
+
return o(W({ theme: e }).container);
|
|
615
624
|
try {
|
|
616
|
-
yield
|
|
617
|
-
} catch (
|
|
618
|
-
return console.error("[EINV_FLOW] init error:",
|
|
625
|
+
yield c();
|
|
626
|
+
} catch (g) {
|
|
627
|
+
return console.error("[EINV_FLOW] init error:", g), o(W({ theme: e }).container);
|
|
619
628
|
}
|
|
620
629
|
});
|
|
621
630
|
}
|
|
622
|
-
function
|
|
623
|
-
|
|
631
|
+
function h() {
|
|
632
|
+
s = !0, t.innerHTML = "";
|
|
624
633
|
}
|
|
625
|
-
return { container: t, init: d, destroy:
|
|
634
|
+
return { container: t, init: d, destroy: h };
|
|
626
635
|
}
|
|
627
|
-
function
|
|
628
|
-
const a = String(
|
|
636
|
+
function re(n) {
|
|
637
|
+
const a = String(n || "").trim().toLowerCase();
|
|
629
638
|
return "individual";
|
|
630
639
|
}
|
|
631
|
-
function
|
|
640
|
+
function oe(n, a) {
|
|
632
641
|
return {
|
|
633
|
-
invoiceType:
|
|
642
|
+
invoiceType: re(n),
|
|
634
643
|
buyerName: (a == null ? void 0 : a.representativeName) || "",
|
|
635
644
|
address: (a == null ? void 0 : a.buyerAddress) || "",
|
|
636
645
|
email: (a == null ? void 0 : a.email) || ""
|
|
637
646
|
};
|
|
638
647
|
}
|
|
639
|
-
function
|
|
640
|
-
return
|
|
641
|
-
for (let
|
|
642
|
-
yield
|
|
643
|
-
const r = yield D(
|
|
644
|
-
if (
|
|
648
|
+
function se(t) {
|
|
649
|
+
return Z(this, arguments, function* (n, { maxTries: a = 20, intervalMs: e = 1500 } = {}) {
|
|
650
|
+
for (let o = 0; o < a; o++) {
|
|
651
|
+
yield le(e);
|
|
652
|
+
const r = yield D(n), c = U(r == null ? void 0 : r.status);
|
|
653
|
+
if (c === "invoiced")
|
|
645
654
|
return r;
|
|
646
|
-
if (
|
|
655
|
+
if (c === "expired") {
|
|
647
656
|
const d = new Error("Invoice request expired while polling");
|
|
648
657
|
throw d.code = "EXPIRED", d.data = r, d;
|
|
649
658
|
}
|
|
650
659
|
}
|
|
651
|
-
const
|
|
652
|
-
throw
|
|
660
|
+
const s = new Error("Polling timeout: status not invoiced");
|
|
661
|
+
throw s.code = "POLL_TIMEOUT", s;
|
|
653
662
|
});
|
|
654
663
|
}
|
|
655
|
-
function
|
|
656
|
-
return new Promise((a) => setTimeout(a,
|
|
664
|
+
function le(n) {
|
|
665
|
+
return new Promise((a) => setTimeout(a, n));
|
|
657
666
|
}
|
|
658
667
|
export {
|
|
659
|
-
|
|
668
|
+
ge as createInvoiceRequestFlow
|
|
660
669
|
};
|