@acrobits/ipc-sdk 0.11.2-alpha.7 → 0.12.0-alpha.10
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/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/IPCManager.html +50 -31
- package/docs/enums/IPCEvents.html +4 -2
- package/docs/interfaces/CallInfoItem.html +16 -0
- package/docs/interfaces/DetailedContactURI.html +3 -3
- package/docs/interfaces/RemoteUser.html +6 -0
- package/docs/modules.html +1 -1
- package/docs/types/BaseContactItem.html +7 -7
- package/docs/types/CallState.html +26 -0
- package/docs/types/CloudUsernameContactItem.html +2 -2
- package/docs/types/ContactItem.html +1 -1
- package/docs/types/ContactLabel.html +1 -1
- package/docs/types/ContactType.html +1 -1
- package/docs/types/ContactURI.html +1 -1
- package/docs/types/DetailedContactItem.html +8 -8
- package/docs/types/HostType.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/docs/types/UriContactItem.html +1 -1
- package/lib/index.d.ts +332 -209
- package/lib/ipc-sdk.js +1095 -894
- package/lib/ipc-sdk.js.map +1 -1
- package/lib/ipc-sdk.umd.cjs +4 -4
- package/lib/ipc-sdk.umd.cjs.map +1 -1
- package/package.json +3 -3
package/lib/ipc-sdk.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
1
|
+
var Ae = Object.defineProperty;
|
|
2
|
+
var Pe = (n, t, e) => t in n ? Ae(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var I = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var w = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n.RequestLogs = "REQUEST LOGS", n.CallInfo = "CALL INFO", n))(w || {}), G = function(n, t) {
|
|
5
|
+
return G = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
8
|
-
for (var
|
|
9
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
10
|
-
},
|
|
8
|
+
for (var s in r)
|
|
9
|
+
Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
10
|
+
}, G(n, t);
|
|
11
11
|
};
|
|
12
|
-
function U(
|
|
12
|
+
function U(n, t) {
|
|
13
13
|
if (typeof t != "function" && t !== null)
|
|
14
14
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
15
|
-
|
|
15
|
+
G(n, t);
|
|
16
16
|
function e() {
|
|
17
|
-
this.constructor =
|
|
17
|
+
this.constructor = n;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
20
20
|
}
|
|
21
|
-
function Q(
|
|
22
|
-
var t = typeof Symbol == "function" && Symbol.iterator, e = t &&
|
|
21
|
+
function Q(n) {
|
|
22
|
+
var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], r = 0;
|
|
23
23
|
if (e)
|
|
24
|
-
return e.call(
|
|
25
|
-
if (
|
|
24
|
+
return e.call(n);
|
|
25
|
+
if (n && typeof n.length == "number")
|
|
26
26
|
return {
|
|
27
27
|
next: function() {
|
|
28
|
-
return
|
|
28
|
+
return n && r >= n.length && (n = void 0), { value: n && n[r++], done: !n };
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
32
32
|
}
|
|
33
|
-
function $(
|
|
34
|
-
var e = typeof Symbol == "function" &&
|
|
33
|
+
function $(n, t) {
|
|
34
|
+
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
35
35
|
if (!e)
|
|
36
|
-
return
|
|
37
|
-
var r = e.call(
|
|
36
|
+
return n;
|
|
37
|
+
var r = e.call(n), s, i = [], o;
|
|
38
38
|
try {
|
|
39
|
-
for (; (t === void 0 || t-- > 0) && !(
|
|
40
|
-
i.push(
|
|
41
|
-
} catch (
|
|
42
|
-
o = { error:
|
|
39
|
+
for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )
|
|
40
|
+
i.push(s.value);
|
|
41
|
+
} catch (a) {
|
|
42
|
+
o = { error: a };
|
|
43
43
|
} finally {
|
|
44
44
|
try {
|
|
45
|
-
|
|
45
|
+
s && !s.done && (e = r.return) && e.call(r);
|
|
46
46
|
} finally {
|
|
47
47
|
if (o)
|
|
48
48
|
throw o.error;
|
|
@@ -50,57 +50,57 @@ function $(s, t) {
|
|
|
50
50
|
}
|
|
51
51
|
return i;
|
|
52
52
|
}
|
|
53
|
-
function k(
|
|
53
|
+
function k(n, t, e) {
|
|
54
54
|
if (e || arguments.length === 2)
|
|
55
|
-
for (var r = 0,
|
|
55
|
+
for (var r = 0, s = t.length, i; r < s; r++)
|
|
56
56
|
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
57
|
-
return
|
|
57
|
+
return n.concat(i || Array.prototype.slice.call(t));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return typeof
|
|
59
|
+
function S(n) {
|
|
60
|
+
return typeof n == "function";
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Z(n) {
|
|
63
63
|
var t = function(r) {
|
|
64
64
|
Error.call(r), r.stack = new Error().stack;
|
|
65
|
-
}, e =
|
|
65
|
+
}, e = n(t);
|
|
66
66
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var H = Z(function(n) {
|
|
69
69
|
return function(e) {
|
|
70
|
-
|
|
71
|
-
` + e.map(function(r,
|
|
72
|
-
return
|
|
70
|
+
n(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
71
|
+
` + e.map(function(r, s) {
|
|
72
|
+
return s + 1 + ") " + r.toString();
|
|
73
73
|
}).join(`
|
|
74
74
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
function
|
|
78
|
-
if (
|
|
79
|
-
var e =
|
|
80
|
-
0 <= e &&
|
|
77
|
+
function N(n, t) {
|
|
78
|
+
if (n) {
|
|
79
|
+
var e = n.indexOf(t);
|
|
80
|
+
0 <= e && n.splice(e, 1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
var x = function() {
|
|
84
|
-
function
|
|
84
|
+
function n(t) {
|
|
85
85
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
86
86
|
}
|
|
87
|
-
return
|
|
88
|
-
var t, e, r,
|
|
87
|
+
return n.prototype.unsubscribe = function() {
|
|
88
|
+
var t, e, r, s, i;
|
|
89
89
|
if (!this.closed) {
|
|
90
90
|
this.closed = !0;
|
|
91
91
|
var o = this._parentage;
|
|
92
92
|
if (o)
|
|
93
93
|
if (this._parentage = null, Array.isArray(o))
|
|
94
94
|
try {
|
|
95
|
-
for (var
|
|
96
|
-
var
|
|
97
|
-
|
|
95
|
+
for (var a = Q(o), c = a.next(); !c.done; c = a.next()) {
|
|
96
|
+
var l = c.value;
|
|
97
|
+
l.remove(this);
|
|
98
98
|
}
|
|
99
99
|
} catch (v) {
|
|
100
100
|
t = { error: v };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
c && !c.done && (e = a.return) && e.call(a);
|
|
104
104
|
} finally {
|
|
105
105
|
if (t)
|
|
106
106
|
throw t.error;
|
|
@@ -108,30 +108,30 @@ var x = function() {
|
|
|
108
108
|
}
|
|
109
109
|
else
|
|
110
110
|
o.remove(this);
|
|
111
|
-
var
|
|
112
|
-
if (
|
|
111
|
+
var d = this.initialTeardown;
|
|
112
|
+
if (S(d))
|
|
113
113
|
try {
|
|
114
|
-
|
|
114
|
+
d();
|
|
115
115
|
} catch (v) {
|
|
116
|
-
i = v instanceof
|
|
116
|
+
i = v instanceof H ? v.errors : [v];
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
118
|
+
var u = this._finalizers;
|
|
119
|
+
if (u) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var b = Q(
|
|
122
|
+
for (var b = Q(u), p = b.next(); !p.done; p = b.next()) {
|
|
123
123
|
var F = p.value;
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
ne(F);
|
|
126
126
|
} catch (v) {
|
|
127
|
-
i = i ?? [], v instanceof
|
|
127
|
+
i = i ?? [], v instanceof H ? i = k(k([], $(i)), $(v.errors)) : i.push(v);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
} catch (v) {
|
|
131
131
|
r = { error: v };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
p && !p.done && (
|
|
134
|
+
p && !p.done && (s = b.return) && s.call(b);
|
|
135
135
|
} finally {
|
|
136
136
|
if (r)
|
|
137
137
|
throw r.error;
|
|
@@ -139,43 +139,43 @@ var x = function() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
if (i)
|
|
142
|
-
throw new
|
|
142
|
+
throw new H(i);
|
|
143
143
|
}
|
|
144
|
-
},
|
|
144
|
+
}, n.prototype.add = function(t) {
|
|
145
145
|
var e;
|
|
146
146
|
if (t && t !== this)
|
|
147
147
|
if (this.closed)
|
|
148
|
-
|
|
148
|
+
ne(t);
|
|
149
149
|
else {
|
|
150
|
-
if (t instanceof
|
|
150
|
+
if (t instanceof n) {
|
|
151
151
|
if (t.closed || t._hasParent(this))
|
|
152
152
|
return;
|
|
153
153
|
t._addParent(this);
|
|
154
154
|
}
|
|
155
155
|
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, n.prototype._hasParent = function(t) {
|
|
158
158
|
var e = this._parentage;
|
|
159
159
|
return e === t || Array.isArray(e) && e.includes(t);
|
|
160
|
-
},
|
|
160
|
+
}, n.prototype._addParent = function(t) {
|
|
161
161
|
var e = this._parentage;
|
|
162
162
|
this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
|
|
163
|
-
},
|
|
163
|
+
}, n.prototype._removeParent = function(t) {
|
|
164
164
|
var e = this._parentage;
|
|
165
|
-
e === t ? this._parentage = null : Array.isArray(e) &&
|
|
166
|
-
},
|
|
165
|
+
e === t ? this._parentage = null : Array.isArray(e) && N(e, t);
|
|
166
|
+
}, n.prototype.remove = function(t) {
|
|
167
167
|
var e = this._finalizers;
|
|
168
|
-
e &&
|
|
169
|
-
},
|
|
170
|
-
var t = new
|
|
168
|
+
e && N(e, t), t instanceof n && t._removeParent(this);
|
|
169
|
+
}, n.EMPTY = function() {
|
|
170
|
+
var t = new n();
|
|
171
171
|
return t.closed = !0, t;
|
|
172
|
-
}(),
|
|
172
|
+
}(), n;
|
|
173
173
|
}(), ve = x.EMPTY;
|
|
174
|
-
function be(
|
|
175
|
-
return
|
|
174
|
+
function be(n) {
|
|
175
|
+
return n instanceof x || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
177
|
+
function ne(n) {
|
|
178
|
+
S(n) ? n() : n.unsubscribe();
|
|
179
179
|
}
|
|
180
180
|
var we = {
|
|
181
181
|
onUnhandledError: null,
|
|
@@ -183,36 +183,36 @@ var we = {
|
|
|
183
183
|
Promise: void 0,
|
|
184
184
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
185
185
|
useDeprecatedNextContext: !1
|
|
186
|
-
},
|
|
187
|
-
setTimeout: function(
|
|
186
|
+
}, Ce = {
|
|
187
|
+
setTimeout: function(n, t) {
|
|
188
188
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
189
189
|
e[r - 2] = arguments[r];
|
|
190
|
-
return setTimeout.apply(void 0, k([
|
|
190
|
+
return setTimeout.apply(void 0, k([n, t], $(e)));
|
|
191
191
|
},
|
|
192
|
-
clearTimeout: function(
|
|
193
|
-
var t =
|
|
194
|
-
return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(
|
|
192
|
+
clearTimeout: function(n) {
|
|
193
|
+
var t = Ce.delegate;
|
|
194
|
+
return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(n);
|
|
195
195
|
},
|
|
196
196
|
delegate: void 0
|
|
197
197
|
};
|
|
198
|
-
function _e(
|
|
199
|
-
|
|
200
|
-
throw
|
|
198
|
+
function _e(n) {
|
|
199
|
+
Ce.setTimeout(function() {
|
|
200
|
+
throw n;
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function ie() {
|
|
204
204
|
}
|
|
205
|
-
function O(
|
|
206
|
-
|
|
205
|
+
function O(n) {
|
|
206
|
+
n();
|
|
207
207
|
}
|
|
208
|
-
var
|
|
209
|
-
U(t,
|
|
208
|
+
var ee = function(n) {
|
|
209
|
+
U(t, n);
|
|
210
210
|
function t(e) {
|
|
211
|
-
var r =
|
|
211
|
+
var r = n.call(this) || this;
|
|
212
212
|
return r.isStopped = !1, e ? (r.destination = e, be(e) && e.add(r)) : r.destination = ke, r;
|
|
213
213
|
}
|
|
214
|
-
return t.create = function(e, r,
|
|
215
|
-
return new
|
|
214
|
+
return t.create = function(e, r, s) {
|
|
215
|
+
return new D(e, r, s);
|
|
216
216
|
}, t.prototype.next = function(e) {
|
|
217
217
|
this.isStopped || this._next(e);
|
|
218
218
|
}, t.prototype.error = function(e) {
|
|
@@ -220,7 +220,7 @@ var Z = function(s) {
|
|
|
220
220
|
}, t.prototype.complete = function() {
|
|
221
221
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
222
222
|
}, t.prototype.unsubscribe = function() {
|
|
223
|
-
this.closed || (this.isStopped = !0,
|
|
223
|
+
this.closed || (this.isStopped = !0, n.prototype.unsubscribe.call(this), this.destination = null);
|
|
224
224
|
}, t.prototype._next = function(e) {
|
|
225
225
|
this.destination.next(e);
|
|
226
226
|
}, t.prototype._error = function(e) {
|
|
@@ -237,167 +237,167 @@ var Z = function(s) {
|
|
|
237
237
|
}
|
|
238
238
|
}, t;
|
|
239
239
|
}(x), Le = Function.prototype.bind;
|
|
240
|
-
function
|
|
241
|
-
return Le.call(
|
|
240
|
+
function q(n, t) {
|
|
241
|
+
return Le.call(n, t);
|
|
242
242
|
}
|
|
243
243
|
var Oe = function() {
|
|
244
|
-
function
|
|
244
|
+
function n(t) {
|
|
245
245
|
this.partialObserver = t;
|
|
246
246
|
}
|
|
247
|
-
return
|
|
247
|
+
return n.prototype.next = function(t) {
|
|
248
248
|
var e = this.partialObserver;
|
|
249
249
|
if (e.next)
|
|
250
250
|
try {
|
|
251
251
|
e.next(t);
|
|
252
252
|
} catch (r) {
|
|
253
|
-
|
|
253
|
+
_(r);
|
|
254
254
|
}
|
|
255
|
-
},
|
|
255
|
+
}, n.prototype.error = function(t) {
|
|
256
256
|
var e = this.partialObserver;
|
|
257
257
|
if (e.error)
|
|
258
258
|
try {
|
|
259
259
|
e.error(t);
|
|
260
260
|
} catch (r) {
|
|
261
|
-
|
|
261
|
+
_(r);
|
|
262
262
|
}
|
|
263
263
|
else
|
|
264
|
-
|
|
265
|
-
},
|
|
264
|
+
_(t);
|
|
265
|
+
}, n.prototype.complete = function() {
|
|
266
266
|
var t = this.partialObserver;
|
|
267
267
|
if (t.complete)
|
|
268
268
|
try {
|
|
269
269
|
t.complete();
|
|
270
270
|
} catch (e) {
|
|
271
|
-
|
|
271
|
+
_(e);
|
|
272
272
|
}
|
|
273
|
-
},
|
|
274
|
-
}(),
|
|
275
|
-
U(t,
|
|
276
|
-
function t(e, r,
|
|
277
|
-
var i =
|
|
278
|
-
if (
|
|
273
|
+
}, n;
|
|
274
|
+
}(), D = function(n) {
|
|
275
|
+
U(t, n);
|
|
276
|
+
function t(e, r, s) {
|
|
277
|
+
var i = n.call(this) || this, o;
|
|
278
|
+
if (S(e) || !e)
|
|
279
279
|
o = {
|
|
280
280
|
next: e ?? void 0,
|
|
281
281
|
error: r ?? void 0,
|
|
282
|
-
complete:
|
|
282
|
+
complete: s ?? void 0
|
|
283
283
|
};
|
|
284
284
|
else {
|
|
285
|
-
var
|
|
286
|
-
i && we.useDeprecatedNextContext ? (
|
|
285
|
+
var a;
|
|
286
|
+
i && we.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
287
287
|
return i.unsubscribe();
|
|
288
288
|
}, o = {
|
|
289
|
-
next: e.next &&
|
|
290
|
-
error: e.error &&
|
|
291
|
-
complete: e.complete &&
|
|
289
|
+
next: e.next && q(e.next, a),
|
|
290
|
+
error: e.error && q(e.error, a),
|
|
291
|
+
complete: e.complete && q(e.complete, a)
|
|
292
292
|
}) : o = e;
|
|
293
293
|
}
|
|
294
294
|
return i.destination = new Oe(o), i;
|
|
295
295
|
}
|
|
296
296
|
return t;
|
|
297
|
-
}(
|
|
298
|
-
function
|
|
299
|
-
_e(
|
|
297
|
+
}(ee);
|
|
298
|
+
function _(n) {
|
|
299
|
+
_e(n);
|
|
300
300
|
}
|
|
301
|
-
function $e(
|
|
302
|
-
throw
|
|
301
|
+
function $e(n) {
|
|
302
|
+
throw n;
|
|
303
303
|
}
|
|
304
304
|
var ke = {
|
|
305
305
|
closed: !0,
|
|
306
|
-
next:
|
|
306
|
+
next: ie,
|
|
307
307
|
error: $e,
|
|
308
|
-
complete:
|
|
309
|
-
},
|
|
308
|
+
complete: ie
|
|
309
|
+
}, Ne = function() {
|
|
310
310
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
311
311
|
}();
|
|
312
|
-
function
|
|
313
|
-
return
|
|
312
|
+
function Se(n) {
|
|
313
|
+
return n;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
317
|
-
return
|
|
318
|
-
return
|
|
315
|
+
function De(n) {
|
|
316
|
+
return n.length === 0 ? Se : n.length === 1 ? n[0] : function(e) {
|
|
317
|
+
return n.reduce(function(r, s) {
|
|
318
|
+
return s(r);
|
|
319
319
|
}, e);
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
var
|
|
323
|
-
function
|
|
322
|
+
var Y = function() {
|
|
323
|
+
function n(t) {
|
|
324
324
|
t && (this._subscribe = t);
|
|
325
325
|
}
|
|
326
|
-
return
|
|
327
|
-
var e = new
|
|
326
|
+
return n.prototype.lift = function(t) {
|
|
327
|
+
var e = new n();
|
|
328
328
|
return e.source = this, e.operator = t, e;
|
|
329
|
-
},
|
|
330
|
-
var
|
|
329
|
+
}, n.prototype.subscribe = function(t, e, r) {
|
|
330
|
+
var s = this, i = Fe(t) ? t : new D(t, e, r);
|
|
331
331
|
return O(function() {
|
|
332
|
-
var o =
|
|
333
|
-
i.add(
|
|
332
|
+
var o = s, a = o.operator, c = o.source;
|
|
333
|
+
i.add(a ? a.call(i, c) : c ? s._subscribe(i) : s._trySubscribe(i));
|
|
334
334
|
}), i;
|
|
335
|
-
},
|
|
335
|
+
}, n.prototype._trySubscribe = function(t) {
|
|
336
336
|
try {
|
|
337
337
|
return this._subscribe(t);
|
|
338
338
|
} catch (e) {
|
|
339
339
|
t.error(e);
|
|
340
340
|
}
|
|
341
|
-
},
|
|
341
|
+
}, n.prototype.forEach = function(t, e) {
|
|
342
342
|
var r = this;
|
|
343
|
-
return e =
|
|
344
|
-
var o = new
|
|
345
|
-
next: function(
|
|
343
|
+
return e = oe(e), new e(function(s, i) {
|
|
344
|
+
var o = new D({
|
|
345
|
+
next: function(a) {
|
|
346
346
|
try {
|
|
347
|
-
t(
|
|
348
|
-
} catch (
|
|
349
|
-
i(
|
|
347
|
+
t(a);
|
|
348
|
+
} catch (c) {
|
|
349
|
+
i(c), o.unsubscribe();
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
error: i,
|
|
353
|
-
complete:
|
|
353
|
+
complete: s
|
|
354
354
|
});
|
|
355
355
|
r.subscribe(o);
|
|
356
356
|
});
|
|
357
|
-
},
|
|
357
|
+
}, n.prototype._subscribe = function(t) {
|
|
358
358
|
var e;
|
|
359
359
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
360
|
-
},
|
|
360
|
+
}, n.prototype[Ne] = function() {
|
|
361
361
|
return this;
|
|
362
|
-
},
|
|
362
|
+
}, n.prototype.pipe = function() {
|
|
363
363
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
364
364
|
t[e] = arguments[e];
|
|
365
|
-
return
|
|
366
|
-
},
|
|
365
|
+
return De(t)(this);
|
|
366
|
+
}, n.prototype.toPromise = function(t) {
|
|
367
367
|
var e = this;
|
|
368
|
-
return t =
|
|
368
|
+
return t = oe(t), new t(function(r, s) {
|
|
369
369
|
var i;
|
|
370
370
|
e.subscribe(function(o) {
|
|
371
371
|
return i = o;
|
|
372
372
|
}, function(o) {
|
|
373
|
-
return
|
|
373
|
+
return s(o);
|
|
374
374
|
}, function() {
|
|
375
375
|
return r(i);
|
|
376
376
|
});
|
|
377
377
|
});
|
|
378
|
-
},
|
|
379
|
-
return new
|
|
380
|
-
},
|
|
378
|
+
}, n.create = function(t) {
|
|
379
|
+
return new n(t);
|
|
380
|
+
}, n;
|
|
381
381
|
}();
|
|
382
|
-
function
|
|
382
|
+
function oe(n) {
|
|
383
383
|
var t;
|
|
384
|
-
return (t =
|
|
384
|
+
return (t = n ?? we.Promise) !== null && t !== void 0 ? t : Promise;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
return
|
|
386
|
+
function Ve(n) {
|
|
387
|
+
return n && S(n.next) && S(n.error) && S(n.complete);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
return
|
|
389
|
+
function Fe(n) {
|
|
390
|
+
return n && n instanceof ee || Ve(n) && be(n);
|
|
391
391
|
}
|
|
392
|
-
function He(
|
|
393
|
-
return
|
|
392
|
+
function He(n) {
|
|
393
|
+
return S(n == null ? void 0 : n.lift);
|
|
394
394
|
}
|
|
395
|
-
function Ee(
|
|
395
|
+
function Ee(n) {
|
|
396
396
|
return function(t) {
|
|
397
397
|
if (He(t))
|
|
398
398
|
return t.lift(function(e) {
|
|
399
399
|
try {
|
|
400
|
-
return
|
|
400
|
+
return n(e, this);
|
|
401
401
|
} catch (r) {
|
|
402
402
|
this.error(r);
|
|
403
403
|
}
|
|
@@ -405,79 +405,79 @@ function Ee(s) {
|
|
|
405
405
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
return new
|
|
408
|
+
function Ie(n, t, e, r, s) {
|
|
409
|
+
return new qe(n, t, e, r, s);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
412
|
-
U(t,
|
|
413
|
-
function t(e, r,
|
|
414
|
-
var
|
|
415
|
-
return
|
|
411
|
+
var qe = function(n) {
|
|
412
|
+
U(t, n);
|
|
413
|
+
function t(e, r, s, i, o, a) {
|
|
414
|
+
var c = n.call(this, e) || this;
|
|
415
|
+
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
|
|
416
416
|
try {
|
|
417
|
-
r(
|
|
418
|
-
} catch (
|
|
419
|
-
e.error(
|
|
417
|
+
r(l);
|
|
418
|
+
} catch (d) {
|
|
419
|
+
e.error(d);
|
|
420
420
|
}
|
|
421
|
-
} :
|
|
421
|
+
} : n.prototype._next, c._error = i ? function(l) {
|
|
422
422
|
try {
|
|
423
|
-
i(
|
|
424
|
-
} catch (
|
|
425
|
-
e.error(
|
|
423
|
+
i(l);
|
|
424
|
+
} catch (d) {
|
|
425
|
+
e.error(d);
|
|
426
426
|
} finally {
|
|
427
427
|
this.unsubscribe();
|
|
428
428
|
}
|
|
429
|
-
} :
|
|
429
|
+
} : n.prototype._error, c._complete = s ? function() {
|
|
430
430
|
try {
|
|
431
|
-
|
|
432
|
-
} catch (
|
|
433
|
-
e.error(
|
|
431
|
+
s();
|
|
432
|
+
} catch (l) {
|
|
433
|
+
e.error(l);
|
|
434
434
|
} finally {
|
|
435
435
|
this.unsubscribe();
|
|
436
436
|
}
|
|
437
|
-
} :
|
|
437
|
+
} : n.prototype._complete, c;
|
|
438
438
|
}
|
|
439
439
|
return t.prototype.unsubscribe = function() {
|
|
440
440
|
var e;
|
|
441
441
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
442
442
|
var r = this.closed;
|
|
443
|
-
|
|
443
|
+
n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
444
444
|
}
|
|
445
445
|
}, t;
|
|
446
|
-
}(
|
|
446
|
+
}(ee), je = Z(function(n) {
|
|
447
447
|
return function() {
|
|
448
|
-
|
|
448
|
+
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
449
449
|
};
|
|
450
|
-
}),
|
|
451
|
-
U(t,
|
|
450
|
+
}), Me = function(n) {
|
|
451
|
+
U(t, n);
|
|
452
452
|
function t() {
|
|
453
|
-
var e =
|
|
453
|
+
var e = n.call(this) || this;
|
|
454
454
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
455
455
|
}
|
|
456
456
|
return t.prototype.lift = function(e) {
|
|
457
|
-
var r = new
|
|
457
|
+
var r = new ce(this, this);
|
|
458
458
|
return r.operator = e, r;
|
|
459
459
|
}, t.prototype._throwIfClosed = function() {
|
|
460
460
|
if (this.closed)
|
|
461
|
-
throw new
|
|
461
|
+
throw new je();
|
|
462
462
|
}, t.prototype.next = function(e) {
|
|
463
463
|
var r = this;
|
|
464
464
|
O(function() {
|
|
465
|
-
var
|
|
465
|
+
var s, i;
|
|
466
466
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
467
467
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
468
468
|
try {
|
|
469
|
-
for (var o = Q(r.currentObservers),
|
|
470
|
-
var
|
|
471
|
-
|
|
469
|
+
for (var o = Q(r.currentObservers), a = o.next(); !a.done; a = o.next()) {
|
|
470
|
+
var c = a.value;
|
|
471
|
+
c.next(e);
|
|
472
472
|
}
|
|
473
|
-
} catch (
|
|
474
|
-
|
|
473
|
+
} catch (l) {
|
|
474
|
+
s = { error: l };
|
|
475
475
|
} finally {
|
|
476
476
|
try {
|
|
477
|
-
|
|
477
|
+
a && !a.done && (i = o.return) && i.call(o);
|
|
478
478
|
} finally {
|
|
479
|
-
if (
|
|
480
|
-
throw
|
|
479
|
+
if (s)
|
|
480
|
+
throw s.error;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
@@ -487,8 +487,8 @@ var je = function(s) {
|
|
|
487
487
|
O(function() {
|
|
488
488
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
489
489
|
r.hasError = r.isStopped = !0, r.thrownError = e;
|
|
490
|
-
for (var
|
|
491
|
-
|
|
490
|
+
for (var s = r.observers; s.length; )
|
|
491
|
+
s.shift().error(e);
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
494
|
}, t.prototype.complete = function() {
|
|
@@ -510,121 +510,121 @@ var je = function(s) {
|
|
|
510
510
|
enumerable: !1,
|
|
511
511
|
configurable: !0
|
|
512
512
|
}), t.prototype._trySubscribe = function(e) {
|
|
513
|
-
return this._throwIfClosed(),
|
|
513
|
+
return this._throwIfClosed(), n.prototype._trySubscribe.call(this, e);
|
|
514
514
|
}, t.prototype._subscribe = function(e) {
|
|
515
515
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
516
516
|
}, t.prototype._innerSubscribe = function(e) {
|
|
517
|
-
var r = this,
|
|
518
|
-
return i || o ? ve : (this.currentObservers = null,
|
|
519
|
-
r.currentObservers = null,
|
|
517
|
+
var r = this, s = this, i = s.hasError, o = s.isStopped, a = s.observers;
|
|
518
|
+
return i || o ? ve : (this.currentObservers = null, a.push(e), new x(function() {
|
|
519
|
+
r.currentObservers = null, N(a, e);
|
|
520
520
|
}));
|
|
521
521
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
522
|
-
var r = this,
|
|
523
|
-
|
|
522
|
+
var r = this, s = r.hasError, i = r.thrownError, o = r.isStopped;
|
|
523
|
+
s ? e.error(i) : o && e.complete();
|
|
524
524
|
}, t.prototype.asObservable = function() {
|
|
525
|
-
var e = new
|
|
525
|
+
var e = new Y();
|
|
526
526
|
return e.source = this, e;
|
|
527
527
|
}, t.create = function(e, r) {
|
|
528
|
-
return new
|
|
528
|
+
return new ce(e, r);
|
|
529
529
|
}, t;
|
|
530
|
-
}(
|
|
531
|
-
U(t,
|
|
530
|
+
}(Y), ce = function(n) {
|
|
531
|
+
U(t, n);
|
|
532
532
|
function t(e, r) {
|
|
533
|
-
var
|
|
534
|
-
return
|
|
533
|
+
var s = n.call(this) || this;
|
|
534
|
+
return s.destination = e, s.source = r, s;
|
|
535
535
|
}
|
|
536
536
|
return t.prototype.next = function(e) {
|
|
537
|
-
var r,
|
|
538
|
-
(
|
|
537
|
+
var r, s;
|
|
538
|
+
(s = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || s === void 0 || s.call(r, e);
|
|
539
539
|
}, t.prototype.error = function(e) {
|
|
540
|
-
var r,
|
|
541
|
-
(
|
|
540
|
+
var r, s;
|
|
541
|
+
(s = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || s === void 0 || s.call(r, e);
|
|
542
542
|
}, t.prototype.complete = function() {
|
|
543
543
|
var e, r;
|
|
544
544
|
(r = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || r === void 0 || r.call(e);
|
|
545
545
|
}, t.prototype._subscribe = function(e) {
|
|
546
|
-
var r,
|
|
547
|
-
return (
|
|
546
|
+
var r, s;
|
|
547
|
+
return (s = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && s !== void 0 ? s : ve;
|
|
548
548
|
}, t;
|
|
549
|
-
}(
|
|
549
|
+
}(Me), Be = {
|
|
550
550
|
now: function() {
|
|
551
551
|
return Date.now();
|
|
552
552
|
},
|
|
553
553
|
delegate: void 0
|
|
554
|
-
},
|
|
555
|
-
U(t,
|
|
554
|
+
}, Ge = function(n) {
|
|
555
|
+
U(t, n);
|
|
556
556
|
function t(e, r) {
|
|
557
|
-
return
|
|
557
|
+
return n.call(this) || this;
|
|
558
558
|
}
|
|
559
559
|
return t.prototype.schedule = function(e, r) {
|
|
560
560
|
return this;
|
|
561
561
|
}, t;
|
|
562
|
-
}(x),
|
|
563
|
-
setInterval: function(
|
|
562
|
+
}(x), z = {
|
|
563
|
+
setInterval: function(n, t) {
|
|
564
564
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
565
565
|
e[r - 2] = arguments[r];
|
|
566
|
-
return setInterval.apply(void 0, k([
|
|
566
|
+
return setInterval.apply(void 0, k([n, t], $(e)));
|
|
567
567
|
},
|
|
568
|
-
clearInterval: function(
|
|
569
|
-
var t =
|
|
570
|
-
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(
|
|
568
|
+
clearInterval: function(n) {
|
|
569
|
+
var t = z.delegate;
|
|
570
|
+
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
|
|
571
571
|
},
|
|
572
572
|
delegate: void 0
|
|
573
|
-
},
|
|
574
|
-
U(t,
|
|
573
|
+
}, Qe = function(n) {
|
|
574
|
+
U(t, n);
|
|
575
575
|
function t(e, r) {
|
|
576
|
-
var
|
|
577
|
-
return
|
|
576
|
+
var s = n.call(this, e, r) || this;
|
|
577
|
+
return s.scheduler = e, s.work = r, s.pending = !1, s;
|
|
578
578
|
}
|
|
579
579
|
return t.prototype.schedule = function(e, r) {
|
|
580
|
-
var
|
|
580
|
+
var s;
|
|
581
581
|
if (r === void 0 && (r = 0), this.closed)
|
|
582
582
|
return this;
|
|
583
583
|
this.state = e;
|
|
584
584
|
var i = this.id, o = this.scheduler;
|
|
585
|
-
return i != null && (this.id = this.recycleAsyncId(o, i, r)), this.pending = !0, this.delay = r, this.id = (
|
|
586
|
-
}, t.prototype.requestAsyncId = function(e, r,
|
|
587
|
-
return
|
|
588
|
-
}, t.prototype.recycleAsyncId = function(e, r,
|
|
589
|
-
if (
|
|
585
|
+
return i != null && (this.id = this.recycleAsyncId(o, i, r)), this.pending = !0, this.delay = r, this.id = (s = this.id) !== null && s !== void 0 ? s : this.requestAsyncId(o, this.id, r), this;
|
|
586
|
+
}, t.prototype.requestAsyncId = function(e, r, s) {
|
|
587
|
+
return s === void 0 && (s = 0), z.setInterval(e.flush.bind(e, this), s);
|
|
588
|
+
}, t.prototype.recycleAsyncId = function(e, r, s) {
|
|
589
|
+
if (s === void 0 && (s = 0), s != null && this.delay === s && this.pending === !1)
|
|
590
590
|
return r;
|
|
591
|
-
r != null &&
|
|
591
|
+
r != null && z.clearInterval(r);
|
|
592
592
|
}, t.prototype.execute = function(e, r) {
|
|
593
593
|
if (this.closed)
|
|
594
594
|
return new Error("executing a cancelled action");
|
|
595
595
|
this.pending = !1;
|
|
596
|
-
var
|
|
597
|
-
if (
|
|
598
|
-
return
|
|
596
|
+
var s = this._execute(e, r);
|
|
597
|
+
if (s)
|
|
598
|
+
return s;
|
|
599
599
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
600
600
|
}, t.prototype._execute = function(e, r) {
|
|
601
|
-
var
|
|
601
|
+
var s = !1, i;
|
|
602
602
|
try {
|
|
603
603
|
this.work(e);
|
|
604
604
|
} catch (o) {
|
|
605
|
-
|
|
605
|
+
s = !0, i = o || new Error("Scheduled action threw falsy error");
|
|
606
606
|
}
|
|
607
|
-
if (
|
|
607
|
+
if (s)
|
|
608
608
|
return this.unsubscribe(), i;
|
|
609
609
|
}, t.prototype.unsubscribe = function() {
|
|
610
610
|
if (!this.closed) {
|
|
611
|
-
var e = this, r = e.id,
|
|
612
|
-
this.work = this.state = this.scheduler = null, this.pending = !1,
|
|
611
|
+
var e = this, r = e.id, s = e.scheduler, i = s.actions;
|
|
612
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, N(i, this), r != null && (this.id = this.recycleAsyncId(s, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
613
613
|
}
|
|
614
614
|
}, t;
|
|
615
|
-
}(
|
|
616
|
-
function
|
|
617
|
-
e === void 0 && (e =
|
|
615
|
+
}(Ge), ae = function() {
|
|
616
|
+
function n(t, e) {
|
|
617
|
+
e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
|
|
618
618
|
}
|
|
619
|
-
return
|
|
619
|
+
return n.prototype.schedule = function(t, e, r) {
|
|
620
620
|
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(r, e);
|
|
621
|
-
},
|
|
622
|
-
}(), Ye = function(
|
|
623
|
-
U(t,
|
|
621
|
+
}, n.now = Be.now, n;
|
|
622
|
+
}(), Ye = function(n) {
|
|
623
|
+
U(t, n);
|
|
624
624
|
function t(e, r) {
|
|
625
|
-
r === void 0 && (r =
|
|
626
|
-
var
|
|
627
|
-
return
|
|
625
|
+
r === void 0 && (r = ae.now);
|
|
626
|
+
var s = n.call(this, e, r) || this;
|
|
627
|
+
return s.actions = [], s._active = !1, s;
|
|
628
628
|
}
|
|
629
629
|
return t.prototype.flush = function(e) {
|
|
630
630
|
var r = this.actions;
|
|
@@ -632,98 +632,98 @@ var je = function(s) {
|
|
|
632
632
|
r.push(e);
|
|
633
633
|
return;
|
|
634
634
|
}
|
|
635
|
-
var
|
|
635
|
+
var s;
|
|
636
636
|
this._active = !0;
|
|
637
637
|
do
|
|
638
|
-
if (
|
|
638
|
+
if (s = e.execute(e.state, e.delay))
|
|
639
639
|
break;
|
|
640
640
|
while (e = r.shift());
|
|
641
|
-
if (this._active = !1,
|
|
641
|
+
if (this._active = !1, s) {
|
|
642
642
|
for (; e = r.shift(); )
|
|
643
643
|
e.unsubscribe();
|
|
644
|
-
throw
|
|
644
|
+
throw s;
|
|
645
645
|
}
|
|
646
646
|
}, t;
|
|
647
|
-
}(
|
|
648
|
-
function We(
|
|
649
|
-
return
|
|
647
|
+
}(ae), ze = new Ye(Qe), Je = ze;
|
|
648
|
+
function We(n) {
|
|
649
|
+
return n && S(n.schedule);
|
|
650
650
|
}
|
|
651
|
-
var Ke =
|
|
651
|
+
var Ke = Z(function(n) {
|
|
652
652
|
return function() {
|
|
653
|
-
|
|
653
|
+
n(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
654
654
|
};
|
|
655
655
|
});
|
|
656
|
-
function T(
|
|
656
|
+
function T(n, t) {
|
|
657
657
|
var e = typeof t == "object";
|
|
658
|
-
return new Promise(function(r,
|
|
659
|
-
var i = new
|
|
658
|
+
return new Promise(function(r, s) {
|
|
659
|
+
var i = new D({
|
|
660
660
|
next: function(o) {
|
|
661
661
|
r(o), i.unsubscribe();
|
|
662
662
|
},
|
|
663
|
-
error:
|
|
663
|
+
error: s,
|
|
664
664
|
complete: function() {
|
|
665
|
-
e ? r(t.defaultValue) :
|
|
665
|
+
e ? r(t.defaultValue) : s(new Ke());
|
|
666
666
|
}
|
|
667
667
|
});
|
|
668
|
-
|
|
668
|
+
n.subscribe(i);
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
|
-
function Xe(
|
|
672
|
-
return
|
|
671
|
+
function Xe(n) {
|
|
672
|
+
return n instanceof Date && !isNaN(n);
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function R(n, t) {
|
|
675
675
|
return Ee(function(e, r) {
|
|
676
|
-
var
|
|
677
|
-
e.subscribe(
|
|
678
|
-
r.next(
|
|
676
|
+
var s = 0;
|
|
677
|
+
e.subscribe(Ie(r, function(i) {
|
|
678
|
+
r.next(n.call(t, i, s++));
|
|
679
679
|
}));
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
|
-
function Ze(
|
|
683
|
-
|
|
682
|
+
function Ze(n, t, e) {
|
|
683
|
+
n === void 0 && (n = 0), e === void 0 && (e = Je);
|
|
684
684
|
var r = -1;
|
|
685
|
-
return t != null && (We(t) ? e = t : r = t), new
|
|
686
|
-
var i = Xe(
|
|
685
|
+
return t != null && (We(t) ? e = t : r = t), new Y(function(s) {
|
|
686
|
+
var i = Xe(n) ? +n - e.now() : n;
|
|
687
687
|
i < 0 && (i = 0);
|
|
688
688
|
var o = 0;
|
|
689
689
|
return e.schedule(function() {
|
|
690
|
-
|
|
690
|
+
s.closed || (s.next(o++), 0 <= r ? this.schedule(void 0, r) : s.complete());
|
|
691
691
|
}, i);
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
|
-
function et(
|
|
695
|
-
var r =
|
|
696
|
-
return r ? Ee(function(
|
|
694
|
+
function et(n, t, e) {
|
|
695
|
+
var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
696
|
+
return r ? Ee(function(s, i) {
|
|
697
697
|
var o;
|
|
698
698
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
699
|
-
var
|
|
700
|
-
|
|
701
|
-
var
|
|
702
|
-
(
|
|
699
|
+
var a = !0;
|
|
700
|
+
s.subscribe(Ie(i, function(c) {
|
|
701
|
+
var l;
|
|
702
|
+
(l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
|
|
703
703
|
}, function() {
|
|
704
|
-
var
|
|
705
|
-
|
|
706
|
-
}, function(
|
|
707
|
-
var
|
|
708
|
-
|
|
704
|
+
var c;
|
|
705
|
+
a = !1, (c = r.complete) === null || c === void 0 || c.call(r), i.complete();
|
|
706
|
+
}, function(c) {
|
|
707
|
+
var l;
|
|
708
|
+
a = !1, (l = r.error) === null || l === void 0 || l.call(r, c), i.error(c);
|
|
709
709
|
}, function() {
|
|
710
|
-
var
|
|
711
|
-
|
|
710
|
+
var c, l;
|
|
711
|
+
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
|
|
712
712
|
}));
|
|
713
|
-
}) :
|
|
713
|
+
}) : Se;
|
|
714
714
|
}
|
|
715
|
-
var tt = Object.defineProperty, rt = (
|
|
716
|
-
class
|
|
715
|
+
var tt = Object.defineProperty, rt = (n, t, e) => t in n ? tt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, M = (n, t, e) => (rt(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
716
|
+
class h extends Error {
|
|
717
717
|
constructor(t) {
|
|
718
|
-
super(`Incorrect context (${t}). Cannot perform the requested operation.`),
|
|
718
|
+
super(`Incorrect context (${t}). Cannot perform the requested operation.`), M(this, "context"), this.context = t;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class
|
|
721
|
+
class m extends Error {
|
|
722
722
|
constructor(t, e, r) {
|
|
723
723
|
super(`Invalid parameter (${t}). ${r}`), this.param = t, this.value = e, this.reason = r;
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
class
|
|
726
|
+
class le extends Error {
|
|
727
727
|
constructor(t, e) {
|
|
728
728
|
super(
|
|
729
729
|
`'streamId' value of "${t}" is different from what we expected ("${e}")`
|
|
@@ -740,24 +740,24 @@ class ue extends Error {
|
|
|
740
740
|
super(`${t} needs to be initialized before it can be used.`);
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
class
|
|
743
|
+
class V extends Error {
|
|
744
744
|
constructor(t, e) {
|
|
745
745
|
let r = `Unsupported Protocol ${Array.isArray(t) ? "versions" : "version"}: (${t}).`;
|
|
746
746
|
e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
function E(
|
|
750
|
-
return typeof
|
|
749
|
+
function E(n) {
|
|
750
|
+
return typeof n == "function";
|
|
751
751
|
}
|
|
752
|
-
function nt(
|
|
753
|
-
return E(
|
|
752
|
+
function nt(n) {
|
|
753
|
+
return E(n == null ? void 0 : n.lift);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function A(n) {
|
|
756
756
|
return function(t) {
|
|
757
757
|
if (nt(t))
|
|
758
758
|
return t.lift(function(e) {
|
|
759
759
|
try {
|
|
760
|
-
return
|
|
760
|
+
return n(e, this);
|
|
761
761
|
} catch (r) {
|
|
762
762
|
this.error(r);
|
|
763
763
|
}
|
|
@@ -765,48 +765,48 @@ function R(s) {
|
|
|
765
765
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
|
-
var
|
|
769
|
-
return
|
|
768
|
+
var J = function(n, t) {
|
|
769
|
+
return J = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
770
770
|
e.__proto__ = r;
|
|
771
771
|
} || function(e, r) {
|
|
772
|
-
for (var
|
|
773
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
774
|
-
},
|
|
772
|
+
for (var s in r)
|
|
773
|
+
Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
774
|
+
}, J(n, t);
|
|
775
775
|
};
|
|
776
|
-
function
|
|
776
|
+
function te(n, t) {
|
|
777
777
|
if (typeof t != "function" && t !== null)
|
|
778
778
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
779
|
-
|
|
779
|
+
J(n, t);
|
|
780
780
|
function e() {
|
|
781
|
-
this.constructor =
|
|
781
|
+
this.constructor = n;
|
|
782
782
|
}
|
|
783
|
-
|
|
783
|
+
n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
784
784
|
}
|
|
785
|
-
function he(
|
|
786
|
-
var t = typeof Symbol == "function" && Symbol.iterator, e = t &&
|
|
785
|
+
function he(n) {
|
|
786
|
+
var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], r = 0;
|
|
787
787
|
if (e)
|
|
788
|
-
return e.call(
|
|
789
|
-
if (
|
|
788
|
+
return e.call(n);
|
|
789
|
+
if (n && typeof n.length == "number")
|
|
790
790
|
return {
|
|
791
791
|
next: function() {
|
|
792
|
-
return
|
|
792
|
+
return n && r >= n.length && (n = void 0), { value: n && n[r++], done: !n };
|
|
793
793
|
}
|
|
794
794
|
};
|
|
795
795
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
var e = typeof Symbol == "function" &&
|
|
797
|
+
function W(n, t) {
|
|
798
|
+
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
799
799
|
if (!e)
|
|
800
|
-
return
|
|
801
|
-
var r = e.call(
|
|
800
|
+
return n;
|
|
801
|
+
var r = e.call(n), s, i = [], o;
|
|
802
802
|
try {
|
|
803
|
-
for (; (t === void 0 || t-- > 0) && !(
|
|
804
|
-
i.push(
|
|
805
|
-
} catch (
|
|
806
|
-
o = { error:
|
|
803
|
+
for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )
|
|
804
|
+
i.push(s.value);
|
|
805
|
+
} catch (a) {
|
|
806
|
+
o = { error: a };
|
|
807
807
|
} finally {
|
|
808
808
|
try {
|
|
809
|
-
|
|
809
|
+
s && !s.done && (e = r.return) && e.call(r);
|
|
810
810
|
} finally {
|
|
811
811
|
if (o)
|
|
812
812
|
throw o.error;
|
|
@@ -814,54 +814,54 @@ function J(s, t) {
|
|
|
814
814
|
}
|
|
815
815
|
return i;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function K(n, t, e) {
|
|
818
818
|
if (e || arguments.length === 2)
|
|
819
|
-
for (var r = 0,
|
|
819
|
+
for (var r = 0, s = t.length, i; r < s; r++)
|
|
820
820
|
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
821
|
-
return
|
|
821
|
+
return n.concat(i || Array.prototype.slice.call(t));
|
|
822
822
|
}
|
|
823
|
-
function it(
|
|
823
|
+
function it(n) {
|
|
824
824
|
var t = function(r) {
|
|
825
825
|
Error.call(r), r.stack = new Error().stack;
|
|
826
|
-
}, e =
|
|
826
|
+
}, e = n(t);
|
|
827
827
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
828
828
|
}
|
|
829
|
-
var j = it(function(
|
|
829
|
+
var j = it(function(n) {
|
|
830
830
|
return function(t) {
|
|
831
|
-
|
|
831
|
+
n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
|
832
832
|
` + t.map(function(e, r) {
|
|
833
833
|
return r + 1 + ") " + e.toString();
|
|
834
834
|
}).join(`
|
|
835
835
|
`) : "", this.name = "UnsubscriptionError", this.errors = t;
|
|
836
836
|
};
|
|
837
837
|
});
|
|
838
|
-
function de(
|
|
839
|
-
if (
|
|
840
|
-
var e =
|
|
841
|
-
0 <= e &&
|
|
838
|
+
function de(n, t) {
|
|
839
|
+
if (n) {
|
|
840
|
+
var e = n.indexOf(t);
|
|
841
|
+
0 <= e && n.splice(e, 1);
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
|
-
var
|
|
845
|
-
function
|
|
844
|
+
var re = function() {
|
|
845
|
+
function n(t) {
|
|
846
846
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
847
847
|
}
|
|
848
|
-
return
|
|
849
|
-
var t, e, r,
|
|
848
|
+
return n.prototype.unsubscribe = function() {
|
|
849
|
+
var t, e, r, s, i;
|
|
850
850
|
if (!this.closed) {
|
|
851
851
|
this.closed = !0;
|
|
852
852
|
var o = this._parentage;
|
|
853
853
|
if (o)
|
|
854
854
|
if (this._parentage = null, Array.isArray(o))
|
|
855
855
|
try {
|
|
856
|
-
for (var
|
|
857
|
-
var
|
|
858
|
-
|
|
856
|
+
for (var a = he(o), c = a.next(); !c.done; c = a.next()) {
|
|
857
|
+
var l = c.value;
|
|
858
|
+
l.remove(this);
|
|
859
859
|
}
|
|
860
860
|
} catch (v) {
|
|
861
861
|
t = { error: v };
|
|
862
862
|
} finally {
|
|
863
863
|
try {
|
|
864
|
-
|
|
864
|
+
c && !c.done && (e = a.return) && e.call(a);
|
|
865
865
|
} finally {
|
|
866
866
|
if (t)
|
|
867
867
|
throw t.error;
|
|
@@ -869,30 +869,30 @@ var te = function() {
|
|
|
869
869
|
}
|
|
870
870
|
else
|
|
871
871
|
o.remove(this);
|
|
872
|
-
var
|
|
873
|
-
if (E(
|
|
872
|
+
var d = this.initialTeardown;
|
|
873
|
+
if (E(d))
|
|
874
874
|
try {
|
|
875
|
-
|
|
875
|
+
d();
|
|
876
876
|
} catch (v) {
|
|
877
877
|
i = v instanceof j ? v.errors : [v];
|
|
878
878
|
}
|
|
879
|
-
var
|
|
880
|
-
if (
|
|
879
|
+
var u = this._finalizers;
|
|
880
|
+
if (u) {
|
|
881
881
|
this._finalizers = null;
|
|
882
882
|
try {
|
|
883
|
-
for (var b = he(
|
|
883
|
+
for (var b = he(u), p = b.next(); !p.done; p = b.next()) {
|
|
884
884
|
var F = p.value;
|
|
885
885
|
try {
|
|
886
886
|
pe(F);
|
|
887
887
|
} catch (v) {
|
|
888
|
-
i = i ?? [], v instanceof j ? i =
|
|
888
|
+
i = i ?? [], v instanceof j ? i = K(K([], W(i)), W(v.errors)) : i.push(v);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
} catch (v) {
|
|
892
892
|
r = { error: v };
|
|
893
893
|
} finally {
|
|
894
894
|
try {
|
|
895
|
-
p && !p.done && (
|
|
895
|
+
p && !p.done && (s = b.return) && s.call(b);
|
|
896
896
|
} finally {
|
|
897
897
|
if (r)
|
|
898
898
|
throw r.error;
|
|
@@ -902,42 +902,42 @@ var te = function() {
|
|
|
902
902
|
if (i)
|
|
903
903
|
throw new j(i);
|
|
904
904
|
}
|
|
905
|
-
},
|
|
905
|
+
}, n.prototype.add = function(t) {
|
|
906
906
|
var e;
|
|
907
907
|
if (t && t !== this)
|
|
908
908
|
if (this.closed)
|
|
909
909
|
pe(t);
|
|
910
910
|
else {
|
|
911
|
-
if (t instanceof
|
|
911
|
+
if (t instanceof n) {
|
|
912
912
|
if (t.closed || t._hasParent(this))
|
|
913
913
|
return;
|
|
914
914
|
t._addParent(this);
|
|
915
915
|
}
|
|
916
916
|
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
|
|
917
917
|
}
|
|
918
|
-
},
|
|
918
|
+
}, n.prototype._hasParent = function(t) {
|
|
919
919
|
var e = this._parentage;
|
|
920
920
|
return e === t || Array.isArray(e) && e.includes(t);
|
|
921
|
-
},
|
|
921
|
+
}, n.prototype._addParent = function(t) {
|
|
922
922
|
var e = this._parentage;
|
|
923
923
|
this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
|
|
924
|
-
},
|
|
924
|
+
}, n.prototype._removeParent = function(t) {
|
|
925
925
|
var e = this._parentage;
|
|
926
926
|
e === t ? this._parentage = null : Array.isArray(e) && de(e, t);
|
|
927
|
-
},
|
|
927
|
+
}, n.prototype.remove = function(t) {
|
|
928
928
|
var e = this._finalizers;
|
|
929
|
-
e && de(e, t), t instanceof
|
|
930
|
-
},
|
|
931
|
-
var t = new
|
|
929
|
+
e && de(e, t), t instanceof n && t._removeParent(this);
|
|
930
|
+
}, n.EMPTY = function() {
|
|
931
|
+
var t = new n();
|
|
932
932
|
return t.closed = !0, t;
|
|
933
|
-
}(),
|
|
933
|
+
}(), n;
|
|
934
934
|
}();
|
|
935
|
-
|
|
936
|
-
function Ue(
|
|
937
|
-
return
|
|
935
|
+
re.EMPTY;
|
|
936
|
+
function Ue(n) {
|
|
937
|
+
return n instanceof re || n && "closed" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);
|
|
938
938
|
}
|
|
939
|
-
function pe(
|
|
940
|
-
E(
|
|
939
|
+
function pe(n) {
|
|
940
|
+
E(n) ? n() : n.unsubscribe();
|
|
941
941
|
}
|
|
942
942
|
var Te = {
|
|
943
943
|
onUnhandledError: null,
|
|
@@ -946,34 +946,34 @@ var Te = {
|
|
|
946
946
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
947
947
|
useDeprecatedNextContext: !1
|
|
948
948
|
}, ot = {
|
|
949
|
-
setTimeout: function(
|
|
949
|
+
setTimeout: function(n, t) {
|
|
950
950
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
951
951
|
e[r - 2] = arguments[r];
|
|
952
|
-
return setTimeout.apply(void 0,
|
|
952
|
+
return setTimeout.apply(void 0, K([n, t], W(e)));
|
|
953
953
|
},
|
|
954
|
-
clearTimeout: function(
|
|
955
|
-
return clearTimeout(
|
|
954
|
+
clearTimeout: function(n) {
|
|
955
|
+
return clearTimeout(n);
|
|
956
956
|
},
|
|
957
957
|
delegate: void 0
|
|
958
958
|
};
|
|
959
|
-
function ct(
|
|
959
|
+
function ct(n) {
|
|
960
960
|
ot.setTimeout(function() {
|
|
961
|
-
throw
|
|
961
|
+
throw n;
|
|
962
962
|
});
|
|
963
963
|
}
|
|
964
964
|
function fe() {
|
|
965
965
|
}
|
|
966
|
-
function at(
|
|
967
|
-
|
|
966
|
+
function at(n) {
|
|
967
|
+
n();
|
|
968
968
|
}
|
|
969
|
-
var
|
|
970
|
-
|
|
969
|
+
var se = function(n) {
|
|
970
|
+
te(t, n);
|
|
971
971
|
function t(e) {
|
|
972
|
-
var r =
|
|
972
|
+
var r = n.call(this) || this;
|
|
973
973
|
return r.isStopped = !1, e ? (r.destination = e, Ue(e) && e.add(r)) : r.destination = dt, r;
|
|
974
974
|
}
|
|
975
|
-
return t.create = function(e, r,
|
|
976
|
-
return new
|
|
975
|
+
return t.create = function(e, r, s) {
|
|
976
|
+
return new X(e, r, s);
|
|
977
977
|
}, t.prototype.next = function(e) {
|
|
978
978
|
this.isStopped || this._next(e);
|
|
979
979
|
}, t.prototype.error = function(e) {
|
|
@@ -981,7 +981,7 @@ var re = function(s) {
|
|
|
981
981
|
}, t.prototype.complete = function() {
|
|
982
982
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
983
983
|
}, t.prototype.unsubscribe = function() {
|
|
984
|
-
this.closed || (this.isStopped = !0,
|
|
984
|
+
this.closed || (this.isStopped = !0, n.prototype.unsubscribe.call(this), this.destination = null);
|
|
985
985
|
}, t.prototype._next = function(e) {
|
|
986
986
|
this.destination.next(e);
|
|
987
987
|
}, t.prototype._error = function(e) {
|
|
@@ -997,15 +997,15 @@ var re = function(s) {
|
|
|
997
997
|
this.unsubscribe();
|
|
998
998
|
}
|
|
999
999
|
}, t;
|
|
1000
|
-
}(
|
|
1001
|
-
function
|
|
1002
|
-
return
|
|
1000
|
+
}(re), lt = Function.prototype.bind;
|
|
1001
|
+
function B(n, t) {
|
|
1002
|
+
return lt.call(n, t);
|
|
1003
1003
|
}
|
|
1004
|
-
var
|
|
1005
|
-
function
|
|
1004
|
+
var ut = function() {
|
|
1005
|
+
function n(t) {
|
|
1006
1006
|
this.partialObserver = t;
|
|
1007
1007
|
}
|
|
1008
|
-
return
|
|
1008
|
+
return n.prototype.next = function(t) {
|
|
1009
1009
|
var e = this.partialObserver;
|
|
1010
1010
|
if (e.next)
|
|
1011
1011
|
try {
|
|
@@ -1013,7 +1013,7 @@ var lt = function() {
|
|
|
1013
1013
|
} catch (r) {
|
|
1014
1014
|
L(r);
|
|
1015
1015
|
}
|
|
1016
|
-
},
|
|
1016
|
+
}, n.prototype.error = function(t) {
|
|
1017
1017
|
var e = this.partialObserver;
|
|
1018
1018
|
if (e.error)
|
|
1019
1019
|
try {
|
|
@@ -1023,7 +1023,7 @@ var lt = function() {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
else
|
|
1025
1025
|
L(t);
|
|
1026
|
-
},
|
|
1026
|
+
}, n.prototype.complete = function() {
|
|
1027
1027
|
var t = this.partialObserver;
|
|
1028
1028
|
if (t.complete)
|
|
1029
1029
|
try {
|
|
@@ -1031,36 +1031,36 @@ var lt = function() {
|
|
|
1031
1031
|
} catch (e) {
|
|
1032
1032
|
L(e);
|
|
1033
1033
|
}
|
|
1034
|
-
},
|
|
1035
|
-
}(),
|
|
1036
|
-
|
|
1037
|
-
function t(e, r,
|
|
1038
|
-
var i =
|
|
1034
|
+
}, n;
|
|
1035
|
+
}(), X = function(n) {
|
|
1036
|
+
te(t, n);
|
|
1037
|
+
function t(e, r, s) {
|
|
1038
|
+
var i = n.call(this) || this, o;
|
|
1039
1039
|
if (E(e) || !e)
|
|
1040
1040
|
o = {
|
|
1041
1041
|
next: e ?? void 0,
|
|
1042
1042
|
error: r ?? void 0,
|
|
1043
|
-
complete:
|
|
1043
|
+
complete: s ?? void 0
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
|
-
var
|
|
1047
|
-
i && Te.useDeprecatedNextContext ? (
|
|
1046
|
+
var a;
|
|
1047
|
+
i && Te.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
1048
1048
|
return i.unsubscribe();
|
|
1049
1049
|
}, o = {
|
|
1050
|
-
next: e.next &&
|
|
1051
|
-
error: e.error &&
|
|
1052
|
-
complete: e.complete &&
|
|
1050
|
+
next: e.next && B(e.next, a),
|
|
1051
|
+
error: e.error && B(e.error, a),
|
|
1052
|
+
complete: e.complete && B(e.complete, a)
|
|
1053
1053
|
}) : o = e;
|
|
1054
1054
|
}
|
|
1055
|
-
return i.destination = new
|
|
1055
|
+
return i.destination = new ut(o), i;
|
|
1056
1056
|
}
|
|
1057
1057
|
return t;
|
|
1058
|
-
}(
|
|
1059
|
-
function L(
|
|
1060
|
-
ct(
|
|
1058
|
+
}(se);
|
|
1059
|
+
function L(n) {
|
|
1060
|
+
ct(n);
|
|
1061
1061
|
}
|
|
1062
|
-
function ht(
|
|
1063
|
-
throw
|
|
1062
|
+
function ht(n) {
|
|
1063
|
+
throw n;
|
|
1064
1064
|
}
|
|
1065
1065
|
var dt = {
|
|
1066
1066
|
closed: !0,
|
|
@@ -1070,206 +1070,206 @@ var dt = {
|
|
|
1070
1070
|
}, pt = function() {
|
|
1071
1071
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
1072
1072
|
}();
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1073
|
+
function Re(n) {
|
|
1074
|
+
return n;
|
|
1075
1075
|
}
|
|
1076
|
-
function ft(
|
|
1077
|
-
return
|
|
1078
|
-
return
|
|
1076
|
+
function ft(n) {
|
|
1077
|
+
return n.length === 0 ? Re : n.length === 1 ? n[0] : function(t) {
|
|
1078
|
+
return n.reduce(function(e, r) {
|
|
1079
1079
|
return r(e);
|
|
1080
1080
|
}, t);
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
1083
|
var gt = function() {
|
|
1084
|
-
function
|
|
1084
|
+
function n(t) {
|
|
1085
1085
|
t && (this._subscribe = t);
|
|
1086
1086
|
}
|
|
1087
|
-
return
|
|
1088
|
-
var e = new
|
|
1087
|
+
return n.prototype.lift = function(t) {
|
|
1088
|
+
var e = new n();
|
|
1089
1089
|
return e.source = this, e.operator = t, e;
|
|
1090
|
-
},
|
|
1091
|
-
var
|
|
1090
|
+
}, n.prototype.subscribe = function(t, e, r) {
|
|
1091
|
+
var s = this, i = mt(t) ? t : new X(t, e, r);
|
|
1092
1092
|
return at(function() {
|
|
1093
|
-
var o =
|
|
1094
|
-
i.add(
|
|
1093
|
+
var o = s, a = o.operator, c = o.source;
|
|
1094
|
+
i.add(a ? a.call(i, c) : c ? s._subscribe(i) : s._trySubscribe(i));
|
|
1095
1095
|
}), i;
|
|
1096
|
-
},
|
|
1096
|
+
}, n.prototype._trySubscribe = function(t) {
|
|
1097
1097
|
try {
|
|
1098
1098
|
return this._subscribe(t);
|
|
1099
1099
|
} catch (e) {
|
|
1100
1100
|
t.error(e);
|
|
1101
1101
|
}
|
|
1102
|
-
},
|
|
1102
|
+
}, n.prototype.forEach = function(t, e) {
|
|
1103
1103
|
var r = this;
|
|
1104
|
-
return e = ge(e), new e(function(
|
|
1105
|
-
var o = new
|
|
1106
|
-
next: function(
|
|
1104
|
+
return e = ge(e), new e(function(s, i) {
|
|
1105
|
+
var o = new X({
|
|
1106
|
+
next: function(a) {
|
|
1107
1107
|
try {
|
|
1108
|
-
t(
|
|
1109
|
-
} catch (
|
|
1110
|
-
i(
|
|
1108
|
+
t(a);
|
|
1109
|
+
} catch (c) {
|
|
1110
|
+
i(c), o.unsubscribe();
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
error: i,
|
|
1114
|
-
complete:
|
|
1114
|
+
complete: s
|
|
1115
1115
|
});
|
|
1116
1116
|
r.subscribe(o);
|
|
1117
1117
|
});
|
|
1118
|
-
},
|
|
1118
|
+
}, n.prototype._subscribe = function(t) {
|
|
1119
1119
|
var e;
|
|
1120
1120
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
1121
|
-
},
|
|
1121
|
+
}, n.prototype[pt] = function() {
|
|
1122
1122
|
return this;
|
|
1123
|
-
},
|
|
1123
|
+
}, n.prototype.pipe = function() {
|
|
1124
1124
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1125
1125
|
t[e] = arguments[e];
|
|
1126
1126
|
return ft(t)(this);
|
|
1127
|
-
},
|
|
1127
|
+
}, n.prototype.toPromise = function(t) {
|
|
1128
1128
|
var e = this;
|
|
1129
|
-
return t = ge(t), new t(function(r,
|
|
1129
|
+
return t = ge(t), new t(function(r, s) {
|
|
1130
1130
|
var i;
|
|
1131
1131
|
e.subscribe(function(o) {
|
|
1132
1132
|
return i = o;
|
|
1133
1133
|
}, function(o) {
|
|
1134
|
-
return
|
|
1134
|
+
return s(o);
|
|
1135
1135
|
}, function() {
|
|
1136
1136
|
return r(i);
|
|
1137
1137
|
});
|
|
1138
1138
|
});
|
|
1139
|
-
},
|
|
1140
|
-
return new
|
|
1141
|
-
},
|
|
1139
|
+
}, n.create = function(t) {
|
|
1140
|
+
return new n(t);
|
|
1141
|
+
}, n;
|
|
1142
1142
|
}();
|
|
1143
|
-
function ge(
|
|
1143
|
+
function ge(n) {
|
|
1144
1144
|
var t;
|
|
1145
|
-
return (t =
|
|
1145
|
+
return (t = n ?? Te.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
return
|
|
1147
|
+
function yt(n) {
|
|
1148
|
+
return n && E(n.next) && E(n.error) && E(n.complete);
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1151
|
-
return
|
|
1150
|
+
function mt(n) {
|
|
1151
|
+
return n && n instanceof se || yt(n) && Ue(n);
|
|
1152
1152
|
}
|
|
1153
|
-
function P(
|
|
1154
|
-
return new vt(
|
|
1153
|
+
function P(n, t, e, r, s) {
|
|
1154
|
+
return new vt(n, t, e, r, s);
|
|
1155
1155
|
}
|
|
1156
|
-
var vt = function(
|
|
1157
|
-
|
|
1158
|
-
function t(e, r,
|
|
1159
|
-
var
|
|
1160
|
-
return
|
|
1156
|
+
var vt = function(n) {
|
|
1157
|
+
te(t, n);
|
|
1158
|
+
function t(e, r, s, i, o, a) {
|
|
1159
|
+
var c = n.call(this, e) || this;
|
|
1160
|
+
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
|
|
1161
1161
|
try {
|
|
1162
|
-
r(
|
|
1163
|
-
} catch (
|
|
1164
|
-
e.error(
|
|
1162
|
+
r(l);
|
|
1163
|
+
} catch (d) {
|
|
1164
|
+
e.error(d);
|
|
1165
1165
|
}
|
|
1166
|
-
} :
|
|
1166
|
+
} : n.prototype._next, c._error = i ? function(l) {
|
|
1167
1167
|
try {
|
|
1168
|
-
i(
|
|
1169
|
-
} catch (
|
|
1170
|
-
e.error(
|
|
1168
|
+
i(l);
|
|
1169
|
+
} catch (d) {
|
|
1170
|
+
e.error(d);
|
|
1171
1171
|
} finally {
|
|
1172
1172
|
this.unsubscribe();
|
|
1173
1173
|
}
|
|
1174
|
-
} :
|
|
1174
|
+
} : n.prototype._error, c._complete = s ? function() {
|
|
1175
1175
|
try {
|
|
1176
|
-
|
|
1177
|
-
} catch (
|
|
1178
|
-
e.error(
|
|
1176
|
+
s();
|
|
1177
|
+
} catch (l) {
|
|
1178
|
+
e.error(l);
|
|
1179
1179
|
} finally {
|
|
1180
1180
|
this.unsubscribe();
|
|
1181
1181
|
}
|
|
1182
|
-
} :
|
|
1182
|
+
} : n.prototype._complete, c;
|
|
1183
1183
|
}
|
|
1184
1184
|
return t.prototype.unsubscribe = function() {
|
|
1185
1185
|
var e;
|
|
1186
1186
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
1187
1187
|
var r = this.closed;
|
|
1188
|
-
|
|
1188
|
+
n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
1189
1189
|
}
|
|
1190
1190
|
}, t;
|
|
1191
|
-
}(
|
|
1192
|
-
function f(
|
|
1193
|
-
return
|
|
1194
|
-
var
|
|
1191
|
+
}(se);
|
|
1192
|
+
function f(n, t) {
|
|
1193
|
+
return A(function(e, r) {
|
|
1194
|
+
var s = 0;
|
|
1195
1195
|
e.subscribe(P(r, function(i) {
|
|
1196
|
-
r.next(
|
|
1196
|
+
r.next(n.call(t, i, s++));
|
|
1197
1197
|
}));
|
|
1198
1198
|
});
|
|
1199
1199
|
}
|
|
1200
|
-
var bt = new gt(function(
|
|
1201
|
-
return
|
|
1200
|
+
var bt = new gt(function(n) {
|
|
1201
|
+
return n.complete();
|
|
1202
1202
|
});
|
|
1203
|
-
function
|
|
1204
|
-
return
|
|
1203
|
+
function C(n) {
|
|
1204
|
+
return n <= 0 ? function() {
|
|
1205
1205
|
return bt;
|
|
1206
|
-
} :
|
|
1206
|
+
} : A(function(t, e) {
|
|
1207
1207
|
var r = 0;
|
|
1208
|
-
t.subscribe(P(e, function(
|
|
1209
|
-
++r <=
|
|
1208
|
+
t.subscribe(P(e, function(s) {
|
|
1209
|
+
++r <= n && (e.next(s), n <= r && e.complete());
|
|
1210
1210
|
}));
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1214
|
-
return
|
|
1215
|
-
var
|
|
1213
|
+
function y(n, t) {
|
|
1214
|
+
return A(function(e, r) {
|
|
1215
|
+
var s = 0;
|
|
1216
1216
|
e.subscribe(P(r, function(i) {
|
|
1217
|
-
return
|
|
1217
|
+
return n.call(t, i, s++) && r.next(i);
|
|
1218
1218
|
}));
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
|
-
function wt(
|
|
1222
|
-
return t === void 0 && (t = !1),
|
|
1223
|
-
var
|
|
1221
|
+
function wt(n, t) {
|
|
1222
|
+
return t === void 0 && (t = !1), A(function(e, r) {
|
|
1223
|
+
var s = 0;
|
|
1224
1224
|
e.subscribe(P(r, function(i) {
|
|
1225
|
-
var o =
|
|
1225
|
+
var o = n(i, s++);
|
|
1226
1226
|
(o || t) && r.next(i), !o && r.complete();
|
|
1227
1227
|
}));
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
|
-
function g(
|
|
1231
|
-
var r = E(
|
|
1232
|
-
return r ?
|
|
1230
|
+
function g(n, t, e) {
|
|
1231
|
+
var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1232
|
+
return r ? A(function(s, i) {
|
|
1233
1233
|
var o;
|
|
1234
1234
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1235
|
-
var
|
|
1236
|
-
|
|
1237
|
-
var
|
|
1238
|
-
(
|
|
1235
|
+
var a = !0;
|
|
1236
|
+
s.subscribe(P(i, function(c) {
|
|
1237
|
+
var l;
|
|
1238
|
+
(l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
|
|
1239
1239
|
}, function() {
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1242
|
-
}, function(
|
|
1243
|
-
var
|
|
1244
|
-
|
|
1240
|
+
var c;
|
|
1241
|
+
a = !1, (c = r.complete) === null || c === void 0 || c.call(r), i.complete();
|
|
1242
|
+
}, function(c) {
|
|
1243
|
+
var l;
|
|
1244
|
+
a = !1, (l = r.error) === null || l === void 0 || l.call(r, c), i.error(c);
|
|
1245
1245
|
}, function() {
|
|
1246
|
-
var
|
|
1247
|
-
|
|
1246
|
+
var c, l;
|
|
1247
|
+
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
|
|
1248
1248
|
}));
|
|
1249
|
-
}) :
|
|
1249
|
+
}) : Re;
|
|
1250
1250
|
}
|
|
1251
|
-
const
|
|
1252
|
-
function
|
|
1253
|
-
if (typeof
|
|
1254
|
-
const t =
|
|
1251
|
+
const Ct = /^(\d+)\.(\d+)$/;
|
|
1252
|
+
function St(n) {
|
|
1253
|
+
if (typeof n == "string") {
|
|
1254
|
+
const t = n.match(Ct);
|
|
1255
1255
|
if (t)
|
|
1256
1256
|
return `${t[1]}.${t[2]}`;
|
|
1257
1257
|
}
|
|
1258
|
-
throw new st(
|
|
1258
|
+
throw new st(n);
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1261
|
-
const t =
|
|
1262
|
-
return [
|
|
1260
|
+
function ye(n) {
|
|
1261
|
+
const t = St(n), [e, r] = t.split("."), [s, i] = [parseInt(e), parseInt(r)];
|
|
1262
|
+
return [s, i];
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const [e, r] =
|
|
1266
|
-
return e <
|
|
1264
|
+
function xe(n, t) {
|
|
1265
|
+
const [e, r] = ye(n), [s, i] = ye(t);
|
|
1266
|
+
return e < s ? -1 : e > s ? 1 : r < i ? -1 : r > i ? 1 : 0;
|
|
1267
1267
|
}
|
|
1268
|
-
function Et(
|
|
1269
|
-
return
|
|
1268
|
+
function Et(n, t) {
|
|
1269
|
+
return xe(n, t) >= 0;
|
|
1270
1270
|
}
|
|
1271
|
-
const
|
|
1272
|
-
class
|
|
1271
|
+
const me = "2.0";
|
|
1272
|
+
class It {
|
|
1273
1273
|
/**
|
|
1274
1274
|
* Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
|
|
1275
1275
|
*
|
|
@@ -1280,8 +1280,8 @@ class Mt {
|
|
|
1280
1280
|
* @param logService - An instance of a logging service or utility
|
|
1281
1281
|
*/
|
|
1282
1282
|
constructor(t, e) {
|
|
1283
|
-
if (
|
|
1284
|
-
throw new
|
|
1283
|
+
if (M(this, "negotiatedProtocolVersion"), M(this, "currentContext"), M(this, "incomingMessages$"), M(this, "inIframe", !1), M(this, "embeddedResult"), M(this, "iframePort1"), M(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Me(), this.supportedVersions = t.filter((r) => Et(r, me)), !this.supportedVersions.length)
|
|
1284
|
+
throw new V(t, me);
|
|
1285
1285
|
this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
|
|
1286
1286
|
}
|
|
1287
1287
|
get parent() {
|
|
@@ -1300,7 +1300,7 @@ class Mt {
|
|
|
1300
1300
|
return this.inIframe ? this.iframePort1 : (e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) == null ? void 0 : e.port1;
|
|
1301
1301
|
}
|
|
1302
1302
|
get port2() {
|
|
1303
|
-
var t, e, r,
|
|
1303
|
+
var t, e, r, s;
|
|
1304
1304
|
if (this.inIframe) {
|
|
1305
1305
|
if (!this.iframePort2)
|
|
1306
1306
|
throw new ue("port2");
|
|
@@ -1308,7 +1308,7 @@ class Mt {
|
|
|
1308
1308
|
} else {
|
|
1309
1309
|
if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))
|
|
1310
1310
|
throw new ue("port2");
|
|
1311
|
-
return (
|
|
1311
|
+
return (s = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : s.port2;
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
1314
|
/**
|
|
@@ -1319,7 +1319,7 @@ class Mt {
|
|
|
1319
1319
|
determineContext() {
|
|
1320
1320
|
return Ze(1e3).pipe(
|
|
1321
1321
|
f(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
|
|
1322
|
-
|
|
1322
|
+
C(1)
|
|
1323
1323
|
);
|
|
1324
1324
|
}
|
|
1325
1325
|
/**
|
|
@@ -1330,26 +1330,26 @@ class Mt {
|
|
|
1330
1330
|
*/
|
|
1331
1331
|
openBridge() {
|
|
1332
1332
|
if (!this.isEmbedded())
|
|
1333
|
-
throw new
|
|
1333
|
+
throw new h(this.currentContext);
|
|
1334
1334
|
const t = "HELLO", e = this.createMessage(t);
|
|
1335
1335
|
e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
|
|
1336
1336
|
const r = this.incomingMessages$.pipe(
|
|
1337
|
-
|
|
1338
|
-
f((
|
|
1337
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
1338
|
+
f((s) => s),
|
|
1339
1339
|
g(this.logReceived()),
|
|
1340
|
-
f((
|
|
1341
|
-
if (!this.supportedVersions.includes(
|
|
1342
|
-
throw new
|
|
1343
|
-
return
|
|
1340
|
+
f((s) => {
|
|
1341
|
+
if (!this.supportedVersions.includes(s.protocolVersion))
|
|
1342
|
+
throw new V(s.protocolVersion, this.supportedVersions[0]);
|
|
1343
|
+
return s.displayName || (s.displayName = s.cloudUsername), s;
|
|
1344
1344
|
}),
|
|
1345
|
-
g((
|
|
1346
|
-
this.negotiatedProtocolVersion =
|
|
1345
|
+
g((s) => {
|
|
1346
|
+
this.negotiatedProtocolVersion = s.protocolVersion, this.logService.info(
|
|
1347
1347
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1348
|
-
), !
|
|
1348
|
+
), !s.networkId && this.compareVersion("2.2") >= 0 && this.logService.error(
|
|
1349
1349
|
`[IPC] Network ID is not set in the HELLO message reply. 'networkId' is required for protocol version ${this.negotiatedProtocolVersion}, and the client may derive an incorrect network ID from the cloudId.`
|
|
1350
1350
|
);
|
|
1351
1351
|
}),
|
|
1352
|
-
|
|
1352
|
+
C(1)
|
|
1353
1353
|
);
|
|
1354
1354
|
return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;
|
|
1355
1355
|
}
|
|
@@ -1362,14 +1362,14 @@ class Mt {
|
|
|
1362
1362
|
*/
|
|
1363
1363
|
requestSSOToken() {
|
|
1364
1364
|
if (!this.isEmbedded())
|
|
1365
|
-
throw new
|
|
1365
|
+
throw new h(this.currentContext);
|
|
1366
1366
|
const t = "TOKEN", e = this.createMessage(t);
|
|
1367
1367
|
this.logCreated(t, e);
|
|
1368
1368
|
const r = this.incomingMessages$.pipe(
|
|
1369
|
-
|
|
1370
|
-
f((
|
|
1369
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
1370
|
+
f((s) => s),
|
|
1371
1371
|
g(this.logReceived()),
|
|
1372
|
-
|
|
1372
|
+
C(1)
|
|
1373
1373
|
);
|
|
1374
1374
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1375
1375
|
}
|
|
@@ -1388,18 +1388,18 @@ class Mt {
|
|
|
1388
1388
|
*/
|
|
1389
1389
|
sendJoiningRoomMessage(t) {
|
|
1390
1390
|
if (!this.isEmbedded())
|
|
1391
|
-
throw new
|
|
1391
|
+
throw new h(this.currentContext);
|
|
1392
1392
|
const {
|
|
1393
1393
|
roomName: e,
|
|
1394
1394
|
roomInvite: r,
|
|
1395
|
-
displayName:
|
|
1395
|
+
displayName: s,
|
|
1396
1396
|
jwtToken: i,
|
|
1397
1397
|
serverUrl: o,
|
|
1398
|
-
region:
|
|
1399
|
-
joinMicMuted:
|
|
1400
|
-
joinWithoutCamera:
|
|
1401
|
-
} = t,
|
|
1402
|
-
|
|
1398
|
+
region: a,
|
|
1399
|
+
joinMicMuted: c,
|
|
1400
|
+
joinWithoutCamera: l
|
|
1401
|
+
} = t, d = "JOINING ROOM", u = this.createMessage(d, !1);
|
|
1402
|
+
u.roomName = e, u.jwtToken = i, u.serverUrl = o, u.region = a, u.roomInvite = r, u.joinMicMuted = c ?? !1, u.joinWithoutCamera = l ?? !1, u.displayName = s, this.logCreated(d, u), this.port2.postMessage(u), this.logSent(d, u);
|
|
1403
1403
|
}
|
|
1404
1404
|
/**
|
|
1405
1405
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1414,7 +1414,7 @@ class Mt {
|
|
|
1414
1414
|
*/
|
|
1415
1415
|
sendLeavingRoomMessage(t) {
|
|
1416
1416
|
if (!this.isEmbedded())
|
|
1417
|
-
throw new
|
|
1417
|
+
throw new h(this.currentContext);
|
|
1418
1418
|
const e = "LEAVING ROOM", r = this.createMessage(e, !1);
|
|
1419
1419
|
r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
1420
1420
|
}
|
|
@@ -1446,10 +1446,10 @@ class Mt {
|
|
|
1446
1446
|
*/
|
|
1447
1447
|
onJoinRoomMessage() {
|
|
1448
1448
|
if (!this.isEmbedded())
|
|
1449
|
-
throw new
|
|
1449
|
+
throw new h(this.currentContext);
|
|
1450
1450
|
const t = "JOIN ROOM";
|
|
1451
1451
|
return this.incomingMessages$.pipe(
|
|
1452
|
-
|
|
1452
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1453
1453
|
f((e) => e),
|
|
1454
1454
|
g(this.logReceived()),
|
|
1455
1455
|
f((e) => e)
|
|
@@ -1482,10 +1482,10 @@ class Mt {
|
|
|
1482
1482
|
*/
|
|
1483
1483
|
onLeaveRoomMessage() {
|
|
1484
1484
|
if (!this.isEmbedded())
|
|
1485
|
-
throw new
|
|
1485
|
+
throw new h(this.currentContext);
|
|
1486
1486
|
const t = "LEAVE ROOM";
|
|
1487
1487
|
return this.incomingMessages$.pipe(
|
|
1488
|
-
|
|
1488
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1489
1489
|
f((e) => e),
|
|
1490
1490
|
g(this.logReceived()),
|
|
1491
1491
|
f((e) => e)
|
|
@@ -1519,10 +1519,10 @@ class Mt {
|
|
|
1519
1519
|
*/
|
|
1520
1520
|
onConfigMessage() {
|
|
1521
1521
|
if (!this.isEmbedded())
|
|
1522
|
-
throw new
|
|
1522
|
+
throw new h(this.currentContext);
|
|
1523
1523
|
const t = "CONFIG";
|
|
1524
1524
|
return this.incomingMessages$.pipe(
|
|
1525
|
-
|
|
1525
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1526
1526
|
f((e) => e),
|
|
1527
1527
|
g(this.logReceived()),
|
|
1528
1528
|
f((e) => ({
|
|
@@ -1542,30 +1542,30 @@ class Mt {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
sendScreenshareSourceMessage(t) {
|
|
1544
1544
|
if (!this.isEmbedded())
|
|
1545
|
-
throw new
|
|
1545
|
+
throw new h(this.currentContext);
|
|
1546
1546
|
const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
|
|
1547
1547
|
r.sourceTypes = t, this.logCreated(e, r);
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1548
|
+
const s = this.incomingMessages$.pipe(
|
|
1549
|
+
y((i) => i.type === e && i.replyTo === r.id),
|
|
1550
1550
|
f((i) => i),
|
|
1551
1551
|
g(this.logReceived()),
|
|
1552
1552
|
f((i) => i),
|
|
1553
|
-
|
|
1553
|
+
C(1)
|
|
1554
1554
|
);
|
|
1555
|
-
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r),
|
|
1555
|
+
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;
|
|
1556
1556
|
}
|
|
1557
1557
|
layoutChange(t, e, r) {
|
|
1558
1558
|
if (!this.isEmbedded())
|
|
1559
|
-
throw new
|
|
1560
|
-
const
|
|
1559
|
+
throw new h(this.currentContext);
|
|
1560
|
+
const s = "LAYOUT CHANGE";
|
|
1561
1561
|
let i, o;
|
|
1562
|
-
if (e && r ? (i = this.createMessage(
|
|
1563
|
-
|
|
1564
|
-
f((
|
|
1562
|
+
if (e && r ? (i = this.createMessage(s, !1, r), i.result = e) : (i = this.createMessage(s), o = this.incomingMessages$.pipe(
|
|
1563
|
+
y((a) => a.type === s && a.replyTo === i.id),
|
|
1564
|
+
f((a) => a),
|
|
1565
1565
|
g(this.logReceived()),
|
|
1566
|
-
f((
|
|
1567
|
-
|
|
1568
|
-
), this.logService.debug(`Created ${
|
|
1566
|
+
f((a) => a),
|
|
1567
|
+
C(1)
|
|
1568
|
+
), this.logService.debug(`Created ${s} Reply handler`)), i.layout = t, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i), o)
|
|
1569
1569
|
return o;
|
|
1570
1570
|
}
|
|
1571
1571
|
/**
|
|
@@ -1601,10 +1601,10 @@ class Mt {
|
|
|
1601
1601
|
*/
|
|
1602
1602
|
onLayoutChangeMessage() {
|
|
1603
1603
|
if (!this.isEmbedded())
|
|
1604
|
-
throw new
|
|
1604
|
+
throw new h(this.currentContext);
|
|
1605
1605
|
const t = "LAYOUT CHANGE";
|
|
1606
1606
|
return this.incomingMessages$.pipe(
|
|
1607
|
-
|
|
1607
|
+
y((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
1608
1608
|
f((e) => e),
|
|
1609
1609
|
g(this.logReceived()),
|
|
1610
1610
|
f((e) => e)
|
|
@@ -1612,36 +1612,36 @@ class Mt {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
requestOAuthToken(t) {
|
|
1614
1614
|
if (!this.isEmbedded())
|
|
1615
|
-
throw new
|
|
1615
|
+
throw new h(this.currentContext);
|
|
1616
1616
|
Array.isArray(t) || (t = [t]);
|
|
1617
1617
|
const e = "OAUTH TOKEN", r = this.createMessage(e);
|
|
1618
1618
|
r.providerTypes = t, this.logCreated(e, r);
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1619
|
+
const s = this.incomingMessages$.pipe(
|
|
1620
|
+
y((i) => i.type === e && i.replyTo === r.id),
|
|
1621
1621
|
f((i) => i),
|
|
1622
1622
|
g(this.logReceived()),
|
|
1623
|
-
|
|
1623
|
+
C(1)
|
|
1624
1624
|
);
|
|
1625
|
-
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r),
|
|
1625
|
+
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;
|
|
1626
1626
|
}
|
|
1627
1627
|
openUrl(t, e) {
|
|
1628
1628
|
if (!this.isEmbedded())
|
|
1629
|
-
throw new
|
|
1630
|
-
const r = "OPEN URL",
|
|
1631
|
-
|
|
1629
|
+
throw new h(this.currentContext);
|
|
1630
|
+
const r = "OPEN URL", s = this.createMessage(r, !1);
|
|
1631
|
+
s.url = t, s.data = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
1632
1632
|
}
|
|
1633
|
-
selectContacts(t, e, r,
|
|
1633
|
+
selectContacts(t, e, r, s) {
|
|
1634
1634
|
if (!this.isEmbedded())
|
|
1635
|
-
throw new
|
|
1635
|
+
throw new h(this.currentContext);
|
|
1636
1636
|
if (this.negotiatedProtocolVersion === "2.0") {
|
|
1637
1637
|
if (e === void 0 || typeof e == "object")
|
|
1638
|
-
throw new
|
|
1638
|
+
throw new m(
|
|
1639
1639
|
"streamType",
|
|
1640
1640
|
e,
|
|
1641
1641
|
"streamType is missing or invalid"
|
|
1642
1642
|
);
|
|
1643
1643
|
if (r === void 0 || typeof r == "object" || typeof r == "number")
|
|
1644
|
-
throw new
|
|
1644
|
+
throw new m(
|
|
1645
1645
|
"contactType",
|
|
1646
1646
|
r,
|
|
1647
1647
|
"contactType is missing or invalid"
|
|
@@ -1650,181 +1650,209 @@ class Mt {
|
|
|
1650
1650
|
t,
|
|
1651
1651
|
e,
|
|
1652
1652
|
r,
|
|
1653
|
-
|
|
1653
|
+
s
|
|
1654
1654
|
);
|
|
1655
1655
|
}
|
|
1656
1656
|
if (typeof e < "u" && typeof e != "object")
|
|
1657
|
-
throw new
|
|
1657
|
+
throw new m("options", e, "options is invalid");
|
|
1658
1658
|
if (typeof r < "u" && !Array.isArray(r))
|
|
1659
|
-
throw new
|
|
1659
|
+
throw new m(
|
|
1660
1660
|
"currentContacts",
|
|
1661
1661
|
r,
|
|
1662
1662
|
"currentContacts is invalid"
|
|
1663
1663
|
);
|
|
1664
1664
|
return this.selectContactsV2_1(t, e, r);
|
|
1665
1665
|
}
|
|
1666
|
-
selectContactsV2_0(t, e, r,
|
|
1666
|
+
selectContactsV2_0(t, e, r, s) {
|
|
1667
1667
|
if (!this.isEmbedded())
|
|
1668
|
-
throw new
|
|
1669
|
-
|
|
1670
|
-
...
|
|
1671
|
-
cloudId:
|
|
1672
|
-
networkId:
|
|
1673
|
-
cloudUsername:
|
|
1674
|
-
} :
|
|
1668
|
+
throw new h(this.currentContext);
|
|
1669
|
+
s && s.length > 0 && (s = s.map((c) => c.type === "cloudUsername" && c.contactUser ? {
|
|
1670
|
+
...c,
|
|
1671
|
+
cloudId: c.cloudId || c.contactUser.cloudId,
|
|
1672
|
+
networkId: c.networkId || c.contactUser.networkId,
|
|
1673
|
+
cloudUsername: c.cloudUsername || c.contactUser.cloudUsername
|
|
1674
|
+
} : c));
|
|
1675
1675
|
const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
|
|
1676
|
-
o.streamId = t, o.streamType = e, o.contactType = r, o.resultTypes = [r], o.currentContacts =
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1676
|
+
o.streamId = t, o.streamType = e, o.contactType = r, o.resultTypes = [r], o.currentContacts = s, this.logCreated(i, o);
|
|
1677
|
+
const a = this.incomingMessages$.pipe(
|
|
1678
|
+
y((c) => c.type === i && c.replyTo === o.id),
|
|
1679
1679
|
g(this.logReceived()),
|
|
1680
|
-
f((
|
|
1681
|
-
const
|
|
1682
|
-
if (
|
|
1683
|
-
if (
|
|
1684
|
-
throw new
|
|
1685
|
-
e === "direct" &&
|
|
1680
|
+
f((c) => {
|
|
1681
|
+
const l = c;
|
|
1682
|
+
if (l.result === "success") {
|
|
1683
|
+
if (l.streamId !== t)
|
|
1684
|
+
throw new le(l.streamId, t);
|
|
1685
|
+
e === "direct" && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]);
|
|
1686
1686
|
}
|
|
1687
|
-
return
|
|
1687
|
+
return l;
|
|
1688
1688
|
}),
|
|
1689
|
-
|
|
1689
|
+
C(1)
|
|
1690
1690
|
);
|
|
1691
|
-
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o),
|
|
1691
|
+
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), a;
|
|
1692
1692
|
}
|
|
1693
1693
|
selectContactsV2_1(t, e, r) {
|
|
1694
1694
|
if (!this.isEmbedded())
|
|
1695
|
-
throw new
|
|
1696
|
-
const
|
|
1695
|
+
throw new h(this.currentContext);
|
|
1696
|
+
const s = {
|
|
1697
1697
|
allowMultipleSelection: (e == null ? void 0 : e.allowMultipleSelection) ?? !1,
|
|
1698
|
+
filterToSelectedType: (e == null ? void 0 : e.filterToSelectedType) ?? !1,
|
|
1698
1699
|
resultTypes: (e == null ? void 0 : e.resultTypes) ?? ["cloudUsername"],
|
|
1699
1700
|
streamName: e == null ? void 0 : e.streamName
|
|
1700
1701
|
};
|
|
1702
|
+
if (s.filterToSelectedType) {
|
|
1703
|
+
if (!s.allowMultipleSelection)
|
|
1704
|
+
throw new m(
|
|
1705
|
+
"filterToSelectedType",
|
|
1706
|
+
s.filterToSelectedType,
|
|
1707
|
+
"filterToSelectedType can only be set when allowMultipleSelection is true"
|
|
1708
|
+
);
|
|
1709
|
+
if (s.resultTypes.length === 1 && this.logService.warn(
|
|
1710
|
+
"[IPC] [SelectContacts] filterToSelectedType is redundant when resultTypes contains only one type"
|
|
1711
|
+
), r && r.length > 0) {
|
|
1712
|
+
const c = r[0].type;
|
|
1713
|
+
if (r.some((l) => l.type !== c))
|
|
1714
|
+
throw new m(
|
|
1715
|
+
"currentContacts",
|
|
1716
|
+
r,
|
|
1717
|
+
"When filterToSelectedType is true, all items in currentContacts must be of the same type"
|
|
1718
|
+
);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1701
1721
|
if (r && r.length > 0)
|
|
1702
|
-
for (const
|
|
1703
|
-
if (
|
|
1704
|
-
throw new
|
|
1722
|
+
for (const c of r) {
|
|
1723
|
+
if (c.contactId === void 0)
|
|
1724
|
+
throw new m(
|
|
1705
1725
|
"currentContacts",
|
|
1706
1726
|
r,
|
|
1707
1727
|
"ContactItem contactId is required since v2.1 on all contacts"
|
|
1708
1728
|
);
|
|
1709
|
-
if (
|
|
1710
|
-
if (!
|
|
1711
|
-
throw new
|
|
1729
|
+
if (c.type === "cloudUsername") {
|
|
1730
|
+
if (!c.contactUser)
|
|
1731
|
+
throw new m(
|
|
1712
1732
|
"currentContacts",
|
|
1713
|
-
|
|
1733
|
+
c,
|
|
1714
1734
|
"CloudUsername contact must include contactUser since v2.1"
|
|
1715
1735
|
);
|
|
1716
|
-
if (!
|
|
1717
|
-
throw new
|
|
1736
|
+
if (!c.contactUser.cloudId || !c.contactUser.networkId || !c.contactUser.cloudUsername)
|
|
1737
|
+
throw new m(
|
|
1718
1738
|
"currentContacts",
|
|
1719
|
-
|
|
1739
|
+
c,
|
|
1720
1740
|
"CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
|
|
1721
1741
|
);
|
|
1722
1742
|
}
|
|
1723
1743
|
}
|
|
1724
1744
|
const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
|
|
1725
|
-
o.streamId = t, o.streamName =
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1745
|
+
o.streamId = t, o.streamName = s.streamName, o.resultTypes = s.resultTypes, o.currentContacts = r, o.allowMultipleSelection = s.allowMultipleSelection, o.filterToSelectedType = s.filterToSelectedType, this.logCreated(i, o);
|
|
1746
|
+
const a = this.incomingMessages$.pipe(
|
|
1747
|
+
y((c) => c.type === i && c.replyTo === o.id),
|
|
1728
1748
|
g(this.logReceived()),
|
|
1729
|
-
f((
|
|
1730
|
-
const
|
|
1731
|
-
if (
|
|
1732
|
-
if (
|
|
1733
|
-
throw new
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1736
|
-
(
|
|
1737
|
-
),
|
|
1738
|
-
`[IPC] [SelectContactsReply] Filtered ${
|
|
1739
|
-
), !
|
|
1740
|
-
|
|
1741
|
-
if (l.
|
|
1742
|
-
|
|
1749
|
+
f((c) => {
|
|
1750
|
+
const l = c;
|
|
1751
|
+
if (l.result === "success") {
|
|
1752
|
+
if (l.streamId !== t)
|
|
1753
|
+
throw new le(l.streamId, t);
|
|
1754
|
+
const d = l.contacts.length;
|
|
1755
|
+
if (l.contacts = l.contacts.filter(
|
|
1756
|
+
(u) => s.resultTypes.includes(u.type)
|
|
1757
|
+
), l.contacts.length !== d && this.logService.debug(
|
|
1758
|
+
`[IPC] [SelectContactsReply] Filtered ${d - l.contacts.length} contacts from reply`
|
|
1759
|
+
), !s.allowMultipleSelection && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]), s.filterToSelectedType && l.contacts.length > 1) {
|
|
1760
|
+
const u = l.contacts[0].type;
|
|
1761
|
+
if (l.contacts.some(
|
|
1762
|
+
(b) => b.type !== u
|
|
1763
|
+
))
|
|
1764
|
+
throw new Error(
|
|
1765
|
+
`When filterToSelectedType is true, all contacts in the reply must be of the same type. Expected all contacts to be of type '${u}', but received mixed types.`
|
|
1766
|
+
);
|
|
1767
|
+
}
|
|
1768
|
+
for (const u of l.contacts) {
|
|
1769
|
+
if (u.type === "cloudUsername") {
|
|
1770
|
+
if (!u.contactUser)
|
|
1743
1771
|
throw new Error(
|
|
1744
1772
|
`CloudUsername contact must include contactUser since v2.1. ContactItem: ${JSON.stringify(
|
|
1745
|
-
|
|
1773
|
+
u
|
|
1746
1774
|
)}`
|
|
1747
1775
|
);
|
|
1748
|
-
if (!
|
|
1776
|
+
if (!u.contactUser.cloudId || !u.contactUser.networkId || !u.contactUser.cloudUsername)
|
|
1749
1777
|
throw new Error(
|
|
1750
1778
|
`CloudContact must define cloudUsername, cloudId, and networkId since v2.1. ContactItem: ${JSON.stringify(
|
|
1751
|
-
|
|
1779
|
+
u
|
|
1752
1780
|
)}`
|
|
1753
1781
|
);
|
|
1754
1782
|
}
|
|
1755
|
-
this.negotiatedProtocolVersion === "2.2" && (
|
|
1783
|
+
this.negotiatedProtocolVersion === "2.2" && (u.type === "number" && u.numbers.length > 1 ? u.numbers = [u.numbers[0]] : u.type === "email" && u.emails.length > 1 && (u.emails = [u.emails[0]]));
|
|
1756
1784
|
}
|
|
1757
1785
|
}
|
|
1758
|
-
return
|
|
1786
|
+
return l;
|
|
1759
1787
|
}),
|
|
1760
|
-
|
|
1788
|
+
C(1)
|
|
1761
1789
|
);
|
|
1762
|
-
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o),
|
|
1790
|
+
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), a;
|
|
1763
1791
|
}
|
|
1764
1792
|
matchContacts(t) {
|
|
1765
1793
|
if (!this.isEmbedded())
|
|
1766
|
-
throw new
|
|
1794
|
+
throw new h(this.currentContext);
|
|
1767
1795
|
if (!Array.isArray(t))
|
|
1768
|
-
throw new
|
|
1796
|
+
throw new m("contacts", t, "contacts is not an array");
|
|
1769
1797
|
if (!t.length)
|
|
1770
|
-
throw new
|
|
1798
|
+
throw new m("contacts", t, "At least one contact is required");
|
|
1771
1799
|
const e = this.createMessage("MATCH CONTACTS");
|
|
1772
1800
|
if (this.compareVersion("2.1") >= 0) {
|
|
1773
|
-
for (const
|
|
1774
|
-
if (
|
|
1775
|
-
if (!
|
|
1776
|
-
throw new
|
|
1801
|
+
for (const s of t)
|
|
1802
|
+
if (s.type === "cloudUsername") {
|
|
1803
|
+
if (!s.contactUser)
|
|
1804
|
+
throw new m(
|
|
1777
1805
|
"contacts",
|
|
1778
|
-
|
|
1806
|
+
s,
|
|
1779
1807
|
"CloudUsername contact must include contactUser"
|
|
1780
1808
|
);
|
|
1781
|
-
if (!
|
|
1782
|
-
throw new
|
|
1809
|
+
if (!s.contactUser.cloudUsername || !s.contactUser.cloudId || !s.contactUser.networkId)
|
|
1810
|
+
throw new m(
|
|
1783
1811
|
"contacts",
|
|
1784
|
-
|
|
1812
|
+
s,
|
|
1785
1813
|
"CloudContact must define cloudUsername, cloudId, and networkId"
|
|
1786
1814
|
);
|
|
1787
1815
|
}
|
|
1788
1816
|
e.contacts = [...t];
|
|
1789
1817
|
} else {
|
|
1790
|
-
for (const
|
|
1791
|
-
|
|
1818
|
+
for (const s of t)
|
|
1819
|
+
s.type === "cloudUsername" && s.contactUser && (s.cloudId = s.contactUser.cloudId, s.networkId = s.contactUser.networkId, s.cloudUsername = s.contactUser.cloudUsername);
|
|
1792
1820
|
e.contacts = [...t];
|
|
1793
1821
|
}
|
|
1794
1822
|
this.logCreated(e.type, e);
|
|
1795
1823
|
const r = this.incomingMessages$.pipe(
|
|
1796
|
-
|
|
1824
|
+
y((s) => s.type === e.type && s.replyTo === e.id),
|
|
1797
1825
|
g(this.logReceived()),
|
|
1798
|
-
f((
|
|
1799
|
-
const i =
|
|
1826
|
+
f((s) => {
|
|
1827
|
+
const i = s;
|
|
1800
1828
|
if (this.compareVersion("2.1") >= 0) {
|
|
1801
1829
|
if (Array.isArray(i.contacts))
|
|
1802
1830
|
throw new Error(
|
|
1803
1831
|
"MatchContactsMessageReply should return a Record<string, DetailedContactItem> of contacts when using IPC Protocol v2.1+"
|
|
1804
1832
|
);
|
|
1805
|
-
for (const [o,
|
|
1806
|
-
if (
|
|
1833
|
+
for (const [o, a] of Object.entries(i.contacts)) {
|
|
1834
|
+
if (a == null) {
|
|
1807
1835
|
this.logService.debug(
|
|
1808
1836
|
`[IPC] [MatchContactsReply] Received null or undefined contact for ${o}`
|
|
1809
1837
|
);
|
|
1810
1838
|
continue;
|
|
1811
1839
|
}
|
|
1812
|
-
if (
|
|
1840
|
+
if (a.contactId === void 0)
|
|
1813
1841
|
throw new Error(
|
|
1814
1842
|
`ContactItem 'contactId' is required since v2.1. ContactItem: ${JSON.stringify(
|
|
1815
|
-
|
|
1843
|
+
a
|
|
1816
1844
|
)}`
|
|
1817
1845
|
);
|
|
1818
|
-
if (!
|
|
1846
|
+
if (!a.contactUser && (!a.uri || a.uri.length === 0) && (!a.numbers || a.numbers.length === 0))
|
|
1819
1847
|
throw new Error(
|
|
1820
1848
|
`DetailedContactItem must define at least one contact method (contactUser, uri, or numbers). ContactItem: ${JSON.stringify(
|
|
1821
|
-
|
|
1849
|
+
a
|
|
1822
1850
|
)}`
|
|
1823
1851
|
);
|
|
1824
|
-
if (
|
|
1852
|
+
if (a.contactUser && (!a.contactUser.cloudId || !a.contactUser.networkId || !a.contactUser.cloudUsername))
|
|
1825
1853
|
throw new Error(
|
|
1826
1854
|
`When contactUser is defined, cloudId, networkId, and cloudUsername must also be defined. ContactItem: ${JSON.stringify(
|
|
1827
|
-
|
|
1855
|
+
a
|
|
1828
1856
|
)}`
|
|
1829
1857
|
);
|
|
1830
1858
|
}
|
|
@@ -1838,14 +1866,14 @@ class Mt {
|
|
|
1838
1866
|
"The number of contacts in the reply does not match the number of contacts in the request"
|
|
1839
1867
|
);
|
|
1840
1868
|
for (const o of i.contacts) {
|
|
1841
|
-
const
|
|
1842
|
-
if (
|
|
1869
|
+
const a = o;
|
|
1870
|
+
if (a.type === "cloudUsername" && !("cloudUsername" in a))
|
|
1843
1871
|
throw new Error(
|
|
1844
1872
|
`CloudUsernameDetailedContactItem must define cloudUsername. ContactItem: ${JSON.stringify(
|
|
1845
1873
|
o
|
|
1846
1874
|
)}`
|
|
1847
1875
|
);
|
|
1848
|
-
if (
|
|
1876
|
+
if (a.type === "uri" && (!("uri" in a) || !Array.isArray(a.uri)))
|
|
1849
1877
|
throw new Error(
|
|
1850
1878
|
`UriDetailedContactItem must define uri as an array. ContactItem: ${JSON.stringify(
|
|
1851
1879
|
o
|
|
@@ -1855,7 +1883,7 @@ class Mt {
|
|
|
1855
1883
|
}
|
|
1856
1884
|
return i;
|
|
1857
1885
|
}),
|
|
1858
|
-
|
|
1886
|
+
C(1)
|
|
1859
1887
|
);
|
|
1860
1888
|
return this.logService.debug(`Created ${e.type} Reply handler`), this.port2.postMessage(e), this.logSent(e.type, e), r;
|
|
1861
1889
|
}
|
|
@@ -1887,14 +1915,56 @@ class Mt {
|
|
|
1887
1915
|
*/
|
|
1888
1916
|
onPushMessageMessage() {
|
|
1889
1917
|
if (!this.isEmbedded())
|
|
1890
|
-
throw new
|
|
1918
|
+
throw new h(this.currentContext);
|
|
1891
1919
|
const t = "PUSH MESSAGE";
|
|
1892
1920
|
return this.incomingMessages$.pipe(
|
|
1893
|
-
|
|
1921
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1894
1922
|
f((e) => e),
|
|
1895
1923
|
g(this.logReceived())
|
|
1896
1924
|
);
|
|
1897
1925
|
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Setup listener for {@link DirectChannelCreateAndNavigateMessage}, which can be sent by a Host app to
|
|
1928
|
+
* instruct the Client to create (if needed) and navigate to a direct channel.
|
|
1929
|
+
*
|
|
1930
|
+
* @remarks
|
|
1931
|
+
* The Host app does not expect a reply to this message.
|
|
1932
|
+
*
|
|
1933
|
+
* @returns An observable that emits whenever {@link DirectChannelCreateAndNavigateMessage} is received so it
|
|
1934
|
+
* can be subscribed to indefinitely.
|
|
1935
|
+
*/
|
|
1936
|
+
onDirectChannelCreateAndNavigateMessage() {
|
|
1937
|
+
if (!this.isEmbedded())
|
|
1938
|
+
throw new h(this.currentContext);
|
|
1939
|
+
const t = "DIRECT CHANNEL CREATE AND NAVIGATE";
|
|
1940
|
+
return this.incomingMessages$.pipe(
|
|
1941
|
+
y(
|
|
1942
|
+
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1943
|
+
),
|
|
1944
|
+
g(this.logReceived())
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
/**
|
|
1948
|
+
* Setup listener for {@link NavigateToRouteMessage}, which can be sent by a Host app to instruct the
|
|
1949
|
+
* Client application to navigate to a specific in-app route.
|
|
1950
|
+
*
|
|
1951
|
+
* @remarks
|
|
1952
|
+
* The Host app does not expect a reply to this message.
|
|
1953
|
+
*
|
|
1954
|
+
* @returns An observable that emits whenever {@link NavigateToRouteMessage} is received so it can be
|
|
1955
|
+
* subscribed to indefinitely.
|
|
1956
|
+
*/
|
|
1957
|
+
onNavigateToRouteMessage() {
|
|
1958
|
+
if (!this.isEmbedded())
|
|
1959
|
+
throw new h(this.currentContext);
|
|
1960
|
+
const t = "NAVIGATE TO ROUTE";
|
|
1961
|
+
return this.incomingMessages$.pipe(
|
|
1962
|
+
y(
|
|
1963
|
+
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1964
|
+
),
|
|
1965
|
+
g(this.logReceived())
|
|
1966
|
+
);
|
|
1967
|
+
}
|
|
1898
1968
|
/**
|
|
1899
1969
|
* Sends a {@link PushTokenMessage} to the Host app, to request the Push Token for the current
|
|
1900
1970
|
* device.
|
|
@@ -1906,14 +1976,14 @@ class Mt {
|
|
|
1906
1976
|
*/
|
|
1907
1977
|
requestPushToken() {
|
|
1908
1978
|
if (!this.isEmbedded())
|
|
1909
|
-
throw new
|
|
1979
|
+
throw new h(this.currentContext);
|
|
1910
1980
|
const t = "PUSH TOKEN", e = this.createMessage(t);
|
|
1911
1981
|
this.logCreated(t, e);
|
|
1912
1982
|
const r = this.incomingMessages$.pipe(
|
|
1913
|
-
|
|
1983
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
1914
1984
|
g(this.logReceived()),
|
|
1915
|
-
f((
|
|
1916
|
-
|
|
1985
|
+
f((s) => s),
|
|
1986
|
+
C(1)
|
|
1917
1987
|
);
|
|
1918
1988
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1919
1989
|
}
|
|
@@ -1946,10 +2016,10 @@ class Mt {
|
|
|
1946
2016
|
*/
|
|
1947
2017
|
onPushTokenMessage() {
|
|
1948
2018
|
if (!this.isEmbedded())
|
|
1949
|
-
throw new
|
|
2019
|
+
throw new h(this.currentContext);
|
|
1950
2020
|
const t = "PUSH TOKEN";
|
|
1951
2021
|
return this.incomingMessages$.pipe(
|
|
1952
|
-
|
|
2022
|
+
y(
|
|
1953
2023
|
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1954
2024
|
),
|
|
1955
2025
|
f((e) => {
|
|
@@ -1961,6 +2031,66 @@ class Mt {
|
|
|
1961
2031
|
g(this.logReceived())
|
|
1962
2032
|
);
|
|
1963
2033
|
}
|
|
2034
|
+
/**
|
|
2035
|
+
* Request current call information from the `Host` app.
|
|
2036
|
+
*
|
|
2037
|
+
* @remarks
|
|
2038
|
+
* The Host app should reply with a {@link CallInfoMessageReply} containing the current call
|
|
2039
|
+
* information.
|
|
2040
|
+
*
|
|
2041
|
+
* @returns Observable with a {@link CallInfoMessageReply} instance containing the call info.
|
|
2042
|
+
*/
|
|
2043
|
+
requestCallInfo() {
|
|
2044
|
+
if (!this.isEmbedded())
|
|
2045
|
+
throw new h(this.currentContext);
|
|
2046
|
+
const t = "CALL INFO", e = this.createMessage(t);
|
|
2047
|
+
this.logCreated(t, e);
|
|
2048
|
+
const r = this.incomingMessages$.pipe(
|
|
2049
|
+
y((s) => s.type === t && s.replyTo === e.id),
|
|
2050
|
+
g(this.logReceived()),
|
|
2051
|
+
f((s) => s),
|
|
2052
|
+
C(1)
|
|
2053
|
+
);
|
|
2054
|
+
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
2055
|
+
}
|
|
2056
|
+
/**
|
|
2057
|
+
* Setup a listener for {@link CallInfoMessageReply}, which can be sent by a Host app to notify
|
|
2058
|
+
* of call information changes.
|
|
2059
|
+
*
|
|
2060
|
+
* @remarks
|
|
2061
|
+
* The Host app should send this message whenever call properties change. The Client app can
|
|
2062
|
+
* use this to update its call state accordingly.
|
|
2063
|
+
*
|
|
2064
|
+
* The Host app does not expect a reply to this message.
|
|
2065
|
+
*
|
|
2066
|
+
* @example
|
|
2067
|
+
* Here is an example of how a listener can be setup:
|
|
2068
|
+
*
|
|
2069
|
+
* ```ts
|
|
2070
|
+
* const ipcHelper = new IpcHelper(['2.0'], console);
|
|
2071
|
+
*
|
|
2072
|
+
* const callInfoSubscription = ipcHelper.onCallInfoMessage().subscribe((msg) => {
|
|
2073
|
+
* // your logic for handling call info updates goes here
|
|
2074
|
+
* });
|
|
2075
|
+
*
|
|
2076
|
+
* // don't forget to unsubscribe when you're cleaning up
|
|
2077
|
+
* callInfoSubscription.unsubscribe();
|
|
2078
|
+
* ```
|
|
2079
|
+
*
|
|
2080
|
+
* @returns An observable that emits whenever {@link CallInfoMessageReply} is received so it can
|
|
2081
|
+
* be subscribed to indefinitely.
|
|
2082
|
+
*/
|
|
2083
|
+
onCallInfoMessage() {
|
|
2084
|
+
if (!this.isEmbedded())
|
|
2085
|
+
throw new h(this.currentContext);
|
|
2086
|
+
const t = "CALL INFO";
|
|
2087
|
+
return this.incomingMessages$.pipe(
|
|
2088
|
+
y(
|
|
2089
|
+
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2090
|
+
),
|
|
2091
|
+
g(this.logReceived())
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
1964
2094
|
/**
|
|
1965
2095
|
* Setup listener for {@link BadgeQueryMessage}, which can be sent by a `Host` app to request the
|
|
1966
2096
|
* current badge counter from the `Client` app.
|
|
@@ -1970,10 +2100,10 @@ class Mt {
|
|
|
1970
2100
|
*/
|
|
1971
2101
|
onBadgeQueryMessage() {
|
|
1972
2102
|
if (!this.isEmbedded())
|
|
1973
|
-
throw new
|
|
2103
|
+
throw new h(this.currentContext);
|
|
1974
2104
|
const t = "BADGE QUERY";
|
|
1975
2105
|
return this.incomingMessages$.pipe(
|
|
1976
|
-
|
|
2106
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1977
2107
|
f((e) => e),
|
|
1978
2108
|
g(this.logReceived())
|
|
1979
2109
|
);
|
|
@@ -1992,9 +2122,9 @@ class Mt {
|
|
|
1992
2122
|
*/
|
|
1993
2123
|
sendBadgeUpdateMessage(t, e, r) {
|
|
1994
2124
|
if (!this.isEmbedded())
|
|
1995
|
-
throw new
|
|
1996
|
-
const
|
|
1997
|
-
i.count = t, i.activity = e ?? !1, this.logCreated(
|
|
2125
|
+
throw new h(this.currentContext);
|
|
2126
|
+
const s = "BADGE UPDATE", i = this.createMessage(s, !1, r);
|
|
2127
|
+
i.count = t, i.activity = e ?? !1, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i);
|
|
1998
2128
|
}
|
|
1999
2129
|
/**
|
|
2000
2130
|
* Sends a {@link LifecycleMessage} to the Host app, to notify it of a lifecycle event.
|
|
@@ -2011,9 +2141,9 @@ class Mt {
|
|
|
2011
2141
|
*/
|
|
2012
2142
|
sendLifecycleMessage(t, e) {
|
|
2013
2143
|
if (!this.isEmbedded())
|
|
2014
|
-
throw new
|
|
2015
|
-
const r = "LIFECYCLE",
|
|
2016
|
-
|
|
2144
|
+
throw new h(this.currentContext);
|
|
2145
|
+
const r = "LIFECYCLE", s = this.createMessage(r, !1);
|
|
2146
|
+
s.eventName = t, s.payload = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2017
2147
|
}
|
|
2018
2148
|
/**
|
|
2019
2149
|
* Setup listener for {@link LifecycleMessage}, which can be sent by a `Host` app to notify the
|
|
@@ -2028,10 +2158,10 @@ class Mt {
|
|
|
2028
2158
|
*/
|
|
2029
2159
|
onLifecycleMessage() {
|
|
2030
2160
|
if (!this.isEmbedded())
|
|
2031
|
-
throw new
|
|
2161
|
+
throw new h(this.currentContext);
|
|
2032
2162
|
const t = "LIFECYCLE";
|
|
2033
2163
|
return this.incomingMessages$.pipe(
|
|
2034
|
-
|
|
2164
|
+
y((e) => e.type === t && e.target === "client"),
|
|
2035
2165
|
f((e) => e),
|
|
2036
2166
|
g(this.logReceived())
|
|
2037
2167
|
);
|
|
@@ -2050,9 +2180,9 @@ class Mt {
|
|
|
2050
2180
|
*/
|
|
2051
2181
|
sendLogMessage(t, e) {
|
|
2052
2182
|
if (!this.isEmbedded())
|
|
2053
|
-
throw new
|
|
2054
|
-
const r = "LOG",
|
|
2055
|
-
|
|
2183
|
+
throw new h(this.currentContext);
|
|
2184
|
+
const r = "LOG", s = this.createMessage(r, !1);
|
|
2185
|
+
s.level = t, s.message = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2056
2186
|
}
|
|
2057
2187
|
/**
|
|
2058
2188
|
* Setup listener for {@link RequestLogsMessage}, which can be sent by a `Host` app to request
|
|
@@ -2068,10 +2198,10 @@ class Mt {
|
|
|
2068
2198
|
*/
|
|
2069
2199
|
onRequestLogsMessage() {
|
|
2070
2200
|
if (!this.isEmbedded())
|
|
2071
|
-
throw new
|
|
2201
|
+
throw new h(this.currentContext);
|
|
2072
2202
|
const t = "REQUEST LOGS";
|
|
2073
2203
|
return this.incomingMessages$.pipe(
|
|
2074
|
-
|
|
2204
|
+
y((e) => e.type === t && e.target === "client"),
|
|
2075
2205
|
f((e) => e),
|
|
2076
2206
|
g(this.logReceived())
|
|
2077
2207
|
);
|
|
@@ -2086,11 +2216,11 @@ class Mt {
|
|
|
2086
2216
|
* @param format - Format of the file. Can be either `gzip` or `text`
|
|
2087
2217
|
* @param replyTo - The message ID to which the reply should be sent
|
|
2088
2218
|
*/
|
|
2089
|
-
sendRequestLogsMessageReply(t, e, r,
|
|
2219
|
+
sendRequestLogsMessageReply(t, e, r, s, i) {
|
|
2090
2220
|
if (!this.isEmbedded())
|
|
2091
|
-
throw new
|
|
2092
|
-
const o = "REQUEST LOGS",
|
|
2093
|
-
|
|
2221
|
+
throw new h(this.currentContext);
|
|
2222
|
+
const o = "REQUEST LOGS", a = this.createMessage(o, !1, i);
|
|
2223
|
+
a.fileId = t, a.fileHash = e, a.fileSize = r, a.format = s, this.logCreated(o, a), this.port2.postMessage(a), this.logSent(o, a);
|
|
2094
2224
|
}
|
|
2095
2225
|
/**
|
|
2096
2226
|
* Send a {@link ViewTransitionMessage} to the `Host` app, notifying it of a view transition
|
|
@@ -2107,9 +2237,9 @@ class Mt {
|
|
|
2107
2237
|
*/
|
|
2108
2238
|
sendViewTransitionMessage(t, e) {
|
|
2109
2239
|
if (!this.isEmbedded())
|
|
2110
|
-
throw new
|
|
2111
|
-
const r = "VIEW TRANSITION",
|
|
2112
|
-
|
|
2240
|
+
throw new h(this.currentContext);
|
|
2241
|
+
const r = "VIEW TRANSITION", s = this.createMessage(r, !1);
|
|
2242
|
+
s.transitionType = t, s.targetView = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2113
2243
|
}
|
|
2114
2244
|
/**
|
|
2115
2245
|
* Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.
|
|
@@ -2152,31 +2282,31 @@ class Mt {
|
|
|
2152
2282
|
* @returns An observable that either emits once if the result is `error` or `not found` or
|
|
2153
2283
|
* emits as many times as the number of chunks in the file if the result is `success`.
|
|
2154
2284
|
*/
|
|
2155
|
-
sendFileRequestMessage(t, e, r,
|
|
2285
|
+
sendFileRequestMessage(t, e, r, s, i) {
|
|
2156
2286
|
if (!this.isEmbedded())
|
|
2157
|
-
throw new
|
|
2158
|
-
const o = "FILE REQUEST",
|
|
2159
|
-
if (
|
|
2160
|
-
if (!
|
|
2161
|
-
throw new
|
|
2287
|
+
throw new h(this.currentContext);
|
|
2288
|
+
const o = "FILE REQUEST", a = this.createMessage(o);
|
|
2289
|
+
if (a.fileId = t, a.fileHash = e.toLowerCase(), a.intent = r, a.maxChunkSizeInBytes = i, r === "attachment") {
|
|
2290
|
+
if (!s)
|
|
2291
|
+
throw new m(
|
|
2162
2292
|
"streamId",
|
|
2163
|
-
|
|
2293
|
+
s,
|
|
2164
2294
|
"streamId is required for attachment intent"
|
|
2165
2295
|
);
|
|
2166
|
-
|
|
2296
|
+
a.streamId = s;
|
|
2167
2297
|
}
|
|
2168
|
-
this.logCreated(o,
|
|
2169
|
-
let
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
(
|
|
2298
|
+
this.logCreated(o, a);
|
|
2299
|
+
let c = 0;
|
|
2300
|
+
const l = this.incomingMessages$.pipe(
|
|
2301
|
+
y(
|
|
2302
|
+
(d) => d.type === o && d.replyTo === a.id
|
|
2173
2303
|
),
|
|
2174
2304
|
g(this.logReceived()),
|
|
2175
|
-
g(() =>
|
|
2176
|
-
f((
|
|
2177
|
-
wt((
|
|
2305
|
+
g(() => c++),
|
|
2306
|
+
f((d) => (d.result === "success" && (d.chunkHash = d.chunkHash.toLowerCase(), d.fileHash = d.fileHash.toLowerCase()), d)),
|
|
2307
|
+
wt((d) => d.result === "success" && c < d.totalChunks, !0)
|
|
2178
2308
|
);
|
|
2179
|
-
return this.port2.postMessage(
|
|
2309
|
+
return this.port2.postMessage(a), this.logSent(o, a), l;
|
|
2180
2310
|
}
|
|
2181
2311
|
/**
|
|
2182
2312
|
* Sends a {@link FileRequestMessageReply} to the Host app, to reply to a
|
|
@@ -2199,12 +2329,12 @@ class Mt {
|
|
|
2199
2329
|
*/
|
|
2200
2330
|
sendFileRequestMessageReply(t, e) {
|
|
2201
2331
|
if (!this.isEmbedded())
|
|
2202
|
-
throw new
|
|
2203
|
-
const r = "FILE REQUEST",
|
|
2332
|
+
throw new h(this.currentContext);
|
|
2333
|
+
const r = "FILE REQUEST", s = Object.assign(
|
|
2204
2334
|
e,
|
|
2205
2335
|
this.createMessage(r, !1, t.id)
|
|
2206
2336
|
);
|
|
2207
|
-
this.logCreated(r,
|
|
2337
|
+
this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2208
2338
|
}
|
|
2209
2339
|
/**
|
|
2210
2340
|
* Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a
|
|
@@ -2220,10 +2350,10 @@ class Mt {
|
|
|
2220
2350
|
*/
|
|
2221
2351
|
onFileRequestMessage() {
|
|
2222
2352
|
if (!this.isEmbedded())
|
|
2223
|
-
throw new
|
|
2353
|
+
throw new h(this.currentContext);
|
|
2224
2354
|
const t = "FILE REQUEST";
|
|
2225
2355
|
return this.incomingMessages$.pipe(
|
|
2226
|
-
|
|
2356
|
+
y(
|
|
2227
2357
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2228
2358
|
),
|
|
2229
2359
|
f((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
|
|
@@ -2252,38 +2382,38 @@ class Mt {
|
|
|
2252
2382
|
*
|
|
2253
2383
|
* @returns This method returns void.
|
|
2254
2384
|
*/
|
|
2255
|
-
sendFileSelectionMessage(t = "attachment", e, r,
|
|
2385
|
+
sendFileSelectionMessage(t = "attachment", e, r, s, i, o) {
|
|
2256
2386
|
if (!this.isEmbedded())
|
|
2257
|
-
throw new
|
|
2258
|
-
const
|
|
2259
|
-
if (
|
|
2387
|
+
throw new h(this.currentContext);
|
|
2388
|
+
const a = "FILE SELECTION", c = this.createMessage(a);
|
|
2389
|
+
if (c.intent = t, c.maxCount = s, c.maxFileSizeInBytes = i, c.mimeTypes = o, t === "attachment") {
|
|
2260
2390
|
if (!e)
|
|
2261
|
-
throw new
|
|
2391
|
+
throw new m(
|
|
2262
2392
|
"streamId",
|
|
2263
2393
|
e,
|
|
2264
2394
|
"streamId is required for attachment intent"
|
|
2265
2395
|
);
|
|
2266
2396
|
if (!r)
|
|
2267
|
-
throw new
|
|
2397
|
+
throw new m(
|
|
2268
2398
|
"correlationId",
|
|
2269
2399
|
r,
|
|
2270
2400
|
"correlationId is required for attachment intent"
|
|
2271
2401
|
);
|
|
2272
|
-
|
|
2402
|
+
c.streamId = e, c.correlationId = r;
|
|
2273
2403
|
}
|
|
2274
|
-
this.logCreated(
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
(
|
|
2404
|
+
this.logCreated(a, c);
|
|
2405
|
+
const l = this.incomingMessages$.pipe(
|
|
2406
|
+
y(
|
|
2407
|
+
(d) => d.type === a && d.replyTo === c.id
|
|
2278
2408
|
),
|
|
2279
|
-
f((
|
|
2280
|
-
var
|
|
2281
|
-
return
|
|
2409
|
+
f((d) => {
|
|
2410
|
+
var u;
|
|
2411
|
+
return d.result === "success" && (d.files = (u = d.files) == null ? void 0 : u.map((b) => (b.original.fileHash = b.original.fileHash.toLowerCase(), b.preview && (b.preview.fileHash = b.preview.fileHash.toLowerCase()), b))), d;
|
|
2282
2412
|
}),
|
|
2283
2413
|
g(this.logReceived()),
|
|
2284
|
-
|
|
2414
|
+
C(1)
|
|
2285
2415
|
);
|
|
2286
|
-
return this.port2.postMessage(
|
|
2416
|
+
return this.port2.postMessage(c), this.logSent(a, c), l;
|
|
2287
2417
|
}
|
|
2288
2418
|
/**
|
|
2289
2419
|
* Sends a {@link FileDownloadProgressQueryMessage} to the Host app, to query the progress of a
|
|
@@ -2306,21 +2436,21 @@ class Mt {
|
|
|
2306
2436
|
*/
|
|
2307
2437
|
sendFileDownloadProgressQueryMessage(t, e, r) {
|
|
2308
2438
|
if (!this.isEmbedded())
|
|
2309
|
-
throw new
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2439
|
+
throw new h(this.currentContext);
|
|
2440
|
+
const s = "FILE DOWNLOAD PROGRESS QUERY", i = this.createMessage(
|
|
2441
|
+
s,
|
|
2312
2442
|
!0
|
|
2313
2443
|
);
|
|
2314
|
-
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(
|
|
2444
|
+
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(s, i);
|
|
2315
2445
|
const o = this.incomingMessages$.pipe(
|
|
2316
|
-
|
|
2317
|
-
(
|
|
2446
|
+
y(
|
|
2447
|
+
(a) => a.type === "FILE DOWNLOAD PROGRESS UPDATE" && a.replyTo === i.id
|
|
2318
2448
|
),
|
|
2319
|
-
g((
|
|
2320
|
-
f((
|
|
2321
|
-
|
|
2449
|
+
g((a) => this.logReceived(a)),
|
|
2450
|
+
f((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
|
|
2451
|
+
C(1)
|
|
2322
2452
|
);
|
|
2323
|
-
return this.port2.postMessage(i), this.logSent(
|
|
2453
|
+
return this.port2.postMessage(i), this.logSent(s, i), o;
|
|
2324
2454
|
}
|
|
2325
2455
|
/**
|
|
2326
2456
|
* Setup listener for {@link FileDownloadProgressQueryMessage}, which can be sent by a `Host` app
|
|
@@ -2331,10 +2461,10 @@ class Mt {
|
|
|
2331
2461
|
*/
|
|
2332
2462
|
onFileDownloadProgressUpdateMessage() {
|
|
2333
2463
|
if (!this.isEmbedded())
|
|
2334
|
-
throw new
|
|
2464
|
+
throw new h(this.currentContext);
|
|
2335
2465
|
const t = "FILE DOWNLOAD PROGRESS UPDATE";
|
|
2336
2466
|
return this.incomingMessages$.pipe(
|
|
2337
|
-
|
|
2467
|
+
y(
|
|
2338
2468
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2339
2469
|
),
|
|
2340
2470
|
f((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),
|
|
@@ -2357,21 +2487,21 @@ class Mt {
|
|
|
2357
2487
|
*/
|
|
2358
2488
|
sendFileUploadProgressQueryMessage(t, e, r) {
|
|
2359
2489
|
if (!this.isEmbedded())
|
|
2360
|
-
throw new
|
|
2361
|
-
const
|
|
2362
|
-
|
|
2490
|
+
throw new h(this.currentContext);
|
|
2491
|
+
const s = "FILE UPLOAD PROGRESS QUERY", i = this.createMessage(
|
|
2492
|
+
s,
|
|
2363
2493
|
!0
|
|
2364
2494
|
);
|
|
2365
|
-
i.fileHash = t.toLowerCase(), i.fileId = e, i.correlationId = r, this.logCreated(
|
|
2495
|
+
i.fileHash = t.toLowerCase(), i.fileId = e, i.correlationId = r, this.logCreated(s, i);
|
|
2366
2496
|
const o = this.incomingMessages$.pipe(
|
|
2367
|
-
|
|
2368
|
-
(
|
|
2497
|
+
y(
|
|
2498
|
+
(a) => a.type === "FILE UPLOAD PROGRESS UPDATE" && a.replyTo === i.id
|
|
2369
2499
|
),
|
|
2370
2500
|
g(this.logReceived()),
|
|
2371
|
-
f((
|
|
2372
|
-
|
|
2501
|
+
f((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
|
|
2502
|
+
C(1)
|
|
2373
2503
|
);
|
|
2374
|
-
return this.port2.postMessage(i), this.logSent(
|
|
2504
|
+
return this.port2.postMessage(i), this.logSent(s, i), o;
|
|
2375
2505
|
}
|
|
2376
2506
|
/**
|
|
2377
2507
|
* Setup listener for {@link FileUploadProgressQueryMessage}, which can be sent by a `Host` app to
|
|
@@ -2386,10 +2516,10 @@ class Mt {
|
|
|
2386
2516
|
*/
|
|
2387
2517
|
onFileUploadProgressUpdateMessage() {
|
|
2388
2518
|
if (!this.isEmbedded())
|
|
2389
|
-
throw new
|
|
2519
|
+
throw new h(this.currentContext);
|
|
2390
2520
|
const t = "FILE UPLOAD PROGRESS UPDATE";
|
|
2391
2521
|
return this.incomingMessages$.pipe(
|
|
2392
|
-
|
|
2522
|
+
y(
|
|
2393
2523
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2394
2524
|
),
|
|
2395
2525
|
f((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),
|
|
@@ -2421,39 +2551,39 @@ class Mt {
|
|
|
2421
2551
|
* @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the
|
|
2422
2552
|
* result of the request. Emits once.
|
|
2423
2553
|
*/
|
|
2424
|
-
sendFileDownloadMessage(t, e, r,
|
|
2554
|
+
sendFileDownloadMessage(t, e, r, s, i, o, a, c, l) {
|
|
2425
2555
|
if (!this.isEmbedded())
|
|
2426
|
-
throw new
|
|
2427
|
-
if (
|
|
2428
|
-
|
|
2429
|
-
...
|
|
2430
|
-
cloudId:
|
|
2431
|
-
networkId:
|
|
2432
|
-
cloudUsername:
|
|
2556
|
+
throw new h(this.currentContext);
|
|
2557
|
+
if (c && this.compareVersion("2.1") < 0)
|
|
2558
|
+
c.type === "cloudUsername" && c.contactUser && (c = {
|
|
2559
|
+
...c,
|
|
2560
|
+
cloudId: c.cloudId || c.contactUser.cloudId,
|
|
2561
|
+
networkId: c.networkId || c.contactUser.networkId,
|
|
2562
|
+
cloudUsername: c.cloudUsername || c.contactUser.cloudUsername
|
|
2433
2563
|
});
|
|
2434
|
-
else if (
|
|
2435
|
-
if (!
|
|
2436
|
-
throw new
|
|
2564
|
+
else if (c && this.compareVersion("2.1") >= 0 && c.type === "cloudUsername") {
|
|
2565
|
+
if (!c.contactUser)
|
|
2566
|
+
throw new m(
|
|
2437
2567
|
"sender",
|
|
2438
|
-
|
|
2568
|
+
c,
|
|
2439
2569
|
"CloudUsername contact must include contactUser since v2.1"
|
|
2440
2570
|
);
|
|
2441
|
-
if (!
|
|
2442
|
-
throw new
|
|
2571
|
+
if (!c.contactUser.cloudId || !c.contactUser.networkId || !c.contactUser.cloudUsername)
|
|
2572
|
+
throw new m(
|
|
2443
2573
|
"sender",
|
|
2444
|
-
|
|
2574
|
+
c,
|
|
2445
2575
|
"CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
|
|
2446
2576
|
);
|
|
2447
2577
|
}
|
|
2448
|
-
const
|
|
2449
|
-
|
|
2578
|
+
const d = "FILE DOWNLOAD", u = this.createMessage(d, !0);
|
|
2579
|
+
u.url = t, u.key = e, u.fileHash = r.toLowerCase(), u.mimeType = s, u.fileName = i, u.streamId = o, u.correlationId = a, u.sender = c, u.intent = l ?? "download", this.logCreated(d, u);
|
|
2450
2580
|
const b = this.incomingMessages$.pipe(
|
|
2451
|
-
|
|
2581
|
+
y((p) => p.type === d && p.replyTo === u.id),
|
|
2452
2582
|
g(this.logReceived()),
|
|
2453
2583
|
f((p) => p),
|
|
2454
|
-
|
|
2584
|
+
C(1)
|
|
2455
2585
|
);
|
|
2456
|
-
return this.port2.postMessage(
|
|
2586
|
+
return this.port2.postMessage(u), this.logSent(d, u), b;
|
|
2457
2587
|
}
|
|
2458
2588
|
/**
|
|
2459
2589
|
* Sends a {@link CancelFileDownloadMessage} to the Host app, to cancel downloading of a file
|
|
@@ -2465,9 +2595,9 @@ class Mt {
|
|
|
2465
2595
|
*/
|
|
2466
2596
|
sendCancelFileDownloadMessage(t, e, r) {
|
|
2467
2597
|
if (!this.isEmbedded())
|
|
2468
|
-
throw new
|
|
2469
|
-
const
|
|
2470
|
-
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(
|
|
2598
|
+
throw new h(this.currentContext);
|
|
2599
|
+
const s = "CANCEL FILE DOWNLOAD", i = this.createMessage(s, !1);
|
|
2600
|
+
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(s, i), this.port2.postMessage(i), this.logSent(s, i);
|
|
2471
2601
|
}
|
|
2472
2602
|
/**
|
|
2473
2603
|
* Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
|
|
@@ -2486,16 +2616,16 @@ class Mt {
|
|
|
2486
2616
|
*/
|
|
2487
2617
|
sendFileRemoveMessage(t, e) {
|
|
2488
2618
|
if (!this.isEmbedded())
|
|
2489
|
-
throw new
|
|
2490
|
-
const r = "FILE REMOVE",
|
|
2491
|
-
|
|
2619
|
+
throw new h(this.currentContext);
|
|
2620
|
+
const r = "FILE REMOVE", s = this.createMessage(r, !0);
|
|
2621
|
+
s.hash = t.toLowerCase(), s.streamId = e, this.logCreated(r, s);
|
|
2492
2622
|
const i = this.incomingMessages$.pipe(
|
|
2493
|
-
|
|
2623
|
+
y((o) => o.type === r && o.replyTo === s.id),
|
|
2494
2624
|
g(this.logReceived()),
|
|
2495
2625
|
f((o) => o),
|
|
2496
|
-
|
|
2626
|
+
C(1)
|
|
2497
2627
|
);
|
|
2498
|
-
return this.port2.postMessage(
|
|
2628
|
+
return this.port2.postMessage(s), this.logSent(r, s), i;
|
|
2499
2629
|
}
|
|
2500
2630
|
/**
|
|
2501
2631
|
* Sends a {@link AppResetMessage} to the Host app, to request logging out the user and resetting
|
|
@@ -2512,7 +2642,7 @@ class Mt {
|
|
|
2512
2642
|
*/
|
|
2513
2643
|
sendAppResetMessage() {
|
|
2514
2644
|
if (!this.isEmbedded())
|
|
2515
|
-
throw new
|
|
2645
|
+
throw new h(this.currentContext);
|
|
2516
2646
|
const t = "APP RESET", e = this.createMessage(t, !1);
|
|
2517
2647
|
this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);
|
|
2518
2648
|
}
|
|
@@ -2536,9 +2666,9 @@ class Mt {
|
|
|
2536
2666
|
*/
|
|
2537
2667
|
sendMessageSentMessage(t, e) {
|
|
2538
2668
|
if (!this.isEmbedded())
|
|
2539
|
-
throw new
|
|
2540
|
-
const r = "MESSAGE SENT",
|
|
2541
|
-
|
|
2669
|
+
throw new h(this.currentContext);
|
|
2670
|
+
const r = "MESSAGE SENT", s = this.createMessage(r, !1);
|
|
2671
|
+
s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2542
2672
|
}
|
|
2543
2673
|
/**
|
|
2544
2674
|
* Sends a {@link SendMessageMessage} to the Host app, to send a message to the specified stream.
|
|
@@ -2558,13 +2688,13 @@ class Mt {
|
|
|
2558
2688
|
* @returns An observable which emits a {@link SendMessageMessageReply} instance containing the
|
|
2559
2689
|
* result of the request. Emits once.
|
|
2560
2690
|
*/
|
|
2561
|
-
sendSendMessageMessage(t, e, r,
|
|
2691
|
+
sendSendMessageMessage(t, e, r, s = "TEXT", i, o, a, c = !0, l) {
|
|
2562
2692
|
if (!this.isEmbedded())
|
|
2563
|
-
throw new
|
|
2564
|
-
const
|
|
2565
|
-
if (
|
|
2693
|
+
throw new h(this.currentContext);
|
|
2694
|
+
const d = "SEND MESSAGE", u = this.createMessage(d, !0);
|
|
2695
|
+
if (u.streamId = t, u.correlationId = e, u.body = r, u.messageType = s, i && i.length > 0)
|
|
2566
2696
|
if (this.compareVersion("2.1") < 0)
|
|
2567
|
-
|
|
2697
|
+
u.mentions = i.map((p) => p.contactUser ? {
|
|
2568
2698
|
...p,
|
|
2569
2699
|
cloudId: p.cloudId || p.contactUser.cloudId,
|
|
2570
2700
|
networkId: p.networkId || p.contactUser.networkId,
|
|
@@ -2573,30 +2703,30 @@ class Mt {
|
|
|
2573
2703
|
else {
|
|
2574
2704
|
for (const p of i) {
|
|
2575
2705
|
if (p.type === "cloudUsername" && !p.contactUser)
|
|
2576
|
-
throw new
|
|
2706
|
+
throw new m(
|
|
2577
2707
|
"mentions",
|
|
2578
2708
|
p,
|
|
2579
2709
|
"CloudUsername mention must include contactUser"
|
|
2580
2710
|
);
|
|
2581
2711
|
if (p.contactUser && (!p.contactUser.cloudId || !p.contactUser.networkId || !p.contactUser.cloudUsername))
|
|
2582
|
-
throw new
|
|
2712
|
+
throw new m(
|
|
2583
2713
|
"mentions",
|
|
2584
2714
|
p,
|
|
2585
2715
|
"CloudContact must define cloudUsername, cloudId, and networkId"
|
|
2586
2716
|
);
|
|
2587
2717
|
}
|
|
2588
|
-
|
|
2718
|
+
u.mentions = i;
|
|
2589
2719
|
}
|
|
2590
2720
|
else
|
|
2591
|
-
|
|
2592
|
-
|
|
2721
|
+
u.mentions = [];
|
|
2722
|
+
u.attachments = (o == null ? void 0 : o.map((p) => p.toLowerCase())) ?? [], u.relatedMessageId = a, u.setCursors = c, u.threadId = l, this.logCreated(d, u);
|
|
2593
2723
|
const b = this.incomingMessages$.pipe(
|
|
2594
|
-
|
|
2724
|
+
y((p) => p.type === d && p.replyTo === u.id),
|
|
2595
2725
|
g(this.logReceived()),
|
|
2596
2726
|
f((p) => p),
|
|
2597
|
-
|
|
2727
|
+
C(1)
|
|
2598
2728
|
);
|
|
2599
|
-
return this.port2.postMessage(
|
|
2729
|
+
return this.port2.postMessage(u), this.logSent(d, u), b;
|
|
2600
2730
|
}
|
|
2601
2731
|
/**
|
|
2602
2732
|
* Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
|
|
@@ -2609,9 +2739,9 @@ class Mt {
|
|
|
2609
2739
|
*/
|
|
2610
2740
|
sendCancelSendMessageMessage(t, e) {
|
|
2611
2741
|
if (!this.isEmbedded())
|
|
2612
|
-
throw new
|
|
2613
|
-
const r = "CANCEL SEND MESSAGE",
|
|
2614
|
-
|
|
2742
|
+
throw new h(this.currentContext);
|
|
2743
|
+
const r = "CANCEL SEND MESSAGE", s = this.createMessage(r, !1);
|
|
2744
|
+
s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2615
2745
|
}
|
|
2616
2746
|
/**
|
|
2617
2747
|
* Sends a {@link MessageDeletedMessage} to the Host app, to notify deletion of a message from the
|
|
@@ -2622,9 +2752,9 @@ class Mt {
|
|
|
2622
2752
|
*/
|
|
2623
2753
|
sendMessageDeletedMessage(t, e) {
|
|
2624
2754
|
if (!this.isEmbedded())
|
|
2625
|
-
throw new
|
|
2626
|
-
const r = "MESSAGE DELETED",
|
|
2627
|
-
|
|
2755
|
+
throw new h(this.currentContext);
|
|
2756
|
+
const r = "MESSAGE DELETED", s = this.createMessage(r, !1);
|
|
2757
|
+
s.correlationId = t, s.streamId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2628
2758
|
}
|
|
2629
2759
|
/**
|
|
2630
2760
|
* Sends a {@link SendMessageStatusQueryMessage} to the Host app, to query the status of a message
|
|
@@ -2641,18 +2771,18 @@ class Mt {
|
|
|
2641
2771
|
*/
|
|
2642
2772
|
sendSendMessageStatusQueryMessage(t, e) {
|
|
2643
2773
|
if (!this.isEmbedded())
|
|
2644
|
-
throw new
|
|
2645
|
-
const r = "SEND MESSAGE STATUS QUERY",
|
|
2646
|
-
|
|
2774
|
+
throw new h(this.currentContext);
|
|
2775
|
+
const r = "SEND MESSAGE STATUS QUERY", s = this.createMessage(r, !0);
|
|
2776
|
+
s.correlationId = t, s.streamId = e, this.logCreated(r, s);
|
|
2647
2777
|
const i = this.incomingMessages$.pipe(
|
|
2648
|
-
|
|
2649
|
-
(o) => o.type === "SEND MESSAGE STATUS UPDATE" && o.replyTo ===
|
|
2778
|
+
y(
|
|
2779
|
+
(o) => o.type === "SEND MESSAGE STATUS UPDATE" && o.replyTo === s.id
|
|
2650
2780
|
),
|
|
2651
2781
|
g(this.logReceived()),
|
|
2652
2782
|
f((o) => o),
|
|
2653
|
-
|
|
2783
|
+
C(1)
|
|
2654
2784
|
);
|
|
2655
|
-
return this.port2.postMessage(
|
|
2785
|
+
return this.port2.postMessage(s), this.logSent(r, s), i;
|
|
2656
2786
|
}
|
|
2657
2787
|
/**
|
|
2658
2788
|
* Setup a listener for {@link SendMessageStatusUpdateMessage}, which can be sent by a Host app to
|
|
@@ -2663,10 +2793,10 @@ class Mt {
|
|
|
2663
2793
|
*/
|
|
2664
2794
|
onSendMessageStatusUpdateMessage() {
|
|
2665
2795
|
if (!this.isEmbedded())
|
|
2666
|
-
throw new
|
|
2796
|
+
throw new h(this.currentContext);
|
|
2667
2797
|
const t = "SEND MESSAGE STATUS UPDATE";
|
|
2668
2798
|
return this.incomingMessages$.pipe(
|
|
2669
|
-
|
|
2799
|
+
y((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
2670
2800
|
f((e) => e),
|
|
2671
2801
|
g(this.logReceived())
|
|
2672
2802
|
);
|
|
@@ -2681,7 +2811,7 @@ class Mt {
|
|
|
2681
2811
|
*/
|
|
2682
2812
|
sendSipCallMessage(t) {
|
|
2683
2813
|
if (!this.isEmbedded())
|
|
2684
|
-
throw new
|
|
2814
|
+
throw new h(this.currentContext);
|
|
2685
2815
|
if (this.compareVersion("2.1") < 0)
|
|
2686
2816
|
t.type === "cloudUsername" && t.contactUser && (t = {
|
|
2687
2817
|
...t,
|
|
@@ -2691,13 +2821,13 @@ class Mt {
|
|
|
2691
2821
|
});
|
|
2692
2822
|
else if (t.type === "cloudUsername") {
|
|
2693
2823
|
if (!t.contactUser)
|
|
2694
|
-
throw new
|
|
2824
|
+
throw new m(
|
|
2695
2825
|
"contact",
|
|
2696
2826
|
t,
|
|
2697
2827
|
"CloudUsername contact must include contactUser since v2.1"
|
|
2698
2828
|
);
|
|
2699
2829
|
if (!t.contactUser.cloudId || !t.contactUser.networkId || !t.contactUser.cloudUsername)
|
|
2700
|
-
throw new
|
|
2830
|
+
throw new m(
|
|
2701
2831
|
"contact",
|
|
2702
2832
|
t,
|
|
2703
2833
|
"CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
|
|
@@ -2708,9 +2838,9 @@ class Mt {
|
|
|
2708
2838
|
}
|
|
2709
2839
|
sendCustomFunctionMessage(t, e) {
|
|
2710
2840
|
if (!this.isEmbedded())
|
|
2711
|
-
throw new
|
|
2712
|
-
const r = "CUSTOM FUNCTION",
|
|
2713
|
-
|
|
2841
|
+
throw new h(this.currentContext);
|
|
2842
|
+
const r = "CUSTOM FUNCTION", s = this.createMessage(r, !1);
|
|
2843
|
+
s.customFunctionId = t, s.context = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);
|
|
2714
2844
|
}
|
|
2715
2845
|
/**
|
|
2716
2846
|
* Sends a {@link SubscribeButtonsMessage} to the Host app to subscribe to button updates for
|
|
@@ -2726,7 +2856,7 @@ class Mt {
|
|
|
2726
2856
|
*/
|
|
2727
2857
|
sendSubscribeButtonsMessage(t) {
|
|
2728
2858
|
if (!this.isEmbedded())
|
|
2729
|
-
throw new
|
|
2859
|
+
throw new h(this.currentContext);
|
|
2730
2860
|
const e = "SUBSCRIBE BUTTONS", r = this.createMessage(e, !1);
|
|
2731
2861
|
r.subscribe = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
2732
2862
|
}
|
|
@@ -2757,10 +2887,10 @@ class Mt {
|
|
|
2757
2887
|
*/
|
|
2758
2888
|
onButtonsMessage() {
|
|
2759
2889
|
if (!this.isEmbedded())
|
|
2760
|
-
throw new
|
|
2890
|
+
throw new h(this.currentContext);
|
|
2761
2891
|
const t = "BUTTONS";
|
|
2762
2892
|
return this.incomingMessages$.pipe(
|
|
2763
|
-
|
|
2893
|
+
y((e) => e.type === t && e.target === "client"),
|
|
2764
2894
|
f((e) => e),
|
|
2765
2895
|
g(this.logReceived())
|
|
2766
2896
|
);
|
|
@@ -2802,7 +2932,7 @@ class Mt {
|
|
|
2802
2932
|
* version.
|
|
2803
2933
|
*/
|
|
2804
2934
|
compareVersion(t) {
|
|
2805
|
-
return
|
|
2935
|
+
return xe(this.negotiatedProtocolVersion, t);
|
|
2806
2936
|
}
|
|
2807
2937
|
logReceived(t) {
|
|
2808
2938
|
const e = (r) => this.logService.debug(
|
|
@@ -2810,7 +2940,7 @@ class Mt {
|
|
|
2810
2940
|
r
|
|
2811
2941
|
);
|
|
2812
2942
|
if (t) {
|
|
2813
|
-
|
|
2943
|
+
Mt(t) && (t = { ...t, data: "..." }), e(t);
|
|
2814
2944
|
return;
|
|
2815
2945
|
} else
|
|
2816
2946
|
return e;
|
|
@@ -2847,18 +2977,18 @@ class Mt {
|
|
|
2847
2977
|
}
|
|
2848
2978
|
generateId(t = 8, e = !1) {
|
|
2849
2979
|
let r = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
|
|
2850
|
-
const
|
|
2980
|
+
const s = [];
|
|
2851
2981
|
e && (r = r.substr(0, r.indexOf("Q")));
|
|
2852
2982
|
for (let i = 0; i < t; i++)
|
|
2853
|
-
|
|
2854
|
-
return
|
|
2983
|
+
s.push(r[Math.floor(Math.random() * r.length)]);
|
|
2984
|
+
return s.join("");
|
|
2855
2985
|
}
|
|
2856
2986
|
}
|
|
2857
|
-
function
|
|
2858
|
-
return
|
|
2987
|
+
function Mt(n) {
|
|
2988
|
+
return n.type === "FILE REQUEST" && n.replyTo !== null;
|
|
2859
2989
|
}
|
|
2860
|
-
const Ut = ["2.
|
|
2861
|
-
class
|
|
2990
|
+
const Ut = ["2.2", "2.1", "2.0"];
|
|
2991
|
+
class Rt {
|
|
2862
2992
|
/**
|
|
2863
2993
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
2864
2994
|
*
|
|
@@ -2873,23 +3003,23 @@ class xt {
|
|
|
2873
3003
|
/**
|
|
2874
3004
|
* The type of the `Host` app the `Client` is embedded in.
|
|
2875
3005
|
*/
|
|
2876
|
-
|
|
3006
|
+
I(this, "host");
|
|
2877
3007
|
/**
|
|
2878
3008
|
* The cloud ID of the `Host` app the `Client` is embedded in.
|
|
2879
3009
|
*/
|
|
2880
|
-
|
|
3010
|
+
I(this, "cloudId");
|
|
2881
3011
|
/**
|
|
2882
3012
|
* The cloud username of the logged in user.
|
|
2883
3013
|
*/
|
|
2884
|
-
|
|
3014
|
+
I(this, "cloudUsername");
|
|
2885
3015
|
/**
|
|
2886
3016
|
* The display name of the logged in user.
|
|
2887
3017
|
*/
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
this.logger = t ?? console, this.helper = new
|
|
3018
|
+
I(this, "displayName");
|
|
3019
|
+
I(this, "logger");
|
|
3020
|
+
I(this, "helper");
|
|
3021
|
+
I(this, "listeners");
|
|
3022
|
+
this.logger = t ?? console, this.helper = new It(Ut, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(w.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(w.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(w.PushToken, /* @__PURE__ */ new Set()), this.listeners.set(w.RequestLogs, /* @__PURE__ */ new Set()), this.listeners.set(w.CallInfo, /* @__PURE__ */ new Set());
|
|
2893
3023
|
}
|
|
2894
3024
|
/**
|
|
2895
3025
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2931,57 +3061,73 @@ class xt {
|
|
|
2931
3061
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2932
3062
|
var r;
|
|
2933
3063
|
this.logger.debug("Received Badge Query: ", e);
|
|
2934
|
-
for (const
|
|
2935
|
-
|
|
3064
|
+
for (const s of ((r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
3065
|
+
s();
|
|
2936
3066
|
}), this.helper.onLifecycleMessage().subscribe((e) => {
|
|
2937
3067
|
var r;
|
|
2938
3068
|
this.logger.debug("Received Lifecycle Event: ", e);
|
|
2939
|
-
for (const
|
|
2940
|
-
|
|
3069
|
+
for (const s of ((r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.values()) ?? [])
|
|
3070
|
+
s(e.eventName, e.payload);
|
|
2941
3071
|
}), this.helper.onPushTokenMessage().subscribe((e) => {
|
|
2942
3072
|
var r;
|
|
2943
3073
|
this.logger.debug("Received Push Token: ", e);
|
|
2944
|
-
for (const
|
|
2945
|
-
|
|
3074
|
+
for (const s of ((r = this.listeners.get(w.PushToken)) == null ? void 0 : r.values()) ?? [])
|
|
3075
|
+
s(e.pushToken, e.appId, e.selector);
|
|
2946
3076
|
}), this.helper.onRequestLogsMessage().subscribe((e) => {
|
|
2947
3077
|
var r;
|
|
2948
3078
|
if (this.logger.debug("Received Request Logs Message: ", e), e.responseType === "file")
|
|
2949
3079
|
throw this.logger.error("File response type not supported"), new Error("File response type not supported");
|
|
2950
|
-
for (const
|
|
2951
|
-
|
|
3080
|
+
for (const s of ((r = this.listeners.get(w.RequestLogs)) == null ? void 0 : r.values()) ?? [])
|
|
3081
|
+
s(e.skipCompression);
|
|
3082
|
+
}), this.helper.onCallInfoMessage().subscribe((e) => {
|
|
3083
|
+
var r;
|
|
3084
|
+
this.logger.debug("Received Call Info update: ", e);
|
|
3085
|
+
for (const s of ((r = this.listeners.get(w.CallInfo)) == null ? void 0 : r.values()) ?? [])
|
|
3086
|
+
s(e.calls);
|
|
2952
3087
|
}), this.cloudId = t.cloudId, this.cloudUsername = t.cloudUsername, this.displayName = t.displayName, this.host = t.host;
|
|
2953
3088
|
}),
|
|
2954
|
-
|
|
3089
|
+
R(() => {
|
|
2955
3090
|
})
|
|
2956
3091
|
)
|
|
2957
3092
|
);
|
|
2958
3093
|
}
|
|
2959
|
-
selectContacts(t, e, r,
|
|
3094
|
+
selectContacts(t, e, r, s) {
|
|
2960
3095
|
this.logger.debug("Selecting Contacts: ", ...arguments);
|
|
2961
3096
|
let i;
|
|
2962
3097
|
if (this.negotiatedVersion === "2.0") {
|
|
2963
|
-
if (typeof e
|
|
2964
|
-
throw new
|
|
2965
|
-
if (
|
|
2966
|
-
throw new
|
|
3098
|
+
if (typeof e == "object")
|
|
3099
|
+
throw new V("2.1", this.negotiatedVersion);
|
|
3100
|
+
if (typeof e != "string" && e !== void 0)
|
|
3101
|
+
throw new m("mode", e, 'mode must be "single" or "multi"');
|
|
3102
|
+
if (s === "number")
|
|
3103
|
+
throw new m(
|
|
2967
3104
|
"contactType",
|
|
2968
|
-
|
|
3105
|
+
s,
|
|
2969
3106
|
'contactType cannot be "number" for version 2.0 of the IPC protocol'
|
|
2970
3107
|
);
|
|
2971
3108
|
i = this.selectContacts_V2_0(
|
|
2972
3109
|
t,
|
|
2973
3110
|
e ?? "single",
|
|
2974
3111
|
e === "multi" ? r : void 0,
|
|
2975
|
-
e === "multi" ?
|
|
3112
|
+
e === "multi" ? s : r
|
|
2976
3113
|
);
|
|
2977
|
-
} else
|
|
2978
|
-
if (typeof e != "object")
|
|
2979
|
-
throw new y("options", e, "options must be an object");
|
|
3114
|
+
} else if (typeof e == "object")
|
|
2980
3115
|
i = this.selectContacts_V2_1(t, e);
|
|
3116
|
+
else {
|
|
3117
|
+
this.logger.warn(
|
|
3118
|
+
"The string-based selectContacts API is deprecated. Please use the options object API instead."
|
|
3119
|
+
);
|
|
3120
|
+
const o = e ?? "single", a = o === "multi" ? r : void 0, c = o === "multi" ? s : r, l = {
|
|
3121
|
+
mode: o,
|
|
3122
|
+
filterToSelectedType: !1,
|
|
3123
|
+
currentContacts: a,
|
|
3124
|
+
resultTypes: c ? [c] : ["cloudUsername"]
|
|
3125
|
+
};
|
|
3126
|
+
i = this.selectContacts_V2_1(t, l);
|
|
2981
3127
|
}
|
|
2982
3128
|
return T(
|
|
2983
3129
|
i.pipe(
|
|
2984
|
-
|
|
3130
|
+
R((o) => o.result === "error" ? {
|
|
2985
3131
|
result: "error",
|
|
2986
3132
|
errorMessage: o.errorMessage
|
|
2987
3133
|
} : o.result === "cancelled" ? {
|
|
@@ -2990,37 +3136,53 @@ class xt {
|
|
|
2990
3136
|
)
|
|
2991
3137
|
);
|
|
2992
3138
|
}
|
|
2993
|
-
selectContacts_V2_0(t, e, r,
|
|
3139
|
+
selectContacts_V2_0(t, e, r, s) {
|
|
2994
3140
|
if (this.logger.debug("Selecting Contacts: ", ...arguments), e === "multi") {
|
|
2995
3141
|
if (!r || !Array.isArray(r))
|
|
2996
|
-
throw new
|
|
3142
|
+
throw new m(
|
|
2997
3143
|
"currentContacts",
|
|
2998
3144
|
r,
|
|
2999
3145
|
"currentContacts is required for group streams"
|
|
3000
3146
|
);
|
|
3001
|
-
return
|
|
3147
|
+
return s || (s = "cloudUsername"), this.helper.selectContacts(
|
|
3002
3148
|
t.toString(),
|
|
3003
3149
|
"group",
|
|
3004
|
-
|
|
3150
|
+
s,
|
|
3005
3151
|
r
|
|
3006
3152
|
);
|
|
3007
3153
|
} else
|
|
3008
|
-
return
|
|
3154
|
+
return s || (s = "cloudUsername"), this.helper.selectContacts(t.toString(), "direct", s);
|
|
3009
3155
|
}
|
|
3010
3156
|
selectContacts_V2_1(t, e) {
|
|
3011
|
-
|
|
3012
|
-
|
|
3157
|
+
this.logger.debug("Selecting Contacts: ", e);
|
|
3158
|
+
const r = t.toString(), s = e.resultTypes ?? ["cloudUsername"];
|
|
3159
|
+
if (e.mode === "single")
|
|
3160
|
+
return this.helper.selectContacts(r, {
|
|
3161
|
+
allowMultipleSelection: !1,
|
|
3162
|
+
resultTypes: s
|
|
3163
|
+
});
|
|
3164
|
+
if (!e.currentContacts || !Array.isArray(e.currentContacts))
|
|
3165
|
+
throw new m(
|
|
3013
3166
|
"currentContacts",
|
|
3014
3167
|
e.currentContacts,
|
|
3015
3168
|
"currentContacts is required for group streams"
|
|
3016
3169
|
);
|
|
3017
|
-
return this.helper.selectContacts(
|
|
3018
|
-
|
|
3170
|
+
return e.filterToSelectedType ? this.helper.selectContacts(
|
|
3171
|
+
r,
|
|
3172
|
+
{
|
|
3173
|
+
allowMultipleSelection: !0,
|
|
3174
|
+
filterToSelectedType: !0,
|
|
3175
|
+
resultTypes: s
|
|
3176
|
+
},
|
|
3177
|
+
e.currentContacts
|
|
3178
|
+
) : this.helper.selectContacts(
|
|
3179
|
+
r,
|
|
3019
3180
|
{
|
|
3020
|
-
allowMultipleSelection:
|
|
3021
|
-
|
|
3181
|
+
allowMultipleSelection: !0,
|
|
3182
|
+
filterToSelectedType: !1,
|
|
3183
|
+
resultTypes: s
|
|
3022
3184
|
},
|
|
3023
|
-
e.
|
|
3185
|
+
e.currentContacts
|
|
3024
3186
|
);
|
|
3025
3187
|
}
|
|
3026
3188
|
/**
|
|
@@ -3033,7 +3195,7 @@ class xt {
|
|
|
3033
3195
|
* Host's contact list.
|
|
3034
3196
|
*/
|
|
3035
3197
|
matchContacts(t) {
|
|
3036
|
-
return this.logger.debug("Match Contacts: ", t), T(this.helper.matchContacts(t).pipe(
|
|
3198
|
+
return this.logger.debug("Match Contacts: ", t), T(this.helper.matchContacts(t).pipe(R((e) => e.contacts)));
|
|
3037
3199
|
}
|
|
3038
3200
|
/**
|
|
3039
3201
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -3041,7 +3203,7 @@ class xt {
|
|
|
3041
3203
|
* @returns A promise with the Push Token as `string`.
|
|
3042
3204
|
*/
|
|
3043
3205
|
requestPushToken() {
|
|
3044
|
-
return this.logger.debug("Requesting Push Token"), T(this.helper.requestPushToken().pipe(
|
|
3206
|
+
return this.logger.debug("Requesting Push Token"), T(this.helper.requestPushToken().pipe(R((t) => t.pushToken)));
|
|
3045
3207
|
}
|
|
3046
3208
|
/**
|
|
3047
3209
|
* Sends the current badge count to the `Host` app.
|
|
@@ -3110,9 +3272,9 @@ class xt {
|
|
|
3110
3272
|
*/
|
|
3111
3273
|
onBadgeQueryRequest(t) {
|
|
3112
3274
|
var e;
|
|
3113
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
3275
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(w.BadgeQuery)) == null || e.add(t), () => {
|
|
3114
3276
|
var r;
|
|
3115
|
-
return (r = this.listeners.get(
|
|
3277
|
+
return (r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
3116
3278
|
};
|
|
3117
3279
|
}
|
|
3118
3280
|
/**
|
|
@@ -3129,9 +3291,9 @@ class xt {
|
|
|
3129
3291
|
*/
|
|
3130
3292
|
onLifecycleEvent(t) {
|
|
3131
3293
|
var e;
|
|
3132
|
-
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(
|
|
3294
|
+
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(w.Lifecycle)) == null || e.add(t), () => {
|
|
3133
3295
|
var r;
|
|
3134
|
-
return (r = this.listeners.get(
|
|
3296
|
+
return (r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.delete(t);
|
|
3135
3297
|
};
|
|
3136
3298
|
}
|
|
3137
3299
|
/**
|
|
@@ -3147,9 +3309,9 @@ class xt {
|
|
|
3147
3309
|
*/
|
|
3148
3310
|
onPushToken(t) {
|
|
3149
3311
|
var e;
|
|
3150
|
-
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(
|
|
3312
|
+
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(w.PushToken)) == null || e.add(t), () => {
|
|
3151
3313
|
var r;
|
|
3152
|
-
return (r = this.listeners.get(
|
|
3314
|
+
return (r = this.listeners.get(w.PushToken)) == null ? void 0 : r.delete(t);
|
|
3153
3315
|
};
|
|
3154
3316
|
}
|
|
3155
3317
|
/**
|
|
@@ -3169,9 +3331,48 @@ class xt {
|
|
|
3169
3331
|
*/
|
|
3170
3332
|
onRequestLogsMessage(t) {
|
|
3171
3333
|
var e;
|
|
3172
|
-
return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(
|
|
3334
|
+
return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(w.RequestLogs)) == null || e.add(t), () => {
|
|
3335
|
+
var r;
|
|
3336
|
+
return (r = this.listeners.get(w.RequestLogs)) == null ? void 0 : r.delete(t);
|
|
3337
|
+
};
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* Requests the current call information from the `Host` app.
|
|
3341
|
+
*
|
|
3342
|
+
* @remarks
|
|
3343
|
+
* This method requires protocol version 2.2 or higher. If the negotiated version
|
|
3344
|
+
* is lower, an {@link UnsupportedVersionError} will be thrown.
|
|
3345
|
+
*
|
|
3346
|
+
* @returns A promise with an array of {@link CallInfoItem} objects representing
|
|
3347
|
+
* the current calls.
|
|
3348
|
+
*
|
|
3349
|
+
* @throws {@link UnsupportedVersionError} if the negotiated version is below 2.2.
|
|
3350
|
+
*/
|
|
3351
|
+
requestCallInfo() {
|
|
3352
|
+
if (this.logger.debug("Requesting Call Info"), this.negotiatedVersion === "2.0" || this.negotiatedVersion === "2.1")
|
|
3353
|
+
throw new V("2.2", this.negotiatedVersion);
|
|
3354
|
+
return T(this.helper.requestCallInfo().pipe(R((t) => t.calls)));
|
|
3355
|
+
}
|
|
3356
|
+
/**
|
|
3357
|
+
* Registers a callback to be invoked when a {@link IPCEvents.CallInfo} event is received.
|
|
3358
|
+
*
|
|
3359
|
+
* @remarks
|
|
3360
|
+
* The Host app sends CALL INFO updates when call state changes occur. This includes
|
|
3361
|
+
* new calls, call state transitions, and call terminations.
|
|
3362
|
+
*
|
|
3363
|
+
* Note: This event is only available on protocol version 2.2 or higher. On lower versions,
|
|
3364
|
+
* the callback will never be invoked.
|
|
3365
|
+
*
|
|
3366
|
+
* @param callback - A callback function to be invoked when a {@link IPCEvents.CallInfo} event
|
|
3367
|
+
* is received. The callback receives an array of {@link CallInfoItem} objects.
|
|
3368
|
+
*
|
|
3369
|
+
* @returns An unsubscribe callback to remove the listener.
|
|
3370
|
+
*/
|
|
3371
|
+
onCallInfo(t) {
|
|
3372
|
+
var e;
|
|
3373
|
+
return this.logger.debug("Registering for Call Info updates"), (e = this.listeners.get(w.CallInfo)) == null || e.add(t), () => {
|
|
3173
3374
|
var r;
|
|
3174
|
-
return (r = this.listeners.get(
|
|
3375
|
+
return (r = this.listeners.get(w.CallInfo)) == null ? void 0 : r.delete(t);
|
|
3175
3376
|
};
|
|
3176
3377
|
}
|
|
3177
3378
|
evaluateContext(t) {
|
|
@@ -3182,6 +3383,6 @@ class xt {
|
|
|
3182
3383
|
}
|
|
3183
3384
|
}
|
|
3184
3385
|
export {
|
|
3185
|
-
|
|
3186
|
-
|
|
3386
|
+
w as IPCEvents,
|
|
3387
|
+
Rt as IPCManager
|
|
3187
3388
|
};
|