vue-dadata
Version:
Vue component for hinting addresses using dadata.ru
1,733 lines • 65.4 kB
JavaScript
import { defineComponent as et, h as q, computed as H, ref as G, watch as bt, resolveComponent as Ft, openBlock as te, createElementBlock as Ce, normalizeClass as ne, createElementVNode as _e, withDirectives as Ct, withKeys as re, vModelText as St, renderSlot as wt, Fragment as Dt, renderList as Bt, createBlock as Tt, mergeProps as vt, createCommentVNode as Rt } from "vue";
var Ot = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Y = {};
Y.remove = xt;
var se = [
{
base: " ",
chars: " "
},
{
base: "0",
chars: "߀"
},
{
base: "A",
chars: "ⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"
},
{
base: "AA",
chars: "Ꜳ"
},
{
base: "AE",
chars: "ÆǼǢ"
},
{
base: "AO",
chars: "Ꜵ"
},
{
base: "AU",
chars: "Ꜷ"
},
{
base: "AV",
chars: "ꜸꜺ"
},
{
base: "AY",
chars: "Ꜽ"
},
{
base: "B",
chars: "ⒷBḂḄḆɃƁ"
},
{
base: "C",
chars: "ⒸCꜾḈĆCĈĊČÇƇȻ"
},
{
base: "D",
chars: "ⒹDḊĎḌḐḒḎĐƊƉᴅꝹ"
},
{
base: "Dh",
chars: "Ð"
},
{
base: "DZ",
chars: "DZDŽ"
},
{
base: "Dz",
chars: "DzDž"
},
{
base: "E",
chars: "ɛⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎᴇ"
},
{
base: "F",
chars: "ꝼⒻFḞƑꝻ"
},
{
base: "G",
chars: "ⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾɢ"
},
{
base: "H",
chars: "ⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"
},
{
base: "I",
chars: "ⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"
},
{
base: "J",
chars: "ⒿJĴɈȷ"
},
{
base: "K",
chars: "ⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"
},
{
base: "L",
chars: "ⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"
},
{
base: "LJ",
chars: "LJ"
},
{
base: "Lj",
chars: "Lj"
},
{
base: "M",
chars: "ⓂMḾṀṂⱮƜϻ"
},
{
base: "N",
chars: "ꞤȠⓃNǸŃÑṄŇṆŅṊṈƝꞐᴎ"
},
{
base: "NJ",
chars: "NJ"
},
{
base: "Nj",
chars: "Nj"
},
{
base: "O",
chars: "ⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"
},
{
base: "OE",
chars: "Œ"
},
{
base: "OI",
chars: "Ƣ"
},
{
base: "OO",
chars: "Ꝏ"
},
{
base: "OU",
chars: "Ȣ"
},
{
base: "P",
chars: "ⓅPṔṖƤⱣꝐꝒꝔ"
},
{
base: "Q",
chars: "ⓆQꝖꝘɊ"
},
{
base: "R",
chars: "ⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"
},
{
base: "S",
chars: "ⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"
},
{
base: "T",
chars: "ⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"
},
{
base: "Th",
chars: "Þ"
},
{
base: "TZ",
chars: "Ꜩ"
},
{
base: "U",
chars: "ⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"
},
{
base: "V",
chars: "ⓋVṼṾƲꝞɅ"
},
{
base: "VY",
chars: "Ꝡ"
},
{
base: "W",
chars: "ⓌWẀẂŴẆẄẈⱲ"
},
{
base: "X",
chars: "ⓍXẊẌ"
},
{
base: "Y",
chars: "ⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"
},
{
base: "Z",
chars: "ⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"
},
{
base: "a",
chars: "ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑ"
},
{
base: "aa",
chars: "ꜳ"
},
{
base: "ae",
chars: "æǽǣ"
},
{
base: "ao",
chars: "ꜵ"
},
{
base: "au",
chars: "ꜷ"
},
{
base: "av",
chars: "ꜹꜻ"
},
{
base: "ay",
chars: "ꜽ"
},
{
base: "b",
chars: "ⓑbḃḅḇƀƃɓƂ"
},
{
base: "c",
chars: "cⓒćĉċčçḉƈȼꜿↄ"
},
{
base: "d",
chars: "ⓓdḋďḍḑḓḏđƌɖɗƋᏧԁꞪ"
},
{
base: "dh",
chars: "ð"
},
{
base: "dz",
chars: "dzdž"
},
{
base: "e",
chars: "ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇǝ"
},
{
base: "f",
chars: "ⓕfḟƒ"
},
{
base: "ff",
chars: "ff"
},
{
base: "fi",
chars: "fi"
},
{
base: "fl",
chars: "fl"
},
{
base: "ffi",
chars: "ffi"
},
{
base: "ffl",
chars: "ffl"
},
{
base: "g",
chars: "ⓖgǵĝḡğġǧģǥɠꞡꝿᵹ"
},
{
base: "h",
chars: "ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"
},
{
base: "hv",
chars: "ƕ"
},
{
base: "i",
chars: "ⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"
},
{
base: "j",
chars: "ⓙjĵǰɉ"
},
{
base: "k",
chars: "ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"
},
{
base: "l",
chars: "ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇɭ"
},
{
base: "lj",
chars: "lj"
},
{
base: "m",
chars: "ⓜmḿṁṃɱɯ"
},
{
base: "n",
chars: "ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥлԉ"
},
{
base: "nj",
chars: "nj"
},
{
base: "o",
chars: "ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿꝋꝍɵɔᴑ"
},
{
base: "oe",
chars: "œ"
},
{
base: "oi",
chars: "ƣ"
},
{
base: "oo",
chars: "ꝏ"
},
{
base: "ou",
chars: "ȣ"
},
{
base: "p",
chars: "ⓟpṕṗƥᵽꝑꝓꝕρ"
},
{
base: "q",
chars: "ⓠqɋꝗꝙ"
},
{
base: "r",
chars: "ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"
},
{
base: "s",
chars: "ⓢsśṥŝṡšṧṣṩșşȿꞩꞅẛʂ"
},
{
base: "ss",
chars: "ß"
},
{
base: "t",
chars: "ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"
},
{
base: "th",
chars: "þ"
},
{
base: "tz",
chars: "ꜩ"
},
{
base: "u",
chars: "ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"
},
{
base: "v",
chars: "ⓥvṽṿʋꝟʌ"
},
{
base: "vy",
chars: "ꝡ"
},
{
base: "w",
chars: "ⓦwẁẃŵẇẅẘẉⱳ"
},
{
base: "x",
chars: "ⓧxẋẍ"
},
{
base: "y",
chars: "ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"
},
{
base: "z",
chars: "ⓩzźẑżžẓẕƶȥɀⱬꝣ"
}
], Ne = {};
for (var ue = 0; ue < se.length; ue += 1)
for (var He = se[ue].chars, Se = 0; Se < He.length; Se += 1)
Ne[He[Se]] = se[ue].base;
function xt(e) {
return e.replace(/[^\u0000-\u007e]/g, function(t) {
return Ne[t] || t;
});
}
Y.replacementList = se;
Y.diacriticsMap = Ne;
const Me = (e) => e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), we = (e, t, n = !1) => {
if (!t.query || t.query instanceof String && !t.query.trim())
return e;
let r = e, u = t.query, s = !1;
t.diacriticsSensitive || (r = Y.remove(r), u = t.query instanceof RegExp ? t.query : Y.remove(t.query), s = r !== e);
const o = ((c) => {
let d;
if (c.query instanceof RegExp)
return new RegExp(String.raw`(${c.query.source})`, "g" + (c.caseSensitive ? "" : "i"));
if (c.splitBySpace) {
const p = c.query.trim().replace(/\s+/g, " ");
d = String.raw`(${p.split(/\s/).map(Me).join("|")})`;
} else
d = String.raw`(${Me(c.query)})`;
return new RegExp(String.raw`${d}`, "g" + (c.caseSensitive ? "" : "i"));
})({ query: u, splitBySpace: t.splitBySpace, caseSensitive: t.caseSensitive }), a = r.split(o), E = s ? ((c, d) => {
const p = [];
return d.forEach((A) => {
const h = p.join("").length, l = h + A.length;
p.push(c.slice(h, l));
}), p;
})(e, a) : a;
return n ? a.map((c, d) => {
if (o.test(c)) {
const p = t.highlightClass ? ` class="${t.highlightClass}"` : "", A = t.highlightStyle ? ` style="${t.highlightStyle}"` : "";
return `<${t.highlightTag}${p}${A}>${E[d]}</${t.highlightTag}>`;
}
return E[d];
}).join("") : a.map((c, d) => o.test(c) ? q(t.highlightTag, { class: t.highlightClass, style: t.highlightStyle }, E[d]) : E[d]);
}, $e = (e) => typeof e == "string" ? [] : e.filter((t) => typeof t != "string").map((t) => typeof t == "string" ? t : t.children);
var Pt = et({ name: "VueWordHighlighter", props: { query: { type: [String, RegExp], required: !0, default: "" }, caseSensitive: { type: Boolean, default: !1 }, diacriticsSensitive: { type: Boolean, default: !1 }, splitBySpace: { type: Boolean, default: !1 }, highlightClass: { type: [Object, String, Array], default: "" }, highlightStyle: { type: [Object, String, Array], default: "" }, highlightTag: { type: String, default: "mark" }, wrapperTag: { type: String, default: "span" }, wrapperClass: { type: [Object, String, Array], default: "" }, textToHighlight: { type: String, default: "" }, htmlToHighlight: { type: String, default: "" } }, emits: ["matches"], setup: (e, t) => () => {
if (e.htmlToHighlight) {
const n = `(<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)`, r = e.htmlToHighlight.split(new RegExp(n, "gs")), u = r.map((s, o) => new RegExp(n).test(s) || o > 0 && r[o - 1].startsWith("<script") ? s : we(s, { query: e.query, splitBySpace: e.splitBySpace, caseSensitive: e.caseSensitive, diacriticsSensitive: e.diacriticsSensitive, highlightTag: e.highlightTag, highlightClass: e.highlightClass, highlightStyle: e.highlightStyle }, !0)).join("");
return q(e.wrapperTag, { class: e.wrapperClass, innerHTML: u });
}
if (e.textToHighlight) {
const n = we(e.textToHighlight, { query: e.query, splitBySpace: e.splitBySpace, caseSensitive: e.caseSensitive, diacriticsSensitive: e.diacriticsSensitive, highlightTag: e.highlightTag, highlightClass: e.highlightClass, highlightStyle: e.highlightStyle });
return t.emit("matches", $e(n)), q(e.wrapperTag, { class: e.wrapperClass }, n);
}
if (t.slots && t.slots.default) {
const n = (u) => {
if (typeof u.children == "string") {
const s = we(u.children, { query: e.query, splitBySpace: e.splitBySpace, caseSensitive: e.caseSensitive, diacriticsSensitive: e.diacriticsSensitive, highlightTag: e.highlightTag, highlightClass: e.highlightClass, highlightStyle: e.highlightStyle }), o = $e(s);
return t.emit("matches", o), o.length === 0 ? u : typeof u.type == "string" ? q(u.type, { ...u.props }, [q(e.wrapperTag, { class: e.wrapperClass }, s)]) : q(e.wrapperTag, { class: e.wrapperClass }, s);
}
return q(u.type, { ...u.props }, Array.isArray(u.children) ? u.children.map((s) => n(s)) : []);
}, r = t.slots.default();
return Array.isArray(r) ? r.map((u) => n(u)) : r;
}
} }), M = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.Esc = "esc", e.Up = "up", e.Down = "down", e))(M || {});
const ir = {
COUNTRY: "country",
REGION: "region",
AREA: "area",
CITY: "city",
SETTLEMENT: "settlement",
STREET: "street",
HOUSE: "house",
FLAT: "flat"
}, _ = {
container: "vue-dadata",
search: "vue-dadata__search",
input: "vue-dadata__input",
suggestions: "vue-dadata__suggestions",
suggestionItem: "vue-dadata__suggestions-item",
suggestionCurrentItem: "vue-dadata__suggestions-item_current"
}, k = {
caseSensitive: !1,
splitBySpace: !1,
highlightTag: "mark",
highlightClass: "vue-dadata__suggestion-item-text_highlight",
highlightStyle: "",
wrapperTag: "span",
wrapperClass: ""
}, Nt = (e) => H(() => ({
container: (e == null ? void 0 : e.container) ?? _.container,
search: (e == null ? void 0 : e.search) ?? _.search,
input: (e == null ? void 0 : e.input) ?? _.input,
suggestions: (e == null ? void 0 : e.suggestions) ?? _.suggestions,
suggestionItem: (e == null ? void 0 : e.suggestionItem) ?? _.suggestionItem,
suggestionCurrentItem: (e == null ? void 0 : e.suggestionCurrentItem) ?? _.suggestionCurrentItem
})), Lt = (e) => H(() => ({
caseSensitive: (e == null ? void 0 : e.caseSensitive) ?? k.caseSensitive,
splitBySpace: (e == null ? void 0 : e.splitBySpace) ?? k.splitBySpace,
highlightTag: (e == null ? void 0 : e.highlightTag) ?? k.highlightTag,
highlightClass: (e == null ? void 0 : e.highlightClass) ?? k.highlightClass,
highlightStyle: (e == null ? void 0 : e.highlightStyle) ?? k.highlightStyle,
wrapperTag: (e == null ? void 0 : e.wrapperTag) ?? k.wrapperTag,
wrapperClass: (e == null ? void 0 : e.wrapperClass) ?? k.wrapperClass
}));
var le = {}, Ut = {
get exports() {
return le;
},
set exports(e) {
le = e;
}
};
(function(e, t) {
(function(n, r) {
r(t);
})(Ot, function(n) {
function r(h, l) {
return function(f) {
if (Array.isArray(f))
return f;
}(h) || function(f, m) {
var y = f == null ? null : typeof Symbol < "u" && f[Symbol.iterator] || f["@@iterator"];
if (y != null) {
var C, D, B = [], b = !0, S = !1;
try {
for (y = y.call(f); !(b = (C = y.next()).done) && (B.push(C.value), !m || B.length !== m); b = !0)
;
} catch (T) {
S = !0, D = T;
} finally {
try {
b || y.return == null || y.return();
} finally {
if (S)
throw D;
}
}
return B;
}
}(h, l) || function(f, m) {
if (f) {
if (typeof f == "string")
return u(f, m);
var y = Object.prototype.toString.call(f).slice(8, -1);
if (y === "Object" && f.constructor && (y = f.constructor.name), y === "Map" || y === "Set")
return Array.from(f);
if (y === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))
return u(f, m);
}
}(h, l) || function() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}();
}
function u(h, l) {
(l == null || l > h.length) && (l = h.length);
for (var f = 0, m = new Array(l); f < l; f++)
m[f] = h[f];
return m;
}
function s(h, l) {
var f, m, y, C, D = null, B = typeof l == "number" ? l : (f = r(String(l).split(/(ms|s)/i), 2), m = f[0], y = f[1], C = y === void 0 ? "ms" : y, Number(m) * { ms: 1, s: 1e3 }[C]), b = function() {
for (var S = this, T = arguments.length, R = new Array(T), L = 0; L < T; L++)
R[L] = arguments[L];
var V = function() {
D = null, h.apply(S, R);
};
clearTimeout(D), (D = setTimeout(V, B)) || h.apply(this, R);
};
return b.cancel = function() {
clearTimeout(D), D = null;
}, b;
}
function o(h) {
return h.map(function(l) {
return l.toLowerCase();
});
}
function a(h, l) {
var f, m = h ? h["debounce-events"] : [];
return m && m.length > 0 ? Array.isArray(m) ? o(m) : o(m.split(",")) : o((f = l, Array.isArray(f) ? f : f == null ? [] : [f]));
}
function E(h) {
return h === "";
}
function c(h, l) {
return h === "Enter" && (!l.lock || l.unlock);
}
function d(h, l, f) {
return E(h) && f.fireonempty && (l === "Enter" || l === " ");
}
function p() {
var h = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = h.lock, f = l !== void 0 && l, m = h.listenTo, y = m === void 0 ? "keyup" : m, C = h.defaultTime, D = C === void 0 ? "300ms" : C, B = h.fireOnEmpty, b = B !== void 0 && B, S = h.cancelOnEmpty, T = S !== void 0 && S, R = h.trim, L = R !== void 0 && R;
return { bind: function(V, I, ye) {
var J = I.value, K = I.arg, ge = K === void 0 ? D : K, Ae = I.modifiers, O = Object.assign({ lock: f, trim: L, fireonempty: b, cancelonempty: T }, Ae), be = a(ye.data.attrs, y), j = s(function(F) {
J(F.target.value, F);
}, ge);
function Fe(F) {
var W = O.trim ? F.target.value.trim() : F.target.value;
E(W) && O.cancelonempty ? j.cancel() : c(F.key, O) || d(W, F.key, O) ? (j.cancel(), J(F.target.value, F)) : j(F);
}
be.forEach(function(F) {
V.addEventListener(F, Fe);
});
} };
}
var A = { install: function(h) {
var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
h.directive("debounce", p(l));
} };
n.debounce = s, n.default = A, n.vue3Debounce = function() {
var h = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = h.lock, f = l !== void 0 && l, m = h.listenTo, y = m === void 0 ? "keyup" : m, C = h.defaultTime, D = C === void 0 ? "300ms" : C, B = h.fireOnEmpty, b = B !== void 0 && B, S = h.cancelOnEmpty, T = S !== void 0 && S, R = h.trim, L = R !== void 0 && R;
return { created: function(V, I, ye) {
var J = I.value, K = I.arg, ge = K === void 0 ? D : K, Ae = I.modifiers, O = Object.assign({ lock: f, trim: L, fireonempty: b, cancelonempty: T }, Ae), be = a(ye.props, y), j = s(function(F) {
J(F.target.value, F);
}, ge);
function Fe(F) {
var W = O.trim ? F.target.value.trim() : F.target.value;
E(W) && O.cancelonempty ? j.cancel() : c(F.key, O) || d(W, F.key, O) ? (j.cancel(), J(F.target.value, F)) : j(F);
}
be.forEach(function(F) {
V.addEventListener(F, Fe);
});
} };
}, Object.defineProperty(n, "__esModule", { value: !0 });
});
})(Ut, le);
function tt(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: kt } = Object.prototype, { getPrototypeOf: Le } = Object, de = ((e) => (t) => {
const n = kt.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), N = (e) => (e = e.toLowerCase(), (t) => de(t) === e), he = (e) => (t) => typeof t === e, { isArray: z } = Array, Z = he("undefined");
function It(e) {
return e !== null && !Z(e) && e.constructor !== null && !Z(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const nt = N("ArrayBuffer");
function jt(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && nt(e.buffer), t;
}
const qt = he("string"), P = he("function"), rt = he("number"), Ue = (e) => e !== null && typeof e == "object", _t = (e) => e === !0 || e === !1, oe = (e) => {
if (de(e) !== "object")
return !1;
const t = Le(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, Ht = N("Date"), Mt = N("File"), $t = N("Blob"), zt = N("FileList"), Vt = (e) => Ue(e) && P(e.pipe), Jt = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = de(e)) === "formdata" || // detect form-data instance
t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
}, Kt = N("URLSearchParams"), Wt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function Q(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, u;
if (typeof e != "object" && (e = [e]), z(e))
for (r = 0, u = e.length; r < u; r++)
t.call(null, e[r], r, e);
else {
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = s.length;
let a;
for (r = 0; r < o; r++)
a = s[r], t.call(null, e[a], a, e);
}
}
function ut(e, t) {
t = t.toLowerCase();
const n = Object.keys(e);
let r = n.length, u;
for (; r-- > 0; )
if (u = n[r], t === u.toLowerCase())
return u;
return null;
}
const st = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), ot = (e) => !Z(e) && e !== st;
function Re() {
const { caseless: e } = ot(this) && this || {}, t = {}, n = (r, u) => {
const s = e && ut(t, u) || u;
oe(t[s]) && oe(r) ? t[s] = Re(t[s], r) : oe(r) ? t[s] = Re({}, r) : z(r) ? t[s] = r.slice() : t[s] = r;
};
for (let r = 0, u = arguments.length; r < u; r++)
arguments[r] && Q(arguments[r], n);
return t;
}
const Gt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (u, s) => {
n && P(u) ? e[s] = tt(u, n) : e[s] = u;
}, { allOwnKeys: r }), e), Xt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Yt = (e, t, n, r) => {
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), n && Object.assign(e.prototype, n);
}, Zt = (e, t, n, r) => {
let u, s, o;
const a = {};
if (t = t || {}, e == null)
return t;
do {
for (u = Object.getOwnPropertyNames(e), s = u.length; s-- > 0; )
o = u[s], (!r || r(o, e, t)) && !a[o] && (t[o] = e[o], a[o] = !0);
e = n !== !1 && Le(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, Qt = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const r = e.indexOf(t, n);
return r !== -1 && r === n;
}, en = (e) => {
if (!e)
return null;
if (z(e))
return e;
let t = e.length;
if (!rt(t))
return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, tn = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Le(Uint8Array)), nn = (e, t) => {
const r = (e && e[Symbol.iterator]).call(e);
let u;
for (; (u = r.next()) && !u.done; ) {
const s = u.value;
t.call(e, s[0], s[1]);
}
}, rn = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, un = N("HTMLFormElement"), sn = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, r, u) {
return r.toUpperCase() + u;
}
), ze = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), on = N("RegExp"), it = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
Q(n, (u, s) => {
t(u, s, e) !== !1 && (r[s] = u);
}), Object.defineProperties(e, r);
}, an = (e) => {
it(e, (t, n) => {
if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (P(r)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, cn = (e, t) => {
const n = {}, r = (u) => {
u.forEach((s) => {
n[s] = !0;
});
};
return z(e) ? r(e) : r(String(e).split(t)), n;
}, ln = () => {
}, fn = (e, t) => (e = +e, Number.isFinite(e) ? e : t), De = "abcdefghijklmnopqrstuvwxyz", Ve = "0123456789", at = {
DIGIT: Ve,
ALPHA: De,
ALPHA_DIGIT: De + De.toUpperCase() + Ve
}, dn = (e = 16, t = at.ALPHA_DIGIT) => {
let n = "";
const { length: r } = t;
for (; e--; )
n += t[Math.random() * r | 0];
return n;
};
function hn(e) {
return !!(e && P(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const En = (e) => {
const t = new Array(10), n = (r, u) => {
if (Ue(r)) {
if (t.indexOf(r) >= 0)
return;
if (!("toJSON" in r)) {
t[u] = r;
const s = z(r) ? [] : {};
return Q(r, (o, a) => {
const E = n(o, u + 1);
!Z(E) && (s[a] = E);
}), t[u] = void 0, s;
}
}
return r;
};
return n(e, 0);
}, i = {
isArray: z,
isArrayBuffer: nt,
isBuffer: It,
isFormData: Jt,
isArrayBufferView: jt,
isString: qt,
isNumber: rt,
isBoolean: _t,
isObject: Ue,
isPlainObject: oe,
isUndefined: Z,
isDate: Ht,
isFile: Mt,
isBlob: $t,
isRegExp: on,
isFunction: P,
isStream: Vt,
isURLSearchParams: Kt,
isTypedArray: tn,
isFileList: zt,
forEach: Q,
merge: Re,
extend: Gt,
trim: Wt,
stripBOM: Xt,
inherits: Yt,
toFlatObject: Zt,
kindOf: de,
kindOfTest: N,
endsWith: Qt,
toArray: en,
forEachEntry: nn,
matchAll: rn,
isHTMLForm: un,
hasOwnProperty: ze,
hasOwnProp: ze,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: it,
freezeMethods: an,
toObjectSet: cn,
toCamelCase: sn,
noop: ln,
toFiniteNumber: fn,
findKey: ut,
global: st,
isContextDefined: ot,
ALPHABET: at,
generateString: dn,
isSpecCompliantForm: hn,
toJSONObject: En
};
function g(e, t, n, r, u) {
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), n && (this.config = n), r && (this.request = r), u && (this.response = u);
}
i.inherits(g, 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: i.toJSONObject(this.config),
code: this.code,
status: this.response && this.response.status ? this.response.status : null
};
}
});
const ct = g.prototype, lt = {};
[
"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) => {
lt[e] = { value: e };
});
Object.defineProperties(g, lt);
Object.defineProperty(ct, "isAxiosError", { value: !0 });
g.from = (e, t, n, r, u, s) => {
const o = Object.create(ct);
return i.toFlatObject(e, o, function(E) {
return E !== Error.prototype;
}, (a) => a !== "isAxiosError"), g.call(o, e.message, t, n, r, u), o.cause = e, o.name = e.name, s && Object.assign(o, s), o;
};
const pn = null;
function Oe(e) {
return i.isPlainObject(e) || i.isArray(e);
}
function ft(e) {
return i.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Je(e, t, n) {
return e ? e.concat(t).map(function(u, s) {
return u = ft(u), !n && s ? "[" + u + "]" : u;
}).join(n ? "." : "") : t;
}
function mn(e) {
return i.isArray(e) && !e.some(Oe);
}
const yn = i.toFlatObject(i, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function Ee(e, t, n) {
if (!i.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = i.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(f, m) {
return !i.isUndefined(m[f]);
});
const r = n.metaTokens, u = n.visitor || d, s = n.dots, o = n.indexes, E = (n.Blob || typeof Blob < "u" && Blob) && i.isSpecCompliantForm(t);
if (!i.isFunction(u))
throw new TypeError("visitor must be a function");
function c(l) {
if (l === null)
return "";
if (i.isDate(l))
return l.toISOString();
if (!E && i.isBlob(l))
throw new g("Blob is not supported. Use a Buffer instead.");
return i.isArrayBuffer(l) || i.isTypedArray(l) ? E && typeof Blob == "function" ? new Blob([l]) : Buffer.from(l) : l;
}
function d(l, f, m) {
let y = l;
if (l && !m && typeof l == "object") {
if (i.endsWith(f, "{}"))
f = r ? f : f.slice(0, -2), l = JSON.stringify(l);
else if (i.isArray(l) && mn(l) || (i.isFileList(l) || i.endsWith(f, "[]")) && (y = i.toArray(l)))
return f = ft(f), y.forEach(function(D, B) {
!(i.isUndefined(D) || D === null) && t.append(
// eslint-disable-next-line no-nested-ternary
o === !0 ? Je([f], B, s) : o === null ? f : f + "[]",
c(D)
);
}), !1;
}
return Oe(l) ? !0 : (t.append(Je(m, f, s), c(l)), !1);
}
const p = [], A = Object.assign(yn, {
defaultVisitor: d,
convertValue: c,
isVisitable: Oe
});
function h(l, f) {
if (!i.isUndefined(l)) {
if (p.indexOf(l) !== -1)
throw Error("Circular reference detected in " + f.join("."));
p.push(l), i.forEach(l, function(y, C) {
(!(i.isUndefined(y) || y === null) && u.call(
t,
y,
i.isString(C) ? C.trim() : C,
f,
A
)) === !0 && h(y, f ? f.concat(C) : [C]);
}), p.pop();
}
}
if (!i.isObject(e))
throw new TypeError("data must be an object");
return h(e), t;
}
function Ke(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
return t[r];
});
}
function ke(e, t) {
this._pairs = [], e && Ee(e, this, t);
}
const dt = ke.prototype;
dt.append = function(t, n) {
this._pairs.push([t, n]);
};
dt.toString = function(t) {
const n = t ? function(r) {
return t.call(this, r, Ke);
} : Ke;
return this._pairs.map(function(u) {
return n(u[0]) + "=" + n(u[1]);
}, "").join("&");
};
function gn(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function ht(e, t, n) {
if (!t)
return e;
const r = n && n.encode || gn, u = n && n.serialize;
let s;
if (u ? s = u(t, n) : s = i.isURLSearchParams(t) ? t.toString() : new ke(t, n).toString(r), s) {
const o = e.indexOf("#");
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
}
return e;
}
class An {
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, n, r) {
return this.handlers.push({
fulfilled: t,
rejected: n,
synchronous: r ? r.synchronous : !1,
runWhen: r ? r.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) {
i.forEach(this.handlers, function(r) {
r !== null && t(r);
});
}
}
const We = An, Et = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, bn = typeof URLSearchParams < "u" ? URLSearchParams : ke, Fn = typeof FormData < "u" ? FormData : null, Cn = typeof Blob < "u" ? Blob : null, Sn = (() => {
let e;
return typeof navigator < "u" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window < "u" && typeof document < "u";
})(), wn = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), v = {
isBrowser: !0,
classes: {
URLSearchParams: bn,
FormData: Fn,
Blob: Cn
},
isStandardBrowserEnv: Sn,
isStandardBrowserWebWorkerEnv: wn,
protocols: ["http", "https", "file", "blob", "url", "data"]
};
function Dn(e, t) {
return Ee(e, new v.classes.URLSearchParams(), Object.assign({
visitor: function(n, r, u, s) {
return v.isNode && i.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
}
}, t));
}
function Bn(e) {
return i.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function Tn(e) {
const t = {}, n = Object.keys(e);
let r;
const u = n.length;
let s;
for (r = 0; r < u; r++)
s = n[r], t[s] = e[s];
return t;
}
function pt(e) {
function t(n, r, u, s) {
let o = n[s++];
const a = Number.isFinite(+o), E = s >= n.length;
return o = !o && i.isArray(u) ? u.length : o, E ? (i.hasOwnProp(u, o) ? u[o] = [u[o], r] : u[o] = r, !a) : ((!u[o] || !i.isObject(u[o])) && (u[o] = []), t(n, r, u[o], s) && i.isArray(u[o]) && (u[o] = Tn(u[o])), !a);
}
if (i.isFormData(e) && i.isFunction(e.entries)) {
const n = {};
return i.forEachEntry(e, (r, u) => {
t(Bn(r), u, n, 0);
}), n;
}
return null;
}
const vn = {
"Content-Type": void 0
};
function Rn(e, t, n) {
if (i.isString(e))
try {
return (t || JSON.parse)(e), i.trim(e);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (n || JSON.stringify)(e);
}
const pe = {
transitional: Et,
adapter: ["xhr", "http"],
transformRequest: [function(t, n) {
const r = n.getContentType() || "", u = r.indexOf("application/json") > -1, s = i.isObject(t);
if (s && i.isHTMLForm(t) && (t = new FormData(t)), i.isFormData(t))
return u && u ? JSON.stringify(pt(t)) : t;
if (i.isArrayBuffer(t) || i.isBuffer(t) || i.isStream(t) || i.isFile(t) || i.isBlob(t))
return t;
if (i.isArrayBufferView(t))
return t.buffer;
if (i.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let a;
if (s) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return Dn(t, this.formSerializer).toString();
if ((a = i.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
const E = this.env && this.env.FormData;
return Ee(
a ? { "files[]": t } : t,
E && new E(),
this.formSerializer
);
}
}
return s || u ? (n.setContentType("application/json", !1), Rn(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || pe.transitional, r = n && n.forcedJSONParsing, u = this.responseType === "json";
if (t && i.isString(t) && (r && !this.responseType || u)) {
const o = !(n && n.silentJSONParsing) && u;
try {
return JSON.parse(t);
} catch (a) {
if (o)
throw a.name === "SyntaxError" ? g.from(a, g.ERR_BAD_RESPONSE, this, null, this.response) : a;
}
}
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: v.classes.FormData,
Blob: v.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*"
}
}
};
i.forEach(["delete", "get", "head"], function(t) {
pe.headers[t] = {};
});
i.forEach(["post", "put", "patch"], function(t) {
pe.headers[t] = i.merge(vn);
});
const Ie = pe, On = i.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"
]), xn = (e) => {
const t = {};
let n, r, u;
return e && e.split(`
`).forEach(function(o) {
u = o.indexOf(":"), n = o.substring(0, u).trim().toLowerCase(), r = o.substring(u + 1).trim(), !(!n || t[n] && On[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, Ge = Symbol("internals");
function X(e) {
return e && String(e).trim().toLowerCase();
}
function ie(e) {
return e === !1 || e == null ? e : i.isArray(e) ? e.map(ie) : String(e);
}
function Pn(e) {
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let r;
for (; r = n.exec(e); )
t[r[1]] = r[2];
return t;
}
const Nn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function Be(e, t, n, r, u) {
if (i.isFunction(r))
return r.call(this, t, n);
if (u && (t = n), !!i.isString(t)) {
if (i.isString(r))
return t.indexOf(r) !== -1;
if (i.isRegExp(r))
return r.test(t);
}
}
function Ln(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function Un(e, t) {
const n = i.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(u, s, o) {
return this[r].call(this, t, u, s, o);
},
configurable: !0
});
});
}
class me {
constructor(t) {
t && this.set(t);
}
set(t, n, r) {
const u = this;
function s(a, E, c) {
const d = X(E);
if (!d)
throw new Error("header name must be a non-empty string");
const p = i.findKey(u, d);
(!p || u[p] === void 0 || c === !0 || c === void 0 && u[p] !== !1) && (u[p || E] = ie(a));
}
const o = (a, E) => i.forEach(a, (c, d) => s(c, d, E));
return i.isPlainObject(t) || t instanceof this.constructor ? o(t, n) : i.isString(t) && (t = t.trim()) && !Nn(t) ? o(xn(t), n) : t != null && s(n, t, r), this;
}
get(t, n) {
if (t = X(t), t) {
const r = i.findKey(this, t);
if (r) {
const u = this[r];
if (!n)
return u;
if (n === !0)
return Pn(u);
if (i.isFunction(n))
return n.call(this, u, r);
if (i.isRegExp(n))
return n.exec(u);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, n) {
if (t = X(t), t) {
const r = i.findKey(this, t);
return !!(r && this[r] !== void 0 && (!n || Be(this, this[r], r, n)));
}
return !1;
}
delete(t, n) {
const r = this;
let u = !1;
function s(o) {
if (o = X(o), o) {
const a = i.findKey(r, o);
a && (!n || Be(r, r[a], a, n)) && (delete r[a], u = !0);
}
}
return i.isArray(t) ? t.forEach(s) : s(t), u;
}
clear(t) {
const n = Object.keys(this);
let r = n.length, u = !1;
for (; r--; ) {
const s = n[r];
(!t || Be(this, this[s], s, t, !0)) && (delete this[s], u = !0);
}
return u;
}
normalize(t) {
const n = this, r = {};
return i.forEach(this, (u, s) => {
const o = i.findKey(r, s);
if (o) {
n[o] = ie(u), delete n[s];
return;
}
const a = t ? Ln(s) : String(s).trim();
a !== s && delete n[s], n[a] = ie(u), r[a] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const n = /* @__PURE__ */ Object.create(null);
return i.forEach(this, (r, u) => {
r != null && r !== !1 && (n[u] = t && i.isArray(r) ? r.join(", ") : r);
}), n;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
`);
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(t) {
return t instanceof this ? t : new this(t);
}
static concat(t, ...n) {
const r = new this(t);
return n.forEach((u) => r.set(u)), r;
}
static accessor(t) {
const r = (this[Ge] = this[Ge] = {
accessors: {}
}).accessors, u = this.prototype;
function s(o) {
const a = X(o);
r[a] || (Un(u, o), r[a] = !0);
}
return i.isArray(t) ? t.forEach(s) : s(t), this;
}
}
me.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
i.freezeMethods(me.prototype);
i.freezeMethods(me);
const x = me;
function Te(e, t) {
const n = this || Ie, r = t || n, u = x.from(r.headers);
let s = r.data;
return i.forEach(e, function(a) {
s = a.call(n, s, u.normalize(), t ? t.status : void 0);
}), u.normalize(), s;
}
function mt(e) {
return !!(e && e.__CANCEL__);
}
function ee(e, t, n) {
g.call(this, e ?? "canceled", g.ERR_CANCELED, t, n), this.name = "CanceledError";
}
i.inherits(ee, g, {
__CANCEL__: !0
});
function kn(e, t, n) {
const r = n.config.validateStatus;
!n.status || !r || r(n.status) ? e(n) : t(new g(
"Request failed with status code " + n.status,
[g.ERR_BAD_REQUEST, g.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
const In = v.isStandardBrowserEnv ? (
// Standard browser envs support document.cookie
function() {
return {
write: function(n, r, u, s, o, a) {
const E = [];
E.push(n + "=" + encodeURIComponent(r)), i.isNumber(u) && E.push("expires=" + new Date(u).toGMTString()), i.isString(s) && E.push("path=" + s), i.isString(o) && E.push("domain=" + o), a === !0 && E.push("secure"), document.cookie = E.join("; ");
},
read: function(n) {
const r = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
return r ? decodeURIComponent(r[3]) : null;
},
remove: function(n) {
this.write(n, "", Date.now() - 864e5);
}
};
}()
) : (
// Non standard browser env (web workers, react-native) lack needed support.
function() {
return {
write: function() {
},
read: function() {
return null;
},
remove: function() {
}
};
}()
);
function jn(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function qn(e, t) {
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function yt(e, t) {
return e && !jn(t) ? qn(e, t) : t;
}
const _n = v.isStandardBrowserEnv ? (
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
function() {
const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
let r;
function u(s) {
let o = s;
return t && (n.setAttribute("href", o), o = n.href), n.setAttribute("href", o), {
href: n.href,
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
host: n.host,
search: n.search ? n.search.replace(/^\?/, "") : "",
hash: n.hash ? n.hash.replace(/^#/, "") : "",
hostname: n.hostname,
port: n.port,
pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
};
}
return r = u(window.location.href), function(o) {
const a = i.isString(o) ? u(o) : o;
return a.protocol === r.protocol && a.host === r.host;
};
}()
) : (
// Non standard browser envs (web workers, react-native) lack needed support.
function() {
return function() {
return !0;
};
}()
);
function Hn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function Mn(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let u = 0, s = 0, o;
return t = t !== void 0 ? t : 1e3, function(E) {
const c = Date.now(), d = r[s];
o || (o = c), n[u] = E, r[u] = c;
let p = s, A = 0;
for (; p !== u; )
A += n[p++], p = p % e;
if (u = (u + 1) % e, u === s && (s = (s + 1) % e), c - o < t)
return;
const h = d && c - d;
return h ? Math.round(A * 1e3 / h) : void 0;
};
}
function Xe(e, t) {
let n = 0;
const r = Mn(50, 250);
return (u) => {
const s = u.loaded, o = u.lengthComputable ? u.total : void 0, a = s - n, E = r(a), c = s <= o;
n = s;
const d = {
loaded: s,
total: o,
progress: o ? s / o : void 0,
bytes: a,
rate: E || void 0,
estimated: E && o && c ? (o - s) / E : void 0,
event: u
};
d[t ? "download" : "upload"] = !0, e(d);
};
}
const $n = typeof XMLHttpRequest < "u", zn = $n && function(e) {
return new Promise(function(n, r) {
let u = e.data;
const s = x.from(e.headers).normalize(), o = e.responseType;
let a;
function E() {
e.cancelToken && e.cancelToken.unsubscribe(a), e.signal && e.signal.removeEventListener("abort", a);
}
i.isFormData(u) && (v.isStandardBrowserEnv || v.isStandardBrowserWebWorkerEnv) && s.setContentType(!1);
let c = new XMLHttpRequest();
if (e.auth) {
const h = e.auth.username || "", l = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
s.set("Authorization", "Basic " + btoa(h + ":" + l));
}
const d = yt(e.baseURL, e.url);
c.open(e.method.toUpperCase(), ht(d, e.params, e.paramsSerializer), !0), c.timeout = e.timeout;
function p() {
if (!c)
return;
const h = x.from(
"getAllResponseHeaders" in c && c.getAllResponseHeaders()
), f = {
data: !o || o === "text" || o === "json" ? c.responseText : c.response,
status: c.status,
statusText: c.statusText,
headers: h,
config: e,
request: c
};
kn(function(y) {
n(y), E();
}, function(y) {
r(y), E();
}, f), c = null;
}
if ("onloadend" in c ? c.onloadend = p : c.onreadystatechange = function() {
!c || c.readyState !== 4 || c.status === 0 && !(c.responseURL && c.responseURL.indexOf("file:") === 0) || setTimeout(p);
}, c.onabort = function() {
c && (r(new g("Request aborted", g.ECONNABORTED, e, c)), c = null);
}, c.onerror = function() {
r(new g("Network Error", g.ERR_NETWORK, e, c)), c = null;
}, c.ontimeout = function() {
let l = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
const f = e.transitional || Et;
e.timeoutErrorMessage && (l = e.timeoutErrorMessage), r(new g(
l,
f.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
e,
c
)), c = null;
}, v.isStandardBrowserEnv) {
const h = (e.withCredentials || _n(d)) && e.xsrfCookieName && In.read(e.xsrfCookieName);
h && s.set(e.xsrfHeaderName, h);
}
u === void 0 && s.setContentType(null), "setRequestHeader" in c && i.forEach(s.toJSON(), function(l, f) {
c.setRequestHeader(f, l);
}), i.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials), o && o !== "json" && (c.responseType = e.responseType), typeof e.onDownloadProgress == "function" && c.addEventListener("progress", Xe(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && c.upload && c.upload.addEventListener("progress", Xe(e.onUploadProgress)), (e.cancelToken || e.signal) && (a = (h) => {
c && (r(!h || h.type ? new ee(null, e, c) : h), c.abort(), c = null);
}, e.cancelToken && e.cancelToken.subscribe(a), e.signal && (e.signal.aborted ? a() : e.signal.addEventListener("abort", a)));
const A = Hn(d);
if (A && v.protocols.indexOf(A) === -1) {
r(new g("Unsupported protocol " + A + ":", g.ERR_BAD_REQUEST, e));
return;
}
c.send(u || null);
});
}, ae = {
http: pn,
xhr: zn
};
i.forEach(ae, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const Vn = {
getAdapter: (e) => {
e = i.isArray(e) ? e : [e];
const { length: t } = e;
let n, r;
for (let u = 0; u < t && (n = e[u], !(r = i.isString(n) ? ae[n.toLowerCase()] : n)); u++)
;
if (!r)
throw r === !1 ? new g(
`Adapter ${n} is not supported by the environment`,
"ERR_NOT_SUPPORT"
) : new Error(
i.hasOwnProp(ae, n) ? `Adapter '${n}' is not available in the build` : `Unknown adapter '${n}'`
);
if (!i.isFunction(r))
throw new TypeError("adapter is not a function");
return r;
},
adapters: ae
};
function ve(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new ee(null, e);
}
function Ye(e) {
return ve(e), e.headers = x.from(e.headers), e.data = Te.call(
e,
e.transformRequest
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Vn.getAdapter(e.adapter || Ie.adapter)(e).then(function(r) {
return ve(e), r.data = Te.call(
e,
e.transformResponse,
r
), r.headers = x.from(r.headers), r;
}, function(r) {
return mt(r) || (ve(e), r && r.response && (r.response.data = Te.call(
e,
e.transformResponse,
r.response
), r.response.headers = x.from(r.response.headers))), Promise.reject(r);
});
}
const Ze = (e) => e instanceof x ? e.toJSON() : e;
function $(e, t) {
t = t || {};
const n = {};
function r(c, d, p) {
return i.isPlainObject(c) && i.isPlainObject(d) ? i.merge.call({ caseless: p }, c, d) : i.isPlainObject(d) ? i.merge({}, d) : i.isArray(d) ? d.slice() : d;
}
function u(c, d, p) {
if (i.isUndefined(d)) {
if (!i.isUndefined(c))
return r(void 0, c, p);
} else
return r(c, d, p);
}
function s(c, d) {
if (!i.isUndefined(d))
return r(void 0, d);
}
function o(c, d) {
if (i.isUndefined(d)) {
if (!i.isUndefined(c))
return r(void 0, c);
} else
return r(void 0, d);
}
function a(c, d, p) {
if (p in t)
return r(c, d);
if (p in e)
return r(void 0, c);
}
const E = {
url: s,
method: s,
data: s,
baseURL: o,
transformRequest: o,
transformResponse: o,
paramsSerializer: o,
timeout: o,
timeoutMessage: o,
withCredentials: o,
adapter: o,
responseType: o,
xsrfCookieName: o,
xsrfHeaderName: o,
onUploadProgress: o,
onDownloadProgress: o,
decompress: o,
maxContentLength: o,
maxBodyLength: o,
beforeRedirect: o,
transport: o,
httpAgent: o,
httpsAgent: o,
cancelToken: o,
socketPath: o,
responseEncoding: o,
validateStatus: a,
headers: (c, d) => u(Ze(c), Ze(d), !0)
};
return i.forEach(Object.keys(e).concat(Object.keys(t)), function(d) {
const p = E[d] || u, A = p(e[d], t[d], d);
i.isUndefined(A) && p !== a || (n[d] = A);
}), n;
}
const gt = "1.3.6", je = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
je[e] = function(r) {
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const Qe = {};
je.transitional = function(t, n, r) {
function u(s, o) {
return "[Axios v" + gt + "] Transitional option '" + s + "'" + o + (r ? ". " + r : "");
}
return (s, o, a) => {
if (t === !1)
throw new g(
u(o, " has been removed" + (n ? " in " + n : "")),
g.ERR_DEPRECATED
);
return n && !Qe[o] && (Qe[o] = !0, console.warn(
u(
o,
" has been deprecated since v" + n + " and will be removed in the near future"
)
)), t ? t(s, o, a) : !0;
};
};
function Jn(e, t, n) {
if (typeof e != "object")
throw new g("options must be an object", g.ERR_BAD_OPTION_VALUE);
const r = Object.keys(e);
let u =