@acrobits/ipc-sdk 0.8.0-alpha.1 → 0.8.0-alpha.3

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/lib/ipc-sdk.js CHANGED
@@ -1,24 +1,24 @@
1
- var Re = Object.defineProperty;
2
- var Pe = (n, t, e) => t in n ? Re(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var T = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
4
- var b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}), B = function(n, t) {
5
- return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
1
+ var Pe = Object.defineProperty;
2
+ var Re = (n, t, e) => t in n ? Pe(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var x = (n, t, e) => (Re(n, typeof t != "symbol" ? t + "" : t, e), e);
4
+ var b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}), H = function(n, t) {
5
+ return H = 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
- }, B(n, t);
10
+ }, H(n, t);
11
11
  };
12
12
  function M(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
- B(n, t);
15
+ H(n, t);
16
16
  function e() {
17
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 z(n) {
21
+ function Q(n) {
22
22
  var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], r = 0;
23
23
  if (e)
24
24
  return e.call(n);
@@ -50,7 +50,7 @@ function $(n, t) {
50
50
  }
51
51
  return s;
52
52
  }
53
- function F(n, t, e) {
53
+ function k(n, t, e) {
54
54
  if (e || arguments.length === 2)
55
55
  for (var r = 0, i = t.length, s; r < i; r++)
56
56
  (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
@@ -65,7 +65,7 @@ function X(n) {
65
65
  }, e = n(t);
66
66
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
67
67
  }
68
- var j = X(function(n) {
68
+ var N = X(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) {
@@ -74,13 +74,13 @@ var j = X(function(n) {
74
74
  `) : "", this.name = "UnsubscriptionError", this.errors = e;
75
75
  };
76
76
  });
77
- function k(n, t) {
77
+ function F(n, t) {
78
78
  if (n) {
79
79
  var e = n.indexOf(t);
80
80
  0 <= e && n.splice(e, 1);
81
81
  }
82
82
  }
83
- var I = function() {
83
+ var T = function() {
84
84
  function n(t) {
85
85
  this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
86
86
  }
@@ -92,15 +92,15 @@ var I = function() {
92
92
  if (o)
93
93
  if (this._parentage = null, Array.isArray(o))
94
94
  try {
95
- for (var c = z(o), a = c.next(); !a.done; a = c.next()) {
96
- var u = a.value;
97
- u.remove(this);
95
+ for (var c = Q(o), u = c.next(); !u.done; u = c.next()) {
96
+ var a = u.value;
97
+ a.remove(this);
98
98
  }
99
99
  } catch (p) {
100
100
  t = { error: p };
101
101
  } finally {
102
102
  try {
103
- a && !a.done && (e = c.return) && e.call(c);
103
+ u && !u.done && (e = c.return) && e.call(c);
104
104
  } finally {
105
105
  if (t)
106
106
  throw t.error;
@@ -113,18 +113,18 @@ var I = function() {
113
113
  try {
114
114
  v();
115
115
  } catch (p) {
116
- s = p instanceof j ? p.errors : [p];
116
+ s = p instanceof N ? p.errors : [p];
117
117
  }
118
118
  var g = this._finalizers;
119
119
  if (g) {
120
120
  this._finalizers = null;
121
121
  try {
122
- for (var E = z(g), w = E.next(); !w.done; w = E.next()) {
123
- var V = w.value;
122
+ for (var E = Q(g), w = E.next(); !w.done; w = E.next()) {
123
+ var j = w.value;
124
124
  try {
125
- ie(V);
125
+ ie(j);
126
126
  } catch (p) {
127
- s = s ?? [], p instanceof j ? s = F(F([], $(s)), $(p.errors)) : s.push(p);
127
+ s = s ?? [], p instanceof N ? s = k(k([], $(s)), $(p.errors)) : s.push(p);
128
128
  }
129
129
  }
130
130
  } catch (p) {
@@ -139,7 +139,7 @@ var I = function() {
139
139
  }
140
140
  }
141
141
  if (s)
142
- throw new j(s);
142
+ throw new N(s);
143
143
  }
144
144
  }, n.prototype.add = function(t) {
145
145
  var e;
@@ -162,17 +162,17 @@ var I = function() {
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) && k(e, t);
165
+ e === t ? this._parentage = null : Array.isArray(e) && F(e, t);
166
166
  }, n.prototype.remove = function(t) {
167
167
  var e = this._finalizers;
168
- e && k(e, t), t instanceof n && t._removeParent(this);
168
+ e && F(e, t), t instanceof n && t._removeParent(this);
169
169
  }, n.EMPTY = function() {
170
170
  var t = new n();
171
171
  return t.closed = !0, t;
172
172
  }(), n;
173
- }(), be = I.EMPTY;
173
+ }(), ye = T.EMPTY;
174
174
  function me(n) {
175
- return n instanceof I || n && "closed" in n && m(n.remove) && m(n.add) && m(n.unsubscribe);
175
+ return n instanceof T || n && "closed" in n && m(n.remove) && m(n.add) && m(n.unsubscribe);
176
176
  }
177
177
  function ie(n) {
178
178
  m(n) ? n() : n.unsubscribe();
@@ -187,7 +187,7 @@ var we = {
187
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, F([n, t], $(e)));
190
+ return setTimeout.apply(void 0, k([n, t], $(e)));
191
191
  },
192
192
  clearTimeout: function(n) {
193
193
  var t = Se.delegate;
@@ -212,7 +212,7 @@ var Z = function(n) {
212
212
  return r.isStopped = !1, e ? (r.destination = e, me(e) && e.add(r)) : r.destination = $e, r;
213
213
  }
214
214
  return t.create = function(e, r, i) {
215
- return new N(e, r, i);
215
+ return new V(e, r, i);
216
216
  }, t.prototype.next = function(e) {
217
217
  this.isStopped || this._next(e);
218
218
  }, t.prototype.error = function(e) {
@@ -236,7 +236,7 @@ var Z = function(n) {
236
236
  this.unsubscribe();
237
237
  }
238
238
  }, t;
239
- }(I), Oe = Function.prototype.bind;
239
+ }(T), Oe = Function.prototype.bind;
240
240
  function D(n, t) {
241
241
  return Oe.call(n, t);
242
242
  }
@@ -271,7 +271,7 @@ var Le = function() {
271
271
  A(e);
272
272
  }
273
273
  }, n;
274
- }(), N = function(n) {
274
+ }(), V = function(n) {
275
275
  M(t, n);
276
276
  function t(e, r, i) {
277
277
  var s = n.call(this) || this, o;
@@ -306,20 +306,20 @@ var $e = {
306
306
  next: se,
307
307
  error: Ue,
308
308
  complete: se
309
- }, Fe = function() {
309
+ }, ke = function() {
310
310
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
311
311
  }();
312
312
  function Ee(n) {
313
313
  return n;
314
314
  }
315
- function ke(n) {
315
+ function Fe(n) {
316
316
  return n.length === 0 ? Ee : n.length === 1 ? n[0] : function(e) {
317
317
  return n.reduce(function(r, i) {
318
318
  return i(r);
319
319
  }, e);
320
320
  };
321
321
  }
322
- var Q = function() {
322
+ var z = function() {
323
323
  function n(t) {
324
324
  t && (this._subscribe = t);
325
325
  }
@@ -327,10 +327,10 @@ var Q = function() {
327
327
  var e = new n();
328
328
  return e.source = this, e.operator = t, e;
329
329
  }, n.prototype.subscribe = function(t, e, r) {
330
- var i = this, s = Ve(t) ? t : new N(t, e, r);
330
+ var i = this, s = je(t) ? t : new V(t, e, r);
331
331
  return U(function() {
332
- var o = i, c = o.operator, a = o.source;
333
- s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
332
+ var o = i, c = o.operator, u = o.source;
333
+ s.add(c ? c.call(s, u) : u ? i._subscribe(s) : i._trySubscribe(s));
334
334
  }), s;
335
335
  }, n.prototype._trySubscribe = function(t) {
336
336
  try {
@@ -341,12 +341,12 @@ var Q = function() {
341
341
  }, n.prototype.forEach = function(t, e) {
342
342
  var r = this;
343
343
  return e = oe(e), new e(function(i, s) {
344
- var o = new N({
344
+ var o = new V({
345
345
  next: function(c) {
346
346
  try {
347
347
  t(c);
348
- } catch (a) {
349
- s(a), o.unsubscribe();
348
+ } catch (u) {
349
+ s(u), o.unsubscribe();
350
350
  }
351
351
  },
352
352
  error: s,
@@ -357,12 +357,12 @@ var Q = function() {
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
- }, n.prototype[Fe] = function() {
360
+ }, n.prototype[ke] = 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 ke(t)(this);
365
+ return Fe(t)(this);
366
366
  }, n.prototype.toPromise = function(t) {
367
367
  var e = this;
368
368
  return t = oe(t), new t(function(r, i) {
@@ -383,18 +383,18 @@ function oe(n) {
383
383
  var t;
384
384
  return (t = n ?? we.Promise) !== null && t !== void 0 ? t : Promise;
385
385
  }
386
- function Ne(n) {
387
- return n && m(n.next) && m(n.error) && m(n.complete);
388
- }
389
386
  function Ve(n) {
390
- return n && n instanceof Z || Ne(n) && me(n);
387
+ return n && m(n.next) && m(n.error) && m(n.complete);
391
388
  }
392
389
  function je(n) {
390
+ return n && n instanceof Z || Ve(n) && me(n);
391
+ }
392
+ function Ne(n) {
393
393
  return m(n == null ? void 0 : n.lift);
394
394
  }
395
395
  function Ce(n) {
396
396
  return function(t) {
397
- if (je(t))
397
+ if (Ne(t))
398
398
  return t.lift(function(e) {
399
399
  try {
400
400
  return n(e, this);
@@ -411,30 +411,30 @@ function Me(n, t, e, r, i) {
411
411
  var De = function(n) {
412
412
  M(t, n);
413
413
  function t(e, r, i, s, o, c) {
414
- var a = n.call(this, e) || this;
415
- return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
414
+ var u = n.call(this, e) || this;
415
+ return u.onFinalize = o, u.shouldUnsubscribe = c, u._next = r ? function(a) {
416
416
  try {
417
- r(u);
417
+ r(a);
418
418
  } catch (v) {
419
419
  e.error(v);
420
420
  }
421
- } : n.prototype._next, a._error = s ? function(u) {
421
+ } : n.prototype._next, u._error = s ? function(a) {
422
422
  try {
423
- s(u);
423
+ s(a);
424
424
  } catch (v) {
425
425
  e.error(v);
426
426
  } finally {
427
427
  this.unsubscribe();
428
428
  }
429
- } : n.prototype._error, a._complete = i ? function() {
429
+ } : n.prototype._error, u._complete = i ? function() {
430
430
  try {
431
431
  i();
432
- } catch (u) {
433
- e.error(u);
432
+ } catch (a) {
433
+ e.error(a);
434
434
  } finally {
435
435
  this.unsubscribe();
436
436
  }
437
- } : n.prototype._complete, a;
437
+ } : n.prototype._complete, u;
438
438
  }
439
439
  return t.prototype.unsubscribe = function() {
440
440
  var e;
@@ -443,7 +443,7 @@ var De = function(n) {
443
443
  n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
444
444
  }
445
445
  }, t;
446
- }(Z), He = X(function(n) {
446
+ }(Z), qe = X(function(n) {
447
447
  return function() {
448
448
  n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
449
449
  };
@@ -454,11 +454,11 @@ var De = function(n) {
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 ae(this, this);
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 He();
461
+ throw new qe();
462
462
  }, t.prototype.next = function(e) {
463
463
  var r = this;
464
464
  U(function() {
@@ -466,12 +466,12 @@ var De = function(n) {
466
466
  if (r._throwIfClosed(), !r.isStopped) {
467
467
  r.currentObservers || (r.currentObservers = Array.from(r.observers));
468
468
  try {
469
- for (var o = z(r.currentObservers), c = o.next(); !c.done; c = o.next()) {
470
- var a = c.value;
471
- a.next(e);
469
+ for (var o = Q(r.currentObservers), c = o.next(); !c.done; c = o.next()) {
470
+ var u = c.value;
471
+ u.next(e);
472
472
  }
473
- } catch (u) {
474
- i = { error: u };
473
+ } catch (a) {
474
+ i = { error: a };
475
475
  } finally {
476
476
  try {
477
477
  c && !c.done && (s = o.return) && s.call(o);
@@ -515,19 +515,19 @@ var De = function(n) {
515
515
  return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
516
516
  }, t.prototype._innerSubscribe = function(e) {
517
517
  var r = this, i = this, s = i.hasError, o = i.isStopped, c = i.observers;
518
- return s || o ? be : (this.currentObservers = null, c.push(e), new I(function() {
519
- r.currentObservers = null, k(c, e);
518
+ return s || o ? ye : (this.currentObservers = null, c.push(e), new T(function() {
519
+ r.currentObservers = null, F(c, e);
520
520
  }));
521
521
  }, t.prototype._checkFinalizedStatuses = function(e) {
522
522
  var r = this, i = r.hasError, s = r.thrownError, o = r.isStopped;
523
523
  i ? e.error(s) : o && e.complete();
524
524
  }, t.prototype.asObservable = function() {
525
- var e = new Q();
525
+ var e = new z();
526
526
  return e.source = this, e;
527
527
  }, t.create = function(e, r) {
528
- return new ae(e, r);
528
+ return new ce(e, r);
529
529
  }, t;
530
- }(Q), ae = function(n) {
530
+ }(z), ce = function(n) {
531
531
  M(t, n);
532
532
  function t(e, r) {
533
533
  var i = n.call(this) || this;
@@ -544,14 +544,14 @@ var De = function(n) {
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
546
  var r, i;
547
- return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : be;
547
+ return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : ye;
548
548
  }, t;
549
- }(xe), qe = {
549
+ }(xe), Be = {
550
550
  now: function() {
551
551
  return Date.now();
552
552
  },
553
553
  delegate: void 0
554
- }, Be = function(n) {
554
+ }, He = function(n) {
555
555
  M(t, n);
556
556
  function t(e, r) {
557
557
  return n.call(this) || this;
@@ -559,18 +559,18 @@ var De = function(n) {
559
559
  return t.prototype.schedule = function(e, r) {
560
560
  return this;
561
561
  }, t;
562
- }(I), Y = {
562
+ }(T), Y = {
563
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, F([n, t], $(e)));
566
+ return setInterval.apply(void 0, k([n, t], $(e)));
567
567
  },
568
568
  clearInterval: function(n) {
569
569
  var t = Y.delegate;
570
570
  return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
571
571
  },
572
572
  delegate: void 0
573
- }, ze = function(n) {
573
+ }, Qe = function(n) {
574
574
  M(t, n);
575
575
  function t(e, r) {
576
576
  var i = n.call(this, e, r) || this;
@@ -609,20 +609,20 @@ var De = function(n) {
609
609
  }, t.prototype.unsubscribe = function() {
610
610
  if (!this.closed) {
611
611
  var e = this, r = e.id, i = e.scheduler, s = i.actions;
612
- this.work = this.state = this.scheduler = null, this.pending = !1, k(s, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
612
+ this.work = this.state = this.scheduler = null, this.pending = !1, F(s, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
613
613
  }
614
614
  }, t;
615
- }(Be), ce = function() {
615
+ }(He), ue = function() {
616
616
  function n(t, e) {
617
617
  e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
618
618
  }
619
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
- }, n.now = qe.now, n;
622
- }(), Qe = function(n) {
621
+ }, n.now = Be.now, n;
622
+ }(), ze = function(n) {
623
623
  M(t, n);
624
624
  function t(e, r) {
625
- r === void 0 && (r = ce.now);
625
+ r === void 0 && (r = ue.now);
626
626
  var i = n.call(this, e, r) || this;
627
627
  return i.actions = [], i._active = !1, i;
628
628
  }
@@ -644,7 +644,7 @@ var De = function(n) {
644
644
  throw i;
645
645
  }
646
646
  }, t;
647
- }(ce), Ye = new Qe(ze), Ge = Ye;
647
+ }(ue), Ye = new ze(Qe), Ge = Ye;
648
648
  function Ke(n) {
649
649
  return n && m(n.schedule);
650
650
  }
@@ -653,10 +653,10 @@ var Je = X(function(n) {
653
653
  n(this), this.name = "EmptyError", this.message = "no elements in sequence";
654
654
  };
655
655
  });
656
- function _(n, t) {
656
+ function I(n, t) {
657
657
  var e = typeof t == "object";
658
658
  return new Promise(function(r, i) {
659
- var s = new N({
659
+ var s = new V({
660
660
  next: function(o) {
661
661
  r(o), s.unsubscribe();
662
662
  },
@@ -682,7 +682,7 @@ function O(n, t) {
682
682
  function Xe(n, t, e) {
683
683
  n === void 0 && (n = 0), e === void 0 && (e = Ge);
684
684
  var r = -1;
685
- return t != null && (Ke(t) ? e = t : r = t), new Q(function(i) {
685
+ return t != null && (Ke(t) ? e = t : r = t), new z(function(i) {
686
686
  var s = We(n) ? +n - e.now() : n;
687
687
  s < 0 && (s = 0);
688
688
  var o = 0;
@@ -697,18 +697,18 @@ function Ze(n, t, e) {
697
697
  var o;
698
698
  (o = r.subscribe) === null || o === void 0 || o.call(r);
699
699
  var c = !0;
700
- i.subscribe(Me(s, function(a) {
701
- var u;
702
- (u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
703
- }, function() {
700
+ i.subscribe(Me(s, function(u) {
704
701
  var a;
705
- c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
706
- }, function(a) {
702
+ (a = r.next) === null || a === void 0 || a.call(r, u), s.next(u);
703
+ }, function() {
707
704
  var u;
708
- c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
705
+ c = !1, (u = r.complete) === null || u === void 0 || u.call(r), s.complete();
706
+ }, function(u) {
707
+ var a;
708
+ c = !1, (a = r.error) === null || a === void 0 || a.call(r, u), s.error(u);
709
709
  }, function() {
710
- var a, u;
711
- c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
710
+ var u, a;
711
+ c && ((u = r.unsubscribe) === null || u === void 0 || u.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
712
712
  }));
713
713
  }) : Ee;
714
714
  }
@@ -718,7 +718,7 @@ class l extends Error {
718
718
  super(`Incorrect context (${t}). Cannot perform the requested operation.`), C(this, "context"), this.context = t;
719
719
  }
720
720
  }
721
- class x extends Error {
721
+ class _ 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
  }
@@ -735,7 +735,7 @@ class nt extends Error {
735
735
  super(`Invalid version format: ${t}`);
736
736
  }
737
737
  }
738
- class ue extends Error {
738
+ class ae extends Error {
739
739
  constructor(t) {
740
740
  super(`${t} needs to be initialized before it can be used.`);
741
741
  }
@@ -752,7 +752,7 @@ function S(n) {
752
752
  function it(n) {
753
753
  return S(n == null ? void 0 : n.lift);
754
754
  }
755
- function R(n) {
755
+ function P(n) {
756
756
  return function(t) {
757
757
  if (it(t))
758
758
  return t.lift(function(e) {
@@ -826,7 +826,7 @@ function st(n) {
826
826
  }, e = n(t);
827
827
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
828
828
  }
829
- var H = st(function(n) {
829
+ var q = st(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) {
@@ -853,15 +853,15 @@ var te = function() {
853
853
  if (o)
854
854
  if (this._parentage = null, Array.isArray(o))
855
855
  try {
856
- for (var c = he(o), a = c.next(); !a.done; a = c.next()) {
857
- var u = a.value;
858
- u.remove(this);
856
+ for (var c = he(o), u = c.next(); !u.done; u = c.next()) {
857
+ var a = u.value;
858
+ a.remove(this);
859
859
  }
860
860
  } catch (p) {
861
861
  t = { error: p };
862
862
  } finally {
863
863
  try {
864
- a && !a.done && (e = c.return) && e.call(c);
864
+ u && !u.done && (e = c.return) && e.call(c);
865
865
  } finally {
866
866
  if (t)
867
867
  throw t.error;
@@ -874,18 +874,18 @@ var te = function() {
874
874
  try {
875
875
  v();
876
876
  } catch (p) {
877
- s = p instanceof H ? p.errors : [p];
877
+ s = p instanceof q ? p.errors : [p];
878
878
  }
879
879
  var g = this._finalizers;
880
880
  if (g) {
881
881
  this._finalizers = null;
882
882
  try {
883
883
  for (var E = he(g), w = E.next(); !w.done; w = E.next()) {
884
- var V = w.value;
884
+ var j = w.value;
885
885
  try {
886
- pe(V);
886
+ pe(j);
887
887
  } catch (p) {
888
- s = s ?? [], p instanceof H ? s = J(J([], K(s)), K(p.errors)) : s.push(p);
888
+ s = s ?? [], p instanceof q ? s = J(J([], K(s)), K(p.errors)) : s.push(p);
889
889
  }
890
890
  }
891
891
  } catch (p) {
@@ -900,7 +900,7 @@ var te = function() {
900
900
  }
901
901
  }
902
902
  if (s)
903
- throw new H(s);
903
+ throw new q(s);
904
904
  }
905
905
  }, n.prototype.add = function(t) {
906
906
  var e;
@@ -933,13 +933,13 @@ var te = function() {
933
933
  }(), n;
934
934
  }();
935
935
  te.EMPTY;
936
- function Te(n) {
936
+ function _e(n) {
937
937
  return n instanceof te || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
938
938
  }
939
939
  function pe(n) {
940
940
  S(n) ? n() : n.unsubscribe();
941
941
  }
942
- var _e = {
942
+ var Ie = {
943
943
  onUnhandledError: null,
944
944
  onStoppedNotification: null,
945
945
  Promise: void 0,
@@ -956,21 +956,21 @@ var _e = {
956
956
  },
957
957
  delegate: void 0
958
958
  };
959
- function at(n) {
959
+ function ct(n) {
960
960
  ot.setTimeout(function() {
961
961
  throw n;
962
962
  });
963
963
  }
964
964
  function fe() {
965
965
  }
966
- function ct(n) {
966
+ function ut(n) {
967
967
  n();
968
968
  }
969
969
  var re = function(n) {
970
970
  ee(t, n);
971
971
  function t(e) {
972
972
  var r = n.call(this) || this;
973
- return r.isStopped = !1, e ? (r.destination = e, Te(e) && e.add(r)) : r.destination = dt, r;
973
+ return r.isStopped = !1, e ? (r.destination = e, _e(e) && e.add(r)) : r.destination = dt, r;
974
974
  }
975
975
  return t.create = function(e, r, i) {
976
976
  return new W(e, r, i);
@@ -997,9 +997,9 @@ var re = function(n) {
997
997
  this.unsubscribe();
998
998
  }
999
999
  }, t;
1000
- }(te), ut = Function.prototype.bind;
1001
- function q(n, t) {
1002
- return ut.call(n, t);
1000
+ }(te), at = Function.prototype.bind;
1001
+ function B(n, t) {
1002
+ return at.call(n, t);
1003
1003
  }
1004
1004
  var lt = function() {
1005
1005
  function n(t) {
@@ -1044,12 +1044,12 @@ var lt = function() {
1044
1044
  };
1045
1045
  else {
1046
1046
  var c;
1047
- s && _e.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
1047
+ s && Ie.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
1048
1048
  return s.unsubscribe();
1049
1049
  }, o = {
1050
- next: e.next && q(e.next, c),
1051
- error: e.error && q(e.error, c),
1052
- complete: e.complete && q(e.complete, c)
1050
+ next: e.next && B(e.next, c),
1051
+ error: e.error && B(e.error, c),
1052
+ complete: e.complete && B(e.complete, c)
1053
1053
  }) : o = e;
1054
1054
  }
1055
1055
  return s.destination = new lt(o), s;
@@ -1057,7 +1057,7 @@ var lt = function() {
1057
1057
  return t;
1058
1058
  }(re);
1059
1059
  function L(n) {
1060
- at(n);
1060
+ ct(n);
1061
1061
  }
1062
1062
  function ht(n) {
1063
1063
  throw n;
@@ -1070,11 +1070,11 @@ var dt = {
1070
1070
  }, pt = function() {
1071
1071
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
1072
1072
  }();
1073
- function Ie(n) {
1073
+ function Te(n) {
1074
1074
  return n;
1075
1075
  }
1076
1076
  function ft(n) {
1077
- return n.length === 0 ? Ie : n.length === 1 ? n[0] : function(t) {
1077
+ return n.length === 0 ? Te : n.length === 1 ? n[0] : function(t) {
1078
1078
  return n.reduce(function(e, r) {
1079
1079
  return r(e);
1080
1080
  }, t);
@@ -1088,10 +1088,10 @@ var gt = function() {
1088
1088
  var e = new n();
1089
1089
  return e.source = this, e.operator = t, e;
1090
1090
  }, n.prototype.subscribe = function(t, e, r) {
1091
- var i = this, s = yt(t) ? t : new W(t, e, r);
1092
- return ct(function() {
1093
- var o = i, c = o.operator, a = o.source;
1094
- s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
1091
+ var i = this, s = bt(t) ? t : new W(t, e, r);
1092
+ return ut(function() {
1093
+ var o = i, c = o.operator, u = o.source;
1094
+ s.add(c ? c.call(s, u) : u ? i._subscribe(s) : i._trySubscribe(s));
1095
1095
  }), s;
1096
1096
  }, n.prototype._trySubscribe = function(t) {
1097
1097
  try {
@@ -1106,8 +1106,8 @@ var gt = function() {
1106
1106
  next: function(c) {
1107
1107
  try {
1108
1108
  t(c);
1109
- } catch (a) {
1110
- s(a), o.unsubscribe();
1109
+ } catch (u) {
1110
+ s(u), o.unsubscribe();
1111
1111
  }
1112
1112
  },
1113
1113
  error: s,
@@ -1142,44 +1142,44 @@ var gt = function() {
1142
1142
  }();
1143
1143
  function ge(n) {
1144
1144
  var t;
1145
- return (t = n ?? _e.Promise) !== null && t !== void 0 ? t : Promise;
1145
+ return (t = n ?? Ie.Promise) !== null && t !== void 0 ? t : Promise;
1146
1146
  }
1147
1147
  function vt(n) {
1148
1148
  return n && S(n.next) && S(n.error) && S(n.complete);
1149
1149
  }
1150
- function yt(n) {
1151
- return n && n instanceof re || vt(n) && Te(n);
1150
+ function bt(n) {
1151
+ return n && n instanceof re || vt(n) && _e(n);
1152
1152
  }
1153
- function P(n, t, e, r, i) {
1154
- return new bt(n, t, e, r, i);
1153
+ function R(n, t, e, r, i) {
1154
+ return new yt(n, t, e, r, i);
1155
1155
  }
1156
- var bt = function(n) {
1156
+ var yt = function(n) {
1157
1157
  ee(t, n);
1158
1158
  function t(e, r, i, s, o, c) {
1159
- var a = n.call(this, e) || this;
1160
- return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
1159
+ var u = n.call(this, e) || this;
1160
+ return u.onFinalize = o, u.shouldUnsubscribe = c, u._next = r ? function(a) {
1161
1161
  try {
1162
- r(u);
1162
+ r(a);
1163
1163
  } catch (v) {
1164
1164
  e.error(v);
1165
1165
  }
1166
- } : n.prototype._next, a._error = s ? function(u) {
1166
+ } : n.prototype._next, u._error = s ? function(a) {
1167
1167
  try {
1168
- s(u);
1168
+ s(a);
1169
1169
  } catch (v) {
1170
1170
  e.error(v);
1171
1171
  } finally {
1172
1172
  this.unsubscribe();
1173
1173
  }
1174
- } : n.prototype._error, a._complete = i ? function() {
1174
+ } : n.prototype._error, u._complete = i ? function() {
1175
1175
  try {
1176
1176
  i();
1177
- } catch (u) {
1178
- e.error(u);
1177
+ } catch (a) {
1178
+ e.error(a);
1179
1179
  } finally {
1180
1180
  this.unsubscribe();
1181
1181
  }
1182
- } : n.prototype._complete, a;
1182
+ } : n.prototype._complete, u;
1183
1183
  }
1184
1184
  return t.prototype.unsubscribe = function() {
1185
1185
  var e;
@@ -1190,9 +1190,9 @@ var bt = function(n) {
1190
1190
  }, t;
1191
1191
  }(re);
1192
1192
  function h(n, t) {
1193
- return R(function(e, r) {
1193
+ return P(function(e, r) {
1194
1194
  var i = 0;
1195
- e.subscribe(P(r, function(s) {
1195
+ e.subscribe(R(r, function(s) {
1196
1196
  r.next(n.call(t, s, i++));
1197
1197
  }));
1198
1198
  });
@@ -1203,25 +1203,25 @@ var mt = new gt(function(n) {
1203
1203
  function y(n) {
1204
1204
  return n <= 0 ? function() {
1205
1205
  return mt;
1206
- } : R(function(t, e) {
1206
+ } : P(function(t, e) {
1207
1207
  var r = 0;
1208
- t.subscribe(P(e, function(i) {
1208
+ t.subscribe(R(e, function(i) {
1209
1209
  ++r <= n && (e.next(i), n <= r && e.complete());
1210
1210
  }));
1211
1211
  });
1212
1212
  }
1213
1213
  function f(n, t) {
1214
- return R(function(e, r) {
1214
+ return P(function(e, r) {
1215
1215
  var i = 0;
1216
- e.subscribe(P(r, function(s) {
1216
+ e.subscribe(R(r, function(s) {
1217
1217
  return n.call(t, s, i++) && r.next(s);
1218
1218
  }));
1219
1219
  });
1220
1220
  }
1221
1221
  function wt(n, t) {
1222
- return t === void 0 && (t = !1), R(function(e, r) {
1222
+ return t === void 0 && (t = !1), P(function(e, r) {
1223
1223
  var i = 0;
1224
- e.subscribe(P(r, function(s) {
1224
+ e.subscribe(R(r, function(s) {
1225
1225
  var o = n(s, i++);
1226
1226
  (o || t) && r.next(s), !o && r.complete();
1227
1227
  }));
@@ -1229,24 +1229,24 @@ function wt(n, t) {
1229
1229
  }
1230
1230
  function d(n, t, e) {
1231
1231
  var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
1232
- return r ? R(function(i, s) {
1232
+ return r ? P(function(i, s) {
1233
1233
  var o;
1234
1234
  (o = r.subscribe) === null || o === void 0 || o.call(r);
1235
1235
  var c = !0;
1236
- i.subscribe(P(s, function(a) {
1237
- var u;
1238
- (u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
1239
- }, function() {
1236
+ i.subscribe(R(s, function(u) {
1240
1237
  var a;
1241
- c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
1242
- }, function(a) {
1238
+ (a = r.next) === null || a === void 0 || a.call(r, u), s.next(u);
1239
+ }, function() {
1243
1240
  var u;
1244
- c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
1241
+ c = !1, (u = r.complete) === null || u === void 0 || u.call(r), s.complete();
1242
+ }, function(u) {
1243
+ var a;
1244
+ c = !1, (a = r.error) === null || a === void 0 || a.call(r, u), s.error(u);
1245
1245
  }, function() {
1246
- var a, u;
1247
- c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
1246
+ var u, a;
1247
+ c && ((u = r.unsubscribe) === null || u === void 0 || u.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
1248
1248
  }));
1249
- }) : Ie;
1249
+ }) : Te;
1250
1250
  }
1251
1251
  const St = /^(\d+)\.(\d+)$/;
1252
1252
  function Et(n) {
@@ -1271,7 +1271,7 @@ function Ct(n, t) {
1271
1271
  function Mt(n, t) {
1272
1272
  return ne(n, t) >= 0;
1273
1273
  }
1274
- const ye = "2.0";
1274
+ const be = "2.0";
1275
1275
  class xt {
1276
1276
  /**
1277
1277
  * Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
@@ -1283,8 +1283,8 @@ class xt {
1283
1283
  * @param logService - An instance of a logging service or utility
1284
1284
  */
1285
1285
  constructor(t, e) {
1286
- if (C(this, "negotiatedProtocolVersion"), C(this, "currentContext"), C(this, "incomingMessages$"), C(this, "inIframe", !1), C(this, "embeddedResult"), C(this, "iframePort1"), C(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new xe(), this.supportedVersions = t.filter((r) => Mt(r, ye)), !this.supportedVersions.length)
1287
- throw new le(t, ye);
1286
+ if (C(this, "negotiatedProtocolVersion"), C(this, "currentContext"), C(this, "incomingMessages$"), C(this, "inIframe", !1), C(this, "embeddedResult"), C(this, "iframePort1"), C(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new xe(), this.supportedVersions = t.filter((r) => Mt(r, be)), !this.supportedVersions.length)
1287
+ throw new le(t, be);
1288
1288
  this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
1289
1289
  }
1290
1290
  get parent() {
@@ -1306,11 +1306,11 @@ class xt {
1306
1306
  var t, e, r, i;
1307
1307
  if (this.inIframe) {
1308
1308
  if (!this.iframePort2)
1309
- throw new ue("port2");
1309
+ throw new ae("port2");
1310
1310
  return this.iframePort2;
1311
1311
  } else {
1312
1312
  if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))
1313
- throw new ue("port2");
1313
+ throw new ae("port2");
1314
1314
  return (i = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : i.port2;
1315
1315
  }
1316
1316
  }
@@ -1397,10 +1397,10 @@ class xt {
1397
1397
  jwtToken: s,
1398
1398
  serverUrl: o,
1399
1399
  region: c,
1400
- joinMicMuted: a,
1401
- joinWithoutCamera: u
1400
+ joinMicMuted: u,
1401
+ joinWithoutCamera: a
1402
1402
  } = t, v = "JOINING ROOM", g = this.createMessage(v, !1);
1403
- g.roomName = e, g.jwtToken = s, g.serverUrl = o, g.region = c, g.roomInvite = r, g.joinMicMuted = a ?? !1, g.joinWithoutCamera = u ?? !1, g.displayName = i, this.logCreated(v, g), this.port2.postMessage(g), this.logSent(v, g);
1403
+ g.roomName = e, g.jwtToken = s, g.serverUrl = o, g.region = c, g.roomInvite = r, g.joinMicMuted = u ?? !1, g.joinWithoutCamera = a ?? !1, g.displayName = i, this.logCreated(v, g), this.port2.postMessage(g), this.logSent(v, g);
1404
1404
  }
1405
1405
  /**
1406
1406
  * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
@@ -1634,13 +1634,13 @@ class xt {
1634
1634
  if (!this.isEmbedded())
1635
1635
  throw new l(this.currentContext);
1636
1636
  if (e === "group" && i === void 0)
1637
- throw new x(
1637
+ throw new _(
1638
1638
  "currentContacts",
1639
1639
  i,
1640
1640
  "currentContacts is required for group streams"
1641
1641
  );
1642
1642
  if (e === "direct" && i !== void 0)
1643
- throw new x(
1643
+ throw new _(
1644
1644
  "currentContacts",
1645
1645
  i,
1646
1646
  "currentContacts should not be passed for direct streams"
@@ -1648,14 +1648,14 @@ class xt {
1648
1648
  const s = "SELECT CONTACTS", o = this.createMessage(s, !0);
1649
1649
  o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = i, this.logCreated(s, o);
1650
1650
  const c = this.incomingMessages$.pipe(
1651
- f((a) => a.type === s && a.replyTo === o.id),
1651
+ f((u) => u.type === s && u.replyTo === o.id),
1652
1652
  d(this.logReceived(s)),
1653
1653
  // validate if `streamId` is the same as we sent
1654
- h((a) => {
1655
- const u = a;
1656
- if (u.streamId !== t)
1657
- throw new rt(u.streamId, t);
1658
- return e === "direct" && u.contacts.length > 1 && (u.contacts = [u.contacts[0]]), u;
1654
+ h((u) => {
1655
+ const a = u;
1656
+ if (a.streamId !== t)
1657
+ throw new rt(a.streamId, t);
1658
+ return e === "direct" && a.contacts.length > 1 && (a.contacts = [a.contacts[0]]), a;
1659
1659
  }),
1660
1660
  y(1)
1661
1661
  );
@@ -1673,7 +1673,7 @@ class xt {
1673
1673
  if (!this.isEmbedded())
1674
1674
  throw new l(this.currentContext);
1675
1675
  if (!t.length)
1676
- throw new x("contacts", t, "At least one contact is required");
1676
+ throw new _("contacts", t, "At least one contact is required");
1677
1677
  const e = "MATCH CONTACTS", r = this.createMessage(e);
1678
1678
  r.contacts = [...t], this.logCreated(e, r);
1679
1679
  const i = this.incomingMessages$.pipe(
@@ -1884,9 +1884,9 @@ class xt {
1884
1884
  * logs from the `Client` app.
1885
1885
  *
1886
1886
  * @remarks
1887
- * The `Host` app can either request that logs be sent as a {@link FileTransferMessage} via the
1888
- * IPC Protocol or trigger a file download by the `Client` by passing a
1889
- * {@link RequestLogsResponseType} in the `responseType` property.
1887
+ * The `Host` app can either request that logs be sent as a transfer via the IPC Protocol or
1888
+ * trigger a file download by the `Client` by passing a {@link RequestLogsResponseType} in the
1889
+ * `responseType` property.
1890
1890
  *
1891
1891
  * @returns An observable that emits whenever a {@link RequestLogsMessage} is received so it can
1892
1892
  * be subscribed to indefinitely.
@@ -1920,85 +1920,6 @@ class xt {
1920
1920
  const r = "VIEW TRANSITION", i = this.createMessage(r, !1);
1921
1921
  i.transitionType = t, i.targetView = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
1922
1922
  }
1923
- /**
1924
- * Send a {@link FileTransferMessage} to the `Host` app, to transfer a file.
1925
- *
1926
- * @remarks
1927
- * The file data can be either `base64` encoded string or a raw byte array `buffer` encoded as an
1928
- * ArrayBuffer. An SHA256 hash of the file is also sent to the `Host` app to verify the file
1929
- * integrity.
1930
- *
1931
- * @param payload - The {@link FileTransferPayload} to send to the host app.
1932
- * @param intent - _Optional_. The intent of the file transfer. Can be either `attachment` or
1933
- * `general`. Defaults to `attachment`.
1934
- * @param streamId - _Optional_. The ID of the message stream to which the files will be attached
1935
- * to. Only used if `intent` is set to `attachment`.
1936
- * @param shouldOpen - _Optional_. Whether the file should be opened after it's transferred.
1937
- *
1938
- * @returns This method returns void.
1939
- */
1940
- sendFileTransferMessage(t, e = "attachment", r, i) {
1941
- if (!this.isEmbedded())
1942
- throw new l(this.currentContext);
1943
- const s = "FILE TRANSFER", o = this.createMessage(s, !1);
1944
- if (o.mimeType = t.mimeType, o.fileName = t.fileName, o.fileSize = t.fileSize, o.fileHash = t.fileHash.toLowerCase(), o.dataType = t.dataType, o.data = t.data, o.intent = e, e === "attachment") {
1945
- if (!r)
1946
- throw new x(
1947
- "streamId",
1948
- r,
1949
- "streamId is required for attachment intent"
1950
- );
1951
- o.streamId = r;
1952
- }
1953
- i && (o.shouldOpen = i), this.logCreated(s, o);
1954
- const c = this.incomingMessages$.pipe(
1955
- f((a) => a.type === s && a.replyTo === o.id),
1956
- d(this.logReceived(s)),
1957
- h((a) => a),
1958
- y(1)
1959
- );
1960
- return this.port2.postMessage(o), this.logSent(s, o), c;
1961
- }
1962
- /**
1963
- * Send a {@link FileTransferMessageReply} to the `Host` app, to reply to a
1964
- * {@link FileTransferMessage} sent by the `Host` app.
1965
- *
1966
- * @param replyTo - ID of the {@link FileTransferMessage} being replied to
1967
- * @param result - The result of the file transfer. Should be of {@link FileTransferMessageResult}
1968
- * @param errorMessage - _Optional_. The error message to send if the result is `error`.
1969
- *
1970
- * @returns This method returns void.
1971
- */
1972
- sendFileTransferMessageReply(t, e, r) {
1973
- if (!this.isEmbedded())
1974
- throw new l(this.currentContext);
1975
- const i = "FILE TRANSFER", s = this.createMessage(i, !1, t);
1976
- s.result = e, r && e === "error" && (s.errorMessage = r), this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
1977
- }
1978
- /**
1979
- * Setup listener for {@link FileTransferMessage}, which can be sent by a `Host` app to transfer
1980
- * a file to the `Client` app.
1981
- *
1982
- * @remarks
1983
- * The `Host` app can send the file as a `base64` encoded string or a raw byte array `buffer` in
1984
- * an ArrayBuffer. An SHA256 hash of the file is also sent to the `Client` app to verify the file
1985
- * integrity.
1986
- *
1987
- * @returns An observable that emits whenever {@link FileTransferMessage} is received so it can
1988
- * be subscribed to indefinitely.
1989
- */
1990
- onFileTransferMessage() {
1991
- if (!this.isEmbedded())
1992
- throw new l(this.currentContext);
1993
- const t = "FILE TRANSFER";
1994
- return this.incomingMessages$.pipe(
1995
- f(
1996
- (e) => e.type === t && e.target === "client" && e.replyTo === null
1997
- ),
1998
- h((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
1999
- d(this.logReceived(t))
2000
- );
2001
- }
2002
1923
  /**
2003
1924
  * Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.
2004
1925
  *
@@ -2045,7 +1966,7 @@ class xt {
2045
1966
  const s = "FILE REQUEST", o = this.createMessage(s);
2046
1967
  if (o.fileHash = t.toLowerCase(), o.intent = e, o.maxChunkSizeInBytes = i, e === "attachment") {
2047
1968
  if (!r)
2048
- throw new x(
1969
+ throw new _(
2049
1970
  "streamId",
2050
1971
  r,
2051
1972
  "streamId is required for attachment intent"
@@ -2054,16 +1975,40 @@ class xt {
2054
1975
  }
2055
1976
  this.logCreated(s, o);
2056
1977
  let c = 0;
2057
- const a = this.incomingMessages$.pipe(
1978
+ const u = this.incomingMessages$.pipe(
2058
1979
  f(
2059
- (u) => u.type === s && u.replyTo === o.id
1980
+ (a) => a.type === s && a.replyTo === o.id
2060
1981
  ),
2061
1982
  d(this.logReceived(s)),
2062
1983
  d(() => c++),
2063
- h((u) => (u.result === "success" && (u.chunkHash = u.chunkHash.toLowerCase()), u)),
2064
- wt((u) => u.result === "success" && c < u.totalChunks, !0)
1984
+ h((a) => (a.result === "success" && (a.chunkHash = a.chunkHash.toLowerCase()), a)),
1985
+ wt((a) => a.result === "success" && c < a.totalChunks, !0)
1986
+ );
1987
+ return this.port2.postMessage(o), this.logSent(s, o), u;
1988
+ }
1989
+ /**
1990
+ * Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a
1991
+ * file by it's SHA256 hash.
1992
+ *
1993
+ * @remarks
1994
+ * The initiating party can optionally suggest the other party to limit the size of the chunks
1995
+ * sent in the response by setting the `maxChunkSizeInBytes` field. However, this is only a
1996
+ * suggestion and the other party can still choose to send chunks of a different size.
1997
+ *
1998
+ * @returns An observable that emits whenever {@link FileRequestMessage} is received so it can
1999
+ * be subscribed to indefinitely.
2000
+ */
2001
+ onFileRequestMessage() {
2002
+ if (!this.isEmbedded())
2003
+ throw new l(this.currentContext);
2004
+ const t = "FILE REQUEST";
2005
+ return this.incomingMessages$.pipe(
2006
+ f(
2007
+ (e) => e.type === t && e.target === "client" && e.replyTo === null
2008
+ ),
2009
+ h((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
2010
+ d(this.logReceived(t))
2065
2011
  );
2066
- return this.port2.postMessage(o), this.logSent(s, o), a;
2067
2012
  }
2068
2013
  /**
2069
2014
  * Sends a {@link FileSelectionMessage} to the Host app, to request the user to select on or
@@ -2073,15 +2018,14 @@ class xt {
2073
2018
  * The `Host` app should reply with a {@link FileSelectionMessageReply} containing the number of
2074
2019
  * files the user selected along with the file identifiers.
2075
2020
  *
2076
- * The file identifiers can be used to corelate files being transferred via the
2077
- * {@link FileTransferMessage} afterwards.
2078
- *
2079
2021
  * @param intent - _Optional_. The intent of the file selection. Can be either `attachment` or
2080
2022
  * `general`. Defaults to `attachment`.
2081
2023
  * @param streamId - _Optional_. The ID of the message stream to which the files will be attached
2082
2024
  * to. Only used if `intent` is set to `attachment`.
2083
2025
  * @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to
2084
2026
  * unlimited.
2027
+ * @param maxFileSize - _Optional_. The maximum size of the files to select in bytes. Defaults to
2028
+ * unlimited.
2085
2029
  * @param mimeTypes - _Optional_. The MIME type of the files to select. Defaults to `*\/*`.
2086
2030
  *
2087
2031
  * @returns This method returns void.
@@ -2092,7 +2036,7 @@ class xt {
2092
2036
  const o = "FILE SELECTION", c = this.createMessage(o);
2093
2037
  if (c.intent = t, c.maxCount = r, c.maxFileSizeInBytes = i, c.mimeTypes = s, t === "attachment") {
2094
2038
  if (!e)
2095
- throw new x(
2039
+ throw new _(
2096
2040
  "streamId",
2097
2041
  e,
2098
2042
  "streamId is required for attachment intent"
@@ -2100,18 +2044,18 @@ class xt {
2100
2044
  c.streamId = e;
2101
2045
  }
2102
2046
  this.logCreated(o, c);
2103
- const a = this.incomingMessages$.pipe(
2047
+ const u = this.incomingMessages$.pipe(
2104
2048
  f(
2105
- (u) => u.type === o && u.replyTo === c.id
2049
+ (a) => a.type === o && a.replyTo === c.id
2106
2050
  ),
2107
- h((u) => {
2051
+ h((a) => {
2108
2052
  var v;
2109
- return u.files = (v = u.files) == null ? void 0 : v.map((g) => (g.fileHash = g.fileHash.toLowerCase(), g)), u;
2053
+ return a.files = (v = a.files) == null ? void 0 : v.map((g) => (g.fileHash = g.fileHash.toLowerCase(), g)), a;
2110
2054
  }),
2111
2055
  d(this.logReceived(o)),
2112
2056
  y(1)
2113
2057
  );
2114
- return this.port2.postMessage(c), this.logSent(o, c), a;
2058
+ return this.port2.postMessage(c), this.logSent(o, c), u;
2115
2059
  }
2116
2060
  /**
2117
2061
  * Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
@@ -2120,9 +2064,6 @@ class xt {
2120
2064
  * The file at the specified `url` is encrypted using the provided `key` and the Host app needs
2121
2065
  * to decrypt it.
2122
2066
  *
2123
- * The reply does not include the file itself. The file will be transferred via the
2124
- * {@link FileTransferMessage} afterwards if required.
2125
- *
2126
2067
  * @param url - The URL to download the file from
2127
2068
  * @param key - The decryption key for the file stream
2128
2069
  * @param fileName - The name of the file to download
@@ -2136,9 +2077,9 @@ class xt {
2136
2077
  const s = "FILE DOWNLOAD", o = this.createMessage(s);
2137
2078
  o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
2138
2079
  const c = this.incomingMessages$.pipe(
2139
- f((a) => a.type === s && a.replyTo === o.id),
2080
+ f((u) => u.type === s && u.replyTo === o.id),
2140
2081
  d(this.logReceived(s)),
2141
- h((a) => a),
2082
+ h((u) => u),
2142
2083
  y(1)
2143
2084
  );
2144
2085
  return this.port2.postMessage(o), this.logSent(s, o), c;
@@ -2151,17 +2092,19 @@ class xt {
2151
2092
  * have in it's storage.
2152
2093
  *
2153
2094
  * @remarks
2154
- * The `hash` parameter is the SHA256 hash of the decrypted file, which is used as an identifier
2155
- * for the target file in the `Host` app as well as to verify the integrity of the file.
2095
+ * The `fileHash` parameter is the SHA256 hash of the decrypted file, which is used as an
2096
+ * identifier for the target file in the `Host` app as well as to verify the integrity of the
2097
+ * file.
2156
2098
  *
2157
- * @param hash - The SHA256 hash of the file to open.
2099
+ * @param fileHash - The SHA256 hash of the file to open.
2100
+ * @param fileName - _Optional_. The name of the file to open.
2158
2101
  * @param streamId - _Optional_. The ID of the message stream from which the file is opened from.
2159
2102
  */
2160
- sendFileOpenMessage(t, e) {
2103
+ sendFileOpenMessage(t, e, r) {
2161
2104
  if (!this.isEmbedded())
2162
2105
  throw new l(this.currentContext);
2163
- const r = "FILE OPEN", i = this.createMessage(r, !1);
2164
- i.hash = t.toLowerCase(), i.streamId = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2106
+ const i = "FILE OPEN", s = this.createMessage(i, !1);
2107
+ s.fileHash = t.toLowerCase(), s.fileName = e, s.streamId = r, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
2165
2108
  }
2166
2109
  /**
2167
2110
  * Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
@@ -2234,14 +2177,13 @@ class xt {
2234
2177
  * Sends a {@link SipCallMessage} to the Host app to initiate a SIP call between the current user
2235
2178
  * and the callee.
2236
2179
  *
2237
- * @param uri - The SIP URI of the callee
2238
- * @param cloudUsername - _Optional_. The cloud username of the callee
2180
+ * @param contact - The {@link ContactItem} for the callee.
2239
2181
  */
2240
- sendSipCallMessage(t, e) {
2182
+ sendSipCallMessage(t) {
2241
2183
  if (!this.isEmbedded())
2242
2184
  throw new l(this.currentContext);
2243
- const r = "SIP CALL", i = this.createMessage(r, !1);
2244
- i.uri = t, i.cloudUsername = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2185
+ const e = "SIP CALL", r = this.createMessage(e, !1);
2186
+ r.contact = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
2245
2187
  }
2246
2188
  /**
2247
2189
  * Checks if the client app is either embedded in an iframe or in a native webview.
@@ -2283,15 +2225,15 @@ class xt {
2283
2225
  return ne(this.negotiatedProtocolVersion, t);
2284
2226
  }
2285
2227
  logReceived(t, e) {
2286
- ["FILE TRANSFER", "FILE REQUEST"].includes(t) && e != null && e.data && (e = { ...e, data: "..." });
2228
+ e && _t(e) && (e = { ...e, data: "..." });
2287
2229
  const r = (i) => this.logService.debug(`[IPC] Received ${t} message`, i);
2288
2230
  return e && r(e), r;
2289
2231
  }
2290
2232
  logSent(t, e) {
2291
- t === "FILE TRANSFER" && e != null && e.data && (e = { ...e, data: "..." }), this.logService.debug(`[IPC] Sent ${t} message`, e);
2233
+ e.type === "FILE REQUEST" && e.result === "success" && (e = { ...e, data: "..." }), this.logService.debug(`[IPC] Sent ${t} message`, e);
2292
2234
  }
2293
2235
  logCreated(t, e) {
2294
- t === "FILE TRANSFER" && e != null && e.data && (e = { ...e, data: "..." }), this.logService.debug(`[IPC] Created ${t} message`, e);
2236
+ e.type === "FILE REQUEST" && e.result === "success" && (e = { ...e, data: "..." }), this.logService.debug(`[IPC] Created ${t} message`, e);
2295
2237
  }
2296
2238
  async createIframeChannel() {
2297
2239
  return new Promise((t) => {
@@ -2326,8 +2268,11 @@ class xt {
2326
2268
  return i.join("");
2327
2269
  }
2328
2270
  }
2329
- const Tt = ["2.0"];
2330
- class It {
2271
+ function _t(n) {
2272
+ return n.type === "FILE REQUEST" && n.replyTo !== null;
2273
+ }
2274
+ const It = ["2.0"];
2275
+ class Pt {
2331
2276
  /**
2332
2277
  * A class that manages the IPC communication between the `Client` and the `Host`.
2333
2278
  *
@@ -2342,15 +2287,15 @@ class It {
2342
2287
  /**
2343
2288
  * The type of the `Host` app the `Client` is embedded in.
2344
2289
  */
2345
- T(this, "host");
2290
+ x(this, "host");
2346
2291
  /**
2347
2292
  * The cloud ID of the `Host` app the `Client` is embedded in.
2348
2293
  */
2349
- T(this, "cloudId");
2350
- T(this, "logger");
2351
- T(this, "helper");
2352
- T(this, "listeners");
2353
- this.logger = t ?? console, this.helper = new xt(Tt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(b.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(b.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(b.PushToken, /* @__PURE__ */ new Set());
2294
+ x(this, "cloudId");
2295
+ x(this, "logger");
2296
+ x(this, "helper");
2297
+ x(this, "listeners");
2298
+ this.logger = t ?? console, this.helper = new xt(It, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(b.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(b.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(b.PushToken, /* @__PURE__ */ new Set());
2354
2299
  }
2355
2300
  /**
2356
2301
  * Returns whether the app is running inside a native WebView (`host` context) or as a
@@ -2377,7 +2322,7 @@ class It {
2377
2322
  * @returns A promise with {@link IPCContext} the app is running under.
2378
2323
  */
2379
2324
  async determineContext() {
2380
- const t = await _(this.helper.determineContext(), {
2325
+ const t = await I(this.helper.determineContext(), {
2381
2326
  defaultValue: "guest"
2382
2327
  });
2383
2328
  return this.evaluateContext(t);
@@ -2386,7 +2331,7 @@ class It {
2386
2331
  * Initiates the IPC handshake with the `Host` app.
2387
2332
  */
2388
2333
  initiateConnection() {
2389
- return _(
2334
+ return I(
2390
2335
  this.helper.openBridge().pipe(
2391
2336
  Ze((t) => {
2392
2337
  this.helper.onBadgeQueryMessage().subscribe((e) => {
@@ -2416,7 +2361,7 @@ class It {
2416
2361
  let s;
2417
2362
  if (e === "multi") {
2418
2363
  if (!r || !Array.isArray(r))
2419
- throw new x(
2364
+ throw new _(
2420
2365
  "currentContacts",
2421
2366
  r,
2422
2367
  "currentContacts is required for group streams"
@@ -2429,7 +2374,7 @@ class It {
2429
2374
  );
2430
2375
  } else
2431
2376
  r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
2432
- return _(s.pipe(O((o) => o.contacts)));
2377
+ return I(s.pipe(O((o) => o.contacts)));
2433
2378
  }
2434
2379
  /**
2435
2380
  * Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
@@ -2441,7 +2386,7 @@ class It {
2441
2386
  * Host's contact list.
2442
2387
  */
2443
2388
  matchContacts(t) {
2444
- return this.logger.debug("Match Contacts: ", t), _(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
2389
+ return this.logger.debug("Match Contacts: ", t), I(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
2445
2390
  }
2446
2391
  /**
2447
2392
  * Requests the `Host` app to provide the Push Token for the current device.
@@ -2449,7 +2394,7 @@ class It {
2449
2394
  * @returns A promise with the Push Token as `string`.
2450
2395
  */
2451
2396
  requestPushToken() {
2452
- return this.logger.debug("Requesting Push Token"), _(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
2397
+ return this.logger.debug("Requesting Push Token"), I(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
2453
2398
  }
2454
2399
  /**
2455
2400
  * Sends the current badge count to the `Host` app.
@@ -2483,13 +2428,12 @@ class It {
2483
2428
  this.logger.debug("Opening URL: ", t), this.helper.openUrl(t, e);
2484
2429
  }
2485
2430
  /**
2486
- * Initiates a SIP call to the given SIP URI.
2431
+ * Initiates a SIP call to the given {@link ContactItem}.
2487
2432
  *
2488
- * @param uri - SIP URI of the callee.
2489
- * @param cloudUsername - _Optional_. The cloud username of the callee.
2433
+ * @param contact - {@link ContactItem} for the callee.
2490
2434
  */
2491
- sipCall(t, e) {
2492
- this.logger.debug("Initiating SIP Call: ", t, e), this.helper.sendSipCallMessage(t, e);
2435
+ sipCall(t) {
2436
+ this.logger.debug("Initiating SIP Call: ", t), this.helper.sendSipCallMessage(t);
2493
2437
  }
2494
2438
  /**
2495
2439
  * Registers a callback to be invoked when a {@link IPCEvents.BadgeQuery} is received.
@@ -2551,5 +2495,5 @@ class It {
2551
2495
  }
2552
2496
  export {
2553
2497
  b as IPCEvents,
2554
- It as IPCManager
2498
+ Pt as IPCManager
2555
2499
  };