@openc3/js-common 6.8.1 → 6.9.1
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.
- package/dist/services.cjs +11 -11
- package/dist/services.cjs.map +1 -1
- package/dist/services.js +966 -902
- package/dist/services.js.map +1 -1
- package/package.json +1 -1
package/dist/services.js
CHANGED
|
@@ -1,137 +1,137 @@
|
|
|
1
1
|
var rn = Object.defineProperty;
|
|
2
|
-
var on = (
|
|
3
|
-
var $ = (
|
|
4
|
-
function St(
|
|
2
|
+
var on = (s, e, t) => e in s ? rn(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var $ = (s, e, t) => on(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
function St(s, e) {
|
|
5
5
|
return function() {
|
|
6
|
-
return
|
|
6
|
+
return s.apply(e, arguments);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
const { toString: cn } = Object.prototype, { getPrototypeOf: qe } = Object, { iterator:
|
|
9
|
+
const { toString: cn } = Object.prototype, { getPrototypeOf: qe } = Object, { iterator: we, toStringTag: xt } = Symbol, Ee = /* @__PURE__ */ ((s) => (e) => {
|
|
10
10
|
const t = cn.call(e);
|
|
11
|
-
return
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)), D = (
|
|
13
|
-
function ie(
|
|
14
|
-
return
|
|
11
|
+
return s[t] || (s[t] = t.slice(8, -1).toLowerCase());
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), D = (s) => (s = s.toLowerCase(), (e) => Ee(e) === s), Se = (s) => (e) => typeof e === s, { isArray: ee } = Array, Y = Se("undefined");
|
|
13
|
+
function ie(s) {
|
|
14
|
+
return s !== null && !Y(s) && s.constructor !== null && !Y(s.constructor) && I(s.constructor.isBuffer) && s.constructor.isBuffer(s);
|
|
15
15
|
}
|
|
16
16
|
const At = D("ArrayBuffer");
|
|
17
|
-
function an(
|
|
17
|
+
function an(s) {
|
|
18
18
|
let e;
|
|
19
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(
|
|
19
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(s) : e = s && s.buffer && At(s.buffer), e;
|
|
20
20
|
}
|
|
21
|
-
const ln = Se("string"), I = Se("function"), Rt = Se("number"), oe = (
|
|
22
|
-
if (Ee(
|
|
21
|
+
const ln = Se("string"), I = Se("function"), Rt = Se("number"), oe = (s) => s !== null && typeof s == "object", un = (s) => s === !0 || s === !1, ge = (s) => {
|
|
22
|
+
if (Ee(s) !== "object")
|
|
23
23
|
return !1;
|
|
24
|
-
const e = qe(
|
|
25
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(xt in
|
|
26
|
-
}, hn = (
|
|
27
|
-
if (!oe(
|
|
24
|
+
const e = qe(s);
|
|
25
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(xt in s) && !(we in s);
|
|
26
|
+
}, hn = (s) => {
|
|
27
|
+
if (!oe(s) || ie(s))
|
|
28
28
|
return !1;
|
|
29
29
|
try {
|
|
30
|
-
return Object.keys(
|
|
30
|
+
return Object.keys(s).length === 0 && Object.getPrototypeOf(s) === Object.prototype;
|
|
31
31
|
} catch {
|
|
32
32
|
return !1;
|
|
33
33
|
}
|
|
34
|
-
}, dn = D("Date"), fn = D("File"), pn = D("Blob"), mn = D("FileList"), gn = (
|
|
34
|
+
}, dn = D("Date"), fn = D("File"), pn = D("Blob"), mn = D("FileList"), gn = (s) => oe(s) && I(s.pipe), bn = (s) => {
|
|
35
35
|
let e;
|
|
36
|
-
return
|
|
37
|
-
e === "object" && I(
|
|
38
|
-
}, yn = D("URLSearchParams"), [
|
|
39
|
-
function ce(
|
|
40
|
-
if (
|
|
36
|
+
return s && (typeof FormData == "function" && s instanceof FormData || I(s.append) && ((e = Ee(s)) === "formdata" || // detect form-data instance
|
|
37
|
+
e === "object" && I(s.toString) && s.toString() === "[object FormData]"));
|
|
38
|
+
}, yn = D("URLSearchParams"), [_n, wn, En, Sn] = ["ReadableStream", "Request", "Response", "Headers"].map(D), xn = (s) => s.trim ? s.trim() : s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
39
|
+
function ce(s, e, { allOwnKeys: t = !1 } = {}) {
|
|
40
|
+
if (s === null || typeof s > "u")
|
|
41
41
|
return;
|
|
42
|
-
let
|
|
43
|
-
if (typeof
|
|
44
|
-
for (
|
|
45
|
-
e.call(null, n
|
|
42
|
+
let n, r;
|
|
43
|
+
if (typeof s != "object" && (s = [s]), ee(s))
|
|
44
|
+
for (n = 0, r = s.length; n < r; n++)
|
|
45
|
+
e.call(null, s[n], n, s);
|
|
46
46
|
else {
|
|
47
|
-
if (ie(
|
|
47
|
+
if (ie(s))
|
|
48
48
|
return;
|
|
49
|
-
const i = t ? Object.getOwnPropertyNames(
|
|
49
|
+
const i = t ? Object.getOwnPropertyNames(s) : Object.keys(s), o = i.length;
|
|
50
50
|
let c;
|
|
51
|
-
for (
|
|
52
|
-
c = i[
|
|
51
|
+
for (n = 0; n < o; n++)
|
|
52
|
+
c = i[n], e.call(null, s[c], c, s);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function Ot(
|
|
56
|
-
if (ie(
|
|
55
|
+
function Ot(s, e) {
|
|
56
|
+
if (ie(s))
|
|
57
57
|
return null;
|
|
58
58
|
e = e.toLowerCase();
|
|
59
|
-
const t = Object.keys(
|
|
60
|
-
let
|
|
61
|
-
for (;
|
|
62
|
-
if (r = t[
|
|
59
|
+
const t = Object.keys(s);
|
|
60
|
+
let n = t.length, r;
|
|
61
|
+
for (; n-- > 0; )
|
|
62
|
+
if (r = t[n], e === r.toLowerCase())
|
|
63
63
|
return r;
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
const J = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ct = (
|
|
66
|
+
const J = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ct = (s) => !Y(s) && s !== J;
|
|
67
67
|
function Ie() {
|
|
68
|
-
const { caseless:
|
|
69
|
-
const o =
|
|
68
|
+
const { caseless: s, skipUndefined: e } = Ct(this) && this || {}, t = {}, n = (r, i) => {
|
|
69
|
+
const o = s && Ot(t, i) || i;
|
|
70
70
|
ge(t[o]) && ge(r) ? t[o] = Ie(t[o], r) : ge(r) ? t[o] = Ie({}, r) : ee(r) ? t[o] = r.slice() : (!e || !Y(r)) && (t[o] = r);
|
|
71
71
|
};
|
|
72
72
|
for (let r = 0, i = arguments.length; r < i; r++)
|
|
73
|
-
arguments[r] && ce(arguments[r],
|
|
73
|
+
arguments[r] && ce(arguments[r], n);
|
|
74
74
|
return t;
|
|
75
75
|
}
|
|
76
|
-
const An = (
|
|
77
|
-
t && I(r) ?
|
|
78
|
-
}, { allOwnKeys:
|
|
79
|
-
|
|
76
|
+
const An = (s, e, t, { allOwnKeys: n } = {}) => (ce(e, (r, i) => {
|
|
77
|
+
t && I(r) ? s[i] = St(r, t) : s[i] = r;
|
|
78
|
+
}, { allOwnKeys: n }), s), Rn = (s) => (s.charCodeAt(0) === 65279 && (s = s.slice(1)), s), On = (s, e, t, n) => {
|
|
79
|
+
s.prototype = Object.create(e.prototype, n), s.prototype.constructor = s, Object.defineProperty(s, "super", {
|
|
80
80
|
value: e.prototype
|
|
81
|
-
}), t && Object.assign(
|
|
82
|
-
}, Cn = (
|
|
81
|
+
}), t && Object.assign(s.prototype, t);
|
|
82
|
+
}, Cn = (s, e, t, n) => {
|
|
83
83
|
let r, i, o;
|
|
84
84
|
const c = {};
|
|
85
|
-
if (e = e || {},
|
|
85
|
+
if (e = e || {}, s == null) return e;
|
|
86
86
|
do {
|
|
87
|
-
for (r = Object.getOwnPropertyNames(
|
|
88
|
-
o = r[i], (!
|
|
89
|
-
|
|
90
|
-
} while (
|
|
87
|
+
for (r = Object.getOwnPropertyNames(s), i = r.length; i-- > 0; )
|
|
88
|
+
o = r[i], (!n || n(o, s, e)) && !c[o] && (e[o] = s[o], c[o] = !0);
|
|
89
|
+
s = t !== !1 && qe(s);
|
|
90
|
+
} while (s && (!t || t(s, e)) && s !== Object.prototype);
|
|
91
91
|
return e;
|
|
92
|
-
}, Tn = (
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
return
|
|
96
|
-
}, kn = (
|
|
97
|
-
if (!
|
|
98
|
-
if (ee(
|
|
99
|
-
let e =
|
|
92
|
+
}, Tn = (s, e, t) => {
|
|
93
|
+
s = String(s), (t === void 0 || t > s.length) && (t = s.length), t -= e.length;
|
|
94
|
+
const n = s.indexOf(e, t);
|
|
95
|
+
return n !== -1 && n === t;
|
|
96
|
+
}, kn = (s) => {
|
|
97
|
+
if (!s) return null;
|
|
98
|
+
if (ee(s)) return s;
|
|
99
|
+
let e = s.length;
|
|
100
100
|
if (!Rt(e)) return null;
|
|
101
101
|
const t = new Array(e);
|
|
102
102
|
for (; e-- > 0; )
|
|
103
|
-
t[e] =
|
|
103
|
+
t[e] = s[e];
|
|
104
104
|
return t;
|
|
105
|
-
}, Nn = /* @__PURE__ */ ((
|
|
106
|
-
const
|
|
105
|
+
}, Nn = /* @__PURE__ */ ((s) => (e) => s && e instanceof s)(typeof Uint8Array < "u" && qe(Uint8Array)), Pn = (s, e) => {
|
|
106
|
+
const n = (s && s[we]).call(s);
|
|
107
107
|
let r;
|
|
108
|
-
for (; (r =
|
|
108
|
+
for (; (r = n.next()) && !r.done; ) {
|
|
109
109
|
const i = r.value;
|
|
110
|
-
e.call(
|
|
110
|
+
e.call(s, i[0], i[1]);
|
|
111
111
|
}
|
|
112
|
-
}, In = (
|
|
112
|
+
}, In = (s, e) => {
|
|
113
113
|
let t;
|
|
114
|
-
const
|
|
115
|
-
for (; (t =
|
|
116
|
-
|
|
117
|
-
return
|
|
118
|
-
}, Ln = D("HTMLFormElement"), jn = (
|
|
114
|
+
const n = [];
|
|
115
|
+
for (; (t = s.exec(e)) !== null; )
|
|
116
|
+
n.push(t);
|
|
117
|
+
return n;
|
|
118
|
+
}, Ln = D("HTMLFormElement"), jn = (s) => s.toLowerCase().replace(
|
|
119
119
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
120
|
-
function(t,
|
|
121
|
-
return
|
|
120
|
+
function(t, n, r) {
|
|
121
|
+
return n.toUpperCase() + r;
|
|
122
122
|
}
|
|
123
|
-
), Ge = (({ hasOwnProperty:
|
|
124
|
-
const t = Object.getOwnPropertyDescriptors(
|
|
123
|
+
), Ge = (({ hasOwnProperty: s }) => (e, t) => s.call(e, t))(Object.prototype), Fn = D("RegExp"), Tt = (s, e) => {
|
|
124
|
+
const t = Object.getOwnPropertyDescriptors(s), n = {};
|
|
125
125
|
ce(t, (r, i) => {
|
|
126
126
|
let o;
|
|
127
|
-
(o = e(r, i,
|
|
128
|
-
}), Object.defineProperties(
|
|
129
|
-
}, vn = (
|
|
130
|
-
Tt(
|
|
131
|
-
if (I(
|
|
127
|
+
(o = e(r, i, s)) !== !1 && (n[i] = o || r);
|
|
128
|
+
}), Object.defineProperties(s, n);
|
|
129
|
+
}, vn = (s) => {
|
|
130
|
+
Tt(s, (e, t) => {
|
|
131
|
+
if (I(s) && ["arguments", "caller", "callee"].indexOf(t) !== -1)
|
|
132
132
|
return !1;
|
|
133
|
-
const
|
|
134
|
-
if (I(
|
|
133
|
+
const n = s[t];
|
|
134
|
+
if (I(n)) {
|
|
135
135
|
if (e.enumerable = !1, "writable" in e) {
|
|
136
136
|
e.writable = !1;
|
|
137
137
|
return;
|
|
@@ -141,45 +141,45 @@ const An = (n, e, t, { allOwnKeys: s } = {}) => (ce(e, (r, i) => {
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
|
-
}, $n = (
|
|
145
|
-
const t = {},
|
|
144
|
+
}, $n = (s, e) => {
|
|
145
|
+
const t = {}, n = (r) => {
|
|
146
146
|
r.forEach((i) => {
|
|
147
147
|
t[i] = !0;
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
|
-
return ee(
|
|
150
|
+
return ee(s) ? n(s) : n(String(s).split(e)), t;
|
|
151
151
|
}, Un = () => {
|
|
152
|
-
}, Dn = (
|
|
153
|
-
function qn(
|
|
154
|
-
return !!(
|
|
152
|
+
}, Dn = (s, e) => s != null && Number.isFinite(s = +s) ? s : e;
|
|
153
|
+
function qn(s) {
|
|
154
|
+
return !!(s && I(s.append) && s[xt] === "FormData" && s[we]);
|
|
155
155
|
}
|
|
156
|
-
const Bn = (
|
|
157
|
-
const e = new Array(10), t = (
|
|
158
|
-
if (oe(
|
|
159
|
-
if (e.indexOf(
|
|
156
|
+
const Bn = (s) => {
|
|
157
|
+
const e = new Array(10), t = (n, r) => {
|
|
158
|
+
if (oe(n)) {
|
|
159
|
+
if (e.indexOf(n) >= 0)
|
|
160
160
|
return;
|
|
161
|
-
if (ie(
|
|
162
|
-
return
|
|
163
|
-
if (!("toJSON" in
|
|
164
|
-
e[r] =
|
|
165
|
-
const i = ee(
|
|
166
|
-
return ce(
|
|
161
|
+
if (ie(n))
|
|
162
|
+
return n;
|
|
163
|
+
if (!("toJSON" in n)) {
|
|
164
|
+
e[r] = n;
|
|
165
|
+
const i = ee(n) ? [] : {};
|
|
166
|
+
return ce(n, (o, c) => {
|
|
167
167
|
const h = t(o, r + 1);
|
|
168
168
|
!Y(h) && (i[c] = h);
|
|
169
169
|
}), e[r] = void 0, i;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
return
|
|
172
|
+
return n;
|
|
173
173
|
};
|
|
174
|
-
return t(
|
|
175
|
-
}, Mn = D("AsyncFunction"), Hn = (
|
|
176
|
-
r === J && i === t &&
|
|
174
|
+
return t(s, 0);
|
|
175
|
+
}, Mn = D("AsyncFunction"), Hn = (s) => s && (oe(s) || I(s)) && I(s.then) && I(s.catch), kt = ((s, e) => s ? setImmediate : e ? ((t, n) => (J.addEventListener("message", ({ source: r, data: i }) => {
|
|
176
|
+
r === J && i === t && n.length && n.shift()();
|
|
177
177
|
}, !1), (r) => {
|
|
178
|
-
|
|
178
|
+
n.push(r), J.postMessage(t, "*");
|
|
179
179
|
}))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(
|
|
180
180
|
typeof setImmediate == "function",
|
|
181
181
|
I(J.postMessage)
|
|
182
|
-
), zn = typeof queueMicrotask < "u" ? queueMicrotask.bind(J) : typeof process < "u" && process.nextTick || kt, Vn = (
|
|
182
|
+
), zn = typeof queueMicrotask < "u" ? queueMicrotask.bind(J) : typeof process < "u" && process.nextTick || kt, Vn = (s) => s != null && I(s[we]), l = {
|
|
183
183
|
isArray: ee,
|
|
184
184
|
isArrayBuffer: At,
|
|
185
185
|
isBuffer: ie,
|
|
@@ -191,8 +191,8 @@ const Bn = (n) => {
|
|
|
191
191
|
isObject: oe,
|
|
192
192
|
isPlainObject: ge,
|
|
193
193
|
isEmptyObject: hn,
|
|
194
|
-
isReadableStream:
|
|
195
|
-
isRequest:
|
|
194
|
+
isReadableStream: _n,
|
|
195
|
+
isRequest: wn,
|
|
196
196
|
isResponse: En,
|
|
197
197
|
isHeaders: Sn,
|
|
198
198
|
isUndefined: Y,
|
|
@@ -239,10 +239,10 @@ const Bn = (n) => {
|
|
|
239
239
|
asap: zn,
|
|
240
240
|
isIterable: Vn
|
|
241
241
|
};
|
|
242
|
-
function
|
|
243
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message =
|
|
242
|
+
function _(s, e, t, n, r) {
|
|
243
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = s, this.name = "AxiosError", e && (this.code = e), t && (this.config = t), n && (this.request = n), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
244
244
|
}
|
|
245
|
-
l.inherits(
|
|
245
|
+
l.inherits(_, Error, {
|
|
246
246
|
toJSON: function() {
|
|
247
247
|
return {
|
|
248
248
|
// Standard
|
|
@@ -263,7 +263,7 @@ l.inherits(w, Error, {
|
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
|
-
const Nt =
|
|
266
|
+
const Nt = _.prototype, Pt = {};
|
|
267
267
|
[
|
|
268
268
|
"ERR_BAD_OPTION_VALUE",
|
|
269
269
|
"ERR_BAD_OPTION",
|
|
@@ -278,39 +278,39 @@ const Nt = w.prototype, Pt = {};
|
|
|
278
278
|
"ERR_NOT_SUPPORT",
|
|
279
279
|
"ERR_INVALID_URL"
|
|
280
280
|
// eslint-disable-next-line func-names
|
|
281
|
-
].forEach((
|
|
282
|
-
Pt[
|
|
281
|
+
].forEach((s) => {
|
|
282
|
+
Pt[s] = { value: s };
|
|
283
283
|
});
|
|
284
|
-
Object.defineProperties(
|
|
284
|
+
Object.defineProperties(_, Pt);
|
|
285
285
|
Object.defineProperty(Nt, "isAxiosError", { value: !0 });
|
|
286
|
-
|
|
286
|
+
_.from = (s, e, t, n, r, i) => {
|
|
287
287
|
const o = Object.create(Nt);
|
|
288
|
-
l.toFlatObject(
|
|
288
|
+
l.toFlatObject(s, o, function(a) {
|
|
289
289
|
return a !== Error.prototype;
|
|
290
290
|
}, (u) => u !== "isAxiosError");
|
|
291
|
-
const c =
|
|
292
|
-
return
|
|
291
|
+
const c = s && s.message ? s.message : "Error", h = e == null && s ? s.code : e;
|
|
292
|
+
return _.call(o, c, h, t, n, r), s && o.cause == null && Object.defineProperty(o, "cause", { value: s, configurable: !0 }), o.name = s && s.name || "Error", i && Object.assign(o, i), o;
|
|
293
293
|
};
|
|
294
294
|
const Jn = null;
|
|
295
|
-
function Le(
|
|
296
|
-
return l.isPlainObject(
|
|
295
|
+
function Le(s) {
|
|
296
|
+
return l.isPlainObject(s) || l.isArray(s);
|
|
297
297
|
}
|
|
298
|
-
function It(
|
|
299
|
-
return l.endsWith(
|
|
298
|
+
function It(s) {
|
|
299
|
+
return l.endsWith(s, "[]") ? s.slice(0, -2) : s;
|
|
300
300
|
}
|
|
301
|
-
function Qe(
|
|
302
|
-
return
|
|
301
|
+
function Qe(s, e, t) {
|
|
302
|
+
return s ? s.concat(e).map(function(r, i) {
|
|
303
303
|
return r = It(r), !t && i ? "[" + r + "]" : r;
|
|
304
304
|
}).join(t ? "." : "") : e;
|
|
305
305
|
}
|
|
306
|
-
function Wn(
|
|
307
|
-
return l.isArray(
|
|
306
|
+
function Wn(s) {
|
|
307
|
+
return l.isArray(s) && !s.some(Le);
|
|
308
308
|
}
|
|
309
309
|
const Kn = l.toFlatObject(l, {}, null, function(e) {
|
|
310
310
|
return /^is[A-Z]/.test(e);
|
|
311
311
|
});
|
|
312
|
-
function xe(
|
|
313
|
-
if (!l.isObject(
|
|
312
|
+
function xe(s, e, t) {
|
|
313
|
+
if (!l.isObject(s))
|
|
314
314
|
throw new TypeError("target must be an object");
|
|
315
315
|
e = e || new FormData(), t = l.toFlatObject(t, {
|
|
316
316
|
metaTokens: !0,
|
|
@@ -319,7 +319,7 @@ function xe(n, e, t) {
|
|
|
319
319
|
}, !1, function(m, p) {
|
|
320
320
|
return !l.isUndefined(p[m]);
|
|
321
321
|
});
|
|
322
|
-
const
|
|
322
|
+
const n = t.metaTokens, r = t.visitor || a, i = t.dots, o = t.indexes, h = (t.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(e);
|
|
323
323
|
if (!l.isFunction(r))
|
|
324
324
|
throw new TypeError("visitor must be a function");
|
|
325
325
|
function u(d) {
|
|
@@ -329,16 +329,16 @@ function xe(n, e, t) {
|
|
|
329
329
|
if (l.isBoolean(d))
|
|
330
330
|
return d.toString();
|
|
331
331
|
if (!h && l.isBlob(d))
|
|
332
|
-
throw new
|
|
332
|
+
throw new _("Blob is not supported. Use a Buffer instead.");
|
|
333
333
|
return l.isArrayBuffer(d) || l.isTypedArray(d) ? h && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
334
334
|
}
|
|
335
335
|
function a(d, m, p) {
|
|
336
|
-
let
|
|
336
|
+
let w = d;
|
|
337
337
|
if (d && !p && typeof d == "object") {
|
|
338
338
|
if (l.endsWith(m, "{}"))
|
|
339
|
-
m =
|
|
340
|
-
else if (l.isArray(d) && Wn(d) || (l.isFileList(d) || l.endsWith(m, "[]")) && (
|
|
341
|
-
return m = It(m),
|
|
339
|
+
m = n ? m : m.slice(0, -2), d = JSON.stringify(d);
|
|
340
|
+
else if (l.isArray(d) && Wn(d) || (l.isFileList(d) || l.endsWith(m, "[]")) && (w = l.toArray(d)))
|
|
341
|
+
return m = It(m), w.forEach(function(x, O) {
|
|
342
342
|
!(l.isUndefined(x) || x === null) && e.append(
|
|
343
343
|
// eslint-disable-next-line no-nested-ternary
|
|
344
344
|
o === !0 ? Qe([m], O, i) : o === null ? m : m + "[]",
|
|
@@ -357,22 +357,22 @@ function xe(n, e, t) {
|
|
|
357
357
|
if (!l.isUndefined(d)) {
|
|
358
358
|
if (f.indexOf(d) !== -1)
|
|
359
359
|
throw Error("Circular reference detected in " + m.join("."));
|
|
360
|
-
f.push(d), l.forEach(d, function(
|
|
361
|
-
(!(l.isUndefined(
|
|
360
|
+
f.push(d), l.forEach(d, function(w, S) {
|
|
361
|
+
(!(l.isUndefined(w) || w === null) && r.call(
|
|
362
362
|
e,
|
|
363
|
-
|
|
363
|
+
w,
|
|
364
364
|
l.isString(S) ? S.trim() : S,
|
|
365
365
|
m,
|
|
366
366
|
g
|
|
367
|
-
)) === !0 && b(
|
|
367
|
+
)) === !0 && b(w, m ? m.concat(S) : [S]);
|
|
368
368
|
}), f.pop();
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
if (!l.isObject(
|
|
371
|
+
if (!l.isObject(s))
|
|
372
372
|
throw new TypeError("data must be an object");
|
|
373
|
-
return b(
|
|
373
|
+
return b(s), e;
|
|
374
374
|
}
|
|
375
|
-
function Ze(
|
|
375
|
+
function Ze(s) {
|
|
376
376
|
const e = {
|
|
377
377
|
"!": "%21",
|
|
378
378
|
"'": "%27",
|
|
@@ -382,42 +382,42 @@ function Ze(n) {
|
|
|
382
382
|
"%20": "+",
|
|
383
383
|
"%00": "\0"
|
|
384
384
|
};
|
|
385
|
-
return encodeURIComponent(
|
|
386
|
-
return e[
|
|
385
|
+
return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g, function(n) {
|
|
386
|
+
return e[n];
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
|
-
function Be(
|
|
390
|
-
this._pairs = [],
|
|
389
|
+
function Be(s, e) {
|
|
390
|
+
this._pairs = [], s && xe(s, this, e);
|
|
391
391
|
}
|
|
392
392
|
const Lt = Be.prototype;
|
|
393
393
|
Lt.append = function(e, t) {
|
|
394
394
|
this._pairs.push([e, t]);
|
|
395
395
|
};
|
|
396
396
|
Lt.toString = function(e) {
|
|
397
|
-
const t = e ? function(
|
|
398
|
-
return e.call(this,
|
|
397
|
+
const t = e ? function(n) {
|
|
398
|
+
return e.call(this, n, Ze);
|
|
399
399
|
} : Ze;
|
|
400
400
|
return this._pairs.map(function(r) {
|
|
401
401
|
return t(r[0]) + "=" + t(r[1]);
|
|
402
402
|
}, "").join("&");
|
|
403
403
|
};
|
|
404
|
-
function Xn(
|
|
405
|
-
return encodeURIComponent(
|
|
404
|
+
function Xn(s) {
|
|
405
|
+
return encodeURIComponent(s).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
406
406
|
}
|
|
407
|
-
function jt(
|
|
407
|
+
function jt(s, e, t) {
|
|
408
408
|
if (!e)
|
|
409
|
-
return
|
|
410
|
-
const
|
|
409
|
+
return s;
|
|
410
|
+
const n = t && t.encode || Xn;
|
|
411
411
|
l.isFunction(t) && (t = {
|
|
412
412
|
serialize: t
|
|
413
413
|
});
|
|
414
414
|
const r = t && t.serialize;
|
|
415
415
|
let i;
|
|
416
|
-
if (r ? i = r(e, t) : i = l.isURLSearchParams(e) ? e.toString() : new Be(e, t).toString(
|
|
417
|
-
const o =
|
|
418
|
-
o !== -1 && (
|
|
416
|
+
if (r ? i = r(e, t) : i = l.isURLSearchParams(e) ? e.toString() : new Be(e, t).toString(n), i) {
|
|
417
|
+
const o = s.indexOf("#");
|
|
418
|
+
o !== -1 && (s = s.slice(0, o)), s += (s.indexOf("?") === -1 ? "?" : "&") + i;
|
|
419
419
|
}
|
|
420
|
-
return
|
|
420
|
+
return s;
|
|
421
421
|
}
|
|
422
422
|
class Ye {
|
|
423
423
|
constructor() {
|
|
@@ -431,12 +431,12 @@ class Ye {
|
|
|
431
431
|
*
|
|
432
432
|
* @return {Number} An ID used to remove interceptor later
|
|
433
433
|
*/
|
|
434
|
-
use(e, t,
|
|
434
|
+
use(e, t, n) {
|
|
435
435
|
return this.handlers.push({
|
|
436
436
|
fulfilled: e,
|
|
437
437
|
rejected: t,
|
|
438
|
-
synchronous:
|
|
439
|
-
runWhen:
|
|
438
|
+
synchronous: n ? n.synchronous : !1,
|
|
439
|
+
runWhen: n ? n.runWhen : null
|
|
440
440
|
}), this.handlers.length - 1;
|
|
441
441
|
}
|
|
442
442
|
/**
|
|
@@ -468,8 +468,8 @@ class Ye {
|
|
|
468
468
|
* @returns {void}
|
|
469
469
|
*/
|
|
470
470
|
forEach(e) {
|
|
471
|
-
l.forEach(this.handlers, function(
|
|
472
|
-
|
|
471
|
+
l.forEach(this.handlers, function(n) {
|
|
472
|
+
n !== null && e(n);
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
}
|
|
@@ -497,56 +497,56 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", ns
|
|
|
497
497
|
...ss,
|
|
498
498
|
...Yn
|
|
499
499
|
};
|
|
500
|
-
function rs(
|
|
501
|
-
return xe(
|
|
502
|
-
visitor: function(t,
|
|
503
|
-
return N.isNode && l.isBuffer(t) ? (this.append(
|
|
500
|
+
function rs(s, e) {
|
|
501
|
+
return xe(s, new N.classes.URLSearchParams(), {
|
|
502
|
+
visitor: function(t, n, r, i) {
|
|
503
|
+
return N.isNode && l.isBuffer(t) ? (this.append(n, t.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
504
504
|
},
|
|
505
505
|
...e
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
|
-
function is(
|
|
509
|
-
return l.matchAll(/\w+|\[(\w*)]/g,
|
|
508
|
+
function is(s) {
|
|
509
|
+
return l.matchAll(/\w+|\[(\w*)]/g, s).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
510
510
|
}
|
|
511
|
-
function os(
|
|
512
|
-
const e = {}, t = Object.keys(
|
|
513
|
-
let
|
|
511
|
+
function os(s) {
|
|
512
|
+
const e = {}, t = Object.keys(s);
|
|
513
|
+
let n;
|
|
514
514
|
const r = t.length;
|
|
515
515
|
let i;
|
|
516
|
-
for (
|
|
517
|
-
i = t[
|
|
516
|
+
for (n = 0; n < r; n++)
|
|
517
|
+
i = t[n], e[i] = s[i];
|
|
518
518
|
return e;
|
|
519
519
|
}
|
|
520
|
-
function vt(
|
|
521
|
-
function e(t,
|
|
520
|
+
function vt(s) {
|
|
521
|
+
function e(t, n, r, i) {
|
|
522
522
|
let o = t[i++];
|
|
523
523
|
if (o === "__proto__") return !0;
|
|
524
524
|
const c = Number.isFinite(+o), h = i >= t.length;
|
|
525
|
-
return o = !o && l.isArray(r) ? r.length : o, h ? (l.hasOwnProp(r, o) ? r[o] = [r[o],
|
|
525
|
+
return o = !o && l.isArray(r) ? r.length : o, h ? (l.hasOwnProp(r, o) ? r[o] = [r[o], n] : r[o] = n, !c) : ((!r[o] || !l.isObject(r[o])) && (r[o] = []), e(t, n, r[o], i) && l.isArray(r[o]) && (r[o] = os(r[o])), !c);
|
|
526
526
|
}
|
|
527
|
-
if (l.isFormData(
|
|
527
|
+
if (l.isFormData(s) && l.isFunction(s.entries)) {
|
|
528
528
|
const t = {};
|
|
529
|
-
return l.forEachEntry(
|
|
530
|
-
e(is(
|
|
529
|
+
return l.forEachEntry(s, (n, r) => {
|
|
530
|
+
e(is(n), r, t, 0);
|
|
531
531
|
}), t;
|
|
532
532
|
}
|
|
533
533
|
return null;
|
|
534
534
|
}
|
|
535
|
-
function cs(
|
|
536
|
-
if (l.isString(
|
|
535
|
+
function cs(s, e, t) {
|
|
536
|
+
if (l.isString(s))
|
|
537
537
|
try {
|
|
538
|
-
return (e || JSON.parse)(
|
|
539
|
-
} catch (
|
|
540
|
-
if (
|
|
541
|
-
throw
|
|
538
|
+
return (e || JSON.parse)(s), l.trim(s);
|
|
539
|
+
} catch (n) {
|
|
540
|
+
if (n.name !== "SyntaxError")
|
|
541
|
+
throw n;
|
|
542
542
|
}
|
|
543
|
-
return (t || JSON.stringify)(
|
|
543
|
+
return (t || JSON.stringify)(s);
|
|
544
544
|
}
|
|
545
545
|
const ae = {
|
|
546
546
|
transitional: Ft,
|
|
547
547
|
adapter: ["xhr", "http", "fetch"],
|
|
548
548
|
transformRequest: [function(e, t) {
|
|
549
|
-
const
|
|
549
|
+
const n = t.getContentType() || "", r = n.indexOf("application/json") > -1, i = l.isObject(e);
|
|
550
550
|
if (i && l.isHTMLForm(e) && (e = new FormData(e)), l.isFormData(e))
|
|
551
551
|
return r ? JSON.stringify(vt(e)) : e;
|
|
552
552
|
if (l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) || l.isReadableStream(e))
|
|
@@ -557,9 +557,9 @@ const ae = {
|
|
|
557
557
|
return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
558
558
|
let c;
|
|
559
559
|
if (i) {
|
|
560
|
-
if (
|
|
560
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
561
561
|
return rs(e, this.formSerializer).toString();
|
|
562
|
-
if ((c = l.isFileList(e)) ||
|
|
562
|
+
if ((c = l.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
563
563
|
const h = this.env && this.env.FormData;
|
|
564
564
|
return xe(
|
|
565
565
|
c ? { "files[]": e } : e,
|
|
@@ -571,16 +571,16 @@ const ae = {
|
|
|
571
571
|
return i || r ? (t.setContentType("application/json", !1), cs(e)) : e;
|
|
572
572
|
}],
|
|
573
573
|
transformResponse: [function(e) {
|
|
574
|
-
const t = this.transitional || ae.transitional,
|
|
574
|
+
const t = this.transitional || ae.transitional, n = t && t.forcedJSONParsing, r = this.responseType === "json";
|
|
575
575
|
if (l.isResponse(e) || l.isReadableStream(e))
|
|
576
576
|
return e;
|
|
577
|
-
if (e && l.isString(e) && (
|
|
577
|
+
if (e && l.isString(e) && (n && !this.responseType || r)) {
|
|
578
578
|
const o = !(t && t.silentJSONParsing) && r;
|
|
579
579
|
try {
|
|
580
580
|
return JSON.parse(e, this.parseReviver);
|
|
581
581
|
} catch (c) {
|
|
582
582
|
if (o)
|
|
583
|
-
throw c.name === "SyntaxError" ?
|
|
583
|
+
throw c.name === "SyntaxError" ? _.from(c, _.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
return e;
|
|
@@ -608,8 +608,8 @@ const ae = {
|
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
};
|
|
611
|
-
l.forEach(["delete", "get", "head", "post", "put", "patch"], (
|
|
612
|
-
ae.headers[
|
|
611
|
+
l.forEach(["delete", "get", "head", "post", "put", "patch"], (s) => {
|
|
612
|
+
ae.headers[s] = {};
|
|
613
613
|
});
|
|
614
614
|
const as = l.toObjectSet([
|
|
615
615
|
"age",
|
|
@@ -629,47 +629,47 @@ const as = l.toObjectSet([
|
|
|
629
629
|
"referer",
|
|
630
630
|
"retry-after",
|
|
631
631
|
"user-agent"
|
|
632
|
-
]), ls = (
|
|
632
|
+
]), ls = (s) => {
|
|
633
633
|
const e = {};
|
|
634
|
-
let t,
|
|
635
|
-
return
|
|
634
|
+
let t, n, r;
|
|
635
|
+
return s && s.split(`
|
|
636
636
|
`).forEach(function(o) {
|
|
637
|
-
r = o.indexOf(":"), t = o.substring(0, r).trim().toLowerCase(),
|
|
637
|
+
r = o.indexOf(":"), t = o.substring(0, r).trim().toLowerCase(), n = o.substring(r + 1).trim(), !(!t || e[t] && as[t]) && (t === "set-cookie" ? e[t] ? e[t].push(n) : e[t] = [n] : e[t] = e[t] ? e[t] + ", " + n : n);
|
|
638
638
|
}), e;
|
|
639
639
|
}, et = Symbol("internals");
|
|
640
|
-
function ne(
|
|
641
|
-
return
|
|
640
|
+
function ne(s) {
|
|
641
|
+
return s && String(s).trim().toLowerCase();
|
|
642
642
|
}
|
|
643
|
-
function be(
|
|
644
|
-
return
|
|
643
|
+
function be(s) {
|
|
644
|
+
return s === !1 || s == null ? s : l.isArray(s) ? s.map(be) : String(s);
|
|
645
645
|
}
|
|
646
|
-
function us(
|
|
646
|
+
function us(s) {
|
|
647
647
|
const e = /* @__PURE__ */ Object.create(null), t = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
648
|
-
let
|
|
649
|
-
for (;
|
|
650
|
-
e[
|
|
648
|
+
let n;
|
|
649
|
+
for (; n = t.exec(s); )
|
|
650
|
+
e[n[1]] = n[2];
|
|
651
651
|
return e;
|
|
652
652
|
}
|
|
653
|
-
const hs = (
|
|
654
|
-
function Te(
|
|
655
|
-
if (l.isFunction(
|
|
656
|
-
return
|
|
653
|
+
const hs = (s) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());
|
|
654
|
+
function Te(s, e, t, n, r) {
|
|
655
|
+
if (l.isFunction(n))
|
|
656
|
+
return n.call(this, e, t);
|
|
657
657
|
if (r && (e = t), !!l.isString(e)) {
|
|
658
|
-
if (l.isString(
|
|
659
|
-
return e.indexOf(
|
|
660
|
-
if (l.isRegExp(
|
|
661
|
-
return
|
|
658
|
+
if (l.isString(n))
|
|
659
|
+
return e.indexOf(n) !== -1;
|
|
660
|
+
if (l.isRegExp(n))
|
|
661
|
+
return n.test(e);
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
function ds(
|
|
665
|
-
return
|
|
664
|
+
function ds(s) {
|
|
665
|
+
return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, t, n) => t.toUpperCase() + n);
|
|
666
666
|
}
|
|
667
|
-
function fs(
|
|
667
|
+
function fs(s, e) {
|
|
668
668
|
const t = l.toCamelCase(" " + e);
|
|
669
|
-
["get", "set", "has"].forEach((
|
|
670
|
-
Object.defineProperty(
|
|
669
|
+
["get", "set", "has"].forEach((n) => {
|
|
670
|
+
Object.defineProperty(s, n + t, {
|
|
671
671
|
value: function(r, i, o) {
|
|
672
|
-
return this[
|
|
672
|
+
return this[n].call(this, e, r, i, o);
|
|
673
673
|
},
|
|
674
674
|
configurable: !0
|
|
675
675
|
});
|
|
@@ -679,7 +679,7 @@ let L = class {
|
|
|
679
679
|
constructor(e) {
|
|
680
680
|
e && this.set(e);
|
|
681
681
|
}
|
|
682
|
-
set(e, t,
|
|
682
|
+
set(e, t, n) {
|
|
683
683
|
const r = this;
|
|
684
684
|
function i(c, h, u) {
|
|
685
685
|
const a = ne(h);
|
|
@@ -702,20 +702,20 @@ let L = class {
|
|
|
702
702
|
}
|
|
703
703
|
o(c, t);
|
|
704
704
|
} else
|
|
705
|
-
e != null && i(t, e,
|
|
705
|
+
e != null && i(t, e, n);
|
|
706
706
|
return this;
|
|
707
707
|
}
|
|
708
708
|
get(e, t) {
|
|
709
709
|
if (e = ne(e), e) {
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
712
|
-
const r = this[
|
|
710
|
+
const n = l.findKey(this, e);
|
|
711
|
+
if (n) {
|
|
712
|
+
const r = this[n];
|
|
713
713
|
if (!t)
|
|
714
714
|
return r;
|
|
715
715
|
if (t === !0)
|
|
716
716
|
return us(r);
|
|
717
717
|
if (l.isFunction(t))
|
|
718
|
-
return t.call(this, r,
|
|
718
|
+
return t.call(this, r, n);
|
|
719
719
|
if (l.isRegExp(t))
|
|
720
720
|
return t.exec(r);
|
|
721
721
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
@@ -724,41 +724,41 @@ let L = class {
|
|
|
724
724
|
}
|
|
725
725
|
has(e, t) {
|
|
726
726
|
if (e = ne(e), e) {
|
|
727
|
-
const
|
|
728
|
-
return !!(
|
|
727
|
+
const n = l.findKey(this, e);
|
|
728
|
+
return !!(n && this[n] !== void 0 && (!t || Te(this, this[n], n, t)));
|
|
729
729
|
}
|
|
730
730
|
return !1;
|
|
731
731
|
}
|
|
732
732
|
delete(e, t) {
|
|
733
|
-
const
|
|
733
|
+
const n = this;
|
|
734
734
|
let r = !1;
|
|
735
735
|
function i(o) {
|
|
736
736
|
if (o = ne(o), o) {
|
|
737
|
-
const c = l.findKey(
|
|
738
|
-
c && (!t || Te(
|
|
737
|
+
const c = l.findKey(n, o);
|
|
738
|
+
c && (!t || Te(n, n[c], c, t)) && (delete n[c], r = !0);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
return l.isArray(e) ? e.forEach(i) : i(e), r;
|
|
742
742
|
}
|
|
743
743
|
clear(e) {
|
|
744
744
|
const t = Object.keys(this);
|
|
745
|
-
let
|
|
746
|
-
for (;
|
|
747
|
-
const i = t[
|
|
745
|
+
let n = t.length, r = !1;
|
|
746
|
+
for (; n--; ) {
|
|
747
|
+
const i = t[n];
|
|
748
748
|
(!e || Te(this, this[i], i, e, !0)) && (delete this[i], r = !0);
|
|
749
749
|
}
|
|
750
750
|
return r;
|
|
751
751
|
}
|
|
752
752
|
normalize(e) {
|
|
753
|
-
const t = this,
|
|
753
|
+
const t = this, n = {};
|
|
754
754
|
return l.forEach(this, (r, i) => {
|
|
755
|
-
const o = l.findKey(
|
|
755
|
+
const o = l.findKey(n, i);
|
|
756
756
|
if (o) {
|
|
757
757
|
t[o] = be(r), delete t[i];
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
760
|
const c = e ? ds(i) : String(i).trim();
|
|
761
|
-
c !== i && delete t[i], t[c] = be(r),
|
|
761
|
+
c !== i && delete t[i], t[c] = be(r), n[c] = !0;
|
|
762
762
|
}), this;
|
|
763
763
|
}
|
|
764
764
|
concat(...e) {
|
|
@@ -766,8 +766,8 @@ let L = class {
|
|
|
766
766
|
}
|
|
767
767
|
toJSON(e) {
|
|
768
768
|
const t = /* @__PURE__ */ Object.create(null);
|
|
769
|
-
return l.forEach(this, (
|
|
770
|
-
|
|
769
|
+
return l.forEach(this, (n, r) => {
|
|
770
|
+
n != null && n !== !1 && (t[r] = e && l.isArray(n) ? n.join(", ") : n);
|
|
771
771
|
}), t;
|
|
772
772
|
}
|
|
773
773
|
[Symbol.iterator]() {
|
|
@@ -787,95 +787,95 @@ let L = class {
|
|
|
787
787
|
return e instanceof this ? e : new this(e);
|
|
788
788
|
}
|
|
789
789
|
static concat(e, ...t) {
|
|
790
|
-
const
|
|
791
|
-
return t.forEach((r) =>
|
|
790
|
+
const n = new this(e);
|
|
791
|
+
return t.forEach((r) => n.set(r)), n;
|
|
792
792
|
}
|
|
793
793
|
static accessor(e) {
|
|
794
|
-
const
|
|
794
|
+
const n = (this[et] = this[et] = {
|
|
795
795
|
accessors: {}
|
|
796
796
|
}).accessors, r = this.prototype;
|
|
797
797
|
function i(o) {
|
|
798
798
|
const c = ne(o);
|
|
799
|
-
|
|
799
|
+
n[c] || (fs(r, o), n[c] = !0);
|
|
800
800
|
}
|
|
801
801
|
return l.isArray(e) ? e.forEach(i) : i(e), this;
|
|
802
802
|
}
|
|
803
803
|
};
|
|
804
804
|
L.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
805
|
-
l.reduceDescriptors(L.prototype, ({ value:
|
|
805
|
+
l.reduceDescriptors(L.prototype, ({ value: s }, e) => {
|
|
806
806
|
let t = e[0].toUpperCase() + e.slice(1);
|
|
807
807
|
return {
|
|
808
|
-
get: () =>
|
|
809
|
-
set(
|
|
810
|
-
this[t] =
|
|
808
|
+
get: () => s,
|
|
809
|
+
set(n) {
|
|
810
|
+
this[t] = n;
|
|
811
811
|
}
|
|
812
812
|
};
|
|
813
813
|
});
|
|
814
814
|
l.freezeMethods(L);
|
|
815
|
-
function ke(
|
|
816
|
-
const t = this || ae,
|
|
817
|
-
let i =
|
|
818
|
-
return l.forEach(
|
|
815
|
+
function ke(s, e) {
|
|
816
|
+
const t = this || ae, n = e || t, r = L.from(n.headers);
|
|
817
|
+
let i = n.data;
|
|
818
|
+
return l.forEach(s, function(c) {
|
|
819
819
|
i = c.call(t, i, r.normalize(), e ? e.status : void 0);
|
|
820
820
|
}), r.normalize(), i;
|
|
821
821
|
}
|
|
822
|
-
function $t(
|
|
823
|
-
return !!(
|
|
822
|
+
function $t(s) {
|
|
823
|
+
return !!(s && s.__CANCEL__);
|
|
824
824
|
}
|
|
825
|
-
function te(
|
|
826
|
-
|
|
825
|
+
function te(s, e, t) {
|
|
826
|
+
_.call(this, s ?? "canceled", _.ERR_CANCELED, e, t), this.name = "CanceledError";
|
|
827
827
|
}
|
|
828
|
-
l.inherits(te,
|
|
828
|
+
l.inherits(te, _, {
|
|
829
829
|
__CANCEL__: !0
|
|
830
830
|
});
|
|
831
|
-
function Ut(
|
|
832
|
-
const
|
|
833
|
-
!t.status || !
|
|
831
|
+
function Ut(s, e, t) {
|
|
832
|
+
const n = t.config.validateStatus;
|
|
833
|
+
!t.status || !n || n(t.status) ? s(t) : e(new _(
|
|
834
834
|
"Request failed with status code " + t.status,
|
|
835
|
-
[
|
|
835
|
+
[_.ERR_BAD_REQUEST, _.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
|
|
836
836
|
t.config,
|
|
837
837
|
t.request,
|
|
838
838
|
t
|
|
839
839
|
));
|
|
840
840
|
}
|
|
841
|
-
function ps(
|
|
842
|
-
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(
|
|
841
|
+
function ps(s) {
|
|
842
|
+
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(s);
|
|
843
843
|
return e && e[1] || "";
|
|
844
844
|
}
|
|
845
|
-
function ms(
|
|
846
|
-
|
|
847
|
-
const t = new Array(
|
|
845
|
+
function ms(s, e) {
|
|
846
|
+
s = s || 10;
|
|
847
|
+
const t = new Array(s), n = new Array(s);
|
|
848
848
|
let r = 0, i = 0, o;
|
|
849
849
|
return e = e !== void 0 ? e : 1e3, function(h) {
|
|
850
|
-
const u = Date.now(), a =
|
|
851
|
-
o || (o = u), t[r] = h,
|
|
850
|
+
const u = Date.now(), a = n[i];
|
|
851
|
+
o || (o = u), t[r] = h, n[r] = u;
|
|
852
852
|
let f = i, g = 0;
|
|
853
853
|
for (; f !== r; )
|
|
854
|
-
g += t[f++], f = f %
|
|
855
|
-
if (r = (r + 1) %
|
|
854
|
+
g += t[f++], f = f % s;
|
|
855
|
+
if (r = (r + 1) % s, r === i && (i = (i + 1) % s), u - o < e)
|
|
856
856
|
return;
|
|
857
857
|
const b = a && u - a;
|
|
858
858
|
return b ? Math.round(g * 1e3 / b) : void 0;
|
|
859
859
|
};
|
|
860
860
|
}
|
|
861
|
-
function gs(
|
|
862
|
-
let t = 0,
|
|
861
|
+
function gs(s, e) {
|
|
862
|
+
let t = 0, n = 1e3 / e, r, i;
|
|
863
863
|
const o = (u, a = Date.now()) => {
|
|
864
|
-
t = a, r = null, i && (clearTimeout(i), i = null),
|
|
864
|
+
t = a, r = null, i && (clearTimeout(i), i = null), s(...u);
|
|
865
865
|
};
|
|
866
866
|
return [(...u) => {
|
|
867
867
|
const a = Date.now(), f = a - t;
|
|
868
|
-
f >=
|
|
868
|
+
f >= n ? o(u, a) : (r = u, i || (i = setTimeout(() => {
|
|
869
869
|
i = null, o(r);
|
|
870
|
-
},
|
|
870
|
+
}, n - f)));
|
|
871
871
|
}, () => r && o(r)];
|
|
872
872
|
}
|
|
873
|
-
const
|
|
874
|
-
let
|
|
873
|
+
const _e = (s, e, t = 3) => {
|
|
874
|
+
let n = 0;
|
|
875
875
|
const r = ms(50, 250);
|
|
876
876
|
return gs((i) => {
|
|
877
|
-
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, h = o -
|
|
878
|
-
|
|
877
|
+
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, h = o - n, u = r(h), a = o <= c;
|
|
878
|
+
n = o;
|
|
879
879
|
const f = {
|
|
880
880
|
loaded: o,
|
|
881
881
|
total: c,
|
|
@@ -887,31 +887,31 @@ const we = (n, e, t = 3) => {
|
|
|
887
887
|
lengthComputable: c != null,
|
|
888
888
|
[e ? "download" : "upload"]: !0
|
|
889
889
|
};
|
|
890
|
-
|
|
890
|
+
s(f);
|
|
891
891
|
}, t);
|
|
892
|
-
}, tt = (
|
|
893
|
-
const t =
|
|
894
|
-
return [(
|
|
892
|
+
}, tt = (s, e) => {
|
|
893
|
+
const t = s != null;
|
|
894
|
+
return [(n) => e[0]({
|
|
895
895
|
lengthComputable: t,
|
|
896
|
-
total:
|
|
897
|
-
loaded:
|
|
896
|
+
total: s,
|
|
897
|
+
loaded: n
|
|
898
898
|
}), e[1]];
|
|
899
|
-
}, nt = (
|
|
899
|
+
}, nt = (s) => (...e) => l.asap(() => s(...e)), bs = N.hasStandardBrowserEnv ? /* @__PURE__ */ ((s, e) => (t) => (t = new URL(t, N.origin), s.protocol === t.protocol && s.host === t.host && (e || s.port === t.port)))(
|
|
900
900
|
new URL(N.origin),
|
|
901
901
|
N.navigator && /(msie|trident)/i.test(N.navigator.userAgent)
|
|
902
902
|
) : () => !0, ys = N.hasStandardBrowserEnv ? (
|
|
903
903
|
// Standard browser envs support document.cookie
|
|
904
904
|
{
|
|
905
|
-
write(
|
|
906
|
-
const o = [
|
|
907
|
-
l.isNumber(t) && o.push("expires=" + new Date(t).toGMTString()), l.isString(
|
|
905
|
+
write(s, e, t, n, r, i) {
|
|
906
|
+
const o = [s + "=" + encodeURIComponent(e)];
|
|
907
|
+
l.isNumber(t) && o.push("expires=" + new Date(t).toGMTString()), l.isString(n) && o.push("path=" + n), l.isString(r) && o.push("domain=" + r), i === !0 && o.push("secure"), document.cookie = o.join("; ");
|
|
908
908
|
},
|
|
909
|
-
read(
|
|
910
|
-
const e = document.cookie.match(new RegExp("(^|;\\s*)(" +
|
|
909
|
+
read(s) {
|
|
910
|
+
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + s + ")=([^;]*)"));
|
|
911
911
|
return e ? decodeURIComponent(e[3]) : null;
|
|
912
912
|
},
|
|
913
|
-
remove(
|
|
914
|
-
this.write(
|
|
913
|
+
remove(s) {
|
|
914
|
+
this.write(s, "", Date.now() - 864e5);
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
) : (
|
|
@@ -926,44 +926,44 @@ const we = (n, e, t = 3) => {
|
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
);
|
|
929
|
-
function
|
|
930
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(
|
|
929
|
+
function _s(s) {
|
|
930
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
933
|
-
return e ?
|
|
932
|
+
function ws(s, e) {
|
|
933
|
+
return e ? s.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : s;
|
|
934
934
|
}
|
|
935
|
-
function Dt(
|
|
936
|
-
let
|
|
937
|
-
return
|
|
935
|
+
function Dt(s, e, t) {
|
|
936
|
+
let n = !_s(e);
|
|
937
|
+
return s && (n || t == !1) ? ws(s, e) : e;
|
|
938
938
|
}
|
|
939
|
-
const st = (
|
|
940
|
-
function K(
|
|
939
|
+
const st = (s) => s instanceof L ? { ...s } : s;
|
|
940
|
+
function K(s, e) {
|
|
941
941
|
e = e || {};
|
|
942
942
|
const t = {};
|
|
943
|
-
function
|
|
943
|
+
function n(u, a, f, g) {
|
|
944
944
|
return l.isPlainObject(u) && l.isPlainObject(a) ? l.merge.call({ caseless: g }, u, a) : l.isPlainObject(a) ? l.merge({}, a) : l.isArray(a) ? a.slice() : a;
|
|
945
945
|
}
|
|
946
946
|
function r(u, a, f, g) {
|
|
947
947
|
if (l.isUndefined(a)) {
|
|
948
948
|
if (!l.isUndefined(u))
|
|
949
|
-
return
|
|
950
|
-
} else return
|
|
949
|
+
return n(void 0, u, f, g);
|
|
950
|
+
} else return n(u, a, f, g);
|
|
951
951
|
}
|
|
952
952
|
function i(u, a) {
|
|
953
953
|
if (!l.isUndefined(a))
|
|
954
|
-
return
|
|
954
|
+
return n(void 0, a);
|
|
955
955
|
}
|
|
956
956
|
function o(u, a) {
|
|
957
957
|
if (l.isUndefined(a)) {
|
|
958
958
|
if (!l.isUndefined(u))
|
|
959
|
-
return
|
|
960
|
-
} else return
|
|
959
|
+
return n(void 0, u);
|
|
960
|
+
} else return n(void 0, a);
|
|
961
961
|
}
|
|
962
962
|
function c(u, a, f) {
|
|
963
963
|
if (f in e)
|
|
964
|
-
return
|
|
965
|
-
if (f in
|
|
966
|
-
return
|
|
964
|
+
return n(u, a);
|
|
965
|
+
if (f in s)
|
|
966
|
+
return n(void 0, u);
|
|
967
967
|
}
|
|
968
968
|
const h = {
|
|
969
969
|
url: i,
|
|
@@ -996,15 +996,15 @@ function K(n, e) {
|
|
|
996
996
|
validateStatus: c,
|
|
997
997
|
headers: (u, a, f) => r(st(u), st(a), f, !0)
|
|
998
998
|
};
|
|
999
|
-
return l.forEach(Object.keys({ ...
|
|
1000
|
-
const f = h[a] || r, g = f(
|
|
999
|
+
return l.forEach(Object.keys({ ...s, ...e }), function(a) {
|
|
1000
|
+
const f = h[a] || r, g = f(s[a], e[a], a);
|
|
1001
1001
|
l.isUndefined(g) && f !== c || (t[a] = g);
|
|
1002
1002
|
}), t;
|
|
1003
1003
|
}
|
|
1004
|
-
const qt = (
|
|
1005
|
-
const e = K({},
|
|
1006
|
-
let { data: t, withXSRFToken:
|
|
1007
|
-
if (e.headers = o = L.from(o), e.url = jt(Dt(e.baseURL, e.url, e.allowAbsoluteUrls),
|
|
1004
|
+
const qt = (s) => {
|
|
1005
|
+
const e = K({}, s);
|
|
1006
|
+
let { data: t, withXSRFToken: n, xsrfHeaderName: r, xsrfCookieName: i, headers: o, auth: c } = e;
|
|
1007
|
+
if (e.headers = o = L.from(o), e.url = jt(Dt(e.baseURL, e.url, e.allowAbsoluteUrls), s.params, s.paramsSerializer), c && o.set(
|
|
1008
1008
|
"Authorization",
|
|
1009
1009
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1010
1010
|
), l.isFormData(t)) {
|
|
@@ -1017,14 +1017,14 @@ const qt = (n) => {
|
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
if (N.hasStandardBrowserEnv && (
|
|
1020
|
+
if (N.hasStandardBrowserEnv && (n && l.isFunction(n) && (n = n(e)), n || n !== !1 && bs(e.url))) {
|
|
1021
1021
|
const h = r && i && ys.read(i);
|
|
1022
1022
|
h && o.set(r, h);
|
|
1023
1023
|
}
|
|
1024
1024
|
return e;
|
|
1025
|
-
}, Es = typeof XMLHttpRequest < "u", Ss = Es && function(
|
|
1026
|
-
return new Promise(function(t,
|
|
1027
|
-
const r = qt(
|
|
1025
|
+
}, Es = typeof XMLHttpRequest < "u", Ss = Es && function(s) {
|
|
1026
|
+
return new Promise(function(t, n) {
|
|
1027
|
+
const r = qt(s);
|
|
1028
1028
|
let i = r.data;
|
|
1029
1029
|
const o = L.from(r.headers).normalize();
|
|
1030
1030
|
let { responseType: c, onUploadProgress: h, onDownloadProgress: u } = r, a, f, g, b, d;
|
|
@@ -1033,7 +1033,7 @@ const qt = (n) => {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
let p = new XMLHttpRequest();
|
|
1035
1035
|
p.open(r.method.toUpperCase(), r.url, !0), p.timeout = r.timeout;
|
|
1036
|
-
function
|
|
1036
|
+
function w() {
|
|
1037
1037
|
if (!p)
|
|
1038
1038
|
return;
|
|
1039
1039
|
const x = L.from(
|
|
@@ -1043,98 +1043,98 @@ const qt = (n) => {
|
|
|
1043
1043
|
status: p.status,
|
|
1044
1044
|
statusText: p.statusText,
|
|
1045
1045
|
headers: x,
|
|
1046
|
-
config:
|
|
1046
|
+
config: s,
|
|
1047
1047
|
request: p
|
|
1048
1048
|
};
|
|
1049
1049
|
Ut(function(T) {
|
|
1050
1050
|
t(T), m();
|
|
1051
1051
|
}, function(T) {
|
|
1052
|
-
|
|
1052
|
+
n(T), m();
|
|
1053
1053
|
}, C), p = null;
|
|
1054
1054
|
}
|
|
1055
|
-
"onloadend" in p ? p.onloadend =
|
|
1056
|
-
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1055
|
+
"onloadend" in p ? p.onloadend = w : p.onreadystatechange = function() {
|
|
1056
|
+
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
1057
1057
|
}, p.onabort = function() {
|
|
1058
|
-
p && (
|
|
1058
|
+
p && (n(new _("Request aborted", _.ECONNABORTED, s, p)), p = null);
|
|
1059
1059
|
}, p.onerror = function(O) {
|
|
1060
|
-
const C = O && O.message ? O.message : "Network Error", F = new
|
|
1061
|
-
F.event = O || null,
|
|
1060
|
+
const C = O && O.message ? O.message : "Network Error", F = new _(C, _.ERR_NETWORK, s, p);
|
|
1061
|
+
F.event = O || null, n(F), p = null;
|
|
1062
1062
|
}, p.ontimeout = function() {
|
|
1063
1063
|
let O = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1064
1064
|
const C = r.transitional || Ft;
|
|
1065
|
-
r.timeoutErrorMessage && (O = r.timeoutErrorMessage),
|
|
1065
|
+
r.timeoutErrorMessage && (O = r.timeoutErrorMessage), n(new _(
|
|
1066
1066
|
O,
|
|
1067
|
-
C.clarifyTimeoutError ?
|
|
1068
|
-
|
|
1067
|
+
C.clarifyTimeoutError ? _.ETIMEDOUT : _.ECONNABORTED,
|
|
1068
|
+
s,
|
|
1069
1069
|
p
|
|
1070
1070
|
)), p = null;
|
|
1071
1071
|
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && l.forEach(o.toJSON(), function(O, C) {
|
|
1072
1072
|
p.setRequestHeader(C, O);
|
|
1073
|
-
}), l.isUndefined(r.withCredentials) || (p.withCredentials = !!r.withCredentials), c && c !== "json" && (p.responseType = r.responseType), u && ([g, d] =
|
|
1074
|
-
p && (
|
|
1073
|
+
}), l.isUndefined(r.withCredentials) || (p.withCredentials = !!r.withCredentials), c && c !== "json" && (p.responseType = r.responseType), u && ([g, d] = _e(u, !0), p.addEventListener("progress", g)), h && p.upload && ([f, b] = _e(h), p.upload.addEventListener("progress", f), p.upload.addEventListener("loadend", b)), (r.cancelToken || r.signal) && (a = (x) => {
|
|
1074
|
+
p && (n(!x || x.type ? new te(null, s, p) : x), p.abort(), p = null);
|
|
1075
1075
|
}, r.cancelToken && r.cancelToken.subscribe(a), r.signal && (r.signal.aborted ? a() : r.signal.addEventListener("abort", a)));
|
|
1076
1076
|
const S = ps(r.url);
|
|
1077
1077
|
if (S && N.protocols.indexOf(S) === -1) {
|
|
1078
|
-
|
|
1078
|
+
n(new _("Unsupported protocol " + S + ":", _.ERR_BAD_REQUEST, s));
|
|
1079
1079
|
return;
|
|
1080
1080
|
}
|
|
1081
1081
|
p.send(i || null);
|
|
1082
1082
|
});
|
|
1083
|
-
}, xs = (
|
|
1084
|
-
const { length: t } =
|
|
1083
|
+
}, xs = (s, e) => {
|
|
1084
|
+
const { length: t } = s = s ? s.filter(Boolean) : [];
|
|
1085
1085
|
if (e || t) {
|
|
1086
|
-
let
|
|
1086
|
+
let n = new AbortController(), r;
|
|
1087
1087
|
const i = function(u) {
|
|
1088
1088
|
if (!r) {
|
|
1089
1089
|
r = !0, c();
|
|
1090
1090
|
const a = u instanceof Error ? u : this.reason;
|
|
1091
|
-
|
|
1091
|
+
n.abort(a instanceof _ ? a : new te(a instanceof Error ? a.message : a));
|
|
1092
1092
|
}
|
|
1093
1093
|
};
|
|
1094
1094
|
let o = e && setTimeout(() => {
|
|
1095
|
-
o = null, i(new
|
|
1095
|
+
o = null, i(new _(`timeout ${e} of ms exceeded`, _.ETIMEDOUT));
|
|
1096
1096
|
}, e);
|
|
1097
1097
|
const c = () => {
|
|
1098
|
-
|
|
1098
|
+
s && (o && clearTimeout(o), o = null, s.forEach((u) => {
|
|
1099
1099
|
u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
|
|
1100
|
-
}),
|
|
1100
|
+
}), s = null);
|
|
1101
1101
|
};
|
|
1102
|
-
|
|
1103
|
-
const { signal: h } =
|
|
1102
|
+
s.forEach((u) => u.addEventListener("abort", i));
|
|
1103
|
+
const { signal: h } = n;
|
|
1104
1104
|
return h.unsubscribe = () => l.asap(c), h;
|
|
1105
1105
|
}
|
|
1106
|
-
}, As = function* (
|
|
1107
|
-
let t =
|
|
1106
|
+
}, As = function* (s, e) {
|
|
1107
|
+
let t = s.byteLength;
|
|
1108
1108
|
if (t < e) {
|
|
1109
|
-
yield
|
|
1109
|
+
yield s;
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
1112
|
-
let
|
|
1113
|
-
for (;
|
|
1114
|
-
r =
|
|
1115
|
-
}, Rs = async function* (
|
|
1116
|
-
for await (const t of Os(
|
|
1112
|
+
let n = 0, r;
|
|
1113
|
+
for (; n < t; )
|
|
1114
|
+
r = n + e, yield s.slice(n, r), n = r;
|
|
1115
|
+
}, Rs = async function* (s, e) {
|
|
1116
|
+
for await (const t of Os(s))
|
|
1117
1117
|
yield* As(t, e);
|
|
1118
|
-
}, Os = async function* (
|
|
1119
|
-
if (
|
|
1120
|
-
yield*
|
|
1118
|
+
}, Os = async function* (s) {
|
|
1119
|
+
if (s[Symbol.asyncIterator]) {
|
|
1120
|
+
yield* s;
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
|
-
const e =
|
|
1123
|
+
const e = s.getReader();
|
|
1124
1124
|
try {
|
|
1125
1125
|
for (; ; ) {
|
|
1126
|
-
const { done: t, value:
|
|
1126
|
+
const { done: t, value: n } = await e.read();
|
|
1127
1127
|
if (t)
|
|
1128
1128
|
break;
|
|
1129
|
-
yield
|
|
1129
|
+
yield n;
|
|
1130
1130
|
}
|
|
1131
1131
|
} finally {
|
|
1132
1132
|
await e.cancel();
|
|
1133
1133
|
}
|
|
1134
|
-
}, rt = (
|
|
1135
|
-
const r = Rs(
|
|
1134
|
+
}, rt = (s, e, t, n) => {
|
|
1135
|
+
const r = Rs(s, e);
|
|
1136
1136
|
let i = 0, o, c = (h) => {
|
|
1137
|
-
o || (o = !0,
|
|
1137
|
+
o || (o = !0, n && n(h));
|
|
1138
1138
|
};
|
|
1139
1139
|
return new ReadableStream({
|
|
1140
1140
|
async pull(h) {
|
|
@@ -1160,21 +1160,21 @@ const qt = (n) => {
|
|
|
1160
1160
|
}, {
|
|
1161
1161
|
highWaterMark: 2
|
|
1162
1162
|
});
|
|
1163
|
-
}, it = 64 * 1024, { isFunction: de } = l, Bt = (({ fetch:
|
|
1164
|
-
fetch:
|
|
1163
|
+
}, it = 64 * 1024, { isFunction: de } = l, Bt = (({ fetch: s, Request: e, Response: t }) => ({
|
|
1164
|
+
fetch: s,
|
|
1165
1165
|
Request: e,
|
|
1166
1166
|
Response: t
|
|
1167
1167
|
}))(l.global), {
|
|
1168
1168
|
ReadableStream: ot,
|
|
1169
1169
|
TextEncoder: ct
|
|
1170
|
-
} = l.global, at = (
|
|
1170
|
+
} = l.global, at = (s, ...e) => {
|
|
1171
1171
|
try {
|
|
1172
|
-
return !!
|
|
1172
|
+
return !!s(...e);
|
|
1173
1173
|
} catch {
|
|
1174
1174
|
return !1;
|
|
1175
1175
|
}
|
|
1176
|
-
}, Cs = (
|
|
1177
|
-
const { fetch: e, Request: t, Response:
|
|
1176
|
+
}, Cs = (s) => {
|
|
1177
|
+
const { fetch: e, Request: t, Response: n } = Object.assign({}, Bt, s), r = de(e), i = de(t), o = de(n);
|
|
1178
1178
|
if (!r)
|
|
1179
1179
|
return !1;
|
|
1180
1180
|
const c = r && de(ot), h = r && (typeof ct == "function" ? /* @__PURE__ */ ((d) => (m) => d.encode(m))(new ct()) : async (d) => new Uint8Array(await new t(d).arrayBuffer())), u = i && c && at(() => {
|
|
@@ -1187,15 +1187,15 @@ const qt = (n) => {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
}).headers.has("Content-Type");
|
|
1189
1189
|
return d && !m;
|
|
1190
|
-
}), a = o && c && at(() => l.isReadableStream(new
|
|
1190
|
+
}), a = o && c && at(() => l.isReadableStream(new n("").body)), f = {
|
|
1191
1191
|
stream: a && ((d) => d.body)
|
|
1192
1192
|
};
|
|
1193
1193
|
r && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
|
|
1194
1194
|
!f[d] && (f[d] = (m, p) => {
|
|
1195
|
-
let
|
|
1196
|
-
if (
|
|
1197
|
-
return
|
|
1198
|
-
throw new
|
|
1195
|
+
let w = m && m[d];
|
|
1196
|
+
if (w)
|
|
1197
|
+
return w.call(m);
|
|
1198
|
+
throw new _(`Response type '${d}' is not supported`, _.ERR_NOT_SUPPORT, p);
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
1201
|
const g = async (d) => {
|
|
@@ -1220,7 +1220,7 @@ const qt = (n) => {
|
|
|
1220
1220
|
let {
|
|
1221
1221
|
url: m,
|
|
1222
1222
|
method: p,
|
|
1223
|
-
data:
|
|
1223
|
+
data: w,
|
|
1224
1224
|
signal: S,
|
|
1225
1225
|
cancelToken: x,
|
|
1226
1226
|
timeout: O,
|
|
@@ -1238,18 +1238,18 @@ const qt = (n) => {
|
|
|
1238
1238
|
});
|
|
1239
1239
|
let y;
|
|
1240
1240
|
try {
|
|
1241
|
-
if (F && u && p !== "get" && p !== "head" && (y = await b(H,
|
|
1241
|
+
if (F && u && p !== "get" && p !== "head" && (y = await b(H, w)) !== 0) {
|
|
1242
1242
|
let M = new t(m, {
|
|
1243
1243
|
method: "POST",
|
|
1244
|
-
body:
|
|
1244
|
+
body: w,
|
|
1245
1245
|
duplex: "half"
|
|
1246
1246
|
}), Q;
|
|
1247
|
-
if (l.isFormData(
|
|
1247
|
+
if (l.isFormData(w) && (Q = M.headers.get("content-type")) && H.setContentType(Q), M.body) {
|
|
1248
1248
|
const [Ce, he] = tt(
|
|
1249
1249
|
y,
|
|
1250
|
-
|
|
1250
|
+
_e(nt(F))
|
|
1251
1251
|
);
|
|
1252
|
-
|
|
1252
|
+
w = rt(M.body, it, Ce, he);
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
1255
|
l.isString(v) || (v = v ? "include" : "omit");
|
|
@@ -1258,7 +1258,7 @@ const qt = (n) => {
|
|
|
1258
1258
|
signal: k,
|
|
1259
1259
|
method: p.toUpperCase(),
|
|
1260
1260
|
headers: H.normalize().toJSON(),
|
|
1261
|
-
body:
|
|
1261
|
+
body: w,
|
|
1262
1262
|
duplex: "half",
|
|
1263
1263
|
credentials: E ? v : void 0
|
|
1264
1264
|
};
|
|
@@ -1272,9 +1272,9 @@ const qt = (n) => {
|
|
|
1272
1272
|
});
|
|
1273
1273
|
const Q = l.toFiniteNumber(P.headers.get("content-length")), [Ce, he] = C && tt(
|
|
1274
1274
|
Q,
|
|
1275
|
-
|
|
1275
|
+
_e(nt(C), !0)
|
|
1276
1276
|
) || [];
|
|
1277
|
-
P = new
|
|
1277
|
+
P = new n(
|
|
1278
1278
|
rt(P.body, it, Ce, () => {
|
|
1279
1279
|
he && he(), A && A();
|
|
1280
1280
|
}),
|
|
@@ -1295,19 +1295,19 @@ const qt = (n) => {
|
|
|
1295
1295
|
});
|
|
1296
1296
|
} catch (E) {
|
|
1297
1297
|
throw A && A(), E && E.name === "TypeError" && /Load failed|fetch/i.test(E.message) ? Object.assign(
|
|
1298
|
-
new
|
|
1298
|
+
new _("Network Error", _.ERR_NETWORK, d, j),
|
|
1299
1299
|
{
|
|
1300
1300
|
cause: E.cause || E
|
|
1301
1301
|
}
|
|
1302
|
-
) :
|
|
1302
|
+
) : _.from(E, E && E.code, d, j);
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
|
-
}, Ts = /* @__PURE__ */ new Map(), Mt = (
|
|
1305
|
+
}, Ts = /* @__PURE__ */ new Map(), Mt = (s) => {
|
|
1306
1306
|
let e = l.merge.call({
|
|
1307
1307
|
skipUndefined: !0
|
|
1308
|
-
}, Bt,
|
|
1309
|
-
const { fetch: t, Request:
|
|
1310
|
-
|
|
1308
|
+
}, Bt, s ? s.env : null);
|
|
1309
|
+
const { fetch: t, Request: n, Response: r } = e, i = [
|
|
1310
|
+
n,
|
|
1311
1311
|
r,
|
|
1312
1312
|
t
|
|
1313
1313
|
];
|
|
@@ -1324,26 +1324,26 @@ const Fe = {
|
|
|
1324
1324
|
get: Mt
|
|
1325
1325
|
}
|
|
1326
1326
|
};
|
|
1327
|
-
l.forEach(Fe, (
|
|
1328
|
-
if (
|
|
1327
|
+
l.forEach(Fe, (s, e) => {
|
|
1328
|
+
if (s) {
|
|
1329
1329
|
try {
|
|
1330
|
-
Object.defineProperty(
|
|
1330
|
+
Object.defineProperty(s, "name", { value: e });
|
|
1331
1331
|
} catch {
|
|
1332
1332
|
}
|
|
1333
|
-
Object.defineProperty(
|
|
1333
|
+
Object.defineProperty(s, "adapterName", { value: e });
|
|
1334
1334
|
}
|
|
1335
1335
|
});
|
|
1336
|
-
const lt = (
|
|
1337
|
-
getAdapter: (
|
|
1338
|
-
|
|
1339
|
-
const { length: t } =
|
|
1340
|
-
let
|
|
1336
|
+
const lt = (s) => `- ${s}`, ks = (s) => l.isFunction(s) || s === null || s === !1, Ht = {
|
|
1337
|
+
getAdapter: (s, e) => {
|
|
1338
|
+
s = l.isArray(s) ? s : [s];
|
|
1339
|
+
const { length: t } = s;
|
|
1340
|
+
let n, r;
|
|
1341
1341
|
const i = {};
|
|
1342
1342
|
for (let o = 0; o < t; o++) {
|
|
1343
|
-
|
|
1343
|
+
n = s[o];
|
|
1344
1344
|
let c;
|
|
1345
|
-
if (r =
|
|
1346
|
-
throw new
|
|
1345
|
+
if (r = n, !ks(n) && (r = Fe[(c = String(n)).toLowerCase()], r === void 0))
|
|
1346
|
+
throw new _(`Unknown adapter '${c}'`);
|
|
1347
1347
|
if (r && (l.isFunction(r) || (r = r.get(e))))
|
|
1348
1348
|
break;
|
|
1349
1349
|
i[c || "#" + o] = r;
|
|
@@ -1355,7 +1355,7 @@ const lt = (n) => `- ${n}`, ks = (n) => l.isFunction(n) || n === null || n === !
|
|
|
1355
1355
|
let c = t ? o.length > 1 ? `since :
|
|
1356
1356
|
` + o.map(lt).join(`
|
|
1357
1357
|
`) : " " + lt(o[0]) : "as no adapter specified";
|
|
1358
|
-
throw new
|
|
1358
|
+
throw new _(
|
|
1359
1359
|
"There is no suitable adapter to dispatch the request " + c,
|
|
1360
1360
|
"ERR_NOT_SUPPORT"
|
|
1361
1361
|
);
|
|
@@ -1364,44 +1364,44 @@ const lt = (n) => `- ${n}`, ks = (n) => l.isFunction(n) || n === null || n === !
|
|
|
1364
1364
|
},
|
|
1365
1365
|
adapters: Fe
|
|
1366
1366
|
};
|
|
1367
|
-
function Ne(
|
|
1368
|
-
if (
|
|
1369
|
-
throw new te(null,
|
|
1367
|
+
function Ne(s) {
|
|
1368
|
+
if (s.cancelToken && s.cancelToken.throwIfRequested(), s.signal && s.signal.aborted)
|
|
1369
|
+
throw new te(null, s);
|
|
1370
1370
|
}
|
|
1371
|
-
function ut(
|
|
1372
|
-
return Ne(
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
), ["post", "put", "patch"].indexOf(
|
|
1376
|
-
return Ne(
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
),
|
|
1381
|
-
}, function(
|
|
1382
|
-
return $t(
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
),
|
|
1371
|
+
function ut(s) {
|
|
1372
|
+
return Ne(s), s.headers = L.from(s.headers), s.data = ke.call(
|
|
1373
|
+
s,
|
|
1374
|
+
s.transformRequest
|
|
1375
|
+
), ["post", "put", "patch"].indexOf(s.method) !== -1 && s.headers.setContentType("application/x-www-form-urlencoded", !1), Ht.getAdapter(s.adapter || ae.adapter, s)(s).then(function(n) {
|
|
1376
|
+
return Ne(s), n.data = ke.call(
|
|
1377
|
+
s,
|
|
1378
|
+
s.transformResponse,
|
|
1379
|
+
n
|
|
1380
|
+
), n.headers = L.from(n.headers), n;
|
|
1381
|
+
}, function(n) {
|
|
1382
|
+
return $t(n) || (Ne(s), n && n.response && (n.response.data = ke.call(
|
|
1383
|
+
s,
|
|
1384
|
+
s.transformResponse,
|
|
1385
|
+
n.response
|
|
1386
|
+
), n.response.headers = L.from(n.response.headers))), Promise.reject(n);
|
|
1387
1387
|
});
|
|
1388
1388
|
}
|
|
1389
1389
|
const zt = "1.12.0", Ae = {};
|
|
1390
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((
|
|
1391
|
-
Ae[
|
|
1392
|
-
return typeof
|
|
1390
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((s, e) => {
|
|
1391
|
+
Ae[s] = function(n) {
|
|
1392
|
+
return typeof n === s || "a" + (e < 1 ? "n " : " ") + s;
|
|
1393
1393
|
};
|
|
1394
1394
|
});
|
|
1395
1395
|
const ht = {};
|
|
1396
|
-
Ae.transitional = function(e, t,
|
|
1396
|
+
Ae.transitional = function(e, t, n) {
|
|
1397
1397
|
function r(i, o) {
|
|
1398
|
-
return "[Axios v" + zt + "] Transitional option '" + i + "'" + o + (
|
|
1398
|
+
return "[Axios v" + zt + "] Transitional option '" + i + "'" + o + (n ? ". " + n : "");
|
|
1399
1399
|
}
|
|
1400
1400
|
return (i, o, c) => {
|
|
1401
1401
|
if (e === !1)
|
|
1402
|
-
throw new
|
|
1402
|
+
throw new _(
|
|
1403
1403
|
r(o, " has been removed" + (t ? " in " + t : "")),
|
|
1404
|
-
|
|
1404
|
+
_.ERR_DEPRECATED
|
|
1405
1405
|
);
|
|
1406
1406
|
return t && !ht[o] && (ht[o] = !0, console.warn(
|
|
1407
1407
|
r(
|
|
@@ -1412,23 +1412,23 @@ Ae.transitional = function(e, t, s) {
|
|
|
1412
1412
|
};
|
|
1413
1413
|
};
|
|
1414
1414
|
Ae.spelling = function(e) {
|
|
1415
|
-
return (t,
|
|
1415
|
+
return (t, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
|
|
1416
1416
|
};
|
|
1417
|
-
function Ns(
|
|
1418
|
-
if (typeof
|
|
1419
|
-
throw new
|
|
1420
|
-
const
|
|
1421
|
-
let r =
|
|
1417
|
+
function Ns(s, e, t) {
|
|
1418
|
+
if (typeof s != "object")
|
|
1419
|
+
throw new _("options must be an object", _.ERR_BAD_OPTION_VALUE);
|
|
1420
|
+
const n = Object.keys(s);
|
|
1421
|
+
let r = n.length;
|
|
1422
1422
|
for (; r-- > 0; ) {
|
|
1423
|
-
const i =
|
|
1423
|
+
const i = n[r], o = e[i];
|
|
1424
1424
|
if (o) {
|
|
1425
|
-
const c =
|
|
1425
|
+
const c = s[i], h = c === void 0 || o(c, i, s);
|
|
1426
1426
|
if (h !== !0)
|
|
1427
|
-
throw new
|
|
1427
|
+
throw new _("option " + i + " must be " + h, _.ERR_BAD_OPTION_VALUE);
|
|
1428
1428
|
continue;
|
|
1429
1429
|
}
|
|
1430
1430
|
if (t !== !0)
|
|
1431
|
-
throw new
|
|
1431
|
+
throw new _("Unknown option " + i, _.ERR_BAD_OPTION);
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
1434
1434
|
const ye = {
|
|
@@ -1453,24 +1453,24 @@ let W = class {
|
|
|
1453
1453
|
async request(e, t) {
|
|
1454
1454
|
try {
|
|
1455
1455
|
return await this._request(e, t);
|
|
1456
|
-
} catch (
|
|
1457
|
-
if (
|
|
1456
|
+
} catch (n) {
|
|
1457
|
+
if (n instanceof Error) {
|
|
1458
1458
|
let r = {};
|
|
1459
1459
|
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
1460
1460
|
const i = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
1461
1461
|
try {
|
|
1462
|
-
|
|
1463
|
-
` + i) :
|
|
1462
|
+
n.stack ? i && !String(n.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (n.stack += `
|
|
1463
|
+
` + i) : n.stack = i;
|
|
1464
1464
|
} catch {
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
|
-
throw
|
|
1467
|
+
throw n;
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
1470
|
_request(e, t) {
|
|
1471
1471
|
typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = K(this.defaults, t);
|
|
1472
|
-
const { transitional:
|
|
1473
|
-
|
|
1472
|
+
const { transitional: n, paramsSerializer: r, headers: i } = t;
|
|
1473
|
+
n !== void 0 && ye.assertOptions(n, {
|
|
1474
1474
|
silentJSONParsing: B.transitional(B.boolean),
|
|
1475
1475
|
forcedJSONParsing: B.transitional(B.boolean),
|
|
1476
1476
|
clarifyTimeoutError: B.transitional(B.boolean)
|
|
@@ -1536,20 +1536,20 @@ let W = class {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
};
|
|
1538
1538
|
l.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1539
|
-
W.prototype[e] = function(t,
|
|
1540
|
-
return this.request(K(
|
|
1539
|
+
W.prototype[e] = function(t, n) {
|
|
1540
|
+
return this.request(K(n || {}, {
|
|
1541
1541
|
method: e,
|
|
1542
1542
|
url: t,
|
|
1543
|
-
data: (
|
|
1543
|
+
data: (n || {}).data
|
|
1544
1544
|
}));
|
|
1545
1545
|
};
|
|
1546
1546
|
});
|
|
1547
1547
|
l.forEach(["post", "put", "patch"], function(e) {
|
|
1548
|
-
function t(
|
|
1548
|
+
function t(n) {
|
|
1549
1549
|
return function(i, o, c) {
|
|
1550
1550
|
return this.request(K(c || {}, {
|
|
1551
1551
|
method: e,
|
|
1552
|
-
headers:
|
|
1552
|
+
headers: n ? {
|
|
1553
1553
|
"Content-Type": "multipart/form-data"
|
|
1554
1554
|
} : {},
|
|
1555
1555
|
url: i,
|
|
@@ -1567,23 +1567,23 @@ let Ps = class Vt {
|
|
|
1567
1567
|
this.promise = new Promise(function(i) {
|
|
1568
1568
|
t = i;
|
|
1569
1569
|
});
|
|
1570
|
-
const
|
|
1570
|
+
const n = this;
|
|
1571
1571
|
this.promise.then((r) => {
|
|
1572
|
-
if (!
|
|
1573
|
-
let i =
|
|
1572
|
+
if (!n._listeners) return;
|
|
1573
|
+
let i = n._listeners.length;
|
|
1574
1574
|
for (; i-- > 0; )
|
|
1575
|
-
|
|
1576
|
-
|
|
1575
|
+
n._listeners[i](r);
|
|
1576
|
+
n._listeners = null;
|
|
1577
1577
|
}), this.promise.then = (r) => {
|
|
1578
1578
|
let i;
|
|
1579
1579
|
const o = new Promise((c) => {
|
|
1580
|
-
|
|
1580
|
+
n.subscribe(c), i = c;
|
|
1581
1581
|
}).then(r);
|
|
1582
1582
|
return o.cancel = function() {
|
|
1583
|
-
|
|
1583
|
+
n.unsubscribe(i);
|
|
1584
1584
|
}, o;
|
|
1585
1585
|
}, e(function(i, o, c) {
|
|
1586
|
-
|
|
1586
|
+
n.reason || (n.reason = new te(i, o, c), t(n.reason));
|
|
1587
1587
|
});
|
|
1588
1588
|
}
|
|
1589
1589
|
/**
|
|
@@ -1613,8 +1613,8 @@ let Ps = class Vt {
|
|
|
1613
1613
|
t !== -1 && this._listeners.splice(t, 1);
|
|
1614
1614
|
}
|
|
1615
1615
|
toAbortSignal() {
|
|
1616
|
-
const e = new AbortController(), t = (
|
|
1617
|
-
e.abort(
|
|
1616
|
+
const e = new AbortController(), t = (n) => {
|
|
1617
|
+
e.abort(n);
|
|
1618
1618
|
};
|
|
1619
1619
|
return this.subscribe(t), e.signal.unsubscribe = () => this.unsubscribe(t), e.signal;
|
|
1620
1620
|
}
|
|
@@ -1632,13 +1632,13 @@ let Ps = class Vt {
|
|
|
1632
1632
|
};
|
|
1633
1633
|
}
|
|
1634
1634
|
};
|
|
1635
|
-
function Is(
|
|
1635
|
+
function Is(s) {
|
|
1636
1636
|
return function(t) {
|
|
1637
|
-
return
|
|
1637
|
+
return s.apply(null, t);
|
|
1638
1638
|
};
|
|
1639
1639
|
}
|
|
1640
|
-
function Ls(
|
|
1641
|
-
return l.isObject(
|
|
1640
|
+
function Ls(s) {
|
|
1641
|
+
return l.isObject(s) && s.isAxiosError === !0;
|
|
1642
1642
|
}
|
|
1643
1643
|
const ve = {
|
|
1644
1644
|
Continue: 100,
|
|
@@ -1705,13 +1705,13 @@ const ve = {
|
|
|
1705
1705
|
NotExtended: 510,
|
|
1706
1706
|
NetworkAuthenticationRequired: 511
|
|
1707
1707
|
};
|
|
1708
|
-
Object.entries(ve).forEach(([
|
|
1709
|
-
ve[e] =
|
|
1708
|
+
Object.entries(ve).forEach(([s, e]) => {
|
|
1709
|
+
ve[e] = s;
|
|
1710
1710
|
});
|
|
1711
|
-
function Jt(
|
|
1712
|
-
const e = new W(
|
|
1711
|
+
function Jt(s) {
|
|
1712
|
+
const e = new W(s), t = St(W.prototype.request, e);
|
|
1713
1713
|
return l.extend(t, W.prototype, e, { allOwnKeys: !0 }), l.extend(t, e, null, { allOwnKeys: !0 }), t.create = function(r) {
|
|
1714
|
-
return Jt(K(
|
|
1714
|
+
return Jt(K(s, r));
|
|
1715
1715
|
}, t;
|
|
1716
1716
|
}
|
|
1717
1717
|
const R = Jt(ae);
|
|
@@ -1721,7 +1721,7 @@ R.CancelToken = Ps;
|
|
|
1721
1721
|
R.isCancel = $t;
|
|
1722
1722
|
R.VERSION = zt;
|
|
1723
1723
|
R.toFormData = xe;
|
|
1724
|
-
R.AxiosError =
|
|
1724
|
+
R.AxiosError = _;
|
|
1725
1725
|
R.Cancel = R.CanceledError;
|
|
1726
1726
|
R.all = function(e) {
|
|
1727
1727
|
return Promise.all(e);
|
|
@@ -1730,7 +1730,7 @@ R.spread = Is;
|
|
|
1730
1730
|
R.isAxiosError = Ls;
|
|
1731
1731
|
R.mergeConfig = K;
|
|
1732
1732
|
R.AxiosHeaders = L;
|
|
1733
|
-
R.formToJSON = (
|
|
1733
|
+
R.formToJSON = (s) => vt(l.isHTMLForm(s) ? new FormData(s) : s);
|
|
1734
1734
|
R.getAdapter = Ht.getAdapter;
|
|
1735
1735
|
R.HttpStatusCode = ve;
|
|
1736
1736
|
R.default = R;
|
|
@@ -1757,32 +1757,32 @@ const {
|
|
|
1757
1757
|
params: {}
|
|
1758
1758
|
});
|
|
1759
1759
|
He.interceptors.response.use(
|
|
1760
|
-
(
|
|
1761
|
-
(
|
|
1762
|
-
var e, t,
|
|
1763
|
-
if (
|
|
1764
|
-
if (
|
|
1760
|
+
(s) => s,
|
|
1761
|
+
(s) => {
|
|
1762
|
+
var e, t, n, r, i, o, c, h, u, a, f;
|
|
1763
|
+
if (s.response) {
|
|
1764
|
+
if (s.response.status === 401 && OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity, !0).then(
|
|
1765
1765
|
function(d) {
|
|
1766
1766
|
d && OpenC3Auth.setTokens();
|
|
1767
1767
|
}
|
|
1768
|
-
),
|
|
1769
|
-
|
|
1768
|
+
), s.response.config.headers["Ignore-Errors"] && s.response.config.headers["Ignore-Errors"].includes(
|
|
1769
|
+
s.response.status.toString()
|
|
1770
1770
|
))
|
|
1771
|
-
return Promise.reject(
|
|
1772
|
-
let g = `HTTP ${
|
|
1773
|
-
(e =
|
|
1771
|
+
return Promise.reject(s);
|
|
1772
|
+
let g = `HTTP ${s.response.status} - `;
|
|
1773
|
+
(e = s.response) != null && e.statusText && (g += `${s.response.statusText} `), (n = (t = s.response) == null ? void 0 : t.config) != null && n.data && (g += `${s.response.config.data} `), (i = (r = s.response) == null ? void 0 : r.data) != null && i.message ? g += `${s.response.data.message}` : (c = (o = s.response) == null ? void 0 : o.data) != null && c.exception ? g += `${s.response.data.exception}` : (a = (u = (h = s.response) == null ? void 0 : h.data) == null ? void 0 : u.error) != null && a.message ? (s.response.data.error.class && (g += `${s.response.data.error.class} `), g += `${s.response.data.error.message}`) : g += `${(f = s.response) == null ? void 0 : f.data}`;
|
|
1774
1774
|
const { $cosmosNotify: b } = window;
|
|
1775
1775
|
throw b && b.serious({
|
|
1776
1776
|
title: "Network error",
|
|
1777
1777
|
body: g
|
|
1778
|
-
}),
|
|
1778
|
+
}), s;
|
|
1779
1779
|
} else
|
|
1780
|
-
throw
|
|
1780
|
+
throw s;
|
|
1781
1781
|
}
|
|
1782
1782
|
);
|
|
1783
|
-
const fe = async function(
|
|
1783
|
+
const fe = async function(s, e, {
|
|
1784
1784
|
data: t,
|
|
1785
|
-
params:
|
|
1785
|
+
params: n = {},
|
|
1786
1786
|
headers: r,
|
|
1787
1787
|
noAuth: i = !1,
|
|
1788
1788
|
noScope: o = !1,
|
|
@@ -1798,11 +1798,11 @@ const fe = async function(n, e, {
|
|
|
1798
1798
|
}
|
|
1799
1799
|
r.Authorization = localStorage.openc3Token;
|
|
1800
1800
|
}
|
|
1801
|
-
return r.manual = !0, !o && !
|
|
1802
|
-
method:
|
|
1801
|
+
return r.manual = !0, !o && !n.scope && (n.scope = window.openc3Scope), He({
|
|
1802
|
+
method: s,
|
|
1803
1803
|
url: e,
|
|
1804
1804
|
data: t,
|
|
1805
|
-
params:
|
|
1805
|
+
params: n,
|
|
1806
1806
|
headers: r,
|
|
1807
1807
|
onUploadProgress: c
|
|
1808
1808
|
});
|
|
@@ -1812,82 +1812,82 @@ const fe = async function(n, e, {
|
|
|
1812
1812
|
...$e,
|
|
1813
1813
|
"Content-Type": "application/json"
|
|
1814
1814
|
}, hi = {
|
|
1815
|
-
get: function(
|
|
1815
|
+
get: function(s, {
|
|
1816
1816
|
params: e,
|
|
1817
1817
|
headers: t = $e,
|
|
1818
|
-
noScope:
|
|
1818
|
+
noScope: n,
|
|
1819
1819
|
noAuth: r,
|
|
1820
1820
|
onUploadProgress: i
|
|
1821
1821
|
} = {}) {
|
|
1822
|
-
return fe("get",
|
|
1822
|
+
return fe("get", s, {
|
|
1823
1823
|
params: e,
|
|
1824
1824
|
headers: t,
|
|
1825
|
-
noScope:
|
|
1825
|
+
noScope: n,
|
|
1826
1826
|
noAuth: r,
|
|
1827
1827
|
onUploadProgress: i
|
|
1828
1828
|
});
|
|
1829
1829
|
},
|
|
1830
|
-
put: function(
|
|
1830
|
+
put: function(s, {
|
|
1831
1831
|
data: e,
|
|
1832
1832
|
params: t,
|
|
1833
|
-
headers:
|
|
1833
|
+
headers: n = dt,
|
|
1834
1834
|
noScope: r,
|
|
1835
1835
|
noAuth: i,
|
|
1836
1836
|
onUploadProgress: o
|
|
1837
1837
|
} = {}) {
|
|
1838
|
-
return fe("put",
|
|
1838
|
+
return fe("put", s, {
|
|
1839
1839
|
data: e,
|
|
1840
1840
|
params: t,
|
|
1841
|
-
headers:
|
|
1841
|
+
headers: n,
|
|
1842
1842
|
noScope: r,
|
|
1843
1843
|
noAuth: i,
|
|
1844
1844
|
onUploadProgress: o
|
|
1845
1845
|
});
|
|
1846
1846
|
},
|
|
1847
|
-
post: function(
|
|
1847
|
+
post: function(s, {
|
|
1848
1848
|
data: e,
|
|
1849
1849
|
params: t,
|
|
1850
|
-
headers:
|
|
1850
|
+
headers: n = dt,
|
|
1851
1851
|
noScope: r,
|
|
1852
1852
|
noAuth: i,
|
|
1853
1853
|
onUploadProgress: o
|
|
1854
1854
|
} = {}) {
|
|
1855
|
-
return fe("post",
|
|
1855
|
+
return fe("post", s, {
|
|
1856
1856
|
data: e,
|
|
1857
1857
|
params: t,
|
|
1858
|
-
headers:
|
|
1858
|
+
headers: n,
|
|
1859
1859
|
noScope: r,
|
|
1860
1860
|
noAuth: i,
|
|
1861
1861
|
onUploadProgress: o
|
|
1862
1862
|
});
|
|
1863
1863
|
},
|
|
1864
|
-
delete: function(
|
|
1864
|
+
delete: function(s, {
|
|
1865
1865
|
params: e,
|
|
1866
1866
|
headers: t = $e,
|
|
1867
|
-
noScope:
|
|
1867
|
+
noScope: n,
|
|
1868
1868
|
noAuth: r,
|
|
1869
1869
|
onUploadProgress: i
|
|
1870
1870
|
} = {}) {
|
|
1871
|
-
return fe("delete",
|
|
1871
|
+
return fe("delete", s, {
|
|
1872
1872
|
params: e,
|
|
1873
1873
|
headers: t,
|
|
1874
|
-
noScope:
|
|
1874
|
+
noScope: n,
|
|
1875
1875
|
noAuth: r,
|
|
1876
1876
|
onUploadProgress: i
|
|
1877
1877
|
});
|
|
1878
1878
|
}
|
|
1879
1879
|
};
|
|
1880
1880
|
let Re = () => ({
|
|
1881
|
-
emit(
|
|
1882
|
-
for (let t = this.events[
|
|
1883
|
-
t[
|
|
1881
|
+
emit(s, ...e) {
|
|
1882
|
+
for (let t = this.events[s] || [], n = 0, r = t.length; n < r; n++)
|
|
1883
|
+
t[n](...e);
|
|
1884
1884
|
},
|
|
1885
1885
|
events: {},
|
|
1886
|
-
on(
|
|
1886
|
+
on(s, e) {
|
|
1887
1887
|
var t;
|
|
1888
|
-
return ((t = this.events)[
|
|
1889
|
-
var
|
|
1890
|
-
this.events[
|
|
1888
|
+
return ((t = this.events)[s] || (t[s] = [])).push(e), () => {
|
|
1889
|
+
var n;
|
|
1890
|
+
this.events[s] = (n = this.events[s]) == null ? void 0 : n.filter((r) => e !== r);
|
|
1891
1891
|
};
|
|
1892
1892
|
}
|
|
1893
1893
|
});
|
|
@@ -1916,10 +1916,10 @@ class Fs extends U {
|
|
|
1916
1916
|
super(e, "stale_connection"), this.name = "StaleConnectionError";
|
|
1917
1917
|
}
|
|
1918
1918
|
}
|
|
1919
|
-
function Wt(
|
|
1920
|
-
return
|
|
1921
|
-
let
|
|
1922
|
-
return `${JSON.stringify(t)}:${
|
|
1919
|
+
function Wt(s) {
|
|
1920
|
+
return s ? `{${Object.keys(s).sort().filter((t) => s[t] !== void 0).map((t) => {
|
|
1921
|
+
let n = JSON.stringify(s[t]);
|
|
1922
|
+
return `${JSON.stringify(t)}:${n}`;
|
|
1923
1923
|
}).join(",")}}` : "";
|
|
1924
1924
|
}
|
|
1925
1925
|
class vs {
|
|
@@ -1967,7 +1967,7 @@ class vs {
|
|
|
1967
1967
|
}
|
|
1968
1968
|
}
|
|
1969
1969
|
stateFromInfo(e) {
|
|
1970
|
-
return e.records.reduce((t, { id:
|
|
1970
|
+
return e.records.reduce((t, { id: n, info: r }) => (t[n] = r, t), {});
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
1973
|
const z = Symbol("state");
|
|
@@ -2033,8 +2033,8 @@ class Kt {
|
|
|
2033
2033
|
try {
|
|
2034
2034
|
await this.perform("$whisper", e);
|
|
2035
2035
|
} catch (t) {
|
|
2036
|
-
let
|
|
2037
|
-
|
|
2036
|
+
let n = this.receiver ? this.receiver.logger : null;
|
|
2037
|
+
n && n.warn("whisper failed: ", t);
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
2040
|
receive(e, t) {
|
|
@@ -2044,10 +2044,10 @@ class Kt {
|
|
|
2044
2044
|
return this.emitter.on(e, t);
|
|
2045
2045
|
}
|
|
2046
2046
|
once(e, t) {
|
|
2047
|
-
let
|
|
2048
|
-
|
|
2047
|
+
let n = this.emitter.on(e, (...r) => {
|
|
2048
|
+
n(), t(...r);
|
|
2049
2049
|
});
|
|
2050
|
-
return
|
|
2050
|
+
return n;
|
|
2051
2051
|
}
|
|
2052
2052
|
emit(e, ...t) {
|
|
2053
2053
|
return this.emitter.emit(e, ...t);
|
|
@@ -2060,14 +2060,14 @@ class Kt {
|
|
|
2060
2060
|
// It ignores disconnect events.
|
|
2061
2061
|
pendingSubscribe() {
|
|
2062
2062
|
return this._pendingSubscribe ? this._pendingSubscribe : (this._pendingSubscribe = new Promise((e, t) => {
|
|
2063
|
-
let
|
|
2064
|
-
|
|
2063
|
+
let n = [() => delete this._pendingSubscribe];
|
|
2064
|
+
n.push(
|
|
2065
2065
|
this.on("connect", () => {
|
|
2066
|
-
|
|
2066
|
+
n.forEach((r) => r()), e();
|
|
2067
2067
|
})
|
|
2068
|
-
),
|
|
2068
|
+
), n.push(
|
|
2069
2069
|
this.on("close", (r) => {
|
|
2070
|
-
|
|
2070
|
+
n.forEach((i) => i()), t(
|
|
2071
2071
|
r || new le(
|
|
2072
2072
|
"Channel was disconnected before subscribing",
|
|
2073
2073
|
"canceled"
|
|
@@ -2090,7 +2090,7 @@ class $s {
|
|
|
2090
2090
|
t > -1 && this.channels.splice(t, 1);
|
|
2091
2091
|
}
|
|
2092
2092
|
notify(e, ...t) {
|
|
2093
|
-
this.state = e === "restored" ? "connected" : e, t.length === 1 ? this.channels.forEach((
|
|
2093
|
+
this.state = e === "restored" ? "connected" : e, t.length === 1 ? this.channels.forEach((n) => n[e](t[0])) : this.channels.forEach((n) => n[e]());
|
|
2094
2094
|
}
|
|
2095
2095
|
pending(e) {
|
|
2096
2096
|
this._checkIntent(e);
|
|
@@ -2160,17 +2160,17 @@ class Ds {
|
|
|
2160
2160
|
get(e) {
|
|
2161
2161
|
return this._subscriptions[e];
|
|
2162
2162
|
}
|
|
2163
|
-
create(e, { subscribe: t, unsubscribe:
|
|
2163
|
+
create(e, { subscribe: t, unsubscribe: n }) {
|
|
2164
2164
|
let r = this._subscriptions[e] = new $s(e);
|
|
2165
|
-
return r.remoteId = this._localToRemote[e], r.subscriber = t, r.unsubscriber =
|
|
2165
|
+
return r.remoteId = this._localToRemote[e], r.subscriber = t, r.unsubscriber = n, r.gvl = this.glv, r;
|
|
2166
2166
|
}
|
|
2167
2167
|
remove(e) {
|
|
2168
2168
|
delete this._subscriptions[e], delete this._localToRemote[e];
|
|
2169
2169
|
}
|
|
2170
2170
|
storeRemoteId(e, t) {
|
|
2171
2171
|
this._localToRemote[e] = t;
|
|
2172
|
-
let
|
|
2173
|
-
|
|
2172
|
+
let n = this.get(e);
|
|
2173
|
+
n && (n.remoteId = t);
|
|
2174
2174
|
}
|
|
2175
2175
|
}
|
|
2176
2176
|
class qs {
|
|
@@ -2183,26 +2183,26 @@ class qs {
|
|
|
2183
2183
|
unsubscribe(e) {
|
|
2184
2184
|
let t = this.subscriptions.get(e);
|
|
2185
2185
|
if (!t) return;
|
|
2186
|
-
let
|
|
2187
|
-
|
|
2186
|
+
let n = t.remoteId;
|
|
2187
|
+
n && delete this._remoteToLocal[n], this.subscriptions.remove(e);
|
|
2188
2188
|
}
|
|
2189
|
-
transmit(e, t,
|
|
2189
|
+
transmit(e, t, n) {
|
|
2190
2190
|
let r = this._remoteToLocal[e];
|
|
2191
2191
|
if (!r) {
|
|
2192
|
-
this._pendingMessages.push([e, t,
|
|
2192
|
+
this._pendingMessages.push([e, t, n]);
|
|
2193
2193
|
return;
|
|
2194
2194
|
}
|
|
2195
2195
|
let i = this.subscriptions.get(r);
|
|
2196
2196
|
i && i.channels.forEach((o) => {
|
|
2197
|
-
o.receive(t,
|
|
2197
|
+
o.receive(t, n);
|
|
2198
2198
|
});
|
|
2199
2199
|
}
|
|
2200
|
-
notify(e, t,
|
|
2200
|
+
notify(e, t, n) {
|
|
2201
2201
|
let r = this._remoteToLocal[e];
|
|
2202
2202
|
if (!r)
|
|
2203
2203
|
return;
|
|
2204
2204
|
let i = this.subscriptions.get(r);
|
|
2205
|
-
i && i.channels.forEach((o) => o.emit(t,
|
|
2205
|
+
i && i.channels.forEach((o) => o.emit(t, n));
|
|
2206
2206
|
}
|
|
2207
2207
|
close() {
|
|
2208
2208
|
this._pendingMessages.length = 0;
|
|
@@ -2215,8 +2215,8 @@ class qs {
|
|
|
2215
2215
|
}
|
|
2216
2216
|
flush(e) {
|
|
2217
2217
|
let t = [];
|
|
2218
|
-
for (let
|
|
2219
|
-
|
|
2218
|
+
for (let n of this._pendingMessages)
|
|
2219
|
+
n[0] === e ? this.transmit(n[0], n[1], n[2]) : t.push(n);
|
|
2220
2220
|
this._pendingMessages = t;
|
|
2221
2221
|
}
|
|
2222
2222
|
}
|
|
@@ -2230,8 +2230,8 @@ class Xt {
|
|
|
2230
2230
|
constructor(e) {
|
|
2231
2231
|
this.level = e || "warn";
|
|
2232
2232
|
}
|
|
2233
|
-
log(e, t,
|
|
2234
|
-
ft[e] < ft[this.level] || this.writeLogEntry(e, t,
|
|
2233
|
+
log(e, t, n) {
|
|
2234
|
+
ft[e] < ft[this.level] || this.writeLogEntry(e, t, n);
|
|
2235
2235
|
}
|
|
2236
2236
|
writeLogEntry() {
|
|
2237
2237
|
throw Error("Not implemented");
|
|
@@ -2274,9 +2274,9 @@ class Gt {
|
|
|
2274
2274
|
this.cable = e;
|
|
2275
2275
|
}
|
|
2276
2276
|
subscribe(e, t) {
|
|
2277
|
-
let
|
|
2278
|
-
t && Object.assign(
|
|
2279
|
-
let r = Wt(
|
|
2277
|
+
let n = { channel: e };
|
|
2278
|
+
t && Object.assign(n, t);
|
|
2279
|
+
let r = Wt(n);
|
|
2280
2280
|
if (this.pendingUnsubscriptions[r]) {
|
|
2281
2281
|
let o = this.subscribeCooldownInterval * 1.5;
|
|
2282
2282
|
return this.logger.debug(
|
|
@@ -2306,24 +2306,24 @@ class Gt {
|
|
|
2306
2306
|
identifier: e
|
|
2307
2307
|
};
|
|
2308
2308
|
}
|
|
2309
|
-
maybeRetrySubscribe(e, t,
|
|
2309
|
+
maybeRetrySubscribe(e, t, n) {
|
|
2310
2310
|
setTimeout(() => {
|
|
2311
2311
|
let r = this.pendingSubscriptions[t];
|
|
2312
2312
|
r && r.id === e && (this.logger.warn(
|
|
2313
|
-
`no subscription ack received in ${
|
|
2313
|
+
`no subscription ack received in ${n}ms, retrying subscribe`,
|
|
2314
2314
|
t
|
|
2315
|
-
), this.cable.send(this.buildSubscribeRequest(t)), this.maybeExpireSubscribe(e, t,
|
|
2316
|
-
},
|
|
2315
|
+
), this.cable.send(this.buildSubscribeRequest(t)), this.maybeExpireSubscribe(e, t, n));
|
|
2316
|
+
}, n);
|
|
2317
2317
|
}
|
|
2318
|
-
maybeExpireSubscribe(e, t,
|
|
2318
|
+
maybeExpireSubscribe(e, t, n) {
|
|
2319
2319
|
setTimeout(() => {
|
|
2320
2320
|
let r = this.pendingSubscriptions[t];
|
|
2321
2321
|
r && r.id === e && (delete this.pendingSubscriptions[t], r.reject(
|
|
2322
2322
|
new js(
|
|
2323
|
-
`Haven't received subscription ack in ${
|
|
2323
|
+
`Haven't received subscription ack in ${n * 2}ms for ${t}`
|
|
2324
2324
|
)
|
|
2325
2325
|
));
|
|
2326
|
-
},
|
|
2326
|
+
}, n);
|
|
2327
2327
|
}
|
|
2328
2328
|
unsubscribe(e) {
|
|
2329
2329
|
return this.cable.send({
|
|
@@ -2333,11 +2333,11 @@ class Gt {
|
|
|
2333
2333
|
delete this.pendingUnsubscriptions[e];
|
|
2334
2334
|
}, this.subscribeCooldownInterval), Promise.resolve();
|
|
2335
2335
|
}
|
|
2336
|
-
perform(e, t,
|
|
2337
|
-
return t === "$whisper" ? this.whisper(e,
|
|
2336
|
+
perform(e, t, n) {
|
|
2337
|
+
return t === "$whisper" ? this.whisper(e, n) : (n || (n = {}), n.action = t, this.cable.send({
|
|
2338
2338
|
command: "message",
|
|
2339
2339
|
identifier: e,
|
|
2340
|
-
data: JSON.stringify(
|
|
2340
|
+
data: JSON.stringify(n)
|
|
2341
2341
|
}), Promise.resolve());
|
|
2342
2342
|
}
|
|
2343
2343
|
whisper(e, t) {
|
|
@@ -2352,7 +2352,7 @@ class Gt {
|
|
|
2352
2352
|
this.logger.error("unsupported message format", { message: e });
|
|
2353
2353
|
return;
|
|
2354
2354
|
}
|
|
2355
|
-
let { type: t, identifier:
|
|
2355
|
+
let { type: t, identifier: n, message: r, reason: i, reconnect: o } = e;
|
|
2356
2356
|
if (t === "ping")
|
|
2357
2357
|
return this.cable.keepalive(e.message);
|
|
2358
2358
|
if (this.cable.keepalive(), t === "welcome") {
|
|
@@ -2365,22 +2365,22 @@ class Gt {
|
|
|
2365
2365
|
return;
|
|
2366
2366
|
}
|
|
2367
2367
|
if (t === "confirm_subscription") {
|
|
2368
|
-
let c = this.pendingSubscriptions[
|
|
2368
|
+
let c = this.pendingSubscriptions[n];
|
|
2369
2369
|
if (!c) {
|
|
2370
2370
|
this.logger.error("subscription not found, unsubscribing", {
|
|
2371
2371
|
type: t,
|
|
2372
|
-
identifier:
|
|
2373
|
-
}), this.unsubscribe(
|
|
2372
|
+
identifier: n
|
|
2373
|
+
}), this.unsubscribe(n);
|
|
2374
2374
|
return;
|
|
2375
2375
|
}
|
|
2376
|
-
return delete this.pendingSubscriptions[
|
|
2376
|
+
return delete this.pendingSubscriptions[n], c.resolve(n);
|
|
2377
2377
|
}
|
|
2378
2378
|
if (t === "reject_subscription") {
|
|
2379
|
-
let c = this.pendingSubscriptions[
|
|
2380
|
-
return c ? (delete this.pendingSubscriptions[
|
|
2379
|
+
let c = this.pendingSubscriptions[n];
|
|
2380
|
+
return c ? (delete this.pendingSubscriptions[n], c.reject(new ze())) : this.logger.error("subscription not found", { type: t, identifier: n });
|
|
2381
2381
|
}
|
|
2382
2382
|
if (r)
|
|
2383
|
-
return { identifier:
|
|
2383
|
+
return { identifier: n, message: r };
|
|
2384
2384
|
this.logger.warn(`unknown message type: ${t}`, { message: e });
|
|
2385
2385
|
}
|
|
2386
2386
|
reset(e) {
|
|
@@ -2407,21 +2407,21 @@ class Hs extends Gt {
|
|
|
2407
2407
|
this.logger.error("unsupported message format", { message: e });
|
|
2408
2408
|
return;
|
|
2409
2409
|
}
|
|
2410
|
-
let { type: t, identifier:
|
|
2410
|
+
let { type: t, identifier: n, message: r } = e;
|
|
2411
2411
|
if (t === "disconnect")
|
|
2412
2412
|
return delete this.sessionId, this.cable.setSessionId(""), super.receive(e);
|
|
2413
2413
|
if (t === "reject_subscription")
|
|
2414
2414
|
return super.receive(e);
|
|
2415
2415
|
if (t === "confirm_subscription")
|
|
2416
|
-
return this.subscriptionStreams[
|
|
2416
|
+
return this.subscriptionStreams[n] || (this.subscriptionStreams[n] = /* @__PURE__ */ new Set()), super.receive(e);
|
|
2417
2417
|
if (t === "ping")
|
|
2418
2418
|
return this.restoreSince && (this.restoreSince = pt()), this.sendPongs && this.sendPong(), this.cable.keepalive(e.message);
|
|
2419
2419
|
if (this.cable.keepalive(), t === "confirm_history") {
|
|
2420
|
-
this.logger.debug("history result received", e), this.cable.notify("history_received",
|
|
2420
|
+
this.logger.debug("history result received", e), this.cable.notify("history_received", n);
|
|
2421
2421
|
return;
|
|
2422
2422
|
}
|
|
2423
2423
|
if (t === "reject_history") {
|
|
2424
|
-
this.logger.warn("failed to retrieve history", e), this.cable.notify("history_not_found",
|
|
2424
|
+
this.logger.warn("failed to retrieve history", e), this.cable.notify("history_not_found", n);
|
|
2425
2425
|
return;
|
|
2426
2426
|
}
|
|
2427
2427
|
if (t === "welcome") {
|
|
@@ -2444,46 +2444,46 @@ class Hs extends Gt {
|
|
|
2444
2444
|
if (t === "presence") {
|
|
2445
2445
|
let i = r.type;
|
|
2446
2446
|
if (i === "info") {
|
|
2447
|
-
let o = this.pendingPresence[
|
|
2448
|
-
o && (delete this.pendingPresence[
|
|
2447
|
+
let o = this.pendingPresence[n];
|
|
2448
|
+
o && (delete this.pendingPresence[n], o.resolve(r));
|
|
2449
2449
|
} else if (i === "error") {
|
|
2450
|
-
let o = this.pendingPresence[
|
|
2451
|
-
o && (delete this.pendingPresence[
|
|
2450
|
+
let o = this.pendingPresence[n];
|
|
2451
|
+
o && (delete this.pendingPresence[n], o.reject(new Error("failed to retrieve presence")));
|
|
2452
2452
|
}
|
|
2453
2453
|
return {
|
|
2454
2454
|
type: t,
|
|
2455
|
-
identifier:
|
|
2455
|
+
identifier: n,
|
|
2456
2456
|
message: r
|
|
2457
2457
|
};
|
|
2458
2458
|
}
|
|
2459
2459
|
if (r) {
|
|
2460
2460
|
let i = this.trackStreamPosition(
|
|
2461
|
-
|
|
2461
|
+
n,
|
|
2462
2462
|
e.stream_id,
|
|
2463
2463
|
e.epoch,
|
|
2464
2464
|
e.offset
|
|
2465
2465
|
);
|
|
2466
|
-
return { identifier:
|
|
2466
|
+
return { identifier: n, message: r, meta: i };
|
|
2467
2467
|
}
|
|
2468
2468
|
this.logger.warn(`unknown message type: ${t}`, { message: e });
|
|
2469
2469
|
}
|
|
2470
|
-
perform(e, t,
|
|
2470
|
+
perform(e, t, n) {
|
|
2471
2471
|
switch (t) {
|
|
2472
2472
|
case "$presence:join":
|
|
2473
|
-
return this.join(e,
|
|
2473
|
+
return this.join(e, n);
|
|
2474
2474
|
case "$presence:leave":
|
|
2475
|
-
return this.leave(e,
|
|
2475
|
+
return this.leave(e, n);
|
|
2476
2476
|
case "$presence:info":
|
|
2477
|
-
return this.presence(e,
|
|
2477
|
+
return this.presence(e, n);
|
|
2478
2478
|
}
|
|
2479
|
-
return super.perform(e, t,
|
|
2479
|
+
return super.perform(e, t, n);
|
|
2480
2480
|
}
|
|
2481
2481
|
unsubscribe(e) {
|
|
2482
2482
|
return delete this.presenceInfo[e], super.unsubscribe(e);
|
|
2483
2483
|
}
|
|
2484
2484
|
buildSubscribeRequest(e) {
|
|
2485
|
-
let t = super.buildSubscribeRequest(e),
|
|
2486
|
-
|
|
2485
|
+
let t = super.buildSubscribeRequest(e), n = this.historyRequestFor(e);
|
|
2486
|
+
n && (t.history = n, this.pendingHistory[e] = !0);
|
|
2487
2487
|
let r = this.presenceInfo[e];
|
|
2488
2488
|
return r && (t.presence = r), t;
|
|
2489
2489
|
}
|
|
@@ -2492,18 +2492,18 @@ class Hs extends Gt {
|
|
|
2492
2492
|
return !!this.sessionId;
|
|
2493
2493
|
}
|
|
2494
2494
|
historyRequestFor(e) {
|
|
2495
|
-
let t = {},
|
|
2495
|
+
let t = {}, n = !1;
|
|
2496
2496
|
if (this.subscriptionStreams[e])
|
|
2497
2497
|
for (let r of this.subscriptionStreams[e]) {
|
|
2498
2498
|
let i = this.streamsPositions[r];
|
|
2499
|
-
i && (
|
|
2499
|
+
i && (n = !0, t[r] = i);
|
|
2500
2500
|
}
|
|
2501
|
-
if (!(!
|
|
2501
|
+
if (!(!n && !this.restoreSince))
|
|
2502
2502
|
return { since: this.restoreSince, streams: t };
|
|
2503
2503
|
}
|
|
2504
|
-
trackStreamPosition(e, t,
|
|
2505
|
-
if (!(!t || !
|
|
2506
|
-
return this.subscriptionStreams[e] || (this.subscriptionStreams[e] = /* @__PURE__ */ new Set()), this.subscriptionStreams[e].add(t), this.streamsPositions[t] = { epoch:
|
|
2504
|
+
trackStreamPosition(e, t, n, r) {
|
|
2505
|
+
if (!(!t || !n))
|
|
2506
|
+
return this.subscriptionStreams[e] || (this.subscriptionStreams[e] = /* @__PURE__ */ new Set()), this.subscriptionStreams[e].add(t), this.streamsPositions[t] = { epoch: n, offset: r }, { stream: t, epoch: n, offset: r };
|
|
2507
2507
|
}
|
|
2508
2508
|
// Send pongs asynchrounously—no need to block the main thread
|
|
2509
2509
|
async sendPong() {
|
|
@@ -2524,9 +2524,9 @@ class Hs extends Gt {
|
|
|
2524
2524
|
}), Promise.resolve();
|
|
2525
2525
|
}
|
|
2526
2526
|
presence(e, t) {
|
|
2527
|
-
return this.pendingPresence[e] ? (this.logger.warn("presence is already pending, skipping", e), Promise.reject(Error("presence request is already pending"))) : new Promise((
|
|
2527
|
+
return this.pendingPresence[e] ? (this.logger.warn("presence is already pending, skipping", e), Promise.reject(Error("presence request is already pending"))) : new Promise((n, r) => {
|
|
2528
2528
|
this.pendingPresence[e] = {
|
|
2529
|
-
resolve:
|
|
2529
|
+
resolve: n,
|
|
2530
2530
|
reject: r
|
|
2531
2531
|
}, this.cable.send({
|
|
2532
2532
|
command: "presence",
|
|
@@ -2567,14 +2567,14 @@ let Js = class {
|
|
|
2567
2567
|
constructor({
|
|
2568
2568
|
transport: e,
|
|
2569
2569
|
protocol: t,
|
|
2570
|
-
encoder:
|
|
2570
|
+
encoder: n,
|
|
2571
2571
|
logger: r,
|
|
2572
2572
|
lazy: i,
|
|
2573
2573
|
hubOptions: o,
|
|
2574
2574
|
performFailures: c,
|
|
2575
2575
|
transportConfigurator: h
|
|
2576
2576
|
}) {
|
|
2577
|
-
this.emitter = Re(), this.transport = e, this.encoder =
|
|
2577
|
+
this.emitter = Re(), this.transport = e, this.encoder = n, this.logger = r || new ue(), this.protocol = t, this.performFailures = c || "throw", this.protocol.attached(this), this.hub = new qs(o || {}), this[V] = "idle", this.handleClose = this.handleClose.bind(this), this.handleIncoming = this.handleIncoming.bind(this), this.transportConfigurator = h, this.transport.on("close", this.handleClose), this.transport.on("data", this.handleIncoming), this.initialConnect = !0, this.recovering = !1, i === !1 && this.connect().catch(() => {
|
|
2578
2578
|
});
|
|
2579
2579
|
}
|
|
2580
2580
|
get state() {
|
|
@@ -2592,8 +2592,8 @@ let Js = class {
|
|
|
2592
2592
|
this.transportConfigurator && await this.transportConfigurator(this.transport, {
|
|
2593
2593
|
initial: e
|
|
2594
2594
|
}), await this.transport.open();
|
|
2595
|
-
} catch (
|
|
2596
|
-
this.handleClose(
|
|
2595
|
+
} catch (n) {
|
|
2596
|
+
this.handleClose(n);
|
|
2597
2597
|
}
|
|
2598
2598
|
return t;
|
|
2599
2599
|
}
|
|
@@ -2618,11 +2618,11 @@ let Js = class {
|
|
|
2618
2618
|
new U("recovery_failed")
|
|
2619
2619
|
), this._resubscribe(r));
|
|
2620
2620
|
});
|
|
2621
|
-
let t = !this.initialConnect,
|
|
2622
|
-
this.recovering = !1, this.initialConnect = !1, this.emit("connect", { reconnect: t, restored:
|
|
2621
|
+
let t = !this.initialConnect, n = !0;
|
|
2622
|
+
this.recovering = !1, this.initialConnect = !1, this.emit("connect", { reconnect: t, restored: n });
|
|
2623
2623
|
}
|
|
2624
|
-
notify(e, t,
|
|
2625
|
-
t && typeof t != "string" && (
|
|
2624
|
+
notify(e, t, n) {
|
|
2625
|
+
t && typeof t != "string" && (n = t, t = void 0), t ? this.hub.notify(t, "info", { type: e, data: n }) : this.emit("info", { type: e, data: n });
|
|
2626
2626
|
}
|
|
2627
2627
|
handleClose(e) {
|
|
2628
2628
|
this.logger.debug("transport closed", { error: e }), this.disconnected(new U(e, "transport_closed"));
|
|
@@ -2636,8 +2636,8 @@ let Js = class {
|
|
|
2636
2636
|
if (this.state === "closed" || this.state === "idle") return;
|
|
2637
2637
|
let t;
|
|
2638
2638
|
e && (t = e instanceof U ? e : new U(e, void 0)), this.logger.info("closed", { reason: e || "user" }), this[V] = "closed";
|
|
2639
|
-
let
|
|
2640
|
-
this.hub.subscriptions.all().forEach((r) => r.notify("disconnected",
|
|
2639
|
+
let n = t || new U("cable_closed");
|
|
2640
|
+
this.hub.subscriptions.all().forEach((r) => r.notify("disconnected", n)), this.hub.close(), this.protocol.reset(), this.transport.close(), this.initialConnect = !0, this.emit("close", t);
|
|
2641
2641
|
}
|
|
2642
2642
|
disconnect() {
|
|
2643
2643
|
this.closed();
|
|
@@ -2651,10 +2651,10 @@ let Js = class {
|
|
|
2651
2651
|
return;
|
|
2652
2652
|
}
|
|
2653
2653
|
this.logger.debug("incoming data", t);
|
|
2654
|
-
let
|
|
2655
|
-
if (
|
|
2656
|
-
this.logger.debug("processed incoming message",
|
|
2657
|
-
let { type: r, identifier: i, message: o, meta: c } =
|
|
2654
|
+
let n = this.protocol.receive(t);
|
|
2655
|
+
if (n) {
|
|
2656
|
+
this.logger.debug("processed incoming message", n);
|
|
2657
|
+
let { type: r, identifier: i, message: o, meta: c } = n;
|
|
2658
2658
|
r ? this.hub.notify(i, r, o) : this.hub.transmit(i, o, c);
|
|
2659
2659
|
}
|
|
2660
2660
|
}
|
|
@@ -2680,23 +2680,23 @@ let Js = class {
|
|
|
2680
2680
|
return this.subscribe(t);
|
|
2681
2681
|
}
|
|
2682
2682
|
subscribeTo(e, t) {
|
|
2683
|
-
let
|
|
2684
|
-
return typeof e == "string" && (r = e, e = Ve),
|
|
2683
|
+
let n, r;
|
|
2684
|
+
return typeof e == "string" && (r = e, e = Ve), n = r ? new e(r, t) : new e(t), this.subscribe(n);
|
|
2685
2685
|
}
|
|
2686
2686
|
subscribe(e) {
|
|
2687
2687
|
if (!e.attached(this)) return e;
|
|
2688
2688
|
let t = e.identifier;
|
|
2689
2689
|
e.connecting();
|
|
2690
|
-
let
|
|
2690
|
+
let n = this.hub.subscriptions.get(t) || this.hub.subscriptions.create(t, {
|
|
2691
2691
|
subscribe: (r) => this._subscribe(r, e.channelId, e.params),
|
|
2692
2692
|
unsubscribe: (r) => this._unsubscribe(r)
|
|
2693
2693
|
});
|
|
2694
|
-
return
|
|
2694
|
+
return n.add(e), n.intent === "subscribed" && n.state === "connected" && e.connected(), n.ensureSubscribed(), e;
|
|
2695
2695
|
}
|
|
2696
2696
|
async _resubscribe(e) {
|
|
2697
2697
|
e.intent !== "subscribed" || !e.channels[0] || (e.notify("connecting"), e.ensureResubscribed());
|
|
2698
2698
|
}
|
|
2699
|
-
async _subscribe(e, t,
|
|
2699
|
+
async _subscribe(e, t, n) {
|
|
2700
2700
|
let r = e.id;
|
|
2701
2701
|
if (this.state === "idle" && this.connect().catch(() => {
|
|
2702
2702
|
}), this.state !== "connected") {
|
|
@@ -2725,11 +2725,11 @@ let Js = class {
|
|
|
2725
2725
|
}
|
|
2726
2726
|
let o = {
|
|
2727
2727
|
identifier: t,
|
|
2728
|
-
params:
|
|
2728
|
+
params: n
|
|
2729
2729
|
};
|
|
2730
2730
|
this.logger.debug("subscribing", o);
|
|
2731
2731
|
try {
|
|
2732
|
-
let c = await this.protocol.subscribe(t,
|
|
2732
|
+
let c = await this.protocol.subscribe(t, n);
|
|
2733
2733
|
this.hub.subscribe(r, c), this.logger.debug("subscribed", { ...o, remoteId: c }), e.notify("connected");
|
|
2734
2734
|
} catch (c) {
|
|
2735
2735
|
if (c) {
|
|
@@ -2750,38 +2750,38 @@ let Js = class {
|
|
|
2750
2750
|
i.release();
|
|
2751
2751
|
}
|
|
2752
2752
|
unsubscribe(e) {
|
|
2753
|
-
let t = e.identifier,
|
|
2754
|
-
if (!
|
|
2753
|
+
let t = e.identifier, n = this.hub.subscriptions.get(t);
|
|
2754
|
+
if (!n)
|
|
2755
2755
|
throw Error(`Subscription not found: ${t}`);
|
|
2756
|
-
|
|
2756
|
+
n.remove(e), e.closed(), n.maybeUnsubscribe();
|
|
2757
2757
|
}
|
|
2758
2758
|
async _unsubscribe(e) {
|
|
2759
2759
|
let t = e.id;
|
|
2760
2760
|
this.logger.debug("acquiring unsubscribe lock", { identifier: t });
|
|
2761
|
-
let
|
|
2762
|
-
if (
|
|
2763
|
-
this.logger.debug("unsubscribe lock has been canceled", { identifier: t }),
|
|
2761
|
+
let n = await e.acquire("unsubscribed");
|
|
2762
|
+
if (n.canceled) {
|
|
2763
|
+
this.logger.debug("unsubscribe lock has been canceled", { identifier: t }), n.release();
|
|
2764
2764
|
return;
|
|
2765
2765
|
}
|
|
2766
2766
|
if (this.logger.debug("unsubscribe lock has been acquired", { identifier: t }), e.intent !== "unsubscribed") {
|
|
2767
2767
|
this.logger.debug("cancel unsubscribe, no longer needed", {
|
|
2768
2768
|
identifier: t,
|
|
2769
2769
|
intent: e.intent
|
|
2770
|
-
}),
|
|
2770
|
+
}), n.release();
|
|
2771
2771
|
return;
|
|
2772
2772
|
}
|
|
2773
2773
|
if (e.state === "disconnected" || e.state === "closed") {
|
|
2774
2774
|
this.logger.debug(
|
|
2775
2775
|
`already ${e.state} connected, skip unsubscribe command`,
|
|
2776
2776
|
{ identifier: t }
|
|
2777
|
-
),
|
|
2777
|
+
), n.release();
|
|
2778
2778
|
return;
|
|
2779
2779
|
}
|
|
2780
2780
|
let r = e.remoteId;
|
|
2781
2781
|
if (this.logger.debug("unsubscribing...", { remoteId: r }), this.state !== "connected") {
|
|
2782
2782
|
this.logger.debug("unsubscribe skipped (cable is not connected)", {
|
|
2783
2783
|
id: t
|
|
2784
|
-
}), e.close(), this.hub.unsubscribe(t),
|
|
2784
|
+
}), e.close(), this.hub.unsubscribe(t), n.release();
|
|
2785
2785
|
return;
|
|
2786
2786
|
}
|
|
2787
2787
|
try {
|
|
@@ -2795,19 +2795,19 @@ let Js = class {
|
|
|
2795
2795
|
error: i
|
|
2796
2796
|
}));
|
|
2797
2797
|
}
|
|
2798
|
-
e.intent === "unsubscribed" ? (e.close(), this.hub.unsubscribe(t)) : e.state = "closed",
|
|
2798
|
+
e.intent === "unsubscribed" ? (e.close(), this.hub.unsubscribe(t)) : e.state = "closed", n.release();
|
|
2799
2799
|
}
|
|
2800
|
-
async perform(e, t,
|
|
2800
|
+
async perform(e, t, n) {
|
|
2801
2801
|
if (this.performFailures === "throw")
|
|
2802
|
-
return this._perform(e, t,
|
|
2802
|
+
return this._perform(e, t, n);
|
|
2803
2803
|
try {
|
|
2804
|
-
return await this._perform(e, t,
|
|
2804
|
+
return await this._perform(e, t, n);
|
|
2805
2805
|
} catch (r) {
|
|
2806
2806
|
this.performFailures === "warn" && this.logger.warn("perform failed", { error: r });
|
|
2807
2807
|
return;
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
|
-
async _perform(e, t,
|
|
2810
|
+
async _perform(e, t, n) {
|
|
2811
2811
|
if (this.state === "connecting" && await this.pendingConnect(), this.state === "closed" || this.state === "disconnected")
|
|
2812
2812
|
throw new zs();
|
|
2813
2813
|
let r = this.hub.subscriptions.get(e);
|
|
@@ -2818,11 +2818,11 @@ let Js = class {
|
|
|
2818
2818
|
let i = r.remoteId, o = {
|
|
2819
2819
|
id: i,
|
|
2820
2820
|
action: t,
|
|
2821
|
-
payload:
|
|
2821
|
+
payload: n
|
|
2822
2822
|
};
|
|
2823
2823
|
this.logger.debug("perform", o);
|
|
2824
2824
|
try {
|
|
2825
|
-
let c = await this.protocol.perform(i, t,
|
|
2825
|
+
let c = await this.protocol.perform(i, t, n);
|
|
2826
2826
|
return c && this.logger.debug("perform result", {
|
|
2827
2827
|
message: c,
|
|
2828
2828
|
request: o
|
|
@@ -2838,28 +2838,28 @@ let Js = class {
|
|
|
2838
2838
|
return this.emitter.on(e, t);
|
|
2839
2839
|
}
|
|
2840
2840
|
once(e, t) {
|
|
2841
|
-
let
|
|
2842
|
-
|
|
2841
|
+
let n = this.emitter.on(e, (...r) => {
|
|
2842
|
+
n(), t(...r);
|
|
2843
2843
|
});
|
|
2844
|
-
return
|
|
2844
|
+
return n;
|
|
2845
2845
|
}
|
|
2846
2846
|
emit(e, ...t) {
|
|
2847
2847
|
return this.emitter.emit(e, ...t);
|
|
2848
2848
|
}
|
|
2849
2849
|
pendingConnect() {
|
|
2850
2850
|
return this._pendingConnect ? this._pendingConnect : (this._pendingConnect = new Promise((e, t) => {
|
|
2851
|
-
let
|
|
2852
|
-
|
|
2851
|
+
let n = [() => delete this._pendingConnect];
|
|
2852
|
+
n.push(
|
|
2853
2853
|
this.on("connect", () => {
|
|
2854
|
-
|
|
2854
|
+
n.forEach((r) => r()), e();
|
|
2855
2855
|
})
|
|
2856
|
-
),
|
|
2856
|
+
), n.push(
|
|
2857
2857
|
this.on("close", (r) => {
|
|
2858
|
-
|
|
2858
|
+
n.forEach((i) => i()), t(r);
|
|
2859
2859
|
})
|
|
2860
|
-
),
|
|
2860
|
+
), n.push(
|
|
2861
2861
|
this.on("disconnect", (r) => {
|
|
2862
|
-
|
|
2862
|
+
n.forEach((i) => i()), t(r);
|
|
2863
2863
|
})
|
|
2864
2864
|
);
|
|
2865
2865
|
}), this._pendingConnect);
|
|
@@ -2868,11 +2868,11 @@ let Js = class {
|
|
|
2868
2868
|
const Ws = {
|
|
2869
2869
|
maxMissingPings: 2,
|
|
2870
2870
|
maxReconnectAttempts: 1 / 0
|
|
2871
|
-
}, Z = () => Date.now(), Qt = (
|
|
2871
|
+
}, Z = () => Date.now(), Qt = (s, e) => {
|
|
2872
2872
|
e = e || {};
|
|
2873
|
-
let { backoffRate: t, jitterRatio:
|
|
2874
|
-
return t = t || 2,
|
|
2875
|
-
let o =
|
|
2873
|
+
let { backoffRate: t, jitterRatio: n, maxInterval: r } = e;
|
|
2874
|
+
return t = t || 2, n === void 0 && (n = 0.5), (i) => {
|
|
2875
|
+
let o = s * t ** i, c = o * t, h = o + (c - o) * Math.random(), u = 2 * (Math.random() - 0.5) * n;
|
|
2876
2876
|
return h = h * (1 + u), r && r < h && (h = r), h;
|
|
2877
2877
|
};
|
|
2878
2878
|
};
|
|
@@ -2955,9 +2955,9 @@ class Ks {
|
|
|
2955
2955
|
try {
|
|
2956
2956
|
this.transport = t, this.resetListeners(), this.logger.debug(`Trying to connect via ${t.displayName()}`), await t.open(), this.logger.debug(`Connected via ${t.displayName()}`);
|
|
2957
2957
|
return;
|
|
2958
|
-
} catch (
|
|
2958
|
+
} catch (n) {
|
|
2959
2959
|
this.logger.debug(
|
|
2960
|
-
`Failed to connect via ${t.displayName()}: ${
|
|
2960
|
+
`Failed to connect via ${t.displayName()}: ${n.message}`
|
|
2961
2961
|
);
|
|
2962
2962
|
}
|
|
2963
2963
|
}
|
|
@@ -2977,23 +2977,23 @@ class Ks {
|
|
|
2977
2977
|
throw new Error("Not implemented. Set URL for each transport separately");
|
|
2978
2978
|
}
|
|
2979
2979
|
setParam(e, t) {
|
|
2980
|
-
this.transports.forEach((
|
|
2981
|
-
|
|
2980
|
+
this.transports.forEach((n) => {
|
|
2981
|
+
n.setParam(e, t);
|
|
2982
2982
|
});
|
|
2983
2983
|
}
|
|
2984
2984
|
setToken(e, t) {
|
|
2985
|
-
this.transports.forEach((
|
|
2986
|
-
|
|
2985
|
+
this.transports.forEach((n) => {
|
|
2986
|
+
n.setToken(e, t);
|
|
2987
2987
|
});
|
|
2988
2988
|
}
|
|
2989
2989
|
on(e, t) {
|
|
2990
2990
|
return this.emitter.on(e, t);
|
|
2991
2991
|
}
|
|
2992
2992
|
once(e, t) {
|
|
2993
|
-
let
|
|
2994
|
-
|
|
2993
|
+
let n = this.emitter.on(e, (...r) => {
|
|
2994
|
+
n(), t(...r);
|
|
2995
2995
|
});
|
|
2996
|
-
return
|
|
2996
|
+
return n;
|
|
2997
2997
|
}
|
|
2998
2998
|
get url() {
|
|
2999
2999
|
return this.transport ? this.transport.url : "";
|
|
@@ -3018,9 +3018,9 @@ class Ks {
|
|
|
3018
3018
|
class Xs {
|
|
3019
3019
|
constructor(e, t = {}) {
|
|
3020
3020
|
this.url = e;
|
|
3021
|
-
let
|
|
3022
|
-
if (
|
|
3023
|
-
this.Impl =
|
|
3021
|
+
let n = t.websocketImplementation;
|
|
3022
|
+
if (n)
|
|
3023
|
+
this.Impl = n;
|
|
3024
3024
|
else if (typeof WebSocket < "u")
|
|
3025
3025
|
this.Impl = WebSocket;
|
|
3026
3026
|
else
|
|
@@ -3034,7 +3034,7 @@ class Xs {
|
|
|
3034
3034
|
}
|
|
3035
3035
|
open() {
|
|
3036
3036
|
let e = this.subprotocol;
|
|
3037
|
-
return this.authStrategy === "sub-protocol" && (e = [this.subprotocol, this.authProtocol]), this.connectionOptions ? this.ws = new this.Impl(this.url, e, this.connectionOptions) : this.ws = new this.Impl(this.url, e), this.ws.binaryType = "arraybuffer", this.initListeners(), new Promise((t,
|
|
3037
|
+
return this.authStrategy === "sub-protocol" && (e = [this.subprotocol, this.authProtocol]), this.connectionOptions ? this.ws = new this.Impl(this.url, e, this.connectionOptions) : this.ws = new this.Impl(this.url, e), this.ws.binaryType = "arraybuffer", this.initListeners(), new Promise((t, n) => {
|
|
3038
3038
|
let r = [];
|
|
3039
3039
|
r.push(
|
|
3040
3040
|
this.once("open", () => {
|
|
@@ -3042,7 +3042,7 @@ class Xs {
|
|
|
3042
3042
|
})
|
|
3043
3043
|
), r.push(
|
|
3044
3044
|
this.once("close", () => {
|
|
3045
|
-
r.forEach((i) => i()),
|
|
3045
|
+
r.forEach((i) => i()), n(Error("WS connection closed"));
|
|
3046
3046
|
})
|
|
3047
3047
|
);
|
|
3048
3048
|
});
|
|
@@ -3051,9 +3051,9 @@ class Xs {
|
|
|
3051
3051
|
this.url = e;
|
|
3052
3052
|
}
|
|
3053
3053
|
setParam(e, t) {
|
|
3054
|
-
let
|
|
3055
|
-
|
|
3056
|
-
let r = `${
|
|
3054
|
+
let n = new URL(this.url);
|
|
3055
|
+
n.searchParams.set(e, t);
|
|
3056
|
+
let r = `${n.protocol}//${n.host}${n.pathname}?${n.searchParams}`;
|
|
3057
3057
|
this.setURL(r);
|
|
3058
3058
|
}
|
|
3059
3059
|
setToken(e, t = "jid") {
|
|
@@ -3061,10 +3061,10 @@ class Xs {
|
|
|
3061
3061
|
this.setParam(t, e);
|
|
3062
3062
|
else if (this.authStrategy === "header") {
|
|
3063
3063
|
this.connectionOptions = this.connectionOptions || {}, this.connectionOptions.headers = this.connectionOptions.headers || {};
|
|
3064
|
-
let
|
|
3065
|
-
|
|
3066
|
-
(i) => i.toLowerCase() ===
|
|
3067
|
-
) ||
|
|
3064
|
+
let n = `x-${t}`.toLowerCase();
|
|
3065
|
+
n = Object.keys(this.connectionOptions.headers).find(
|
|
3066
|
+
(i) => i.toLowerCase() === n
|
|
3067
|
+
) || n, this.connectionOptions.headers[n] = e;
|
|
3068
3068
|
} else if (this.authStrategy === "sub-protocol")
|
|
3069
3069
|
this.authProtocol = `anycable-token.${e}`;
|
|
3070
3070
|
else
|
|
@@ -3082,10 +3082,10 @@ class Xs {
|
|
|
3082
3082
|
return this.emitter.on(e, t);
|
|
3083
3083
|
}
|
|
3084
3084
|
once(e, t) {
|
|
3085
|
-
let
|
|
3086
|
-
|
|
3085
|
+
let n = this.emitter.on(e, (...r) => {
|
|
3086
|
+
n(), t(...r);
|
|
3087
3087
|
});
|
|
3088
|
-
return
|
|
3088
|
+
return n;
|
|
3089
3089
|
}
|
|
3090
3090
|
initListeners() {
|
|
3091
3091
|
this.ws.onerror = (e) => {
|
|
@@ -3111,12 +3111,12 @@ const Yt = {
|
|
|
3111
3111
|
logLevel: "warn",
|
|
3112
3112
|
lazy: !0
|
|
3113
3113
|
};
|
|
3114
|
-
function Gs(
|
|
3115
|
-
if (typeof
|
|
3114
|
+
function Gs(s, e) {
|
|
3115
|
+
if (typeof s == "object" && typeof e > "u" && (e = s, s = void 0), e = e || {}, !s && !e.transport) throw Error("URL or transport must be specified");
|
|
3116
3116
|
e = Object.assign({}, Yt, e);
|
|
3117
3117
|
let {
|
|
3118
3118
|
protocol: t,
|
|
3119
|
-
websocketImplementation:
|
|
3119
|
+
websocketImplementation: n,
|
|
3120
3120
|
websocketFormat: r,
|
|
3121
3121
|
websocketOptions: i,
|
|
3122
3122
|
websocketAuthStrategy: o,
|
|
@@ -3130,7 +3130,7 @@ function Gs(n, e) {
|
|
|
3130
3130
|
pingInterval: d,
|
|
3131
3131
|
reconnectStrategy: m,
|
|
3132
3132
|
maxMissingPings: p,
|
|
3133
|
-
maxReconnectAttempts:
|
|
3133
|
+
maxReconnectAttempts: w,
|
|
3134
3134
|
subprotocol: S,
|
|
3135
3135
|
tokenRefresher: x,
|
|
3136
3136
|
historyTimestamp: O,
|
|
@@ -3169,8 +3169,8 @@ function Gs(n, e) {
|
|
|
3169
3169
|
throw Error(`Protocol is not supported yet: ${t}`);
|
|
3170
3170
|
}
|
|
3171
3171
|
if (!t) throw Error("Protocol must be specified");
|
|
3172
|
-
a = a || new Xs(
|
|
3173
|
-
websocketImplementation:
|
|
3172
|
+
a = a || new Xs(s, {
|
|
3173
|
+
websocketImplementation: n,
|
|
3174
3174
|
websocketOptions: i,
|
|
3175
3175
|
subprotocol: S,
|
|
3176
3176
|
authStrategy: o,
|
|
@@ -3179,7 +3179,7 @@ function Gs(n, e) {
|
|
|
3179
3179
|
pingInterval: d,
|
|
3180
3180
|
reconnectStrategy: m,
|
|
3181
3181
|
maxMissingPings: p,
|
|
3182
|
-
maxReconnectAttempts:
|
|
3182
|
+
maxReconnectAttempts: w,
|
|
3183
3183
|
logger: u
|
|
3184
3184
|
}));
|
|
3185
3185
|
let X = { concurrentSubscribes: F }, k = new Js({
|
|
@@ -3202,15 +3202,15 @@ function Gs(n, e) {
|
|
|
3202
3202
|
}), !0;
|
|
3203
3203
|
}), k;
|
|
3204
3204
|
}
|
|
3205
|
-
function Qs(
|
|
3205
|
+
function Qs(s, e) {
|
|
3206
3206
|
let t = !1;
|
|
3207
|
-
|
|
3208
|
-
if (
|
|
3207
|
+
s.on("connect", () => t = !1), s.on("close", async (n) => {
|
|
3208
|
+
if (n) {
|
|
3209
3209
|
if (t) {
|
|
3210
|
-
|
|
3210
|
+
s.logger.warn("Token auto-refresh is disabled", n);
|
|
3211
3211
|
return;
|
|
3212
3212
|
}
|
|
3213
|
-
|
|
3213
|
+
n.reason === "token_expired" && (t = !0, await e());
|
|
3214
3214
|
}
|
|
3215
3215
|
});
|
|
3216
3216
|
}
|
|
@@ -3235,8 +3235,8 @@ class Zs {
|
|
|
3235
3235
|
}
|
|
3236
3236
|
}
|
|
3237
3237
|
class Ys extends Ve {
|
|
3238
|
-
constructor(e, t,
|
|
3239
|
-
super(e, t), this.subscription = new Zs(this), Object.assign(this.subscription,
|
|
3238
|
+
constructor(e, t, n) {
|
|
3239
|
+
super(e, t), this.subscription = new Zs(this), Object.assign(this.subscription, n), this.on(
|
|
3240
3240
|
"connect",
|
|
3241
3241
|
({ reconnect: r }) => this.subscription.notify("connected", { reconnected: r })
|
|
3242
3242
|
), this.on(
|
|
@@ -3252,9 +3252,9 @@ class er {
|
|
|
3252
3252
|
this.cable = e;
|
|
3253
3253
|
}
|
|
3254
3254
|
create(e, t) {
|
|
3255
|
-
let
|
|
3256
|
-
typeof e == "object" ? (
|
|
3257
|
-
let i = new Ys(
|
|
3255
|
+
let n, r;
|
|
3256
|
+
typeof e == "object" ? (n = e.channel, delete e.channel, r = e) : (n = e, r = {});
|
|
3257
|
+
let i = new Ys(n, r, t);
|
|
3258
3258
|
return i.subscription.notify("initialized"), this.cable.subscribe(i), i.subscription;
|
|
3259
3259
|
}
|
|
3260
3260
|
findAll(e) {
|
|
@@ -3267,8 +3267,8 @@ class tr {
|
|
|
3267
3267
|
}
|
|
3268
3268
|
}
|
|
3269
3269
|
class nr extends Xt {
|
|
3270
|
-
writeLogEntry(e, t,
|
|
3271
|
-
|
|
3270
|
+
writeLogEntry(e, t, n) {
|
|
3271
|
+
n ? console[e](t, n) : console[e](t);
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
3274
|
class sr extends Zt {
|
|
@@ -3281,9 +3281,9 @@ class sr extends Zt {
|
|
|
3281
3281
|
document.hidden || this.reconnectNow() && this.logger.debug("Trigger reconnect due to visibility change");
|
|
3282
3282
|
}, t = (r) => {
|
|
3283
3283
|
this.reconnectNow() && this.logger.debug("Trigger reconnect", { event: r });
|
|
3284
|
-
},
|
|
3285
|
-
document.addEventListener("visibilitychange", e, !1), window.addEventListener("focus", t, !1), window.addEventListener("online", t, !1), window.addEventListener("resume", t, !1), window.addEventListener("freeze",
|
|
3286
|
-
document.removeEventListener("visibilitychange", e, !1), window.removeEventListener("focus", t, !1), window.removeEventListener("online", t, !1), window.removeEventListener("resume", t, !1), window.removeEventListener("freeze",
|
|
3284
|
+
}, n = () => this.disconnect(new U("page_frozen"));
|
|
3285
|
+
document.addEventListener("visibilitychange", e, !1), window.addEventListener("focus", t, !1), window.addEventListener("online", t, !1), window.addEventListener("resume", t, !1), window.addEventListener("freeze", n, !1), this.unbind.push(() => {
|
|
3286
|
+
document.removeEventListener("visibilitychange", e, !1), window.removeEventListener("focus", t, !1), window.removeEventListener("online", t, !1), window.removeEventListener("resume", t, !1), window.removeEventListener("freeze", n, !1);
|
|
3287
3287
|
});
|
|
3288
3288
|
}
|
|
3289
3289
|
}
|
|
@@ -3291,24 +3291,24 @@ class sr extends Zt {
|
|
|
3291
3291
|
this.state === "disconnected" || this.state === "closed" || (this.logger.info("Disconnecting", { reason: e.message }), this.cancelReconnect(), this.stopPolling(), this.state = "pending_disconnect", this.target.disconnected(e));
|
|
3292
3292
|
}
|
|
3293
3293
|
}
|
|
3294
|
-
const rr = ["cable", "action-cable"], ir = "/cable", Oe = (
|
|
3294
|
+
const rr = ["cable", "action-cable"], ir = "/cable", Oe = (s, e) => {
|
|
3295
3295
|
for (let t of rr) {
|
|
3296
|
-
let
|
|
3297
|
-
if (
|
|
3298
|
-
return
|
|
3296
|
+
let n = s.head.querySelector(`meta[name='${t}-${e}']`);
|
|
3297
|
+
if (n)
|
|
3298
|
+
return n.getAttribute("content");
|
|
3299
3299
|
}
|
|
3300
|
-
}, mt = (
|
|
3300
|
+
}, mt = (s) => s.match(/wss?:\/\//) ? s : typeof window < "u" ? `${window.location.protocol.replace("http", "ws")}//${window.location.host}${s}` : s, or = () => {
|
|
3301
3301
|
if (typeof document < "u" && document.head) {
|
|
3302
|
-
let
|
|
3303
|
-
if (
|
|
3304
|
-
return mt(
|
|
3302
|
+
let s = Oe(document, "url");
|
|
3303
|
+
if (s)
|
|
3304
|
+
return mt(s);
|
|
3305
3305
|
}
|
|
3306
3306
|
return mt(ir);
|
|
3307
3307
|
}, cr = () => {
|
|
3308
3308
|
if (typeof document < "u" && document.head) {
|
|
3309
|
-
let
|
|
3310
|
-
if (
|
|
3311
|
-
return
|
|
3309
|
+
let s = Oe(document, "history-timestamp");
|
|
3310
|
+
if (s)
|
|
3311
|
+
return s | 0;
|
|
3312
3312
|
}
|
|
3313
3313
|
}, ar = () => {
|
|
3314
3314
|
if (typeof document < "u" && document.head)
|
|
@@ -3317,8 +3317,8 @@ const rr = ["cable", "action-cable"], ir = "/cable", Oe = (n, e) => {
|
|
|
3317
3317
|
if (typeof document < "u" && document.head)
|
|
3318
3318
|
return Oe(document, "token-param");
|
|
3319
3319
|
};
|
|
3320
|
-
function ur(
|
|
3321
|
-
typeof
|
|
3320
|
+
function ur(s, e) {
|
|
3321
|
+
typeof s == "object" && typeof e > "u" && (e = s, s = void 0), s = s || or(), e = e || {}, e.historyTimestamp || (e.historyTimestamp = cr());
|
|
3322
3322
|
let t = ar();
|
|
3323
3323
|
if (t) {
|
|
3324
3324
|
let u = lr();
|
|
@@ -3326,23 +3326,23 @@ function ur(n, e) {
|
|
|
3326
3326
|
}
|
|
3327
3327
|
e = Object.assign({}, Yt, e);
|
|
3328
3328
|
let {
|
|
3329
|
-
logLevel:
|
|
3329
|
+
logLevel: n,
|
|
3330
3330
|
logger: r,
|
|
3331
3331
|
pingInterval: i,
|
|
3332
3332
|
reconnectStrategy: o,
|
|
3333
3333
|
maxMissingPings: c,
|
|
3334
3334
|
maxReconnectAttempts: h
|
|
3335
3335
|
} = e;
|
|
3336
|
-
return r = e.logger = e.logger || new nr(
|
|
3336
|
+
return r = e.logger = e.logger || new nr(n), o = e.reconnectStrategy = e.reconnectStrategy || Qt(i), e.monitor !== !1 && (e.monitor = e.monitor || new sr({
|
|
3337
3337
|
pingInterval: i,
|
|
3338
3338
|
reconnectStrategy: o,
|
|
3339
3339
|
maxMissingPings: c,
|
|
3340
3340
|
maxReconnectAttempts: h,
|
|
3341
3341
|
logger: r
|
|
3342
|
-
})), Gs(
|
|
3342
|
+
})), Gs(s, e);
|
|
3343
3343
|
}
|
|
3344
|
-
function hr(
|
|
3345
|
-
let t = ur(
|
|
3344
|
+
function hr(s, e) {
|
|
3345
|
+
let t = ur(s, e);
|
|
3346
3346
|
return new tr(t);
|
|
3347
3347
|
}
|
|
3348
3348
|
class pi {
|
|
@@ -3352,7 +3352,7 @@ class pi {
|
|
|
3352
3352
|
disconnect() {
|
|
3353
3353
|
this._cable && (this._cable.cable.disconnect(), this._cable = null);
|
|
3354
3354
|
}
|
|
3355
|
-
createSubscription(e, t,
|
|
3355
|
+
createSubscription(e, t, n = {}, r = {}) {
|
|
3356
3356
|
return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(
|
|
3357
3357
|
(i) => {
|
|
3358
3358
|
if (i && OpenC3Auth.setTokens(), this._cable == null) {
|
|
@@ -3364,7 +3364,7 @@ class pi {
|
|
|
3364
3364
|
channel: e,
|
|
3365
3365
|
...r
|
|
3366
3366
|
},
|
|
3367
|
-
|
|
3367
|
+
n
|
|
3368
3368
|
);
|
|
3369
3369
|
}
|
|
3370
3370
|
);
|
|
@@ -3373,8 +3373,8 @@ class pi {
|
|
|
3373
3373
|
}
|
|
3374
3374
|
}
|
|
3375
3375
|
class gt {
|
|
3376
|
-
constructor(e, t,
|
|
3377
|
-
this.keyword = e.keyword, this.parameters = e.parameters, this.filename = e.filename, this.line = e.line, this.lineNumber = e.lineNumber, this.message = t, this.usage =
|
|
3376
|
+
constructor(e, t, n = "", r = "") {
|
|
3377
|
+
this.keyword = e.keyword, this.parameters = e.parameters, this.filename = e.filename, this.line = e.line, this.lineNumber = e.lineNumber, this.message = t, this.usage = n, this.url = r;
|
|
3378
3378
|
}
|
|
3379
3379
|
}
|
|
3380
3380
|
class mi {
|
|
@@ -3386,20 +3386,20 @@ class mi {
|
|
|
3386
3386
|
$(this, "lineNumber", 0);
|
|
3387
3387
|
$(this, "url", "https://docs.openc3.com/docs/configuration");
|
|
3388
3388
|
}
|
|
3389
|
-
verify_num_parameters(e, t,
|
|
3389
|
+
verify_num_parameters(e, t, n = "") {
|
|
3390
3390
|
for (let r = 1; r <= e; r++)
|
|
3391
3391
|
if (this.parameters[r - 1] === void 0)
|
|
3392
3392
|
throw new gt(
|
|
3393
3393
|
this,
|
|
3394
3394
|
`Not enough parameters for ${this.keyword}.`,
|
|
3395
|
-
|
|
3395
|
+
n,
|
|
3396
3396
|
this.url
|
|
3397
3397
|
);
|
|
3398
3398
|
if (t && this.parameters[t] !== void 0)
|
|
3399
3399
|
throw new gt(
|
|
3400
3400
|
this,
|
|
3401
3401
|
`Too many parameters for ${this.keyword}.`,
|
|
3402
|
-
|
|
3402
|
+
n,
|
|
3403
3403
|
this.url
|
|
3404
3404
|
);
|
|
3405
3405
|
}
|
|
@@ -3409,17 +3409,17 @@ class mi {
|
|
|
3409
3409
|
let t = e.charAt(0);
|
|
3410
3410
|
if (t !== '"' && t !== "'")
|
|
3411
3411
|
return e;
|
|
3412
|
-
let
|
|
3413
|
-
return t !==
|
|
3412
|
+
let n = e.charAt(e.length - 1);
|
|
3413
|
+
return t !== n ? e : e.substring(1, e.length - 1);
|
|
3414
3414
|
}
|
|
3415
3415
|
scan_string(e, t) {
|
|
3416
3416
|
if (!t.global) throw "rx must have 'global' flag set";
|
|
3417
|
-
let
|
|
3417
|
+
let n = [];
|
|
3418
3418
|
return e.replace(t, function(r) {
|
|
3419
|
-
return
|
|
3420
|
-
}),
|
|
3419
|
+
return n.push(r), r;
|
|
3420
|
+
}), n;
|
|
3421
3421
|
}
|
|
3422
|
-
parse_string(e, t,
|
|
3422
|
+
parse_string(e, t, n, r, i) {
|
|
3423
3423
|
let o = !1;
|
|
3424
3424
|
this.line = "", this.keyword = null, this.parameters = [], this.filename = t;
|
|
3425
3425
|
let c = e.split(`
|
|
@@ -3428,7 +3428,7 @@ class mi {
|
|
|
3428
3428
|
this.lineNumber = u + 1;
|
|
3429
3429
|
let a = c[u].trim();
|
|
3430
3430
|
if (a.length === 0) {
|
|
3431
|
-
|
|
3431
|
+
n && i(null, [], this.line, this.lineNumber);
|
|
3432
3432
|
continue;
|
|
3433
3433
|
}
|
|
3434
3434
|
if (o === !0) {
|
|
@@ -3442,8 +3442,8 @@ class mi {
|
|
|
3442
3442
|
g = !0;
|
|
3443
3443
|
// Deliberate fall through
|
|
3444
3444
|
case "\\":
|
|
3445
|
-
let
|
|
3446
|
-
this.line +=
|
|
3445
|
+
let w = a.substring(0, a.length - 1).trim();
|
|
3446
|
+
this.line += w.substring(0, w.length - 1), g && (this.line += `
|
|
3447
3447
|
`), o = !0;
|
|
3448
3448
|
continue;
|
|
3449
3449
|
case "&":
|
|
@@ -3455,13 +3455,13 @@ class mi {
|
|
|
3455
3455
|
o = !1;
|
|
3456
3456
|
let b = /("([^\\"]|\\.)*")|('([^\\']|\\.)*')|\S+/g, d = this.scan_string(this.line, b), m = "";
|
|
3457
3457
|
if (d.length > 0 && (m = m + d[0]), m.length === 0 || m.charAt(0) === "#" ? this.keyword = null : this.keyword = m.toUpperCase(), this.parameters = [], this.keyword === null) {
|
|
3458
|
-
|
|
3458
|
+
n && i(this.keyword, this.parameters, this.line, this.lineNumber), this.line = "";
|
|
3459
3459
|
continue;
|
|
3460
3460
|
}
|
|
3461
3461
|
let p = d.length;
|
|
3462
3462
|
if (p > 1)
|
|
3463
|
-
for (let
|
|
3464
|
-
let S = d[
|
|
3463
|
+
for (let w = 1; w < p; w++) {
|
|
3464
|
+
let S = d[w];
|
|
3465
3465
|
if (S.length > 0 && S.charAt(0) === "#")
|
|
3466
3466
|
break;
|
|
3467
3467
|
r ? this.parameters.push(this.remove_quotes(S)) : this.parameters.push(S);
|
|
@@ -3471,49 +3471,49 @@ class mi {
|
|
|
3471
3471
|
}
|
|
3472
3472
|
// parse_string
|
|
3473
3473
|
}
|
|
3474
|
-
function re(
|
|
3475
|
-
return dr.test(
|
|
3474
|
+
function re(s) {
|
|
3475
|
+
return dr.test(s);
|
|
3476
3476
|
}
|
|
3477
3477
|
const dr = /^-?[0-9]+$/;
|
|
3478
|
-
function en(
|
|
3479
|
-
return fr.test(
|
|
3478
|
+
function en(s) {
|
|
3479
|
+
return fr.test(s);
|
|
3480
3480
|
}
|
|
3481
3481
|
const fr = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
3482
|
-
function tn(
|
|
3483
|
-
if (re(
|
|
3484
|
-
return Number.isSafeInteger(Number.parseInt(
|
|
3485
|
-
const t = Number.parseFloat(
|
|
3486
|
-
if (
|
|
3482
|
+
function tn(s, e) {
|
|
3483
|
+
if (re(s))
|
|
3484
|
+
return Number.isSafeInteger(Number.parseInt(s, 10));
|
|
3485
|
+
const t = Number.parseFloat(s), n = String(t);
|
|
3486
|
+
if (s === n)
|
|
3487
3487
|
return !0;
|
|
3488
|
-
const r = bt(
|
|
3489
|
-
return !!(r === i || (e == null ? void 0 : e.approx) === !0 && !re(
|
|
3488
|
+
const r = bt(s), i = bt(n);
|
|
3489
|
+
return !!(r === i || (e == null ? void 0 : e.approx) === !0 && !re(s) && i.length >= 14 && r.startsWith(i.substring(0, 14)));
|
|
3490
3490
|
}
|
|
3491
|
-
let se = /* @__PURE__ */
|
|
3492
|
-
return
|
|
3493
|
-
}
|
|
3494
|
-
function pr(
|
|
3495
|
-
if (tn(
|
|
3491
|
+
let se = /* @__PURE__ */ function(s) {
|
|
3492
|
+
return s.underflow = "underflow", s.overflow = "overflow", s.truncate_integer = "truncate_integer", s.truncate_float = "truncate_float", s;
|
|
3493
|
+
}({});
|
|
3494
|
+
function pr(s) {
|
|
3495
|
+
if (tn(s, {
|
|
3496
3496
|
approx: !1
|
|
3497
3497
|
}))
|
|
3498
3498
|
return;
|
|
3499
|
-
if (re(
|
|
3499
|
+
if (re(s))
|
|
3500
3500
|
return se.truncate_integer;
|
|
3501
|
-
const e = Number.parseFloat(
|
|
3501
|
+
const e = Number.parseFloat(s);
|
|
3502
3502
|
return Number.isFinite(e) ? e === 0 ? se.underflow : se.truncate_float : se.overflow;
|
|
3503
3503
|
}
|
|
3504
|
-
function bt(
|
|
3504
|
+
function bt(s) {
|
|
3505
3505
|
const {
|
|
3506
3506
|
start: e,
|
|
3507
3507
|
end: t
|
|
3508
|
-
} = mr(
|
|
3509
|
-
return r === -1 ?
|
|
3508
|
+
} = mr(s), n = s.substring(e, t), r = n.indexOf(".");
|
|
3509
|
+
return r === -1 ? n : n.substring(0, r) + n.substring(r + 1);
|
|
3510
3510
|
}
|
|
3511
|
-
function mr(
|
|
3511
|
+
function mr(s) {
|
|
3512
3512
|
let e = 0;
|
|
3513
|
-
for (
|
|
3513
|
+
for (s[0] === "-" && e++; s[e] === "0" || s[e] === "."; )
|
|
3514
3514
|
e++;
|
|
3515
|
-
let t =
|
|
3516
|
-
for (t === -1 && (t =
|
|
3515
|
+
let t = s.lastIndexOf("e");
|
|
3516
|
+
for (t === -1 && (t = s.lastIndexOf("E")), t === -1 && (t = s.length); (s[t - 1] === "0" || s[t - 1] === ".") && t > e; )
|
|
3517
3517
|
t--;
|
|
3518
3518
|
return {
|
|
3519
3519
|
start: e,
|
|
@@ -3558,44 +3558,44 @@ class gr {
|
|
|
3558
3558
|
// or use that, it cannot safely turn the numeric value in the string into
|
|
3559
3559
|
// stringified JSON since it has to be parsed into a number first.
|
|
3560
3560
|
}
|
|
3561
|
-
function br(
|
|
3562
|
-
return
|
|
3561
|
+
function br(s) {
|
|
3562
|
+
return s && typeof s == "object" && s.isLosslessNumber || !1;
|
|
3563
3563
|
}
|
|
3564
|
-
function yr(
|
|
3565
|
-
return new gr(
|
|
3564
|
+
function yr(s) {
|
|
3565
|
+
return new gr(s);
|
|
3566
3566
|
}
|
|
3567
|
-
function
|
|
3567
|
+
function _r(s, e) {
|
|
3568
3568
|
return Je({
|
|
3569
|
-
"":
|
|
3570
|
-
}, "",
|
|
3569
|
+
"": s
|
|
3570
|
+
}, "", s, e);
|
|
3571
3571
|
}
|
|
3572
|
-
function Je(
|
|
3573
|
-
return Array.isArray(t) ?
|
|
3572
|
+
function Je(s, e, t, n) {
|
|
3573
|
+
return Array.isArray(t) ? n.call(s, e, Er(t, n)) : t && typeof t == "object" && !br(t) ? n.call(s, e, wr(t, n)) : n.call(s, e, t);
|
|
3574
3574
|
}
|
|
3575
|
-
function
|
|
3576
|
-
for (const t of Object.keys(
|
|
3577
|
-
const
|
|
3578
|
-
|
|
3575
|
+
function wr(s, e) {
|
|
3576
|
+
for (const t of Object.keys(s)) {
|
|
3577
|
+
const n = Je(s, t, s[t], e);
|
|
3578
|
+
n !== void 0 ? s[t] = n : delete s[t];
|
|
3579
3579
|
}
|
|
3580
|
-
return
|
|
3580
|
+
return s;
|
|
3581
3581
|
}
|
|
3582
|
-
function Er(
|
|
3583
|
-
for (let t = 0; t <
|
|
3584
|
-
|
|
3585
|
-
return
|
|
3582
|
+
function Er(s, e) {
|
|
3583
|
+
for (let t = 0; t < s.length; t++)
|
|
3584
|
+
s[t] = Je(s, String(t), s[t], e);
|
|
3585
|
+
return s;
|
|
3586
3586
|
}
|
|
3587
|
-
function Sr(
|
|
3588
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : yr,
|
|
3587
|
+
function Sr(s, e) {
|
|
3588
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : yr, n = 0;
|
|
3589
3589
|
const r = c();
|
|
3590
|
-
return d(r), p(), e ?
|
|
3590
|
+
return d(r), p(), e ? _r(r, e) : r;
|
|
3591
3591
|
function i() {
|
|
3592
|
-
if (
|
|
3593
|
-
|
|
3592
|
+
if (s.charCodeAt(n) === Tr) {
|
|
3593
|
+
n++, u();
|
|
3594
3594
|
const y = {};
|
|
3595
3595
|
let E = !0;
|
|
3596
|
-
for (;
|
|
3596
|
+
for (; n < s.length && s.charCodeAt(n) !== _t; ) {
|
|
3597
3597
|
E ? E = !1 : (g(), u());
|
|
3598
|
-
const q =
|
|
3598
|
+
const q = n, P = a();
|
|
3599
3599
|
if (P === void 0) {
|
|
3600
3600
|
x();
|
|
3601
3601
|
return;
|
|
@@ -3608,20 +3608,20 @@ function Sr(n, e) {
|
|
|
3608
3608
|
}
|
|
3609
3609
|
Object.prototype.hasOwnProperty.call(y, P) && !De(G, y[P]) && O(P, q + 1), y[P] = G;
|
|
3610
3610
|
}
|
|
3611
|
-
return
|
|
3611
|
+
return s.charCodeAt(n) !== _t && C(), n++, y;
|
|
3612
3612
|
}
|
|
3613
3613
|
}
|
|
3614
3614
|
function o() {
|
|
3615
|
-
if (
|
|
3616
|
-
|
|
3615
|
+
if (s.charCodeAt(n) === kr) {
|
|
3616
|
+
n++, u();
|
|
3617
3617
|
const y = [];
|
|
3618
3618
|
let E = !0;
|
|
3619
|
-
for (;
|
|
3619
|
+
for (; n < s.length && s.charCodeAt(n) !== wt; ) {
|
|
3620
3620
|
E ? E = !1 : g();
|
|
3621
3621
|
const q = c();
|
|
3622
3622
|
m(q), y.push(q);
|
|
3623
3623
|
}
|
|
3624
|
-
return
|
|
3624
|
+
return s.charCodeAt(n) !== wt && F(), n++, y;
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
3627
|
function c() {
|
|
@@ -3630,53 +3630,53 @@ function Sr(n, e) {
|
|
|
3630
3630
|
return u(), y;
|
|
3631
3631
|
}
|
|
3632
3632
|
function h(y, E) {
|
|
3633
|
-
if (
|
|
3634
|
-
return
|
|
3633
|
+
if (s.slice(n, n + y.length) === y)
|
|
3634
|
+
return n += y.length, E;
|
|
3635
3635
|
}
|
|
3636
3636
|
function u() {
|
|
3637
|
-
for (; xr(
|
|
3638
|
-
|
|
3637
|
+
for (; xr(s.charCodeAt(n)); )
|
|
3638
|
+
n++;
|
|
3639
3639
|
}
|
|
3640
3640
|
function a() {
|
|
3641
|
-
if (
|
|
3642
|
-
|
|
3641
|
+
if (s.charCodeAt(n) === Pe) {
|
|
3642
|
+
n++;
|
|
3643
3643
|
let y = "";
|
|
3644
|
-
for (;
|
|
3645
|
-
if (
|
|
3646
|
-
const E = n
|
|
3647
|
-
q !== void 0 ? (y += q,
|
|
3644
|
+
for (; n < s.length && s.charCodeAt(n) !== Pe; ) {
|
|
3645
|
+
if (s.charCodeAt(n) === Cr) {
|
|
3646
|
+
const E = s[n + 1], q = Or[E];
|
|
3647
|
+
q !== void 0 ? (y += q, n++) : E === "u" ? pe(s.charCodeAt(n + 2)) && pe(s.charCodeAt(n + 3)) && pe(s.charCodeAt(n + 4)) && pe(s.charCodeAt(n + 5)) ? (y += String.fromCharCode(Number.parseInt(s.slice(n + 2, n + 6), 16)), n += 5) : X(n) : H(n);
|
|
3648
3648
|
} else
|
|
3649
|
-
Rr(
|
|
3650
|
-
|
|
3649
|
+
Rr(s.charCodeAt(n)) ? y += s[n] : T(s[n]);
|
|
3650
|
+
n++;
|
|
3651
3651
|
}
|
|
3652
|
-
return S(),
|
|
3652
|
+
return S(), n++, y;
|
|
3653
3653
|
}
|
|
3654
3654
|
}
|
|
3655
3655
|
function f() {
|
|
3656
|
-
const y =
|
|
3657
|
-
if (
|
|
3658
|
-
|
|
3659
|
-
else if (Ar(
|
|
3660
|
-
for (
|
|
3661
|
-
|
|
3662
|
-
if (
|
|
3663
|
-
for (
|
|
3664
|
-
|
|
3665
|
-
if (
|
|
3666
|
-
for (
|
|
3667
|
-
|
|
3668
|
-
if (
|
|
3669
|
-
return t(
|
|
3656
|
+
const y = n;
|
|
3657
|
+
if (s.charCodeAt(n) === Et && (n++, w(y)), s.charCodeAt(n) === We)
|
|
3658
|
+
n++;
|
|
3659
|
+
else if (Ar(s.charCodeAt(n)))
|
|
3660
|
+
for (n++; me(s.charCodeAt(n)); )
|
|
3661
|
+
n++;
|
|
3662
|
+
if (s.charCodeAt(n) === $r)
|
|
3663
|
+
for (n++, w(y); me(s.charCodeAt(n)); )
|
|
3664
|
+
n++;
|
|
3665
|
+
if (s.charCodeAt(n) === Mr || s.charCodeAt(n) === Br)
|
|
3666
|
+
for (n++, (s.charCodeAt(n) === Et || s.charCodeAt(n) === jr) && n++, w(y); me(s.charCodeAt(n)); )
|
|
3667
|
+
n++;
|
|
3668
|
+
if (n > y)
|
|
3669
|
+
return t(s.slice(y, n));
|
|
3670
3670
|
}
|
|
3671
3671
|
function g() {
|
|
3672
|
-
if (
|
|
3672
|
+
if (s.charCodeAt(n) !== vr)
|
|
3673
3673
|
throw new SyntaxError(`Comma ',' expected after value ${A()}`);
|
|
3674
|
-
|
|
3674
|
+
n++;
|
|
3675
3675
|
}
|
|
3676
3676
|
function b() {
|
|
3677
|
-
if (
|
|
3677
|
+
if (s.charCodeAt(n) !== Ur)
|
|
3678
3678
|
throw new SyntaxError(`Colon ':' expected after property name ${A()}`);
|
|
3679
|
-
|
|
3679
|
+
n++;
|
|
3680
3680
|
}
|
|
3681
3681
|
function d(y) {
|
|
3682
3682
|
if (y === void 0)
|
|
@@ -3687,17 +3687,17 @@ function Sr(n, e) {
|
|
|
3687
3687
|
throw new SyntaxError(`Array item expected ${A()}`);
|
|
3688
3688
|
}
|
|
3689
3689
|
function p() {
|
|
3690
|
-
if (
|
|
3690
|
+
if (n < s.length)
|
|
3691
3691
|
throw new SyntaxError(`Expected end of input ${A()}`);
|
|
3692
3692
|
}
|
|
3693
|
-
function
|
|
3694
|
-
if (!me(
|
|
3695
|
-
const E =
|
|
3693
|
+
function w(y) {
|
|
3694
|
+
if (!me(s.charCodeAt(n))) {
|
|
3695
|
+
const E = s.slice(y, n);
|
|
3696
3696
|
throw new SyntaxError(`Invalid number '${E}', expecting a digit ${A()}`);
|
|
3697
3697
|
}
|
|
3698
3698
|
}
|
|
3699
3699
|
function S() {
|
|
3700
|
-
if (
|
|
3700
|
+
if (s.charCodeAt(n) !== Pe)
|
|
3701
3701
|
throw new SyntaxError(`End of string '"' expected ${A()}`);
|
|
3702
3702
|
}
|
|
3703
3703
|
function x() {
|
|
@@ -3716,46 +3716,46 @@ function Sr(n, e) {
|
|
|
3716
3716
|
throw new SyntaxError(`Invalid character '${y}' ${k()}`);
|
|
3717
3717
|
}
|
|
3718
3718
|
function H(y) {
|
|
3719
|
-
const E =
|
|
3719
|
+
const E = s.slice(y, y + 2);
|
|
3720
3720
|
throw new SyntaxError(`Invalid escape character '${E}' ${k()}`);
|
|
3721
3721
|
}
|
|
3722
3722
|
function v() {
|
|
3723
3723
|
throw new SyntaxError(`Object value expected after ':' ${k()}`);
|
|
3724
3724
|
}
|
|
3725
3725
|
function X(y) {
|
|
3726
|
-
const E =
|
|
3726
|
+
const E = s.slice(y, y + 6);
|
|
3727
3727
|
throw new SyntaxError(`Invalid unicode character '${E}' ${k()}`);
|
|
3728
3728
|
}
|
|
3729
3729
|
function k() {
|
|
3730
|
-
return `at position ${
|
|
3730
|
+
return `at position ${n}`;
|
|
3731
3731
|
}
|
|
3732
3732
|
function j() {
|
|
3733
|
-
return
|
|
3733
|
+
return n < s.length ? `but got '${s[n]}'` : "but reached end of input";
|
|
3734
3734
|
}
|
|
3735
3735
|
function A() {
|
|
3736
3736
|
return `${j()} ${k()}`;
|
|
3737
3737
|
}
|
|
3738
3738
|
}
|
|
3739
|
-
function xr(
|
|
3740
|
-
return
|
|
3739
|
+
function xr(s) {
|
|
3740
|
+
return s === Nr || s === Pr || s === Ir || s === Lr;
|
|
3741
3741
|
}
|
|
3742
|
-
function pe(
|
|
3743
|
-
return
|
|
3742
|
+
function pe(s) {
|
|
3743
|
+
return s >= We && s <= Ke || s >= Dr && s <= Hr || s >= qr && s <= zr;
|
|
3744
3744
|
}
|
|
3745
|
-
function me(
|
|
3746
|
-
return
|
|
3745
|
+
function me(s) {
|
|
3746
|
+
return s >= We && s <= Ke;
|
|
3747
3747
|
}
|
|
3748
|
-
function Ar(
|
|
3749
|
-
return
|
|
3748
|
+
function Ar(s) {
|
|
3749
|
+
return s >= Fr && s <= Ke;
|
|
3750
3750
|
}
|
|
3751
|
-
function Rr(
|
|
3752
|
-
return
|
|
3751
|
+
function Rr(s) {
|
|
3752
|
+
return s >= 32 && s <= 1114111;
|
|
3753
3753
|
}
|
|
3754
|
-
function De(
|
|
3755
|
-
return
|
|
3754
|
+
function De(s, e) {
|
|
3755
|
+
return s === e ? !0 : Array.isArray(s) && Array.isArray(e) ? s.length === e.length && s.every((t, n) => De(t, e[n])) : yt(s) && yt(e) ? [.../* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(e)])].every((n) => De(s[n], e[n])) : !1;
|
|
3756
3756
|
}
|
|
3757
|
-
function yt(
|
|
3758
|
-
return typeof
|
|
3757
|
+
function yt(s) {
|
|
3758
|
+
return typeof s == "object" && s !== null;
|
|
3759
3759
|
}
|
|
3760
3760
|
const Or = {
|
|
3761
3761
|
'"': '"',
|
|
@@ -3768,13 +3768,13 @@ const Or = {
|
|
|
3768
3768
|
r: "\r",
|
|
3769
3769
|
t: " "
|
|
3770
3770
|
// note that \u is handled separately in parseString()
|
|
3771
|
-
}, Cr = 92, Tr = 123,
|
|
3772
|
-
function nn(
|
|
3771
|
+
}, Cr = 92, Tr = 123, _t = 125, kr = 91, wt = 93, Nr = 32, Pr = 10, Ir = 9, Lr = 13, Pe = 34, jr = 43, Et = 45, We = 48, Fr = 49, Ke = 57, vr = 44, $r = 46, Ur = 58, Dr = 65, qr = 97, Br = 69, Mr = 101, Hr = 70, zr = 102;
|
|
3772
|
+
function nn(s, e, t, n) {
|
|
3773
3773
|
const r = void 0;
|
|
3774
|
-
return o(
|
|
3774
|
+
return o(s, "");
|
|
3775
3775
|
function o(a, f) {
|
|
3776
|
-
if (Array.isArray(
|
|
3777
|
-
const g =
|
|
3776
|
+
if (Array.isArray(n)) {
|
|
3777
|
+
const g = n.find((b) => b.test(a));
|
|
3778
3778
|
if (g) {
|
|
3779
3779
|
const b = g.stringify(a);
|
|
3780
3780
|
if (typeof b != "string" || !en(b))
|
|
@@ -3815,12 +3815,12 @@ ${f}]` : "]", b;
|
|
|
3815
3815
|
let d = !0, m = r ? `{
|
|
3816
3816
|
` : "{";
|
|
3817
3817
|
for (const p of g) {
|
|
3818
|
-
const
|
|
3819
|
-
if (u(p,
|
|
3818
|
+
const w = a[p];
|
|
3819
|
+
if (u(p, w)) {
|
|
3820
3820
|
d ? d = !1 : m += r ? `,
|
|
3821
3821
|
` : ",";
|
|
3822
3822
|
const S = JSON.stringify(p);
|
|
3823
|
-
m += r ? `${b + S}: ` : `${S}:`, m += o(
|
|
3823
|
+
m += r ? `${b + S}: ` : `${S}:`, m += o(w, b);
|
|
3824
3824
|
}
|
|
3825
3825
|
}
|
|
3826
3826
|
return m += r ? `
|
|
@@ -3830,14 +3830,14 @@ ${f}}` : "}", m;
|
|
|
3830
3830
|
return typeof f < "u" && typeof f != "function" && typeof f != "symbol";
|
|
3831
3831
|
}
|
|
3832
3832
|
}
|
|
3833
|
-
function Vr(
|
|
3834
|
-
return re(
|
|
3833
|
+
function Vr(s) {
|
|
3834
|
+
return re(s) && !tn(s) ? BigInt(s) : parseFloat(s);
|
|
3835
3835
|
}
|
|
3836
3836
|
class gi {
|
|
3837
3837
|
constructor() {
|
|
3838
3838
|
$(this, "id", 1);
|
|
3839
3839
|
}
|
|
3840
|
-
async exec(e, t,
|
|
3840
|
+
async exec(e, t, n = {}, r = {}, i = 6e4) {
|
|
3841
3841
|
try {
|
|
3842
3842
|
await OpenC3Auth.updateToken(
|
|
3843
3843
|
OpenC3Auth.defaultMinValidity
|
|
@@ -3847,14 +3847,14 @@ class gi {
|
|
|
3847
3847
|
}
|
|
3848
3848
|
this.id = this.id + 1;
|
|
3849
3849
|
try {
|
|
3850
|
-
return
|
|
3850
|
+
return n.scope = window.openc3Scope, r.manual = !0, (await He.post(
|
|
3851
3851
|
"/openc3-api/api",
|
|
3852
3852
|
{
|
|
3853
3853
|
jsonrpc: "2.0",
|
|
3854
3854
|
method: e,
|
|
3855
3855
|
params: t,
|
|
3856
3856
|
id: this.id,
|
|
3857
|
-
keyword_params:
|
|
3857
|
+
keyword_params: n
|
|
3858
3858
|
},
|
|
3859
3859
|
{
|
|
3860
3860
|
headers: {
|
|
@@ -3909,8 +3909,22 @@ class gi {
|
|
|
3909
3909
|
get_all_interface_info() {
|
|
3910
3910
|
return this.exec("get_all_interface_info", []);
|
|
3911
3911
|
}
|
|
3912
|
-
map_target_to_interface(e, t) {
|
|
3913
|
-
return this.exec("map_target_to_interface", [e, t]
|
|
3912
|
+
map_target_to_interface(e, t, n, r, i) {
|
|
3913
|
+
return this.exec("map_target_to_interface", [e, t], {
|
|
3914
|
+
cmd_only: n,
|
|
3915
|
+
tlm_only: r,
|
|
3916
|
+
unmap_old: i
|
|
3917
|
+
});
|
|
3918
|
+
}
|
|
3919
|
+
unmap_target_from_interface(e, t, n, r) {
|
|
3920
|
+
return this.exec(
|
|
3921
|
+
"unmap_target_from_interface",
|
|
3922
|
+
[e, t],
|
|
3923
|
+
{
|
|
3924
|
+
cmd_only: n,
|
|
3925
|
+
tlm_only: r
|
|
3926
|
+
}
|
|
3927
|
+
);
|
|
3914
3928
|
}
|
|
3915
3929
|
connect_interface(e, ...t) {
|
|
3916
3930
|
return t.length > 0 ? this.exec("connect_interface", [
|
|
@@ -3921,37 +3935,84 @@ class gi {
|
|
|
3921
3935
|
disconnect_interface(e) {
|
|
3922
3936
|
return this.exec("disconnect_interface", [e]);
|
|
3923
3937
|
}
|
|
3924
|
-
interface_cmd(e, t, ...
|
|
3938
|
+
interface_cmd(e, t, ...n) {
|
|
3925
3939
|
return this.exec("interface_cmd", [
|
|
3926
3940
|
e,
|
|
3927
3941
|
t,
|
|
3928
|
-
...
|
|
3942
|
+
...n
|
|
3929
3943
|
]);
|
|
3930
3944
|
}
|
|
3945
|
+
interface_target_enable(e, t, n = !1, r = !1) {
|
|
3946
|
+
return this.exec("interface_target_enable", [e, t], {
|
|
3947
|
+
cmd_only: n,
|
|
3948
|
+
tlm_only: r
|
|
3949
|
+
});
|
|
3950
|
+
}
|
|
3951
|
+
interface_target_disable(e, t, n = !1, r = !1) {
|
|
3952
|
+
return this.exec(
|
|
3953
|
+
"interface_target_disable",
|
|
3954
|
+
[e, t],
|
|
3955
|
+
{
|
|
3956
|
+
cmd_only: n,
|
|
3957
|
+
tlm_only: r
|
|
3958
|
+
}
|
|
3959
|
+
);
|
|
3960
|
+
}
|
|
3961
|
+
interface_details(e) {
|
|
3962
|
+
return this.exec("interface_details", [e]);
|
|
3963
|
+
}
|
|
3931
3964
|
get_all_router_info() {
|
|
3932
3965
|
return this.exec("get_all_router_info", []);
|
|
3933
3966
|
}
|
|
3967
|
+
map_target_to_router(e, t, n, r, i) {
|
|
3968
|
+
return this.exec("map_target_to_router", [e, t], {
|
|
3969
|
+
cmd_only: n,
|
|
3970
|
+
tlm_only: r,
|
|
3971
|
+
unmap_old: i
|
|
3972
|
+
});
|
|
3973
|
+
}
|
|
3974
|
+
unmap_target_from_router(e, t, n, r) {
|
|
3975
|
+
return this.exec("unmap_target_from_router", [e, t], {
|
|
3976
|
+
cmd_only: n,
|
|
3977
|
+
tlm_only: r
|
|
3978
|
+
});
|
|
3979
|
+
}
|
|
3934
3980
|
connect_router(e) {
|
|
3935
3981
|
return this.exec("connect_router", [e]);
|
|
3936
3982
|
}
|
|
3937
3983
|
disconnect_router(e) {
|
|
3938
3984
|
return this.exec("disconnect_router", [e]);
|
|
3939
3985
|
}
|
|
3986
|
+
router_target_enable(e, t, n = !1, r = !1) {
|
|
3987
|
+
return this.exec("router_target_enable", [e, t], {
|
|
3988
|
+
cmd_only: n,
|
|
3989
|
+
tlm_only: r
|
|
3990
|
+
});
|
|
3991
|
+
}
|
|
3992
|
+
router_target_disable(e, t, n = !1, r = !1) {
|
|
3993
|
+
return this.exec("router_target_disable", [e, t], {
|
|
3994
|
+
cmd_only: n,
|
|
3995
|
+
tlm_only: r
|
|
3996
|
+
});
|
|
3997
|
+
}
|
|
3998
|
+
router_details(e) {
|
|
3999
|
+
return this.exec("router_details", [e]);
|
|
4000
|
+
}
|
|
3940
4001
|
get_target_interfaces() {
|
|
3941
4002
|
return this.exec("get_target_interfaces", []);
|
|
3942
4003
|
}
|
|
3943
4004
|
get_tlm_cnts(e) {
|
|
3944
4005
|
return this.exec("get_tlm_cnts", [e]);
|
|
3945
4006
|
}
|
|
3946
|
-
get_item(e, t,
|
|
3947
|
-
return this.exec("get_item", [e, t,
|
|
4007
|
+
get_item(e, t, n) {
|
|
4008
|
+
return this.exec("get_item", [e, t, n]);
|
|
3948
4009
|
}
|
|
3949
|
-
get_param(e, t,
|
|
3950
|
-
return this.exec("get_param", [e, t,
|
|
4010
|
+
get_param(e, t, n) {
|
|
4011
|
+
return this.exec("get_param", [e, t, n]);
|
|
3951
4012
|
}
|
|
3952
4013
|
// DEPRECATED for get_param
|
|
3953
|
-
get_parameter(e, t,
|
|
3954
|
-
return this.exec("get_param", [e, t,
|
|
4014
|
+
get_parameter(e, t, n) {
|
|
4015
|
+
return this.exec("get_param", [e, t, n]);
|
|
3955
4016
|
}
|
|
3956
4017
|
get_limits_sets() {
|
|
3957
4018
|
return this.exec("get_limits_sets", []);
|
|
@@ -3999,9 +4060,9 @@ class gi {
|
|
|
3999
4060
|
get_all_tlm_item_names(e) {
|
|
4000
4061
|
return this.exec("get_all_tlm_item_names", [e]);
|
|
4001
4062
|
}
|
|
4002
|
-
async get_tlm_packet(e, t,
|
|
4063
|
+
async get_tlm_packet(e, t, n, r = 30) {
|
|
4003
4064
|
const i = await this.exec("get_tlm_packet", [e, t], {
|
|
4004
|
-
type:
|
|
4065
|
+
type: n,
|
|
4005
4066
|
stale_time: r
|
|
4006
4067
|
});
|
|
4007
4068
|
if (i != null) {
|
|
@@ -4020,11 +4081,11 @@ class gi {
|
|
|
4020
4081
|
get_tlm_available(e) {
|
|
4021
4082
|
return this.exec("get_tlm_available", [e]);
|
|
4022
4083
|
}
|
|
4023
|
-
async get_tlm_values(e, t = 30,
|
|
4084
|
+
async get_tlm_values(e, t = 30, n = null, r = null, i = null) {
|
|
4024
4085
|
let o = {
|
|
4025
4086
|
stale_time: t
|
|
4026
4087
|
};
|
|
4027
|
-
|
|
4088
|
+
n !== null && (o.cache_timeout = n), r !== null && (o.start_time = r.toISOString()), i !== null && (o.end_time = i.toISOString());
|
|
4028
4089
|
const c = await this.exec(
|
|
4029
4090
|
"get_tlm_values",
|
|
4030
4091
|
[e],
|
|
@@ -4040,14 +4101,14 @@ class gi {
|
|
|
4040
4101
|
}
|
|
4041
4102
|
return c;
|
|
4042
4103
|
}
|
|
4043
|
-
get_limits(e, t,
|
|
4044
|
-
return this.exec("get_limits", [e, t,
|
|
4104
|
+
get_limits(e, t, n) {
|
|
4105
|
+
return this.exec("get_limits", [e, t, n]);
|
|
4045
4106
|
}
|
|
4046
|
-
async tlm(e, t,
|
|
4107
|
+
async tlm(e, t, n, r = "CONVERTED") {
|
|
4047
4108
|
let i = null;
|
|
4048
4109
|
if (t === void 0)
|
|
4049
4110
|
i = await this.exec("tlm", [e]);
|
|
4050
|
-
else if (
|
|
4111
|
+
else if (n === void 0)
|
|
4051
4112
|
if (["RAW", "CONVERTED", "FORMATTED", "WITH_UNITS"].includes(t))
|
|
4052
4113
|
i = await this.exec("tlm", [e], { type: t });
|
|
4053
4114
|
else {
|
|
@@ -4055,32 +4116,32 @@ class gi {
|
|
|
4055
4116
|
throw c.name = "TypeError", c.message = `Invalid data type ${t}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`, c;
|
|
4056
4117
|
}
|
|
4057
4118
|
else
|
|
4058
|
-
i = await this.exec("tlm", [e, t,
|
|
4119
|
+
i = await this.exec("tlm", [e, t, n], {
|
|
4059
4120
|
type: r
|
|
4060
4121
|
});
|
|
4061
4122
|
let o = this.decode_openc3_type(i);
|
|
4062
4123
|
return o !== null && (i = o), i;
|
|
4063
4124
|
}
|
|
4064
|
-
async inject_tlm(e, t,
|
|
4065
|
-
await this.exec("inject_tlm", [e, t,
|
|
4125
|
+
async inject_tlm(e, t, n = null, r = "CONVERTED") {
|
|
4126
|
+
await this.exec("inject_tlm", [e, t, n], {
|
|
4066
4127
|
type: r
|
|
4067
4128
|
});
|
|
4068
4129
|
}
|
|
4069
|
-
set_tlm(e, t,
|
|
4070
|
-
return this.exec("set_tlm", [e, t,
|
|
4130
|
+
set_tlm(e, t, n, r) {
|
|
4131
|
+
return this.exec("set_tlm", [e, t, n], {
|
|
4071
4132
|
type: r
|
|
4072
4133
|
});
|
|
4073
4134
|
}
|
|
4074
|
-
override_tlm(e, t,
|
|
4075
|
-
return this.exec("override_tlm", [e, t,
|
|
4135
|
+
override_tlm(e, t, n, r) {
|
|
4136
|
+
return this.exec("override_tlm", [e, t, n], {
|
|
4076
4137
|
type: r
|
|
4077
4138
|
});
|
|
4078
4139
|
}
|
|
4079
4140
|
get_overrides() {
|
|
4080
4141
|
return this.exec("get_overrides");
|
|
4081
4142
|
}
|
|
4082
|
-
normalize_tlm(e, t,
|
|
4083
|
-
return this.exec("normalize_tlm", [e, t,
|
|
4143
|
+
normalize_tlm(e, t, n, r) {
|
|
4144
|
+
return this.exec("normalize_tlm", [e, t, n], {
|
|
4084
4145
|
type: r
|
|
4085
4146
|
});
|
|
4086
4147
|
}
|
|
@@ -4108,11 +4169,11 @@ class gi {
|
|
|
4108
4169
|
get_cmd_cnts(e) {
|
|
4109
4170
|
return this.exec("get_cmd_cnts", [e]);
|
|
4110
4171
|
}
|
|
4111
|
-
get_cmd_value(e, t,
|
|
4172
|
+
get_cmd_value(e, t, n, r = "CONVERTED") {
|
|
4112
4173
|
return this.exec("get_cmd_value", [
|
|
4113
4174
|
e,
|
|
4114
4175
|
t,
|
|
4115
|
-
|
|
4176
|
+
n,
|
|
4116
4177
|
r
|
|
4117
4178
|
]);
|
|
4118
4179
|
}
|
|
@@ -4120,87 +4181,87 @@ class gi {
|
|
|
4120
4181
|
return this.exec("get_cmd_buffer", [e, t]);
|
|
4121
4182
|
}
|
|
4122
4183
|
// Implementation of functionality shared by cmd methods with param_lists.
|
|
4123
|
-
_cmd(e, t,
|
|
4184
|
+
_cmd(e, t, n, r, i, o = {}) {
|
|
4124
4185
|
let c = null;
|
|
4125
4186
|
for (let h in r)
|
|
4126
4187
|
Object.prototype.hasOwnProperty.call(r, h) && (c = this.encode_openc3_type(r[h]), c !== null && (r[h] = c));
|
|
4127
4188
|
return this.exec(
|
|
4128
4189
|
e,
|
|
4129
|
-
[t,
|
|
4190
|
+
[t, n, r],
|
|
4130
4191
|
o,
|
|
4131
4192
|
i
|
|
4132
4193
|
);
|
|
4133
4194
|
}
|
|
4134
|
-
get_cmd_hazardous(e, t,
|
|
4195
|
+
get_cmd_hazardous(e, t, n, r = {}) {
|
|
4135
4196
|
return t === void 0 ? this.exec("get_cmd_hazardous", e, {}, r) : this._cmd(
|
|
4136
4197
|
"get_cmd_hazardous",
|
|
4137
4198
|
e,
|
|
4138
4199
|
t,
|
|
4139
|
-
|
|
4200
|
+
n,
|
|
4140
4201
|
r
|
|
4141
4202
|
);
|
|
4142
4203
|
}
|
|
4143
|
-
cmd(e, t,
|
|
4204
|
+
cmd(e, t, n, r = {}, i = {}) {
|
|
4144
4205
|
return t === void 0 ? this.exec("cmd", e, {}, r) : this._cmd(
|
|
4145
4206
|
"cmd",
|
|
4146
4207
|
e,
|
|
4147
4208
|
t,
|
|
4148
|
-
|
|
4209
|
+
n,
|
|
4149
4210
|
r,
|
|
4150
4211
|
i
|
|
4151
4212
|
);
|
|
4152
4213
|
}
|
|
4153
|
-
cmd_no_range_check(e, t,
|
|
4214
|
+
cmd_no_range_check(e, t, n, r = {}, i = {}) {
|
|
4154
4215
|
return t === void 0 ? this.exec("cmd_no_range_check", e, {}, r, i) : this._cmd(
|
|
4155
4216
|
"cmd_no_range_check",
|
|
4156
4217
|
e,
|
|
4157
4218
|
t,
|
|
4158
|
-
|
|
4219
|
+
n,
|
|
4159
4220
|
r,
|
|
4160
4221
|
i
|
|
4161
4222
|
);
|
|
4162
4223
|
}
|
|
4163
|
-
cmd_raw(e, t,
|
|
4224
|
+
cmd_raw(e, t, n, r = {}, i = {}) {
|
|
4164
4225
|
return t === void 0 ? this.exec("cmd_raw", e, {}, r, i) : this._cmd(
|
|
4165
4226
|
"cmd_raw",
|
|
4166
4227
|
e,
|
|
4167
4228
|
t,
|
|
4168
|
-
|
|
4229
|
+
n,
|
|
4169
4230
|
r,
|
|
4170
4231
|
i
|
|
4171
4232
|
);
|
|
4172
4233
|
}
|
|
4173
|
-
cmd_raw_no_range_check(e, t,
|
|
4234
|
+
cmd_raw_no_range_check(e, t, n, r = {}, i = {}) {
|
|
4174
4235
|
return t === void 0 ? this.exec("cmd_raw_no_range_check", e, {}, r, i) : this._cmd(
|
|
4175
4236
|
"cmd_raw_no_range_check",
|
|
4176
4237
|
e,
|
|
4177
4238
|
t,
|
|
4178
|
-
|
|
4239
|
+
n,
|
|
4179
4240
|
r,
|
|
4180
4241
|
i
|
|
4181
4242
|
);
|
|
4182
4243
|
}
|
|
4183
|
-
cmd_no_hazardous_check(e, t,
|
|
4244
|
+
cmd_no_hazardous_check(e, t, n, r = {}, i = {}) {
|
|
4184
4245
|
return t === void 0 ? this.exec("cmd_no_hazardous_check", e, {}, r, i) : this._cmd(
|
|
4185
4246
|
"cmd_no_hazardous_check",
|
|
4186
4247
|
e,
|
|
4187
4248
|
t,
|
|
4188
|
-
|
|
4249
|
+
n,
|
|
4189
4250
|
r,
|
|
4190
4251
|
i
|
|
4191
4252
|
);
|
|
4192
4253
|
}
|
|
4193
|
-
cmd_no_checks(e, t,
|
|
4254
|
+
cmd_no_checks(e, t, n, r = {}, i = {}) {
|
|
4194
4255
|
return t === void 0 ? this.exec("cmd_no_checks", e, {}, r, i) : this._cmd(
|
|
4195
4256
|
"cmd_no_checks",
|
|
4196
4257
|
e,
|
|
4197
4258
|
t,
|
|
4198
|
-
|
|
4259
|
+
n,
|
|
4199
4260
|
r,
|
|
4200
4261
|
i
|
|
4201
4262
|
);
|
|
4202
4263
|
}
|
|
4203
|
-
cmd_raw_no_hazardous_check(e, t,
|
|
4264
|
+
cmd_raw_no_hazardous_check(e, t, n, r = {}, i = {}) {
|
|
4204
4265
|
return t === void 0 ? this.exec(
|
|
4205
4266
|
"cmd_raw_no_hazardous_check",
|
|
4206
4267
|
e,
|
|
@@ -4211,31 +4272,34 @@ class gi {
|
|
|
4211
4272
|
"cmd_raw_no_hazardous_check",
|
|
4212
4273
|
e,
|
|
4213
4274
|
t,
|
|
4214
|
-
|
|
4275
|
+
n,
|
|
4215
4276
|
r,
|
|
4216
4277
|
i
|
|
4217
4278
|
);
|
|
4218
4279
|
}
|
|
4219
|
-
cmd_raw_no_checks(e, t,
|
|
4280
|
+
cmd_raw_no_checks(e, t, n, r = {}, i = {}) {
|
|
4220
4281
|
return t === void 0 ? this.exec("cmd_raw_no_checks", e, {}, r, i) : this._cmd(
|
|
4221
4282
|
"cmd_raw_no_checks",
|
|
4222
4283
|
e,
|
|
4223
4284
|
t,
|
|
4224
|
-
|
|
4285
|
+
n,
|
|
4225
4286
|
r,
|
|
4226
4287
|
i
|
|
4227
4288
|
);
|
|
4228
4289
|
}
|
|
4229
|
-
build_cmd(e, t,
|
|
4230
|
-
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t,
|
|
4290
|
+
build_cmd(e, t, n, r = {}, i = {}) {
|
|
4291
|
+
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t, n, r, i);
|
|
4231
4292
|
}
|
|
4232
4293
|
// DEPRECATED for build_cmd
|
|
4233
|
-
build_command(e, t,
|
|
4234
|
-
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t,
|
|
4294
|
+
build_command(e, t, n, r = {}, i = {}) {
|
|
4295
|
+
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t, n, r, i);
|
|
4235
4296
|
}
|
|
4236
4297
|
get_interface_names() {
|
|
4237
4298
|
return this.exec("get_interface_names", []);
|
|
4238
4299
|
}
|
|
4300
|
+
get_router_names() {
|
|
4301
|
+
return this.exec("get_router_names", []);
|
|
4302
|
+
}
|
|
4239
4303
|
send_raw(e, t) {
|
|
4240
4304
|
return this.exec("send_raw", [e, t]);
|
|
4241
4305
|
}
|
|
@@ -4245,17 +4309,17 @@ class gi {
|
|
|
4245
4309
|
load_config(e, t) {
|
|
4246
4310
|
return this.exec("load_config", [e, t]);
|
|
4247
4311
|
}
|
|
4248
|
-
save_config(e, t,
|
|
4249
|
-
return this.exec("save_config", [e, t,
|
|
4312
|
+
save_config(e, t, n) {
|
|
4313
|
+
return this.exec("save_config", [e, t, n]);
|
|
4250
4314
|
}
|
|
4251
4315
|
delete_config(e, t) {
|
|
4252
4316
|
return this.exec("delete_config", [e, t]);
|
|
4253
4317
|
}
|
|
4254
|
-
enable_limits(e, t,
|
|
4255
|
-
return this.exec("enable_limits", [e, t,
|
|
4318
|
+
enable_limits(e, t, n) {
|
|
4319
|
+
return this.exec("enable_limits", [e, t, n]);
|
|
4256
4320
|
}
|
|
4257
|
-
disable_limits(e, t,
|
|
4258
|
-
return this.exec("disable_limits", [e, t,
|
|
4321
|
+
disable_limits(e, t, n) {
|
|
4322
|
+
return this.exec("disable_limits", [e, t, n]);
|
|
4259
4323
|
}
|
|
4260
4324
|
get_out_of_limits() {
|
|
4261
4325
|
return this.exec("get_out_of_limits", []);
|
|
@@ -4294,10 +4358,10 @@ class gi {
|
|
|
4294
4358
|
// TODO: Currently unused but seemed like a useful function
|
|
4295
4359
|
async hashString(e) {
|
|
4296
4360
|
if (window.isSecureContext) {
|
|
4297
|
-
const t = new TextEncoder().encode(e),
|
|
4361
|
+
const t = new TextEncoder().encode(e), n = await crypto.subtle.digest(
|
|
4298
4362
|
"SHA-256",
|
|
4299
4363
|
t
|
|
4300
|
-
), r = new Uint8Array(
|
|
4364
|
+
), r = new Uint8Array(n);
|
|
4301
4365
|
return Array.from(r).map((i) => i.toString(16).padStart(2, "0")).join("");
|
|
4302
4366
|
}
|
|
4303
4367
|
}
|