fingerprintjs-pro
Version:
A React library for integrating FingerprintJS Pro to identify users with high accuracy.
1,713 lines • 58.4 kB
JavaScript
function Ce(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: Ze } = Object.prototype, { getPrototypeOf: ce } = Object, W = /* @__PURE__ */ ((e) => (t) => {
const r = Ze.call(t);
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), C = (e) => (e = e.toLowerCase(), (t) => W(t) === e), K = (e) => (t) => typeof t === e, { isArray: L } = Array, j = K("undefined");
function Qe(e) {
return e !== null && !j(e) && e.constructor !== null && !j(e.constructor) && x(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const Pe = C("ArrayBuffer");
function Ye(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Pe(e.buffer), t;
}
const et = K("string"), x = K("function"), Ne = K("number"), G = (e) => e !== null && typeof e == "object", tt = (e) => e === !0 || e === !1, H = (e) => {
if (W(e) !== "object")
return !1;
const t = ce(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, nt = C("Date"), rt = C("File"), st = C("Blob"), ot = C("FileList"), it = (e) => G(e) && x(e.pipe), at = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || x(e.append) && ((t = W(e)) === "formdata" || // detect form-data instance
t === "object" && x(e.toString) && e.toString() === "[object FormData]"));
}, ct = C("URLSearchParams"), [lt, ut, ft, dt] = ["ReadableStream", "Request", "Response", "Headers"].map(C), pt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function q(e, t, { allOwnKeys: r = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let n, s;
if (typeof e != "object" && (e = [e]), L(e))
for (n = 0, s = e.length; n < s; n++)
t.call(null, e[n], n, e);
else {
const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
let c;
for (n = 0; n < i; n++)
c = o[n], t.call(null, e[c], c, e);
}
}
function Fe(e, t) {
t = t.toLowerCase();
const r = Object.keys(e);
let n = r.length, s;
for (; n-- > 0; )
if (s = r[n], t === s.toLowerCase())
return s;
return null;
}
const _ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, De = (e) => !j(e) && e !== _;
function ne() {
const { caseless: e } = De(this) && this || {}, t = {}, r = (n, s) => {
const o = e && Fe(t, s) || s;
H(t[o]) && H(n) ? t[o] = ne(t[o], n) : H(n) ? t[o] = ne({}, n) : L(n) ? t[o] = n.slice() : t[o] = n;
};
for (let n = 0, s = arguments.length; n < s; n++)
arguments[n] && q(arguments[n], r);
return t;
}
const ht = (e, t, r, { allOwnKeys: n } = {}) => (q(t, (s, o) => {
r && x(s) ? e[o] = Ce(s, r) : e[o] = s;
}, { allOwnKeys: n }), e), mt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), yt = (e, t, r, n) => {
e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), r && Object.assign(e.prototype, r);
}, wt = (e, t, r, n) => {
let s, o, i;
const c = {};
if (t = t || {}, e == null) return t;
do {
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
i = s[o], (!n || n(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
e = r !== !1 && ce(e);
} while (e && (!r || r(e, t)) && e !== Object.prototype);
return t;
}, gt = (e, t, r) => {
e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
const n = e.indexOf(t, r);
return n !== -1 && n === r;
}, bt = (e) => {
if (!e) return null;
if (L(e)) return e;
let t = e.length;
if (!Ne(t)) return null;
const r = new Array(t);
for (; t-- > 0; )
r[t] = e[t];
return r;
}, Et = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ce(Uint8Array)), St = (e, t) => {
const n = (e && e[Symbol.iterator]).call(e);
let s;
for (; (s = n.next()) && !s.done; ) {
const o = s.value;
t.call(e, o[0], o[1]);
}
}, Rt = (e, t) => {
let r;
const n = [];
for (; (r = e.exec(t)) !== null; )
n.push(r);
return n;
}, Tt = C("HTMLFormElement"), At = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(r, n, s) {
return n.toUpperCase() + s;
}
), pe = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Ot = C("RegExp"), _e = (e, t) => {
const r = Object.getOwnPropertyDescriptors(e), n = {};
q(r, (s, o) => {
let i;
(i = t(s, o, e)) !== !1 && (n[o] = i || s);
}), Object.defineProperties(e, n);
}, xt = (e) => {
_e(e, (t, r) => {
if (x(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
return !1;
const n = e[r];
if (x(n)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + r + "'");
});
}
});
}, Ct = (e, t) => {
const r = {}, n = (s) => {
s.forEach((o) => {
r[o] = !0;
});
};
return L(e) ? n(e) : n(String(e).split(t)), r;
}, Pt = () => {
}, Nt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function Ft(e) {
return !!(e && x(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const Dt = (e) => {
const t = new Array(10), r = (n, s) => {
if (G(n)) {
if (t.indexOf(n) >= 0)
return;
if (!("toJSON" in n)) {
t[s] = n;
const o = L(n) ? [] : {};
return q(n, (i, c) => {
const f = r(i, s + 1);
!j(f) && (o[c] = f);
}), t[s] = void 0, o;
}
}
return n;
};
return r(e, 0);
}, _t = C("AsyncFunction"), Ut = (e) => e && (G(e) || x(e)) && x(e.then) && x(e.catch), Ue = ((e, t) => e ? setImmediate : t ? ((r, n) => (_.addEventListener("message", ({ source: s, data: o }) => {
s === _ && o === r && n.length && n.shift()();
}, !1), (s) => {
n.push(s), _.postMessage(r, "*");
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
typeof setImmediate == "function",
x(_.postMessage)
), Bt = typeof queueMicrotask < "u" ? queueMicrotask.bind(_) : typeof process < "u" && process.nextTick || Ue, a = {
isArray: L,
isArrayBuffer: Pe,
isBuffer: Qe,
isFormData: at,
isArrayBufferView: Ye,
isString: et,
isNumber: Ne,
isBoolean: tt,
isObject: G,
isPlainObject: H,
isReadableStream: lt,
isRequest: ut,
isResponse: ft,
isHeaders: dt,
isUndefined: j,
isDate: nt,
isFile: rt,
isBlob: st,
isRegExp: Ot,
isFunction: x,
isStream: it,
isURLSearchParams: ct,
isTypedArray: Et,
isFileList: ot,
forEach: q,
merge: ne,
extend: ht,
trim: pt,
stripBOM: mt,
inherits: yt,
toFlatObject: wt,
kindOf: W,
kindOfTest: C,
endsWith: gt,
toArray: bt,
forEachEntry: St,
matchAll: Rt,
isHTMLForm: Tt,
hasOwnProperty: pe,
hasOwnProp: pe,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: _e,
freezeMethods: xt,
toObjectSet: Ct,
toCamelCase: At,
noop: Pt,
toFiniteNumber: Nt,
findKey: Fe,
global: _,
isContextDefined: De,
isSpecCompliantForm: Ft,
toJSONObject: Dt,
isAsyncFn: _t,
isThenable: Ut,
setImmediate: Ue,
asap: Bt
};
function y(e, t, r, n, s) {
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), s && (this.response = s, this.status = s.status ? s.status : null);
}
a.inherits(y, Error, {
toJSON: function() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: a.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const Be = y.prototype, Le = {};
[
"ERR_BAD_OPTION_VALUE",
"ERR_BAD_OPTION",
"ECONNABORTED",
"ETIMEDOUT",
"ERR_NETWORK",
"ERR_FR_TOO_MANY_REDIRECTS",
"ERR_DEPRECATED",
"ERR_BAD_RESPONSE",
"ERR_BAD_REQUEST",
"ERR_CANCELED",
"ERR_NOT_SUPPORT",
"ERR_INVALID_URL"
// eslint-disable-next-line func-names
].forEach((e) => {
Le[e] = { value: e };
});
Object.defineProperties(y, Le);
Object.defineProperty(Be, "isAxiosError", { value: !0 });
y.from = (e, t, r, n, s, o) => {
const i = Object.create(Be);
return a.toFlatObject(e, i, function(f) {
return f !== Error.prototype;
}, (c) => c !== "isAxiosError"), y.call(i, e.message, t, r, n, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
};
const Lt = null;
function re(e) {
return a.isPlainObject(e) || a.isArray(e);
}
function ke(e) {
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function he(e, t, r) {
return e ? e.concat(t).map(function(s, o) {
return s = ke(s), !r && o ? "[" + s + "]" : s;
}).join(r ? "." : "") : t;
}
function kt(e) {
return a.isArray(e) && !e.some(re);
}
const vt = a.toFlatObject(a, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function X(e, t, r) {
if (!a.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), r = a.toFlatObject(r, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(m, d) {
return !a.isUndefined(d[m]);
});
const n = r.metaTokens, s = r.visitor || u, o = r.dots, i = r.indexes, f = (r.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
if (!a.isFunction(s))
throw new TypeError("visitor must be a function");
function l(h) {
if (h === null) return "";
if (a.isDate(h))
return h.toISOString();
if (!f && a.isBlob(h))
throw new y("Blob is not supported. Use a Buffer instead.");
return a.isArrayBuffer(h) || a.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
}
function u(h, m, d) {
let b = h;
if (h && !d && typeof h == "object") {
if (a.endsWith(m, "{}"))
m = n ? m : m.slice(0, -2), h = JSON.stringify(h);
else if (a.isArray(h) && kt(h) || (a.isFileList(h) || a.endsWith(m, "[]")) && (b = a.toArray(h)))
return m = ke(m), b.forEach(function(R, N) {
!(a.isUndefined(R) || R === null) && t.append(
// eslint-disable-next-line no-nested-ternary
i === !0 ? he([m], N, o) : i === null ? m : m + "[]",
l(R)
);
}), !1;
}
return re(h) ? !0 : (t.append(he(d, m, o), l(h)), !1);
}
const p = [], w = Object.assign(vt, {
defaultVisitor: u,
convertValue: l,
isVisitable: re
});
function g(h, m) {
if (!a.isUndefined(h)) {
if (p.indexOf(h) !== -1)
throw Error("Circular reference detected in " + m.join("."));
p.push(h), a.forEach(h, function(b, S) {
(!(a.isUndefined(b) || b === null) && s.call(
t,
b,
a.isString(S) ? S.trim() : S,
m,
w
)) === !0 && g(b, m ? m.concat(S) : [S]);
}), p.pop();
}
}
if (!a.isObject(e))
throw new TypeError("data must be an object");
return g(e), t;
}
function me(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
return t[n];
});
}
function le(e, t) {
this._pairs = [], e && X(e, this, t);
}
const ve = le.prototype;
ve.append = function(t, r) {
this._pairs.push([t, r]);
};
ve.toString = function(t) {
const r = t ? function(n) {
return t.call(this, n, me);
} : me;
return this._pairs.map(function(s) {
return r(s[0]) + "=" + r(s[1]);
}, "").join("&");
};
function jt(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function je(e, t, r) {
if (!t)
return e;
const n = r && r.encode || jt;
a.isFunction(r) && (r = {
serialize: r
});
const s = r && r.serialize;
let o;
if (s ? o = s(t, r) : o = a.isURLSearchParams(t) ? t.toString() : new le(t, r).toString(n), o) {
const i = e.indexOf("#");
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
}
return e;
}
class ye {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(t, r, n) {
return this.handlers.push({
fulfilled: t,
rejected: r,
synchronous: n ? n.synchronous : !1,
runWhen: n ? n.runWhen : null
}), this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
*/
eject(t) {
this.handlers[t] && (this.handlers[t] = null);
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
this.handlers && (this.handlers = []);
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(t) {
a.forEach(this.handlers, function(n) {
n !== null && t(n);
});
}
}
const qe = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, qt = typeof URLSearchParams < "u" ? URLSearchParams : le, It = typeof FormData < "u" ? FormData : null, Mt = typeof Blob < "u" ? Blob : null, Ht = {
isBrowser: !0,
classes: {
URLSearchParams: qt,
FormData: It,
Blob: Mt
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, ue = typeof window < "u" && typeof document < "u", se = typeof navigator == "object" && navigator || void 0, zt = ue && (!se || ["ReactNative", "NativeScript", "NS"].indexOf(se.product) < 0), $t = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Jt = ue && window.location.href || "http://localhost", Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: ue,
hasStandardBrowserEnv: zt,
hasStandardBrowserWebWorkerEnv: $t,
navigator: se,
origin: Jt
}, Symbol.toStringTag, { value: "Module" })), T = {
...Vt,
...Ht
};
function Wt(e, t) {
return X(e, new T.classes.URLSearchParams(), Object.assign({
visitor: function(r, n, s, o) {
return T.isNode && a.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
}
}, t));
}
function Kt(e) {
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function Gt(e) {
const t = {}, r = Object.keys(e);
let n;
const s = r.length;
let o;
for (n = 0; n < s; n++)
o = r[n], t[o] = e[o];
return t;
}
function Ie(e) {
function t(r, n, s, o) {
let i = r[o++];
if (i === "__proto__") return !0;
const c = Number.isFinite(+i), f = o >= r.length;
return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(r, n, s[i], o) && a.isArray(s[i]) && (s[i] = Gt(s[i])), !c);
}
if (a.isFormData(e) && a.isFunction(e.entries)) {
const r = {};
return a.forEachEntry(e, (n, s) => {
t(Kt(n), s, r, 0);
}), r;
}
return null;
}
function Xt(e, t, r) {
if (a.isString(e))
try {
return (t || JSON.parse)(e), a.trim(e);
} catch (n) {
if (n.name !== "SyntaxError")
throw n;
}
return (r || JSON.stringify)(e);
}
const I = {
transitional: qe,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, r) {
const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, o = a.isObject(t);
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
return s ? JSON.stringify(Ie(t)) : t;
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
return t;
if (a.isArrayBufferView(t))
return t.buffer;
if (a.isURLSearchParams(t))
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let c;
if (o) {
if (n.indexOf("application/x-www-form-urlencoded") > -1)
return Wt(t, this.formSerializer).toString();
if ((c = a.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
const f = this.env && this.env.FormData;
return X(
c ? { "files[]": t } : t,
f && new f(),
this.formSerializer
);
}
}
return o || s ? (r.setContentType("application/json", !1), Xt(t)) : t;
}],
transformResponse: [function(t) {
const r = this.transitional || I.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
if (a.isResponse(t) || a.isReadableStream(t))
return t;
if (t && a.isString(t) && (n && !this.responseType || s)) {
const i = !(r && r.silentJSONParsing) && s;
try {
return JSON.parse(t);
} catch (c) {
if (i)
throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
}
}
return t;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: T.classes.FormData,
Blob: T.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
I.headers[e] = {};
});
const Zt = a.toObjectSet([
"age",
"authorization",
"content-length",
"content-type",
"etag",
"expires",
"from",
"host",
"if-modified-since",
"if-unmodified-since",
"last-modified",
"location",
"max-forwards",
"proxy-authorization",
"referer",
"retry-after",
"user-agent"
]), Qt = (e) => {
const t = {};
let r, n, s;
return e && e.split(`
`).forEach(function(i) {
s = i.indexOf(":"), r = i.substring(0, s).trim().toLowerCase(), n = i.substring(s + 1).trim(), !(!r || t[r] && Zt[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
}), t;
}, we = Symbol("internals");
function v(e) {
return e && String(e).trim().toLowerCase();
}
function z(e) {
return e === !1 || e == null ? e : a.isArray(e) ? e.map(z) : String(e);
}
function Yt(e) {
const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let n;
for (; n = r.exec(e); )
t[n[1]] = n[2];
return t;
}
const en = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function Y(e, t, r, n, s) {
if (a.isFunction(n))
return n.call(this, t, r);
if (s && (t = r), !!a.isString(t)) {
if (a.isString(n))
return t.indexOf(n) !== -1;
if (a.isRegExp(n))
return n.test(t);
}
}
function tn(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
}
function nn(e, t) {
const r = a.toCamelCase(" " + t);
["get", "set", "has"].forEach((n) => {
Object.defineProperty(e, n + r, {
value: function(s, o, i) {
return this[n].call(this, t, s, o, i);
},
configurable: !0
});
});
}
let O = class {
constructor(t) {
t && this.set(t);
}
set(t, r, n) {
const s = this;
function o(c, f, l) {
const u = v(f);
if (!u)
throw new Error("header name must be a non-empty string");
const p = a.findKey(s, u);
(!p || s[p] === void 0 || l === !0 || l === void 0 && s[p] !== !1) && (s[p || f] = z(c));
}
const i = (c, f) => a.forEach(c, (l, u) => o(l, u, f));
if (a.isPlainObject(t) || t instanceof this.constructor)
i(t, r);
else if (a.isString(t) && (t = t.trim()) && !en(t))
i(Qt(t), r);
else if (a.isHeaders(t))
for (const [c, f] of t.entries())
o(f, c, n);
else
t != null && o(r, t, n);
return this;
}
get(t, r) {
if (t = v(t), t) {
const n = a.findKey(this, t);
if (n) {
const s = this[n];
if (!r)
return s;
if (r === !0)
return Yt(s);
if (a.isFunction(r))
return r.call(this, s, n);
if (a.isRegExp(r))
return r.exec(s);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, r) {
if (t = v(t), t) {
const n = a.findKey(this, t);
return !!(n && this[n] !== void 0 && (!r || Y(this, this[n], n, r)));
}
return !1;
}
delete(t, r) {
const n = this;
let s = !1;
function o(i) {
if (i = v(i), i) {
const c = a.findKey(n, i);
c && (!r || Y(n, n[c], c, r)) && (delete n[c], s = !0);
}
}
return a.isArray(t) ? t.forEach(o) : o(t), s;
}
clear(t) {
const r = Object.keys(this);
let n = r.length, s = !1;
for (; n--; ) {
const o = r[n];
(!t || Y(this, this[o], o, t, !0)) && (delete this[o], s = !0);
}
return s;
}
normalize(t) {
const r = this, n = {};
return a.forEach(this, (s, o) => {
const i = a.findKey(n, o);
if (i) {
r[i] = z(s), delete r[o];
return;
}
const c = t ? tn(o) : String(o).trim();
c !== o && delete r[o], r[c] = z(s), n[c] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const r = /* @__PURE__ */ Object.create(null);
return a.forEach(this, (n, s) => {
n != null && n !== !1 && (r[s] = t && a.isArray(n) ? n.join(", ") : n);
}), r;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(`
`);
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(t) {
return t instanceof this ? t : new this(t);
}
static concat(t, ...r) {
const n = new this(t);
return r.forEach((s) => n.set(s)), n;
}
static accessor(t) {
const n = (this[we] = this[we] = {
accessors: {}
}).accessors, s = this.prototype;
function o(i) {
const c = v(i);
n[c] || (nn(s, i), n[c] = !0);
}
return a.isArray(t) ? t.forEach(o) : o(t), this;
}
};
O.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
a.reduceDescriptors(O.prototype, ({ value: e }, t) => {
let r = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(n) {
this[r] = n;
}
};
});
a.freezeMethods(O);
function ee(e, t) {
const r = this || I, n = t || r, s = O.from(n.headers);
let o = n.data;
return a.forEach(e, function(c) {
o = c.call(r, o, s.normalize(), t ? t.status : void 0);
}), s.normalize(), o;
}
function Me(e) {
return !!(e && e.__CANCEL__);
}
function k(e, t, r) {
y.call(this, e ?? "canceled", y.ERR_CANCELED, t, r), this.name = "CanceledError";
}
a.inherits(k, y, {
__CANCEL__: !0
});
function He(e, t, r) {
const n = r.config.validateStatus;
!r.status || !n || n(r.status) ? e(r) : t(new y(
"Request failed with status code " + r.status,
[y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
r.config,
r.request,
r
));
}
function rn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function sn(e, t) {
e = e || 10;
const r = new Array(e), n = new Array(e);
let s = 0, o = 0, i;
return t = t !== void 0 ? t : 1e3, function(f) {
const l = Date.now(), u = n[o];
i || (i = l), r[s] = f, n[s] = l;
let p = o, w = 0;
for (; p !== s; )
w += r[p++], p = p % e;
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), l - i < t)
return;
const g = u && l - u;
return g ? Math.round(w * 1e3 / g) : void 0;
};
}
function on(e, t) {
let r = 0, n = 1e3 / t, s, o;
const i = (l, u = Date.now()) => {
r = u, s = null, o && (clearTimeout(o), o = null), e.apply(null, l);
};
return [(...l) => {
const u = Date.now(), p = u - r;
p >= n ? i(l, u) : (s = l, o || (o = setTimeout(() => {
o = null, i(s);
}, n - p)));
}, () => s && i(s)];
}
const J = (e, t, r = 3) => {
let n = 0;
const s = sn(50, 250);
return on((o) => {
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, f = i - n, l = s(f), u = i <= c;
n = i;
const p = {
loaded: i,
total: c,
progress: c ? i / c : void 0,
bytes: f,
rate: l || void 0,
estimated: l && c && u ? (c - i) / l : void 0,
event: o,
lengthComputable: c != null,
[t ? "download" : "upload"]: !0
};
e(p);
}, r);
}, ge = (e, t) => {
const r = e != null;
return [(n) => t[0]({
lengthComputable: r,
total: e,
loaded: n
}), t[1]];
}, be = (e) => (...t) => a.asap(() => e(...t)), an = T.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, T.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
new URL(T.origin),
T.navigator && /(msie|trident)/i.test(T.navigator.userAgent)
) : () => !0, cn = T.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, r, n, s, o) {
const i = [e + "=" + encodeURIComponent(t)];
a.isNumber(r) && i.push("expires=" + new Date(r).toGMTString()), a.isString(n) && i.push("path=" + n), a.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
},
read(e) {
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : null;
},
remove(e) {
this.write(e, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function ln(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function un(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function ze(e, t, r) {
let n = !ln(t);
return e && (n || r == !1) ? un(e, t) : t;
}
const Ee = (e) => e instanceof O ? { ...e } : e;
function B(e, t) {
t = t || {};
const r = {};
function n(l, u, p, w) {
return a.isPlainObject(l) && a.isPlainObject(u) ? a.merge.call({ caseless: w }, l, u) : a.isPlainObject(u) ? a.merge({}, u) : a.isArray(u) ? u.slice() : u;
}
function s(l, u, p, w) {
if (a.isUndefined(u)) {
if (!a.isUndefined(l))
return n(void 0, l, p, w);
} else return n(l, u, p, w);
}
function o(l, u) {
if (!a.isUndefined(u))
return n(void 0, u);
}
function i(l, u) {
if (a.isUndefined(u)) {
if (!a.isUndefined(l))
return n(void 0, l);
} else return n(void 0, u);
}
function c(l, u, p) {
if (p in t)
return n(l, u);
if (p in e)
return n(void 0, l);
}
const f = {
url: o,
method: o,
data: o,
baseURL: i,
transformRequest: i,
transformResponse: i,
paramsSerializer: i,
timeout: i,
timeoutMessage: i,
withCredentials: i,
withXSRFToken: i,
adapter: i,
responseType: i,
xsrfCookieName: i,
xsrfHeaderName: i,
onUploadProgress: i,
onDownloadProgress: i,
decompress: i,
maxContentLength: i,
maxBodyLength: i,
beforeRedirect: i,
transport: i,
httpAgent: i,
httpsAgent: i,
cancelToken: i,
socketPath: i,
responseEncoding: i,
validateStatus: c,
headers: (l, u, p) => s(Ee(l), Ee(u), p, !0)
};
return a.forEach(Object.keys(Object.assign({}, e, t)), function(u) {
const p = f[u] || s, w = p(e[u], t[u], u);
a.isUndefined(w) && p !== c || (r[u] = w);
}), r;
}
const $e = (e) => {
const t = B({}, e);
let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
t.headers = i = O.from(i), t.url = je(ze(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
"Authorization",
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
);
let f;
if (a.isFormData(r)) {
if (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv)
i.setContentType(void 0);
else if ((f = i.getContentType()) !== !1) {
const [l, ...u] = f ? f.split(";").map((p) => p.trim()).filter(Boolean) : [];
i.setContentType([l || "multipart/form-data", ...u].join("; "));
}
}
if (T.hasStandardBrowserEnv && (n && a.isFunction(n) && (n = n(t)), n || n !== !1 && an(t.url))) {
const l = s && o && cn.read(o);
l && i.set(s, l);
}
return t;
}, fn = typeof XMLHttpRequest < "u", dn = fn && function(e) {
return new Promise(function(r, n) {
const s = $e(e);
let o = s.data;
const i = O.from(s.headers).normalize();
let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = s, u, p, w, g, h;
function m() {
g && g(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
}
let d = new XMLHttpRequest();
d.open(s.method.toUpperCase(), s.url, !0), d.timeout = s.timeout;
function b() {
if (!d)
return;
const R = O.from(
"getAllResponseHeaders" in d && d.getAllResponseHeaders()
), A = {
data: !c || c === "text" || c === "json" ? d.responseText : d.response,
status: d.status,
statusText: d.statusText,
headers: R,
config: e,
request: d
};
He(function(D) {
r(D), m();
}, function(D) {
n(D), m();
}, A), d = null;
}
"onloadend" in d ? d.onloadend = b : d.onreadystatechange = function() {
!d || d.readyState !== 4 || d.status === 0 && !(d.responseURL && d.responseURL.indexOf("file:") === 0) || setTimeout(b);
}, d.onabort = function() {
d && (n(new y("Request aborted", y.ECONNABORTED, e, d)), d = null);
}, d.onerror = function() {
n(new y("Network Error", y.ERR_NETWORK, e, d)), d = null;
}, d.ontimeout = function() {
let N = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
const A = s.transitional || qe;
s.timeoutErrorMessage && (N = s.timeoutErrorMessage), n(new y(
N,
A.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
e,
d
)), d = null;
}, o === void 0 && i.setContentType(null), "setRequestHeader" in d && a.forEach(i.toJSON(), function(N, A) {
d.setRequestHeader(A, N);
}), a.isUndefined(s.withCredentials) || (d.withCredentials = !!s.withCredentials), c && c !== "json" && (d.responseType = s.responseType), l && ([w, h] = J(l, !0), d.addEventListener("progress", w)), f && d.upload && ([p, g] = J(f), d.upload.addEventListener("progress", p), d.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (u = (R) => {
d && (n(!R || R.type ? new k(null, e, d) : R), d.abort(), d = null);
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
const S = rn(s.url);
if (S && T.protocols.indexOf(S) === -1) {
n(new y("Unsupported protocol " + S + ":", y.ERR_BAD_REQUEST, e));
return;
}
d.send(o || null);
});
}, pn = (e, t) => {
const { length: r } = e = e ? e.filter(Boolean) : [];
if (t || r) {
let n = new AbortController(), s;
const o = function(l) {
if (!s) {
s = !0, c();
const u = l instanceof Error ? l : this.reason;
n.abort(u instanceof y ? u : new k(u instanceof Error ? u.message : u));
}
};
let i = t && setTimeout(() => {
i = null, o(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
}, t);
const c = () => {
e && (i && clearTimeout(i), i = null, e.forEach((l) => {
l.unsubscribe ? l.unsubscribe(o) : l.removeEventListener("abort", o);
}), e = null);
};
e.forEach((l) => l.addEventListener("abort", o));
const { signal: f } = n;
return f.unsubscribe = () => a.asap(c), f;
}
}, hn = function* (e, t) {
let r = e.byteLength;
if (r < t) {
yield e;
return;
}
let n = 0, s;
for (; n < r; )
s = n + t, yield e.slice(n, s), n = s;
}, mn = async function* (e, t) {
for await (const r of yn(e))
yield* hn(r, t);
}, yn = async function* (e) {
if (e[Symbol.asyncIterator]) {
yield* e;
return;
}
const t = e.getReader();
try {
for (; ; ) {
const { done: r, value: n } = await t.read();
if (r)
break;
yield n;
}
} finally {
await t.cancel();
}
}, Se = (e, t, r, n) => {
const s = mn(e, t);
let o = 0, i, c = (f) => {
i || (i = !0, n && n(f));
};
return new ReadableStream({
async pull(f) {
try {
const { done: l, value: u } = await s.next();
if (l) {
c(), f.close();
return;
}
let p = u.byteLength;
if (r) {
let w = o += p;
r(w);
}
f.enqueue(new Uint8Array(u));
} catch (l) {
throw c(l), l;
}
},
cancel(f) {
return c(f), s.return();
}
}, {
highWaterMark: 2
});
}, Z = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Je = Z && typeof ReadableStream == "function", wn = Z && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Ve = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, gn = Je && Ve(() => {
let e = !1;
const t = new Request(T.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return e = !0, "half";
}
}).headers.has("Content-Type");
return e && !t;
}), Re = 64 * 1024, oe = Je && Ve(() => a.isReadableStream(new Response("").body)), V = {
stream: oe && ((e) => e.body)
};
Z && ((e) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
!V[t] && (V[t] = a.isFunction(e[t]) ? (r) => r[t]() : (r, n) => {
throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, n);
});
});
})(new Response());
const bn = async (e) => {
if (e == null)
return 0;
if (a.isBlob(e))
return e.size;
if (a.isSpecCompliantForm(e))
return (await new Request(T.origin, {
method: "POST",
body: e
}).arrayBuffer()).byteLength;
if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
return e.byteLength;
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
return (await wn(e)).byteLength;
}, En = async (e, t) => {
const r = a.toFiniteNumber(e.getContentLength());
return r ?? bn(t);
}, Sn = Z && (async (e) => {
let {
url: t,
method: r,
data: n,
signal: s,
cancelToken: o,
timeout: i,
onDownloadProgress: c,
onUploadProgress: f,
responseType: l,
headers: u,
withCredentials: p = "same-origin",
fetchOptions: w
} = $e(e);
l = l ? (l + "").toLowerCase() : "text";
let g = pn([s, o && o.toAbortSignal()], i), h;
const m = g && g.unsubscribe && (() => {
g.unsubscribe();
});
let d;
try {
if (f && gn && r !== "get" && r !== "head" && (d = await En(u, n)) !== 0) {
let A = new Request(t, {
method: "POST",
body: n,
duplex: "half"
}), F;
if (a.isFormData(n) && (F = A.headers.get("content-type")) && u.setContentType(F), A.body) {
const [D, M] = ge(
d,
J(be(f))
);
n = Se(A.body, Re, D, M);
}
}
a.isString(p) || (p = p ? "include" : "omit");
const b = "credentials" in Request.prototype;
h = new Request(t, {
...w,
signal: g,
method: r.toUpperCase(),
headers: u.normalize().toJSON(),
body: n,
duplex: "half",
credentials: b ? p : void 0
});
let S = await fetch(h);
const R = oe && (l === "stream" || l === "response");
if (oe && (c || R && m)) {
const A = {};
["status", "statusText", "headers"].forEach((de) => {
A[de] = S[de];
});
const F = a.toFiniteNumber(S.headers.get("content-length")), [D, M] = c && ge(
F,
J(be(c), !0)
) || [];
S = new Response(
Se(S.body, Re, D, () => {
M && M(), m && m();
}),
A
);
}
l = l || "text";
let N = await V[a.findKey(V, l) || "text"](S, e);
return !R && m && m(), await new Promise((A, F) => {
He(A, F, {
data: N,
headers: O.from(S.headers),
status: S.status,
statusText: S.statusText,
config: e,
request: h
});
});
} catch (b) {
throw m && m(), b && b.name === "TypeError" && /fetch/i.test(b.message) ? Object.assign(
new y("Network Error", y.ERR_NETWORK, e, h),
{
cause: b.cause || b
}
) : y.from(b, b && b.code, e, h);
}
}), ie = {
http: Lt,
xhr: dn,
fetch: Sn
};
a.forEach(ie, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const Te = (e) => `- ${e}`, Rn = (e) => a.isFunction(e) || e === null || e === !1, We = {
getAdapter: (e) => {
e = a.isArray(e) ? e : [e];
const { length: t } = e;
let r, n;
const s = {};
for (let o = 0; o < t; o++) {
r = e[o];
let i;
if (n = r, !Rn(r) && (n = ie[(i = String(r)).toLowerCase()], n === void 0))
throw new y(`Unknown adapter '${i}'`);
if (n)
break;
s[i || "#" + o] = n;
}
if (!n) {
const o = Object.entries(s).map(
([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
);
let i = t ? o.length > 1 ? `since :
` + o.map(Te).join(`
`) : " " + Te(o[0]) : "as no adapter specified";
throw new y(
"There is no suitable adapter to dispatch the request " + i,
"ERR_NOT_SUPPORT"
);
}
return n;
},
adapters: ie
};
function te(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new k(null, e);
}
function Ae(e) {
return te(e), e.headers = O.from(e.headers), e.data = ee.call(
e,
e.transformRequest
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), We.getAdapter(e.adapter || I.adapter)(e).then(function(n) {
return te(e), n.data = ee.call(
e,
e.transformResponse,
n
), n.headers = O.from(n.headers), n;
}, function(n) {
return Me(n) || (te(e), n && n.response && (n.response.data = ee.call(
e,
e.transformResponse,
n.response
), n.response.headers = O.from(n.response.headers))), Promise.reject(n);
});
}
const Ke = "1.8.4", Q = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
Q[e] = function(n) {
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const Oe = {};
Q.transitional = function(t, r, n) {
function s(o, i) {
return "[Axios v" + Ke + "] Transitional option '" + o + "'" + i + (n ? ". " + n : "");
}
return (o, i, c) => {
if (t === !1)
throw new y(
s(i, " has been removed" + (r ? " in " + r : "")),
y.ERR_DEPRECATED
);
return r && !Oe[i] && (Oe[i] = !0, console.warn(
s(
i,
" has been deprecated since v" + r + " and will be removed in the near future"
)
)), t ? t(o, i, c) : !0;
};
};
Q.spelling = function(t) {
return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
};
function Tn(e, t, r) {
if (typeof e != "object")
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
const n = Object.keys(e);
let s = n.length;
for (; s-- > 0; ) {
const o = n[s], i = t[o];
if (i) {
const c = e[o], f = c === void 0 || i(c, o, e);
if (f !== !0)
throw new y("option " + o + " must be " + f, y.ERR_BAD_OPTION_VALUE);
continue;
}
if (r !== !0)
throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
}
}
const $ = {
assertOptions: Tn,
validators: Q
}, P = $.validators;
let U = class {
constructor(t) {
this.defaults = t, this.interceptors = {
request: new ye(),
response: new ye()
};
}
/**
* Dispatch a request
*
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
* @param {?Object} config
*
* @returns {Promise} The Promise to be fulfilled
*/
async request(t, r) {
try {
return await this._request(t, r);
} catch (n) {
if (n instanceof Error) {
let s = {};
Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
try {
n.stack ? o && !String(n.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (n.stack += `
` + o) : n.stack = o;
} catch {
}
}
throw n;
}
}
_request(t, r) {
typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = B(this.defaults, r);
const { transitional: n, paramsSerializer: s, headers: o } = r;
n !== void 0 && $.assertOptions(n, {
silentJSONParsing: P.transitional(P.boolean),
forcedJSONParsing: P.transitional(P.boolean),
clarifyTimeoutError: P.transitional(P.boolean)
}, !1), s != null && (a.isFunction(s) ? r.paramsSerializer = {
serialize: s
} : $.assertOptions(s, {
encode: P.function,
serialize: P.function
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), $.assertOptions(r, {
baseUrl: P.spelling("baseURL"),
withXsrfToken: P.spelling("withXSRFToken")
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
let i = o && a.merge(
o.common,
o[r.method]
);
o && a.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(h) => {
delete o[h];
}
), r.headers = O.concat(i, o);
const c = [];
let f = !0;
this.interceptors.request.forEach(function(m) {
typeof m.runWhen == "function" && m.runWhen(r) === !1 || (f = f && m.synchronous, c.unshift(m.fulfilled, m.rejected));
});
const l = [];
this.interceptors.response.forEach(function(m) {
l.push(m.fulfilled, m.rejected);
});
let u, p = 0, w;
if (!f) {
const h = [Ae.bind(this), void 0];
for (h.unshift.apply(h, c), h.push.apply(h, l), w = h.length, u = Promise.resolve(r); p < w; )
u = u.then(h[p++], h[p++]);
return u;
}
w = c.length;
let g = r;
for (p = 0; p < w; ) {
const h = c[p++], m = c[p++];
try {
g = h(g);
} catch (d) {
m.call(this, d);
break;
}
}
try {
u = Ae.call(this, g);
} catch (h) {
return Promise.reject(h);
}
for (p = 0, w = l.length; p < w; )
u = u.then(l[p++], l[p++]);
return u;
}
getUri(t) {
t = B(this.defaults, t);
const r = ze(t.baseURL, t.url, t.allowAbsoluteUrls);
return je(r, t.params, t.paramsSerializer);
}
};
a.forEach(["delete", "get", "head", "options"], function(t) {
U.prototype[t] = function(r, n) {
return this.request(B(n || {}, {
method: t,
url: r,
data: (n || {}).data
}));
};
});
a.forEach(["post", "put", "patch"], function(t) {
function r(n) {
return function(o, i, c) {
return this.request(B(c || {}, {
method: t,
headers: n ? {
"Content-Type": "multipart/form-data"
} : {},
url: o,
data: i
}));
};
}
U.prototype[t] = r(), U.prototype[t + "Form"] = r(!0);
});
let An = class Ge {
constructor(t) {
if (typeof t != "function")
throw new TypeError("executor must be a function.");
let r;
this.promise = new Promise(function(o) {
r = o;
});
const n = this;
this.promise.then((s) => {
if (!n._listeners) return;
let o = n._listeners.length;
for (; o-- > 0; )
n._listeners[o](s);
n._listeners = null;
}), this.promise.then = (s) => {
let o;
const i = new Promise((c) => {
n.subscribe(c), o = c;
}).then(s);
return i.cancel = function() {
n.unsubscribe(o);
}, i;
}, t(function(o, i, c) {
n.reason || (n.reason = new k(o, i, c), r(n.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(t) {
if (this.reason) {
t(this.reason);
return;
}
this._listeners ? this._listeners.push(t) : this._listeners = [t];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(t) {
if (!this._listeners)
return;
const r = this._listeners.indexOf(t);
r !== -1 && this._listeners.splice(r, 1);
}
toAbortSignal() {
const t = new AbortController(), r = (n) => {
t.abort(n);
};
return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), t.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let t;
return {
token: new Ge(function(s) {
t = s;
}),
cancel: t
};
}
};
function On(e) {
return function(r) {
return e.apply(null, r);
};
}
function xn(e) {
return a.isObject(e) && e.isAxiosError === !0;
}
const ae = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511
};
Object.entries(ae).forEach(([e, t]) => {
ae[t] = e;
});
function Xe(e) {
const t = new U(e), r = Ce(U.prototype.request, t);
return a.extend(r, U.prototype, t, { allOwnKeys: !0 }), a.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(s) {
return Xe(B(e, s));
}, r;
}
const E = Xe(I);
E.Axios = U;
E.CanceledError = k;
E.CancelToken = An;
E.isCancel = Me;
E.VERSION = Ke;
E.toFormData = X;
E.AxiosError = y;
E.Cancel = E.CanceledError;
E.all = function(t) {
return Promise.all(t);
};
E.spread = On;
E.isAxiosError = xn;
E.mergeConfig = B;
E.AxiosHeaders = O;
E.formToJSON = (e) => Ie(a.isHTMLForm(e) ? new FormData(e) : e);
E.getAdapter = We.getAdapter;
E.HttpStatusCode = ae;
E.default = E;
const {
Axios: qn,
AxiosError: In,
CanceledError: Mn,
isCancel: Hn,
CancelToken: zn,
VERSION: $n,
all: Jn,
Cancel: Vn,
isAxiosError: Wn,
spread: Kn,
toFormData: Gn,
AxiosHeaders: Xn,
HttpStatusCode: Zn,
formToJSON: Qn,
getAdapter: Yn,
mergeConfig: er
} = E, fe = E.create({
baseURL: "https://api.quickpollindia.com/api/v1/",
headers: {
"Content-Type": "application/json"
}
});
fe.interceptors.request.use(
(e) => e,
(e) => Promise.reject(e)
);
fe.interceptors.response.use(
(e) => e,
async (e) => Promise.reject(e)
);
const Cn = {
getFingerprintApi: async (e, t) => (await fe.post("captcha/getFingerprintTokenss", { ...e }, {
headers: { "x-api-key": t }
})).data
}, xe = async () => {
if (!navigator.permissions)
return [];
const e = ["geolocation", "notifications", "camera", "microphone"];
try {
return