oauth0-js-lib 2.2.3 → 2.2.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.
@@ -0,0 +1,3616 @@
1
+ var vn = Object.defineProperty;
2
+ var xn = (e, t, r) => t in e ? vn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var F = (e, t, r) => xn(e, typeof t != "symbol" ? t + "" : t, r);
4
+ const Fn = {
5
+ baseUrl: "",
6
+ createEndpoint: "/api/oauth0/create",
7
+ authEventEndpoint: "/api/oauth0/auth-events",
8
+ authConfirmEndpoint: "/api/oauth0/auth-confirm"
9
+ }, Mn = typeof __OAUTH_LIB_CONFIG__ < "u" ? __OAUTH_LIB_CONFIG__ : void 0, kn = typeof globalThis < "u" && globalThis.OAUTH_LIB_CONFIG ? globalThis.OAUTH_LIB_CONFIG : void 0;
10
+ let nt = {
11
+ ...Fn,
12
+ ...Mn,
13
+ ...kn
14
+ };
15
+ function Vo(e) {
16
+ nt = { ...nt, ...e };
17
+ }
18
+ function Dn() {
19
+ return nt;
20
+ }
21
+ function on(e, t) {
22
+ return function() {
23
+ return e.apply(t, arguments);
24
+ };
25
+ }
26
+ const { toString: qn } = Object.prototype, { getPrototypeOf: at } = Object, { iterator: Te, toStringTag: sn } = Symbol, Ae = /* @__PURE__ */ ((e) => (t) => {
27
+ const r = qn.call(t);
28
+ return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
29
+ })(/* @__PURE__ */ Object.create(null)), H = (e) => (e = e.toLowerCase(), (t) => Ae(t) === e), Be = (e) => (t) => typeof t === e, { isArray: se } = Array, ie = Be("undefined");
30
+ function de(e) {
31
+ return e !== null && !ie(e) && e.constructor !== null && !ie(e.constructor) && M(e.constructor.isBuffer) && e.constructor.isBuffer(e);
32
+ }
33
+ const an = H("ArrayBuffer");
34
+ function jn(e) {
35
+ let t;
36
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && an(e.buffer), t;
37
+ }
38
+ const Hn = Be("string"), M = Be("function"), un = Be("number"), he = (e) => e !== null && typeof e == "object", zn = (e) => e === !0 || e === !1, Ee = (e) => {
39
+ if (Ae(e) !== "object")
40
+ return !1;
41
+ const t = at(e);
42
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(sn in e) && !(Te in e);
43
+ }, Vn = (e) => {
44
+ if (!he(e) || de(e))
45
+ return !1;
46
+ try {
47
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
48
+ } catch {
49
+ return !1;
50
+ }
51
+ }, $n = H("Date"), Jn = H("File"), Kn = H("Blob"), Wn = H("FileList"), Gn = (e) => he(e) && M(e.pipe), Qn = (e) => {
52
+ let t;
53
+ return e && (typeof FormData == "function" && e instanceof FormData || M(e.append) && ((t = Ae(e)) === "formdata" || // detect form-data instance
54
+ t === "object" && M(e.toString) && e.toString() === "[object FormData]"));
55
+ }, Yn = H("URLSearchParams"), [Xn, Zn, er, tr] = ["ReadableStream", "Request", "Response", "Headers"].map(H), nr = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
56
+ function pe(e, t, { allOwnKeys: r = !1 } = {}) {
57
+ if (e === null || typeof e > "u")
58
+ return;
59
+ let n, o;
60
+ if (typeof e != "object" && (e = [e]), se(e))
61
+ for (n = 0, o = e.length; n < o; n++)
62
+ t.call(null, e[n], n, e);
63
+ else {
64
+ if (de(e))
65
+ return;
66
+ const i = r ? Object.getOwnPropertyNames(e) : Object.keys(e), s = i.length;
67
+ let a;
68
+ for (n = 0; n < s; n++)
69
+ a = i[n], t.call(null, e[a], a, e);
70
+ }
71
+ }
72
+ function ln(e, t) {
73
+ if (de(e))
74
+ return null;
75
+ t = t.toLowerCase();
76
+ const r = Object.keys(e);
77
+ let n = r.length, o;
78
+ for (; n-- > 0; )
79
+ if (o = r[n], t === o.toLowerCase())
80
+ return o;
81
+ return null;
82
+ }
83
+ const Q = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, cn = (e) => !ie(e) && e !== Q;
84
+ function rt() {
85
+ const { caseless: e, skipUndefined: t } = cn(this) && this || {}, r = {}, n = (o, i) => {
86
+ const s = e && ln(r, i) || i;
87
+ Ee(r[s]) && Ee(o) ? r[s] = rt(r[s], o) : Ee(o) ? r[s] = rt({}, o) : se(o) ? r[s] = o.slice() : (!t || !ie(o)) && (r[s] = o);
88
+ };
89
+ for (let o = 0, i = arguments.length; o < i; o++)
90
+ arguments[o] && pe(arguments[o], n);
91
+ return r;
92
+ }
93
+ const rr = (e, t, r, { allOwnKeys: n } = {}) => (pe(t, (o, i) => {
94
+ r && M(o) ? e[i] = on(o, r) : e[i] = o;
95
+ }, { allOwnKeys: n }), e), or = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), ir = (e, t, r, n) => {
96
+ e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
97
+ value: t.prototype
98
+ }), r && Object.assign(e.prototype, r);
99
+ }, sr = (e, t, r, n) => {
100
+ let o, i, s;
101
+ const a = {};
102
+ if (t = t || {}, e == null) return t;
103
+ do {
104
+ for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
105
+ s = o[i], (!n || n(s, e, t)) && !a[s] && (t[s] = e[s], a[s] = !0);
106
+ e = r !== !1 && at(e);
107
+ } while (e && (!r || r(e, t)) && e !== Object.prototype);
108
+ return t;
109
+ }, ar = (e, t, r) => {
110
+ e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
111
+ const n = e.indexOf(t, r);
112
+ return n !== -1 && n === r;
113
+ }, ur = (e) => {
114
+ if (!e) return null;
115
+ if (se(e)) return e;
116
+ let t = e.length;
117
+ if (!un(t)) return null;
118
+ const r = new Array(t);
119
+ for (; t-- > 0; )
120
+ r[t] = e[t];
121
+ return r;
122
+ }, lr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && at(Uint8Array)), cr = (e, t) => {
123
+ const n = (e && e[Te]).call(e);
124
+ let o;
125
+ for (; (o = n.next()) && !o.done; ) {
126
+ const i = o.value;
127
+ t.call(e, i[0], i[1]);
128
+ }
129
+ }, fr = (e, t) => {
130
+ let r;
131
+ const n = [];
132
+ for (; (r = e.exec(t)) !== null; )
133
+ n.push(r);
134
+ return n;
135
+ }, dr = H("HTMLFormElement"), hr = (e) => e.toLowerCase().replace(
136
+ /[-_\s]([a-z\d])(\w*)/g,
137
+ function(r, n, o) {
138
+ return n.toUpperCase() + o;
139
+ }
140
+ ), pt = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), pr = H("RegExp"), fn = (e, t) => {
141
+ const r = Object.getOwnPropertyDescriptors(e), n = {};
142
+ pe(r, (o, i) => {
143
+ let s;
144
+ (s = t(o, i, e)) !== !1 && (n[i] = s || o);
145
+ }), Object.defineProperties(e, n);
146
+ }, gr = (e) => {
147
+ fn(e, (t, r) => {
148
+ if (M(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
149
+ return !1;
150
+ const n = e[r];
151
+ if (M(n)) {
152
+ if (t.enumerable = !1, "writable" in t) {
153
+ t.writable = !1;
154
+ return;
155
+ }
156
+ t.set || (t.set = () => {
157
+ throw Error("Can not rewrite read-only method '" + r + "'");
158
+ });
159
+ }
160
+ });
161
+ }, mr = (e, t) => {
162
+ const r = {}, n = (o) => {
163
+ o.forEach((i) => {
164
+ r[i] = !0;
165
+ });
166
+ };
167
+ return se(e) ? n(e) : n(String(e).split(t)), r;
168
+ }, yr = () => {
169
+ }, wr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
170
+ function br(e) {
171
+ return !!(e && M(e.append) && e[sn] === "FormData" && e[Te]);
172
+ }
173
+ const Er = (e) => {
174
+ const t = new Array(10), r = (n, o) => {
175
+ if (he(n)) {
176
+ if (t.indexOf(n) >= 0)
177
+ return;
178
+ if (de(n))
179
+ return n;
180
+ if (!("toJSON" in n)) {
181
+ t[o] = n;
182
+ const i = se(n) ? [] : {};
183
+ return pe(n, (s, a) => {
184
+ const u = r(s, o + 1);
185
+ !ie(u) && (i[a] = u);
186
+ }), t[o] = void 0, i;
187
+ }
188
+ }
189
+ return n;
190
+ };
191
+ return r(e, 0);
192
+ }, Cr = H("AsyncFunction"), Sr = (e) => e && (he(e) || M(e)) && M(e.then) && M(e.catch), dn = ((e, t) => e ? setImmediate : t ? ((r, n) => (Q.addEventListener("message", ({ source: o, data: i }) => {
193
+ o === Q && i === r && n.length && n.shift()();
194
+ }, !1), (o) => {
195
+ n.push(o), Q.postMessage(r, "*");
196
+ }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
197
+ typeof setImmediate == "function",
198
+ M(Q.postMessage)
199
+ ), Rr = typeof queueMicrotask < "u" ? queueMicrotask.bind(Q) : typeof process < "u" && process.nextTick || dn, Tr = (e) => e != null && M(e[Te]), f = {
200
+ isArray: se,
201
+ isArrayBuffer: an,
202
+ isBuffer: de,
203
+ isFormData: Qn,
204
+ isArrayBufferView: jn,
205
+ isString: Hn,
206
+ isNumber: un,
207
+ isBoolean: zn,
208
+ isObject: he,
209
+ isPlainObject: Ee,
210
+ isEmptyObject: Vn,
211
+ isReadableStream: Xn,
212
+ isRequest: Zn,
213
+ isResponse: er,
214
+ isHeaders: tr,
215
+ isUndefined: ie,
216
+ isDate: $n,
217
+ isFile: Jn,
218
+ isBlob: Kn,
219
+ isRegExp: pr,
220
+ isFunction: M,
221
+ isStream: Gn,
222
+ isURLSearchParams: Yn,
223
+ isTypedArray: lr,
224
+ isFileList: Wn,
225
+ forEach: pe,
226
+ merge: rt,
227
+ extend: rr,
228
+ trim: nr,
229
+ stripBOM: or,
230
+ inherits: ir,
231
+ toFlatObject: sr,
232
+ kindOf: Ae,
233
+ kindOfTest: H,
234
+ endsWith: ar,
235
+ toArray: ur,
236
+ forEachEntry: cr,
237
+ matchAll: fr,
238
+ isHTMLForm: dr,
239
+ hasOwnProperty: pt,
240
+ hasOwnProp: pt,
241
+ // an alias to avoid ESLint no-prototype-builtins detection
242
+ reduceDescriptors: fn,
243
+ freezeMethods: gr,
244
+ toObjectSet: mr,
245
+ toCamelCase: hr,
246
+ noop: yr,
247
+ toFiniteNumber: wr,
248
+ findKey: ln,
249
+ global: Q,
250
+ isContextDefined: cn,
251
+ isSpecCompliantForm: br,
252
+ toJSONObject: Er,
253
+ isAsyncFn: Cr,
254
+ isThenable: Sr,
255
+ setImmediate: dn,
256
+ asap: Rr,
257
+ isIterable: Tr
258
+ };
259
+ function I(e, t, r, n, o) {
260
+ Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), r && (this.config = r), n && (this.request = n), o && (this.response = o, this.status = o.status ? o.status : null);
261
+ }
262
+ f.inherits(I, Error, {
263
+ toJSON: function() {
264
+ return {
265
+ // Standard
266
+ message: this.message,
267
+ name: this.name,
268
+ // Microsoft
269
+ description: this.description,
270
+ number: this.number,
271
+ // Mozilla
272
+ fileName: this.fileName,
273
+ lineNumber: this.lineNumber,
274
+ columnNumber: this.columnNumber,
275
+ stack: this.stack,
276
+ // Axios
277
+ config: f.toJSONObject(this.config),
278
+ code: this.code,
279
+ status: this.status
280
+ };
281
+ }
282
+ });
283
+ const hn = I.prototype, pn = {};
284
+ [
285
+ "ERR_BAD_OPTION_VALUE",
286
+ "ERR_BAD_OPTION",
287
+ "ECONNABORTED",
288
+ "ETIMEDOUT",
289
+ "ERR_NETWORK",
290
+ "ERR_FR_TOO_MANY_REDIRECTS",
291
+ "ERR_DEPRECATED",
292
+ "ERR_BAD_RESPONSE",
293
+ "ERR_BAD_REQUEST",
294
+ "ERR_CANCELED",
295
+ "ERR_NOT_SUPPORT",
296
+ "ERR_INVALID_URL"
297
+ // eslint-disable-next-line func-names
298
+ ].forEach((e) => {
299
+ pn[e] = { value: e };
300
+ });
301
+ Object.defineProperties(I, pn);
302
+ Object.defineProperty(hn, "isAxiosError", { value: !0 });
303
+ I.from = (e, t, r, n, o, i) => {
304
+ const s = Object.create(hn);
305
+ f.toFlatObject(e, s, function(c) {
306
+ return c !== Error.prototype;
307
+ }, (l) => l !== "isAxiosError");
308
+ const a = e && e.message ? e.message : "Error", u = t == null && e ? e.code : t;
309
+ return I.call(s, a, u, r, n, o), e && s.cause == null && Object.defineProperty(s, "cause", { value: e, configurable: !0 }), s.name = e && e.name || "Error", i && Object.assign(s, i), s;
310
+ };
311
+ const Ar = null;
312
+ function ot(e) {
313
+ return f.isPlainObject(e) || f.isArray(e);
314
+ }
315
+ function gn(e) {
316
+ return f.endsWith(e, "[]") ? e.slice(0, -2) : e;
317
+ }
318
+ function gt(e, t, r) {
319
+ return e ? e.concat(t).map(function(o, i) {
320
+ return o = gn(o), !r && i ? "[" + o + "]" : o;
321
+ }).join(r ? "." : "") : t;
322
+ }
323
+ function Br(e) {
324
+ return f.isArray(e) && !e.some(ot);
325
+ }
326
+ const Nr = f.toFlatObject(f, {}, null, function(t) {
327
+ return /^is[A-Z]/.test(t);
328
+ });
329
+ function Ne(e, t, r) {
330
+ if (!f.isObject(e))
331
+ throw new TypeError("target must be an object");
332
+ t = t || new FormData(), r = f.toFlatObject(r, {
333
+ metaTokens: !0,
334
+ dots: !1,
335
+ indexes: !1
336
+ }, !1, function(p, g) {
337
+ return !f.isUndefined(g[p]);
338
+ });
339
+ const n = r.metaTokens, o = r.visitor || c, i = r.dots, s = r.indexes, u = (r.Blob || typeof Blob < "u" && Blob) && f.isSpecCompliantForm(t);
340
+ if (!f.isFunction(o))
341
+ throw new TypeError("visitor must be a function");
342
+ function l(d) {
343
+ if (d === null) return "";
344
+ if (f.isDate(d))
345
+ return d.toISOString();
346
+ if (f.isBoolean(d))
347
+ return d.toString();
348
+ if (!u && f.isBlob(d))
349
+ throw new I("Blob is not supported. Use a Buffer instead.");
350
+ return f.isArrayBuffer(d) || f.isTypedArray(d) ? u && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
351
+ }
352
+ function c(d, p, g) {
353
+ let w = d;
354
+ if (d && !g && typeof d == "object") {
355
+ if (f.endsWith(p, "{}"))
356
+ p = n ? p : p.slice(0, -2), d = JSON.stringify(d);
357
+ else if (f.isArray(d) && Br(d) || (f.isFileList(d) || f.endsWith(p, "[]")) && (w = f.toArray(d)))
358
+ return p = gn(p), w.forEach(function(E, R) {
359
+ !(f.isUndefined(E) || E === null) && t.append(
360
+ // eslint-disable-next-line no-nested-ternary
361
+ s === !0 ? gt([p], R, i) : s === null ? p : p + "[]",
362
+ l(E)
363
+ );
364
+ }), !1;
365
+ }
366
+ return ot(d) ? !0 : (t.append(gt(g, p, i), l(d)), !1);
367
+ }
368
+ const h = [], m = Object.assign(Nr, {
369
+ defaultVisitor: c,
370
+ convertValue: l,
371
+ isVisitable: ot
372
+ });
373
+ function y(d, p) {
374
+ if (!f.isUndefined(d)) {
375
+ if (h.indexOf(d) !== -1)
376
+ throw Error("Circular reference detected in " + p.join("."));
377
+ h.push(d), f.forEach(d, function(w, P) {
378
+ (!(f.isUndefined(w) || w === null) && o.call(
379
+ t,
380
+ w,
381
+ f.isString(P) ? P.trim() : P,
382
+ p,
383
+ m
384
+ )) === !0 && y(w, p ? p.concat(P) : [P]);
385
+ }), h.pop();
386
+ }
387
+ }
388
+ if (!f.isObject(e))
389
+ throw new TypeError("data must be an object");
390
+ return y(e), t;
391
+ }
392
+ function mt(e) {
393
+ const t = {
394
+ "!": "%21",
395
+ "'": "%27",
396
+ "(": "%28",
397
+ ")": "%29",
398
+ "~": "%7E",
399
+ "%20": "+",
400
+ "%00": "\0"
401
+ };
402
+ return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
403
+ return t[n];
404
+ });
405
+ }
406
+ function ut(e, t) {
407
+ this._pairs = [], e && Ne(e, this, t);
408
+ }
409
+ const mn = ut.prototype;
410
+ mn.append = function(t, r) {
411
+ this._pairs.push([t, r]);
412
+ };
413
+ mn.toString = function(t) {
414
+ const r = t ? function(n) {
415
+ return t.call(this, n, mt);
416
+ } : mt;
417
+ return this._pairs.map(function(o) {
418
+ return r(o[0]) + "=" + r(o[1]);
419
+ }, "").join("&");
420
+ };
421
+ function Pr(e) {
422
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
423
+ }
424
+ function yn(e, t, r) {
425
+ if (!t)
426
+ return e;
427
+ const n = r && r.encode || Pr;
428
+ f.isFunction(r) && (r = {
429
+ serialize: r
430
+ });
431
+ const o = r && r.serialize;
432
+ let i;
433
+ if (o ? i = o(t, r) : i = f.isURLSearchParams(t) ? t.toString() : new ut(t, r).toString(n), i) {
434
+ const s = e.indexOf("#");
435
+ s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
436
+ }
437
+ return e;
438
+ }
439
+ class yt {
440
+ constructor() {
441
+ this.handlers = [];
442
+ }
443
+ /**
444
+ * Add a new interceptor to the stack
445
+ *
446
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
447
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
448
+ *
449
+ * @return {Number} An ID used to remove interceptor later
450
+ */
451
+ use(t, r, n) {
452
+ return this.handlers.push({
453
+ fulfilled: t,
454
+ rejected: r,
455
+ synchronous: n ? n.synchronous : !1,
456
+ runWhen: n ? n.runWhen : null
457
+ }), this.handlers.length - 1;
458
+ }
459
+ /**
460
+ * Remove an interceptor from the stack
461
+ *
462
+ * @param {Number} id The ID that was returned by `use`
463
+ *
464
+ * @returns {void}
465
+ */
466
+ eject(t) {
467
+ this.handlers[t] && (this.handlers[t] = null);
468
+ }
469
+ /**
470
+ * Clear all interceptors from the stack
471
+ *
472
+ * @returns {void}
473
+ */
474
+ clear() {
475
+ this.handlers && (this.handlers = []);
476
+ }
477
+ /**
478
+ * Iterate over all the registered interceptors
479
+ *
480
+ * This method is particularly useful for skipping over any
481
+ * interceptors that may have become `null` calling `eject`.
482
+ *
483
+ * @param {Function} fn The function to call for each interceptor
484
+ *
485
+ * @returns {void}
486
+ */
487
+ forEach(t) {
488
+ f.forEach(this.handlers, function(n) {
489
+ n !== null && t(n);
490
+ });
491
+ }
492
+ }
493
+ const wn = {
494
+ silentJSONParsing: !0,
495
+ forcedJSONParsing: !0,
496
+ clarifyTimeoutError: !1
497
+ }, Or = typeof URLSearchParams < "u" ? URLSearchParams : ut, Lr = typeof FormData < "u" ? FormData : null, Ir = typeof Blob < "u" ? Blob : null, _r = {
498
+ isBrowser: !0,
499
+ classes: {
500
+ URLSearchParams: Or,
501
+ FormData: Lr,
502
+ Blob: Ir
503
+ },
504
+ protocols: ["http", "https", "file", "blob", "url", "data"]
505
+ }, lt = typeof window < "u" && typeof document < "u", it = typeof navigator == "object" && navigator || void 0, Ur = lt && (!it || ["ReactNative", "NativeScript", "NS"].indexOf(it.product) < 0), vr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
506
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", xr = lt && window.location.href || "http://localhost", Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
507
+ __proto__: null,
508
+ hasBrowserEnv: lt,
509
+ hasStandardBrowserEnv: Ur,
510
+ hasStandardBrowserWebWorkerEnv: vr,
511
+ navigator: it,
512
+ origin: xr
513
+ }, Symbol.toStringTag, { value: "Module" })), x = {
514
+ ...Fr,
515
+ ..._r
516
+ };
517
+ function Mr(e, t) {
518
+ return Ne(e, new x.classes.URLSearchParams(), {
519
+ visitor: function(r, n, o, i) {
520
+ return x.isNode && f.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
521
+ },
522
+ ...t
523
+ });
524
+ }
525
+ function kr(e) {
526
+ return f.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
527
+ }
528
+ function Dr(e) {
529
+ const t = {}, r = Object.keys(e);
530
+ let n;
531
+ const o = r.length;
532
+ let i;
533
+ for (n = 0; n < o; n++)
534
+ i = r[n], t[i] = e[i];
535
+ return t;
536
+ }
537
+ function bn(e) {
538
+ function t(r, n, o, i) {
539
+ let s = r[i++];
540
+ if (s === "__proto__") return !0;
541
+ const a = Number.isFinite(+s), u = i >= r.length;
542
+ return s = !s && f.isArray(o) ? o.length : s, u ? (f.hasOwnProp(o, s) ? o[s] = [o[s], n] : o[s] = n, !a) : ((!o[s] || !f.isObject(o[s])) && (o[s] = []), t(r, n, o[s], i) && f.isArray(o[s]) && (o[s] = Dr(o[s])), !a);
543
+ }
544
+ if (f.isFormData(e) && f.isFunction(e.entries)) {
545
+ const r = {};
546
+ return f.forEachEntry(e, (n, o) => {
547
+ t(kr(n), o, r, 0);
548
+ }), r;
549
+ }
550
+ return null;
551
+ }
552
+ function qr(e, t, r) {
553
+ if (f.isString(e))
554
+ try {
555
+ return (t || JSON.parse)(e), f.trim(e);
556
+ } catch (n) {
557
+ if (n.name !== "SyntaxError")
558
+ throw n;
559
+ }
560
+ return (r || JSON.stringify)(e);
561
+ }
562
+ const ge = {
563
+ transitional: wn,
564
+ adapter: ["xhr", "http", "fetch"],
565
+ transformRequest: [function(t, r) {
566
+ const n = r.getContentType() || "", o = n.indexOf("application/json") > -1, i = f.isObject(t);
567
+ if (i && f.isHTMLForm(t) && (t = new FormData(t)), f.isFormData(t))
568
+ return o ? JSON.stringify(bn(t)) : t;
569
+ if (f.isArrayBuffer(t) || f.isBuffer(t) || f.isStream(t) || f.isFile(t) || f.isBlob(t) || f.isReadableStream(t))
570
+ return t;
571
+ if (f.isArrayBufferView(t))
572
+ return t.buffer;
573
+ if (f.isURLSearchParams(t))
574
+ return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
575
+ let a;
576
+ if (i) {
577
+ if (n.indexOf("application/x-www-form-urlencoded") > -1)
578
+ return Mr(t, this.formSerializer).toString();
579
+ if ((a = f.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
580
+ const u = this.env && this.env.FormData;
581
+ return Ne(
582
+ a ? { "files[]": t } : t,
583
+ u && new u(),
584
+ this.formSerializer
585
+ );
586
+ }
587
+ }
588
+ return i || o ? (r.setContentType("application/json", !1), qr(t)) : t;
589
+ }],
590
+ transformResponse: [function(t) {
591
+ const r = this.transitional || ge.transitional, n = r && r.forcedJSONParsing, o = this.responseType === "json";
592
+ if (f.isResponse(t) || f.isReadableStream(t))
593
+ return t;
594
+ if (t && f.isString(t) && (n && !this.responseType || o)) {
595
+ const s = !(r && r.silentJSONParsing) && o;
596
+ try {
597
+ return JSON.parse(t, this.parseReviver);
598
+ } catch (a) {
599
+ if (s)
600
+ throw a.name === "SyntaxError" ? I.from(a, I.ERR_BAD_RESPONSE, this, null, this.response) : a;
601
+ }
602
+ }
603
+ return t;
604
+ }],
605
+ /**
606
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
607
+ * timeout is not created.
608
+ */
609
+ timeout: 0,
610
+ xsrfCookieName: "XSRF-TOKEN",
611
+ xsrfHeaderName: "X-XSRF-TOKEN",
612
+ maxContentLength: -1,
613
+ maxBodyLength: -1,
614
+ env: {
615
+ FormData: x.classes.FormData,
616
+ Blob: x.classes.Blob
617
+ },
618
+ validateStatus: function(t) {
619
+ return t >= 200 && t < 300;
620
+ },
621
+ headers: {
622
+ common: {
623
+ Accept: "application/json, text/plain, */*",
624
+ "Content-Type": void 0
625
+ }
626
+ }
627
+ };
628
+ f.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
629
+ ge.headers[e] = {};
630
+ });
631
+ const jr = f.toObjectSet([
632
+ "age",
633
+ "authorization",
634
+ "content-length",
635
+ "content-type",
636
+ "etag",
637
+ "expires",
638
+ "from",
639
+ "host",
640
+ "if-modified-since",
641
+ "if-unmodified-since",
642
+ "last-modified",
643
+ "location",
644
+ "max-forwards",
645
+ "proxy-authorization",
646
+ "referer",
647
+ "retry-after",
648
+ "user-agent"
649
+ ]), Hr = (e) => {
650
+ const t = {};
651
+ let r, n, o;
652
+ return e && e.split(`
653
+ `).forEach(function(s) {
654
+ o = s.indexOf(":"), r = s.substring(0, o).trim().toLowerCase(), n = s.substring(o + 1).trim(), !(!r || t[r] && jr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
655
+ }), t;
656
+ }, wt = Symbol("internals");
657
+ function le(e) {
658
+ return e && String(e).trim().toLowerCase();
659
+ }
660
+ function Ce(e) {
661
+ return e === !1 || e == null ? e : f.isArray(e) ? e.map(Ce) : String(e);
662
+ }
663
+ function zr(e) {
664
+ const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
665
+ let n;
666
+ for (; n = r.exec(e); )
667
+ t[n[1]] = n[2];
668
+ return t;
669
+ }
670
+ const Vr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
671
+ function Le(e, t, r, n, o) {
672
+ if (f.isFunction(n))
673
+ return n.call(this, t, r);
674
+ if (o && (t = r), !!f.isString(t)) {
675
+ if (f.isString(n))
676
+ return t.indexOf(n) !== -1;
677
+ if (f.isRegExp(n))
678
+ return n.test(t);
679
+ }
680
+ }
681
+ function $r(e) {
682
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
683
+ }
684
+ function Jr(e, t) {
685
+ const r = f.toCamelCase(" " + t);
686
+ ["get", "set", "has"].forEach((n) => {
687
+ Object.defineProperty(e, n + r, {
688
+ value: function(o, i, s) {
689
+ return this[n].call(this, t, o, i, s);
690
+ },
691
+ configurable: !0
692
+ });
693
+ });
694
+ }
695
+ let k = class {
696
+ constructor(t) {
697
+ t && this.set(t);
698
+ }
699
+ set(t, r, n) {
700
+ const o = this;
701
+ function i(a, u, l) {
702
+ const c = le(u);
703
+ if (!c)
704
+ throw new Error("header name must be a non-empty string");
705
+ const h = f.findKey(o, c);
706
+ (!h || o[h] === void 0 || l === !0 || l === void 0 && o[h] !== !1) && (o[h || u] = Ce(a));
707
+ }
708
+ const s = (a, u) => f.forEach(a, (l, c) => i(l, c, u));
709
+ if (f.isPlainObject(t) || t instanceof this.constructor)
710
+ s(t, r);
711
+ else if (f.isString(t) && (t = t.trim()) && !Vr(t))
712
+ s(Hr(t), r);
713
+ else if (f.isObject(t) && f.isIterable(t)) {
714
+ let a = {}, u, l;
715
+ for (const c of t) {
716
+ if (!f.isArray(c))
717
+ throw TypeError("Object iterator must return a key-value pair");
718
+ a[l = c[0]] = (u = a[l]) ? f.isArray(u) ? [...u, c[1]] : [u, c[1]] : c[1];
719
+ }
720
+ s(a, r);
721
+ } else
722
+ t != null && i(r, t, n);
723
+ return this;
724
+ }
725
+ get(t, r) {
726
+ if (t = le(t), t) {
727
+ const n = f.findKey(this, t);
728
+ if (n) {
729
+ const o = this[n];
730
+ if (!r)
731
+ return o;
732
+ if (r === !0)
733
+ return zr(o);
734
+ if (f.isFunction(r))
735
+ return r.call(this, o, n);
736
+ if (f.isRegExp(r))
737
+ return r.exec(o);
738
+ throw new TypeError("parser must be boolean|regexp|function");
739
+ }
740
+ }
741
+ }
742
+ has(t, r) {
743
+ if (t = le(t), t) {
744
+ const n = f.findKey(this, t);
745
+ return !!(n && this[n] !== void 0 && (!r || Le(this, this[n], n, r)));
746
+ }
747
+ return !1;
748
+ }
749
+ delete(t, r) {
750
+ const n = this;
751
+ let o = !1;
752
+ function i(s) {
753
+ if (s = le(s), s) {
754
+ const a = f.findKey(n, s);
755
+ a && (!r || Le(n, n[a], a, r)) && (delete n[a], o = !0);
756
+ }
757
+ }
758
+ return f.isArray(t) ? t.forEach(i) : i(t), o;
759
+ }
760
+ clear(t) {
761
+ const r = Object.keys(this);
762
+ let n = r.length, o = !1;
763
+ for (; n--; ) {
764
+ const i = r[n];
765
+ (!t || Le(this, this[i], i, t, !0)) && (delete this[i], o = !0);
766
+ }
767
+ return o;
768
+ }
769
+ normalize(t) {
770
+ const r = this, n = {};
771
+ return f.forEach(this, (o, i) => {
772
+ const s = f.findKey(n, i);
773
+ if (s) {
774
+ r[s] = Ce(o), delete r[i];
775
+ return;
776
+ }
777
+ const a = t ? $r(i) : String(i).trim();
778
+ a !== i && delete r[i], r[a] = Ce(o), n[a] = !0;
779
+ }), this;
780
+ }
781
+ concat(...t) {
782
+ return this.constructor.concat(this, ...t);
783
+ }
784
+ toJSON(t) {
785
+ const r = /* @__PURE__ */ Object.create(null);
786
+ return f.forEach(this, (n, o) => {
787
+ n != null && n !== !1 && (r[o] = t && f.isArray(n) ? n.join(", ") : n);
788
+ }), r;
789
+ }
790
+ [Symbol.iterator]() {
791
+ return Object.entries(this.toJSON())[Symbol.iterator]();
792
+ }
793
+ toString() {
794
+ return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(`
795
+ `);
796
+ }
797
+ getSetCookie() {
798
+ return this.get("set-cookie") || [];
799
+ }
800
+ get [Symbol.toStringTag]() {
801
+ return "AxiosHeaders";
802
+ }
803
+ static from(t) {
804
+ return t instanceof this ? t : new this(t);
805
+ }
806
+ static concat(t, ...r) {
807
+ const n = new this(t);
808
+ return r.forEach((o) => n.set(o)), n;
809
+ }
810
+ static accessor(t) {
811
+ const n = (this[wt] = this[wt] = {
812
+ accessors: {}
813
+ }).accessors, o = this.prototype;
814
+ function i(s) {
815
+ const a = le(s);
816
+ n[a] || (Jr(o, s), n[a] = !0);
817
+ }
818
+ return f.isArray(t) ? t.forEach(i) : i(t), this;
819
+ }
820
+ };
821
+ k.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
822
+ f.reduceDescriptors(k.prototype, ({ value: e }, t) => {
823
+ let r = t[0].toUpperCase() + t.slice(1);
824
+ return {
825
+ get: () => e,
826
+ set(n) {
827
+ this[r] = n;
828
+ }
829
+ };
830
+ });
831
+ f.freezeMethods(k);
832
+ function Ie(e, t) {
833
+ const r = this || ge, n = t || r, o = k.from(n.headers);
834
+ let i = n.data;
835
+ return f.forEach(e, function(a) {
836
+ i = a.call(r, i, o.normalize(), t ? t.status : void 0);
837
+ }), o.normalize(), i;
838
+ }
839
+ function En(e) {
840
+ return !!(e && e.__CANCEL__);
841
+ }
842
+ function ae(e, t, r) {
843
+ I.call(this, e ?? "canceled", I.ERR_CANCELED, t, r), this.name = "CanceledError";
844
+ }
845
+ f.inherits(ae, I, {
846
+ __CANCEL__: !0
847
+ });
848
+ function Cn(e, t, r) {
849
+ const n = r.config.validateStatus;
850
+ !r.status || !n || n(r.status) ? e(r) : t(new I(
851
+ "Request failed with status code " + r.status,
852
+ [I.ERR_BAD_REQUEST, I.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
853
+ r.config,
854
+ r.request,
855
+ r
856
+ ));
857
+ }
858
+ function Kr(e) {
859
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
860
+ return t && t[1] || "";
861
+ }
862
+ function Wr(e, t) {
863
+ e = e || 10;
864
+ const r = new Array(e), n = new Array(e);
865
+ let o = 0, i = 0, s;
866
+ return t = t !== void 0 ? t : 1e3, function(u) {
867
+ const l = Date.now(), c = n[i];
868
+ s || (s = l), r[o] = u, n[o] = l;
869
+ let h = i, m = 0;
870
+ for (; h !== o; )
871
+ m += r[h++], h = h % e;
872
+ if (o = (o + 1) % e, o === i && (i = (i + 1) % e), l - s < t)
873
+ return;
874
+ const y = c && l - c;
875
+ return y ? Math.round(m * 1e3 / y) : void 0;
876
+ };
877
+ }
878
+ function Gr(e, t) {
879
+ let r = 0, n = 1e3 / t, o, i;
880
+ const s = (l, c = Date.now()) => {
881
+ r = c, o = null, i && (clearTimeout(i), i = null), e(...l);
882
+ };
883
+ return [(...l) => {
884
+ const c = Date.now(), h = c - r;
885
+ h >= n ? s(l, c) : (o = l, i || (i = setTimeout(() => {
886
+ i = null, s(o);
887
+ }, n - h)));
888
+ }, () => o && s(o)];
889
+ }
890
+ const Re = (e, t, r = 3) => {
891
+ let n = 0;
892
+ const o = Wr(50, 250);
893
+ return Gr((i) => {
894
+ const s = i.loaded, a = i.lengthComputable ? i.total : void 0, u = s - n, l = o(u), c = s <= a;
895
+ n = s;
896
+ const h = {
897
+ loaded: s,
898
+ total: a,
899
+ progress: a ? s / a : void 0,
900
+ bytes: u,
901
+ rate: l || void 0,
902
+ estimated: l && a && c ? (a - s) / l : void 0,
903
+ event: i,
904
+ lengthComputable: a != null,
905
+ [t ? "download" : "upload"]: !0
906
+ };
907
+ e(h);
908
+ }, r);
909
+ }, bt = (e, t) => {
910
+ const r = e != null;
911
+ return [(n) => t[0]({
912
+ lengthComputable: r,
913
+ total: e,
914
+ loaded: n
915
+ }), t[1]];
916
+ }, Et = (e) => (...t) => f.asap(() => e(...t)), Qr = x.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, x.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
917
+ new URL(x.origin),
918
+ x.navigator && /(msie|trident)/i.test(x.navigator.userAgent)
919
+ ) : () => !0, Yr = x.hasStandardBrowserEnv ? (
920
+ // Standard browser envs support document.cookie
921
+ {
922
+ write(e, t, r, n, o, i, s) {
923
+ if (typeof document > "u") return;
924
+ const a = [`${e}=${encodeURIComponent(t)}`];
925
+ f.isNumber(r) && a.push(`expires=${new Date(r).toUTCString()}`), f.isString(n) && a.push(`path=${n}`), f.isString(o) && a.push(`domain=${o}`), i === !0 && a.push("secure"), f.isString(s) && a.push(`SameSite=${s}`), document.cookie = a.join("; ");
926
+ },
927
+ read(e) {
928
+ if (typeof document > "u") return null;
929
+ const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
930
+ return t ? decodeURIComponent(t[1]) : null;
931
+ },
932
+ remove(e) {
933
+ this.write(e, "", Date.now() - 864e5, "/");
934
+ }
935
+ }
936
+ ) : (
937
+ // Non-standard browser env (web workers, react-native) lack needed support.
938
+ {
939
+ write() {
940
+ },
941
+ read() {
942
+ return null;
943
+ },
944
+ remove() {
945
+ }
946
+ }
947
+ );
948
+ function Xr(e) {
949
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
950
+ }
951
+ function Zr(e, t) {
952
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
953
+ }
954
+ function Sn(e, t, r) {
955
+ let n = !Xr(t);
956
+ return e && (n || r == !1) ? Zr(e, t) : t;
957
+ }
958
+ const Ct = (e) => e instanceof k ? { ...e } : e;
959
+ function X(e, t) {
960
+ t = t || {};
961
+ const r = {};
962
+ function n(l, c, h, m) {
963
+ return f.isPlainObject(l) && f.isPlainObject(c) ? f.merge.call({ caseless: m }, l, c) : f.isPlainObject(c) ? f.merge({}, c) : f.isArray(c) ? c.slice() : c;
964
+ }
965
+ function o(l, c, h, m) {
966
+ if (f.isUndefined(c)) {
967
+ if (!f.isUndefined(l))
968
+ return n(void 0, l, h, m);
969
+ } else return n(l, c, h, m);
970
+ }
971
+ function i(l, c) {
972
+ if (!f.isUndefined(c))
973
+ return n(void 0, c);
974
+ }
975
+ function s(l, c) {
976
+ if (f.isUndefined(c)) {
977
+ if (!f.isUndefined(l))
978
+ return n(void 0, l);
979
+ } else return n(void 0, c);
980
+ }
981
+ function a(l, c, h) {
982
+ if (h in t)
983
+ return n(l, c);
984
+ if (h in e)
985
+ return n(void 0, l);
986
+ }
987
+ const u = {
988
+ url: i,
989
+ method: i,
990
+ data: i,
991
+ baseURL: s,
992
+ transformRequest: s,
993
+ transformResponse: s,
994
+ paramsSerializer: s,
995
+ timeout: s,
996
+ timeoutMessage: s,
997
+ withCredentials: s,
998
+ withXSRFToken: s,
999
+ adapter: s,
1000
+ responseType: s,
1001
+ xsrfCookieName: s,
1002
+ xsrfHeaderName: s,
1003
+ onUploadProgress: s,
1004
+ onDownloadProgress: s,
1005
+ decompress: s,
1006
+ maxContentLength: s,
1007
+ maxBodyLength: s,
1008
+ beforeRedirect: s,
1009
+ transport: s,
1010
+ httpAgent: s,
1011
+ httpsAgent: s,
1012
+ cancelToken: s,
1013
+ socketPath: s,
1014
+ responseEncoding: s,
1015
+ validateStatus: a,
1016
+ headers: (l, c, h) => o(Ct(l), Ct(c), h, !0)
1017
+ };
1018
+ return f.forEach(Object.keys({ ...e, ...t }), function(c) {
1019
+ const h = u[c] || o, m = h(e[c], t[c], c);
1020
+ f.isUndefined(m) && h !== a || (r[c] = m);
1021
+ }), r;
1022
+ }
1023
+ const Rn = (e) => {
1024
+ const t = X({}, e);
1025
+ let { data: r, withXSRFToken: n, xsrfHeaderName: o, xsrfCookieName: i, headers: s, auth: a } = t;
1026
+ if (t.headers = s = k.from(s), t.url = yn(Sn(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && s.set(
1027
+ "Authorization",
1028
+ "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1029
+ ), f.isFormData(r)) {
1030
+ if (x.hasStandardBrowserEnv || x.hasStandardBrowserWebWorkerEnv)
1031
+ s.setContentType(void 0);
1032
+ else if (f.isFunction(r.getHeaders)) {
1033
+ const u = r.getHeaders(), l = ["content-type", "content-length"];
1034
+ Object.entries(u).forEach(([c, h]) => {
1035
+ l.includes(c.toLowerCase()) && s.set(c, h);
1036
+ });
1037
+ }
1038
+ }
1039
+ if (x.hasStandardBrowserEnv && (n && f.isFunction(n) && (n = n(t)), n || n !== !1 && Qr(t.url))) {
1040
+ const u = o && i && Yr.read(i);
1041
+ u && s.set(o, u);
1042
+ }
1043
+ return t;
1044
+ }, eo = typeof XMLHttpRequest < "u", to = eo && function(e) {
1045
+ return new Promise(function(r, n) {
1046
+ const o = Rn(e);
1047
+ let i = o.data;
1048
+ const s = k.from(o.headers).normalize();
1049
+ let { responseType: a, onUploadProgress: u, onDownloadProgress: l } = o, c, h, m, y, d;
1050
+ function p() {
1051
+ y && y(), d && d(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
1052
+ }
1053
+ let g = new XMLHttpRequest();
1054
+ g.open(o.method.toUpperCase(), o.url, !0), g.timeout = o.timeout;
1055
+ function w() {
1056
+ if (!g)
1057
+ return;
1058
+ const E = k.from(
1059
+ "getAllResponseHeaders" in g && g.getAllResponseHeaders()
1060
+ ), _ = {
1061
+ data: !a || a === "text" || a === "json" ? g.responseText : g.response,
1062
+ status: g.status,
1063
+ statusText: g.statusText,
1064
+ headers: E,
1065
+ config: e,
1066
+ request: g
1067
+ };
1068
+ Cn(function(S) {
1069
+ r(S), p();
1070
+ }, function(S) {
1071
+ n(S), p();
1072
+ }, _), g = null;
1073
+ }
1074
+ "onloadend" in g ? g.onloadend = w : g.onreadystatechange = function() {
1075
+ !g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(w);
1076
+ }, g.onabort = function() {
1077
+ g && (n(new I("Request aborted", I.ECONNABORTED, e, g)), g = null);
1078
+ }, g.onerror = function(R) {
1079
+ const _ = R && R.message ? R.message : "Network Error", b = new I(_, I.ERR_NETWORK, e, g);
1080
+ b.event = R || null, n(b), g = null;
1081
+ }, g.ontimeout = function() {
1082
+ let R = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1083
+ const _ = o.transitional || wn;
1084
+ o.timeoutErrorMessage && (R = o.timeoutErrorMessage), n(new I(
1085
+ R,
1086
+ _.clarifyTimeoutError ? I.ETIMEDOUT : I.ECONNABORTED,
1087
+ e,
1088
+ g
1089
+ )), g = null;
1090
+ }, i === void 0 && s.setContentType(null), "setRequestHeader" in g && f.forEach(s.toJSON(), function(R, _) {
1091
+ g.setRequestHeader(_, R);
1092
+ }), f.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), a && a !== "json" && (g.responseType = o.responseType), l && ([m, d] = Re(l, !0), g.addEventListener("progress", m)), u && g.upload && ([h, y] = Re(u), g.upload.addEventListener("progress", h), g.upload.addEventListener("loadend", y)), (o.cancelToken || o.signal) && (c = (E) => {
1093
+ g && (n(!E || E.type ? new ae(null, e, g) : E), g.abort(), g = null);
1094
+ }, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
1095
+ const P = Kr(o.url);
1096
+ if (P && x.protocols.indexOf(P) === -1) {
1097
+ n(new I("Unsupported protocol " + P + ":", I.ERR_BAD_REQUEST, e));
1098
+ return;
1099
+ }
1100
+ g.send(i || null);
1101
+ });
1102
+ }, no = (e, t) => {
1103
+ const { length: r } = e = e ? e.filter(Boolean) : [];
1104
+ if (t || r) {
1105
+ let n = new AbortController(), o;
1106
+ const i = function(l) {
1107
+ if (!o) {
1108
+ o = !0, a();
1109
+ const c = l instanceof Error ? l : this.reason;
1110
+ n.abort(c instanceof I ? c : new ae(c instanceof Error ? c.message : c));
1111
+ }
1112
+ };
1113
+ let s = t && setTimeout(() => {
1114
+ s = null, i(new I(`timeout ${t} of ms exceeded`, I.ETIMEDOUT));
1115
+ }, t);
1116
+ const a = () => {
1117
+ e && (s && clearTimeout(s), s = null, e.forEach((l) => {
1118
+ l.unsubscribe ? l.unsubscribe(i) : l.removeEventListener("abort", i);
1119
+ }), e = null);
1120
+ };
1121
+ e.forEach((l) => l.addEventListener("abort", i));
1122
+ const { signal: u } = n;
1123
+ return u.unsubscribe = () => f.asap(a), u;
1124
+ }
1125
+ }, ro = function* (e, t) {
1126
+ let r = e.byteLength;
1127
+ if (r < t) {
1128
+ yield e;
1129
+ return;
1130
+ }
1131
+ let n = 0, o;
1132
+ for (; n < r; )
1133
+ o = n + t, yield e.slice(n, o), n = o;
1134
+ }, oo = async function* (e, t) {
1135
+ for await (const r of io(e))
1136
+ yield* ro(r, t);
1137
+ }, io = async function* (e) {
1138
+ if (e[Symbol.asyncIterator]) {
1139
+ yield* e;
1140
+ return;
1141
+ }
1142
+ const t = e.getReader();
1143
+ try {
1144
+ for (; ; ) {
1145
+ const { done: r, value: n } = await t.read();
1146
+ if (r)
1147
+ break;
1148
+ yield n;
1149
+ }
1150
+ } finally {
1151
+ await t.cancel();
1152
+ }
1153
+ }, St = (e, t, r, n) => {
1154
+ const o = oo(e, t);
1155
+ let i = 0, s, a = (u) => {
1156
+ s || (s = !0, n && n(u));
1157
+ };
1158
+ return new ReadableStream({
1159
+ async pull(u) {
1160
+ try {
1161
+ const { done: l, value: c } = await o.next();
1162
+ if (l) {
1163
+ a(), u.close();
1164
+ return;
1165
+ }
1166
+ let h = c.byteLength;
1167
+ if (r) {
1168
+ let m = i += h;
1169
+ r(m);
1170
+ }
1171
+ u.enqueue(new Uint8Array(c));
1172
+ } catch (l) {
1173
+ throw a(l), l;
1174
+ }
1175
+ },
1176
+ cancel(u) {
1177
+ return a(u), o.return();
1178
+ }
1179
+ }, {
1180
+ highWaterMark: 2
1181
+ });
1182
+ }, Rt = 64 * 1024, { isFunction: we } = f, so = (({ Request: e, Response: t }) => ({
1183
+ Request: e,
1184
+ Response: t
1185
+ }))(f.global), {
1186
+ ReadableStream: Tt,
1187
+ TextEncoder: At
1188
+ } = f.global, Bt = (e, ...t) => {
1189
+ try {
1190
+ return !!e(...t);
1191
+ } catch {
1192
+ return !1;
1193
+ }
1194
+ }, ao = (e) => {
1195
+ e = f.merge.call({
1196
+ skipUndefined: !0
1197
+ }, so, e);
1198
+ const { fetch: t, Request: r, Response: n } = e, o = t ? we(t) : typeof fetch == "function", i = we(r), s = we(n);
1199
+ if (!o)
1200
+ return !1;
1201
+ const a = o && we(Tt), u = o && (typeof At == "function" ? /* @__PURE__ */ ((d) => (p) => d.encode(p))(new At()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), l = i && a && Bt(() => {
1202
+ let d = !1;
1203
+ const p = new r(x.origin, {
1204
+ body: new Tt(),
1205
+ method: "POST",
1206
+ get duplex() {
1207
+ return d = !0, "half";
1208
+ }
1209
+ }).headers.has("Content-Type");
1210
+ return d && !p;
1211
+ }), c = s && a && Bt(() => f.isReadableStream(new n("").body)), h = {
1212
+ stream: c && ((d) => d.body)
1213
+ };
1214
+ o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
1215
+ !h[d] && (h[d] = (p, g) => {
1216
+ let w = p && p[d];
1217
+ if (w)
1218
+ return w.call(p);
1219
+ throw new I(`Response type '${d}' is not supported`, I.ERR_NOT_SUPPORT, g);
1220
+ });
1221
+ });
1222
+ const m = async (d) => {
1223
+ if (d == null)
1224
+ return 0;
1225
+ if (f.isBlob(d))
1226
+ return d.size;
1227
+ if (f.isSpecCompliantForm(d))
1228
+ return (await new r(x.origin, {
1229
+ method: "POST",
1230
+ body: d
1231
+ }).arrayBuffer()).byteLength;
1232
+ if (f.isArrayBufferView(d) || f.isArrayBuffer(d))
1233
+ return d.byteLength;
1234
+ if (f.isURLSearchParams(d) && (d = d + ""), f.isString(d))
1235
+ return (await u(d)).byteLength;
1236
+ }, y = async (d, p) => {
1237
+ const g = f.toFiniteNumber(d.getContentLength());
1238
+ return g ?? m(p);
1239
+ };
1240
+ return async (d) => {
1241
+ let {
1242
+ url: p,
1243
+ method: g,
1244
+ data: w,
1245
+ signal: P,
1246
+ cancelToken: E,
1247
+ timeout: R,
1248
+ onDownloadProgress: _,
1249
+ onUploadProgress: b,
1250
+ responseType: S,
1251
+ headers: A,
1252
+ withCredentials: C = "same-origin",
1253
+ fetchOptions: L
1254
+ } = Rn(d), B = t || fetch;
1255
+ S = S ? (S + "").toLowerCase() : "text";
1256
+ let N = no([P, E && E.toAbortSignal()], R), T = null;
1257
+ const O = N && N.unsubscribe && (() => {
1258
+ N.unsubscribe();
1259
+ });
1260
+ let q;
1261
+ try {
1262
+ if (b && l && g !== "get" && g !== "head" && (q = await y(A, w)) !== 0) {
1263
+ let D = new r(p, {
1264
+ method: "POST",
1265
+ body: w,
1266
+ duplex: "half"
1267
+ }), $;
1268
+ if (f.isFormData(w) && ($ = D.headers.get("content-type")) && A.setContentType($), D.body) {
1269
+ const [G, te] = bt(
1270
+ q,
1271
+ Re(Et(b))
1272
+ );
1273
+ w = St(D.body, Rt, G, te);
1274
+ }
1275
+ }
1276
+ f.isString(C) || (C = C ? "include" : "omit");
1277
+ const v = i && "credentials" in r.prototype, me = {
1278
+ ...L,
1279
+ signal: N,
1280
+ method: g.toUpperCase(),
1281
+ headers: A.normalize().toJSON(),
1282
+ body: w,
1283
+ duplex: "half",
1284
+ credentials: v ? C : void 0
1285
+ };
1286
+ T = i && new r(p, me);
1287
+ let j = await (i ? B(T, L) : B(p, me));
1288
+ const ye = c && (S === "stream" || S === "response");
1289
+ if (c && (_ || ye && O)) {
1290
+ const D = {};
1291
+ ["status", "statusText", "headers"].forEach((ne) => {
1292
+ D[ne] = j[ne];
1293
+ });
1294
+ const $ = f.toFiniteNumber(j.headers.get("content-length")), [G, te] = _ && bt(
1295
+ $,
1296
+ Re(Et(_), !0)
1297
+ ) || [];
1298
+ j = new n(
1299
+ St(j.body, Rt, G, () => {
1300
+ te && te(), O && O();
1301
+ }),
1302
+ D
1303
+ );
1304
+ }
1305
+ S = S || "text";
1306
+ let ue = await h[f.findKey(h, S) || "text"](j, d);
1307
+ return !ye && O && O(), await new Promise((D, $) => {
1308
+ Cn(D, $, {
1309
+ data: ue,
1310
+ headers: k.from(j.headers),
1311
+ status: j.status,
1312
+ statusText: j.statusText,
1313
+ config: d,
1314
+ request: T
1315
+ });
1316
+ });
1317
+ } catch (v) {
1318
+ throw O && O(), v && v.name === "TypeError" && /Load failed|fetch/i.test(v.message) ? Object.assign(
1319
+ new I("Network Error", I.ERR_NETWORK, d, T),
1320
+ {
1321
+ cause: v.cause || v
1322
+ }
1323
+ ) : I.from(v, v && v.code, d, T);
1324
+ }
1325
+ };
1326
+ }, uo = /* @__PURE__ */ new Map(), Tn = (e) => {
1327
+ let t = e && e.env || {};
1328
+ const { fetch: r, Request: n, Response: o } = t, i = [
1329
+ n,
1330
+ o,
1331
+ r
1332
+ ];
1333
+ let s = i.length, a = s, u, l, c = uo;
1334
+ for (; a--; )
1335
+ u = i[a], l = c.get(u), l === void 0 && c.set(u, l = a ? /* @__PURE__ */ new Map() : ao(t)), c = l;
1336
+ return l;
1337
+ };
1338
+ Tn();
1339
+ const ct = {
1340
+ http: Ar,
1341
+ xhr: to,
1342
+ fetch: {
1343
+ get: Tn
1344
+ }
1345
+ };
1346
+ f.forEach(ct, (e, t) => {
1347
+ if (e) {
1348
+ try {
1349
+ Object.defineProperty(e, "name", { value: t });
1350
+ } catch {
1351
+ }
1352
+ Object.defineProperty(e, "adapterName", { value: t });
1353
+ }
1354
+ });
1355
+ const Nt = (e) => `- ${e}`, lo = (e) => f.isFunction(e) || e === null || e === !1;
1356
+ function co(e, t) {
1357
+ e = f.isArray(e) ? e : [e];
1358
+ const { length: r } = e;
1359
+ let n, o;
1360
+ const i = {};
1361
+ for (let s = 0; s < r; s++) {
1362
+ n = e[s];
1363
+ let a;
1364
+ if (o = n, !lo(n) && (o = ct[(a = String(n)).toLowerCase()], o === void 0))
1365
+ throw new I(`Unknown adapter '${a}'`);
1366
+ if (o && (f.isFunction(o) || (o = o.get(t))))
1367
+ break;
1368
+ i[a || "#" + s] = o;
1369
+ }
1370
+ if (!o) {
1371
+ const s = Object.entries(i).map(
1372
+ ([u, l]) => `adapter ${u} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
1373
+ );
1374
+ let a = r ? s.length > 1 ? `since :
1375
+ ` + s.map(Nt).join(`
1376
+ `) : " " + Nt(s[0]) : "as no adapter specified";
1377
+ throw new I(
1378
+ "There is no suitable adapter to dispatch the request " + a,
1379
+ "ERR_NOT_SUPPORT"
1380
+ );
1381
+ }
1382
+ return o;
1383
+ }
1384
+ const An = {
1385
+ /**
1386
+ * Resolve an adapter from a list of adapter names or functions.
1387
+ * @type {Function}
1388
+ */
1389
+ getAdapter: co,
1390
+ /**
1391
+ * Exposes all known adapters
1392
+ * @type {Object<string, Function|Object>}
1393
+ */
1394
+ adapters: ct
1395
+ };
1396
+ function _e(e) {
1397
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1398
+ throw new ae(null, e);
1399
+ }
1400
+ function Pt(e) {
1401
+ return _e(e), e.headers = k.from(e.headers), e.data = Ie.call(
1402
+ e,
1403
+ e.transformRequest
1404
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), An.getAdapter(e.adapter || ge.adapter, e)(e).then(function(n) {
1405
+ return _e(e), n.data = Ie.call(
1406
+ e,
1407
+ e.transformResponse,
1408
+ n
1409
+ ), n.headers = k.from(n.headers), n;
1410
+ }, function(n) {
1411
+ return En(n) || (_e(e), n && n.response && (n.response.data = Ie.call(
1412
+ e,
1413
+ e.transformResponse,
1414
+ n.response
1415
+ ), n.response.headers = k.from(n.response.headers))), Promise.reject(n);
1416
+ });
1417
+ }
1418
+ const Bn = "1.13.1", Pe = {};
1419
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1420
+ Pe[e] = function(n) {
1421
+ return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
1422
+ };
1423
+ });
1424
+ const Ot = {};
1425
+ Pe.transitional = function(t, r, n) {
1426
+ function o(i, s) {
1427
+ return "[Axios v" + Bn + "] Transitional option '" + i + "'" + s + (n ? ". " + n : "");
1428
+ }
1429
+ return (i, s, a) => {
1430
+ if (t === !1)
1431
+ throw new I(
1432
+ o(s, " has been removed" + (r ? " in " + r : "")),
1433
+ I.ERR_DEPRECATED
1434
+ );
1435
+ return r && !Ot[s] && (Ot[s] = !0, console.warn(
1436
+ o(
1437
+ s,
1438
+ " has been deprecated since v" + r + " and will be removed in the near future"
1439
+ )
1440
+ )), t ? t(i, s, a) : !0;
1441
+ };
1442
+ };
1443
+ Pe.spelling = function(t) {
1444
+ return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
1445
+ };
1446
+ function fo(e, t, r) {
1447
+ if (typeof e != "object")
1448
+ throw new I("options must be an object", I.ERR_BAD_OPTION_VALUE);
1449
+ const n = Object.keys(e);
1450
+ let o = n.length;
1451
+ for (; o-- > 0; ) {
1452
+ const i = n[o], s = t[i];
1453
+ if (s) {
1454
+ const a = e[i], u = a === void 0 || s(a, i, e);
1455
+ if (u !== !0)
1456
+ throw new I("option " + i + " must be " + u, I.ERR_BAD_OPTION_VALUE);
1457
+ continue;
1458
+ }
1459
+ if (r !== !0)
1460
+ throw new I("Unknown option " + i, I.ERR_BAD_OPTION);
1461
+ }
1462
+ }
1463
+ const Se = {
1464
+ assertOptions: fo,
1465
+ validators: Pe
1466
+ }, z = Se.validators;
1467
+ let Y = class {
1468
+ constructor(t) {
1469
+ this.defaults = t || {}, this.interceptors = {
1470
+ request: new yt(),
1471
+ response: new yt()
1472
+ };
1473
+ }
1474
+ /**
1475
+ * Dispatch a request
1476
+ *
1477
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1478
+ * @param {?Object} config
1479
+ *
1480
+ * @returns {Promise} The Promise to be fulfilled
1481
+ */
1482
+ async request(t, r) {
1483
+ try {
1484
+ return await this._request(t, r);
1485
+ } catch (n) {
1486
+ if (n instanceof Error) {
1487
+ let o = {};
1488
+ Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
1489
+ const i = o.stack ? o.stack.replace(/^.+\n/, "") : "";
1490
+ try {
1491
+ n.stack ? i && !String(n.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (n.stack += `
1492
+ ` + i) : n.stack = i;
1493
+ } catch {
1494
+ }
1495
+ }
1496
+ throw n;
1497
+ }
1498
+ }
1499
+ _request(t, r) {
1500
+ typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = X(this.defaults, r);
1501
+ const { transitional: n, paramsSerializer: o, headers: i } = r;
1502
+ n !== void 0 && Se.assertOptions(n, {
1503
+ silentJSONParsing: z.transitional(z.boolean),
1504
+ forcedJSONParsing: z.transitional(z.boolean),
1505
+ clarifyTimeoutError: z.transitional(z.boolean)
1506
+ }, !1), o != null && (f.isFunction(o) ? r.paramsSerializer = {
1507
+ serialize: o
1508
+ } : Se.assertOptions(o, {
1509
+ encode: z.function,
1510
+ serialize: z.function
1511
+ }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), Se.assertOptions(r, {
1512
+ baseUrl: z.spelling("baseURL"),
1513
+ withXsrfToken: z.spelling("withXSRFToken")
1514
+ }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
1515
+ let s = i && f.merge(
1516
+ i.common,
1517
+ i[r.method]
1518
+ );
1519
+ i && f.forEach(
1520
+ ["delete", "get", "head", "post", "put", "patch", "common"],
1521
+ (d) => {
1522
+ delete i[d];
1523
+ }
1524
+ ), r.headers = k.concat(s, i);
1525
+ const a = [];
1526
+ let u = !0;
1527
+ this.interceptors.request.forEach(function(p) {
1528
+ typeof p.runWhen == "function" && p.runWhen(r) === !1 || (u = u && p.synchronous, a.unshift(p.fulfilled, p.rejected));
1529
+ });
1530
+ const l = [];
1531
+ this.interceptors.response.forEach(function(p) {
1532
+ l.push(p.fulfilled, p.rejected);
1533
+ });
1534
+ let c, h = 0, m;
1535
+ if (!u) {
1536
+ const d = [Pt.bind(this), void 0];
1537
+ for (d.unshift(...a), d.push(...l), m = d.length, c = Promise.resolve(r); h < m; )
1538
+ c = c.then(d[h++], d[h++]);
1539
+ return c;
1540
+ }
1541
+ m = a.length;
1542
+ let y = r;
1543
+ for (; h < m; ) {
1544
+ const d = a[h++], p = a[h++];
1545
+ try {
1546
+ y = d(y);
1547
+ } catch (g) {
1548
+ p.call(this, g);
1549
+ break;
1550
+ }
1551
+ }
1552
+ try {
1553
+ c = Pt.call(this, y);
1554
+ } catch (d) {
1555
+ return Promise.reject(d);
1556
+ }
1557
+ for (h = 0, m = l.length; h < m; )
1558
+ c = c.then(l[h++], l[h++]);
1559
+ return c;
1560
+ }
1561
+ getUri(t) {
1562
+ t = X(this.defaults, t);
1563
+ const r = Sn(t.baseURL, t.url, t.allowAbsoluteUrls);
1564
+ return yn(r, t.params, t.paramsSerializer);
1565
+ }
1566
+ };
1567
+ f.forEach(["delete", "get", "head", "options"], function(t) {
1568
+ Y.prototype[t] = function(r, n) {
1569
+ return this.request(X(n || {}, {
1570
+ method: t,
1571
+ url: r,
1572
+ data: (n || {}).data
1573
+ }));
1574
+ };
1575
+ });
1576
+ f.forEach(["post", "put", "patch"], function(t) {
1577
+ function r(n) {
1578
+ return function(i, s, a) {
1579
+ return this.request(X(a || {}, {
1580
+ method: t,
1581
+ headers: n ? {
1582
+ "Content-Type": "multipart/form-data"
1583
+ } : {},
1584
+ url: i,
1585
+ data: s
1586
+ }));
1587
+ };
1588
+ }
1589
+ Y.prototype[t] = r(), Y.prototype[t + "Form"] = r(!0);
1590
+ });
1591
+ let ho = class Nn {
1592
+ constructor(t) {
1593
+ if (typeof t != "function")
1594
+ throw new TypeError("executor must be a function.");
1595
+ let r;
1596
+ this.promise = new Promise(function(i) {
1597
+ r = i;
1598
+ });
1599
+ const n = this;
1600
+ this.promise.then((o) => {
1601
+ if (!n._listeners) return;
1602
+ let i = n._listeners.length;
1603
+ for (; i-- > 0; )
1604
+ n._listeners[i](o);
1605
+ n._listeners = null;
1606
+ }), this.promise.then = (o) => {
1607
+ let i;
1608
+ const s = new Promise((a) => {
1609
+ n.subscribe(a), i = a;
1610
+ }).then(o);
1611
+ return s.cancel = function() {
1612
+ n.unsubscribe(i);
1613
+ }, s;
1614
+ }, t(function(i, s, a) {
1615
+ n.reason || (n.reason = new ae(i, s, a), r(n.reason));
1616
+ });
1617
+ }
1618
+ /**
1619
+ * Throws a `CanceledError` if cancellation has been requested.
1620
+ */
1621
+ throwIfRequested() {
1622
+ if (this.reason)
1623
+ throw this.reason;
1624
+ }
1625
+ /**
1626
+ * Subscribe to the cancel signal
1627
+ */
1628
+ subscribe(t) {
1629
+ if (this.reason) {
1630
+ t(this.reason);
1631
+ return;
1632
+ }
1633
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
1634
+ }
1635
+ /**
1636
+ * Unsubscribe from the cancel signal
1637
+ */
1638
+ unsubscribe(t) {
1639
+ if (!this._listeners)
1640
+ return;
1641
+ const r = this._listeners.indexOf(t);
1642
+ r !== -1 && this._listeners.splice(r, 1);
1643
+ }
1644
+ toAbortSignal() {
1645
+ const t = new AbortController(), r = (n) => {
1646
+ t.abort(n);
1647
+ };
1648
+ return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), t.signal;
1649
+ }
1650
+ /**
1651
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
1652
+ * cancels the `CancelToken`.
1653
+ */
1654
+ static source() {
1655
+ let t;
1656
+ return {
1657
+ token: new Nn(function(o) {
1658
+ t = o;
1659
+ }),
1660
+ cancel: t
1661
+ };
1662
+ }
1663
+ };
1664
+ function po(e) {
1665
+ return function(r) {
1666
+ return e.apply(null, r);
1667
+ };
1668
+ }
1669
+ function go(e) {
1670
+ return f.isObject(e) && e.isAxiosError === !0;
1671
+ }
1672
+ const st = {
1673
+ Continue: 100,
1674
+ SwitchingProtocols: 101,
1675
+ Processing: 102,
1676
+ EarlyHints: 103,
1677
+ Ok: 200,
1678
+ Created: 201,
1679
+ Accepted: 202,
1680
+ NonAuthoritativeInformation: 203,
1681
+ NoContent: 204,
1682
+ ResetContent: 205,
1683
+ PartialContent: 206,
1684
+ MultiStatus: 207,
1685
+ AlreadyReported: 208,
1686
+ ImUsed: 226,
1687
+ MultipleChoices: 300,
1688
+ MovedPermanently: 301,
1689
+ Found: 302,
1690
+ SeeOther: 303,
1691
+ NotModified: 304,
1692
+ UseProxy: 305,
1693
+ Unused: 306,
1694
+ TemporaryRedirect: 307,
1695
+ PermanentRedirect: 308,
1696
+ BadRequest: 400,
1697
+ Unauthorized: 401,
1698
+ PaymentRequired: 402,
1699
+ Forbidden: 403,
1700
+ NotFound: 404,
1701
+ MethodNotAllowed: 405,
1702
+ NotAcceptable: 406,
1703
+ ProxyAuthenticationRequired: 407,
1704
+ RequestTimeout: 408,
1705
+ Conflict: 409,
1706
+ Gone: 410,
1707
+ LengthRequired: 411,
1708
+ PreconditionFailed: 412,
1709
+ PayloadTooLarge: 413,
1710
+ UriTooLong: 414,
1711
+ UnsupportedMediaType: 415,
1712
+ RangeNotSatisfiable: 416,
1713
+ ExpectationFailed: 417,
1714
+ ImATeapot: 418,
1715
+ MisdirectedRequest: 421,
1716
+ UnprocessableEntity: 422,
1717
+ Locked: 423,
1718
+ FailedDependency: 424,
1719
+ TooEarly: 425,
1720
+ UpgradeRequired: 426,
1721
+ PreconditionRequired: 428,
1722
+ TooManyRequests: 429,
1723
+ RequestHeaderFieldsTooLarge: 431,
1724
+ UnavailableForLegalReasons: 451,
1725
+ InternalServerError: 500,
1726
+ NotImplemented: 501,
1727
+ BadGateway: 502,
1728
+ ServiceUnavailable: 503,
1729
+ GatewayTimeout: 504,
1730
+ HttpVersionNotSupported: 505,
1731
+ VariantAlsoNegotiates: 506,
1732
+ InsufficientStorage: 507,
1733
+ LoopDetected: 508,
1734
+ NotExtended: 510,
1735
+ NetworkAuthenticationRequired: 511,
1736
+ WebServerIsDown: 521,
1737
+ ConnectionTimedOut: 522,
1738
+ OriginIsUnreachable: 523,
1739
+ TimeoutOccurred: 524,
1740
+ SslHandshakeFailed: 525,
1741
+ InvalidSslCertificate: 526
1742
+ };
1743
+ Object.entries(st).forEach(([e, t]) => {
1744
+ st[t] = e;
1745
+ });
1746
+ function Pn(e) {
1747
+ const t = new Y(e), r = on(Y.prototype.request, t);
1748
+ return f.extend(r, Y.prototype, t, { allOwnKeys: !0 }), f.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(o) {
1749
+ return Pn(X(e, o));
1750
+ }, r;
1751
+ }
1752
+ const U = Pn(ge);
1753
+ U.Axios = Y;
1754
+ U.CanceledError = ae;
1755
+ U.CancelToken = ho;
1756
+ U.isCancel = En;
1757
+ U.VERSION = Bn;
1758
+ U.toFormData = Ne;
1759
+ U.AxiosError = I;
1760
+ U.Cancel = U.CanceledError;
1761
+ U.all = function(t) {
1762
+ return Promise.all(t);
1763
+ };
1764
+ U.spread = po;
1765
+ U.isAxiosError = go;
1766
+ U.mergeConfig = X;
1767
+ U.AxiosHeaders = k;
1768
+ U.formToJSON = (e) => bn(f.isHTMLForm(e) ? new FormData(e) : e);
1769
+ U.getAdapter = An.getAdapter;
1770
+ U.HttpStatusCode = st;
1771
+ U.default = U;
1772
+ const {
1773
+ Axios: Ko,
1774
+ AxiosError: Wo,
1775
+ CanceledError: Go,
1776
+ isCancel: Qo,
1777
+ CancelToken: Yo,
1778
+ VERSION: Xo,
1779
+ all: Zo,
1780
+ Cancel: ei,
1781
+ isAxiosError: ti,
1782
+ spread: ni,
1783
+ toFormData: ri,
1784
+ AxiosHeaders: oi,
1785
+ HttpStatusCode: ii,
1786
+ formToJSON: si,
1787
+ getAdapter: ai,
1788
+ mergeConfig: ui
1789
+ } = U, mo = `.oauth-modal-overlay {
1790
+ position: fixed;
1791
+ top: 0;
1792
+ left: 0;
1793
+ width: 100%;
1794
+ height: 100%;
1795
+ background-color: rgba(0, 0, 0, 0.6);
1796
+ display: flex;
1797
+ justify-content: center;
1798
+ align-items: flex-end;
1799
+ z-index: 1000;
1800
+ opacity: 0;
1801
+ visibility: hidden;
1802
+ transition: opacity 0.3s ease, visibility 0.3s ease;
1803
+ padding: 0;
1804
+ }
1805
+
1806
+ .oauth-modal-overlay.active {
1807
+ opacity: 1;
1808
+ visibility: visible;
1809
+ }
1810
+
1811
+ .oauth-modal-content {
1812
+ background: white;
1813
+ text-align: center;
1814
+ position: relative;
1815
+ width: 100%;
1816
+ border-radius: 20px 20px 0 0;
1817
+ padding: 35px 20px 20px 20px; /* Возвращаем исходный padding */
1818
+ box-sizing: border-box;
1819
+ max-height: 90vh;
1820
+ overflow-y: auto;
1821
+ transform: translateY(100%);
1822
+ transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
1823
+ }
1824
+
1825
+ .oauth-modal-content::before {
1826
+ content: '';
1827
+ position: absolute;
1828
+ top: 8px;
1829
+ left: 50%;
1830
+ transform: translateX(-50%);
1831
+ width: 36px;
1832
+ height: 4px;
1833
+ background-color: #c4c4c4;
1834
+ border-radius: 4px;
1835
+ }
1836
+
1837
+ .oauth-modal-overlay.active .oauth-modal-content {
1838
+ transform: translateY(0);
1839
+ }
1840
+
1841
+ .oauth-modal-content h3 {
1842
+ margin-top: 0; /* Возвращаем исходный margin */
1843
+ margin-bottom: 16px;
1844
+ color: #333;
1845
+ font-size: 1.2rem;
1846
+ }
1847
+
1848
+ .oauth-qrcode-container {
1849
+ margin: 20px 0;
1850
+ display: flex;
1851
+ justify-content: center;
1852
+ }
1853
+
1854
+ .oauth-qrcode-container canvas {
1855
+ border: 1px solid #eee;
1856
+ max-width: 100%;
1857
+ height: auto;
1858
+ }
1859
+
1860
+ .oauth-modal-separator {
1861
+ margin: 24px 0;
1862
+ color: #888;
1863
+ font-size: 0.9rem;
1864
+ font-weight: 500;
1865
+ }
1866
+
1867
+ .oauth-login-button {
1868
+ background-color: #007bff;
1869
+ color: white;
1870
+ border: none;
1871
+ padding: 16px 24px;
1872
+ border-radius: 8px;
1873
+ font-size: 18px;
1874
+ font-weight: 600;
1875
+ cursor: pointer;
1876
+ transition: background-color 0.2s;
1877
+ width: 100%;
1878
+ box-sizing: border-box;
1879
+ }
1880
+
1881
+ .oauth-login-button:hover {
1882
+ background-color: #0056b3;
1883
+ }
1884
+
1885
+ /* --- Стили для десктопов --- */
1886
+ @media (min-width: 768px) {
1887
+ .oauth-modal-overlay {
1888
+ align-items: center;
1889
+ }
1890
+
1891
+ .oauth-modal-content {
1892
+ width: 90%;
1893
+ max-width: 500px;
1894
+ margin: 0 16px;
1895
+ border-radius: 12px;
1896
+ padding: 32px;
1897
+ transform: scale(0.8);
1898
+ transition: transform 0.3s ease;
1899
+ }
1900
+
1901
+ .oauth-modal-content::before {
1902
+ display: none;
1903
+ }
1904
+
1905
+ .oauth-modal-overlay.active .oauth-modal-content {
1906
+ transform: scale(1);
1907
+ }
1908
+ }
1909
+
1910
+ /* Лоадер */
1911
+ .oauth-loader {
1912
+ display: none;
1913
+ justify-content: center;
1914
+ align-items: center;
1915
+ padding: 40px 0;
1916
+ }
1917
+ .oauth-spinner {
1918
+ width: 40px; height: 40px;
1919
+ border: 4px solid rgba(0, 0, 0, 0.1);
1920
+ border-radius: 50%;
1921
+ border-top-color: #007bff;
1922
+ animation: spin 1s ease-in-out infinite;
1923
+ }
1924
+ @keyframes spin { to { transform: rotate(360deg); } }
1925
+
1926
+ /* Контейнер для ошибки */
1927
+ .oauth-error-container {
1928
+ text-align: center;
1929
+ padding: 20px 0;
1930
+ display: none; /* Изначально скрыт */
1931
+ }
1932
+ .oauth-error-message {
1933
+ color: #d9534f;
1934
+ margin-bottom: 16px;
1935
+ }
1936
+ .oauth-retry-button {
1937
+ background-color: #f0ad4e;
1938
+ color: white;
1939
+ border: none;
1940
+ padding: 12px 20px;
1941
+ border-radius: 8px;
1942
+ font-size: 16px;
1943
+ cursor: pointer;
1944
+ transition: background-color 0.2s;
1945
+ }
1946
+ .oauth-retry-button:hover {
1947
+ background-color: #ec971f;
1948
+ }
1949
+
1950
+ /* Таймер */
1951
+ .oauth-timer-container {
1952
+ display: none; /* Изначально скрыт */
1953
+ font-size: 0.9rem;
1954
+ color: #555;
1955
+ margin-top: -10px;
1956
+ margin-bottom: 10px;
1957
+ }`;
1958
+ var oe = {}, Ue, Lt;
1959
+ function yo() {
1960
+ return Lt || (Lt = 1, Ue = function() {
1961
+ return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
1962
+ }), Ue;
1963
+ }
1964
+ var ve = {}, W = {}, It;
1965
+ function Z() {
1966
+ if (It) return W;
1967
+ It = 1;
1968
+ let e;
1969
+ const t = [
1970
+ 0,
1971
+ // Not used
1972
+ 26,
1973
+ 44,
1974
+ 70,
1975
+ 100,
1976
+ 134,
1977
+ 172,
1978
+ 196,
1979
+ 242,
1980
+ 292,
1981
+ 346,
1982
+ 404,
1983
+ 466,
1984
+ 532,
1985
+ 581,
1986
+ 655,
1987
+ 733,
1988
+ 815,
1989
+ 901,
1990
+ 991,
1991
+ 1085,
1992
+ 1156,
1993
+ 1258,
1994
+ 1364,
1995
+ 1474,
1996
+ 1588,
1997
+ 1706,
1998
+ 1828,
1999
+ 1921,
2000
+ 2051,
2001
+ 2185,
2002
+ 2323,
2003
+ 2465,
2004
+ 2611,
2005
+ 2761,
2006
+ 2876,
2007
+ 3034,
2008
+ 3196,
2009
+ 3362,
2010
+ 3532,
2011
+ 3706
2012
+ ];
2013
+ return W.getSymbolSize = function(n) {
2014
+ if (!n) throw new Error('"version" cannot be null or undefined');
2015
+ if (n < 1 || n > 40) throw new Error('"version" should be in range from 1 to 40');
2016
+ return n * 4 + 17;
2017
+ }, W.getSymbolTotalCodewords = function(n) {
2018
+ return t[n];
2019
+ }, W.getBCHDigit = function(r) {
2020
+ let n = 0;
2021
+ for (; r !== 0; )
2022
+ n++, r >>>= 1;
2023
+ return n;
2024
+ }, W.setToSJISFunction = function(n) {
2025
+ if (typeof n != "function")
2026
+ throw new Error('"toSJISFunc" is not a valid function.');
2027
+ e = n;
2028
+ }, W.isKanjiModeEnabled = function() {
2029
+ return typeof e < "u";
2030
+ }, W.toSJIS = function(n) {
2031
+ return e(n);
2032
+ }, W;
2033
+ }
2034
+ var xe = {}, _t;
2035
+ function ft() {
2036
+ return _t || (_t = 1, (function(e) {
2037
+ e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
2038
+ function t(r) {
2039
+ if (typeof r != "string")
2040
+ throw new Error("Param is not a string");
2041
+ switch (r.toLowerCase()) {
2042
+ case "l":
2043
+ case "low":
2044
+ return e.L;
2045
+ case "m":
2046
+ case "medium":
2047
+ return e.M;
2048
+ case "q":
2049
+ case "quartile":
2050
+ return e.Q;
2051
+ case "h":
2052
+ case "high":
2053
+ return e.H;
2054
+ default:
2055
+ throw new Error("Unknown EC Level: " + r);
2056
+ }
2057
+ }
2058
+ e.isValid = function(n) {
2059
+ return n && typeof n.bit < "u" && n.bit >= 0 && n.bit < 4;
2060
+ }, e.from = function(n, o) {
2061
+ if (e.isValid(n))
2062
+ return n;
2063
+ try {
2064
+ return t(n);
2065
+ } catch {
2066
+ return o;
2067
+ }
2068
+ };
2069
+ })(xe)), xe;
2070
+ }
2071
+ var Fe, Ut;
2072
+ function wo() {
2073
+ if (Ut) return Fe;
2074
+ Ut = 1;
2075
+ function e() {
2076
+ this.buffer = [], this.length = 0;
2077
+ }
2078
+ return e.prototype = {
2079
+ get: function(t) {
2080
+ const r = Math.floor(t / 8);
2081
+ return (this.buffer[r] >>> 7 - t % 8 & 1) === 1;
2082
+ },
2083
+ put: function(t, r) {
2084
+ for (let n = 0; n < r; n++)
2085
+ this.putBit((t >>> r - n - 1 & 1) === 1);
2086
+ },
2087
+ getLengthInBits: function() {
2088
+ return this.length;
2089
+ },
2090
+ putBit: function(t) {
2091
+ const r = Math.floor(this.length / 8);
2092
+ this.buffer.length <= r && this.buffer.push(0), t && (this.buffer[r] |= 128 >>> this.length % 8), this.length++;
2093
+ }
2094
+ }, Fe = e, Fe;
2095
+ }
2096
+ var Me, vt;
2097
+ function bo() {
2098
+ if (vt) return Me;
2099
+ vt = 1;
2100
+ function e(t) {
2101
+ if (!t || t < 1)
2102
+ throw new Error("BitMatrix size must be defined and greater than 0");
2103
+ this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
2104
+ }
2105
+ return e.prototype.set = function(t, r, n, o) {
2106
+ const i = t * this.size + r;
2107
+ this.data[i] = n, o && (this.reservedBit[i] = !0);
2108
+ }, e.prototype.get = function(t, r) {
2109
+ return this.data[t * this.size + r];
2110
+ }, e.prototype.xor = function(t, r, n) {
2111
+ this.data[t * this.size + r] ^= n;
2112
+ }, e.prototype.isReserved = function(t, r) {
2113
+ return this.reservedBit[t * this.size + r];
2114
+ }, Me = e, Me;
2115
+ }
2116
+ var ke = {}, xt;
2117
+ function Eo() {
2118
+ return xt || (xt = 1, (function(e) {
2119
+ const t = Z().getSymbolSize;
2120
+ e.getRowColCoords = function(n) {
2121
+ if (n === 1) return [];
2122
+ const o = Math.floor(n / 7) + 2, i = t(n), s = i === 145 ? 26 : Math.ceil((i - 13) / (2 * o - 2)) * 2, a = [i - 7];
2123
+ for (let u = 1; u < o - 1; u++)
2124
+ a[u] = a[u - 1] - s;
2125
+ return a.push(6), a.reverse();
2126
+ }, e.getPositions = function(n) {
2127
+ const o = [], i = e.getRowColCoords(n), s = i.length;
2128
+ for (let a = 0; a < s; a++)
2129
+ for (let u = 0; u < s; u++)
2130
+ a === 0 && u === 0 || // top-left
2131
+ a === 0 && u === s - 1 || // bottom-left
2132
+ a === s - 1 && u === 0 || o.push([i[a], i[u]]);
2133
+ return o;
2134
+ };
2135
+ })(ke)), ke;
2136
+ }
2137
+ var De = {}, Ft;
2138
+ function Co() {
2139
+ if (Ft) return De;
2140
+ Ft = 1;
2141
+ const e = Z().getSymbolSize, t = 7;
2142
+ return De.getPositions = function(n) {
2143
+ const o = e(n);
2144
+ return [
2145
+ // top-left
2146
+ [0, 0],
2147
+ // top-right
2148
+ [o - t, 0],
2149
+ // bottom-left
2150
+ [0, o - t]
2151
+ ];
2152
+ }, De;
2153
+ }
2154
+ var qe = {}, Mt;
2155
+ function So() {
2156
+ return Mt || (Mt = 1, (function(e) {
2157
+ e.Patterns = {
2158
+ PATTERN000: 0,
2159
+ PATTERN001: 1,
2160
+ PATTERN010: 2,
2161
+ PATTERN011: 3,
2162
+ PATTERN100: 4,
2163
+ PATTERN101: 5,
2164
+ PATTERN110: 6,
2165
+ PATTERN111: 7
2166
+ };
2167
+ const t = {
2168
+ N1: 3,
2169
+ N2: 3,
2170
+ N3: 40,
2171
+ N4: 10
2172
+ };
2173
+ e.isValid = function(o) {
2174
+ return o != null && o !== "" && !isNaN(o) && o >= 0 && o <= 7;
2175
+ }, e.from = function(o) {
2176
+ return e.isValid(o) ? parseInt(o, 10) : void 0;
2177
+ }, e.getPenaltyN1 = function(o) {
2178
+ const i = o.size;
2179
+ let s = 0, a = 0, u = 0, l = null, c = null;
2180
+ for (let h = 0; h < i; h++) {
2181
+ a = u = 0, l = c = null;
2182
+ for (let m = 0; m < i; m++) {
2183
+ let y = o.get(h, m);
2184
+ y === l ? a++ : (a >= 5 && (s += t.N1 + (a - 5)), l = y, a = 1), y = o.get(m, h), y === c ? u++ : (u >= 5 && (s += t.N1 + (u - 5)), c = y, u = 1);
2185
+ }
2186
+ a >= 5 && (s += t.N1 + (a - 5)), u >= 5 && (s += t.N1 + (u - 5));
2187
+ }
2188
+ return s;
2189
+ }, e.getPenaltyN2 = function(o) {
2190
+ const i = o.size;
2191
+ let s = 0;
2192
+ for (let a = 0; a < i - 1; a++)
2193
+ for (let u = 0; u < i - 1; u++) {
2194
+ const l = o.get(a, u) + o.get(a, u + 1) + o.get(a + 1, u) + o.get(a + 1, u + 1);
2195
+ (l === 4 || l === 0) && s++;
2196
+ }
2197
+ return s * t.N2;
2198
+ }, e.getPenaltyN3 = function(o) {
2199
+ const i = o.size;
2200
+ let s = 0, a = 0, u = 0;
2201
+ for (let l = 0; l < i; l++) {
2202
+ a = u = 0;
2203
+ for (let c = 0; c < i; c++)
2204
+ a = a << 1 & 2047 | o.get(l, c), c >= 10 && (a === 1488 || a === 93) && s++, u = u << 1 & 2047 | o.get(c, l), c >= 10 && (u === 1488 || u === 93) && s++;
2205
+ }
2206
+ return s * t.N3;
2207
+ }, e.getPenaltyN4 = function(o) {
2208
+ let i = 0;
2209
+ const s = o.data.length;
2210
+ for (let u = 0; u < s; u++) i += o.data[u];
2211
+ return Math.abs(Math.ceil(i * 100 / s / 5) - 10) * t.N4;
2212
+ };
2213
+ function r(n, o, i) {
2214
+ switch (n) {
2215
+ case e.Patterns.PATTERN000:
2216
+ return (o + i) % 2 === 0;
2217
+ case e.Patterns.PATTERN001:
2218
+ return o % 2 === 0;
2219
+ case e.Patterns.PATTERN010:
2220
+ return i % 3 === 0;
2221
+ case e.Patterns.PATTERN011:
2222
+ return (o + i) % 3 === 0;
2223
+ case e.Patterns.PATTERN100:
2224
+ return (Math.floor(o / 2) + Math.floor(i / 3)) % 2 === 0;
2225
+ case e.Patterns.PATTERN101:
2226
+ return o * i % 2 + o * i % 3 === 0;
2227
+ case e.Patterns.PATTERN110:
2228
+ return (o * i % 2 + o * i % 3) % 2 === 0;
2229
+ case e.Patterns.PATTERN111:
2230
+ return (o * i % 3 + (o + i) % 2) % 2 === 0;
2231
+ default:
2232
+ throw new Error("bad maskPattern:" + n);
2233
+ }
2234
+ }
2235
+ e.applyMask = function(o, i) {
2236
+ const s = i.size;
2237
+ for (let a = 0; a < s; a++)
2238
+ for (let u = 0; u < s; u++)
2239
+ i.isReserved(u, a) || i.xor(u, a, r(o, u, a));
2240
+ }, e.getBestMask = function(o, i) {
2241
+ const s = Object.keys(e.Patterns).length;
2242
+ let a = 0, u = 1 / 0;
2243
+ for (let l = 0; l < s; l++) {
2244
+ i(l), e.applyMask(l, o);
2245
+ const c = e.getPenaltyN1(o) + e.getPenaltyN2(o) + e.getPenaltyN3(o) + e.getPenaltyN4(o);
2246
+ e.applyMask(l, o), c < u && (u = c, a = l);
2247
+ }
2248
+ return a;
2249
+ };
2250
+ })(qe)), qe;
2251
+ }
2252
+ var be = {}, kt;
2253
+ function On() {
2254
+ if (kt) return be;
2255
+ kt = 1;
2256
+ const e = ft(), t = [
2257
+ // L M Q H
2258
+ 1,
2259
+ 1,
2260
+ 1,
2261
+ 1,
2262
+ 1,
2263
+ 1,
2264
+ 1,
2265
+ 1,
2266
+ 1,
2267
+ 1,
2268
+ 2,
2269
+ 2,
2270
+ 1,
2271
+ 2,
2272
+ 2,
2273
+ 4,
2274
+ 1,
2275
+ 2,
2276
+ 4,
2277
+ 4,
2278
+ 2,
2279
+ 4,
2280
+ 4,
2281
+ 4,
2282
+ 2,
2283
+ 4,
2284
+ 6,
2285
+ 5,
2286
+ 2,
2287
+ 4,
2288
+ 6,
2289
+ 6,
2290
+ 2,
2291
+ 5,
2292
+ 8,
2293
+ 8,
2294
+ 4,
2295
+ 5,
2296
+ 8,
2297
+ 8,
2298
+ 4,
2299
+ 5,
2300
+ 8,
2301
+ 11,
2302
+ 4,
2303
+ 8,
2304
+ 10,
2305
+ 11,
2306
+ 4,
2307
+ 9,
2308
+ 12,
2309
+ 16,
2310
+ 4,
2311
+ 9,
2312
+ 16,
2313
+ 16,
2314
+ 6,
2315
+ 10,
2316
+ 12,
2317
+ 18,
2318
+ 6,
2319
+ 10,
2320
+ 17,
2321
+ 16,
2322
+ 6,
2323
+ 11,
2324
+ 16,
2325
+ 19,
2326
+ 6,
2327
+ 13,
2328
+ 18,
2329
+ 21,
2330
+ 7,
2331
+ 14,
2332
+ 21,
2333
+ 25,
2334
+ 8,
2335
+ 16,
2336
+ 20,
2337
+ 25,
2338
+ 8,
2339
+ 17,
2340
+ 23,
2341
+ 25,
2342
+ 9,
2343
+ 17,
2344
+ 23,
2345
+ 34,
2346
+ 9,
2347
+ 18,
2348
+ 25,
2349
+ 30,
2350
+ 10,
2351
+ 20,
2352
+ 27,
2353
+ 32,
2354
+ 12,
2355
+ 21,
2356
+ 29,
2357
+ 35,
2358
+ 12,
2359
+ 23,
2360
+ 34,
2361
+ 37,
2362
+ 12,
2363
+ 25,
2364
+ 34,
2365
+ 40,
2366
+ 13,
2367
+ 26,
2368
+ 35,
2369
+ 42,
2370
+ 14,
2371
+ 28,
2372
+ 38,
2373
+ 45,
2374
+ 15,
2375
+ 29,
2376
+ 40,
2377
+ 48,
2378
+ 16,
2379
+ 31,
2380
+ 43,
2381
+ 51,
2382
+ 17,
2383
+ 33,
2384
+ 45,
2385
+ 54,
2386
+ 18,
2387
+ 35,
2388
+ 48,
2389
+ 57,
2390
+ 19,
2391
+ 37,
2392
+ 51,
2393
+ 60,
2394
+ 19,
2395
+ 38,
2396
+ 53,
2397
+ 63,
2398
+ 20,
2399
+ 40,
2400
+ 56,
2401
+ 66,
2402
+ 21,
2403
+ 43,
2404
+ 59,
2405
+ 70,
2406
+ 22,
2407
+ 45,
2408
+ 62,
2409
+ 74,
2410
+ 24,
2411
+ 47,
2412
+ 65,
2413
+ 77,
2414
+ 25,
2415
+ 49,
2416
+ 68,
2417
+ 81
2418
+ ], r = [
2419
+ // L M Q H
2420
+ 7,
2421
+ 10,
2422
+ 13,
2423
+ 17,
2424
+ 10,
2425
+ 16,
2426
+ 22,
2427
+ 28,
2428
+ 15,
2429
+ 26,
2430
+ 36,
2431
+ 44,
2432
+ 20,
2433
+ 36,
2434
+ 52,
2435
+ 64,
2436
+ 26,
2437
+ 48,
2438
+ 72,
2439
+ 88,
2440
+ 36,
2441
+ 64,
2442
+ 96,
2443
+ 112,
2444
+ 40,
2445
+ 72,
2446
+ 108,
2447
+ 130,
2448
+ 48,
2449
+ 88,
2450
+ 132,
2451
+ 156,
2452
+ 60,
2453
+ 110,
2454
+ 160,
2455
+ 192,
2456
+ 72,
2457
+ 130,
2458
+ 192,
2459
+ 224,
2460
+ 80,
2461
+ 150,
2462
+ 224,
2463
+ 264,
2464
+ 96,
2465
+ 176,
2466
+ 260,
2467
+ 308,
2468
+ 104,
2469
+ 198,
2470
+ 288,
2471
+ 352,
2472
+ 120,
2473
+ 216,
2474
+ 320,
2475
+ 384,
2476
+ 132,
2477
+ 240,
2478
+ 360,
2479
+ 432,
2480
+ 144,
2481
+ 280,
2482
+ 408,
2483
+ 480,
2484
+ 168,
2485
+ 308,
2486
+ 448,
2487
+ 532,
2488
+ 180,
2489
+ 338,
2490
+ 504,
2491
+ 588,
2492
+ 196,
2493
+ 364,
2494
+ 546,
2495
+ 650,
2496
+ 224,
2497
+ 416,
2498
+ 600,
2499
+ 700,
2500
+ 224,
2501
+ 442,
2502
+ 644,
2503
+ 750,
2504
+ 252,
2505
+ 476,
2506
+ 690,
2507
+ 816,
2508
+ 270,
2509
+ 504,
2510
+ 750,
2511
+ 900,
2512
+ 300,
2513
+ 560,
2514
+ 810,
2515
+ 960,
2516
+ 312,
2517
+ 588,
2518
+ 870,
2519
+ 1050,
2520
+ 336,
2521
+ 644,
2522
+ 952,
2523
+ 1110,
2524
+ 360,
2525
+ 700,
2526
+ 1020,
2527
+ 1200,
2528
+ 390,
2529
+ 728,
2530
+ 1050,
2531
+ 1260,
2532
+ 420,
2533
+ 784,
2534
+ 1140,
2535
+ 1350,
2536
+ 450,
2537
+ 812,
2538
+ 1200,
2539
+ 1440,
2540
+ 480,
2541
+ 868,
2542
+ 1290,
2543
+ 1530,
2544
+ 510,
2545
+ 924,
2546
+ 1350,
2547
+ 1620,
2548
+ 540,
2549
+ 980,
2550
+ 1440,
2551
+ 1710,
2552
+ 570,
2553
+ 1036,
2554
+ 1530,
2555
+ 1800,
2556
+ 570,
2557
+ 1064,
2558
+ 1590,
2559
+ 1890,
2560
+ 600,
2561
+ 1120,
2562
+ 1680,
2563
+ 1980,
2564
+ 630,
2565
+ 1204,
2566
+ 1770,
2567
+ 2100,
2568
+ 660,
2569
+ 1260,
2570
+ 1860,
2571
+ 2220,
2572
+ 720,
2573
+ 1316,
2574
+ 1950,
2575
+ 2310,
2576
+ 750,
2577
+ 1372,
2578
+ 2040,
2579
+ 2430
2580
+ ];
2581
+ return be.getBlocksCount = function(o, i) {
2582
+ switch (i) {
2583
+ case e.L:
2584
+ return t[(o - 1) * 4 + 0];
2585
+ case e.M:
2586
+ return t[(o - 1) * 4 + 1];
2587
+ case e.Q:
2588
+ return t[(o - 1) * 4 + 2];
2589
+ case e.H:
2590
+ return t[(o - 1) * 4 + 3];
2591
+ default:
2592
+ return;
2593
+ }
2594
+ }, be.getTotalCodewordsCount = function(o, i) {
2595
+ switch (i) {
2596
+ case e.L:
2597
+ return r[(o - 1) * 4 + 0];
2598
+ case e.M:
2599
+ return r[(o - 1) * 4 + 1];
2600
+ case e.Q:
2601
+ return r[(o - 1) * 4 + 2];
2602
+ case e.H:
2603
+ return r[(o - 1) * 4 + 3];
2604
+ default:
2605
+ return;
2606
+ }
2607
+ }, be;
2608
+ }
2609
+ var je = {}, ce = {}, Dt;
2610
+ function Ro() {
2611
+ if (Dt) return ce;
2612
+ Dt = 1;
2613
+ const e = new Uint8Array(512), t = new Uint8Array(256);
2614
+ return (function() {
2615
+ let n = 1;
2616
+ for (let o = 0; o < 255; o++)
2617
+ e[o] = n, t[n] = o, n <<= 1, n & 256 && (n ^= 285);
2618
+ for (let o = 255; o < 512; o++)
2619
+ e[o] = e[o - 255];
2620
+ })(), ce.log = function(n) {
2621
+ if (n < 1) throw new Error("log(" + n + ")");
2622
+ return t[n];
2623
+ }, ce.exp = function(n) {
2624
+ return e[n];
2625
+ }, ce.mul = function(n, o) {
2626
+ return n === 0 || o === 0 ? 0 : e[t[n] + t[o]];
2627
+ }, ce;
2628
+ }
2629
+ var qt;
2630
+ function To() {
2631
+ return qt || (qt = 1, (function(e) {
2632
+ const t = Ro();
2633
+ e.mul = function(n, o) {
2634
+ const i = new Uint8Array(n.length + o.length - 1);
2635
+ for (let s = 0; s < n.length; s++)
2636
+ for (let a = 0; a < o.length; a++)
2637
+ i[s + a] ^= t.mul(n[s], o[a]);
2638
+ return i;
2639
+ }, e.mod = function(n, o) {
2640
+ let i = new Uint8Array(n);
2641
+ for (; i.length - o.length >= 0; ) {
2642
+ const s = i[0];
2643
+ for (let u = 0; u < o.length; u++)
2644
+ i[u] ^= t.mul(o[u], s);
2645
+ let a = 0;
2646
+ for (; a < i.length && i[a] === 0; ) a++;
2647
+ i = i.slice(a);
2648
+ }
2649
+ return i;
2650
+ }, e.generateECPolynomial = function(n) {
2651
+ let o = new Uint8Array([1]);
2652
+ for (let i = 0; i < n; i++)
2653
+ o = e.mul(o, new Uint8Array([1, t.exp(i)]));
2654
+ return o;
2655
+ };
2656
+ })(je)), je;
2657
+ }
2658
+ var He, jt;
2659
+ function Ao() {
2660
+ if (jt) return He;
2661
+ jt = 1;
2662
+ const e = To();
2663
+ function t(r) {
2664
+ this.genPoly = void 0, this.degree = r, this.degree && this.initialize(this.degree);
2665
+ }
2666
+ return t.prototype.initialize = function(n) {
2667
+ this.degree = n, this.genPoly = e.generateECPolynomial(this.degree);
2668
+ }, t.prototype.encode = function(n) {
2669
+ if (!this.genPoly)
2670
+ throw new Error("Encoder not initialized");
2671
+ const o = new Uint8Array(n.length + this.degree);
2672
+ o.set(n);
2673
+ const i = e.mod(o, this.genPoly), s = this.degree - i.length;
2674
+ if (s > 0) {
2675
+ const a = new Uint8Array(this.degree);
2676
+ return a.set(i, s), a;
2677
+ }
2678
+ return i;
2679
+ }, He = t, He;
2680
+ }
2681
+ var ze = {}, Ve = {}, $e = {}, Ht;
2682
+ function Ln() {
2683
+ return Ht || (Ht = 1, $e.isValid = function(t) {
2684
+ return !isNaN(t) && t >= 1 && t <= 40;
2685
+ }), $e;
2686
+ }
2687
+ var V = {}, zt;
2688
+ function In() {
2689
+ if (zt) return V;
2690
+ zt = 1;
2691
+ const e = "[0-9]+", t = "[A-Z $%*+\\-./:]+";
2692
+ let r = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
2693
+ r = r.replace(/u/g, "\\u");
2694
+ const n = "(?:(?![A-Z0-9 $%*+\\-./:]|" + r + `)(?:.|[\r
2695
+ ]))+`;
2696
+ V.KANJI = new RegExp(r, "g"), V.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), V.BYTE = new RegExp(n, "g"), V.NUMERIC = new RegExp(e, "g"), V.ALPHANUMERIC = new RegExp(t, "g");
2697
+ const o = new RegExp("^" + r + "$"), i = new RegExp("^" + e + "$"), s = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
2698
+ return V.testKanji = function(u) {
2699
+ return o.test(u);
2700
+ }, V.testNumeric = function(u) {
2701
+ return i.test(u);
2702
+ }, V.testAlphanumeric = function(u) {
2703
+ return s.test(u);
2704
+ }, V;
2705
+ }
2706
+ var Vt;
2707
+ function ee() {
2708
+ return Vt || (Vt = 1, (function(e) {
2709
+ const t = Ln(), r = In();
2710
+ e.NUMERIC = {
2711
+ id: "Numeric",
2712
+ bit: 1,
2713
+ ccBits: [10, 12, 14]
2714
+ }, e.ALPHANUMERIC = {
2715
+ id: "Alphanumeric",
2716
+ bit: 2,
2717
+ ccBits: [9, 11, 13]
2718
+ }, e.BYTE = {
2719
+ id: "Byte",
2720
+ bit: 4,
2721
+ ccBits: [8, 16, 16]
2722
+ }, e.KANJI = {
2723
+ id: "Kanji",
2724
+ bit: 8,
2725
+ ccBits: [8, 10, 12]
2726
+ }, e.MIXED = {
2727
+ bit: -1
2728
+ }, e.getCharCountIndicator = function(i, s) {
2729
+ if (!i.ccBits) throw new Error("Invalid mode: " + i);
2730
+ if (!t.isValid(s))
2731
+ throw new Error("Invalid version: " + s);
2732
+ return s >= 1 && s < 10 ? i.ccBits[0] : s < 27 ? i.ccBits[1] : i.ccBits[2];
2733
+ }, e.getBestModeForData = function(i) {
2734
+ return r.testNumeric(i) ? e.NUMERIC : r.testAlphanumeric(i) ? e.ALPHANUMERIC : r.testKanji(i) ? e.KANJI : e.BYTE;
2735
+ }, e.toString = function(i) {
2736
+ if (i && i.id) return i.id;
2737
+ throw new Error("Invalid mode");
2738
+ }, e.isValid = function(i) {
2739
+ return i && i.bit && i.ccBits;
2740
+ };
2741
+ function n(o) {
2742
+ if (typeof o != "string")
2743
+ throw new Error("Param is not a string");
2744
+ switch (o.toLowerCase()) {
2745
+ case "numeric":
2746
+ return e.NUMERIC;
2747
+ case "alphanumeric":
2748
+ return e.ALPHANUMERIC;
2749
+ case "kanji":
2750
+ return e.KANJI;
2751
+ case "byte":
2752
+ return e.BYTE;
2753
+ default:
2754
+ throw new Error("Unknown mode: " + o);
2755
+ }
2756
+ }
2757
+ e.from = function(i, s) {
2758
+ if (e.isValid(i))
2759
+ return i;
2760
+ try {
2761
+ return n(i);
2762
+ } catch {
2763
+ return s;
2764
+ }
2765
+ };
2766
+ })(Ve)), Ve;
2767
+ }
2768
+ var $t;
2769
+ function Bo() {
2770
+ return $t || ($t = 1, (function(e) {
2771
+ const t = Z(), r = On(), n = ft(), o = ee(), i = Ln(), s = 7973, a = t.getBCHDigit(s);
2772
+ function u(m, y, d) {
2773
+ for (let p = 1; p <= 40; p++)
2774
+ if (y <= e.getCapacity(p, d, m))
2775
+ return p;
2776
+ }
2777
+ function l(m, y) {
2778
+ return o.getCharCountIndicator(m, y) + 4;
2779
+ }
2780
+ function c(m, y) {
2781
+ let d = 0;
2782
+ return m.forEach(function(p) {
2783
+ const g = l(p.mode, y);
2784
+ d += g + p.getBitsLength();
2785
+ }), d;
2786
+ }
2787
+ function h(m, y) {
2788
+ for (let d = 1; d <= 40; d++)
2789
+ if (c(m, d) <= e.getCapacity(d, y, o.MIXED))
2790
+ return d;
2791
+ }
2792
+ e.from = function(y, d) {
2793
+ return i.isValid(y) ? parseInt(y, 10) : d;
2794
+ }, e.getCapacity = function(y, d, p) {
2795
+ if (!i.isValid(y))
2796
+ throw new Error("Invalid QR Code version");
2797
+ typeof p > "u" && (p = o.BYTE);
2798
+ const g = t.getSymbolTotalCodewords(y), w = r.getTotalCodewordsCount(y, d), P = (g - w) * 8;
2799
+ if (p === o.MIXED) return P;
2800
+ const E = P - l(p, y);
2801
+ switch (p) {
2802
+ case o.NUMERIC:
2803
+ return Math.floor(E / 10 * 3);
2804
+ case o.ALPHANUMERIC:
2805
+ return Math.floor(E / 11 * 2);
2806
+ case o.KANJI:
2807
+ return Math.floor(E / 13);
2808
+ case o.BYTE:
2809
+ default:
2810
+ return Math.floor(E / 8);
2811
+ }
2812
+ }, e.getBestVersionForData = function(y, d) {
2813
+ let p;
2814
+ const g = n.from(d, n.M);
2815
+ if (Array.isArray(y)) {
2816
+ if (y.length > 1)
2817
+ return h(y, g);
2818
+ if (y.length === 0)
2819
+ return 1;
2820
+ p = y[0];
2821
+ } else
2822
+ p = y;
2823
+ return u(p.mode, p.getLength(), g);
2824
+ }, e.getEncodedBits = function(y) {
2825
+ if (!i.isValid(y) || y < 7)
2826
+ throw new Error("Invalid QR Code version");
2827
+ let d = y << 12;
2828
+ for (; t.getBCHDigit(d) - a >= 0; )
2829
+ d ^= s << t.getBCHDigit(d) - a;
2830
+ return y << 12 | d;
2831
+ };
2832
+ })(ze)), ze;
2833
+ }
2834
+ var Je = {}, Jt;
2835
+ function No() {
2836
+ if (Jt) return Je;
2837
+ Jt = 1;
2838
+ const e = Z(), t = 1335, r = 21522, n = e.getBCHDigit(t);
2839
+ return Je.getEncodedBits = function(i, s) {
2840
+ const a = i.bit << 3 | s;
2841
+ let u = a << 10;
2842
+ for (; e.getBCHDigit(u) - n >= 0; )
2843
+ u ^= t << e.getBCHDigit(u) - n;
2844
+ return (a << 10 | u) ^ r;
2845
+ }, Je;
2846
+ }
2847
+ var Ke = {}, We, Kt;
2848
+ function Po() {
2849
+ if (Kt) return We;
2850
+ Kt = 1;
2851
+ const e = ee();
2852
+ function t(r) {
2853
+ this.mode = e.NUMERIC, this.data = r.toString();
2854
+ }
2855
+ return t.getBitsLength = function(n) {
2856
+ return 10 * Math.floor(n / 3) + (n % 3 ? n % 3 * 3 + 1 : 0);
2857
+ }, t.prototype.getLength = function() {
2858
+ return this.data.length;
2859
+ }, t.prototype.getBitsLength = function() {
2860
+ return t.getBitsLength(this.data.length);
2861
+ }, t.prototype.write = function(n) {
2862
+ let o, i, s;
2863
+ for (o = 0; o + 3 <= this.data.length; o += 3)
2864
+ i = this.data.substr(o, 3), s = parseInt(i, 10), n.put(s, 10);
2865
+ const a = this.data.length - o;
2866
+ a > 0 && (i = this.data.substr(o), s = parseInt(i, 10), n.put(s, a * 3 + 1));
2867
+ }, We = t, We;
2868
+ }
2869
+ var Ge, Wt;
2870
+ function Oo() {
2871
+ if (Wt) return Ge;
2872
+ Wt = 1;
2873
+ const e = ee(), t = [
2874
+ "0",
2875
+ "1",
2876
+ "2",
2877
+ "3",
2878
+ "4",
2879
+ "5",
2880
+ "6",
2881
+ "7",
2882
+ "8",
2883
+ "9",
2884
+ "A",
2885
+ "B",
2886
+ "C",
2887
+ "D",
2888
+ "E",
2889
+ "F",
2890
+ "G",
2891
+ "H",
2892
+ "I",
2893
+ "J",
2894
+ "K",
2895
+ "L",
2896
+ "M",
2897
+ "N",
2898
+ "O",
2899
+ "P",
2900
+ "Q",
2901
+ "R",
2902
+ "S",
2903
+ "T",
2904
+ "U",
2905
+ "V",
2906
+ "W",
2907
+ "X",
2908
+ "Y",
2909
+ "Z",
2910
+ " ",
2911
+ "$",
2912
+ "%",
2913
+ "*",
2914
+ "+",
2915
+ "-",
2916
+ ".",
2917
+ "/",
2918
+ ":"
2919
+ ];
2920
+ function r(n) {
2921
+ this.mode = e.ALPHANUMERIC, this.data = n;
2922
+ }
2923
+ return r.getBitsLength = function(o) {
2924
+ return 11 * Math.floor(o / 2) + 6 * (o % 2);
2925
+ }, r.prototype.getLength = function() {
2926
+ return this.data.length;
2927
+ }, r.prototype.getBitsLength = function() {
2928
+ return r.getBitsLength(this.data.length);
2929
+ }, r.prototype.write = function(o) {
2930
+ let i;
2931
+ for (i = 0; i + 2 <= this.data.length; i += 2) {
2932
+ let s = t.indexOf(this.data[i]) * 45;
2933
+ s += t.indexOf(this.data[i + 1]), o.put(s, 11);
2934
+ }
2935
+ this.data.length % 2 && o.put(t.indexOf(this.data[i]), 6);
2936
+ }, Ge = r, Ge;
2937
+ }
2938
+ var Qe, Gt;
2939
+ function Lo() {
2940
+ if (Gt) return Qe;
2941
+ Gt = 1;
2942
+ const e = ee();
2943
+ function t(r) {
2944
+ this.mode = e.BYTE, typeof r == "string" ? this.data = new TextEncoder().encode(r) : this.data = new Uint8Array(r);
2945
+ }
2946
+ return t.getBitsLength = function(n) {
2947
+ return n * 8;
2948
+ }, t.prototype.getLength = function() {
2949
+ return this.data.length;
2950
+ }, t.prototype.getBitsLength = function() {
2951
+ return t.getBitsLength(this.data.length);
2952
+ }, t.prototype.write = function(r) {
2953
+ for (let n = 0, o = this.data.length; n < o; n++)
2954
+ r.put(this.data[n], 8);
2955
+ }, Qe = t, Qe;
2956
+ }
2957
+ var Ye, Qt;
2958
+ function Io() {
2959
+ if (Qt) return Ye;
2960
+ Qt = 1;
2961
+ const e = ee(), t = Z();
2962
+ function r(n) {
2963
+ this.mode = e.KANJI, this.data = n;
2964
+ }
2965
+ return r.getBitsLength = function(o) {
2966
+ return o * 13;
2967
+ }, r.prototype.getLength = function() {
2968
+ return this.data.length;
2969
+ }, r.prototype.getBitsLength = function() {
2970
+ return r.getBitsLength(this.data.length);
2971
+ }, r.prototype.write = function(n) {
2972
+ let o;
2973
+ for (o = 0; o < this.data.length; o++) {
2974
+ let i = t.toSJIS(this.data[o]);
2975
+ if (i >= 33088 && i <= 40956)
2976
+ i -= 33088;
2977
+ else if (i >= 57408 && i <= 60351)
2978
+ i -= 49472;
2979
+ else
2980
+ throw new Error(
2981
+ "Invalid SJIS character: " + this.data[o] + `
2982
+ Make sure your charset is UTF-8`
2983
+ );
2984
+ i = (i >>> 8 & 255) * 192 + (i & 255), n.put(i, 13);
2985
+ }
2986
+ }, Ye = r, Ye;
2987
+ }
2988
+ var Xe = { exports: {} }, Yt;
2989
+ function _o() {
2990
+ return Yt || (Yt = 1, (function(e) {
2991
+ var t = {
2992
+ single_source_shortest_paths: function(r, n, o) {
2993
+ var i = {}, s = {};
2994
+ s[n] = 0;
2995
+ var a = t.PriorityQueue.make();
2996
+ a.push(n, 0);
2997
+ for (var u, l, c, h, m, y, d, p, g; !a.empty(); ) {
2998
+ u = a.pop(), l = u.value, h = u.cost, m = r[l] || {};
2999
+ for (c in m)
3000
+ m.hasOwnProperty(c) && (y = m[c], d = h + y, p = s[c], g = typeof s[c] > "u", (g || p > d) && (s[c] = d, a.push(c, d), i[c] = l));
3001
+ }
3002
+ if (typeof o < "u" && typeof s[o] > "u") {
3003
+ var w = ["Could not find a path from ", n, " to ", o, "."].join("");
3004
+ throw new Error(w);
3005
+ }
3006
+ return i;
3007
+ },
3008
+ extract_shortest_path_from_predecessor_list: function(r, n) {
3009
+ for (var o = [], i = n; i; )
3010
+ o.push(i), r[i], i = r[i];
3011
+ return o.reverse(), o;
3012
+ },
3013
+ find_path: function(r, n, o) {
3014
+ var i = t.single_source_shortest_paths(r, n, o);
3015
+ return t.extract_shortest_path_from_predecessor_list(
3016
+ i,
3017
+ o
3018
+ );
3019
+ },
3020
+ /**
3021
+ * A very naive priority queue implementation.
3022
+ */
3023
+ PriorityQueue: {
3024
+ make: function(r) {
3025
+ var n = t.PriorityQueue, o = {}, i;
3026
+ r = r || {};
3027
+ for (i in n)
3028
+ n.hasOwnProperty(i) && (o[i] = n[i]);
3029
+ return o.queue = [], o.sorter = r.sorter || n.default_sorter, o;
3030
+ },
3031
+ default_sorter: function(r, n) {
3032
+ return r.cost - n.cost;
3033
+ },
3034
+ /**
3035
+ * Add a new item to the queue and ensure the highest priority element
3036
+ * is at the front of the queue.
3037
+ */
3038
+ push: function(r, n) {
3039
+ var o = { value: r, cost: n };
3040
+ this.queue.push(o), this.queue.sort(this.sorter);
3041
+ },
3042
+ /**
3043
+ * Return the highest priority element in the queue.
3044
+ */
3045
+ pop: function() {
3046
+ return this.queue.shift();
3047
+ },
3048
+ empty: function() {
3049
+ return this.queue.length === 0;
3050
+ }
3051
+ }
3052
+ };
3053
+ e.exports = t;
3054
+ })(Xe)), Xe.exports;
3055
+ }
3056
+ var Xt;
3057
+ function Uo() {
3058
+ return Xt || (Xt = 1, (function(e) {
3059
+ const t = ee(), r = Po(), n = Oo(), o = Lo(), i = Io(), s = In(), a = Z(), u = _o();
3060
+ function l(w) {
3061
+ return unescape(encodeURIComponent(w)).length;
3062
+ }
3063
+ function c(w, P, E) {
3064
+ const R = [];
3065
+ let _;
3066
+ for (; (_ = w.exec(E)) !== null; )
3067
+ R.push({
3068
+ data: _[0],
3069
+ index: _.index,
3070
+ mode: P,
3071
+ length: _[0].length
3072
+ });
3073
+ return R;
3074
+ }
3075
+ function h(w) {
3076
+ const P = c(s.NUMERIC, t.NUMERIC, w), E = c(s.ALPHANUMERIC, t.ALPHANUMERIC, w);
3077
+ let R, _;
3078
+ return a.isKanjiModeEnabled() ? (R = c(s.BYTE, t.BYTE, w), _ = c(s.KANJI, t.KANJI, w)) : (R = c(s.BYTE_KANJI, t.BYTE, w), _ = []), P.concat(E, R, _).sort(function(S, A) {
3079
+ return S.index - A.index;
3080
+ }).map(function(S) {
3081
+ return {
3082
+ data: S.data,
3083
+ mode: S.mode,
3084
+ length: S.length
3085
+ };
3086
+ });
3087
+ }
3088
+ function m(w, P) {
3089
+ switch (P) {
3090
+ case t.NUMERIC:
3091
+ return r.getBitsLength(w);
3092
+ case t.ALPHANUMERIC:
3093
+ return n.getBitsLength(w);
3094
+ case t.KANJI:
3095
+ return i.getBitsLength(w);
3096
+ case t.BYTE:
3097
+ return o.getBitsLength(w);
3098
+ }
3099
+ }
3100
+ function y(w) {
3101
+ return w.reduce(function(P, E) {
3102
+ const R = P.length - 1 >= 0 ? P[P.length - 1] : null;
3103
+ return R && R.mode === E.mode ? (P[P.length - 1].data += E.data, P) : (P.push(E), P);
3104
+ }, []);
3105
+ }
3106
+ function d(w) {
3107
+ const P = [];
3108
+ for (let E = 0; E < w.length; E++) {
3109
+ const R = w[E];
3110
+ switch (R.mode) {
3111
+ case t.NUMERIC:
3112
+ P.push([
3113
+ R,
3114
+ { data: R.data, mode: t.ALPHANUMERIC, length: R.length },
3115
+ { data: R.data, mode: t.BYTE, length: R.length }
3116
+ ]);
3117
+ break;
3118
+ case t.ALPHANUMERIC:
3119
+ P.push([
3120
+ R,
3121
+ { data: R.data, mode: t.BYTE, length: R.length }
3122
+ ]);
3123
+ break;
3124
+ case t.KANJI:
3125
+ P.push([
3126
+ R,
3127
+ { data: R.data, mode: t.BYTE, length: l(R.data) }
3128
+ ]);
3129
+ break;
3130
+ case t.BYTE:
3131
+ P.push([
3132
+ { data: R.data, mode: t.BYTE, length: l(R.data) }
3133
+ ]);
3134
+ }
3135
+ }
3136
+ return P;
3137
+ }
3138
+ function p(w, P) {
3139
+ const E = {}, R = { start: {} };
3140
+ let _ = ["start"];
3141
+ for (let b = 0; b < w.length; b++) {
3142
+ const S = w[b], A = [];
3143
+ for (let C = 0; C < S.length; C++) {
3144
+ const L = S[C], B = "" + b + C;
3145
+ A.push(B), E[B] = { node: L, lastCount: 0 }, R[B] = {};
3146
+ for (let N = 0; N < _.length; N++) {
3147
+ const T = _[N];
3148
+ E[T] && E[T].node.mode === L.mode ? (R[T][B] = m(E[T].lastCount + L.length, L.mode) - m(E[T].lastCount, L.mode), E[T].lastCount += L.length) : (E[T] && (E[T].lastCount = L.length), R[T][B] = m(L.length, L.mode) + 4 + t.getCharCountIndicator(L.mode, P));
3149
+ }
3150
+ }
3151
+ _ = A;
3152
+ }
3153
+ for (let b = 0; b < _.length; b++)
3154
+ R[_[b]].end = 0;
3155
+ return { map: R, table: E };
3156
+ }
3157
+ function g(w, P) {
3158
+ let E;
3159
+ const R = t.getBestModeForData(w);
3160
+ if (E = t.from(P, R), E !== t.BYTE && E.bit < R.bit)
3161
+ throw new Error('"' + w + '" cannot be encoded with mode ' + t.toString(E) + `.
3162
+ Suggested mode is: ` + t.toString(R));
3163
+ switch (E === t.KANJI && !a.isKanjiModeEnabled() && (E = t.BYTE), E) {
3164
+ case t.NUMERIC:
3165
+ return new r(w);
3166
+ case t.ALPHANUMERIC:
3167
+ return new n(w);
3168
+ case t.KANJI:
3169
+ return new i(w);
3170
+ case t.BYTE:
3171
+ return new o(w);
3172
+ }
3173
+ }
3174
+ e.fromArray = function(P) {
3175
+ return P.reduce(function(E, R) {
3176
+ return typeof R == "string" ? E.push(g(R, null)) : R.data && E.push(g(R.data, R.mode)), E;
3177
+ }, []);
3178
+ }, e.fromString = function(P, E) {
3179
+ const R = h(P, a.isKanjiModeEnabled()), _ = d(R), b = p(_, E), S = u.find_path(b.map, "start", "end"), A = [];
3180
+ for (let C = 1; C < S.length - 1; C++)
3181
+ A.push(b.table[S[C]].node);
3182
+ return e.fromArray(y(A));
3183
+ }, e.rawSplit = function(P) {
3184
+ return e.fromArray(
3185
+ h(P, a.isKanjiModeEnabled())
3186
+ );
3187
+ };
3188
+ })(Ke)), Ke;
3189
+ }
3190
+ var Zt;
3191
+ function vo() {
3192
+ if (Zt) return ve;
3193
+ Zt = 1;
3194
+ const e = Z(), t = ft(), r = wo(), n = bo(), o = Eo(), i = Co(), s = So(), a = On(), u = Ao(), l = Bo(), c = No(), h = ee(), m = Uo();
3195
+ function y(b, S) {
3196
+ const A = b.size, C = i.getPositions(S);
3197
+ for (let L = 0; L < C.length; L++) {
3198
+ const B = C[L][0], N = C[L][1];
3199
+ for (let T = -1; T <= 7; T++)
3200
+ if (!(B + T <= -1 || A <= B + T))
3201
+ for (let O = -1; O <= 7; O++)
3202
+ N + O <= -1 || A <= N + O || (T >= 0 && T <= 6 && (O === 0 || O === 6) || O >= 0 && O <= 6 && (T === 0 || T === 6) || T >= 2 && T <= 4 && O >= 2 && O <= 4 ? b.set(B + T, N + O, !0, !0) : b.set(B + T, N + O, !1, !0));
3203
+ }
3204
+ }
3205
+ function d(b) {
3206
+ const S = b.size;
3207
+ for (let A = 8; A < S - 8; A++) {
3208
+ const C = A % 2 === 0;
3209
+ b.set(A, 6, C, !0), b.set(6, A, C, !0);
3210
+ }
3211
+ }
3212
+ function p(b, S) {
3213
+ const A = o.getPositions(S);
3214
+ for (let C = 0; C < A.length; C++) {
3215
+ const L = A[C][0], B = A[C][1];
3216
+ for (let N = -2; N <= 2; N++)
3217
+ for (let T = -2; T <= 2; T++)
3218
+ N === -2 || N === 2 || T === -2 || T === 2 || N === 0 && T === 0 ? b.set(L + N, B + T, !0, !0) : b.set(L + N, B + T, !1, !0);
3219
+ }
3220
+ }
3221
+ function g(b, S) {
3222
+ const A = b.size, C = l.getEncodedBits(S);
3223
+ let L, B, N;
3224
+ for (let T = 0; T < 18; T++)
3225
+ L = Math.floor(T / 3), B = T % 3 + A - 8 - 3, N = (C >> T & 1) === 1, b.set(L, B, N, !0), b.set(B, L, N, !0);
3226
+ }
3227
+ function w(b, S, A) {
3228
+ const C = b.size, L = c.getEncodedBits(S, A);
3229
+ let B, N;
3230
+ for (B = 0; B < 15; B++)
3231
+ N = (L >> B & 1) === 1, B < 6 ? b.set(B, 8, N, !0) : B < 8 ? b.set(B + 1, 8, N, !0) : b.set(C - 15 + B, 8, N, !0), B < 8 ? b.set(8, C - B - 1, N, !0) : B < 9 ? b.set(8, 15 - B - 1 + 1, N, !0) : b.set(8, 15 - B - 1, N, !0);
3232
+ b.set(C - 8, 8, 1, !0);
3233
+ }
3234
+ function P(b, S) {
3235
+ const A = b.size;
3236
+ let C = -1, L = A - 1, B = 7, N = 0;
3237
+ for (let T = A - 1; T > 0; T -= 2)
3238
+ for (T === 6 && T--; ; ) {
3239
+ for (let O = 0; O < 2; O++)
3240
+ if (!b.isReserved(L, T - O)) {
3241
+ let q = !1;
3242
+ N < S.length && (q = (S[N] >>> B & 1) === 1), b.set(L, T - O, q), B--, B === -1 && (N++, B = 7);
3243
+ }
3244
+ if (L += C, L < 0 || A <= L) {
3245
+ L -= C, C = -C;
3246
+ break;
3247
+ }
3248
+ }
3249
+ }
3250
+ function E(b, S, A) {
3251
+ const C = new r();
3252
+ A.forEach(function(O) {
3253
+ C.put(O.mode.bit, 4), C.put(O.getLength(), h.getCharCountIndicator(O.mode, b)), O.write(C);
3254
+ });
3255
+ const L = e.getSymbolTotalCodewords(b), B = a.getTotalCodewordsCount(b, S), N = (L - B) * 8;
3256
+ for (C.getLengthInBits() + 4 <= N && C.put(0, 4); C.getLengthInBits() % 8 !== 0; )
3257
+ C.putBit(0);
3258
+ const T = (N - C.getLengthInBits()) / 8;
3259
+ for (let O = 0; O < T; O++)
3260
+ C.put(O % 2 ? 17 : 236, 8);
3261
+ return R(C, b, S);
3262
+ }
3263
+ function R(b, S, A) {
3264
+ const C = e.getSymbolTotalCodewords(S), L = a.getTotalCodewordsCount(S, A), B = C - L, N = a.getBlocksCount(S, A), T = C % N, O = N - T, q = Math.floor(C / N), v = Math.floor(B / N), me = v + 1, j = q - v, ye = new u(j);
3265
+ let ue = 0;
3266
+ const D = new Array(N), $ = new Array(N);
3267
+ let G = 0;
3268
+ const te = new Uint8Array(b.buffer);
3269
+ for (let re = 0; re < N; re++) {
3270
+ const Oe = re < O ? v : me;
3271
+ D[re] = te.slice(ue, ue + Oe), $[re] = ye.encode(D[re]), ue += Oe, G = Math.max(G, Oe);
3272
+ }
3273
+ const ne = new Uint8Array(C);
3274
+ let ht = 0, J, K;
3275
+ for (J = 0; J < G; J++)
3276
+ for (K = 0; K < N; K++)
3277
+ J < D[K].length && (ne[ht++] = D[K][J]);
3278
+ for (J = 0; J < j; J++)
3279
+ for (K = 0; K < N; K++)
3280
+ ne[ht++] = $[K][J];
3281
+ return ne;
3282
+ }
3283
+ function _(b, S, A, C) {
3284
+ let L;
3285
+ if (Array.isArray(b))
3286
+ L = m.fromArray(b);
3287
+ else if (typeof b == "string") {
3288
+ let q = S;
3289
+ if (!q) {
3290
+ const v = m.rawSplit(b);
3291
+ q = l.getBestVersionForData(v, A);
3292
+ }
3293
+ L = m.fromString(b, q || 40);
3294
+ } else
3295
+ throw new Error("Invalid data");
3296
+ const B = l.getBestVersionForData(L, A);
3297
+ if (!B)
3298
+ throw new Error("The amount of data is too big to be stored in a QR Code");
3299
+ if (!S)
3300
+ S = B;
3301
+ else if (S < B)
3302
+ throw new Error(
3303
+ `
3304
+ The chosen QR Code version cannot contain this amount of data.
3305
+ Minimum version required to store current data is: ` + B + `.
3306
+ `
3307
+ );
3308
+ const N = E(S, A, L), T = e.getSymbolSize(S), O = new n(T);
3309
+ return y(O, S), d(O), p(O, S), w(O, A, 0), S >= 7 && g(O, S), P(O, N), isNaN(C) && (C = s.getBestMask(
3310
+ O,
3311
+ w.bind(null, O, A)
3312
+ )), s.applyMask(C, O), w(O, A, C), {
3313
+ modules: O,
3314
+ version: S,
3315
+ errorCorrectionLevel: A,
3316
+ maskPattern: C,
3317
+ segments: L
3318
+ };
3319
+ }
3320
+ return ve.create = function(S, A) {
3321
+ if (typeof S > "u" || S === "")
3322
+ throw new Error("No input text");
3323
+ let C = t.M, L, B;
3324
+ return typeof A < "u" && (C = t.from(A.errorCorrectionLevel, t.M), L = l.from(A.version), B = s.from(A.maskPattern), A.toSJISFunc && e.setToSJISFunction(A.toSJISFunc)), _(S, L, C, B);
3325
+ }, ve;
3326
+ }
3327
+ var Ze = {}, et = {}, en;
3328
+ function _n() {
3329
+ return en || (en = 1, (function(e) {
3330
+ function t(r) {
3331
+ if (typeof r == "number" && (r = r.toString()), typeof r != "string")
3332
+ throw new Error("Color should be defined as hex string");
3333
+ let n = r.slice().replace("#", "").split("");
3334
+ if (n.length < 3 || n.length === 5 || n.length > 8)
3335
+ throw new Error("Invalid hex color: " + r);
3336
+ (n.length === 3 || n.length === 4) && (n = Array.prototype.concat.apply([], n.map(function(i) {
3337
+ return [i, i];
3338
+ }))), n.length === 6 && n.push("F", "F");
3339
+ const o = parseInt(n.join(""), 16);
3340
+ return {
3341
+ r: o >> 24 & 255,
3342
+ g: o >> 16 & 255,
3343
+ b: o >> 8 & 255,
3344
+ a: o & 255,
3345
+ hex: "#" + n.slice(0, 6).join("")
3346
+ };
3347
+ }
3348
+ e.getOptions = function(n) {
3349
+ n || (n = {}), n.color || (n.color = {});
3350
+ const o = typeof n.margin > "u" || n.margin === null || n.margin < 0 ? 4 : n.margin, i = n.width && n.width >= 21 ? n.width : void 0, s = n.scale || 4;
3351
+ return {
3352
+ width: i,
3353
+ scale: i ? 4 : s,
3354
+ margin: o,
3355
+ color: {
3356
+ dark: t(n.color.dark || "#000000ff"),
3357
+ light: t(n.color.light || "#ffffffff")
3358
+ },
3359
+ type: n.type,
3360
+ rendererOpts: n.rendererOpts || {}
3361
+ };
3362
+ }, e.getScale = function(n, o) {
3363
+ return o.width && o.width >= n + o.margin * 2 ? o.width / (n + o.margin * 2) : o.scale;
3364
+ }, e.getImageWidth = function(n, o) {
3365
+ const i = e.getScale(n, o);
3366
+ return Math.floor((n + o.margin * 2) * i);
3367
+ }, e.qrToImageData = function(n, o, i) {
3368
+ const s = o.modules.size, a = o.modules.data, u = e.getScale(s, i), l = Math.floor((s + i.margin * 2) * u), c = i.margin * u, h = [i.color.light, i.color.dark];
3369
+ for (let m = 0; m < l; m++)
3370
+ for (let y = 0; y < l; y++) {
3371
+ let d = (m * l + y) * 4, p = i.color.light;
3372
+ if (m >= c && y >= c && m < l - c && y < l - c) {
3373
+ const g = Math.floor((m - c) / u), w = Math.floor((y - c) / u);
3374
+ p = h[a[g * s + w] ? 1 : 0];
3375
+ }
3376
+ n[d++] = p.r, n[d++] = p.g, n[d++] = p.b, n[d] = p.a;
3377
+ }
3378
+ };
3379
+ })(et)), et;
3380
+ }
3381
+ var tn;
3382
+ function xo() {
3383
+ return tn || (tn = 1, (function(e) {
3384
+ const t = _n();
3385
+ function r(o, i, s) {
3386
+ o.clearRect(0, 0, i.width, i.height), i.style || (i.style = {}), i.height = s, i.width = s, i.style.height = s + "px", i.style.width = s + "px";
3387
+ }
3388
+ function n() {
3389
+ try {
3390
+ return document.createElement("canvas");
3391
+ } catch {
3392
+ throw new Error("You need to specify a canvas element");
3393
+ }
3394
+ }
3395
+ e.render = function(i, s, a) {
3396
+ let u = a, l = s;
3397
+ typeof u > "u" && (!s || !s.getContext) && (u = s, s = void 0), s || (l = n()), u = t.getOptions(u);
3398
+ const c = t.getImageWidth(i.modules.size, u), h = l.getContext("2d"), m = h.createImageData(c, c);
3399
+ return t.qrToImageData(m.data, i, u), r(h, l, c), h.putImageData(m, 0, 0), l;
3400
+ }, e.renderToDataURL = function(i, s, a) {
3401
+ let u = a;
3402
+ typeof u > "u" && (!s || !s.getContext) && (u = s, s = void 0), u || (u = {});
3403
+ const l = e.render(i, s, u), c = u.type || "image/png", h = u.rendererOpts || {};
3404
+ return l.toDataURL(c, h.quality);
3405
+ };
3406
+ })(Ze)), Ze;
3407
+ }
3408
+ var tt = {}, nn;
3409
+ function Fo() {
3410
+ if (nn) return tt;
3411
+ nn = 1;
3412
+ const e = _n();
3413
+ function t(o, i) {
3414
+ const s = o.a / 255, a = i + '="' + o.hex + '"';
3415
+ return s < 1 ? a + " " + i + '-opacity="' + s.toFixed(2).slice(1) + '"' : a;
3416
+ }
3417
+ function r(o, i, s) {
3418
+ let a = o + i;
3419
+ return typeof s < "u" && (a += " " + s), a;
3420
+ }
3421
+ function n(o, i, s) {
3422
+ let a = "", u = 0, l = !1, c = 0;
3423
+ for (let h = 0; h < o.length; h++) {
3424
+ const m = Math.floor(h % i), y = Math.floor(h / i);
3425
+ !m && !l && (l = !0), o[h] ? (c++, h > 0 && m > 0 && o[h - 1] || (a += l ? r("M", m + s, 0.5 + y + s) : r("m", u, 0), u = 0, l = !1), m + 1 < i && o[h + 1] || (a += r("h", c), c = 0)) : u++;
3426
+ }
3427
+ return a;
3428
+ }
3429
+ return tt.render = function(i, s, a) {
3430
+ const u = e.getOptions(s), l = i.modules.size, c = i.modules.data, h = l + u.margin * 2, m = u.color.light.a ? "<path " + t(u.color.light, "fill") + ' d="M0 0h' + h + "v" + h + 'H0z"/>' : "", y = "<path " + t(u.color.dark, "stroke") + ' d="' + n(c, l, u.margin) + '"/>', d = 'viewBox="0 0 ' + h + " " + h + '"', g = '<svg xmlns="http://www.w3.org/2000/svg" ' + (u.width ? 'width="' + u.width + '" height="' + u.width + '" ' : "") + d + ' shape-rendering="crispEdges">' + m + y + `</svg>
3431
+ `;
3432
+ return typeof a == "function" && a(null, g), g;
3433
+ }, tt;
3434
+ }
3435
+ var rn;
3436
+ function Mo() {
3437
+ if (rn) return oe;
3438
+ rn = 1;
3439
+ const e = yo(), t = vo(), r = xo(), n = Fo();
3440
+ function o(i, s, a, u, l) {
3441
+ const c = [].slice.call(arguments, 1), h = c.length, m = typeof c[h - 1] == "function";
3442
+ if (!m && !e())
3443
+ throw new Error("Callback required as last argument");
3444
+ if (m) {
3445
+ if (h < 2)
3446
+ throw new Error("Too few arguments provided");
3447
+ h === 2 ? (l = a, a = s, s = u = void 0) : h === 3 && (s.getContext && typeof l > "u" ? (l = u, u = void 0) : (l = u, u = a, a = s, s = void 0));
3448
+ } else {
3449
+ if (h < 1)
3450
+ throw new Error("Too few arguments provided");
3451
+ return h === 1 ? (a = s, s = u = void 0) : h === 2 && !s.getContext && (u = a, a = s, s = void 0), new Promise(function(y, d) {
3452
+ try {
3453
+ const p = t.create(a, u);
3454
+ y(i(p, s, u));
3455
+ } catch (p) {
3456
+ d(p);
3457
+ }
3458
+ });
3459
+ }
3460
+ try {
3461
+ const y = t.create(a, u);
3462
+ l(null, i(y, s, u));
3463
+ } catch (y) {
3464
+ l(y);
3465
+ }
3466
+ }
3467
+ return oe.create = t.create, oe.toCanvas = o.bind(null, r.render), oe.toDataURL = o.bind(null, r.renderToDataURL), oe.toString = o.bind(null, function(i, s, a) {
3468
+ return n.render(i, a);
3469
+ }), oe;
3470
+ }
3471
+ var ko = Mo();
3472
+ class Do {
3473
+ constructor() {
3474
+ F(this, "overlay", null);
3475
+ F(this, "isOpen", !1);
3476
+ F(this, "errorCallback", null);
3477
+ F(this, "authEvent", null);
3478
+ // Элементы для управления состояниями
3479
+ F(this, "contentContainer", null);
3480
+ F(this, "loader", null);
3481
+ F(this, "qrContainer", null);
3482
+ F(this, "separator", null);
3483
+ F(this, "loginButton", null);
3484
+ F(this, "errorContainer", null);
3485
+ F(this, "timerContainer", null);
3486
+ // Таймер
3487
+ F(this, "timerInterval", null);
3488
+ // Добавим свойство для хранения данных запроса
3489
+ F(this, "requestData", null);
3490
+ }
3491
+ createElement(t, r, n) {
3492
+ const o = document.createElement(t);
3493
+ return o.className = r, n && (o.textContent = n), o;
3494
+ }
3495
+ createModal() {
3496
+ this.overlay = this.createElement("div", "oauth-modal-overlay"), this.contentContainer = this.createElement("div", "oauth-modal-content");
3497
+ const t = this.createElement("h3", "", "Отсканируйте QR-код");
3498
+ this.contentContainer.appendChild(t), this.loader = this.createElement("div", "oauth-loader"), this.loader.innerHTML = '<div class="oauth-spinner"></div>', this.contentContainer.appendChild(this.loader), this.qrContainer = this.createElement("div", "oauth-qrcode-container"), this.contentContainer.appendChild(this.qrContainer), this.timerContainer = this.createElement("div", "oauth-timer-container"), this.contentContainer.appendChild(this.timerContainer), this.separator = this.createElement("p", "oauth-modal-separator", "ИЛИ"), this.contentContainer.appendChild(this.separator), this.loginButton = this.createElement("button", "oauth-login-button", "Войдите с текущего устройства"), this.contentContainer.appendChild(this.loginButton), this.errorContainer = this.createElement("div", "oauth-error-container"), this.errorContainer.style.display = "none", this.contentContainer.appendChild(this.errorContainer), this.overlay.appendChild(this.contentContainer), this.overlay.addEventListener("click", (r) => {
3499
+ r.target === this.overlay && this.close();
3500
+ }), document.body.appendChild(this.overlay);
3501
+ }
3502
+ async generateQR(t, r) {
3503
+ try {
3504
+ t.innerHTML = "";
3505
+ const n = document.createElement("canvas");
3506
+ await ko.toCanvas(n, r, { width: 200, margin: 1 }), t.appendChild(n);
3507
+ } catch (n) {
3508
+ console.error("Ошибка при генерации QR-кода:", n), t.innerHTML = "<p>Не удалось загрузить QR-код</p>";
3509
+ }
3510
+ }
3511
+ startTimer(t) {
3512
+ this.timerInterval && clearInterval(this.timerInterval);
3513
+ const r = () => {
3514
+ const n = (/* @__PURE__ */ new Date()).getTime(), i = new Date(t).getTime() - n;
3515
+ if (i > 0) {
3516
+ const s = Math.floor(i % 36e5 / 6e4), a = Math.floor(i % (1e3 * 60) / 1e3);
3517
+ this.timerContainer.textContent = `Ссылка действительна еще: ${String(s).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
3518
+ } else
3519
+ clearInterval(this.timerInterval), this.timerInterval = null, this.renderExpiredState();
3520
+ };
3521
+ r(), this.timerInterval = window.setInterval(r, 1e3);
3522
+ }
3523
+ setLoadingState() {
3524
+ this.loader.style.display = "flex", this.qrContainer.style.display = "none", this.separator.style.display = "none", this.loginButton.style.display = "none", this.errorContainer.style.display = "none", this.timerContainer.style.display = "none";
3525
+ }
3526
+ renderSuccessState(t) {
3527
+ this.loader.style.display = "none", this.errorContainer.style.display = "none", this.qrContainer.style.display = "flex", this.separator.style.display = "block", this.loginButton.style.display = "block";
3528
+ const r = t.links[0].link;
3529
+ this.generateQR(this.qrContainer, r), this.loginButton.onclick = () => window.open(r), this.authEvent = jo(() => this.close(), (n) => this.renderErrorState(n)), t.validUntil ? (this.timerContainer.style.display = "block", this.startTimer(t.validUntil)) : this.timerContainer.style.display = "none";
3530
+ }
3531
+ renderErrorState(t) {
3532
+ this.loader.style.display = "none", this.qrContainer.style.display = "none", this.separator.style.display = "none", this.loginButton.style.display = "none", this.timerContainer.style.display = "none", this.errorContainer.style.display = "block", this.errorContainer.innerHTML = `
3533
+ <p class="oauth-error-message">Ошибка: ${t.message || "Неизвестная ошибка"}</p>
3534
+ <button class="oauth-retry-button">Повторить</button>
3535
+ `, this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click", () => {
3536
+ this.startAuthFlow();
3537
+ });
3538
+ }
3539
+ renderExpiredState() {
3540
+ this.qrContainer.style.display = "none", this.separator.style.display = "none", this.loginButton.style.display = "none", this.errorContainer.style.display = "block", this.errorContainer.innerHTML = `
3541
+ <p class="oauth-error-message">Срок действия ссылки истек.</p>
3542
+ <button class="oauth-retry-button">Обновить</button>
3543
+ `, this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click", () => {
3544
+ this.startAuthFlow();
3545
+ });
3546
+ }
3547
+ async show(t, r) {
3548
+ this.isOpen || (this.requestData = t, this.errorCallback = r || null, this.overlay || this.createModal(), this.isOpen = !0, setTimeout(() => {
3549
+ var n;
3550
+ return (n = this.overlay) == null ? void 0 : n.classList.add("active");
3551
+ }, 10), this.startAuthFlow());
3552
+ }
3553
+ async startAuthFlow() {
3554
+ if (this.requestData) {
3555
+ this.setLoadingState();
3556
+ try {
3557
+ const t = await qo(this.requestData);
3558
+ this.renderSuccessState(t);
3559
+ } catch (t) {
3560
+ this.renderErrorState(t), this.errorCallback && this.errorCallback(t);
3561
+ }
3562
+ }
3563
+ }
3564
+ close() {
3565
+ !this.isOpen || !this.overlay || (this.authEvent && this.authEvent.close(), this.timerInterval && (clearInterval(this.timerInterval), this.timerInterval = null), this.overlay.classList.remove("active"), setTimeout(() => {
3566
+ this.overlay && this.overlay.parentNode && this.overlay.parentNode.removeChild(this.overlay), this.overlay = null, this.isOpen = !1, this.requestData = null;
3567
+ }, 400));
3568
+ }
3569
+ }
3570
+ Ho();
3571
+ const fe = Dn(), Un = U.create({
3572
+ baseURL: fe.baseUrl
3573
+ }), dt = new Do();
3574
+ function li(e = {}) {
3575
+ dt.show(e);
3576
+ }
3577
+ function ci() {
3578
+ dt.close();
3579
+ }
3580
+ async function qo(e = {}) {
3581
+ return (await Un.post(fe.createEndpoint, e, {
3582
+ withCredentials: !0
3583
+ })).data;
3584
+ }
3585
+ function jo(e = () => dt.close(), t = () => {
3586
+ }) {
3587
+ const r = new URL(fe.authEventEndpoint, fe.baseUrl), n = new EventSource(r, {
3588
+ withCredentials: !0
3589
+ });
3590
+ return n.addEventListener("auth-success", async (o) => {
3591
+ try {
3592
+ await Un.post(fe.authConfirmEndpoint, null, {
3593
+ withCredentials: !0
3594
+ }), e();
3595
+ } catch (i) {
3596
+ console.error(i), t(i);
3597
+ } finally {
3598
+ n.close();
3599
+ }
3600
+ }), n.onerror = (o) => {
3601
+ console.error("EventSource failed:", o), n.close();
3602
+ }, n;
3603
+ }
3604
+ function Ho() {
3605
+ if (document.getElementById("oauth0-js-lib-styles")) return;
3606
+ const e = document.createElement("style");
3607
+ e.id = "oauth0-js-lib-styles", e.innerHTML = mo, document.head.appendChild(e);
3608
+ }
3609
+ export {
3610
+ ci as closeQrLogin,
3611
+ jo as createAuthEvent,
3612
+ qo as createAuthSession,
3613
+ Dn as getConfig,
3614
+ Vo as setConfig,
3615
+ li as showQrLogin
3616
+ };