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