@tarxemo/customer_support 1.0.13 → 1.0.14
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.es.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
var Et = Object.defineProperty;
|
|
2
2
|
var _t = (e, t, r) => t in e ? Et(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var Pe = (e, t, r) => _t(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import w, { useState as
|
|
4
|
+
import w, { useState as V, useEffect as Ee, useRef as Ge, useCallback as te } from "react";
|
|
5
5
|
import { ExternalLink as St, Send as Rt, X as Ot, Loader2 as Tt, MessageCircle as At } from "lucide-react";
|
|
6
6
|
function Ye(e, t) {
|
|
7
7
|
return function() {
|
|
8
8
|
return e.apply(t, arguments);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
const { toString: Ct } = Object.prototype, { getPrototypeOf:
|
|
11
|
+
const { toString: Ct } = Object.prototype, { getPrototypeOf: _e } = Object, { iterator: ae, toStringTag: Qe } = Symbol, ce = /* @__PURE__ */ ((e) => (t) => {
|
|
12
12
|
const r = Ct.call(t);
|
|
13
13
|
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
|
|
14
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
15
|
-
function
|
|
16
|
-
return e !== null &&
|
|
14
|
+
})(/* @__PURE__ */ Object.create(null)), P = (e) => (e = e.toLowerCase(), (t) => ce(t) === e), le = (e) => (t) => typeof t === e, { isArray: z } = Array, q = le("undefined");
|
|
15
|
+
function W(e) {
|
|
16
|
+
return e !== null && !q(e) && e.constructor !== null && !q(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
17
17
|
}
|
|
18
|
-
const Ze =
|
|
18
|
+
const Ze = P("ArrayBuffer");
|
|
19
19
|
function Nt(e) {
|
|
20
20
|
let t;
|
|
21
21
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ze(e.buffer), t;
|
|
22
22
|
}
|
|
23
|
-
const kt =
|
|
24
|
-
if (
|
|
23
|
+
const kt = le("string"), N = le("function"), et = le("number"), X = (e) => e !== null && typeof e == "object", Pt = (e) => e === !0 || e === !1, ne = (e) => {
|
|
24
|
+
if (ce(e) !== "object")
|
|
25
25
|
return !1;
|
|
26
|
-
const t =
|
|
27
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Qe in e) && !(
|
|
26
|
+
const t = _e(e);
|
|
27
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Qe in e) && !(ae in e);
|
|
28
28
|
}, Ut = (e) => {
|
|
29
|
-
if (!
|
|
29
|
+
if (!X(e) || W(e))
|
|
30
30
|
return !1;
|
|
31
31
|
try {
|
|
32
32
|
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
33
33
|
} catch {
|
|
34
34
|
return !1;
|
|
35
35
|
}
|
|
36
|
-
}, Dt =
|
|
36
|
+
}, Dt = P("Date"), Ft = P("File"), vt = P("Blob"), Lt = P("FileList"), Bt = (e) => X(e) && N(e.pipe), It = (e) => {
|
|
37
37
|
let t;
|
|
38
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
39
|
-
t === "object" &&
|
|
40
|
-
}, jt =
|
|
41
|
-
function
|
|
38
|
+
return e && (typeof FormData == "function" && e instanceof FormData || N(e.append) && ((t = ce(e)) === "formdata" || // detect form-data instance
|
|
39
|
+
t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
|
|
40
|
+
}, jt = P("URLSearchParams"), [Mt, $t, Ht, qt] = ["ReadableStream", "Request", "Response", "Headers"].map(P), zt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
41
|
+
function G(e, t, { allOwnKeys: r = !1 } = {}) {
|
|
42
42
|
if (e === null || typeof e > "u")
|
|
43
43
|
return;
|
|
44
44
|
let n, s;
|
|
45
|
-
if (typeof e != "object" && (e = [e]),
|
|
45
|
+
if (typeof e != "object" && (e = [e]), z(e))
|
|
46
46
|
for (n = 0, s = e.length; n < s; n++)
|
|
47
47
|
t.call(null, e[n], n, e);
|
|
48
48
|
else {
|
|
49
|
-
if (
|
|
49
|
+
if (W(e))
|
|
50
50
|
return;
|
|
51
51
|
const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
|
|
52
52
|
let a;
|
|
@@ -55,7 +55,7 @@ function W(e, t, { allOwnKeys: r = !1 } = {}) {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
function tt(e, t) {
|
|
58
|
-
if (
|
|
58
|
+
if (W(e))
|
|
59
59
|
return null;
|
|
60
60
|
t = t.toLowerCase();
|
|
61
61
|
const r = Object.keys(e);
|
|
@@ -65,18 +65,18 @@ function tt(e, t) {
|
|
|
65
65
|
return s;
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
68
|
+
const j = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, rt = (e) => !q(e) && e !== j;
|
|
69
|
+
function we() {
|
|
70
70
|
const { caseless: e, skipUndefined: t } = rt(this) && this || {}, r = {}, n = (s, o) => {
|
|
71
71
|
const i = e && tt(r, o) || o;
|
|
72
|
-
|
|
72
|
+
ne(r[i]) && ne(s) ? r[i] = we(r[i], s) : ne(s) ? r[i] = we({}, s) : z(s) ? r[i] = s.slice() : (!t || !q(s)) && (r[i] = s);
|
|
73
73
|
};
|
|
74
74
|
for (let s = 0, o = arguments.length; s < o; s++)
|
|
75
|
-
arguments[s] &&
|
|
75
|
+
arguments[s] && G(arguments[s], n);
|
|
76
76
|
return r;
|
|
77
77
|
}
|
|
78
|
-
const Jt = (e, t, r, { allOwnKeys: n } = {}) => (
|
|
79
|
-
r &&
|
|
78
|
+
const Jt = (e, t, r, { allOwnKeys: n } = {}) => (G(t, (s, o) => {
|
|
79
|
+
r && N(s) ? Object.defineProperty(e, o, {
|
|
80
80
|
value: Ye(s, r),
|
|
81
81
|
writable: !0,
|
|
82
82
|
enumerable: !0,
|
|
@@ -103,7 +103,7 @@ const Jt = (e, t, r, { allOwnKeys: n } = {}) => (W(t, (s, o) => {
|
|
|
103
103
|
do {
|
|
104
104
|
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
|
|
105
105
|
i = s[o], (!n || n(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
|
|
106
|
-
e = r !== !1 &&
|
|
106
|
+
e = r !== !1 && _e(e);
|
|
107
107
|
} while (e && (!r || r(e, t)) && e !== Object.prototype);
|
|
108
108
|
return t;
|
|
109
109
|
}, Xt = (e, t, r) => {
|
|
@@ -112,15 +112,15 @@ const Jt = (e, t, r, { allOwnKeys: n } = {}) => (W(t, (s, o) => {
|
|
|
112
112
|
return n !== -1 && n === r;
|
|
113
113
|
}, Gt = (e) => {
|
|
114
114
|
if (!e) return null;
|
|
115
|
-
if (
|
|
115
|
+
if (z(e)) return e;
|
|
116
116
|
let t = e.length;
|
|
117
117
|
if (!et(t)) return null;
|
|
118
118
|
const r = new Array(t);
|
|
119
119
|
for (; t-- > 0; )
|
|
120
120
|
r[t] = e[t];
|
|
121
121
|
return r;
|
|
122
|
-
}, Yt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" &&
|
|
123
|
-
const n = (e && e[
|
|
122
|
+
}, Yt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && _e(Uint8Array)), Qt = (e, t) => {
|
|
123
|
+
const n = (e && e[ae]).call(e);
|
|
124
124
|
let s;
|
|
125
125
|
for (; (s = n.next()) && !s.done; ) {
|
|
126
126
|
const o = s.value;
|
|
@@ -132,23 +132,23 @@ const Jt = (e, t, r, { allOwnKeys: n } = {}) => (W(t, (s, o) => {
|
|
|
132
132
|
for (; (r = e.exec(t)) !== null; )
|
|
133
133
|
n.push(r);
|
|
134
134
|
return n;
|
|
135
|
-
}, er =
|
|
135
|
+
}, er = P("HTMLFormElement"), tr = (e) => e.toLowerCase().replace(
|
|
136
136
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
137
137
|
function(r, n, s) {
|
|
138
138
|
return n.toUpperCase() + s;
|
|
139
139
|
}
|
|
140
|
-
), Ue = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), rr =
|
|
140
|
+
), Ue = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), rr = P("RegExp"), nt = (e, t) => {
|
|
141
141
|
const r = Object.getOwnPropertyDescriptors(e), n = {};
|
|
142
|
-
|
|
142
|
+
G(r, (s, o) => {
|
|
143
143
|
let i;
|
|
144
144
|
(i = t(s, o, e)) !== !1 && (n[o] = i || s);
|
|
145
145
|
}), Object.defineProperties(e, n);
|
|
146
146
|
}, nr = (e) => {
|
|
147
147
|
nt(e, (t, r) => {
|
|
148
|
-
if (
|
|
148
|
+
if (N(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
149
149
|
return !1;
|
|
150
150
|
const n = e[r];
|
|
151
|
-
if (
|
|
151
|
+
if (N(n)) {
|
|
152
152
|
if (t.enumerable = !1, "writable" in t) {
|
|
153
153
|
t.writable = !1;
|
|
154
154
|
return;
|
|
@@ -164,73 +164,73 @@ const Jt = (e, t, r, { allOwnKeys: n } = {}) => (W(t, (s, o) => {
|
|
|
164
164
|
r[o] = !0;
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
|
-
return
|
|
167
|
+
return z(e) ? n(e) : n(String(e).split(t)), r;
|
|
168
168
|
}, or = () => {
|
|
169
169
|
}, ir = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
170
170
|
function ar(e) {
|
|
171
|
-
return !!(e &&
|
|
171
|
+
return !!(e && N(e.append) && e[Qe] === "FormData" && e[ae]);
|
|
172
172
|
}
|
|
173
173
|
const cr = (e) => {
|
|
174
174
|
const t = new Array(10), r = (n, s) => {
|
|
175
|
-
if (
|
|
175
|
+
if (X(n)) {
|
|
176
176
|
if (t.indexOf(n) >= 0)
|
|
177
177
|
return;
|
|
178
|
-
if (
|
|
178
|
+
if (W(n))
|
|
179
179
|
return n;
|
|
180
180
|
if (!("toJSON" in n)) {
|
|
181
181
|
t[s] = n;
|
|
182
|
-
const o =
|
|
183
|
-
return
|
|
182
|
+
const o = z(n) ? [] : {};
|
|
183
|
+
return G(n, (i, a) => {
|
|
184
184
|
const f = r(i, s + 1);
|
|
185
|
-
|
|
185
|
+
!q(f) && (o[a] = f);
|
|
186
186
|
}), t[s] = void 0, o;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
return n;
|
|
190
190
|
};
|
|
191
191
|
return r(e, 0);
|
|
192
|
-
}, lr =
|
|
193
|
-
s ===
|
|
192
|
+
}, lr = P("AsyncFunction"), ur = (e) => e && (X(e) || N(e)) && N(e.then) && N(e.catch), st = ((e, t) => e ? setImmediate : t ? ((r, n) => (j.addEventListener("message", ({ source: s, data: o }) => {
|
|
193
|
+
s === j && o === r && n.length && n.shift()();
|
|
194
194
|
}, !1), (s) => {
|
|
195
|
-
n.push(s),
|
|
195
|
+
n.push(s), j.postMessage(r, "*");
|
|
196
196
|
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
197
197
|
typeof setImmediate == "function",
|
|
198
|
-
|
|
199
|
-
), dr = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
200
|
-
isArray:
|
|
198
|
+
N(j.postMessage)
|
|
199
|
+
), dr = typeof queueMicrotask < "u" ? queueMicrotask.bind(j) : typeof process < "u" && process.nextTick || st, fr = (e) => e != null && N(e[ae]), c = {
|
|
200
|
+
isArray: z,
|
|
201
201
|
isArrayBuffer: Ze,
|
|
202
|
-
isBuffer:
|
|
202
|
+
isBuffer: W,
|
|
203
203
|
isFormData: It,
|
|
204
204
|
isArrayBufferView: Nt,
|
|
205
205
|
isString: kt,
|
|
206
206
|
isNumber: et,
|
|
207
207
|
isBoolean: Pt,
|
|
208
|
-
isObject:
|
|
209
|
-
isPlainObject:
|
|
208
|
+
isObject: X,
|
|
209
|
+
isPlainObject: ne,
|
|
210
210
|
isEmptyObject: Ut,
|
|
211
211
|
isReadableStream: Mt,
|
|
212
212
|
isRequest: $t,
|
|
213
213
|
isResponse: Ht,
|
|
214
214
|
isHeaders: qt,
|
|
215
|
-
isUndefined:
|
|
215
|
+
isUndefined: q,
|
|
216
216
|
isDate: Dt,
|
|
217
217
|
isFile: Ft,
|
|
218
|
-
isBlob:
|
|
218
|
+
isBlob: vt,
|
|
219
219
|
isRegExp: rr,
|
|
220
|
-
isFunction:
|
|
220
|
+
isFunction: N,
|
|
221
221
|
isStream: Bt,
|
|
222
222
|
isURLSearchParams: jt,
|
|
223
223
|
isTypedArray: Yt,
|
|
224
|
-
isFileList:
|
|
225
|
-
forEach:
|
|
226
|
-
merge:
|
|
224
|
+
isFileList: Lt,
|
|
225
|
+
forEach: G,
|
|
226
|
+
merge: we,
|
|
227
227
|
extend: Jt,
|
|
228
228
|
trim: zt,
|
|
229
229
|
stripBOM: Kt,
|
|
230
230
|
inherits: Vt,
|
|
231
231
|
toFlatObject: Wt,
|
|
232
|
-
kindOf:
|
|
233
|
-
kindOfTest:
|
|
232
|
+
kindOf: ce,
|
|
233
|
+
kindOfTest: P,
|
|
234
234
|
endsWith: Xt,
|
|
235
235
|
toArray: Gt,
|
|
236
236
|
forEachEntry: Qt,
|
|
@@ -246,7 +246,7 @@ const cr = (e) => {
|
|
|
246
246
|
noop: or,
|
|
247
247
|
toFiniteNumber: ir,
|
|
248
248
|
findKey: tt,
|
|
249
|
-
global:
|
|
249
|
+
global: j,
|
|
250
250
|
isContextDefined: rt,
|
|
251
251
|
isSpecCompliantForm: ar,
|
|
252
252
|
toJSONObject: cr,
|
|
@@ -308,7 +308,7 @@ g.ERR_CANCELED = "ERR_CANCELED";
|
|
|
308
308
|
g.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
309
309
|
g.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
310
310
|
const pr = null;
|
|
311
|
-
function
|
|
311
|
+
function be(e) {
|
|
312
312
|
return c.isPlainObject(e) || c.isArray(e);
|
|
313
313
|
}
|
|
314
314
|
function it(e) {
|
|
@@ -320,12 +320,12 @@ function De(e, t, r) {
|
|
|
320
320
|
}).join(r ? "." : "") : t;
|
|
321
321
|
}
|
|
322
322
|
function mr(e) {
|
|
323
|
-
return c.isArray(e) && !e.some(
|
|
323
|
+
return c.isArray(e) && !e.some(be);
|
|
324
324
|
}
|
|
325
325
|
const hr = c.toFlatObject(c, {}, null, function(t) {
|
|
326
326
|
return /^is[A-Z]/.test(t);
|
|
327
327
|
});
|
|
328
|
-
function
|
|
328
|
+
function ue(e, t, r) {
|
|
329
329
|
if (!c.isObject(e))
|
|
330
330
|
throw new TypeError("target must be an object");
|
|
331
331
|
t = t || new FormData(), r = c.toFlatObject(r, {
|
|
@@ -354,39 +354,39 @@ function le(e, t, r) {
|
|
|
354
354
|
if (c.endsWith(h, "{}"))
|
|
355
355
|
h = n ? h : h.slice(0, -2), d = JSON.stringify(d);
|
|
356
356
|
else if (c.isArray(d) && mr(d) || (c.isFileList(d) || c.endsWith(h, "[]")) && (E = c.toArray(d)))
|
|
357
|
-
return h = it(h), E.forEach(function(x,
|
|
357
|
+
return h = it(h), E.forEach(function(x, S) {
|
|
358
358
|
!(c.isUndefined(x) || x === null) && t.append(
|
|
359
359
|
// eslint-disable-next-line no-nested-ternary
|
|
360
|
-
i === !0 ? De([h],
|
|
360
|
+
i === !0 ? De([h], S, o) : i === null ? h : h + "[]",
|
|
361
361
|
u(x)
|
|
362
362
|
);
|
|
363
363
|
}), !1;
|
|
364
364
|
}
|
|
365
|
-
return
|
|
365
|
+
return be(d) ? !0 : (t.append(De(m, h, o), u(d)), !1);
|
|
366
366
|
}
|
|
367
367
|
const p = [], y = Object.assign(hr, {
|
|
368
368
|
defaultVisitor: l,
|
|
369
369
|
convertValue: u,
|
|
370
|
-
isVisitable:
|
|
370
|
+
isVisitable: be
|
|
371
371
|
});
|
|
372
|
-
function
|
|
372
|
+
function T(d, h) {
|
|
373
373
|
if (!c.isUndefined(d)) {
|
|
374
374
|
if (p.indexOf(d) !== -1)
|
|
375
375
|
throw Error("Circular reference detected in " + h.join("."));
|
|
376
|
-
p.push(d), c.forEach(d, function(E,
|
|
376
|
+
p.push(d), c.forEach(d, function(E, R) {
|
|
377
377
|
(!(c.isUndefined(E) || E === null) && s.call(
|
|
378
378
|
t,
|
|
379
379
|
E,
|
|
380
|
-
c.isString(
|
|
380
|
+
c.isString(R) ? R.trim() : R,
|
|
381
381
|
h,
|
|
382
382
|
y
|
|
383
|
-
)) === !0 &&
|
|
383
|
+
)) === !0 && T(E, h ? h.concat(R) : [R]);
|
|
384
384
|
}), p.pop();
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
if (!c.isObject(e))
|
|
388
388
|
throw new TypeError("data must be an object");
|
|
389
|
-
return
|
|
389
|
+
return T(e), t;
|
|
390
390
|
}
|
|
391
391
|
function Fe(e) {
|
|
392
392
|
const t = {
|
|
@@ -402,10 +402,10 @@ function Fe(e) {
|
|
|
402
402
|
return t[n];
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
this._pairs = [], e &&
|
|
405
|
+
function Se(e, t) {
|
|
406
|
+
this._pairs = [], e && ue(e, this, t);
|
|
407
407
|
}
|
|
408
|
-
const at =
|
|
408
|
+
const at = Se.prototype;
|
|
409
409
|
at.append = function(t, r) {
|
|
410
410
|
this._pairs.push([t, r]);
|
|
411
411
|
};
|
|
@@ -427,13 +427,13 @@ function ct(e, t, r) {
|
|
|
427
427
|
serialize: r
|
|
428
428
|
} : r, o = s && s.serialize;
|
|
429
429
|
let i;
|
|
430
|
-
if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new
|
|
430
|
+
if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new Se(t, s).toString(n), i) {
|
|
431
431
|
const a = e.indexOf("#");
|
|
432
432
|
a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
433
433
|
}
|
|
434
434
|
return e;
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class ve {
|
|
437
437
|
constructor() {
|
|
438
438
|
this.handlers = [];
|
|
439
439
|
}
|
|
@@ -492,7 +492,7 @@ const lt = {
|
|
|
492
492
|
silentJSONParsing: !0,
|
|
493
493
|
forcedJSONParsing: !0,
|
|
494
494
|
clarifyTimeoutError: !1
|
|
495
|
-
}, wr = typeof URLSearchParams < "u" ? URLSearchParams :
|
|
495
|
+
}, wr = typeof URLSearchParams < "u" ? URLSearchParams : Se, br = typeof FormData < "u" ? FormData : null, yr = typeof Blob < "u" ? Blob : null, xr = {
|
|
496
496
|
isBrowser: !0,
|
|
497
497
|
classes: {
|
|
498
498
|
URLSearchParams: wr,
|
|
@@ -500,22 +500,22 @@ const lt = {
|
|
|
500
500
|
Blob: yr
|
|
501
501
|
},
|
|
502
502
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
503
|
-
},
|
|
504
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Sr =
|
|
503
|
+
}, Re = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0, Er = Re && (!ye || ["ReactNative", "NativeScript", "NS"].indexOf(ye.product) < 0), _r = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
504
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Sr = Re && window.location.href || "http://localhost", Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
505
505
|
__proto__: null,
|
|
506
|
-
hasBrowserEnv:
|
|
506
|
+
hasBrowserEnv: Re,
|
|
507
507
|
hasStandardBrowserEnv: Er,
|
|
508
508
|
hasStandardBrowserWebWorkerEnv: _r,
|
|
509
|
-
navigator:
|
|
509
|
+
navigator: ye,
|
|
510
510
|
origin: Sr
|
|
511
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
511
|
+
}, Symbol.toStringTag, { value: "Module" })), C = {
|
|
512
512
|
...Rr,
|
|
513
513
|
...xr
|
|
514
514
|
};
|
|
515
515
|
function Or(e, t) {
|
|
516
|
-
return
|
|
516
|
+
return ue(e, new C.classes.URLSearchParams(), {
|
|
517
517
|
visitor: function(r, n, s, o) {
|
|
518
|
-
return
|
|
518
|
+
return C.isNode && c.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
519
519
|
},
|
|
520
520
|
...t
|
|
521
521
|
});
|
|
@@ -557,7 +557,7 @@ function Cr(e, t, r) {
|
|
|
557
557
|
}
|
|
558
558
|
return (r || JSON.stringify)(e);
|
|
559
559
|
}
|
|
560
|
-
const
|
|
560
|
+
const Y = {
|
|
561
561
|
transitional: lt,
|
|
562
562
|
adapter: ["xhr", "http", "fetch"],
|
|
563
563
|
transformRequest: [function(t, r) {
|
|
@@ -576,7 +576,7 @@ const X = {
|
|
|
576
576
|
return Or(t, this.formSerializer).toString();
|
|
577
577
|
if ((a = c.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
|
|
578
578
|
const f = this.env && this.env.FormData;
|
|
579
|
-
return
|
|
579
|
+
return ue(
|
|
580
580
|
a ? { "files[]": t } : t,
|
|
581
581
|
f && new f(),
|
|
582
582
|
this.formSerializer
|
|
@@ -586,7 +586,7 @@ const X = {
|
|
|
586
586
|
return o || s ? (r.setContentType("application/json", !1), Cr(t)) : t;
|
|
587
587
|
}],
|
|
588
588
|
transformResponse: [function(t) {
|
|
589
|
-
const r = this.transitional ||
|
|
589
|
+
const r = this.transitional || Y.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
|
|
590
590
|
if (c.isResponse(t) || c.isReadableStream(t))
|
|
591
591
|
return t;
|
|
592
592
|
if (t && c.isString(t) && (n && !this.responseType || s)) {
|
|
@@ -610,8 +610,8 @@ const X = {
|
|
|
610
610
|
maxContentLength: -1,
|
|
611
611
|
maxBodyLength: -1,
|
|
612
612
|
env: {
|
|
613
|
-
FormData:
|
|
614
|
-
Blob:
|
|
613
|
+
FormData: C.classes.FormData,
|
|
614
|
+
Blob: C.classes.Blob
|
|
615
615
|
},
|
|
616
616
|
validateStatus: function(t) {
|
|
617
617
|
return t >= 200 && t < 300;
|
|
@@ -624,7 +624,7 @@ const X = {
|
|
|
624
624
|
}
|
|
625
625
|
};
|
|
626
626
|
c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
627
|
-
|
|
627
|
+
Y.headers[e] = {};
|
|
628
628
|
});
|
|
629
629
|
const Nr = c.toObjectSet([
|
|
630
630
|
"age",
|
|
@@ -651,12 +651,12 @@ const Nr = c.toObjectSet([
|
|
|
651
651
|
`).forEach(function(i) {
|
|
652
652
|
s = i.indexOf(":"), r = i.substring(0, s).trim().toLowerCase(), n = i.substring(s + 1).trim(), !(!r || t[r] && Nr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
|
|
653
653
|
}), t;
|
|
654
|
-
},
|
|
655
|
-
function
|
|
654
|
+
}, Le = Symbol("internals");
|
|
655
|
+
function K(e) {
|
|
656
656
|
return e && String(e).trim().toLowerCase();
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
return e === !1 || e == null ? e : c.isArray(e) ? e.map(
|
|
658
|
+
function se(e) {
|
|
659
|
+
return e === !1 || e == null ? e : c.isArray(e) ? e.map(se) : String(e);
|
|
660
660
|
}
|
|
661
661
|
function Pr(e) {
|
|
662
662
|
const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -666,7 +666,7 @@ function Pr(e) {
|
|
|
666
666
|
return t;
|
|
667
667
|
}
|
|
668
668
|
const Ur = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
669
|
-
function
|
|
669
|
+
function me(e, t, r, n, s) {
|
|
670
670
|
if (c.isFunction(n))
|
|
671
671
|
return n.call(this, t, r);
|
|
672
672
|
if (s && (t = r), !!c.isString(t)) {
|
|
@@ -690,18 +690,18 @@ function Fr(e, t) {
|
|
|
690
690
|
});
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
-
let
|
|
693
|
+
let k = class {
|
|
694
694
|
constructor(t) {
|
|
695
695
|
t && this.set(t);
|
|
696
696
|
}
|
|
697
697
|
set(t, r, n) {
|
|
698
698
|
const s = this;
|
|
699
699
|
function o(a, f, u) {
|
|
700
|
-
const l =
|
|
700
|
+
const l = K(f);
|
|
701
701
|
if (!l)
|
|
702
702
|
throw new Error("header name must be a non-empty string");
|
|
703
703
|
const p = c.findKey(s, l);
|
|
704
|
-
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || f] =
|
|
704
|
+
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || f] = se(a));
|
|
705
705
|
}
|
|
706
706
|
const i = (a, f) => c.forEach(a, (u, l) => o(u, l, f));
|
|
707
707
|
if (c.isPlainObject(t) || t instanceof this.constructor)
|
|
@@ -721,7 +721,7 @@ let C = class {
|
|
|
721
721
|
return this;
|
|
722
722
|
}
|
|
723
723
|
get(t, r) {
|
|
724
|
-
if (t =
|
|
724
|
+
if (t = K(t), t) {
|
|
725
725
|
const n = c.findKey(this, t);
|
|
726
726
|
if (n) {
|
|
727
727
|
const s = this[n];
|
|
@@ -738,9 +738,9 @@ let C = class {
|
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
740
|
has(t, r) {
|
|
741
|
-
if (t =
|
|
741
|
+
if (t = K(t), t) {
|
|
742
742
|
const n = c.findKey(this, t);
|
|
743
|
-
return !!(n && this[n] !== void 0 && (!r ||
|
|
743
|
+
return !!(n && this[n] !== void 0 && (!r || me(this, this[n], n, r)));
|
|
744
744
|
}
|
|
745
745
|
return !1;
|
|
746
746
|
}
|
|
@@ -748,9 +748,9 @@ let C = class {
|
|
|
748
748
|
const n = this;
|
|
749
749
|
let s = !1;
|
|
750
750
|
function o(i) {
|
|
751
|
-
if (i =
|
|
751
|
+
if (i = K(i), i) {
|
|
752
752
|
const a = c.findKey(n, i);
|
|
753
|
-
a && (!r ||
|
|
753
|
+
a && (!r || me(n, n[a], a, r)) && (delete n[a], s = !0);
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
return c.isArray(t) ? t.forEach(o) : o(t), s;
|
|
@@ -760,7 +760,7 @@ let C = class {
|
|
|
760
760
|
let n = r.length, s = !1;
|
|
761
761
|
for (; n--; ) {
|
|
762
762
|
const o = r[n];
|
|
763
|
-
(!t ||
|
|
763
|
+
(!t || me(this, this[o], o, t, !0)) && (delete this[o], s = !0);
|
|
764
764
|
}
|
|
765
765
|
return s;
|
|
766
766
|
}
|
|
@@ -769,11 +769,11 @@ let C = class {
|
|
|
769
769
|
return c.forEach(this, (s, o) => {
|
|
770
770
|
const i = c.findKey(n, o);
|
|
771
771
|
if (i) {
|
|
772
|
-
r[i] =
|
|
772
|
+
r[i] = se(s), delete r[o];
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
775
|
const a = t ? Dr(o) : String(o).trim();
|
|
776
|
-
a !== o && delete r[o], r[a] =
|
|
776
|
+
a !== o && delete r[o], r[a] = se(s), n[a] = !0;
|
|
777
777
|
}), this;
|
|
778
778
|
}
|
|
779
779
|
concat(...t) {
|
|
@@ -806,18 +806,18 @@ let C = class {
|
|
|
806
806
|
return r.forEach((s) => n.set(s)), n;
|
|
807
807
|
}
|
|
808
808
|
static accessor(t) {
|
|
809
|
-
const n = (this[
|
|
809
|
+
const n = (this[Le] = this[Le] = {
|
|
810
810
|
accessors: {}
|
|
811
811
|
}).accessors, s = this.prototype;
|
|
812
812
|
function o(i) {
|
|
813
|
-
const a =
|
|
813
|
+
const a = K(i);
|
|
814
814
|
n[a] || (Fr(s, i), n[a] = !0);
|
|
815
815
|
}
|
|
816
816
|
return c.isArray(t) ? t.forEach(o) : o(t), this;
|
|
817
817
|
}
|
|
818
818
|
};
|
|
819
|
-
|
|
820
|
-
c.reduceDescriptors(
|
|
819
|
+
k.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
820
|
+
c.reduceDescriptors(k.prototype, ({ value: e }, t) => {
|
|
821
821
|
let r = t[0].toUpperCase() + t.slice(1);
|
|
822
822
|
return {
|
|
823
823
|
get: () => e,
|
|
@@ -826,9 +826,9 @@ c.reduceDescriptors(C.prototype, ({ value: e }, t) => {
|
|
|
826
826
|
}
|
|
827
827
|
};
|
|
828
828
|
});
|
|
829
|
-
c.freezeMethods(
|
|
830
|
-
function
|
|
831
|
-
const r = this ||
|
|
829
|
+
c.freezeMethods(k);
|
|
830
|
+
function he(e, t) {
|
|
831
|
+
const r = this || Y, n = t || r, s = k.from(n.headers);
|
|
832
832
|
let o = n.data;
|
|
833
833
|
return c.forEach(e, function(a) {
|
|
834
834
|
o = a.call(r, o, s.normalize(), t ? t.status : void 0);
|
|
@@ -837,7 +837,7 @@ function me(e, t) {
|
|
|
837
837
|
function dt(e) {
|
|
838
838
|
return !!(e && e.__CANCEL__);
|
|
839
839
|
}
|
|
840
|
-
let
|
|
840
|
+
let Q = class extends g {
|
|
841
841
|
/**
|
|
842
842
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
843
843
|
*
|
|
@@ -861,11 +861,11 @@ function ft(e, t, r) {
|
|
|
861
861
|
r
|
|
862
862
|
));
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function vr(e) {
|
|
865
865
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
866
866
|
return t && t[1] || "";
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function Lr(e, t) {
|
|
869
869
|
e = e || 10;
|
|
870
870
|
const r = new Array(e), n = new Array(e);
|
|
871
871
|
let s = 0, o = 0, i;
|
|
@@ -877,8 +877,8 @@ function vr(e, t) {
|
|
|
877
877
|
y += r[p++], p = p % e;
|
|
878
878
|
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
879
879
|
return;
|
|
880
|
-
const
|
|
881
|
-
return
|
|
880
|
+
const T = l && u - l;
|
|
881
|
+
return T ? Math.round(y * 1e3 / T) : void 0;
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
function Br(e, t) {
|
|
@@ -893,9 +893,9 @@ function Br(e, t) {
|
|
|
893
893
|
}, n - p)));
|
|
894
894
|
}, () => s && i(s)];
|
|
895
895
|
}
|
|
896
|
-
const
|
|
896
|
+
const ie = (e, t, r = 3) => {
|
|
897
897
|
let n = 0;
|
|
898
|
-
const s =
|
|
898
|
+
const s = Lr(50, 250);
|
|
899
899
|
return Br((o) => {
|
|
900
900
|
const i = o.loaded, a = o.lengthComputable ? o.total : void 0, f = i - n, u = s(f), l = i <= a;
|
|
901
901
|
n = i;
|
|
@@ -919,10 +919,10 @@ const oe = (e, t, r = 3) => {
|
|
|
919
919
|
total: e,
|
|
920
920
|
loaded: n
|
|
921
921
|
}), t[1]];
|
|
922
|
-
}, Ie = (e) => (...t) => c.asap(() => e(...t)), Ir =
|
|
923
|
-
new URL(
|
|
924
|
-
|
|
925
|
-
) : () => !0, jr =
|
|
922
|
+
}, Ie = (e) => (...t) => c.asap(() => e(...t)), Ir = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, C.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
|
|
923
|
+
new URL(C.origin),
|
|
924
|
+
C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
|
|
925
|
+
) : () => !0, jr = C.hasStandardBrowserEnv ? (
|
|
926
926
|
// Standard browser envs support document.cookie
|
|
927
927
|
{
|
|
928
928
|
write(e, t, r, n, s, o, i) {
|
|
@@ -961,8 +961,8 @@ function pt(e, t, r) {
|
|
|
961
961
|
let n = !Mr(t);
|
|
962
962
|
return e && (n || r == !1) ? $r(e, t) : t;
|
|
963
963
|
}
|
|
964
|
-
const je = (e) => e instanceof
|
|
965
|
-
function
|
|
964
|
+
const je = (e) => e instanceof k ? { ...e } : e;
|
|
965
|
+
function $(e, t) {
|
|
966
966
|
t = t || {};
|
|
967
967
|
const r = {};
|
|
968
968
|
function n(u, l, p, y) {
|
|
@@ -1027,13 +1027,13 @@ function j(e, t) {
|
|
|
1027
1027
|
}), r;
|
|
1028
1028
|
}
|
|
1029
1029
|
const mt = (e) => {
|
|
1030
|
-
const t =
|
|
1030
|
+
const t = $({}, e);
|
|
1031
1031
|
let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = t;
|
|
1032
|
-
if (t.headers = i =
|
|
1032
|
+
if (t.headers = i = k.from(i), t.url = ct(pt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
|
|
1033
1033
|
"Authorization",
|
|
1034
1034
|
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
|
|
1035
1035
|
), c.isFormData(r)) {
|
|
1036
|
-
if (
|
|
1036
|
+
if (C.hasStandardBrowserEnv || C.hasStandardBrowserWebWorkerEnv)
|
|
1037
1037
|
i.setContentType(void 0);
|
|
1038
1038
|
else if (c.isFunction(r.getHeaders)) {
|
|
1039
1039
|
const f = r.getHeaders(), u = ["content-type", "content-length"];
|
|
@@ -1042,7 +1042,7 @@ const mt = (e) => {
|
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
if (
|
|
1045
|
+
if (C.hasStandardBrowserEnv && (n && c.isFunction(n) && (n = n(t)), n || n !== !1 && Ir(t.url))) {
|
|
1046
1046
|
const f = s && o && jr.read(o);
|
|
1047
1047
|
f && i.set(s, f);
|
|
1048
1048
|
}
|
|
@@ -1051,19 +1051,19 @@ const mt = (e) => {
|
|
|
1051
1051
|
return new Promise(function(r, n) {
|
|
1052
1052
|
const s = mt(e);
|
|
1053
1053
|
let o = s.data;
|
|
1054
|
-
const i =
|
|
1055
|
-
let { responseType: a, onUploadProgress: f, onDownloadProgress: u } = s, l, p, y,
|
|
1054
|
+
const i = k.from(s.headers).normalize();
|
|
1055
|
+
let { responseType: a, onUploadProgress: f, onDownloadProgress: u } = s, l, p, y, T, d;
|
|
1056
1056
|
function h() {
|
|
1057
|
-
|
|
1057
|
+
T && T(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1058
1058
|
}
|
|
1059
1059
|
let m = new XMLHttpRequest();
|
|
1060
1060
|
m.open(s.method.toUpperCase(), s.url, !0), m.timeout = s.timeout;
|
|
1061
1061
|
function E() {
|
|
1062
1062
|
if (!m)
|
|
1063
1063
|
return;
|
|
1064
|
-
const x =
|
|
1064
|
+
const x = k.from(
|
|
1065
1065
|
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1066
|
-
),
|
|
1066
|
+
), b = {
|
|
1067
1067
|
data: !a || a === "text" || a === "json" ? m.responseText : m.response,
|
|
1068
1068
|
status: m.status,
|
|
1069
1069
|
statusText: m.statusText,
|
|
@@ -1071,36 +1071,36 @@ const mt = (e) => {
|
|
|
1071
1071
|
config: e,
|
|
1072
1072
|
request: m
|
|
1073
1073
|
};
|
|
1074
|
-
ft(function(
|
|
1075
|
-
r(
|
|
1076
|
-
}, function(
|
|
1077
|
-
n(
|
|
1078
|
-
},
|
|
1074
|
+
ft(function(A) {
|
|
1075
|
+
r(A), h();
|
|
1076
|
+
}, function(A) {
|
|
1077
|
+
n(A), h();
|
|
1078
|
+
}, b), m = null;
|
|
1079
1079
|
}
|
|
1080
1080
|
"onloadend" in m ? m.onloadend = E : m.onreadystatechange = function() {
|
|
1081
1081
|
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(E);
|
|
1082
1082
|
}, m.onabort = function() {
|
|
1083
1083
|
m && (n(new g("Request aborted", g.ECONNABORTED, e, m)), m = null);
|
|
1084
|
-
}, m.onerror = function(
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1084
|
+
}, m.onerror = function(S) {
|
|
1085
|
+
const b = S && S.message ? S.message : "Network Error", _ = new g(b, g.ERR_NETWORK, e, m);
|
|
1086
|
+
_.event = S || null, n(_), m = null;
|
|
1087
1087
|
}, m.ontimeout = function() {
|
|
1088
|
-
let
|
|
1089
|
-
const
|
|
1090
|
-
s.timeoutErrorMessage && (
|
|
1091
|
-
|
|
1092
|
-
|
|
1088
|
+
let S = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1089
|
+
const b = s.transitional || lt;
|
|
1090
|
+
s.timeoutErrorMessage && (S = s.timeoutErrorMessage), n(new g(
|
|
1091
|
+
S,
|
|
1092
|
+
b.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
|
|
1093
1093
|
e,
|
|
1094
1094
|
m
|
|
1095
1095
|
)), m = null;
|
|
1096
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(
|
|
1097
|
-
m.setRequestHeader(
|
|
1098
|
-
}), c.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), a && a !== "json" && (m.responseType = s.responseType), u && ([y, d] =
|
|
1099
|
-
m && (n(!x || x.type ? new
|
|
1096
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(S, b) {
|
|
1097
|
+
m.setRequestHeader(b, S);
|
|
1098
|
+
}), c.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), a && a !== "json" && (m.responseType = s.responseType), u && ([y, d] = ie(u, !0), m.addEventListener("progress", y)), f && m.upload && ([p, T] = ie(f), m.upload.addEventListener("progress", p), m.upload.addEventListener("loadend", T)), (s.cancelToken || s.signal) && (l = (x) => {
|
|
1099
|
+
m && (n(!x || x.type ? new Q(null, e, m) : x), m.abort(), m = null);
|
|
1100
1100
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1101
|
-
const
|
|
1102
|
-
if (
|
|
1103
|
-
n(new g("Unsupported protocol " +
|
|
1101
|
+
const R = vr(s.url);
|
|
1102
|
+
if (R && C.protocols.indexOf(R) === -1) {
|
|
1103
|
+
n(new g("Unsupported protocol " + R + ":", g.ERR_BAD_REQUEST, e));
|
|
1104
1104
|
return;
|
|
1105
1105
|
}
|
|
1106
1106
|
m.send(o || null);
|
|
@@ -1113,7 +1113,7 @@ const mt = (e) => {
|
|
|
1113
1113
|
if (!s) {
|
|
1114
1114
|
s = !0, a();
|
|
1115
1115
|
const l = u instanceof Error ? u : this.reason;
|
|
1116
|
-
n.abort(l instanceof g ? l : new
|
|
1116
|
+
n.abort(l instanceof g ? l : new Q(l instanceof Error ? l.message : l));
|
|
1117
1117
|
}
|
|
1118
1118
|
};
|
|
1119
1119
|
let i = t && setTimeout(() => {
|
|
@@ -1185,7 +1185,7 @@ const mt = (e) => {
|
|
|
1185
1185
|
}, {
|
|
1186
1186
|
highWaterMark: 2
|
|
1187
1187
|
});
|
|
1188
|
-
}, $e = 64 * 1024, { isFunction:
|
|
1188
|
+
}, $e = 64 * 1024, { isFunction: re } = c, Wr = (({ Request: e, Response: t }) => ({
|
|
1189
1189
|
Request: e,
|
|
1190
1190
|
Response: t
|
|
1191
1191
|
}))(c.global), {
|
|
@@ -1201,12 +1201,12 @@ const mt = (e) => {
|
|
|
1201
1201
|
e = c.merge.call({
|
|
1202
1202
|
skipUndefined: !0
|
|
1203
1203
|
}, Wr, e);
|
|
1204
|
-
const { fetch: t, Request: r, Response: n } = e, s = t ?
|
|
1204
|
+
const { fetch: t, Request: r, Response: n } = e, s = t ? re(t) : typeof fetch == "function", o = re(r), i = re(n);
|
|
1205
1205
|
if (!s)
|
|
1206
1206
|
return !1;
|
|
1207
|
-
const a = s &&
|
|
1207
|
+
const a = s && re(He), f = s && (typeof qe == "function" ? /* @__PURE__ */ ((d) => (h) => d.encode(h))(new qe()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), u = o && a && ze(() => {
|
|
1208
1208
|
let d = !1;
|
|
1209
|
-
const h = new r(
|
|
1209
|
+
const h = new r(C.origin, {
|
|
1210
1210
|
body: new He(),
|
|
1211
1211
|
method: "POST",
|
|
1212
1212
|
get duplex() {
|
|
@@ -1231,7 +1231,7 @@ const mt = (e) => {
|
|
|
1231
1231
|
if (c.isBlob(d))
|
|
1232
1232
|
return d.size;
|
|
1233
1233
|
if (c.isSpecCompliantForm(d))
|
|
1234
|
-
return (await new r(
|
|
1234
|
+
return (await new r(C.origin, {
|
|
1235
1235
|
method: "POST",
|
|
1236
1236
|
body: d
|
|
1237
1237
|
}).arrayBuffer()).byteLength;
|
|
@@ -1239,7 +1239,7 @@ const mt = (e) => {
|
|
|
1239
1239
|
return d.byteLength;
|
|
1240
1240
|
if (c.isURLSearchParams(d) && (d = d + ""), c.isString(d))
|
|
1241
1241
|
return (await f(d)).byteLength;
|
|
1242
|
-
},
|
|
1242
|
+
}, T = async (d, h) => {
|
|
1243
1243
|
const m = c.toFiniteNumber(d.getContentLength());
|
|
1244
1244
|
return m ?? y(h);
|
|
1245
1245
|
};
|
|
@@ -1248,85 +1248,85 @@ const mt = (e) => {
|
|
|
1248
1248
|
url: h,
|
|
1249
1249
|
method: m,
|
|
1250
1250
|
data: E,
|
|
1251
|
-
signal:
|
|
1251
|
+
signal: R,
|
|
1252
1252
|
cancelToken: x,
|
|
1253
|
-
timeout:
|
|
1254
|
-
onDownloadProgress:
|
|
1255
|
-
onUploadProgress:
|
|
1256
|
-
responseType:
|
|
1257
|
-
headers:
|
|
1258
|
-
withCredentials:
|
|
1259
|
-
fetchOptions:
|
|
1253
|
+
timeout: S,
|
|
1254
|
+
onDownloadProgress: b,
|
|
1255
|
+
onUploadProgress: _,
|
|
1256
|
+
responseType: A,
|
|
1257
|
+
headers: F,
|
|
1258
|
+
withCredentials: v = "same-origin",
|
|
1259
|
+
fetchOptions: fe
|
|
1260
1260
|
} = mt(d), Te = t || fetch;
|
|
1261
|
-
|
|
1262
|
-
let
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1261
|
+
A = A ? (A + "").toLowerCase() : "text";
|
|
1262
|
+
let Z = zr([R, x && x.toAbortSignal()], S), J = null;
|
|
1263
|
+
const I = Z && Z.unsubscribe && (() => {
|
|
1264
|
+
Z.unsubscribe();
|
|
1265
1265
|
});
|
|
1266
1266
|
let Ae;
|
|
1267
1267
|
try {
|
|
1268
|
-
if (
|
|
1269
|
-
let
|
|
1268
|
+
if (_ && u && m !== "get" && m !== "head" && (Ae = await T(F, E)) !== 0) {
|
|
1269
|
+
let B = new r(h, {
|
|
1270
1270
|
method: "POST",
|
|
1271
1271
|
body: E,
|
|
1272
1272
|
duplex: "half"
|
|
1273
|
-
}),
|
|
1274
|
-
if (c.isFormData(E) && (
|
|
1275
|
-
const [
|
|
1273
|
+
}), H;
|
|
1274
|
+
if (c.isFormData(E) && (H = B.headers.get("content-type")) && F.setContentType(H), B.body) {
|
|
1275
|
+
const [pe, ee] = Be(
|
|
1276
1276
|
Ae,
|
|
1277
|
-
|
|
1277
|
+
ie(Ie(_))
|
|
1278
1278
|
);
|
|
1279
|
-
E = Me(
|
|
1279
|
+
E = Me(B.body, $e, pe, ee);
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
|
-
c.isString(
|
|
1283
|
-
const
|
|
1284
|
-
...
|
|
1285
|
-
signal:
|
|
1282
|
+
c.isString(v) || (v = v ? "include" : "omit");
|
|
1283
|
+
const U = o && "credentials" in r.prototype, Ce = {
|
|
1284
|
+
...fe,
|
|
1285
|
+
signal: Z,
|
|
1286
1286
|
method: m.toUpperCase(),
|
|
1287
|
-
headers:
|
|
1287
|
+
headers: F.normalize().toJSON(),
|
|
1288
1288
|
body: E,
|
|
1289
1289
|
duplex: "half",
|
|
1290
|
-
credentials:
|
|
1290
|
+
credentials: U ? v : void 0
|
|
1291
1291
|
};
|
|
1292
|
-
|
|
1293
|
-
let
|
|
1294
|
-
const Ne = l && (
|
|
1295
|
-
if (l && (
|
|
1296
|
-
const
|
|
1292
|
+
J = o && new r(h, Ce);
|
|
1293
|
+
let L = await (o ? Te(J, fe) : Te(h, Ce));
|
|
1294
|
+
const Ne = l && (A === "stream" || A === "response");
|
|
1295
|
+
if (l && (b || Ne && I)) {
|
|
1296
|
+
const B = {};
|
|
1297
1297
|
["status", "statusText", "headers"].forEach((ke) => {
|
|
1298
|
-
|
|
1298
|
+
B[ke] = L[ke];
|
|
1299
1299
|
});
|
|
1300
|
-
const
|
|
1301
|
-
|
|
1302
|
-
|
|
1300
|
+
const H = c.toFiniteNumber(L.headers.get("content-length")), [pe, ee] = b && Be(
|
|
1301
|
+
H,
|
|
1302
|
+
ie(Ie(b), !0)
|
|
1303
1303
|
) || [];
|
|
1304
|
-
|
|
1305
|
-
Me(
|
|
1306
|
-
|
|
1304
|
+
L = new n(
|
|
1305
|
+
Me(L.body, $e, pe, () => {
|
|
1306
|
+
ee && ee(), I && I();
|
|
1307
1307
|
}),
|
|
1308
|
-
|
|
1308
|
+
B
|
|
1309
1309
|
);
|
|
1310
1310
|
}
|
|
1311
|
-
|
|
1312
|
-
let xt = await p[c.findKey(p,
|
|
1313
|
-
return !Ne &&
|
|
1314
|
-
ft(
|
|
1311
|
+
A = A || "text";
|
|
1312
|
+
let xt = await p[c.findKey(p, A) || "text"](L, d);
|
|
1313
|
+
return !Ne && I && I(), await new Promise((B, H) => {
|
|
1314
|
+
ft(B, H, {
|
|
1315
1315
|
data: xt,
|
|
1316
|
-
headers:
|
|
1317
|
-
status:
|
|
1318
|
-
statusText:
|
|
1316
|
+
headers: k.from(L.headers),
|
|
1317
|
+
status: L.status,
|
|
1318
|
+
statusText: L.statusText,
|
|
1319
1319
|
config: d,
|
|
1320
|
-
request:
|
|
1320
|
+
request: J
|
|
1321
1321
|
});
|
|
1322
1322
|
});
|
|
1323
|
-
} catch (
|
|
1324
|
-
throw
|
|
1325
|
-
new g("Network Error", g.ERR_NETWORK, d,
|
|
1323
|
+
} catch (U) {
|
|
1324
|
+
throw I && I(), U && U.name === "TypeError" && /Load failed|fetch/i.test(U.message) ? Object.assign(
|
|
1325
|
+
new g("Network Error", g.ERR_NETWORK, d, J),
|
|
1326
1326
|
{
|
|
1327
|
-
cause:
|
|
1327
|
+
cause: U.cause || U
|
|
1328
1328
|
}
|
|
1329
|
-
) : g.from(
|
|
1329
|
+
) : g.from(U, U && U.code, d, J);
|
|
1330
1330
|
}
|
|
1331
1331
|
};
|
|
1332
1332
|
}, Gr = /* @__PURE__ */ new Map(), ht = (e) => {
|
|
@@ -1342,14 +1342,14 @@ const mt = (e) => {
|
|
|
1342
1342
|
return u;
|
|
1343
1343
|
};
|
|
1344
1344
|
ht();
|
|
1345
|
-
const
|
|
1345
|
+
const Oe = {
|
|
1346
1346
|
http: pr,
|
|
1347
1347
|
xhr: qr,
|
|
1348
1348
|
fetch: {
|
|
1349
1349
|
get: ht
|
|
1350
1350
|
}
|
|
1351
1351
|
};
|
|
1352
|
-
c.forEach(
|
|
1352
|
+
c.forEach(Oe, (e, t) => {
|
|
1353
1353
|
if (e) {
|
|
1354
1354
|
try {
|
|
1355
1355
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1367,7 +1367,7 @@ function Qr(e, t) {
|
|
|
1367
1367
|
for (let i = 0; i < r; i++) {
|
|
1368
1368
|
n = e[i];
|
|
1369
1369
|
let a;
|
|
1370
|
-
if (s = n, !Yr(n) && (s =
|
|
1370
|
+
if (s = n, !Yr(n) && (s = Oe[(a = String(n)).toLowerCase()], s === void 0))
|
|
1371
1371
|
throw new g(`Unknown adapter '${a}'`);
|
|
1372
1372
|
if (s && (c.isFunction(s) || (s = s.get(t))))
|
|
1373
1373
|
break;
|
|
@@ -1397,38 +1397,38 @@ const gt = {
|
|
|
1397
1397
|
* Exposes all known adapters
|
|
1398
1398
|
* @type {Object<string, Function|Object>}
|
|
1399
1399
|
*/
|
|
1400
|
-
adapters:
|
|
1400
|
+
adapters: Oe
|
|
1401
1401
|
};
|
|
1402
|
-
function
|
|
1402
|
+
function ge(e) {
|
|
1403
1403
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1404
|
-
throw new
|
|
1404
|
+
throw new Q(null, e);
|
|
1405
1405
|
}
|
|
1406
1406
|
function Ke(e) {
|
|
1407
|
-
return
|
|
1407
|
+
return ge(e), e.headers = k.from(e.headers), e.data = he.call(
|
|
1408
1408
|
e,
|
|
1409
1409
|
e.transformRequest
|
|
1410
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter ||
|
|
1411
|
-
return
|
|
1410
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter || Y.adapter, e)(e).then(function(n) {
|
|
1411
|
+
return ge(e), n.data = he.call(
|
|
1412
1412
|
e,
|
|
1413
1413
|
e.transformResponse,
|
|
1414
1414
|
n
|
|
1415
|
-
), n.headers =
|
|
1415
|
+
), n.headers = k.from(n.headers), n;
|
|
1416
1416
|
}, function(n) {
|
|
1417
|
-
return dt(n) || (
|
|
1417
|
+
return dt(n) || (ge(e), n && n.response && (n.response.data = he.call(
|
|
1418
1418
|
e,
|
|
1419
1419
|
e.transformResponse,
|
|
1420
1420
|
n.response
|
|
1421
|
-
), n.response.headers =
|
|
1421
|
+
), n.response.headers = k.from(n.response.headers))), Promise.reject(n);
|
|
1422
1422
|
});
|
|
1423
1423
|
}
|
|
1424
|
-
const wt = "1.13.4",
|
|
1424
|
+
const wt = "1.13.4", de = {};
|
|
1425
1425
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1426
|
-
|
|
1426
|
+
de[e] = function(n) {
|
|
1427
1427
|
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1428
1428
|
};
|
|
1429
1429
|
});
|
|
1430
1430
|
const Ve = {};
|
|
1431
|
-
|
|
1431
|
+
de.transitional = function(t, r, n) {
|
|
1432
1432
|
function s(o, i) {
|
|
1433
1433
|
return "[Axios v" + wt + "] Transitional option '" + o + "'" + i + (n ? ". " + n : "");
|
|
1434
1434
|
}
|
|
@@ -1446,7 +1446,7 @@ ue.transitional = function(t, r, n) {
|
|
|
1446
1446
|
)), t ? t(o, i, a) : !0;
|
|
1447
1447
|
};
|
|
1448
1448
|
};
|
|
1449
|
-
|
|
1449
|
+
de.spelling = function(t) {
|
|
1450
1450
|
return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
|
|
1451
1451
|
};
|
|
1452
1452
|
function Zr(e, t, r) {
|
|
@@ -1466,15 +1466,15 @@ function Zr(e, t, r) {
|
|
|
1466
1466
|
throw new g("Unknown option " + o, g.ERR_BAD_OPTION);
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
|
-
const
|
|
1469
|
+
const oe = {
|
|
1470
1470
|
assertOptions: Zr,
|
|
1471
|
-
validators:
|
|
1472
|
-
},
|
|
1473
|
-
let
|
|
1471
|
+
validators: de
|
|
1472
|
+
}, D = oe.validators;
|
|
1473
|
+
let M = class {
|
|
1474
1474
|
constructor(t) {
|
|
1475
1475
|
this.defaults = t || {}, this.interceptors = {
|
|
1476
|
-
request: new
|
|
1477
|
-
response: new
|
|
1476
|
+
request: new ve(),
|
|
1477
|
+
response: new ve()
|
|
1478
1478
|
};
|
|
1479
1479
|
}
|
|
1480
1480
|
/**
|
|
@@ -1503,20 +1503,20 @@ let I = class {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
_request(t, r) {
|
|
1506
|
-
typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r =
|
|
1506
|
+
typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = $(this.defaults, r);
|
|
1507
1507
|
const { transitional: n, paramsSerializer: s, headers: o } = r;
|
|
1508
|
-
n !== void 0 &&
|
|
1509
|
-
silentJSONParsing:
|
|
1510
|
-
forcedJSONParsing:
|
|
1511
|
-
clarifyTimeoutError:
|
|
1508
|
+
n !== void 0 && oe.assertOptions(n, {
|
|
1509
|
+
silentJSONParsing: D.transitional(D.boolean),
|
|
1510
|
+
forcedJSONParsing: D.transitional(D.boolean),
|
|
1511
|
+
clarifyTimeoutError: D.transitional(D.boolean)
|
|
1512
1512
|
}, !1), s != null && (c.isFunction(s) ? r.paramsSerializer = {
|
|
1513
1513
|
serialize: s
|
|
1514
|
-
} :
|
|
1515
|
-
encode:
|
|
1516
|
-
serialize:
|
|
1517
|
-
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0),
|
|
1518
|
-
baseUrl:
|
|
1519
|
-
withXsrfToken:
|
|
1514
|
+
} : oe.assertOptions(s, {
|
|
1515
|
+
encode: D.function,
|
|
1516
|
+
serialize: D.function
|
|
1517
|
+
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), oe.assertOptions(r, {
|
|
1518
|
+
baseUrl: D.spelling("baseURL"),
|
|
1519
|
+
withXsrfToken: D.spelling("withXSRFToken")
|
|
1520
1520
|
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
1521
1521
|
let i = o && c.merge(
|
|
1522
1522
|
o.common,
|
|
@@ -1527,7 +1527,7 @@ let I = class {
|
|
|
1527
1527
|
(d) => {
|
|
1528
1528
|
delete o[d];
|
|
1529
1529
|
}
|
|
1530
|
-
), r.headers =
|
|
1530
|
+
), r.headers = k.concat(i, o);
|
|
1531
1531
|
const a = [];
|
|
1532
1532
|
let f = !0;
|
|
1533
1533
|
this.interceptors.request.forEach(function(h) {
|
|
@@ -1545,18 +1545,18 @@ let I = class {
|
|
|
1545
1545
|
return l;
|
|
1546
1546
|
}
|
|
1547
1547
|
y = a.length;
|
|
1548
|
-
let
|
|
1548
|
+
let T = r;
|
|
1549
1549
|
for (; p < y; ) {
|
|
1550
1550
|
const d = a[p++], h = a[p++];
|
|
1551
1551
|
try {
|
|
1552
|
-
|
|
1552
|
+
T = d(T);
|
|
1553
1553
|
} catch (m) {
|
|
1554
1554
|
h.call(this, m);
|
|
1555
1555
|
break;
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
1558
|
try {
|
|
1559
|
-
l = Ke.call(this,
|
|
1559
|
+
l = Ke.call(this, T);
|
|
1560
1560
|
} catch (d) {
|
|
1561
1561
|
return Promise.reject(d);
|
|
1562
1562
|
}
|
|
@@ -1565,14 +1565,14 @@ let I = class {
|
|
|
1565
1565
|
return l;
|
|
1566
1566
|
}
|
|
1567
1567
|
getUri(t) {
|
|
1568
|
-
t =
|
|
1568
|
+
t = $(this.defaults, t);
|
|
1569
1569
|
const r = pt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1570
1570
|
return ct(r, t.params, t.paramsSerializer);
|
|
1571
1571
|
}
|
|
1572
1572
|
};
|
|
1573
1573
|
c.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1574
|
-
|
|
1575
|
-
return this.request(
|
|
1574
|
+
M.prototype[t] = function(r, n) {
|
|
1575
|
+
return this.request($(n || {}, {
|
|
1576
1576
|
method: t,
|
|
1577
1577
|
url: r,
|
|
1578
1578
|
data: (n || {}).data
|
|
@@ -1582,7 +1582,7 @@ c.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1582
1582
|
c.forEach(["post", "put", "patch"], function(t) {
|
|
1583
1583
|
function r(n) {
|
|
1584
1584
|
return function(o, i, a) {
|
|
1585
|
-
return this.request(
|
|
1585
|
+
return this.request($(a || {}, {
|
|
1586
1586
|
method: t,
|
|
1587
1587
|
headers: n ? {
|
|
1588
1588
|
"Content-Type": "multipart/form-data"
|
|
@@ -1592,7 +1592,7 @@ c.forEach(["post", "put", "patch"], function(t) {
|
|
|
1592
1592
|
}));
|
|
1593
1593
|
};
|
|
1594
1594
|
}
|
|
1595
|
-
|
|
1595
|
+
M.prototype[t] = r(), M.prototype[t + "Form"] = r(!0);
|
|
1596
1596
|
});
|
|
1597
1597
|
let en = class bt {
|
|
1598
1598
|
constructor(t) {
|
|
@@ -1618,7 +1618,7 @@ let en = class bt {
|
|
|
1618
1618
|
n.unsubscribe(o);
|
|
1619
1619
|
}, i;
|
|
1620
1620
|
}, t(function(o, i, a) {
|
|
1621
|
-
n.reason || (n.reason = new
|
|
1621
|
+
n.reason || (n.reason = new Q(o, i, a), r(n.reason));
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
1624
|
/**
|
|
@@ -1675,7 +1675,7 @@ function tn(e) {
|
|
|
1675
1675
|
function rn(e) {
|
|
1676
1676
|
return c.isObject(e) && e.isAxiosError === !0;
|
|
1677
1677
|
}
|
|
1678
|
-
const
|
|
1678
|
+
const xe = {
|
|
1679
1679
|
Continue: 100,
|
|
1680
1680
|
SwitchingProtocols: 101,
|
|
1681
1681
|
Processing: 102,
|
|
@@ -1746,35 +1746,35 @@ const ye = {
|
|
|
1746
1746
|
SslHandshakeFailed: 525,
|
|
1747
1747
|
InvalidSslCertificate: 526
|
|
1748
1748
|
};
|
|
1749
|
-
Object.entries(
|
|
1750
|
-
|
|
1749
|
+
Object.entries(xe).forEach(([e, t]) => {
|
|
1750
|
+
xe[t] = e;
|
|
1751
1751
|
});
|
|
1752
1752
|
function yt(e) {
|
|
1753
|
-
const t = new
|
|
1754
|
-
return c.extend(r,
|
|
1755
|
-
return yt(
|
|
1753
|
+
const t = new M(e), r = Ye(M.prototype.request, t);
|
|
1754
|
+
return c.extend(r, M.prototype, t, { allOwnKeys: !0 }), c.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(s) {
|
|
1755
|
+
return yt($(e, s));
|
|
1756
1756
|
}, r;
|
|
1757
1757
|
}
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1758
|
+
const O = yt(Y);
|
|
1759
|
+
O.Axios = M;
|
|
1760
|
+
O.CanceledError = Q;
|
|
1761
|
+
O.CancelToken = en;
|
|
1762
|
+
O.isCancel = dt;
|
|
1763
|
+
O.VERSION = wt;
|
|
1764
|
+
O.toFormData = ue;
|
|
1765
|
+
O.AxiosError = g;
|
|
1766
|
+
O.Cancel = O.CanceledError;
|
|
1767
|
+
O.all = function(t) {
|
|
1768
1768
|
return Promise.all(t);
|
|
1769
1769
|
};
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1770
|
+
O.spread = tn;
|
|
1771
|
+
O.isAxiosError = rn;
|
|
1772
|
+
O.mergeConfig = $;
|
|
1773
|
+
O.AxiosHeaders = k;
|
|
1774
|
+
O.formToJSON = (e) => ut(c.isHTMLForm(e) ? new FormData(e) : e);
|
|
1775
|
+
O.getAdapter = gt.getAdapter;
|
|
1776
|
+
O.HttpStatusCode = xe;
|
|
1777
|
+
O.default = O;
|
|
1778
1778
|
const {
|
|
1779
1779
|
Axios: yn,
|
|
1780
1780
|
AxiosError: xn,
|
|
@@ -1792,11 +1792,11 @@ const {
|
|
|
1792
1792
|
formToJSON: Un,
|
|
1793
1793
|
getAdapter: Dn,
|
|
1794
1794
|
mergeConfig: Fn
|
|
1795
|
-
} =
|
|
1795
|
+
} = O, nn = "https://customers-services.tarxemo.com/api";
|
|
1796
1796
|
class sn {
|
|
1797
1797
|
constructor(t, r = nn) {
|
|
1798
1798
|
Pe(this, "client");
|
|
1799
|
-
this.client =
|
|
1799
|
+
this.client = O.create({
|
|
1800
1800
|
baseURL: r,
|
|
1801
1801
|
headers: {
|
|
1802
1802
|
"Content-Type": "application/json",
|
|
@@ -1860,7 +1860,7 @@ class sn {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
1862
|
function We(e, t) {
|
|
1863
|
-
const [r, n] =
|
|
1863
|
+
const [r, n] = V(() => {
|
|
1864
1864
|
try {
|
|
1865
1865
|
const s = window.localStorage.getItem(e);
|
|
1866
1866
|
return s ? JSON.parse(s) : t;
|
|
@@ -1868,7 +1868,7 @@ function We(e, t) {
|
|
|
1868
1868
|
return console.warn(`Error reading localStorage key "${e}":`, s), t;
|
|
1869
1869
|
}
|
|
1870
1870
|
});
|
|
1871
|
-
return
|
|
1871
|
+
return Ee(() => {
|
|
1872
1872
|
try {
|
|
1873
1873
|
window.localStorage.setItem(e, JSON.stringify(r));
|
|
1874
1874
|
} catch (s) {
|
|
@@ -1884,13 +1884,13 @@ function cn(e) {
|
|
|
1884
1884
|
const { apiKey: t, baseUrl: r, onError: n } = e, [s, o] = We(an, []), [i, a] = We(
|
|
1885
1885
|
on,
|
|
1886
1886
|
Xe()
|
|
1887
|
-
), [f, u] =
|
|
1888
|
-
|
|
1887
|
+
), [f, u] = V(!1), [l, p] = V(null), y = Ge(null);
|
|
1888
|
+
Ee(() => {
|
|
1889
1889
|
y.current = new sn(t, r);
|
|
1890
1890
|
}, [t, r]);
|
|
1891
|
-
const
|
|
1891
|
+
const T = te(() => {
|
|
1892
1892
|
p(null);
|
|
1893
|
-
}, []), d =
|
|
1893
|
+
}, []), d = te(
|
|
1894
1894
|
async (E) => {
|
|
1895
1895
|
if (!y.current) {
|
|
1896
1896
|
const x = new Error("API client not initialized");
|
|
@@ -1899,56 +1899,56 @@ function cn(e) {
|
|
|
1899
1899
|
}
|
|
1900
1900
|
if (!E.trim())
|
|
1901
1901
|
return;
|
|
1902
|
-
const
|
|
1902
|
+
const R = {
|
|
1903
1903
|
id: `user_${Date.now()}`,
|
|
1904
1904
|
role: "USER",
|
|
1905
1905
|
content: E,
|
|
1906
1906
|
timestamp: /* @__PURE__ */ new Date()
|
|
1907
1907
|
};
|
|
1908
|
-
o((x) => [...x,
|
|
1908
|
+
o((x) => [...x, R]), u(!0), p(null);
|
|
1909
1909
|
try {
|
|
1910
|
-
const x = await y.current.sendMessage(E, i),
|
|
1910
|
+
const x = await y.current.sendMessage(E, i), S = {
|
|
1911
1911
|
id: `assistant_${Date.now()}`,
|
|
1912
1912
|
role: "ASSISTANT",
|
|
1913
1913
|
content: x.answer,
|
|
1914
1914
|
timestamp: /* @__PURE__ */ new Date(),
|
|
1915
1915
|
sources: x.sources
|
|
1916
1916
|
};
|
|
1917
|
-
o((
|
|
1917
|
+
o((b) => [...b, S]), x.session_id !== i && a(x.session_id);
|
|
1918
1918
|
} catch (x) {
|
|
1919
|
-
const
|
|
1920
|
-
p(
|
|
1921
|
-
const
|
|
1919
|
+
const S = x instanceof Error ? x : new Error("Failed to send message");
|
|
1920
|
+
p(S), n == null || n(S);
|
|
1921
|
+
const b = {
|
|
1922
1922
|
id: `error_${Date.now()}`,
|
|
1923
1923
|
role: "ASSISTANT",
|
|
1924
|
-
content: `Sorry, I encountered an error: ${
|
|
1924
|
+
content: `Sorry, I encountered an error: ${S.message}`,
|
|
1925
1925
|
timestamp: /* @__PURE__ */ new Date()
|
|
1926
1926
|
};
|
|
1927
|
-
o((
|
|
1927
|
+
o((_) => [..._, b]);
|
|
1928
1928
|
} finally {
|
|
1929
1929
|
u(!1);
|
|
1930
1930
|
}
|
|
1931
1931
|
},
|
|
1932
1932
|
[i, n, o, a]
|
|
1933
|
-
), h =
|
|
1933
|
+
), h = te(async () => {
|
|
1934
1934
|
if (!(!y.current || !i)) {
|
|
1935
1935
|
u(!0), p(null);
|
|
1936
1936
|
try {
|
|
1937
|
-
const
|
|
1938
|
-
id: `${x.role.toLowerCase()}_${
|
|
1937
|
+
const R = (await y.current.getConversationHistory(i)).messages.map((x, S) => ({
|
|
1938
|
+
id: `${x.role.toLowerCase()}_${S}_${Date.now()}`,
|
|
1939
1939
|
role: x.role.toUpperCase(),
|
|
1940
1940
|
content: x.content,
|
|
1941
1941
|
timestamp: new Date(x.created_at)
|
|
1942
1942
|
}));
|
|
1943
|
-
o(
|
|
1943
|
+
o(R);
|
|
1944
1944
|
} catch (E) {
|
|
1945
|
-
const
|
|
1946
|
-
p(
|
|
1945
|
+
const R = E instanceof Error ? E : new Error("Failed to load history");
|
|
1946
|
+
p(R), n == null || n(R);
|
|
1947
1947
|
} finally {
|
|
1948
1948
|
u(!1);
|
|
1949
1949
|
}
|
|
1950
1950
|
}
|
|
1951
|
-
}, [i, n, o]), m =
|
|
1951
|
+
}, [i, n, o]), m = te(() => {
|
|
1952
1952
|
o([]), a(Xe());
|
|
1953
1953
|
}, [o, a]);
|
|
1954
1954
|
return {
|
|
@@ -1956,7 +1956,7 @@ function cn(e) {
|
|
|
1956
1956
|
sendMessage: d,
|
|
1957
1957
|
isLoading: f,
|
|
1958
1958
|
error: l,
|
|
1959
|
-
clearError:
|
|
1959
|
+
clearError: T,
|
|
1960
1960
|
sessionId: i,
|
|
1961
1961
|
loadHistory: h,
|
|
1962
1962
|
clearHistory: m
|
|
@@ -1980,7 +1980,7 @@ const ln = ({ message: e }) => {
|
|
|
1980
1980
|
isLoading: t,
|
|
1981
1981
|
placeholder: r = "Type your message..."
|
|
1982
1982
|
}) => {
|
|
1983
|
-
const [n, s] =
|
|
1983
|
+
const [n, s] = V(""), o = (a) => {
|
|
1984
1984
|
a.preventDefault(), n.trim() && !t && (e(n), s(""));
|
|
1985
1985
|
}, i = (a) => {
|
|
1986
1986
|
a.key === "Enter" && !a.shiftKey && (a.preventDefault(), o(a));
|
|
@@ -2017,7 +2017,7 @@ const ln = ({ message: e }) => {
|
|
|
2017
2017
|
welcomeMessage: i = "Hi! How can I help you today?"
|
|
2018
2018
|
}) => {
|
|
2019
2019
|
const a = Ge(null);
|
|
2020
|
-
return
|
|
2020
|
+
return Ee(() => {
|
|
2021
2021
|
var f;
|
|
2022
2022
|
(f = a.current) == null || f.scrollIntoView({ behavior: "smooth" });
|
|
2023
2023
|
}, [e]), /* @__PURE__ */ w.createElement("div", { className: "cs-window" }, /* @__PURE__ */ w.createElement("div", { className: "cs-window__header" }, /* @__PURE__ */ w.createElement("div", { className: "cs-window__header-info" }, /* @__PURE__ */ w.createElement("h3", { className: "cs-window__title" }, "Customer Support"), /* @__PURE__ */ w.createElement("div", { className: "cs-window__status" }, /* @__PURE__ */ w.createElement("span", { className: "cs-window__status-dot" }), /* @__PURE__ */ w.createElement("span", null, "Online"))), /* @__PURE__ */ w.createElement(
|
|
@@ -2036,7 +2036,7 @@ const ln = ({ message: e }) => {
|
|
|
2036
2036
|
placeholder: o
|
|
2037
2037
|
}
|
|
2038
2038
|
)));
|
|
2039
|
-
}, fn = ':root{--cs-primary-color: inherit;--cs-secondary-color: inherit;--cs-bg-color: inherit;--cs-text-color: inherit;--cs-font-family: inherit;--cs-border-radius: 12px;--cs-button-color: var(--cs-primary-color);--cs-user-message-color: var(--cs-primary-color);--cs-assistant-message-color: rgba(0, 0, 0, .05);--cs-header-gradient: linear-gradient(135deg, var(--cs-primary-color), var(--cs-secondary-color));--cs-focus-ring: rgba(0, 0, 0, .1);--cs-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);--cs-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--cs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--cs-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}.cs-widget{position:fixed;z-index:9999;font-family:var(--cs-font-family)}.cs-widget,.cs-widget *{box-sizing:border-box}.cs-widget--bottom-right{bottom:20px;right:20px}.cs-widget--bottom-left{bottom:20px;left:20px}.cs-widget--top-right{top:20px;right:20px}.cs-widget--top-left{top:20px;left:20px}.cs-widget__toggle{position:relative;width:60px;height:60px;border-radius:50%;background:var(--cs-header-gradient);border:none;color:#fff;cursor:pointer;box-shadow:var(--cs-shadow-xl);transition:all .3s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:center}.cs-widget__toggle:hover{transform:scale(1.1);box-shadow:0 15px 25px -5px var(--cs-focus-ring)}.cs-widget__toggle:active{transform:scale(.95)}.cs-widget__toggle--open{background:#ef4444}.cs-widget__badge{position:absolute;top:-5px;right:-5px;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;box-shadow:var(--cs-shadow)}.cs-window{position:absolute;bottom:85px;right:0;width:380px;max-width:calc(100vw - 40px);height:600px;max-height:calc(100vh - 130px);background:var(--cs-bg-color);border-radius:var(--cs-border-radius);border:1px solid rgba(0,0,0,.1);box-shadow:var(--cs-shadow-xl);display:flex;flex-direction:column;overflow:visible;animation:slideUp .3s cubic-bezier(.4,0,.2,1);transform-origin:bottom right}.cs-window:after{content:"";position:absolute;bottom:-10px;right:25px;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid var(--cs-bg-color);filter:drop-shadow(0 5px 5px rgba(0,0,0,.1))}.cs-widget--bottom-left .cs-window{transform-origin:bottom left;right:auto;left:0}.cs-widget--bottom-left .cs-window:after{right:auto;left:25px}.cs-widget--top-right .cs-window{transform-origin:top right;bottom:auto;top:85px}.cs-widget--top-right .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color)}.cs-widget--top-left .cs-window{transform-origin:top left;bottom:auto;top:85px;right:auto;left:0}.cs-widget--top-left .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color);right:auto;left:25px}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.cs-window__header{background:var(--cs-header-gradient);color
|
|
2039
|
+
}, fn = ':root{--cs-primary-color: inherit;--cs-secondary-color: inherit;--cs-bg-color: inherit;--cs-text-color: inherit;--cs-font-family: inherit;--cs-border-radius: 12px;--cs-button-color: var(--cs-primary-color);--cs-user-message-color: var(--cs-primary-color);--cs-assistant-message-color: rgba(0, 0, 0, .05);--cs-header-gradient: linear-gradient(135deg, var(--cs-primary-color), var(--cs-secondary-color));--cs-header-text-color: #ffffff;--cs-bg-text-color: #1a1a1a;--cs-user-text-color: #ffffff;--cs-assistant-text-color: #1a1a1a;--cs-focus-ring: rgba(0, 0, 0, .1);--cs-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);--cs-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--cs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--cs-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}.cs-widget{position:fixed;z-index:9999;font-family:var(--cs-font-family)}.cs-widget,.cs-widget *{box-sizing:border-box}.cs-widget--bottom-right{bottom:20px;right:20px}.cs-widget--bottom-left{bottom:20px;left:20px}.cs-widget--top-right{top:20px;right:20px}.cs-widget--top-left{top:20px;left:20px}.cs-widget__toggle{position:relative;width:60px;height:60px;border-radius:50%;background:var(--cs-header-gradient);border:none;color:#fff;cursor:pointer;box-shadow:var(--cs-shadow-xl);transition:all .3s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:center}.cs-widget__toggle:hover{transform:scale(1.1);box-shadow:0 15px 25px -5px var(--cs-focus-ring)}.cs-widget__toggle:active{transform:scale(.95)}.cs-widget__toggle--open{background:#ef4444}.cs-widget__badge{position:absolute;top:-5px;right:-5px;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;box-shadow:var(--cs-shadow)}.cs-window{position:absolute;bottom:85px;right:0;width:380px;max-width:calc(100vw - 40px);height:600px;max-height:calc(100vh - 130px);background:var(--cs-bg-color);border-radius:var(--cs-border-radius);border:1px solid rgba(0,0,0,.1);box-shadow:var(--cs-shadow-xl);display:flex;flex-direction:column;overflow:visible;animation:slideUp .3s cubic-bezier(.4,0,.2,1);transform-origin:bottom right}.cs-window:after{content:"";position:absolute;bottom:-10px;right:25px;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid var(--cs-bg-color);filter:drop-shadow(0 5px 5px rgba(0,0,0,.1))}.cs-widget--bottom-left .cs-window{transform-origin:bottom left;right:auto;left:0}.cs-widget--bottom-left .cs-window:after{right:auto;left:25px}.cs-widget--top-right .cs-window{transform-origin:top right;bottom:auto;top:85px}.cs-widget--top-right .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color)}.cs-widget--top-left .cs-window{transform-origin:top left;bottom:auto;top:85px;right:auto;left:0}.cs-widget--top-left .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color);right:auto;left:25px}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.cs-window__header{background:var(--cs-header-gradient);color:var(--cs-header-text-color);padding:16px 20px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.cs-window__header-info{display:flex;flex-direction:column;gap:2px}.cs-window__title{margin:0;font-size:16px;font-weight:600}.cs-window__status{display:flex;align-items:center;gap:6px;font-size:12px;opacity:.9}.cs-window__status-dot{width:8px;height:8px;background:#4ade80;border-radius:50%;box-shadow:0 0 0 2px #fff3}.cs-window__close{background:#fff3;border:none;color:var(--cs-header-text-color);width:32px;height:32px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.cs-window__close:hover{background:#ffffff4d}.cs-window__messages{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:16px;background:var(--cs-bg-color);color:var(--cs-bg-text-color)}.cs-window__messages::-webkit-scrollbar{width:6px}.cs-window__messages::-webkit-scrollbar-track{background:transparent}.cs-window__messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.cs-window__messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}.cs-window__welcome{text-align:center;padding:40px 20px;color:#6b7280}.cs-window__welcome p{margin:0;font-size:16px}.cs-window__typing{display:flex;align-items:center;gap:8px;padding:12px 16px;background:var(--cs-assistant-message-color);border-radius:var(--cs-border-radius);width:fit-content;color:var(--cs-text-color)}.cs-window__typing-icon{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cs-window__error{background:#fee2e2;border:1px solid #ef4444;color:#991b1b;padding:12px 16px;border-radius:var(--cs-border-radius)}.cs-window__error p{margin:0}.cs-message{display:flex;flex-direction:column;gap:6px;max-width:85%;animation:fadeIn .3s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.cs-message--user{align-self:flex-end;align-items:flex-end}.cs-message--assistant{align-self:flex-start;align-items:flex-start}.cs-message__content{background:var(--cs-assistant-message-color);padding:12px 16px;border-radius:var(--cs-border-radius);border-bottom-left-radius:4px;color:var(--cs-assistant-text-color);word-wrap:break-word;box-shadow:var(--cs-shadow-sm)}.cs-message--user .cs-message__content{background:var(--cs-user-message-color);color:var(--cs-user-text-color);border-radius:var(--cs-border-radius);border-bottom-right-radius:4px}.cs-message__text{margin:0;line-height:1.5;white-space:pre-wrap}.cs-message__time{font-size:11px;color:#9ca3af;padding:0 4px}.cs-message__sources{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}.cs-message__sources-title{margin:0 0 8px;font-size:12px;font-weight:600;color:#6b7280}.cs-message__sources-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}.cs-message__source-item{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.cs-message__source-link{display:flex;align-items:center;gap:4px;color:var(--cs-primary-color);text-decoration:none;flex:1;min-width:0}.cs-message__source-link:hover{text-decoration:underline}.cs-message__source-link span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cs-message__source-similarity{color:#6b7280;font-size:11px;white-space:nowrap}.cs-window__input-wrapper{padding:16px;background:var(--cs-bg-color);border-top:1px solid #e5e7eb;flex-shrink:0}.cs-input{display:flex;gap:8px;align-items:flex-end}.cs-input__textarea{flex:1;padding:12px 16px;border:1px solid rgba(0,0,0,.1);border-radius:var(--cs-border-radius);font-family:var(--cs-font-family);font-size:14px;resize:none;max-height:120px;min-height:44px;transition:border-color .2s;background:var(--cs-bg-color);color:var(--cs-bg-text-color)}.cs-input__textarea:focus{outline:none;border-color:var(--cs-primary-color);box-shadow:0 0 0 3px var(--cs-focus-ring);background-color:var(--cs-bg-color)}.cs-input__textarea:disabled{background:#f3f4f6;cursor:not-allowed}.cs-input__button{background:var(--cs-button-color);color:var(--cs-header-text-color);border:none;width:44px;height:44px;border-radius:var(--cs-border-radius);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;flex-shrink:0}.cs-input__button:hover:not(:disabled){background:var(--cs-secondary-color);transform:scale(1.05)}.cs-input__button:active:not(:disabled){transform:scale(.95)}.cs-input__button:disabled{background:#d1d5db;cursor:not-allowed}@media(max-width:480px){.cs-widget--open{position:fixed!important;inset:auto!important;bottom:20px!important;right:20px!important;width:auto!important;height:auto!important;z-index:10000!important}.cs-window{position:fixed!important;width:88vw!important;height:60vh!important;max-width:400px!important;max-height:500px!important;bottom:90px!important;right:5%!important;left:5%!important;top:auto!important;border-radius:var(--cs-border-radius)!important;box-shadow:var(--cs-shadow-xl)!important;display:flex!important;flex-direction:column!important;animation:slideUp .3s ease-out!important;overflow:visible!important}.cs-widget--open .cs-widget__toggle{display:flex!important;opacity:.8}.cs-window__messages{padding:16px}.cs-window__header{padding:12px 16px}.cs-window__input-wrapper{padding:12px}.cs-widget__toggle{width:50px;height:50px}}', vn = ({
|
|
2040
2040
|
apiKey: e,
|
|
2041
2041
|
baseUrl: t,
|
|
2042
2042
|
theme: r,
|
|
@@ -2048,9 +2048,9 @@ const ln = ({ message: e }) => {
|
|
|
2048
2048
|
onMessageSent: f,
|
|
2049
2049
|
onMessageReceived: u
|
|
2050
2050
|
}) => {
|
|
2051
|
-
const [l, p] =
|
|
2051
|
+
const [l, p] = V(!1), {
|
|
2052
2052
|
messages: y,
|
|
2053
|
-
sendMessage:
|
|
2053
|
+
sendMessage: T,
|
|
2054
2054
|
isLoading: d,
|
|
2055
2055
|
error: h,
|
|
2056
2056
|
clearError: m
|
|
@@ -2058,29 +2058,35 @@ const ln = ({ message: e }) => {
|
|
|
2058
2058
|
apiKey: e,
|
|
2059
2059
|
baseUrl: t,
|
|
2060
2060
|
onError: a
|
|
2061
|
-
}), E =
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2061
|
+
}), E = (b) => {
|
|
2062
|
+
if (!b) return "#ffffff";
|
|
2063
|
+
const _ = b.startsWith("#") ? b.slice(1) : b, A = parseInt(_.substring(0, 2), 16), F = parseInt(_.substring(2, 4), 16), v = parseInt(_.substring(4, 6), 16);
|
|
2064
|
+
return (0.299 * A + 0.587 * F + 0.114 * v) / 255 > 0.6 ? "#1a1a1a" : "#ffffff";
|
|
2065
|
+
}, R = w.useMemo(() => {
|
|
2066
|
+
const b = {}, _ = (r == null ? void 0 : r.primaryColor) || "#6366f1", A = (r == null ? void 0 : r.backgroundColor) || "#ffffff", F = (r == null ? void 0 : r.textColor) || (E(A) === "#ffffff" ? "#ffffff" : "#1f2937");
|
|
2067
|
+
b["--cs-primary-color"] = _, b["--cs-secondary-color"] = (r == null ? void 0 : r.secondaryColor) || _, b["--cs-bg-color"] = A, b["--cs-text-color"] = F, b["--cs-font-family"] = (r == null ? void 0 : r.fontFamily) || "inherit", b["--cs-border-radius"] = (r == null ? void 0 : r.borderRadius) || "12px", b["--cs-header-text-color"] = E(_), b["--cs-bg-text-color"] = F, b["--cs-button-color"] = (r == null ? void 0 : r.buttonColor) || _, b["--cs-user-message-color"] = (r == null ? void 0 : r.userMessageColor) || _, b["--cs-user-text-color"] = E((r == null ? void 0 : r.userMessageColor) || _);
|
|
2068
|
+
const v = E(A) === "#ffffff";
|
|
2069
|
+
return b["--cs-assistant-message-color"] = (r == null ? void 0 : r.assistantMessageColor) || (v ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)"), b["--cs-assistant-text-color"] = F, b["--cs-focus-ring"] = `${_}33`, b;
|
|
2070
|
+
}, [r]), x = async (b) => {
|
|
2071
|
+
if (f == null || f(b), await T(b), !h) {
|
|
2072
|
+
const _ = y[y.length - 1];
|
|
2073
|
+
(_ == null ? void 0 : _.role) === "ASSISTANT" && (u == null || u(_.content));
|
|
2068
2074
|
}
|
|
2069
|
-
},
|
|
2075
|
+
}, S = () => {
|
|
2070
2076
|
p(!l), h && m();
|
|
2071
2077
|
};
|
|
2072
2078
|
return /* @__PURE__ */ w.createElement(
|
|
2073
2079
|
"div",
|
|
2074
2080
|
{
|
|
2075
2081
|
className: `cs-widget cs-widget--${n} ${l ? "cs-widget--open" : ""} ${i}`,
|
|
2076
|
-
style:
|
|
2082
|
+
style: R
|
|
2077
2083
|
},
|
|
2078
2084
|
/* @__PURE__ */ w.createElement("style", { dangerouslySetInnerHTML: { __html: fn } }),
|
|
2079
2085
|
l && /* @__PURE__ */ w.createElement(
|
|
2080
2086
|
dn,
|
|
2081
2087
|
{
|
|
2082
2088
|
messages: y,
|
|
2083
|
-
onSendMessage:
|
|
2089
|
+
onSendMessage: x,
|
|
2084
2090
|
onClose: () => p(!1),
|
|
2085
2091
|
isLoading: d,
|
|
2086
2092
|
error: h,
|
|
@@ -2092,7 +2098,7 @@ const ln = ({ message: e }) => {
|
|
|
2092
2098
|
"button",
|
|
2093
2099
|
{
|
|
2094
2100
|
className: `cs-widget__toggle ${l ? "cs-widget__toggle--open" : ""}`,
|
|
2095
|
-
onClick:
|
|
2101
|
+
onClick: S,
|
|
2096
2102
|
"aria-label": l ? "Close chat" : "Open chat",
|
|
2097
2103
|
"aria-expanded": l
|
|
2098
2104
|
},
|
|
@@ -2106,7 +2112,7 @@ export {
|
|
|
2106
2112
|
ln as ChatMessage,
|
|
2107
2113
|
dn as ChatWindow,
|
|
2108
2114
|
sn as CustomerSupportAPIClient,
|
|
2109
|
-
|
|
2115
|
+
vn as CustomerSupportWidget,
|
|
2110
2116
|
cn as useCustomerSupport,
|
|
2111
2117
|
We as useLocalStorage
|
|
2112
2118
|
};
|