@openc3/js-common 6.2.1 → 6.3.0
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 +1204 -1207
- package/dist/services.js.map +1 -1
- package/package.json +12 -12
package/dist/services.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var v = (
|
|
4
|
-
function
|
|
1
|
+
var Kt = Object.defineProperty;
|
|
2
|
+
var Xt = (s, e, t) => e in s ? Kt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var v = (s, e, t) => Xt(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
function pt(s, e) {
|
|
5
5
|
return function() {
|
|
6
|
-
return
|
|
6
|
+
return s.apply(e, arguments);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
const { toString:
|
|
10
|
-
const t =
|
|
11
|
-
return
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
13
|
-
function
|
|
14
|
-
return
|
|
9
|
+
const { toString: Gt } = Object.prototype, { getPrototypeOf: $e } = Object, de = /* @__PURE__ */ ((s) => (e) => {
|
|
10
|
+
const t = Gt.call(e);
|
|
11
|
+
return s[t] || (s[t] = t.slice(8, -1).toLowerCase());
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), j = (s) => (s = s.toLowerCase(), (e) => de(e) === s), fe = (s) => (e) => typeof e === s, { isArray: K } = Array, Y = fe("undefined");
|
|
13
|
+
function Zt(s) {
|
|
14
|
+
return s !== null && !Y(s) && s.constructor !== null && !Y(s.constructor) && N(s.constructor.isBuffer) && s.constructor.isBuffer(s);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const mt = j("ArrayBuffer");
|
|
17
|
+
function Qt(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 && mt(s.buffer), e;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
if (de(
|
|
21
|
+
const Yt = fe("string"), N = fe("function"), gt = fe("number"), pe = (s) => s !== null && typeof s == "object", en = (s) => s === !0 || s === !1, ce = (s) => {
|
|
22
|
+
if (de(s) !== "object")
|
|
23
23
|
return !1;
|
|
24
|
-
const e = $e(
|
|
25
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in
|
|
26
|
-
},
|
|
24
|
+
const e = $e(s);
|
|
25
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in s) && !(Symbol.iterator in s);
|
|
26
|
+
}, tn = j("Date"), nn = j("File"), sn = j("Blob"), rn = j("FileList"), on = (s) => pe(s) && N(s.pipe), cn = (s) => {
|
|
27
27
|
let e;
|
|
28
|
-
return
|
|
29
|
-
e === "object" && N(
|
|
30
|
-
},
|
|
31
|
-
function ee(
|
|
32
|
-
if (
|
|
28
|
+
return s && (typeof FormData == "function" && s instanceof FormData || N(s.append) && ((e = de(s)) === "formdata" || // detect form-data instance
|
|
29
|
+
e === "object" && N(s.toString) && s.toString() === "[object FormData]"));
|
|
30
|
+
}, an = j("URLSearchParams"), [ln, un, hn, dn] = ["ReadableStream", "Request", "Response", "Headers"].map(j), fn = (s) => s.trim ? s.trim() : s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
31
|
+
function ee(s, e, { allOwnKeys: t = !1 } = {}) {
|
|
32
|
+
if (s === null || typeof s > "u")
|
|
33
33
|
return;
|
|
34
|
-
let
|
|
35
|
-
if (typeof
|
|
36
|
-
for (
|
|
37
|
-
e.call(null, n
|
|
34
|
+
let n, r;
|
|
35
|
+
if (typeof s != "object" && (s = [s]), K(s))
|
|
36
|
+
for (n = 0, r = s.length; n < r; n++)
|
|
37
|
+
e.call(null, s[n], n, s);
|
|
38
38
|
else {
|
|
39
|
-
const i = t ? Object.getOwnPropertyNames(
|
|
39
|
+
const i = t ? Object.getOwnPropertyNames(s) : Object.keys(s), o = i.length;
|
|
40
40
|
let c;
|
|
41
|
-
for (
|
|
42
|
-
c = i[
|
|
41
|
+
for (n = 0; n < o; n++)
|
|
42
|
+
c = i[n], e.call(null, s[c], c, s);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function bt(s, e) {
|
|
46
46
|
e = e.toLowerCase();
|
|
47
|
-
const t = Object.keys(
|
|
48
|
-
let
|
|
49
|
-
for (;
|
|
50
|
-
if (r = t[
|
|
47
|
+
const t = Object.keys(s);
|
|
48
|
+
let n = t.length, r;
|
|
49
|
+
for (; n-- > 0; )
|
|
50
|
+
if (r = t[n], e === r.toLowerCase())
|
|
51
51
|
return r;
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const H = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global,
|
|
54
|
+
const H = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, wt = (s) => !Y(s) && s !== H;
|
|
55
55
|
function Oe() {
|
|
56
|
-
const { caseless:
|
|
57
|
-
const i =
|
|
58
|
-
ce(e[i]) && ce(
|
|
56
|
+
const { caseless: s } = wt(this) && this || {}, e = {}, t = (n, r) => {
|
|
57
|
+
const i = s && bt(e, r) || r;
|
|
58
|
+
ce(e[i]) && ce(n) ? e[i] = Oe(e[i], n) : ce(n) ? e[i] = Oe({}, n) : K(n) ? e[i] = n.slice() : e[i] = n;
|
|
59
59
|
};
|
|
60
|
-
for (let
|
|
61
|
-
arguments[
|
|
60
|
+
for (let n = 0, r = arguments.length; n < r; n++)
|
|
61
|
+
arguments[n] && ee(arguments[n], t);
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
t && N(r) ?
|
|
66
|
-
}, { allOwnKeys:
|
|
67
|
-
|
|
64
|
+
const pn = (s, e, t, { allOwnKeys: n } = {}) => (ee(e, (r, i) => {
|
|
65
|
+
t && N(r) ? s[i] = pt(r, t) : s[i] = r;
|
|
66
|
+
}, { allOwnKeys: n }), s), mn = (s) => (s.charCodeAt(0) === 65279 && (s = s.slice(1)), s), gn = (s, e, t, n) => {
|
|
67
|
+
s.prototype = Object.create(e.prototype, n), s.prototype.constructor = s, Object.defineProperty(s, "super", {
|
|
68
68
|
value: e.prototype
|
|
69
|
-
}), t && Object.assign(
|
|
70
|
-
},
|
|
69
|
+
}), t && Object.assign(s.prototype, t);
|
|
70
|
+
}, bn = (s, e, t, n) => {
|
|
71
71
|
let r, i, o;
|
|
72
72
|
const c = {};
|
|
73
|
-
if (e = e || {},
|
|
73
|
+
if (e = e || {}, s == null) return e;
|
|
74
74
|
do {
|
|
75
|
-
for (r = Object.getOwnPropertyNames(
|
|
76
|
-
o = r[i], (!
|
|
77
|
-
|
|
78
|
-
} while (
|
|
75
|
+
for (r = Object.getOwnPropertyNames(s), i = r.length; i-- > 0; )
|
|
76
|
+
o = r[i], (!n || n(o, s, e)) && !c[o] && (e[o] = s[o], c[o] = !0);
|
|
77
|
+
s = t !== !1 && $e(s);
|
|
78
|
+
} while (s && (!t || t(s, e)) && s !== Object.prototype);
|
|
79
79
|
return e;
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
},
|
|
85
|
-
if (!
|
|
86
|
-
if (K(
|
|
87
|
-
let e =
|
|
88
|
-
if (!
|
|
80
|
+
}, wn = (s, e, t) => {
|
|
81
|
+
s = String(s), (t === void 0 || t > s.length) && (t = s.length), t -= e.length;
|
|
82
|
+
const n = s.indexOf(e, t);
|
|
83
|
+
return n !== -1 && n === t;
|
|
84
|
+
}, yn = (s) => {
|
|
85
|
+
if (!s) return null;
|
|
86
|
+
if (K(s)) return s;
|
|
87
|
+
let e = s.length;
|
|
88
|
+
if (!gt(e)) return null;
|
|
89
89
|
const t = new Array(e);
|
|
90
90
|
for (; e-- > 0; )
|
|
91
|
-
t[e] =
|
|
91
|
+
t[e] = s[e];
|
|
92
92
|
return t;
|
|
93
|
-
},
|
|
94
|
-
const
|
|
93
|
+
}, _n = /* @__PURE__ */ ((s) => (e) => s && e instanceof s)(typeof Uint8Array < "u" && $e(Uint8Array)), En = (s, e) => {
|
|
94
|
+
const n = (s && s[Symbol.iterator]).call(s);
|
|
95
95
|
let r;
|
|
96
|
-
for (; (r =
|
|
96
|
+
for (; (r = n.next()) && !r.done; ) {
|
|
97
97
|
const i = r.value;
|
|
98
|
-
e.call(
|
|
98
|
+
e.call(s, i[0], i[1]);
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, Sn = (s, e) => {
|
|
101
101
|
let t;
|
|
102
|
-
const
|
|
103
|
-
for (; (t =
|
|
104
|
-
|
|
105
|
-
return
|
|
106
|
-
},
|
|
102
|
+
const n = [];
|
|
103
|
+
for (; (t = s.exec(e)) !== null; )
|
|
104
|
+
n.push(t);
|
|
105
|
+
return n;
|
|
106
|
+
}, xn = j("HTMLFormElement"), Rn = (s) => s.toLowerCase().replace(
|
|
107
107
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
108
|
-
function(t,
|
|
109
|
-
return
|
|
108
|
+
function(t, n, r) {
|
|
109
|
+
return n.toUpperCase() + r;
|
|
110
110
|
}
|
|
111
|
-
),
|
|
112
|
-
const t = Object.getOwnPropertyDescriptors(
|
|
111
|
+
), Ve = (({ hasOwnProperty: s }) => (e, t) => s.call(e, t))(Object.prototype), An = j("RegExp"), yt = (s, e) => {
|
|
112
|
+
const t = Object.getOwnPropertyDescriptors(s), n = {};
|
|
113
113
|
ee(t, (r, i) => {
|
|
114
114
|
let o;
|
|
115
|
-
(o = e(r, i,
|
|
116
|
-
}), Object.defineProperties(
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
if (N(
|
|
115
|
+
(o = e(r, i, s)) !== !1 && (n[i] = o || r);
|
|
116
|
+
}), Object.defineProperties(s, n);
|
|
117
|
+
}, On = (s) => {
|
|
118
|
+
yt(s, (e, t) => {
|
|
119
|
+
if (N(s) && ["arguments", "caller", "callee"].indexOf(t) !== -1)
|
|
120
120
|
return !1;
|
|
121
|
-
const
|
|
122
|
-
if (N(
|
|
121
|
+
const n = s[t];
|
|
122
|
+
if (N(n)) {
|
|
123
123
|
if (e.enumerable = !1, "writable" in e) {
|
|
124
124
|
e.writable = !1;
|
|
125
125
|
return;
|
|
@@ -129,116 +129,104 @@ const bn = (n, e, t, { allOwnKeys: s } = {}) => (ee(e, (r, i) => {
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
-
},
|
|
133
|
-
const t = {},
|
|
132
|
+
}, Cn = (s, e) => {
|
|
133
|
+
const t = {}, n = (r) => {
|
|
134
134
|
r.forEach((i) => {
|
|
135
135
|
t[i] = !0;
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
|
-
return K(
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
ALPHA_DIGIT: Se + Se.toUpperCase() + We
|
|
144
|
-
}, Ln = (n = 16, e = St.ALPHA_DIGIT) => {
|
|
145
|
-
let t = "";
|
|
146
|
-
const { length: s } = e;
|
|
147
|
-
for (; n--; )
|
|
148
|
-
t += e[Math.random() * s | 0];
|
|
149
|
-
return t;
|
|
150
|
-
};
|
|
151
|
-
function vn(n) {
|
|
152
|
-
return !!(n && N(n.append) && n[Symbol.toStringTag] === "FormData" && n[Symbol.iterator]);
|
|
138
|
+
return K(s) ? n(s) : n(String(s).split(e)), t;
|
|
139
|
+
}, Tn = () => {
|
|
140
|
+
}, kn = (s, e) => s != null && Number.isFinite(s = +s) ? s : e;
|
|
141
|
+
function Nn(s) {
|
|
142
|
+
return !!(s && N(s.append) && s[Symbol.toStringTag] === "FormData" && s[Symbol.iterator]);
|
|
153
143
|
}
|
|
154
|
-
const
|
|
155
|
-
const e = new Array(10), t = (
|
|
156
|
-
if (pe(
|
|
157
|
-
if (e.indexOf(
|
|
144
|
+
const Pn = (s) => {
|
|
145
|
+
const e = new Array(10), t = (n, r) => {
|
|
146
|
+
if (pe(n)) {
|
|
147
|
+
if (e.indexOf(n) >= 0)
|
|
158
148
|
return;
|
|
159
|
-
if (!("toJSON" in
|
|
160
|
-
e[r] =
|
|
161
|
-
const i = K(
|
|
162
|
-
return ee(
|
|
149
|
+
if (!("toJSON" in n)) {
|
|
150
|
+
e[r] = n;
|
|
151
|
+
const i = K(n) ? [] : {};
|
|
152
|
+
return ee(n, (o, c) => {
|
|
163
153
|
const h = t(o, r + 1);
|
|
164
154
|
!Y(h) && (i[c] = h);
|
|
165
155
|
}), e[r] = void 0, i;
|
|
166
156
|
}
|
|
167
157
|
}
|
|
168
|
-
return
|
|
158
|
+
return n;
|
|
169
159
|
};
|
|
170
|
-
return t(
|
|
171
|
-
},
|
|
172
|
-
r === H && i === t &&
|
|
160
|
+
return t(s, 0);
|
|
161
|
+
}, In = j("AsyncFunction"), Ln = (s) => s && (pe(s) || N(s)) && N(s.then) && N(s.catch), _t = ((s, e) => s ? setImmediate : e ? ((t, n) => (H.addEventListener("message", ({ source: r, data: i }) => {
|
|
162
|
+
r === H && i === t && n.length && n.shift()();
|
|
173
163
|
}, !1), (r) => {
|
|
174
|
-
|
|
164
|
+
n.push(r), H.postMessage(t, "*");
|
|
175
165
|
}))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(
|
|
176
166
|
typeof setImmediate == "function",
|
|
177
167
|
N(H.postMessage)
|
|
178
|
-
),
|
|
168
|
+
), vn = typeof queueMicrotask < "u" ? queueMicrotask.bind(H) : typeof process < "u" && process.nextTick || _t, l = {
|
|
179
169
|
isArray: K,
|
|
180
|
-
isArrayBuffer:
|
|
181
|
-
isBuffer:
|
|
182
|
-
isFormData:
|
|
183
|
-
isArrayBufferView:
|
|
184
|
-
isString:
|
|
185
|
-
isNumber:
|
|
186
|
-
isBoolean:
|
|
170
|
+
isArrayBuffer: mt,
|
|
171
|
+
isBuffer: Zt,
|
|
172
|
+
isFormData: cn,
|
|
173
|
+
isArrayBufferView: Qt,
|
|
174
|
+
isString: Yt,
|
|
175
|
+
isNumber: gt,
|
|
176
|
+
isBoolean: en,
|
|
187
177
|
isObject: pe,
|
|
188
178
|
isPlainObject: ce,
|
|
189
|
-
isReadableStream:
|
|
190
|
-
isRequest:
|
|
191
|
-
isResponse:
|
|
192
|
-
isHeaders:
|
|
179
|
+
isReadableStream: ln,
|
|
180
|
+
isRequest: un,
|
|
181
|
+
isResponse: hn,
|
|
182
|
+
isHeaders: dn,
|
|
193
183
|
isUndefined: Y,
|
|
194
|
-
isDate:
|
|
195
|
-
isFile:
|
|
196
|
-
isBlob:
|
|
197
|
-
isRegExp:
|
|
184
|
+
isDate: tn,
|
|
185
|
+
isFile: nn,
|
|
186
|
+
isBlob: sn,
|
|
187
|
+
isRegExp: An,
|
|
198
188
|
isFunction: N,
|
|
199
|
-
isStream:
|
|
200
|
-
isURLSearchParams:
|
|
201
|
-
isTypedArray:
|
|
202
|
-
isFileList:
|
|
189
|
+
isStream: on,
|
|
190
|
+
isURLSearchParams: an,
|
|
191
|
+
isTypedArray: _n,
|
|
192
|
+
isFileList: rn,
|
|
203
193
|
forEach: ee,
|
|
204
194
|
merge: Oe,
|
|
205
|
-
extend:
|
|
206
|
-
trim:
|
|
207
|
-
stripBOM:
|
|
208
|
-
inherits:
|
|
209
|
-
toFlatObject:
|
|
195
|
+
extend: pn,
|
|
196
|
+
trim: fn,
|
|
197
|
+
stripBOM: mn,
|
|
198
|
+
inherits: gn,
|
|
199
|
+
toFlatObject: bn,
|
|
210
200
|
kindOf: de,
|
|
211
|
-
kindOfTest:
|
|
212
|
-
endsWith:
|
|
213
|
-
toArray:
|
|
214
|
-
forEachEntry:
|
|
215
|
-
matchAll:
|
|
216
|
-
isHTMLForm:
|
|
217
|
-
hasOwnProperty:
|
|
218
|
-
hasOwnProp:
|
|
201
|
+
kindOfTest: j,
|
|
202
|
+
endsWith: wn,
|
|
203
|
+
toArray: yn,
|
|
204
|
+
forEachEntry: En,
|
|
205
|
+
matchAll: Sn,
|
|
206
|
+
isHTMLForm: xn,
|
|
207
|
+
hasOwnProperty: Ve,
|
|
208
|
+
hasOwnProp: Ve,
|
|
219
209
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
220
|
-
reduceDescriptors:
|
|
221
|
-
freezeMethods:
|
|
222
|
-
toObjectSet:
|
|
223
|
-
toCamelCase:
|
|
224
|
-
noop:
|
|
225
|
-
toFiniteNumber:
|
|
226
|
-
findKey:
|
|
210
|
+
reduceDescriptors: yt,
|
|
211
|
+
freezeMethods: On,
|
|
212
|
+
toObjectSet: Cn,
|
|
213
|
+
toCamelCase: Rn,
|
|
214
|
+
noop: Tn,
|
|
215
|
+
toFiniteNumber: kn,
|
|
216
|
+
findKey: bt,
|
|
227
217
|
global: H,
|
|
228
|
-
isContextDefined:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
setImmediate: xt,
|
|
236
|
-
asap: Un
|
|
218
|
+
isContextDefined: wt,
|
|
219
|
+
isSpecCompliantForm: Nn,
|
|
220
|
+
toJSONObject: Pn,
|
|
221
|
+
isAsyncFn: In,
|
|
222
|
+
isThenable: Ln,
|
|
223
|
+
setImmediate: _t,
|
|
224
|
+
asap: vn
|
|
237
225
|
};
|
|
238
|
-
function
|
|
239
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message =
|
|
226
|
+
function w(s, e, t, n, r) {
|
|
227
|
+
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);
|
|
240
228
|
}
|
|
241
|
-
l.inherits(
|
|
229
|
+
l.inherits(w, Error, {
|
|
242
230
|
toJSON: function() {
|
|
243
231
|
return {
|
|
244
232
|
// Standard
|
|
@@ -259,7 +247,7 @@ l.inherits(y, Error, {
|
|
|
259
247
|
};
|
|
260
248
|
}
|
|
261
249
|
});
|
|
262
|
-
const
|
|
250
|
+
const Et = w.prototype, St = {};
|
|
263
251
|
[
|
|
264
252
|
"ERR_BAD_OPTION_VALUE",
|
|
265
253
|
"ERR_BAD_OPTION",
|
|
@@ -274,37 +262,37 @@ const Rt = y.prototype, At = {};
|
|
|
274
262
|
"ERR_NOT_SUPPORT",
|
|
275
263
|
"ERR_INVALID_URL"
|
|
276
264
|
// eslint-disable-next-line func-names
|
|
277
|
-
].forEach((
|
|
278
|
-
|
|
265
|
+
].forEach((s) => {
|
|
266
|
+
St[s] = { value: s };
|
|
279
267
|
});
|
|
280
|
-
Object.defineProperties(
|
|
281
|
-
Object.defineProperty(
|
|
282
|
-
|
|
283
|
-
const o = Object.create(
|
|
284
|
-
return l.toFlatObject(
|
|
268
|
+
Object.defineProperties(w, St);
|
|
269
|
+
Object.defineProperty(Et, "isAxiosError", { value: !0 });
|
|
270
|
+
w.from = (s, e, t, n, r, i) => {
|
|
271
|
+
const o = Object.create(Et);
|
|
272
|
+
return l.toFlatObject(s, o, function(h) {
|
|
285
273
|
return h !== Error.prototype;
|
|
286
|
-
}, (c) => c !== "isAxiosError"),
|
|
274
|
+
}, (c) => c !== "isAxiosError"), w.call(o, s.message, e, t, n, r), o.cause = s, o.name = s.name, i && Object.assign(o, i), o;
|
|
287
275
|
};
|
|
288
|
-
const
|
|
289
|
-
function Ce(
|
|
290
|
-
return l.isPlainObject(
|
|
276
|
+
const $n = null;
|
|
277
|
+
function Ce(s) {
|
|
278
|
+
return l.isPlainObject(s) || l.isArray(s);
|
|
291
279
|
}
|
|
292
|
-
function
|
|
293
|
-
return l.endsWith(
|
|
280
|
+
function xt(s) {
|
|
281
|
+
return l.endsWith(s, "[]") ? s.slice(0, -2) : s;
|
|
294
282
|
}
|
|
295
|
-
function
|
|
296
|
-
return
|
|
297
|
-
return r =
|
|
283
|
+
function Je(s, e, t) {
|
|
284
|
+
return s ? s.concat(e).map(function(r, i) {
|
|
285
|
+
return r = xt(r), !t && i ? "[" + r + "]" : r;
|
|
298
286
|
}).join(t ? "." : "") : e;
|
|
299
287
|
}
|
|
300
|
-
function
|
|
301
|
-
return l.isArray(
|
|
288
|
+
function jn(s) {
|
|
289
|
+
return l.isArray(s) && !s.some(Ce);
|
|
302
290
|
}
|
|
303
|
-
const
|
|
291
|
+
const Fn = l.toFlatObject(l, {}, null, function(e) {
|
|
304
292
|
return /^is[A-Z]/.test(e);
|
|
305
293
|
});
|
|
306
|
-
function me(
|
|
307
|
-
if (!l.isObject(
|
|
294
|
+
function me(s, e, t) {
|
|
295
|
+
if (!l.isObject(s))
|
|
308
296
|
throw new TypeError("target must be an object");
|
|
309
297
|
e = e || new FormData(), t = l.toFlatObject(t, {
|
|
310
298
|
metaTokens: !0,
|
|
@@ -313,7 +301,7 @@ function me(n, e, t) {
|
|
|
313
301
|
}, !1, function(m, p) {
|
|
314
302
|
return !l.isUndefined(p[m]);
|
|
315
303
|
});
|
|
316
|
-
const
|
|
304
|
+
const n = t.metaTokens, r = t.visitor || a, i = t.dots, o = t.indexes, h = (t.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(e);
|
|
317
305
|
if (!l.isFunction(r))
|
|
318
306
|
throw new TypeError("visitor must be a function");
|
|
319
307
|
function u(f) {
|
|
@@ -321,26 +309,26 @@ function me(n, e, t) {
|
|
|
321
309
|
if (l.isDate(f))
|
|
322
310
|
return f.toISOString();
|
|
323
311
|
if (!h && l.isBlob(f))
|
|
324
|
-
throw new
|
|
312
|
+
throw new w("Blob is not supported. Use a Buffer instead.");
|
|
325
313
|
return l.isArrayBuffer(f) || l.isTypedArray(f) ? h && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
326
314
|
}
|
|
327
315
|
function a(f, m, p) {
|
|
328
316
|
let _ = f;
|
|
329
317
|
if (f && !p && typeof f == "object") {
|
|
330
318
|
if (l.endsWith(m, "{}"))
|
|
331
|
-
m =
|
|
332
|
-
else if (l.isArray(f) &&
|
|
333
|
-
return m =
|
|
319
|
+
m = n ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
320
|
+
else if (l.isArray(f) && jn(f) || (l.isFileList(f) || l.endsWith(m, "[]")) && (_ = l.toArray(f)))
|
|
321
|
+
return m = xt(m), _.forEach(function(S, k) {
|
|
334
322
|
!(l.isUndefined(S) || S === null) && e.append(
|
|
335
323
|
// eslint-disable-next-line no-nested-ternary
|
|
336
|
-
o === !0 ?
|
|
324
|
+
o === !0 ? Je([m], k, i) : o === null ? m : m + "[]",
|
|
337
325
|
u(S)
|
|
338
326
|
);
|
|
339
327
|
}), !1;
|
|
340
328
|
}
|
|
341
|
-
return Ce(f) ? !0 : (e.append(
|
|
329
|
+
return Ce(f) ? !0 : (e.append(Je(p, m, i), u(f)), !1);
|
|
342
330
|
}
|
|
343
|
-
const d = [], g = Object.assign(
|
|
331
|
+
const d = [], g = Object.assign(Fn, {
|
|
344
332
|
defaultVisitor: a,
|
|
345
333
|
convertValue: u,
|
|
346
334
|
isVisitable: Ce
|
|
@@ -360,11 +348,11 @@ function me(n, e, t) {
|
|
|
360
348
|
}), d.pop();
|
|
361
349
|
}
|
|
362
350
|
}
|
|
363
|
-
if (!l.isObject(
|
|
351
|
+
if (!l.isObject(s))
|
|
364
352
|
throw new TypeError("data must be an object");
|
|
365
|
-
return b(
|
|
353
|
+
return b(s), e;
|
|
366
354
|
}
|
|
367
|
-
function
|
|
355
|
+
function We(s) {
|
|
368
356
|
const e = {
|
|
369
357
|
"!": "%21",
|
|
370
358
|
"'": "%27",
|
|
@@ -374,44 +362,44 @@ function Ge(n) {
|
|
|
374
362
|
"%20": "+",
|
|
375
363
|
"%00": "\0"
|
|
376
364
|
};
|
|
377
|
-
return encodeURIComponent(
|
|
378
|
-
return e[
|
|
365
|
+
return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g, function(n) {
|
|
366
|
+
return e[n];
|
|
379
367
|
});
|
|
380
368
|
}
|
|
381
|
-
function
|
|
382
|
-
this._pairs = [],
|
|
369
|
+
function je(s, e) {
|
|
370
|
+
this._pairs = [], s && me(s, this, e);
|
|
383
371
|
}
|
|
384
|
-
const
|
|
385
|
-
|
|
372
|
+
const Rt = je.prototype;
|
|
373
|
+
Rt.append = function(e, t) {
|
|
386
374
|
this._pairs.push([e, t]);
|
|
387
375
|
};
|
|
388
|
-
|
|
389
|
-
const t = e ? function(
|
|
390
|
-
return e.call(this,
|
|
391
|
-
} :
|
|
376
|
+
Rt.toString = function(e) {
|
|
377
|
+
const t = e ? function(n) {
|
|
378
|
+
return e.call(this, n, We);
|
|
379
|
+
} : We;
|
|
392
380
|
return this._pairs.map(function(r) {
|
|
393
381
|
return t(r[0]) + "=" + t(r[1]);
|
|
394
382
|
}, "").join("&");
|
|
395
383
|
};
|
|
396
|
-
function
|
|
397
|
-
return encodeURIComponent(
|
|
384
|
+
function Un(s) {
|
|
385
|
+
return encodeURIComponent(s).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
398
386
|
}
|
|
399
|
-
function
|
|
387
|
+
function At(s, e, t) {
|
|
400
388
|
if (!e)
|
|
401
|
-
return
|
|
402
|
-
const
|
|
389
|
+
return s;
|
|
390
|
+
const n = t && t.encode || Un;
|
|
403
391
|
l.isFunction(t) && (t = {
|
|
404
392
|
serialize: t
|
|
405
393
|
});
|
|
406
394
|
const r = t && t.serialize;
|
|
407
395
|
let i;
|
|
408
|
-
if (r ? i = r(e, t) : i = l.isURLSearchParams(e) ? e.toString() : new
|
|
409
|
-
const o =
|
|
410
|
-
o !== -1 && (
|
|
396
|
+
if (r ? i = r(e, t) : i = l.isURLSearchParams(e) ? e.toString() : new je(e, t).toString(n), i) {
|
|
397
|
+
const o = s.indexOf("#");
|
|
398
|
+
o !== -1 && (s = s.slice(0, o)), s += (s.indexOf("?") === -1 ? "?" : "&") + i;
|
|
411
399
|
}
|
|
412
|
-
return
|
|
400
|
+
return s;
|
|
413
401
|
}
|
|
414
|
-
class
|
|
402
|
+
class Ke {
|
|
415
403
|
constructor() {
|
|
416
404
|
this.handlers = [];
|
|
417
405
|
}
|
|
@@ -423,12 +411,12 @@ class Xe {
|
|
|
423
411
|
*
|
|
424
412
|
* @return {Number} An ID used to remove interceptor later
|
|
425
413
|
*/
|
|
426
|
-
use(e, t,
|
|
414
|
+
use(e, t, n) {
|
|
427
415
|
return this.handlers.push({
|
|
428
416
|
fulfilled: e,
|
|
429
417
|
rejected: t,
|
|
430
|
-
synchronous:
|
|
431
|
-
runWhen:
|
|
418
|
+
synchronous: n ? n.synchronous : !1,
|
|
419
|
+
runWhen: n ? n.runWhen : null
|
|
432
420
|
}), this.handlers.length - 1;
|
|
433
421
|
}
|
|
434
422
|
/**
|
|
@@ -460,86 +448,86 @@ class Xe {
|
|
|
460
448
|
* @returns {void}
|
|
461
449
|
*/
|
|
462
450
|
forEach(e) {
|
|
463
|
-
l.forEach(this.handlers, function(
|
|
464
|
-
|
|
451
|
+
l.forEach(this.handlers, function(n) {
|
|
452
|
+
n !== null && e(n);
|
|
465
453
|
});
|
|
466
454
|
}
|
|
467
455
|
}
|
|
468
|
-
const
|
|
456
|
+
const Ot = {
|
|
469
457
|
silentJSONParsing: !0,
|
|
470
458
|
forcedJSONParsing: !0,
|
|
471
459
|
clarifyTimeoutError: !1
|
|
472
|
-
},
|
|
460
|
+
}, Dn = typeof URLSearchParams < "u" ? URLSearchParams : je, qn = typeof FormData < "u" ? FormData : null, Bn = typeof Blob < "u" ? Blob : null, Mn = {
|
|
473
461
|
isBrowser: !0,
|
|
474
462
|
classes: {
|
|
475
|
-
URLSearchParams:
|
|
476
|
-
FormData:
|
|
477
|
-
Blob:
|
|
463
|
+
URLSearchParams: Dn,
|
|
464
|
+
FormData: qn,
|
|
465
|
+
Blob: Bn
|
|
478
466
|
},
|
|
479
467
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
480
|
-
},
|
|
481
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
468
|
+
}, Fe = typeof window < "u" && typeof document < "u", Te = typeof navigator == "object" && navigator || void 0, Hn = Fe && (!Te || ["ReactNative", "NativeScript", "NS"].indexOf(Te.product) < 0), zn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
469
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Vn = Fe && window.location.href || "http://localhost", Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
482
470
|
__proto__: null,
|
|
483
|
-
hasBrowserEnv:
|
|
484
|
-
hasStandardBrowserEnv:
|
|
485
|
-
hasStandardBrowserWebWorkerEnv:
|
|
486
|
-
navigator:
|
|
487
|
-
origin:
|
|
488
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
489
|
-
...
|
|
490
|
-
...
|
|
471
|
+
hasBrowserEnv: Fe,
|
|
472
|
+
hasStandardBrowserEnv: Hn,
|
|
473
|
+
hasStandardBrowserWebWorkerEnv: zn,
|
|
474
|
+
navigator: Te,
|
|
475
|
+
origin: Vn
|
|
476
|
+
}, Symbol.toStringTag, { value: "Module" })), O = {
|
|
477
|
+
...Jn,
|
|
478
|
+
...Mn
|
|
491
479
|
};
|
|
492
|
-
function
|
|
493
|
-
return me(
|
|
494
|
-
visitor: function(t,
|
|
495
|
-
return
|
|
480
|
+
function Wn(s, e) {
|
|
481
|
+
return me(s, new O.classes.URLSearchParams(), Object.assign({
|
|
482
|
+
visitor: function(t, n, r, i) {
|
|
483
|
+
return O.isNode && l.isBuffer(t) ? (this.append(n, t.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
496
484
|
}
|
|
497
485
|
}, e));
|
|
498
486
|
}
|
|
499
|
-
function
|
|
500
|
-
return l.matchAll(/\w+|\[(\w*)]/g,
|
|
487
|
+
function Kn(s) {
|
|
488
|
+
return l.matchAll(/\w+|\[(\w*)]/g, s).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
501
489
|
}
|
|
502
|
-
function
|
|
503
|
-
const e = {}, t = Object.keys(
|
|
504
|
-
let
|
|
490
|
+
function Xn(s) {
|
|
491
|
+
const e = {}, t = Object.keys(s);
|
|
492
|
+
let n;
|
|
505
493
|
const r = t.length;
|
|
506
494
|
let i;
|
|
507
|
-
for (
|
|
508
|
-
i = t[
|
|
495
|
+
for (n = 0; n < r; n++)
|
|
496
|
+
i = t[n], e[i] = s[i];
|
|
509
497
|
return e;
|
|
510
498
|
}
|
|
511
|
-
function
|
|
512
|
-
function e(t,
|
|
499
|
+
function Ct(s) {
|
|
500
|
+
function e(t, n, r, i) {
|
|
513
501
|
let o = t[i++];
|
|
514
502
|
if (o === "__proto__") return !0;
|
|
515
503
|
const c = Number.isFinite(+o), h = i >= t.length;
|
|
516
|
-
return o = !o && l.isArray(r) ? r.length : o, h ? (l.hasOwnProp(r, o) ? r[o] = [r[o],
|
|
504
|
+
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] = Xn(r[o])), !c);
|
|
517
505
|
}
|
|
518
|
-
if (l.isFormData(
|
|
506
|
+
if (l.isFormData(s) && l.isFunction(s.entries)) {
|
|
519
507
|
const t = {};
|
|
520
|
-
return l.forEachEntry(
|
|
521
|
-
e(
|
|
508
|
+
return l.forEachEntry(s, (n, r) => {
|
|
509
|
+
e(Kn(n), r, t, 0);
|
|
522
510
|
}), t;
|
|
523
511
|
}
|
|
524
512
|
return null;
|
|
525
513
|
}
|
|
526
|
-
function
|
|
527
|
-
if (l.isString(
|
|
514
|
+
function Gn(s, e, t) {
|
|
515
|
+
if (l.isString(s))
|
|
528
516
|
try {
|
|
529
|
-
return (e || JSON.parse)(
|
|
530
|
-
} catch (
|
|
531
|
-
if (
|
|
532
|
-
throw
|
|
517
|
+
return (e || JSON.parse)(s), l.trim(s);
|
|
518
|
+
} catch (n) {
|
|
519
|
+
if (n.name !== "SyntaxError")
|
|
520
|
+
throw n;
|
|
533
521
|
}
|
|
534
|
-
return (t || JSON.stringify)(
|
|
522
|
+
return (t || JSON.stringify)(s);
|
|
535
523
|
}
|
|
536
524
|
const te = {
|
|
537
|
-
transitional:
|
|
525
|
+
transitional: Ot,
|
|
538
526
|
adapter: ["xhr", "http", "fetch"],
|
|
539
527
|
transformRequest: [function(e, t) {
|
|
540
|
-
const
|
|
528
|
+
const n = t.getContentType() || "", r = n.indexOf("application/json") > -1, i = l.isObject(e);
|
|
541
529
|
if (i && l.isHTMLForm(e) && (e = new FormData(e)), l.isFormData(e))
|
|
542
|
-
return r ? JSON.stringify(
|
|
530
|
+
return r ? JSON.stringify(Ct(e)) : e;
|
|
543
531
|
if (l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) || l.isReadableStream(e))
|
|
544
532
|
return e;
|
|
545
533
|
if (l.isArrayBufferView(e))
|
|
@@ -548,9 +536,9 @@ const te = {
|
|
|
548
536
|
return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
549
537
|
let c;
|
|
550
538
|
if (i) {
|
|
551
|
-
if (
|
|
552
|
-
return
|
|
553
|
-
if ((c = l.isFileList(e)) ||
|
|
539
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
540
|
+
return Wn(e, this.formSerializer).toString();
|
|
541
|
+
if ((c = l.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
554
542
|
const h = this.env && this.env.FormData;
|
|
555
543
|
return me(
|
|
556
544
|
c ? { "files[]": e } : e,
|
|
@@ -559,19 +547,19 @@ const te = {
|
|
|
559
547
|
);
|
|
560
548
|
}
|
|
561
549
|
}
|
|
562
|
-
return i || r ? (t.setContentType("application/json", !1),
|
|
550
|
+
return i || r ? (t.setContentType("application/json", !1), Gn(e)) : e;
|
|
563
551
|
}],
|
|
564
552
|
transformResponse: [function(e) {
|
|
565
|
-
const t = this.transitional || te.transitional,
|
|
553
|
+
const t = this.transitional || te.transitional, n = t && t.forcedJSONParsing, r = this.responseType === "json";
|
|
566
554
|
if (l.isResponse(e) || l.isReadableStream(e))
|
|
567
555
|
return e;
|
|
568
|
-
if (e && l.isString(e) && (
|
|
556
|
+
if (e && l.isString(e) && (n && !this.responseType || r)) {
|
|
569
557
|
const o = !(t && t.silentJSONParsing) && r;
|
|
570
558
|
try {
|
|
571
559
|
return JSON.parse(e);
|
|
572
560
|
} catch (c) {
|
|
573
561
|
if (o)
|
|
574
|
-
throw c.name === "SyntaxError" ?
|
|
562
|
+
throw c.name === "SyntaxError" ? w.from(c, w.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
575
563
|
}
|
|
576
564
|
}
|
|
577
565
|
return e;
|
|
@@ -586,8 +574,8 @@ const te = {
|
|
|
586
574
|
maxContentLength: -1,
|
|
587
575
|
maxBodyLength: -1,
|
|
588
576
|
env: {
|
|
589
|
-
FormData:
|
|
590
|
-
Blob:
|
|
577
|
+
FormData: O.classes.FormData,
|
|
578
|
+
Blob: O.classes.Blob
|
|
591
579
|
},
|
|
592
580
|
validateStatus: function(e) {
|
|
593
581
|
return e >= 200 && e < 300;
|
|
@@ -599,10 +587,10 @@ const te = {
|
|
|
599
587
|
}
|
|
600
588
|
}
|
|
601
589
|
};
|
|
602
|
-
l.forEach(["delete", "get", "head", "post", "put", "patch"], (
|
|
603
|
-
te.headers[
|
|
590
|
+
l.forEach(["delete", "get", "head", "post", "put", "patch"], (s) => {
|
|
591
|
+
te.headers[s] = {};
|
|
604
592
|
});
|
|
605
|
-
const
|
|
593
|
+
const Zn = l.toObjectSet([
|
|
606
594
|
"age",
|
|
607
595
|
"authorization",
|
|
608
596
|
"content-length",
|
|
@@ -620,57 +608,57 @@ const ts = l.toObjectSet([
|
|
|
620
608
|
"referer",
|
|
621
609
|
"retry-after",
|
|
622
610
|
"user-agent"
|
|
623
|
-
]),
|
|
611
|
+
]), Qn = (s) => {
|
|
624
612
|
const e = {};
|
|
625
|
-
let t,
|
|
626
|
-
return
|
|
613
|
+
let t, n, r;
|
|
614
|
+
return s && s.split(`
|
|
627
615
|
`).forEach(function(o) {
|
|
628
|
-
r = o.indexOf(":"), t = o.substring(0, r).trim().toLowerCase(),
|
|
616
|
+
r = o.indexOf(":"), t = o.substring(0, r).trim().toLowerCase(), n = o.substring(r + 1).trim(), !(!t || e[t] && Zn[t]) && (t === "set-cookie" ? e[t] ? e[t].push(n) : e[t] = [n] : e[t] = e[t] ? e[t] + ", " + n : n);
|
|
629
617
|
}), e;
|
|
630
|
-
},
|
|
631
|
-
function Z(
|
|
632
|
-
return
|
|
618
|
+
}, Xe = Symbol("internals");
|
|
619
|
+
function Z(s) {
|
|
620
|
+
return s && String(s).trim().toLowerCase();
|
|
633
621
|
}
|
|
634
|
-
function ae(
|
|
635
|
-
return
|
|
622
|
+
function ae(s) {
|
|
623
|
+
return s === !1 || s == null ? s : l.isArray(s) ? s.map(ae) : String(s);
|
|
636
624
|
}
|
|
637
|
-
function
|
|
625
|
+
function Yn(s) {
|
|
638
626
|
const e = /* @__PURE__ */ Object.create(null), t = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
639
|
-
let
|
|
640
|
-
for (;
|
|
641
|
-
e[
|
|
627
|
+
let n;
|
|
628
|
+
for (; n = t.exec(s); )
|
|
629
|
+
e[n[1]] = n[2];
|
|
642
630
|
return e;
|
|
643
631
|
}
|
|
644
|
-
const
|
|
645
|
-
function
|
|
646
|
-
if (l.isFunction(
|
|
647
|
-
return
|
|
632
|
+
const es = (s) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());
|
|
633
|
+
function Se(s, e, t, n, r) {
|
|
634
|
+
if (l.isFunction(n))
|
|
635
|
+
return n.call(this, e, t);
|
|
648
636
|
if (r && (e = t), !!l.isString(e)) {
|
|
649
|
-
if (l.isString(
|
|
650
|
-
return e.indexOf(
|
|
651
|
-
if (l.isRegExp(
|
|
652
|
-
return
|
|
637
|
+
if (l.isString(n))
|
|
638
|
+
return e.indexOf(n) !== -1;
|
|
639
|
+
if (l.isRegExp(n))
|
|
640
|
+
return n.test(e);
|
|
653
641
|
}
|
|
654
642
|
}
|
|
655
|
-
function
|
|
656
|
-
return
|
|
643
|
+
function ts(s) {
|
|
644
|
+
return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, t, n) => t.toUpperCase() + n);
|
|
657
645
|
}
|
|
658
|
-
function
|
|
646
|
+
function ns(s, e) {
|
|
659
647
|
const t = l.toCamelCase(" " + e);
|
|
660
|
-
["get", "set", "has"].forEach((
|
|
661
|
-
Object.defineProperty(
|
|
648
|
+
["get", "set", "has"].forEach((n) => {
|
|
649
|
+
Object.defineProperty(s, n + t, {
|
|
662
650
|
value: function(r, i, o) {
|
|
663
|
-
return this[
|
|
651
|
+
return this[n].call(this, e, r, i, o);
|
|
664
652
|
},
|
|
665
653
|
configurable: !0
|
|
666
654
|
});
|
|
667
655
|
});
|
|
668
656
|
}
|
|
669
|
-
let
|
|
657
|
+
let T = class {
|
|
670
658
|
constructor(e) {
|
|
671
659
|
e && this.set(e);
|
|
672
660
|
}
|
|
673
|
-
set(e, t,
|
|
661
|
+
set(e, t, n) {
|
|
674
662
|
const r = this;
|
|
675
663
|
function i(c, h, u) {
|
|
676
664
|
const a = Z(h);
|
|
@@ -682,26 +670,26 @@ let C = class {
|
|
|
682
670
|
const o = (c, h) => l.forEach(c, (u, a) => i(u, a, h));
|
|
683
671
|
if (l.isPlainObject(e) || e instanceof this.constructor)
|
|
684
672
|
o(e, t);
|
|
685
|
-
else if (l.isString(e) && (e = e.trim()) && !
|
|
686
|
-
o(
|
|
673
|
+
else if (l.isString(e) && (e = e.trim()) && !es(e))
|
|
674
|
+
o(Qn(e), t);
|
|
687
675
|
else if (l.isHeaders(e))
|
|
688
676
|
for (const [c, h] of e.entries())
|
|
689
|
-
i(h, c,
|
|
677
|
+
i(h, c, n);
|
|
690
678
|
else
|
|
691
|
-
e != null && i(t, e,
|
|
679
|
+
e != null && i(t, e, n);
|
|
692
680
|
return this;
|
|
693
681
|
}
|
|
694
682
|
get(e, t) {
|
|
695
683
|
if (e = Z(e), e) {
|
|
696
|
-
const
|
|
697
|
-
if (
|
|
698
|
-
const r = this[
|
|
684
|
+
const n = l.findKey(this, e);
|
|
685
|
+
if (n) {
|
|
686
|
+
const r = this[n];
|
|
699
687
|
if (!t)
|
|
700
688
|
return r;
|
|
701
689
|
if (t === !0)
|
|
702
|
-
return
|
|
690
|
+
return Yn(r);
|
|
703
691
|
if (l.isFunction(t))
|
|
704
|
-
return t.call(this, r,
|
|
692
|
+
return t.call(this, r, n);
|
|
705
693
|
if (l.isRegExp(t))
|
|
706
694
|
return t.exec(r);
|
|
707
695
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
@@ -710,41 +698,41 @@ let C = class {
|
|
|
710
698
|
}
|
|
711
699
|
has(e, t) {
|
|
712
700
|
if (e = Z(e), e) {
|
|
713
|
-
const
|
|
714
|
-
return !!(
|
|
701
|
+
const n = l.findKey(this, e);
|
|
702
|
+
return !!(n && this[n] !== void 0 && (!t || Se(this, this[n], n, t)));
|
|
715
703
|
}
|
|
716
704
|
return !1;
|
|
717
705
|
}
|
|
718
706
|
delete(e, t) {
|
|
719
|
-
const
|
|
707
|
+
const n = this;
|
|
720
708
|
let r = !1;
|
|
721
709
|
function i(o) {
|
|
722
710
|
if (o = Z(o), o) {
|
|
723
|
-
const c = l.findKey(
|
|
724
|
-
c && (!t ||
|
|
711
|
+
const c = l.findKey(n, o);
|
|
712
|
+
c && (!t || Se(n, n[c], c, t)) && (delete n[c], r = !0);
|
|
725
713
|
}
|
|
726
714
|
}
|
|
727
715
|
return l.isArray(e) ? e.forEach(i) : i(e), r;
|
|
728
716
|
}
|
|
729
717
|
clear(e) {
|
|
730
718
|
const t = Object.keys(this);
|
|
731
|
-
let
|
|
732
|
-
for (;
|
|
733
|
-
const i = t[
|
|
734
|
-
(!e ||
|
|
719
|
+
let n = t.length, r = !1;
|
|
720
|
+
for (; n--; ) {
|
|
721
|
+
const i = t[n];
|
|
722
|
+
(!e || Se(this, this[i], i, e, !0)) && (delete this[i], r = !0);
|
|
735
723
|
}
|
|
736
724
|
return r;
|
|
737
725
|
}
|
|
738
726
|
normalize(e) {
|
|
739
|
-
const t = this,
|
|
727
|
+
const t = this, n = {};
|
|
740
728
|
return l.forEach(this, (r, i) => {
|
|
741
|
-
const o = l.findKey(
|
|
729
|
+
const o = l.findKey(n, i);
|
|
742
730
|
if (o) {
|
|
743
731
|
t[o] = ae(r), delete t[i];
|
|
744
732
|
return;
|
|
745
733
|
}
|
|
746
|
-
const c = e ?
|
|
747
|
-
c !== i && delete t[i], t[c] = ae(r),
|
|
734
|
+
const c = e ? ts(i) : String(i).trim();
|
|
735
|
+
c !== i && delete t[i], t[c] = ae(r), n[c] = !0;
|
|
748
736
|
}), this;
|
|
749
737
|
}
|
|
750
738
|
concat(...e) {
|
|
@@ -752,8 +740,8 @@ let C = class {
|
|
|
752
740
|
}
|
|
753
741
|
toJSON(e) {
|
|
754
742
|
const t = /* @__PURE__ */ Object.create(null);
|
|
755
|
-
return l.forEach(this, (
|
|
756
|
-
|
|
743
|
+
return l.forEach(this, (n, r) => {
|
|
744
|
+
n != null && n !== !1 && (t[r] = e && l.isArray(n) ? n.join(", ") : n);
|
|
757
745
|
}), t;
|
|
758
746
|
}
|
|
759
747
|
[Symbol.iterator]() {
|
|
@@ -770,95 +758,95 @@ let C = class {
|
|
|
770
758
|
return e instanceof this ? e : new this(e);
|
|
771
759
|
}
|
|
772
760
|
static concat(e, ...t) {
|
|
773
|
-
const
|
|
774
|
-
return t.forEach((r) =>
|
|
761
|
+
const n = new this(e);
|
|
762
|
+
return t.forEach((r) => n.set(r)), n;
|
|
775
763
|
}
|
|
776
764
|
static accessor(e) {
|
|
777
|
-
const
|
|
765
|
+
const n = (this[Xe] = this[Xe] = {
|
|
778
766
|
accessors: {}
|
|
779
767
|
}).accessors, r = this.prototype;
|
|
780
768
|
function i(o) {
|
|
781
769
|
const c = Z(o);
|
|
782
|
-
|
|
770
|
+
n[c] || (ns(r, o), n[c] = !0);
|
|
783
771
|
}
|
|
784
772
|
return l.isArray(e) ? e.forEach(i) : i(e), this;
|
|
785
773
|
}
|
|
786
774
|
};
|
|
787
|
-
|
|
788
|
-
l.reduceDescriptors(
|
|
775
|
+
T.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
776
|
+
l.reduceDescriptors(T.prototype, ({ value: s }, e) => {
|
|
789
777
|
let t = e[0].toUpperCase() + e.slice(1);
|
|
790
778
|
return {
|
|
791
|
-
get: () =>
|
|
792
|
-
set(
|
|
793
|
-
this[t] =
|
|
779
|
+
get: () => s,
|
|
780
|
+
set(n) {
|
|
781
|
+
this[t] = n;
|
|
794
782
|
}
|
|
795
783
|
};
|
|
796
784
|
});
|
|
797
|
-
l.freezeMethods(
|
|
798
|
-
function
|
|
799
|
-
const t = this || te,
|
|
800
|
-
let i =
|
|
801
|
-
return l.forEach(
|
|
785
|
+
l.freezeMethods(T);
|
|
786
|
+
function xe(s, e) {
|
|
787
|
+
const t = this || te, n = e || t, r = T.from(n.headers);
|
|
788
|
+
let i = n.data;
|
|
789
|
+
return l.forEach(s, function(c) {
|
|
802
790
|
i = c.call(t, i, r.normalize(), e ? e.status : void 0);
|
|
803
791
|
}), r.normalize(), i;
|
|
804
792
|
}
|
|
805
|
-
function
|
|
806
|
-
return !!(
|
|
793
|
+
function Tt(s) {
|
|
794
|
+
return !!(s && s.__CANCEL__);
|
|
807
795
|
}
|
|
808
|
-
function
|
|
809
|
-
|
|
796
|
+
function X(s, e, t) {
|
|
797
|
+
w.call(this, s ?? "canceled", w.ERR_CANCELED, e, t), this.name = "CanceledError";
|
|
810
798
|
}
|
|
811
|
-
l.inherits(
|
|
799
|
+
l.inherits(X, w, {
|
|
812
800
|
__CANCEL__: !0
|
|
813
801
|
});
|
|
814
|
-
function
|
|
815
|
-
const
|
|
816
|
-
!t.status || !
|
|
802
|
+
function kt(s, e, t) {
|
|
803
|
+
const n = t.config.validateStatus;
|
|
804
|
+
!t.status || !n || n(t.status) ? s(t) : e(new w(
|
|
817
805
|
"Request failed with status code " + t.status,
|
|
818
|
-
[
|
|
806
|
+
[w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
|
|
819
807
|
t.config,
|
|
820
808
|
t.request,
|
|
821
809
|
t
|
|
822
810
|
));
|
|
823
811
|
}
|
|
824
|
-
function
|
|
825
|
-
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(
|
|
812
|
+
function ss(s) {
|
|
813
|
+
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(s);
|
|
826
814
|
return e && e[1] || "";
|
|
827
815
|
}
|
|
828
|
-
function
|
|
829
|
-
|
|
830
|
-
const t = new Array(
|
|
816
|
+
function rs(s, e) {
|
|
817
|
+
s = s || 10;
|
|
818
|
+
const t = new Array(s), n = new Array(s);
|
|
831
819
|
let r = 0, i = 0, o;
|
|
832
820
|
return e = e !== void 0 ? e : 1e3, function(h) {
|
|
833
|
-
const u = Date.now(), a =
|
|
834
|
-
o || (o = u), t[r] = h,
|
|
821
|
+
const u = Date.now(), a = n[i];
|
|
822
|
+
o || (o = u), t[r] = h, n[r] = u;
|
|
835
823
|
let d = i, g = 0;
|
|
836
824
|
for (; d !== r; )
|
|
837
|
-
g += t[d++], d = d %
|
|
838
|
-
if (r = (r + 1) %
|
|
825
|
+
g += t[d++], d = d % s;
|
|
826
|
+
if (r = (r + 1) % s, r === i && (i = (i + 1) % s), u - o < e)
|
|
839
827
|
return;
|
|
840
828
|
const b = a && u - a;
|
|
841
829
|
return b ? Math.round(g * 1e3 / b) : void 0;
|
|
842
830
|
};
|
|
843
831
|
}
|
|
844
|
-
function
|
|
845
|
-
let t = 0,
|
|
832
|
+
function is(s, e) {
|
|
833
|
+
let t = 0, n = 1e3 / e, r, i;
|
|
846
834
|
const o = (u, a = Date.now()) => {
|
|
847
|
-
t = a, r = null, i && (clearTimeout(i), i = null),
|
|
835
|
+
t = a, r = null, i && (clearTimeout(i), i = null), s.apply(null, u);
|
|
848
836
|
};
|
|
849
837
|
return [(...u) => {
|
|
850
838
|
const a = Date.now(), d = a - t;
|
|
851
|
-
d >=
|
|
839
|
+
d >= n ? o(u, a) : (r = u, i || (i = setTimeout(() => {
|
|
852
840
|
i = null, o(r);
|
|
853
|
-
},
|
|
841
|
+
}, n - d)));
|
|
854
842
|
}, () => r && o(r)];
|
|
855
843
|
}
|
|
856
|
-
const ue = (
|
|
857
|
-
let
|
|
858
|
-
const r =
|
|
859
|
-
return
|
|
860
|
-
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, h = o -
|
|
861
|
-
|
|
844
|
+
const ue = (s, e, t = 3) => {
|
|
845
|
+
let n = 0;
|
|
846
|
+
const r = rs(50, 250);
|
|
847
|
+
return is((i) => {
|
|
848
|
+
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, h = o - n, u = r(h), a = o <= c;
|
|
849
|
+
n = o;
|
|
862
850
|
const d = {
|
|
863
851
|
loaded: o,
|
|
864
852
|
total: c,
|
|
@@ -870,31 +858,31 @@ const ue = (n, e, t = 3) => {
|
|
|
870
858
|
lengthComputable: c != null,
|
|
871
859
|
[e ? "download" : "upload"]: !0
|
|
872
860
|
};
|
|
873
|
-
|
|
861
|
+
s(d);
|
|
874
862
|
}, t);
|
|
875
|
-
},
|
|
876
|
-
const t =
|
|
877
|
-
return [(
|
|
863
|
+
}, Ge = (s, e) => {
|
|
864
|
+
const t = s != null;
|
|
865
|
+
return [(n) => e[0]({
|
|
878
866
|
lengthComputable: t,
|
|
879
|
-
total:
|
|
880
|
-
loaded:
|
|
867
|
+
total: s,
|
|
868
|
+
loaded: n
|
|
881
869
|
}), e[1]];
|
|
882
|
-
},
|
|
883
|
-
new URL(
|
|
884
|
-
|
|
885
|
-
) : () => !0,
|
|
870
|
+
}, Ze = (s) => (...e) => l.asap(() => s(...e)), os = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((s, e) => (t) => (t = new URL(t, O.origin), s.protocol === t.protocol && s.host === t.host && (e || s.port === t.port)))(
|
|
871
|
+
new URL(O.origin),
|
|
872
|
+
O.navigator && /(msie|trident)/i.test(O.navigator.userAgent)
|
|
873
|
+
) : () => !0, cs = O.hasStandardBrowserEnv ? (
|
|
886
874
|
// Standard browser envs support document.cookie
|
|
887
875
|
{
|
|
888
|
-
write(
|
|
889
|
-
const o = [
|
|
890
|
-
l.isNumber(t) && o.push("expires=" + new Date(t).toGMTString()), l.isString(
|
|
876
|
+
write(s, e, t, n, r, i) {
|
|
877
|
+
const o = [s + "=" + encodeURIComponent(e)];
|
|
878
|
+
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("; ");
|
|
891
879
|
},
|
|
892
|
-
read(
|
|
893
|
-
const e = document.cookie.match(new RegExp("(^|;\\s*)(" +
|
|
880
|
+
read(s) {
|
|
881
|
+
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + s + ")=([^;]*)"));
|
|
894
882
|
return e ? decodeURIComponent(e[3]) : null;
|
|
895
883
|
},
|
|
896
|
-
remove(
|
|
897
|
-
this.write(
|
|
884
|
+
remove(s) {
|
|
885
|
+
this.write(s, "", Date.now() - 864e5);
|
|
898
886
|
}
|
|
899
887
|
}
|
|
900
888
|
) : (
|
|
@@ -909,43 +897,44 @@ const ue = (n, e, t = 3) => {
|
|
|
909
897
|
}
|
|
910
898
|
}
|
|
911
899
|
);
|
|
912
|
-
function
|
|
913
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(
|
|
900
|
+
function as(s) {
|
|
901
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
|
|
914
902
|
}
|
|
915
|
-
function
|
|
916
|
-
return e ?
|
|
903
|
+
function ls(s, e) {
|
|
904
|
+
return e ? s.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : s;
|
|
917
905
|
}
|
|
918
|
-
function
|
|
919
|
-
|
|
906
|
+
function Nt(s, e, t) {
|
|
907
|
+
let n = !as(e);
|
|
908
|
+
return s && (n || t == !1) ? ls(s, e) : e;
|
|
920
909
|
}
|
|
921
|
-
const
|
|
922
|
-
function V(
|
|
910
|
+
const Qe = (s) => s instanceof T ? { ...s } : s;
|
|
911
|
+
function V(s, e) {
|
|
923
912
|
e = e || {};
|
|
924
913
|
const t = {};
|
|
925
|
-
function
|
|
914
|
+
function n(u, a, d, g) {
|
|
926
915
|
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;
|
|
927
916
|
}
|
|
928
917
|
function r(u, a, d, g) {
|
|
929
918
|
if (l.isUndefined(a)) {
|
|
930
919
|
if (!l.isUndefined(u))
|
|
931
|
-
return
|
|
932
|
-
} else return
|
|
920
|
+
return n(void 0, u, d, g);
|
|
921
|
+
} else return n(u, a, d, g);
|
|
933
922
|
}
|
|
934
923
|
function i(u, a) {
|
|
935
924
|
if (!l.isUndefined(a))
|
|
936
|
-
return
|
|
925
|
+
return n(void 0, a);
|
|
937
926
|
}
|
|
938
927
|
function o(u, a) {
|
|
939
928
|
if (l.isUndefined(a)) {
|
|
940
929
|
if (!l.isUndefined(u))
|
|
941
|
-
return
|
|
942
|
-
} else return
|
|
930
|
+
return n(void 0, u);
|
|
931
|
+
} else return n(void 0, a);
|
|
943
932
|
}
|
|
944
933
|
function c(u, a, d) {
|
|
945
934
|
if (d in e)
|
|
946
|
-
return
|
|
947
|
-
if (d in
|
|
948
|
-
return
|
|
935
|
+
return n(u, a);
|
|
936
|
+
if (d in s)
|
|
937
|
+
return n(void 0, u);
|
|
949
938
|
}
|
|
950
939
|
const h = {
|
|
951
940
|
url: i,
|
|
@@ -976,39 +965,39 @@ function V(n, e) {
|
|
|
976
965
|
socketPath: o,
|
|
977
966
|
responseEncoding: o,
|
|
978
967
|
validateStatus: c,
|
|
979
|
-
headers: (u, a, d) => r(
|
|
968
|
+
headers: (u, a, d) => r(Qe(u), Qe(a), d, !0)
|
|
980
969
|
};
|
|
981
|
-
return l.forEach(Object.keys(Object.assign({},
|
|
982
|
-
const d = h[a] || r, g = d(
|
|
970
|
+
return l.forEach(Object.keys(Object.assign({}, s, e)), function(a) {
|
|
971
|
+
const d = h[a] || r, g = d(s[a], e[a], a);
|
|
983
972
|
l.isUndefined(g) && d !== c || (t[a] = g);
|
|
984
973
|
}), t;
|
|
985
974
|
}
|
|
986
|
-
const
|
|
987
|
-
const e = V({},
|
|
988
|
-
let { data: t, withXSRFToken:
|
|
989
|
-
e.headers = o =
|
|
975
|
+
const Pt = (s) => {
|
|
976
|
+
const e = V({}, s);
|
|
977
|
+
let { data: t, withXSRFToken: n, xsrfHeaderName: r, xsrfCookieName: i, headers: o, auth: c } = e;
|
|
978
|
+
e.headers = o = T.from(o), e.url = At(Nt(e.baseURL, e.url, e.allowAbsoluteUrls), s.params, s.paramsSerializer), c && o.set(
|
|
990
979
|
"Authorization",
|
|
991
980
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
992
981
|
);
|
|
993
982
|
let h;
|
|
994
983
|
if (l.isFormData(t)) {
|
|
995
|
-
if (
|
|
984
|
+
if (O.hasStandardBrowserEnv || O.hasStandardBrowserWebWorkerEnv)
|
|
996
985
|
o.setContentType(void 0);
|
|
997
986
|
else if ((h = o.getContentType()) !== !1) {
|
|
998
987
|
const [u, ...a] = h ? h.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
999
988
|
o.setContentType([u || "multipart/form-data", ...a].join("; "));
|
|
1000
989
|
}
|
|
1001
990
|
}
|
|
1002
|
-
if (
|
|
1003
|
-
const u = r && i &&
|
|
991
|
+
if (O.hasStandardBrowserEnv && (n && l.isFunction(n) && (n = n(e)), n || n !== !1 && os(e.url))) {
|
|
992
|
+
const u = r && i && cs.read(i);
|
|
1004
993
|
u && o.set(r, u);
|
|
1005
994
|
}
|
|
1006
995
|
return e;
|
|
1007
|
-
},
|
|
1008
|
-
return new Promise(function(t,
|
|
1009
|
-
const r =
|
|
996
|
+
}, us = typeof XMLHttpRequest < "u", hs = us && function(s) {
|
|
997
|
+
return new Promise(function(t, n) {
|
|
998
|
+
const r = Pt(s);
|
|
1010
999
|
let i = r.data;
|
|
1011
|
-
const o =
|
|
1000
|
+
const o = T.from(r.headers).normalize();
|
|
1012
1001
|
let { responseType: c, onUploadProgress: h, onDownloadProgress: u } = r, a, d, g, b, f;
|
|
1013
1002
|
function m() {
|
|
1014
1003
|
b && b(), f && f(), r.cancelToken && r.cancelToken.unsubscribe(a), r.signal && r.signal.removeEventListener("abort", a);
|
|
@@ -1018,104 +1007,104 @@ const vt = (n) => {
|
|
|
1018
1007
|
function _() {
|
|
1019
1008
|
if (!p)
|
|
1020
1009
|
return;
|
|
1021
|
-
const S =
|
|
1010
|
+
const S = T.from(
|
|
1022
1011
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1023
1012
|
), x = {
|
|
1024
1013
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1025
1014
|
status: p.status,
|
|
1026
1015
|
statusText: p.statusText,
|
|
1027
1016
|
headers: S,
|
|
1028
|
-
config:
|
|
1017
|
+
config: s,
|
|
1029
1018
|
request: p
|
|
1030
1019
|
};
|
|
1031
|
-
|
|
1020
|
+
kt(function(I) {
|
|
1032
1021
|
t(I), m();
|
|
1033
1022
|
}, function(I) {
|
|
1034
|
-
|
|
1023
|
+
n(I), m();
|
|
1035
1024
|
}, x), p = null;
|
|
1036
1025
|
}
|
|
1037
1026
|
"onloadend" in p ? p.onloadend = _ : p.onreadystatechange = function() {
|
|
1038
1027
|
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(_);
|
|
1039
1028
|
}, p.onabort = function() {
|
|
1040
|
-
p && (
|
|
1029
|
+
p && (n(new w("Request aborted", w.ECONNABORTED, s, p)), p = null);
|
|
1041
1030
|
}, p.onerror = function() {
|
|
1042
|
-
|
|
1031
|
+
n(new w("Network Error", w.ERR_NETWORK, s, p)), p = null;
|
|
1043
1032
|
}, p.ontimeout = function() {
|
|
1044
1033
|
let k = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1045
|
-
const x = r.transitional ||
|
|
1046
|
-
r.timeoutErrorMessage && (k = r.timeoutErrorMessage),
|
|
1034
|
+
const x = r.transitional || Ot;
|
|
1035
|
+
r.timeoutErrorMessage && (k = r.timeoutErrorMessage), n(new w(
|
|
1047
1036
|
k,
|
|
1048
|
-
x.clarifyTimeoutError ?
|
|
1049
|
-
|
|
1037
|
+
x.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
|
|
1038
|
+
s,
|
|
1050
1039
|
p
|
|
1051
1040
|
)), p = null;
|
|
1052
1041
|
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && l.forEach(o.toJSON(), function(k, x) {
|
|
1053
1042
|
p.setRequestHeader(x, k);
|
|
1054
1043
|
}), l.isUndefined(r.withCredentials) || (p.withCredentials = !!r.withCredentials), c && c !== "json" && (p.responseType = r.responseType), u && ([g, f] = ue(u, !0), p.addEventListener("progress", g)), h && p.upload && ([d, b] = ue(h), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", b)), (r.cancelToken || r.signal) && (a = (S) => {
|
|
1055
|
-
p && (
|
|
1044
|
+
p && (n(!S || S.type ? new X(null, s, p) : S), p.abort(), p = null);
|
|
1056
1045
|
}, r.cancelToken && r.cancelToken.subscribe(a), r.signal && (r.signal.aborted ? a() : r.signal.addEventListener("abort", a)));
|
|
1057
|
-
const E =
|
|
1058
|
-
if (E &&
|
|
1059
|
-
|
|
1046
|
+
const E = ss(r.url);
|
|
1047
|
+
if (E && O.protocols.indexOf(E) === -1) {
|
|
1048
|
+
n(new w("Unsupported protocol " + E + ":", w.ERR_BAD_REQUEST, s));
|
|
1060
1049
|
return;
|
|
1061
1050
|
}
|
|
1062
1051
|
p.send(i || null);
|
|
1063
1052
|
});
|
|
1064
|
-
},
|
|
1065
|
-
const { length: t } =
|
|
1053
|
+
}, ds = (s, e) => {
|
|
1054
|
+
const { length: t } = s = s ? s.filter(Boolean) : [];
|
|
1066
1055
|
if (e || t) {
|
|
1067
|
-
let
|
|
1056
|
+
let n = new AbortController(), r;
|
|
1068
1057
|
const i = function(u) {
|
|
1069
1058
|
if (!r) {
|
|
1070
1059
|
r = !0, c();
|
|
1071
1060
|
const a = u instanceof Error ? u : this.reason;
|
|
1072
|
-
|
|
1061
|
+
n.abort(a instanceof w ? a : new X(a instanceof Error ? a.message : a));
|
|
1073
1062
|
}
|
|
1074
1063
|
};
|
|
1075
1064
|
let o = e && setTimeout(() => {
|
|
1076
|
-
o = null, i(new
|
|
1065
|
+
o = null, i(new w(`timeout ${e} of ms exceeded`, w.ETIMEDOUT));
|
|
1077
1066
|
}, e);
|
|
1078
1067
|
const c = () => {
|
|
1079
|
-
|
|
1068
|
+
s && (o && clearTimeout(o), o = null, s.forEach((u) => {
|
|
1080
1069
|
u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
|
|
1081
|
-
}),
|
|
1070
|
+
}), s = null);
|
|
1082
1071
|
};
|
|
1083
|
-
|
|
1084
|
-
const { signal: h } =
|
|
1072
|
+
s.forEach((u) => u.addEventListener("abort", i));
|
|
1073
|
+
const { signal: h } = n;
|
|
1085
1074
|
return h.unsubscribe = () => l.asap(c), h;
|
|
1086
1075
|
}
|
|
1087
|
-
},
|
|
1088
|
-
let t =
|
|
1076
|
+
}, fs = function* (s, e) {
|
|
1077
|
+
let t = s.byteLength;
|
|
1089
1078
|
if (t < e) {
|
|
1090
|
-
yield
|
|
1079
|
+
yield s;
|
|
1091
1080
|
return;
|
|
1092
1081
|
}
|
|
1093
|
-
let
|
|
1094
|
-
for (;
|
|
1095
|
-
r =
|
|
1096
|
-
},
|
|
1097
|
-
for await (const t of
|
|
1098
|
-
yield*
|
|
1099
|
-
},
|
|
1100
|
-
if (
|
|
1101
|
-
yield*
|
|
1082
|
+
let n = 0, r;
|
|
1083
|
+
for (; n < t; )
|
|
1084
|
+
r = n + e, yield s.slice(n, r), n = r;
|
|
1085
|
+
}, ps = async function* (s, e) {
|
|
1086
|
+
for await (const t of ms(s))
|
|
1087
|
+
yield* fs(t, e);
|
|
1088
|
+
}, ms = async function* (s) {
|
|
1089
|
+
if (s[Symbol.asyncIterator]) {
|
|
1090
|
+
yield* s;
|
|
1102
1091
|
return;
|
|
1103
1092
|
}
|
|
1104
|
-
const e =
|
|
1093
|
+
const e = s.getReader();
|
|
1105
1094
|
try {
|
|
1106
1095
|
for (; ; ) {
|
|
1107
|
-
const { done: t, value:
|
|
1096
|
+
const { done: t, value: n } = await e.read();
|
|
1108
1097
|
if (t)
|
|
1109
1098
|
break;
|
|
1110
|
-
yield
|
|
1099
|
+
yield n;
|
|
1111
1100
|
}
|
|
1112
1101
|
} finally {
|
|
1113
1102
|
await e.cancel();
|
|
1114
1103
|
}
|
|
1115
|
-
},
|
|
1116
|
-
const r =
|
|
1104
|
+
}, Ye = (s, e, t, n) => {
|
|
1105
|
+
const r = ps(s, e);
|
|
1117
1106
|
let i = 0, o, c = (h) => {
|
|
1118
|
-
o || (o = !0,
|
|
1107
|
+
o || (o = !0, n && n(h));
|
|
1119
1108
|
};
|
|
1120
1109
|
return new ReadableStream({
|
|
1121
1110
|
async pull(h) {
|
|
@@ -1141,54 +1130,54 @@ const vt = (n) => {
|
|
|
1141
1130
|
}, {
|
|
1142
1131
|
highWaterMark: 2
|
|
1143
1132
|
});
|
|
1144
|
-
}, ge = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function",
|
|
1133
|
+
}, ge = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", It = ge && typeof ReadableStream == "function", gs = ge && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((s) => (e) => s.encode(e))(new TextEncoder()) : async (s) => new Uint8Array(await new Response(s).arrayBuffer())), Lt = (s, ...e) => {
|
|
1145
1134
|
try {
|
|
1146
|
-
return !!
|
|
1135
|
+
return !!s(...e);
|
|
1147
1136
|
} catch {
|
|
1148
1137
|
return !1;
|
|
1149
1138
|
}
|
|
1150
|
-
},
|
|
1151
|
-
let
|
|
1152
|
-
const e = new Request(
|
|
1139
|
+
}, bs = It && Lt(() => {
|
|
1140
|
+
let s = !1;
|
|
1141
|
+
const e = new Request(O.origin, {
|
|
1153
1142
|
body: new ReadableStream(),
|
|
1154
1143
|
method: "POST",
|
|
1155
1144
|
get duplex() {
|
|
1156
|
-
return
|
|
1145
|
+
return s = !0, "half";
|
|
1157
1146
|
}
|
|
1158
1147
|
}).headers.has("Content-Type");
|
|
1159
|
-
return
|
|
1160
|
-
}),
|
|
1161
|
-
stream:
|
|
1148
|
+
return s && !e;
|
|
1149
|
+
}), et = 64 * 1024, ke = It && Lt(() => l.isReadableStream(new Response("").body)), he = {
|
|
1150
|
+
stream: ke && ((s) => s.body)
|
|
1162
1151
|
};
|
|
1163
|
-
ge && ((
|
|
1152
|
+
ge && ((s) => {
|
|
1164
1153
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
|
|
1165
|
-
!he[e] && (he[e] = l.isFunction(
|
|
1166
|
-
throw new
|
|
1154
|
+
!he[e] && (he[e] = l.isFunction(s[e]) ? (t) => t[e]() : (t, n) => {
|
|
1155
|
+
throw new w(`Response type '${e}' is not supported`, w.ERR_NOT_SUPPORT, n);
|
|
1167
1156
|
});
|
|
1168
1157
|
});
|
|
1169
1158
|
})(new Response());
|
|
1170
|
-
const
|
|
1171
|
-
if (
|
|
1159
|
+
const ws = async (s) => {
|
|
1160
|
+
if (s == null)
|
|
1172
1161
|
return 0;
|
|
1173
|
-
if (l.isBlob(
|
|
1174
|
-
return
|
|
1175
|
-
if (l.isSpecCompliantForm(
|
|
1176
|
-
return (await new Request(
|
|
1162
|
+
if (l.isBlob(s))
|
|
1163
|
+
return s.size;
|
|
1164
|
+
if (l.isSpecCompliantForm(s))
|
|
1165
|
+
return (await new Request(O.origin, {
|
|
1177
1166
|
method: "POST",
|
|
1178
|
-
body:
|
|
1167
|
+
body: s
|
|
1179
1168
|
}).arrayBuffer()).byteLength;
|
|
1180
|
-
if (l.isArrayBufferView(
|
|
1181
|
-
return
|
|
1182
|
-
if (l.isURLSearchParams(
|
|
1183
|
-
return (await
|
|
1184
|
-
},
|
|
1185
|
-
const t = l.toFiniteNumber(
|
|
1186
|
-
return t ??
|
|
1187
|
-
},
|
|
1169
|
+
if (l.isArrayBufferView(s) || l.isArrayBuffer(s))
|
|
1170
|
+
return s.byteLength;
|
|
1171
|
+
if (l.isURLSearchParams(s) && (s = s + ""), l.isString(s))
|
|
1172
|
+
return (await gs(s)).byteLength;
|
|
1173
|
+
}, ys = async (s, e) => {
|
|
1174
|
+
const t = l.toFiniteNumber(s.getContentLength());
|
|
1175
|
+
return t ?? ws(e);
|
|
1176
|
+
}, _s = ge && (async (s) => {
|
|
1188
1177
|
let {
|
|
1189
1178
|
url: e,
|
|
1190
1179
|
method: t,
|
|
1191
|
-
data:
|
|
1180
|
+
data: n,
|
|
1192
1181
|
signal: r,
|
|
1193
1182
|
cancelToken: i,
|
|
1194
1183
|
timeout: o,
|
|
@@ -1198,26 +1187,26 @@ const Ss = async (n) => {
|
|
|
1198
1187
|
headers: a,
|
|
1199
1188
|
withCredentials: d = "same-origin",
|
|
1200
1189
|
fetchOptions: g
|
|
1201
|
-
} =
|
|
1190
|
+
} = Pt(s);
|
|
1202
1191
|
u = u ? (u + "").toLowerCase() : "text";
|
|
1203
|
-
let b =
|
|
1192
|
+
let b = ds([r, i && i.toAbortSignal()], o), f;
|
|
1204
1193
|
const m = b && b.unsubscribe && (() => {
|
|
1205
1194
|
b.unsubscribe();
|
|
1206
1195
|
});
|
|
1207
1196
|
let p;
|
|
1208
1197
|
try {
|
|
1209
|
-
if (h &&
|
|
1198
|
+
if (h && bs && t !== "get" && t !== "head" && (p = await ys(a, n)) !== 0) {
|
|
1210
1199
|
let x = new Request(e, {
|
|
1211
1200
|
method: "POST",
|
|
1212
|
-
body:
|
|
1201
|
+
body: n,
|
|
1213
1202
|
duplex: "half"
|
|
1214
1203
|
}), P;
|
|
1215
|
-
if (l.isFormData(
|
|
1216
|
-
const [I, D] =
|
|
1204
|
+
if (l.isFormData(n) && (P = x.headers.get("content-type")) && a.setContentType(P), x.body) {
|
|
1205
|
+
const [I, D] = Ge(
|
|
1217
1206
|
p,
|
|
1218
|
-
ue(
|
|
1207
|
+
ue(Ze(h))
|
|
1219
1208
|
);
|
|
1220
|
-
|
|
1209
|
+
n = Ye(x.body, et, I, D);
|
|
1221
1210
|
}
|
|
1222
1211
|
}
|
|
1223
1212
|
l.isString(d) || (d = d ? "include" : "omit");
|
|
@@ -1227,133 +1216,133 @@ const Ss = async (n) => {
|
|
|
1227
1216
|
signal: b,
|
|
1228
1217
|
method: t.toUpperCase(),
|
|
1229
1218
|
headers: a.normalize().toJSON(),
|
|
1230
|
-
body:
|
|
1219
|
+
body: n,
|
|
1231
1220
|
duplex: "half",
|
|
1232
1221
|
credentials: _ ? d : void 0
|
|
1233
1222
|
});
|
|
1234
1223
|
let E = await fetch(f);
|
|
1235
|
-
const S =
|
|
1236
|
-
if (
|
|
1224
|
+
const S = ke && (u === "stream" || u === "response");
|
|
1225
|
+
if (ke && (c || S && m)) {
|
|
1237
1226
|
const x = {};
|
|
1238
1227
|
["status", "statusText", "headers"].forEach((U) => {
|
|
1239
1228
|
x[U] = E[U];
|
|
1240
1229
|
});
|
|
1241
|
-
const P = l.toFiniteNumber(E.headers.get("content-length")), [I, D] = c &&
|
|
1230
|
+
const P = l.toFiniteNumber(E.headers.get("content-length")), [I, D] = c && Ge(
|
|
1242
1231
|
P,
|
|
1243
|
-
ue(
|
|
1232
|
+
ue(Ze(c), !0)
|
|
1244
1233
|
) || [];
|
|
1245
1234
|
E = new Response(
|
|
1246
|
-
|
|
1235
|
+
Ye(E.body, et, I, () => {
|
|
1247
1236
|
D && D(), m && m();
|
|
1248
1237
|
}),
|
|
1249
1238
|
x
|
|
1250
1239
|
);
|
|
1251
1240
|
}
|
|
1252
1241
|
u = u || "text";
|
|
1253
|
-
let k = await he[l.findKey(he, u) || "text"](E,
|
|
1242
|
+
let k = await he[l.findKey(he, u) || "text"](E, s);
|
|
1254
1243
|
return !S && m && m(), await new Promise((x, P) => {
|
|
1255
|
-
|
|
1244
|
+
kt(x, P, {
|
|
1256
1245
|
data: k,
|
|
1257
|
-
headers:
|
|
1246
|
+
headers: T.from(E.headers),
|
|
1258
1247
|
status: E.status,
|
|
1259
1248
|
statusText: E.statusText,
|
|
1260
|
-
config:
|
|
1249
|
+
config: s,
|
|
1261
1250
|
request: f
|
|
1262
1251
|
});
|
|
1263
1252
|
});
|
|
1264
1253
|
} catch (_) {
|
|
1265
1254
|
throw m && m(), _ && _.name === "TypeError" && /fetch/i.test(_.message) ? Object.assign(
|
|
1266
|
-
new
|
|
1255
|
+
new w("Network Error", w.ERR_NETWORK, s, f),
|
|
1267
1256
|
{
|
|
1268
1257
|
cause: _.cause || _
|
|
1269
1258
|
}
|
|
1270
|
-
) :
|
|
1259
|
+
) : w.from(_, _ && _.code, s, f);
|
|
1271
1260
|
}
|
|
1272
|
-
}),
|
|
1273
|
-
http:
|
|
1274
|
-
xhr:
|
|
1275
|
-
fetch:
|
|
1261
|
+
}), Ne = {
|
|
1262
|
+
http: $n,
|
|
1263
|
+
xhr: hs,
|
|
1264
|
+
fetch: _s
|
|
1276
1265
|
};
|
|
1277
|
-
l.forEach(
|
|
1278
|
-
if (
|
|
1266
|
+
l.forEach(Ne, (s, e) => {
|
|
1267
|
+
if (s) {
|
|
1279
1268
|
try {
|
|
1280
|
-
Object.defineProperty(
|
|
1269
|
+
Object.defineProperty(s, "name", { value: e });
|
|
1281
1270
|
} catch {
|
|
1282
1271
|
}
|
|
1283
|
-
Object.defineProperty(
|
|
1272
|
+
Object.defineProperty(s, "adapterName", { value: e });
|
|
1284
1273
|
}
|
|
1285
1274
|
});
|
|
1286
|
-
const
|
|
1287
|
-
getAdapter: (
|
|
1288
|
-
|
|
1289
|
-
const { length: e } =
|
|
1290
|
-
let t,
|
|
1275
|
+
const tt = (s) => `- ${s}`, Es = (s) => l.isFunction(s) || s === null || s === !1, vt = {
|
|
1276
|
+
getAdapter: (s) => {
|
|
1277
|
+
s = l.isArray(s) ? s : [s];
|
|
1278
|
+
const { length: e } = s;
|
|
1279
|
+
let t, n;
|
|
1291
1280
|
const r = {};
|
|
1292
1281
|
for (let i = 0; i < e; i++) {
|
|
1293
|
-
t =
|
|
1282
|
+
t = s[i];
|
|
1294
1283
|
let o;
|
|
1295
|
-
if (
|
|
1296
|
-
throw new
|
|
1297
|
-
if (
|
|
1284
|
+
if (n = t, !Es(t) && (n = Ne[(o = String(t)).toLowerCase()], n === void 0))
|
|
1285
|
+
throw new w(`Unknown adapter '${o}'`);
|
|
1286
|
+
if (n)
|
|
1298
1287
|
break;
|
|
1299
|
-
r[o || "#" + i] =
|
|
1288
|
+
r[o || "#" + i] = n;
|
|
1300
1289
|
}
|
|
1301
|
-
if (!
|
|
1290
|
+
if (!n) {
|
|
1302
1291
|
const i = Object.entries(r).map(
|
|
1303
1292
|
([c, h]) => `adapter ${c} ` + (h === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1304
1293
|
);
|
|
1305
1294
|
let o = e ? i.length > 1 ? `since :
|
|
1306
|
-
` + i.map(
|
|
1307
|
-
`) : " " +
|
|
1308
|
-
throw new
|
|
1295
|
+
` + i.map(tt).join(`
|
|
1296
|
+
`) : " " + tt(i[0]) : "as no adapter specified";
|
|
1297
|
+
throw new w(
|
|
1309
1298
|
"There is no suitable adapter to dispatch the request " + o,
|
|
1310
1299
|
"ERR_NOT_SUPPORT"
|
|
1311
1300
|
);
|
|
1312
1301
|
}
|
|
1313
|
-
return
|
|
1302
|
+
return n;
|
|
1314
1303
|
},
|
|
1315
|
-
adapters:
|
|
1304
|
+
adapters: Ne
|
|
1316
1305
|
};
|
|
1317
|
-
function
|
|
1318
|
-
if (
|
|
1319
|
-
throw new
|
|
1306
|
+
function Re(s) {
|
|
1307
|
+
if (s.cancelToken && s.cancelToken.throwIfRequested(), s.signal && s.signal.aborted)
|
|
1308
|
+
throw new X(null, s);
|
|
1320
1309
|
}
|
|
1321
|
-
function
|
|
1322
|
-
return
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
), ["post", "put", "patch"].indexOf(
|
|
1326
|
-
return
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
),
|
|
1331
|
-
}, function(
|
|
1332
|
-
return
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
),
|
|
1310
|
+
function nt(s) {
|
|
1311
|
+
return Re(s), s.headers = T.from(s.headers), s.data = xe.call(
|
|
1312
|
+
s,
|
|
1313
|
+
s.transformRequest
|
|
1314
|
+
), ["post", "put", "patch"].indexOf(s.method) !== -1 && s.headers.setContentType("application/x-www-form-urlencoded", !1), vt.getAdapter(s.adapter || te.adapter)(s).then(function(n) {
|
|
1315
|
+
return Re(s), n.data = xe.call(
|
|
1316
|
+
s,
|
|
1317
|
+
s.transformResponse,
|
|
1318
|
+
n
|
|
1319
|
+
), n.headers = T.from(n.headers), n;
|
|
1320
|
+
}, function(n) {
|
|
1321
|
+
return Tt(n) || (Re(s), n && n.response && (n.response.data = xe.call(
|
|
1322
|
+
s,
|
|
1323
|
+
s.transformResponse,
|
|
1324
|
+
n.response
|
|
1325
|
+
), n.response.headers = T.from(n.response.headers))), Promise.reject(n);
|
|
1337
1326
|
});
|
|
1338
1327
|
}
|
|
1339
|
-
const
|
|
1340
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((
|
|
1341
|
-
be[
|
|
1342
|
-
return typeof
|
|
1328
|
+
const $t = "1.8.4", be = {};
|
|
1329
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((s, e) => {
|
|
1330
|
+
be[s] = function(n) {
|
|
1331
|
+
return typeof n === s || "a" + (e < 1 ? "n " : " ") + s;
|
|
1343
1332
|
};
|
|
1344
1333
|
});
|
|
1345
|
-
const
|
|
1346
|
-
be.transitional = function(e, t,
|
|
1334
|
+
const st = {};
|
|
1335
|
+
be.transitional = function(e, t, n) {
|
|
1347
1336
|
function r(i, o) {
|
|
1348
|
-
return "[Axios v" +
|
|
1337
|
+
return "[Axios v" + $t + "] Transitional option '" + i + "'" + o + (n ? ". " + n : "");
|
|
1349
1338
|
}
|
|
1350
1339
|
return (i, o, c) => {
|
|
1351
1340
|
if (e === !1)
|
|
1352
|
-
throw new
|
|
1341
|
+
throw new w(
|
|
1353
1342
|
r(o, " has been removed" + (t ? " in " + t : "")),
|
|
1354
|
-
|
|
1343
|
+
w.ERR_DEPRECATED
|
|
1355
1344
|
);
|
|
1356
|
-
return t && !
|
|
1345
|
+
return t && !st[o] && (st[o] = !0, console.warn(
|
|
1357
1346
|
r(
|
|
1358
1347
|
o,
|
|
1359
1348
|
" has been deprecated since v" + t + " and will be removed in the near future"
|
|
@@ -1362,34 +1351,34 @@ be.transitional = function(e, t, s) {
|
|
|
1362
1351
|
};
|
|
1363
1352
|
};
|
|
1364
1353
|
be.spelling = function(e) {
|
|
1365
|
-
return (t,
|
|
1354
|
+
return (t, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
|
|
1366
1355
|
};
|
|
1367
|
-
function
|
|
1368
|
-
if (typeof
|
|
1369
|
-
throw new
|
|
1370
|
-
const
|
|
1371
|
-
let r =
|
|
1356
|
+
function Ss(s, e, t) {
|
|
1357
|
+
if (typeof s != "object")
|
|
1358
|
+
throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
|
|
1359
|
+
const n = Object.keys(s);
|
|
1360
|
+
let r = n.length;
|
|
1372
1361
|
for (; r-- > 0; ) {
|
|
1373
|
-
const i =
|
|
1362
|
+
const i = n[r], o = e[i];
|
|
1374
1363
|
if (o) {
|
|
1375
|
-
const c =
|
|
1364
|
+
const c = s[i], h = c === void 0 || o(c, i, s);
|
|
1376
1365
|
if (h !== !0)
|
|
1377
|
-
throw new
|
|
1366
|
+
throw new w("option " + i + " must be " + h, w.ERR_BAD_OPTION_VALUE);
|
|
1378
1367
|
continue;
|
|
1379
1368
|
}
|
|
1380
1369
|
if (t !== !0)
|
|
1381
|
-
throw new
|
|
1370
|
+
throw new w("Unknown option " + i, w.ERR_BAD_OPTION);
|
|
1382
1371
|
}
|
|
1383
1372
|
}
|
|
1384
1373
|
const le = {
|
|
1385
|
-
assertOptions:
|
|
1374
|
+
assertOptions: Ss,
|
|
1386
1375
|
validators: be
|
|
1387
1376
|
}, F = le.validators;
|
|
1388
1377
|
let z = class {
|
|
1389
1378
|
constructor(e) {
|
|
1390
1379
|
this.defaults = e, this.interceptors = {
|
|
1391
|
-
request: new
|
|
1392
|
-
response: new
|
|
1380
|
+
request: new Ke(),
|
|
1381
|
+
response: new Ke()
|
|
1393
1382
|
};
|
|
1394
1383
|
}
|
|
1395
1384
|
/**
|
|
@@ -1403,24 +1392,24 @@ let z = class {
|
|
|
1403
1392
|
async request(e, t) {
|
|
1404
1393
|
try {
|
|
1405
1394
|
return await this._request(e, t);
|
|
1406
|
-
} catch (
|
|
1407
|
-
if (
|
|
1395
|
+
} catch (n) {
|
|
1396
|
+
if (n instanceof Error) {
|
|
1408
1397
|
let r = {};
|
|
1409
1398
|
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
1410
1399
|
const i = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
1411
1400
|
try {
|
|
1412
|
-
|
|
1413
|
-
` + i) :
|
|
1401
|
+
n.stack ? i && !String(n.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (n.stack += `
|
|
1402
|
+
` + i) : n.stack = i;
|
|
1414
1403
|
} catch {
|
|
1415
1404
|
}
|
|
1416
1405
|
}
|
|
1417
|
-
throw
|
|
1406
|
+
throw n;
|
|
1418
1407
|
}
|
|
1419
1408
|
}
|
|
1420
1409
|
_request(e, t) {
|
|
1421
1410
|
typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = V(this.defaults, t);
|
|
1422
|
-
const { transitional:
|
|
1423
|
-
|
|
1411
|
+
const { transitional: n, paramsSerializer: r, headers: i } = t;
|
|
1412
|
+
n !== void 0 && le.assertOptions(n, {
|
|
1424
1413
|
silentJSONParsing: F.transitional(F.boolean),
|
|
1425
1414
|
forcedJSONParsing: F.transitional(F.boolean),
|
|
1426
1415
|
clarifyTimeoutError: F.transitional(F.boolean)
|
|
@@ -1429,7 +1418,7 @@ let z = class {
|
|
|
1429
1418
|
} : le.assertOptions(r, {
|
|
1430
1419
|
encode: F.function,
|
|
1431
1420
|
serialize: F.function
|
|
1432
|
-
}, !0)), le.assertOptions(t, {
|
|
1421
|
+
}, !0)), t.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? t.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : t.allowAbsoluteUrls = !0), le.assertOptions(t, {
|
|
1433
1422
|
baseUrl: F.spelling("baseURL"),
|
|
1434
1423
|
withXsrfToken: F.spelling("withXSRFToken")
|
|
1435
1424
|
}, !0), t.method = (t.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1442,7 +1431,7 @@ let z = class {
|
|
|
1442
1431
|
(f) => {
|
|
1443
1432
|
delete i[f];
|
|
1444
1433
|
}
|
|
1445
|
-
), t.headers =
|
|
1434
|
+
), t.headers = T.concat(o, i);
|
|
1446
1435
|
const c = [];
|
|
1447
1436
|
let h = !0;
|
|
1448
1437
|
this.interceptors.request.forEach(function(m) {
|
|
@@ -1454,7 +1443,7 @@ let z = class {
|
|
|
1454
1443
|
});
|
|
1455
1444
|
let a, d = 0, g;
|
|
1456
1445
|
if (!h) {
|
|
1457
|
-
const f = [
|
|
1446
|
+
const f = [nt.bind(this), void 0];
|
|
1458
1447
|
for (f.unshift.apply(f, c), f.push.apply(f, u), g = f.length, a = Promise.resolve(t); d < g; )
|
|
1459
1448
|
a = a.then(f[d++], f[d++]);
|
|
1460
1449
|
return a;
|
|
@@ -1471,7 +1460,7 @@ let z = class {
|
|
|
1471
1460
|
}
|
|
1472
1461
|
}
|
|
1473
1462
|
try {
|
|
1474
|
-
a =
|
|
1463
|
+
a = nt.call(this, b);
|
|
1475
1464
|
} catch (f) {
|
|
1476
1465
|
return Promise.reject(f);
|
|
1477
1466
|
}
|
|
@@ -1481,25 +1470,25 @@ let z = class {
|
|
|
1481
1470
|
}
|
|
1482
1471
|
getUri(e) {
|
|
1483
1472
|
e = V(this.defaults, e);
|
|
1484
|
-
const t =
|
|
1485
|
-
return
|
|
1473
|
+
const t = Nt(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1474
|
+
return At(t, e.params, e.paramsSerializer);
|
|
1486
1475
|
}
|
|
1487
1476
|
};
|
|
1488
1477
|
l.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1489
|
-
z.prototype[e] = function(t,
|
|
1490
|
-
return this.request(V(
|
|
1478
|
+
z.prototype[e] = function(t, n) {
|
|
1479
|
+
return this.request(V(n || {}, {
|
|
1491
1480
|
method: e,
|
|
1492
1481
|
url: t,
|
|
1493
|
-
data: (
|
|
1482
|
+
data: (n || {}).data
|
|
1494
1483
|
}));
|
|
1495
1484
|
};
|
|
1496
1485
|
});
|
|
1497
1486
|
l.forEach(["post", "put", "patch"], function(e) {
|
|
1498
|
-
function t(
|
|
1487
|
+
function t(n) {
|
|
1499
1488
|
return function(i, o, c) {
|
|
1500
1489
|
return this.request(V(c || {}, {
|
|
1501
1490
|
method: e,
|
|
1502
|
-
headers:
|
|
1491
|
+
headers: n ? {
|
|
1503
1492
|
"Content-Type": "multipart/form-data"
|
|
1504
1493
|
} : {},
|
|
1505
1494
|
url: i,
|
|
@@ -1509,7 +1498,7 @@ l.forEach(["post", "put", "patch"], function(e) {
|
|
|
1509
1498
|
}
|
|
1510
1499
|
z.prototype[e] = t(), z.prototype[e + "Form"] = t(!0);
|
|
1511
1500
|
});
|
|
1512
|
-
let
|
|
1501
|
+
let xs = class jt {
|
|
1513
1502
|
constructor(e) {
|
|
1514
1503
|
if (typeof e != "function")
|
|
1515
1504
|
throw new TypeError("executor must be a function.");
|
|
@@ -1517,23 +1506,23 @@ let Os = class Dt {
|
|
|
1517
1506
|
this.promise = new Promise(function(i) {
|
|
1518
1507
|
t = i;
|
|
1519
1508
|
});
|
|
1520
|
-
const
|
|
1509
|
+
const n = this;
|
|
1521
1510
|
this.promise.then((r) => {
|
|
1522
|
-
if (!
|
|
1523
|
-
let i =
|
|
1511
|
+
if (!n._listeners) return;
|
|
1512
|
+
let i = n._listeners.length;
|
|
1524
1513
|
for (; i-- > 0; )
|
|
1525
|
-
|
|
1526
|
-
|
|
1514
|
+
n._listeners[i](r);
|
|
1515
|
+
n._listeners = null;
|
|
1527
1516
|
}), this.promise.then = (r) => {
|
|
1528
1517
|
let i;
|
|
1529
1518
|
const o = new Promise((c) => {
|
|
1530
|
-
|
|
1519
|
+
n.subscribe(c), i = c;
|
|
1531
1520
|
}).then(r);
|
|
1532
1521
|
return o.cancel = function() {
|
|
1533
|
-
|
|
1522
|
+
n.unsubscribe(i);
|
|
1534
1523
|
}, o;
|
|
1535
1524
|
}, e(function(i, o, c) {
|
|
1536
|
-
|
|
1525
|
+
n.reason || (n.reason = new X(i, o, c), t(n.reason));
|
|
1537
1526
|
});
|
|
1538
1527
|
}
|
|
1539
1528
|
/**
|
|
@@ -1563,8 +1552,8 @@ let Os = class Dt {
|
|
|
1563
1552
|
t !== -1 && this._listeners.splice(t, 1);
|
|
1564
1553
|
}
|
|
1565
1554
|
toAbortSignal() {
|
|
1566
|
-
const e = new AbortController(), t = (
|
|
1567
|
-
e.abort(
|
|
1555
|
+
const e = new AbortController(), t = (n) => {
|
|
1556
|
+
e.abort(n);
|
|
1568
1557
|
};
|
|
1569
1558
|
return this.subscribe(t), e.signal.unsubscribe = () => this.unsubscribe(t), e.signal;
|
|
1570
1559
|
}
|
|
@@ -1575,22 +1564,22 @@ let Os = class Dt {
|
|
|
1575
1564
|
static source() {
|
|
1576
1565
|
let e;
|
|
1577
1566
|
return {
|
|
1578
|
-
token: new
|
|
1567
|
+
token: new jt(function(r) {
|
|
1579
1568
|
e = r;
|
|
1580
1569
|
}),
|
|
1581
1570
|
cancel: e
|
|
1582
1571
|
};
|
|
1583
1572
|
}
|
|
1584
1573
|
};
|
|
1585
|
-
function
|
|
1574
|
+
function Rs(s) {
|
|
1586
1575
|
return function(t) {
|
|
1587
|
-
return
|
|
1576
|
+
return s.apply(null, t);
|
|
1588
1577
|
};
|
|
1589
1578
|
}
|
|
1590
|
-
function
|
|
1591
|
-
return l.isObject(
|
|
1579
|
+
function As(s) {
|
|
1580
|
+
return l.isObject(s) && s.isAxiosError === !0;
|
|
1592
1581
|
}
|
|
1593
|
-
const
|
|
1582
|
+
const Pe = {
|
|
1594
1583
|
Continue: 100,
|
|
1595
1584
|
SwitchingProtocols: 101,
|
|
1596
1585
|
Processing: 102,
|
|
@@ -1655,84 +1644,84 @@ const Ie = {
|
|
|
1655
1644
|
NotExtended: 510,
|
|
1656
1645
|
NetworkAuthenticationRequired: 511
|
|
1657
1646
|
};
|
|
1658
|
-
Object.entries(
|
|
1659
|
-
|
|
1647
|
+
Object.entries(Pe).forEach(([s, e]) => {
|
|
1648
|
+
Pe[e] = s;
|
|
1660
1649
|
});
|
|
1661
|
-
function
|
|
1662
|
-
const e = new z(
|
|
1650
|
+
function Ft(s) {
|
|
1651
|
+
const e = new z(s), t = pt(z.prototype.request, e);
|
|
1663
1652
|
return l.extend(t, z.prototype, e, { allOwnKeys: !0 }), l.extend(t, e, null, { allOwnKeys: !0 }), t.create = function(r) {
|
|
1664
|
-
return
|
|
1653
|
+
return Ft(V(s, r));
|
|
1665
1654
|
}, t;
|
|
1666
1655
|
}
|
|
1667
|
-
const R =
|
|
1656
|
+
const R = Ft(te);
|
|
1668
1657
|
R.Axios = z;
|
|
1669
|
-
R.CanceledError =
|
|
1670
|
-
R.CancelToken =
|
|
1671
|
-
R.isCancel =
|
|
1672
|
-
R.VERSION =
|
|
1658
|
+
R.CanceledError = X;
|
|
1659
|
+
R.CancelToken = xs;
|
|
1660
|
+
R.isCancel = Tt;
|
|
1661
|
+
R.VERSION = $t;
|
|
1673
1662
|
R.toFormData = me;
|
|
1674
|
-
R.AxiosError =
|
|
1663
|
+
R.AxiosError = w;
|
|
1675
1664
|
R.Cancel = R.CanceledError;
|
|
1676
1665
|
R.all = function(e) {
|
|
1677
1666
|
return Promise.all(e);
|
|
1678
1667
|
};
|
|
1679
|
-
R.spread =
|
|
1680
|
-
R.isAxiosError =
|
|
1668
|
+
R.spread = Rs;
|
|
1669
|
+
R.isAxiosError = As;
|
|
1681
1670
|
R.mergeConfig = V;
|
|
1682
|
-
R.AxiosHeaders =
|
|
1683
|
-
R.formToJSON = (
|
|
1684
|
-
R.getAdapter =
|
|
1685
|
-
R.HttpStatusCode =
|
|
1671
|
+
R.AxiosHeaders = T;
|
|
1672
|
+
R.formToJSON = (s) => Ct(l.isHTMLForm(s) ? new FormData(s) : s);
|
|
1673
|
+
R.getAdapter = vt.getAdapter;
|
|
1674
|
+
R.HttpStatusCode = Pe;
|
|
1686
1675
|
R.default = R;
|
|
1687
1676
|
const {
|
|
1688
|
-
Axios:
|
|
1689
|
-
AxiosError:
|
|
1690
|
-
CanceledError:
|
|
1691
|
-
isCancel:
|
|
1692
|
-
CancelToken:
|
|
1693
|
-
VERSION:
|
|
1694
|
-
all:
|
|
1695
|
-
Cancel:
|
|
1696
|
-
isAxiosError:
|
|
1697
|
-
spread:
|
|
1698
|
-
toFormData:
|
|
1699
|
-
AxiosHeaders:
|
|
1700
|
-
HttpStatusCode:
|
|
1701
|
-
formToJSON:
|
|
1702
|
-
getAdapter:
|
|
1703
|
-
mergeConfig:
|
|
1704
|
-
} = R,
|
|
1677
|
+
Axios: zr,
|
|
1678
|
+
AxiosError: Vr,
|
|
1679
|
+
CanceledError: Jr,
|
|
1680
|
+
isCancel: Wr,
|
|
1681
|
+
CancelToken: Kr,
|
|
1682
|
+
VERSION: Xr,
|
|
1683
|
+
all: Gr,
|
|
1684
|
+
Cancel: Zr,
|
|
1685
|
+
isAxiosError: Qr,
|
|
1686
|
+
spread: Yr,
|
|
1687
|
+
toFormData: ei,
|
|
1688
|
+
AxiosHeaders: ti,
|
|
1689
|
+
HttpStatusCode: ni,
|
|
1690
|
+
formToJSON: si,
|
|
1691
|
+
getAdapter: ri,
|
|
1692
|
+
mergeConfig: ii
|
|
1693
|
+
} = R, Ue = R.create({
|
|
1705
1694
|
baseURL: location.origin,
|
|
1706
1695
|
timeout: 6e4,
|
|
1707
1696
|
params: {}
|
|
1708
1697
|
});
|
|
1709
|
-
|
|
1710
|
-
(
|
|
1711
|
-
(
|
|
1712
|
-
var e, t,
|
|
1713
|
-
if (
|
|
1714
|
-
if (
|
|
1698
|
+
Ue.interceptors.response.use(
|
|
1699
|
+
(s) => s,
|
|
1700
|
+
(s) => {
|
|
1701
|
+
var e, t, n, r, i, o, c, h, u, a, d;
|
|
1702
|
+
if (s.response) {
|
|
1703
|
+
if (s.response.status === 401 && OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity, !0).then(
|
|
1715
1704
|
function(f) {
|
|
1716
1705
|
f && OpenC3Auth.setTokens();
|
|
1717
1706
|
}
|
|
1718
|
-
),
|
|
1719
|
-
|
|
1707
|
+
), s.response.config.headers["Ignore-Errors"] && s.response.config.headers["Ignore-Errors"].includes(
|
|
1708
|
+
s.response.status.toString()
|
|
1720
1709
|
))
|
|
1721
|
-
return Promise.reject(
|
|
1722
|
-
let g = `HTTP ${
|
|
1723
|
-
(e =
|
|
1710
|
+
return Promise.reject(s);
|
|
1711
|
+
let g = `HTTP ${s.response.status} - `;
|
|
1712
|
+
(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 += `${(d = s.response) == null ? void 0 : d.data}`;
|
|
1724
1713
|
const { $cosmosNotify: b } = window;
|
|
1725
1714
|
throw b && b.serious({
|
|
1726
1715
|
title: "Network error",
|
|
1727
1716
|
body: g
|
|
1728
|
-
}),
|
|
1717
|
+
}), s;
|
|
1729
1718
|
} else
|
|
1730
|
-
throw
|
|
1719
|
+
throw s;
|
|
1731
1720
|
}
|
|
1732
1721
|
);
|
|
1733
|
-
const re = async function(
|
|
1722
|
+
const re = async function(s, e, {
|
|
1734
1723
|
data: t,
|
|
1735
|
-
params:
|
|
1724
|
+
params: n = {},
|
|
1736
1725
|
headers: r,
|
|
1737
1726
|
noAuth: i = !1,
|
|
1738
1727
|
noScope: o = !1,
|
|
@@ -1748,96 +1737,96 @@ const re = async function(n, e, {
|
|
|
1748
1737
|
}
|
|
1749
1738
|
r.Authorization = localStorage.openc3Token;
|
|
1750
1739
|
}
|
|
1751
|
-
return r.manual = !0, !o && !
|
|
1752
|
-
method:
|
|
1740
|
+
return r.manual = !0, !o && !n.scope && (n.scope = window.openc3Scope), Ue({
|
|
1741
|
+
method: s,
|
|
1753
1742
|
url: e,
|
|
1754
1743
|
data: t,
|
|
1755
|
-
params:
|
|
1744
|
+
params: n,
|
|
1756
1745
|
headers: r,
|
|
1757
1746
|
onUploadProgress: c
|
|
1758
1747
|
});
|
|
1759
|
-
},
|
|
1748
|
+
}, Ie = {
|
|
1760
1749
|
Accept: "application/json"
|
|
1761
|
-
},
|
|
1762
|
-
...
|
|
1750
|
+
}, rt = {
|
|
1751
|
+
...Ie,
|
|
1763
1752
|
"Content-Type": "application/json"
|
|
1764
|
-
},
|
|
1765
|
-
get: function(
|
|
1753
|
+
}, oi = {
|
|
1754
|
+
get: function(s, {
|
|
1766
1755
|
params: e,
|
|
1767
|
-
headers: t =
|
|
1768
|
-
noScope:
|
|
1756
|
+
headers: t = Ie,
|
|
1757
|
+
noScope: n,
|
|
1769
1758
|
noAuth: r,
|
|
1770
1759
|
onUploadProgress: i
|
|
1771
1760
|
} = {}) {
|
|
1772
|
-
return re("get",
|
|
1761
|
+
return re("get", s, {
|
|
1773
1762
|
params: e,
|
|
1774
1763
|
headers: t,
|
|
1775
|
-
noScope:
|
|
1764
|
+
noScope: n,
|
|
1776
1765
|
noAuth: r,
|
|
1777
1766
|
onUploadProgress: i
|
|
1778
1767
|
});
|
|
1779
1768
|
},
|
|
1780
|
-
put: function(
|
|
1769
|
+
put: function(s, {
|
|
1781
1770
|
data: e,
|
|
1782
1771
|
params: t,
|
|
1783
|
-
headers:
|
|
1772
|
+
headers: n = rt,
|
|
1784
1773
|
noScope: r,
|
|
1785
1774
|
noAuth: i,
|
|
1786
1775
|
onUploadProgress: o
|
|
1787
1776
|
} = {}) {
|
|
1788
|
-
return re("put",
|
|
1777
|
+
return re("put", s, {
|
|
1789
1778
|
data: e,
|
|
1790
1779
|
params: t,
|
|
1791
|
-
headers:
|
|
1780
|
+
headers: n,
|
|
1792
1781
|
noScope: r,
|
|
1793
1782
|
noAuth: i,
|
|
1794
1783
|
onUploadProgress: o
|
|
1795
1784
|
});
|
|
1796
1785
|
},
|
|
1797
|
-
post: function(
|
|
1786
|
+
post: function(s, {
|
|
1798
1787
|
data: e,
|
|
1799
1788
|
params: t,
|
|
1800
|
-
headers:
|
|
1789
|
+
headers: n = rt,
|
|
1801
1790
|
noScope: r,
|
|
1802
1791
|
noAuth: i,
|
|
1803
1792
|
onUploadProgress: o
|
|
1804
1793
|
} = {}) {
|
|
1805
|
-
return re("post",
|
|
1794
|
+
return re("post", s, {
|
|
1806
1795
|
data: e,
|
|
1807
1796
|
params: t,
|
|
1808
|
-
headers:
|
|
1797
|
+
headers: n,
|
|
1809
1798
|
noScope: r,
|
|
1810
1799
|
noAuth: i,
|
|
1811
1800
|
onUploadProgress: o
|
|
1812
1801
|
});
|
|
1813
1802
|
},
|
|
1814
|
-
delete: function(
|
|
1803
|
+
delete: function(s, {
|
|
1815
1804
|
params: e,
|
|
1816
|
-
headers: t =
|
|
1817
|
-
noScope:
|
|
1805
|
+
headers: t = Ie,
|
|
1806
|
+
noScope: n,
|
|
1818
1807
|
noAuth: r,
|
|
1819
1808
|
onUploadProgress: i
|
|
1820
1809
|
} = {}) {
|
|
1821
|
-
return re("delete",
|
|
1810
|
+
return re("delete", s, {
|
|
1822
1811
|
params: e,
|
|
1823
1812
|
headers: t,
|
|
1824
|
-
noScope:
|
|
1813
|
+
noScope: n,
|
|
1825
1814
|
noAuth: r,
|
|
1826
1815
|
onUploadProgress: i
|
|
1827
1816
|
});
|
|
1828
1817
|
}
|
|
1829
1818
|
};
|
|
1830
|
-
let
|
|
1831
|
-
emit(
|
|
1832
|
-
for (let t = this.events[
|
|
1833
|
-
t[
|
|
1819
|
+
let we = () => ({
|
|
1820
|
+
emit(s, ...e) {
|
|
1821
|
+
for (let t = this.events[s] || [], n = 0, r = t.length; n < r; n++)
|
|
1822
|
+
t[n](...e);
|
|
1834
1823
|
},
|
|
1835
1824
|
events: {},
|
|
1836
|
-
on(
|
|
1825
|
+
on(s, e) {
|
|
1837
1826
|
var t;
|
|
1838
|
-
return ((t = this.events)[
|
|
1839
|
-
var
|
|
1840
|
-
this.events[
|
|
1827
|
+
return ((t = this.events)[s] || (t[s] = [])).push(e), () => {
|
|
1828
|
+
var n;
|
|
1829
|
+
this.events[s] = (n = this.events[s]) == null ? void 0 : n.filter((r) => e !== r);
|
|
1841
1830
|
};
|
|
1842
1831
|
}
|
|
1843
1832
|
});
|
|
@@ -1846,33 +1835,33 @@ class ne extends Error {
|
|
|
1846
1835
|
e instanceof Error ? (super(e.message), this.cause = e) : super(e), this.reason = t, this.name = "ReasonError";
|
|
1847
1836
|
}
|
|
1848
1837
|
}
|
|
1849
|
-
class
|
|
1838
|
+
class De extends ne {
|
|
1850
1839
|
constructor(e) {
|
|
1851
1840
|
super("Rejected", e), this.name = "SubscriptionRejectedError";
|
|
1852
1841
|
}
|
|
1853
1842
|
}
|
|
1854
|
-
class
|
|
1843
|
+
class Os extends ne {
|
|
1855
1844
|
constructor(e) {
|
|
1856
1845
|
super(e || "Timed out to receive subscription ack"), this.name = "SubscriptionTimeoutError";
|
|
1857
1846
|
}
|
|
1858
1847
|
}
|
|
1859
|
-
class
|
|
1848
|
+
class $ extends ne {
|
|
1860
1849
|
constructor(e, t) {
|
|
1861
1850
|
t ? super(e, t) : super("Disconnected", e), this.name = "DisconnectedError";
|
|
1862
1851
|
}
|
|
1863
1852
|
}
|
|
1864
|
-
class
|
|
1853
|
+
class Cs extends $ {
|
|
1865
1854
|
constructor(e) {
|
|
1866
1855
|
super(e, "stale_connection"), this.name = "StaleConnectionError";
|
|
1867
1856
|
}
|
|
1868
1857
|
}
|
|
1869
|
-
function
|
|
1870
|
-
return
|
|
1871
|
-
let
|
|
1872
|
-
return `${JSON.stringify(t)}:${
|
|
1858
|
+
function Ut(s) {
|
|
1859
|
+
return s ? `{${Object.keys(s).sort().filter((t) => s[t] !== void 0).map((t) => {
|
|
1860
|
+
let n = JSON.stringify(s[t]);
|
|
1861
|
+
return `${JSON.stringify(t)}:${n}`;
|
|
1873
1862
|
}).join(",")}}` : "";
|
|
1874
1863
|
}
|
|
1875
|
-
class
|
|
1864
|
+
class Ts {
|
|
1876
1865
|
constructor(e) {
|
|
1877
1866
|
this.channel = e, this.listeners = [];
|
|
1878
1867
|
}
|
|
@@ -1917,18 +1906,18 @@ class Is {
|
|
|
1917
1906
|
}
|
|
1918
1907
|
}
|
|
1919
1908
|
stateFromInfo(e) {
|
|
1920
|
-
return e.records.reduce((t, { id:
|
|
1909
|
+
return e.records.reduce((t, { id: n, info: r }) => (t[n] = r, t), {});
|
|
1921
1910
|
}
|
|
1922
1911
|
}
|
|
1923
1912
|
const B = Symbol("state");
|
|
1924
|
-
class
|
|
1913
|
+
class Dt {
|
|
1925
1914
|
// Unique channel identifier
|
|
1926
1915
|
// static identifier = ''
|
|
1927
1916
|
constructor(e = {}) {
|
|
1928
|
-
this.emitter =
|
|
1917
|
+
this.emitter = we(), this.params = Object.freeze(e), this.presence = new Ts(this), this.initialConnect = !0, this[B] = "idle";
|
|
1929
1918
|
}
|
|
1930
1919
|
get identifier() {
|
|
1931
|
-
return this._identifier ? this._identifier : (this._identifier =
|
|
1920
|
+
return this._identifier ? this._identifier : (this._identifier = Ut({
|
|
1932
1921
|
channel: this.channelId,
|
|
1933
1922
|
...this.params
|
|
1934
1923
|
}), this._identifier);
|
|
@@ -1983,8 +1972,8 @@ class Mt {
|
|
|
1983
1972
|
try {
|
|
1984
1973
|
await this.perform("$whisper", e);
|
|
1985
1974
|
} catch (t) {
|
|
1986
|
-
let
|
|
1987
|
-
|
|
1975
|
+
let n = this.receiver ? this.receiver.logger : null;
|
|
1976
|
+
n && n.warn("whisper failed: ", t);
|
|
1988
1977
|
}
|
|
1989
1978
|
}
|
|
1990
1979
|
receive(e, t) {
|
|
@@ -1994,10 +1983,10 @@ class Mt {
|
|
|
1994
1983
|
return this.emitter.on(e, t);
|
|
1995
1984
|
}
|
|
1996
1985
|
once(e, t) {
|
|
1997
|
-
let
|
|
1998
|
-
|
|
1986
|
+
let n = this.emitter.on(e, (...r) => {
|
|
1987
|
+
n(), t(...r);
|
|
1999
1988
|
});
|
|
2000
|
-
return
|
|
1989
|
+
return n;
|
|
2001
1990
|
}
|
|
2002
1991
|
emit(e, ...t) {
|
|
2003
1992
|
return this.emitter.emit(e, ...t);
|
|
@@ -2010,14 +1999,14 @@ class Mt {
|
|
|
2010
1999
|
// It ignores disconnect events.
|
|
2011
2000
|
pendingSubscribe() {
|
|
2012
2001
|
return this._pendingSubscribe ? this._pendingSubscribe : (this._pendingSubscribe = new Promise((e, t) => {
|
|
2013
|
-
let
|
|
2014
|
-
|
|
2002
|
+
let n = [() => delete this._pendingSubscribe];
|
|
2003
|
+
n.push(
|
|
2015
2004
|
this.on("connect", () => {
|
|
2016
|
-
|
|
2005
|
+
n.forEach((r) => r()), e();
|
|
2017
2006
|
})
|
|
2018
|
-
),
|
|
2007
|
+
), n.push(
|
|
2019
2008
|
this.on("close", (r) => {
|
|
2020
|
-
|
|
2009
|
+
n.forEach((i) => i()), t(
|
|
2021
2010
|
r || new ne(
|
|
2022
2011
|
"Channel was disconnected before subscribing",
|
|
2023
2012
|
"canceled"
|
|
@@ -2028,7 +2017,7 @@ class Mt {
|
|
|
2028
2017
|
}), this._pendingSubscribe);
|
|
2029
2018
|
}
|
|
2030
2019
|
}
|
|
2031
|
-
class
|
|
2020
|
+
class ks {
|
|
2032
2021
|
constructor(e) {
|
|
2033
2022
|
this.id = e, this.intent = "unsubscribed", this.state = "idle", this.channels = [], this.disposed = !1, this._pendings = [];
|
|
2034
2023
|
}
|
|
@@ -2040,7 +2029,7 @@ class Ls {
|
|
|
2040
2029
|
t > -1 && this.channels.splice(t, 1);
|
|
2041
2030
|
}
|
|
2042
2031
|
notify(e, ...t) {
|
|
2043
|
-
this.state = e === "restored" ? "connected" : e, t.length === 1 ? this.channels.forEach((
|
|
2032
|
+
this.state = e === "restored" ? "connected" : e, t.length === 1 ? this.channels.forEach((n) => n[e](t[0])) : this.channels.forEach((n) => n[e]());
|
|
2044
2033
|
}
|
|
2045
2034
|
pending(e) {
|
|
2046
2035
|
this._checkIntent(e);
|
|
@@ -2088,7 +2077,7 @@ class Ls {
|
|
|
2088
2077
|
return !t || t.acquired || t.intent !== e ? !1 : (this._pendings.pop(), t.canceled = !0, !0);
|
|
2089
2078
|
}
|
|
2090
2079
|
}
|
|
2091
|
-
class
|
|
2080
|
+
class Ns {
|
|
2092
2081
|
constructor() {
|
|
2093
2082
|
this.queue = [];
|
|
2094
2083
|
}
|
|
@@ -2100,9 +2089,9 @@ class vs {
|
|
|
2100
2089
|
), this.queue.length > 1 && await this.queue[this.queue.length - 2]);
|
|
2101
2090
|
}
|
|
2102
2091
|
}
|
|
2103
|
-
class
|
|
2092
|
+
class Ps {
|
|
2104
2093
|
constructor(e) {
|
|
2105
|
-
e.concurrentSubscribes === !1 && (this.glv = new
|
|
2094
|
+
e.concurrentSubscribes === !1 && (this.glv = new Ns()), this._subscriptions = {}, this._localToRemote = {};
|
|
2106
2095
|
}
|
|
2107
2096
|
all() {
|
|
2108
2097
|
return Object.values(this._subscriptions);
|
|
@@ -2110,22 +2099,22 @@ class js {
|
|
|
2110
2099
|
get(e) {
|
|
2111
2100
|
return this._subscriptions[e];
|
|
2112
2101
|
}
|
|
2113
|
-
create(e, { subscribe: t, unsubscribe:
|
|
2114
|
-
let r = this._subscriptions[e] = new
|
|
2115
|
-
return r.remoteId = this._localToRemote[e], r.subscriber = t, r.unsubscriber =
|
|
2102
|
+
create(e, { subscribe: t, unsubscribe: n }) {
|
|
2103
|
+
let r = this._subscriptions[e] = new ks(e);
|
|
2104
|
+
return r.remoteId = this._localToRemote[e], r.subscriber = t, r.unsubscriber = n, r.gvl = this.glv, r;
|
|
2116
2105
|
}
|
|
2117
2106
|
remove(e) {
|
|
2118
2107
|
delete this._subscriptions[e], delete this._localToRemote[e];
|
|
2119
2108
|
}
|
|
2120
2109
|
storeRemoteId(e, t) {
|
|
2121
2110
|
this._localToRemote[e] = t;
|
|
2122
|
-
let
|
|
2123
|
-
|
|
2111
|
+
let n = this.get(e);
|
|
2112
|
+
n && (n.remoteId = t);
|
|
2124
2113
|
}
|
|
2125
2114
|
}
|
|
2126
|
-
class
|
|
2115
|
+
class Is {
|
|
2127
2116
|
constructor(e = {}) {
|
|
2128
|
-
this.subscriptions = new
|
|
2117
|
+
this.subscriptions = new Ps(e), this._pendingMessages = [], this._remoteToLocal = {};
|
|
2129
2118
|
}
|
|
2130
2119
|
subscribe(e, t) {
|
|
2131
2120
|
this._remoteToLocal[t] = e, this.subscriptions.storeRemoteId(e, t), this.flush(t);
|
|
@@ -2133,26 +2122,26 @@ class $s {
|
|
|
2133
2122
|
unsubscribe(e) {
|
|
2134
2123
|
let t = this.subscriptions.get(e);
|
|
2135
2124
|
if (!t) return;
|
|
2136
|
-
let
|
|
2137
|
-
|
|
2125
|
+
let n = t.remoteId;
|
|
2126
|
+
n && delete this._remoteToLocal[n], this.subscriptions.remove(e);
|
|
2138
2127
|
}
|
|
2139
|
-
transmit(e, t,
|
|
2128
|
+
transmit(e, t, n) {
|
|
2140
2129
|
let r = this._remoteToLocal[e];
|
|
2141
2130
|
if (!r) {
|
|
2142
|
-
this._pendingMessages.push([e, t,
|
|
2131
|
+
this._pendingMessages.push([e, t, n]);
|
|
2143
2132
|
return;
|
|
2144
2133
|
}
|
|
2145
2134
|
let i = this.subscriptions.get(r);
|
|
2146
2135
|
i && i.channels.forEach((o) => {
|
|
2147
|
-
o.receive(t,
|
|
2136
|
+
o.receive(t, n);
|
|
2148
2137
|
});
|
|
2149
2138
|
}
|
|
2150
|
-
notify(e, t,
|
|
2139
|
+
notify(e, t, n) {
|
|
2151
2140
|
let r = this._remoteToLocal[e];
|
|
2152
2141
|
if (!r)
|
|
2153
2142
|
return;
|
|
2154
2143
|
let i = this.subscriptions.get(r);
|
|
2155
|
-
i && i.channels.forEach((o) => o.emit(t,
|
|
2144
|
+
i && i.channels.forEach((o) => o.emit(t, n));
|
|
2156
2145
|
}
|
|
2157
2146
|
close() {
|
|
2158
2147
|
this._pendingMessages.length = 0;
|
|
@@ -2165,23 +2154,23 @@ class $s {
|
|
|
2165
2154
|
}
|
|
2166
2155
|
flush(e) {
|
|
2167
2156
|
let t = [];
|
|
2168
|
-
for (let
|
|
2169
|
-
|
|
2157
|
+
for (let n of this._pendingMessages)
|
|
2158
|
+
n[0] === e ? this.transmit(n[0], n[1], n[2]) : t.push(n);
|
|
2170
2159
|
this._pendingMessages = t;
|
|
2171
2160
|
}
|
|
2172
2161
|
}
|
|
2173
|
-
const
|
|
2162
|
+
const it = {
|
|
2174
2163
|
debug: 0,
|
|
2175
2164
|
info: 1,
|
|
2176
2165
|
warn: 2,
|
|
2177
2166
|
error: 3
|
|
2178
2167
|
};
|
|
2179
|
-
class
|
|
2168
|
+
class qt {
|
|
2180
2169
|
constructor(e) {
|
|
2181
2170
|
this.level = e || "warn";
|
|
2182
2171
|
}
|
|
2183
|
-
log(e, t,
|
|
2184
|
-
|
|
2172
|
+
log(e, t, n) {
|
|
2173
|
+
it[e] < it[this.level] || this.writeLogEntry(e, t, n);
|
|
2185
2174
|
}
|
|
2186
2175
|
writeLogEntry() {
|
|
2187
2176
|
throw Error("Not implemented");
|
|
@@ -2199,11 +2188,11 @@ class Ht {
|
|
|
2199
2188
|
this.log("error", e, t);
|
|
2200
2189
|
}
|
|
2201
2190
|
}
|
|
2202
|
-
class se extends
|
|
2191
|
+
class se extends qt {
|
|
2203
2192
|
writeLogEntry() {
|
|
2204
2193
|
}
|
|
2205
2194
|
}
|
|
2206
|
-
class
|
|
2195
|
+
class Ls {
|
|
2207
2196
|
encode(e) {
|
|
2208
2197
|
return JSON.stringify(e);
|
|
2209
2198
|
}
|
|
@@ -2214,8 +2203,8 @@ class Fs {
|
|
|
2214
2203
|
}
|
|
2215
2204
|
}
|
|
2216
2205
|
}
|
|
2217
|
-
let
|
|
2218
|
-
class
|
|
2206
|
+
let vs = 0;
|
|
2207
|
+
class Bt {
|
|
2219
2208
|
constructor(e = {}) {
|
|
2220
2209
|
let { logger: t } = e;
|
|
2221
2210
|
this.logger = t || new se(), this.pendingSubscriptions = {}, this.pendingUnsubscriptions = {}, this.subscribeCooldownInterval = e.subscribeCooldownInterval || 250, this.subscribeRetryInterval = e.subscribeRetryInterval || 5e3;
|
|
@@ -2224,9 +2213,9 @@ class zt {
|
|
|
2224
2213
|
this.cable = e;
|
|
2225
2214
|
}
|
|
2226
2215
|
subscribe(e, t) {
|
|
2227
|
-
let
|
|
2228
|
-
t && Object.assign(
|
|
2229
|
-
let r =
|
|
2216
|
+
let n = { channel: e };
|
|
2217
|
+
t && Object.assign(n, t);
|
|
2218
|
+
let r = Ut(n);
|
|
2230
2219
|
if (this.pendingUnsubscriptions[r]) {
|
|
2231
2220
|
let o = this.subscribeCooldownInterval * 1.5;
|
|
2232
2221
|
return this.logger.debug(
|
|
@@ -2242,7 +2231,7 @@ class zt {
|
|
|
2242
2231
|
return this.logger.warn("subscription is already pending, skipping", r), Promise.reject(Error("Already subscribing"));
|
|
2243
2232
|
let i = this.subscribeRetryInterval;
|
|
2244
2233
|
return new Promise((o, c) => {
|
|
2245
|
-
let h = ++
|
|
2234
|
+
let h = ++vs;
|
|
2246
2235
|
this.pendingSubscriptions[r] = {
|
|
2247
2236
|
resolve: o,
|
|
2248
2237
|
reject: c,
|
|
@@ -2256,24 +2245,24 @@ class zt {
|
|
|
2256
2245
|
identifier: e
|
|
2257
2246
|
};
|
|
2258
2247
|
}
|
|
2259
|
-
maybeRetrySubscribe(e, t,
|
|
2248
|
+
maybeRetrySubscribe(e, t, n) {
|
|
2260
2249
|
setTimeout(() => {
|
|
2261
2250
|
let r = this.pendingSubscriptions[t];
|
|
2262
2251
|
r && r.id === e && (this.logger.warn(
|
|
2263
|
-
`no subscription ack received in ${
|
|
2252
|
+
`no subscription ack received in ${n}ms, retrying subscribe`,
|
|
2264
2253
|
t
|
|
2265
|
-
), this.cable.send(this.buildSubscribeRequest(t)), this.maybeExpireSubscribe(e, t,
|
|
2266
|
-
},
|
|
2254
|
+
), this.cable.send(this.buildSubscribeRequest(t)), this.maybeExpireSubscribe(e, t, n));
|
|
2255
|
+
}, n);
|
|
2267
2256
|
}
|
|
2268
|
-
maybeExpireSubscribe(e, t,
|
|
2257
|
+
maybeExpireSubscribe(e, t, n) {
|
|
2269
2258
|
setTimeout(() => {
|
|
2270
2259
|
let r = this.pendingSubscriptions[t];
|
|
2271
2260
|
r && r.id === e && (delete this.pendingSubscriptions[t], r.reject(
|
|
2272
|
-
new
|
|
2273
|
-
`Haven't received subscription ack in ${
|
|
2261
|
+
new Os(
|
|
2262
|
+
`Haven't received subscription ack in ${n * 2}ms for ${t}`
|
|
2274
2263
|
)
|
|
2275
2264
|
));
|
|
2276
|
-
},
|
|
2265
|
+
}, n);
|
|
2277
2266
|
}
|
|
2278
2267
|
unsubscribe(e) {
|
|
2279
2268
|
return this.cable.send({
|
|
@@ -2283,11 +2272,11 @@ class zt {
|
|
|
2283
2272
|
delete this.pendingUnsubscriptions[e];
|
|
2284
2273
|
}, this.subscribeCooldownInterval), Promise.resolve();
|
|
2285
2274
|
}
|
|
2286
|
-
perform(e, t,
|
|
2287
|
-
return t === "$whisper" ? this.whisper(e,
|
|
2275
|
+
perform(e, t, n) {
|
|
2276
|
+
return t === "$whisper" ? this.whisper(e, n) : (n || (n = {}), n.action = t, this.cable.send({
|
|
2288
2277
|
command: "message",
|
|
2289
2278
|
identifier: e,
|
|
2290
|
-
data: JSON.stringify(
|
|
2279
|
+
data: JSON.stringify(n)
|
|
2291
2280
|
}), Promise.resolve());
|
|
2292
2281
|
}
|
|
2293
2282
|
whisper(e, t) {
|
|
@@ -2302,7 +2291,7 @@ class zt {
|
|
|
2302
2291
|
this.logger.error("unsupported message format", { message: e });
|
|
2303
2292
|
return;
|
|
2304
2293
|
}
|
|
2305
|
-
let { type: t, identifier:
|
|
2294
|
+
let { type: t, identifier: n, message: r, reason: i, reconnect: o } = e;
|
|
2306
2295
|
if (t === "ping")
|
|
2307
2296
|
return this.cable.keepalive(e.message);
|
|
2308
2297
|
if (this.cable.keepalive(), t === "welcome") {
|
|
@@ -2310,27 +2299,27 @@ class zt {
|
|
|
2310
2299
|
return c && this.cable.setSessionId(c), this.cable.connected();
|
|
2311
2300
|
}
|
|
2312
2301
|
if (t === "disconnect") {
|
|
2313
|
-
let c = new
|
|
2302
|
+
let c = new $(i);
|
|
2314
2303
|
this.reset(c), o === !1 ? this.cable.closed(c) : this.cable.disconnected(c);
|
|
2315
2304
|
return;
|
|
2316
2305
|
}
|
|
2317
2306
|
if (t === "confirm_subscription") {
|
|
2318
|
-
let c = this.pendingSubscriptions[
|
|
2307
|
+
let c = this.pendingSubscriptions[n];
|
|
2319
2308
|
if (!c) {
|
|
2320
2309
|
this.logger.error("subscription not found, unsubscribing", {
|
|
2321
2310
|
type: t,
|
|
2322
|
-
identifier:
|
|
2323
|
-
}), this.unsubscribe(
|
|
2311
|
+
identifier: n
|
|
2312
|
+
}), this.unsubscribe(n);
|
|
2324
2313
|
return;
|
|
2325
2314
|
}
|
|
2326
|
-
return delete this.pendingSubscriptions[
|
|
2315
|
+
return delete this.pendingSubscriptions[n], c.resolve(n);
|
|
2327
2316
|
}
|
|
2328
2317
|
if (t === "reject_subscription") {
|
|
2329
|
-
let c = this.pendingSubscriptions[
|
|
2330
|
-
return c ? (delete this.pendingSubscriptions[
|
|
2318
|
+
let c = this.pendingSubscriptions[n];
|
|
2319
|
+
return c ? (delete this.pendingSubscriptions[n], c.reject(new De())) : this.logger.error("subscription not found", { type: t, identifier: n });
|
|
2331
2320
|
}
|
|
2332
2321
|
if (r)
|
|
2333
|
-
return { identifier:
|
|
2322
|
+
return { identifier: n, message: r };
|
|
2334
2323
|
this.logger.warn(`unknown message type: ${t}`, { message: e });
|
|
2335
2324
|
}
|
|
2336
2325
|
reset(e) {
|
|
@@ -2342,10 +2331,10 @@ class zt {
|
|
|
2342
2331
|
return !1;
|
|
2343
2332
|
}
|
|
2344
2333
|
}
|
|
2345
|
-
const
|
|
2346
|
-
class
|
|
2334
|
+
const ot = () => Date.now() / 1e3 | 0;
|
|
2335
|
+
class $s extends Bt {
|
|
2347
2336
|
constructor(e = {}) {
|
|
2348
|
-
super(e), this.streamsPositions = {}, this.subscriptionStreams = {}, this.pendingHistory = {}, this.pendingPresence = {}, this.presenceInfo = {}, this.restoreSince = e.historyTimestamp, this.restoreSince === void 0 && (this.restoreSince =
|
|
2337
|
+
super(e), this.streamsPositions = {}, this.subscriptionStreams = {}, this.pendingHistory = {}, this.pendingPresence = {}, this.presenceInfo = {}, this.restoreSince = e.historyTimestamp, this.restoreSince === void 0 && (this.restoreSince = ot()), this.sessionId = void 0, this.sendPongs = e.pongs;
|
|
2349
2338
|
}
|
|
2350
2339
|
reset(e) {
|
|
2351
2340
|
for (let t in this.pendingPresence)
|
|
@@ -2357,19 +2346,19 @@ class Ds extends zt {
|
|
|
2357
2346
|
this.logger.error("unsupported message format", { message: e });
|
|
2358
2347
|
return;
|
|
2359
2348
|
}
|
|
2360
|
-
let { type: t, identifier:
|
|
2349
|
+
let { type: t, identifier: n, message: r } = e;
|
|
2361
2350
|
if (t === "disconnect" || t === "reject_subscription")
|
|
2362
2351
|
return super.receive(e);
|
|
2363
2352
|
if (t === "confirm_subscription")
|
|
2364
|
-
return this.subscriptionStreams[
|
|
2353
|
+
return this.subscriptionStreams[n] || (this.subscriptionStreams[n] = /* @__PURE__ */ new Set()), super.receive(e);
|
|
2365
2354
|
if (t === "ping")
|
|
2366
|
-
return this.restoreSince && (this.restoreSince =
|
|
2355
|
+
return this.restoreSince && (this.restoreSince = ot()), this.sendPongs && this.sendPong(), this.cable.keepalive(e.message);
|
|
2367
2356
|
if (this.cable.keepalive(), t === "confirm_history") {
|
|
2368
|
-
this.logger.debug("history result received", e), this.cable.notify("history_received",
|
|
2357
|
+
this.logger.debug("history result received", e), this.cable.notify("history_received", n);
|
|
2369
2358
|
return;
|
|
2370
2359
|
}
|
|
2371
2360
|
if (t === "reject_history") {
|
|
2372
|
-
this.logger.warn("failed to retrieve history", e), this.cable.notify("history_not_found",
|
|
2361
|
+
this.logger.warn("failed to retrieve history", e), this.cable.notify("history_not_found", n);
|
|
2373
2362
|
return;
|
|
2374
2363
|
}
|
|
2375
2364
|
if (t === "welcome") {
|
|
@@ -2392,46 +2381,46 @@ class Ds extends zt {
|
|
|
2392
2381
|
if (t === "presence") {
|
|
2393
2382
|
let i = r.type;
|
|
2394
2383
|
if (i === "info") {
|
|
2395
|
-
let o = this.pendingPresence[
|
|
2396
|
-
o && (delete this.pendingPresence[
|
|
2384
|
+
let o = this.pendingPresence[n];
|
|
2385
|
+
o && (delete this.pendingPresence[n], o.resolve(r));
|
|
2397
2386
|
} else if (i === "error") {
|
|
2398
|
-
let o = this.pendingPresence[
|
|
2399
|
-
o && (delete this.pendingPresence[
|
|
2387
|
+
let o = this.pendingPresence[n];
|
|
2388
|
+
o && (delete this.pendingPresence[n], o.reject(new Error("failed to retrieve presence")));
|
|
2400
2389
|
}
|
|
2401
2390
|
return {
|
|
2402
2391
|
type: t,
|
|
2403
|
-
identifier:
|
|
2392
|
+
identifier: n,
|
|
2404
2393
|
message: r
|
|
2405
2394
|
};
|
|
2406
2395
|
}
|
|
2407
2396
|
if (r) {
|
|
2408
2397
|
let i = this.trackStreamPosition(
|
|
2409
|
-
|
|
2398
|
+
n,
|
|
2410
2399
|
e.stream_id,
|
|
2411
2400
|
e.epoch,
|
|
2412
2401
|
e.offset
|
|
2413
2402
|
);
|
|
2414
|
-
return { identifier:
|
|
2403
|
+
return { identifier: n, message: r, meta: i };
|
|
2415
2404
|
}
|
|
2416
2405
|
this.logger.warn(`unknown message type: ${t}`, { message: e });
|
|
2417
2406
|
}
|
|
2418
|
-
perform(e, t,
|
|
2407
|
+
perform(e, t, n) {
|
|
2419
2408
|
switch (t) {
|
|
2420
2409
|
case "$presence:join":
|
|
2421
|
-
return this.join(e,
|
|
2410
|
+
return this.join(e, n);
|
|
2422
2411
|
case "$presence:leave":
|
|
2423
|
-
return this.leave(e,
|
|
2412
|
+
return this.leave(e, n);
|
|
2424
2413
|
case "$presence:info":
|
|
2425
|
-
return this.presence(e,
|
|
2414
|
+
return this.presence(e, n);
|
|
2426
2415
|
}
|
|
2427
|
-
return super.perform(e, t,
|
|
2416
|
+
return super.perform(e, t, n);
|
|
2428
2417
|
}
|
|
2429
2418
|
unsubscribe(e) {
|
|
2430
2419
|
return delete this.presenceInfo[e], super.unsubscribe(e);
|
|
2431
2420
|
}
|
|
2432
2421
|
buildSubscribeRequest(e) {
|
|
2433
|
-
let t = super.buildSubscribeRequest(e),
|
|
2434
|
-
|
|
2422
|
+
let t = super.buildSubscribeRequest(e), n = this.historyRequestFor(e);
|
|
2423
|
+
n && (t.history = n, this.pendingHistory[e] = !0);
|
|
2435
2424
|
let r = this.presenceInfo[e];
|
|
2436
2425
|
return r && (t.presence = r), t;
|
|
2437
2426
|
}
|
|
@@ -2440,18 +2429,18 @@ class Ds extends zt {
|
|
|
2440
2429
|
return !!this.sessionId;
|
|
2441
2430
|
}
|
|
2442
2431
|
historyRequestFor(e) {
|
|
2443
|
-
let t = {},
|
|
2432
|
+
let t = {}, n = !1;
|
|
2444
2433
|
if (this.subscriptionStreams[e])
|
|
2445
2434
|
for (let r of this.subscriptionStreams[e]) {
|
|
2446
2435
|
let i = this.streamsPositions[r];
|
|
2447
|
-
i && (
|
|
2436
|
+
i && (n = !0, t[r] = i);
|
|
2448
2437
|
}
|
|
2449
|
-
if (!(!
|
|
2438
|
+
if (!(!n && !this.restoreSince))
|
|
2450
2439
|
return { since: this.restoreSince, streams: t };
|
|
2451
2440
|
}
|
|
2452
|
-
trackStreamPosition(e, t,
|
|
2453
|
-
if (!(!t || !
|
|
2454
|
-
return this.subscriptionStreams[e] || (this.subscriptionStreams[e] = /* @__PURE__ */ new Set()), this.subscriptionStreams[e].add(t), this.streamsPositions[t] = { epoch:
|
|
2441
|
+
trackStreamPosition(e, t, n, r) {
|
|
2442
|
+
if (!(!t || !n))
|
|
2443
|
+
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 };
|
|
2455
2444
|
}
|
|
2456
2445
|
// Send pongs asynchrounously—no need to block the main thread
|
|
2457
2446
|
async sendPong() {
|
|
@@ -2472,9 +2461,9 @@ class Ds extends zt {
|
|
|
2472
2461
|
}), Promise.resolve();
|
|
2473
2462
|
}
|
|
2474
2463
|
presence(e, t) {
|
|
2475
|
-
return this.pendingPresence[e] ? (this.logger.warn("presence is already pending, skipping", e), Promise.reject(Error("presence request is already pending"))) : new Promise((
|
|
2464
|
+
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) => {
|
|
2476
2465
|
this.pendingPresence[e] = {
|
|
2477
|
-
resolve:
|
|
2466
|
+
resolve: n,
|
|
2478
2467
|
reject: r
|
|
2479
2468
|
}, this.cable.send({
|
|
2480
2469
|
command: "presence",
|
|
@@ -2484,12 +2473,12 @@ class Ds extends zt {
|
|
|
2484
2473
|
});
|
|
2485
2474
|
}
|
|
2486
2475
|
}
|
|
2487
|
-
class
|
|
2476
|
+
class js extends ne {
|
|
2488
2477
|
constructor() {
|
|
2489
2478
|
super("No connection", "closed"), this.name = "NoConnectionError";
|
|
2490
2479
|
}
|
|
2491
2480
|
}
|
|
2492
|
-
class
|
|
2481
|
+
class qe extends Dt {
|
|
2493
2482
|
constructor(e, t) {
|
|
2494
2483
|
super(t), this.channelId = e;
|
|
2495
2484
|
}
|
|
@@ -2500,29 +2489,29 @@ class Be extends Mt {
|
|
|
2500
2489
|
return this._channelId;
|
|
2501
2490
|
}
|
|
2502
2491
|
}
|
|
2503
|
-
v(
|
|
2504
|
-
const
|
|
2505
|
-
class
|
|
2492
|
+
v(qe, "identifier", "__ghost__");
|
|
2493
|
+
const Fs = "$pubsub";
|
|
2494
|
+
class Le extends Dt {
|
|
2506
2495
|
async perform(e, t) {
|
|
2507
2496
|
if (e.startsWith("$"))
|
|
2508
2497
|
return super.perform(e, t);
|
|
2509
2498
|
throw Error("not implemented");
|
|
2510
2499
|
}
|
|
2511
2500
|
}
|
|
2512
|
-
v(
|
|
2501
|
+
v(Le, "identifier", Fs);
|
|
2513
2502
|
const M = Symbol("state");
|
|
2514
|
-
let
|
|
2503
|
+
let Us = class {
|
|
2515
2504
|
constructor({
|
|
2516
2505
|
transport: e,
|
|
2517
2506
|
protocol: t,
|
|
2518
|
-
encoder:
|
|
2507
|
+
encoder: n,
|
|
2519
2508
|
logger: r,
|
|
2520
2509
|
lazy: i,
|
|
2521
2510
|
hubOptions: o,
|
|
2522
2511
|
performFailures: c,
|
|
2523
2512
|
transportConfigurator: h
|
|
2524
2513
|
}) {
|
|
2525
|
-
this.emitter =
|
|
2514
|
+
this.emitter = we(), this.transport = e, this.encoder = n, this.logger = r || new se(), this.protocol = t, this.performFailures = c || "throw", this.protocol.attached(this), this.hub = new Is(o || {}), this[M] = "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(() => {
|
|
2526
2515
|
});
|
|
2527
2516
|
}
|
|
2528
2517
|
get state() {
|
|
@@ -2540,8 +2529,8 @@ let Ms = class {
|
|
|
2540
2529
|
this.transportConfigurator && await this.transportConfigurator(this.transport, {
|
|
2541
2530
|
initial: e
|
|
2542
2531
|
}), await this.transport.open();
|
|
2543
|
-
} catch (
|
|
2544
|
-
this.handleClose(
|
|
2532
|
+
} catch (n) {
|
|
2533
|
+
this.handleClose(n);
|
|
2545
2534
|
}
|
|
2546
2535
|
return t;
|
|
2547
2536
|
}
|
|
@@ -2553,7 +2542,7 @@ let Ms = class {
|
|
|
2553
2542
|
this.logger.info("connected"), this[M] = "connected", this.recovering && this.hub.subscriptions.all().forEach(
|
|
2554
2543
|
(t) => t.notify(
|
|
2555
2544
|
"disconnected",
|
|
2556
|
-
new
|
|
2545
|
+
new $("recovery_failed")
|
|
2557
2546
|
)
|
|
2558
2547
|
), this.hub.subscriptions.all().forEach((t) => this._resubscribe(t));
|
|
2559
2548
|
let e = !1;
|
|
@@ -2563,17 +2552,17 @@ let Ms = class {
|
|
|
2563
2552
|
this.logger.info("connection recovered", { remoteIds: e }), this[M] = "connected", this.hub.subscriptions.all().forEach((r) => {
|
|
2564
2553
|
e && r.remoteId && e.includes(r.remoteId) ? r.notify("restored") : (r.notify(
|
|
2565
2554
|
"disconnected",
|
|
2566
|
-
new
|
|
2555
|
+
new $("recovery_failed")
|
|
2567
2556
|
), this._resubscribe(r));
|
|
2568
2557
|
});
|
|
2569
|
-
let t = !this.initialConnect,
|
|
2570
|
-
this.recovering = !1, this.initialConnect = !1, this.emit("connect", { reconnect: t, restored:
|
|
2558
|
+
let t = !this.initialConnect, n = !0;
|
|
2559
|
+
this.recovering = !1, this.initialConnect = !1, this.emit("connect", { reconnect: t, restored: n });
|
|
2571
2560
|
}
|
|
2572
|
-
notify(e, t,
|
|
2573
|
-
t && typeof t != "string" && (
|
|
2561
|
+
notify(e, t, n) {
|
|
2562
|
+
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 });
|
|
2574
2563
|
}
|
|
2575
2564
|
handleClose(e) {
|
|
2576
|
-
this.logger.debug("transport closed", { error: e }), this.disconnected(new
|
|
2565
|
+
this.logger.debug("transport closed", { error: e }), this.disconnected(new $(e, "transport_closed"));
|
|
2577
2566
|
}
|
|
2578
2567
|
disconnected(e) {
|
|
2579
2568
|
(this.state === "connected" || this.state === "connecting") && (this.logger.info("disconnected", { reason: e }), this[M] = "disconnected", this.recovering = this.protocol.recoverableClosure(e), this.recovering ? this.hub.subscriptions.all().forEach((t) => t.notify("connecting")) : this.hub.subscriptions.all().forEach((t) => {
|
|
@@ -2583,9 +2572,9 @@ let Ms = class {
|
|
|
2583
2572
|
closed(e) {
|
|
2584
2573
|
if (this.state === "closed" || this.state === "idle") return;
|
|
2585
2574
|
let t;
|
|
2586
|
-
e && (t = e instanceof
|
|
2587
|
-
let
|
|
2588
|
-
this.hub.subscriptions.all().forEach((r) => r.notify("disconnected",
|
|
2575
|
+
e && (t = e instanceof $ ? e : new $(e, void 0)), this.logger.info("closed", { reason: e || "user" }), this[M] = "closed";
|
|
2576
|
+
let n = t || new $("cable_closed");
|
|
2577
|
+
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);
|
|
2589
2578
|
}
|
|
2590
2579
|
disconnect() {
|
|
2591
2580
|
this.closed();
|
|
@@ -2599,10 +2588,10 @@ let Ms = class {
|
|
|
2599
2588
|
return;
|
|
2600
2589
|
}
|
|
2601
2590
|
this.logger.debug("incoming data", t);
|
|
2602
|
-
let
|
|
2603
|
-
if (
|
|
2604
|
-
this.logger.debug("processed incoming message",
|
|
2605
|
-
let { type: r, identifier: i, message: o, meta: c } =
|
|
2591
|
+
let n = this.protocol.receive(t);
|
|
2592
|
+
if (n) {
|
|
2593
|
+
this.logger.debug("processed incoming message", n);
|
|
2594
|
+
let { type: r, identifier: i, message: o, meta: c } = n;
|
|
2606
2595
|
r ? this.hub.notify(i, r, o) : this.hub.transmit(i, o, c);
|
|
2607
2596
|
}
|
|
2608
2597
|
}
|
|
@@ -2620,31 +2609,31 @@ let Ms = class {
|
|
|
2620
2609
|
this.emit("keepalive", e);
|
|
2621
2610
|
}
|
|
2622
2611
|
streamFrom(e) {
|
|
2623
|
-
let t = new
|
|
2612
|
+
let t = new Le({ stream_name: e });
|
|
2624
2613
|
return this.subscribe(t);
|
|
2625
2614
|
}
|
|
2626
2615
|
streamFromSigned(e) {
|
|
2627
|
-
let t = new
|
|
2616
|
+
let t = new Le({ signed_stream_name: e });
|
|
2628
2617
|
return this.subscribe(t);
|
|
2629
2618
|
}
|
|
2630
2619
|
subscribeTo(e, t) {
|
|
2631
|
-
let
|
|
2632
|
-
return typeof e == "string" && (r = e, e =
|
|
2620
|
+
let n, r;
|
|
2621
|
+
return typeof e == "string" && (r = e, e = qe), n = r ? new e(r, t) : new e(t), this.subscribe(n);
|
|
2633
2622
|
}
|
|
2634
2623
|
subscribe(e) {
|
|
2635
2624
|
if (!e.attached(this)) return e;
|
|
2636
2625
|
let t = e.identifier;
|
|
2637
2626
|
e.connecting();
|
|
2638
|
-
let
|
|
2627
|
+
let n = this.hub.subscriptions.get(t) || this.hub.subscriptions.create(t, {
|
|
2639
2628
|
subscribe: (r) => this._subscribe(r, e.channelId, e.params),
|
|
2640
2629
|
unsubscribe: (r) => this._unsubscribe(r)
|
|
2641
2630
|
});
|
|
2642
|
-
return
|
|
2631
|
+
return n.add(e), n.intent === "subscribed" && n.state === "connected" && e.connected(), n.ensureSubscribed(), e;
|
|
2643
2632
|
}
|
|
2644
2633
|
async _resubscribe(e) {
|
|
2645
2634
|
e.intent !== "subscribed" || !e.channels[0] || (e.notify("connecting"), e.ensureResubscribed());
|
|
2646
2635
|
}
|
|
2647
|
-
async _subscribe(e, t,
|
|
2636
|
+
async _subscribe(e, t, n) {
|
|
2648
2637
|
let r = e.id;
|
|
2649
2638
|
if (this.state === "idle" && this.connect().catch(() => {
|
|
2650
2639
|
}), this.state !== "connected") {
|
|
@@ -2673,15 +2662,15 @@ let Ms = class {
|
|
|
2673
2662
|
}
|
|
2674
2663
|
let o = {
|
|
2675
2664
|
identifier: t,
|
|
2676
|
-
params:
|
|
2665
|
+
params: n
|
|
2677
2666
|
};
|
|
2678
2667
|
this.logger.debug("subscribing", o);
|
|
2679
2668
|
try {
|
|
2680
|
-
let c = await this.protocol.subscribe(t,
|
|
2669
|
+
let c = await this.protocol.subscribe(t, n);
|
|
2681
2670
|
this.hub.subscribe(r, c), this.logger.debug("subscribed", { ...o, remoteId: c }), e.notify("connected");
|
|
2682
2671
|
} catch (c) {
|
|
2683
2672
|
if (c) {
|
|
2684
|
-
if (c instanceof
|
|
2673
|
+
if (c instanceof De && this.logger.warn("rejected", o), c instanceof $) {
|
|
2685
2674
|
this.logger.debug(
|
|
2686
2675
|
"disconnected during subscription; will retry on connect",
|
|
2687
2676
|
o
|
|
@@ -2698,44 +2687,44 @@ let Ms = class {
|
|
|
2698
2687
|
i.release();
|
|
2699
2688
|
}
|
|
2700
2689
|
unsubscribe(e) {
|
|
2701
|
-
let t = e.identifier,
|
|
2702
|
-
if (!
|
|
2690
|
+
let t = e.identifier, n = this.hub.subscriptions.get(t);
|
|
2691
|
+
if (!n)
|
|
2703
2692
|
throw Error(`Subscription not found: ${t}`);
|
|
2704
|
-
|
|
2693
|
+
n.remove(e), e.closed(), n.maybeUnsubscribe();
|
|
2705
2694
|
}
|
|
2706
2695
|
async _unsubscribe(e) {
|
|
2707
2696
|
let t = e.id;
|
|
2708
2697
|
this.logger.debug("acquiring unsubscribe lock", { identifier: t });
|
|
2709
|
-
let
|
|
2710
|
-
if (
|
|
2711
|
-
this.logger.debug("unsubscribe lock has been canceled", { identifier: t }),
|
|
2698
|
+
let n = await e.acquire("unsubscribed");
|
|
2699
|
+
if (n.canceled) {
|
|
2700
|
+
this.logger.debug("unsubscribe lock has been canceled", { identifier: t }), n.release();
|
|
2712
2701
|
return;
|
|
2713
2702
|
}
|
|
2714
2703
|
if (this.logger.debug("unsubscribe lock has been acquired", { identifier: t }), e.intent !== "unsubscribed") {
|
|
2715
2704
|
this.logger.debug("cancel unsubscribe, no longer needed", {
|
|
2716
2705
|
identifier: t,
|
|
2717
2706
|
intent: e.intent
|
|
2718
|
-
}),
|
|
2707
|
+
}), n.release();
|
|
2719
2708
|
return;
|
|
2720
2709
|
}
|
|
2721
2710
|
if (e.state === "disconnected" || e.state === "closed") {
|
|
2722
2711
|
this.logger.debug(
|
|
2723
2712
|
`already ${e.state} connected, skip unsubscribe command`,
|
|
2724
2713
|
{ identifier: t }
|
|
2725
|
-
),
|
|
2714
|
+
), n.release();
|
|
2726
2715
|
return;
|
|
2727
2716
|
}
|
|
2728
2717
|
let r = e.remoteId;
|
|
2729
2718
|
if (this.logger.debug("unsubscribing...", { remoteId: r }), this.state !== "connected") {
|
|
2730
2719
|
this.logger.debug("unsubscribe skipped (cable is not connected)", {
|
|
2731
2720
|
id: t
|
|
2732
|
-
}), e.close(), this.hub.unsubscribe(t),
|
|
2721
|
+
}), e.close(), this.hub.unsubscribe(t), n.release();
|
|
2733
2722
|
return;
|
|
2734
2723
|
}
|
|
2735
2724
|
try {
|
|
2736
2725
|
await this.protocol.unsubscribe(r), this.logger.debug("unsubscribed remotely", { id: t });
|
|
2737
2726
|
} catch (i) {
|
|
2738
|
-
i && (i instanceof
|
|
2727
|
+
i && (i instanceof $ ? this.logger.debug(
|
|
2739
2728
|
"cable disconnected during the unsubscribe command execution",
|
|
2740
2729
|
{ id: t, error: i }
|
|
2741
2730
|
) : this.logger.error("unsubscribe failed", {
|
|
@@ -2743,21 +2732,21 @@ let Ms = class {
|
|
|
2743
2732
|
error: i
|
|
2744
2733
|
}));
|
|
2745
2734
|
}
|
|
2746
|
-
e.intent === "unsubscribed" ? (e.close(), this.hub.unsubscribe(t)) : e.state = "closed",
|
|
2735
|
+
e.intent === "unsubscribed" ? (e.close(), this.hub.unsubscribe(t)) : e.state = "closed", n.release();
|
|
2747
2736
|
}
|
|
2748
|
-
async perform(e, t,
|
|
2737
|
+
async perform(e, t, n) {
|
|
2749
2738
|
if (this.performFailures === "throw")
|
|
2750
|
-
return this._perform(e, t,
|
|
2739
|
+
return this._perform(e, t, n);
|
|
2751
2740
|
try {
|
|
2752
|
-
return await this._perform(e, t,
|
|
2741
|
+
return await this._perform(e, t, n);
|
|
2753
2742
|
} catch (r) {
|
|
2754
2743
|
this.performFailures === "warn" && this.logger.warn("perform failed", { error: r });
|
|
2755
2744
|
return;
|
|
2756
2745
|
}
|
|
2757
2746
|
}
|
|
2758
|
-
async _perform(e, t,
|
|
2747
|
+
async _perform(e, t, n) {
|
|
2759
2748
|
if (this.state === "connecting" && await this.pendingConnect(), this.state === "closed" || this.state === "disconnected")
|
|
2760
|
-
throw new
|
|
2749
|
+
throw new js();
|
|
2761
2750
|
let r = this.hub.subscriptions.get(e);
|
|
2762
2751
|
if (!r)
|
|
2763
2752
|
throw Error(`Subscription not found: ${e}`);
|
|
@@ -2766,11 +2755,11 @@ let Ms = class {
|
|
|
2766
2755
|
let i = r.remoteId, o = {
|
|
2767
2756
|
id: i,
|
|
2768
2757
|
action: t,
|
|
2769
|
-
payload:
|
|
2758
|
+
payload: n
|
|
2770
2759
|
};
|
|
2771
2760
|
this.logger.debug("perform", o);
|
|
2772
2761
|
try {
|
|
2773
|
-
let c = await this.protocol.perform(i, t,
|
|
2762
|
+
let c = await this.protocol.perform(i, t, n);
|
|
2774
2763
|
return c && this.logger.debug("perform result", {
|
|
2775
2764
|
message: c,
|
|
2776
2765
|
request: o
|
|
@@ -2786,49 +2775,49 @@ let Ms = class {
|
|
|
2786
2775
|
return this.emitter.on(e, t);
|
|
2787
2776
|
}
|
|
2788
2777
|
once(e, t) {
|
|
2789
|
-
let
|
|
2790
|
-
|
|
2778
|
+
let n = this.emitter.on(e, (...r) => {
|
|
2779
|
+
n(), t(...r);
|
|
2791
2780
|
});
|
|
2792
|
-
return
|
|
2781
|
+
return n;
|
|
2793
2782
|
}
|
|
2794
2783
|
emit(e, ...t) {
|
|
2795
2784
|
return this.emitter.emit(e, ...t);
|
|
2796
2785
|
}
|
|
2797
2786
|
pendingConnect() {
|
|
2798
2787
|
return this._pendingConnect ? this._pendingConnect : (this._pendingConnect = new Promise((e, t) => {
|
|
2799
|
-
let
|
|
2800
|
-
|
|
2788
|
+
let n = [() => delete this._pendingConnect];
|
|
2789
|
+
n.push(
|
|
2801
2790
|
this.on("connect", () => {
|
|
2802
|
-
|
|
2791
|
+
n.forEach((r) => r()), e();
|
|
2803
2792
|
})
|
|
2804
|
-
),
|
|
2793
|
+
), n.push(
|
|
2805
2794
|
this.on("close", (r) => {
|
|
2806
|
-
|
|
2795
|
+
n.forEach((i) => i()), t(r);
|
|
2807
2796
|
})
|
|
2808
|
-
),
|
|
2797
|
+
), n.push(
|
|
2809
2798
|
this.on("disconnect", (r) => {
|
|
2810
|
-
|
|
2799
|
+
n.forEach((i) => i()), t(r);
|
|
2811
2800
|
})
|
|
2812
2801
|
);
|
|
2813
2802
|
}), this._pendingConnect);
|
|
2814
2803
|
}
|
|
2815
2804
|
};
|
|
2816
|
-
const
|
|
2805
|
+
const Ds = {
|
|
2817
2806
|
maxMissingPings: 2,
|
|
2818
2807
|
maxReconnectAttempts: 1 / 0
|
|
2819
|
-
}, W = () => Date.now(),
|
|
2808
|
+
}, W = () => Date.now(), Mt = (s, e) => {
|
|
2820
2809
|
e = e || {};
|
|
2821
|
-
let { backoffRate: t, jitterRatio:
|
|
2822
|
-
return t = t || 2,
|
|
2823
|
-
let o =
|
|
2810
|
+
let { backoffRate: t, jitterRatio: n, maxInterval: r } = e;
|
|
2811
|
+
return t = t || 2, n === void 0 && (n = 0.5), (i) => {
|
|
2812
|
+
let o = s * t ** i, c = o * t, h = o + (c - o) * Math.random(), u = 2 * (Math.random() - 0.5) * n;
|
|
2824
2813
|
return h = h * (1 + u), r && r < h && (h = r), h;
|
|
2825
2814
|
};
|
|
2826
2815
|
};
|
|
2827
|
-
let
|
|
2816
|
+
let Ht = class {
|
|
2828
2817
|
constructor({ pingInterval: e, ...t }) {
|
|
2829
2818
|
if (this.pingInterval = e, !this.pingInterval)
|
|
2830
2819
|
throw Error(`Incorrect pingInterval is provided: ${e}`);
|
|
2831
|
-
if (t = Object.assign({},
|
|
2820
|
+
if (t = Object.assign({}, Ds, t), this.strategy = t.reconnectStrategy, !this.strategy)
|
|
2832
2821
|
throw Error("Reconnect strategy must be provided");
|
|
2833
2822
|
this.maxMissingPings = t.maxMissingPings, this.maxReconnectAttempts = t.maxReconnectAttempts, this.logger = t.logger || new se(), this.state = "pending_connect", this.attempts = 0, this.disconnectedAt = W();
|
|
2834
2823
|
}
|
|
@@ -2876,7 +2865,7 @@ let Jt = class {
|
|
|
2876
2865
|
}
|
|
2877
2866
|
checkStale() {
|
|
2878
2867
|
let e = W() - this.pingedAt;
|
|
2879
|
-
e > this.maxMissingPings * this.pingInterval && (this.logger.warn(`Stale connection: ${e}ms without pings`), this.state = "pending_disconnect", this.target.disconnected(new
|
|
2868
|
+
e > this.maxMissingPings * this.pingInterval && (this.logger.warn(`Stale connection: ${e}ms without pings`), this.state = "pending_disconnect", this.target.disconnected(new Cs()));
|
|
2880
2869
|
}
|
|
2881
2870
|
scheduleReconnect() {
|
|
2882
2871
|
if (this.attempts >= this.maxReconnectAttempts) {
|
|
@@ -2890,9 +2879,9 @@ let Jt = class {
|
|
|
2890
2879
|
this.reconnnectId && (clearTimeout(this.reconnnectId), delete this.reconnnectId);
|
|
2891
2880
|
}
|
|
2892
2881
|
};
|
|
2893
|
-
class
|
|
2882
|
+
class qs {
|
|
2894
2883
|
constructor(e, t = {}) {
|
|
2895
|
-
this.transports = e, this.transport = null, this.emitter =
|
|
2884
|
+
this.transports = e, this.transport = null, this.emitter = we(), this.unbind = [], this.logger = t.logger || new se();
|
|
2896
2885
|
}
|
|
2897
2886
|
displayName() {
|
|
2898
2887
|
return "fallbacked transport";
|
|
@@ -2903,9 +2892,9 @@ class zs {
|
|
|
2903
2892
|
try {
|
|
2904
2893
|
this.transport = t, this.resetListeners(), this.logger.debug(`Trying to connect via ${t.displayName()}`), await t.open(), this.logger.debug(`Connected via ${t.displayName()}`);
|
|
2905
2894
|
return;
|
|
2906
|
-
} catch (
|
|
2895
|
+
} catch (n) {
|
|
2907
2896
|
this.logger.debug(
|
|
2908
|
-
`Failed to connect via ${t.displayName()}: ${
|
|
2897
|
+
`Failed to connect via ${t.displayName()}: ${n.message}`
|
|
2909
2898
|
);
|
|
2910
2899
|
}
|
|
2911
2900
|
}
|
|
@@ -2925,23 +2914,23 @@ class zs {
|
|
|
2925
2914
|
throw new Error("Not implemented. Set URL for each transport separately");
|
|
2926
2915
|
}
|
|
2927
2916
|
setParam(e, t) {
|
|
2928
|
-
this.transports.forEach((
|
|
2929
|
-
|
|
2917
|
+
this.transports.forEach((n) => {
|
|
2918
|
+
n.setParam(e, t);
|
|
2930
2919
|
});
|
|
2931
2920
|
}
|
|
2932
2921
|
setToken(e, t) {
|
|
2933
|
-
this.transports.forEach((
|
|
2934
|
-
|
|
2922
|
+
this.transports.forEach((n) => {
|
|
2923
|
+
n.setToken(e, t);
|
|
2935
2924
|
});
|
|
2936
2925
|
}
|
|
2937
2926
|
on(e, t) {
|
|
2938
2927
|
return this.emitter.on(e, t);
|
|
2939
2928
|
}
|
|
2940
2929
|
once(e, t) {
|
|
2941
|
-
let
|
|
2942
|
-
|
|
2930
|
+
let n = this.emitter.on(e, (...r) => {
|
|
2931
|
+
n(), t(...r);
|
|
2943
2932
|
});
|
|
2944
|
-
return
|
|
2933
|
+
return n;
|
|
2945
2934
|
}
|
|
2946
2935
|
get url() {
|
|
2947
2936
|
return this.transport ? this.transport.url : "";
|
|
@@ -2963,17 +2952,17 @@ class zs {
|
|
|
2963
2952
|
);
|
|
2964
2953
|
}
|
|
2965
2954
|
}
|
|
2966
|
-
class
|
|
2955
|
+
class Bs {
|
|
2967
2956
|
constructor(e, t = {}) {
|
|
2968
2957
|
this.url = e;
|
|
2969
|
-
let
|
|
2970
|
-
if (
|
|
2971
|
-
this.Impl =
|
|
2958
|
+
let n = t.websocketImplementation;
|
|
2959
|
+
if (n)
|
|
2960
|
+
this.Impl = n;
|
|
2972
2961
|
else if (typeof WebSocket < "u")
|
|
2973
2962
|
this.Impl = WebSocket;
|
|
2974
2963
|
else
|
|
2975
2964
|
throw new Error("No WebSocket support");
|
|
2976
|
-
this.connected = !1, this.emitter =
|
|
2965
|
+
this.connected = !1, this.emitter = we();
|
|
2977
2966
|
let { format: r, subprotocol: i, authStrategy: o } = t;
|
|
2978
2967
|
this.format = r || "text", this.connectionOptions = t.websocketOptions, this.authStrategy = o || "param", this.authProtocol = "", this.subprotocol = i;
|
|
2979
2968
|
}
|
|
@@ -2982,7 +2971,7 @@ class Vs {
|
|
|
2982
2971
|
}
|
|
2983
2972
|
open() {
|
|
2984
2973
|
let e = this.subprotocol;
|
|
2985
|
-
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,
|
|
2974
|
+
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) => {
|
|
2986
2975
|
let r = [];
|
|
2987
2976
|
r.push(
|
|
2988
2977
|
this.once("open", () => {
|
|
@@ -2990,7 +2979,7 @@ class Vs {
|
|
|
2990
2979
|
})
|
|
2991
2980
|
), r.push(
|
|
2992
2981
|
this.once("close", () => {
|
|
2993
|
-
r.forEach((i) => i()),
|
|
2982
|
+
r.forEach((i) => i()), n(Error("WS connection closed"));
|
|
2994
2983
|
})
|
|
2995
2984
|
);
|
|
2996
2985
|
});
|
|
@@ -2999,9 +2988,9 @@ class Vs {
|
|
|
2999
2988
|
this.url = e;
|
|
3000
2989
|
}
|
|
3001
2990
|
setParam(e, t) {
|
|
3002
|
-
let
|
|
3003
|
-
|
|
3004
|
-
let r = `${
|
|
2991
|
+
let n = new URL(this.url);
|
|
2992
|
+
n.searchParams.set(e, t);
|
|
2993
|
+
let r = `${n.protocol}//${n.host}${n.pathname}?${n.searchParams}`;
|
|
3005
2994
|
this.setURL(r);
|
|
3006
2995
|
}
|
|
3007
2996
|
setToken(e, t = "jid") {
|
|
@@ -3009,10 +2998,10 @@ class Vs {
|
|
|
3009
2998
|
this.setParam(t, e);
|
|
3010
2999
|
else if (this.authStrategy === "header") {
|
|
3011
3000
|
this.connectionOptions = this.connectionOptions || {}, this.connectionOptions.headers = this.connectionOptions.headers || {};
|
|
3012
|
-
let
|
|
3013
|
-
|
|
3014
|
-
(i) => i.toLowerCase() ===
|
|
3015
|
-
) ||
|
|
3001
|
+
let n = `x-${t}`.toLowerCase();
|
|
3002
|
+
n = Object.keys(this.connectionOptions.headers).find(
|
|
3003
|
+
(i) => i.toLowerCase() === n
|
|
3004
|
+
) || n, this.connectionOptions.headers[n] = e;
|
|
3016
3005
|
} else if (this.authStrategy === "sub-protocol")
|
|
3017
3006
|
this.authProtocol = `anycable-token.${e}`;
|
|
3018
3007
|
else
|
|
@@ -3030,10 +3019,10 @@ class Vs {
|
|
|
3030
3019
|
return this.emitter.on(e, t);
|
|
3031
3020
|
}
|
|
3032
3021
|
once(e, t) {
|
|
3033
|
-
let
|
|
3034
|
-
|
|
3022
|
+
let n = this.emitter.on(e, (...r) => {
|
|
3023
|
+
n(), t(...r);
|
|
3035
3024
|
});
|
|
3036
|
-
return
|
|
3025
|
+
return n;
|
|
3037
3026
|
}
|
|
3038
3027
|
initListeners() {
|
|
3039
3028
|
this.ws.onerror = (e) => {
|
|
@@ -3051,7 +3040,7 @@ class Vs {
|
|
|
3051
3040
|
this.ws.onclose = void 0, this.ws.onmessage = void 0, this.ws.onopen = void 0, this.ws.close(), delete this.ws, this.connected = !1, this.emitter.emit("close");
|
|
3052
3041
|
}
|
|
3053
3042
|
}
|
|
3054
|
-
const
|
|
3043
|
+
const zt = {
|
|
3055
3044
|
protocol: "actioncable-v1-json",
|
|
3056
3045
|
pingInterval: 3e3,
|
|
3057
3046
|
maxReconnectAttempts: 1 / 0,
|
|
@@ -3059,12 +3048,12 @@ const Wt = {
|
|
|
3059
3048
|
logLevel: "warn",
|
|
3060
3049
|
lazy: !0
|
|
3061
3050
|
};
|
|
3062
|
-
function
|
|
3063
|
-
if (typeof
|
|
3064
|
-
e = Object.assign({},
|
|
3051
|
+
function Ms(s, e) {
|
|
3052
|
+
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");
|
|
3053
|
+
e = Object.assign({}, zt, e);
|
|
3065
3054
|
let {
|
|
3066
3055
|
protocol: t,
|
|
3067
|
-
websocketImplementation:
|
|
3056
|
+
websocketImplementation: n,
|
|
3068
3057
|
websocketFormat: r,
|
|
3069
3058
|
websocketOptions: i,
|
|
3070
3059
|
websocketAuthStrategy: o,
|
|
@@ -3090,25 +3079,25 @@ function Js(n, e) {
|
|
|
3090
3079
|
} = e;
|
|
3091
3080
|
if (u = u || new se(h), typeof t == "string") {
|
|
3092
3081
|
E = E || t;
|
|
3093
|
-
let J = t.substring(0, t.lastIndexOf("-")),
|
|
3082
|
+
let J = t.substring(0, t.lastIndexOf("-")), C = t.substring(t.lastIndexOf("-") + 1);
|
|
3094
3083
|
if (x = x || {}, J === "actioncable-v1")
|
|
3095
|
-
t = new
|
|
3084
|
+
t = new Bt({ logger: u, ...x });
|
|
3096
3085
|
else if (J === "actioncable-v1-ext")
|
|
3097
|
-
t = new
|
|
3086
|
+
t = new $s({
|
|
3098
3087
|
logger: u,
|
|
3099
3088
|
historyTimestamp: k,
|
|
3100
3089
|
...x
|
|
3101
3090
|
});
|
|
3102
3091
|
else
|
|
3103
3092
|
throw Error(`Protocol is not supported yet: ${t}`);
|
|
3104
|
-
if (
|
|
3105
|
-
d = d || new
|
|
3106
|
-
else if (
|
|
3093
|
+
if (C === "json")
|
|
3094
|
+
d = d || new Ls(), r = r || "text";
|
|
3095
|
+
else if (C === "msgpack") {
|
|
3107
3096
|
if (r = "binary", !d)
|
|
3108
3097
|
throw Error(
|
|
3109
3098
|
"Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own"
|
|
3110
3099
|
);
|
|
3111
|
-
} else if (
|
|
3100
|
+
} else if (C === "protobuf") {
|
|
3112
3101
|
if (r = r || "binary", !d)
|
|
3113
3102
|
throw Error(
|
|
3114
3103
|
"Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own"
|
|
@@ -3117,20 +3106,20 @@ function Js(n, e) {
|
|
|
3117
3106
|
throw Error(`Protocol is not supported yet: ${t}`);
|
|
3118
3107
|
}
|
|
3119
3108
|
if (!t) throw Error("Protocol must be specified");
|
|
3120
|
-
a = a || new
|
|
3121
|
-
websocketImplementation:
|
|
3109
|
+
a = a || new Bs(s, {
|
|
3110
|
+
websocketImplementation: n,
|
|
3122
3111
|
websocketOptions: i,
|
|
3123
3112
|
subprotocol: E,
|
|
3124
3113
|
authStrategy: o,
|
|
3125
3114
|
format: r
|
|
3126
|
-
}), c && (a = new
|
|
3115
|
+
}), c && (a = new qs([a, ...c], { logger: u })), U && U.token && a.setToken(U.token, U.param || "jid"), m = m || Mt(f), b !== !1 && (b = b || new Ht({
|
|
3127
3116
|
pingInterval: f,
|
|
3128
3117
|
reconnectStrategy: m,
|
|
3129
3118
|
maxMissingPings: p,
|
|
3130
3119
|
maxReconnectAttempts: _,
|
|
3131
3120
|
logger: u
|
|
3132
3121
|
}));
|
|
3133
|
-
let _e = { concurrentSubscribes: P }, L = new
|
|
3122
|
+
let _e = { concurrentSubscribes: P }, L = new Us({
|
|
3134
3123
|
protocol: t,
|
|
3135
3124
|
transport: a,
|
|
3136
3125
|
encoder: d,
|
|
@@ -3140,7 +3129,7 @@ function Js(n, e) {
|
|
|
3140
3129
|
performFailures: I,
|
|
3141
3130
|
transportConfigurator: D
|
|
3142
3131
|
});
|
|
3143
|
-
return b && (b.watch(L), L.monitor = b), S &&
|
|
3132
|
+
return b && (b.watch(L), L.monitor = b), S && Hs(L, async () => {
|
|
3144
3133
|
try {
|
|
3145
3134
|
await S(a);
|
|
3146
3135
|
} catch (J) {
|
|
@@ -3150,19 +3139,19 @@ function Js(n, e) {
|
|
|
3150
3139
|
}), !0;
|
|
3151
3140
|
}), L;
|
|
3152
3141
|
}
|
|
3153
|
-
function
|
|
3142
|
+
function Hs(s, e) {
|
|
3154
3143
|
let t = !1;
|
|
3155
|
-
|
|
3156
|
-
if (
|
|
3144
|
+
s.on("connect", () => t = !1), s.on("close", async (n) => {
|
|
3145
|
+
if (n) {
|
|
3157
3146
|
if (t) {
|
|
3158
|
-
|
|
3147
|
+
s.logger.warn("Token auto-refresh is disabled", n);
|
|
3159
3148
|
return;
|
|
3160
3149
|
}
|
|
3161
|
-
|
|
3150
|
+
n.reason === "token_expired" && (t = !0, await e());
|
|
3162
3151
|
}
|
|
3163
3152
|
});
|
|
3164
3153
|
}
|
|
3165
|
-
class
|
|
3154
|
+
class zs {
|
|
3166
3155
|
constructor(e) {
|
|
3167
3156
|
this.channel = e;
|
|
3168
3157
|
}
|
|
@@ -3182,41 +3171,44 @@ class Ks {
|
|
|
3182
3171
|
return this.channel.disconnect();
|
|
3183
3172
|
}
|
|
3184
3173
|
}
|
|
3185
|
-
class
|
|
3186
|
-
constructor(e, t,
|
|
3187
|
-
super(e, t), this.subscription = new
|
|
3174
|
+
class Vs extends qe {
|
|
3175
|
+
constructor(e, t, n) {
|
|
3176
|
+
super(e, t), this.subscription = new zs(this), Object.assign(this.subscription, n), this.on(
|
|
3177
|
+
"connect",
|
|
3178
|
+
({ reconnect: r }) => this.subscription.notify("connected", { reconnected: r })
|
|
3179
|
+
), this.on(
|
|
3188
3180
|
"disconnect",
|
|
3189
3181
|
() => this.subscription.notify("disconnected", { allowReconnect: !0 })
|
|
3190
3182
|
), this.on("message", (r) => this.subscription.notify("received", r)), this.on("close", (r) => {
|
|
3191
|
-
r && r instanceof
|
|
3183
|
+
r && r instanceof De ? this.subscription.notify("rejected") : this.subscription.notify("disconnected", { allowReconnect: !1 });
|
|
3192
3184
|
});
|
|
3193
3185
|
}
|
|
3194
3186
|
}
|
|
3195
|
-
class
|
|
3187
|
+
class Js {
|
|
3196
3188
|
constructor(e) {
|
|
3197
3189
|
this.cable = e;
|
|
3198
3190
|
}
|
|
3199
3191
|
create(e, t) {
|
|
3200
|
-
let
|
|
3201
|
-
typeof e == "object" ? (
|
|
3202
|
-
let i = new
|
|
3192
|
+
let n, r;
|
|
3193
|
+
typeof e == "object" ? (n = e.channel, delete e.channel, r = e) : (n = e, r = {});
|
|
3194
|
+
let i = new Vs(n, r, t);
|
|
3203
3195
|
return i.subscription.notify("initialized"), this.cable.subscribe(i), i.subscription;
|
|
3204
3196
|
}
|
|
3205
3197
|
findAll(e) {
|
|
3206
3198
|
return this.cable.hub.channels.filter((t) => t.identifier === e).map((t) => t.subscription);
|
|
3207
3199
|
}
|
|
3208
3200
|
}
|
|
3209
|
-
class
|
|
3201
|
+
class Ws {
|
|
3210
3202
|
constructor(e) {
|
|
3211
|
-
this.cable = e, this.subscriptions = new
|
|
3203
|
+
this.cable = e, this.subscriptions = new Js(e);
|
|
3212
3204
|
}
|
|
3213
3205
|
}
|
|
3214
|
-
class
|
|
3215
|
-
writeLogEntry(e, t,
|
|
3216
|
-
|
|
3206
|
+
class Ks extends qt {
|
|
3207
|
+
writeLogEntry(e, t, n) {
|
|
3208
|
+
n ? console[e](t, n) : console[e](t);
|
|
3217
3209
|
}
|
|
3218
3210
|
}
|
|
3219
|
-
class
|
|
3211
|
+
class Xs extends Ht {
|
|
3220
3212
|
watch(e) {
|
|
3221
3213
|
super.watch(e), this.initActivityListeners();
|
|
3222
3214
|
}
|
|
@@ -3226,9 +3218,9 @@ class Ys extends Jt {
|
|
|
3226
3218
|
document.hidden || this.reconnectNow() && this.logger.debug("Trigger reconnect due to visibility change");
|
|
3227
3219
|
}, t = (r) => {
|
|
3228
3220
|
this.reconnectNow() && this.logger.debug("Trigger reconnect", { event: r });
|
|
3229
|
-
},
|
|
3230
|
-
document.addEventListener("visibilitychange", e, !1), window.addEventListener("focus", t, !1), window.addEventListener("online", t, !1), window.addEventListener("resume", t, !1), window.addEventListener("freeze",
|
|
3231
|
-
document.removeEventListener("visibilitychange", e, !1), window.removeEventListener("focus", t, !1), window.removeEventListener("online", t, !1), window.removeEventListener("resume", t, !1), window.removeEventListener("freeze",
|
|
3221
|
+
}, n = () => this.disconnect(new $("page_frozen"));
|
|
3222
|
+
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(() => {
|
|
3223
|
+
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);
|
|
3232
3224
|
});
|
|
3233
3225
|
}
|
|
3234
3226
|
}
|
|
@@ -3236,80 +3228,80 @@ class Ys extends Jt {
|
|
|
3236
3228
|
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));
|
|
3237
3229
|
}
|
|
3238
3230
|
}
|
|
3239
|
-
const
|
|
3240
|
-
for (let t of
|
|
3241
|
-
let
|
|
3242
|
-
if (
|
|
3243
|
-
return
|
|
3231
|
+
const Gs = ["cable", "action-cable"], Zs = "/cable", ye = (s, e) => {
|
|
3232
|
+
for (let t of Gs) {
|
|
3233
|
+
let n = s.head.querySelector(`meta[name='${t}-${e}']`);
|
|
3234
|
+
if (n)
|
|
3235
|
+
return n.getAttribute("content");
|
|
3244
3236
|
}
|
|
3245
|
-
},
|
|
3237
|
+
}, ct = (s) => s.match(/wss?:\/\//) ? s : typeof window < "u" ? `${window.location.protocol.replace("http", "ws")}//${window.location.host}${s}` : s, Qs = () => {
|
|
3246
3238
|
if (typeof document < "u" && document.head) {
|
|
3247
|
-
let
|
|
3248
|
-
if (
|
|
3249
|
-
return
|
|
3239
|
+
let s = ye(document, "url");
|
|
3240
|
+
if (s)
|
|
3241
|
+
return ct(s);
|
|
3250
3242
|
}
|
|
3251
|
-
return
|
|
3252
|
-
},
|
|
3243
|
+
return ct(Zs);
|
|
3244
|
+
}, Ys = () => {
|
|
3253
3245
|
if (typeof document < "u" && document.head) {
|
|
3254
|
-
let
|
|
3255
|
-
if (
|
|
3256
|
-
return
|
|
3246
|
+
let s = ye(document, "history-timestamp");
|
|
3247
|
+
if (s)
|
|
3248
|
+
return s | 0;
|
|
3257
3249
|
}
|
|
3258
|
-
},
|
|
3250
|
+
}, er = () => {
|
|
3259
3251
|
if (typeof document < "u" && document.head)
|
|
3260
|
-
return
|
|
3261
|
-
},
|
|
3252
|
+
return ye(document, "token");
|
|
3253
|
+
}, tr = () => {
|
|
3262
3254
|
if (typeof document < "u" && document.head)
|
|
3263
|
-
return
|
|
3255
|
+
return ye(document, "token-param");
|
|
3264
3256
|
};
|
|
3265
|
-
function
|
|
3266
|
-
typeof
|
|
3267
|
-
let t =
|
|
3257
|
+
function nr(s, e) {
|
|
3258
|
+
typeof s == "object" && typeof e > "u" && (e = s, s = void 0), s = s || Qs(), e = e || {}, e.historyTimestamp || (e.historyTimestamp = Ys());
|
|
3259
|
+
let t = er();
|
|
3268
3260
|
if (t) {
|
|
3269
|
-
let u =
|
|
3261
|
+
let u = tr();
|
|
3270
3262
|
e.auth = Object.assign({ token: t, param: u }, e.auth || {});
|
|
3271
3263
|
}
|
|
3272
|
-
e = Object.assign({},
|
|
3264
|
+
e = Object.assign({}, zt, e);
|
|
3273
3265
|
let {
|
|
3274
|
-
logLevel:
|
|
3266
|
+
logLevel: n,
|
|
3275
3267
|
logger: r,
|
|
3276
3268
|
pingInterval: i,
|
|
3277
3269
|
reconnectStrategy: o,
|
|
3278
3270
|
maxMissingPings: c,
|
|
3279
3271
|
maxReconnectAttempts: h
|
|
3280
3272
|
} = e;
|
|
3281
|
-
return r = e.logger = e.logger || new
|
|
3273
|
+
return r = e.logger = e.logger || new Ks(n), o = e.reconnectStrategy = e.reconnectStrategy || Mt(i), e.monitor !== !1 && (e.monitor = e.monitor || new Xs({
|
|
3282
3274
|
pingInterval: i,
|
|
3283
3275
|
reconnectStrategy: o,
|
|
3284
3276
|
maxMissingPings: c,
|
|
3285
3277
|
maxReconnectAttempts: h,
|
|
3286
3278
|
logger: r
|
|
3287
|
-
})),
|
|
3279
|
+
})), Ms(s, e);
|
|
3288
3280
|
}
|
|
3289
|
-
function
|
|
3290
|
-
let t =
|
|
3291
|
-
return new
|
|
3281
|
+
function sr(s, e) {
|
|
3282
|
+
let t = nr(s, e);
|
|
3283
|
+
return new Ws(t);
|
|
3292
3284
|
}
|
|
3293
|
-
class
|
|
3285
|
+
class li {
|
|
3294
3286
|
constructor(e = "/openc3-api/cable") {
|
|
3295
3287
|
this._cable = null, this._url = e;
|
|
3296
3288
|
}
|
|
3297
3289
|
disconnect() {
|
|
3298
3290
|
this._cable && (this._cable.cable.disconnect(), this._cable = null);
|
|
3299
3291
|
}
|
|
3300
|
-
createSubscription(e, t,
|
|
3292
|
+
createSubscription(e, t, n = {}, r = {}) {
|
|
3301
3293
|
return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(
|
|
3302
3294
|
(i) => {
|
|
3303
3295
|
if (i && OpenC3Auth.setTokens(), this._cable == null) {
|
|
3304
3296
|
let o = this._url + "?scope=" + encodeURIComponent(window.openc3Scope) + "&authorization=" + encodeURIComponent(localStorage.openc3Token);
|
|
3305
|
-
o = new URL(o, document.baseURI).href, this._cable =
|
|
3297
|
+
o = new URL(o, document.baseURI).href, this._cable = sr(o);
|
|
3306
3298
|
}
|
|
3307
3299
|
return this._cable.subscriptions.create(
|
|
3308
3300
|
{
|
|
3309
3301
|
channel: e,
|
|
3310
3302
|
...r
|
|
3311
3303
|
},
|
|
3312
|
-
|
|
3304
|
+
n
|
|
3313
3305
|
);
|
|
3314
3306
|
}
|
|
3315
3307
|
);
|
|
@@ -3317,12 +3309,12 @@ class fi {
|
|
|
3317
3309
|
recordPing() {
|
|
3318
3310
|
}
|
|
3319
3311
|
}
|
|
3320
|
-
class
|
|
3321
|
-
constructor(e, t,
|
|
3322
|
-
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 =
|
|
3312
|
+
class at {
|
|
3313
|
+
constructor(e, t, n = "", r = "") {
|
|
3314
|
+
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;
|
|
3323
3315
|
}
|
|
3324
3316
|
}
|
|
3325
|
-
class
|
|
3317
|
+
class ui {
|
|
3326
3318
|
constructor() {
|
|
3327
3319
|
v(this, "keyword", null);
|
|
3328
3320
|
v(this, "parameters", []);
|
|
@@ -3331,20 +3323,20 @@ class pi {
|
|
|
3331
3323
|
v(this, "lineNumber", 0);
|
|
3332
3324
|
v(this, "url", "https://docs.openc3.com/docs/configuration");
|
|
3333
3325
|
}
|
|
3334
|
-
verify_num_parameters(e, t,
|
|
3326
|
+
verify_num_parameters(e, t, n = "") {
|
|
3335
3327
|
for (let r = 1; r <= e; r++)
|
|
3336
3328
|
if (this.parameters[r - 1] === void 0)
|
|
3337
|
-
throw new
|
|
3329
|
+
throw new at(
|
|
3338
3330
|
this,
|
|
3339
3331
|
`Not enough parameters for ${this.keyword}.`,
|
|
3340
|
-
|
|
3332
|
+
n,
|
|
3341
3333
|
this.url
|
|
3342
3334
|
);
|
|
3343
3335
|
if (t && this.parameters[t] !== void 0)
|
|
3344
|
-
throw new
|
|
3336
|
+
throw new at(
|
|
3345
3337
|
this,
|
|
3346
3338
|
`Too many parameters for ${this.keyword}.`,
|
|
3347
|
-
|
|
3339
|
+
n,
|
|
3348
3340
|
this.url
|
|
3349
3341
|
);
|
|
3350
3342
|
}
|
|
@@ -3354,17 +3346,17 @@ class pi {
|
|
|
3354
3346
|
let t = e.charAt(0);
|
|
3355
3347
|
if (t !== '"' && t !== "'")
|
|
3356
3348
|
return e;
|
|
3357
|
-
let
|
|
3358
|
-
return t !==
|
|
3349
|
+
let n = e.charAt(e.length - 1);
|
|
3350
|
+
return t !== n ? e : e.substring(1, e.length - 1);
|
|
3359
3351
|
}
|
|
3360
3352
|
scan_string(e, t) {
|
|
3361
3353
|
if (!t.global) throw "rx must have 'global' flag set";
|
|
3362
|
-
let
|
|
3354
|
+
let n = [];
|
|
3363
3355
|
return e.replace(t, function(r) {
|
|
3364
|
-
return
|
|
3365
|
-
}),
|
|
3356
|
+
return n.push(r), r;
|
|
3357
|
+
}), n;
|
|
3366
3358
|
}
|
|
3367
|
-
parse_string(e, t,
|
|
3359
|
+
parse_string(e, t, n, r, i) {
|
|
3368
3360
|
let o = !1;
|
|
3369
3361
|
this.line = "", this.keyword = null, this.parameters = [], this.filename = t;
|
|
3370
3362
|
let c = e.split(`
|
|
@@ -3372,8 +3364,10 @@ class pi {
|
|
|
3372
3364
|
for (let u = 0; u < h; u++) {
|
|
3373
3365
|
this.lineNumber = u + 1;
|
|
3374
3366
|
let a = c[u].trim();
|
|
3375
|
-
if (a.length === 0)
|
|
3367
|
+
if (a.length === 0) {
|
|
3368
|
+
n && i(null, [], this.line, this.lineNumber);
|
|
3376
3369
|
continue;
|
|
3370
|
+
}
|
|
3377
3371
|
if (o === !0) {
|
|
3378
3372
|
if (a[0] === "#")
|
|
3379
3373
|
continue;
|
|
@@ -3398,7 +3392,7 @@ class pi {
|
|
|
3398
3392
|
o = !1;
|
|
3399
3393
|
let b = /("([^\\"]|\\.)*")|('([^\\']|\\.)*')|\S+/g, f = this.scan_string(this.line, b), m = "";
|
|
3400
3394
|
if (f.length > 0 && (m = m + f[0]), m.length === 0 || m.charAt(0) === "#" ? this.keyword = null : this.keyword = m.toUpperCase(), this.parameters = [], this.keyword === null) {
|
|
3401
|
-
|
|
3395
|
+
n && i(this.keyword, this.parameters, this.line, this.lineNumber), this.line = "";
|
|
3402
3396
|
continue;
|
|
3403
3397
|
}
|
|
3404
3398
|
let p = f.length;
|
|
@@ -3414,41 +3408,41 @@ class pi {
|
|
|
3414
3408
|
}
|
|
3415
3409
|
// parse_string
|
|
3416
3410
|
}
|
|
3417
|
-
function
|
|
3418
|
-
return
|
|
3411
|
+
function Be(s) {
|
|
3412
|
+
return rr.test(s);
|
|
3419
3413
|
}
|
|
3420
|
-
const
|
|
3421
|
-
function
|
|
3422
|
-
return
|
|
3414
|
+
const rr = /^-?[0-9]+$/;
|
|
3415
|
+
function Vt(s) {
|
|
3416
|
+
return ir.test(s);
|
|
3423
3417
|
}
|
|
3424
|
-
const
|
|
3425
|
-
function
|
|
3426
|
-
const t = Number.parseFloat(
|
|
3427
|
-
return !!(r === i || (e == null ? void 0 : e.approx) === !0 && !
|
|
3418
|
+
const ir = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
3419
|
+
function Jt(s, e) {
|
|
3420
|
+
const t = Number.parseFloat(s), n = String(t), r = lt(s), i = lt(n);
|
|
3421
|
+
return !!(r === i || (e == null ? void 0 : e.approx) === !0 && !Be(s) && i.length >= 14 && r.startsWith(i.substring(0, 14)));
|
|
3428
3422
|
}
|
|
3429
|
-
let Q = /* @__PURE__ */ function(
|
|
3430
|
-
return
|
|
3423
|
+
let Q = /* @__PURE__ */ function(s) {
|
|
3424
|
+
return s.underflow = "underflow", s.overflow = "overflow", s.truncate_integer = "truncate_integer", s.truncate_float = "truncate_float", s;
|
|
3431
3425
|
}({});
|
|
3432
|
-
function
|
|
3433
|
-
if (
|
|
3426
|
+
function or(s) {
|
|
3427
|
+
if (Jt(s, {
|
|
3434
3428
|
approx: !1
|
|
3435
3429
|
}))
|
|
3436
3430
|
return;
|
|
3437
|
-
if (
|
|
3431
|
+
if (Be(s))
|
|
3438
3432
|
return Q.truncate_integer;
|
|
3439
|
-
const e = Number.parseFloat(
|
|
3433
|
+
const e = Number.parseFloat(s);
|
|
3440
3434
|
return Number.isFinite(e) ? e === 0 ? Q.underflow : Q.truncate_float : Q.overflow;
|
|
3441
3435
|
}
|
|
3442
|
-
function
|
|
3443
|
-
return
|
|
3436
|
+
function lt(s) {
|
|
3437
|
+
return s.replace(cr, "").replace(lr, "").replace(ur, "").replace(ar, "");
|
|
3444
3438
|
}
|
|
3445
|
-
const
|
|
3446
|
-
class
|
|
3439
|
+
const cr = /[eE][+-]?\d+$/, ar = /^-?(0*)?/, lr = /\./, ur = /0+$/;
|
|
3440
|
+
class hr {
|
|
3447
3441
|
constructor(e) {
|
|
3448
3442
|
// numeric value as string
|
|
3449
3443
|
// type information
|
|
3450
3444
|
v(this, "isLosslessNumber", !0);
|
|
3451
|
-
if (!
|
|
3445
|
+
if (!Vt(e))
|
|
3452
3446
|
throw new Error(`Invalid number (value: "${e}")`);
|
|
3453
3447
|
this.value = e;
|
|
3454
3448
|
}
|
|
@@ -3464,10 +3458,10 @@ class mr {
|
|
|
3464
3458
|
* and toSafeNumberOrThrow to convert it to a numeric value.
|
|
3465
3459
|
*/
|
|
3466
3460
|
valueOf() {
|
|
3467
|
-
const e =
|
|
3461
|
+
const e = or(this.value);
|
|
3468
3462
|
if (e === void 0 || e === Q.truncate_float)
|
|
3469
3463
|
return Number.parseFloat(this.value);
|
|
3470
|
-
if (
|
|
3464
|
+
if (Be(this.value))
|
|
3471
3465
|
return BigInt(this.value);
|
|
3472
3466
|
throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${Number.parseFloat(this.value)}`);
|
|
3473
3467
|
}
|
|
@@ -3481,45 +3475,45 @@ class mr {
|
|
|
3481
3475
|
// or use that, it cannot safely turn the numeric value in the string into
|
|
3482
3476
|
// stringified JSON since it has to be parsed into a number first.
|
|
3483
3477
|
}
|
|
3484
|
-
function
|
|
3485
|
-
return
|
|
3478
|
+
function dr(s) {
|
|
3479
|
+
return s && typeof s == "object" && s.isLosslessNumber === !0 || !1;
|
|
3486
3480
|
}
|
|
3487
|
-
function
|
|
3488
|
-
return new
|
|
3481
|
+
function fr(s) {
|
|
3482
|
+
return new hr(s);
|
|
3489
3483
|
}
|
|
3490
|
-
function
|
|
3491
|
-
return
|
|
3492
|
-
"":
|
|
3493
|
-
}, "",
|
|
3484
|
+
function pr(s, e) {
|
|
3485
|
+
return Me({
|
|
3486
|
+
"": s
|
|
3487
|
+
}, "", s, e);
|
|
3494
3488
|
}
|
|
3495
|
-
function
|
|
3496
|
-
return Array.isArray(t) ?
|
|
3489
|
+
function Me(s, e, t, n) {
|
|
3490
|
+
return Array.isArray(t) ? n.call(s, e, gr(t, n)) : t && typeof t == "object" && !dr(t) ? n.call(s, e, mr(t, n)) : n.call(s, e, t);
|
|
3497
3491
|
}
|
|
3498
|
-
function
|
|
3499
|
-
for (const t of Object.keys(
|
|
3500
|
-
const
|
|
3501
|
-
|
|
3492
|
+
function mr(s, e) {
|
|
3493
|
+
for (const t of Object.keys(s)) {
|
|
3494
|
+
const n = Me(s, t, s[t], e);
|
|
3495
|
+
n !== void 0 ? s[t] = n : delete s[t];
|
|
3502
3496
|
}
|
|
3503
|
-
return
|
|
3497
|
+
return s;
|
|
3504
3498
|
}
|
|
3505
|
-
function
|
|
3506
|
-
for (let t = 0; t <
|
|
3507
|
-
|
|
3508
|
-
return
|
|
3499
|
+
function gr(s, e) {
|
|
3500
|
+
for (let t = 0; t < s.length; t++)
|
|
3501
|
+
s[t] = Me(s, String(t), s[t], e);
|
|
3502
|
+
return s;
|
|
3509
3503
|
}
|
|
3510
|
-
function
|
|
3511
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
3504
|
+
function br(s, e) {
|
|
3505
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : fr, n = 0;
|
|
3512
3506
|
const r = c();
|
|
3513
|
-
return f(r), p(), e ?
|
|
3507
|
+
return f(r), p(), e ? pr(r, e) : r;
|
|
3514
3508
|
function i() {
|
|
3515
|
-
if (
|
|
3516
|
-
|
|
3517
|
-
const
|
|
3509
|
+
if (s.charCodeAt(n) === xr) {
|
|
3510
|
+
n++, u();
|
|
3511
|
+
const y = {};
|
|
3518
3512
|
let A = !0;
|
|
3519
|
-
for (;
|
|
3513
|
+
for (; n < s.length && s.charCodeAt(n) !== ht; ) {
|
|
3520
3514
|
A ? A = !1 : (g(), u());
|
|
3521
|
-
const q =
|
|
3522
|
-
if (
|
|
3515
|
+
const q = n, G = a();
|
|
3516
|
+
if (G === void 0) {
|
|
3523
3517
|
S();
|
|
3524
3518
|
return;
|
|
3525
3519
|
}
|
|
@@ -3529,158 +3523,158 @@ function Er(n, e) {
|
|
|
3529
3523
|
U();
|
|
3530
3524
|
return;
|
|
3531
3525
|
}
|
|
3532
|
-
Object.prototype.hasOwnProperty.call(
|
|
3526
|
+
Object.prototype.hasOwnProperty.call(y, G) && !ve(Ee, y[G]) && k(G, q + 1), y[G] = Ee;
|
|
3533
3527
|
}
|
|
3534
|
-
return
|
|
3528
|
+
return s.charCodeAt(n) !== ht && x(), n++, y;
|
|
3535
3529
|
}
|
|
3536
3530
|
}
|
|
3537
3531
|
function o() {
|
|
3538
|
-
if (
|
|
3539
|
-
|
|
3540
|
-
const
|
|
3532
|
+
if (s.charCodeAt(n) === Rr) {
|
|
3533
|
+
n++, u();
|
|
3534
|
+
const y = [];
|
|
3541
3535
|
let A = !0;
|
|
3542
|
-
for (;
|
|
3536
|
+
for (; n < s.length && s.charCodeAt(n) !== dt; ) {
|
|
3543
3537
|
A ? A = !1 : g();
|
|
3544
3538
|
const q = c();
|
|
3545
|
-
m(q),
|
|
3539
|
+
m(q), y.push(q);
|
|
3546
3540
|
}
|
|
3547
|
-
return
|
|
3541
|
+
return s.charCodeAt(n) !== dt && P(), n++, y;
|
|
3548
3542
|
}
|
|
3549
3543
|
}
|
|
3550
3544
|
function c() {
|
|
3551
3545
|
u();
|
|
3552
|
-
const
|
|
3553
|
-
return u(),
|
|
3546
|
+
const y = a() ?? d() ?? i() ?? o() ?? h("true", !0) ?? h("false", !1) ?? h("null", null);
|
|
3547
|
+
return u(), y;
|
|
3554
3548
|
}
|
|
3555
|
-
function h(
|
|
3556
|
-
if (
|
|
3557
|
-
return
|
|
3549
|
+
function h(y, A) {
|
|
3550
|
+
if (s.slice(n, n + y.length) === y)
|
|
3551
|
+
return n += y.length, A;
|
|
3558
3552
|
}
|
|
3559
3553
|
function u() {
|
|
3560
|
-
for (;
|
|
3561
|
-
|
|
3554
|
+
for (; wr(s.charCodeAt(n)); )
|
|
3555
|
+
n++;
|
|
3562
3556
|
}
|
|
3563
3557
|
function a() {
|
|
3564
|
-
if (
|
|
3565
|
-
|
|
3566
|
-
let
|
|
3567
|
-
for (;
|
|
3568
|
-
if (
|
|
3569
|
-
const A = n
|
|
3570
|
-
q !== void 0 ? (
|
|
3558
|
+
if (s.charCodeAt(n) === Ae) {
|
|
3559
|
+
n++;
|
|
3560
|
+
let y = "";
|
|
3561
|
+
for (; n < s.length && s.charCodeAt(n) !== Ae; ) {
|
|
3562
|
+
if (s.charCodeAt(n) === Sr) {
|
|
3563
|
+
const A = s[n + 1], q = Er[A];
|
|
3564
|
+
q !== void 0 ? (y += q, n++) : A === "u" ? ie(s.charCodeAt(n + 2)) && ie(s.charCodeAt(n + 3)) && ie(s.charCodeAt(n + 4)) && ie(s.charCodeAt(n + 5)) ? (y += String.fromCharCode(Number.parseInt(s.slice(n + 2, n + 6), 16)), n += 5) : _e(n) : D(n);
|
|
3571
3565
|
} else
|
|
3572
|
-
|
|
3573
|
-
|
|
3566
|
+
_r(s.charCodeAt(n)) ? y += s[n] : I(s[n]);
|
|
3567
|
+
n++;
|
|
3574
3568
|
}
|
|
3575
|
-
return E(),
|
|
3569
|
+
return E(), n++, y;
|
|
3576
3570
|
}
|
|
3577
3571
|
}
|
|
3578
3572
|
function d() {
|
|
3579
|
-
const
|
|
3580
|
-
if (
|
|
3581
|
-
|
|
3582
|
-
else if (
|
|
3583
|
-
for (
|
|
3584
|
-
|
|
3585
|
-
if (
|
|
3586
|
-
for (
|
|
3587
|
-
|
|
3588
|
-
if (
|
|
3589
|
-
for (
|
|
3590
|
-
|
|
3591
|
-
if (
|
|
3592
|
-
return t(
|
|
3573
|
+
const y = n;
|
|
3574
|
+
if (s.charCodeAt(n) === ft && (n++, _(y)), s.charCodeAt(n) === He)
|
|
3575
|
+
n++;
|
|
3576
|
+
else if (yr(s.charCodeAt(n)))
|
|
3577
|
+
for (n++; oe(s.charCodeAt(n)); )
|
|
3578
|
+
n++;
|
|
3579
|
+
if (s.charCodeAt(n) === Ir)
|
|
3580
|
+
for (n++, _(y); oe(s.charCodeAt(n)); )
|
|
3581
|
+
n++;
|
|
3582
|
+
if (s.charCodeAt(n) === Fr || s.charCodeAt(n) === jr)
|
|
3583
|
+
for (n++, (s.charCodeAt(n) === ft || s.charCodeAt(n) === kr) && n++, _(y); oe(s.charCodeAt(n)); )
|
|
3584
|
+
n++;
|
|
3585
|
+
if (n > y)
|
|
3586
|
+
return t(s.slice(y, n));
|
|
3593
3587
|
}
|
|
3594
3588
|
function g() {
|
|
3595
|
-
if (
|
|
3596
|
-
throw new SyntaxError(`Comma ',' expected after value ${
|
|
3597
|
-
|
|
3589
|
+
if (s.charCodeAt(n) !== Pr)
|
|
3590
|
+
throw new SyntaxError(`Comma ',' expected after value ${C()}`);
|
|
3591
|
+
n++;
|
|
3598
3592
|
}
|
|
3599
3593
|
function b() {
|
|
3600
|
-
if (
|
|
3601
|
-
throw new SyntaxError(`Colon ':' expected after property name ${
|
|
3602
|
-
|
|
3594
|
+
if (s.charCodeAt(n) !== Lr)
|
|
3595
|
+
throw new SyntaxError(`Colon ':' expected after property name ${C()}`);
|
|
3596
|
+
n++;
|
|
3603
3597
|
}
|
|
3604
|
-
function f(
|
|
3605
|
-
if (
|
|
3606
|
-
throw new SyntaxError(`JSON value expected ${
|
|
3598
|
+
function f(y) {
|
|
3599
|
+
if (y === void 0)
|
|
3600
|
+
throw new SyntaxError(`JSON value expected ${C()}`);
|
|
3607
3601
|
}
|
|
3608
|
-
function m(
|
|
3609
|
-
if (
|
|
3610
|
-
throw new SyntaxError(`Array item expected ${
|
|
3602
|
+
function m(y) {
|
|
3603
|
+
if (y === void 0)
|
|
3604
|
+
throw new SyntaxError(`Array item expected ${C()}`);
|
|
3611
3605
|
}
|
|
3612
3606
|
function p() {
|
|
3613
|
-
if (
|
|
3614
|
-
throw new SyntaxError(`Expected end of input ${
|
|
3607
|
+
if (n < s.length)
|
|
3608
|
+
throw new SyntaxError(`Expected end of input ${C()}`);
|
|
3615
3609
|
}
|
|
3616
|
-
function _(
|
|
3617
|
-
if (!oe(
|
|
3618
|
-
const A =
|
|
3619
|
-
throw new SyntaxError(`Invalid number '${A}', expecting a digit ${
|
|
3610
|
+
function _(y) {
|
|
3611
|
+
if (!oe(s.charCodeAt(n))) {
|
|
3612
|
+
const A = s.slice(y, n);
|
|
3613
|
+
throw new SyntaxError(`Invalid number '${A}', expecting a digit ${C()}`);
|
|
3620
3614
|
}
|
|
3621
3615
|
}
|
|
3622
3616
|
function E() {
|
|
3623
|
-
if (
|
|
3624
|
-
throw new SyntaxError(`End of string '"' expected ${
|
|
3617
|
+
if (s.charCodeAt(n) !== Ae)
|
|
3618
|
+
throw new SyntaxError(`End of string '"' expected ${C()}`);
|
|
3625
3619
|
}
|
|
3626
3620
|
function S() {
|
|
3627
|
-
throw new SyntaxError(`Quoted object key expected ${
|
|
3621
|
+
throw new SyntaxError(`Quoted object key expected ${C()}`);
|
|
3628
3622
|
}
|
|
3629
|
-
function k(
|
|
3630
|
-
throw new SyntaxError(`Duplicate key '${
|
|
3623
|
+
function k(y, A) {
|
|
3624
|
+
throw new SyntaxError(`Duplicate key '${y}' encountered at position ${A}`);
|
|
3631
3625
|
}
|
|
3632
3626
|
function x() {
|
|
3633
|
-
throw new SyntaxError(`Quoted object key or end of object '}' expected ${
|
|
3627
|
+
throw new SyntaxError(`Quoted object key or end of object '}' expected ${C()}`);
|
|
3634
3628
|
}
|
|
3635
3629
|
function P() {
|
|
3636
|
-
throw new SyntaxError(`Array item or end of array ']' expected ${
|
|
3630
|
+
throw new SyntaxError(`Array item or end of array ']' expected ${C()}`);
|
|
3637
3631
|
}
|
|
3638
|
-
function I(
|
|
3639
|
-
throw new SyntaxError(`Invalid character '${
|
|
3632
|
+
function I(y) {
|
|
3633
|
+
throw new SyntaxError(`Invalid character '${y}' ${L()}`);
|
|
3640
3634
|
}
|
|
3641
|
-
function D(
|
|
3642
|
-
const A =
|
|
3635
|
+
function D(y) {
|
|
3636
|
+
const A = s.slice(y, y + 2);
|
|
3643
3637
|
throw new SyntaxError(`Invalid escape character '${A}' ${L()}`);
|
|
3644
3638
|
}
|
|
3645
3639
|
function U() {
|
|
3646
3640
|
throw new SyntaxError(`Object value expected after ':' ${L()}`);
|
|
3647
3641
|
}
|
|
3648
|
-
function _e(
|
|
3649
|
-
const A =
|
|
3642
|
+
function _e(y) {
|
|
3643
|
+
const A = s.slice(y, y + 6);
|
|
3650
3644
|
throw new SyntaxError(`Invalid unicode character '${A}' ${L()}`);
|
|
3651
3645
|
}
|
|
3652
3646
|
function L() {
|
|
3653
|
-
return `at position ${
|
|
3647
|
+
return `at position ${n}`;
|
|
3654
3648
|
}
|
|
3655
3649
|
function J() {
|
|
3656
|
-
return
|
|
3650
|
+
return n < s.length ? `but got '${s[n]}'` : "but reached end of input";
|
|
3657
3651
|
}
|
|
3658
|
-
function
|
|
3652
|
+
function C() {
|
|
3659
3653
|
return `${J()} ${L()}`;
|
|
3660
3654
|
}
|
|
3661
3655
|
}
|
|
3662
|
-
function
|
|
3663
|
-
return
|
|
3656
|
+
function wr(s) {
|
|
3657
|
+
return s === Ar || s === Or || s === Cr || s === Tr;
|
|
3664
3658
|
}
|
|
3665
|
-
function ie(
|
|
3666
|
-
return
|
|
3659
|
+
function ie(s) {
|
|
3660
|
+
return s >= He && s <= ze || s >= vr && s <= Ur || s >= $r && s <= Dr;
|
|
3667
3661
|
}
|
|
3668
|
-
function oe(
|
|
3669
|
-
return
|
|
3662
|
+
function oe(s) {
|
|
3663
|
+
return s >= He && s <= ze;
|
|
3670
3664
|
}
|
|
3671
|
-
function
|
|
3672
|
-
return
|
|
3665
|
+
function yr(s) {
|
|
3666
|
+
return s >= Nr && s <= ze;
|
|
3673
3667
|
}
|
|
3674
|
-
function
|
|
3675
|
-
return
|
|
3668
|
+
function _r(s) {
|
|
3669
|
+
return s >= 32 && s <= 1114111;
|
|
3676
3670
|
}
|
|
3677
|
-
function
|
|
3678
|
-
return
|
|
3671
|
+
function ve(s, e) {
|
|
3672
|
+
return s === e ? !0 : Array.isArray(s) && Array.isArray(e) ? s.length === e.length && s.every((t, n) => ve(t, e[n])) : ut(s) && ut(e) ? [.../* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(e)])].every((n) => ve(s[n], e[n])) : !1;
|
|
3679
3673
|
}
|
|
3680
|
-
function
|
|
3681
|
-
return typeof
|
|
3674
|
+
function ut(s) {
|
|
3675
|
+
return typeof s == "object" && s !== null;
|
|
3682
3676
|
}
|
|
3683
|
-
const
|
|
3677
|
+
const Er = {
|
|
3684
3678
|
'"': '"',
|
|
3685
3679
|
"\\": "\\",
|
|
3686
3680
|
"/": "/",
|
|
@@ -3691,16 +3685,16 @@ const Ar = {
|
|
|
3691
3685
|
r: "\r",
|
|
3692
3686
|
t: " "
|
|
3693
3687
|
// note that \u is handled separately in parseString()
|
|
3694
|
-
},
|
|
3695
|
-
function
|
|
3688
|
+
}, Sr = 92, xr = 123, ht = 125, Rr = 91, dt = 93, Ar = 32, Or = 10, Cr = 9, Tr = 13, Ae = 34, kr = 43, ft = 45, He = 48, Nr = 49, ze = 57, Pr = 44, Ir = 46, Lr = 58, vr = 65, $r = 97, jr = 69, Fr = 101, Ur = 70, Dr = 102;
|
|
3689
|
+
function Wt(s, e, t, n) {
|
|
3696
3690
|
const r = void 0;
|
|
3697
|
-
return o(
|
|
3691
|
+
return o(s, "");
|
|
3698
3692
|
function o(a, d) {
|
|
3699
|
-
if (Array.isArray(
|
|
3700
|
-
const g =
|
|
3693
|
+
if (Array.isArray(n)) {
|
|
3694
|
+
const g = n.find((b) => b.test(a));
|
|
3701
3695
|
if (g) {
|
|
3702
3696
|
const b = g.stringify(a);
|
|
3703
|
-
if (typeof b != "string" || !
|
|
3697
|
+
if (typeof b != "string" || !Vt(b))
|
|
3704
3698
|
throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${b})`);
|
|
3705
3699
|
return b;
|
|
3706
3700
|
}
|
|
@@ -3730,7 +3724,7 @@ ${d}]` : "]", b;
|
|
|
3730
3724
|
}
|
|
3731
3725
|
function h(a, d) {
|
|
3732
3726
|
if (typeof a.toJSON == "function")
|
|
3733
|
-
return
|
|
3727
|
+
return Wt(a.toJSON(), e, t, void 0);
|
|
3734
3728
|
const g = Array.isArray(e) ? e.map(String) : Object.keys(a);
|
|
3735
3729
|
if (g.length === 0)
|
|
3736
3730
|
return "{}";
|
|
@@ -3753,14 +3747,14 @@ ${d}}` : "}", m;
|
|
|
3753
3747
|
return typeof d < "u" && typeof d != "function" && typeof d != "symbol";
|
|
3754
3748
|
}
|
|
3755
3749
|
}
|
|
3756
|
-
function
|
|
3757
|
-
return
|
|
3750
|
+
function qr(s) {
|
|
3751
|
+
return Jt(s) ? parseFloat(s) : BigInt(s);
|
|
3758
3752
|
}
|
|
3759
|
-
class
|
|
3753
|
+
class hi {
|
|
3760
3754
|
constructor() {
|
|
3761
3755
|
v(this, "id", 1);
|
|
3762
3756
|
}
|
|
3763
|
-
async exec(e, t,
|
|
3757
|
+
async exec(e, t, n = {}, r = {}, i = 6e4) {
|
|
3764
3758
|
try {
|
|
3765
3759
|
await OpenC3Auth.updateToken(
|
|
3766
3760
|
OpenC3Auth.defaultMinValidity
|
|
@@ -3770,14 +3764,14 @@ class mi {
|
|
|
3770
3764
|
}
|
|
3771
3765
|
this.id = this.id + 1;
|
|
3772
3766
|
try {
|
|
3773
|
-
return
|
|
3767
|
+
return n.scope = window.openc3Scope, r.manual = !0, (await Ue.post(
|
|
3774
3768
|
"/openc3-api/api",
|
|
3775
3769
|
{
|
|
3776
3770
|
jsonrpc: "2.0",
|
|
3777
3771
|
method: e,
|
|
3778
3772
|
params: t,
|
|
3779
3773
|
id: this.id,
|
|
3780
|
-
keyword_params:
|
|
3774
|
+
keyword_params: n
|
|
3781
3775
|
},
|
|
3782
3776
|
{
|
|
3783
3777
|
headers: {
|
|
@@ -3787,10 +3781,10 @@ class mi {
|
|
|
3787
3781
|
},
|
|
3788
3782
|
timeout: i,
|
|
3789
3783
|
transformRequest: [
|
|
3790
|
-
(c, h) =>
|
|
3784
|
+
(c, h) => Wt(c)
|
|
3791
3785
|
],
|
|
3792
3786
|
transformResponse: [
|
|
3793
|
-
(c) =>
|
|
3787
|
+
(c) => br(c, void 0, qr)
|
|
3794
3788
|
]
|
|
3795
3789
|
}
|
|
3796
3790
|
)).data.result;
|
|
@@ -3844,11 +3838,11 @@ class mi {
|
|
|
3844
3838
|
disconnect_interface(e) {
|
|
3845
3839
|
return this.exec("disconnect_interface", [e]);
|
|
3846
3840
|
}
|
|
3847
|
-
interface_cmd(e, t, ...
|
|
3841
|
+
interface_cmd(e, t, ...n) {
|
|
3848
3842
|
return this.exec("interface_cmd", [
|
|
3849
3843
|
e,
|
|
3850
3844
|
t,
|
|
3851
|
-
...
|
|
3845
|
+
...n
|
|
3852
3846
|
]);
|
|
3853
3847
|
}
|
|
3854
3848
|
get_all_router_info() {
|
|
@@ -3866,15 +3860,15 @@ class mi {
|
|
|
3866
3860
|
get_tlm_cnts(e) {
|
|
3867
3861
|
return this.exec("get_tlm_cnts", [e]);
|
|
3868
3862
|
}
|
|
3869
|
-
get_item(e, t,
|
|
3870
|
-
return this.exec("get_item", [e, t,
|
|
3863
|
+
get_item(e, t, n) {
|
|
3864
|
+
return this.exec("get_item", [e, t, n]);
|
|
3871
3865
|
}
|
|
3872
|
-
get_param(e, t,
|
|
3873
|
-
return this.exec("get_param", [e, t,
|
|
3866
|
+
get_param(e, t, n) {
|
|
3867
|
+
return this.exec("get_param", [e, t, n]);
|
|
3874
3868
|
}
|
|
3875
3869
|
// DEPRECATED for get_param
|
|
3876
|
-
get_parameter(e, t,
|
|
3877
|
-
return this.exec("get_param", [e, t,
|
|
3870
|
+
get_parameter(e, t, n) {
|
|
3871
|
+
return this.exec("get_param", [e, t, n]);
|
|
3878
3872
|
}
|
|
3879
3873
|
get_limits_sets() {
|
|
3880
3874
|
return this.exec("get_limits_sets", []);
|
|
@@ -3919,9 +3913,12 @@ class mi {
|
|
|
3919
3913
|
get_all_telemetry_names(e) {
|
|
3920
3914
|
return this.exec("get_all_tlm_names", [e]);
|
|
3921
3915
|
}
|
|
3922
|
-
|
|
3916
|
+
get_all_tlm_item_names(e) {
|
|
3917
|
+
return this.exec("get_all_tlm_item_names", [e]);
|
|
3918
|
+
}
|
|
3919
|
+
async get_tlm_packet(e, t, n, r = 30) {
|
|
3923
3920
|
const i = await this.exec("get_tlm_packet", [e, t], {
|
|
3924
|
-
type:
|
|
3921
|
+
type: n,
|
|
3925
3922
|
stale_time: r
|
|
3926
3923
|
});
|
|
3927
3924
|
if (i != null) {
|
|
@@ -3937,11 +3934,11 @@ class mi {
|
|
|
3937
3934
|
get_tlm_buffer(e, t) {
|
|
3938
3935
|
return this.exec("get_tlm_buffer", [e, t]);
|
|
3939
3936
|
}
|
|
3940
|
-
async get_tlm_values(e, t = 30,
|
|
3937
|
+
async get_tlm_values(e, t = 30, n = null) {
|
|
3941
3938
|
let r = {
|
|
3942
3939
|
stale_time: t
|
|
3943
3940
|
};
|
|
3944
|
-
|
|
3941
|
+
n !== null && (r.cache_timeout = n);
|
|
3945
3942
|
const i = await this.exec(
|
|
3946
3943
|
"get_tlm_values",
|
|
3947
3944
|
[e],
|
|
@@ -3955,14 +3952,14 @@ class mi {
|
|
|
3955
3952
|
c = this.decode_openc3_type(i[0][h]), c !== null && (i[0][h] = c);
|
|
3956
3953
|
return i;
|
|
3957
3954
|
}
|
|
3958
|
-
get_limits(e, t,
|
|
3959
|
-
return this.exec("get_limits", [e, t,
|
|
3955
|
+
get_limits(e, t, n) {
|
|
3956
|
+
return this.exec("get_limits", [e, t, n]);
|
|
3960
3957
|
}
|
|
3961
|
-
async tlm(e, t,
|
|
3958
|
+
async tlm(e, t, n, r = "CONVERTED") {
|
|
3962
3959
|
let i = null;
|
|
3963
3960
|
if (t === void 0)
|
|
3964
3961
|
i = await this.exec("tlm", [e]);
|
|
3965
|
-
else if (
|
|
3962
|
+
else if (n === void 0)
|
|
3966
3963
|
if (["RAW", "CONVERTED", "FORMATTED", "WITH_UNITS"].includes(t))
|
|
3967
3964
|
i = await this.exec("tlm", [e], { type: t });
|
|
3968
3965
|
else {
|
|
@@ -3970,32 +3967,32 @@ class mi {
|
|
|
3970
3967
|
throw c.name = "TypeError", c.message = `Invalid data type ${t}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`, c;
|
|
3971
3968
|
}
|
|
3972
3969
|
else
|
|
3973
|
-
i = await this.exec("tlm", [e, t,
|
|
3970
|
+
i = await this.exec("tlm", [e, t, n], {
|
|
3974
3971
|
type: r
|
|
3975
3972
|
});
|
|
3976
3973
|
let o = this.decode_openc3_type(i);
|
|
3977
3974
|
return o !== null && (i = o), i;
|
|
3978
3975
|
}
|
|
3979
|
-
async inject_tlm(e, t,
|
|
3980
|
-
await this.exec("inject_tlm", [e, t,
|
|
3976
|
+
async inject_tlm(e, t, n = null, r = "CONVERTED") {
|
|
3977
|
+
await this.exec("inject_tlm", [e, t, n], {
|
|
3981
3978
|
type: r
|
|
3982
3979
|
});
|
|
3983
3980
|
}
|
|
3984
|
-
set_tlm(e, t,
|
|
3985
|
-
return this.exec("set_tlm", [e, t,
|
|
3981
|
+
set_tlm(e, t, n, r) {
|
|
3982
|
+
return this.exec("set_tlm", [e, t, n], {
|
|
3986
3983
|
type: r
|
|
3987
3984
|
});
|
|
3988
3985
|
}
|
|
3989
|
-
override_tlm(e, t,
|
|
3990
|
-
return this.exec("override_tlm", [e, t,
|
|
3986
|
+
override_tlm(e, t, n, r) {
|
|
3987
|
+
return this.exec("override_tlm", [e, t, n], {
|
|
3991
3988
|
type: r
|
|
3992
3989
|
});
|
|
3993
3990
|
}
|
|
3994
3991
|
get_overrides() {
|
|
3995
3992
|
return this.exec("get_overrides");
|
|
3996
3993
|
}
|
|
3997
|
-
normalize_tlm(e, t,
|
|
3998
|
-
return this.exec("normalize_tlm", [e, t,
|
|
3994
|
+
normalize_tlm(e, t, n, r) {
|
|
3995
|
+
return this.exec("normalize_tlm", [e, t, n], {
|
|
3999
3996
|
type: r
|
|
4000
3997
|
});
|
|
4001
3998
|
}
|
|
@@ -4023,11 +4020,11 @@ class mi {
|
|
|
4023
4020
|
get_cmd_cnts(e) {
|
|
4024
4021
|
return this.exec("get_cmd_cnts", [e]);
|
|
4025
4022
|
}
|
|
4026
|
-
get_cmd_value(e, t,
|
|
4023
|
+
get_cmd_value(e, t, n, r = "CONVERTED") {
|
|
4027
4024
|
return this.exec("get_cmd_value", [
|
|
4028
4025
|
e,
|
|
4029
4026
|
t,
|
|
4030
|
-
|
|
4027
|
+
n,
|
|
4031
4028
|
r
|
|
4032
4029
|
]);
|
|
4033
4030
|
}
|
|
@@ -4035,81 +4032,81 @@ class mi {
|
|
|
4035
4032
|
return this.exec("get_cmd_buffer", [e, t]);
|
|
4036
4033
|
}
|
|
4037
4034
|
// Implementation of functionality shared by cmd methods with param_lists.
|
|
4038
|
-
_cmd(e, t,
|
|
4035
|
+
_cmd(e, t, n, r, i) {
|
|
4039
4036
|
let o = null;
|
|
4040
4037
|
for (let c in r)
|
|
4041
4038
|
Object.prototype.hasOwnProperty.call(r, c) && (o = this.encode_openc3_type(r[c]), o !== null && (r[c] = o));
|
|
4042
4039
|
return this.exec(
|
|
4043
4040
|
e,
|
|
4044
|
-
[t,
|
|
4041
|
+
[t, n, r],
|
|
4045
4042
|
{},
|
|
4046
4043
|
i
|
|
4047
4044
|
);
|
|
4048
4045
|
}
|
|
4049
|
-
get_cmd_hazardous(e, t,
|
|
4046
|
+
get_cmd_hazardous(e, t, n, r = {}) {
|
|
4050
4047
|
return t === void 0 ? this.exec("get_cmd_hazardous", e, {}, r) : this._cmd(
|
|
4051
4048
|
"get_cmd_hazardous",
|
|
4052
4049
|
e,
|
|
4053
4050
|
t,
|
|
4054
|
-
|
|
4051
|
+
n,
|
|
4055
4052
|
r
|
|
4056
4053
|
);
|
|
4057
4054
|
}
|
|
4058
|
-
cmd(e, t,
|
|
4055
|
+
cmd(e, t, n, r = {}) {
|
|
4059
4056
|
return t === void 0 ? this.exec("cmd", e, {}, r) : this._cmd(
|
|
4060
4057
|
"cmd",
|
|
4061
4058
|
e,
|
|
4062
4059
|
t,
|
|
4063
|
-
|
|
4060
|
+
n,
|
|
4064
4061
|
r
|
|
4065
4062
|
);
|
|
4066
4063
|
}
|
|
4067
|
-
cmd_no_range_check(e, t,
|
|
4064
|
+
cmd_no_range_check(e, t, n, r = {}) {
|
|
4068
4065
|
return t === void 0 ? this.exec("cmd_no_range_check", e, {}, r) : this._cmd(
|
|
4069
4066
|
"cmd_no_range_check",
|
|
4070
4067
|
e,
|
|
4071
4068
|
t,
|
|
4072
|
-
|
|
4069
|
+
n,
|
|
4073
4070
|
r
|
|
4074
4071
|
);
|
|
4075
4072
|
}
|
|
4076
|
-
cmd_raw(e, t,
|
|
4073
|
+
cmd_raw(e, t, n, r = {}) {
|
|
4077
4074
|
return t === void 0 ? this.exec("cmd_raw", e, {}, r) : this._cmd(
|
|
4078
4075
|
"cmd_raw",
|
|
4079
4076
|
e,
|
|
4080
4077
|
t,
|
|
4081
|
-
|
|
4078
|
+
n,
|
|
4082
4079
|
r
|
|
4083
4080
|
);
|
|
4084
4081
|
}
|
|
4085
|
-
cmd_raw_no_range_check(e, t,
|
|
4082
|
+
cmd_raw_no_range_check(e, t, n, r = {}) {
|
|
4086
4083
|
return t === void 0 ? this.exec("cmd_raw_no_range_check", e, {}, r) : this._cmd(
|
|
4087
4084
|
"cmd_raw_no_range_check",
|
|
4088
4085
|
e,
|
|
4089
4086
|
t,
|
|
4090
|
-
|
|
4087
|
+
n,
|
|
4091
4088
|
r
|
|
4092
4089
|
);
|
|
4093
4090
|
}
|
|
4094
|
-
cmd_no_hazardous_check(e, t,
|
|
4091
|
+
cmd_no_hazardous_check(e, t, n, r = {}) {
|
|
4095
4092
|
return t === void 0 ? this.exec("cmd_no_hazardous_check", e, {}, r) : this._cmd(
|
|
4096
4093
|
"cmd_no_hazardous_check",
|
|
4097
4094
|
e,
|
|
4098
4095
|
t,
|
|
4099
|
-
|
|
4096
|
+
n,
|
|
4100
4097
|
r
|
|
4101
4098
|
);
|
|
4102
4099
|
}
|
|
4103
|
-
cmd_no_checks(e, t,
|
|
4100
|
+
cmd_no_checks(e, t, n, r = {}) {
|
|
4104
4101
|
return t === void 0 ? this.exec("cmd_no_checks", e, {}, r) : this._cmd(
|
|
4105
4102
|
"cmd_no_checks",
|
|
4106
4103
|
e,
|
|
4107
4104
|
t,
|
|
4108
|
-
|
|
4105
|
+
n,
|
|
4109
4106
|
r
|
|
4110
4107
|
);
|
|
4111
4108
|
}
|
|
4112
|
-
cmd_raw_no_hazardous_check(e, t,
|
|
4109
|
+
cmd_raw_no_hazardous_check(e, t, n, r = {}) {
|
|
4113
4110
|
return t === void 0 ? this.exec(
|
|
4114
4111
|
"cmd_raw_no_hazardous_check",
|
|
4115
4112
|
e,
|
|
@@ -4119,25 +4116,25 @@ class mi {
|
|
|
4119
4116
|
"cmd_raw_no_hazardous_check",
|
|
4120
4117
|
e,
|
|
4121
4118
|
t,
|
|
4122
|
-
|
|
4119
|
+
n,
|
|
4123
4120
|
r
|
|
4124
4121
|
);
|
|
4125
4122
|
}
|
|
4126
|
-
cmd_raw_no_checks(e, t,
|
|
4123
|
+
cmd_raw_no_checks(e, t, n, r = {}) {
|
|
4127
4124
|
return t === void 0 ? this.exec("cmd_raw_no_checks", e, {}, r) : this._cmd(
|
|
4128
4125
|
"cmd_raw_no_checks",
|
|
4129
4126
|
e,
|
|
4130
4127
|
t,
|
|
4131
|
-
|
|
4128
|
+
n,
|
|
4132
4129
|
r
|
|
4133
4130
|
);
|
|
4134
4131
|
}
|
|
4135
|
-
build_cmd(e, t,
|
|
4136
|
-
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t,
|
|
4132
|
+
build_cmd(e, t, n) {
|
|
4133
|
+
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t, n);
|
|
4137
4134
|
}
|
|
4138
4135
|
// DEPRECATED for build_cmd
|
|
4139
|
-
build_command(e, t,
|
|
4140
|
-
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t,
|
|
4136
|
+
build_command(e, t, n) {
|
|
4137
|
+
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t, n);
|
|
4141
4138
|
}
|
|
4142
4139
|
get_interface_names() {
|
|
4143
4140
|
return this.exec("get_interface_names", []);
|
|
@@ -4151,17 +4148,17 @@ class mi {
|
|
|
4151
4148
|
load_config(e, t) {
|
|
4152
4149
|
return this.exec("load_config", [e, t]);
|
|
4153
4150
|
}
|
|
4154
|
-
save_config(e, t,
|
|
4155
|
-
return this.exec("save_config", [e, t,
|
|
4151
|
+
save_config(e, t, n) {
|
|
4152
|
+
return this.exec("save_config", [e, t, n]);
|
|
4156
4153
|
}
|
|
4157
4154
|
delete_config(e, t) {
|
|
4158
4155
|
return this.exec("delete_config", [e, t]);
|
|
4159
4156
|
}
|
|
4160
|
-
enable_limits(e, t,
|
|
4161
|
-
return this.exec("enable_limits", [e, t,
|
|
4157
|
+
enable_limits(e, t, n) {
|
|
4158
|
+
return this.exec("enable_limits", [e, t, n]);
|
|
4162
4159
|
}
|
|
4163
|
-
disable_limits(e, t,
|
|
4164
|
-
return this.exec("disable_limits", [e, t,
|
|
4160
|
+
disable_limits(e, t, n) {
|
|
4161
|
+
return this.exec("disable_limits", [e, t, n]);
|
|
4165
4162
|
}
|
|
4166
4163
|
get_out_of_limits() {
|
|
4167
4164
|
return this.exec("get_out_of_limits", []);
|
|
@@ -4197,20 +4194,20 @@ class mi {
|
|
|
4197
4194
|
// TODO: Currently unused but seemed like a useful function
|
|
4198
4195
|
async hashString(e) {
|
|
4199
4196
|
if (window.isSecureContext) {
|
|
4200
|
-
const t = new TextEncoder().encode(e),
|
|
4197
|
+
const t = new TextEncoder().encode(e), n = await crypto.subtle.digest(
|
|
4201
4198
|
"SHA-256",
|
|
4202
4199
|
t
|
|
4203
|
-
), r = new Uint8Array(
|
|
4200
|
+
), r = new Uint8Array(n);
|
|
4204
4201
|
return Array.from(r).map((i) => i.toString(16).padStart(2, "0")).join("");
|
|
4205
4202
|
}
|
|
4206
4203
|
}
|
|
4207
4204
|
}
|
|
4208
4205
|
export {
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4206
|
+
oi as Api,
|
|
4207
|
+
li as Cable,
|
|
4208
|
+
at as ConfigParserError,
|
|
4209
|
+
ui as ConfigParserService,
|
|
4210
|
+
hi as OpenC3Api,
|
|
4211
|
+
Ue as axios
|
|
4215
4212
|
};
|
|
4216
4213
|
//# sourceMappingURL=services.js.map
|