@tarxemo/customer_support 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2557 @@
1
+ var Ut = Object.defineProperty;
2
+ var vt = (e, t, r) => t in e ? Ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var $e = (e, t, r) => vt(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import It, { forwardRef as lt, createElement as ke, useState as se, useRef as ut, useEffect as Ue, useCallback as he } from "react";
5
+ var me = { exports: {} }, te = {};
6
+ /**
7
+ * @license React
8
+ * react-jsx-runtime.production.js
9
+ *
10
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ var qe;
16
+ function Bt() {
17
+ if (qe) return te;
18
+ qe = 1;
19
+ var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
20
+ function r(n, s, o) {
21
+ var i = null;
22
+ if (o !== void 0 && (i = "" + o), s.key !== void 0 && (i = "" + s.key), "key" in s) {
23
+ o = {};
24
+ for (var a in s)
25
+ a !== "key" && (o[a] = s[a]);
26
+ } else o = s;
27
+ return s = o.ref, {
28
+ $$typeof: e,
29
+ type: n,
30
+ key: i,
31
+ ref: s !== void 0 ? s : null,
32
+ props: o
33
+ };
34
+ }
35
+ return te.Fragment = t, te.jsx = r, te.jsxs = r, te;
36
+ }
37
+ var re = {};
38
+ /**
39
+ * @license React
40
+ * react-jsx-runtime.development.js
41
+ *
42
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
43
+ *
44
+ * This source code is licensed under the MIT license found in the
45
+ * LICENSE file in the root directory of this source tree.
46
+ */
47
+ var He;
48
+ function Mt() {
49
+ return He || (He = 1, process.env.NODE_ENV !== "production" && (function() {
50
+ function e(l) {
51
+ if (l == null) return null;
52
+ if (typeof l == "function")
53
+ return l.$$typeof === de ? null : l.displayName || l.name || null;
54
+ if (typeof l == "string") return l;
55
+ switch (l) {
56
+ case h:
57
+ return "Fragment";
58
+ case x:
59
+ return "Profiler";
60
+ case S:
61
+ return "StrictMode";
62
+ case U:
63
+ return "Suspense";
64
+ case j:
65
+ return "SuspenseList";
66
+ case fe:
67
+ return "Activity";
68
+ }
69
+ if (typeof l == "object")
70
+ switch (typeof l.tag == "number" && console.error(
71
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
+ ), l.$$typeof) {
73
+ case y:
74
+ return "Portal";
75
+ case _:
76
+ return l.displayName || "Context";
77
+ case w:
78
+ return (l._context.displayName || "Context") + ".Consumer";
79
+ case P:
80
+ var E = l.render;
81
+ return l = l.displayName, l || (l = E.displayName || E.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
82
+ case Z:
83
+ return E = l.displayName || null, E !== null ? E : e(l.type) || "Memo";
84
+ case $:
85
+ E = l._payload, l = l._init;
86
+ try {
87
+ return e(l(E));
88
+ } catch {
89
+ }
90
+ }
91
+ return null;
92
+ }
93
+ function t(l) {
94
+ return "" + l;
95
+ }
96
+ function r(l) {
97
+ try {
98
+ t(l);
99
+ var E = !1;
100
+ } catch {
101
+ E = !0;
102
+ }
103
+ if (E) {
104
+ E = console;
105
+ var T = E.error, A = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
106
+ return T.call(
107
+ E,
108
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
+ A
110
+ ), t(l);
111
+ }
112
+ }
113
+ function n(l) {
114
+ if (l === h) return "<>";
115
+ if (typeof l == "object" && l !== null && l.$$typeof === $)
116
+ return "<...>";
117
+ try {
118
+ var E = e(l);
119
+ return E ? "<" + E + ">" : "<...>";
120
+ } catch {
121
+ return "<...>";
122
+ }
123
+ }
124
+ function s() {
125
+ var l = q.A;
126
+ return l === null ? null : l.getOwner();
127
+ }
128
+ function o() {
129
+ return Error("react-stack-top-frame");
130
+ }
131
+ function i(l) {
132
+ if (H.call(l, "key")) {
133
+ var E = Object.getOwnPropertyDescriptor(l, "key").get;
134
+ if (E && E.isReactWarning) return !1;
135
+ }
136
+ return l.key !== void 0;
137
+ }
138
+ function a(l, E) {
139
+ function T() {
140
+ L || (L = !0, console.error(
141
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
+ E
143
+ ));
144
+ }
145
+ T.isReactWarning = !0, Object.defineProperty(l, "key", {
146
+ get: T,
147
+ configurable: !0
148
+ });
149
+ }
150
+ function p() {
151
+ var l = e(this.type);
152
+ return Q[l] || (Q[l] = !0, console.error(
153
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
+ )), l = this.props.ref, l !== void 0 ? l : null;
155
+ }
156
+ function f(l, E, T, A, z, Ae) {
157
+ var N = T.ref;
158
+ return l = {
159
+ $$typeof: d,
160
+ type: l,
161
+ key: E,
162
+ props: T,
163
+ _owner: A
164
+ }, (N !== void 0 ? N : null) !== null ? Object.defineProperty(l, "ref", {
165
+ enumerable: !1,
166
+ get: p
167
+ }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
168
+ configurable: !1,
169
+ enumerable: !1,
170
+ writable: !0,
171
+ value: 0
172
+ }), Object.defineProperty(l, "_debugInfo", {
173
+ configurable: !1,
174
+ enumerable: !1,
175
+ writable: !0,
176
+ value: null
177
+ }), Object.defineProperty(l, "_debugStack", {
178
+ configurable: !1,
179
+ enumerable: !1,
180
+ writable: !0,
181
+ value: z
182
+ }), Object.defineProperty(l, "_debugTask", {
183
+ configurable: !1,
184
+ enumerable: !1,
185
+ writable: !0,
186
+ value: Ae
187
+ }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
188
+ }
189
+ function u(l, E, T, A, z, Ae) {
190
+ var N = E.children;
191
+ if (N !== void 0)
192
+ if (A)
193
+ if (M(N)) {
194
+ for (A = 0; A < N.length; A++)
195
+ m(N[A]);
196
+ Object.freeze && Object.freeze(N);
197
+ } else
198
+ console.error(
199
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
200
+ );
201
+ else m(N);
202
+ if (H.call(E, "key")) {
203
+ N = e(l);
204
+ var Y = Object.keys(E).filter(function(Lt) {
205
+ return Lt !== "key";
206
+ });
207
+ A = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", pe[N + A] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ `A props object containing a "key" prop is being spread into JSX:
209
+ let props = %s;
210
+ <%s {...props} />
211
+ React keys must be passed directly to JSX without using spread:
212
+ let props = %s;
213
+ <%s key={someKey} {...props} />`,
214
+ A,
215
+ N,
216
+ Y,
217
+ N
218
+ ), pe[N + A] = !0);
219
+ }
220
+ if (N = null, T !== void 0 && (r(T), N = "" + T), i(E) && (r(E.key), N = "" + E.key), "key" in E) {
221
+ T = {};
222
+ for (var xe in E)
223
+ xe !== "key" && (T[xe] = E[xe]);
224
+ } else T = E;
225
+ return N && a(
226
+ T,
227
+ typeof l == "function" ? l.displayName || l.name || "Unknown" : l
228
+ ), f(
229
+ l,
230
+ N,
231
+ T,
232
+ s(),
233
+ z,
234
+ Ae
235
+ );
236
+ }
237
+ function m(l) {
238
+ g(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === $ && (l._payload.status === "fulfilled" ? g(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
239
+ }
240
+ function g(l) {
241
+ return typeof l == "object" && l !== null && l.$$typeof === d;
242
+ }
243
+ var O = It, d = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), P = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), fe = Symbol.for("react.activity"), de = Symbol.for("react.client.reference"), q = O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, M = Array.isArray, K = console.createTask ? console.createTask : function() {
244
+ return null;
245
+ };
246
+ O = {
247
+ react_stack_bottom_frame: function(l) {
248
+ return l();
249
+ }
250
+ };
251
+ var L, Q = {}, v = O.react_stack_bottom_frame.bind(
252
+ O,
253
+ o
254
+ )(), ee = K(n(o)), pe = {};
255
+ re.Fragment = h, re.jsx = function(l, E, T) {
256
+ var A = 1e4 > q.recentlyCreatedOwnerStacks++;
257
+ return u(
258
+ l,
259
+ E,
260
+ T,
261
+ !1,
262
+ A ? Error("react-stack-top-frame") : v,
263
+ A ? K(n(l)) : ee
264
+ );
265
+ }, re.jsxs = function(l, E, T) {
266
+ var A = 1e4 > q.recentlyCreatedOwnerStacks++;
267
+ return u(
268
+ l,
269
+ E,
270
+ T,
271
+ !0,
272
+ A ? Error("react-stack-top-frame") : v,
273
+ A ? K(n(l)) : ee
274
+ );
275
+ };
276
+ })()), re;
277
+ }
278
+ var ze;
279
+ function $t() {
280
+ return ze || (ze = 1, process.env.NODE_ENV === "production" ? me.exports = Bt() : me.exports = Mt()), me.exports;
281
+ }
282
+ var R = $t();
283
+ /**
284
+ * @license lucide-react v0.469.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */
289
+ const qt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ft = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim();
290
+ /**
291
+ * @license lucide-react v0.469.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */
296
+ var Ht = {
297
+ xmlns: "http://www.w3.org/2000/svg",
298
+ width: 24,
299
+ height: 24,
300
+ viewBox: "0 0 24 24",
301
+ fill: "none",
302
+ stroke: "currentColor",
303
+ strokeWidth: 2,
304
+ strokeLinecap: "round",
305
+ strokeLinejoin: "round"
306
+ };
307
+ /**
308
+ * @license lucide-react v0.469.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */
313
+ const zt = lt(
314
+ ({
315
+ color: e = "currentColor",
316
+ size: t = 24,
317
+ strokeWidth: r = 2,
318
+ absoluteStrokeWidth: n,
319
+ className: s = "",
320
+ children: o,
321
+ iconNode: i,
322
+ ...a
323
+ }, p) => ke(
324
+ "svg",
325
+ {
326
+ ref: p,
327
+ ...Ht,
328
+ width: t,
329
+ height: t,
330
+ stroke: e,
331
+ strokeWidth: n ? Number(r) * 24 / Number(t) : r,
332
+ className: ft("lucide", s),
333
+ ...a
334
+ },
335
+ [
336
+ ...i.map(([f, u]) => ke(f, u)),
337
+ ...Array.isArray(o) ? o : [o]
338
+ ]
339
+ )
340
+ );
341
+ /**
342
+ * @license lucide-react v0.469.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */
347
+ const oe = (e, t) => {
348
+ const r = lt(
349
+ ({ className: n, ...s }, o) => ke(zt, {
350
+ ref: o,
351
+ iconNode: t,
352
+ className: ft(`lucide-${qt(e)}`, n),
353
+ ...s
354
+ })
355
+ );
356
+ return r.displayName = `${e}`, r;
357
+ };
358
+ /**
359
+ * @license lucide-react v0.469.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */
364
+ const Jt = oe("ExternalLink", [
365
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
366
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
367
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
368
+ ]);
369
+ /**
370
+ * @license lucide-react v0.469.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */
375
+ const Vt = oe("LoaderCircle", [
376
+ ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
377
+ ]);
378
+ /**
379
+ * @license lucide-react v0.469.0 - ISC
380
+ *
381
+ * This source code is licensed under the ISC license.
382
+ * See the LICENSE file in the root directory of this source tree.
383
+ */
384
+ const Wt = oe("MessageCircle", [
385
+ ["path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z", key: "vv11sd" }]
386
+ ]);
387
+ /**
388
+ * @license lucide-react v0.469.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */
393
+ const Kt = oe("Send", [
394
+ [
395
+ "path",
396
+ {
397
+ d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
398
+ key: "1ffxy3"
399
+ }
400
+ ],
401
+ ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
402
+ ]);
403
+ /**
404
+ * @license lucide-react v0.469.0 - ISC
405
+ *
406
+ * This source code is licensed under the ISC license.
407
+ * See the LICENSE file in the root directory of this source tree.
408
+ */
409
+ const Yt = oe("X", [
410
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
411
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
412
+ ]);
413
+ function dt(e, t) {
414
+ return function() {
415
+ return e.apply(t, arguments);
416
+ };
417
+ }
418
+ const { toString: Xt } = Object.prototype, { getPrototypeOf: ve } = Object, { iterator: Re, toStringTag: pt } = Symbol, Se = /* @__PURE__ */ ((e) => (t) => {
419
+ const r = Xt.call(t);
420
+ return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
421
+ })(/* @__PURE__ */ Object.create(null)), I = (e) => (e = e.toLowerCase(), (t) => Se(t) === e), _e = (e) => (t) => typeof t === e, { isArray: G } = Array, X = _e("undefined");
422
+ function ie(e) {
423
+ return e !== null && !X(e) && e.constructor !== null && !X(e.constructor) && F(e.constructor.isBuffer) && e.constructor.isBuffer(e);
424
+ }
425
+ const ht = I("ArrayBuffer");
426
+ function Gt(e) {
427
+ let t;
428
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ht(e.buffer), t;
429
+ }
430
+ const Zt = _e("string"), F = _e("function"), mt = _e("number"), ae = (e) => e !== null && typeof e == "object", Qt = (e) => e === !0 || e === !1, we = (e) => {
431
+ if (Se(e) !== "object")
432
+ return !1;
433
+ const t = ve(e);
434
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(pt in e) && !(Re in e);
435
+ }, er = (e) => {
436
+ if (!ae(e) || ie(e))
437
+ return !1;
438
+ try {
439
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
440
+ } catch {
441
+ return !1;
442
+ }
443
+ }, tr = I("Date"), rr = I("File"), nr = I("Blob"), sr = I("FileList"), or = (e) => ae(e) && F(e.pipe), ir = (e) => {
444
+ let t;
445
+ return e && (typeof FormData == "function" && e instanceof FormData || F(e.append) && ((t = Se(e)) === "formdata" || // detect form-data instance
446
+ t === "object" && F(e.toString) && e.toString() === "[object FormData]"));
447
+ }, ar = I("URLSearchParams"), [cr, lr, ur, fr] = ["ReadableStream", "Request", "Response", "Headers"].map(I), dr = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
448
+ function ce(e, t, { allOwnKeys: r = !1 } = {}) {
449
+ if (e === null || typeof e > "u")
450
+ return;
451
+ let n, s;
452
+ if (typeof e != "object" && (e = [e]), G(e))
453
+ for (n = 0, s = e.length; n < s; n++)
454
+ t.call(null, e[n], n, e);
455
+ else {
456
+ if (ie(e))
457
+ return;
458
+ const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
459
+ let a;
460
+ for (n = 0; n < i; n++)
461
+ a = o[n], t.call(null, e[a], a, e);
462
+ }
463
+ }
464
+ function yt(e, t) {
465
+ if (ie(e))
466
+ return null;
467
+ t = t.toLowerCase();
468
+ const r = Object.keys(e);
469
+ let n = r.length, s;
470
+ for (; n-- > 0; )
471
+ if (s = r[n], t === s.toLowerCase())
472
+ return s;
473
+ return null;
474
+ }
475
+ const J = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, wt = (e) => !X(e) && e !== J;
476
+ function je() {
477
+ const { caseless: e, skipUndefined: t } = wt(this) && this || {}, r = {}, n = (s, o) => {
478
+ const i = e && yt(r, o) || o;
479
+ we(r[i]) && we(s) ? r[i] = je(r[i], s) : we(s) ? r[i] = je({}, s) : G(s) ? r[i] = s.slice() : (!t || !X(s)) && (r[i] = s);
480
+ };
481
+ for (let s = 0, o = arguments.length; s < o; s++)
482
+ arguments[s] && ce(arguments[s], n);
483
+ return r;
484
+ }
485
+ const pr = (e, t, r, { allOwnKeys: n } = {}) => (ce(t, (s, o) => {
486
+ r && F(s) ? Object.defineProperty(e, o, {
487
+ value: dt(s, r),
488
+ writable: !0,
489
+ enumerable: !0,
490
+ configurable: !0
491
+ }) : Object.defineProperty(e, o, {
492
+ value: s,
493
+ writable: !0,
494
+ enumerable: !0,
495
+ configurable: !0
496
+ });
497
+ }, { allOwnKeys: n }), e), hr = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), mr = (e, t, r, n) => {
498
+ e.prototype = Object.create(t.prototype, n), Object.defineProperty(e.prototype, "constructor", {
499
+ value: e,
500
+ writable: !0,
501
+ enumerable: !1,
502
+ configurable: !0
503
+ }), Object.defineProperty(e, "super", {
504
+ value: t.prototype
505
+ }), r && Object.assign(e.prototype, r);
506
+ }, yr = (e, t, r, n) => {
507
+ let s, o, i;
508
+ const a = {};
509
+ if (t = t || {}, e == null) return t;
510
+ do {
511
+ for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
512
+ i = s[o], (!n || n(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
513
+ e = r !== !1 && ve(e);
514
+ } while (e && (!r || r(e, t)) && e !== Object.prototype);
515
+ return t;
516
+ }, wr = (e, t, r) => {
517
+ e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
518
+ const n = e.indexOf(t, r);
519
+ return n !== -1 && n === r;
520
+ }, br = (e) => {
521
+ if (!e) return null;
522
+ if (G(e)) return e;
523
+ let t = e.length;
524
+ if (!mt(t)) return null;
525
+ const r = new Array(t);
526
+ for (; t-- > 0; )
527
+ r[t] = e[t];
528
+ return r;
529
+ }, Er = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ve(Uint8Array)), gr = (e, t) => {
530
+ const n = (e && e[Re]).call(e);
531
+ let s;
532
+ for (; (s = n.next()) && !s.done; ) {
533
+ const o = s.value;
534
+ t.call(e, o[0], o[1]);
535
+ }
536
+ }, Rr = (e, t) => {
537
+ let r;
538
+ const n = [];
539
+ for (; (r = e.exec(t)) !== null; )
540
+ n.push(r);
541
+ return n;
542
+ }, Sr = I("HTMLFormElement"), _r = (e) => e.toLowerCase().replace(
543
+ /[-_\s]([a-z\d])(\w*)/g,
544
+ function(r, n, s) {
545
+ return n.toUpperCase() + s;
546
+ }
547
+ ), Je = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Tr = I("RegExp"), bt = (e, t) => {
548
+ const r = Object.getOwnPropertyDescriptors(e), n = {};
549
+ ce(r, (s, o) => {
550
+ let i;
551
+ (i = t(s, o, e)) !== !1 && (n[o] = i || s);
552
+ }), Object.defineProperties(e, n);
553
+ }, Or = (e) => {
554
+ bt(e, (t, r) => {
555
+ if (F(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
556
+ return !1;
557
+ const n = e[r];
558
+ if (F(n)) {
559
+ if (t.enumerable = !1, "writable" in t) {
560
+ t.writable = !1;
561
+ return;
562
+ }
563
+ t.set || (t.set = () => {
564
+ throw Error("Can not rewrite read-only method '" + r + "'");
565
+ });
566
+ }
567
+ });
568
+ }, Ar = (e, t) => {
569
+ const r = {}, n = (s) => {
570
+ s.forEach((o) => {
571
+ r[o] = !0;
572
+ });
573
+ };
574
+ return G(e) ? n(e) : n(String(e).split(t)), r;
575
+ }, xr = () => {
576
+ }, Cr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
577
+ function Nr(e) {
578
+ return !!(e && F(e.append) && e[pt] === "FormData" && e[Re]);
579
+ }
580
+ const Pr = (e) => {
581
+ const t = new Array(10), r = (n, s) => {
582
+ if (ae(n)) {
583
+ if (t.indexOf(n) >= 0)
584
+ return;
585
+ if (ie(n))
586
+ return n;
587
+ if (!("toJSON" in n)) {
588
+ t[s] = n;
589
+ const o = G(n) ? [] : {};
590
+ return ce(n, (i, a) => {
591
+ const p = r(i, s + 1);
592
+ !X(p) && (o[a] = p);
593
+ }), t[s] = void 0, o;
594
+ }
595
+ }
596
+ return n;
597
+ };
598
+ return r(e, 0);
599
+ }, kr = I("AsyncFunction"), jr = (e) => e && (ae(e) || F(e)) && F(e.then) && F(e.catch), Et = ((e, t) => e ? setImmediate : t ? ((r, n) => (J.addEventListener("message", ({ source: s, data: o }) => {
600
+ s === J && o === r && n.length && n.shift()();
601
+ }, !1), (s) => {
602
+ n.push(s), J.postMessage(r, "*");
603
+ }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
604
+ typeof setImmediate == "function",
605
+ F(J.postMessage)
606
+ ), Fr = typeof queueMicrotask < "u" ? queueMicrotask.bind(J) : typeof process < "u" && process.nextTick || Et, Dr = (e) => e != null && F(e[Re]), c = {
607
+ isArray: G,
608
+ isArrayBuffer: ht,
609
+ isBuffer: ie,
610
+ isFormData: ir,
611
+ isArrayBufferView: Gt,
612
+ isString: Zt,
613
+ isNumber: mt,
614
+ isBoolean: Qt,
615
+ isObject: ae,
616
+ isPlainObject: we,
617
+ isEmptyObject: er,
618
+ isReadableStream: cr,
619
+ isRequest: lr,
620
+ isResponse: ur,
621
+ isHeaders: fr,
622
+ isUndefined: X,
623
+ isDate: tr,
624
+ isFile: rr,
625
+ isBlob: nr,
626
+ isRegExp: Tr,
627
+ isFunction: F,
628
+ isStream: or,
629
+ isURLSearchParams: ar,
630
+ isTypedArray: Er,
631
+ isFileList: sr,
632
+ forEach: ce,
633
+ merge: je,
634
+ extend: pr,
635
+ trim: dr,
636
+ stripBOM: hr,
637
+ inherits: mr,
638
+ toFlatObject: yr,
639
+ kindOf: Se,
640
+ kindOfTest: I,
641
+ endsWith: wr,
642
+ toArray: br,
643
+ forEachEntry: gr,
644
+ matchAll: Rr,
645
+ isHTMLForm: Sr,
646
+ hasOwnProperty: Je,
647
+ hasOwnProp: Je,
648
+ // an alias to avoid ESLint no-prototype-builtins detection
649
+ reduceDescriptors: bt,
650
+ freezeMethods: Or,
651
+ toObjectSet: Ar,
652
+ toCamelCase: _r,
653
+ noop: xr,
654
+ toFiniteNumber: Cr,
655
+ findKey: yt,
656
+ global: J,
657
+ isContextDefined: wt,
658
+ isSpecCompliantForm: Nr,
659
+ toJSONObject: Pr,
660
+ isAsyncFn: kr,
661
+ isThenable: jr,
662
+ setImmediate: Et,
663
+ asap: Fr,
664
+ isIterable: Dr
665
+ };
666
+ let b = class gt extends Error {
667
+ static from(t, r, n, s, o, i) {
668
+ const a = new gt(t.message, r || t.code, n, s, o);
669
+ return a.cause = t, a.name = t.name, i && Object.assign(a, i), a;
670
+ }
671
+ /**
672
+ * Create an Error with the specified message, config, error code, request and response.
673
+ *
674
+ * @param {string} message The error message.
675
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
676
+ * @param {Object} [config] The config.
677
+ * @param {Object} [request] The request.
678
+ * @param {Object} [response] The response.
679
+ *
680
+ * @returns {Error} The created error.
681
+ */
682
+ constructor(t, r, n, s, o) {
683
+ super(t), this.name = "AxiosError", this.isAxiosError = !0, r && (this.code = r), n && (this.config = n), s && (this.request = s), o && (this.response = o, this.status = o.status);
684
+ }
685
+ toJSON() {
686
+ return {
687
+ // Standard
688
+ message: this.message,
689
+ name: this.name,
690
+ // Microsoft
691
+ description: this.description,
692
+ number: this.number,
693
+ // Mozilla
694
+ fileName: this.fileName,
695
+ lineNumber: this.lineNumber,
696
+ columnNumber: this.columnNumber,
697
+ stack: this.stack,
698
+ // Axios
699
+ config: c.toJSONObject(this.config),
700
+ code: this.code,
701
+ status: this.status
702
+ };
703
+ }
704
+ };
705
+ b.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
706
+ b.ERR_BAD_OPTION = "ERR_BAD_OPTION";
707
+ b.ECONNABORTED = "ECONNABORTED";
708
+ b.ETIMEDOUT = "ETIMEDOUT";
709
+ b.ERR_NETWORK = "ERR_NETWORK";
710
+ b.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
711
+ b.ERR_DEPRECATED = "ERR_DEPRECATED";
712
+ b.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
713
+ b.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
714
+ b.ERR_CANCELED = "ERR_CANCELED";
715
+ b.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
716
+ b.ERR_INVALID_URL = "ERR_INVALID_URL";
717
+ const Lr = null;
718
+ function Fe(e) {
719
+ return c.isPlainObject(e) || c.isArray(e);
720
+ }
721
+ function Rt(e) {
722
+ return c.endsWith(e, "[]") ? e.slice(0, -2) : e;
723
+ }
724
+ function Ve(e, t, r) {
725
+ return e ? e.concat(t).map(function(s, o) {
726
+ return s = Rt(s), !r && o ? "[" + s + "]" : s;
727
+ }).join(r ? "." : "") : t;
728
+ }
729
+ function Ur(e) {
730
+ return c.isArray(e) && !e.some(Fe);
731
+ }
732
+ const vr = c.toFlatObject(c, {}, null, function(t) {
733
+ return /^is[A-Z]/.test(t);
734
+ });
735
+ function Te(e, t, r) {
736
+ if (!c.isObject(e))
737
+ throw new TypeError("target must be an object");
738
+ t = t || new FormData(), r = c.toFlatObject(r, {
739
+ metaTokens: !0,
740
+ dots: !1,
741
+ indexes: !1
742
+ }, !1, function(y, h) {
743
+ return !c.isUndefined(h[y]);
744
+ });
745
+ const n = r.metaTokens, s = r.visitor || u, o = r.dots, i = r.indexes, p = (r.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
746
+ if (!c.isFunction(s))
747
+ throw new TypeError("visitor must be a function");
748
+ function f(d) {
749
+ if (d === null) return "";
750
+ if (c.isDate(d))
751
+ return d.toISOString();
752
+ if (c.isBoolean(d))
753
+ return d.toString();
754
+ if (!p && c.isBlob(d))
755
+ throw new b("Blob is not supported. Use a Buffer instead.");
756
+ return c.isArrayBuffer(d) || c.isTypedArray(d) ? p && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
757
+ }
758
+ function u(d, y, h) {
759
+ let S = d;
760
+ if (d && !h && typeof d == "object") {
761
+ if (c.endsWith(y, "{}"))
762
+ y = n ? y : y.slice(0, -2), d = JSON.stringify(d);
763
+ else if (c.isArray(d) && Ur(d) || (c.isFileList(d) || c.endsWith(y, "[]")) && (S = c.toArray(d)))
764
+ return y = Rt(y), S.forEach(function(w, _) {
765
+ !(c.isUndefined(w) || w === null) && t.append(
766
+ // eslint-disable-next-line no-nested-ternary
767
+ i === !0 ? Ve([y], _, o) : i === null ? y : y + "[]",
768
+ f(w)
769
+ );
770
+ }), !1;
771
+ }
772
+ return Fe(d) ? !0 : (t.append(Ve(h, y, o), f(d)), !1);
773
+ }
774
+ const m = [], g = Object.assign(vr, {
775
+ defaultVisitor: u,
776
+ convertValue: f,
777
+ isVisitable: Fe
778
+ });
779
+ function O(d, y) {
780
+ if (!c.isUndefined(d)) {
781
+ if (m.indexOf(d) !== -1)
782
+ throw Error("Circular reference detected in " + y.join("."));
783
+ m.push(d), c.forEach(d, function(S, x) {
784
+ (!(c.isUndefined(S) || S === null) && s.call(
785
+ t,
786
+ S,
787
+ c.isString(x) ? x.trim() : x,
788
+ y,
789
+ g
790
+ )) === !0 && O(S, y ? y.concat(x) : [x]);
791
+ }), m.pop();
792
+ }
793
+ }
794
+ if (!c.isObject(e))
795
+ throw new TypeError("data must be an object");
796
+ return O(e), t;
797
+ }
798
+ function We(e) {
799
+ const t = {
800
+ "!": "%21",
801
+ "'": "%27",
802
+ "(": "%28",
803
+ ")": "%29",
804
+ "~": "%7E",
805
+ "%20": "+",
806
+ "%00": "\0"
807
+ };
808
+ return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
809
+ return t[n];
810
+ });
811
+ }
812
+ function Ie(e, t) {
813
+ this._pairs = [], e && Te(e, this, t);
814
+ }
815
+ const St = Ie.prototype;
816
+ St.append = function(t, r) {
817
+ this._pairs.push([t, r]);
818
+ };
819
+ St.toString = function(t) {
820
+ const r = t ? function(n) {
821
+ return t.call(this, n, We);
822
+ } : We;
823
+ return this._pairs.map(function(s) {
824
+ return r(s[0]) + "=" + r(s[1]);
825
+ }, "").join("&");
826
+ };
827
+ function Ir(e) {
828
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
829
+ }
830
+ function _t(e, t, r) {
831
+ if (!t)
832
+ return e;
833
+ const n = r && r.encode || Ir, s = c.isFunction(r) ? {
834
+ serialize: r
835
+ } : r, o = s && s.serialize;
836
+ let i;
837
+ if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new Ie(t, s).toString(n), i) {
838
+ const a = e.indexOf("#");
839
+ a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
840
+ }
841
+ return e;
842
+ }
843
+ class Ke {
844
+ constructor() {
845
+ this.handlers = [];
846
+ }
847
+ /**
848
+ * Add a new interceptor to the stack
849
+ *
850
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
851
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
852
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
853
+ *
854
+ * @return {Number} An ID used to remove interceptor later
855
+ */
856
+ use(t, r, n) {
857
+ return this.handlers.push({
858
+ fulfilled: t,
859
+ rejected: r,
860
+ synchronous: n ? n.synchronous : !1,
861
+ runWhen: n ? n.runWhen : null
862
+ }), this.handlers.length - 1;
863
+ }
864
+ /**
865
+ * Remove an interceptor from the stack
866
+ *
867
+ * @param {Number} id The ID that was returned by `use`
868
+ *
869
+ * @returns {void}
870
+ */
871
+ eject(t) {
872
+ this.handlers[t] && (this.handlers[t] = null);
873
+ }
874
+ /**
875
+ * Clear all interceptors from the stack
876
+ *
877
+ * @returns {void}
878
+ */
879
+ clear() {
880
+ this.handlers && (this.handlers = []);
881
+ }
882
+ /**
883
+ * Iterate over all the registered interceptors
884
+ *
885
+ * This method is particularly useful for skipping over any
886
+ * interceptors that may have become `null` calling `eject`.
887
+ *
888
+ * @param {Function} fn The function to call for each interceptor
889
+ *
890
+ * @returns {void}
891
+ */
892
+ forEach(t) {
893
+ c.forEach(this.handlers, function(n) {
894
+ n !== null && t(n);
895
+ });
896
+ }
897
+ }
898
+ const Tt = {
899
+ silentJSONParsing: !0,
900
+ forcedJSONParsing: !0,
901
+ clarifyTimeoutError: !1
902
+ }, Br = typeof URLSearchParams < "u" ? URLSearchParams : Ie, Mr = typeof FormData < "u" ? FormData : null, $r = typeof Blob < "u" ? Blob : null, qr = {
903
+ isBrowser: !0,
904
+ classes: {
905
+ URLSearchParams: Br,
906
+ FormData: Mr,
907
+ Blob: $r
908
+ },
909
+ protocols: ["http", "https", "file", "blob", "url", "data"]
910
+ }, Be = typeof window < "u" && typeof document < "u", De = typeof navigator == "object" && navigator || void 0, Hr = Be && (!De || ["ReactNative", "NativeScript", "NS"].indexOf(De.product) < 0), zr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
911
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Jr = Be && window.location.href || "http://localhost", Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
912
+ __proto__: null,
913
+ hasBrowserEnv: Be,
914
+ hasStandardBrowserEnv: Hr,
915
+ hasStandardBrowserWebWorkerEnv: zr,
916
+ navigator: De,
917
+ origin: Jr
918
+ }, Symbol.toStringTag, { value: "Module" })), k = {
919
+ ...Vr,
920
+ ...qr
921
+ };
922
+ function Wr(e, t) {
923
+ return Te(e, new k.classes.URLSearchParams(), {
924
+ visitor: function(r, n, s, o) {
925
+ return k.isNode && c.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
926
+ },
927
+ ...t
928
+ });
929
+ }
930
+ function Kr(e) {
931
+ return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
932
+ }
933
+ function Yr(e) {
934
+ const t = {}, r = Object.keys(e);
935
+ let n;
936
+ const s = r.length;
937
+ let o;
938
+ for (n = 0; n < s; n++)
939
+ o = r[n], t[o] = e[o];
940
+ return t;
941
+ }
942
+ function Ot(e) {
943
+ function t(r, n, s, o) {
944
+ let i = r[o++];
945
+ if (i === "__proto__") return !0;
946
+ const a = Number.isFinite(+i), p = o >= r.length;
947
+ return i = !i && c.isArray(s) ? s.length : i, p ? (c.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !a) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), t(r, n, s[i], o) && c.isArray(s[i]) && (s[i] = Yr(s[i])), !a);
948
+ }
949
+ if (c.isFormData(e) && c.isFunction(e.entries)) {
950
+ const r = {};
951
+ return c.forEachEntry(e, (n, s) => {
952
+ t(Kr(n), s, r, 0);
953
+ }), r;
954
+ }
955
+ return null;
956
+ }
957
+ function Xr(e, t, r) {
958
+ if (c.isString(e))
959
+ try {
960
+ return (t || JSON.parse)(e), c.trim(e);
961
+ } catch (n) {
962
+ if (n.name !== "SyntaxError")
963
+ throw n;
964
+ }
965
+ return (r || JSON.stringify)(e);
966
+ }
967
+ const le = {
968
+ transitional: Tt,
969
+ adapter: ["xhr", "http", "fetch"],
970
+ transformRequest: [function(t, r) {
971
+ const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, o = c.isObject(t);
972
+ if (o && c.isHTMLForm(t) && (t = new FormData(t)), c.isFormData(t))
973
+ return s ? JSON.stringify(Ot(t)) : t;
974
+ if (c.isArrayBuffer(t) || c.isBuffer(t) || c.isStream(t) || c.isFile(t) || c.isBlob(t) || c.isReadableStream(t))
975
+ return t;
976
+ if (c.isArrayBufferView(t))
977
+ return t.buffer;
978
+ if (c.isURLSearchParams(t))
979
+ return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
980
+ let a;
981
+ if (o) {
982
+ if (n.indexOf("application/x-www-form-urlencoded") > -1)
983
+ return Wr(t, this.formSerializer).toString();
984
+ if ((a = c.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
985
+ const p = this.env && this.env.FormData;
986
+ return Te(
987
+ a ? { "files[]": t } : t,
988
+ p && new p(),
989
+ this.formSerializer
990
+ );
991
+ }
992
+ }
993
+ return o || s ? (r.setContentType("application/json", !1), Xr(t)) : t;
994
+ }],
995
+ transformResponse: [function(t) {
996
+ const r = this.transitional || le.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
997
+ if (c.isResponse(t) || c.isReadableStream(t))
998
+ return t;
999
+ if (t && c.isString(t) && (n && !this.responseType || s)) {
1000
+ const i = !(r && r.silentJSONParsing) && s;
1001
+ try {
1002
+ return JSON.parse(t, this.parseReviver);
1003
+ } catch (a) {
1004
+ if (i)
1005
+ throw a.name === "SyntaxError" ? b.from(a, b.ERR_BAD_RESPONSE, this, null, this.response) : a;
1006
+ }
1007
+ }
1008
+ return t;
1009
+ }],
1010
+ /**
1011
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1012
+ * timeout is not created.
1013
+ */
1014
+ timeout: 0,
1015
+ xsrfCookieName: "XSRF-TOKEN",
1016
+ xsrfHeaderName: "X-XSRF-TOKEN",
1017
+ maxContentLength: -1,
1018
+ maxBodyLength: -1,
1019
+ env: {
1020
+ FormData: k.classes.FormData,
1021
+ Blob: k.classes.Blob
1022
+ },
1023
+ validateStatus: function(t) {
1024
+ return t >= 200 && t < 300;
1025
+ },
1026
+ headers: {
1027
+ common: {
1028
+ Accept: "application/json, text/plain, */*",
1029
+ "Content-Type": void 0
1030
+ }
1031
+ }
1032
+ };
1033
+ c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1034
+ le.headers[e] = {};
1035
+ });
1036
+ const Gr = c.toObjectSet([
1037
+ "age",
1038
+ "authorization",
1039
+ "content-length",
1040
+ "content-type",
1041
+ "etag",
1042
+ "expires",
1043
+ "from",
1044
+ "host",
1045
+ "if-modified-since",
1046
+ "if-unmodified-since",
1047
+ "last-modified",
1048
+ "location",
1049
+ "max-forwards",
1050
+ "proxy-authorization",
1051
+ "referer",
1052
+ "retry-after",
1053
+ "user-agent"
1054
+ ]), Zr = (e) => {
1055
+ const t = {};
1056
+ let r, n, s;
1057
+ return e && e.split(`
1058
+ `).forEach(function(i) {
1059
+ s = i.indexOf(":"), r = i.substring(0, s).trim().toLowerCase(), n = i.substring(s + 1).trim(), !(!r || t[r] && Gr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
1060
+ }), t;
1061
+ }, Ye = Symbol("internals");
1062
+ function ne(e) {
1063
+ return e && String(e).trim().toLowerCase();
1064
+ }
1065
+ function be(e) {
1066
+ return e === !1 || e == null ? e : c.isArray(e) ? e.map(be) : String(e);
1067
+ }
1068
+ function Qr(e) {
1069
+ const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1070
+ let n;
1071
+ for (; n = r.exec(e); )
1072
+ t[n[1]] = n[2];
1073
+ return t;
1074
+ }
1075
+ const en = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
1076
+ function Ce(e, t, r, n, s) {
1077
+ if (c.isFunction(n))
1078
+ return n.call(this, t, r);
1079
+ if (s && (t = r), !!c.isString(t)) {
1080
+ if (c.isString(n))
1081
+ return t.indexOf(n) !== -1;
1082
+ if (c.isRegExp(n))
1083
+ return n.test(t);
1084
+ }
1085
+ }
1086
+ function tn(e) {
1087
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
1088
+ }
1089
+ function rn(e, t) {
1090
+ const r = c.toCamelCase(" " + t);
1091
+ ["get", "set", "has"].forEach((n) => {
1092
+ Object.defineProperty(e, n + r, {
1093
+ value: function(s, o, i) {
1094
+ return this[n].call(this, t, s, o, i);
1095
+ },
1096
+ configurable: !0
1097
+ });
1098
+ });
1099
+ }
1100
+ let D = class {
1101
+ constructor(t) {
1102
+ t && this.set(t);
1103
+ }
1104
+ set(t, r, n) {
1105
+ const s = this;
1106
+ function o(a, p, f) {
1107
+ const u = ne(p);
1108
+ if (!u)
1109
+ throw new Error("header name must be a non-empty string");
1110
+ const m = c.findKey(s, u);
1111
+ (!m || s[m] === void 0 || f === !0 || f === void 0 && s[m] !== !1) && (s[m || p] = be(a));
1112
+ }
1113
+ const i = (a, p) => c.forEach(a, (f, u) => o(f, u, p));
1114
+ if (c.isPlainObject(t) || t instanceof this.constructor)
1115
+ i(t, r);
1116
+ else if (c.isString(t) && (t = t.trim()) && !en(t))
1117
+ i(Zr(t), r);
1118
+ else if (c.isObject(t) && c.isIterable(t)) {
1119
+ let a = {}, p, f;
1120
+ for (const u of t) {
1121
+ if (!c.isArray(u))
1122
+ throw TypeError("Object iterator must return a key-value pair");
1123
+ a[f = u[0]] = (p = a[f]) ? c.isArray(p) ? [...p, u[1]] : [p, u[1]] : u[1];
1124
+ }
1125
+ i(a, r);
1126
+ } else
1127
+ t != null && o(r, t, n);
1128
+ return this;
1129
+ }
1130
+ get(t, r) {
1131
+ if (t = ne(t), t) {
1132
+ const n = c.findKey(this, t);
1133
+ if (n) {
1134
+ const s = this[n];
1135
+ if (!r)
1136
+ return s;
1137
+ if (r === !0)
1138
+ return Qr(s);
1139
+ if (c.isFunction(r))
1140
+ return r.call(this, s, n);
1141
+ if (c.isRegExp(r))
1142
+ return r.exec(s);
1143
+ throw new TypeError("parser must be boolean|regexp|function");
1144
+ }
1145
+ }
1146
+ }
1147
+ has(t, r) {
1148
+ if (t = ne(t), t) {
1149
+ const n = c.findKey(this, t);
1150
+ return !!(n && this[n] !== void 0 && (!r || Ce(this, this[n], n, r)));
1151
+ }
1152
+ return !1;
1153
+ }
1154
+ delete(t, r) {
1155
+ const n = this;
1156
+ let s = !1;
1157
+ function o(i) {
1158
+ if (i = ne(i), i) {
1159
+ const a = c.findKey(n, i);
1160
+ a && (!r || Ce(n, n[a], a, r)) && (delete n[a], s = !0);
1161
+ }
1162
+ }
1163
+ return c.isArray(t) ? t.forEach(o) : o(t), s;
1164
+ }
1165
+ clear(t) {
1166
+ const r = Object.keys(this);
1167
+ let n = r.length, s = !1;
1168
+ for (; n--; ) {
1169
+ const o = r[n];
1170
+ (!t || Ce(this, this[o], o, t, !0)) && (delete this[o], s = !0);
1171
+ }
1172
+ return s;
1173
+ }
1174
+ normalize(t) {
1175
+ const r = this, n = {};
1176
+ return c.forEach(this, (s, o) => {
1177
+ const i = c.findKey(n, o);
1178
+ if (i) {
1179
+ r[i] = be(s), delete r[o];
1180
+ return;
1181
+ }
1182
+ const a = t ? tn(o) : String(o).trim();
1183
+ a !== o && delete r[o], r[a] = be(s), n[a] = !0;
1184
+ }), this;
1185
+ }
1186
+ concat(...t) {
1187
+ return this.constructor.concat(this, ...t);
1188
+ }
1189
+ toJSON(t) {
1190
+ const r = /* @__PURE__ */ Object.create(null);
1191
+ return c.forEach(this, (n, s) => {
1192
+ n != null && n !== !1 && (r[s] = t && c.isArray(n) ? n.join(", ") : n);
1193
+ }), r;
1194
+ }
1195
+ [Symbol.iterator]() {
1196
+ return Object.entries(this.toJSON())[Symbol.iterator]();
1197
+ }
1198
+ toString() {
1199
+ return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(`
1200
+ `);
1201
+ }
1202
+ getSetCookie() {
1203
+ return this.get("set-cookie") || [];
1204
+ }
1205
+ get [Symbol.toStringTag]() {
1206
+ return "AxiosHeaders";
1207
+ }
1208
+ static from(t) {
1209
+ return t instanceof this ? t : new this(t);
1210
+ }
1211
+ static concat(t, ...r) {
1212
+ const n = new this(t);
1213
+ return r.forEach((s) => n.set(s)), n;
1214
+ }
1215
+ static accessor(t) {
1216
+ const n = (this[Ye] = this[Ye] = {
1217
+ accessors: {}
1218
+ }).accessors, s = this.prototype;
1219
+ function o(i) {
1220
+ const a = ne(i);
1221
+ n[a] || (rn(s, i), n[a] = !0);
1222
+ }
1223
+ return c.isArray(t) ? t.forEach(o) : o(t), this;
1224
+ }
1225
+ };
1226
+ D.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1227
+ c.reduceDescriptors(D.prototype, ({ value: e }, t) => {
1228
+ let r = t[0].toUpperCase() + t.slice(1);
1229
+ return {
1230
+ get: () => e,
1231
+ set(n) {
1232
+ this[r] = n;
1233
+ }
1234
+ };
1235
+ });
1236
+ c.freezeMethods(D);
1237
+ function Ne(e, t) {
1238
+ const r = this || le, n = t || r, s = D.from(n.headers);
1239
+ let o = n.data;
1240
+ return c.forEach(e, function(a) {
1241
+ o = a.call(r, o, s.normalize(), t ? t.status : void 0);
1242
+ }), s.normalize(), o;
1243
+ }
1244
+ function At(e) {
1245
+ return !!(e && e.__CANCEL__);
1246
+ }
1247
+ let ue = class extends b {
1248
+ /**
1249
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1250
+ *
1251
+ * @param {string=} message The message.
1252
+ * @param {Object=} config The config.
1253
+ * @param {Object=} request The request.
1254
+ *
1255
+ * @returns {CanceledError} The created error.
1256
+ */
1257
+ constructor(t, r, n) {
1258
+ super(t ?? "canceled", b.ERR_CANCELED, r, n), this.name = "CanceledError", this.__CANCEL__ = !0;
1259
+ }
1260
+ };
1261
+ function xt(e, t, r) {
1262
+ const n = r.config.validateStatus;
1263
+ !r.status || !n || n(r.status) ? e(r) : t(new b(
1264
+ "Request failed with status code " + r.status,
1265
+ [b.ERR_BAD_REQUEST, b.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
1266
+ r.config,
1267
+ r.request,
1268
+ r
1269
+ ));
1270
+ }
1271
+ function nn(e) {
1272
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
1273
+ return t && t[1] || "";
1274
+ }
1275
+ function sn(e, t) {
1276
+ e = e || 10;
1277
+ const r = new Array(e), n = new Array(e);
1278
+ let s = 0, o = 0, i;
1279
+ return t = t !== void 0 ? t : 1e3, function(p) {
1280
+ const f = Date.now(), u = n[o];
1281
+ i || (i = f), r[s] = p, n[s] = f;
1282
+ let m = o, g = 0;
1283
+ for (; m !== s; )
1284
+ g += r[m++], m = m % e;
1285
+ if (s = (s + 1) % e, s === o && (o = (o + 1) % e), f - i < t)
1286
+ return;
1287
+ const O = u && f - u;
1288
+ return O ? Math.round(g * 1e3 / O) : void 0;
1289
+ };
1290
+ }
1291
+ function on(e, t) {
1292
+ let r = 0, n = 1e3 / t, s, o;
1293
+ const i = (f, u = Date.now()) => {
1294
+ r = u, s = null, o && (clearTimeout(o), o = null), e(...f);
1295
+ };
1296
+ return [(...f) => {
1297
+ const u = Date.now(), m = u - r;
1298
+ m >= n ? i(f, u) : (s = f, o || (o = setTimeout(() => {
1299
+ o = null, i(s);
1300
+ }, n - m)));
1301
+ }, () => s && i(s)];
1302
+ }
1303
+ const ge = (e, t, r = 3) => {
1304
+ let n = 0;
1305
+ const s = sn(50, 250);
1306
+ return on((o) => {
1307
+ const i = o.loaded, a = o.lengthComputable ? o.total : void 0, p = i - n, f = s(p), u = i <= a;
1308
+ n = i;
1309
+ const m = {
1310
+ loaded: i,
1311
+ total: a,
1312
+ progress: a ? i / a : void 0,
1313
+ bytes: p,
1314
+ rate: f || void 0,
1315
+ estimated: f && a && u ? (a - i) / f : void 0,
1316
+ event: o,
1317
+ lengthComputable: a != null,
1318
+ [t ? "download" : "upload"]: !0
1319
+ };
1320
+ e(m);
1321
+ }, r);
1322
+ }, Xe = (e, t) => {
1323
+ const r = e != null;
1324
+ return [(n) => t[0]({
1325
+ lengthComputable: r,
1326
+ total: e,
1327
+ loaded: n
1328
+ }), t[1]];
1329
+ }, Ge = (e) => (...t) => c.asap(() => e(...t)), an = k.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, k.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
1330
+ new URL(k.origin),
1331
+ k.navigator && /(msie|trident)/i.test(k.navigator.userAgent)
1332
+ ) : () => !0, cn = k.hasStandardBrowserEnv ? (
1333
+ // Standard browser envs support document.cookie
1334
+ {
1335
+ write(e, t, r, n, s, o, i) {
1336
+ if (typeof document > "u") return;
1337
+ const a = [`${e}=${encodeURIComponent(t)}`];
1338
+ c.isNumber(r) && a.push(`expires=${new Date(r).toUTCString()}`), c.isString(n) && a.push(`path=${n}`), c.isString(s) && a.push(`domain=${s}`), o === !0 && a.push("secure"), c.isString(i) && a.push(`SameSite=${i}`), document.cookie = a.join("; ");
1339
+ },
1340
+ read(e) {
1341
+ if (typeof document > "u") return null;
1342
+ const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
1343
+ return t ? decodeURIComponent(t[1]) : null;
1344
+ },
1345
+ remove(e) {
1346
+ this.write(e, "", Date.now() - 864e5, "/");
1347
+ }
1348
+ }
1349
+ ) : (
1350
+ // Non-standard browser env (web workers, react-native) lack needed support.
1351
+ {
1352
+ write() {
1353
+ },
1354
+ read() {
1355
+ return null;
1356
+ },
1357
+ remove() {
1358
+ }
1359
+ }
1360
+ );
1361
+ function ln(e) {
1362
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1363
+ }
1364
+ function un(e, t) {
1365
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1366
+ }
1367
+ function Ct(e, t, r) {
1368
+ let n = !ln(t);
1369
+ return e && (n || r == !1) ? un(e, t) : t;
1370
+ }
1371
+ const Ze = (e) => e instanceof D ? { ...e } : e;
1372
+ function W(e, t) {
1373
+ t = t || {};
1374
+ const r = {};
1375
+ function n(f, u, m, g) {
1376
+ return c.isPlainObject(f) && c.isPlainObject(u) ? c.merge.call({ caseless: g }, f, u) : c.isPlainObject(u) ? c.merge({}, u) : c.isArray(u) ? u.slice() : u;
1377
+ }
1378
+ function s(f, u, m, g) {
1379
+ if (c.isUndefined(u)) {
1380
+ if (!c.isUndefined(f))
1381
+ return n(void 0, f, m, g);
1382
+ } else return n(f, u, m, g);
1383
+ }
1384
+ function o(f, u) {
1385
+ if (!c.isUndefined(u))
1386
+ return n(void 0, u);
1387
+ }
1388
+ function i(f, u) {
1389
+ if (c.isUndefined(u)) {
1390
+ if (!c.isUndefined(f))
1391
+ return n(void 0, f);
1392
+ } else return n(void 0, u);
1393
+ }
1394
+ function a(f, u, m) {
1395
+ if (m in t)
1396
+ return n(f, u);
1397
+ if (m in e)
1398
+ return n(void 0, f);
1399
+ }
1400
+ const p = {
1401
+ url: o,
1402
+ method: o,
1403
+ data: o,
1404
+ baseURL: i,
1405
+ transformRequest: i,
1406
+ transformResponse: i,
1407
+ paramsSerializer: i,
1408
+ timeout: i,
1409
+ timeoutMessage: i,
1410
+ withCredentials: i,
1411
+ withXSRFToken: i,
1412
+ adapter: i,
1413
+ responseType: i,
1414
+ xsrfCookieName: i,
1415
+ xsrfHeaderName: i,
1416
+ onUploadProgress: i,
1417
+ onDownloadProgress: i,
1418
+ decompress: i,
1419
+ maxContentLength: i,
1420
+ maxBodyLength: i,
1421
+ beforeRedirect: i,
1422
+ transport: i,
1423
+ httpAgent: i,
1424
+ httpsAgent: i,
1425
+ cancelToken: i,
1426
+ socketPath: i,
1427
+ responseEncoding: i,
1428
+ validateStatus: a,
1429
+ headers: (f, u, m) => s(Ze(f), Ze(u), m, !0)
1430
+ };
1431
+ return c.forEach(Object.keys({ ...e, ...t }), function(u) {
1432
+ const m = p[u] || s, g = m(e[u], t[u], u);
1433
+ c.isUndefined(g) && m !== a || (r[u] = g);
1434
+ }), r;
1435
+ }
1436
+ const Nt = (e) => {
1437
+ const t = W({}, e);
1438
+ let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = t;
1439
+ if (t.headers = i = D.from(i), t.url = _t(Ct(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1440
+ "Authorization",
1441
+ "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1442
+ ), c.isFormData(r)) {
1443
+ if (k.hasStandardBrowserEnv || k.hasStandardBrowserWebWorkerEnv)
1444
+ i.setContentType(void 0);
1445
+ else if (c.isFunction(r.getHeaders)) {
1446
+ const p = r.getHeaders(), f = ["content-type", "content-length"];
1447
+ Object.entries(p).forEach(([u, m]) => {
1448
+ f.includes(u.toLowerCase()) && i.set(u, m);
1449
+ });
1450
+ }
1451
+ }
1452
+ if (k.hasStandardBrowserEnv && (n && c.isFunction(n) && (n = n(t)), n || n !== !1 && an(t.url))) {
1453
+ const p = s && o && cn.read(o);
1454
+ p && i.set(s, p);
1455
+ }
1456
+ return t;
1457
+ }, fn = typeof XMLHttpRequest < "u", dn = fn && function(e) {
1458
+ return new Promise(function(r, n) {
1459
+ const s = Nt(e);
1460
+ let o = s.data;
1461
+ const i = D.from(s.headers).normalize();
1462
+ let { responseType: a, onUploadProgress: p, onDownloadProgress: f } = s, u, m, g, O, d;
1463
+ function y() {
1464
+ O && O(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
1465
+ }
1466
+ let h = new XMLHttpRequest();
1467
+ h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1468
+ function S() {
1469
+ if (!h)
1470
+ return;
1471
+ const w = D.from(
1472
+ "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1473
+ ), P = {
1474
+ data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1475
+ status: h.status,
1476
+ statusText: h.statusText,
1477
+ headers: w,
1478
+ config: e,
1479
+ request: h
1480
+ };
1481
+ xt(function(j) {
1482
+ r(j), y();
1483
+ }, function(j) {
1484
+ n(j), y();
1485
+ }, P), h = null;
1486
+ }
1487
+ "onloadend" in h ? h.onloadend = S : h.onreadystatechange = function() {
1488
+ !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(S);
1489
+ }, h.onabort = function() {
1490
+ h && (n(new b("Request aborted", b.ECONNABORTED, e, h)), h = null);
1491
+ }, h.onerror = function(_) {
1492
+ const P = _ && _.message ? _.message : "Network Error", U = new b(P, b.ERR_NETWORK, e, h);
1493
+ U.event = _ || null, n(U), h = null;
1494
+ }, h.ontimeout = function() {
1495
+ let _ = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1496
+ const P = s.transitional || Tt;
1497
+ s.timeoutErrorMessage && (_ = s.timeoutErrorMessage), n(new b(
1498
+ _,
1499
+ P.clarifyTimeoutError ? b.ETIMEDOUT : b.ECONNABORTED,
1500
+ e,
1501
+ h
1502
+ )), h = null;
1503
+ }, o === void 0 && i.setContentType(null), "setRequestHeader" in h && c.forEach(i.toJSON(), function(_, P) {
1504
+ h.setRequestHeader(P, _);
1505
+ }), c.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), f && ([g, d] = ge(f, !0), h.addEventListener("progress", g)), p && h.upload && ([m, O] = ge(p), h.upload.addEventListener("progress", m), h.upload.addEventListener("loadend", O)), (s.cancelToken || s.signal) && (u = (w) => {
1506
+ h && (n(!w || w.type ? new ue(null, e, h) : w), h.abort(), h = null);
1507
+ }, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
1508
+ const x = nn(s.url);
1509
+ if (x && k.protocols.indexOf(x) === -1) {
1510
+ n(new b("Unsupported protocol " + x + ":", b.ERR_BAD_REQUEST, e));
1511
+ return;
1512
+ }
1513
+ h.send(o || null);
1514
+ });
1515
+ }, pn = (e, t) => {
1516
+ const { length: r } = e = e ? e.filter(Boolean) : [];
1517
+ if (t || r) {
1518
+ let n = new AbortController(), s;
1519
+ const o = function(f) {
1520
+ if (!s) {
1521
+ s = !0, a();
1522
+ const u = f instanceof Error ? f : this.reason;
1523
+ n.abort(u instanceof b ? u : new ue(u instanceof Error ? u.message : u));
1524
+ }
1525
+ };
1526
+ let i = t && setTimeout(() => {
1527
+ i = null, o(new b(`timeout of ${t}ms exceeded`, b.ETIMEDOUT));
1528
+ }, t);
1529
+ const a = () => {
1530
+ e && (i && clearTimeout(i), i = null, e.forEach((f) => {
1531
+ f.unsubscribe ? f.unsubscribe(o) : f.removeEventListener("abort", o);
1532
+ }), e = null);
1533
+ };
1534
+ e.forEach((f) => f.addEventListener("abort", o));
1535
+ const { signal: p } = n;
1536
+ return p.unsubscribe = () => c.asap(a), p;
1537
+ }
1538
+ }, hn = function* (e, t) {
1539
+ let r = e.byteLength;
1540
+ if (r < t) {
1541
+ yield e;
1542
+ return;
1543
+ }
1544
+ let n = 0, s;
1545
+ for (; n < r; )
1546
+ s = n + t, yield e.slice(n, s), n = s;
1547
+ }, mn = async function* (e, t) {
1548
+ for await (const r of yn(e))
1549
+ yield* hn(r, t);
1550
+ }, yn = async function* (e) {
1551
+ if (e[Symbol.asyncIterator]) {
1552
+ yield* e;
1553
+ return;
1554
+ }
1555
+ const t = e.getReader();
1556
+ try {
1557
+ for (; ; ) {
1558
+ const { done: r, value: n } = await t.read();
1559
+ if (r)
1560
+ break;
1561
+ yield n;
1562
+ }
1563
+ } finally {
1564
+ await t.cancel();
1565
+ }
1566
+ }, Qe = (e, t, r, n) => {
1567
+ const s = mn(e, t);
1568
+ let o = 0, i, a = (p) => {
1569
+ i || (i = !0, n && n(p));
1570
+ };
1571
+ return new ReadableStream({
1572
+ async pull(p) {
1573
+ try {
1574
+ const { done: f, value: u } = await s.next();
1575
+ if (f) {
1576
+ a(), p.close();
1577
+ return;
1578
+ }
1579
+ let m = u.byteLength;
1580
+ if (r) {
1581
+ let g = o += m;
1582
+ r(g);
1583
+ }
1584
+ p.enqueue(new Uint8Array(u));
1585
+ } catch (f) {
1586
+ throw a(f), f;
1587
+ }
1588
+ },
1589
+ cancel(p) {
1590
+ return a(p), s.return();
1591
+ }
1592
+ }, {
1593
+ highWaterMark: 2
1594
+ });
1595
+ }, et = 64 * 1024, { isFunction: ye } = c, wn = (({ Request: e, Response: t }) => ({
1596
+ Request: e,
1597
+ Response: t
1598
+ }))(c.global), {
1599
+ ReadableStream: tt,
1600
+ TextEncoder: rt
1601
+ } = c.global, nt = (e, ...t) => {
1602
+ try {
1603
+ return !!e(...t);
1604
+ } catch {
1605
+ return !1;
1606
+ }
1607
+ }, bn = (e) => {
1608
+ e = c.merge.call({
1609
+ skipUndefined: !0
1610
+ }, wn, e);
1611
+ const { fetch: t, Request: r, Response: n } = e, s = t ? ye(t) : typeof fetch == "function", o = ye(r), i = ye(n);
1612
+ if (!s)
1613
+ return !1;
1614
+ const a = s && ye(tt), p = s && (typeof rt == "function" ? /* @__PURE__ */ ((d) => (y) => d.encode(y))(new rt()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), f = o && a && nt(() => {
1615
+ let d = !1;
1616
+ const y = new r(k.origin, {
1617
+ body: new tt(),
1618
+ method: "POST",
1619
+ get duplex() {
1620
+ return d = !0, "half";
1621
+ }
1622
+ }).headers.has("Content-Type");
1623
+ return d && !y;
1624
+ }), u = i && a && nt(() => c.isReadableStream(new n("").body)), m = {
1625
+ stream: u && ((d) => d.body)
1626
+ };
1627
+ s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
1628
+ !m[d] && (m[d] = (y, h) => {
1629
+ let S = y && y[d];
1630
+ if (S)
1631
+ return S.call(y);
1632
+ throw new b(`Response type '${d}' is not supported`, b.ERR_NOT_SUPPORT, h);
1633
+ });
1634
+ });
1635
+ const g = async (d) => {
1636
+ if (d == null)
1637
+ return 0;
1638
+ if (c.isBlob(d))
1639
+ return d.size;
1640
+ if (c.isSpecCompliantForm(d))
1641
+ return (await new r(k.origin, {
1642
+ method: "POST",
1643
+ body: d
1644
+ }).arrayBuffer()).byteLength;
1645
+ if (c.isArrayBufferView(d) || c.isArrayBuffer(d))
1646
+ return d.byteLength;
1647
+ if (c.isURLSearchParams(d) && (d = d + ""), c.isString(d))
1648
+ return (await p(d)).byteLength;
1649
+ }, O = async (d, y) => {
1650
+ const h = c.toFiniteNumber(d.getContentLength());
1651
+ return h ?? g(y);
1652
+ };
1653
+ return async (d) => {
1654
+ let {
1655
+ url: y,
1656
+ method: h,
1657
+ data: S,
1658
+ signal: x,
1659
+ cancelToken: w,
1660
+ timeout: _,
1661
+ onDownloadProgress: P,
1662
+ onUploadProgress: U,
1663
+ responseType: j,
1664
+ headers: Z,
1665
+ withCredentials: $ = "same-origin",
1666
+ fetchOptions: fe
1667
+ } = Nt(d), de = t || fetch;
1668
+ j = j ? (j + "").toLowerCase() : "text";
1669
+ let q = pn([x, w && w.toAbortSignal()], _), H = null;
1670
+ const M = q && q.unsubscribe && (() => {
1671
+ q.unsubscribe();
1672
+ });
1673
+ let K;
1674
+ try {
1675
+ if (U && f && h !== "get" && h !== "head" && (K = await O(Z, S)) !== 0) {
1676
+ let l = new r(y, {
1677
+ method: "POST",
1678
+ body: S,
1679
+ duplex: "half"
1680
+ }), E;
1681
+ if (c.isFormData(S) && (E = l.headers.get("content-type")) && Z.setContentType(E), l.body) {
1682
+ const [T, A] = Xe(
1683
+ K,
1684
+ ge(Ge(U))
1685
+ );
1686
+ S = Qe(l.body, et, T, A);
1687
+ }
1688
+ }
1689
+ c.isString($) || ($ = $ ? "include" : "omit");
1690
+ const L = o && "credentials" in r.prototype, Q = {
1691
+ ...fe,
1692
+ signal: q,
1693
+ method: h.toUpperCase(),
1694
+ headers: Z.normalize().toJSON(),
1695
+ body: S,
1696
+ duplex: "half",
1697
+ credentials: L ? $ : void 0
1698
+ };
1699
+ H = o && new r(y, Q);
1700
+ let v = await (o ? de(H, fe) : de(y, Q));
1701
+ const ee = u && (j === "stream" || j === "response");
1702
+ if (u && (P || ee && M)) {
1703
+ const l = {};
1704
+ ["status", "statusText", "headers"].forEach((z) => {
1705
+ l[z] = v[z];
1706
+ });
1707
+ const E = c.toFiniteNumber(v.headers.get("content-length")), [T, A] = P && Xe(
1708
+ E,
1709
+ ge(Ge(P), !0)
1710
+ ) || [];
1711
+ v = new n(
1712
+ Qe(v.body, et, T, () => {
1713
+ A && A(), M && M();
1714
+ }),
1715
+ l
1716
+ );
1717
+ }
1718
+ j = j || "text";
1719
+ let pe = await m[c.findKey(m, j) || "text"](v, d);
1720
+ return !ee && M && M(), await new Promise((l, E) => {
1721
+ xt(l, E, {
1722
+ data: pe,
1723
+ headers: D.from(v.headers),
1724
+ status: v.status,
1725
+ statusText: v.statusText,
1726
+ config: d,
1727
+ request: H
1728
+ });
1729
+ });
1730
+ } catch (L) {
1731
+ throw M && M(), L && L.name === "TypeError" && /Load failed|fetch/i.test(L.message) ? Object.assign(
1732
+ new b("Network Error", b.ERR_NETWORK, d, H),
1733
+ {
1734
+ cause: L.cause || L
1735
+ }
1736
+ ) : b.from(L, L && L.code, d, H);
1737
+ }
1738
+ };
1739
+ }, En = /* @__PURE__ */ new Map(), Pt = (e) => {
1740
+ let t = e && e.env || {};
1741
+ const { fetch: r, Request: n, Response: s } = t, o = [
1742
+ n,
1743
+ s,
1744
+ r
1745
+ ];
1746
+ let i = o.length, a = i, p, f, u = En;
1747
+ for (; a--; )
1748
+ p = o[a], f = u.get(p), f === void 0 && u.set(p, f = a ? /* @__PURE__ */ new Map() : bn(t)), u = f;
1749
+ return f;
1750
+ };
1751
+ Pt();
1752
+ const Me = {
1753
+ http: Lr,
1754
+ xhr: dn,
1755
+ fetch: {
1756
+ get: Pt
1757
+ }
1758
+ };
1759
+ c.forEach(Me, (e, t) => {
1760
+ if (e) {
1761
+ try {
1762
+ Object.defineProperty(e, "name", { value: t });
1763
+ } catch {
1764
+ }
1765
+ Object.defineProperty(e, "adapterName", { value: t });
1766
+ }
1767
+ });
1768
+ const st = (e) => `- ${e}`, gn = (e) => c.isFunction(e) || e === null || e === !1;
1769
+ function Rn(e, t) {
1770
+ e = c.isArray(e) ? e : [e];
1771
+ const { length: r } = e;
1772
+ let n, s;
1773
+ const o = {};
1774
+ for (let i = 0; i < r; i++) {
1775
+ n = e[i];
1776
+ let a;
1777
+ if (s = n, !gn(n) && (s = Me[(a = String(n)).toLowerCase()], s === void 0))
1778
+ throw new b(`Unknown adapter '${a}'`);
1779
+ if (s && (c.isFunction(s) || (s = s.get(t))))
1780
+ break;
1781
+ o[a || "#" + i] = s;
1782
+ }
1783
+ if (!s) {
1784
+ const i = Object.entries(o).map(
1785
+ ([p, f]) => `adapter ${p} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1786
+ );
1787
+ let a = r ? i.length > 1 ? `since :
1788
+ ` + i.map(st).join(`
1789
+ `) : " " + st(i[0]) : "as no adapter specified";
1790
+ throw new b(
1791
+ "There is no suitable adapter to dispatch the request " + a,
1792
+ "ERR_NOT_SUPPORT"
1793
+ );
1794
+ }
1795
+ return s;
1796
+ }
1797
+ const kt = {
1798
+ /**
1799
+ * Resolve an adapter from a list of adapter names or functions.
1800
+ * @type {Function}
1801
+ */
1802
+ getAdapter: Rn,
1803
+ /**
1804
+ * Exposes all known adapters
1805
+ * @type {Object<string, Function|Object>}
1806
+ */
1807
+ adapters: Me
1808
+ };
1809
+ function Pe(e) {
1810
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1811
+ throw new ue(null, e);
1812
+ }
1813
+ function ot(e) {
1814
+ return Pe(e), e.headers = D.from(e.headers), e.data = Ne.call(
1815
+ e,
1816
+ e.transformRequest
1817
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), kt.getAdapter(e.adapter || le.adapter, e)(e).then(function(n) {
1818
+ return Pe(e), n.data = Ne.call(
1819
+ e,
1820
+ e.transformResponse,
1821
+ n
1822
+ ), n.headers = D.from(n.headers), n;
1823
+ }, function(n) {
1824
+ return At(n) || (Pe(e), n && n.response && (n.response.data = Ne.call(
1825
+ e,
1826
+ e.transformResponse,
1827
+ n.response
1828
+ ), n.response.headers = D.from(n.response.headers))), Promise.reject(n);
1829
+ });
1830
+ }
1831
+ const jt = "1.13.4", Oe = {};
1832
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1833
+ Oe[e] = function(n) {
1834
+ return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
1835
+ };
1836
+ });
1837
+ const it = {};
1838
+ Oe.transitional = function(t, r, n) {
1839
+ function s(o, i) {
1840
+ return "[Axios v" + jt + "] Transitional option '" + o + "'" + i + (n ? ". " + n : "");
1841
+ }
1842
+ return (o, i, a) => {
1843
+ if (t === !1)
1844
+ throw new b(
1845
+ s(i, " has been removed" + (r ? " in " + r : "")),
1846
+ b.ERR_DEPRECATED
1847
+ );
1848
+ return r && !it[i] && (it[i] = !0, console.warn(
1849
+ s(
1850
+ i,
1851
+ " has been deprecated since v" + r + " and will be removed in the near future"
1852
+ )
1853
+ )), t ? t(o, i, a) : !0;
1854
+ };
1855
+ };
1856
+ Oe.spelling = function(t) {
1857
+ return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
1858
+ };
1859
+ function Sn(e, t, r) {
1860
+ if (typeof e != "object")
1861
+ throw new b("options must be an object", b.ERR_BAD_OPTION_VALUE);
1862
+ const n = Object.keys(e);
1863
+ let s = n.length;
1864
+ for (; s-- > 0; ) {
1865
+ const o = n[s], i = t[o];
1866
+ if (i) {
1867
+ const a = e[o], p = a === void 0 || i(a, o, e);
1868
+ if (p !== !0)
1869
+ throw new b("option " + o + " must be " + p, b.ERR_BAD_OPTION_VALUE);
1870
+ continue;
1871
+ }
1872
+ if (r !== !0)
1873
+ throw new b("Unknown option " + o, b.ERR_BAD_OPTION);
1874
+ }
1875
+ }
1876
+ const Ee = {
1877
+ assertOptions: Sn,
1878
+ validators: Oe
1879
+ }, B = Ee.validators;
1880
+ let V = class {
1881
+ constructor(t) {
1882
+ this.defaults = t || {}, this.interceptors = {
1883
+ request: new Ke(),
1884
+ response: new Ke()
1885
+ };
1886
+ }
1887
+ /**
1888
+ * Dispatch a request
1889
+ *
1890
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1891
+ * @param {?Object} config
1892
+ *
1893
+ * @returns {Promise} The Promise to be fulfilled
1894
+ */
1895
+ async request(t, r) {
1896
+ try {
1897
+ return await this._request(t, r);
1898
+ } catch (n) {
1899
+ if (n instanceof Error) {
1900
+ let s = {};
1901
+ Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1902
+ const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1903
+ try {
1904
+ n.stack ? o && !String(n.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (n.stack += `
1905
+ ` + o) : n.stack = o;
1906
+ } catch {
1907
+ }
1908
+ }
1909
+ throw n;
1910
+ }
1911
+ }
1912
+ _request(t, r) {
1913
+ typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = W(this.defaults, r);
1914
+ const { transitional: n, paramsSerializer: s, headers: o } = r;
1915
+ n !== void 0 && Ee.assertOptions(n, {
1916
+ silentJSONParsing: B.transitional(B.boolean),
1917
+ forcedJSONParsing: B.transitional(B.boolean),
1918
+ clarifyTimeoutError: B.transitional(B.boolean)
1919
+ }, !1), s != null && (c.isFunction(s) ? r.paramsSerializer = {
1920
+ serialize: s
1921
+ } : Ee.assertOptions(s, {
1922
+ encode: B.function,
1923
+ serialize: B.function
1924
+ }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), Ee.assertOptions(r, {
1925
+ baseUrl: B.spelling("baseURL"),
1926
+ withXsrfToken: B.spelling("withXSRFToken")
1927
+ }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
1928
+ let i = o && c.merge(
1929
+ o.common,
1930
+ o[r.method]
1931
+ );
1932
+ o && c.forEach(
1933
+ ["delete", "get", "head", "post", "put", "patch", "common"],
1934
+ (d) => {
1935
+ delete o[d];
1936
+ }
1937
+ ), r.headers = D.concat(i, o);
1938
+ const a = [];
1939
+ let p = !0;
1940
+ this.interceptors.request.forEach(function(y) {
1941
+ typeof y.runWhen == "function" && y.runWhen(r) === !1 || (p = p && y.synchronous, a.unshift(y.fulfilled, y.rejected));
1942
+ });
1943
+ const f = [];
1944
+ this.interceptors.response.forEach(function(y) {
1945
+ f.push(y.fulfilled, y.rejected);
1946
+ });
1947
+ let u, m = 0, g;
1948
+ if (!p) {
1949
+ const d = [ot.bind(this), void 0];
1950
+ for (d.unshift(...a), d.push(...f), g = d.length, u = Promise.resolve(r); m < g; )
1951
+ u = u.then(d[m++], d[m++]);
1952
+ return u;
1953
+ }
1954
+ g = a.length;
1955
+ let O = r;
1956
+ for (; m < g; ) {
1957
+ const d = a[m++], y = a[m++];
1958
+ try {
1959
+ O = d(O);
1960
+ } catch (h) {
1961
+ y.call(this, h);
1962
+ break;
1963
+ }
1964
+ }
1965
+ try {
1966
+ u = ot.call(this, O);
1967
+ } catch (d) {
1968
+ return Promise.reject(d);
1969
+ }
1970
+ for (m = 0, g = f.length; m < g; )
1971
+ u = u.then(f[m++], f[m++]);
1972
+ return u;
1973
+ }
1974
+ getUri(t) {
1975
+ t = W(this.defaults, t);
1976
+ const r = Ct(t.baseURL, t.url, t.allowAbsoluteUrls);
1977
+ return _t(r, t.params, t.paramsSerializer);
1978
+ }
1979
+ };
1980
+ c.forEach(["delete", "get", "head", "options"], function(t) {
1981
+ V.prototype[t] = function(r, n) {
1982
+ return this.request(W(n || {}, {
1983
+ method: t,
1984
+ url: r,
1985
+ data: (n || {}).data
1986
+ }));
1987
+ };
1988
+ });
1989
+ c.forEach(["post", "put", "patch"], function(t) {
1990
+ function r(n) {
1991
+ return function(o, i, a) {
1992
+ return this.request(W(a || {}, {
1993
+ method: t,
1994
+ headers: n ? {
1995
+ "Content-Type": "multipart/form-data"
1996
+ } : {},
1997
+ url: o,
1998
+ data: i
1999
+ }));
2000
+ };
2001
+ }
2002
+ V.prototype[t] = r(), V.prototype[t + "Form"] = r(!0);
2003
+ });
2004
+ let _n = class Ft {
2005
+ constructor(t) {
2006
+ if (typeof t != "function")
2007
+ throw new TypeError("executor must be a function.");
2008
+ let r;
2009
+ this.promise = new Promise(function(o) {
2010
+ r = o;
2011
+ });
2012
+ const n = this;
2013
+ this.promise.then((s) => {
2014
+ if (!n._listeners) return;
2015
+ let o = n._listeners.length;
2016
+ for (; o-- > 0; )
2017
+ n._listeners[o](s);
2018
+ n._listeners = null;
2019
+ }), this.promise.then = (s) => {
2020
+ let o;
2021
+ const i = new Promise((a) => {
2022
+ n.subscribe(a), o = a;
2023
+ }).then(s);
2024
+ return i.cancel = function() {
2025
+ n.unsubscribe(o);
2026
+ }, i;
2027
+ }, t(function(o, i, a) {
2028
+ n.reason || (n.reason = new ue(o, i, a), r(n.reason));
2029
+ });
2030
+ }
2031
+ /**
2032
+ * Throws a `CanceledError` if cancellation has been requested.
2033
+ */
2034
+ throwIfRequested() {
2035
+ if (this.reason)
2036
+ throw this.reason;
2037
+ }
2038
+ /**
2039
+ * Subscribe to the cancel signal
2040
+ */
2041
+ subscribe(t) {
2042
+ if (this.reason) {
2043
+ t(this.reason);
2044
+ return;
2045
+ }
2046
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
2047
+ }
2048
+ /**
2049
+ * Unsubscribe from the cancel signal
2050
+ */
2051
+ unsubscribe(t) {
2052
+ if (!this._listeners)
2053
+ return;
2054
+ const r = this._listeners.indexOf(t);
2055
+ r !== -1 && this._listeners.splice(r, 1);
2056
+ }
2057
+ toAbortSignal() {
2058
+ const t = new AbortController(), r = (n) => {
2059
+ t.abort(n);
2060
+ };
2061
+ return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), t.signal;
2062
+ }
2063
+ /**
2064
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
2065
+ * cancels the `CancelToken`.
2066
+ */
2067
+ static source() {
2068
+ let t;
2069
+ return {
2070
+ token: new Ft(function(s) {
2071
+ t = s;
2072
+ }),
2073
+ cancel: t
2074
+ };
2075
+ }
2076
+ };
2077
+ function Tn(e) {
2078
+ return function(r) {
2079
+ return e.apply(null, r);
2080
+ };
2081
+ }
2082
+ function On(e) {
2083
+ return c.isObject(e) && e.isAxiosError === !0;
2084
+ }
2085
+ const Le = {
2086
+ Continue: 100,
2087
+ SwitchingProtocols: 101,
2088
+ Processing: 102,
2089
+ EarlyHints: 103,
2090
+ Ok: 200,
2091
+ Created: 201,
2092
+ Accepted: 202,
2093
+ NonAuthoritativeInformation: 203,
2094
+ NoContent: 204,
2095
+ ResetContent: 205,
2096
+ PartialContent: 206,
2097
+ MultiStatus: 207,
2098
+ AlreadyReported: 208,
2099
+ ImUsed: 226,
2100
+ MultipleChoices: 300,
2101
+ MovedPermanently: 301,
2102
+ Found: 302,
2103
+ SeeOther: 303,
2104
+ NotModified: 304,
2105
+ UseProxy: 305,
2106
+ Unused: 306,
2107
+ TemporaryRedirect: 307,
2108
+ PermanentRedirect: 308,
2109
+ BadRequest: 400,
2110
+ Unauthorized: 401,
2111
+ PaymentRequired: 402,
2112
+ Forbidden: 403,
2113
+ NotFound: 404,
2114
+ MethodNotAllowed: 405,
2115
+ NotAcceptable: 406,
2116
+ ProxyAuthenticationRequired: 407,
2117
+ RequestTimeout: 408,
2118
+ Conflict: 409,
2119
+ Gone: 410,
2120
+ LengthRequired: 411,
2121
+ PreconditionFailed: 412,
2122
+ PayloadTooLarge: 413,
2123
+ UriTooLong: 414,
2124
+ UnsupportedMediaType: 415,
2125
+ RangeNotSatisfiable: 416,
2126
+ ExpectationFailed: 417,
2127
+ ImATeapot: 418,
2128
+ MisdirectedRequest: 421,
2129
+ UnprocessableEntity: 422,
2130
+ Locked: 423,
2131
+ FailedDependency: 424,
2132
+ TooEarly: 425,
2133
+ UpgradeRequired: 426,
2134
+ PreconditionRequired: 428,
2135
+ TooManyRequests: 429,
2136
+ RequestHeaderFieldsTooLarge: 431,
2137
+ UnavailableForLegalReasons: 451,
2138
+ InternalServerError: 500,
2139
+ NotImplemented: 501,
2140
+ BadGateway: 502,
2141
+ ServiceUnavailable: 503,
2142
+ GatewayTimeout: 504,
2143
+ HttpVersionNotSupported: 505,
2144
+ VariantAlsoNegotiates: 506,
2145
+ InsufficientStorage: 507,
2146
+ LoopDetected: 508,
2147
+ NotExtended: 510,
2148
+ NetworkAuthenticationRequired: 511,
2149
+ WebServerIsDown: 521,
2150
+ ConnectionTimedOut: 522,
2151
+ OriginIsUnreachable: 523,
2152
+ TimeoutOccurred: 524,
2153
+ SslHandshakeFailed: 525,
2154
+ InvalidSslCertificate: 526
2155
+ };
2156
+ Object.entries(Le).forEach(([e, t]) => {
2157
+ Le[t] = e;
2158
+ });
2159
+ function Dt(e) {
2160
+ const t = new V(e), r = dt(V.prototype.request, t);
2161
+ return c.extend(r, V.prototype, t, { allOwnKeys: !0 }), c.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(s) {
2162
+ return Dt(W(e, s));
2163
+ }, r;
2164
+ }
2165
+ const C = Dt(le);
2166
+ C.Axios = V;
2167
+ C.CanceledError = ue;
2168
+ C.CancelToken = _n;
2169
+ C.isCancel = At;
2170
+ C.VERSION = jt;
2171
+ C.toFormData = Te;
2172
+ C.AxiosError = b;
2173
+ C.Cancel = C.CanceledError;
2174
+ C.all = function(t) {
2175
+ return Promise.all(t);
2176
+ };
2177
+ C.spread = Tn;
2178
+ C.isAxiosError = On;
2179
+ C.mergeConfig = W;
2180
+ C.AxiosHeaders = D;
2181
+ C.formToJSON = (e) => Ot(c.isHTMLForm(e) ? new FormData(e) : e);
2182
+ C.getAdapter = kt.getAdapter;
2183
+ C.HttpStatusCode = Le;
2184
+ C.default = C;
2185
+ const {
2186
+ Axios: Bn,
2187
+ AxiosError: Mn,
2188
+ CanceledError: $n,
2189
+ isCancel: qn,
2190
+ CancelToken: Hn,
2191
+ VERSION: zn,
2192
+ all: Jn,
2193
+ Cancel: Vn,
2194
+ isAxiosError: Wn,
2195
+ spread: Kn,
2196
+ toFormData: Yn,
2197
+ AxiosHeaders: Xn,
2198
+ HttpStatusCode: Gn,
2199
+ formToJSON: Zn,
2200
+ getAdapter: Qn,
2201
+ mergeConfig: es
2202
+ } = C, An = "http://localhost:8000/api";
2203
+ class xn {
2204
+ constructor(t, r = An) {
2205
+ $e(this, "client");
2206
+ this.client = C.create({
2207
+ baseURL: r,
2208
+ headers: {
2209
+ "Content-Type": "application/json",
2210
+ "X-API-Key": t
2211
+ },
2212
+ timeout: 3e4
2213
+ // 30 seconds
2214
+ }), this.client.interceptors.response.use(
2215
+ (n) => n,
2216
+ (n) => {
2217
+ var s, o;
2218
+ if ((s = n.response) != null && s.data) {
2219
+ const a = ((o = n.response.data.response) == null ? void 0 : o.message) || "An unknown error occurred";
2220
+ throw new Error(a);
2221
+ } else throw n.request ? new Error("No response from server. Please check your connection.") : new Error(n.message || "Request failed");
2222
+ }
2223
+ );
2224
+ }
2225
+ /**
2226
+ * Send a message to the customer support API
2227
+ */
2228
+ async sendMessage(t, r) {
2229
+ try {
2230
+ const n = await this.client.post("/chat/", {
2231
+ question: t,
2232
+ session_id: r
2233
+ });
2234
+ if (n.data.response.status !== "success")
2235
+ throw new Error(n.data.response.message);
2236
+ return n.data.data;
2237
+ } catch (n) {
2238
+ throw n instanceof Error ? n : new Error("Failed to send message");
2239
+ }
2240
+ }
2241
+ /**
2242
+ * Get conversation history for a session
2243
+ */
2244
+ async getConversationHistory(t) {
2245
+ try {
2246
+ const r = await this.client.get(
2247
+ `/chat/history/${t}/`
2248
+ );
2249
+ if (r.data.response.status !== "success")
2250
+ throw new Error(r.data.response.message);
2251
+ return r.data.data;
2252
+ } catch (r) {
2253
+ throw r instanceof Error ? r : new Error("Failed to load conversation history");
2254
+ }
2255
+ }
2256
+ /**
2257
+ * Update API key
2258
+ */
2259
+ updateApiKey(t) {
2260
+ this.client.defaults.headers.common["X-API-Key"] = t;
2261
+ }
2262
+ /**
2263
+ * Update base URL
2264
+ */
2265
+ updateBaseUrl(t) {
2266
+ this.client.defaults.baseURL = t;
2267
+ }
2268
+ }
2269
+ function at(e, t) {
2270
+ const [r, n] = se(() => {
2271
+ try {
2272
+ const o = window.localStorage.getItem(e);
2273
+ return o ? JSON.parse(o) : t;
2274
+ } catch (o) {
2275
+ return console.warn(`Error reading localStorage key "${e}":`, o), t;
2276
+ }
2277
+ });
2278
+ return [r, (o) => {
2279
+ try {
2280
+ const i = o instanceof Function ? o(r) : o;
2281
+ n(i), window.localStorage.setItem(e, JSON.stringify(i));
2282
+ } catch (i) {
2283
+ console.warn(`Error setting localStorage key "${e}":`, i);
2284
+ }
2285
+ }];
2286
+ }
2287
+ function ct() {
2288
+ return `session_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
2289
+ }
2290
+ const Cn = "customer_support_session_id", Nn = "customer_support_messages";
2291
+ function Pn(e) {
2292
+ const { apiKey: t, baseUrl: r, onError: n } = e, [s, o] = at(Nn, []), [i, a] = at(
2293
+ Cn,
2294
+ ct()
2295
+ ), [p, f] = se(!1), [u, m] = se(null), g = ut(null);
2296
+ Ue(() => {
2297
+ g.current = new xn(t, r);
2298
+ }, [t, r]);
2299
+ const O = he(() => {
2300
+ m(null);
2301
+ }, []), d = he(
2302
+ async (S) => {
2303
+ if (!g.current) {
2304
+ const w = new Error("API client not initialized");
2305
+ m(w), n == null || n(w);
2306
+ return;
2307
+ }
2308
+ if (!S.trim())
2309
+ return;
2310
+ const x = {
2311
+ id: `user_${Date.now()}`,
2312
+ role: "USER",
2313
+ content: S,
2314
+ timestamp: /* @__PURE__ */ new Date()
2315
+ };
2316
+ o((w) => [...w, x]), f(!0), m(null);
2317
+ try {
2318
+ const w = await g.current.sendMessage(S, i), _ = {
2319
+ id: `assistant_${Date.now()}`,
2320
+ role: "ASSISTANT",
2321
+ content: w.answer,
2322
+ timestamp: /* @__PURE__ */ new Date(),
2323
+ sources: w.sources
2324
+ };
2325
+ o((P) => [...P, _]), w.session_id !== i && a(w.session_id);
2326
+ } catch (w) {
2327
+ const _ = w instanceof Error ? w : new Error("Failed to send message");
2328
+ m(_), n == null || n(_);
2329
+ const P = {
2330
+ id: `error_${Date.now()}`,
2331
+ role: "ASSISTANT",
2332
+ content: `Sorry, I encountered an error: ${_.message}`,
2333
+ timestamp: /* @__PURE__ */ new Date()
2334
+ };
2335
+ o((U) => [...U, P]);
2336
+ } finally {
2337
+ f(!1);
2338
+ }
2339
+ },
2340
+ [i, n, o, a]
2341
+ ), y = he(async () => {
2342
+ if (!(!g.current || !i)) {
2343
+ f(!0), m(null);
2344
+ try {
2345
+ const x = (await g.current.getConversationHistory(i)).messages.map((w, _) => ({
2346
+ id: `${w.role.toLowerCase()}_${_}_${Date.now()}`,
2347
+ role: w.role,
2348
+ content: w.content,
2349
+ timestamp: new Date(w.created_at)
2350
+ }));
2351
+ o(x);
2352
+ } catch (S) {
2353
+ const x = S instanceof Error ? S : new Error("Failed to load history");
2354
+ m(x), n == null || n(x);
2355
+ } finally {
2356
+ f(!1);
2357
+ }
2358
+ }
2359
+ }, [i, n, o]), h = he(() => {
2360
+ o([]), a(ct());
2361
+ }, [o, a]);
2362
+ return {
2363
+ messages: s,
2364
+ sendMessage: d,
2365
+ isLoading: p,
2366
+ error: u,
2367
+ clearError: O,
2368
+ sessionId: i,
2369
+ loadHistory: y,
2370
+ clearHistory: h
2371
+ };
2372
+ }
2373
+ const kn = ({ message: e }) => {
2374
+ const t = e.role === "USER";
2375
+ return /* @__PURE__ */ R.jsxs("div", { className: `cs-message ${t ? "cs-message--user" : "cs-message--assistant"}`, children: [
2376
+ /* @__PURE__ */ R.jsxs("div", { className: "cs-message__content", children: [
2377
+ /* @__PURE__ */ R.jsx("p", { className: "cs-message__text", children: e.content }),
2378
+ e.sources && e.sources.length > 0 && /* @__PURE__ */ R.jsxs("div", { className: "cs-message__sources", children: [
2379
+ /* @__PURE__ */ R.jsx("p", { className: "cs-message__sources-title", children: "Sources:" }),
2380
+ /* @__PURE__ */ R.jsx("ul", { className: "cs-message__sources-list", children: e.sources.map((r, n) => /* @__PURE__ */ R.jsxs("li", { className: "cs-message__source-item", children: [
2381
+ /* @__PURE__ */ R.jsxs(
2382
+ "a",
2383
+ {
2384
+ href: r.url,
2385
+ target: "_blank",
2386
+ rel: "noopener noreferrer",
2387
+ className: "cs-message__source-link",
2388
+ children: [
2389
+ /* @__PURE__ */ R.jsx(Jt, { size: 12 }),
2390
+ /* @__PURE__ */ R.jsx("span", { children: r.title })
2391
+ ]
2392
+ }
2393
+ ),
2394
+ /* @__PURE__ */ R.jsxs("span", { className: "cs-message__source-similarity", children: [
2395
+ Math.round(r.similarity * 100),
2396
+ "% match"
2397
+ ] })
2398
+ ] }, n)) })
2399
+ ] })
2400
+ ] }),
2401
+ /* @__PURE__ */ R.jsx("time", { className: "cs-message__time", children: e.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) })
2402
+ ] });
2403
+ }, jn = ({
2404
+ onSendMessage: e,
2405
+ isLoading: t,
2406
+ placeholder: r = "Type your message..."
2407
+ }) => {
2408
+ const [n, s] = se(""), o = (a) => {
2409
+ a.preventDefault(), n.trim() && !t && (e(n), s(""));
2410
+ }, i = (a) => {
2411
+ a.key === "Enter" && !a.shiftKey && (a.preventDefault(), o(a));
2412
+ };
2413
+ return /* @__PURE__ */ R.jsxs("form", { className: "cs-input", onSubmit: o, children: [
2414
+ /* @__PURE__ */ R.jsx(
2415
+ "textarea",
2416
+ {
2417
+ className: "cs-input__textarea",
2418
+ value: n,
2419
+ onChange: (a) => s(a.target.value),
2420
+ onKeyDown: i,
2421
+ placeholder: r,
2422
+ disabled: t,
2423
+ rows: 1,
2424
+ "aria-label": "Message input"
2425
+ }
2426
+ ),
2427
+ /* @__PURE__ */ R.jsx(
2428
+ "button",
2429
+ {
2430
+ type: "submit",
2431
+ className: "cs-input__button",
2432
+ disabled: !n.trim() || t,
2433
+ "aria-label": "Send message",
2434
+ children: /* @__PURE__ */ R.jsx(Kt, { size: 20 })
2435
+ }
2436
+ )
2437
+ ] });
2438
+ }, Fn = ({
2439
+ messages: e,
2440
+ onSendMessage: t,
2441
+ onClose: r,
2442
+ isLoading: n,
2443
+ error: s,
2444
+ placeholder: o,
2445
+ welcomeMessage: i = "Hi! How can I help you today?"
2446
+ }) => {
2447
+ const a = ut(null);
2448
+ return Ue(() => {
2449
+ var p;
2450
+ (p = a.current) == null || p.scrollIntoView({ behavior: "smooth" });
2451
+ }, [e]), /* @__PURE__ */ R.jsxs("div", { className: "cs-window", children: [
2452
+ /* @__PURE__ */ R.jsxs("div", { className: "cs-window__header", children: [
2453
+ /* @__PURE__ */ R.jsx("h3", { className: "cs-window__title", children: "Customer Support" }),
2454
+ /* @__PURE__ */ R.jsx(
2455
+ "button",
2456
+ {
2457
+ className: "cs-window__close",
2458
+ onClick: r,
2459
+ "aria-label": "Close chat",
2460
+ children: /* @__PURE__ */ R.jsx(Yt, { size: 20 })
2461
+ }
2462
+ )
2463
+ ] }),
2464
+ /* @__PURE__ */ R.jsxs("div", { className: "cs-window__messages", children: [
2465
+ e.length === 0 && !n && /* @__PURE__ */ R.jsx("div", { className: "cs-window__welcome", children: /* @__PURE__ */ R.jsx("p", { children: i }) }),
2466
+ e.map((p) => /* @__PURE__ */ R.jsx(kn, { message: p }, p.id)),
2467
+ n && /* @__PURE__ */ R.jsxs("div", { className: "cs-window__typing", children: [
2468
+ /* @__PURE__ */ R.jsx(Vt, { size: 20, className: "cs-window__typing-icon" }),
2469
+ /* @__PURE__ */ R.jsx("span", { children: "Thinking..." })
2470
+ ] }),
2471
+ s && /* @__PURE__ */ R.jsx("div", { className: "cs-window__error", children: /* @__PURE__ */ R.jsx("p", { children: s.message }) }),
2472
+ /* @__PURE__ */ R.jsx("div", { ref: a })
2473
+ ] }),
2474
+ /* @__PURE__ */ R.jsx("div", { className: "cs-window__input-wrapper", children: /* @__PURE__ */ R.jsx(
2475
+ jn,
2476
+ {
2477
+ onSendMessage: t,
2478
+ isLoading: n,
2479
+ placeholder: o
2480
+ }
2481
+ ) })
2482
+ ] });
2483
+ }, ts = ({
2484
+ apiKey: e,
2485
+ baseUrl: t,
2486
+ theme: r,
2487
+ position: n = "bottom-right",
2488
+ welcomeMessage: s,
2489
+ placeholder: o,
2490
+ className: i = "",
2491
+ onError: a,
2492
+ onMessageSent: p,
2493
+ onMessageReceived: f
2494
+ }) => {
2495
+ const [u, m] = se(!1), {
2496
+ messages: g,
2497
+ sendMessage: O,
2498
+ isLoading: d,
2499
+ error: y,
2500
+ clearError: h
2501
+ } = Pn({
2502
+ apiKey: e,
2503
+ baseUrl: t,
2504
+ onError: a
2505
+ });
2506
+ Ue(() => {
2507
+ if (r) {
2508
+ const w = document.documentElement;
2509
+ r.primaryColor && w.style.setProperty("--cs-primary-color", r.primaryColor), r.secondaryColor && w.style.setProperty("--cs-secondary-color", r.secondaryColor), r.backgroundColor && w.style.setProperty("--cs-bg-color", r.backgroundColor), r.textColor && w.style.setProperty("--cs-text-color", r.textColor), r.fontFamily && w.style.setProperty("--cs-font-family", r.fontFamily), r.borderRadius && w.style.setProperty("--cs-border-radius", r.borderRadius), r.buttonColor && w.style.setProperty("--cs-button-color", r.buttonColor), r.userMessageColor && w.style.setProperty("--cs-user-message-color", r.userMessageColor), r.assistantMessageColor && w.style.setProperty("--cs-assistant-message-color", r.assistantMessageColor);
2510
+ }
2511
+ }, [r]);
2512
+ const S = async (w) => {
2513
+ if (p == null || p(w), await O(w), !y) {
2514
+ const _ = g[g.length - 1];
2515
+ (_ == null ? void 0 : _.role) === "ASSISTANT" && (f == null || f(_.content));
2516
+ }
2517
+ }, x = () => {
2518
+ m(!u), y && h();
2519
+ };
2520
+ return /* @__PURE__ */ R.jsxs("div", { className: `cs-widget cs-widget--${n} ${i}`, children: [
2521
+ u && /* @__PURE__ */ R.jsx(
2522
+ Fn,
2523
+ {
2524
+ messages: g,
2525
+ onSendMessage: S,
2526
+ onClose: () => m(!1),
2527
+ isLoading: d,
2528
+ error: y,
2529
+ placeholder: o,
2530
+ welcomeMessage: s
2531
+ }
2532
+ ),
2533
+ /* @__PURE__ */ R.jsxs(
2534
+ "button",
2535
+ {
2536
+ className: `cs-widget__toggle ${u ? "cs-widget__toggle--open" : ""}`,
2537
+ onClick: x,
2538
+ "aria-label": u ? "Close chat" : "Open chat",
2539
+ "aria-expanded": u,
2540
+ children: [
2541
+ /* @__PURE__ */ R.jsx(Wt, { size: 24 }),
2542
+ !u && g.length > 0 && /* @__PURE__ */ R.jsx("span", { className: "cs-widget__badge", children: g.filter((w) => w.role === "ASSISTANT").length })
2543
+ ]
2544
+ }
2545
+ )
2546
+ ] });
2547
+ };
2548
+ export {
2549
+ jn as ChatInput,
2550
+ kn as ChatMessage,
2551
+ Fn as ChatWindow,
2552
+ xn as CustomerSupportAPIClient,
2553
+ ts as CustomerSupportWidget,
2554
+ Pn as useCustomerSupport,
2555
+ at as useLocalStorage
2556
+ };
2557
+ //# sourceMappingURL=index.es.js.map