dev-classes 1.3.23 → 1.3.25
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.
|
@@ -12,11 +12,11 @@ function Ie(e, t) {
|
|
|
12
12
|
const { toString: dt } = Object.prototype, { getPrototypeOf: he } = Object, G = /* @__PURE__ */ ((e) => (t) => {
|
|
13
13
|
const n = dt.call(t);
|
|
14
14
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
15
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
15
|
+
})(/* @__PURE__ */ Object.create(null)), D = (e) => (e = e.toLowerCase(), (t) => G(t) === e), X = (e) => (t) => typeof t === e, { isArray: _ } = Array, H = X("undefined");
|
|
16
16
|
function pt(e) {
|
|
17
17
|
return e !== null && !H(e) && e.constructor !== null && !H(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
18
18
|
}
|
|
19
|
-
const He =
|
|
19
|
+
const He = D("ArrayBuffer");
|
|
20
20
|
function ht(e) {
|
|
21
21
|
let t;
|
|
22
22
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && He(e.buffer), t;
|
|
@@ -26,11 +26,11 @@ const mt = X("string"), N = X("function"), ve = X("number"), Q = (e) => e !== nu
|
|
|
26
26
|
return !1;
|
|
27
27
|
const t = he(e);
|
|
28
28
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
29
|
-
}, wt =
|
|
29
|
+
}, wt = D("Date"), gt = D("File"), bt = D("Blob"), Et = D("FileList"), St = (e) => Q(e) && N(e.pipe), Rt = (e) => {
|
|
30
30
|
let t;
|
|
31
31
|
return e && (typeof FormData == "function" && e instanceof FormData || N(e.append) && ((t = G(e)) === "formdata" || // detect form-data instance
|
|
32
32
|
t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
|
|
33
|
-
}, Ot =
|
|
33
|
+
}, Ot = D("URLSearchParams"), [Tt, At, Ct, xt] = ["ReadableStream", "Request", "Response", "Headers"].map(D), Nt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
34
34
|
function v(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
35
35
|
if (e === null || typeof e > "u")
|
|
36
36
|
return;
|
|
@@ -110,12 +110,12 @@ const Pt = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
|
110
110
|
for (; (n = e.exec(t)) !== null; )
|
|
111
111
|
r.push(n);
|
|
112
112
|
return r;
|
|
113
|
-
}, qt =
|
|
113
|
+
}, qt = D("HTMLFormElement"), It = (e) => e.toLowerCase().replace(
|
|
114
114
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
115
115
|
function(n, r, s) {
|
|
116
116
|
return r.toUpperCase() + s;
|
|
117
117
|
}
|
|
118
|
-
), Te = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ht =
|
|
118
|
+
), Te = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ht = D("RegExp"), Je = (e, t) => {
|
|
119
119
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
120
120
|
v(n, (s, o) => {
|
|
121
121
|
let i;
|
|
@@ -175,7 +175,7 @@ const Wt = (e) => {
|
|
|
175
175
|
return r;
|
|
176
176
|
};
|
|
177
177
|
return n(e, 0);
|
|
178
|
-
}, Kt =
|
|
178
|
+
}, Kt = D("AsyncFunction"), Gt = (e) => e && (Q(e) || N(e)) && N(e.then) && N(e.catch), Ve = ((e, t) => e ? setImmediate : t ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
|
|
179
179
|
s === B && o === n && r.length && r.shift()();
|
|
180
180
|
}, !1), (s) => {
|
|
181
181
|
r.push(s), B.postMessage(n, "*");
|
|
@@ -215,7 +215,7 @@ const Wt = (e) => {
|
|
|
215
215
|
inherits: Ft,
|
|
216
216
|
toFlatObject: Ut,
|
|
217
217
|
kindOf: G,
|
|
218
|
-
kindOfTest:
|
|
218
|
+
kindOfTest: D,
|
|
219
219
|
endsWith: Dt,
|
|
220
220
|
toArray: Lt,
|
|
221
221
|
forEachEntry: jt,
|
|
@@ -338,10 +338,10 @@ function Z(e, t, n) {
|
|
|
338
338
|
if (a.endsWith(h, "{}"))
|
|
339
339
|
h = r ? h : h.slice(0, -2), d = JSON.stringify(d);
|
|
340
340
|
else if (a.isArray(d) && Zt(d) || (a.isFileList(d) || a.endsWith(h, "[]")) && (g = a.toArray(d)))
|
|
341
|
-
return h = Ge(h), g.forEach(function(O,
|
|
341
|
+
return h = Ge(h), g.forEach(function(O, b) {
|
|
342
342
|
!(a.isUndefined(O) || O === null) && t.append(
|
|
343
343
|
// eslint-disable-next-line no-nested-ternary
|
|
344
|
-
i === !0 ? Ce([h],
|
|
344
|
+
i === !0 ? Ce([h], b, o) : i === null ? h : h + "[]",
|
|
345
345
|
u(O)
|
|
346
346
|
);
|
|
347
347
|
}), !1;
|
|
@@ -357,14 +357,14 @@ function Z(e, t, n) {
|
|
|
357
357
|
if (!a.isUndefined(d)) {
|
|
358
358
|
if (m.indexOf(d) !== -1)
|
|
359
359
|
throw Error("Circular reference detected in " + h.join("."));
|
|
360
|
-
m.push(d), a.forEach(d, function(g,
|
|
360
|
+
m.push(d), a.forEach(d, function(g, E) {
|
|
361
361
|
(!(a.isUndefined(g) || g === null) && s.call(
|
|
362
362
|
t,
|
|
363
363
|
g,
|
|
364
|
-
a.isString(
|
|
364
|
+
a.isString(E) ? E.trim() : E,
|
|
365
365
|
h,
|
|
366
366
|
S
|
|
367
|
-
)) === !0 && R(g, h ? h.concat(
|
|
367
|
+
)) === !0 && R(g, h ? h.concat(E) : [E]);
|
|
368
368
|
}), m.pop();
|
|
369
369
|
}
|
|
370
370
|
}
|
|
@@ -800,9 +800,9 @@ a.reduceDescriptors(Y.prototype, ({ value: e }, t) => {
|
|
|
800
800
|
};
|
|
801
801
|
});
|
|
802
802
|
a.freezeMethods(Y);
|
|
803
|
-
const
|
|
803
|
+
const U = Y;
|
|
804
804
|
function re(e, t) {
|
|
805
|
-
const n = this || ge, r = t || n, s =
|
|
805
|
+
const n = this || ge, r = t || n, s = U.from(r.headers);
|
|
806
806
|
let o = r.data;
|
|
807
807
|
return a.forEach(e, function(c) {
|
|
808
808
|
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
@@ -952,7 +952,7 @@ function Cn(e, t) {
|
|
|
952
952
|
function nt(e, t) {
|
|
953
953
|
return e && !An(t) ? Cn(e, t) : t;
|
|
954
954
|
}
|
|
955
|
-
const Ue = (e) => e instanceof
|
|
955
|
+
const Ue = (e) => e instanceof U ? { ...e } : e;
|
|
956
956
|
function j(e, t) {
|
|
957
957
|
t = t || {};
|
|
958
958
|
const n = {};
|
|
@@ -1022,7 +1022,7 @@ function j(e, t) {
|
|
|
1022
1022
|
const rt = (e) => {
|
|
1023
1023
|
const t = j({}, e);
|
|
1024
1024
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
|
|
1025
|
-
t.headers = i =
|
|
1025
|
+
t.headers = i = U.from(i), t.url = Qe(nt(t.baseURL, t.url), e.params, e.paramsSerializer), c && i.set(
|
|
1026
1026
|
"Authorization",
|
|
1027
1027
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1028
1028
|
);
|
|
@@ -1044,7 +1044,7 @@ const rt = (e) => {
|
|
|
1044
1044
|
return new Promise(function(n, r) {
|
|
1045
1045
|
const s = rt(e);
|
|
1046
1046
|
let o = s.data;
|
|
1047
|
-
const i =
|
|
1047
|
+
const i = U.from(s.headers).normalize();
|
|
1048
1048
|
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, m, S, R, d;
|
|
1049
1049
|
function h() {
|
|
1050
1050
|
R && R(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
@@ -1054,7 +1054,7 @@ const rt = (e) => {
|
|
|
1054
1054
|
function g() {
|
|
1055
1055
|
if (!p)
|
|
1056
1056
|
return;
|
|
1057
|
-
const O =
|
|
1057
|
+
const O = U.from(
|
|
1058
1058
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1059
1059
|
), A = {
|
|
1060
1060
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
@@ -1077,22 +1077,22 @@ const rt = (e) => {
|
|
|
1077
1077
|
}, p.onerror = function() {
|
|
1078
1078
|
r(new y("Network Error", y.ERR_NETWORK, e, p)), p = null;
|
|
1079
1079
|
}, p.ontimeout = function() {
|
|
1080
|
-
let
|
|
1080
|
+
let b = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1081
1081
|
const A = s.transitional || Ze;
|
|
1082
|
-
s.timeoutErrorMessage && (
|
|
1083
|
-
|
|
1082
|
+
s.timeoutErrorMessage && (b = s.timeoutErrorMessage), r(new y(
|
|
1083
|
+
b,
|
|
1084
1084
|
A.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
|
|
1085
1085
|
e,
|
|
1086
1086
|
p
|
|
1087
1087
|
)), p = null;
|
|
1088
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(
|
|
1089
|
-
p.setRequestHeader(A,
|
|
1088
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(b, A) {
|
|
1089
|
+
p.setRequestHeader(A, b);
|
|
1090
1090
|
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([S, d] = V(u, !0), p.addEventListener("progress", S)), f && p.upload && ([m, R] = V(f), p.upload.addEventListener("progress", m), p.upload.addEventListener("loadend", R)), (s.cancelToken || s.signal) && (l = (O) => {
|
|
1091
1091
|
p && (r(!O || O.type ? new q(null, e, p) : O), p.abort(), p = null);
|
|
1092
1092
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1093
|
-
const
|
|
1094
|
-
if (
|
|
1095
|
-
r(new y("Unsupported protocol " +
|
|
1093
|
+
const E = En(s.url);
|
|
1094
|
+
if (E && C.protocols.indexOf(E) === -1) {
|
|
1095
|
+
r(new y("Unsupported protocol " + E + ":", y.ERR_BAD_REQUEST, e));
|
|
1096
1096
|
return;
|
|
1097
1097
|
}
|
|
1098
1098
|
p.send(o || null);
|
|
@@ -1249,11 +1249,11 @@ const jn = async (e) => {
|
|
|
1249
1249
|
duplex: "half"
|
|
1250
1250
|
}), P;
|
|
1251
1251
|
if (a.isFormData(r) && (P = A.headers.get("content-type")) && l.setContentType(P), A.body) {
|
|
1252
|
-
const [k,
|
|
1252
|
+
const [k, F] = ke(
|
|
1253
1253
|
p,
|
|
1254
1254
|
V(Fe(f))
|
|
1255
1255
|
);
|
|
1256
|
-
r = De(A.body, Le, k,
|
|
1256
|
+
r = De(A.body, Le, k, F);
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
1259
|
a.isString(m) || (m = m ? "include" : "omit");
|
|
@@ -1267,32 +1267,32 @@ const jn = async (e) => {
|
|
|
1267
1267
|
duplex: "half",
|
|
1268
1268
|
credentials: g ? m : void 0
|
|
1269
1269
|
});
|
|
1270
|
-
let
|
|
1270
|
+
let E = await fetch(d);
|
|
1271
1271
|
const O = ue && (u === "stream" || u === "response");
|
|
1272
1272
|
if (ue && (c || O && h)) {
|
|
1273
1273
|
const A = {};
|
|
1274
1274
|
["status", "statusText", "headers"].forEach((Se) => {
|
|
1275
|
-
A[Se] =
|
|
1275
|
+
A[Se] = E[Se];
|
|
1276
1276
|
});
|
|
1277
|
-
const P = a.toFiniteNumber(
|
|
1277
|
+
const P = a.toFiniteNumber(E.headers.get("content-length")), [k, F] = c && ke(
|
|
1278
1278
|
P,
|
|
1279
1279
|
V(Fe(c), !0)
|
|
1280
1280
|
) || [];
|
|
1281
|
-
|
|
1282
|
-
De(
|
|
1283
|
-
|
|
1281
|
+
E = new Response(
|
|
1282
|
+
De(E.body, Le, k, () => {
|
|
1283
|
+
F && F(), h && h();
|
|
1284
1284
|
}),
|
|
1285
1285
|
A
|
|
1286
1286
|
);
|
|
1287
1287
|
}
|
|
1288
1288
|
u = u || "text";
|
|
1289
|
-
let
|
|
1289
|
+
let b = await W[a.findKey(W, u) || "text"](E, e);
|
|
1290
1290
|
return !O && h && h(), await new Promise((A, P) => {
|
|
1291
1291
|
tt(A, P, {
|
|
1292
|
-
data:
|
|
1293
|
-
headers:
|
|
1294
|
-
status:
|
|
1295
|
-
statusText:
|
|
1292
|
+
data: b,
|
|
1293
|
+
headers: U.from(E.headers),
|
|
1294
|
+
status: E.status,
|
|
1295
|
+
statusText: E.statusText,
|
|
1296
1296
|
config: e,
|
|
1297
1297
|
request: d
|
|
1298
1298
|
});
|
|
@@ -1355,7 +1355,7 @@ function se(e) {
|
|
|
1355
1355
|
throw new q(null, e);
|
|
1356
1356
|
}
|
|
1357
1357
|
function je(e) {
|
|
1358
|
-
return se(e), e.headers =
|
|
1358
|
+
return se(e), e.headers = U.from(e.headers), e.data = re.call(
|
|
1359
1359
|
e,
|
|
1360
1360
|
e.transformRequest
|
|
1361
1361
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), it.getAdapter(e.adapter || ge.adapter)(e).then(function(r) {
|
|
@@ -1363,13 +1363,13 @@ function je(e) {
|
|
|
1363
1363
|
e,
|
|
1364
1364
|
e.transformResponse,
|
|
1365
1365
|
r
|
|
1366
|
-
), r.headers =
|
|
1366
|
+
), r.headers = U.from(r.headers), r;
|
|
1367
1367
|
}, function(r) {
|
|
1368
1368
|
return et(r) || (se(e), r && r.response && (r.response.data = re.call(
|
|
1369
1369
|
e,
|
|
1370
1370
|
e.transformResponse,
|
|
1371
1371
|
r.response
|
|
1372
|
-
), r.response.headers =
|
|
1372
|
+
), r.response.headers = U.from(r.response.headers))), Promise.reject(r);
|
|
1373
1373
|
});
|
|
1374
1374
|
}
|
|
1375
1375
|
const at = "1.7.7", be = {};
|
|
@@ -1417,7 +1417,7 @@ function Hn(e, t, n) {
|
|
|
1417
1417
|
const fe = {
|
|
1418
1418
|
assertOptions: Hn,
|
|
1419
1419
|
validators: be
|
|
1420
|
-
},
|
|
1420
|
+
}, L = fe.validators;
|
|
1421
1421
|
class K {
|
|
1422
1422
|
constructor(t) {
|
|
1423
1423
|
this.defaults = t, this.interceptors = {
|
|
@@ -1454,14 +1454,14 @@ class K {
|
|
|
1454
1454
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = j(this.defaults, n);
|
|
1455
1455
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1456
1456
|
r !== void 0 && fe.assertOptions(r, {
|
|
1457
|
-
silentJSONParsing:
|
|
1458
|
-
forcedJSONParsing:
|
|
1459
|
-
clarifyTimeoutError:
|
|
1457
|
+
silentJSONParsing: L.transitional(L.boolean),
|
|
1458
|
+
forcedJSONParsing: L.transitional(L.boolean),
|
|
1459
|
+
clarifyTimeoutError: L.transitional(L.boolean)
|
|
1460
1460
|
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1461
1461
|
serialize: s
|
|
1462
1462
|
} : fe.assertOptions(s, {
|
|
1463
|
-
encode:
|
|
1464
|
-
serialize:
|
|
1463
|
+
encode: L.function,
|
|
1464
|
+
serialize: L.function
|
|
1465
1465
|
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1466
1466
|
let i = o && a.merge(
|
|
1467
1467
|
o.common,
|
|
@@ -1472,7 +1472,7 @@ class K {
|
|
|
1472
1472
|
(d) => {
|
|
1473
1473
|
delete o[d];
|
|
1474
1474
|
}
|
|
1475
|
-
), n.headers =
|
|
1475
|
+
), n.headers = U.concat(i, o);
|
|
1476
1476
|
const c = [];
|
|
1477
1477
|
let f = !0;
|
|
1478
1478
|
this.interceptors.request.forEach(function(h) {
|
|
@@ -1713,7 +1713,7 @@ T.all = function(t) {
|
|
|
1713
1713
|
T.spread = Mn;
|
|
1714
1714
|
T.isAxiosError = zn;
|
|
1715
1715
|
T.mergeConfig = j;
|
|
1716
|
-
T.AxiosHeaders =
|
|
1716
|
+
T.AxiosHeaders = U;
|
|
1717
1717
|
T.formToJSON = (e) => Ye(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1718
1718
|
T.getAdapter = it.getAdapter;
|
|
1719
1719
|
T.HttpStatusCode = Jn;
|
|
@@ -1820,21 +1820,29 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1820
1820
|
c,
|
|
1821
1821
|
(h) => {
|
|
1822
1822
|
w.registerFailedRequests.removeItem(t), w.registerRequest.removeItem(t);
|
|
1823
|
-
const p = (h == null ? void 0 : h.headers) && h.headers["set-cookie"], g = h.status,
|
|
1824
|
-
o = { ...o, statusCode: g, data:
|
|
1823
|
+
const p = (h == null ? void 0 : h.headers) && h.headers["set-cookie"], g = h.status, E = h == null ? void 0 : h.data;
|
|
1824
|
+
o = { ...o, statusCode: g, data: E, res: h }, g === 200 && p && (w.saveToken(p), o.data = { ...o.data, token: p }), r(o);
|
|
1825
1825
|
},
|
|
1826
1826
|
(h) => {
|
|
1827
1827
|
console.log("http.sendRequest error: ", h);
|
|
1828
|
-
const p = w.errorsHandler.handleError(h), { url: g, status:
|
|
1828
|
+
const p = w.errorsHandler.handleError(h), { url: g, status: E, headers: O, error: b, ...A } = h;
|
|
1829
|
+
console.dir(b);
|
|
1830
|
+
try {
|
|
1831
|
+
const F = JSON.parse(b.trim());
|
|
1832
|
+
console.log("parseError", F);
|
|
1833
|
+
} catch (F) {
|
|
1834
|
+
console.dir(F);
|
|
1835
|
+
}
|
|
1836
|
+
const P = typeof b == "string" ? Oe.isJSON(b.trim()) : !1, k = {
|
|
1829
1837
|
headers: O,
|
|
1830
|
-
status:
|
|
1838
|
+
status: E,
|
|
1831
1839
|
message: ""
|
|
1832
1840
|
};
|
|
1833
1841
|
if (P) {
|
|
1834
|
-
const
|
|
1835
|
-
k.message = w.errorsHandler.getErrorMessageFromData(
|
|
1842
|
+
const F = JSON.parse(b);
|
|
1843
|
+
k.message = w.errorsHandler.getErrorMessageFromData(F), k.data = F;
|
|
1836
1844
|
} else
|
|
1837
|
-
typeof
|
|
1845
|
+
typeof b == "string" && (k.message = b);
|
|
1838
1846
|
s({ ...l, ...p, errExt: k });
|
|
1839
1847
|
}
|
|
1840
1848
|
);
|
|
@@ -1844,14 +1852,14 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1844
1852
|
const h = d.status, p = d == null ? void 0 : d.data;
|
|
1845
1853
|
o = { ...o, statusCode: h, data: p, res: d }, r(o);
|
|
1846
1854
|
}).catch((d) => {
|
|
1847
|
-
const h = w.errorsHandler.handleError(d), { code: p, config: g, status:
|
|
1855
|
+
const h = w.errorsHandler.handleError(d), { code: p, config: g, status: E, message: O, response: b, stack: A } = d, P = {
|
|
1848
1856
|
code: p,
|
|
1849
1857
|
config: g,
|
|
1850
|
-
status:
|
|
1858
|
+
status: E || f,
|
|
1851
1859
|
message: O,
|
|
1852
|
-
headers:
|
|
1853
|
-
statusText:
|
|
1854
|
-
data:
|
|
1860
|
+
headers: b == null ? void 0 : b.headers,
|
|
1861
|
+
statusText: b == null ? void 0 : b.statusText,
|
|
1862
|
+
data: b == null ? void 0 : b.data,
|
|
1855
1863
|
stack: A
|
|
1856
1864
|
};
|
|
1857
1865
|
s({ ...l, ...h, errExt: P });
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var u = (
|
|
3
|
-
var
|
|
2
|
+
var u = (e, t, s) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var i = (e, t, s) => (u(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
4
|
const l = {
|
|
5
5
|
isNetworkStatus: window.navigator.onLine,
|
|
6
6
|
listCloseSignals: [],
|
|
7
7
|
isWatcher: !1
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class f {
|
|
10
10
|
constructor() {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
i(this, "state", l);
|
|
12
|
+
i(this, "resetState", () => this.state = l);
|
|
13
13
|
}
|
|
14
14
|
addWatchers(t) {
|
|
15
15
|
if (!this.state.isWatcher) {
|
|
16
|
-
|
|
17
|
-
const
|
|
16
|
+
this.state.isWatcher = !0;
|
|
17
|
+
const s = [
|
|
18
18
|
{ event: "online", status: !0, textStatus: "network" },
|
|
19
19
|
{ event: "offline", status: !1, textStatus: "none" }
|
|
20
20
|
];
|
|
21
|
-
for (let a = 0; a <
|
|
22
|
-
const
|
|
23
|
-
this.state.listCloseSignals.push(
|
|
21
|
+
for (let a = 0; a < s.length; a++) {
|
|
22
|
+
const n = new AbortController(), { event: o, status: r, textStatus: h } = s[a];
|
|
23
|
+
this.state.listCloseSignals.push(n), window.addEventListener(o, () => t(r, h), { signal: n.signal });
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
removeWatchers() {
|
|
28
28
|
if (this.state.isWatcher) {
|
|
29
29
|
for (let t = 0; t < this.state.listCloseSignals.length; t++) {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const s = this.state.listCloseSignals[t];
|
|
31
|
+
s == null || s.abort();
|
|
32
32
|
}
|
|
33
33
|
this.resetState();
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
f as InternetWatchers
|
|
39
39
|
};
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var a = (
|
|
4
|
-
import { NetworkInformationAbstract as
|
|
5
|
-
class
|
|
2
|
+
var d = (t, n, o) => n in t ? i(t, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[n] = o;
|
|
3
|
+
var a = (t, n, o) => (d(t, typeof n != "symbol" ? n + "" : n, o), o);
|
|
4
|
+
import { NetworkInformationAbstract as f } from "./types/types.abscruct.js";
|
|
5
|
+
class g extends f {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
a(this, "watchers", (
|
|
9
|
-
const s = (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
n(r, t);
|
|
8
|
+
a(this, "watchers", (o) => {
|
|
9
|
+
const s = (r) => {
|
|
10
|
+
const e = !["none", "unknown"].includes(r);
|
|
11
|
+
o(e, r);
|
|
13
12
|
};
|
|
14
13
|
if (navigator != null && navigator.connection && "getInfo" in (navigator == null ? void 0 : navigator.connection)) {
|
|
15
|
-
const
|
|
14
|
+
const r = () => {
|
|
16
15
|
var c;
|
|
17
16
|
return (c = navigator == null ? void 0 : navigator.connection) == null ? void 0 : c.type;
|
|
18
|
-
},
|
|
19
|
-
const c =
|
|
17
|
+
}, e = () => {
|
|
18
|
+
const c = r();
|
|
20
19
|
s(c);
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
e(), document.addEventListener("offline", e, !1), document.addEventListener("online", e, !1);
|
|
23
22
|
} else
|
|
24
23
|
console.error("Нету navigator.connection.getInfo");
|
|
25
24
|
});
|
|
@@ -32,5 +31,5 @@ class w extends d {
|
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
g as NetworkInformationCordova
|
|
36
35
|
};
|