@tarxemo/customer_support 1.0.3 → 1.0.4

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,22 +1,21 @@
1
- var Tt = Object.defineProperty;
2
- var Ct = (e, t, n) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var Le = (e, t, n) => Ct(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { jsxs as x, jsx as S } from "react/jsx-runtime";
5
- import { forwardRef as Ye, createElement as be, useState as K, useRef as et, useEffect as Oe, useCallback as ne } from "react";
1
+ var At = Object.defineProperty;
2
+ var Tt = (e, t, n) => t in e ? At(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var Ue = (e, t, n) => Tt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import b, { forwardRef as Qe, createElement as we, useState as J, useRef as Ye, useEffect as Re, useCallback as te } from "react";
6
5
  /**
7
6
  * @license lucide-react v0.469.0 - ISC
8
7
  *
9
8
  * This source code is licensed under the ISC license.
10
9
  * See the LICENSE file in the root directory of this source tree.
11
10
  */
12
- const Nt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), tt = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim();
11
+ const Ct = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), et = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim();
13
12
  /**
14
13
  * @license lucide-react v0.469.0 - ISC
15
14
  *
16
15
  * This source code is licensed under the ISC license.
17
16
  * See the LICENSE file in the root directory of this source tree.
18
17
  */
19
- var xt = {
18
+ var Nt = {
20
19
  xmlns: "http://www.w3.org/2000/svg",
21
20
  width: 24,
22
21
  height: 24,
@@ -33,7 +32,7 @@ var xt = {
33
32
  * This source code is licensed under the ISC license.
34
33
  * See the LICENSE file in the root directory of this source tree.
35
34
  */
36
- const Pt = Ye(
35
+ const xt = Qe(
37
36
  ({
38
37
  color: e = "currentColor",
39
38
  size: t = 24,
@@ -43,20 +42,20 @@ const Pt = Ye(
43
42
  children: o,
44
43
  iconNode: i,
45
44
  ...a
46
- }, d) => be(
45
+ }, d) => we(
47
46
  "svg",
48
47
  {
49
48
  ref: d,
50
- ...xt,
49
+ ...Nt,
51
50
  width: t,
52
51
  height: t,
53
52
  stroke: e,
54
53
  strokeWidth: r ? Number(n) * 24 / Number(t) : n,
55
- className: tt("lucide", s),
54
+ className: et("lucide", s),
56
55
  ...a
57
56
  },
58
57
  [
59
- ...i.map(([u, l]) => be(u, l)),
58
+ ...i.map(([u, l]) => we(u, l)),
60
59
  ...Array.isArray(o) ? o : [o]
61
60
  ]
62
61
  )
@@ -68,11 +67,11 @@ const Pt = Ye(
68
67
  * See the LICENSE file in the root directory of this source tree.
69
68
  */
70
69
  const V = (e, t) => {
71
- const n = Ye(
72
- ({ className: r, ...s }, o) => be(Pt, {
70
+ const n = Qe(
71
+ ({ className: r, ...s }, o) => we(xt, {
73
72
  ref: o,
74
73
  iconNode: t,
75
- className: tt(`lucide-${Nt(e)}`, r),
74
+ className: et(`lucide-${Ct(e)}`, r),
76
75
  ...s
77
76
  })
78
77
  );
@@ -84,7 +83,7 @@ const V = (e, t) => {
84
83
  * This source code is licensed under the ISC license.
85
84
  * See the LICENSE file in the root directory of this source tree.
86
85
  */
87
- const Dt = V("ExternalLink", [
86
+ const Pt = V("ExternalLink", [
88
87
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
89
88
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
90
89
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
@@ -95,7 +94,7 @@ const Dt = V("ExternalLink", [
95
94
  * This source code is licensed under the ISC license.
96
95
  * See the LICENSE file in the root directory of this source tree.
97
96
  */
98
- const Ft = V("LoaderCircle", [
97
+ const Dt = V("LoaderCircle", [
99
98
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
100
99
  ]);
101
100
  /**
@@ -104,7 +103,7 @@ const Ft = V("LoaderCircle", [
104
103
  * This source code is licensed under the ISC license.
105
104
  * See the LICENSE file in the root directory of this source tree.
106
105
  */
107
- const Ut = V("MessageCircle", [
106
+ const Ft = V("MessageCircle", [
108
107
  ["path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z", key: "vv11sd" }]
109
108
  ]);
110
109
  /**
@@ -113,7 +112,7 @@ const Ut = V("MessageCircle", [
113
112
  * This source code is licensed under the ISC license.
114
113
  * See the LICENSE file in the root directory of this source tree.
115
114
  */
116
- const Lt = V("Send", [
115
+ const Ut = V("Send", [
117
116
  [
118
117
  "path",
119
118
  {
@@ -129,54 +128,54 @@ const Lt = V("Send", [
129
128
  * This source code is licensed under the ISC license.
130
129
  * See the LICENSE file in the root directory of this source tree.
131
130
  */
132
- const kt = V("X", [
131
+ const Lt = V("X", [
133
132
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
134
133
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
135
134
  ]);
136
- function nt(e, t) {
135
+ function tt(e, t) {
137
136
  return function() {
138
137
  return e.apply(t, arguments);
139
138
  };
140
139
  }
141
- const { toString: Bt } = Object.prototype, { getPrototypeOf: _e } = Object, { iterator: ce, toStringTag: rt } = Symbol, le = /* @__PURE__ */ ((e) => (t) => {
142
- const n = Bt.call(t);
140
+ const { toString: kt } = Object.prototype, { getPrototypeOf: Oe } = Object, { iterator: ae, toStringTag: nt } = Symbol, ce = /* @__PURE__ */ ((e) => (t) => {
141
+ const n = kt.call(t);
143
142
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
144
- })(/* @__PURE__ */ Object.create(null)), D = (e) => (e = e.toLowerCase(), (t) => le(t) === e), ue = (e) => (t) => typeof t === e, { isArray: z } = Array, H = ue("undefined");
145
- function W(e) {
146
- return e !== null && !H(e) && e.constructor !== null && !H(e.constructor) && C(e.constructor.isBuffer) && e.constructor.isBuffer(e);
143
+ })(/* @__PURE__ */ Object.create(null)), P = (e) => (e = e.toLowerCase(), (t) => ce(t) === e), le = (e) => (t) => typeof t === e, { isArray: H } = Array, q = le("undefined");
144
+ function K(e) {
145
+ return e !== null && !q(e) && e.constructor !== null && !q(e.constructor) && C(e.constructor.isBuffer) && e.constructor.isBuffer(e);
147
146
  }
148
- const st = D("ArrayBuffer");
149
- function It(e) {
147
+ const rt = P("ArrayBuffer");
148
+ function Bt(e) {
150
149
  let t;
151
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && st(e.buffer), t;
150
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && rt(e.buffer), t;
152
151
  }
153
- const jt = ue("string"), C = ue("function"), ot = ue("number"), X = (e) => e !== null && typeof e == "object", Mt = (e) => e === !0 || e === !1, se = (e) => {
154
- if (le(e) !== "object")
152
+ const It = le("string"), C = le("function"), st = le("number"), W = (e) => e !== null && typeof e == "object", jt = (e) => e === !0 || e === !1, re = (e) => {
153
+ if (ce(e) !== "object")
155
154
  return !1;
156
- const t = _e(e);
157
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(rt in e) && !(ce in e);
158
- }, $t = (e) => {
159
- if (!X(e) || W(e))
155
+ const t = Oe(e);
156
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(nt in e) && !(ae in e);
157
+ }, Mt = (e) => {
158
+ if (!W(e) || K(e))
160
159
  return !1;
161
160
  try {
162
161
  return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
163
162
  } catch {
164
163
  return !1;
165
164
  }
166
- }, qt = D("Date"), Ht = D("File"), zt = D("Blob"), vt = D("FileList"), Jt = (e) => X(e) && C(e.pipe), Kt = (e) => {
165
+ }, $t = P("Date"), qt = P("File"), Ht = P("Blob"), zt = P("FileList"), vt = (e) => W(e) && C(e.pipe), Jt = (e) => {
167
166
  let t;
168
- return e && (typeof FormData == "function" && e instanceof FormData || C(e.append) && ((t = le(e)) === "formdata" || // detect form-data instance
167
+ return e && (typeof FormData == "function" && e instanceof FormData || C(e.append) && ((t = ce(e)) === "formdata" || // detect form-data instance
169
168
  t === "object" && C(e.toString) && e.toString() === "[object FormData]"));
170
- }, Vt = D("URLSearchParams"), [Wt, Xt, Gt, Zt] = ["ReadableStream", "Request", "Response", "Headers"].map(D), Qt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
171
- function G(e, t, { allOwnKeys: n = !1 } = {}) {
169
+ }, Vt = P("URLSearchParams"), [Kt, Wt, Xt, Gt] = ["ReadableStream", "Request", "Response", "Headers"].map(P), Zt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
170
+ function X(e, t, { allOwnKeys: n = !1 } = {}) {
172
171
  if (e === null || typeof e > "u")
173
172
  return;
174
173
  let r, s;
175
- if (typeof e != "object" && (e = [e]), z(e))
174
+ if (typeof e != "object" && (e = [e]), H(e))
176
175
  for (r = 0, s = e.length; r < s; r++)
177
176
  t.call(null, e[r], r, e);
178
177
  else {
179
- if (W(e))
178
+ if (K(e))
180
179
  return;
181
180
  const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
182
181
  let a;
@@ -184,8 +183,8 @@ function G(e, t, { allOwnKeys: n = !1 } = {}) {
184
183
  a = o[r], t.call(null, e[a], a, e);
185
184
  }
186
185
  }
187
- function it(e, t) {
188
- if (W(e))
186
+ function ot(e, t) {
187
+ if (K(e))
189
188
  return null;
190
189
  t = t.toLowerCase();
191
190
  const n = Object.keys(e);
@@ -195,19 +194,19 @@ function it(e, t) {
195
194
  return s;
196
195
  return null;
197
196
  }
198
- const j = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, at = (e) => !H(e) && e !== j;
199
- function ge() {
200
- const { caseless: e, skipUndefined: t } = at(this) && this || {}, n = {}, r = (s, o) => {
201
- const i = e && it(n, o) || o;
202
- se(n[i]) && se(s) ? n[i] = ge(n[i], s) : se(s) ? n[i] = ge({}, s) : z(s) ? n[i] = s.slice() : (!t || !H(s)) && (n[i] = s);
197
+ const I = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, it = (e) => !q(e) && e !== I;
198
+ function Ee() {
199
+ const { caseless: e, skipUndefined: t } = it(this) && this || {}, n = {}, r = (s, o) => {
200
+ const i = e && ot(n, o) || o;
201
+ re(n[i]) && re(s) ? n[i] = Ee(n[i], s) : re(s) ? n[i] = Ee({}, s) : H(s) ? n[i] = s.slice() : (!t || !q(s)) && (n[i] = s);
203
202
  };
204
203
  for (let s = 0, o = arguments.length; s < o; s++)
205
- arguments[s] && G(arguments[s], r);
204
+ arguments[s] && X(arguments[s], r);
206
205
  return n;
207
206
  }
208
- const Yt = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (s, o) => {
207
+ const Qt = (e, t, n, { allOwnKeys: r } = {}) => (X(t, (s, o) => {
209
208
  n && C(s) ? Object.defineProperty(e, o, {
210
- value: nt(s, n),
209
+ value: tt(s, n),
211
210
  writable: !0,
212
211
  enumerable: !0,
213
212
  configurable: !0
@@ -217,7 +216,7 @@ const Yt = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (s, o) => {
217
216
  enumerable: !0,
218
217
  configurable: !0
219
218
  });
220
- }, { allOwnKeys: r }), e), en = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), tn = (e, t, n, r) => {
219
+ }, { allOwnKeys: r }), e), Yt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), en = (e, t, n, r) => {
221
220
  e.prototype = Object.create(t.prototype, r), Object.defineProperty(e.prototype, "constructor", {
222
221
  value: e,
223
222
  writable: !0,
@@ -226,55 +225,55 @@ const Yt = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (s, o) => {
226
225
  }), Object.defineProperty(e, "super", {
227
226
  value: t.prototype
228
227
  }), n && Object.assign(e.prototype, n);
229
- }, nn = (e, t, n, r) => {
228
+ }, tn = (e, t, n, r) => {
230
229
  let s, o, i;
231
230
  const a = {};
232
231
  if (t = t || {}, e == null) return t;
233
232
  do {
234
233
  for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
235
234
  i = s[o], (!r || r(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
236
- e = n !== !1 && _e(e);
235
+ e = n !== !1 && Oe(e);
237
236
  } while (e && (!n || n(e, t)) && e !== Object.prototype);
238
237
  return t;
239
- }, rn = (e, t, n) => {
238
+ }, nn = (e, t, n) => {
240
239
  e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
241
240
  const r = e.indexOf(t, n);
242
241
  return r !== -1 && r === n;
243
- }, sn = (e) => {
242
+ }, rn = (e) => {
244
243
  if (!e) return null;
245
- if (z(e)) return e;
244
+ if (H(e)) return e;
246
245
  let t = e.length;
247
- if (!ot(t)) return null;
246
+ if (!st(t)) return null;
248
247
  const n = new Array(t);
249
248
  for (; t-- > 0; )
250
249
  n[t] = e[t];
251
250
  return n;
252
- }, on = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && _e(Uint8Array)), an = (e, t) => {
253
- const r = (e && e[ce]).call(e);
251
+ }, sn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Oe(Uint8Array)), on = (e, t) => {
252
+ const r = (e && e[ae]).call(e);
254
253
  let s;
255
254
  for (; (s = r.next()) && !s.done; ) {
256
255
  const o = s.value;
257
256
  t.call(e, o[0], o[1]);
258
257
  }
259
- }, cn = (e, t) => {
258
+ }, an = (e, t) => {
260
259
  let n;
261
260
  const r = [];
262
261
  for (; (n = e.exec(t)) !== null; )
263
262
  r.push(n);
264
263
  return r;
265
- }, ln = D("HTMLFormElement"), un = (e) => e.toLowerCase().replace(
264
+ }, cn = P("HTMLFormElement"), ln = (e) => e.toLowerCase().replace(
266
265
  /[-_\s]([a-z\d])(\w*)/g,
267
266
  function(n, r, s) {
268
267
  return r.toUpperCase() + s;
269
268
  }
270
- ), ke = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), fn = D("RegExp"), ct = (e, t) => {
269
+ ), Le = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), un = P("RegExp"), at = (e, t) => {
271
270
  const n = Object.getOwnPropertyDescriptors(e), r = {};
272
- G(n, (s, o) => {
271
+ X(n, (s, o) => {
273
272
  let i;
274
273
  (i = t(s, o, e)) !== !1 && (r[o] = i || s);
275
274
  }), Object.defineProperties(e, r);
276
- }, dn = (e) => {
277
- ct(e, (t, n) => {
275
+ }, fn = (e) => {
276
+ at(e, (t, n) => {
278
277
  if (C(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
279
278
  return !1;
280
279
  const r = e[n];
@@ -288,107 +287,107 @@ const Yt = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (s, o) => {
288
287
  });
289
288
  }
290
289
  });
291
- }, pn = (e, t) => {
290
+ }, dn = (e, t) => {
292
291
  const n = {}, r = (s) => {
293
292
  s.forEach((o) => {
294
293
  n[o] = !0;
295
294
  });
296
295
  };
297
- return z(e) ? r(e) : r(String(e).split(t)), n;
298
- }, hn = () => {
296
+ return H(e) ? r(e) : r(String(e).split(t)), n;
297
+ }, pn = () => {
299
298
  }, mn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
300
- function yn(e) {
301
- return !!(e && C(e.append) && e[rt] === "FormData" && e[ce]);
299
+ function hn(e) {
300
+ return !!(e && C(e.append) && e[nt] === "FormData" && e[ae]);
302
301
  }
303
- const wn = (e) => {
302
+ const yn = (e) => {
304
303
  const t = new Array(10), n = (r, s) => {
305
- if (X(r)) {
304
+ if (W(r)) {
306
305
  if (t.indexOf(r) >= 0)
307
306
  return;
308
- if (W(r))
307
+ if (K(r))
309
308
  return r;
310
309
  if (!("toJSON" in r)) {
311
310
  t[s] = r;
312
- const o = z(r) ? [] : {};
313
- return G(r, (i, a) => {
311
+ const o = H(r) ? [] : {};
312
+ return X(r, (i, a) => {
314
313
  const d = n(i, s + 1);
315
- !H(d) && (o[a] = d);
314
+ !q(d) && (o[a] = d);
316
315
  }), t[s] = void 0, o;
317
316
  }
318
317
  }
319
318
  return r;
320
319
  };
321
320
  return n(e, 0);
322
- }, bn = D("AsyncFunction"), gn = (e) => e && (X(e) || C(e)) && C(e.then) && C(e.catch), lt = ((e, t) => e ? setImmediate : t ? ((n, r) => (j.addEventListener("message", ({ source: s, data: o }) => {
323
- s === j && o === n && r.length && r.shift()();
321
+ }, wn = P("AsyncFunction"), En = (e) => e && (W(e) || C(e)) && C(e.then) && C(e.catch), ct = ((e, t) => e ? setImmediate : t ? ((n, r) => (I.addEventListener("message", ({ source: s, data: o }) => {
322
+ s === I && o === n && r.length && r.shift()();
324
323
  }, !1), (s) => {
325
- r.push(s), j.postMessage(n, "*");
324
+ r.push(s), I.postMessage(n, "*");
326
325
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
327
326
  typeof setImmediate == "function",
328
- C(j.postMessage)
329
- ), En = typeof queueMicrotask < "u" ? queueMicrotask.bind(j) : typeof process < "u" && process.nextTick || lt, Sn = (e) => e != null && C(e[ce]), c = {
330
- isArray: z,
331
- isArrayBuffer: st,
332
- isBuffer: W,
333
- isFormData: Kt,
334
- isArrayBufferView: It,
335
- isString: jt,
336
- isNumber: ot,
337
- isBoolean: Mt,
338
- isObject: X,
339
- isPlainObject: se,
340
- isEmptyObject: $t,
341
- isReadableStream: Wt,
342
- isRequest: Xt,
343
- isResponse: Gt,
344
- isHeaders: Zt,
345
- isUndefined: H,
346
- isDate: qt,
347
- isFile: Ht,
348
- isBlob: zt,
349
- isRegExp: fn,
327
+ C(I.postMessage)
328
+ ), bn = typeof queueMicrotask < "u" ? queueMicrotask.bind(I) : typeof process < "u" && process.nextTick || ct, gn = (e) => e != null && C(e[ae]), c = {
329
+ isArray: H,
330
+ isArrayBuffer: rt,
331
+ isBuffer: K,
332
+ isFormData: Jt,
333
+ isArrayBufferView: Bt,
334
+ isString: It,
335
+ isNumber: st,
336
+ isBoolean: jt,
337
+ isObject: W,
338
+ isPlainObject: re,
339
+ isEmptyObject: Mt,
340
+ isReadableStream: Kt,
341
+ isRequest: Wt,
342
+ isResponse: Xt,
343
+ isHeaders: Gt,
344
+ isUndefined: q,
345
+ isDate: $t,
346
+ isFile: qt,
347
+ isBlob: Ht,
348
+ isRegExp: un,
350
349
  isFunction: C,
351
- isStream: Jt,
350
+ isStream: vt,
352
351
  isURLSearchParams: Vt,
353
- isTypedArray: on,
354
- isFileList: vt,
355
- forEach: G,
356
- merge: ge,
357
- extend: Yt,
358
- trim: Qt,
359
- stripBOM: en,
360
- inherits: tn,
361
- toFlatObject: nn,
362
- kindOf: le,
363
- kindOfTest: D,
364
- endsWith: rn,
365
- toArray: sn,
366
- forEachEntry: an,
367
- matchAll: cn,
368
- isHTMLForm: ln,
369
- hasOwnProperty: ke,
370
- hasOwnProp: ke,
352
+ isTypedArray: sn,
353
+ isFileList: zt,
354
+ forEach: X,
355
+ merge: Ee,
356
+ extend: Qt,
357
+ trim: Zt,
358
+ stripBOM: Yt,
359
+ inherits: en,
360
+ toFlatObject: tn,
361
+ kindOf: ce,
362
+ kindOfTest: P,
363
+ endsWith: nn,
364
+ toArray: rn,
365
+ forEachEntry: on,
366
+ matchAll: an,
367
+ isHTMLForm: cn,
368
+ hasOwnProperty: Le,
369
+ hasOwnProp: Le,
371
370
  // an alias to avoid ESLint no-prototype-builtins detection
372
- reduceDescriptors: ct,
373
- freezeMethods: dn,
374
- toObjectSet: pn,
375
- toCamelCase: un,
376
- noop: hn,
371
+ reduceDescriptors: at,
372
+ freezeMethods: fn,
373
+ toObjectSet: dn,
374
+ toCamelCase: ln,
375
+ noop: pn,
377
376
  toFiniteNumber: mn,
378
- findKey: it,
379
- global: j,
380
- isContextDefined: at,
381
- isSpecCompliantForm: yn,
382
- toJSONObject: wn,
383
- isAsyncFn: bn,
384
- isThenable: gn,
385
- setImmediate: lt,
386
- asap: En,
387
- isIterable: Sn
377
+ findKey: ot,
378
+ global: I,
379
+ isContextDefined: it,
380
+ isSpecCompliantForm: hn,
381
+ toJSONObject: yn,
382
+ isAsyncFn: wn,
383
+ isThenable: En,
384
+ setImmediate: ct,
385
+ asap: bn,
386
+ isIterable: gn
388
387
  };
389
- let w = class ut extends Error {
388
+ let w = class lt extends Error {
390
389
  static from(t, n, r, s, o, i) {
391
- const a = new ut(t.message, n || t.code, r, s, o);
390
+ const a = new lt(t.message, n || t.code, r, s, o);
392
391
  return a.cause = t, a.name = t.name, i && Object.assign(a, i), a;
393
392
  }
394
393
  /**
@@ -437,33 +436,33 @@ w.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
437
436
  w.ERR_CANCELED = "ERR_CANCELED";
438
437
  w.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
439
438
  w.ERR_INVALID_URL = "ERR_INVALID_URL";
440
- const Rn = null;
441
- function Ee(e) {
439
+ const Sn = null;
440
+ function be(e) {
442
441
  return c.isPlainObject(e) || c.isArray(e);
443
442
  }
444
- function ft(e) {
443
+ function ut(e) {
445
444
  return c.endsWith(e, "[]") ? e.slice(0, -2) : e;
446
445
  }
447
- function Be(e, t, n) {
446
+ function ke(e, t, n) {
448
447
  return e ? e.concat(t).map(function(s, o) {
449
- return s = ft(s), !n && o ? "[" + s + "]" : s;
448
+ return s = ut(s), !n && o ? "[" + s + "]" : s;
450
449
  }).join(n ? "." : "") : t;
451
450
  }
452
- function On(e) {
453
- return c.isArray(e) && !e.some(Ee);
451
+ function Rn(e) {
452
+ return c.isArray(e) && !e.some(be);
454
453
  }
455
- const _n = c.toFlatObject(c, {}, null, function(t) {
454
+ const On = c.toFlatObject(c, {}, null, function(t) {
456
455
  return /^is[A-Z]/.test(t);
457
456
  });
458
- function fe(e, t, n) {
457
+ function ue(e, t, n) {
459
458
  if (!c.isObject(e))
460
459
  throw new TypeError("target must be an object");
461
460
  t = t || new FormData(), n = c.toFlatObject(n, {
462
461
  metaTokens: !0,
463
462
  dots: !1,
464
463
  indexes: !1
465
- }, !1, function(m, h) {
466
- return !c.isUndefined(h[m]);
464
+ }, !1, function(h, m) {
465
+ return !c.isUndefined(m[h]);
467
466
  });
468
467
  const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
469
468
  if (!c.isFunction(s))
@@ -478,39 +477,39 @@ function fe(e, t, n) {
478
477
  throw new w("Blob is not supported. Use a Buffer instead.");
479
478
  return c.isArrayBuffer(f) || c.isTypedArray(f) ? d && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
480
479
  }
481
- function l(f, m, h) {
480
+ function l(f, h, m) {
482
481
  let g = f;
483
- if (f && !h && typeof f == "object") {
484
- if (c.endsWith(m, "{}"))
485
- m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
486
- else if (c.isArray(f) && On(f) || (c.isFileList(f) || c.endsWith(m, "[]")) && (g = c.toArray(f)))
487
- return m = ft(m), g.forEach(function(y, E) {
482
+ if (f && !m && typeof f == "object") {
483
+ if (c.endsWith(h, "{}"))
484
+ h = r ? h : h.slice(0, -2), f = JSON.stringify(f);
485
+ else if (c.isArray(f) && Rn(f) || (c.isFileList(f) || c.endsWith(h, "[]")) && (g = c.toArray(f)))
486
+ return h = ut(h), g.forEach(function(y, S) {
488
487
  !(c.isUndefined(y) || y === null) && t.append(
489
488
  // eslint-disable-next-line no-nested-ternary
490
- i === !0 ? Be([m], E, o) : i === null ? m : m + "[]",
489
+ i === !0 ? ke([h], S, o) : i === null ? h : h + "[]",
491
490
  u(y)
492
491
  );
493
492
  }), !1;
494
493
  }
495
- return Ee(f) ? !0 : (t.append(Be(h, m, o), u(f)), !1);
494
+ return be(f) ? !0 : (t.append(ke(m, h, o), u(f)), !1);
496
495
  }
497
- const p = [], b = Object.assign(_n, {
496
+ const p = [], E = Object.assign(On, {
498
497
  defaultVisitor: l,
499
498
  convertValue: u,
500
- isVisitable: Ee
499
+ isVisitable: be
501
500
  });
502
- function _(f, m) {
501
+ function _(f, h) {
503
502
  if (!c.isUndefined(f)) {
504
503
  if (p.indexOf(f) !== -1)
505
- throw Error("Circular reference detected in " + m.join("."));
504
+ throw Error("Circular reference detected in " + h.join("."));
506
505
  p.push(f), c.forEach(f, function(g, R) {
507
506
  (!(c.isUndefined(g) || g === null) && s.call(
508
507
  t,
509
508
  g,
510
509
  c.isString(R) ? R.trim() : R,
511
- m,
512
- b
513
- )) === !0 && _(g, m ? m.concat(R) : [R]);
510
+ h,
511
+ E
512
+ )) === !0 && _(g, h ? h.concat(R) : [R]);
514
513
  }), p.pop();
515
514
  }
516
515
  }
@@ -518,7 +517,7 @@ function fe(e, t, n) {
518
517
  throw new TypeError("data must be an object");
519
518
  return _(e), t;
520
519
  }
521
- function Ie(e) {
520
+ function Be(e) {
522
521
  const t = {
523
522
  "!": "%21",
524
523
  "'": "%27",
@@ -532,38 +531,38 @@ function Ie(e) {
532
531
  return t[r];
533
532
  });
534
533
  }
535
- function Ae(e, t) {
536
- this._pairs = [], e && fe(e, this, t);
534
+ function _e(e, t) {
535
+ this._pairs = [], e && ue(e, this, t);
537
536
  }
538
- const dt = Ae.prototype;
539
- dt.append = function(t, n) {
537
+ const ft = _e.prototype;
538
+ ft.append = function(t, n) {
540
539
  this._pairs.push([t, n]);
541
540
  };
542
- dt.toString = function(t) {
541
+ ft.toString = function(t) {
543
542
  const n = t ? function(r) {
544
- return t.call(this, r, Ie);
545
- } : Ie;
543
+ return t.call(this, r, Be);
544
+ } : Be;
546
545
  return this._pairs.map(function(s) {
547
546
  return n(s[0]) + "=" + n(s[1]);
548
547
  }, "").join("&");
549
548
  };
550
- function An(e) {
549
+ function _n(e) {
551
550
  return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
552
551
  }
553
- function pt(e, t, n) {
552
+ function dt(e, t, n) {
554
553
  if (!t)
555
554
  return e;
556
- const r = n && n.encode || An, s = c.isFunction(n) ? {
555
+ const r = n && n.encode || _n, s = c.isFunction(n) ? {
557
556
  serialize: n
558
557
  } : n, o = s && s.serialize;
559
558
  let i;
560
- if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new Ae(t, s).toString(r), i) {
559
+ if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new _e(t, s).toString(r), i) {
561
560
  const a = e.indexOf("#");
562
561
  a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
563
562
  }
564
563
  return e;
565
564
  }
566
- class je {
565
+ class Ie {
567
566
  constructor() {
568
567
  this.handlers = [];
569
568
  }
@@ -618,42 +617,42 @@ class je {
618
617
  });
619
618
  }
620
619
  }
621
- const ht = {
620
+ const pt = {
622
621
  silentJSONParsing: !0,
623
622
  forcedJSONParsing: !0,
624
623
  clarifyTimeoutError: !1
625
- }, Tn = typeof URLSearchParams < "u" ? URLSearchParams : Ae, Cn = typeof FormData < "u" ? FormData : null, Nn = typeof Blob < "u" ? Blob : null, xn = {
624
+ }, An = typeof URLSearchParams < "u" ? URLSearchParams : _e, Tn = typeof FormData < "u" ? FormData : null, Cn = typeof Blob < "u" ? Blob : null, Nn = {
626
625
  isBrowser: !0,
627
626
  classes: {
628
- URLSearchParams: Tn,
629
- FormData: Cn,
630
- Blob: Nn
627
+ URLSearchParams: An,
628
+ FormData: Tn,
629
+ Blob: Cn
631
630
  },
632
631
  protocols: ["http", "https", "file", "blob", "url", "data"]
633
- }, Te = typeof window < "u" && typeof document < "u", Se = typeof navigator == "object" && navigator || void 0, Pn = Te && (!Se || ["ReactNative", "NativeScript", "NS"].indexOf(Se.product) < 0), Dn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
634
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Fn = Te && window.location.href || "http://localhost", Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
632
+ }, Ae = typeof window < "u" && typeof document < "u", ge = typeof navigator == "object" && navigator || void 0, xn = Ae && (!ge || ["ReactNative", "NativeScript", "NS"].indexOf(ge.product) < 0), Pn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
633
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Dn = Ae && window.location.href || "http://localhost", Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
635
634
  __proto__: null,
636
- hasBrowserEnv: Te,
637
- hasStandardBrowserEnv: Pn,
638
- hasStandardBrowserWebWorkerEnv: Dn,
639
- navigator: Se,
640
- origin: Fn
635
+ hasBrowserEnv: Ae,
636
+ hasStandardBrowserEnv: xn,
637
+ hasStandardBrowserWebWorkerEnv: Pn,
638
+ navigator: ge,
639
+ origin: Dn
641
640
  }, Symbol.toStringTag, { value: "Module" })), A = {
642
- ...Un,
643
- ...xn
641
+ ...Fn,
642
+ ...Nn
644
643
  };
645
- function Ln(e, t) {
646
- return fe(e, new A.classes.URLSearchParams(), {
644
+ function Un(e, t) {
645
+ return ue(e, new A.classes.URLSearchParams(), {
647
646
  visitor: function(n, r, s, o) {
648
647
  return A.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
649
648
  },
650
649
  ...t
651
650
  });
652
651
  }
653
- function kn(e) {
652
+ function Ln(e) {
654
653
  return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
655
654
  }
656
- function Bn(e) {
655
+ function kn(e) {
657
656
  const t = {}, n = Object.keys(e);
658
657
  let r;
659
658
  const s = n.length;
@@ -667,17 +666,17 @@ function mt(e) {
667
666
  let i = n[o++];
668
667
  if (i === "__proto__") return !0;
669
668
  const a = Number.isFinite(+i), d = o >= n.length;
670
- return i = !i && c.isArray(s) ? s.length : i, d ? (c.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !a) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && c.isArray(s[i]) && (s[i] = Bn(s[i])), !a);
669
+ return i = !i && c.isArray(s) ? s.length : i, d ? (c.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !a) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && c.isArray(s[i]) && (s[i] = kn(s[i])), !a);
671
670
  }
672
671
  if (c.isFormData(e) && c.isFunction(e.entries)) {
673
672
  const n = {};
674
673
  return c.forEachEntry(e, (r, s) => {
675
- t(kn(r), s, n, 0);
674
+ t(Ln(r), s, n, 0);
676
675
  }), n;
677
676
  }
678
677
  return null;
679
678
  }
680
- function In(e, t, n) {
679
+ function Bn(e, t, n) {
681
680
  if (c.isString(e))
682
681
  try {
683
682
  return (t || JSON.parse)(e), c.trim(e);
@@ -687,8 +686,8 @@ function In(e, t, n) {
687
686
  }
688
687
  return (n || JSON.stringify)(e);
689
688
  }
690
- const Z = {
691
- transitional: ht,
689
+ const G = {
690
+ transitional: pt,
692
691
  adapter: ["xhr", "http", "fetch"],
693
692
  transformRequest: [function(t, n) {
694
693
  const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = c.isObject(t);
@@ -703,20 +702,20 @@ const Z = {
703
702
  let a;
704
703
  if (o) {
705
704
  if (r.indexOf("application/x-www-form-urlencoded") > -1)
706
- return Ln(t, this.formSerializer).toString();
705
+ return Un(t, this.formSerializer).toString();
707
706
  if ((a = c.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
708
707
  const d = this.env && this.env.FormData;
709
- return fe(
708
+ return ue(
710
709
  a ? { "files[]": t } : t,
711
710
  d && new d(),
712
711
  this.formSerializer
713
712
  );
714
713
  }
715
714
  }
716
- return o || s ? (n.setContentType("application/json", !1), In(t)) : t;
715
+ return o || s ? (n.setContentType("application/json", !1), Bn(t)) : t;
717
716
  }],
718
717
  transformResponse: [function(t) {
719
- const n = this.transitional || Z.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
718
+ const n = this.transitional || G.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
720
719
  if (c.isResponse(t) || c.isReadableStream(t))
721
720
  return t;
722
721
  if (t && c.isString(t) && (r && !this.responseType || s)) {
@@ -754,9 +753,9 @@ const Z = {
754
753
  }
755
754
  };
756
755
  c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
757
- Z.headers[e] = {};
756
+ G.headers[e] = {};
758
757
  });
759
- const jn = c.toObjectSet([
758
+ const In = c.toObjectSet([
760
759
  "age",
761
760
  "authorization",
762
761
  "content-length",
@@ -774,28 +773,28 @@ const jn = c.toObjectSet([
774
773
  "referer",
775
774
  "retry-after",
776
775
  "user-agent"
777
- ]), Mn = (e) => {
776
+ ]), jn = (e) => {
778
777
  const t = {};
779
778
  let n, r, s;
780
779
  return e && e.split(`
781
780
  `).forEach(function(i) {
782
- s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && jn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
781
+ s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && In[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
783
782
  }), t;
784
- }, Me = Symbol("internals");
785
- function J(e) {
783
+ }, je = Symbol("internals");
784
+ function v(e) {
786
785
  return e && String(e).trim().toLowerCase();
787
786
  }
788
- function oe(e) {
789
- return e === !1 || e == null ? e : c.isArray(e) ? e.map(oe) : String(e);
787
+ function se(e) {
788
+ return e === !1 || e == null ? e : c.isArray(e) ? e.map(se) : String(e);
790
789
  }
791
- function $n(e) {
790
+ function Mn(e) {
792
791
  const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
793
792
  let r;
794
793
  for (; r = n.exec(e); )
795
794
  t[r[1]] = r[2];
796
795
  return t;
797
796
  }
798
- const qn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
797
+ const $n = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
799
798
  function me(e, t, n, r, s) {
800
799
  if (c.isFunction(r))
801
800
  return r.call(this, t, n);
@@ -806,10 +805,10 @@ function me(e, t, n, r, s) {
806
805
  return r.test(t);
807
806
  }
808
807
  }
809
- function Hn(e) {
808
+ function qn(e) {
810
809
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
811
810
  }
812
- function zn(e, t) {
811
+ function Hn(e, t) {
813
812
  const n = c.toCamelCase(" " + t);
814
813
  ["get", "set", "has"].forEach((r) => {
815
814
  Object.defineProperty(e, r + n, {
@@ -827,17 +826,17 @@ let N = class {
827
826
  set(t, n, r) {
828
827
  const s = this;
829
828
  function o(a, d, u) {
830
- const l = J(d);
829
+ const l = v(d);
831
830
  if (!l)
832
831
  throw new Error("header name must be a non-empty string");
833
832
  const p = c.findKey(s, l);
834
- (!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || d] = oe(a));
833
+ (!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || d] = se(a));
835
834
  }
836
835
  const i = (a, d) => c.forEach(a, (u, l) => o(u, l, d));
837
836
  if (c.isPlainObject(t) || t instanceof this.constructor)
838
837
  i(t, n);
839
- else if (c.isString(t) && (t = t.trim()) && !qn(t))
840
- i(Mn(t), n);
838
+ else if (c.isString(t) && (t = t.trim()) && !$n(t))
839
+ i(jn(t), n);
841
840
  else if (c.isObject(t) && c.isIterable(t)) {
842
841
  let a = {}, d, u;
843
842
  for (const l of t) {
@@ -851,14 +850,14 @@ let N = class {
851
850
  return this;
852
851
  }
853
852
  get(t, n) {
854
- if (t = J(t), t) {
853
+ if (t = v(t), t) {
855
854
  const r = c.findKey(this, t);
856
855
  if (r) {
857
856
  const s = this[r];
858
857
  if (!n)
859
858
  return s;
860
859
  if (n === !0)
861
- return $n(s);
860
+ return Mn(s);
862
861
  if (c.isFunction(n))
863
862
  return n.call(this, s, r);
864
863
  if (c.isRegExp(n))
@@ -868,7 +867,7 @@ let N = class {
868
867
  }
869
868
  }
870
869
  has(t, n) {
871
- if (t = J(t), t) {
870
+ if (t = v(t), t) {
872
871
  const r = c.findKey(this, t);
873
872
  return !!(r && this[r] !== void 0 && (!n || me(this, this[r], r, n)));
874
873
  }
@@ -878,7 +877,7 @@ let N = class {
878
877
  const r = this;
879
878
  let s = !1;
880
879
  function o(i) {
881
- if (i = J(i), i) {
880
+ if (i = v(i), i) {
882
881
  const a = c.findKey(r, i);
883
882
  a && (!n || me(r, r[a], a, n)) && (delete r[a], s = !0);
884
883
  }
@@ -899,11 +898,11 @@ let N = class {
899
898
  return c.forEach(this, (s, o) => {
900
899
  const i = c.findKey(r, o);
901
900
  if (i) {
902
- n[i] = oe(s), delete n[o];
901
+ n[i] = se(s), delete n[o];
903
902
  return;
904
903
  }
905
- const a = t ? Hn(o) : String(o).trim();
906
- a !== o && delete n[o], n[a] = oe(s), r[a] = !0;
904
+ const a = t ? qn(o) : String(o).trim();
905
+ a !== o && delete n[o], n[a] = se(s), r[a] = !0;
907
906
  }), this;
908
907
  }
909
908
  concat(...t) {
@@ -936,12 +935,12 @@ let N = class {
936
935
  return n.forEach((s) => r.set(s)), r;
937
936
  }
938
937
  static accessor(t) {
939
- const r = (this[Me] = this[Me] = {
938
+ const r = (this[je] = this[je] = {
940
939
  accessors: {}
941
940
  }).accessors, s = this.prototype;
942
941
  function o(i) {
943
- const a = J(i);
944
- r[a] || (zn(s, i), r[a] = !0);
942
+ const a = v(i);
943
+ r[a] || (Hn(s, i), r[a] = !0);
945
944
  }
946
945
  return c.isArray(t) ? t.forEach(o) : o(t), this;
947
946
  }
@@ -957,17 +956,17 @@ c.reduceDescriptors(N.prototype, ({ value: e }, t) => {
957
956
  };
958
957
  });
959
958
  c.freezeMethods(N);
960
- function ye(e, t) {
961
- const n = this || Z, r = t || n, s = N.from(r.headers);
959
+ function he(e, t) {
960
+ const n = this || G, r = t || n, s = N.from(r.headers);
962
961
  let o = r.data;
963
962
  return c.forEach(e, function(a) {
964
963
  o = a.call(n, o, s.normalize(), t ? t.status : void 0);
965
964
  }), s.normalize(), o;
966
965
  }
967
- function yt(e) {
966
+ function ht(e) {
968
967
  return !!(e && e.__CANCEL__);
969
968
  }
970
- let Q = class extends w {
969
+ let Z = class extends w {
971
970
  /**
972
971
  * A `CanceledError` is an object that is thrown when an operation is canceled.
973
972
  *
@@ -981,7 +980,7 @@ let Q = class extends w {
981
980
  super(t ?? "canceled", w.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
982
981
  }
983
982
  };
984
- function wt(e, t, n) {
983
+ function yt(e, t, n) {
985
984
  const r = n.config.validateStatus;
986
985
  !n.status || !r || r(n.status) ? e(n) : t(new w(
987
986
  "Request failed with status code " + n.status,
@@ -991,27 +990,27 @@ function wt(e, t, n) {
991
990
  n
992
991
  ));
993
992
  }
994
- function vn(e) {
993
+ function zn(e) {
995
994
  const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
996
995
  return t && t[1] || "";
997
996
  }
998
- function Jn(e, t) {
997
+ function vn(e, t) {
999
998
  e = e || 10;
1000
999
  const n = new Array(e), r = new Array(e);
1001
1000
  let s = 0, o = 0, i;
1002
1001
  return t = t !== void 0 ? t : 1e3, function(d) {
1003
1002
  const u = Date.now(), l = r[o];
1004
1003
  i || (i = u), n[s] = d, r[s] = u;
1005
- let p = o, b = 0;
1004
+ let p = o, E = 0;
1006
1005
  for (; p !== s; )
1007
- b += n[p++], p = p % e;
1006
+ E += n[p++], p = p % e;
1008
1007
  if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
1009
1008
  return;
1010
1009
  const _ = l && u - l;
1011
- return _ ? Math.round(b * 1e3 / _) : void 0;
1010
+ return _ ? Math.round(E * 1e3 / _) : void 0;
1012
1011
  };
1013
1012
  }
1014
- function Kn(e, t) {
1013
+ function Jn(e, t) {
1015
1014
  let n = 0, r = 1e3 / t, s, o;
1016
1015
  const i = (u, l = Date.now()) => {
1017
1016
  n = l, s = null, o && (clearTimeout(o), o = null), e(...u);
@@ -1023,10 +1022,10 @@ function Kn(e, t) {
1023
1022
  }, r - p)));
1024
1023
  }, () => s && i(s)];
1025
1024
  }
1026
- const ae = (e, t, n = 3) => {
1025
+ const ie = (e, t, n = 3) => {
1027
1026
  let r = 0;
1028
- const s = Jn(50, 250);
1029
- return Kn((o) => {
1027
+ const s = vn(50, 250);
1028
+ return Jn((o) => {
1030
1029
  const i = o.loaded, a = o.lengthComputable ? o.total : void 0, d = i - r, u = s(d), l = i <= a;
1031
1030
  r = i;
1032
1031
  const p = {
@@ -1042,17 +1041,17 @@ const ae = (e, t, n = 3) => {
1042
1041
  };
1043
1042
  e(p);
1044
1043
  }, n);
1045
- }, $e = (e, t) => {
1044
+ }, Me = (e, t) => {
1046
1045
  const n = e != null;
1047
1046
  return [(r) => t[0]({
1048
1047
  lengthComputable: n,
1049
1048
  total: e,
1050
1049
  loaded: r
1051
1050
  }), t[1]];
1052
- }, qe = (e) => (...t) => c.asap(() => e(...t)), Vn = A.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, A.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1051
+ }, $e = (e) => (...t) => c.asap(() => e(...t)), Vn = A.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, A.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1053
1052
  new URL(A.origin),
1054
1053
  A.navigator && /(msie|trident)/i.test(A.navigator.userAgent)
1055
- ) : () => !0, Wn = A.hasStandardBrowserEnv ? (
1054
+ ) : () => !0, Kn = A.hasStandardBrowserEnv ? (
1056
1055
  // Standard browser envs support document.cookie
1057
1056
  {
1058
1057
  write(e, t, n, r, s, o, i) {
@@ -1081,28 +1080,28 @@ const ae = (e, t, n = 3) => {
1081
1080
  }
1082
1081
  }
1083
1082
  );
1084
- function Xn(e) {
1083
+ function Wn(e) {
1085
1084
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1086
1085
  }
1087
- function Gn(e, t) {
1086
+ function Xn(e, t) {
1088
1087
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1089
1088
  }
1090
- function bt(e, t, n) {
1091
- let r = !Xn(t);
1092
- return e && (r || n == !1) ? Gn(e, t) : t;
1089
+ function wt(e, t, n) {
1090
+ let r = !Wn(t);
1091
+ return e && (r || n == !1) ? Xn(e, t) : t;
1093
1092
  }
1094
- const He = (e) => e instanceof N ? { ...e } : e;
1095
- function $(e, t) {
1093
+ const qe = (e) => e instanceof N ? { ...e } : e;
1094
+ function M(e, t) {
1096
1095
  t = t || {};
1097
1096
  const n = {};
1098
- function r(u, l, p, b) {
1099
- return c.isPlainObject(u) && c.isPlainObject(l) ? c.merge.call({ caseless: b }, u, l) : c.isPlainObject(l) ? c.merge({}, l) : c.isArray(l) ? l.slice() : l;
1097
+ function r(u, l, p, E) {
1098
+ return c.isPlainObject(u) && c.isPlainObject(l) ? c.merge.call({ caseless: E }, u, l) : c.isPlainObject(l) ? c.merge({}, l) : c.isArray(l) ? l.slice() : l;
1100
1099
  }
1101
- function s(u, l, p, b) {
1100
+ function s(u, l, p, E) {
1102
1101
  if (c.isUndefined(l)) {
1103
1102
  if (!c.isUndefined(u))
1104
- return r(void 0, u, p, b);
1105
- } else return r(u, l, p, b);
1103
+ return r(void 0, u, p, E);
1104
+ } else return r(u, l, p, E);
1106
1105
  }
1107
1106
  function o(u, l) {
1108
1107
  if (!c.isUndefined(l))
@@ -1149,17 +1148,17 @@ function $(e, t) {
1149
1148
  socketPath: i,
1150
1149
  responseEncoding: i,
1151
1150
  validateStatus: a,
1152
- headers: (u, l, p) => s(He(u), He(l), p, !0)
1151
+ headers: (u, l, p) => s(qe(u), qe(l), p, !0)
1153
1152
  };
1154
1153
  return c.forEach(Object.keys({ ...e, ...t }), function(l) {
1155
- const p = d[l] || s, b = p(e[l], t[l], l);
1156
- c.isUndefined(b) && p !== a || (n[l] = b);
1154
+ const p = d[l] || s, E = p(e[l], t[l], l);
1155
+ c.isUndefined(E) && p !== a || (n[l] = E);
1157
1156
  }), n;
1158
1157
  }
1159
- const gt = (e) => {
1160
- const t = $({}, e);
1158
+ const Et = (e) => {
1159
+ const t = M({}, e);
1161
1160
  let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = t;
1162
- if (t.headers = i = N.from(i), t.url = pt(bt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1161
+ if (t.headers = i = N.from(i), t.url = dt(wt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1163
1162
  "Authorization",
1164
1163
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1165
1164
  ), c.isFormData(n)) {
@@ -1173,69 +1172,69 @@ const gt = (e) => {
1173
1172
  }
1174
1173
  }
1175
1174
  if (A.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(t)), r || r !== !1 && Vn(t.url))) {
1176
- const d = s && o && Wn.read(o);
1175
+ const d = s && o && Kn.read(o);
1177
1176
  d && i.set(s, d);
1178
1177
  }
1179
1178
  return t;
1180
- }, Zn = typeof XMLHttpRequest < "u", Qn = Zn && function(e) {
1179
+ }, Gn = typeof XMLHttpRequest < "u", Zn = Gn && function(e) {
1181
1180
  return new Promise(function(n, r) {
1182
- const s = gt(e);
1181
+ const s = Et(e);
1183
1182
  let o = s.data;
1184
1183
  const i = N.from(s.headers).normalize();
1185
- let { responseType: a, onUploadProgress: d, onDownloadProgress: u } = s, l, p, b, _, f;
1186
- function m() {
1184
+ let { responseType: a, onUploadProgress: d, onDownloadProgress: u } = s, l, p, E, _, f;
1185
+ function h() {
1187
1186
  _ && _(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1188
1187
  }
1189
- let h = new XMLHttpRequest();
1190
- h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1188
+ let m = new XMLHttpRequest();
1189
+ m.open(s.method.toUpperCase(), s.url, !0), m.timeout = s.timeout;
1191
1190
  function g() {
1192
- if (!h)
1191
+ if (!m)
1193
1192
  return;
1194
1193
  const y = N.from(
1195
- "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1194
+ "getAllResponseHeaders" in m && m.getAllResponseHeaders()
1196
1195
  ), T = {
1197
- data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1198
- status: h.status,
1199
- statusText: h.statusText,
1196
+ data: !a || a === "text" || a === "json" ? m.responseText : m.response,
1197
+ status: m.status,
1198
+ statusText: m.statusText,
1200
1199
  headers: y,
1201
1200
  config: e,
1202
- request: h
1201
+ request: m
1203
1202
  };
1204
- wt(function(P) {
1205
- n(P), m();
1206
- }, function(P) {
1207
- r(P), m();
1208
- }, T), h = null;
1203
+ yt(function(x) {
1204
+ n(x), h();
1205
+ }, function(x) {
1206
+ r(x), h();
1207
+ }, T), m = null;
1209
1208
  }
1210
- "onloadend" in h ? h.onloadend = g : h.onreadystatechange = function() {
1211
- !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(g);
1212
- }, h.onabort = function() {
1213
- h && (r(new w("Request aborted", w.ECONNABORTED, e, h)), h = null);
1214
- }, h.onerror = function(E) {
1215
- const T = E && E.message ? E.message : "Network Error", L = new w(T, w.ERR_NETWORK, e, h);
1216
- L.event = E || null, r(L), h = null;
1217
- }, h.ontimeout = function() {
1218
- let E = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1219
- const T = s.transitional || ht;
1220
- s.timeoutErrorMessage && (E = s.timeoutErrorMessage), r(new w(
1221
- E,
1209
+ "onloadend" in m ? m.onloadend = g : m.onreadystatechange = function() {
1210
+ !m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(g);
1211
+ }, m.onabort = function() {
1212
+ m && (r(new w("Request aborted", w.ECONNABORTED, e, m)), m = null);
1213
+ }, m.onerror = function(S) {
1214
+ const T = S && S.message ? S.message : "Network Error", U = new w(T, w.ERR_NETWORK, e, m);
1215
+ U.event = S || null, r(U), m = null;
1216
+ }, m.ontimeout = function() {
1217
+ let S = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1218
+ const T = s.transitional || pt;
1219
+ s.timeoutErrorMessage && (S = s.timeoutErrorMessage), r(new w(
1220
+ S,
1222
1221
  T.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
1223
1222
  e,
1224
- h
1225
- )), h = null;
1226
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in h && c.forEach(i.toJSON(), function(E, T) {
1227
- h.setRequestHeader(T, E);
1228
- }), c.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), u && ([b, f] = ae(u, !0), h.addEventListener("progress", b)), d && h.upload && ([p, _] = ae(d), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", _)), (s.cancelToken || s.signal) && (l = (y) => {
1229
- h && (r(!y || y.type ? new Q(null, e, h) : y), h.abort(), h = null);
1223
+ m
1224
+ )), m = null;
1225
+ }, o === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(S, T) {
1226
+ m.setRequestHeader(T, S);
1227
+ }), c.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), a && a !== "json" && (m.responseType = s.responseType), u && ([E, f] = ie(u, !0), m.addEventListener("progress", E)), d && m.upload && ([p, _] = ie(d), m.upload.addEventListener("progress", p), m.upload.addEventListener("loadend", _)), (s.cancelToken || s.signal) && (l = (y) => {
1228
+ m && (r(!y || y.type ? new Z(null, e, m) : y), m.abort(), m = null);
1230
1229
  }, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
1231
- const R = vn(s.url);
1230
+ const R = zn(s.url);
1232
1231
  if (R && A.protocols.indexOf(R) === -1) {
1233
1232
  r(new w("Unsupported protocol " + R + ":", w.ERR_BAD_REQUEST, e));
1234
1233
  return;
1235
1234
  }
1236
- h.send(o || null);
1235
+ m.send(o || null);
1237
1236
  });
1238
- }, Yn = (e, t) => {
1237
+ }, Qn = (e, t) => {
1239
1238
  const { length: n } = e = e ? e.filter(Boolean) : [];
1240
1239
  if (t || n) {
1241
1240
  let r = new AbortController(), s;
@@ -1243,7 +1242,7 @@ const gt = (e) => {
1243
1242
  if (!s) {
1244
1243
  s = !0, a();
1245
1244
  const l = u instanceof Error ? u : this.reason;
1246
- r.abort(l instanceof w ? l : new Q(l instanceof Error ? l.message : l));
1245
+ r.abort(l instanceof w ? l : new Z(l instanceof Error ? l.message : l));
1247
1246
  }
1248
1247
  };
1249
1248
  let i = t && setTimeout(() => {
@@ -1258,7 +1257,7 @@ const gt = (e) => {
1258
1257
  const { signal: d } = r;
1259
1258
  return d.unsubscribe = () => c.asap(a), d;
1260
1259
  }
1261
- }, er = function* (e, t) {
1260
+ }, Yn = function* (e, t) {
1262
1261
  let n = e.byteLength;
1263
1262
  if (n < t) {
1264
1263
  yield e;
@@ -1267,10 +1266,10 @@ const gt = (e) => {
1267
1266
  let r = 0, s;
1268
1267
  for (; r < n; )
1269
1268
  s = r + t, yield e.slice(r, s), r = s;
1270
- }, tr = async function* (e, t) {
1271
- for await (const n of nr(e))
1272
- yield* er(n, t);
1273
- }, nr = async function* (e) {
1269
+ }, er = async function* (e, t) {
1270
+ for await (const n of tr(e))
1271
+ yield* Yn(n, t);
1272
+ }, tr = async function* (e) {
1274
1273
  if (e[Symbol.asyncIterator]) {
1275
1274
  yield* e;
1276
1275
  return;
@@ -1286,8 +1285,8 @@ const gt = (e) => {
1286
1285
  } finally {
1287
1286
  await t.cancel();
1288
1287
  }
1289
- }, ze = (e, t, n, r) => {
1290
- const s = tr(e, t);
1288
+ }, He = (e, t, n, r) => {
1289
+ const s = er(e, t);
1291
1290
  let o = 0, i, a = (d) => {
1292
1291
  i || (i = !0, r && r(d));
1293
1292
  };
@@ -1301,8 +1300,8 @@ const gt = (e) => {
1301
1300
  }
1302
1301
  let p = l.byteLength;
1303
1302
  if (n) {
1304
- let b = o += p;
1305
- n(b);
1303
+ let E = o += p;
1304
+ n(E);
1306
1305
  }
1307
1306
  d.enqueue(new Uint8Array(l));
1308
1307
  } catch (u) {
@@ -1315,47 +1314,47 @@ const gt = (e) => {
1315
1314
  }, {
1316
1315
  highWaterMark: 2
1317
1316
  });
1318
- }, ve = 64 * 1024, { isFunction: re } = c, rr = (({ Request: e, Response: t }) => ({
1317
+ }, ze = 64 * 1024, { isFunction: ne } = c, nr = (({ Request: e, Response: t }) => ({
1319
1318
  Request: e,
1320
1319
  Response: t
1321
1320
  }))(c.global), {
1322
- ReadableStream: Je,
1323
- TextEncoder: Ke
1321
+ ReadableStream: ve,
1322
+ TextEncoder: Je
1324
1323
  } = c.global, Ve = (e, ...t) => {
1325
1324
  try {
1326
1325
  return !!e(...t);
1327
1326
  } catch {
1328
1327
  return !1;
1329
1328
  }
1330
- }, sr = (e) => {
1329
+ }, rr = (e) => {
1331
1330
  e = c.merge.call({
1332
1331
  skipUndefined: !0
1333
- }, rr, e);
1334
- const { fetch: t, Request: n, Response: r } = e, s = t ? re(t) : typeof fetch == "function", o = re(n), i = re(r);
1332
+ }, nr, e);
1333
+ const { fetch: t, Request: n, Response: r } = e, s = t ? ne(t) : typeof fetch == "function", o = ne(n), i = ne(r);
1335
1334
  if (!s)
1336
1335
  return !1;
1337
- const a = s && re(Je), d = s && (typeof Ke == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new Ke()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = o && a && Ve(() => {
1336
+ const a = s && ne(ve), d = s && (typeof Je == "function" ? /* @__PURE__ */ ((f) => (h) => f.encode(h))(new Je()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = o && a && Ve(() => {
1338
1337
  let f = !1;
1339
- const m = new n(A.origin, {
1340
- body: new Je(),
1338
+ const h = new n(A.origin, {
1339
+ body: new ve(),
1341
1340
  method: "POST",
1342
1341
  get duplex() {
1343
1342
  return f = !0, "half";
1344
1343
  }
1345
1344
  }).headers.has("Content-Type");
1346
- return f && !m;
1345
+ return f && !h;
1347
1346
  }), l = i && a && Ve(() => c.isReadableStream(new r("").body)), p = {
1348
1347
  stream: l && ((f) => f.body)
1349
1348
  };
1350
1349
  s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
1351
- !p[f] && (p[f] = (m, h) => {
1352
- let g = m && m[f];
1350
+ !p[f] && (p[f] = (h, m) => {
1351
+ let g = h && h[f];
1353
1352
  if (g)
1354
- return g.call(m);
1355
- throw new w(`Response type '${f}' is not supported`, w.ERR_NOT_SUPPORT, h);
1353
+ return g.call(h);
1354
+ throw new w(`Response type '${f}' is not supported`, w.ERR_NOT_SUPPORT, m);
1356
1355
  });
1357
1356
  });
1358
- const b = async (f) => {
1357
+ const E = async (f) => {
1359
1358
  if (f == null)
1360
1359
  return 0;
1361
1360
  if (c.isBlob(f))
@@ -1369,117 +1368,117 @@ const gt = (e) => {
1369
1368
  return f.byteLength;
1370
1369
  if (c.isURLSearchParams(f) && (f = f + ""), c.isString(f))
1371
1370
  return (await d(f)).byteLength;
1372
- }, _ = async (f, m) => {
1373
- const h = c.toFiniteNumber(f.getContentLength());
1374
- return h ?? b(m);
1371
+ }, _ = async (f, h) => {
1372
+ const m = c.toFiniteNumber(f.getContentLength());
1373
+ return m ?? E(h);
1375
1374
  };
1376
1375
  return async (f) => {
1377
1376
  let {
1378
- url: m,
1379
- method: h,
1377
+ url: h,
1378
+ method: m,
1380
1379
  data: g,
1381
1380
  signal: R,
1382
1381
  cancelToken: y,
1383
- timeout: E,
1382
+ timeout: S,
1384
1383
  onDownloadProgress: T,
1385
- onUploadProgress: L,
1386
- responseType: P,
1387
- headers: pe,
1388
- withCredentials: Y = "same-origin",
1389
- fetchOptions: Ne
1390
- } = gt(f), xe = t || fetch;
1391
- P = P ? (P + "").toLowerCase() : "text";
1392
- let ee = Yn([R, y && y.toAbortSignal()], E), v = null;
1393
- const I = ee && ee.unsubscribe && (() => {
1394
- ee.unsubscribe();
1384
+ onUploadProgress: U,
1385
+ responseType: x,
1386
+ headers: de,
1387
+ withCredentials: Q = "same-origin",
1388
+ fetchOptions: Ce
1389
+ } = Et(f), Ne = t || fetch;
1390
+ x = x ? (x + "").toLowerCase() : "text";
1391
+ let Y = Qn([R, y && y.toAbortSignal()], S), z = null;
1392
+ const B = Y && Y.unsubscribe && (() => {
1393
+ Y.unsubscribe();
1395
1394
  });
1396
- let Pe;
1395
+ let xe;
1397
1396
  try {
1398
- if (L && u && h !== "get" && h !== "head" && (Pe = await _(pe, g)) !== 0) {
1399
- let B = new n(m, {
1397
+ if (U && u && m !== "get" && m !== "head" && (xe = await _(de, g)) !== 0) {
1398
+ let k = new n(h, {
1400
1399
  method: "POST",
1401
1400
  body: g,
1402
1401
  duplex: "half"
1403
- }), q;
1404
- if (c.isFormData(g) && (q = B.headers.get("content-type")) && pe.setContentType(q), B.body) {
1405
- const [he, te] = $e(
1406
- Pe,
1407
- ae(qe(L))
1402
+ }), $;
1403
+ if (c.isFormData(g) && ($ = k.headers.get("content-type")) && de.setContentType($), k.body) {
1404
+ const [pe, ee] = Me(
1405
+ xe,
1406
+ ie($e(U))
1408
1407
  );
1409
- g = ze(B.body, ve, he, te);
1408
+ g = He(k.body, ze, pe, ee);
1410
1409
  }
1411
1410
  }
1412
- c.isString(Y) || (Y = Y ? "include" : "omit");
1413
- const F = o && "credentials" in n.prototype, De = {
1414
- ...Ne,
1415
- signal: ee,
1416
- method: h.toUpperCase(),
1417
- headers: pe.normalize().toJSON(),
1411
+ c.isString(Q) || (Q = Q ? "include" : "omit");
1412
+ const D = o && "credentials" in n.prototype, Pe = {
1413
+ ...Ce,
1414
+ signal: Y,
1415
+ method: m.toUpperCase(),
1416
+ headers: de.normalize().toJSON(),
1418
1417
  body: g,
1419
1418
  duplex: "half",
1420
- credentials: F ? Y : void 0
1419
+ credentials: D ? Q : void 0
1421
1420
  };
1422
- v = o && new n(m, De);
1423
- let k = await (o ? xe(v, Ne) : xe(m, De));
1424
- const Fe = l && (P === "stream" || P === "response");
1425
- if (l && (T || Fe && I)) {
1426
- const B = {};
1427
- ["status", "statusText", "headers"].forEach((Ue) => {
1428
- B[Ue] = k[Ue];
1421
+ z = o && new n(h, Pe);
1422
+ let L = await (o ? Ne(z, Ce) : Ne(h, Pe));
1423
+ const De = l && (x === "stream" || x === "response");
1424
+ if (l && (T || De && B)) {
1425
+ const k = {};
1426
+ ["status", "statusText", "headers"].forEach((Fe) => {
1427
+ k[Fe] = L[Fe];
1429
1428
  });
1430
- const q = c.toFiniteNumber(k.headers.get("content-length")), [he, te] = T && $e(
1431
- q,
1432
- ae(qe(T), !0)
1429
+ const $ = c.toFiniteNumber(L.headers.get("content-length")), [pe, ee] = T && Me(
1430
+ $,
1431
+ ie($e(T), !0)
1433
1432
  ) || [];
1434
- k = new r(
1435
- ze(k.body, ve, he, () => {
1436
- te && te(), I && I();
1433
+ L = new r(
1434
+ He(L.body, ze, pe, () => {
1435
+ ee && ee(), B && B();
1437
1436
  }),
1438
- B
1437
+ k
1439
1438
  );
1440
1439
  }
1441
- P = P || "text";
1442
- let At = await p[c.findKey(p, P) || "text"](k, f);
1443
- return !Fe && I && I(), await new Promise((B, q) => {
1444
- wt(B, q, {
1445
- data: At,
1446
- headers: N.from(k.headers),
1447
- status: k.status,
1448
- statusText: k.statusText,
1440
+ x = x || "text";
1441
+ let _t = await p[c.findKey(p, x) || "text"](L, f);
1442
+ return !De && B && B(), await new Promise((k, $) => {
1443
+ yt(k, $, {
1444
+ data: _t,
1445
+ headers: N.from(L.headers),
1446
+ status: L.status,
1447
+ statusText: L.statusText,
1449
1448
  config: f,
1450
- request: v
1449
+ request: z
1451
1450
  });
1452
1451
  });
1453
- } catch (F) {
1454
- throw I && I(), F && F.name === "TypeError" && /Load failed|fetch/i.test(F.message) ? Object.assign(
1455
- new w("Network Error", w.ERR_NETWORK, f, v),
1452
+ } catch (D) {
1453
+ throw B && B(), D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message) ? Object.assign(
1454
+ new w("Network Error", w.ERR_NETWORK, f, z),
1456
1455
  {
1457
- cause: F.cause || F
1456
+ cause: D.cause || D
1458
1457
  }
1459
- ) : w.from(F, F && F.code, f, v);
1458
+ ) : w.from(D, D && D.code, f, z);
1460
1459
  }
1461
1460
  };
1462
- }, or = /* @__PURE__ */ new Map(), Et = (e) => {
1461
+ }, sr = /* @__PURE__ */ new Map(), bt = (e) => {
1463
1462
  let t = e && e.env || {};
1464
1463
  const { fetch: n, Request: r, Response: s } = t, o = [
1465
1464
  r,
1466
1465
  s,
1467
1466
  n
1468
1467
  ];
1469
- let i = o.length, a = i, d, u, l = or;
1468
+ let i = o.length, a = i, d, u, l = sr;
1470
1469
  for (; a--; )
1471
- d = o[a], u = l.get(d), u === void 0 && l.set(d, u = a ? /* @__PURE__ */ new Map() : sr(t)), l = u;
1470
+ d = o[a], u = l.get(d), u === void 0 && l.set(d, u = a ? /* @__PURE__ */ new Map() : rr(t)), l = u;
1472
1471
  return u;
1473
1472
  };
1474
- Et();
1475
- const Ce = {
1476
- http: Rn,
1477
- xhr: Qn,
1473
+ bt();
1474
+ const Te = {
1475
+ http: Sn,
1476
+ xhr: Zn,
1478
1477
  fetch: {
1479
- get: Et
1478
+ get: bt
1480
1479
  }
1481
1480
  };
1482
- c.forEach(Ce, (e, t) => {
1481
+ c.forEach(Te, (e, t) => {
1483
1482
  if (e) {
1484
1483
  try {
1485
1484
  Object.defineProperty(e, "name", { value: t });
@@ -1488,8 +1487,8 @@ c.forEach(Ce, (e, t) => {
1488
1487
  Object.defineProperty(e, "adapterName", { value: t });
1489
1488
  }
1490
1489
  });
1491
- const We = (e) => `- ${e}`, ir = (e) => c.isFunction(e) || e === null || e === !1;
1492
- function ar(e, t) {
1490
+ const Ke = (e) => `- ${e}`, or = (e) => c.isFunction(e) || e === null || e === !1;
1491
+ function ir(e, t) {
1493
1492
  e = c.isArray(e) ? e : [e];
1494
1493
  const { length: n } = e;
1495
1494
  let r, s;
@@ -1497,7 +1496,7 @@ function ar(e, t) {
1497
1496
  for (let i = 0; i < n; i++) {
1498
1497
  r = e[i];
1499
1498
  let a;
1500
- if (s = r, !ir(r) && (s = Ce[(a = String(r)).toLowerCase()], s === void 0))
1499
+ if (s = r, !or(r) && (s = Te[(a = String(r)).toLowerCase()], s === void 0))
1501
1500
  throw new w(`Unknown adapter '${a}'`);
1502
1501
  if (s && (c.isFunction(s) || (s = s.get(t))))
1503
1502
  break;
@@ -1508,8 +1507,8 @@ function ar(e, t) {
1508
1507
  ([d, u]) => `adapter ${d} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
1509
1508
  );
1510
1509
  let a = n ? i.length > 1 ? `since :
1511
- ` + i.map(We).join(`
1512
- `) : " " + We(i[0]) : "as no adapter specified";
1510
+ ` + i.map(Ke).join(`
1511
+ `) : " " + Ke(i[0]) : "as no adapter specified";
1513
1512
  throw new w(
1514
1513
  "There is no suitable adapter to dispatch the request " + a,
1515
1514
  "ERR_NOT_SUPPORT"
@@ -1517,50 +1516,50 @@ function ar(e, t) {
1517
1516
  }
1518
1517
  return s;
1519
1518
  }
1520
- const St = {
1519
+ const gt = {
1521
1520
  /**
1522
1521
  * Resolve an adapter from a list of adapter names or functions.
1523
1522
  * @type {Function}
1524
1523
  */
1525
- getAdapter: ar,
1524
+ getAdapter: ir,
1526
1525
  /**
1527
1526
  * Exposes all known adapters
1528
1527
  * @type {Object<string, Function|Object>}
1529
1528
  */
1530
- adapters: Ce
1529
+ adapters: Te
1531
1530
  };
1532
- function we(e) {
1531
+ function ye(e) {
1533
1532
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1534
- throw new Q(null, e);
1533
+ throw new Z(null, e);
1535
1534
  }
1536
- function Xe(e) {
1537
- return we(e), e.headers = N.from(e.headers), e.data = ye.call(
1535
+ function We(e) {
1536
+ return ye(e), e.headers = N.from(e.headers), e.data = he.call(
1538
1537
  e,
1539
1538
  e.transformRequest
1540
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), St.getAdapter(e.adapter || Z.adapter, e)(e).then(function(r) {
1541
- return we(e), r.data = ye.call(
1539
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter || G.adapter, e)(e).then(function(r) {
1540
+ return ye(e), r.data = he.call(
1542
1541
  e,
1543
1542
  e.transformResponse,
1544
1543
  r
1545
1544
  ), r.headers = N.from(r.headers), r;
1546
1545
  }, function(r) {
1547
- return yt(r) || (we(e), r && r.response && (r.response.data = ye.call(
1546
+ return ht(r) || (ye(e), r && r.response && (r.response.data = he.call(
1548
1547
  e,
1549
1548
  e.transformResponse,
1550
1549
  r.response
1551
1550
  ), r.response.headers = N.from(r.response.headers))), Promise.reject(r);
1552
1551
  });
1553
1552
  }
1554
- const Rt = "1.13.4", de = {};
1553
+ const St = "1.13.4", fe = {};
1555
1554
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1556
- de[e] = function(r) {
1555
+ fe[e] = function(r) {
1557
1556
  return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1558
1557
  };
1559
1558
  });
1560
- const Ge = {};
1561
- de.transitional = function(t, n, r) {
1559
+ const Xe = {};
1560
+ fe.transitional = function(t, n, r) {
1562
1561
  function s(o, i) {
1563
- return "[Axios v" + Rt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1562
+ return "[Axios v" + St + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1564
1563
  }
1565
1564
  return (o, i, a) => {
1566
1565
  if (t === !1)
@@ -1568,7 +1567,7 @@ de.transitional = function(t, n, r) {
1568
1567
  s(i, " has been removed" + (n ? " in " + n : "")),
1569
1568
  w.ERR_DEPRECATED
1570
1569
  );
1571
- return n && !Ge[i] && (Ge[i] = !0, console.warn(
1570
+ return n && !Xe[i] && (Xe[i] = !0, console.warn(
1572
1571
  s(
1573
1572
  i,
1574
1573
  " has been deprecated since v" + n + " and will be removed in the near future"
@@ -1576,10 +1575,10 @@ de.transitional = function(t, n, r) {
1576
1575
  )), t ? t(o, i, a) : !0;
1577
1576
  };
1578
1577
  };
1579
- de.spelling = function(t) {
1578
+ fe.spelling = function(t) {
1580
1579
  return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1581
1580
  };
1582
- function cr(e, t, n) {
1581
+ function ar(e, t, n) {
1583
1582
  if (typeof e != "object")
1584
1583
  throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
1585
1584
  const r = Object.keys(e);
@@ -1596,15 +1595,15 @@ function cr(e, t, n) {
1596
1595
  throw new w("Unknown option " + o, w.ERR_BAD_OPTION);
1597
1596
  }
1598
1597
  }
1599
- const ie = {
1600
- assertOptions: cr,
1601
- validators: de
1602
- }, U = ie.validators;
1603
- let M = class {
1598
+ const oe = {
1599
+ assertOptions: ar,
1600
+ validators: fe
1601
+ }, F = oe.validators;
1602
+ let j = class {
1604
1603
  constructor(t) {
1605
1604
  this.defaults = t || {}, this.interceptors = {
1606
- request: new je(),
1607
- response: new je()
1605
+ request: new Ie(),
1606
+ response: new Ie()
1608
1607
  };
1609
1608
  }
1610
1609
  /**
@@ -1633,20 +1632,20 @@ let M = class {
1633
1632
  }
1634
1633
  }
1635
1634
  _request(t, n) {
1636
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = $(this.defaults, n);
1635
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = M(this.defaults, n);
1637
1636
  const { transitional: r, paramsSerializer: s, headers: o } = n;
1638
- r !== void 0 && ie.assertOptions(r, {
1639
- silentJSONParsing: U.transitional(U.boolean),
1640
- forcedJSONParsing: U.transitional(U.boolean),
1641
- clarifyTimeoutError: U.transitional(U.boolean)
1637
+ r !== void 0 && oe.assertOptions(r, {
1638
+ silentJSONParsing: F.transitional(F.boolean),
1639
+ forcedJSONParsing: F.transitional(F.boolean),
1640
+ clarifyTimeoutError: F.transitional(F.boolean)
1642
1641
  }, !1), s != null && (c.isFunction(s) ? n.paramsSerializer = {
1643
1642
  serialize: s
1644
- } : ie.assertOptions(s, {
1645
- encode: U.function,
1646
- serialize: U.function
1647
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ie.assertOptions(n, {
1648
- baseUrl: U.spelling("baseURL"),
1649
- withXsrfToken: U.spelling("withXSRFToken")
1643
+ } : oe.assertOptions(s, {
1644
+ encode: F.function,
1645
+ serialize: F.function
1646
+ }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), oe.assertOptions(n, {
1647
+ baseUrl: F.spelling("baseURL"),
1648
+ withXsrfToken: F.spelling("withXSRFToken")
1650
1649
  }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1651
1650
  let i = o && c.merge(
1652
1651
  o.common,
@@ -1660,49 +1659,49 @@ let M = class {
1660
1659
  ), n.headers = N.concat(i, o);
1661
1660
  const a = [];
1662
1661
  let d = !0;
1663
- this.interceptors.request.forEach(function(m) {
1664
- typeof m.runWhen == "function" && m.runWhen(n) === !1 || (d = d && m.synchronous, a.unshift(m.fulfilled, m.rejected));
1662
+ this.interceptors.request.forEach(function(h) {
1663
+ typeof h.runWhen == "function" && h.runWhen(n) === !1 || (d = d && h.synchronous, a.unshift(h.fulfilled, h.rejected));
1665
1664
  });
1666
1665
  const u = [];
1667
- this.interceptors.response.forEach(function(m) {
1668
- u.push(m.fulfilled, m.rejected);
1666
+ this.interceptors.response.forEach(function(h) {
1667
+ u.push(h.fulfilled, h.rejected);
1669
1668
  });
1670
- let l, p = 0, b;
1669
+ let l, p = 0, E;
1671
1670
  if (!d) {
1672
- const f = [Xe.bind(this), void 0];
1673
- for (f.unshift(...a), f.push(...u), b = f.length, l = Promise.resolve(n); p < b; )
1671
+ const f = [We.bind(this), void 0];
1672
+ for (f.unshift(...a), f.push(...u), E = f.length, l = Promise.resolve(n); p < E; )
1674
1673
  l = l.then(f[p++], f[p++]);
1675
1674
  return l;
1676
1675
  }
1677
- b = a.length;
1676
+ E = a.length;
1678
1677
  let _ = n;
1679
- for (; p < b; ) {
1680
- const f = a[p++], m = a[p++];
1678
+ for (; p < E; ) {
1679
+ const f = a[p++], h = a[p++];
1681
1680
  try {
1682
1681
  _ = f(_);
1683
- } catch (h) {
1684
- m.call(this, h);
1682
+ } catch (m) {
1683
+ h.call(this, m);
1685
1684
  break;
1686
1685
  }
1687
1686
  }
1688
1687
  try {
1689
- l = Xe.call(this, _);
1688
+ l = We.call(this, _);
1690
1689
  } catch (f) {
1691
1690
  return Promise.reject(f);
1692
1691
  }
1693
- for (p = 0, b = u.length; p < b; )
1692
+ for (p = 0, E = u.length; p < E; )
1694
1693
  l = l.then(u[p++], u[p++]);
1695
1694
  return l;
1696
1695
  }
1697
1696
  getUri(t) {
1698
- t = $(this.defaults, t);
1699
- const n = bt(t.baseURL, t.url, t.allowAbsoluteUrls);
1700
- return pt(n, t.params, t.paramsSerializer);
1697
+ t = M(this.defaults, t);
1698
+ const n = wt(t.baseURL, t.url, t.allowAbsoluteUrls);
1699
+ return dt(n, t.params, t.paramsSerializer);
1701
1700
  }
1702
1701
  };
1703
1702
  c.forEach(["delete", "get", "head", "options"], function(t) {
1704
- M.prototype[t] = function(n, r) {
1705
- return this.request($(r || {}, {
1703
+ j.prototype[t] = function(n, r) {
1704
+ return this.request(M(r || {}, {
1706
1705
  method: t,
1707
1706
  url: n,
1708
1707
  data: (r || {}).data
@@ -1712,7 +1711,7 @@ c.forEach(["delete", "get", "head", "options"], function(t) {
1712
1711
  c.forEach(["post", "put", "patch"], function(t) {
1713
1712
  function n(r) {
1714
1713
  return function(o, i, a) {
1715
- return this.request($(a || {}, {
1714
+ return this.request(M(a || {}, {
1716
1715
  method: t,
1717
1716
  headers: r ? {
1718
1717
  "Content-Type": "multipart/form-data"
@@ -1722,9 +1721,9 @@ c.forEach(["post", "put", "patch"], function(t) {
1722
1721
  }));
1723
1722
  };
1724
1723
  }
1725
- M.prototype[t] = n(), M.prototype[t + "Form"] = n(!0);
1724
+ j.prototype[t] = n(), j.prototype[t + "Form"] = n(!0);
1726
1725
  });
1727
- let lr = class Ot {
1726
+ let cr = class Rt {
1728
1727
  constructor(t) {
1729
1728
  if (typeof t != "function")
1730
1729
  throw new TypeError("executor must be a function.");
@@ -1748,7 +1747,7 @@ let lr = class Ot {
1748
1747
  r.unsubscribe(o);
1749
1748
  }, i;
1750
1749
  }, t(function(o, i, a) {
1751
- r.reason || (r.reason = new Q(o, i, a), n(r.reason));
1750
+ r.reason || (r.reason = new Z(o, i, a), n(r.reason));
1752
1751
  });
1753
1752
  }
1754
1753
  /**
@@ -1790,22 +1789,22 @@ let lr = class Ot {
1790
1789
  static source() {
1791
1790
  let t;
1792
1791
  return {
1793
- token: new Ot(function(s) {
1792
+ token: new Rt(function(s) {
1794
1793
  t = s;
1795
1794
  }),
1796
1795
  cancel: t
1797
1796
  };
1798
1797
  }
1799
1798
  };
1800
- function ur(e) {
1799
+ function lr(e) {
1801
1800
  return function(n) {
1802
1801
  return e.apply(null, n);
1803
1802
  };
1804
1803
  }
1805
- function fr(e) {
1804
+ function ur(e) {
1806
1805
  return c.isObject(e) && e.isAxiosError === !0;
1807
1806
  }
1808
- const Re = {
1807
+ const Se = {
1809
1808
  Continue: 100,
1810
1809
  SwitchingProtocols: 101,
1811
1810
  Processing: 102,
@@ -1876,56 +1875,56 @@ const Re = {
1876
1875
  SslHandshakeFailed: 525,
1877
1876
  InvalidSslCertificate: 526
1878
1877
  };
1879
- Object.entries(Re).forEach(([e, t]) => {
1880
- Re[t] = e;
1878
+ Object.entries(Se).forEach(([e, t]) => {
1879
+ Se[t] = e;
1881
1880
  });
1882
- function _t(e) {
1883
- const t = new M(e), n = nt(M.prototype.request, t);
1884
- return c.extend(n, M.prototype, t, { allOwnKeys: !0 }), c.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1885
- return _t($(e, s));
1881
+ function Ot(e) {
1882
+ const t = new j(e), n = tt(j.prototype.request, t);
1883
+ return c.extend(n, j.prototype, t, { allOwnKeys: !0 }), c.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1884
+ return Ot(M(e, s));
1886
1885
  }, n;
1887
1886
  }
1888
- const O = _t(Z);
1889
- O.Axios = M;
1890
- O.CanceledError = Q;
1891
- O.CancelToken = lr;
1892
- O.isCancel = yt;
1893
- O.VERSION = Rt;
1894
- O.toFormData = fe;
1887
+ const O = Ot(G);
1888
+ O.Axios = j;
1889
+ O.CanceledError = Z;
1890
+ O.CancelToken = cr;
1891
+ O.isCancel = ht;
1892
+ O.VERSION = St;
1893
+ O.toFormData = ue;
1895
1894
  O.AxiosError = w;
1896
1895
  O.Cancel = O.CanceledError;
1897
1896
  O.all = function(t) {
1898
1897
  return Promise.all(t);
1899
1898
  };
1900
- O.spread = ur;
1901
- O.isAxiosError = fr;
1902
- O.mergeConfig = $;
1899
+ O.spread = lr;
1900
+ O.isAxiosError = ur;
1901
+ O.mergeConfig = M;
1903
1902
  O.AxiosHeaders = N;
1904
1903
  O.formToJSON = (e) => mt(c.isHTMLForm(e) ? new FormData(e) : e);
1905
- O.getAdapter = St.getAdapter;
1906
- O.HttpStatusCode = Re;
1904
+ O.getAdapter = gt.getAdapter;
1905
+ O.HttpStatusCode = Se;
1907
1906
  O.default = O;
1908
1907
  const {
1909
- Axios: Tr,
1910
- AxiosError: Cr,
1911
- CanceledError: Nr,
1912
- isCancel: xr,
1913
- CancelToken: Pr,
1914
- VERSION: Dr,
1915
- all: Fr,
1916
- Cancel: Ur,
1917
- isAxiosError: Lr,
1918
- spread: kr,
1919
- toFormData: Br,
1920
- AxiosHeaders: Ir,
1921
- HttpStatusCode: jr,
1922
- formToJSON: Mr,
1923
- getAdapter: $r,
1924
- mergeConfig: qr
1925
- } = O, dr = "http://localhost:8000/api";
1926
- class pr {
1927
- constructor(t, n = dr) {
1928
- Le(this, "client");
1908
+ Axios: _r,
1909
+ AxiosError: Ar,
1910
+ CanceledError: Tr,
1911
+ isCancel: Cr,
1912
+ CancelToken: Nr,
1913
+ VERSION: xr,
1914
+ all: Pr,
1915
+ Cancel: Dr,
1916
+ isAxiosError: Fr,
1917
+ spread: Ur,
1918
+ toFormData: Lr,
1919
+ AxiosHeaders: kr,
1920
+ HttpStatusCode: Br,
1921
+ formToJSON: Ir,
1922
+ getAdapter: jr,
1923
+ mergeConfig: Mr
1924
+ } = O, fr = "http://localhost:8000/api";
1925
+ class dr {
1926
+ constructor(t, n = fr) {
1927
+ Ue(this, "client");
1929
1928
  this.client = O.create({
1930
1929
  baseURL: n,
1931
1930
  headers: {
@@ -1989,8 +1988,8 @@ class pr {
1989
1988
  this.client.defaults.baseURL = t;
1990
1989
  }
1991
1990
  }
1992
- function Ze(e, t) {
1993
- const [n, r] = K(() => {
1991
+ function Ge(e, t) {
1992
+ const [n, r] = J(() => {
1994
1993
  try {
1995
1994
  const o = window.localStorage.getItem(e);
1996
1995
  return o ? JSON.parse(o) : t;
@@ -2007,23 +2006,23 @@ function Ze(e, t) {
2007
2006
  }
2008
2007
  }];
2009
2008
  }
2010
- function Qe() {
2009
+ function Ze() {
2011
2010
  return `session_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
2012
2011
  }
2013
- const hr = "customer_support_session_id", mr = "customer_support_messages";
2014
- function yr(e) {
2015
- const { apiKey: t, baseUrl: n, onError: r } = e, [s, o] = Ze(mr, []), [i, a] = Ze(
2016
- hr,
2017
- Qe()
2018
- ), [d, u] = K(!1), [l, p] = K(null), b = et(null);
2019
- Oe(() => {
2020
- b.current = new pr(t, n);
2012
+ const pr = "customer_support_session_id", mr = "customer_support_messages";
2013
+ function hr(e) {
2014
+ const { apiKey: t, baseUrl: n, onError: r } = e, [s, o] = Ge(mr, []), [i, a] = Ge(
2015
+ pr,
2016
+ Ze()
2017
+ ), [d, u] = J(!1), [l, p] = J(null), E = Ye(null);
2018
+ Re(() => {
2019
+ E.current = new dr(t, n);
2021
2020
  }, [t, n]);
2022
- const _ = ne(() => {
2021
+ const _ = te(() => {
2023
2022
  p(null);
2024
- }, []), f = ne(
2023
+ }, []), f = te(
2025
2024
  async (g) => {
2026
- if (!b.current) {
2025
+ if (!E.current) {
2027
2026
  const y = new Error("API client not initialized");
2028
2027
  p(y), r == null || r(y);
2029
2028
  return;
@@ -2038,35 +2037,35 @@ function yr(e) {
2038
2037
  };
2039
2038
  o((y) => [...y, R]), u(!0), p(null);
2040
2039
  try {
2041
- const y = await b.current.sendMessage(g, i), E = {
2040
+ const y = await E.current.sendMessage(g, i), S = {
2042
2041
  id: `assistant_${Date.now()}`,
2043
2042
  role: "ASSISTANT",
2044
2043
  content: y.answer,
2045
2044
  timestamp: /* @__PURE__ */ new Date(),
2046
2045
  sources: y.sources
2047
2046
  };
2048
- o((T) => [...T, E]), y.session_id !== i && a(y.session_id);
2047
+ o((T) => [...T, S]), y.session_id !== i && a(y.session_id);
2049
2048
  } catch (y) {
2050
- const E = y instanceof Error ? y : new Error("Failed to send message");
2051
- p(E), r == null || r(E);
2049
+ const S = y instanceof Error ? y : new Error("Failed to send message");
2050
+ p(S), r == null || r(S);
2052
2051
  const T = {
2053
2052
  id: `error_${Date.now()}`,
2054
2053
  role: "ASSISTANT",
2055
- content: `Sorry, I encountered an error: ${E.message}`,
2054
+ content: `Sorry, I encountered an error: ${S.message}`,
2056
2055
  timestamp: /* @__PURE__ */ new Date()
2057
2056
  };
2058
- o((L) => [...L, T]);
2057
+ o((U) => [...U, T]);
2059
2058
  } finally {
2060
2059
  u(!1);
2061
2060
  }
2062
2061
  },
2063
2062
  [i, r, o, a]
2064
- ), m = ne(async () => {
2065
- if (!(!b.current || !i)) {
2063
+ ), h = te(async () => {
2064
+ if (!(!E.current || !i)) {
2066
2065
  u(!0), p(null);
2067
2066
  try {
2068
- const R = (await b.current.getConversationHistory(i)).messages.map((y, E) => ({
2069
- id: `${y.role.toLowerCase()}_${E}_${Date.now()}`,
2067
+ const R = (await E.current.getConversationHistory(i)).messages.map((y, S) => ({
2068
+ id: `${y.role.toLowerCase()}_${S}_${Date.now()}`,
2070
2069
  role: y.role,
2071
2070
  content: y.content,
2072
2071
  timestamp: new Date(y.created_at)
@@ -2079,8 +2078,8 @@ function yr(e) {
2079
2078
  u(!1);
2080
2079
  }
2081
2080
  }
2082
- }, [i, r, o]), h = ne(() => {
2083
- o([]), a(Qe());
2081
+ }, [i, r, o]), m = te(() => {
2082
+ o([]), a(Ze());
2084
2083
  }, [o, a]);
2085
2084
  return {
2086
2085
  messages: s,
@@ -2089,76 +2088,56 @@ function yr(e) {
2089
2088
  error: l,
2090
2089
  clearError: _,
2091
2090
  sessionId: i,
2092
- loadHistory: m,
2093
- clearHistory: h
2091
+ loadHistory: h,
2092
+ clearHistory: m
2094
2093
  };
2095
2094
  }
2096
- const wr = ({ message: e }) => {
2095
+ const yr = ({ message: e }) => {
2097
2096
  const t = e.role === "USER", n = e.timestamp instanceof Date ? e.timestamp : new Date(e.timestamp);
2098
- return /* @__PURE__ */ x("div", { className: `cs-message ${t ? "cs-message--user" : "cs-message--assistant"}`, children: [
2099
- /* @__PURE__ */ x("div", { className: "cs-message__content", children: [
2100
- /* @__PURE__ */ S("p", { className: "cs-message__text", children: e.content }),
2101
- e.sources && e.sources.length > 0 && /* @__PURE__ */ x("div", { className: "cs-message__sources", children: [
2102
- /* @__PURE__ */ S("p", { className: "cs-message__sources-title", children: "Sources:" }),
2103
- /* @__PURE__ */ S("ul", { className: "cs-message__sources-list", children: e.sources.map((r, s) => /* @__PURE__ */ x("li", { className: "cs-message__source-item", children: [
2104
- /* @__PURE__ */ x(
2105
- "a",
2106
- {
2107
- href: r.url,
2108
- target: "_blank",
2109
- rel: "noopener noreferrer",
2110
- className: "cs-message__source-link",
2111
- children: [
2112
- /* @__PURE__ */ S(Dt, { size: 12 }),
2113
- /* @__PURE__ */ S("span", { children: r.title })
2114
- ]
2115
- }
2116
- ),
2117
- /* @__PURE__ */ x("span", { className: "cs-message__source-similarity", children: [
2118
- Math.round(r.similarity * 100),
2119
- "% match"
2120
- ] })
2121
- ] }, s)) })
2122
- ] })
2123
- ] }),
2124
- /* @__PURE__ */ S("time", { className: "cs-message__time", dateTime: n.toISOString(), children: n.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) })
2125
- ] });
2126
- }, br = ({
2097
+ return /* @__PURE__ */ b.createElement("div", { className: `cs-message ${t ? "cs-message--user" : "cs-message--assistant"}` }, /* @__PURE__ */ b.createElement("div", { className: "cs-message__content" }, /* @__PURE__ */ b.createElement("p", { className: "cs-message__text" }, e.content), e.sources && e.sources.length > 0 && /* @__PURE__ */ b.createElement("div", { className: "cs-message__sources" }, /* @__PURE__ */ b.createElement("p", { className: "cs-message__sources-title" }, "Sources:"), /* @__PURE__ */ b.createElement("ul", { className: "cs-message__sources-list" }, e.sources.map((r, s) => /* @__PURE__ */ b.createElement("li", { key: s, className: "cs-message__source-item" }, /* @__PURE__ */ b.createElement(
2098
+ "a",
2099
+ {
2100
+ href: r.url,
2101
+ target: "_blank",
2102
+ rel: "noopener noreferrer",
2103
+ className: "cs-message__source-link"
2104
+ },
2105
+ /* @__PURE__ */ b.createElement(Pt, { size: 12 }),
2106
+ /* @__PURE__ */ b.createElement("span", null, r.title)
2107
+ ), /* @__PURE__ */ b.createElement("span", { className: "cs-message__source-similarity" }, Math.round(r.similarity * 100), "% match")))))), /* @__PURE__ */ b.createElement("time", { className: "cs-message__time", dateTime: n.toISOString() }, n.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })));
2108
+ }, wr = ({
2127
2109
  onSendMessage: e,
2128
2110
  isLoading: t,
2129
2111
  placeholder: n = "Type your message..."
2130
2112
  }) => {
2131
- const [r, s] = K(""), o = (a) => {
2113
+ const [r, s] = J(""), o = (a) => {
2132
2114
  a.preventDefault(), r.trim() && !t && (e(r), s(""));
2115
+ }, i = (a) => {
2116
+ a.key === "Enter" && !a.shiftKey && (a.preventDefault(), o(a));
2133
2117
  };
2134
- return /* @__PURE__ */ x("form", { className: "cs-input", onSubmit: o, children: [
2135
- /* @__PURE__ */ S(
2136
- "textarea",
2137
- {
2138
- className: "cs-input__textarea",
2139
- value: r,
2140
- onChange: (a) => s(a.target.value),
2141
- onKeyDown: (a) => {
2142
- a.key === "Enter" && !a.shiftKey && (a.preventDefault(), o(a));
2143
- },
2144
- placeholder: n,
2145
- disabled: t,
2146
- rows: 1,
2147
- "aria-label": "Message input"
2148
- }
2149
- ),
2150
- /* @__PURE__ */ S(
2151
- "button",
2152
- {
2153
- type: "submit",
2154
- className: "cs-input__button",
2155
- disabled: !r.trim() || t,
2156
- "aria-label": "Send message",
2157
- children: /* @__PURE__ */ S(Lt, { size: 20 })
2158
- }
2159
- )
2160
- ] });
2161
- }, gr = ({
2118
+ return /* @__PURE__ */ b.createElement("form", { className: "cs-input", onSubmit: o }, /* @__PURE__ */ b.createElement(
2119
+ "textarea",
2120
+ {
2121
+ className: "cs-input__textarea",
2122
+ value: r,
2123
+ onChange: (a) => s(a.target.value),
2124
+ onKeyDown: i,
2125
+ placeholder: n,
2126
+ disabled: t,
2127
+ rows: 1,
2128
+ "aria-label": "Message input"
2129
+ }
2130
+ ), /* @__PURE__ */ b.createElement(
2131
+ "button",
2132
+ {
2133
+ type: "submit",
2134
+ className: "cs-input__button",
2135
+ disabled: !r.trim() || t,
2136
+ "aria-label": "Send message"
2137
+ },
2138
+ /* @__PURE__ */ b.createElement(Ut, { size: 20 })
2139
+ ));
2140
+ }, Er = ({
2162
2141
  messages: e,
2163
2142
  onSendMessage: t,
2164
2143
  onClose: n,
@@ -2167,43 +2146,27 @@ const wr = ({ message: e }) => {
2167
2146
  placeholder: o,
2168
2147
  welcomeMessage: i = "Hi! How can I help you today?"
2169
2148
  }) => {
2170
- const a = et(null);
2171
- return Oe(() => {
2149
+ const a = Ye(null);
2150
+ return Re(() => {
2172
2151
  var d;
2173
2152
  (d = a.current) == null || d.scrollIntoView({ behavior: "smooth" });
2174
- }, [e]), /* @__PURE__ */ x("div", { className: "cs-window", children: [
2175
- /* @__PURE__ */ x("div", { className: "cs-window__header", children: [
2176
- /* @__PURE__ */ S("h3", { className: "cs-window__title", children: "Customer Support" }),
2177
- /* @__PURE__ */ S(
2178
- "button",
2179
- {
2180
- className: "cs-window__close",
2181
- onClick: n,
2182
- "aria-label": "Close chat",
2183
- children: /* @__PURE__ */ S(kt, { size: 20 })
2184
- }
2185
- )
2186
- ] }),
2187
- /* @__PURE__ */ x("div", { className: "cs-window__messages", children: [
2188
- e.length === 0 && !r && /* @__PURE__ */ S("div", { className: "cs-window__welcome", children: /* @__PURE__ */ S("p", { children: i }) }),
2189
- e.map((d) => /* @__PURE__ */ S(wr, { message: d }, d.id)),
2190
- r && /* @__PURE__ */ x("div", { className: "cs-window__typing", children: [
2191
- /* @__PURE__ */ S(Ft, { size: 20, className: "cs-window__typing-icon" }),
2192
- /* @__PURE__ */ S("span", { children: "Thinking..." })
2193
- ] }),
2194
- s && /* @__PURE__ */ S("div", { className: "cs-window__error", children: /* @__PURE__ */ S("p", { children: s.message }) }),
2195
- /* @__PURE__ */ S("div", { ref: a })
2196
- ] }),
2197
- /* @__PURE__ */ S("div", { className: "cs-window__input-wrapper", children: /* @__PURE__ */ S(
2198
- br,
2199
- {
2200
- onSendMessage: t,
2201
- isLoading: r,
2202
- placeholder: o
2203
- }
2204
- ) })
2205
- ] });
2206
- }, Hr = ({
2153
+ }, [e]), /* @__PURE__ */ b.createElement("div", { className: "cs-window" }, /* @__PURE__ */ b.createElement("div", { className: "cs-window__header" }, /* @__PURE__ */ b.createElement("h3", { className: "cs-window__title" }, "Customer Support"), /* @__PURE__ */ b.createElement(
2154
+ "button",
2155
+ {
2156
+ className: "cs-window__close",
2157
+ onClick: n,
2158
+ "aria-label": "Close chat"
2159
+ },
2160
+ /* @__PURE__ */ b.createElement(Lt, { size: 20 })
2161
+ )), /* @__PURE__ */ b.createElement("div", { className: "cs-window__messages" }, e.length === 0 && !r && /* @__PURE__ */ b.createElement("div", { className: "cs-window__welcome" }, /* @__PURE__ */ b.createElement("p", null, i)), e.map((d) => /* @__PURE__ */ b.createElement(yr, { key: d.id, message: d })), r && /* @__PURE__ */ b.createElement("div", { className: "cs-window__typing" }, /* @__PURE__ */ b.createElement(Dt, { size: 20, className: "cs-window__typing-icon" }), /* @__PURE__ */ b.createElement("span", null, "Thinking...")), s && /* @__PURE__ */ b.createElement("div", { className: "cs-window__error" }, /* @__PURE__ */ b.createElement("p", null, s.message)), /* @__PURE__ */ b.createElement("div", { ref: a })), /* @__PURE__ */ b.createElement("div", { className: "cs-window__input-wrapper" }, /* @__PURE__ */ b.createElement(
2162
+ wr,
2163
+ {
2164
+ onSendMessage: t,
2165
+ isLoading: r,
2166
+ placeholder: o
2167
+ }
2168
+ )));
2169
+ }, $r = ({
2207
2170
  apiKey: e,
2208
2171
  baseUrl: t,
2209
2172
  theme: n,
@@ -2215,66 +2178,61 @@ const wr = ({ message: e }) => {
2215
2178
  onMessageSent: d,
2216
2179
  onMessageReceived: u
2217
2180
  }) => {
2218
- const [l, p] = K(!1), {
2219
- messages: b,
2181
+ const [l, p] = J(!1), {
2182
+ messages: E,
2220
2183
  sendMessage: _,
2221
2184
  isLoading: f,
2222
- error: m,
2223
- clearError: h
2224
- } = yr({
2185
+ error: h,
2186
+ clearError: m
2187
+ } = hr({
2225
2188
  apiKey: e,
2226
2189
  baseUrl: t,
2227
2190
  onError: a
2228
2191
  });
2229
- Oe(() => {
2192
+ Re(() => {
2230
2193
  if (n) {
2231
2194
  const y = document.documentElement;
2232
2195
  n.primaryColor && y.style.setProperty("--cs-primary-color", n.primaryColor), n.secondaryColor && y.style.setProperty("--cs-secondary-color", n.secondaryColor), n.backgroundColor && y.style.setProperty("--cs-bg-color", n.backgroundColor), n.textColor && y.style.setProperty("--cs-text-color", n.textColor), n.fontFamily && y.style.setProperty("--cs-font-family", n.fontFamily), n.borderRadius && y.style.setProperty("--cs-border-radius", n.borderRadius), n.buttonColor && y.style.setProperty("--cs-button-color", n.buttonColor), n.userMessageColor && y.style.setProperty("--cs-user-message-color", n.userMessageColor), n.assistantMessageColor && y.style.setProperty("--cs-assistant-message-color", n.assistantMessageColor);
2233
2196
  }
2234
2197
  }, [n]);
2235
2198
  const g = async (y) => {
2236
- if (d == null || d(y), await _(y), !m) {
2237
- const E = b[b.length - 1];
2238
- (E == null ? void 0 : E.role) === "ASSISTANT" && (u == null || u(E.content));
2199
+ if (d == null || d(y), await _(y), !h) {
2200
+ const S = E[E.length - 1];
2201
+ (S == null ? void 0 : S.role) === "ASSISTANT" && (u == null || u(S.content));
2239
2202
  }
2240
2203
  }, R = () => {
2241
- p(!l), m && h();
2204
+ p(!l), h && m();
2242
2205
  };
2243
- return /* @__PURE__ */ x("div", { className: `cs-widget cs-widget--${r} ${i}`, children: [
2244
- l && /* @__PURE__ */ S(
2245
- gr,
2246
- {
2247
- messages: b,
2248
- onSendMessage: g,
2249
- onClose: () => p(!1),
2250
- isLoading: f,
2251
- error: m,
2252
- placeholder: o,
2253
- welcomeMessage: s
2254
- }
2255
- ),
2256
- /* @__PURE__ */ x(
2257
- "button",
2258
- {
2259
- className: `cs-widget__toggle ${l ? "cs-widget__toggle--open" : ""}`,
2260
- onClick: R,
2261
- "aria-label": l ? "Close chat" : "Open chat",
2262
- "aria-expanded": l,
2263
- children: [
2264
- /* @__PURE__ */ S(Ut, { size: 24 }),
2265
- !l && b.length > 0 && /* @__PURE__ */ S("span", { className: "cs-widget__badge", children: b.filter((y) => y.role === "ASSISTANT").length })
2266
- ]
2267
- }
2268
- )
2269
- ] });
2206
+ return /* @__PURE__ */ b.createElement("div", { className: `cs-widget cs-widget--${r} ${i}` }, l && /* @__PURE__ */ b.createElement(
2207
+ Er,
2208
+ {
2209
+ messages: E,
2210
+ onSendMessage: g,
2211
+ onClose: () => p(!1),
2212
+ isLoading: f,
2213
+ error: h,
2214
+ placeholder: o,
2215
+ welcomeMessage: s
2216
+ }
2217
+ ), /* @__PURE__ */ b.createElement(
2218
+ "button",
2219
+ {
2220
+ className: `cs-widget__toggle ${l ? "cs-widget__toggle--open" : ""}`,
2221
+ onClick: R,
2222
+ "aria-label": l ? "Close chat" : "Open chat",
2223
+ "aria-expanded": l
2224
+ },
2225
+ /* @__PURE__ */ b.createElement(Ft, { size: 24 }),
2226
+ !l && E.length > 0 && /* @__PURE__ */ b.createElement("span", { className: "cs-widget__badge" }, E.filter((y) => y.role === "ASSISTANT").length)
2227
+ ));
2270
2228
  };
2271
2229
  export {
2272
- br as ChatInput,
2273
- wr as ChatMessage,
2274
- gr as ChatWindow,
2275
- pr as CustomerSupportAPIClient,
2276
- Hr as CustomerSupportWidget,
2277
- yr as useCustomerSupport,
2278
- Ze as useLocalStorage
2230
+ wr as ChatInput,
2231
+ yr as ChatMessage,
2232
+ Er as ChatWindow,
2233
+ dr as CustomerSupportAPIClient,
2234
+ $r as CustomerSupportWidget,
2235
+ hr as useCustomerSupport,
2236
+ Ge as useLocalStorage
2279
2237
  };
2280
2238
  //# sourceMappingURL=index.es.js.map