@asgard-js/core 0.0.4 → 0.0.5
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/README.md +67 -0
- package/dist/constants/enum.d.ts +22 -0
- package/dist/constants/enum.d.ts.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +957 -884
- package/dist/index.mjs.map +1 -1
- package/dist/lib/channel.d.ts +19 -0
- package/dist/lib/channel.d.ts.map +1 -0
- package/dist/lib/client.d.ts +12 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/conversation.d.ts +20 -0
- package/dist/lib/conversation.d.ts.map +1 -0
- package/dist/lib/create-sse-observable.d.ts +12 -0
- package/dist/lib/create-sse-observable.d.ts.map +1 -0
- package/dist/types/channel.d.ts +35 -0
- package/dist/types/channel.d.ts.map +1 -0
- package/dist/types/client.d.ts +25 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/sse-response.d.ts +94 -0
- package/dist/types/sse-response.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var m = (t,
|
|
4
|
-
var H = /* @__PURE__ */ ((t) => (t.RESET_CHANNEL = "RESET_CHANNEL", t.NONE = "NONE", t))(H || {}),
|
|
5
|
-
return
|
|
6
|
-
e.__proto__ =
|
|
7
|
-
} || function(e,
|
|
8
|
-
for (var i in
|
|
9
|
-
},
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
|
+
var $e = (t, r, e) => r in t ? Le(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var m = (t, r, e) => $e(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
var H = /* @__PURE__ */ ((t) => (t.RESET_CHANNEL = "RESET_CHANNEL", t.NONE = "NONE", t))(H || {}), O = /* @__PURE__ */ ((t) => (t.INIT = "asgard.run.init", t.MESSAGE_START = "asgard.message.start", t.MESSAGE_DELTA = "asgard.message.delta", t.MESSAGE_COMPLETE = "asgard.message.complete", t.DONE = "asgard.run.done", t))(O || {}), Re = /* @__PURE__ */ ((t) => (t.TEXT = "TEXT", t.HINT = "HINT", t.BUTTON = "BUTTON", t.IMAGE = "IMAGE", t.VIDEO = "VIDEO", t.AUDIO = "AUDIO", t.LOCATION = "LOCATION", t.CAROUSEL = "CAROUSEL", t))(Re || {}), q = function(t, r) {
|
|
5
|
+
return q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
|
|
6
|
+
e.__proto__ = n;
|
|
7
|
+
} || function(e, n) {
|
|
8
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
|
|
9
|
+
}, q(t, r);
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
if (typeof
|
|
13
|
-
throw new TypeError("Class extends value " + String(
|
|
14
|
-
|
|
11
|
+
function E(t, r) {
|
|
12
|
+
if (typeof r != "function" && r !== null)
|
|
13
|
+
throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
|
|
14
|
+
q(t, r);
|
|
15
15
|
function e() {
|
|
16
16
|
this.constructor = t;
|
|
17
17
|
}
|
|
18
|
-
t.prototype =
|
|
18
|
+
t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
function i(
|
|
22
|
-
return
|
|
23
|
-
o
|
|
20
|
+
function Ue(t, r, e, n) {
|
|
21
|
+
function i(o) {
|
|
22
|
+
return o instanceof e ? o : new e(function(s) {
|
|
23
|
+
s(o);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
return new (e || (e = Promise))(function(
|
|
27
|
-
function
|
|
26
|
+
return new (e || (e = Promise))(function(o, s) {
|
|
27
|
+
function c(f) {
|
|
28
28
|
try {
|
|
29
|
-
a(
|
|
30
|
-
} catch (
|
|
31
|
-
|
|
29
|
+
a(n.next(f));
|
|
30
|
+
} catch (d) {
|
|
31
|
+
s(d);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function u(f) {
|
|
35
35
|
try {
|
|
36
|
-
a(
|
|
37
|
-
} catch (
|
|
38
|
-
|
|
36
|
+
a(n.throw(f));
|
|
37
|
+
} catch (d) {
|
|
38
|
+
s(d);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function a(
|
|
42
|
-
|
|
41
|
+
function a(f) {
|
|
42
|
+
f.done ? o(f.value) : i(f.value).then(c, u);
|
|
43
43
|
}
|
|
44
|
-
a((
|
|
44
|
+
a((n = n.apply(t, r || [])).next());
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ue(t, r) {
|
|
48
48
|
var e = { label: 0, sent: function() {
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
51
|
-
}, trys: [], ops: [] },
|
|
52
|
-
return
|
|
49
|
+
if (o[0] & 1) throw o[1];
|
|
50
|
+
return o[1];
|
|
51
|
+
}, trys: [], ops: [] }, n, i, o, s = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
52
|
+
return s.next = c(0), s.throw = c(1), s.return = c(2), typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
53
53
|
return this;
|
|
54
|
-
}),
|
|
55
|
-
function
|
|
56
|
-
return function(
|
|
57
|
-
return
|
|
54
|
+
}), s;
|
|
55
|
+
function c(a) {
|
|
56
|
+
return function(f) {
|
|
57
|
+
return u([a, f]);
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
if (
|
|
62
|
-
for (;
|
|
63
|
-
if (
|
|
64
|
-
switch (i = 0,
|
|
60
|
+
function u(a) {
|
|
61
|
+
if (n) throw new TypeError("Generator is already executing.");
|
|
62
|
+
for (; s && (s = 0, a[0] && (e = 0)), e; ) try {
|
|
63
|
+
if (n = 1, i && (o = a[0] & 2 ? i.return : a[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, a[1])).done) return o;
|
|
64
|
+
switch (i = 0, o && (a = [a[0] & 2, o.value]), a[0]) {
|
|
65
65
|
case 0:
|
|
66
66
|
case 1:
|
|
67
|
-
|
|
67
|
+
o = a;
|
|
68
68
|
break;
|
|
69
69
|
case 4:
|
|
70
70
|
return e.label++, { value: a[1], done: !1 };
|
|
@@ -75,480 +75,475 @@ function ae(t, n) {
|
|
|
75
75
|
a = e.ops.pop(), e.trys.pop();
|
|
76
76
|
continue;
|
|
77
77
|
default:
|
|
78
|
-
if (
|
|
78
|
+
if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (a[0] === 6 || a[0] === 2)) {
|
|
79
79
|
e = 0;
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
|
-
if (a[0] === 3 && (!
|
|
82
|
+
if (a[0] === 3 && (!o || a[1] > o[0] && a[1] < o[3])) {
|
|
83
83
|
e.label = a[1];
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
|
-
if (a[0] === 6 && e.label <
|
|
87
|
-
e.label =
|
|
86
|
+
if (a[0] === 6 && e.label < o[1]) {
|
|
87
|
+
e.label = o[1], o = a;
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
|
-
if (
|
|
91
|
-
e.label =
|
|
90
|
+
if (o && e.label < o[2]) {
|
|
91
|
+
e.label = o[2], e.ops.push(a);
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
o[2] && e.ops.pop(), e.trys.pop();
|
|
95
95
|
continue;
|
|
96
96
|
}
|
|
97
|
-
a =
|
|
98
|
-
} catch (
|
|
99
|
-
a = [6,
|
|
97
|
+
a = r.call(t, e);
|
|
98
|
+
} catch (f) {
|
|
99
|
+
a = [6, f], i = 0;
|
|
100
100
|
} finally {
|
|
101
|
-
|
|
101
|
+
n = o = 0;
|
|
102
102
|
}
|
|
103
103
|
if (a[0] & 5) throw a[1];
|
|
104
104
|
return { value: a[0] ? a[1] : void 0, done: !0 };
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
var
|
|
107
|
+
function P(t) {
|
|
108
|
+
var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], n = 0;
|
|
109
109
|
if (e) return e.call(t);
|
|
110
110
|
if (t && typeof t.length == "number") return {
|
|
111
111
|
next: function() {
|
|
112
|
-
return t &&
|
|
112
|
+
return t && n >= t.length && (t = void 0), { value: t && t[n++], done: !t };
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
throw new TypeError(
|
|
115
|
+
throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function M(t, r) {
|
|
118
118
|
var e = typeof Symbol == "function" && t[Symbol.iterator];
|
|
119
119
|
if (!e) return t;
|
|
120
|
-
var
|
|
120
|
+
var n = e.call(t), i, o = [], s;
|
|
121
121
|
try {
|
|
122
|
-
for (; (
|
|
123
|
-
} catch (
|
|
124
|
-
|
|
122
|
+
for (; (r === void 0 || r-- > 0) && !(i = n.next()).done; ) o.push(i.value);
|
|
123
|
+
} catch (c) {
|
|
124
|
+
s = { error: c };
|
|
125
125
|
} finally {
|
|
126
126
|
try {
|
|
127
|
-
i && !i.done && (e =
|
|
127
|
+
i && !i.done && (e = n.return) && e.call(n);
|
|
128
128
|
} finally {
|
|
129
|
-
if (
|
|
129
|
+
if (s) throw s.error;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
return
|
|
132
|
+
return o;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
if (e || arguments.length === 2) for (var
|
|
136
|
-
(
|
|
137
|
-
return t.concat(
|
|
134
|
+
function k(t, r, e) {
|
|
135
|
+
if (e || arguments.length === 2) for (var n = 0, i = r.length, o; n < i; n++)
|
|
136
|
+
(o || !(n in r)) && (o || (o = Array.prototype.slice.call(r, 0, n)), o[n] = r[n]);
|
|
137
|
+
return t.concat(o || Array.prototype.slice.call(r));
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return this instanceof
|
|
139
|
+
function T(t) {
|
|
140
|
+
return this instanceof T ? (this.v = t, this) : new T(t);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Ne(t, r, e) {
|
|
143
143
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
144
|
-
var
|
|
145
|
-
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype),
|
|
144
|
+
var n = e.apply(t, r || []), i, o = [];
|
|
145
|
+
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), c("next"), c("throw"), c("return", s), i[Symbol.asyncIterator] = function() {
|
|
146
146
|
return this;
|
|
147
147
|
}, i;
|
|
148
|
-
function
|
|
149
|
-
return function(
|
|
150
|
-
return Promise.resolve(
|
|
148
|
+
function s(l) {
|
|
149
|
+
return function(v) {
|
|
150
|
+
return Promise.resolve(v).then(l, d);
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
return new Promise(function(
|
|
156
|
-
|
|
153
|
+
function c(l, v) {
|
|
154
|
+
n[l] && (i[l] = function(h) {
|
|
155
|
+
return new Promise(function(g, w) {
|
|
156
|
+
o.push([l, h, g, w]) > 1 || u(l, h);
|
|
157
157
|
});
|
|
158
|
-
},
|
|
158
|
+
}, v && (i[l] = v(i[l])));
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function u(l, v) {
|
|
161
161
|
try {
|
|
162
|
-
a(
|
|
163
|
-
} catch (
|
|
164
|
-
|
|
162
|
+
a(n[l](v));
|
|
163
|
+
} catch (h) {
|
|
164
|
+
p(o[0][3], h);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function a(
|
|
168
|
-
|
|
167
|
+
function a(l) {
|
|
168
|
+
l.value instanceof T ? Promise.resolve(l.value.v).then(f, d) : p(o[0][2], l);
|
|
169
169
|
}
|
|
170
|
-
function l
|
|
171
|
-
|
|
170
|
+
function f(l) {
|
|
171
|
+
u("next", l);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
173
|
+
function d(l) {
|
|
174
|
+
u("throw", l);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
|
|
176
|
+
function p(l, v) {
|
|
177
|
+
l(v), o.shift(), o.length && u(o[0][0], o[0][1]);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function Ge(t) {
|
|
181
181
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
182
|
-
var
|
|
183
|
-
return
|
|
182
|
+
var r = t[Symbol.asyncIterator], e;
|
|
183
|
+
return r ? r.call(t) : (t = typeof P == "function" ? P(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
|
|
184
184
|
return this;
|
|
185
185
|
}, e);
|
|
186
|
-
function
|
|
187
|
-
e[
|
|
188
|
-
return new Promise(function(
|
|
189
|
-
|
|
186
|
+
function n(o) {
|
|
187
|
+
e[o] = t[o] && function(s) {
|
|
188
|
+
return new Promise(function(c, u) {
|
|
189
|
+
s = t[o](s), i(c, u, s.done, s.value);
|
|
190
190
|
});
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function i(
|
|
194
|
-
Promise.resolve(
|
|
195
|
-
|
|
196
|
-
},
|
|
193
|
+
function i(o, s, c, u) {
|
|
194
|
+
Promise.resolve(u).then(function(a) {
|
|
195
|
+
o({ value: a, done: c });
|
|
196
|
+
}, s);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function y(t) {
|
|
200
200
|
return typeof t == "function";
|
|
201
201
|
}
|
|
202
202
|
function ce(t) {
|
|
203
|
-
var
|
|
204
|
-
Error.call(
|
|
205
|
-
}, e = t(
|
|
203
|
+
var r = function(n) {
|
|
204
|
+
Error.call(n), n.stack = new Error().stack;
|
|
205
|
+
}, e = t(r);
|
|
206
206
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
207
207
|
}
|
|
208
208
|
var K = ce(function(t) {
|
|
209
209
|
return function(e) {
|
|
210
210
|
t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
211
|
-
` + e.map(function(
|
|
212
|
-
return i + 1 + ") " +
|
|
211
|
+
` + e.map(function(n, i) {
|
|
212
|
+
return i + 1 + ") " + n.toString();
|
|
213
213
|
}).join(`
|
|
214
214
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
215
215
|
};
|
|
216
216
|
});
|
|
217
|
-
function R(t,
|
|
217
|
+
function R(t, r) {
|
|
218
218
|
if (t) {
|
|
219
|
-
var e = t.indexOf(
|
|
219
|
+
var e = t.indexOf(r);
|
|
220
220
|
0 <= e && t.splice(e, 1);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
var
|
|
224
|
-
function t(
|
|
225
|
-
this.initialTeardown =
|
|
223
|
+
var j = function() {
|
|
224
|
+
function t(r) {
|
|
225
|
+
this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
226
226
|
}
|
|
227
227
|
return t.prototype.unsubscribe = function() {
|
|
228
|
-
var
|
|
228
|
+
var r, e, n, i, o;
|
|
229
229
|
if (!this.closed) {
|
|
230
230
|
this.closed = !0;
|
|
231
|
-
var
|
|
232
|
-
if (
|
|
233
|
-
if (this._parentage = null, Array.isArray(
|
|
231
|
+
var s = this._parentage;
|
|
232
|
+
if (s)
|
|
233
|
+
if (this._parentage = null, Array.isArray(s))
|
|
234
234
|
try {
|
|
235
|
-
for (var
|
|
236
|
-
var a =
|
|
235
|
+
for (var c = P(s), u = c.next(); !u.done; u = c.next()) {
|
|
236
|
+
var a = u.value;
|
|
237
237
|
a.remove(this);
|
|
238
238
|
}
|
|
239
|
-
} catch (
|
|
240
|
-
|
|
239
|
+
} catch (h) {
|
|
240
|
+
r = { error: h };
|
|
241
241
|
} finally {
|
|
242
242
|
try {
|
|
243
|
-
|
|
243
|
+
u && !u.done && (e = c.return) && e.call(c);
|
|
244
244
|
} finally {
|
|
245
|
-
if (
|
|
245
|
+
if (r) throw r.error;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
else
|
|
249
|
-
|
|
250
|
-
var
|
|
251
|
-
if (
|
|
249
|
+
s.remove(this);
|
|
250
|
+
var f = this.initialTeardown;
|
|
251
|
+
if (y(f))
|
|
252
252
|
try {
|
|
253
|
-
|
|
254
|
-
} catch (
|
|
255
|
-
|
|
253
|
+
f();
|
|
254
|
+
} catch (h) {
|
|
255
|
+
o = h instanceof K ? h.errors : [h];
|
|
256
256
|
}
|
|
257
|
-
var
|
|
258
|
-
if (
|
|
257
|
+
var d = this._finalizers;
|
|
258
|
+
if (d) {
|
|
259
259
|
this._finalizers = null;
|
|
260
260
|
try {
|
|
261
|
-
for (var
|
|
262
|
-
var
|
|
261
|
+
for (var p = P(d), l = p.next(); !l.done; l = p.next()) {
|
|
262
|
+
var v = l.value;
|
|
263
263
|
try {
|
|
264
|
-
|
|
265
|
-
} catch (
|
|
266
|
-
|
|
264
|
+
Z(v);
|
|
265
|
+
} catch (h) {
|
|
266
|
+
o = o ?? [], h instanceof K ? o = k(k([], M(o)), M(h.errors)) : o.push(h);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
} catch (
|
|
270
|
-
|
|
269
|
+
} catch (h) {
|
|
270
|
+
n = { error: h };
|
|
271
271
|
} finally {
|
|
272
272
|
try {
|
|
273
|
-
|
|
273
|
+
l && !l.done && (i = p.return) && i.call(p);
|
|
274
274
|
} finally {
|
|
275
|
-
if (
|
|
275
|
+
if (n) throw n.error;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
if (
|
|
280
|
-
throw new K(
|
|
279
|
+
if (o)
|
|
280
|
+
throw new K(o);
|
|
281
281
|
}
|
|
282
|
-
}, t.prototype.add = function(
|
|
282
|
+
}, t.prototype.add = function(r) {
|
|
283
283
|
var e;
|
|
284
|
-
if (
|
|
284
|
+
if (r && r !== this)
|
|
285
285
|
if (this.closed)
|
|
286
|
-
|
|
286
|
+
Z(r);
|
|
287
287
|
else {
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
288
|
+
if (r instanceof t) {
|
|
289
|
+
if (r.closed || r._hasParent(this))
|
|
290
290
|
return;
|
|
291
|
-
|
|
291
|
+
r._addParent(this);
|
|
292
292
|
}
|
|
293
|
-
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(
|
|
293
|
+
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(r);
|
|
294
294
|
}
|
|
295
|
-
}, t.prototype._hasParent = function(
|
|
295
|
+
}, t.prototype._hasParent = function(r) {
|
|
296
296
|
var e = this._parentage;
|
|
297
|
-
return e ===
|
|
298
|
-
}, t.prototype._addParent = function(
|
|
297
|
+
return e === r || Array.isArray(e) && e.includes(r);
|
|
298
|
+
}, t.prototype._addParent = function(r) {
|
|
299
299
|
var e = this._parentage;
|
|
300
|
-
this._parentage = Array.isArray(e) ? (e.push(
|
|
301
|
-
}, t.prototype._removeParent = function(
|
|
300
|
+
this._parentage = Array.isArray(e) ? (e.push(r), e) : e ? [e, r] : r;
|
|
301
|
+
}, t.prototype._removeParent = function(r) {
|
|
302
302
|
var e = this._parentage;
|
|
303
|
-
e ===
|
|
304
|
-
}, t.prototype.remove = function(
|
|
303
|
+
e === r ? this._parentage = null : Array.isArray(e) && R(e, r);
|
|
304
|
+
}, t.prototype.remove = function(r) {
|
|
305
305
|
var e = this._finalizers;
|
|
306
|
-
e && R(e,
|
|
306
|
+
e && R(e, r), r instanceof t && r._removeParent(this);
|
|
307
307
|
}, t.EMPTY = function() {
|
|
308
|
-
var
|
|
309
|
-
return
|
|
308
|
+
var r = new t();
|
|
309
|
+
return r.closed = !0, r;
|
|
310
310
|
}(), t;
|
|
311
|
-
}(),
|
|
312
|
-
function
|
|
313
|
-
return t instanceof
|
|
314
|
-
}
|
|
315
|
-
function
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
var
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
setTimeout: function(t, n) {
|
|
326
|
-
for (var e = [], r = 2; r < arguments.length; r++)
|
|
327
|
-
e[r - 2] = arguments[r];
|
|
328
|
-
return setTimeout.apply(void 0, N([t, n], U(e)));
|
|
311
|
+
}(), le = j.EMPTY;
|
|
312
|
+
function fe(t) {
|
|
313
|
+
return t instanceof j || t && "closed" in t && y(t.remove) && y(t.add) && y(t.unsubscribe);
|
|
314
|
+
}
|
|
315
|
+
function Z(t) {
|
|
316
|
+
y(t) ? t() : t.unsubscribe();
|
|
317
|
+
}
|
|
318
|
+
var Fe = {
|
|
319
|
+
Promise: void 0
|
|
320
|
+
}, Ve = {
|
|
321
|
+
setTimeout: function(t, r) {
|
|
322
|
+
for (var e = [], n = 2; n < arguments.length; n++)
|
|
323
|
+
e[n - 2] = arguments[n];
|
|
324
|
+
return setTimeout.apply(void 0, k([t, r], M(e)));
|
|
329
325
|
},
|
|
330
326
|
clearTimeout: function(t) {
|
|
331
|
-
|
|
332
|
-
return ((n == null ? void 0 : n.clearTimeout) || clearTimeout)(t);
|
|
327
|
+
return clearTimeout(t);
|
|
333
328
|
},
|
|
334
329
|
delegate: void 0
|
|
335
330
|
};
|
|
336
331
|
function he(t) {
|
|
337
|
-
|
|
332
|
+
Ve.setTimeout(function() {
|
|
338
333
|
throw t;
|
|
339
334
|
});
|
|
340
335
|
}
|
|
341
|
-
function
|
|
336
|
+
function B() {
|
|
342
337
|
}
|
|
343
|
-
function
|
|
338
|
+
function $(t) {
|
|
344
339
|
t();
|
|
345
340
|
}
|
|
346
|
-
var
|
|
347
|
-
|
|
348
|
-
function
|
|
349
|
-
var
|
|
350
|
-
return
|
|
341
|
+
var J = function(t) {
|
|
342
|
+
E(r, t);
|
|
343
|
+
function r(e) {
|
|
344
|
+
var n = t.call(this) || this;
|
|
345
|
+
return n.isStopped = !1, e ? (n.destination = e, fe(e) && e.add(n)) : n.destination = qe, n;
|
|
351
346
|
}
|
|
352
|
-
return
|
|
353
|
-
return new
|
|
354
|
-
},
|
|
347
|
+
return r.create = function(e, n, i) {
|
|
348
|
+
return new Y(e, n, i);
|
|
349
|
+
}, r.prototype.next = function(e) {
|
|
355
350
|
this.isStopped || this._next(e);
|
|
356
|
-
},
|
|
351
|
+
}, r.prototype.error = function(e) {
|
|
357
352
|
this.isStopped || (this.isStopped = !0, this._error(e));
|
|
358
|
-
},
|
|
353
|
+
}, r.prototype.complete = function() {
|
|
359
354
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
360
|
-
},
|
|
355
|
+
}, r.prototype.unsubscribe = function() {
|
|
361
356
|
this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this), this.destination = null);
|
|
362
|
-
},
|
|
357
|
+
}, r.prototype._next = function(e) {
|
|
363
358
|
this.destination.next(e);
|
|
364
|
-
},
|
|
359
|
+
}, r.prototype._error = function(e) {
|
|
365
360
|
try {
|
|
366
361
|
this.destination.error(e);
|
|
367
362
|
} finally {
|
|
368
363
|
this.unsubscribe();
|
|
369
364
|
}
|
|
370
|
-
},
|
|
365
|
+
}, r.prototype._complete = function() {
|
|
371
366
|
try {
|
|
372
367
|
this.destination.complete();
|
|
373
368
|
} finally {
|
|
374
369
|
this.unsubscribe();
|
|
375
370
|
}
|
|
376
|
-
},
|
|
377
|
-
}(
|
|
378
|
-
function t(
|
|
379
|
-
this.partialObserver =
|
|
371
|
+
}, r;
|
|
372
|
+
}(j), Ke = function() {
|
|
373
|
+
function t(r) {
|
|
374
|
+
this.partialObserver = r;
|
|
380
375
|
}
|
|
381
|
-
return t.prototype.next = function(
|
|
376
|
+
return t.prototype.next = function(r) {
|
|
382
377
|
var e = this.partialObserver;
|
|
383
378
|
if (e.next)
|
|
384
379
|
try {
|
|
385
|
-
e.next(
|
|
386
|
-
} catch (
|
|
387
|
-
|
|
380
|
+
e.next(r);
|
|
381
|
+
} catch (n) {
|
|
382
|
+
L(n);
|
|
388
383
|
}
|
|
389
|
-
}, t.prototype.error = function(
|
|
384
|
+
}, t.prototype.error = function(r) {
|
|
390
385
|
var e = this.partialObserver;
|
|
391
386
|
if (e.error)
|
|
392
387
|
try {
|
|
393
|
-
e.error(
|
|
394
|
-
} catch (
|
|
395
|
-
|
|
388
|
+
e.error(r);
|
|
389
|
+
} catch (n) {
|
|
390
|
+
L(n);
|
|
396
391
|
}
|
|
397
392
|
else
|
|
398
|
-
|
|
393
|
+
L(r);
|
|
399
394
|
}, t.prototype.complete = function() {
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
395
|
+
var r = this.partialObserver;
|
|
396
|
+
if (r.complete)
|
|
402
397
|
try {
|
|
403
|
-
|
|
398
|
+
r.complete();
|
|
404
399
|
} catch (e) {
|
|
405
|
-
|
|
400
|
+
L(e);
|
|
406
401
|
}
|
|
407
402
|
}, t;
|
|
408
|
-
}(),
|
|
409
|
-
|
|
410
|
-
function
|
|
411
|
-
var
|
|
412
|
-
return
|
|
403
|
+
}(), Y = function(t) {
|
|
404
|
+
E(r, t);
|
|
405
|
+
function r(e, n, i) {
|
|
406
|
+
var o = t.call(this) || this, s;
|
|
407
|
+
return y(e) || !e ? s = {
|
|
413
408
|
next: e ?? void 0,
|
|
414
|
-
error:
|
|
409
|
+
error: n ?? void 0,
|
|
415
410
|
complete: i ?? void 0
|
|
416
|
-
} :
|
|
411
|
+
} : s = e, o.destination = new Ke(s), o;
|
|
417
412
|
}
|
|
418
|
-
return
|
|
419
|
-
}(
|
|
420
|
-
function
|
|
413
|
+
return r;
|
|
414
|
+
}(J);
|
|
415
|
+
function L(t) {
|
|
421
416
|
he(t);
|
|
422
417
|
}
|
|
423
|
-
function
|
|
418
|
+
function He(t) {
|
|
424
419
|
throw t;
|
|
425
420
|
}
|
|
426
|
-
var
|
|
421
|
+
var qe = {
|
|
427
422
|
closed: !0,
|
|
428
|
-
next:
|
|
429
|
-
error:
|
|
430
|
-
complete:
|
|
423
|
+
next: B,
|
|
424
|
+
error: He,
|
|
425
|
+
complete: B
|
|
431
426
|
}, X = function() {
|
|
432
427
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
433
428
|
}();
|
|
434
|
-
function
|
|
429
|
+
function N(t) {
|
|
435
430
|
return t;
|
|
436
431
|
}
|
|
437
|
-
function
|
|
438
|
-
return t.length === 0 ?
|
|
439
|
-
return t.reduce(function(
|
|
440
|
-
return i(
|
|
432
|
+
function Be(t) {
|
|
433
|
+
return t.length === 0 ? N : t.length === 1 ? t[0] : function(e) {
|
|
434
|
+
return t.reduce(function(n, i) {
|
|
435
|
+
return i(n);
|
|
441
436
|
}, e);
|
|
442
437
|
};
|
|
443
438
|
}
|
|
444
|
-
var
|
|
445
|
-
function t(
|
|
446
|
-
|
|
439
|
+
var b = function() {
|
|
440
|
+
function t(r) {
|
|
441
|
+
r && (this._subscribe = r);
|
|
447
442
|
}
|
|
448
|
-
return t.prototype.lift = function(
|
|
443
|
+
return t.prototype.lift = function(r) {
|
|
449
444
|
var e = new t();
|
|
450
|
-
return e.source = this, e.operator =
|
|
451
|
-
}, t.prototype.subscribe = function(
|
|
452
|
-
var i = this,
|
|
453
|
-
return
|
|
454
|
-
var
|
|
455
|
-
|
|
456
|
-
}),
|
|
457
|
-
}, t.prototype._trySubscribe = function(
|
|
445
|
+
return e.source = this, e.operator = r, e;
|
|
446
|
+
}, t.prototype.subscribe = function(r, e, n) {
|
|
447
|
+
var i = this, o = We(r) ? r : new Y(r, e, n);
|
|
448
|
+
return $(function() {
|
|
449
|
+
var s = i, c = s.operator, u = s.source;
|
|
450
|
+
o.add(c ? c.call(o, u) : u ? i._subscribe(o) : i._trySubscribe(o));
|
|
451
|
+
}), o;
|
|
452
|
+
}, t.prototype._trySubscribe = function(r) {
|
|
458
453
|
try {
|
|
459
|
-
return this._subscribe(
|
|
454
|
+
return this._subscribe(r);
|
|
460
455
|
} catch (e) {
|
|
461
|
-
|
|
456
|
+
r.error(e);
|
|
462
457
|
}
|
|
463
|
-
}, t.prototype.forEach = function(
|
|
464
|
-
var
|
|
465
|
-
return e =
|
|
466
|
-
var
|
|
467
|
-
next: function(
|
|
458
|
+
}, t.prototype.forEach = function(r, e) {
|
|
459
|
+
var n = this;
|
|
460
|
+
return e = ee(e), new e(function(i, o) {
|
|
461
|
+
var s = new Y({
|
|
462
|
+
next: function(c) {
|
|
468
463
|
try {
|
|
469
|
-
|
|
470
|
-
} catch (
|
|
471
|
-
u
|
|
464
|
+
r(c);
|
|
465
|
+
} catch (u) {
|
|
466
|
+
o(u), s.unsubscribe();
|
|
472
467
|
}
|
|
473
468
|
},
|
|
474
|
-
error:
|
|
469
|
+
error: o,
|
|
475
470
|
complete: i
|
|
476
471
|
});
|
|
477
|
-
|
|
472
|
+
n.subscribe(s);
|
|
478
473
|
});
|
|
479
|
-
}, t.prototype._subscribe = function(
|
|
474
|
+
}, t.prototype._subscribe = function(r) {
|
|
480
475
|
var e;
|
|
481
|
-
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(
|
|
476
|
+
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(r);
|
|
482
477
|
}, t.prototype[X] = function() {
|
|
483
478
|
return this;
|
|
484
479
|
}, t.prototype.pipe = function() {
|
|
485
|
-
for (var
|
|
486
|
-
|
|
487
|
-
return
|
|
488
|
-
}, t.prototype.toPromise = function(
|
|
480
|
+
for (var r = [], e = 0; e < arguments.length; e++)
|
|
481
|
+
r[e] = arguments[e];
|
|
482
|
+
return Be(r)(this);
|
|
483
|
+
}, t.prototype.toPromise = function(r) {
|
|
489
484
|
var e = this;
|
|
490
|
-
return
|
|
491
|
-
var
|
|
492
|
-
e.subscribe(function(
|
|
493
|
-
return
|
|
494
|
-
}, function(
|
|
495
|
-
return i(
|
|
485
|
+
return r = ee(r), new r(function(n, i) {
|
|
486
|
+
var o;
|
|
487
|
+
e.subscribe(function(s) {
|
|
488
|
+
return o = s;
|
|
489
|
+
}, function(s) {
|
|
490
|
+
return i(s);
|
|
496
491
|
}, function() {
|
|
497
|
-
return
|
|
492
|
+
return n(o);
|
|
498
493
|
});
|
|
499
494
|
});
|
|
500
|
-
}, t.create = function(
|
|
501
|
-
return new t(
|
|
495
|
+
}, t.create = function(r) {
|
|
496
|
+
return new t(r);
|
|
502
497
|
}, t;
|
|
503
498
|
}();
|
|
504
|
-
function
|
|
505
|
-
var
|
|
506
|
-
return (
|
|
499
|
+
function ee(t) {
|
|
500
|
+
var r;
|
|
501
|
+
return (r = t ?? Fe.Promise) !== null && r !== void 0 ? r : Promise;
|
|
507
502
|
}
|
|
508
|
-
function
|
|
509
|
-
return t &&
|
|
503
|
+
function Ye(t) {
|
|
504
|
+
return t && y(t.next) && y(t.error) && y(t.complete);
|
|
510
505
|
}
|
|
511
|
-
function
|
|
512
|
-
return t && t instanceof
|
|
506
|
+
function We(t) {
|
|
507
|
+
return t && t instanceof J || Ye(t) && fe(t);
|
|
513
508
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
509
|
+
function Je(t) {
|
|
510
|
+
return y(t == null ? void 0 : t.lift);
|
|
516
511
|
}
|
|
517
512
|
function C(t) {
|
|
518
|
-
return function(
|
|
519
|
-
if (
|
|
520
|
-
return
|
|
513
|
+
return function(r) {
|
|
514
|
+
if (Je(r))
|
|
515
|
+
return r.lift(function(e) {
|
|
521
516
|
try {
|
|
522
517
|
return t(e, this);
|
|
523
|
-
} catch (
|
|
524
|
-
this.error(
|
|
518
|
+
} catch (n) {
|
|
519
|
+
this.error(n);
|
|
525
520
|
}
|
|
526
521
|
});
|
|
527
522
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
528
523
|
};
|
|
529
524
|
}
|
|
530
|
-
function
|
|
531
|
-
return new
|
|
525
|
+
function S(t, r, e, n, i) {
|
|
526
|
+
return new Xe(t, r, e, n, i);
|
|
532
527
|
}
|
|
533
|
-
var
|
|
534
|
-
|
|
535
|
-
function
|
|
536
|
-
var
|
|
537
|
-
return
|
|
528
|
+
var Xe = function(t) {
|
|
529
|
+
E(r, t);
|
|
530
|
+
function r(e, n, i, o, s, c) {
|
|
531
|
+
var u = t.call(this, e) || this;
|
|
532
|
+
return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = n ? function(a) {
|
|
538
533
|
try {
|
|
539
|
-
|
|
540
|
-
} catch (
|
|
541
|
-
e.error(
|
|
534
|
+
n(a);
|
|
535
|
+
} catch (f) {
|
|
536
|
+
e.error(f);
|
|
542
537
|
}
|
|
543
|
-
} : t.prototype._next,
|
|
538
|
+
} : t.prototype._next, u._error = o ? function(a) {
|
|
544
539
|
try {
|
|
545
|
-
|
|
546
|
-
} catch (
|
|
547
|
-
e.error(
|
|
540
|
+
o(a);
|
|
541
|
+
} catch (f) {
|
|
542
|
+
e.error(f);
|
|
548
543
|
} finally {
|
|
549
544
|
this.unsubscribe();
|
|
550
545
|
}
|
|
551
|
-
} : t.prototype._error,
|
|
546
|
+
} : t.prototype._error, u._complete = i ? function() {
|
|
552
547
|
try {
|
|
553
548
|
i();
|
|
554
549
|
} catch (a) {
|
|
@@ -556,223 +551,222 @@ var We = function(t) {
|
|
|
556
551
|
} finally {
|
|
557
552
|
this.unsubscribe();
|
|
558
553
|
}
|
|
559
|
-
} : t.prototype._complete,
|
|
554
|
+
} : t.prototype._complete, u;
|
|
560
555
|
}
|
|
561
|
-
return
|
|
556
|
+
return r.prototype.unsubscribe = function() {
|
|
562
557
|
var e;
|
|
563
558
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
564
|
-
var
|
|
565
|
-
t.prototype.unsubscribe.call(this), !
|
|
559
|
+
var n = this.closed;
|
|
560
|
+
t.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
566
561
|
}
|
|
567
|
-
},
|
|
568
|
-
}(
|
|
562
|
+
}, r;
|
|
563
|
+
}(J), ze = ce(function(t) {
|
|
569
564
|
return function() {
|
|
570
565
|
t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
571
566
|
};
|
|
572
567
|
}), z = function(t) {
|
|
573
|
-
|
|
574
|
-
function
|
|
568
|
+
E(r, t);
|
|
569
|
+
function r() {
|
|
575
570
|
var e = t.call(this) || this;
|
|
576
571
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
577
572
|
}
|
|
578
|
-
return
|
|
579
|
-
var
|
|
580
|
-
return
|
|
581
|
-
},
|
|
573
|
+
return r.prototype.lift = function(e) {
|
|
574
|
+
var n = new te(this, this);
|
|
575
|
+
return n.operator = e, n;
|
|
576
|
+
}, r.prototype._throwIfClosed = function() {
|
|
582
577
|
if (this.closed)
|
|
583
|
-
throw new
|
|
584
|
-
},
|
|
585
|
-
var
|
|
586
|
-
|
|
587
|
-
var i,
|
|
588
|
-
if (
|
|
589
|
-
|
|
578
|
+
throw new ze();
|
|
579
|
+
}, r.prototype.next = function(e) {
|
|
580
|
+
var n = this;
|
|
581
|
+
$(function() {
|
|
582
|
+
var i, o;
|
|
583
|
+
if (n._throwIfClosed(), !n.isStopped) {
|
|
584
|
+
n.currentObservers || (n.currentObservers = Array.from(n.observers));
|
|
590
585
|
try {
|
|
591
|
-
for (var
|
|
592
|
-
var
|
|
593
|
-
|
|
586
|
+
for (var s = P(n.currentObservers), c = s.next(); !c.done; c = s.next()) {
|
|
587
|
+
var u = c.value;
|
|
588
|
+
u.next(e);
|
|
594
589
|
}
|
|
595
590
|
} catch (a) {
|
|
596
591
|
i = { error: a };
|
|
597
592
|
} finally {
|
|
598
593
|
try {
|
|
599
|
-
|
|
594
|
+
c && !c.done && (o = s.return) && o.call(s);
|
|
600
595
|
} finally {
|
|
601
596
|
if (i) throw i.error;
|
|
602
597
|
}
|
|
603
598
|
}
|
|
604
599
|
}
|
|
605
600
|
});
|
|
606
|
-
},
|
|
607
|
-
var
|
|
608
|
-
|
|
609
|
-
if (
|
|
610
|
-
|
|
611
|
-
for (var i =
|
|
601
|
+
}, r.prototype.error = function(e) {
|
|
602
|
+
var n = this;
|
|
603
|
+
$(function() {
|
|
604
|
+
if (n._throwIfClosed(), !n.isStopped) {
|
|
605
|
+
n.hasError = n.isStopped = !0, n.thrownError = e;
|
|
606
|
+
for (var i = n.observers; i.length; )
|
|
612
607
|
i.shift().error(e);
|
|
613
608
|
}
|
|
614
609
|
});
|
|
615
|
-
},
|
|
610
|
+
}, r.prototype.complete = function() {
|
|
616
611
|
var e = this;
|
|
617
|
-
|
|
612
|
+
$(function() {
|
|
618
613
|
if (e._throwIfClosed(), !e.isStopped) {
|
|
619
614
|
e.isStopped = !0;
|
|
620
|
-
for (var
|
|
621
|
-
|
|
615
|
+
for (var n = e.observers; n.length; )
|
|
616
|
+
n.shift().complete();
|
|
622
617
|
}
|
|
623
618
|
});
|
|
624
|
-
},
|
|
619
|
+
}, r.prototype.unsubscribe = function() {
|
|
625
620
|
this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
|
|
626
|
-
}, Object.defineProperty(
|
|
621
|
+
}, Object.defineProperty(r.prototype, "observed", {
|
|
627
622
|
get: function() {
|
|
628
623
|
var e;
|
|
629
624
|
return ((e = this.observers) === null || e === void 0 ? void 0 : e.length) > 0;
|
|
630
625
|
},
|
|
631
626
|
enumerable: !1,
|
|
632
627
|
configurable: !0
|
|
633
|
-
}),
|
|
628
|
+
}), r.prototype._trySubscribe = function(e) {
|
|
634
629
|
return this._throwIfClosed(), t.prototype._trySubscribe.call(this, e);
|
|
635
|
-
},
|
|
630
|
+
}, r.prototype._subscribe = function(e) {
|
|
636
631
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
637
|
-
},
|
|
638
|
-
var
|
|
639
|
-
return
|
|
640
|
-
|
|
632
|
+
}, r.prototype._innerSubscribe = function(e) {
|
|
633
|
+
var n = this, i = this, o = i.hasError, s = i.isStopped, c = i.observers;
|
|
634
|
+
return o || s ? le : (this.currentObservers = null, c.push(e), new j(function() {
|
|
635
|
+
n.currentObservers = null, R(c, e);
|
|
641
636
|
}));
|
|
642
|
-
},
|
|
643
|
-
var
|
|
644
|
-
i ? e.error(
|
|
645
|
-
},
|
|
646
|
-
var e = new
|
|
637
|
+
}, r.prototype._checkFinalizedStatuses = function(e) {
|
|
638
|
+
var n = this, i = n.hasError, o = n.thrownError, s = n.isStopped;
|
|
639
|
+
i ? e.error(o) : s && e.complete();
|
|
640
|
+
}, r.prototype.asObservable = function() {
|
|
641
|
+
var e = new b();
|
|
647
642
|
return e.source = this, e;
|
|
648
|
-
},
|
|
649
|
-
return new
|
|
650
|
-
},
|
|
651
|
-
}(
|
|
652
|
-
|
|
653
|
-
function
|
|
643
|
+
}, r.create = function(e, n) {
|
|
644
|
+
return new te(e, n);
|
|
645
|
+
}, r;
|
|
646
|
+
}(b), te = function(t) {
|
|
647
|
+
E(r, t);
|
|
648
|
+
function r(e, n) {
|
|
654
649
|
var i = t.call(this) || this;
|
|
655
|
-
return i.destination = e, i.source =
|
|
650
|
+
return i.destination = e, i.source = n, i;
|
|
656
651
|
}
|
|
657
|
-
return
|
|
658
|
-
var
|
|
659
|
-
(i = (
|
|
660
|
-
},
|
|
661
|
-
var
|
|
662
|
-
(i = (
|
|
663
|
-
},
|
|
664
|
-
var e,
|
|
665
|
-
(
|
|
666
|
-
},
|
|
667
|
-
var
|
|
668
|
-
return (i = (
|
|
669
|
-
},
|
|
670
|
-
}(z),
|
|
671
|
-
|
|
672
|
-
function
|
|
673
|
-
var
|
|
674
|
-
return
|
|
652
|
+
return r.prototype.next = function(e) {
|
|
653
|
+
var n, i;
|
|
654
|
+
(i = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || i === void 0 || i.call(n, e);
|
|
655
|
+
}, r.prototype.error = function(e) {
|
|
656
|
+
var n, i;
|
|
657
|
+
(i = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || i === void 0 || i.call(n, e);
|
|
658
|
+
}, r.prototype.complete = function() {
|
|
659
|
+
var e, n;
|
|
660
|
+
(n = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || n === void 0 || n.call(e);
|
|
661
|
+
}, r.prototype._subscribe = function(e) {
|
|
662
|
+
var n, i;
|
|
663
|
+
return (i = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && i !== void 0 ? i : le;
|
|
664
|
+
}, r;
|
|
665
|
+
}(z), re = function(t) {
|
|
666
|
+
E(r, t);
|
|
667
|
+
function r(e) {
|
|
668
|
+
var n = t.call(this) || this;
|
|
669
|
+
return n._value = e, n;
|
|
675
670
|
}
|
|
676
|
-
return Object.defineProperty(
|
|
671
|
+
return Object.defineProperty(r.prototype, "value", {
|
|
677
672
|
get: function() {
|
|
678
673
|
return this.getValue();
|
|
679
674
|
},
|
|
680
675
|
enumerable: !1,
|
|
681
676
|
configurable: !0
|
|
682
|
-
}),
|
|
683
|
-
var
|
|
684
|
-
return !
|
|
685
|
-
},
|
|
686
|
-
var e = this,
|
|
687
|
-
if (
|
|
677
|
+
}), r.prototype._subscribe = function(e) {
|
|
678
|
+
var n = t.prototype._subscribe.call(this, e);
|
|
679
|
+
return !n.closed && e.next(this._value), n;
|
|
680
|
+
}, r.prototype.getValue = function() {
|
|
681
|
+
var e = this, n = e.hasError, i = e.thrownError, o = e._value;
|
|
682
|
+
if (n)
|
|
688
683
|
throw i;
|
|
689
|
-
return this._throwIfClosed(),
|
|
690
|
-
},
|
|
684
|
+
return this._throwIfClosed(), o;
|
|
685
|
+
}, r.prototype.next = function(e) {
|
|
691
686
|
t.prototype.next.call(this, this._value = e);
|
|
692
|
-
},
|
|
693
|
-
}(z),
|
|
687
|
+
}, r;
|
|
688
|
+
}(z), Qe = {
|
|
694
689
|
now: function() {
|
|
695
690
|
return Date.now();
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
function n(e, r) {
|
|
691
|
+
}
|
|
692
|
+
}, Ze = function(t) {
|
|
693
|
+
E(r, t);
|
|
694
|
+
function r(e, n) {
|
|
701
695
|
return t.call(this) || this;
|
|
702
696
|
}
|
|
703
|
-
return
|
|
697
|
+
return r.prototype.schedule = function(e, n) {
|
|
704
698
|
return this;
|
|
705
|
-
},
|
|
706
|
-
}(
|
|
707
|
-
setInterval: function(t,
|
|
708
|
-
for (var e = [],
|
|
709
|
-
e[
|
|
710
|
-
return setInterval.apply(void 0,
|
|
699
|
+
}, r;
|
|
700
|
+
}(j), ne = {
|
|
701
|
+
setInterval: function(t, r) {
|
|
702
|
+
for (var e = [], n = 2; n < arguments.length; n++)
|
|
703
|
+
e[n - 2] = arguments[n];
|
|
704
|
+
return setInterval.apply(void 0, k([t, r], M(e)));
|
|
711
705
|
},
|
|
712
706
|
clearInterval: function(t) {
|
|
713
707
|
return clearInterval(t);
|
|
714
708
|
},
|
|
715
709
|
delegate: void 0
|
|
716
|
-
},
|
|
717
|
-
|
|
718
|
-
function
|
|
719
|
-
var i = t.call(this, e,
|
|
720
|
-
return i.scheduler = e, i.work =
|
|
710
|
+
}, et = function(t) {
|
|
711
|
+
E(r, t);
|
|
712
|
+
function r(e, n) {
|
|
713
|
+
var i = t.call(this, e, n) || this;
|
|
714
|
+
return i.scheduler = e, i.work = n, i.pending = !1, i;
|
|
721
715
|
}
|
|
722
|
-
return
|
|
716
|
+
return r.prototype.schedule = function(e, n) {
|
|
723
717
|
var i;
|
|
724
|
-
if (
|
|
718
|
+
if (n === void 0 && (n = 0), this.closed)
|
|
725
719
|
return this;
|
|
726
720
|
this.state = e;
|
|
727
|
-
var
|
|
728
|
-
return
|
|
729
|
-
},
|
|
730
|
-
return i === void 0 && (i = 0),
|
|
731
|
-
},
|
|
721
|
+
var o = this.id, s = this.scheduler;
|
|
722
|
+
return o != null && (this.id = this.recycleAsyncId(s, o, n)), this.pending = !0, this.delay = n, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(s, this.id, n), this;
|
|
723
|
+
}, r.prototype.requestAsyncId = function(e, n, i) {
|
|
724
|
+
return i === void 0 && (i = 0), ne.setInterval(e.flush.bind(e, this), i);
|
|
725
|
+
}, r.prototype.recycleAsyncId = function(e, n, i) {
|
|
732
726
|
if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
|
|
733
|
-
return
|
|
734
|
-
|
|
735
|
-
},
|
|
727
|
+
return n;
|
|
728
|
+
n != null && ne.clearInterval(n);
|
|
729
|
+
}, r.prototype.execute = function(e, n) {
|
|
736
730
|
if (this.closed)
|
|
737
731
|
return new Error("executing a cancelled action");
|
|
738
732
|
this.pending = !1;
|
|
739
|
-
var i = this._execute(e,
|
|
733
|
+
var i = this._execute(e, n);
|
|
740
734
|
if (i)
|
|
741
735
|
return i;
|
|
742
736
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
743
|
-
},
|
|
744
|
-
var i = !1,
|
|
737
|
+
}, r.prototype._execute = function(e, n) {
|
|
738
|
+
var i = !1, o;
|
|
745
739
|
try {
|
|
746
740
|
this.work(e);
|
|
747
|
-
} catch (
|
|
748
|
-
i = !0,
|
|
741
|
+
} catch (s) {
|
|
742
|
+
i = !0, o = s || new Error("Scheduled action threw falsy error");
|
|
749
743
|
}
|
|
750
744
|
if (i)
|
|
751
|
-
return this.unsubscribe(),
|
|
752
|
-
},
|
|
745
|
+
return this.unsubscribe(), o;
|
|
746
|
+
}, r.prototype.unsubscribe = function() {
|
|
753
747
|
if (!this.closed) {
|
|
754
|
-
var e = this,
|
|
755
|
-
this.work = this.state = this.scheduler = null, this.pending = !1, R(
|
|
748
|
+
var e = this, n = e.id, i = e.scheduler, o = i.actions;
|
|
749
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, R(o, this), n != null && (this.id = this.recycleAsyncId(i, n, null)), this.delay = null, t.prototype.unsubscribe.call(this);
|
|
756
750
|
}
|
|
757
|
-
},
|
|
758
|
-
}(
|
|
759
|
-
function t(
|
|
760
|
-
e === void 0 && (e = t.now), this.schedulerActionCtor =
|
|
751
|
+
}, r;
|
|
752
|
+
}(Ze), ie = function() {
|
|
753
|
+
function t(r, e) {
|
|
754
|
+
e === void 0 && (e = t.now), this.schedulerActionCtor = r, this.now = e;
|
|
761
755
|
}
|
|
762
|
-
return t.prototype.schedule = function(
|
|
763
|
-
return e === void 0 && (e = 0), new this.schedulerActionCtor(this,
|
|
764
|
-
}, t.now =
|
|
765
|
-
}(),
|
|
766
|
-
|
|
767
|
-
function
|
|
768
|
-
|
|
769
|
-
var i = t.call(this, e,
|
|
756
|
+
return t.prototype.schedule = function(r, e, n) {
|
|
757
|
+
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, r).schedule(n, e);
|
|
758
|
+
}, t.now = Qe.now, t;
|
|
759
|
+
}(), tt = function(t) {
|
|
760
|
+
E(r, t);
|
|
761
|
+
function r(e, n) {
|
|
762
|
+
n === void 0 && (n = ie.now);
|
|
763
|
+
var i = t.call(this, e, n) || this;
|
|
770
764
|
return i.actions = [], i._active = !1, i;
|
|
771
765
|
}
|
|
772
|
-
return
|
|
773
|
-
var
|
|
766
|
+
return r.prototype.flush = function(e) {
|
|
767
|
+
var n = this.actions;
|
|
774
768
|
if (this._active) {
|
|
775
|
-
|
|
769
|
+
n.push(e);
|
|
776
770
|
return;
|
|
777
771
|
}
|
|
778
772
|
var i;
|
|
@@ -780,68 +774,71 @@ var We = function(t) {
|
|
|
780
774
|
do
|
|
781
775
|
if (i = e.execute(e.state, e.delay))
|
|
782
776
|
break;
|
|
783
|
-
while (e =
|
|
777
|
+
while (e = n.shift());
|
|
784
778
|
if (this._active = !1, i) {
|
|
785
|
-
for (; e =
|
|
779
|
+
for (; e = n.shift(); )
|
|
786
780
|
e.unsubscribe();
|
|
787
781
|
throw i;
|
|
788
782
|
}
|
|
789
|
-
},
|
|
790
|
-
}(
|
|
783
|
+
}, r;
|
|
784
|
+
}(ie), de = new tt(et), rt = de, nt = new b(function(t) {
|
|
791
785
|
return t.complete();
|
|
792
786
|
});
|
|
793
|
-
function
|
|
794
|
-
return t &&
|
|
787
|
+
function ve(t) {
|
|
788
|
+
return t && y(t.schedule);
|
|
795
789
|
}
|
|
796
|
-
function
|
|
790
|
+
function ye(t) {
|
|
797
791
|
return t[t.length - 1];
|
|
798
792
|
}
|
|
799
|
-
function
|
|
800
|
-
return
|
|
793
|
+
function it(t) {
|
|
794
|
+
return y(ye(t)) ? t.pop() : void 0;
|
|
801
795
|
}
|
|
802
|
-
|
|
796
|
+
function pe(t) {
|
|
797
|
+
return ve(ye(t)) ? t.pop() : void 0;
|
|
798
|
+
}
|
|
799
|
+
var be = function(t) {
|
|
803
800
|
return t && typeof t.length == "number" && typeof t != "function";
|
|
804
801
|
};
|
|
805
802
|
function me(t) {
|
|
806
|
-
return
|
|
807
|
-
}
|
|
808
|
-
function we(t) {
|
|
809
|
-
return v(t[X]);
|
|
803
|
+
return y(t == null ? void 0 : t.then);
|
|
810
804
|
}
|
|
811
805
|
function ge(t) {
|
|
812
|
-
return
|
|
806
|
+
return y(t[X]);
|
|
807
|
+
}
|
|
808
|
+
function we(t) {
|
|
809
|
+
return Symbol.asyncIterator && y(t == null ? void 0 : t[Symbol.asyncIterator]);
|
|
813
810
|
}
|
|
814
811
|
function Se(t) {
|
|
815
812
|
return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
816
813
|
}
|
|
817
|
-
function
|
|
814
|
+
function ot() {
|
|
818
815
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
819
816
|
}
|
|
820
|
-
var Ee =
|
|
817
|
+
var Ee = ot();
|
|
821
818
|
function Ie(t) {
|
|
822
|
-
return
|
|
819
|
+
return y(t == null ? void 0 : t[Ee]);
|
|
823
820
|
}
|
|
824
|
-
function
|
|
825
|
-
return
|
|
826
|
-
var e,
|
|
827
|
-
return
|
|
828
|
-
switch (
|
|
821
|
+
function Oe(t) {
|
|
822
|
+
return Ne(this, arguments, function() {
|
|
823
|
+
var e, n, i, o;
|
|
824
|
+
return ue(this, function(s) {
|
|
825
|
+
switch (s.label) {
|
|
829
826
|
case 0:
|
|
830
|
-
e = t.getReader(),
|
|
827
|
+
e = t.getReader(), s.label = 1;
|
|
831
828
|
case 1:
|
|
832
|
-
|
|
829
|
+
s.trys.push([1, , 9, 10]), s.label = 2;
|
|
833
830
|
case 2:
|
|
834
|
-
return [4,
|
|
831
|
+
return [4, T(e.read())];
|
|
835
832
|
case 3:
|
|
836
|
-
return
|
|
833
|
+
return n = s.sent(), i = n.value, o = n.done, o ? [4, T(void 0)] : [3, 5];
|
|
837
834
|
case 4:
|
|
838
|
-
return [2,
|
|
835
|
+
return [2, s.sent()];
|
|
839
836
|
case 5:
|
|
840
|
-
return [4,
|
|
837
|
+
return [4, T(i)];
|
|
841
838
|
case 6:
|
|
842
|
-
return [4,
|
|
839
|
+
return [4, s.sent()];
|
|
843
840
|
case 7:
|
|
844
|
-
return
|
|
841
|
+
return s.sent(), [3, 2];
|
|
845
842
|
case 8:
|
|
846
843
|
return [3, 10];
|
|
847
844
|
case 9:
|
|
@@ -852,108 +849,108 @@ function xe(t) {
|
|
|
852
849
|
});
|
|
853
850
|
});
|
|
854
851
|
}
|
|
855
|
-
function
|
|
856
|
-
return
|
|
852
|
+
function Ae(t) {
|
|
853
|
+
return y(t == null ? void 0 : t.getReader);
|
|
857
854
|
}
|
|
858
|
-
function
|
|
859
|
-
if (t instanceof
|
|
855
|
+
function x(t) {
|
|
856
|
+
if (t instanceof b)
|
|
860
857
|
return t;
|
|
861
858
|
if (t != null) {
|
|
862
|
-
if (we(t))
|
|
863
|
-
return ut(t);
|
|
864
|
-
if (pe(t))
|
|
865
|
-
return ot(t);
|
|
866
|
-
if (me(t))
|
|
867
|
-
return st(t);
|
|
868
859
|
if (ge(t))
|
|
869
|
-
return
|
|
870
|
-
if (
|
|
860
|
+
return st(t);
|
|
861
|
+
if (be(t))
|
|
871
862
|
return at(t);
|
|
872
|
-
if (
|
|
863
|
+
if (me(t))
|
|
864
|
+
return ut(t);
|
|
865
|
+
if (we(t))
|
|
866
|
+
return xe(t);
|
|
867
|
+
if (Ie(t))
|
|
873
868
|
return ct(t);
|
|
869
|
+
if (Ae(t))
|
|
870
|
+
return lt(t);
|
|
874
871
|
}
|
|
875
872
|
throw Se(t);
|
|
876
873
|
}
|
|
877
|
-
function
|
|
878
|
-
return new
|
|
874
|
+
function st(t) {
|
|
875
|
+
return new b(function(r) {
|
|
879
876
|
var e = t[X]();
|
|
880
|
-
if (
|
|
881
|
-
return e.subscribe(
|
|
877
|
+
if (y(e.subscribe))
|
|
878
|
+
return e.subscribe(r);
|
|
882
879
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
883
880
|
});
|
|
884
881
|
}
|
|
885
|
-
function
|
|
886
|
-
return new
|
|
887
|
-
for (var e = 0; e < t.length && !
|
|
888
|
-
|
|
889
|
-
|
|
882
|
+
function at(t) {
|
|
883
|
+
return new b(function(r) {
|
|
884
|
+
for (var e = 0; e < t.length && !r.closed; e++)
|
|
885
|
+
r.next(t[e]);
|
|
886
|
+
r.complete();
|
|
890
887
|
});
|
|
891
888
|
}
|
|
892
|
-
function
|
|
893
|
-
return new
|
|
889
|
+
function ut(t) {
|
|
890
|
+
return new b(function(r) {
|
|
894
891
|
t.then(function(e) {
|
|
895
|
-
|
|
892
|
+
r.closed || (r.next(e), r.complete());
|
|
896
893
|
}, function(e) {
|
|
897
|
-
return
|
|
894
|
+
return r.error(e);
|
|
898
895
|
}).then(null, he);
|
|
899
896
|
});
|
|
900
897
|
}
|
|
901
|
-
function
|
|
902
|
-
return new
|
|
903
|
-
var e,
|
|
898
|
+
function ct(t) {
|
|
899
|
+
return new b(function(r) {
|
|
900
|
+
var e, n;
|
|
904
901
|
try {
|
|
905
|
-
for (var i =
|
|
906
|
-
var
|
|
907
|
-
if (
|
|
902
|
+
for (var i = P(t), o = i.next(); !o.done; o = i.next()) {
|
|
903
|
+
var s = o.value;
|
|
904
|
+
if (r.next(s), r.closed)
|
|
908
905
|
return;
|
|
909
906
|
}
|
|
910
|
-
} catch (
|
|
911
|
-
e = { error:
|
|
907
|
+
} catch (c) {
|
|
908
|
+
e = { error: c };
|
|
912
909
|
} finally {
|
|
913
910
|
try {
|
|
914
|
-
|
|
911
|
+
o && !o.done && (n = i.return) && n.call(i);
|
|
915
912
|
} finally {
|
|
916
913
|
if (e) throw e.error;
|
|
917
914
|
}
|
|
918
915
|
}
|
|
919
|
-
|
|
916
|
+
r.complete();
|
|
920
917
|
});
|
|
921
918
|
}
|
|
922
|
-
function
|
|
923
|
-
return new
|
|
924
|
-
ft(t,
|
|
925
|
-
return
|
|
919
|
+
function xe(t) {
|
|
920
|
+
return new b(function(r) {
|
|
921
|
+
ft(t, r).catch(function(e) {
|
|
922
|
+
return r.error(e);
|
|
926
923
|
});
|
|
927
924
|
});
|
|
928
925
|
}
|
|
929
|
-
function
|
|
930
|
-
return
|
|
931
|
-
}
|
|
932
|
-
function ft(t,
|
|
933
|
-
var e,
|
|
934
|
-
return
|
|
935
|
-
var
|
|
936
|
-
return
|
|
937
|
-
switch (
|
|
926
|
+
function lt(t) {
|
|
927
|
+
return xe(Oe(t));
|
|
928
|
+
}
|
|
929
|
+
function ft(t, r) {
|
|
930
|
+
var e, n, i, o;
|
|
931
|
+
return Ue(this, void 0, void 0, function() {
|
|
932
|
+
var s, c;
|
|
933
|
+
return ue(this, function(u) {
|
|
934
|
+
switch (u.label) {
|
|
938
935
|
case 0:
|
|
939
|
-
|
|
936
|
+
u.trys.push([0, 5, 6, 11]), e = Ge(t), u.label = 1;
|
|
940
937
|
case 1:
|
|
941
938
|
return [4, e.next()];
|
|
942
939
|
case 2:
|
|
943
|
-
if (
|
|
944
|
-
if (
|
|
940
|
+
if (n = u.sent(), !!n.done) return [3, 4];
|
|
941
|
+
if (s = n.value, r.next(s), r.closed)
|
|
945
942
|
return [2];
|
|
946
|
-
|
|
943
|
+
u.label = 3;
|
|
947
944
|
case 3:
|
|
948
945
|
return [3, 1];
|
|
949
946
|
case 4:
|
|
950
947
|
return [3, 11];
|
|
951
948
|
case 5:
|
|
952
|
-
return
|
|
949
|
+
return c = u.sent(), i = { error: c }, [3, 11];
|
|
953
950
|
case 6:
|
|
954
|
-
return
|
|
951
|
+
return u.trys.push([6, , 9, 10]), n && !n.done && (o = e.return) ? [4, o.call(e)] : [3, 8];
|
|
955
952
|
case 7:
|
|
956
|
-
|
|
953
|
+
u.sent(), u.label = 8;
|
|
957
954
|
case 8:
|
|
958
955
|
return [3, 10];
|
|
959
956
|
case 9:
|
|
@@ -962,271 +959,337 @@ function ft(t, n) {
|
|
|
962
959
|
case 10:
|
|
963
960
|
return [7];
|
|
964
961
|
case 11:
|
|
965
|
-
return
|
|
962
|
+
return r.complete(), [2];
|
|
966
963
|
}
|
|
967
964
|
});
|
|
968
965
|
});
|
|
969
966
|
}
|
|
970
|
-
function
|
|
971
|
-
|
|
972
|
-
var
|
|
973
|
-
e(), i ? t.add(this.schedule(null,
|
|
974
|
-
},
|
|
975
|
-
if (t.add(
|
|
976
|
-
return
|
|
977
|
-
}
|
|
978
|
-
function _e(t,
|
|
979
|
-
return
|
|
980
|
-
e.subscribe(
|
|
981
|
-
return
|
|
982
|
-
return
|
|
983
|
-
},
|
|
967
|
+
function A(t, r, e, n, i) {
|
|
968
|
+
n === void 0 && (n = 0), i === void 0 && (i = !1);
|
|
969
|
+
var o = r.schedule(function() {
|
|
970
|
+
e(), i ? t.add(this.schedule(null, n)) : this.unsubscribe();
|
|
971
|
+
}, n);
|
|
972
|
+
if (t.add(o), !i)
|
|
973
|
+
return o;
|
|
974
|
+
}
|
|
975
|
+
function _e(t, r) {
|
|
976
|
+
return r === void 0 && (r = 0), C(function(e, n) {
|
|
977
|
+
e.subscribe(S(n, function(i) {
|
|
978
|
+
return A(n, t, function() {
|
|
979
|
+
return n.next(i);
|
|
980
|
+
}, r);
|
|
984
981
|
}, function() {
|
|
985
|
-
return
|
|
986
|
-
return
|
|
987
|
-
},
|
|
982
|
+
return A(n, t, function() {
|
|
983
|
+
return n.complete();
|
|
984
|
+
}, r);
|
|
988
985
|
}, function(i) {
|
|
989
|
-
return
|
|
990
|
-
return
|
|
991
|
-
},
|
|
986
|
+
return A(n, t, function() {
|
|
987
|
+
return n.error(i);
|
|
988
|
+
}, r);
|
|
992
989
|
}));
|
|
993
990
|
});
|
|
994
991
|
}
|
|
995
|
-
function
|
|
996
|
-
return
|
|
997
|
-
|
|
998
|
-
return e.subscribe(
|
|
999
|
-
},
|
|
992
|
+
function Ce(t, r) {
|
|
993
|
+
return r === void 0 && (r = 0), C(function(e, n) {
|
|
994
|
+
n.add(t.schedule(function() {
|
|
995
|
+
return e.subscribe(n);
|
|
996
|
+
}, r));
|
|
1000
997
|
});
|
|
1001
998
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
999
|
+
function ht(t, r) {
|
|
1000
|
+
return x(t).pipe(Ce(r), _e(r));
|
|
1004
1001
|
}
|
|
1005
|
-
function dt(t,
|
|
1006
|
-
return
|
|
1002
|
+
function dt(t, r) {
|
|
1003
|
+
return x(t).pipe(Ce(r), _e(r));
|
|
1007
1004
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return new
|
|
1010
|
-
var
|
|
1011
|
-
return
|
|
1012
|
-
|
|
1005
|
+
function vt(t, r) {
|
|
1006
|
+
return new b(function(e) {
|
|
1007
|
+
var n = 0;
|
|
1008
|
+
return r.schedule(function() {
|
|
1009
|
+
n === t.length ? e.complete() : (e.next(t[n++]), e.closed || this.schedule());
|
|
1013
1010
|
});
|
|
1014
1011
|
});
|
|
1015
1012
|
}
|
|
1016
|
-
function yt(t,
|
|
1017
|
-
return new
|
|
1018
|
-
var
|
|
1019
|
-
return
|
|
1020
|
-
|
|
1021
|
-
var i,
|
|
1013
|
+
function yt(t, r) {
|
|
1014
|
+
return new b(function(e) {
|
|
1015
|
+
var n;
|
|
1016
|
+
return A(e, r, function() {
|
|
1017
|
+
n = t[Ee](), A(e, r, function() {
|
|
1018
|
+
var i, o, s;
|
|
1022
1019
|
try {
|
|
1023
|
-
i =
|
|
1024
|
-
} catch (
|
|
1025
|
-
e.error(
|
|
1020
|
+
i = n.next(), o = i.value, s = i.done;
|
|
1021
|
+
} catch (c) {
|
|
1022
|
+
e.error(c);
|
|
1026
1023
|
return;
|
|
1027
1024
|
}
|
|
1028
|
-
|
|
1025
|
+
s ? e.complete() : e.next(o);
|
|
1029
1026
|
}, 0, !0);
|
|
1030
1027
|
}), function() {
|
|
1031
|
-
return
|
|
1028
|
+
return y(n == null ? void 0 : n.return) && n.return();
|
|
1032
1029
|
};
|
|
1033
1030
|
});
|
|
1034
1031
|
}
|
|
1035
|
-
function
|
|
1032
|
+
function Te(t, r) {
|
|
1036
1033
|
if (!t)
|
|
1037
1034
|
throw new Error("Iterable cannot be null");
|
|
1038
|
-
return new
|
|
1039
|
-
|
|
1040
|
-
var
|
|
1041
|
-
|
|
1042
|
-
|
|
1035
|
+
return new b(function(e) {
|
|
1036
|
+
A(e, r, function() {
|
|
1037
|
+
var n = t[Symbol.asyncIterator]();
|
|
1038
|
+
A(e, r, function() {
|
|
1039
|
+
n.next().then(function(i) {
|
|
1043
1040
|
i.done ? e.complete() : e.next(i.value);
|
|
1044
1041
|
});
|
|
1045
1042
|
}, 0, !0);
|
|
1046
1043
|
});
|
|
1047
1044
|
});
|
|
1048
1045
|
}
|
|
1049
|
-
function
|
|
1050
|
-
return
|
|
1046
|
+
function pt(t, r) {
|
|
1047
|
+
return Te(Oe(t), r);
|
|
1051
1048
|
}
|
|
1052
|
-
function bt(t,
|
|
1049
|
+
function bt(t, r) {
|
|
1053
1050
|
if (t != null) {
|
|
1054
|
-
if (we(t))
|
|
1055
|
-
return lt(t, n);
|
|
1056
|
-
if (pe(t))
|
|
1057
|
-
return ht(t, n);
|
|
1058
|
-
if (me(t))
|
|
1059
|
-
return dt(t, n);
|
|
1060
1051
|
if (ge(t))
|
|
1061
|
-
return
|
|
1052
|
+
return ht(t, r);
|
|
1053
|
+
if (be(t))
|
|
1054
|
+
return vt(t, r);
|
|
1055
|
+
if (me(t))
|
|
1056
|
+
return dt(t, r);
|
|
1057
|
+
if (we(t))
|
|
1058
|
+
return Te(t, r);
|
|
1062
1059
|
if (Ie(t))
|
|
1063
|
-
return yt(t,
|
|
1064
|
-
if (
|
|
1065
|
-
return
|
|
1060
|
+
return yt(t, r);
|
|
1061
|
+
if (Ae(t))
|
|
1062
|
+
return pt(t, r);
|
|
1066
1063
|
}
|
|
1067
1064
|
throw Se(t);
|
|
1068
1065
|
}
|
|
1069
|
-
function
|
|
1070
|
-
return
|
|
1066
|
+
function Q(t, r) {
|
|
1067
|
+
return r ? bt(t, r) : x(t);
|
|
1071
1068
|
}
|
|
1072
1069
|
function mt() {
|
|
1073
|
-
for (var t = [],
|
|
1074
|
-
t[
|
|
1075
|
-
var e =
|
|
1076
|
-
return
|
|
1070
|
+
for (var t = [], r = 0; r < arguments.length; r++)
|
|
1071
|
+
t[r] = arguments[r];
|
|
1072
|
+
var e = pe(t);
|
|
1073
|
+
return Q(t, e);
|
|
1077
1074
|
}
|
|
1078
|
-
function
|
|
1075
|
+
function gt(t) {
|
|
1079
1076
|
return t instanceof Date && !isNaN(t);
|
|
1080
1077
|
}
|
|
1081
|
-
function
|
|
1082
|
-
return C(function(e,
|
|
1078
|
+
function G(t, r) {
|
|
1079
|
+
return C(function(e, n) {
|
|
1083
1080
|
var i = 0;
|
|
1084
|
-
e.subscribe(
|
|
1085
|
-
|
|
1081
|
+
e.subscribe(S(n, function(o) {
|
|
1082
|
+
n.next(t.call(r, o, i++));
|
|
1086
1083
|
}));
|
|
1087
1084
|
});
|
|
1088
1085
|
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1086
|
+
var wt = Array.isArray;
|
|
1087
|
+
function St(t, r) {
|
|
1088
|
+
return wt(r) ? t.apply(void 0, k([], M(r))) : t(r);
|
|
1089
|
+
}
|
|
1090
|
+
function Et(t) {
|
|
1091
|
+
return G(function(r) {
|
|
1092
|
+
return St(t, r);
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
var It = Array.isArray, Ot = Object.getPrototypeOf, At = Object.prototype, xt = Object.keys;
|
|
1096
|
+
function _t(t) {
|
|
1097
|
+
if (t.length === 1) {
|
|
1098
|
+
var r = t[0];
|
|
1099
|
+
if (It(r))
|
|
1100
|
+
return { args: r, keys: null };
|
|
1101
|
+
if (Ct(r)) {
|
|
1102
|
+
var e = xt(r);
|
|
1103
|
+
return {
|
|
1104
|
+
args: e.map(function(n) {
|
|
1105
|
+
return r[n];
|
|
1106
|
+
}),
|
|
1107
|
+
keys: e
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
return { args: t, keys: null };
|
|
1112
|
+
}
|
|
1113
|
+
function Ct(t) {
|
|
1114
|
+
return t && typeof t == "object" && Ot(t) === At;
|
|
1115
|
+
}
|
|
1116
|
+
function Tt(t, r) {
|
|
1117
|
+
return t.reduce(function(e, n, i) {
|
|
1118
|
+
return e[n] = r[i], e;
|
|
1119
|
+
}, {});
|
|
1120
|
+
}
|
|
1121
|
+
function Pt() {
|
|
1122
|
+
for (var t = [], r = 0; r < arguments.length; r++)
|
|
1123
|
+
t[r] = arguments[r];
|
|
1124
|
+
var e = pe(t), n = it(t), i = _t(t), o = i.args, s = i.keys;
|
|
1125
|
+
if (o.length === 0)
|
|
1126
|
+
return Q([], e);
|
|
1127
|
+
var c = new b(Mt(o, e, s ? function(u) {
|
|
1128
|
+
return Tt(s, u);
|
|
1129
|
+
} : N));
|
|
1130
|
+
return n ? c.pipe(Et(n)) : c;
|
|
1131
|
+
}
|
|
1132
|
+
function Mt(t, r, e) {
|
|
1133
|
+
return e === void 0 && (e = N), function(n) {
|
|
1134
|
+
oe(r, function() {
|
|
1135
|
+
for (var i = t.length, o = new Array(i), s = i, c = i, u = function(f) {
|
|
1136
|
+
oe(r, function() {
|
|
1137
|
+
var d = Q(t[f], r), p = !1;
|
|
1138
|
+
d.subscribe(S(n, function(l) {
|
|
1139
|
+
o[f] = l, p || (p = !0, c--), c || n.next(e(o.slice()));
|
|
1140
|
+
}, function() {
|
|
1141
|
+
--s || n.complete();
|
|
1142
|
+
}));
|
|
1143
|
+
}, n);
|
|
1144
|
+
}, a = 0; a < i; a++)
|
|
1145
|
+
u(a);
|
|
1146
|
+
}, n);
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
function oe(t, r, e) {
|
|
1150
|
+
t ? A(e, t, r) : r();
|
|
1151
|
+
}
|
|
1152
|
+
function kt(t, r, e, n, i, o, s, c) {
|
|
1153
|
+
var u = [], a = 0, f = 0, d = !1, p = function() {
|
|
1154
|
+
d && !u.length && !a && r.complete();
|
|
1155
|
+
}, l = function(h) {
|
|
1156
|
+
return a < n ? v(h) : u.push(h);
|
|
1157
|
+
}, v = function(h) {
|
|
1095
1158
|
a++;
|
|
1096
|
-
var
|
|
1097
|
-
|
|
1098
|
-
|
|
1159
|
+
var g = !1;
|
|
1160
|
+
x(e(h, f++)).subscribe(S(r, function(w) {
|
|
1161
|
+
r.next(w);
|
|
1099
1162
|
}, function() {
|
|
1100
|
-
|
|
1163
|
+
g = !0;
|
|
1101
1164
|
}, void 0, function() {
|
|
1102
|
-
if (
|
|
1165
|
+
if (g)
|
|
1103
1166
|
try {
|
|
1104
1167
|
a--;
|
|
1105
|
-
for (var
|
|
1106
|
-
var _ =
|
|
1107
|
-
|
|
1108
|
-
};
|
|
1109
|
-
|
|
1110
|
-
|
|
1168
|
+
for (var w = function() {
|
|
1169
|
+
var _ = u.shift();
|
|
1170
|
+
s || v(_);
|
|
1171
|
+
}; u.length && a < n; )
|
|
1172
|
+
w();
|
|
1173
|
+
p();
|
|
1111
1174
|
} catch (_) {
|
|
1112
|
-
|
|
1175
|
+
r.error(_);
|
|
1113
1176
|
}
|
|
1114
1177
|
}));
|
|
1115
1178
|
};
|
|
1116
|
-
return t.subscribe(
|
|
1117
|
-
|
|
1179
|
+
return t.subscribe(S(r, l, function() {
|
|
1180
|
+
d = !0, p();
|
|
1118
1181
|
})), function() {
|
|
1119
1182
|
};
|
|
1120
1183
|
}
|
|
1121
|
-
function
|
|
1122
|
-
return e === void 0 && (e = 1 / 0),
|
|
1123
|
-
return
|
|
1124
|
-
return n
|
|
1125
|
-
})(
|
|
1126
|
-
}, e) : (typeof
|
|
1127
|
-
return
|
|
1184
|
+
function U(t, r, e) {
|
|
1185
|
+
return e === void 0 && (e = 1 / 0), y(r) ? U(function(n, i) {
|
|
1186
|
+
return G(function(o, s) {
|
|
1187
|
+
return r(n, o, i, s);
|
|
1188
|
+
})(x(t(n, i)));
|
|
1189
|
+
}, e) : (typeof r == "number" && (e = r), C(function(n, i) {
|
|
1190
|
+
return kt(n, i, t, e);
|
|
1128
1191
|
}));
|
|
1129
1192
|
}
|
|
1130
|
-
function
|
|
1131
|
-
t === void 0 && (t = 0), e === void 0 && (e =
|
|
1132
|
-
var
|
|
1133
|
-
return
|
|
1134
|
-
var
|
|
1135
|
-
|
|
1136
|
-
var
|
|
1193
|
+
function Pe(t, r, e) {
|
|
1194
|
+
t === void 0 && (t = 0), e === void 0 && (e = rt);
|
|
1195
|
+
var n = -1;
|
|
1196
|
+
return r != null && (ve(r) ? e = r : n = r), new b(function(i) {
|
|
1197
|
+
var o = gt(t) ? +t - e.now() : t;
|
|
1198
|
+
o < 0 && (o = 0);
|
|
1199
|
+
var s = 0;
|
|
1137
1200
|
return e.schedule(function() {
|
|
1138
|
-
i.closed || (i.next(
|
|
1139
|
-
},
|
|
1201
|
+
i.closed || (i.next(s++), 0 <= n ? this.schedule(void 0, n) : i.complete());
|
|
1202
|
+
}, o);
|
|
1140
1203
|
});
|
|
1141
1204
|
}
|
|
1142
|
-
function
|
|
1143
|
-
return
|
|
1205
|
+
function jt(t, r) {
|
|
1206
|
+
return y(r) ? U(t, r, 1) : U(t, 1);
|
|
1144
1207
|
}
|
|
1145
|
-
function
|
|
1208
|
+
function Dt(t) {
|
|
1146
1209
|
return t <= 0 ? function() {
|
|
1147
|
-
return
|
|
1148
|
-
} : C(function(
|
|
1149
|
-
var
|
|
1150
|
-
|
|
1151
|
-
++
|
|
1210
|
+
return nt;
|
|
1211
|
+
} : C(function(r, e) {
|
|
1212
|
+
var n = 0;
|
|
1213
|
+
r.subscribe(S(e, function(i) {
|
|
1214
|
+
++n <= t && (e.next(i), t <= n && e.complete());
|
|
1152
1215
|
}));
|
|
1153
1216
|
});
|
|
1154
1217
|
}
|
|
1155
|
-
function
|
|
1156
|
-
return
|
|
1218
|
+
function Lt(t) {
|
|
1219
|
+
return G(function() {
|
|
1157
1220
|
return t;
|
|
1158
1221
|
});
|
|
1159
1222
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1162
|
-
return
|
|
1223
|
+
function $t(t, r) {
|
|
1224
|
+
return U(function(e, n) {
|
|
1225
|
+
return x(t(e, n)).pipe(Dt(1), Lt(e));
|
|
1163
1226
|
});
|
|
1164
1227
|
}
|
|
1165
|
-
function
|
|
1166
|
-
|
|
1167
|
-
var e =
|
|
1168
|
-
return
|
|
1228
|
+
function Rt(t, r) {
|
|
1229
|
+
r === void 0 && (r = de);
|
|
1230
|
+
var e = Pe(t, r);
|
|
1231
|
+
return $t(function() {
|
|
1169
1232
|
return e;
|
|
1170
1233
|
});
|
|
1171
1234
|
}
|
|
1172
|
-
function
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1235
|
+
function Ut(t) {
|
|
1236
|
+
var r;
|
|
1237
|
+
r = {
|
|
1175
1238
|
count: t
|
|
1176
1239
|
};
|
|
1177
|
-
var e =
|
|
1178
|
-
return
|
|
1179
|
-
var a = 0,
|
|
1180
|
-
var
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
}, void 0, function(
|
|
1184
|
-
if (a++ <
|
|
1185
|
-
var
|
|
1186
|
-
|
|
1240
|
+
var e = r.count, n = e === void 0 ? 1 / 0 : e, i = r.delay, o = r.resetOnSuccess, s = o === void 0 ? !1 : o;
|
|
1241
|
+
return n <= 0 ? N : C(function(c, u) {
|
|
1242
|
+
var a = 0, f, d = function() {
|
|
1243
|
+
var p = !1;
|
|
1244
|
+
f = c.subscribe(S(u, function(l) {
|
|
1245
|
+
s && (a = 0), u.next(l);
|
|
1246
|
+
}, void 0, function(l) {
|
|
1247
|
+
if (a++ < n) {
|
|
1248
|
+
var v = function() {
|
|
1249
|
+
f ? (f.unsubscribe(), f = null, d()) : p = !0;
|
|
1187
1250
|
};
|
|
1188
1251
|
if (i != null) {
|
|
1189
|
-
var
|
|
1190
|
-
|
|
1252
|
+
var h = typeof i == "number" ? Pe(i) : x(i(l, a)), g = S(u, function() {
|
|
1253
|
+
g.unsubscribe(), v();
|
|
1191
1254
|
}, function() {
|
|
1192
|
-
|
|
1255
|
+
u.complete();
|
|
1193
1256
|
});
|
|
1194
|
-
|
|
1257
|
+
h.subscribe(g);
|
|
1195
1258
|
} else
|
|
1196
|
-
|
|
1259
|
+
v();
|
|
1197
1260
|
} else
|
|
1198
|
-
|
|
1199
|
-
})),
|
|
1261
|
+
u.error(l);
|
|
1262
|
+
})), p && (f.unsubscribe(), f = null, d());
|
|
1200
1263
|
};
|
|
1201
|
-
|
|
1264
|
+
d();
|
|
1202
1265
|
});
|
|
1203
1266
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return C(function(
|
|
1206
|
-
|
|
1267
|
+
function Nt(t) {
|
|
1268
|
+
return C(function(r, e) {
|
|
1269
|
+
x(t).subscribe(S(e, function() {
|
|
1207
1270
|
return e.complete();
|
|
1208
|
-
},
|
|
1271
|
+
}, B)), !e.closed && r.subscribe(e);
|
|
1209
1272
|
});
|
|
1210
1273
|
}
|
|
1211
|
-
async function
|
|
1274
|
+
async function Gt(t, r) {
|
|
1212
1275
|
const e = t.getReader();
|
|
1213
|
-
let
|
|
1214
|
-
for (; !(
|
|
1215
|
-
n
|
|
1216
|
-
}
|
|
1217
|
-
function
|
|
1218
|
-
let
|
|
1219
|
-
return function(
|
|
1220
|
-
|
|
1221
|
-
const
|
|
1222
|
-
let
|
|
1223
|
-
for (; e <
|
|
1224
|
-
i && (
|
|
1276
|
+
let n;
|
|
1277
|
+
for (; !(n = await e.read()).done; )
|
|
1278
|
+
r(n.value);
|
|
1279
|
+
}
|
|
1280
|
+
function Ft(t) {
|
|
1281
|
+
let r, e, n, i = !1;
|
|
1282
|
+
return function(s) {
|
|
1283
|
+
r === void 0 ? (r = s, e = 0, n = -1) : r = Kt(r, s);
|
|
1284
|
+
const c = r.length;
|
|
1285
|
+
let u = 0;
|
|
1286
|
+
for (; e < c; ) {
|
|
1287
|
+
i && (r[e] === 10 && (u = ++e), i = !1);
|
|
1225
1288
|
let a = -1;
|
|
1226
|
-
for (; e <
|
|
1227
|
-
switch (
|
|
1289
|
+
for (; e < c && a === -1; ++e)
|
|
1290
|
+
switch (r[e]) {
|
|
1228
1291
|
case 58:
|
|
1229
|
-
|
|
1292
|
+
n === -1 && (n = e - u);
|
|
1230
1293
|
break;
|
|
1231
1294
|
case 13:
|
|
1232
1295
|
i = !0;
|
|
@@ -1236,43 +1299,43 @@ function _t(t) {
|
|
|
1236
1299
|
}
|
|
1237
1300
|
if (a === -1)
|
|
1238
1301
|
break;
|
|
1239
|
-
t(
|
|
1302
|
+
t(r.subarray(u, a), n), u = e, n = -1;
|
|
1240
1303
|
}
|
|
1241
|
-
|
|
1304
|
+
u === c ? r = void 0 : u !== 0 && (r = r.subarray(u), e -= u);
|
|
1242
1305
|
};
|
|
1243
1306
|
}
|
|
1244
|
-
function
|
|
1245
|
-
let
|
|
1307
|
+
function Vt(t, r, e) {
|
|
1308
|
+
let n = se();
|
|
1246
1309
|
const i = new TextDecoder();
|
|
1247
|
-
return function(
|
|
1248
|
-
if (
|
|
1249
|
-
e == null || e(
|
|
1250
|
-
else if (
|
|
1251
|
-
const
|
|
1252
|
-
switch (
|
|
1310
|
+
return function(s, c) {
|
|
1311
|
+
if (s.length === 0)
|
|
1312
|
+
e == null || e(n), n = se();
|
|
1313
|
+
else if (c > 0) {
|
|
1314
|
+
const u = i.decode(s.subarray(0, c)), a = c + (s[c + 1] === 32 ? 2 : 1), f = i.decode(s.subarray(a));
|
|
1315
|
+
switch (u) {
|
|
1253
1316
|
case "data":
|
|
1254
|
-
|
|
1255
|
-
` +
|
|
1317
|
+
n.data = n.data ? n.data + `
|
|
1318
|
+
` + f : f;
|
|
1256
1319
|
break;
|
|
1257
1320
|
case "event":
|
|
1258
|
-
|
|
1321
|
+
n.event = f;
|
|
1259
1322
|
break;
|
|
1260
1323
|
case "id":
|
|
1261
|
-
t(
|
|
1324
|
+
t(n.id = f);
|
|
1262
1325
|
break;
|
|
1263
1326
|
case "retry":
|
|
1264
|
-
const
|
|
1265
|
-
isNaN(
|
|
1327
|
+
const d = parseInt(f, 10);
|
|
1328
|
+
isNaN(d) || r(n.retry = d);
|
|
1266
1329
|
break;
|
|
1267
1330
|
}
|
|
1268
1331
|
}
|
|
1269
1332
|
};
|
|
1270
1333
|
}
|
|
1271
|
-
function
|
|
1272
|
-
const e = new Uint8Array(t.length +
|
|
1273
|
-
return e.set(t), e.set(
|
|
1334
|
+
function Kt(t, r) {
|
|
1335
|
+
const e = new Uint8Array(t.length + r.length);
|
|
1336
|
+
return e.set(t), e.set(r, t.length), e;
|
|
1274
1337
|
}
|
|
1275
|
-
function
|
|
1338
|
+
function se() {
|
|
1276
1339
|
return {
|
|
1277
1340
|
data: "",
|
|
1278
1341
|
event: "",
|
|
@@ -1280,147 +1343,112 @@ function ue() {
|
|
|
1280
1343
|
retry: void 0
|
|
1281
1344
|
};
|
|
1282
1345
|
}
|
|
1283
|
-
var
|
|
1346
|
+
var Ht = function(t, r) {
|
|
1284
1347
|
var e = {};
|
|
1285
|
-
for (var
|
|
1348
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && r.indexOf(n) < 0 && (e[n] = t[n]);
|
|
1286
1349
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1287
|
-
for (var i = 0,
|
|
1288
|
-
|
|
1350
|
+
for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++)
|
|
1351
|
+
r.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (e[n[i]] = t[n[i]]);
|
|
1289
1352
|
return e;
|
|
1290
1353
|
};
|
|
1291
|
-
const
|
|
1292
|
-
function
|
|
1293
|
-
var { signal: e, headers:
|
|
1294
|
-
return new Promise((
|
|
1295
|
-
const
|
|
1296
|
-
|
|
1297
|
-
let
|
|
1298
|
-
function
|
|
1299
|
-
|
|
1354
|
+
const W = "text/event-stream", qt = 1e3, ae = "last-event-id";
|
|
1355
|
+
function Bt(t, r) {
|
|
1356
|
+
var { signal: e, headers: n, onopen: i, onmessage: o, onclose: s, onerror: c, openWhenHidden: u, fetch: a } = r, f = Ht(r, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
1357
|
+
return new Promise((d, p) => {
|
|
1358
|
+
const l = Object.assign({}, n);
|
|
1359
|
+
l.accept || (l.accept = W);
|
|
1360
|
+
let v;
|
|
1361
|
+
function h() {
|
|
1362
|
+
v.abort(), document.hidden || F();
|
|
1300
1363
|
}
|
|
1301
|
-
|
|
1302
|
-
let
|
|
1364
|
+
u || document.addEventListener("visibilitychange", h);
|
|
1365
|
+
let g = qt, w = 0;
|
|
1303
1366
|
function _() {
|
|
1304
|
-
document.removeEventListener("visibilitychange",
|
|
1367
|
+
document.removeEventListener("visibilitychange", h), window.clearTimeout(w), v.abort();
|
|
1305
1368
|
}
|
|
1306
1369
|
e == null || e.addEventListener("abort", () => {
|
|
1307
|
-
_(),
|
|
1370
|
+
_(), d();
|
|
1308
1371
|
});
|
|
1309
|
-
const
|
|
1310
|
-
async function
|
|
1311
|
-
var
|
|
1312
|
-
|
|
1372
|
+
const je = a ?? window.fetch, De = i ?? Yt;
|
|
1373
|
+
async function F() {
|
|
1374
|
+
var V;
|
|
1375
|
+
v = new AbortController();
|
|
1313
1376
|
try {
|
|
1314
|
-
const
|
|
1315
|
-
await
|
|
1316
|
-
|
|
1317
|
-
}, (
|
|
1318
|
-
|
|
1319
|
-
},
|
|
1320
|
-
} catch (
|
|
1321
|
-
if (!
|
|
1377
|
+
const D = await je(t, Object.assign(Object.assign({}, f), { headers: l, signal: v.signal }));
|
|
1378
|
+
await De(D), await Gt(D.body, Ft(Vt((I) => {
|
|
1379
|
+
I ? l[ae] = I : delete l[ae];
|
|
1380
|
+
}, (I) => {
|
|
1381
|
+
g = I;
|
|
1382
|
+
}, o))), s == null || s(), _(), d();
|
|
1383
|
+
} catch (D) {
|
|
1384
|
+
if (!v.signal.aborted)
|
|
1322
1385
|
try {
|
|
1323
|
-
const
|
|
1324
|
-
window.clearTimeout(
|
|
1325
|
-
} catch (
|
|
1326
|
-
_(),
|
|
1386
|
+
const I = (V = c == null ? void 0 : c(D)) !== null && V !== void 0 ? V : g;
|
|
1387
|
+
window.clearTimeout(w), w = window.setTimeout(F, I);
|
|
1388
|
+
} catch (I) {
|
|
1389
|
+
_(), p(I);
|
|
1327
1390
|
}
|
|
1328
1391
|
}
|
|
1329
1392
|
}
|
|
1330
|
-
|
|
1393
|
+
F();
|
|
1331
1394
|
});
|
|
1332
1395
|
}
|
|
1333
|
-
function
|
|
1334
|
-
const
|
|
1335
|
-
if (!(
|
|
1336
|
-
throw new Error(`Expected content-type to be ${
|
|
1396
|
+
function Yt(t) {
|
|
1397
|
+
const r = t.headers.get("content-type");
|
|
1398
|
+
if (!(r != null && r.startsWith(W)))
|
|
1399
|
+
throw new Error(`Expected content-type to be ${W}, Actual: ${r}`);
|
|
1337
1400
|
}
|
|
1338
|
-
function
|
|
1339
|
-
const { endpoint:
|
|
1340
|
-
return new
|
|
1341
|
-
const
|
|
1342
|
-
return
|
|
1401
|
+
function Wt(t) {
|
|
1402
|
+
const { endpoint: r, apiKey: e, payload: n } = t;
|
|
1403
|
+
return new b((i) => {
|
|
1404
|
+
const o = new AbortController();
|
|
1405
|
+
return Bt(r, {
|
|
1343
1406
|
method: "POST",
|
|
1344
1407
|
headers: {
|
|
1345
1408
|
"X-API-KEY": e,
|
|
1346
1409
|
"Content-Type": "application/json"
|
|
1347
1410
|
},
|
|
1348
|
-
body:
|
|
1349
|
-
signal:
|
|
1350
|
-
onopen: async (
|
|
1351
|
-
|
|
1411
|
+
body: n ? JSON.stringify(n) : void 0,
|
|
1412
|
+
signal: o.signal,
|
|
1413
|
+
onopen: async (s) => {
|
|
1414
|
+
s.ok || (i.error(s), o.abort());
|
|
1352
1415
|
},
|
|
1353
|
-
onmessage: (
|
|
1354
|
-
i.next(JSON.parse(
|
|
1416
|
+
onmessage: (s) => {
|
|
1417
|
+
i.next(JSON.parse(s.data));
|
|
1355
1418
|
},
|
|
1356
1419
|
onclose: () => {
|
|
1357
1420
|
i.complete();
|
|
1358
1421
|
},
|
|
1359
|
-
onerror: (
|
|
1360
|
-
throw i.error(
|
|
1422
|
+
onerror: (s) => {
|
|
1423
|
+
throw i.error(s), o.abort(), s;
|
|
1361
1424
|
}
|
|
1362
1425
|
}), () => {
|
|
1363
|
-
|
|
1426
|
+
o.abort();
|
|
1364
1427
|
};
|
|
1365
1428
|
});
|
|
1366
1429
|
}
|
|
1367
|
-
class
|
|
1368
|
-
constructor(
|
|
1430
|
+
class Xt {
|
|
1431
|
+
constructor(r) {
|
|
1369
1432
|
m(this, "apiKey");
|
|
1370
1433
|
m(this, "endpoint");
|
|
1371
1434
|
m(this, "destroy$", new z());
|
|
1372
1435
|
m(this, "transformSsePayload");
|
|
1373
|
-
if (!
|
|
1436
|
+
if (!r.apiKey)
|
|
1374
1437
|
throw new Error("apiKey must be required");
|
|
1375
|
-
if (!
|
|
1438
|
+
if (!r.endpoint)
|
|
1376
1439
|
throw new Error("endpoint must be required");
|
|
1377
|
-
this.apiKey =
|
|
1440
|
+
this.apiKey = r.apiKey, this.endpoint = r.endpoint, this.transformSsePayload = r.transformSsePayload;
|
|
1378
1441
|
}
|
|
1379
|
-
|
|
1380
|
-
var
|
|
1381
|
-
(
|
|
1382
|
-
const r = {
|
|
1383
|
-
action: H.RESET_CHANNEL,
|
|
1384
|
-
customChannelId: n.customChannelId,
|
|
1385
|
-
customMessageId: n == null ? void 0 : n.customMessageId,
|
|
1386
|
-
text: ""
|
|
1387
|
-
};
|
|
1388
|
-
se({
|
|
1442
|
+
fetchSse(r, e) {
|
|
1443
|
+
var n, i;
|
|
1444
|
+
(n = e == null ? void 0 : e.onSseStart) == null || n.call(e), Wt({
|
|
1389
1445
|
apiKey: this.apiKey,
|
|
1390
1446
|
endpoint: this.endpoint,
|
|
1391
|
-
payload: ((
|
|
1392
|
-
}).pipe(ie(this.destroy$), re(3)).subscribe({
|
|
1393
|
-
next: (o) => {
|
|
1394
|
-
var s;
|
|
1395
|
-
(s = e == null ? void 0 : e.onSseMessage) == null || s.call(e, o);
|
|
1396
|
-
},
|
|
1397
|
-
error: (o) => {
|
|
1398
|
-
var s;
|
|
1399
|
-
(s = e == null ? void 0 : e.onSseError) == null || s.call(e, o);
|
|
1400
|
-
},
|
|
1401
|
-
complete: () => {
|
|
1402
|
-
var o;
|
|
1403
|
-
(o = e == null ? void 0 : e.onSseCompleted) == null || o.call(e);
|
|
1404
|
-
}
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
|
-
sendMessage(n, e) {
|
|
1408
|
-
var i, u;
|
|
1409
|
-
(i = e == null ? void 0 : e.onSseStart) == null || i.call(e);
|
|
1410
|
-
const r = {
|
|
1411
|
-
action: H.NONE,
|
|
1412
|
-
customChannelId: n.customChannelId,
|
|
1413
|
-
customMessageId: n == null ? void 0 : n.customMessageId,
|
|
1414
|
-
text: n.text
|
|
1415
|
-
};
|
|
1416
|
-
se({
|
|
1417
|
-
apiKey: this.apiKey,
|
|
1418
|
-
endpoint: this.endpoint,
|
|
1419
|
-
payload: ((u = this.transformSsePayload) == null ? void 0 : u.call(this, r)) ?? r
|
|
1447
|
+
payload: ((i = this.transformSsePayload) == null ? void 0 : i.call(this, r)) ?? r
|
|
1420
1448
|
}).pipe(
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1449
|
+
jt((o) => mt(o).pipe(Rt((e == null ? void 0 : e.delayTime) ?? 50))),
|
|
1450
|
+
Nt(this.destroy$),
|
|
1451
|
+
Ut(3)
|
|
1424
1452
|
).subscribe({
|
|
1425
1453
|
next: (o) => {
|
|
1426
1454
|
var s;
|
|
@@ -1440,130 +1468,175 @@ class Lt {
|
|
|
1440
1468
|
this.destroy$.next(), this.destroy$.complete();
|
|
1441
1469
|
}
|
|
1442
1470
|
}
|
|
1443
|
-
class
|
|
1444
|
-
constructor(
|
|
1471
|
+
class Me {
|
|
1472
|
+
constructor(r) {
|
|
1445
1473
|
m(this, "client");
|
|
1474
|
+
m(this, "customChannelId");
|
|
1475
|
+
m(this, "customMessageId");
|
|
1446
1476
|
m(this, "isConnecting$");
|
|
1447
1477
|
m(this, "conversation$");
|
|
1448
|
-
m(this, "
|
|
1449
|
-
|
|
1478
|
+
m(this, "statesObserver");
|
|
1479
|
+
m(this, "statesSubscription");
|
|
1480
|
+
if (!r.client)
|
|
1450
1481
|
throw new Error("client must be required");
|
|
1451
|
-
if (!
|
|
1482
|
+
if (!r.customChannelId)
|
|
1452
1483
|
throw new Error("customChannelId must be required");
|
|
1453
|
-
this.client =
|
|
1484
|
+
this.client = r.client, this.customChannelId = r.customChannelId, this.customMessageId = r.customMessageId, this.isConnecting$ = new re(!1), this.conversation$ = new re(r.conversation), this.statesObserver = r.statesObserver;
|
|
1485
|
+
}
|
|
1486
|
+
static async reset(r, e) {
|
|
1487
|
+
const n = new Me(r);
|
|
1488
|
+
try {
|
|
1489
|
+
return await n.resetChannel(e), n.subscribe(), n;
|
|
1490
|
+
} catch (i) {
|
|
1491
|
+
throw n.close(), i;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
subscribe() {
|
|
1495
|
+
this.statesSubscription = Pt([
|
|
1496
|
+
this.isConnecting$,
|
|
1497
|
+
this.conversation$
|
|
1498
|
+
]).pipe(
|
|
1499
|
+
G(([r, e]) => ({
|
|
1500
|
+
isConnecting: r,
|
|
1501
|
+
conversation: e
|
|
1502
|
+
}))
|
|
1503
|
+
).subscribe(this.statesObserver);
|
|
1504
|
+
}
|
|
1505
|
+
fetchSse(r, e) {
|
|
1506
|
+
return new Promise((n, i) => {
|
|
1507
|
+
this.isConnecting$.next(!0), this.client.fetchSse(r, {
|
|
1508
|
+
onSseStart: e == null ? void 0 : e.onSseStart,
|
|
1509
|
+
onSseMessage: (o) => {
|
|
1510
|
+
var s;
|
|
1511
|
+
(s = e == null ? void 0 : e.onSseMessage) == null || s.call(e, o), this.conversation$.next(this.conversation$.value.onMessage(o));
|
|
1512
|
+
},
|
|
1513
|
+
onSseError: (o) => {
|
|
1514
|
+
var s;
|
|
1515
|
+
(s = e == null ? void 0 : e.onSseError) == null || s.call(e, o), this.isConnecting$.next(!1), i(o);
|
|
1516
|
+
},
|
|
1517
|
+
onSseCompleted: () => {
|
|
1518
|
+
var o;
|
|
1519
|
+
(o = e == null ? void 0 : e.onSseCompleted) == null || o.call(e), this.isConnecting$.next(!1), n();
|
|
1520
|
+
}
|
|
1521
|
+
});
|
|
1522
|
+
});
|
|
1454
1523
|
}
|
|
1455
|
-
|
|
1456
|
-
this.
|
|
1457
|
-
|
|
1458
|
-
|
|
1524
|
+
resetChannel(r) {
|
|
1525
|
+
return this.fetchSse(
|
|
1526
|
+
{
|
|
1527
|
+
action: H.RESET_CHANNEL,
|
|
1528
|
+
customChannelId: this.customChannelId,
|
|
1529
|
+
customMessageId: this.customMessageId,
|
|
1530
|
+
text: ""
|
|
1531
|
+
},
|
|
1532
|
+
r
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
sendMessage(r, e) {
|
|
1536
|
+
const n = r.text.trim(), i = r.customMessageId ?? crypto.randomUUID();
|
|
1537
|
+
return this.conversation$.next(
|
|
1459
1538
|
this.conversation$.value.pushMessage({
|
|
1460
1539
|
type: "user",
|
|
1461
|
-
messageId:
|
|
1462
|
-
text: n
|
|
1540
|
+
messageId: i,
|
|
1541
|
+
text: n,
|
|
1463
1542
|
time: /* @__PURE__ */ new Date()
|
|
1464
1543
|
})
|
|
1465
|
-
), this.
|
|
1544
|
+
), this.fetchSse(
|
|
1466
1545
|
{
|
|
1546
|
+
action: H.NONE,
|
|
1467
1547
|
customChannelId: this.customChannelId,
|
|
1468
|
-
customMessageId:
|
|
1469
|
-
text: n
|
|
1548
|
+
customMessageId: i,
|
|
1549
|
+
text: n
|
|
1470
1550
|
},
|
|
1471
|
-
|
|
1472
|
-
onSseStart: e == null ? void 0 : e.onSseStart,
|
|
1473
|
-
onSseMessage: (i) => {
|
|
1474
|
-
var u;
|
|
1475
|
-
(u = e == null ? void 0 : e.onSseMessage) == null || u.call(e, i), this.conversation$.next(this.conversation$.value.onMessage(i));
|
|
1476
|
-
},
|
|
1477
|
-
onSseError: (i) => {
|
|
1478
|
-
var u;
|
|
1479
|
-
(u = e == null ? void 0 : e.onSseError) == null || u.call(e, i), this.isConnecting$.next(!1);
|
|
1480
|
-
},
|
|
1481
|
-
onSseCompleted: () => {
|
|
1482
|
-
var i;
|
|
1483
|
-
(i = e == null ? void 0 : e.onSseCompleted) == null || i.call(e), this.isConnecting$.next(!1);
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1551
|
+
e
|
|
1486
1552
|
);
|
|
1487
1553
|
}
|
|
1488
1554
|
close() {
|
|
1489
|
-
|
|
1555
|
+
var r;
|
|
1556
|
+
this.isConnecting$.complete(), this.conversation$.complete(), (r = this.statesSubscription) == null || r.unsubscribe();
|
|
1490
1557
|
}
|
|
1491
1558
|
}
|
|
1492
|
-
class
|
|
1493
|
-
constructor({ messages:
|
|
1559
|
+
class ke {
|
|
1560
|
+
constructor({ messages: r, showDebugMessage: e }) {
|
|
1494
1561
|
m(this, "showDebugMessage", !1);
|
|
1495
1562
|
m(this, "messages", null);
|
|
1496
|
-
this.messages =
|
|
1563
|
+
this.messages = r, this.showDebugMessage = e ?? !1;
|
|
1564
|
+
}
|
|
1565
|
+
create(r) {
|
|
1566
|
+
return new ke({
|
|
1567
|
+
messages: r,
|
|
1568
|
+
showDebugMessage: this.showDebugMessage
|
|
1569
|
+
});
|
|
1497
1570
|
}
|
|
1498
|
-
pushMessage(
|
|
1571
|
+
pushMessage(r) {
|
|
1499
1572
|
const e = new Map(this.messages);
|
|
1500
|
-
return e.set(
|
|
1573
|
+
return e.set(r.messageId, r), this.create(e);
|
|
1501
1574
|
}
|
|
1502
|
-
onMessage(
|
|
1503
|
-
switch (
|
|
1504
|
-
case
|
|
1575
|
+
onMessage(r) {
|
|
1576
|
+
switch (r.eventType) {
|
|
1577
|
+
case O.MESSAGE_START:
|
|
1505
1578
|
return this.onMessageStart(
|
|
1506
|
-
|
|
1579
|
+
r
|
|
1507
1580
|
);
|
|
1508
|
-
case
|
|
1581
|
+
case O.MESSAGE_DELTA:
|
|
1509
1582
|
return this.onMessageDelta(
|
|
1510
|
-
|
|
1583
|
+
r
|
|
1511
1584
|
);
|
|
1512
|
-
case
|
|
1585
|
+
case O.MESSAGE_COMPLETE:
|
|
1513
1586
|
return this.onMessageComplete(
|
|
1514
|
-
|
|
1587
|
+
r
|
|
1515
1588
|
);
|
|
1516
1589
|
default:
|
|
1517
1590
|
return this;
|
|
1518
1591
|
}
|
|
1519
1592
|
}
|
|
1520
|
-
onMessageStart(
|
|
1521
|
-
const e =
|
|
1522
|
-
return e.isDebug && !this.showDebugMessage ||
|
|
1593
|
+
onMessageStart(r) {
|
|
1594
|
+
const e = r.fact.messageStart.message, n = new Map(this.messages);
|
|
1595
|
+
return e.isDebug && !this.showDebugMessage || n != null && n.has(e.messageId) ? this.create(n) : (n.set(e.messageId, {
|
|
1523
1596
|
type: "bot",
|
|
1524
|
-
eventType:
|
|
1597
|
+
eventType: O.MESSAGE_START,
|
|
1525
1598
|
isTyping: !0,
|
|
1526
1599
|
typingText: "",
|
|
1527
1600
|
messageId: e.messageId,
|
|
1528
1601
|
message: e,
|
|
1529
1602
|
time: /* @__PURE__ */ new Date()
|
|
1530
|
-
}),
|
|
1603
|
+
}), this.create(n));
|
|
1531
1604
|
}
|
|
1532
|
-
onMessageDelta(
|
|
1533
|
-
const e =
|
|
1605
|
+
onMessageDelta(r) {
|
|
1606
|
+
const e = r.fact.messageDelta.message, n = new Map(this.messages), i = n.get(e.messageId);
|
|
1534
1607
|
if ((i == null ? void 0 : i.type) === "user") return this;
|
|
1535
|
-
if (e.isDebug && !this.showDebugMessage || (i == null ? void 0 : i.eventType) ===
|
|
1536
|
-
return
|
|
1537
|
-
const
|
|
1538
|
-
return
|
|
1608
|
+
if (e.isDebug && !this.showDebugMessage || (i == null ? void 0 : i.eventType) === O.MESSAGE_COMPLETE)
|
|
1609
|
+
return this.create(n);
|
|
1610
|
+
const o = `${(i == null ? void 0 : i.typingText) ?? ""}${e.text}`;
|
|
1611
|
+
return n.set(e.messageId, {
|
|
1539
1612
|
type: "bot",
|
|
1540
|
-
eventType:
|
|
1613
|
+
eventType: O.MESSAGE_DELTA,
|
|
1541
1614
|
isTyping: !0,
|
|
1542
|
-
typingText:
|
|
1615
|
+
typingText: o,
|
|
1543
1616
|
messageId: e.messageId,
|
|
1544
1617
|
message: e,
|
|
1545
1618
|
time: /* @__PURE__ */ new Date()
|
|
1546
|
-
}),
|
|
1619
|
+
}), this.create(n);
|
|
1547
1620
|
}
|
|
1548
|
-
onMessageComplete(
|
|
1549
|
-
const e =
|
|
1550
|
-
return e.isDebug && !this.showDebugMessage ?
|
|
1621
|
+
onMessageComplete(r) {
|
|
1622
|
+
const e = r.fact.messageComplete.message, n = new Map(this.messages);
|
|
1623
|
+
return e.isDebug && !this.showDebugMessage ? this.create(n) : (n.set(e.messageId, {
|
|
1551
1624
|
type: "bot",
|
|
1552
|
-
eventType:
|
|
1625
|
+
eventType: O.MESSAGE_COMPLETE,
|
|
1553
1626
|
isTyping: !1,
|
|
1554
1627
|
typingText: null,
|
|
1555
1628
|
messageId: e.messageId,
|
|
1556
1629
|
message: e,
|
|
1557
1630
|
time: /* @__PURE__ */ new Date()
|
|
1558
|
-
}),
|
|
1631
|
+
}), this.create(n));
|
|
1559
1632
|
}
|
|
1560
1633
|
}
|
|
1561
1634
|
export {
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1635
|
+
Xt as AsgardServiceClient,
|
|
1636
|
+
Me as Channel,
|
|
1637
|
+
ke as Conversation,
|
|
1638
|
+
O as EventType,
|
|
1566
1639
|
H as FetchSseAction,
|
|
1567
|
-
|
|
1640
|
+
Re as MessageTemplateType
|
|
1568
1641
|
};
|
|
1569
1642
|
//# sourceMappingURL=index.mjs.map
|