@acrobits/ipc-sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/search.js +1 -1
- package/docs/classes/IPCManager.html +17 -10
- package/docs/enums/IPCEvents.html +3 -1
- package/docs/interfaces/UriContactItem.html +3 -3
- package/docs/types/HostType.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/lib/index.d.ts +17 -1
- package/lib/ipc-sdk.js +413 -302
- package/lib/ipc-sdk.js.map +1 -1
- package/lib/ipc-sdk.umd.cjs +3 -3
- package/lib/ipc-sdk.umd.cjs.map +1 -1
- package/package.json +2 -2
package/lib/ipc-sdk.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Re = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var M = (n, t, e) => (
|
|
4
|
-
var
|
|
5
|
-
return
|
|
2
|
+
var Ae = (n, t, e) => t in n ? Re(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var M = (n, t, e) => (Ae(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var y = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(y || {}), z = function(n, t) {
|
|
5
|
+
return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
8
8
|
for (var i in r)
|
|
9
9
|
Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
10
|
-
},
|
|
10
|
+
}, z(n, t);
|
|
11
11
|
};
|
|
12
12
|
function x(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
|
+
z(n, t);
|
|
16
16
|
function e() {
|
|
17
17
|
this.constructor = n;
|
|
18
18
|
}
|
|
@@ -34,29 +34,29 @@ function _(n, t) {
|
|
|
34
34
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
35
35
|
if (!e)
|
|
36
36
|
return n;
|
|
37
|
-
var r = e.call(n), i,
|
|
37
|
+
var r = e.call(n), i, s = [], o;
|
|
38
38
|
try {
|
|
39
39
|
for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
|
|
40
|
-
|
|
40
|
+
s.push(i.value);
|
|
41
41
|
} catch (u) {
|
|
42
|
-
|
|
42
|
+
o = { error: u };
|
|
43
43
|
} finally {
|
|
44
44
|
try {
|
|
45
45
|
i && !i.done && (e = r.return) && e.call(r);
|
|
46
46
|
} finally {
|
|
47
|
-
if (
|
|
48
|
-
throw
|
|
47
|
+
if (o)
|
|
48
|
+
throw o.error;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return s;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function T(n, t, e) {
|
|
54
54
|
if (e || arguments.length === 2)
|
|
55
|
-
for (var r = 0, i = t.length,
|
|
56
|
-
(
|
|
57
|
-
return n.concat(
|
|
55
|
+
for (var r = 0, i = t.length, s; r < i; r++)
|
|
56
|
+
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
57
|
+
return n.concat(s || Array.prototype.slice.call(t));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function m(n) {
|
|
60
60
|
return typeof n == "function";
|
|
61
61
|
}
|
|
62
62
|
function Z(n) {
|
|
@@ -65,7 +65,7 @@ function Z(n) {
|
|
|
65
65
|
}, e = n(t);
|
|
66
66
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var D = Z(function(n) {
|
|
69
69
|
return function(e) {
|
|
70
70
|
n(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
71
71
|
` + e.map(function(r, i) {
|
|
@@ -80,19 +80,19 @@ function U(n, t) {
|
|
|
80
80
|
0 <= e && n.splice(e, 1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var I = function() {
|
|
84
84
|
function n(t) {
|
|
85
85
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
86
86
|
}
|
|
87
87
|
return n.prototype.unsubscribe = function() {
|
|
88
|
-
var t, e, r, i,
|
|
88
|
+
var t, e, r, i, s;
|
|
89
89
|
if (!this.closed) {
|
|
90
90
|
this.closed = !0;
|
|
91
|
-
var
|
|
92
|
-
if (
|
|
93
|
-
if (this._parentage = null, Array.isArray(
|
|
91
|
+
var o = this._parentage;
|
|
92
|
+
if (o)
|
|
93
|
+
if (this._parentage = null, Array.isArray(o))
|
|
94
94
|
try {
|
|
95
|
-
for (var u = Q(
|
|
95
|
+
for (var u = Q(o), c = u.next(); !c.done; c = u.next()) {
|
|
96
96
|
var a = c.value;
|
|
97
97
|
a.remove(this);
|
|
98
98
|
}
|
|
@@ -107,45 +107,45 @@ var T = function() {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
else
|
|
110
|
-
|
|
110
|
+
o.remove(this);
|
|
111
111
|
var g = this.initialTeardown;
|
|
112
|
-
if (
|
|
112
|
+
if (m(g))
|
|
113
113
|
try {
|
|
114
114
|
g();
|
|
115
115
|
} catch (d) {
|
|
116
|
-
|
|
116
|
+
s = d instanceof D ? d.errors : [d];
|
|
117
117
|
}
|
|
118
118
|
var v = this._finalizers;
|
|
119
119
|
if (v) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var
|
|
123
|
-
var
|
|
122
|
+
for (var E = Q(v), w = E.next(); !w.done; w = E.next()) {
|
|
123
|
+
var N = w.value;
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
se(N);
|
|
126
126
|
} catch (d) {
|
|
127
|
-
|
|
127
|
+
s = s ?? [], d instanceof D ? s = T(T([], _(s)), _(d.errors)) : s.push(d);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
} catch (d) {
|
|
131
131
|
r = { error: d };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
|
|
134
|
+
w && !w.done && (i = E.return) && i.call(E);
|
|
135
135
|
} finally {
|
|
136
136
|
if (r)
|
|
137
137
|
throw r.error;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
if (
|
|
142
|
-
throw new
|
|
141
|
+
if (s)
|
|
142
|
+
throw new D(s);
|
|
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
|
+
se(t);
|
|
149
149
|
else {
|
|
150
150
|
if (t instanceof n) {
|
|
151
151
|
if (t.closed || t._hasParent(this))
|
|
@@ -170,12 +170,12 @@ var T = function() {
|
|
|
170
170
|
var t = new n();
|
|
171
171
|
return t.closed = !0, t;
|
|
172
172
|
}(), n;
|
|
173
|
-
}(), me =
|
|
173
|
+
}(), me = I.EMPTY;
|
|
174
174
|
function we(n) {
|
|
175
|
-
return n instanceof
|
|
175
|
+
return n instanceof I || n && "closed" in n && m(n.remove) && m(n.add) && m(n.unsubscribe);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
177
|
+
function se(n) {
|
|
178
|
+
m(n) ? n() : n.unsubscribe();
|
|
179
179
|
}
|
|
180
180
|
var Se = {
|
|
181
181
|
onUnhandledError: null,
|
|
@@ -188,7 +188,7 @@ var Se = {
|
|
|
188
188
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
189
189
|
e[r - 2] = arguments[r];
|
|
190
190
|
var i = Y.delegate;
|
|
191
|
-
return i != null && i.setTimeout ? i.setTimeout.apply(i,
|
|
191
|
+
return i != null && i.setTimeout ? i.setTimeout.apply(i, T([n, t], _(e))) : setTimeout.apply(void 0, T([n, t], _(e)));
|
|
192
192
|
},
|
|
193
193
|
clearTimeout: function(n) {
|
|
194
194
|
var t = Y.delegate;
|
|
@@ -201,7 +201,7 @@ function Oe(n) {
|
|
|
201
201
|
throw n;
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function oe() {
|
|
205
205
|
}
|
|
206
206
|
function L(n) {
|
|
207
207
|
n();
|
|
@@ -210,10 +210,10 @@ var ee = function(n) {
|
|
|
210
210
|
x(t, n);
|
|
211
211
|
function t(e) {
|
|
212
212
|
var r = n.call(this) || this;
|
|
213
|
-
return r.isStopped = !1, e ? (r.destination = e, we(e) && e.add(r)) : r.destination =
|
|
213
|
+
return r.isStopped = !1, e ? (r.destination = e, we(e) && e.add(r)) : r.destination = ke, r;
|
|
214
214
|
}
|
|
215
215
|
return t.create = function(e, r, i) {
|
|
216
|
-
return new
|
|
216
|
+
return new k(e, r, i);
|
|
217
217
|
}, t.prototype.next = function(e) {
|
|
218
218
|
this.isStopped || this._next(e);
|
|
219
219
|
}, t.prototype.error = function(e) {
|
|
@@ -237,7 +237,7 @@ var ee = function(n) {
|
|
|
237
237
|
this.unsubscribe();
|
|
238
238
|
}
|
|
239
239
|
}, t;
|
|
240
|
-
}(
|
|
240
|
+
}(I), Le = Function.prototype.bind;
|
|
241
241
|
function B(n, t) {
|
|
242
242
|
return Le.call(n, t);
|
|
243
243
|
}
|
|
@@ -272,27 +272,27 @@ var $e = function() {
|
|
|
272
272
|
R(e);
|
|
273
273
|
}
|
|
274
274
|
}, n;
|
|
275
|
-
}(),
|
|
275
|
+
}(), k = function(n) {
|
|
276
276
|
x(t, n);
|
|
277
277
|
function t(e, r, i) {
|
|
278
|
-
var
|
|
279
|
-
if (
|
|
280
|
-
|
|
278
|
+
var s = n.call(this) || this, o;
|
|
279
|
+
if (m(e) || !e)
|
|
280
|
+
o = {
|
|
281
281
|
next: e ?? void 0,
|
|
282
282
|
error: r ?? void 0,
|
|
283
283
|
complete: i ?? void 0
|
|
284
284
|
};
|
|
285
285
|
else {
|
|
286
286
|
var u;
|
|
287
|
-
|
|
288
|
-
return
|
|
289
|
-
},
|
|
287
|
+
s && Se.useDeprecatedNextContext ? (u = Object.create(e), u.unsubscribe = function() {
|
|
288
|
+
return s.unsubscribe();
|
|
289
|
+
}, o = {
|
|
290
290
|
next: e.next && B(e.next, u),
|
|
291
291
|
error: e.error && B(e.error, u),
|
|
292
292
|
complete: e.complete && B(e.complete, u)
|
|
293
|
-
}) :
|
|
293
|
+
}) : o = e;
|
|
294
294
|
}
|
|
295
|
-
return
|
|
295
|
+
return s.destination = new $e(o), s;
|
|
296
296
|
}
|
|
297
297
|
return t;
|
|
298
298
|
}(ee);
|
|
@@ -302,18 +302,18 @@ function R(n) {
|
|
|
302
302
|
function Ue(n) {
|
|
303
303
|
throw n;
|
|
304
304
|
}
|
|
305
|
-
var
|
|
305
|
+
var ke = {
|
|
306
306
|
closed: !0,
|
|
307
|
-
next:
|
|
307
|
+
next: oe,
|
|
308
308
|
error: Ue,
|
|
309
|
-
complete:
|
|
310
|
-
},
|
|
309
|
+
complete: oe
|
|
310
|
+
}, Ve = function() {
|
|
311
311
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
312
312
|
}();
|
|
313
313
|
function Ee(n) {
|
|
314
314
|
return n;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function je(n) {
|
|
317
317
|
return n.length === 0 ? Ee : n.length === 1 ? n[0] : function(e) {
|
|
318
318
|
return n.reduce(function(r, i) {
|
|
319
319
|
return i(r);
|
|
@@ -328,11 +328,11 @@ var G = function() {
|
|
|
328
328
|
var e = new n();
|
|
329
329
|
return e.source = this, e.operator = t, e;
|
|
330
330
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
331
|
-
var i = this,
|
|
331
|
+
var i = this, s = Ne(t) ? t : new k(t, e, r);
|
|
332
332
|
return L(function() {
|
|
333
|
-
var
|
|
334
|
-
|
|
335
|
-
}),
|
|
333
|
+
var o = i, u = o.operator, c = o.source;
|
|
334
|
+
s.add(u ? u.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
|
|
335
|
+
}), s;
|
|
336
336
|
}, n.prototype._trySubscribe = function(t) {
|
|
337
337
|
try {
|
|
338
338
|
return this._subscribe(t);
|
|
@@ -341,39 +341,39 @@ var G = function() {
|
|
|
341
341
|
}
|
|
342
342
|
}, n.prototype.forEach = function(t, e) {
|
|
343
343
|
var r = this;
|
|
344
|
-
return e = ce(e), new e(function(i,
|
|
345
|
-
var
|
|
344
|
+
return e = ce(e), new e(function(i, s) {
|
|
345
|
+
var o = new k({
|
|
346
346
|
next: function(u) {
|
|
347
347
|
try {
|
|
348
348
|
t(u);
|
|
349
349
|
} catch (c) {
|
|
350
|
-
|
|
350
|
+
s(c), o.unsubscribe();
|
|
351
351
|
}
|
|
352
352
|
},
|
|
353
|
-
error:
|
|
353
|
+
error: s,
|
|
354
354
|
complete: i
|
|
355
355
|
});
|
|
356
|
-
r.subscribe(
|
|
356
|
+
r.subscribe(o);
|
|
357
357
|
});
|
|
358
358
|
}, n.prototype._subscribe = function(t) {
|
|
359
359
|
var e;
|
|
360
360
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
361
|
-
}, n.prototype[
|
|
361
|
+
}, n.prototype[Ve] = function() {
|
|
362
362
|
return this;
|
|
363
363
|
}, n.prototype.pipe = function() {
|
|
364
364
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
365
365
|
t[e] = arguments[e];
|
|
366
|
-
return
|
|
366
|
+
return je(t)(this);
|
|
367
367
|
}, n.prototype.toPromise = function(t) {
|
|
368
368
|
var e = this;
|
|
369
369
|
return t = ce(t), new t(function(r, i) {
|
|
370
|
-
var
|
|
371
|
-
e.subscribe(function(
|
|
372
|
-
return
|
|
373
|
-
}, function(
|
|
374
|
-
return i(
|
|
370
|
+
var s;
|
|
371
|
+
e.subscribe(function(o) {
|
|
372
|
+
return s = o;
|
|
373
|
+
}, function(o) {
|
|
374
|
+
return i(o);
|
|
375
375
|
}, function() {
|
|
376
|
-
return r(
|
|
376
|
+
return r(s);
|
|
377
377
|
});
|
|
378
378
|
});
|
|
379
379
|
}, n.create = function(t) {
|
|
@@ -384,18 +384,18 @@ function ce(n) {
|
|
|
384
384
|
var t;
|
|
385
385
|
return (t = n ?? Se.Promise) !== null && t !== void 0 ? t : Promise;
|
|
386
386
|
}
|
|
387
|
+
function Fe(n) {
|
|
388
|
+
return n && m(n.next) && m(n.error) && m(n.complete);
|
|
389
|
+
}
|
|
387
390
|
function Ne(n) {
|
|
388
|
-
return n &&
|
|
391
|
+
return n && n instanceof ee || Fe(n) && we(n);
|
|
389
392
|
}
|
|
390
393
|
function De(n) {
|
|
391
|
-
return n
|
|
392
|
-
}
|
|
393
|
-
function ke(n) {
|
|
394
|
-
return y(n == null ? void 0 : n.lift);
|
|
394
|
+
return m(n == null ? void 0 : n.lift);
|
|
395
395
|
}
|
|
396
396
|
function Ce(n) {
|
|
397
397
|
return function(t) {
|
|
398
|
-
if (
|
|
398
|
+
if (De(t))
|
|
399
399
|
return t.lift(function(e) {
|
|
400
400
|
try {
|
|
401
401
|
return n(e, this);
|
|
@@ -411,17 +411,17 @@ function xe(n, t, e, r, i) {
|
|
|
411
411
|
}
|
|
412
412
|
var Be = function(n) {
|
|
413
413
|
x(t, n);
|
|
414
|
-
function t(e, r, i,
|
|
414
|
+
function t(e, r, i, s, o, u) {
|
|
415
415
|
var c = n.call(this, e) || this;
|
|
416
|
-
return c.onFinalize =
|
|
416
|
+
return c.onFinalize = o, c.shouldUnsubscribe = u, c._next = r ? function(a) {
|
|
417
417
|
try {
|
|
418
418
|
r(a);
|
|
419
419
|
} catch (g) {
|
|
420
420
|
e.error(g);
|
|
421
421
|
}
|
|
422
|
-
} : n.prototype._next, c._error =
|
|
422
|
+
} : n.prototype._next, c._error = s ? function(a) {
|
|
423
423
|
try {
|
|
424
|
-
|
|
424
|
+
s(a);
|
|
425
425
|
} catch (g) {
|
|
426
426
|
e.error(g);
|
|
427
427
|
} finally {
|
|
@@ -463,11 +463,11 @@ var Be = function(n) {
|
|
|
463
463
|
}, t.prototype.next = function(e) {
|
|
464
464
|
var r = this;
|
|
465
465
|
L(function() {
|
|
466
|
-
var i,
|
|
466
|
+
var i, s;
|
|
467
467
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
468
468
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
469
469
|
try {
|
|
470
|
-
for (var
|
|
470
|
+
for (var o = Q(r.currentObservers), u = o.next(); !u.done; u = o.next()) {
|
|
471
471
|
var c = u.value;
|
|
472
472
|
c.next(e);
|
|
473
473
|
}
|
|
@@ -475,7 +475,7 @@ var Be = function(n) {
|
|
|
475
475
|
i = { error: a };
|
|
476
476
|
} finally {
|
|
477
477
|
try {
|
|
478
|
-
u && !u.done && (
|
|
478
|
+
u && !u.done && (s = o.return) && s.call(o);
|
|
479
479
|
} finally {
|
|
480
480
|
if (i)
|
|
481
481
|
throw i.error;
|
|
@@ -515,13 +515,13 @@ var Be = function(n) {
|
|
|
515
515
|
}, t.prototype._subscribe = function(e) {
|
|
516
516
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
517
517
|
}, t.prototype._innerSubscribe = function(e) {
|
|
518
|
-
var r = this, i = this,
|
|
519
|
-
return
|
|
518
|
+
var r = this, i = this, s = i.hasError, o = i.isStopped, u = i.observers;
|
|
519
|
+
return s || o ? me : (this.currentObservers = null, u.push(e), new I(function() {
|
|
520
520
|
r.currentObservers = null, U(u, e);
|
|
521
521
|
}));
|
|
522
522
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
523
|
-
var r = this, i = r.hasError,
|
|
524
|
-
i ? e.error(
|
|
523
|
+
var r = this, i = r.hasError, s = r.thrownError, o = r.isStopped;
|
|
524
|
+
i ? e.error(s) : o && e.complete();
|
|
525
525
|
}, t.prototype.asObservable = function() {
|
|
526
526
|
var e = new G();
|
|
527
527
|
return e.source = this, e;
|
|
@@ -552,7 +552,7 @@ var Be = function(n) {
|
|
|
552
552
|
return (_e.delegate || Date).now();
|
|
553
553
|
},
|
|
554
554
|
delegate: void 0
|
|
555
|
-
},
|
|
555
|
+
}, He = function(n) {
|
|
556
556
|
x(t, n);
|
|
557
557
|
function t(e, r) {
|
|
558
558
|
return n.call(this) || this;
|
|
@@ -560,19 +560,19 @@ var Be = function(n) {
|
|
|
560
560
|
return t.prototype.schedule = function(e, r) {
|
|
561
561
|
return this;
|
|
562
562
|
}, t;
|
|
563
|
-
}(
|
|
563
|
+
}(I), V = {
|
|
564
564
|
setInterval: function(n, t) {
|
|
565
565
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
566
566
|
e[r - 2] = arguments[r];
|
|
567
|
-
var i =
|
|
568
|
-
return i != null && i.setInterval ? i.setInterval.apply(i,
|
|
567
|
+
var i = V.delegate;
|
|
568
|
+
return i != null && i.setInterval ? i.setInterval.apply(i, T([n, t], _(e))) : setInterval.apply(void 0, T([n, t], _(e)));
|
|
569
569
|
},
|
|
570
570
|
clearInterval: function(n) {
|
|
571
|
-
var t =
|
|
571
|
+
var t = V.delegate;
|
|
572
572
|
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
|
|
573
573
|
},
|
|
574
574
|
delegate: void 0
|
|
575
|
-
},
|
|
575
|
+
}, ze = function(n) {
|
|
576
576
|
x(t, n);
|
|
577
577
|
function t(e, r) {
|
|
578
578
|
var i = n.call(this, e, r) || this;
|
|
@@ -583,14 +583,14 @@ var Be = function(n) {
|
|
|
583
583
|
if (r === void 0 && (r = 0), this.closed)
|
|
584
584
|
return this;
|
|
585
585
|
this.state = e;
|
|
586
|
-
var
|
|
587
|
-
return
|
|
586
|
+
var s = this.id, o = this.scheduler;
|
|
587
|
+
return s != null && (this.id = this.recycleAsyncId(o, s, r)), this.pending = !0, this.delay = r, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(o, this.id, r), this;
|
|
588
588
|
}, t.prototype.requestAsyncId = function(e, r, i) {
|
|
589
|
-
return i === void 0 && (i = 0),
|
|
589
|
+
return i === void 0 && (i = 0), V.setInterval(e.flush.bind(e, this), i);
|
|
590
590
|
}, t.prototype.recycleAsyncId = function(e, r, i) {
|
|
591
591
|
if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
|
|
592
592
|
return r;
|
|
593
|
-
r != null &&
|
|
593
|
+
r != null && V.clearInterval(r);
|
|
594
594
|
}, t.prototype.execute = function(e, r) {
|
|
595
595
|
if (this.closed)
|
|
596
596
|
return new Error("executing a cancelled action");
|
|
@@ -600,21 +600,21 @@ var Be = function(n) {
|
|
|
600
600
|
return i;
|
|
601
601
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
602
602
|
}, t.prototype._execute = function(e, r) {
|
|
603
|
-
var i = !1,
|
|
603
|
+
var i = !1, s;
|
|
604
604
|
try {
|
|
605
605
|
this.work(e);
|
|
606
|
-
} catch (
|
|
607
|
-
i = !0,
|
|
606
|
+
} catch (o) {
|
|
607
|
+
i = !0, s = o || new Error("Scheduled action threw falsy error");
|
|
608
608
|
}
|
|
609
609
|
if (i)
|
|
610
|
-
return this.unsubscribe(),
|
|
610
|
+
return this.unsubscribe(), s;
|
|
611
611
|
}, t.prototype.unsubscribe = function() {
|
|
612
612
|
if (!this.closed) {
|
|
613
|
-
var e = this, r = e.id, i = e.scheduler,
|
|
614
|
-
this.work = this.state = this.scheduler = null, this.pending = !1, U(
|
|
613
|
+
var e = this, r = e.id, i = e.scheduler, s = i.actions;
|
|
614
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, U(s, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
615
615
|
}
|
|
616
616
|
}, t;
|
|
617
|
-
}(
|
|
617
|
+
}(He), ae = function() {
|
|
618
618
|
function n(t, e) {
|
|
619
619
|
e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
|
|
620
620
|
}
|
|
@@ -646,38 +646,38 @@ var Be = function(n) {
|
|
|
646
646
|
throw i;
|
|
647
647
|
}
|
|
648
648
|
}, t;
|
|
649
|
-
}(ae), Ye = new Qe(
|
|
649
|
+
}(ae), Ye = new Qe(ze), Ge = Ye;
|
|
650
650
|
function Je(n) {
|
|
651
|
-
return n &&
|
|
651
|
+
return n && m(n.schedule);
|
|
652
652
|
}
|
|
653
|
-
var
|
|
653
|
+
var Ke = Z(function(n) {
|
|
654
654
|
return function() {
|
|
655
655
|
n(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
656
656
|
};
|
|
657
657
|
});
|
|
658
|
-
function
|
|
658
|
+
function P(n, t) {
|
|
659
659
|
var e = typeof t == "object";
|
|
660
660
|
return new Promise(function(r, i) {
|
|
661
|
-
var
|
|
662
|
-
next: function(
|
|
663
|
-
r(
|
|
661
|
+
var s = new k({
|
|
662
|
+
next: function(o) {
|
|
663
|
+
r(o), s.unsubscribe();
|
|
664
664
|
},
|
|
665
665
|
error: i,
|
|
666
666
|
complete: function() {
|
|
667
|
-
e ? r(t.defaultValue) : i(new
|
|
667
|
+
e ? r(t.defaultValue) : i(new Ke());
|
|
668
668
|
}
|
|
669
669
|
});
|
|
670
|
-
n.subscribe(
|
|
670
|
+
n.subscribe(s);
|
|
671
671
|
});
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function We(n) {
|
|
674
674
|
return n instanceof Date && !isNaN(n);
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function A(n, t) {
|
|
677
677
|
return Ce(function(e, r) {
|
|
678
678
|
var i = 0;
|
|
679
|
-
e.subscribe(xe(r, function(
|
|
680
|
-
r.next(n.call(t,
|
|
679
|
+
e.subscribe(xe(r, function(s) {
|
|
680
|
+
r.next(n.call(t, s, i++));
|
|
681
681
|
}));
|
|
682
682
|
});
|
|
683
683
|
}
|
|
@@ -685,29 +685,29 @@ function Xe(n, t, e) {
|
|
|
685
685
|
n === void 0 && (n = 0), e === void 0 && (e = Ge);
|
|
686
686
|
var r = -1;
|
|
687
687
|
return t != null && (Je(t) ? e = t : r = t), new G(function(i) {
|
|
688
|
-
var
|
|
689
|
-
|
|
690
|
-
var
|
|
688
|
+
var s = We(n) ? +n - e.now() : n;
|
|
689
|
+
s < 0 && (s = 0);
|
|
690
|
+
var o = 0;
|
|
691
691
|
return e.schedule(function() {
|
|
692
|
-
i.closed || (i.next(
|
|
693
|
-
},
|
|
692
|
+
i.closed || (i.next(o++), 0 <= r ? this.schedule(void 0, r) : i.complete());
|
|
693
|
+
}, s);
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
696
|
function Ze(n, t, e) {
|
|
697
|
-
var r =
|
|
698
|
-
return r ? Ce(function(i,
|
|
699
|
-
var
|
|
700
|
-
(
|
|
697
|
+
var r = m(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
698
|
+
return r ? Ce(function(i, s) {
|
|
699
|
+
var o;
|
|
700
|
+
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
701
701
|
var u = !0;
|
|
702
|
-
i.subscribe(xe(
|
|
702
|
+
i.subscribe(xe(s, function(c) {
|
|
703
703
|
var a;
|
|
704
|
-
(a = r.next) === null || a === void 0 || a.call(r, c),
|
|
704
|
+
(a = r.next) === null || a === void 0 || a.call(r, c), s.next(c);
|
|
705
705
|
}, function() {
|
|
706
706
|
var c;
|
|
707
|
-
u = !1, (c = r.complete) === null || c === void 0 || c.call(r),
|
|
707
|
+
u = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
|
|
708
708
|
}, function(c) {
|
|
709
709
|
var a;
|
|
710
|
-
u = !1, (a = r.error) === null || a === void 0 || a.call(r, c),
|
|
710
|
+
u = !1, (a = r.error) === null || a === void 0 || a.call(r, c), s.error(c);
|
|
711
711
|
}, function() {
|
|
712
712
|
var c, a;
|
|
713
713
|
u && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
|
|
@@ -748,13 +748,13 @@ class he extends Error {
|
|
|
748
748
|
e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function S(n) {
|
|
752
752
|
return typeof n == "function";
|
|
753
753
|
}
|
|
754
754
|
function it(n) {
|
|
755
|
-
return
|
|
755
|
+
return S(n == null ? void 0 : n.lift);
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function j(n) {
|
|
758
758
|
return function(t) {
|
|
759
759
|
if (it(t))
|
|
760
760
|
return t.lift(function(e) {
|
|
@@ -796,39 +796,39 @@ function de(n) {
|
|
|
796
796
|
};
|
|
797
797
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function K(n, t) {
|
|
800
800
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
801
801
|
if (!e)
|
|
802
802
|
return n;
|
|
803
|
-
var r = e.call(n), i,
|
|
803
|
+
var r = e.call(n), i, s = [], o;
|
|
804
804
|
try {
|
|
805
805
|
for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
|
|
806
|
-
|
|
806
|
+
s.push(i.value);
|
|
807
807
|
} catch (u) {
|
|
808
|
-
|
|
808
|
+
o = { error: u };
|
|
809
809
|
} finally {
|
|
810
810
|
try {
|
|
811
811
|
i && !i.done && (e = r.return) && e.call(r);
|
|
812
812
|
} finally {
|
|
813
|
-
if (
|
|
814
|
-
throw
|
|
813
|
+
if (o)
|
|
814
|
+
throw o.error;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
return
|
|
817
|
+
return s;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function W(n, t, e) {
|
|
820
820
|
if (e || arguments.length === 2)
|
|
821
|
-
for (var r = 0, i = t.length,
|
|
822
|
-
(
|
|
823
|
-
return n.concat(
|
|
821
|
+
for (var r = 0, i = t.length, s; r < i; r++)
|
|
822
|
+
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
823
|
+
return n.concat(s || Array.prototype.slice.call(t));
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function st(n) {
|
|
826
826
|
var t = function(r) {
|
|
827
827
|
Error.call(r), r.stack = new Error().stack;
|
|
828
828
|
}, e = n(t);
|
|
829
829
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
830
830
|
}
|
|
831
|
-
var q =
|
|
831
|
+
var q = st(function(n) {
|
|
832
832
|
return function(t) {
|
|
833
833
|
n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
|
834
834
|
` + t.map(function(e, r) {
|
|
@@ -848,14 +848,14 @@ var re = function() {
|
|
|
848
848
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
849
849
|
}
|
|
850
850
|
return n.prototype.unsubscribe = function() {
|
|
851
|
-
var t, e, r, i,
|
|
851
|
+
var t, e, r, i, s;
|
|
852
852
|
if (!this.closed) {
|
|
853
853
|
this.closed = !0;
|
|
854
|
-
var
|
|
855
|
-
if (
|
|
856
|
-
if (this._parentage = null, Array.isArray(
|
|
854
|
+
var o = this._parentage;
|
|
855
|
+
if (o)
|
|
856
|
+
if (this._parentage = null, Array.isArray(o))
|
|
857
857
|
try {
|
|
858
|
-
for (var u = de(
|
|
858
|
+
for (var u = de(o), c = u.next(); !c.done; c = u.next()) {
|
|
859
859
|
var a = c.value;
|
|
860
860
|
a.remove(this);
|
|
861
861
|
}
|
|
@@ -870,39 +870,39 @@ var re = function() {
|
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
872
|
else
|
|
873
|
-
|
|
873
|
+
o.remove(this);
|
|
874
874
|
var g = this.initialTeardown;
|
|
875
|
-
if (
|
|
875
|
+
if (S(g))
|
|
876
876
|
try {
|
|
877
877
|
g();
|
|
878
878
|
} catch (d) {
|
|
879
|
-
|
|
879
|
+
s = d instanceof q ? d.errors : [d];
|
|
880
880
|
}
|
|
881
881
|
var v = this._finalizers;
|
|
882
882
|
if (v) {
|
|
883
883
|
this._finalizers = null;
|
|
884
884
|
try {
|
|
885
|
-
for (var
|
|
886
|
-
var
|
|
885
|
+
for (var E = de(v), w = E.next(); !w.done; w = E.next()) {
|
|
886
|
+
var N = w.value;
|
|
887
887
|
try {
|
|
888
|
-
fe(
|
|
888
|
+
fe(N);
|
|
889
889
|
} catch (d) {
|
|
890
|
-
|
|
890
|
+
s = s ?? [], d instanceof q ? s = W(W([], K(s)), K(d.errors)) : s.push(d);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
} catch (d) {
|
|
894
894
|
r = { error: d };
|
|
895
895
|
} finally {
|
|
896
896
|
try {
|
|
897
|
-
|
|
897
|
+
w && !w.done && (i = E.return) && i.call(E);
|
|
898
898
|
} finally {
|
|
899
899
|
if (r)
|
|
900
900
|
throw r.error;
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
if (
|
|
905
|
-
throw new q(
|
|
904
|
+
if (s)
|
|
905
|
+
throw new q(s);
|
|
906
906
|
}
|
|
907
907
|
}, n.prototype.add = function(t) {
|
|
908
908
|
var e;
|
|
@@ -935,23 +935,23 @@ var re = function() {
|
|
|
935
935
|
}(), n;
|
|
936
936
|
}();
|
|
937
937
|
re.EMPTY;
|
|
938
|
-
function
|
|
939
|
-
return n instanceof re || n && "closed" in n &&
|
|
938
|
+
function Te(n) {
|
|
939
|
+
return n instanceof re || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
|
|
940
940
|
}
|
|
941
941
|
function fe(n) {
|
|
942
|
-
|
|
942
|
+
S(n) ? n() : n.unsubscribe();
|
|
943
943
|
}
|
|
944
|
-
var
|
|
944
|
+
var Pe = {
|
|
945
945
|
onUnhandledError: null,
|
|
946
946
|
onStoppedNotification: null,
|
|
947
947
|
Promise: void 0,
|
|
948
948
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
949
949
|
useDeprecatedNextContext: !1
|
|
950
|
-
},
|
|
950
|
+
}, ot = {
|
|
951
951
|
setTimeout: function(n, t) {
|
|
952
952
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
953
953
|
e[r - 2] = arguments[r];
|
|
954
|
-
return setTimeout.apply(void 0,
|
|
954
|
+
return setTimeout.apply(void 0, W([n, t], K(e)));
|
|
955
955
|
},
|
|
956
956
|
clearTimeout: function(n) {
|
|
957
957
|
return clearTimeout(n);
|
|
@@ -959,7 +959,7 @@ var Ae = {
|
|
|
959
959
|
delegate: void 0
|
|
960
960
|
};
|
|
961
961
|
function ct(n) {
|
|
962
|
-
|
|
962
|
+
ot.setTimeout(function() {
|
|
963
963
|
throw n;
|
|
964
964
|
});
|
|
965
965
|
}
|
|
@@ -972,7 +972,7 @@ var ne = function(n) {
|
|
|
972
972
|
te(t, n);
|
|
973
973
|
function t(e) {
|
|
974
974
|
var r = n.call(this) || this;
|
|
975
|
-
return r.isStopped = !1, e ? (r.destination = e,
|
|
975
|
+
return r.isStopped = !1, e ? (r.destination = e, Te(e) && e.add(r)) : r.destination = dt, r;
|
|
976
976
|
}
|
|
977
977
|
return t.create = function(e, r, i) {
|
|
978
978
|
return new X(e, r, i);
|
|
@@ -1000,7 +1000,7 @@ var ne = function(n) {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}, t;
|
|
1002
1002
|
}(re), at = Function.prototype.bind;
|
|
1003
|
-
function
|
|
1003
|
+
function H(n, t) {
|
|
1004
1004
|
return at.call(n, t);
|
|
1005
1005
|
}
|
|
1006
1006
|
var lt = function() {
|
|
@@ -1037,24 +1037,24 @@ var lt = function() {
|
|
|
1037
1037
|
}(), X = function(n) {
|
|
1038
1038
|
te(t, n);
|
|
1039
1039
|
function t(e, r, i) {
|
|
1040
|
-
var
|
|
1041
|
-
if (
|
|
1042
|
-
|
|
1040
|
+
var s = n.call(this) || this, o;
|
|
1041
|
+
if (S(e) || !e)
|
|
1042
|
+
o = {
|
|
1043
1043
|
next: e ?? void 0,
|
|
1044
1044
|
error: r ?? void 0,
|
|
1045
1045
|
complete: i ?? void 0
|
|
1046
1046
|
};
|
|
1047
1047
|
else {
|
|
1048
1048
|
var u;
|
|
1049
|
-
|
|
1050
|
-
return
|
|
1051
|
-
},
|
|
1052
|
-
next: e.next &&
|
|
1053
|
-
error: e.error &&
|
|
1054
|
-
complete: e.complete &&
|
|
1055
|
-
}) :
|
|
1049
|
+
s && Pe.useDeprecatedNextContext ? (u = Object.create(e), u.unsubscribe = function() {
|
|
1050
|
+
return s.unsubscribe();
|
|
1051
|
+
}, o = {
|
|
1052
|
+
next: e.next && H(e.next, u),
|
|
1053
|
+
error: e.error && H(e.error, u),
|
|
1054
|
+
complete: e.complete && H(e.complete, u)
|
|
1055
|
+
}) : o = e;
|
|
1056
1056
|
}
|
|
1057
|
-
return
|
|
1057
|
+
return s.destination = new lt(o), s;
|
|
1058
1058
|
}
|
|
1059
1059
|
return t;
|
|
1060
1060
|
}(ne);
|
|
@@ -1072,11 +1072,11 @@ var dt = {
|
|
|
1072
1072
|
}, pt = function() {
|
|
1073
1073
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
1074
1074
|
}();
|
|
1075
|
-
function
|
|
1075
|
+
function Ie(n) {
|
|
1076
1076
|
return n;
|
|
1077
1077
|
}
|
|
1078
1078
|
function ft(n) {
|
|
1079
|
-
return n.length === 0 ?
|
|
1079
|
+
return n.length === 0 ? Ie : n.length === 1 ? n[0] : function(t) {
|
|
1080
1080
|
return n.reduce(function(e, r) {
|
|
1081
1081
|
return r(e);
|
|
1082
1082
|
}, t);
|
|
@@ -1090,11 +1090,11 @@ var gt = function() {
|
|
|
1090
1090
|
var e = new n();
|
|
1091
1091
|
return e.source = this, e.operator = t, e;
|
|
1092
1092
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
1093
|
-
var i = this,
|
|
1093
|
+
var i = this, s = yt(t) ? t : new X(t, e, r);
|
|
1094
1094
|
return ut(function() {
|
|
1095
|
-
var
|
|
1096
|
-
|
|
1097
|
-
}),
|
|
1095
|
+
var o = i, u = o.operator, c = o.source;
|
|
1096
|
+
s.add(u ? u.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
|
|
1097
|
+
}), s;
|
|
1098
1098
|
}, n.prototype._trySubscribe = function(t) {
|
|
1099
1099
|
try {
|
|
1100
1100
|
return this._subscribe(t);
|
|
@@ -1103,19 +1103,19 @@ var gt = function() {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
}, n.prototype.forEach = function(t, e) {
|
|
1105
1105
|
var r = this;
|
|
1106
|
-
return e = ve(e), new e(function(i,
|
|
1107
|
-
var
|
|
1106
|
+
return e = ve(e), new e(function(i, s) {
|
|
1107
|
+
var o = new X({
|
|
1108
1108
|
next: function(u) {
|
|
1109
1109
|
try {
|
|
1110
1110
|
t(u);
|
|
1111
1111
|
} catch (c) {
|
|
1112
|
-
|
|
1112
|
+
s(c), o.unsubscribe();
|
|
1113
1113
|
}
|
|
1114
1114
|
},
|
|
1115
|
-
error:
|
|
1115
|
+
error: s,
|
|
1116
1116
|
complete: i
|
|
1117
1117
|
});
|
|
1118
|
-
r.subscribe(
|
|
1118
|
+
r.subscribe(o);
|
|
1119
1119
|
});
|
|
1120
1120
|
}, n.prototype._subscribe = function(t) {
|
|
1121
1121
|
var e;
|
|
@@ -1129,13 +1129,13 @@ var gt = function() {
|
|
|
1129
1129
|
}, n.prototype.toPromise = function(t) {
|
|
1130
1130
|
var e = this;
|
|
1131
1131
|
return t = ve(t), new t(function(r, i) {
|
|
1132
|
-
var
|
|
1133
|
-
e.subscribe(function(
|
|
1134
|
-
return
|
|
1135
|
-
}, function(
|
|
1136
|
-
return i(
|
|
1132
|
+
var s;
|
|
1133
|
+
e.subscribe(function(o) {
|
|
1134
|
+
return s = o;
|
|
1135
|
+
}, function(o) {
|
|
1136
|
+
return i(o);
|
|
1137
1137
|
}, function() {
|
|
1138
|
-
return r(
|
|
1138
|
+
return r(s);
|
|
1139
1139
|
});
|
|
1140
1140
|
});
|
|
1141
1141
|
}, n.create = function(t) {
|
|
@@ -1144,30 +1144,30 @@ var gt = function() {
|
|
|
1144
1144
|
}();
|
|
1145
1145
|
function ve(n) {
|
|
1146
1146
|
var t;
|
|
1147
|
-
return (t = n ??
|
|
1147
|
+
return (t = n ?? Pe.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1148
1148
|
}
|
|
1149
1149
|
function vt(n) {
|
|
1150
|
-
return n &&
|
|
1150
|
+
return n && S(n.next) && S(n.error) && S(n.complete);
|
|
1151
1151
|
}
|
|
1152
1152
|
function yt(n) {
|
|
1153
|
-
return n && n instanceof ne || vt(n) &&
|
|
1153
|
+
return n && n instanceof ne || vt(n) && Te(n);
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function F(n, t, e, r, i) {
|
|
1156
1156
|
return new bt(n, t, e, r, i);
|
|
1157
1157
|
}
|
|
1158
1158
|
var bt = function(n) {
|
|
1159
1159
|
te(t, n);
|
|
1160
|
-
function t(e, r, i,
|
|
1160
|
+
function t(e, r, i, s, o, u) {
|
|
1161
1161
|
var c = n.call(this, e) || this;
|
|
1162
|
-
return c.onFinalize =
|
|
1162
|
+
return c.onFinalize = o, c.shouldUnsubscribe = u, c._next = r ? function(a) {
|
|
1163
1163
|
try {
|
|
1164
1164
|
r(a);
|
|
1165
1165
|
} catch (g) {
|
|
1166
1166
|
e.error(g);
|
|
1167
1167
|
}
|
|
1168
|
-
} : n.prototype._next, c._error =
|
|
1168
|
+
} : n.prototype._next, c._error = s ? function(a) {
|
|
1169
1169
|
try {
|
|
1170
|
-
|
|
1170
|
+
s(a);
|
|
1171
1171
|
} catch (g) {
|
|
1172
1172
|
e.error(g);
|
|
1173
1173
|
} finally {
|
|
@@ -1192,54 +1192,54 @@ var bt = function(n) {
|
|
|
1192
1192
|
}, t;
|
|
1193
1193
|
}(ne);
|
|
1194
1194
|
function h(n, t) {
|
|
1195
|
-
return
|
|
1195
|
+
return j(function(e, r) {
|
|
1196
1196
|
var i = 0;
|
|
1197
|
-
e.subscribe(
|
|
1198
|
-
r.next(n.call(t,
|
|
1197
|
+
e.subscribe(F(r, function(s) {
|
|
1198
|
+
r.next(n.call(t, s, i++));
|
|
1199
1199
|
}));
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
1202
|
var mt = new gt(function(n) {
|
|
1203
1203
|
return n.complete();
|
|
1204
1204
|
});
|
|
1205
|
-
function
|
|
1205
|
+
function b(n) {
|
|
1206
1206
|
return n <= 0 ? function() {
|
|
1207
1207
|
return mt;
|
|
1208
|
-
} :
|
|
1208
|
+
} : j(function(t, e) {
|
|
1209
1209
|
var r = 0;
|
|
1210
|
-
t.subscribe(
|
|
1210
|
+
t.subscribe(F(e, function(i) {
|
|
1211
1211
|
++r <= n && (e.next(i), n <= r && e.complete());
|
|
1212
1212
|
}));
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
1215
|
function f(n, t) {
|
|
1216
|
-
return
|
|
1216
|
+
return j(function(e, r) {
|
|
1217
1217
|
var i = 0;
|
|
1218
|
-
e.subscribe(
|
|
1219
|
-
return n.call(t,
|
|
1218
|
+
e.subscribe(F(r, function(s) {
|
|
1219
|
+
return n.call(t, s, i++) && r.next(s);
|
|
1220
1220
|
}));
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
1223
|
function p(n, t, e) {
|
|
1224
|
-
var r =
|
|
1225
|
-
return r ?
|
|
1226
|
-
var
|
|
1227
|
-
(
|
|
1224
|
+
var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1225
|
+
return r ? j(function(i, s) {
|
|
1226
|
+
var o;
|
|
1227
|
+
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1228
1228
|
var u = !0;
|
|
1229
|
-
i.subscribe(
|
|
1229
|
+
i.subscribe(F(s, function(c) {
|
|
1230
1230
|
var a;
|
|
1231
|
-
(a = r.next) === null || a === void 0 || a.call(r, c),
|
|
1231
|
+
(a = r.next) === null || a === void 0 || a.call(r, c), s.next(c);
|
|
1232
1232
|
}, function() {
|
|
1233
1233
|
var c;
|
|
1234
|
-
u = !1, (c = r.complete) === null || c === void 0 || c.call(r),
|
|
1234
|
+
u = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
|
|
1235
1235
|
}, function(c) {
|
|
1236
1236
|
var a;
|
|
1237
|
-
u = !1, (a = r.error) === null || a === void 0 || a.call(r, c),
|
|
1237
|
+
u = !1, (a = r.error) === null || a === void 0 || a.call(r, c), s.error(c);
|
|
1238
1238
|
}, function() {
|
|
1239
1239
|
var c, a;
|
|
1240
1240
|
u && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
|
|
1241
1241
|
}));
|
|
1242
|
-
}) :
|
|
1242
|
+
}) : Ie;
|
|
1243
1243
|
}
|
|
1244
1244
|
const wt = /^(\d+)\.(\d+)$/;
|
|
1245
1245
|
function St(n) {
|
|
@@ -1251,12 +1251,12 @@ function St(n) {
|
|
|
1251
1251
|
throw new nt(n);
|
|
1252
1252
|
}
|
|
1253
1253
|
function ye(n) {
|
|
1254
|
-
const t = St(n), [e, r] = t.split("."), [i,
|
|
1255
|
-
return [i,
|
|
1254
|
+
const t = St(n), [e, r] = t.split("."), [i, s] = [parseInt(e), parseInt(r)];
|
|
1255
|
+
return [i, s];
|
|
1256
1256
|
}
|
|
1257
1257
|
function ie(n, t) {
|
|
1258
|
-
const [e, r] = ye(n), [i,
|
|
1259
|
-
return e < i ? -1 : e > i ? 1 : r <
|
|
1258
|
+
const [e, r] = ye(n), [i, s] = ye(t);
|
|
1259
|
+
return e < i ? -1 : e > i ? 1 : r < s ? -1 : r > s ? 1 : 0;
|
|
1260
1260
|
}
|
|
1261
1261
|
function Et(n, t) {
|
|
1262
1262
|
return ie(n, t) === 1;
|
|
@@ -1315,7 +1315,7 @@ class xt {
|
|
|
1315
1315
|
determineContext() {
|
|
1316
1316
|
return Xe(1e3).pipe(
|
|
1317
1317
|
h(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
|
|
1318
|
-
|
|
1318
|
+
b(1)
|
|
1319
1319
|
);
|
|
1320
1320
|
}
|
|
1321
1321
|
/**
|
|
@@ -1334,7 +1334,7 @@ class xt {
|
|
|
1334
1334
|
h((i) => i),
|
|
1335
1335
|
p(this.logReceived(t)),
|
|
1336
1336
|
h((i) => {
|
|
1337
|
-
if (this.supportedVersions.some((
|
|
1337
|
+
if (this.supportedVersions.some((s) => Et(s, i.protocolVersion)))
|
|
1338
1338
|
throw new he(i.protocolVersion, this.supportedVersions[0]);
|
|
1339
1339
|
return i;
|
|
1340
1340
|
}),
|
|
@@ -1343,7 +1343,7 @@ class xt {
|
|
|
1343
1343
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1344
1344
|
);
|
|
1345
1345
|
}),
|
|
1346
|
-
|
|
1346
|
+
b(1)
|
|
1347
1347
|
);
|
|
1348
1348
|
return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;
|
|
1349
1349
|
}
|
|
@@ -1363,7 +1363,7 @@ class xt {
|
|
|
1363
1363
|
f((i) => i.type === t && i.replyTo === e.id),
|
|
1364
1364
|
h((i) => i),
|
|
1365
1365
|
p(this.logReceived(t)),
|
|
1366
|
-
|
|
1366
|
+
b(1)
|
|
1367
1367
|
);
|
|
1368
1368
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1369
1369
|
}
|
|
@@ -1387,13 +1387,13 @@ class xt {
|
|
|
1387
1387
|
roomName: e,
|
|
1388
1388
|
roomInvite: r,
|
|
1389
1389
|
displayName: i,
|
|
1390
|
-
jwtToken:
|
|
1391
|
-
serverUrl:
|
|
1390
|
+
jwtToken: s,
|
|
1391
|
+
serverUrl: o,
|
|
1392
1392
|
region: u,
|
|
1393
1393
|
joinMicMuted: c,
|
|
1394
1394
|
joinWithoutCamera: a
|
|
1395
1395
|
} = t, g = "JOINING ROOM", v = this.createMessage(g, !1);
|
|
1396
|
-
v.roomName = e, v.jwtToken =
|
|
1396
|
+
v.roomName = e, v.jwtToken = s, v.serverUrl = o, v.region = u, v.roomInvite = r, v.joinMicMuted = c ?? !1, v.joinWithoutCamera = a ?? !1, v.displayName = i, this.logCreated(g, v), this.port2.postMessage(v), this.logSent(g, v);
|
|
1397
1397
|
}
|
|
1398
1398
|
/**
|
|
1399
1399
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1539,11 +1539,11 @@ class xt {
|
|
|
1539
1539
|
const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
|
|
1540
1540
|
r.sourceTypes = t, this.logCreated(e, r);
|
|
1541
1541
|
const i = this.incomingMessages$.pipe(
|
|
1542
|
-
f((
|
|
1543
|
-
h((
|
|
1542
|
+
f((s) => s.type === e && s.replyTo === r.id),
|
|
1543
|
+
h((s) => s),
|
|
1544
1544
|
p(this.logReceived(e)),
|
|
1545
|
-
h((
|
|
1546
|
-
|
|
1545
|
+
h((s) => s),
|
|
1546
|
+
b(1)
|
|
1547
1547
|
);
|
|
1548
1548
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1549
1549
|
}
|
|
@@ -1551,15 +1551,15 @@ class xt {
|
|
|
1551
1551
|
if (!this.isEmbedded())
|
|
1552
1552
|
throw new l(this.currentContext);
|
|
1553
1553
|
const i = "LAYOUT CHANGE";
|
|
1554
|
-
let
|
|
1555
|
-
if (e && r ? (
|
|
1556
|
-
f((u) => u.type === i && u.replyTo ===
|
|
1554
|
+
let s, o;
|
|
1555
|
+
if (e && r ? (s = this.createMessage(i, !1, r), s.result = e) : (s = this.createMessage(i), o = this.incomingMessages$.pipe(
|
|
1556
|
+
f((u) => u.type === i && u.replyTo === s.id),
|
|
1557
1557
|
h((u) => u),
|
|
1558
1558
|
p(this.logReceived(i)),
|
|
1559
1559
|
h((u) => u),
|
|
1560
|
-
|
|
1561
|
-
), this.logService.debug(`Created ${i} Reply handler`)),
|
|
1562
|
-
return
|
|
1560
|
+
b(1)
|
|
1561
|
+
), this.logService.debug(`Created ${i} Reply handler`)), s.layout = t, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s), o)
|
|
1562
|
+
return o;
|
|
1563
1563
|
}
|
|
1564
1564
|
/**
|
|
1565
1565
|
* Setup listener for {@link LayoutChangeMessage}, which can be sent by a host app if it needs to
|
|
@@ -1610,10 +1610,10 @@ class xt {
|
|
|
1610
1610
|
const e = "OAUTH TOKEN", r = this.createMessage(e);
|
|
1611
1611
|
r.providerTypes = t, this.logCreated(e, r);
|
|
1612
1612
|
const i = this.incomingMessages$.pipe(
|
|
1613
|
-
f((
|
|
1614
|
-
h((
|
|
1613
|
+
f((s) => s.type === e && s.replyTo === r.id),
|
|
1614
|
+
h((s) => s),
|
|
1615
1615
|
p(this.logReceived(e)),
|
|
1616
|
-
|
|
1616
|
+
b(1)
|
|
1617
1617
|
);
|
|
1618
1618
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1619
1619
|
}
|
|
@@ -1638,11 +1638,11 @@ class xt {
|
|
|
1638
1638
|
i,
|
|
1639
1639
|
"currentContacts should not be passed for direct streams"
|
|
1640
1640
|
);
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1641
|
+
const s = "SELECT CONTACTS", o = this.createMessage(s, !0);
|
|
1642
|
+
o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = i, this.logCreated(s, o);
|
|
1643
1643
|
const u = this.incomingMessages$.pipe(
|
|
1644
|
-
f((c) => c.type ===
|
|
1645
|
-
p(this.logReceived(
|
|
1644
|
+
f((c) => c.type === s && c.replyTo === o.id),
|
|
1645
|
+
p(this.logReceived(s)),
|
|
1646
1646
|
// validate if `streamId` is the same as we sent
|
|
1647
1647
|
h((c) => {
|
|
1648
1648
|
const a = c;
|
|
@@ -1650,9 +1650,9 @@ class xt {
|
|
|
1650
1650
|
throw new rt(a.streamId, t);
|
|
1651
1651
|
return e === "direct" && a.contacts.length > 1 && (a.contacts = [a.contacts[0]]), a;
|
|
1652
1652
|
}),
|
|
1653
|
-
|
|
1653
|
+
b(1)
|
|
1654
1654
|
);
|
|
1655
|
-
return this.logService.debug(`Created ${
|
|
1655
|
+
return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), u;
|
|
1656
1656
|
}
|
|
1657
1657
|
/**
|
|
1658
1658
|
* Request detailed contact information for the given Cloud usernames.
|
|
@@ -1670,10 +1670,10 @@ class xt {
|
|
|
1670
1670
|
const e = "MATCH CONTACTS", r = this.createMessage(e);
|
|
1671
1671
|
r.contacts = [...t], this.logCreated(e, r);
|
|
1672
1672
|
const i = this.incomingMessages$.pipe(
|
|
1673
|
-
f((
|
|
1673
|
+
f((s) => s.type === e && s.replyTo === r.id),
|
|
1674
1674
|
p(this.logReceived(e)),
|
|
1675
|
-
h((
|
|
1676
|
-
|
|
1675
|
+
h((s) => s),
|
|
1676
|
+
b(1)
|
|
1677
1677
|
);
|
|
1678
1678
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1679
1679
|
}
|
|
@@ -1731,10 +1731,54 @@ class xt {
|
|
|
1731
1731
|
f((i) => i.type === t && i.replyTo === e.id),
|
|
1732
1732
|
p(this.logReceived(t)),
|
|
1733
1733
|
h((i) => i),
|
|
1734
|
-
|
|
1734
|
+
b(1)
|
|
1735
1735
|
);
|
|
1736
1736
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1737
1737
|
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Setup a listener for {@link PushTokenMessage}, which can be sent by a Host app to notify of a
|
|
1740
|
+
* new Push Token.
|
|
1741
|
+
*
|
|
1742
|
+
* @remarks
|
|
1743
|
+
* The Host app should send this message whenever the Push Token changes. The Client app should
|
|
1744
|
+
* then update it's Push Token accordingly.
|
|
1745
|
+
*
|
|
1746
|
+
* The Host app does not expect a reply to this message.
|
|
1747
|
+
*
|
|
1748
|
+
* @example
|
|
1749
|
+
* Here is an example of how a listener can be setup:
|
|
1750
|
+
*
|
|
1751
|
+
* ```ts
|
|
1752
|
+
* const ipcHelper = new IpcHelper(['2.0'], console);
|
|
1753
|
+
*
|
|
1754
|
+
* const pushTokenSubscription = ipcHelper.onPushTokenMessage().subscribe((msg) => {
|
|
1755
|
+
* // your logic for handling the push token goes here
|
|
1756
|
+
* });
|
|
1757
|
+
*
|
|
1758
|
+
* // don't forget to unsubscribe when you're cleaning up
|
|
1759
|
+
* pushTokenSubscription.unsubscribe();
|
|
1760
|
+
* ```
|
|
1761
|
+
*
|
|
1762
|
+
* @returns An observable that emits whenever {@link PushTokenMessage} is received so it can be
|
|
1763
|
+
* subscribed to indefinitely.
|
|
1764
|
+
*/
|
|
1765
|
+
onPushTokenMessage() {
|
|
1766
|
+
if (!this.isEmbedded())
|
|
1767
|
+
throw new l(this.currentContext);
|
|
1768
|
+
const t = "PUSH TOKEN";
|
|
1769
|
+
return this.incomingMessages$.pipe(
|
|
1770
|
+
f(
|
|
1771
|
+
(e) => e.type === t && e.target === "client"
|
|
1772
|
+
),
|
|
1773
|
+
h((e) => {
|
|
1774
|
+
if (e.pushToken && e.selector && e.appId)
|
|
1775
|
+
return e;
|
|
1776
|
+
throw new Error("PushTokenMessage is missing required PushTokenPayload fields");
|
|
1777
|
+
}),
|
|
1778
|
+
p((e) => e.pushToken),
|
|
1779
|
+
p(this.logReceived(t))
|
|
1780
|
+
);
|
|
1781
|
+
}
|
|
1738
1782
|
/**
|
|
1739
1783
|
* Setup listener for {@link BadgeQueryMessage}, which can be sent by a `Host` app to request the
|
|
1740
1784
|
* current badge counter from the `Client` app.
|
|
@@ -1767,8 +1811,8 @@ class xt {
|
|
|
1767
1811
|
sendBadgeUpdateMessage(t, e, r) {
|
|
1768
1812
|
if (!this.isEmbedded())
|
|
1769
1813
|
throw new l(this.currentContext);
|
|
1770
|
-
const i = "BADGE UPDATE",
|
|
1771
|
-
|
|
1814
|
+
const i = "BADGE UPDATE", s = this.createMessage(i, !1, r);
|
|
1815
|
+
s.count = t, s.activity = e ?? !1, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
|
|
1772
1816
|
}
|
|
1773
1817
|
/**
|
|
1774
1818
|
* Sends a {@link LifecycleMessage} to the Host app, to notify it of a lifecycle event.
|
|
@@ -1931,13 +1975,13 @@ class xt {
|
|
|
1931
1975
|
throw new l(this.currentContext);
|
|
1932
1976
|
const r = "FILE SELECTION", i = this.createMessage(r);
|
|
1933
1977
|
i.maxCount = t, i.mimeTypes = e, this.logCreated(r, i);
|
|
1934
|
-
const
|
|
1935
|
-
f((
|
|
1978
|
+
const s = this.incomingMessages$.pipe(
|
|
1979
|
+
f((o) => o.type === r && o.replyTo === i.id),
|
|
1936
1980
|
p(this.logReceived(r)),
|
|
1937
|
-
h((
|
|
1938
|
-
|
|
1981
|
+
h((o) => o),
|
|
1982
|
+
b(1)
|
|
1939
1983
|
);
|
|
1940
|
-
return this.port2.postMessage(i), this.logSent(r, i),
|
|
1984
|
+
return this.port2.postMessage(i), this.logSent(r, i), s;
|
|
1941
1985
|
}
|
|
1942
1986
|
/**
|
|
1943
1987
|
* Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
|
|
@@ -1959,30 +2003,74 @@ class xt {
|
|
|
1959
2003
|
sendFileDownloadMessage(t, e, r, i) {
|
|
1960
2004
|
if (!this.isEmbedded())
|
|
1961
2005
|
throw new l(this.currentContext);
|
|
1962
|
-
const
|
|
1963
|
-
|
|
2006
|
+
const s = "FILE DOWNLOAD", o = this.createMessage(s);
|
|
2007
|
+
o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
|
|
1964
2008
|
const u = this.incomingMessages$.pipe(
|
|
1965
|
-
f((c) => c.type ===
|
|
1966
|
-
p(this.logReceived(
|
|
2009
|
+
f((c) => c.type === s && c.replyTo === o.id),
|
|
2010
|
+
p(this.logReceived(s)),
|
|
1967
2011
|
h((c) => c),
|
|
1968
|
-
|
|
2012
|
+
b(1)
|
|
1969
2013
|
);
|
|
1970
|
-
return this.port2.postMessage(
|
|
2014
|
+
return this.port2.postMessage(o), this.logSent(s, o), u;
|
|
1971
2015
|
}
|
|
1972
2016
|
sendFileUploadMessage() {
|
|
1973
2017
|
throw new Error("Not implemented");
|
|
1974
2018
|
}
|
|
1975
2019
|
/**
|
|
1976
|
-
* Sends a {@link FileOpenMessage} to the Host app, to
|
|
1977
|
-
* or
|
|
2020
|
+
* Sends a {@link FileOpenMessage} to the Host app, to either open a file from the device's
|
|
2021
|
+
* storage or download the specified encrypted file from the given URL and open it.
|
|
2022
|
+
*
|
|
2023
|
+
* @remarks
|
|
2024
|
+
* If the Client has previously resolved the `fileId` of the file, the `fileId` parameter can be
|
|
2025
|
+
* used to open the file from the device's storage. Otherwise, the parameter is omitted and the
|
|
2026
|
+
* file is downloaded from the specified `url`.
|
|
2027
|
+
*
|
|
2028
|
+
* The file at the specified `url` is encrypted using the provided `key` and the Host app needs
|
|
2029
|
+
* to decrypt it. The `mimeType` and `name` parameters are used to display the file in the Host
|
|
2030
|
+
* app.
|
|
2031
|
+
*
|
|
2032
|
+
* The `hash` parameter is used to verify the integrity of the file.
|
|
1978
2033
|
*
|
|
1979
|
-
* @param
|
|
2034
|
+
* @param url - The URL of the encrypted file to download from.
|
|
2035
|
+
* @param key - The decryption key for the encrypted file.
|
|
2036
|
+
* @param mimeType - The MIME type of the file to open.
|
|
2037
|
+
* @param name - The name of the file to open.
|
|
2038
|
+
* @param hash - The SHA256 hash of the file to open.
|
|
2039
|
+
* @param fileId - _Optional_. The ID of the file to open.
|
|
1980
2040
|
*/
|
|
1981
|
-
sendFileOpenMessage(t) {
|
|
2041
|
+
sendFileOpenMessage(t, e, r, i, s, o) {
|
|
1982
2042
|
if (!this.isEmbedded())
|
|
1983
2043
|
throw new l(this.currentContext);
|
|
1984
|
-
const
|
|
1985
|
-
r.fileId =
|
|
2044
|
+
const u = "FILE OPEN", c = this.createMessage(u, !1);
|
|
2045
|
+
c.hash = s, c.url = t, c.key = e, c.mimeType = r, c.name = i, c.fileId = o, this.logCreated(u, c), this.port2.postMessage(c), this.logSent(u, c);
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* Sends a {@link FileReferenceMessage} to the Host app, to request a reference to a file from
|
|
2049
|
+
* the device's storage.
|
|
2050
|
+
*
|
|
2051
|
+
* @remarks
|
|
2052
|
+
* The file is identified by it's SHA256 hash. The Host app would reply with a
|
|
2053
|
+
* {@link FileReferenceMessageReply} containing a generated identifier of the file. In case the
|
|
2054
|
+
* file is not found, the `fileId` property would be set to `null` or `undefined`.
|
|
2055
|
+
*
|
|
2056
|
+
* @param hash - An SHA256 hash of the file
|
|
2057
|
+
* @param mimeType - The MIME type of the file
|
|
2058
|
+
* @param name - The name of the file
|
|
2059
|
+
* @returns An observable which emits a {@link FileReferenceMessageReply} instance containing the
|
|
2060
|
+
* `fileId` of the file. Emits once.
|
|
2061
|
+
*/
|
|
2062
|
+
sendFileReferenceMessage(t, e, r) {
|
|
2063
|
+
if (!this.isEmbedded())
|
|
2064
|
+
throw new l(this.currentContext);
|
|
2065
|
+
const i = "FILE REFERENCE", s = this.createMessage(i, !0);
|
|
2066
|
+
s.hash = t, s.mimeType = e, s.name = r, this.logCreated(i, s);
|
|
2067
|
+
const o = this.incomingMessages$.pipe(
|
|
2068
|
+
f((u) => u.type === i && u.replyTo === s.id),
|
|
2069
|
+
p(this.logReceived(i)),
|
|
2070
|
+
h((u) => u),
|
|
2071
|
+
b(1)
|
|
2072
|
+
);
|
|
2073
|
+
return this.port2.postMessage(s), this.logSent(i, s), o;
|
|
1986
2074
|
}
|
|
1987
2075
|
/**
|
|
1988
2076
|
* Sends a {@link AppResetMessage} to the Host app, to request logging out the user and resetting
|
|
@@ -2080,13 +2168,13 @@ class xt {
|
|
|
2080
2168
|
let r = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
|
|
2081
2169
|
const i = [];
|
|
2082
2170
|
e && (r = r.substr(0, r.indexOf("Q")));
|
|
2083
|
-
for (let
|
|
2171
|
+
for (let s = 0; s < t; s++)
|
|
2084
2172
|
i.push(r[Math.floor(Math.random() * r.length)]);
|
|
2085
2173
|
return i.join("");
|
|
2086
2174
|
}
|
|
2087
2175
|
}
|
|
2088
2176
|
const Mt = ["2.0"];
|
|
2089
|
-
class
|
|
2177
|
+
class Tt {
|
|
2090
2178
|
/**
|
|
2091
2179
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
2092
2180
|
*
|
|
@@ -2109,7 +2197,7 @@ class It {
|
|
|
2109
2197
|
M(this, "logger");
|
|
2110
2198
|
M(this, "helper");
|
|
2111
2199
|
M(this, "listeners");
|
|
2112
|
-
this.logger = t ?? console, this.helper = new xt(Mt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(
|
|
2200
|
+
this.logger = t ?? console, this.helper = new xt(Mt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(y.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(y.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(y.PushToken, /* @__PURE__ */ new Set());
|
|
2113
2201
|
}
|
|
2114
2202
|
/**
|
|
2115
2203
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2136,7 +2224,7 @@ class It {
|
|
|
2136
2224
|
* @returns A promise with {@link IPCContext} the app is running under.
|
|
2137
2225
|
*/
|
|
2138
2226
|
async determineContext() {
|
|
2139
|
-
const t = await
|
|
2227
|
+
const t = await P(this.helper.determineContext(), {
|
|
2140
2228
|
defaultValue: "guest"
|
|
2141
2229
|
});
|
|
2142
2230
|
return this.evaluateContext(t);
|
|
@@ -2145,29 +2233,34 @@ class It {
|
|
|
2145
2233
|
* Initiates the IPC handshake with the `Host` app.
|
|
2146
2234
|
*/
|
|
2147
2235
|
initiateConnection() {
|
|
2148
|
-
return
|
|
2236
|
+
return P(
|
|
2149
2237
|
this.helper.openBridge().pipe(
|
|
2150
2238
|
Ze((t) => {
|
|
2151
2239
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2152
2240
|
var r;
|
|
2153
2241
|
this.logger.debug("Received Badge Query: ", e);
|
|
2154
|
-
for (const i of ((r = this.listeners.get(
|
|
2242
|
+
for (const i of ((r = this.listeners.get(y.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
2155
2243
|
i();
|
|
2156
2244
|
}), this.helper.onLifecycleMessage().subscribe((e) => {
|
|
2157
2245
|
var r;
|
|
2158
2246
|
this.logger.debug("Received Lifecycle Event: ", e);
|
|
2159
|
-
for (const i of ((r = this.listeners.get(
|
|
2247
|
+
for (const i of ((r = this.listeners.get(y.Lifecycle)) == null ? void 0 : r.values()) ?? [])
|
|
2160
2248
|
i(e.eventName, e.payload);
|
|
2249
|
+
}), this.helper.onPushTokenMessage().subscribe((e) => {
|
|
2250
|
+
var r;
|
|
2251
|
+
this.logger.debug("Received Push Token: ", e);
|
|
2252
|
+
for (const i of ((r = this.listeners.get(y.PushToken)) == null ? void 0 : r.values()) ?? [])
|
|
2253
|
+
i(e.pushToken, e.appId, e.selector, e.expiry);
|
|
2161
2254
|
}), this.cloudId = t.cloudId, this.host = t.host;
|
|
2162
2255
|
}),
|
|
2163
|
-
|
|
2256
|
+
A(() => {
|
|
2164
2257
|
})
|
|
2165
2258
|
)
|
|
2166
2259
|
);
|
|
2167
2260
|
}
|
|
2168
2261
|
selectContacts(t, e, r, i) {
|
|
2169
2262
|
this.logger.debug("Selecting Contacts: ", ...arguments);
|
|
2170
|
-
let
|
|
2263
|
+
let s;
|
|
2171
2264
|
if (e === "multi") {
|
|
2172
2265
|
if (!r || !Array.isArray(r))
|
|
2173
2266
|
throw new $(
|
|
@@ -2175,15 +2268,15 @@ class It {
|
|
|
2175
2268
|
r,
|
|
2176
2269
|
"currentContacts is required for group streams"
|
|
2177
2270
|
);
|
|
2178
|
-
i || (i = "cloudUsername"),
|
|
2271
|
+
i || (i = "cloudUsername"), s = this.helper.selectContacts(
|
|
2179
2272
|
t.toString(),
|
|
2180
2273
|
"group",
|
|
2181
2274
|
i,
|
|
2182
2275
|
r
|
|
2183
2276
|
);
|
|
2184
2277
|
} else
|
|
2185
|
-
r ? i = r : i = "cloudUsername",
|
|
2186
|
-
return
|
|
2278
|
+
r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
|
|
2279
|
+
return P(s.pipe(A((o) => o.contacts)));
|
|
2187
2280
|
}
|
|
2188
2281
|
/**
|
|
2189
2282
|
* Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
|
|
@@ -2195,7 +2288,7 @@ class It {
|
|
|
2195
2288
|
* Host's contact list.
|
|
2196
2289
|
*/
|
|
2197
2290
|
matchContacts(t) {
|
|
2198
|
-
return this.logger.debug("Match Contacts: ", t),
|
|
2291
|
+
return this.logger.debug("Match Contacts: ", t), P(this.helper.matchContacts(t).pipe(A((e) => e.contacts)));
|
|
2199
2292
|
}
|
|
2200
2293
|
/**
|
|
2201
2294
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -2203,7 +2296,7 @@ class It {
|
|
|
2203
2296
|
* @returns A promise with the Push Token as `string`.
|
|
2204
2297
|
*/
|
|
2205
2298
|
requestPushToken() {
|
|
2206
|
-
return this.logger.debug("Requesting Push Token"),
|
|
2299
|
+
return this.logger.debug("Requesting Push Token"), P(this.helper.requestPushToken().pipe(A((t) => t.pushToken)));
|
|
2207
2300
|
}
|
|
2208
2301
|
/**
|
|
2209
2302
|
* Sends the current badge count to the `Host` app.
|
|
@@ -2233,9 +2326,9 @@ class It {
|
|
|
2233
2326
|
*/
|
|
2234
2327
|
onBadgeQueryRequest(t) {
|
|
2235
2328
|
var e;
|
|
2236
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
2329
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(y.BadgeQuery)) == null || e.add(t), () => {
|
|
2237
2330
|
var r;
|
|
2238
|
-
return (r = this.listeners.get(
|
|
2331
|
+
return (r = this.listeners.get(y.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
2239
2332
|
};
|
|
2240
2333
|
}
|
|
2241
2334
|
/**
|
|
@@ -2252,9 +2345,27 @@ class It {
|
|
|
2252
2345
|
*/
|
|
2253
2346
|
onLifecycleEvent(t) {
|
|
2254
2347
|
var e;
|
|
2255
|
-
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(
|
|
2348
|
+
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(y.Lifecycle)) == null || e.add(t), () => {
|
|
2349
|
+
var r;
|
|
2350
|
+
return (r = this.listeners.get(y.Lifecycle)) == null ? void 0 : r.delete(t);
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2353
|
+
/**
|
|
2354
|
+
* Registers a callback to be invoked when a {@link IPCEvents.PushToken} event is received.
|
|
2355
|
+
*
|
|
2356
|
+
* @remarks
|
|
2357
|
+
* The `token`, `appId`, `selector` and `expiry` are defined by the `Host` app and can vary for
|
|
2358
|
+
* each Push Token event.
|
|
2359
|
+
*
|
|
2360
|
+
* @param callback - A callback function to be invoked when a {@link IPCEvents.PushToken} event
|
|
2361
|
+
* is received.
|
|
2362
|
+
* @returns An unsubscribe callback to remove the listener.
|
|
2363
|
+
*/
|
|
2364
|
+
onPushToken(t) {
|
|
2365
|
+
var e;
|
|
2366
|
+
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(y.PushToken)) == null || e.add(t), () => {
|
|
2256
2367
|
var r;
|
|
2257
|
-
return (r = this.listeners.get(
|
|
2368
|
+
return (r = this.listeners.get(y.PushToken)) == null ? void 0 : r.delete(t);
|
|
2258
2369
|
};
|
|
2259
2370
|
}
|
|
2260
2371
|
evaluateContext(t) {
|
|
@@ -2265,6 +2376,6 @@ class It {
|
|
|
2265
2376
|
}
|
|
2266
2377
|
}
|
|
2267
2378
|
export {
|
|
2268
|
-
|
|
2269
|
-
|
|
2379
|
+
y as IPCEvents,
|
|
2380
|
+
Tt as IPCManager
|
|
2270
2381
|
};
|