@acrobits/ipc-sdk 0.5.4 → 0.5.6

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,5 +1,5 @@
1
- var Ie = Object.defineProperty;
2
- var Ae = (n, t, e) => t in n ? Ie(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
1
+ var Re = Object.defineProperty;
2
+ var Ae = (n, t, e) => t in n ? Re(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var x = (n, t, e) => (Ae(n, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  var b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}), z = function(n, t) {
5
5
  return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
@@ -30,7 +30,7 @@ function Q(n) {
30
30
  };
31
31
  throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
32
32
  }
33
- function _(n, t) {
33
+ function T(n, t) {
34
34
  var e = typeof Symbol == "function" && n[Symbol.iterator];
35
35
  if (!e)
36
36
  return n;
@@ -38,8 +38,8 @@ function _(n, t) {
38
38
  try {
39
39
  for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
40
40
  s.push(i.value);
41
- } catch (u) {
42
- o = { error: u };
41
+ } catch (a) {
42
+ o = { error: a };
43
43
  } finally {
44
44
  try {
45
45
  i && !i.done && (e = r.return) && e.call(r);
@@ -50,7 +50,7 @@ function _(n, t) {
50
50
  }
51
51
  return s;
52
52
  }
53
- function T(n, t, e) {
53
+ function I(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]);
@@ -92,15 +92,15 @@ var R = function() {
92
92
  if (o)
93
93
  if (this._parentage = null, Array.isArray(o))
94
94
  try {
95
- for (var u = Q(o), c = u.next(); !c.done; c = u.next()) {
96
- var a = c.value;
97
- a.remove(this);
95
+ for (var a = Q(o), c = a.next(); !c.done; c = a.next()) {
96
+ var u = c.value;
97
+ u.remove(this);
98
98
  }
99
99
  } catch (p) {
100
100
  t = { error: p };
101
101
  } finally {
102
102
  try {
103
- c && !c.done && (e = u.return) && e.call(u);
103
+ c && !c.done && (e = a.return) && e.call(a);
104
104
  } finally {
105
105
  if (t)
106
106
  throw t.error;
@@ -124,7 +124,7 @@ var R = function() {
124
124
  try {
125
125
  se(j);
126
126
  } catch (p) {
127
- s = s ?? [], p instanceof D ? s = T(T([], _(s)), _(p.errors)) : s.push(p);
127
+ s = s ?? [], p instanceof D ? s = I(I([], T(s)), T(p.errors)) : s.push(p);
128
128
  }
129
129
  }
130
130
  } catch (p) {
@@ -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, T([n, t], _(e))) : setTimeout.apply(void 0, T([n, t], _(e)));
191
+ return i != null && i.setTimeout ? i.setTimeout.apply(i, I([n, t], T(e))) : setTimeout.apply(void 0, I([n, t], T(e)));
192
192
  },
193
193
  clearTimeout: function(n) {
194
194
  var t = Y.delegate;
@@ -203,7 +203,7 @@ function Oe(n) {
203
203
  }
204
204
  function oe() {
205
205
  }
206
- function L(n) {
206
+ function $(n) {
207
207
  n();
208
208
  }
209
209
  var ee = function(n) {
@@ -238,7 +238,7 @@ var ee = function(n) {
238
238
  }
239
239
  }, t;
240
240
  }(R), Le = Function.prototype.bind;
241
- function B(n, t) {
241
+ function q(n, t) {
242
242
  return Le.call(n, t);
243
243
  }
244
244
  var $e = function() {
@@ -251,7 +251,7 @@ var $e = function() {
251
251
  try {
252
252
  e.next(t);
253
253
  } catch (r) {
254
- I(r);
254
+ A(r);
255
255
  }
256
256
  }, n.prototype.error = function(t) {
257
257
  var e = this.partialObserver;
@@ -259,17 +259,17 @@ var $e = function() {
259
259
  try {
260
260
  e.error(t);
261
261
  } catch (r) {
262
- I(r);
262
+ A(r);
263
263
  }
264
264
  else
265
- I(t);
265
+ A(t);
266
266
  }, n.prototype.complete = function() {
267
267
  var t = this.partialObserver;
268
268
  if (t.complete)
269
269
  try {
270
270
  t.complete();
271
271
  } catch (e) {
272
- I(e);
272
+ A(e);
273
273
  }
274
274
  }, n;
275
275
  }(), k = function(n) {
@@ -283,20 +283,20 @@ var $e = function() {
283
283
  complete: i ?? void 0
284
284
  };
285
285
  else {
286
- var u;
287
- s && Se.useDeprecatedNextContext ? (u = Object.create(e), u.unsubscribe = function() {
286
+ var a;
287
+ s && Se.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
288
288
  return s.unsubscribe();
289
289
  }, o = {
290
- next: e.next && B(e.next, u),
291
- error: e.error && B(e.error, u),
292
- complete: e.complete && B(e.complete, u)
290
+ next: e.next && q(e.next, a),
291
+ error: e.error && q(e.error, a),
292
+ complete: e.complete && q(e.complete, a)
293
293
  }) : o = e;
294
294
  }
295
295
  return s.destination = new $e(o), s;
296
296
  }
297
297
  return t;
298
298
  }(ee);
299
- function I(n) {
299
+ function A(n) {
300
300
  Oe(n);
301
301
  }
302
302
  function Ue(n) {
@@ -313,7 +313,7 @@ var ke = {
313
313
  function Ee(n) {
314
314
  return n;
315
315
  }
316
- function Ne(n) {
316
+ function Ve(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);
@@ -329,9 +329,9 @@ var G = function() {
329
329
  return e.source = this, e.operator = t, e;
330
330
  }, n.prototype.subscribe = function(t, e, r) {
331
331
  var i = this, s = je(t) ? t : new k(t, e, r);
332
- return L(function() {
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));
332
+ return $(function() {
333
+ var o = i, a = o.operator, c = o.source;
334
+ s.add(a ? a.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
335
335
  }), s;
336
336
  }, n.prototype._trySubscribe = function(t) {
337
337
  try {
@@ -343,9 +343,9 @@ var G = function() {
343
343
  var r = this;
344
344
  return e = ce(e), new e(function(i, s) {
345
345
  var o = new k({
346
- next: function(u) {
346
+ next: function(a) {
347
347
  try {
348
- t(u);
348
+ t(a);
349
349
  } catch (c) {
350
350
  s(c), o.unsubscribe();
351
351
  }
@@ -363,7 +363,7 @@ var G = function() {
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 Ne(t)(this);
366
+ return Ve(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) {
@@ -384,11 +384,11 @@ function ce(n) {
384
384
  var t;
385
385
  return (t = n ?? Se.Promise) !== null && t !== void 0 ? t : Promise;
386
386
  }
387
- function Ve(n) {
387
+ function Ne(n) {
388
388
  return n && m(n.next) && m(n.error) && m(n.complete);
389
389
  }
390
390
  function je(n) {
391
- return n && n instanceof ee || Ve(n) && we(n);
391
+ return n && n instanceof ee || Ne(n) && we(n);
392
392
  }
393
393
  function De(n) {
394
394
  return m(n == null ? void 0 : n.lift);
@@ -407,21 +407,21 @@ function Ce(n) {
407
407
  };
408
408
  }
409
409
  function Me(n, t, e, r, i) {
410
- return new Be(n, t, e, r, i);
410
+ return new qe(n, t, e, r, i);
411
411
  }
412
- var Be = function(n) {
412
+ var qe = function(n) {
413
413
  M(t, n);
414
- function t(e, r, i, s, o, u) {
414
+ function t(e, r, i, s, o, a) {
415
415
  var c = n.call(this, e) || this;
416
- return c.onFinalize = o, c.shouldUnsubscribe = u, c._next = r ? function(a) {
416
+ return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
417
417
  try {
418
- r(a);
418
+ r(u);
419
419
  } catch (g) {
420
420
  e.error(g);
421
421
  }
422
- } : n.prototype._next, c._error = s ? function(a) {
422
+ } : n.prototype._next, c._error = s ? function(u) {
423
423
  try {
424
- s(a);
424
+ s(u);
425
425
  } catch (g) {
426
426
  e.error(g);
427
427
  } finally {
@@ -430,8 +430,8 @@ var Be = function(n) {
430
430
  } : n.prototype._error, c._complete = i ? function() {
431
431
  try {
432
432
  i();
433
- } catch (a) {
434
- e.error(a);
433
+ } catch (u) {
434
+ e.error(u);
435
435
  } finally {
436
436
  this.unsubscribe();
437
437
  }
@@ -444,7 +444,7 @@ var Be = function(n) {
444
444
  n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
445
445
  }
446
446
  }, t;
447
- }(ee), qe = Z(function(n) {
447
+ }(ee), Be = Z(function(n) {
448
448
  return function() {
449
449
  n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
450
450
  };
@@ -455,27 +455,27 @@ var Be = function(n) {
455
455
  return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
456
456
  }
457
457
  return t.prototype.lift = function(e) {
458
- var r = new ue(this, this);
458
+ var r = new ae(this, this);
459
459
  return r.operator = e, r;
460
460
  }, t.prototype._throwIfClosed = function() {
461
461
  if (this.closed)
462
- throw new qe();
462
+ throw new Be();
463
463
  }, t.prototype.next = function(e) {
464
464
  var r = this;
465
- L(function() {
465
+ $(function() {
466
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 o = Q(r.currentObservers), u = o.next(); !u.done; u = o.next()) {
471
- var c = u.value;
470
+ for (var o = Q(r.currentObservers), a = o.next(); !a.done; a = o.next()) {
471
+ var c = a.value;
472
472
  c.next(e);
473
473
  }
474
- } catch (a) {
475
- i = { error: a };
474
+ } catch (u) {
475
+ i = { error: u };
476
476
  } finally {
477
477
  try {
478
- u && !u.done && (s = o.return) && s.call(o);
478
+ a && !a.done && (s = o.return) && s.call(o);
479
479
  } finally {
480
480
  if (i)
481
481
  throw i.error;
@@ -485,7 +485,7 @@ var Be = function(n) {
485
485
  });
486
486
  }, t.prototype.error = function(e) {
487
487
  var r = this;
488
- L(function() {
488
+ $(function() {
489
489
  if (r._throwIfClosed(), !r.isStopped) {
490
490
  r.hasError = r.isStopped = !0, r.thrownError = e;
491
491
  for (var i = r.observers; i.length; )
@@ -494,7 +494,7 @@ var Be = function(n) {
494
494
  });
495
495
  }, t.prototype.complete = function() {
496
496
  var e = this;
497
- L(function() {
497
+ $(function() {
498
498
  if (e._throwIfClosed(), !e.isStopped) {
499
499
  e.isStopped = !0;
500
500
  for (var r = e.observers; r.length; )
@@ -515,9 +515,9 @@ 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, s = i.hasError, o = i.isStopped, u = i.observers;
519
- return s || o ? me : (this.currentObservers = null, u.push(e), new R(function() {
520
- r.currentObservers = null, U(u, e);
518
+ var r = this, i = this, s = i.hasError, o = i.isStopped, a = i.observers;
519
+ return s || o ? me : (this.currentObservers = null, a.push(e), new R(function() {
520
+ r.currentObservers = null, U(a, e);
521
521
  }));
522
522
  }, t.prototype._checkFinalizedStatuses = function(e) {
523
523
  var r = this, i = r.hasError, s = r.thrownError, o = r.isStopped;
@@ -526,9 +526,9 @@ var Be = function(n) {
526
526
  var e = new G();
527
527
  return e.source = this, e;
528
528
  }, t.create = function(e, r) {
529
- return new ue(e, r);
529
+ return new ae(e, r);
530
530
  }, t;
531
- }(G), ue = function(n) {
531
+ }(G), ae = function(n) {
532
532
  M(t, n);
533
533
  function t(e, r) {
534
534
  var i = n.call(this) || this;
@@ -565,7 +565,7 @@ var Be = function(n) {
565
565
  for (var e = [], r = 2; r < arguments.length; r++)
566
566
  e[r - 2] = arguments[r];
567
567
  var i = F.delegate;
568
- return i != null && i.setInterval ? i.setInterval.apply(i, T([n, t], _(e))) : setInterval.apply(void 0, T([n, t], _(e)));
568
+ return i != null && i.setInterval ? i.setInterval.apply(i, I([n, t], T(e))) : setInterval.apply(void 0, I([n, t], T(e)));
569
569
  },
570
570
  clearInterval: function(n) {
571
571
  var t = F.delegate;
@@ -614,7 +614,7 @@ var Be = function(n) {
614
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
- }(He), ae = function() {
617
+ }(He), ue = function() {
618
618
  function n(t, e) {
619
619
  e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
620
620
  }
@@ -624,7 +624,7 @@ var Be = function(n) {
624
624
  }(), Qe = function(n) {
625
625
  M(t, n);
626
626
  function t(e, r) {
627
- r === void 0 && (r = ae.now);
627
+ r === void 0 && (r = ue.now);
628
628
  var i = n.call(this, e, r) || this;
629
629
  return i.actions = [], i._active = !1, i;
630
630
  }
@@ -646,7 +646,7 @@ var Be = function(n) {
646
646
  throw i;
647
647
  }
648
648
  }, t;
649
- }(ae), Ye = new Qe(ze), Ge = Ye;
649
+ }(ue), Ye = new Qe(ze), Ge = Ye;
650
650
  function Je(n) {
651
651
  return n && m(n.schedule);
652
652
  }
@@ -673,7 +673,7 @@ function P(n, t) {
673
673
  function We(n) {
674
674
  return n instanceof Date && !isNaN(n);
675
675
  }
676
- function A(n, t) {
676
+ function O(n, t) {
677
677
  return Ce(function(e, r) {
678
678
  var i = 0;
679
679
  e.subscribe(Me(r, function(s) {
@@ -698,19 +698,19 @@ function Ze(n, t, e) {
698
698
  return r ? Ce(function(i, s) {
699
699
  var o;
700
700
  (o = r.subscribe) === null || o === void 0 || o.call(r);
701
- var u = !0;
701
+ var a = !0;
702
702
  i.subscribe(Me(s, function(c) {
703
- var a;
704
- (a = r.next) === null || a === void 0 || a.call(r, c), s.next(c);
703
+ var u;
704
+ (u = r.next) === null || u === void 0 || u.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), s.complete();
707
+ a = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
708
708
  }, function(c) {
709
- var a;
710
- u = !1, (a = r.error) === null || a === void 0 || a.call(r, c), s.error(c);
709
+ var u;
710
+ a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), s.error(c);
711
711
  }, function() {
712
- var c, a;
713
- u && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
712
+ var c, u;
713
+ a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
714
714
  }));
715
715
  }) : Ee;
716
716
  }
@@ -720,7 +720,7 @@ class l extends Error {
720
720
  super(`Incorrect context (${t}). Cannot perform the requested operation.`), C(this, "context"), this.context = t;
721
721
  }
722
722
  }
723
- class $ extends Error {
723
+ class _ extends Error {
724
724
  constructor(t, e, r) {
725
725
  super(`Invalid parameter (${t}). ${r}`), this.param = t, this.value = e, this.reason = r;
726
726
  }
@@ -754,7 +754,7 @@ function S(n) {
754
754
  function it(n) {
755
755
  return S(n == null ? void 0 : n.lift);
756
756
  }
757
- function N(n) {
757
+ function V(n) {
758
758
  return function(t) {
759
759
  if (it(t))
760
760
  return t.lift(function(e) {
@@ -804,8 +804,8 @@ function K(n, t) {
804
804
  try {
805
805
  for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
806
806
  s.push(i.value);
807
- } catch (u) {
808
- o = { error: u };
807
+ } catch (a) {
808
+ o = { error: a };
809
809
  } finally {
810
810
  try {
811
811
  i && !i.done && (e = r.return) && e.call(r);
@@ -828,7 +828,7 @@ function st(n) {
828
828
  }, e = n(t);
829
829
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
830
830
  }
831
- var q = st(function(n) {
831
+ var B = 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) {
@@ -855,15 +855,15 @@ var re = function() {
855
855
  if (o)
856
856
  if (this._parentage = null, Array.isArray(o))
857
857
  try {
858
- for (var u = de(o), c = u.next(); !c.done; c = u.next()) {
859
- var a = c.value;
860
- a.remove(this);
858
+ for (var a = de(o), c = a.next(); !c.done; c = a.next()) {
859
+ var u = c.value;
860
+ u.remove(this);
861
861
  }
862
862
  } catch (p) {
863
863
  t = { error: p };
864
864
  } finally {
865
865
  try {
866
- c && !c.done && (e = u.return) && e.call(u);
866
+ c && !c.done && (e = a.return) && e.call(a);
867
867
  } finally {
868
868
  if (t)
869
869
  throw t.error;
@@ -876,7 +876,7 @@ var re = function() {
876
876
  try {
877
877
  g();
878
878
  } catch (p) {
879
- s = p instanceof q ? p.errors : [p];
879
+ s = p instanceof B ? p.errors : [p];
880
880
  }
881
881
  var v = this._finalizers;
882
882
  if (v) {
@@ -887,7 +887,7 @@ var re = function() {
887
887
  try {
888
888
  fe(j);
889
889
  } catch (p) {
890
- s = s ?? [], p instanceof q ? s = W(W([], K(s)), K(p.errors)) : s.push(p);
890
+ s = s ?? [], p instanceof B ? s = W(W([], K(s)), K(p.errors)) : s.push(p);
891
891
  }
892
892
  }
893
893
  } catch (p) {
@@ -902,7 +902,7 @@ var re = function() {
902
902
  }
903
903
  }
904
904
  if (s)
905
- throw new q(s);
905
+ throw new B(s);
906
906
  }
907
907
  }, n.prototype.add = function(t) {
908
908
  var e;
@@ -941,7 +941,7 @@ function Te(n) {
941
941
  function fe(n) {
942
942
  S(n) ? n() : n.unsubscribe();
943
943
  }
944
- var Pe = {
944
+ var Ie = {
945
945
  onUnhandledError: null,
946
946
  onStoppedNotification: null,
947
947
  Promise: void 0,
@@ -965,7 +965,7 @@ function ct(n) {
965
965
  }
966
966
  function ge() {
967
967
  }
968
- function ut(n) {
968
+ function at(n) {
969
969
  n();
970
970
  }
971
971
  var ne = function(n) {
@@ -999,9 +999,9 @@ var ne = function(n) {
999
999
  this.unsubscribe();
1000
1000
  }
1001
1001
  }, t;
1002
- }(re), at = Function.prototype.bind;
1002
+ }(re), ut = Function.prototype.bind;
1003
1003
  function H(n, t) {
1004
- return at.call(n, t);
1004
+ return ut.call(n, t);
1005
1005
  }
1006
1006
  var lt = function() {
1007
1007
  function n(t) {
@@ -1013,7 +1013,7 @@ var lt = function() {
1013
1013
  try {
1014
1014
  e.next(t);
1015
1015
  } catch (r) {
1016
- O(r);
1016
+ L(r);
1017
1017
  }
1018
1018
  }, n.prototype.error = function(t) {
1019
1019
  var e = this.partialObserver;
@@ -1021,17 +1021,17 @@ var lt = function() {
1021
1021
  try {
1022
1022
  e.error(t);
1023
1023
  } catch (r) {
1024
- O(r);
1024
+ L(r);
1025
1025
  }
1026
1026
  else
1027
- O(t);
1027
+ L(t);
1028
1028
  }, n.prototype.complete = function() {
1029
1029
  var t = this.partialObserver;
1030
1030
  if (t.complete)
1031
1031
  try {
1032
1032
  t.complete();
1033
1033
  } catch (e) {
1034
- O(e);
1034
+ L(e);
1035
1035
  }
1036
1036
  }, n;
1037
1037
  }(), X = function(n) {
@@ -1045,20 +1045,20 @@ var lt = function() {
1045
1045
  complete: i ?? void 0
1046
1046
  };
1047
1047
  else {
1048
- var u;
1049
- s && Pe.useDeprecatedNextContext ? (u = Object.create(e), u.unsubscribe = function() {
1048
+ var a;
1049
+ s && Ie.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
1050
1050
  return s.unsubscribe();
1051
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)
1052
+ next: e.next && H(e.next, a),
1053
+ error: e.error && H(e.error, a),
1054
+ complete: e.complete && H(e.complete, a)
1055
1055
  }) : o = e;
1056
1056
  }
1057
1057
  return s.destination = new lt(o), s;
1058
1058
  }
1059
1059
  return t;
1060
1060
  }(ne);
1061
- function O(n) {
1061
+ function L(n) {
1062
1062
  ct(n);
1063
1063
  }
1064
1064
  function ht(n) {
@@ -1072,11 +1072,11 @@ var dt = {
1072
1072
  }, pt = function() {
1073
1073
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
1074
1074
  }();
1075
- function Re(n) {
1075
+ function Pe(n) {
1076
1076
  return n;
1077
1077
  }
1078
1078
  function ft(n) {
1079
- return n.length === 0 ? Re : n.length === 1 ? n[0] : function(t) {
1079
+ return n.length === 0 ? Pe : n.length === 1 ? n[0] : function(t) {
1080
1080
  return n.reduce(function(e, r) {
1081
1081
  return r(e);
1082
1082
  }, t);
@@ -1091,9 +1091,9 @@ var gt = function() {
1091
1091
  return e.source = this, e.operator = t, e;
1092
1092
  }, n.prototype.subscribe = function(t, e, r) {
1093
1093
  var i = this, s = yt(t) ? t : new X(t, e, r);
1094
- return ut(function() {
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));
1094
+ return at(function() {
1095
+ var o = i, a = o.operator, c = o.source;
1096
+ s.add(a ? a.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
1097
1097
  }), s;
1098
1098
  }, n.prototype._trySubscribe = function(t) {
1099
1099
  try {
@@ -1105,9 +1105,9 @@ var gt = function() {
1105
1105
  var r = this;
1106
1106
  return e = ve(e), new e(function(i, s) {
1107
1107
  var o = new X({
1108
- next: function(u) {
1108
+ next: function(a) {
1109
1109
  try {
1110
- t(u);
1110
+ t(a);
1111
1111
  } catch (c) {
1112
1112
  s(c), o.unsubscribe();
1113
1113
  }
@@ -1144,7 +1144,7 @@ var gt = function() {
1144
1144
  }();
1145
1145
  function ve(n) {
1146
1146
  var t;
1147
- return (t = n ?? Pe.Promise) !== null && t !== void 0 ? t : Promise;
1147
+ return (t = n ?? Ie.Promise) !== null && t !== void 0 ? t : Promise;
1148
1148
  }
1149
1149
  function vt(n) {
1150
1150
  return n && S(n.next) && S(n.error) && S(n.complete);
@@ -1152,22 +1152,22 @@ function vt(n) {
1152
1152
  function yt(n) {
1153
1153
  return n && n instanceof ne || vt(n) && Te(n);
1154
1154
  }
1155
- function V(n, t, e, r, i) {
1155
+ function N(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, s, o, u) {
1160
+ function t(e, r, i, s, o, a) {
1161
1161
  var c = n.call(this, e) || this;
1162
- return c.onFinalize = o, c.shouldUnsubscribe = u, c._next = r ? function(a) {
1162
+ return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
1163
1163
  try {
1164
- r(a);
1164
+ r(u);
1165
1165
  } catch (g) {
1166
1166
  e.error(g);
1167
1167
  }
1168
- } : n.prototype._next, c._error = s ? function(a) {
1168
+ } : n.prototype._next, c._error = s ? function(u) {
1169
1169
  try {
1170
- s(a);
1170
+ s(u);
1171
1171
  } catch (g) {
1172
1172
  e.error(g);
1173
1173
  } finally {
@@ -1176,8 +1176,8 @@ var bt = function(n) {
1176
1176
  } : n.prototype._error, c._complete = i ? function() {
1177
1177
  try {
1178
1178
  i();
1179
- } catch (a) {
1180
- e.error(a);
1179
+ } catch (u) {
1180
+ e.error(u);
1181
1181
  } finally {
1182
1182
  this.unsubscribe();
1183
1183
  }
@@ -1192,9 +1192,9 @@ var bt = function(n) {
1192
1192
  }, t;
1193
1193
  }(ne);
1194
1194
  function h(n, t) {
1195
- return N(function(e, r) {
1195
+ return V(function(e, r) {
1196
1196
  var i = 0;
1197
- e.subscribe(V(r, function(s) {
1197
+ e.subscribe(N(r, function(s) {
1198
1198
  r.next(n.call(t, s, i++));
1199
1199
  }));
1200
1200
  });
@@ -1205,41 +1205,41 @@ var mt = new gt(function(n) {
1205
1205
  function y(n) {
1206
1206
  return n <= 0 ? function() {
1207
1207
  return mt;
1208
- } : N(function(t, e) {
1208
+ } : V(function(t, e) {
1209
1209
  var r = 0;
1210
- t.subscribe(V(e, function(i) {
1210
+ t.subscribe(N(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 N(function(e, r) {
1216
+ return V(function(e, r) {
1217
1217
  var i = 0;
1218
- e.subscribe(V(r, function(s) {
1218
+ e.subscribe(N(r, function(s) {
1219
1219
  return n.call(t, s, i++) && r.next(s);
1220
1220
  }));
1221
1221
  });
1222
1222
  }
1223
1223
  function d(n, t, e) {
1224
1224
  var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
1225
- return r ? N(function(i, s) {
1225
+ return r ? V(function(i, s) {
1226
1226
  var o;
1227
1227
  (o = r.subscribe) === null || o === void 0 || o.call(r);
1228
- var u = !0;
1229
- i.subscribe(V(s, function(c) {
1230
- var a;
1231
- (a = r.next) === null || a === void 0 || a.call(r, c), s.next(c);
1228
+ var a = !0;
1229
+ i.subscribe(N(s, function(c) {
1230
+ var u;
1231
+ (u = r.next) === null || u === void 0 || u.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), s.complete();
1234
+ a = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
1235
1235
  }, function(c) {
1236
- var a;
1237
- u = !1, (a = r.error) === null || a === void 0 || a.call(r, c), s.error(c);
1236
+ var u;
1237
+ a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), s.error(c);
1238
1238
  }, function() {
1239
- var c, a;
1240
- u && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
1239
+ var c, u;
1240
+ a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
1241
1241
  }));
1242
- }) : Re;
1242
+ }) : Pe;
1243
1243
  }
1244
1244
  const wt = /^(\d+)\.(\d+)$/;
1245
1245
  function St(n) {
@@ -1389,11 +1389,11 @@ class Mt {
1389
1389
  displayName: i,
1390
1390
  jwtToken: s,
1391
1391
  serverUrl: o,
1392
- region: u,
1392
+ region: a,
1393
1393
  joinMicMuted: c,
1394
- joinWithoutCamera: a
1394
+ joinWithoutCamera: u
1395
1395
  } = t, g = "JOINING ROOM", v = this.createMessage(g, !1);
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);
1396
+ v.roomName = e, v.jwtToken = s, v.serverUrl = o, v.region = a, v.roomInvite = r, v.joinMicMuted = c ?? !1, v.joinWithoutCamera = u ?? !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.
@@ -1553,10 +1553,10 @@ class Mt {
1553
1553
  const i = "LAYOUT CHANGE";
1554
1554
  let s, o;
1555
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
- h((u) => u),
1556
+ f((a) => a.type === i && a.replyTo === s.id),
1557
+ h((a) => a),
1558
1558
  d(this.logReceived(i)),
1559
- h((u) => u),
1559
+ h((a) => a),
1560
1560
  y(1)
1561
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
1562
  return o;
@@ -1627,32 +1627,32 @@ class Mt {
1627
1627
  if (!this.isEmbedded())
1628
1628
  throw new l(this.currentContext);
1629
1629
  if (e === "group" && i === void 0)
1630
- throw new $(
1630
+ throw new _(
1631
1631
  "currentContacts",
1632
1632
  i,
1633
1633
  "currentContacts is required for group streams"
1634
1634
  );
1635
1635
  if (e === "direct" && i !== void 0)
1636
- throw new $(
1636
+ throw new _(
1637
1637
  "currentContacts",
1638
1638
  i,
1639
1639
  "currentContacts should not be passed for direct streams"
1640
1640
  );
1641
1641
  const s = "SELECT CONTACTS", o = this.createMessage(s, !0);
1642
1642
  o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = i, this.logCreated(s, o);
1643
- const u = this.incomingMessages$.pipe(
1643
+ const a = this.incomingMessages$.pipe(
1644
1644
  f((c) => c.type === s && c.replyTo === o.id),
1645
1645
  d(this.logReceived(s)),
1646
1646
  // validate if `streamId` is the same as we sent
1647
1647
  h((c) => {
1648
- const a = c;
1649
- if (a.streamId !== t)
1650
- throw new rt(a.streamId, t);
1651
- return e === "direct" && a.contacts.length > 1 && (a.contacts = [a.contacts[0]]), a;
1648
+ const u = c;
1649
+ if (u.streamId !== t)
1650
+ throw new rt(u.streamId, t);
1651
+ return e === "direct" && u.contacts.length > 1 && (u.contacts = [u.contacts[0]]), u;
1652
1652
  }),
1653
1653
  y(1)
1654
1654
  );
1655
- return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), u;
1655
+ return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), a;
1656
1656
  }
1657
1657
  /**
1658
1658
  * Request detailed contact information for the given Cloud usernames.
@@ -1666,7 +1666,7 @@ class Mt {
1666
1666
  if (!this.isEmbedded())
1667
1667
  throw new l(this.currentContext);
1668
1668
  if (!t.length)
1669
- throw new $("contacts", t, "At least one contact is required");
1669
+ throw new _("contacts", t, "At least one contact is required");
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(
@@ -1922,22 +1922,35 @@ class Mt {
1922
1922
  * integrity.
1923
1923
  *
1924
1924
  * @param payload - The {@link FileTransferPayload} to send to the host app.
1925
+ * @param intent - _Optional_. The intent of the file transfer. Can be either `attachment` or
1926
+ * `general`. Defaults to `attachment`.
1927
+ * @param streamId - _Optional_. The ID of the message stream to which the files will be attached
1928
+ * to. Only used if `intent` is set to `attachment`.
1925
1929
  * @param shouldOpen - _Optional_. Whether the file should be opened after it's transferred.
1926
1930
  *
1927
1931
  * @returns This method returns void.
1928
1932
  */
1929
- sendFileTransferMessage(t, e) {
1933
+ sendFileTransferMessage(t, e = "attachment", r, i) {
1930
1934
  if (!this.isEmbedded())
1931
1935
  throw new l(this.currentContext);
1932
- const r = "FILE TRANSFER", i = this.createMessage(r, !1);
1933
- i.mimeType = t.mimeType, i.fileName = t.fileName, i.fileSize = t.fileSize, i.fileHash = t.fileHash, i.dataType = t.dataType, i.data = t.data, e && (i.shouldOpen = e), this.logCreated(r, i);
1934
- const s = this.incomingMessages$.pipe(
1935
- f((o) => o.type === r && o.replyTo === i.id),
1936
- d(this.logReceived(r)),
1937
- h((o) => o),
1936
+ const s = "FILE TRANSFER", o = this.createMessage(s, !1);
1937
+ if (o.mimeType = t.mimeType, o.fileName = t.fileName, o.fileSize = t.fileSize, o.fileHash = t.fileHash, o.dataType = t.dataType, o.data = t.data, o.intent = e, e === "attachment") {
1938
+ if (!r)
1939
+ throw new _(
1940
+ "streamId",
1941
+ r,
1942
+ "streamId is required for attachment intent"
1943
+ );
1944
+ o.streamId = r;
1945
+ }
1946
+ i && (o.shouldOpen = i), this.logCreated(s, o);
1947
+ const a = this.incomingMessages$.pipe(
1948
+ f((c) => c.type === s && c.replyTo === o.id),
1949
+ d(this.logReceived(s)),
1950
+ h((c) => c),
1938
1951
  y(1)
1939
1952
  );
1940
- return this.port2.postMessage(i), this.logSent(r, i), s;
1953
+ return this.port2.postMessage(o), this.logSent(s, o), a;
1941
1954
  }
1942
1955
  /**
1943
1956
  * Send a {@link FileTransferMessageReply} to the `Host` app, to reply to a
@@ -1988,24 +2001,37 @@ class Mt {
1988
2001
  * The file identifiers can be used to corelate files being transferred via the
1989
2002
  * {@link FileTransferMessage} afterwards.
1990
2003
  *
2004
+ * @param intent - _Optional_. The intent of the file selection. Can be either `attachment` or
2005
+ * `general`. Defaults to `attachment`.
2006
+ * @param streamId - _Optional_. The ID of the message stream to which the files will be attached
2007
+ * to. Only used if `intent` is set to `attachment`.
1991
2008
  * @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to
1992
2009
  * unlimited.
1993
2010
  * @param mimeTypes - _Optional_. The MIME type of the files to select. Defaults to `*\/*`.
1994
2011
  *
1995
2012
  * @returns This method returns void.
1996
2013
  */
1997
- sendFileSelectionMessage(t, e) {
2014
+ sendFileSelectionMessage(t = "attachment", e, r, i) {
1998
2015
  if (!this.isEmbedded())
1999
2016
  throw new l(this.currentContext);
2000
- const r = "FILE SELECTION", i = this.createMessage(r);
2001
- i.maxCount = t, i.mimeTypes = e, this.logCreated(r, i);
2002
- const s = this.incomingMessages$.pipe(
2003
- f((o) => o.type === r && o.replyTo === i.id),
2004
- d(this.logReceived(r)),
2005
- h((o) => o),
2017
+ const s = "FILE SELECTION", o = this.createMessage(s);
2018
+ if (o.intent = t, o.maxCount = r, o.mimeTypes = i, t === "attachment") {
2019
+ if (!e)
2020
+ throw new _(
2021
+ "streamId",
2022
+ e,
2023
+ "streamId is required for attachment intent"
2024
+ );
2025
+ o.streamId = e;
2026
+ }
2027
+ this.logCreated(s, o);
2028
+ const a = this.incomingMessages$.pipe(
2029
+ f((c) => c.type === s && c.replyTo === o.id),
2030
+ d(this.logReceived(s)),
2031
+ h((c) => c),
2006
2032
  y(1)
2007
2033
  );
2008
- return this.port2.postMessage(i), this.logSent(r, i), s;
2034
+ return this.port2.postMessage(o), this.logSent(s, o), a;
2009
2035
  }
2010
2036
  /**
2011
2037
  * Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
@@ -2029,13 +2055,13 @@ class Mt {
2029
2055
  throw new l(this.currentContext);
2030
2056
  const s = "FILE DOWNLOAD", o = this.createMessage(s);
2031
2057
  o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
2032
- const u = this.incomingMessages$.pipe(
2058
+ const a = this.incomingMessages$.pipe(
2033
2059
  f((c) => c.type === s && c.replyTo === o.id),
2034
2060
  d(this.logReceived(s)),
2035
2061
  h((c) => c),
2036
2062
  y(1)
2037
2063
  );
2038
- return this.port2.postMessage(o), this.logSent(s, o), u;
2064
+ return this.port2.postMessage(o), this.logSent(s, o), a;
2039
2065
  }
2040
2066
  sendFileUploadMessage() {
2041
2067
  throw new Error("Not implemented");
@@ -2064,32 +2090,32 @@ class Mt {
2064
2090
  return this.port2.postMessage(r), this.logSent(e, r), i;
2065
2091
  }
2066
2092
  /**
2067
- * Sends a {@link FileReferenceMessage} to the Host app, to request a reference to a file from
2068
- * the device's storage.
2093
+ * Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
2094
+ * device's storage.
2069
2095
  *
2070
2096
  * @remarks
2071
2097
  * The file is identified by it's SHA256 hash. The Host app would reply with a
2072
- * {@link FileReferenceMessageReply} containing a generated identifier of the file. In case the
2073
- * file is not found, the `fileId` property would be set to `null` or `undefined`.
2098
+ * {@link FileRemoveMessageReply} containing the result of the request. In case the
2099
+ * file is not found, the `host` app should reply with `success` as well.
2074
2100
  *
2075
2101
  * @param hash - An SHA256 hash of the file
2076
- * @param mimeType - The MIME type of the file
2077
- * @param name - The name of the file
2078
- * @returns An observable which emits a {@link FileReferenceMessageReply} instance containing the
2079
- * `fileId` of the file. Emits once.
2102
+ * @param streamId - _Optional_. The ID of the message stream from which the file is removed from.
2103
+ *
2104
+ * @returns An observable which emits a {@link FileRemoveMessageReply} with the result of the
2105
+ * request. Emits once.
2080
2106
  */
2081
- sendFileReferenceMessage(t, e, r) {
2107
+ sendFileRemoveMessage(t, e) {
2082
2108
  if (!this.isEmbedded())
2083
2109
  throw new l(this.currentContext);
2084
- const i = "FILE REFERENCE", s = this.createMessage(i, !0);
2085
- s.hash = t, s.mimeType = e, s.name = r, this.logCreated(i, s);
2086
- const o = this.incomingMessages$.pipe(
2087
- f((u) => u.type === i && u.replyTo === s.id),
2088
- d(this.logReceived(i)),
2089
- h((u) => u),
2110
+ const r = "FILE REMOVE", i = this.createMessage(r, !0);
2111
+ i.hash = t, i.streamId = e, this.logCreated(r, i);
2112
+ const s = this.incomingMessages$.pipe(
2113
+ f((o) => o.type === r && o.replyTo === i.id),
2114
+ d(this.logReceived(r)),
2115
+ h((o) => o),
2090
2116
  y(1)
2091
2117
  );
2092
- return this.port2.postMessage(s), this.logSent(i, s), o;
2118
+ return this.port2.postMessage(i), this.logSent(r, i), s;
2093
2119
  }
2094
2120
  /**
2095
2121
  * Sends a {@link AppResetMessage} to the Host app, to request logging out the user and resetting
@@ -2110,6 +2136,26 @@ class Mt {
2110
2136
  const t = "APP RESET", e = this.createMessage(t, !1);
2111
2137
  this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);
2112
2138
  }
2139
+ /**
2140
+ * Sends a {@link MessageSentMessage} to the Host app, to notify it of a message that has been
2141
+ * sent to the specified stream along with any attachments.
2142
+ *
2143
+ * @remarks
2144
+ * The number of items in the `attachments` array should be equal to the number of files sent
2145
+ * with the message. If no files were sent, the `attachments` array should be undefined or empty.
2146
+ *
2147
+ * @param streamId - ID of the stream the message was sent to.
2148
+ * @param attachments - _Optional_. A list of file hashes of the attachments sent with the
2149
+ * message.
2150
+ *
2151
+ * @returns This method returns void.
2152
+ */
2153
+ sendMessageSentMessage(t, e) {
2154
+ if (!this.isEmbedded())
2155
+ throw new l(this.currentContext);
2156
+ const r = "MESSAGE SENT", i = this.createMessage(r, !1);
2157
+ i.streamId = t, i.attachments = e ?? [], this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
2158
+ }
2113
2159
  /**
2114
2160
  * Checks if the client app is either embedded in an iframe or in a native webview.
2115
2161
  *
@@ -2272,7 +2318,7 @@ class Tt {
2272
2318
  i(e.pushToken, e.appId, e.selector, e.expiry);
2273
2319
  }), this.cloudId = t.cloudId, this.host = t.host;
2274
2320
  }),
2275
- A(() => {
2321
+ O(() => {
2276
2322
  })
2277
2323
  )
2278
2324
  );
@@ -2282,7 +2328,7 @@ class Tt {
2282
2328
  let s;
2283
2329
  if (e === "multi") {
2284
2330
  if (!r || !Array.isArray(r))
2285
- throw new $(
2331
+ throw new _(
2286
2332
  "currentContacts",
2287
2333
  r,
2288
2334
  "currentContacts is required for group streams"
@@ -2295,7 +2341,7 @@ class Tt {
2295
2341
  );
2296
2342
  } else
2297
2343
  r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
2298
- return P(s.pipe(A((o) => o.contacts)));
2344
+ return P(s.pipe(O((o) => o.contacts)));
2299
2345
  }
2300
2346
  /**
2301
2347
  * Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
@@ -2307,7 +2353,7 @@ class Tt {
2307
2353
  * Host's contact list.
2308
2354
  */
2309
2355
  matchContacts(t) {
2310
- return this.logger.debug("Match Contacts: ", t), P(this.helper.matchContacts(t).pipe(A((e) => e.contacts)));
2356
+ return this.logger.debug("Match Contacts: ", t), P(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
2311
2357
  }
2312
2358
  /**
2313
2359
  * Requests the `Host` app to provide the Push Token for the current device.
@@ -2315,7 +2361,7 @@ class Tt {
2315
2361
  * @returns A promise with the Push Token as `string`.
2316
2362
  */
2317
2363
  requestPushToken() {
2318
- return this.logger.debug("Requesting Push Token"), P(this.helper.requestPushToken().pipe(A((t) => t.pushToken)));
2364
+ return this.logger.debug("Requesting Push Token"), P(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
2319
2365
  }
2320
2366
  /**
2321
2367
  * Sends the current badge count to the `Host` app.