@sendity/client 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,10 +105,12 @@ const pt = `<template id="sendity-tpl">
105
105
  --sendity-radius: 1rem; /* 16 — radius-xl */
106
106
  --sendity-surface: #ffffff;
107
107
  --sendity-shadow: 0 12px 28px -6px rgb(28 25 23 / 0.14), 0 6px 12px -6px rgb(28 25 23 / 0.08);
108
- --sendity-shadow-accent: 0 8px 24px -6px rgb(16 185 129 / 0.35);
108
+ --sendity-shadow-success: 0 0 0 1px rgb(16 185 129 / 0.18), 0 18px 46px -18px rgb(16 185 129 / 0.78);
109
+ --sendity-shadow-error: 0 0 0 1px rgb(244 63 94 / 0.18), 0 18px 46px -18px rgb(244 63 94 / 0.78);
109
110
 
110
111
  /* Card layout */
111
112
  --sendity-width: 320px;
113
+ --sendity-body-min-height: 11.875rem;
112
114
  --sendity-crossfade-duration: 220ms;
113
115
 
114
116
  color-scheme: light;
@@ -130,8 +132,12 @@ const pt = `<template id="sendity-tpl">
130
132
  transition: box-shadow .35s ease;
131
133
  }
132
134
 
133
- .sendity:has(.code--verified) {
134
- box-shadow: var(--sendity-shadow-accent), var(--sendity-shadow);
135
+ .sendity.sendity--verified {
136
+ box-shadow: var(--sendity-shadow-success), var(--sendity-shadow);
137
+ }
138
+
139
+ .sendity.sendity--expired {
140
+ box-shadow: var(--sendity-shadow-error), var(--sendity-shadow);
135
141
  }
136
142
 
137
143
  .sendity-body {
@@ -139,6 +145,7 @@ const pt = `<template id="sendity-tpl">
139
145
  flex: 1;
140
146
  display: flex;
141
147
  flex-direction: column;
148
+ min-height: var(--sendity-body-min-height);
142
149
  padding: 1.25rem 1.25rem 1rem;
143
150
  gap: 0.875rem;
144
151
  }
@@ -293,15 +300,26 @@ const pt = `<template id="sendity-tpl">
293
300
  .sendity .verifiers a.chan .icon svg,
294
301
  .sendity .verifiers button.chan .icon svg { width: 100%; height: 100%; display: block; }
295
302
 
296
- .sendity .verifiers button.chan.primary {
303
+ .sendity .verifiers button.chan.primary,
304
+ .sendity .verifiers button.chan.error {
297
305
  width: 100%;
298
306
  color: #ffffff;
307
+ }
308
+
309
+ .sendity .verifiers button.chan.primary {
299
310
  background: var(--sendity-primary-color);
300
311
  border-color: var(--sendity-primary-color);
301
312
  }
302
313
  .sendity .verifiers button.chan.primary:hover { background: var(--sendity-primary-hover); border-color: var(--sendity-primary-hover); }
303
314
  .sendity .verifiers button.chan.primary:disabled { opacity: 0.7; cursor: wait; }
304
315
 
316
+ .sendity .verifiers button.chan.error {
317
+ background: var(--sendity-error-color);
318
+ border-color: var(--sendity-error-color);
319
+ }
320
+ .sendity .verifiers button.chan.error:hover { background: var(--sendity-error-fg); border-color: var(--sendity-error-fg); }
321
+ .sendity .verifiers button.chan.error:disabled { opacity: 0.7; cursor: wait; }
322
+
305
323
  .sendity .verifiers a.chan.email {
306
324
  color: var(--sendity-email-fg);
307
325
  background: var(--sendity-email-bg);
@@ -518,7 +536,10 @@ const pt = `<template id="sendity-tpl">
518
536
  height: 0.5rem;
519
537
  border-radius: 999px;
520
538
  background: var(--sendity-primary-color);
539
+ color: var(--sendity-error-color);
521
540
  position: relative;
541
+ display: inline-grid;
542
+ place-items: center;
522
543
  flex: none;
523
544
  }
524
545
  .sendity .footer-spinner::after {
@@ -531,6 +552,21 @@ const pt = `<template id="sendity-tpl">
531
552
  animation: sendity-pulse 1.6s ease-out infinite;
532
553
  }
533
554
 
555
+ .sendity .footer-indicator--error {
556
+ width: 1rem;
557
+ height: 1rem;
558
+ background: transparent;
559
+ }
560
+ .sendity .footer-indicator--error::after {
561
+ content: none;
562
+ animation: none;
563
+ }
564
+ .sendity .footer-indicator--error svg {
565
+ width: 1rem;
566
+ height: 1rem;
567
+ display: block;
568
+ }
569
+
534
570
  @keyframes sendity-pulse { to { transform: scale(2.4); opacity: 0; } }
535
571
 
536
572
  /* Inherit dark surfaces when consumer page enables a dark theme on the host. */
@@ -561,6 +597,8 @@ const pt = `<template id="sendity-tpl">
561
597
  --sendity-whatsapp-bg-hover: rgb(16 185 129 / 0.26);
562
598
  --sendity-btn-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.06), 0 1px 2px 0 rgb(0 0 0 / 0.4);
563
599
  --sendity-shadow: 0 12px 28px -6px rgb(0 0 0 / 0.55), 0 6px 12px -6px rgb(0 0 0 / 0.4);
600
+ --sendity-shadow-success: 0 0 0 1px rgb(16 185 129 / 0.24), 0 18px 46px -18px rgb(16 185 129 / 0.9);
601
+ --sendity-shadow-error: 0 0 0 1px rgb(244 63 94 / 0.24), 0 18px 46px -18px rgb(244 63 94 / 0.9);
564
602
  }
565
603
  `;
566
604
  class qe {
@@ -654,8 +692,8 @@ class Ue extends qe {
654
692
  let h = String(this.options.namespace ?? "").replace(
655
693
  /\./g,
656
694
  "\\"
657
- ), u = s.startsWith(h) ? s.substring(h.length + 1) : "." + s;
658
- i(u, a);
695
+ ), d = s.startsWith(h) ? s.substring(h.length + 1) : "." + s;
696
+ i(d, a);
659
697
  }), this;
660
698
  }
661
699
  /**
@@ -809,7 +847,7 @@ class Tt extends qe {
809
847
  */
810
848
  on(i, s) {
811
849
  return this.listeners[i] = this.listeners[i] || [], this.events[i] || (this.events[i] = (a, h) => {
812
- this.name === a && this.listeners[i] && this.listeners[i].forEach((u) => u(h));
850
+ this.name === a && this.listeners[i] && this.listeners[i].forEach((d) => d(h));
813
851
  }, this.socket.on(i, this.events[i])), this.listeners[i].push(s), this;
814
852
  }
815
853
  /**
@@ -927,7 +965,7 @@ class ge extends qe {
927
965
  return this;
928
966
  }
929
967
  }
930
- class _t extends ge {
968
+ class Et extends ge {
931
969
  /**
932
970
  * Send a whisper event to other clients in the channel.
933
971
  */
@@ -943,7 +981,7 @@ class Bi extends ge {
943
981
  return this;
944
982
  }
945
983
  }
946
- class $i extends _t {
984
+ class $i extends Et {
947
985
  /**
948
986
  * Register a callback to be called anytime the member list changes.
949
987
  */
@@ -969,7 +1007,7 @@ class $i extends _t {
969
1007
  return this;
970
1008
  }
971
1009
  }
972
- const Et = class kt {
1010
+ const _t = class kt {
973
1011
  /**
974
1012
  * Create a new class instance.
975
1013
  */
@@ -996,7 +1034,7 @@ const Et = class kt {
996
1034
  return typeof window < "u" && (i = window.Laravel) != null && i.csrfToken ? window.Laravel.csrfToken : this.options.csrfToken ? this.options.csrfToken : typeof document < "u" && typeof document.querySelector == "function" ? ((s = document.querySelector('meta[name="csrf-token"]')) == null ? void 0 : s.getAttribute("content")) ?? null : null;
997
1035
  }
998
1036
  };
999
- Et._defaultOptions = {
1037
+ _t._defaultOptions = {
1000
1038
  auth: {
1001
1039
  headers: {}
1002
1040
  },
@@ -1011,7 +1049,7 @@ Et._defaultOptions = {
1011
1049
  key: null,
1012
1050
  namespace: "App.Events"
1013
1051
  };
1014
- let Ne = Et;
1052
+ let Ne = _t;
1015
1053
  class fe extends Ne {
1016
1054
  constructor() {
1017
1055
  super(...arguments), this.channels = {};
@@ -1296,7 +1334,7 @@ class mt extends Ne {
1296
1334
  * Get a private channel instance by name.
1297
1335
  */
1298
1336
  privateChannel(i) {
1299
- return new _t();
1337
+ return new Et();
1300
1338
  }
1301
1339
  /**
1302
1340
  * Get a private encrypted channel instance by name.
@@ -1506,7 +1544,7 @@ class Vi {
1506
1544
  function Ji(v) {
1507
1545
  return v && v.__esModule && Object.prototype.hasOwnProperty.call(v, "default") ? v.default : v;
1508
1546
  }
1509
- var Le = { exports: {} };
1547
+ var Pe = { exports: {} };
1510
1548
  var gt;
1511
1549
  function Gi() {
1512
1550
  return gt || (gt = 1, (function(v, i) {
@@ -1518,66 +1556,66 @@ function Gi() {
1518
1556
  var s = {
1519
1557
  /***/
1520
1558
  594(m, g) {
1521
- var b = this && this.__extends || /* @__PURE__ */ (function() {
1522
- var x = function(d, f) {
1523
- return x = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(S, P) {
1524
- S.__proto__ = P;
1525
- } || function(S, P) {
1526
- for (var q in P) P.hasOwnProperty(q) && (S[q] = P[q]);
1527
- }, x(d, f);
1559
+ var y = this && this.__extends || /* @__PURE__ */ (function() {
1560
+ var x = function(u, f) {
1561
+ return x = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(S, L) {
1562
+ S.__proto__ = L;
1563
+ } || function(S, L) {
1564
+ for (var q in L) L.hasOwnProperty(q) && (S[q] = L[q]);
1565
+ }, x(u, f);
1528
1566
  };
1529
- return function(d, f) {
1530
- x(d, f);
1567
+ return function(u, f) {
1568
+ x(u, f);
1531
1569
  function S() {
1532
- this.constructor = d;
1570
+ this.constructor = u;
1533
1571
  }
1534
- d.prototype = f === null ? Object.create(f) : (S.prototype = f.prototype, new S());
1572
+ u.prototype = f === null ? Object.create(f) : (S.prototype = f.prototype, new S());
1535
1573
  };
1536
1574
  })();
1537
1575
  Object.defineProperty(g, "__esModule", { value: !0 });
1538
- var _ = 256, w = (
1576
+ var E = 256, w = (
1539
1577
  /** @class */
1540
1578
  (function() {
1541
- function x(d) {
1542
- d === void 0 && (d = "="), this._paddingCharacter = d;
1579
+ function x(u) {
1580
+ u === void 0 && (u = "="), this._paddingCharacter = u;
1543
1581
  }
1544
- return x.prototype.encodedLength = function(d) {
1545
- return this._paddingCharacter ? (d + 2) / 3 * 4 | 0 : (d * 8 + 5) / 6 | 0;
1546
- }, x.prototype.encode = function(d) {
1547
- for (var f = "", S = 0; S < d.length - 2; S += 3) {
1548
- var P = d[S] << 16 | d[S + 1] << 8 | d[S + 2];
1549
- f += this._encodeByte(P >>> 18 & 63), f += this._encodeByte(P >>> 12 & 63), f += this._encodeByte(P >>> 6 & 63), f += this._encodeByte(P >>> 0 & 63);
1582
+ return x.prototype.encodedLength = function(u) {
1583
+ return this._paddingCharacter ? (u + 2) / 3 * 4 | 0 : (u * 8 + 5) / 6 | 0;
1584
+ }, x.prototype.encode = function(u) {
1585
+ for (var f = "", S = 0; S < u.length - 2; S += 3) {
1586
+ var L = u[S] << 16 | u[S + 1] << 8 | u[S + 2];
1587
+ f += this._encodeByte(L >>> 18 & 63), f += this._encodeByte(L >>> 12 & 63), f += this._encodeByte(L >>> 6 & 63), f += this._encodeByte(L >>> 0 & 63);
1550
1588
  }
1551
- var q = d.length - S;
1589
+ var q = u.length - S;
1552
1590
  if (q > 0) {
1553
- var P = d[S] << 16 | (q === 2 ? d[S + 1] << 8 : 0);
1554
- f += this._encodeByte(P >>> 18 & 63), f += this._encodeByte(P >>> 12 & 63), q === 2 ? f += this._encodeByte(P >>> 6 & 63) : f += this._paddingCharacter || "", f += this._paddingCharacter || "";
1591
+ var L = u[S] << 16 | (q === 2 ? u[S + 1] << 8 : 0);
1592
+ f += this._encodeByte(L >>> 18 & 63), f += this._encodeByte(L >>> 12 & 63), q === 2 ? f += this._encodeByte(L >>> 6 & 63) : f += this._paddingCharacter || "", f += this._paddingCharacter || "";
1555
1593
  }
1556
1594
  return f;
1557
- }, x.prototype.maxDecodedLength = function(d) {
1558
- return this._paddingCharacter ? d / 4 * 3 | 0 : (d * 6 + 7) / 8 | 0;
1559
- }, x.prototype.decodedLength = function(d) {
1560
- return this.maxDecodedLength(d.length - this._getPaddingLength(d));
1561
- }, x.prototype.decode = function(d) {
1562
- if (d.length === 0)
1595
+ }, x.prototype.maxDecodedLength = function(u) {
1596
+ return this._paddingCharacter ? u / 4 * 3 | 0 : (u * 6 + 7) / 8 | 0;
1597
+ }, x.prototype.decodedLength = function(u) {
1598
+ return this.maxDecodedLength(u.length - this._getPaddingLength(u));
1599
+ }, x.prototype.decode = function(u) {
1600
+ if (u.length === 0)
1563
1601
  return new Uint8Array(0);
1564
- for (var f = this._getPaddingLength(d), S = d.length - f, P = new Uint8Array(this.maxDecodedLength(S)), q = 0, j = 0, z = 0, J = 0, D = 0, H = 0, G = 0; j < S - 4; j += 4)
1565
- J = this._decodeChar(d.charCodeAt(j + 0)), D = this._decodeChar(d.charCodeAt(j + 1)), H = this._decodeChar(d.charCodeAt(j + 2)), G = this._decodeChar(d.charCodeAt(j + 3)), P[q++] = J << 2 | D >>> 4, P[q++] = D << 4 | H >>> 2, P[q++] = H << 6 | G, z |= J & _, z |= D & _, z |= H & _, z |= G & _;
1566
- if (j < S - 1 && (J = this._decodeChar(d.charCodeAt(j)), D = this._decodeChar(d.charCodeAt(j + 1)), P[q++] = J << 2 | D >>> 4, z |= J & _, z |= D & _), j < S - 2 && (H = this._decodeChar(d.charCodeAt(j + 2)), P[q++] = D << 4 | H >>> 2, z |= H & _), j < S - 3 && (G = this._decodeChar(d.charCodeAt(j + 3)), P[q++] = H << 6 | G, z |= G & _), z !== 0)
1602
+ for (var f = this._getPaddingLength(u), S = u.length - f, L = new Uint8Array(this.maxDecodedLength(S)), q = 0, M = 0, z = 0, J = 0, D = 0, H = 0, G = 0; M < S - 4; M += 4)
1603
+ J = this._decodeChar(u.charCodeAt(M + 0)), D = this._decodeChar(u.charCodeAt(M + 1)), H = this._decodeChar(u.charCodeAt(M + 2)), G = this._decodeChar(u.charCodeAt(M + 3)), L[q++] = J << 2 | D >>> 4, L[q++] = D << 4 | H >>> 2, L[q++] = H << 6 | G, z |= J & E, z |= D & E, z |= H & E, z |= G & E;
1604
+ if (M < S - 1 && (J = this._decodeChar(u.charCodeAt(M)), D = this._decodeChar(u.charCodeAt(M + 1)), L[q++] = J << 2 | D >>> 4, z |= J & E, z |= D & E), M < S - 2 && (H = this._decodeChar(u.charCodeAt(M + 2)), L[q++] = D << 4 | H >>> 2, z |= H & E), M < S - 3 && (G = this._decodeChar(u.charCodeAt(M + 3)), L[q++] = H << 6 | G, z |= G & E), z !== 0)
1567
1605
  throw new Error("Base64Coder: incorrect characters for decoding");
1568
- return P;
1569
- }, x.prototype._encodeByte = function(d) {
1570
- var f = d;
1571
- return f += 65, f += 25 - d >>> 8 & 6, f += 51 - d >>> 8 & -75, f += 61 - d >>> 8 & -15, f += 62 - d >>> 8 & 3, String.fromCharCode(f);
1572
- }, x.prototype._decodeChar = function(d) {
1573
- var f = _;
1574
- return f += (42 - d & d - 44) >>> 8 & -_ + d - 43 + 62, f += (46 - d & d - 48) >>> 8 & -_ + d - 47 + 63, f += (47 - d & d - 58) >>> 8 & -_ + d - 48 + 52, f += (64 - d & d - 91) >>> 8 & -_ + d - 65 + 0, f += (96 - d & d - 123) >>> 8 & -_ + d - 97 + 26, f;
1575
- }, x.prototype._getPaddingLength = function(d) {
1606
+ return L;
1607
+ }, x.prototype._encodeByte = function(u) {
1608
+ var f = u;
1609
+ return f += 65, f += 25 - u >>> 8 & 6, f += 51 - u >>> 8 & -75, f += 61 - u >>> 8 & -15, f += 62 - u >>> 8 & 3, String.fromCharCode(f);
1610
+ }, x.prototype._decodeChar = function(u) {
1611
+ var f = E;
1612
+ return f += (42 - u & u - 44) >>> 8 & -E + u - 43 + 62, f += (46 - u & u - 48) >>> 8 & -E + u - 47 + 63, f += (47 - u & u - 58) >>> 8 & -E + u - 48 + 52, f += (64 - u & u - 91) >>> 8 & -E + u - 65 + 0, f += (96 - u & u - 123) >>> 8 & -E + u - 97 + 26, f;
1613
+ }, x.prototype._getPaddingLength = function(u) {
1576
1614
  var f = 0;
1577
1615
  if (this._paddingCharacter) {
1578
- for (var S = d.length - 1; S >= 0 && d[S] === this._paddingCharacter; S--)
1616
+ for (var S = u.length - 1; S >= 0 && u[S] === this._paddingCharacter; S--)
1579
1617
  f++;
1580
- if (d.length < 4 || f > 2)
1618
+ if (u.length < 4 || f > 2)
1581
1619
  throw new Error("Base64Coder: incorrect padding");
1582
1620
  }
1583
1621
  return f;
@@ -1597,17 +1635,17 @@ function Gi() {
1597
1635
  var F = (
1598
1636
  /** @class */
1599
1637
  (function(x) {
1600
- b(d, x);
1601
- function d() {
1638
+ y(u, x);
1639
+ function u() {
1602
1640
  return x !== null && x.apply(this, arguments) || this;
1603
1641
  }
1604
- return d.prototype._encodeByte = function(f) {
1642
+ return u.prototype._encodeByte = function(f) {
1605
1643
  var S = f;
1606
1644
  return S += 65, S += 25 - f >>> 8 & 6, S += 51 - f >>> 8 & -75, S += 61 - f >>> 8 & -13, S += 62 - f >>> 8 & 49, String.fromCharCode(S);
1607
- }, d.prototype._decodeChar = function(f) {
1608
- var S = _;
1609
- return S += (44 - f & f - 46) >>> 8 & -_ + f - 45 + 62, S += (94 - f & f - 96) >>> 8 & -_ + f - 95 + 63, S += (47 - f & f - 58) >>> 8 & -_ + f - 48 + 52, S += (64 - f & f - 91) >>> 8 & -_ + f - 65 + 0, S += (96 - f & f - 123) >>> 8 & -_ + f - 97 + 26, S;
1610
- }, d;
1645
+ }, u.prototype._decodeChar = function(f) {
1646
+ var S = E;
1647
+ return S += (44 - f & f - 46) >>> 8 & -E + f - 45 + 62, S += (94 - f & f - 96) >>> 8 & -E + f - 95 + 63, S += (47 - f & f - 58) >>> 8 & -E + f - 48 + 52, S += (64 - f & f - 91) >>> 8 & -E + f - 65 + 0, S += (96 - f & f - 123) >>> 8 & -E + f - 97 + 26, S;
1648
+ }, u;
1611
1649
  })(w)
1612
1650
  );
1613
1651
  g.URLSafeCoder = F;
@@ -1629,40 +1667,40 @@ function Gi() {
1629
1667
  },
1630
1668
  /***/
1631
1669
  978(m, g) {
1632
- var b = "utf8: invalid source encoding";
1633
- function _(w) {
1670
+ var y = "utf8: invalid source encoding";
1671
+ function E(w) {
1634
1672
  for (var R = [], T = 0; T < w.length; T++) {
1635
1673
  var A = w[T];
1636
1674
  if (A & 128) {
1637
1675
  var F = void 0;
1638
1676
  if (A < 224) {
1639
1677
  if (T >= w.length)
1640
- throw new Error(b);
1678
+ throw new Error(y);
1641
1679
  var N = w[++T];
1642
1680
  if ((N & 192) !== 128)
1643
- throw new Error(b);
1681
+ throw new Error(y);
1644
1682
  A = (A & 31) << 6 | N & 63, F = 128;
1645
1683
  } else if (A < 240) {
1646
1684
  if (T >= w.length - 1)
1647
- throw new Error(b);
1685
+ throw new Error(y);
1648
1686
  var N = w[++T], W = w[++T];
1649
1687
  if ((N & 192) !== 128 || (W & 192) !== 128)
1650
- throw new Error(b);
1688
+ throw new Error(y);
1651
1689
  A = (A & 15) << 12 | (N & 63) << 6 | W & 63, F = 2048;
1652
1690
  } else if (A < 248) {
1653
1691
  if (T >= w.length - 2)
1654
- throw new Error(b);
1692
+ throw new Error(y);
1655
1693
  var N = w[++T], W = w[++T], te = w[++T];
1656
1694
  if ((N & 192) !== 128 || (W & 192) !== 128 || (te & 192) !== 128)
1657
- throw new Error(b);
1695
+ throw new Error(y);
1658
1696
  A = (A & 15) << 18 | (N & 63) << 12 | (W & 63) << 6 | te & 63, F = 65536;
1659
1697
  } else
1660
- throw new Error(b);
1698
+ throw new Error(y);
1661
1699
  if (A < F || A >= 55296 && A <= 57343)
1662
- throw new Error(b);
1700
+ throw new Error(y);
1663
1701
  if (A >= 65536) {
1664
1702
  if (A > 1114111)
1665
- throw new Error(b);
1703
+ throw new Error(y);
1666
1704
  A -= 65536, R.push(String.fromCharCode(55296 | A >> 10)), A = 56320 | A & 1023;
1667
1705
  }
1668
1706
  }
@@ -1670,21 +1708,21 @@ function Gi() {
1670
1708
  }
1671
1709
  return R.join("");
1672
1710
  }
1673
- g.D4 = _;
1711
+ g.D4 = E;
1674
1712
  },
1675
1713
  /***/
1676
- 721(m, g, b) {
1677
- m.exports = b(207).default;
1714
+ 721(m, g, y) {
1715
+ m.exports = y(207).default;
1678
1716
  },
1679
1717
  /***/
1680
- 207(m, g, b) {
1681
- b.d(g, {
1718
+ 207(m, g, y) {
1719
+ y.d(g, {
1682
1720
  default: () => (
1683
1721
  /* binding */
1684
- ue
1722
+ de
1685
1723
  )
1686
1724
  });
1687
- class _ {
1725
+ class E {
1688
1726
  constructor(e, t) {
1689
1727
  this.lastId = 0, this.prefix = e, this.name = t;
1690
1728
  }
@@ -1699,7 +1737,7 @@ function Gi() {
1699
1737
  delete this[e.number];
1700
1738
  }
1701
1739
  }
1702
- var w = new _("_pusher_script_", "Pusher.ScriptReceivers"), R = {
1740
+ var w = new E("_pusher_script_", "Pusher.ScriptReceivers"), R = {
1703
1741
  VERSION: "8.5.0",
1704
1742
  PROTOCOL: 7,
1705
1743
  wsPort: 80,
@@ -1740,12 +1778,12 @@ function Gi() {
1740
1778
  o.loading[e] = [r];
1741
1779
  var c = C.createScriptRequest(o.getPath(e, t)), l = o.receivers.create(function(p) {
1742
1780
  if (o.receivers.remove(l), o.loading[e]) {
1743
- var y = o.loading[e];
1781
+ var b = o.loading[e];
1744
1782
  delete o.loading[e];
1745
- for (var E = function(I) {
1783
+ for (var _ = function(I) {
1746
1784
  I || c.cleanup();
1747
- }, k = 0; k < y.length; k++)
1748
- y[k](p, E);
1785
+ }, k = 0; k < b.length; k++)
1786
+ b[k](p, _);
1749
1787
  }
1750
1788
  });
1751
1789
  c.send(l);
@@ -1759,7 +1797,7 @@ function Gi() {
1759
1797
  return this.getRoot(t) + "/" + e + this.options.suffix + ".js";
1760
1798
  }
1761
1799
  }
1762
- var F = new _("_pusher_dependencies", "Pusher.DependenciesReceivers"), N = new A({
1800
+ var F = new E("_pusher_dependencies", "Pusher.DependenciesReceivers"), N = new A({
1763
1801
  cdn_http: T.cdn_http,
1764
1802
  cdn_https: T.cdn_https,
1765
1803
  version: T.VERSION,
@@ -1792,10 +1830,10 @@ function Gi() {
1792
1830
  let r;
1793
1831
  return t.fullUrl ? r = t.fullUrl : t.path && (r = W.baseUrl + t.path), r ? `${e} ${r}` : "";
1794
1832
  } };
1795
- var d;
1833
+ var u;
1796
1834
  (function(n) {
1797
1835
  n.UserAuthentication = "user-authentication", n.ChannelAuthorization = "channel-authorization";
1798
- })(d || (d = {}));
1836
+ })(u || (u = {}));
1799
1837
  class f extends Error {
1800
1838
  constructor(e) {
1801
1839
  super(e), Object.setPrototypeOf(this, new.target.prototype);
@@ -1806,7 +1844,7 @@ function Gi() {
1806
1844
  super(e), Object.setPrototypeOf(this, new.target.prototype);
1807
1845
  }
1808
1846
  }
1809
- class P extends Error {
1847
+ class L extends Error {
1810
1848
  constructor(e) {
1811
1849
  super(e), Object.setPrototypeOf(this, new.target.prototype);
1812
1850
  }
@@ -1816,7 +1854,7 @@ function Gi() {
1816
1854
  super(e), Object.setPrototypeOf(this, new.target.prototype);
1817
1855
  }
1818
1856
  }
1819
- class j extends Error {
1857
+ class M extends Error {
1820
1858
  constructor(e) {
1821
1859
  super(e), Object.setPrototypeOf(this, new.target.prototype);
1822
1860
  }
@@ -1841,7 +1879,7 @@ function Gi() {
1841
1879
  super(t), this.status = e, Object.setPrototypeOf(this, new.target.prototype);
1842
1880
  }
1843
1881
  }
1844
- const Pt = function(n, e, t, r, o) {
1882
+ const Lt = function(n, e, t, r, o) {
1845
1883
  const c = C.createXHR();
1846
1884
  c.open("POST", t.endpoint, !0), c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
1847
1885
  for (var l in t.headers)
@@ -1854,20 +1892,20 @@ function Gi() {
1854
1892
  return c.onreadystatechange = function() {
1855
1893
  if (c.readyState === 4)
1856
1894
  if (c.status === 200) {
1857
- let p, y = !1;
1895
+ let p, b = !1;
1858
1896
  try {
1859
- p = JSON.parse(c.responseText), y = !0;
1897
+ p = JSON.parse(c.responseText), b = !0;
1860
1898
  } catch {
1861
1899
  o(new H(200, `JSON returned from ${r.toString()} endpoint was invalid, yet status code was 200. Data was: ${c.responseText}`), null);
1862
1900
  }
1863
- y && o(null, p);
1901
+ b && o(null, p);
1864
1902
  } else {
1865
1903
  let p = "";
1866
1904
  switch (r) {
1867
- case d.UserAuthentication:
1905
+ case u.UserAuthentication:
1868
1906
  p = x.buildLogSuffix("authenticationEndpoint");
1869
1907
  break;
1870
- case d.ChannelAuthorization:
1908
+ case u.ChannelAuthorization:
1871
1909
  p = `Clients must be authorized to join private or presence channels. ${x.buildLogSuffix("authorizationEndpoint")}`;
1872
1910
  break;
1873
1911
  }
@@ -1875,7 +1913,7 @@ function Gi() {
1875
1913
  }
1876
1914
  }, c.send(e), c;
1877
1915
  };
1878
- function Lt(n) {
1916
+ function Pt(n) {
1879
1917
  return qt(It(n));
1880
1918
  }
1881
1919
  var ne = String.fromCharCode, oe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Rt = function(n) {
@@ -1911,7 +1949,7 @@ function Gi() {
1911
1949
  function Nt(n) {
1912
1950
  window.clearTimeout(n);
1913
1951
  }
1914
- function jt(n) {
1952
+ function Mt(n) {
1915
1953
  window.clearInterval(n);
1916
1954
  }
1917
1955
  class Y extends ze {
@@ -1921,9 +1959,9 @@ function Gi() {
1921
1959
  });
1922
1960
  }
1923
1961
  }
1924
- class Mt extends ze {
1962
+ class jt extends ze {
1925
1963
  constructor(e, t) {
1926
- super(setInterval, jt, e, function(r) {
1964
+ super(setInterval, Mt, e, function(r) {
1927
1965
  return t(), r;
1928
1966
  });
1929
1967
  }
@@ -1943,11 +1981,11 @@ function Gi() {
1943
1981
  }
1944
1982
  };
1945
1983
  const U = zt;
1946
- function M(n, ...e) {
1984
+ function j(n, ...e) {
1947
1985
  for (var t = 0; t < e.length; t++) {
1948
1986
  var r = e[t];
1949
1987
  for (var o in r)
1950
- r[o] && r[o].constructor && r[o].constructor === Object ? n[o] = M(n[o] || {}, r[o]) : n[o] = r[o];
1988
+ r[o] && r[o].constructor && r[o].constructor === Object ? n[o] = j(n[o] || {}, r[o]) : n[o] = r[o];
1951
1989
  }
1952
1990
  return n;
1953
1991
  }
@@ -2032,7 +2070,7 @@ function Gi() {
2032
2070
  }
2033
2071
  function $t(n) {
2034
2072
  return Ft(n, function(e) {
2035
- return typeof e == "object" && (e = ae(e)), encodeURIComponent(Lt(e.toString()));
2073
+ return typeof e == "object" && (e = ae(e)), encodeURIComponent(Pt(e.toString()));
2036
2074
  });
2037
2075
  }
2038
2076
  function Xt(n) {
@@ -2044,7 +2082,7 @@ function Gi() {
2044
2082
  function Vt(n) {
2045
2083
  var e = [], t = [];
2046
2084
  return (function r(o, c) {
2047
- var l, p, y;
2085
+ var l, p, b;
2048
2086
  switch (typeof o) {
2049
2087
  case "object":
2050
2088
  if (!o)
@@ -2053,14 +2091,14 @@ function Gi() {
2053
2091
  if (e[l] === o)
2054
2092
  return { $ref: t[l] };
2055
2093
  if (e.push(o), t.push(c), Object.prototype.toString.apply(o) === "[object Array]")
2056
- for (y = [], l = 0; l < o.length; l += 1)
2057
- y[l] = r(o[l], c + "[" + l + "]");
2094
+ for (b = [], l = 0; l < o.length; l += 1)
2095
+ b[l] = r(o[l], c + "[" + l + "]");
2058
2096
  else {
2059
- y = {};
2097
+ b = {};
2060
2098
  for (p in o)
2061
- Object.prototype.hasOwnProperty.call(o, p) && (y[p] = r(o[p], c + "[" + JSON.stringify(p) + "]"));
2099
+ Object.prototype.hasOwnProperty.call(o, p) && (b[p] = r(o[p], c + "[" + JSON.stringify(p) + "]"));
2062
2100
  }
2063
- return y;
2101
+ return b;
2064
2102
  case "number":
2065
2103
  case "string":
2066
2104
  case "boolean":
@@ -2098,22 +2136,22 @@ function Gi() {
2098
2136
  }
2099
2137
  log(e, ...t) {
2100
2138
  var r = Ht.apply(this, arguments);
2101
- ue.log ? ue.log(r) : ue.logToConsole && e.bind(this)(r);
2139
+ de.log ? de.log(r) : de.logToConsole && e.bind(this)(r);
2102
2140
  }
2103
2141
  }
2104
- const L = new Jt();
2142
+ const P = new Jt();
2105
2143
  var Gt = function(n, e, t, r, o) {
2106
- (t.headers !== void 0 || t.headersProvider != null) && L.warn(`To send headers with the ${r.toString()} request, you must use AJAX, rather than JSONP.`);
2144
+ (t.headers !== void 0 || t.headersProvider != null) && P.warn(`To send headers with the ${r.toString()} request, you must use AJAX, rather than JSONP.`);
2107
2145
  var c = n.nextAuthCallbackID.toString();
2108
2146
  n.nextAuthCallbackID++;
2109
2147
  var l = n.getDocument(), p = l.createElement("script");
2110
2148
  n.auth_callbacks[c] = function(k) {
2111
2149
  o(null, k);
2112
2150
  };
2113
- var y = "Pusher.auth_callbacks['" + c + "']";
2114
- p.src = t.endpoint + "?callback=" + encodeURIComponent(y) + "&" + e;
2115
- var E = l.getElementsByTagName("head")[0] || l.documentElement;
2116
- E.insertBefore(p, E.firstChild);
2151
+ var b = "Pusher.auth_callbacks['" + c + "']";
2152
+ p.src = t.endpoint + "?callback=" + encodeURIComponent(b) + "&" + e;
2153
+ var _ = l.getElementsByTagName("head")[0] || l.documentElement;
2154
+ _.insertBefore(p, _.firstChild);
2117
2155
  };
2118
2156
  const Yt = Gt;
2119
2157
  class Kt {
@@ -2152,8 +2190,8 @@ function Gi() {
2152
2190
  }
2153
2191
  var Zt = function(n, e) {
2154
2192
  return function(t, r) {
2155
- var o = "http" + (e ? "s" : "") + "://", c = o + (n.host || n.options.host) + n.options.path, l = C.createJSONPRequest(c, t), p = C.ScriptReceivers.create(function(y, E) {
2156
- w.remove(p), l.cleanup(), E && E.host && (n.host = E.host), r && r(y, E);
2193
+ var o = "http" + (e ? "s" : "") + "://", c = o + (n.host || n.options.host) + n.options.path, l = C.createJSONPRequest(c, t), p = C.ScriptReceivers.create(function(b, _) {
2194
+ w.remove(p), l.cleanup(), _ && _.host && (n.host = _.host), r && r(b, _);
2157
2195
  });
2158
2196
  l.send(p);
2159
2197
  };
@@ -2162,30 +2200,30 @@ function Gi() {
2162
2200
  getAgent: Zt
2163
2201
  };
2164
2202
  const tn = en;
2165
- function be(n, e, t) {
2203
+ function ye(n, e, t) {
2166
2204
  var r = n + (e.useTLS ? "s" : ""), o = e.useTLS ? e.hostTLS : e.hostNonTLS;
2167
2205
  return r + "://" + o + t;
2168
2206
  }
2169
- function ye(n, e) {
2207
+ function be(n, e) {
2170
2208
  var t = "/app/" + n, r = "?protocol=" + T.PROTOCOL + "&client=js&version=" + T.VERSION + (e ? "&" + e : "");
2171
2209
  return t + r;
2172
2210
  }
2173
2211
  var nn = {
2174
2212
  getInitial: function(n, e) {
2175
- var t = (e.httpPath || "") + ye(n, "flash=false");
2176
- return be("ws", e, t);
2213
+ var t = (e.httpPath || "") + be(n, "flash=false");
2214
+ return ye("ws", e, t);
2177
2215
  }
2178
2216
  }, rn = {
2179
2217
  getInitial: function(n, e) {
2180
- var t = (e.httpPath || "/pusher") + ye(n);
2181
- return be("http", e, t);
2218
+ var t = (e.httpPath || "/pusher") + be(n);
2219
+ return ye("http", e, t);
2182
2220
  }
2183
2221
  }, sn = {
2184
2222
  getInitial: function(n, e) {
2185
- return be("http", e, e.httpPath || "/pusher");
2223
+ return ye("http", e, e.httpPath || "/pusher");
2186
2224
  },
2187
2225
  getPath: function(n, e) {
2188
- return ye(n);
2226
+ return be(n);
2189
2227
  }
2190
2228
  };
2191
2229
  class on {
@@ -2277,7 +2315,7 @@ function Gi() {
2277
2315
  this.onError(t), this.changeState("closed");
2278
2316
  }), !1;
2279
2317
  }
2280
- return this.bindListeners(), L.debug("Connecting", { transport: this.name, url: e }), this.changeState("connecting"), !0;
2318
+ return this.bindListeners(), P.debug("Connecting", { transport: this.name, url: e }), this.changeState("connecting"), !0;
2281
2319
  }
2282
2320
  close() {
2283
2321
  return this.socket ? (this.socket.close(), !0) : !1;
@@ -2332,7 +2370,7 @@ function Gi() {
2332
2370
  })), this.emit(e, t);
2333
2371
  }
2334
2372
  buildTimelineMessage(e) {
2335
- return M({ cid: this.id }, e);
2373
+ return j({ cid: this.id }, e);
2336
2374
  }
2337
2375
  }
2338
2376
  class ee {
@@ -2366,11 +2404,11 @@ function Gi() {
2366
2404
  isInitialized: function() {
2367
2405
  return !0;
2368
2406
  }
2369
- }, Ve = M({
2407
+ }, Ve = j({
2370
2408
  getSocket: function(n) {
2371
2409
  return C.HTTPFactory.createStreamingSocket(n);
2372
2410
  }
2373
- }, Xe), Je = M({
2411
+ }, Xe), Je = j({
2374
2412
  getSocket: function(n) {
2375
2413
  return C.HTTPFactory.createPollingSocket(n);
2376
2414
  }
@@ -2378,13 +2416,13 @@ function Gi() {
2378
2416
  isSupported: function() {
2379
2417
  return C.isXHRSupported();
2380
2418
  }
2381
- }, hn = new ee(M({}, Ve, Ge)), ln = new ee(M({}, Je, Ge)), un = {
2419
+ }, hn = new ee(j({}, Ve, Ge)), ln = new ee(j({}, Je, Ge)), dn = {
2382
2420
  ws: cn,
2383
2421
  xhr_streaming: hn,
2384
2422
  xhr_polling: ln
2385
2423
  };
2386
- const ce = un;
2387
- var dn = new ee({
2424
+ const ce = dn;
2425
+ var un = new ee({
2388
2426
  file: "sockjs",
2389
2427
  urls: sn,
2390
2428
  handlesActivityChecks: !0,
@@ -2413,8 +2451,8 @@ function Gi() {
2413
2451
  var e = C.isXDRSupported(n.useTLS);
2414
2452
  return e;
2415
2453
  }
2416
- }, fn = new ee(M({}, Ve, Ye)), pn = new ee(M({}, Je, Ye));
2417
- ce.xdr_streaming = fn, ce.xdr_polling = pn, ce.sockjs = dn;
2454
+ }, fn = new ee(j({}, Ve, Ye)), pn = new ee(j({}, Je, Ye));
2455
+ ce.xdr_streaming = fn, ce.xdr_polling = pn, ce.sockjs = un;
2418
2456
  const mn = ce;
2419
2457
  class gn extends $ {
2420
2458
  constructor() {
@@ -2431,20 +2469,20 @@ function Gi() {
2431
2469
  }
2432
2470
  }
2433
2471
  var vn = new gn();
2434
- class bn {
2472
+ class yn {
2435
2473
  constructor(e, t, r) {
2436
2474
  this.manager = e, this.transport = t, this.minPingDelay = r.minPingDelay, this.maxPingDelay = r.maxPingDelay, this.pingDelay = void 0;
2437
2475
  }
2438
2476
  createConnection(e, t, r, o) {
2439
- o = M({}, o, {
2477
+ o = j({}, o, {
2440
2478
  activityTimeout: this.pingDelay
2441
2479
  });
2442
2480
  var c = this.transport.createConnection(e, t, r, o), l = null, p = function() {
2443
- c.unbind("open", p), c.bind("closed", y), l = U.now();
2444
- }, y = (E) => {
2445
- if (c.unbind("closed", y), E.code === 1002 || E.code === 1003)
2481
+ c.unbind("open", p), c.bind("closed", b), l = U.now();
2482
+ }, b = (_) => {
2483
+ if (c.unbind("closed", b), _.code === 1002 || _.code === 1003)
2446
2484
  this.manager.reportDeath();
2447
- else if (!E.wasClean && l) {
2485
+ else if (!_.wasClean && l) {
2448
2486
  var k = U.now() - l;
2449
2487
  k < 2 * this.maxPingDelay && (this.manager.reportDeath(), this.pingDelay = Math.max(k / 2, this.minPingDelay));
2450
2488
  }
@@ -2509,7 +2547,7 @@ function Gi() {
2509
2547
  } : null;
2510
2548
  }
2511
2549
  }, K = Ke;
2512
- class yn extends $ {
2550
+ class bn extends $ {
2513
2551
  constructor(e, t) {
2514
2552
  super(), this.id = e, this.transport = t, this.activityTimeout = t.activityTimeout, this.bindListeners();
2515
2553
  }
@@ -2521,7 +2559,7 @@ function Gi() {
2521
2559
  }
2522
2560
  send_event(e, t, r) {
2523
2561
  var o = { event: e, data: t };
2524
- return r && (o.channel = r), L.debug("Event sent", o), this.send(K.encodeMessage(o));
2562
+ return r && (o.channel = r), P.debug("Event sent", o), this.send(K.encodeMessage(o));
2525
2563
  }
2526
2564
  ping() {
2527
2565
  this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
@@ -2543,7 +2581,7 @@ function Gi() {
2543
2581
  });
2544
2582
  }
2545
2583
  if (o !== void 0) {
2546
- switch (L.debug("Event recd", o), o.event) {
2584
+ switch (P.debug("Event recd", o), o.event) {
2547
2585
  case "pusher:error":
2548
2586
  this.emit("error", {
2549
2587
  type: "PusherError",
@@ -2601,7 +2639,7 @@ function Gi() {
2601
2639
  return;
2602
2640
  }
2603
2641
  t.action === "connected" ? this.finish("connected", {
2604
- connection: new yn(t.id, this.transport),
2642
+ connection: new bn(t.id, this.transport),
2605
2643
  activityTimeout: t.activityTimeout
2606
2644
  }) : (this.finish(t.action, { error: t.error }), this.transport.close());
2607
2645
  }, this.onClosed = (e) => {
@@ -2614,7 +2652,7 @@ function Gi() {
2614
2652
  this.transport.unbind("message", this.onMessage), this.transport.unbind("closed", this.onClosed);
2615
2653
  }
2616
2654
  finish(e, t) {
2617
- this.callback(M({ transport: this.transport, action: e }, t));
2655
+ this.callback(j({ transport: this.transport, action: e }, t));
2618
2656
  }
2619
2657
  }
2620
2658
  class Cn {
@@ -2628,7 +2666,7 @@ function Gi() {
2628
2666
  class Ce extends $ {
2629
2667
  constructor(e, t) {
2630
2668
  super(function(r, o) {
2631
- L.debug("No callbacks on " + e + " for " + r);
2669
+ P.debug("No callbacks on " + e + " for " + r);
2632
2670
  }), this.name = e, this.pusher = t, this.subscribed = !1, this.subscriptionPending = !1, this.subscriptionCancelled = !1;
2633
2671
  }
2634
2672
  authorize(e, t) {
@@ -2639,7 +2677,7 @@ function Gi() {
2639
2677
  throw new f("Event '" + e + "' does not start with 'client-'");
2640
2678
  if (!this.subscribed) {
2641
2679
  var r = x.buildLogSuffix("triggeringClientEvents");
2642
- L.warn(`Client event triggered before channel 'subscription_succeeded' event . ${r}`);
2680
+ P.warn(`Client event triggered before channel 'subscription_succeeded' event . ${r}`);
2643
2681
  }
2644
2682
  return this.pusher.send_event(e, t, this.name);
2645
2683
  }
@@ -2665,7 +2703,7 @@ function Gi() {
2665
2703
  }
2666
2704
  subscribe() {
2667
2705
  this.subscribed || (this.subscriptionPending = !0, this.subscriptionCancelled = !1, this.authorize(this.pusher.connection.socket_id, (e, t) => {
2668
- e ? (this.subscriptionPending = !1, L.error(e.toString()), this.emit("pusher:subscription_error", Object.assign({}, {
2706
+ e ? (this.subscriptionPending = !1, P.error(e.toString()), this.emit("pusher:subscription_error", Object.assign({}, {
2669
2707
  type: "AuthError",
2670
2708
  error: e.message
2671
2709
  }, e instanceof H ? { status: e.status } : {}))) : this.pusher.send_event("pusher:subscribe", {
@@ -2736,22 +2774,22 @@ function Gi() {
2736
2774
  return new (t || (t = Promise))(function(c, l) {
2737
2775
  function p(k) {
2738
2776
  try {
2739
- E(r.next(k));
2777
+ _(r.next(k));
2740
2778
  } catch (I) {
2741
2779
  l(I);
2742
2780
  }
2743
2781
  }
2744
- function y(k) {
2782
+ function b(k) {
2745
2783
  try {
2746
- E(r.throw(k));
2784
+ _(r.throw(k));
2747
2785
  } catch (I) {
2748
2786
  l(I);
2749
2787
  }
2750
2788
  }
2751
- function E(k) {
2752
- k.done ? c(k.value) : o(k.value).then(p, y);
2789
+ function _(k) {
2790
+ k.done ? c(k.value) : o(k.value).then(p, b);
2753
2791
  }
2754
- E((r = r.apply(n, e || [])).next());
2792
+ _((r = r.apply(n, e || [])).next());
2755
2793
  });
2756
2794
  };
2757
2795
  class xn extends Se {
@@ -2768,7 +2806,7 @@ function Gi() {
2768
2806
  this.members.setMyID(this.pusher.user.user_data.id);
2769
2807
  else {
2770
2808
  let l = x.buildLogSuffix("authorizationEndpoint");
2771
- L.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${l}, or the user should be signed in.`), t("Invalid auth response");
2809
+ P.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${l}, or the user should be signed in.`), t("Invalid auth response");
2772
2810
  return;
2773
2811
  }
2774
2812
  t(r, o);
@@ -2809,8 +2847,8 @@ function Gi() {
2809
2847
  this.members.reset(), super.disconnect();
2810
2848
  }
2811
2849
  }
2812
- var _n = b(978), Te = b(594);
2813
- class En extends Se {
2850
+ var En = y(978), Te = y(594);
2851
+ class _n extends Se {
2814
2852
  constructor(e, t, r) {
2815
2853
  super(e, t), this.key = null, this.nacl = r;
2816
2854
  }
@@ -2841,32 +2879,32 @@ function Gi() {
2841
2879
  }
2842
2880
  handleEncryptedEvent(e, t) {
2843
2881
  if (!this.key) {
2844
- L.debug("Received encrypted event before key has been retrieved from the authEndpoint");
2882
+ P.debug("Received encrypted event before key has been retrieved from the authEndpoint");
2845
2883
  return;
2846
2884
  }
2847
2885
  if (!t.ciphertext || !t.nonce) {
2848
- L.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + t);
2886
+ P.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + t);
2849
2887
  return;
2850
2888
  }
2851
2889
  let r = (0, Te.decode)(t.ciphertext);
2852
2890
  if (r.length < this.nacl.secretbox.overheadLength) {
2853
- L.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${r.length}`);
2891
+ P.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${r.length}`);
2854
2892
  return;
2855
2893
  }
2856
2894
  let o = (0, Te.decode)(t.nonce);
2857
2895
  if (o.length < this.nacl.secretbox.nonceLength) {
2858
- L.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${o.length}`);
2896
+ P.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${o.length}`);
2859
2897
  return;
2860
2898
  }
2861
2899
  let c = this.nacl.secretbox.open(r, o, this.key);
2862
2900
  if (c === null) {
2863
- L.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, (l, p) => {
2901
+ P.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, (l, p) => {
2864
2902
  if (l) {
2865
- L.error(`Failed to make a request to the authEndpoint: ${p}. Unable to fetch new key, so dropping encrypted event`);
2903
+ P.error(`Failed to make a request to the authEndpoint: ${p}. Unable to fetch new key, so dropping encrypted event`);
2866
2904
  return;
2867
2905
  }
2868
2906
  if (c = this.nacl.secretbox.open(r, o, this.key), c === null) {
2869
- L.error("Failed to decrypt event with new key. Dropping encrypted event");
2907
+ P.error("Failed to decrypt event with new key. Dropping encrypted event");
2870
2908
  return;
2871
2909
  }
2872
2910
  this.emit(e, this.getDataToEmit(c));
@@ -2876,7 +2914,7 @@ function Gi() {
2876
2914
  this.emit(e, this.getDataToEmit(c));
2877
2915
  }
2878
2916
  getDataToEmit(e) {
2879
- let t = (0, _n.D4)(e);
2917
+ let t = (0, En.D4)(e);
2880
2918
  try {
2881
2919
  return JSON.parse(t);
2882
2920
  } catch {
@@ -2973,7 +3011,7 @@ function Gi() {
2973
3011
  this.activityTimer && this.activityTimer.ensureAborted();
2974
3012
  }
2975
3013
  buildConnectionCallbacks(e) {
2976
- return M({}, e, {
3014
+ return j({}, e, {
2977
3015
  message: (t) => {
2978
3016
  this.resetActivityCheck(), this.emit("message", t);
2979
3017
  },
@@ -2992,7 +3030,7 @@ function Gi() {
2992
3030
  });
2993
3031
  }
2994
3032
  buildHandshakeCallbacks(e) {
2995
- return M({}, e, {
3033
+ return j({}, e, {
2996
3034
  connected: (t) => {
2997
3035
  this.activityTimeout = Math.min(this.options.activityTimeout, t.activityTimeout, t.connection.activityTimeout || 1 / 0), this.clearUnavailableTimer(), this.setConnection(t.connection), this.socket_id = this.connection.id, this.updateState("connected", { socket_id: this.socket_id });
2998
3036
  }
@@ -3036,7 +3074,7 @@ function Gi() {
3036
3074
  var r = this.state;
3037
3075
  if (this.state = e, r !== e) {
3038
3076
  var o = e;
3039
- o === "connected" && (o += " with new socket ID " + t.socket_id), L.debug("State changed", r + " -> " + o), this.timeline.info({ state: e, params: t }), this.emit("state_change", { previous: r, current: e }), this.emit(e, t);
3077
+ o === "connected" && (o += " with new socket ID " + t.socket_id), P.debug("State changed", r + " -> " + o), this.timeline.info({ state: e, params: t }), this.emit("state_change", { previous: r, current: e }), this.emit(e, t);
3040
3078
  }
3041
3079
  }
3042
3080
  shouldRetry() {
@@ -3048,7 +3086,7 @@ function Gi() {
3048
3086
  this.channels = {};
3049
3087
  }
3050
3088
  add(e, t) {
3051
- return this.channels[e] || (this.channels[e] = Pn(e, t)), this.channels[e];
3089
+ return this.channels[e] || (this.channels[e] = Ln(e, t)), this.channels[e];
3052
3090
  }
3053
3091
  all() {
3054
3092
  return Dt(this.channels);
@@ -3066,7 +3104,7 @@ function Gi() {
3066
3104
  });
3067
3105
  }
3068
3106
  }
3069
- function Pn(n, e) {
3107
+ function Ln(n, e) {
3070
3108
  if (n.indexOf("private-encrypted-") === 0) {
3071
3109
  if (e.config.nacl)
3072
3110
  return X.createEncryptedChannel(n, e, e.config.nacl);
@@ -3082,7 +3120,7 @@ function Gi() {
3082
3120
  return X.createChannel(n, e);
3083
3121
  }
3084
3122
  }
3085
- var Ln = {
3123
+ var Pn = {
3086
3124
  createChannels() {
3087
3125
  return new An();
3088
3126
  },
@@ -3099,7 +3137,7 @@ function Gi() {
3099
3137
  return new xn(n, e);
3100
3138
  },
3101
3139
  createEncryptedChannel(n, e, t) {
3102
- return new En(n, e, t);
3140
+ return new _n(n, e, t);
3103
3141
  },
3104
3142
  createTimelineSender(n, e) {
3105
3143
  return new Cn(n, e);
@@ -3108,10 +3146,10 @@ function Gi() {
3108
3146
  return new wn(n, e);
3109
3147
  },
3110
3148
  createAssistantToTheTransportManager(n, e, t) {
3111
- return new bn(n, e, t);
3149
+ return new yn(n, e, t);
3112
3150
  }
3113
3151
  };
3114
- const X = Ln;
3152
+ const X = Pn;
3115
3153
  class Qe {
3116
3154
  constructor(e) {
3117
3155
  this.options = e || {}, this.livesLeft = this.options.lives || 1 / 0;
@@ -3137,15 +3175,15 @@ function Gi() {
3137
3175
  return $e(this.strategies, U.method("isSupported"));
3138
3176
  }
3139
3177
  connect(e, t) {
3140
- var r = this.strategies, o = 0, c = this.timeout, l = null, p = (y, E) => {
3141
- E ? t(null, E) : (o = o + 1, this.loop && (o = o % r.length), o < r.length ? (c && (c = c * 2, this.timeoutLimit && (c = Math.min(c, this.timeoutLimit))), l = this.tryStrategy(r[o], e, { timeout: c, failFast: this.failFast }, p)) : t(!0));
3178
+ var r = this.strategies, o = 0, c = this.timeout, l = null, p = (b, _) => {
3179
+ _ ? t(null, _) : (o = o + 1, this.loop && (o = o % r.length), o < r.length ? (c && (c = c * 2, this.timeoutLimit && (c = Math.min(c, this.timeoutLimit))), l = this.tryStrategy(r[o], e, { timeout: c, failFast: this.failFast }, p)) : t(!0));
3142
3180
  };
3143
3181
  return l = this.tryStrategy(r[o], e, { timeout: c, failFast: this.failFast }, p), {
3144
3182
  abort: function() {
3145
3183
  l.abort();
3146
3184
  },
3147
- forceMinPriority: function(y) {
3148
- e = y, l && l.forceMinPriority(y);
3185
+ forceMinPriority: function(b) {
3186
+ e = b, l && l.forceMinPriority(b);
3149
3187
  }
3150
3188
  };
3151
3189
  }
@@ -3153,8 +3191,8 @@ function Gi() {
3153
3191
  var c = null, l = null;
3154
3192
  return r.timeout > 0 && (c = new Y(r.timeout, function() {
3155
3193
  l.abort(), o(!0);
3156
- })), l = e.connect(t, function(p, y) {
3157
- p && c && c.isRunning() && !r.failFast || (c && c.ensureAborted(), o(p, y));
3194
+ })), l = e.connect(t, function(p, b) {
3195
+ p && c && c.isRunning() && !r.failFast || (c && c.ensureAborted(), o(p, b));
3158
3196
  }), {
3159
3197
  abort: function() {
3160
3198
  c && c.ensureAborted(), l.abort();
@@ -3229,27 +3267,27 @@ function Gi() {
3229
3267
  failFast: !0
3230
3268
  }))) : c++);
3231
3269
  }
3232
- var y = U.now(), E = l.pop().connect(e, function k(I, de) {
3233
- I ? (Ze(r), l.length > 0 ? (y = U.now(), E = l.pop().connect(e, k)) : t(I)) : (Nn(r, de.transport.name, U.now() - y, c), t(null, de));
3270
+ var b = U.now(), _ = l.pop().connect(e, function k(I, ue) {
3271
+ I ? (Ze(r), l.length > 0 ? (b = U.now(), _ = l.pop().connect(e, k)) : t(I)) : (Nn(r, ue.transport.name, U.now() - b, c), t(null, ue));
3234
3272
  });
3235
3273
  return {
3236
3274
  abort: function() {
3237
- E.abort();
3275
+ _.abort();
3238
3276
  },
3239
3277
  forceMinPriority: function(k) {
3240
- e = k, E && E.forceMinPriority(k);
3278
+ e = k, _ && _.forceMinPriority(k);
3241
3279
  }
3242
3280
  };
3243
3281
  }
3244
3282
  }
3245
- function _e(n) {
3283
+ function Ee(n) {
3246
3284
  return "pusherTransport" + (n ? "TLS" : "NonTLS");
3247
3285
  }
3248
3286
  function Un(n) {
3249
3287
  var e = C.getLocalStorage();
3250
3288
  if (e)
3251
3289
  try {
3252
- var t = e[_e(n)];
3290
+ var t = e[Ee(n)];
3253
3291
  if (t)
3254
3292
  return JSON.parse(t);
3255
3293
  } catch {
@@ -3261,7 +3299,7 @@ function Gi() {
3261
3299
  var o = C.getLocalStorage();
3262
3300
  if (o)
3263
3301
  try {
3264
- o[_e(n)] = ae({
3302
+ o[Ee(n)] = ae({
3265
3303
  timestamp: U.now(),
3266
3304
  transport: e,
3267
3305
  latency: t,
@@ -3274,7 +3312,7 @@ function Gi() {
3274
3312
  var e = C.getLocalStorage();
3275
3313
  if (e)
3276
3314
  try {
3277
- delete e[_e(n)];
3315
+ delete e[Ee(n)];
3278
3316
  } catch {
3279
3317
  }
3280
3318
  }
@@ -3312,7 +3350,7 @@ function Gi() {
3312
3350
  return r.connect(e, t);
3313
3351
  }
3314
3352
  }
3315
- class jn {
3353
+ class Mn {
3316
3354
  constructor(e) {
3317
3355
  this.strategy = e;
3318
3356
  }
@@ -3331,11 +3369,11 @@ function Gi() {
3331
3369
  return n.isSupported();
3332
3370
  };
3333
3371
  }
3334
- var Mn = function(n, e, t) {
3372
+ var jn = function(n, e, t) {
3335
3373
  var r = {};
3336
- function o(dt, Ui, Ni, ji, Mi) {
3337
- var ft = t(n, dt, Ui, Ni, ji, Mi);
3338
- return r[dt] = ft, ft;
3374
+ function o(ut, Ui, Ni, Mi, ji) {
3375
+ var ft = t(n, ut, Ui, Ni, Mi, ji);
3376
+ return r[ut] = ft, ft;
3339
3377
  }
3340
3378
  var c = Object.assign({}, e, {
3341
3379
  hostNonTLS: n.wsHost + ":" + n.wsPort,
@@ -3347,41 +3385,41 @@ function Gi() {
3347
3385
  hostNonTLS: n.httpHost + ":" + n.httpPort,
3348
3386
  hostTLS: n.httpHost + ":" + n.httpsPort,
3349
3387
  httpPath: n.httpPath
3350
- }), y = {
3388
+ }), b = {
3351
3389
  loop: !0,
3352
3390
  timeout: 15e3,
3353
3391
  timeoutLimit: 6e4
3354
- }, E = new Qe({
3392
+ }, _ = new Qe({
3355
3393
  minPingDelay: 1e4,
3356
3394
  maxPingDelay: n.activityTimeout
3357
3395
  }), k = new Qe({
3358
3396
  lives: 2,
3359
3397
  minPingDelay: 1e4,
3360
3398
  maxPingDelay: n.activityTimeout
3361
- }), I = o("ws", "ws", 3, c, E), de = o("wss", "ws", 3, l, E), Li = o("sockjs", "sockjs", 1, p), ot = o("xhr_streaming", "xhr_streaming", 1, p, k), Ri = o("xdr_streaming", "xdr_streaming", 1, p, k), at = o("xhr_polling", "xhr_polling", 1, p), Ii = o("xdr_polling", "xdr_polling", 1, p), ct = new Q([I], y), Oi = new Q([de], y), qi = new Q([Li], y), ht = new Q([
3399
+ }), I = o("ws", "ws", 3, c, _), ue = o("wss", "ws", 3, l, _), Pi = o("sockjs", "sockjs", 1, p), ot = o("xhr_streaming", "xhr_streaming", 1, p, k), Ri = o("xdr_streaming", "xdr_streaming", 1, p, k), at = o("xhr_polling", "xhr_polling", 1, p), Ii = o("xdr_polling", "xdr_polling", 1, p), ct = new Q([I], b), Oi = new Q([ue], b), qi = new Q([Pi], b), ht = new Q([
3362
3400
  new re(se(ot), ot, Ri)
3363
- ], y), lt = new Q([
3401
+ ], b), lt = new Q([
3364
3402
  new re(se(at), at, Ii)
3365
- ], y), ut = new Q([
3403
+ ], b), dt = new Q([
3366
3404
  new re(se(ht), new xe([
3367
3405
  ht,
3368
3406
  new he(lt, { delay: 4e3 })
3369
3407
  ]), lt)
3370
- ], y), Ae = new re(se(ut), ut, qi), Pe;
3371
- return e.useTLS ? Pe = new xe([
3408
+ ], b), Ae = new re(se(dt), dt, qi), Le;
3409
+ return e.useTLS ? Le = new xe([
3372
3410
  ct,
3373
3411
  new he(Ae, { delay: 2e3 })
3374
- ]) : Pe = new xe([
3412
+ ]) : Le = new xe([
3375
3413
  ct,
3376
3414
  new he(Oi, { delay: 2e3 }),
3377
3415
  new he(Ae, { delay: 5e3 })
3378
- ]), new qn(new jn(new re(se(I), Pe, Ae)), r, {
3416
+ ]), new qn(new Mn(new re(se(I), Le, Ae)), r, {
3379
3417
  ttl: 18e5,
3380
3418
  timeline: e.timeline,
3381
3419
  useTLS: e.useTLS
3382
3420
  });
3383
3421
  };
3384
- const zn = Mn;
3422
+ const zn = jn;
3385
3423
  function Hn() {
3386
3424
  var n = this;
3387
3425
  n.timeline.info(n.buildTimelineMessage({
@@ -3394,7 +3432,7 @@ function Gi() {
3394
3432
  getRequest: function(n) {
3395
3433
  var e = new window.XDomainRequest();
3396
3434
  return e.ontimeout = function() {
3397
- n.emit("error", new P()), n.close();
3435
+ n.emit("error", new L()), n.close();
3398
3436
  }, e.onerror = function(t) {
3399
3437
  n.emit("error", t), n.close();
3400
3438
  }, e.onprogress = function() {
@@ -3439,11 +3477,11 @@ function Gi() {
3439
3477
  return this.position === e.length && e.length > Wn;
3440
3478
  }
3441
3479
  }
3442
- var Ee;
3480
+ var _e;
3443
3481
  (function(n) {
3444
3482
  n[n.CONNECTING = 0] = "CONNECTING", n[n.OPEN = 1] = "OPEN", n[n.CLOSED = 3] = "CLOSED";
3445
- })(Ee || (Ee = {}));
3446
- const Z = Ee;
3483
+ })(_e || (_e = {}));
3484
+ const Z = _e;
3447
3485
  var $n = 1;
3448
3486
  class Xn {
3449
3487
  constructor(e, t) {
@@ -3661,7 +3699,7 @@ function Gi() {
3661
3699
  return this.getDocument().location.protocol;
3662
3700
  },
3663
3701
  getAuthorizers() {
3664
- return { ajax: Pt, jsonp: Yt };
3702
+ return { ajax: Lt, jsonp: Yt };
3665
3703
  },
3666
3704
  onDocumentBody(n) {
3667
3705
  document.body ? n() : setTimeout(() => {
@@ -3736,7 +3774,7 @@ function Gi() {
3736
3774
  this.key = e, this.session = t, this.events = [], this.options = r || {}, this.sent = 0, this.uniqueID = 0;
3737
3775
  }
3738
3776
  log(e, t) {
3739
- e <= this.options.level && (this.events.push(M({}, t, { timestamp: U.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
3777
+ e <= this.options.level && (this.events.push(j({}, t, { timestamp: U.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
3740
3778
  }
3741
3779
  error(e) {
3742
3780
  this.log(le.ERROR, e);
@@ -3751,7 +3789,7 @@ function Gi() {
3751
3789
  return this.events.length === 0;
3752
3790
  }
3753
3791
  send(e, t) {
3754
- var r = M({
3792
+ var r = j({
3755
3793
  session: this.session,
3756
3794
  bundle: this.sent + 1,
3757
3795
  key: this.key,
@@ -3789,16 +3827,16 @@ function Gi() {
3789
3827
  c = X.createHandshake(o, function(I) {
3790
3828
  r = !0, k(), t(null, I);
3791
3829
  });
3792
- }, y = function(I) {
3830
+ }, b = function(I) {
3793
3831
  k(), t(I);
3794
- }, E = function() {
3832
+ }, _ = function() {
3795
3833
  k();
3796
3834
  var I;
3797
- I = ae(o), t(new j(I));
3835
+ I = ae(o), t(new M(I));
3798
3836
  }, k = function() {
3799
- o.unbind("initialized", l), o.unbind("open", p), o.unbind("error", y), o.unbind("closed", E);
3837
+ o.unbind("initialized", l), o.unbind("open", p), o.unbind("error", b), o.unbind("closed", _);
3800
3838
  };
3801
- return o.bind("initialized", l), o.bind("open", p), o.bind("error", y), o.bind("closed", E), o.initialize(), {
3839
+ return o.bind("initialized", l), o.bind("open", p), o.bind("error", b), o.bind("closed", _), o.initialize(), {
3802
3840
  abort: () => {
3803
3841
  r || (k(), c ? c.close() : o.close());
3804
3842
  },
@@ -3823,8 +3861,8 @@ function Gi() {
3823
3861
  var l = ci[t];
3824
3862
  if (!l)
3825
3863
  throw new J(t);
3826
- var p = (!n.enabledTransports || He(n.enabledTransports, e) !== -1) && (!n.disabledTransports || He(n.disabledTransports, e) === -1), y;
3827
- return p ? (o = Object.assign({ ignoreNullOrigin: n.ignoreNullOrigin }, o), y = new ai(e, r, c ? c.getAssistant(l) : l, o)) : y = li, y;
3864
+ var p = (!n.enabledTransports || He(n.enabledTransports, e) !== -1) && (!n.disabledTransports || He(n.disabledTransports, e) === -1), b;
3865
+ return p ? (o = Object.assign({ ignoreNullOrigin: n.ignoreNullOrigin }, o), b = new ai(e, r, c ? c.getAssistant(l) : l, o)) : b = li, b;
3828
3866
  }, li = {
3829
3867
  isSupported: function() {
3830
3868
  return !1;
@@ -3842,14 +3880,14 @@ function Gi() {
3842
3880
  };
3843
3881
  }
3844
3882
  };
3845
- function ui(n) {
3883
+ function di(n) {
3846
3884
  if (n == null)
3847
3885
  throw "You must pass an options object";
3848
3886
  if (n.cluster == null)
3849
3887
  throw "Options object must provide a cluster";
3850
- "disableStats" in n && L.warn("The disableStats option is deprecated in favor of enableStats");
3888
+ "disableStats" in n && P.warn("The disableStats option is deprecated in favor of enableStats");
3851
3889
  }
3852
- const di = (n, e) => {
3890
+ const ui = (n, e) => {
3853
3891
  var t = "socket_id=" + encodeURIComponent(n.socketId);
3854
3892
  for (var r in e.params)
3855
3893
  t += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(e.params[r]);
@@ -3863,8 +3901,8 @@ function Gi() {
3863
3901
  if (typeof C.getAuthorizers()[n.transport] > "u")
3864
3902
  throw `'${n.transport}' is not a recognized auth transport`;
3865
3903
  return (e, t) => {
3866
- const r = di(e, n);
3867
- C.getAuthorizers()[n.transport](C, r, n, d.UserAuthentication, t);
3904
+ const r = ui(e, n);
3905
+ C.getAuthorizers()[n.transport](C, r, n, u.UserAuthentication, t);
3868
3906
  };
3869
3907
  }, pi = (n, e) => {
3870
3908
  var t = "socket_id=" + encodeURIComponent(n.socketId);
@@ -3882,7 +3920,7 @@ function Gi() {
3882
3920
  throw `'${n.transport}' is not a recognized auth transport`;
3883
3921
  return (e, t) => {
3884
3922
  const r = pi(e, n);
3885
- C.getAuthorizers()[n.transport](C, r, n, d.ChannelAuthorization, t);
3923
+ C.getAuthorizers()[n.transport](C, r, n, u.ChannelAuthorization, t);
3886
3924
  };
3887
3925
  }, gi = (n, e, t) => {
3888
3926
  const r = {
@@ -3914,7 +3952,7 @@ function Gi() {
3914
3952
  enableStats: Ci(n),
3915
3953
  httpHost: vi(n),
3916
3954
  useTLS: wi(n),
3917
- wsHost: bi(n),
3955
+ wsHost: yi(n),
3918
3956
  userAuthenticator: Si(n),
3919
3957
  channelAuthorizer: xi(n, e)
3920
3958
  };
@@ -3923,10 +3961,10 @@ function Gi() {
3923
3961
  function vi(n) {
3924
3962
  return n.httpHost ? n.httpHost : n.cluster ? `sockjs-${n.cluster}.pusher.com` : T.httpHost;
3925
3963
  }
3926
- function bi(n) {
3927
- return n.wsHost ? n.wsHost : yi(n.cluster);
3928
- }
3929
3964
  function yi(n) {
3965
+ return n.wsHost ? n.wsHost : bi(n.cluster);
3966
+ }
3967
+ function bi(n) {
3930
3968
  return `ws-${n}.pusher.com`;
3931
3969
  }
3932
3970
  function wi(n) {
@@ -3957,10 +3995,10 @@ function Gi() {
3957
3995
  const t = Ti(n, e);
3958
3996
  return st(t) ? t.customHandler : mi(t);
3959
3997
  }
3960
- class _i extends $ {
3998
+ class Ei extends $ {
3961
3999
  constructor(e) {
3962
4000
  super(function(t, r) {
3963
- L.debug(`No callbacks on watchlist events for ${t}`);
4001
+ P.debug(`No callbacks on watchlist events for ${t}`);
3964
4002
  }), this.pusher = e, this.bindWatchlistInternalEvent();
3965
4003
  }
3966
4004
  handleEvent(e) {
@@ -3975,20 +4013,20 @@ function Gi() {
3975
4013
  });
3976
4014
  }
3977
4015
  }
3978
- function Ei() {
4016
+ function _i() {
3979
4017
  let n, e;
3980
4018
  return { promise: new Promise((r, o) => {
3981
4019
  n = r, e = o;
3982
4020
  }), resolve: n, reject: e };
3983
4021
  }
3984
- const ki = Ei;
4022
+ const ki = _i;
3985
4023
  class Ai extends $ {
3986
4024
  constructor(e) {
3987
4025
  super(function(t, r) {
3988
- L.debug("No callbacks on user for " + t);
4026
+ P.debug("No callbacks on user for " + t);
3989
4027
  }), this.signin_requested = !1, this.user_data = null, this.serverToUserChannel = null, this.signinDonePromise = null, this._signinDoneResolve = null, this._onAuthorize = (t, r) => {
3990
4028
  if (t) {
3991
- L.warn(`Error during signin: ${t}`), this._cleanup();
4029
+ P.warn(`Error during signin: ${t}`), this._cleanup();
3992
4030
  return;
3993
4031
  }
3994
4032
  this.pusher.send_event("pusher:signin", {
@@ -3997,7 +4035,7 @@ function Gi() {
3997
4035
  });
3998
4036
  }, this.pusher = e, this.pusher.connection.bind("state_change", ({ previous: t, current: r }) => {
3999
4037
  t !== "connected" && r === "connected" && this._signin(), t === "connected" && r !== "connected" && (this._cleanup(), this._newSigninPromiseIfNeeded());
4000
- }), this.watchlist = new _i(e), this.pusher.connection.bind("message", (t) => {
4038
+ }), this.watchlist = new Ei(e), this.pusher.connection.bind("message", (t) => {
4001
4039
  var r = t.event;
4002
4040
  r === "pusher:signin_success" && this._onSigninSuccess(t.data), this.serverToUserChannel && this.serverToUserChannel.name === t.channel && this.serverToUserChannel.handleEvent(t);
4003
4041
  });
@@ -4014,11 +4052,11 @@ function Gi() {
4014
4052
  try {
4015
4053
  this.user_data = JSON.parse(e.user_data);
4016
4054
  } catch {
4017
- L.error(`Failed parsing user data after signin: ${e.user_data}`), this._cleanup();
4055
+ P.error(`Failed parsing user data after signin: ${e.user_data}`), this._cleanup();
4018
4056
  return;
4019
4057
  }
4020
4058
  if (typeof this.user_data.id != "string" || this.user_data.id === "") {
4021
- L.error(`user_data doesn't contain an id. user_data: ${this.user_data}`), this._cleanup();
4059
+ P.error(`user_data doesn't contain an id. user_data: ${this.user_data}`), this._cleanup();
4022
4060
  return;
4023
4061
  }
4024
4062
  this._signinDoneResolve(), this._subscribeChannels();
@@ -4057,7 +4095,7 @@ function Gi() {
4057
4095
  }));
4058
4096
  }
4059
4097
  constructor(e, t) {
4060
- Pi(e), ui(t), this.key = e, this.options = t, this.config = rt(this.options, this), this.channels = X.createChannels(), this.global_emitter = new $(), this.sessionID = C.randomInt(1e9), this.timeline = new oi(this.key, this.sessionID, {
4098
+ Li(e), di(t), this.key = e, this.options = t, this.config = rt(this.options, this), this.channels = X.createChannels(), this.global_emitter = new $(), this.sessionID = C.randomInt(1e9), this.timeline = new oi(this.key, this.sessionID, {
4061
4099
  cluster: this.config.cluster,
4062
4100
  features: O.getClientFeatures(),
4063
4101
  params: this.config.timelineParams || {},
@@ -4090,7 +4128,7 @@ function Gi() {
4090
4128
  }), this.connection.bind("disconnected", () => {
4091
4129
  this.channels.disconnect();
4092
4130
  }), this.connection.bind("error", (o) => {
4093
- L.warn(o);
4131
+ P.warn(o);
4094
4132
  }), O.instances.push(this), this.timeline.info({ instances: O.instances.length }), this.user = new Ai(this), O.isReady && this.connect();
4095
4133
  }
4096
4134
  switchCluster(e) {
@@ -4106,7 +4144,7 @@ function Gi() {
4106
4144
  connect() {
4107
4145
  if (this.connection.connect(), this.timelineSender && !this.timelineSenderTimer) {
4108
4146
  var e = this.connection.isUsingTLS(), t = this.timelineSender;
4109
- this.timelineSenderTimer = new Mt(6e4, function() {
4147
+ this.timelineSenderTimer = new jt(6e4, function() {
4110
4148
  t.send(e);
4111
4149
  });
4112
4150
  }
@@ -4153,8 +4191,8 @@ function Gi() {
4153
4191
  }
4154
4192
  }
4155
4193
  O.instances = [], O.isReady = !1, O.logToConsole = !1, O.Runtime = C, O.ScriptReceivers = C.ScriptReceivers, O.DependenciesReceivers = C.DependenciesReceivers, O.auth_callbacks = C.auth_callbacks;
4156
- const ue = O;
4157
- function Pi(n) {
4194
+ const de = O;
4195
+ function Li(n) {
4158
4196
  if (n == null)
4159
4197
  throw "You must pass your app key when you instantiate Pusher.";
4160
4198
  }
@@ -4166,7 +4204,7 @@ function Gi() {
4166
4204
  var g = a[m];
4167
4205
  if (g !== void 0)
4168
4206
  return g.exports;
4169
- var b = a[m] = {
4207
+ var y = a[m] = {
4170
4208
  /******/
4171
4209
  // no module.id needed
4172
4210
  /******/
@@ -4175,17 +4213,17 @@ function Gi() {
4175
4213
  exports: {}
4176
4214
  /******/
4177
4215
  };
4178
- return s[m].call(b.exports, b, b.exports, h), b.exports;
4216
+ return s[m].call(y.exports, y, y.exports, h), y.exports;
4179
4217
  }
4180
4218
  h.d = (m, g) => {
4181
- for (var b in g)
4182
- h.o(g, b) && !h.o(m, b) && Object.defineProperty(m, b, { enumerable: !0, get: g[b] });
4219
+ for (var y in g)
4220
+ h.o(g, y) && !h.o(m, y) && Object.defineProperty(m, y, { enumerable: !0, get: g[y] });
4183
4221
  }, h.o = (m, g) => Object.prototype.hasOwnProperty.call(m, g);
4184
- var u = h(721);
4185
- return u;
4222
+ var d = h(721);
4223
+ return d;
4186
4224
  })()
4187
4225
  ));
4188
- })(Le)), Le.exports;
4226
+ })(Pe)), Pe.exports;
4189
4227
  }
4190
4228
  var Yi = Gi();
4191
4229
  const Ki = /* @__PURE__ */ Ji(Yi), Re = "/vendor/sendity-client/tailwind.css", Qi = {
@@ -4266,36 +4304,36 @@ function V(v) {
4266
4304
  }
4267
4305
  }
4268
4306
  const vt = `<svg role="img" viewBox="0 0 512 512" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>Email</title><path d="M64 112c-8.8 0-16 7.2-16 16l0 22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1l0-22.1c0-8.8-7.2-16-16-16L64 112zM48 212.2L48 384c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-171.8L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128z"/></svg>
4269
- `, bt = '<svg role="img" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>WhatsApp</title><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>', tr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.998 9.332A5.002 5.002 0 0 1 13.2 5.5H11a1 1 0 1 0 0 2h4.5a1 1 0 0 0 1-1V2a1 1 0 1 0-2 0v1.74A7.002 7.002 0 0 0 3 9.332a1 1 0 1 0 1.998 0ZM15.002 10.668A5.002 5.002 0 0 1 6.8 14.5H9a1 1 0 1 0 0-2H4.5a1 1 0 0 0-1 1V18a1 1 0 1 0 2 0v-1.74a7.002 7.002 0 0 0 11.5-5.592 1 1 0 1 0-1.998 0Z" clip-rule="evenodd" /></svg>', je = "sendityAuthRequest", nr = "https://sendity.io/api", ir = ["mailto:verify@sendity.io"], rr = 600 * 1e3, sr = 5e3, or = 15e3, Ie = 2e3, pe = 220, At = 0;
4270
- function Me(v, i) {
4307
+ `, yt = '<svg role="img" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>WhatsApp</title><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>', tr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.998 9.332A5.002 5.002 0 0 1 13.2 5.5H11a1 1 0 1 0 0 2h4.5a1 1 0 0 0 1-1V2a1 1 0 1 0-2 0v1.74A7.002 7.002 0 0 0 3 9.332a1 1 0 1 0 1.998 0ZM15.002 10.668A5.002 5.002 0 0 1 6.8 14.5H9a1 1 0 1 0 0-2H4.5a1 1 0 0 0-1 1V18a1 1 0 1 0 2 0v-1.74a7.002 7.002 0 0 0 11.5-5.592 1 1 0 1 0-1.998 0Z" clip-rule="evenodd" /></svg>', nr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM7.22 6.22a.75.75 0 0 0-1.06 1.06L8.88 10l-2.72 2.72a.75.75 0 1 0 1.06 1.06L9.94 11.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11 10l2.72-2.72a.75.75 0 0 0-1.06-1.06L9.94 8.94 7.22 6.22Z" clip-rule="evenodd" /></svg>', Me = "sendityAuthRequest", ir = "https://sendity.io/api", rr = ["mailto:verify@sendity.io"], sr = 600 * 1e3, or = 5e3, ar = 15e3, Ie = 2e3, pe = 220, At = 0;
4308
+ function je(v, i) {
4271
4309
  return `sendity:auth-request:${encodeURIComponent(v)}:${encodeURIComponent(i)}`;
4272
4310
  }
4273
- function yt(v, i, s, a = Date.now()) {
4274
- v.removeItem(je);
4275
- const h = Me(i, s), u = v.getItem(h);
4276
- if (!u) return null;
4311
+ function bt(v, i, s, a = Date.now()) {
4312
+ v.removeItem(Me);
4313
+ const h = je(i, s), d = v.getItem(h);
4314
+ if (!d) return null;
4277
4315
  try {
4278
- const m = JSON.parse(u);
4316
+ const m = JSON.parse(d);
4279
4317
  if (typeof m.id != "string" || typeof m.clientSecret != "string" || typeof m.createdAt != "number")
4280
4318
  throw new Error("invalid stored auth request");
4281
- return a - m.createdAt >= rr ? (v.removeItem(h), null) : { id: m.id, clientSecret: m.clientSecret };
4319
+ return a - m.createdAt >= sr ? (v.removeItem(h), null) : { id: m.id, clientSecret: m.clientSecret };
4282
4320
  } catch {
4283
4321
  return v.removeItem(h), null;
4284
4322
  }
4285
4323
  }
4286
- function ar(v, i, s, a, h = Date.now()) {
4287
- v.setItem(Me(i, s), JSON.stringify({ ...a, createdAt: h }));
4324
+ function cr(v, i, s, a, h = Date.now()) {
4325
+ v.setItem(je(i, s), JSON.stringify({ ...a, createdAt: h }));
4288
4326
  }
4289
4327
  function wt(v, i, s) {
4290
- v.removeItem(Me(i, s)), v.removeItem(je);
4328
+ v.removeItem(je(i, s)), v.removeItem(Me);
4291
4329
  }
4292
4330
  function me() {
4293
- return window.localStorage.removeItem(je), window.sessionStorage;
4331
+ return window.localStorage.removeItem(Me), window.sessionStorage;
4294
4332
  }
4295
- function cr(v, i = window.location.origin) {
4296
- return v.filter((s) => hr(s, i));
4333
+ function hr(v, i = window.location.origin) {
4334
+ return v.filter((s) => lr(s, i));
4297
4335
  }
4298
- function hr(v, i) {
4336
+ function lr(v, i) {
4299
4337
  try {
4300
4338
  const s = new URL(v, i);
4301
4339
  return ["http:", "https:", "mailto:", "whatsapp:"].includes(s.protocol);
@@ -4303,24 +4341,24 @@ function hr(v, i) {
4303
4341
  return !1;
4304
4342
  }
4305
4343
  }
4306
- function lr(v, i, s) {
4344
+ function dr(v, i, s) {
4307
4345
  return v === "push" ? { start: !1, delayMs: 0 } : v === "polling" || !i || !s ? { start: !0, delayMs: 0 } : { start: !0, delayMs: At };
4308
4346
  }
4309
4347
  const ve = class ve extends HTMLElement {
4310
4348
  constructor() {
4311
- super(), this.pollTimer = null, this.fallbackPollTimer = null, this.authenticatedEventTimer = null, this.codeContainerEl = null, this.codeEl = null, this.promptEl = null, this.successEl = null, this.spinnerEl = null, this.verifiersEl = null, this.footerEl = null, this.footerBrandEl = null, this.footerStatusEl = null, this.footerMessageEl = null, this.footerTimerEl = null, this.footerObserver = null, this.authStartObserver = null, this.authFlowStarted = !1, this.footerWaitTimer = null, this.footerTransitionTimer = null, this.successTransitionTimer = null, this.timerInterval = null, this.currentConfig = null, this.destroyed = !1, this.lastCode = void 0, this.echo = null, this.authenticated = !1;
4349
+ super(), this.pollTimer = null, this.fallbackPollTimer = null, this.authenticatedEventTimer = null, this.rootEl = null, this.codeContainerEl = null, this.codeEl = null, this.promptEl = null, this.successEl = null, this.spinnerEl = null, this.verifiersEl = null, this.footerEl = null, this.footerBrandEl = null, this.footerStatusEl = null, this.footerMessageEl = null, this.footerTimerEl = null, this.footerIndicatorEl = null, this.footerObserver = null, this.authStartObserver = null, this.authFlowStarted = !1, this.footerWaitTimer = null, this.footerTransitionTimer = null, this.successTransitionTimer = null, this.timerInterval = null, this.currentConfig = null, this.destroyed = !1, this.lastCode = void 0, this.echo = null, this.authenticated = !1;
4312
4350
  const i = this.attachShadow({ mode: "open" });
4313
4351
  this.injectTailwind(i);
4314
4352
  const s = document.createElement("div");
4315
4353
  s.innerHTML = pt;
4316
- const a = s.querySelector("template"), h = a ? a.content.cloneNode(!0) : document.createRange().createContextualFragment(pt), u = document.createElement("style");
4317
- u.textContent = zi, i.appendChild(u), i.appendChild(h);
4354
+ const a = s.querySelector("template"), h = a ? a.content.cloneNode(!0) : document.createRange().createContextualFragment(pt), d = document.createElement("style");
4355
+ d.textContent = zi, i.appendChild(d), i.appendChild(h);
4318
4356
  }
4319
4357
  static get observedAttributes() {
4320
4358
  return ["server-url", "public-key", "verify-urls", "lang", "transport", "hide-footer", "footer", "authenticated-event-delay-ms"];
4321
4359
  }
4322
4360
  connectedCallback() {
4323
- this.codeContainerEl = this.shadowRoot?.querySelector(".code"), this.codeEl = this.shadowRoot?.querySelector(".formatted-code"), this.promptEl = this.shadowRoot?.querySelector(".prompt"), this.successEl = this.shadowRoot?.querySelector(".success"), this.spinnerEl = this.shadowRoot?.querySelector(".spinner"), this.verifiersEl = this.shadowRoot?.querySelector(".verifiers"), this.footerEl = this.shadowRoot?.querySelector(".sendity-footer"), this.footerBrandEl = this.shadowRoot?.querySelector(".footer-brand"), this.footerStatusEl = this.shadowRoot?.querySelector(".footer-status"), this.footerMessageEl = this.shadowRoot?.querySelector(".footer-message"), this.footerTimerEl = this.shadowRoot?.querySelector(".footer-timer");
4361
+ this.rootEl = this.shadowRoot?.querySelector(".sendity"), this.codeContainerEl = this.shadowRoot?.querySelector(".code"), this.codeEl = this.shadowRoot?.querySelector(".formatted-code"), this.promptEl = this.shadowRoot?.querySelector(".prompt"), this.successEl = this.shadowRoot?.querySelector(".success"), this.spinnerEl = this.shadowRoot?.querySelector(".spinner"), this.verifiersEl = this.shadowRoot?.querySelector(".verifiers"), this.footerEl = this.shadowRoot?.querySelector(".sendity-footer"), this.footerBrandEl = this.shadowRoot?.querySelector(".footer-brand"), this.footerStatusEl = this.shadowRoot?.querySelector(".footer-status"), this.footerMessageEl = this.shadowRoot?.querySelector(".footer-message"), this.footerTimerEl = this.shadowRoot?.querySelector(".footer-timer"), this.footerIndicatorEl = this.shadowRoot?.querySelector(".footer-spinner");
4324
4362
  try {
4325
4363
  this.currentConfig = this.resolveConfig();
4326
4364
  } catch (i) {
@@ -4396,7 +4434,7 @@ const ve = class ve extends HTMLElement {
4396
4434
  this.footerEl.hidden = !0, this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.footerObserver?.disconnect(), this.footerObserver = null;
4397
4435
  return;
4398
4436
  }
4399
- this.footerEl.hidden = !1, this.footerEl.classList.remove("footer--waiting", "footer--transitioning", "footer--leaving"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.setAttribute("hidden", ""), this.observeFooterVisibility();
4437
+ this.footerEl.hidden = !1, this.footerEl.classList.remove("footer--waiting", "footer--transitioning", "footer--leaving", "footer--verified"), this.setFooterIndicatorWaiting(), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.setAttribute("hidden", ""), this.observeFooterVisibility();
4400
4438
  }
4401
4439
  }
4402
4440
  isFooterHidden() {
@@ -4411,10 +4449,16 @@ const ve = class ve extends HTMLElement {
4411
4449
  scheduleFooterWaitingState() {
4412
4450
  this.footerWaitTimer !== null || this.isFooterHidden() || (this.footerWaitTimer = window.setTimeout(() => {
4413
4451
  this.footerWaitTimer = null, this.showFooterWaitingState();
4414
- }, or));
4452
+ }, ar));
4453
+ }
4454
+ setFooterIndicatorWaiting() {
4455
+ this.footerIndicatorEl && (this.footerIndicatorEl.classList.remove("footer-indicator--error"), this.footerIndicatorEl.innerHTML = "", this.footerIndicatorEl.removeAttribute("hidden"));
4456
+ }
4457
+ setFooterIndicatorError() {
4458
+ this.footerIndicatorEl && (this.footerIndicatorEl.classList.add("footer-indicator--error"), this.footerIndicatorEl.innerHTML = nr, this.footerIndicatorEl.removeAttribute("hidden"));
4415
4459
  }
4416
4460
  showFooterWaitingState() {
4417
- this.isFooterHidden() || (this.currentConfig && this.footerMessageEl && (this.footerMessageEl.textContent = this.waitingFooterMessage()), this.footerEl?.classList.add("footer--waiting", "footer--transitioning"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.removeAttribute("hidden"), this.footerTransitionTimer !== null && clearTimeout(this.footerTransitionTimer), this.footerTransitionTimer = window.setTimeout(() => {
4461
+ this.isFooterHidden() || (this.currentConfig && this.footerMessageEl && (this.footerMessageEl.textContent = this.waitingFooterMessage()), this.setFooterIndicatorWaiting(), this.footerEl?.classList.add("footer--waiting", "footer--transitioning"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.removeAttribute("hidden"), this.footerTransitionTimer !== null && clearTimeout(this.footerTransitionTimer), this.footerTransitionTimer = window.setTimeout(() => {
4418
4462
  this.footerTransitionTimer = null, this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl?.setAttribute("hidden", "");
4419
4463
  }, pe), this.startCountdown());
4420
4464
  }
@@ -4431,8 +4475,8 @@ const ve = class ve extends HTMLElement {
4431
4475
  this.footerTimerEl.setAttribute("hidden", "");
4432
4476
  return;
4433
4477
  }
4434
- const a = Math.max(0, Math.floor((s - Date.now()) / 1e3)), h = Math.floor(a / 60), u = String(a % 60).padStart(2, "0");
4435
- this.footerTimerEl.textContent = `${h}:${u}`, this.footerTimerEl.classList.toggle("low", a > 0 && a <= 60), this.footerTimerEl.removeAttribute("hidden"), a <= 0 && this.timerInterval !== null && (clearInterval(this.timerInterval), this.timerInterval = null, this.showExpiredState());
4478
+ const a = Math.max(0, Math.floor((s - Date.now()) / 1e3)), h = Math.floor(a / 60), d = String(a % 60).padStart(2, "0");
4479
+ this.footerTimerEl.textContent = `${h}:${d}`, this.footerTimerEl.classList.toggle("low", a > 0 && a <= 60), this.footerTimerEl.removeAttribute("hidden"), a <= 0 && this.timerInterval !== null && (clearInterval(this.timerInterval), this.timerInterval = null, this.showExpiredState());
4436
4480
  };
4437
4481
  i(), this.timerInterval = window.setInterval(i, 1e3);
4438
4482
  }
@@ -4441,9 +4485,9 @@ const ve = class ve extends HTMLElement {
4441
4485
  }
4442
4486
  showExpiredState() {
4443
4487
  if (!(this.authenticated || this.destroyed || !this.currentConfig)) {
4444
- if (this.stopAuthTransports(), this.codeContainerEl?.classList.remove("code--active", "code--placeholder"), this.codeContainerEl?.classList.add("code--expired"), this.spinnerEl?.setAttribute("hidden", ""), this.codeEl?.removeAttribute("hidden"), !this.isFooterHidden()) {
4488
+ if (this.stopAuthTransports(), this.rootEl?.classList.remove("sendity--verified"), this.rootEl?.classList.add("sendity--expired"), this.codeContainerEl?.classList.remove("code--active", "code--placeholder"), this.codeContainerEl?.classList.add("code--expired"), this.spinnerEl?.setAttribute("hidden", ""), this.codeEl?.removeAttribute("hidden"), !this.isFooterHidden()) {
4445
4489
  const i = V(this.currentConfig.lang);
4446
- this.footerMessageEl && (this.footerMessageEl.textContent = i.ui.codeExpired), this.footerEl?.classList.add("footer--waiting", "footer--transitioning"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.removeAttribute("hidden"), this.footerTimerEl?.setAttribute("hidden", ""), this.footerTransitionTimer !== null && clearTimeout(this.footerTransitionTimer), this.footerTransitionTimer = window.setTimeout(() => {
4490
+ this.footerMessageEl && (this.footerMessageEl.textContent = i.ui.codeExpired), this.setFooterIndicatorError(), this.footerEl?.classList.add("footer--waiting", "footer--transitioning"), this.footerBrandEl?.removeAttribute("hidden"), this.footerStatusEl?.removeAttribute("hidden"), this.footerTimerEl?.setAttribute("hidden", ""), this.footerTransitionTimer !== null && clearTimeout(this.footerTransitionTimer), this.footerTransitionTimer = window.setTimeout(() => {
4447
4491
  this.footerTransitionTimer = null, this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl?.setAttribute("hidden", "");
4448
4492
  }, pe);
4449
4493
  }
@@ -4455,9 +4499,9 @@ const ve = class ve extends HTMLElement {
4455
4499
  const i = V(this.currentConfig.lang);
4456
4500
  this.verifiersEl.innerHTML = "", this.verifiersEl.classList.remove("is-two", "verifiers--exiting"), this.verifiersEl.removeAttribute("aria-hidden");
4457
4501
  const s = document.createElement("button");
4458
- s.type = "button", s.className = "chan primary", s.addEventListener("click", () => {
4459
- s.disabled = !0, this.requestNewAuthRequest().catch((u) => {
4460
- console.warn("[sendity-auth] failed to request a new code", u), s.disabled = !1;
4502
+ s.type = "button", s.className = "chan error", s.addEventListener("click", () => {
4503
+ s.disabled = !0, this.requestNewAuthRequest().catch((d) => {
4504
+ console.warn("[sendity-auth] failed to request a new code", d), s.disabled = !1;
4461
4505
  });
4462
4506
  });
4463
4507
  const a = document.createElement("span");
@@ -4468,7 +4512,7 @@ const ve = class ve extends HTMLElement {
4468
4512
  async requestNewAuthRequest() {
4469
4513
  this.currentConfig || (this.currentConfig = this.resolveConfig());
4470
4514
  const i = this.currentConfig;
4471
- this.stopAuthTransports(), this.stopCountdown(), this.codeContainerEl?.classList.remove("code--expired");
4515
+ this.stopAuthTransports(), this.stopCountdown(), this.rootEl?.classList.remove("sendity--expired", "sendity--verified"), this.setFooterIndicatorWaiting(), this.codeContainerEl?.classList.remove("code--expired");
4472
4516
  const s = await this.createAuthRequest(i.serverUrl, i.publicKey, me());
4473
4517
  this.renderVerifiers(i.verifyUrls), this.showFooterWaitingState(), this.configureRealtime(s);
4474
4518
  }
@@ -4485,24 +4529,24 @@ const ve = class ve extends HTMLElement {
4485
4529
  const i = {
4486
4530
  lang: navigator.language?.startsWith("de") ? "de" : navigator.language?.startsWith("fr") ? "fr" : "en",
4487
4531
  transport: "auto"
4488
- }, s = (R) => this.getAttribute(R) ?? void 0, a = s("server-url")?.trim() || nr, h = s("public-key")?.trim();
4532
+ }, s = (R) => this.getAttribute(R) ?? void 0, a = s("server-url")?.trim() || ir, h = s("public-key")?.trim();
4489
4533
  if (!h)
4490
4534
  throw new Error("Missing required sendity-auth attribute: public-key");
4491
- let u = [...ir];
4535
+ let d = [...rr];
4492
4536
  const m = s("verify-urls");
4493
4537
  if (m)
4494
4538
  try {
4495
- if (u = JSON.parse(m), !Array.isArray(u)) throw new Error("verify-urls not array");
4496
- u = u.map(String);
4539
+ if (d = JSON.parse(m), !Array.isArray(d)) throw new Error("verify-urls not array");
4540
+ d = d.map(String);
4497
4541
  } catch {
4498
- u = m.split(",").map((R) => R.trim()).filter(Boolean);
4542
+ d = m.split(",").map((R) => R.trim()).filter(Boolean);
4499
4543
  }
4500
- if (u = cr(u), u.length === 0)
4544
+ if (d = hr(d), d.length === 0)
4501
4545
  throw new Error("Missing required sendity-auth attribute: verify-urls");
4502
4546
  let g = s("lang") || i.lang;
4503
4547
  g !== "en" && g !== "de" && g !== "fr" && (g = i.lang);
4504
- const b = s("transport"), _ = b === "push" || b === "polling" ? b : i.transport, w = this.parseAuthenticatedEventDelayMs(s("authenticated-event-delay-ms"));
4505
- return { serverUrl: a, publicKey: h, verifyUrls: u, lang: g, transport: _, authenticatedEventDelayMs: w };
4548
+ const y = s("transport"), E = y === "push" || y === "polling" ? y : i.transport, w = this.parseAuthenticatedEventDelayMs(s("authenticated-event-delay-ms"));
4549
+ return { serverUrl: a, publicKey: h, verifyUrls: d, lang: g, transport: E, authenticatedEventDelayMs: w };
4506
4550
  }
4507
4551
  parseAuthenticatedEventDelayMs(i) {
4508
4552
  if (i === void 0 || i.trim() === "") return Ie;
@@ -4520,24 +4564,24 @@ const ve = class ve extends HTMLElement {
4520
4564
  body: JSON.stringify({ public_key: s })
4521
4565
  });
4522
4566
  if (!h.ok) throw new Error(`Auth request creation failed: ${h.status}`);
4523
- const u = await h.json();
4524
- if (!u.id) throw new Error("Missing id from server response");
4525
- const m = this.extractClientSecret(u);
4567
+ const d = await h.json();
4568
+ if (!d.id) throw new Error("Missing id from server response");
4569
+ const m = this.extractClientSecret(d);
4526
4570
  if (!m) throw new Error("Missing client secret from server response");
4527
- return ar(a, i, s, { id: String(u.id), clientSecret: m }), this.activeAuthRequestId = String(u.id), this.activeAuthRequestSecret = m, this.updateActiveAuthRequestExpiry(u), this.updateCode(u.formattedCode ?? u.code), this.dispatchPublicEvent("sendity:challenge-created", {
4528
- verificationId: String(u.id),
4529
- code: u.formattedCode ?? u.code ?? "",
4571
+ return cr(a, i, s, { id: String(d.id), clientSecret: m }), this.activeAuthRequestId = String(d.id), this.activeAuthRequestSecret = m, this.updateActiveAuthRequestExpiry(d), this.updateCode(d.formattedCode ?? d.code), this.dispatchPublicEvent("sendity:challenge-created", {
4572
+ verificationId: String(d.id),
4573
+ code: d.formattedCode ?? d.code ?? "",
4530
4574
  channel: this.primaryChannel(this.currentConfig?.verifyUrls ?? [])
4531
- }), u;
4575
+ }), d;
4532
4576
  }
4533
4577
  async step() {
4534
4578
  this.currentConfig || (this.currentConfig = this.resolveConfig());
4535
- const { serverUrl: i, publicKey: s } = this.currentConfig, a = me(), h = yt(a, i, s), u = h?.id;
4536
- if (!u)
4579
+ const { serverUrl: i, publicKey: s } = this.currentConfig, a = me(), h = bt(a, i, s), d = h?.id;
4580
+ if (!d)
4537
4581
  return await this.createAuthRequest(i, s, a);
4538
- this.activeAuthRequestId = u, this.activeAuthRequestSecret = h.clientSecret;
4582
+ this.activeAuthRequestId = d, this.activeAuthRequestSecret = h.clientSecret;
4539
4583
  const m = await fetch(
4540
- this.authRequestStatusUrl(i, u),
4584
+ this.authRequestStatusUrl(i, d),
4541
4585
  this.authRequestStatusInit(h.clientSecret)
4542
4586
  );
4543
4587
  if (m.status !== 200)
@@ -4548,15 +4592,15 @@ const ve = class ve extends HTMLElement {
4548
4592
  if (g.status === "expired")
4549
4593
  return this.updateActiveAuthRequestExpiry(g), this.updateCode(g.formattedCode ?? g.code), this.showExpiredState(), g;
4550
4594
  g.id && (this.activeAuthRequestId = String(g.id));
4551
- const b = this.extractClientSecret(g);
4552
- return b && (this.activeAuthRequestSecret = b), this.updateActiveAuthRequestExpiry(g), this.updateCode(g.formattedCode ?? g.code), g;
4595
+ const y = this.extractClientSecret(g);
4596
+ return y && (this.activeAuthRequestSecret = y), this.updateActiveAuthRequestExpiry(g), this.updateCode(g.formattedCode ?? g.code), g;
4553
4597
  }
4554
4598
  configureRealtime(i) {
4555
4599
  this.currentConfig || (this.currentConfig = this.resolveConfig());
4556
4600
  const { transport: s } = this.currentConfig, a = i?.broadcasting, h = !!(a?.key && a.channel && a.authEndpoint);
4557
- let u = !1;
4558
- s !== "polling" && h && a ? u = this.subscribeToBroadcasting(a) : s === "push" && console.warn("[sendity-auth] Push transport requested, but server response does not contain broadcasting metadata");
4559
- const m = lr(s, h, u);
4601
+ let d = !1;
4602
+ s !== "polling" && h && a ? d = this.subscribeToBroadcasting(a) : s === "push" && console.warn("[sendity-auth] Push transport requested, but server response does not contain broadcasting metadata");
4603
+ const m = dr(s, h, d);
4560
4604
  m.start && this.startPolling(m.delayMs);
4561
4605
  }
4562
4606
  subscribeToBroadcasting(i) {
@@ -4595,7 +4639,7 @@ const ve = class ve extends HTMLElement {
4595
4639
  const s = () => {
4596
4640
  this.pollTimer !== null || this.authenticated || this.destroyed || (this.pollTimer = window.setInterval(() => {
4597
4641
  this.step().catch((a) => console.warn("[sendity-auth] poll failed", a));
4598
- }, sr));
4642
+ }, or));
4599
4643
  };
4600
4644
  i > 0 ? this.fallbackPollTimer = window.setTimeout(() => {
4601
4645
  this.fallbackPollTimer = null, s();
@@ -4678,7 +4722,7 @@ const ve = class ve extends HTMLElement {
4678
4722
  }
4679
4723
  async fetchAuthorizationAfterAuthenticatedSignal() {
4680
4724
  this.currentConfig || (this.currentConfig = this.resolveConfig());
4681
- const i = yt(me(), this.currentConfig.serverUrl, this.currentConfig.publicKey), s = this.activeAuthRequestId ?? i?.id, a = this.activeAuthRequestSecret ?? i?.clientSecret;
4725
+ const i = bt(me(), this.currentConfig.serverUrl, this.currentConfig.publicKey), s = this.activeAuthRequestId ?? i?.id, a = this.activeAuthRequestSecret ?? i?.clientSecret;
4682
4726
  if (!s || !a)
4683
4727
  throw new Error("Cannot fetch authorization without an active auth request id and client secret");
4684
4728
  const h = await fetch(
@@ -4687,9 +4731,9 @@ const ve = class ve extends HTMLElement {
4687
4731
  );
4688
4732
  if (!h.ok)
4689
4733
  throw new Error(`Authorization fetch failed: ${h.status}`);
4690
- const u = await h.json();
4691
- if (u.status === "verified" && u.authorization) {
4692
- this.handleAuthenticated(u);
4734
+ const d = await h.json();
4735
+ if (d.status === "verified" && d.authorization) {
4736
+ this.handleAuthenticated(d);
4693
4737
  return;
4694
4738
  }
4695
4739
  throw new Error("Verified auth request did not include authorization");
@@ -4704,7 +4748,7 @@ const ve = class ve extends HTMLElement {
4704
4748
  this.currentConfig && this.renderVerifiers(this.currentConfig.verifyUrls);
4705
4749
  }
4706
4750
  showPlaceholderCode() {
4707
- this.codeEl && (this.lastCode = void 0, this.spinnerEl?.setAttribute("hidden", ""), this.codeEl.textContent = this.randomPlaceholderCode(), this.codeEl.removeAttribute("hidden"), this.codeContainerEl?.classList.remove("code--active", "code--verified", "code--expired", "code--exiting", "code--collapsed"), this.codeContainerEl?.classList.add("code--placeholder"), this.codeContainerEl?.removeAttribute("aria-hidden"), this.promptEl?.setAttribute("hidden", ""), this.successEl?.setAttribute("hidden", ""));
4751
+ this.codeEl && (this.lastCode = void 0, this.spinnerEl?.setAttribute("hidden", ""), this.codeEl.textContent = this.randomPlaceholderCode(), this.codeEl.removeAttribute("hidden"), this.rootEl?.classList.remove("sendity--expired", "sendity--verified"), this.codeContainerEl?.classList.remove("code--active", "code--verified", "code--expired", "code--exiting", "code--collapsed"), this.codeContainerEl?.classList.add("code--placeholder"), this.codeContainerEl?.removeAttribute("aria-hidden"), this.promptEl?.setAttribute("hidden", ""), this.successEl?.setAttribute("hidden", ""));
4708
4752
  }
4709
4753
  randomPlaceholderCode() {
4710
4754
  const i = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", s = () => i[Math.floor(Math.random() * i.length)], a = () => `${s()}${s()}${s()}`;
@@ -4717,14 +4761,14 @@ const ve = class ve extends HTMLElement {
4717
4761
  this.spinnerEl?.removeAttribute("hidden"), this.codeContainerEl?.classList.remove("code--active", "code--verified", "code--expired", "code--placeholder"), this.codeEl?.setAttribute("hidden", ""), this.promptEl?.setAttribute("hidden", ""), this.successEl?.setAttribute("hidden", "");
4718
4762
  }
4719
4763
  showCodeState() {
4720
- if (this.spinnerEl?.setAttribute("hidden", ""), this.codeContainerEl?.classList.remove("code--verified", "code--placeholder"), this.codeContainerEl?.classList.remove("code--exiting", "code--collapsed"), this.codeContainerEl?.classList.add("code--active"), this.codeContainerEl?.removeAttribute("aria-hidden"), this.verifiersEl?.classList.remove("verifiers--exiting"), this.verifiersEl?.removeAttribute("aria-hidden"), this.codeEl?.removeAttribute("hidden"), this.currentConfig && this.promptEl) {
4764
+ if (this.spinnerEl?.setAttribute("hidden", ""), this.rootEl?.classList.remove("sendity--expired", "sendity--verified"), this.codeContainerEl?.classList.remove("code--verified", "code--placeholder"), this.codeContainerEl?.classList.remove("code--exiting", "code--collapsed"), this.codeContainerEl?.classList.add("code--active"), this.codeContainerEl?.removeAttribute("aria-hidden"), this.verifiersEl?.classList.remove("verifiers--exiting"), this.verifiersEl?.removeAttribute("aria-hidden"), this.codeEl?.removeAttribute("hidden"), this.currentConfig && this.promptEl) {
4721
4765
  const i = V(this.currentConfig.lang);
4722
4766
  this.promptEl.textContent = i.ui.sendCodePrompt, this.promptEl.classList.remove("prompt--exiting"), this.promptEl.removeAttribute("aria-hidden"), this.promptEl.removeAttribute("hidden");
4723
4767
  }
4724
4768
  this.successEl?.setAttribute("hidden", "");
4725
4769
  }
4726
4770
  showSuccess(i) {
4727
- this.spinnerEl?.setAttribute("hidden", ""), this.codeContainerEl?.classList.remove("code--active", "code--placeholder"), this.codeContainerEl?.classList.add("code--verified", "code--exiting"), this.promptEl?.classList.add("prompt--exiting"), this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.stopCountdown();
4771
+ this.rootEl?.classList.remove("sendity--expired"), this.rootEl?.classList.add("sendity--verified"), this.spinnerEl?.setAttribute("hidden", ""), this.codeContainerEl?.classList.remove("code--active", "code--placeholder"), this.codeContainerEl?.classList.add("code--verified", "code--exiting"), this.promptEl?.classList.add("prompt--exiting"), this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.stopCountdown();
4728
4772
  const s = this.isFooterHidden();
4729
4773
  if (this.footerEl && (this.footerEl.hidden = s, this.footerEl.classList.remove("footer--leaving"), s || (this.footerEl.classList.add("footer--waiting", "footer--transitioning", "footer--verified"), window.setTimeout(() => {
4730
4774
  this.footerEl?.classList.remove("footer--transitioning"), this.footerBrandEl && (this.footerBrandEl.hidden = !0);
@@ -4753,8 +4797,8 @@ const ve = class ve extends HTMLElement {
4753
4797
  if (h.protocol === "mailto:")
4754
4798
  return decodeURIComponent(h.pathname || h.href.replace(/^mailto:/, "").split("?")[0]) || null;
4755
4799
  if (h.protocol === "whatsapp:" || h.protocol === "whatsapp://") {
4756
- const u = h.searchParams.get("phone") || h.pathname.replace(/^\/+/, "");
4757
- return u ? `+${u.replace(/^\+/, "")}` : null;
4800
+ const d = h.searchParams.get("phone") || h.pathname.replace(/^\/+/, "");
4801
+ return d ? `+${d.replace(/^\+/, "")}` : null;
4758
4802
  }
4759
4803
  } catch {
4760
4804
  if (a.startsWith("mailto:")) return a.replace(/^mailto:/, "").split("?")[0] || null;
@@ -4776,8 +4820,8 @@ const ve = class ve extends HTMLElement {
4776
4820
  const R = document.createElement("span");
4777
4821
  R.textContent = s.lang === "de" ? "oder" : s.lang === "fr" ? "ou" : "or", w.appendChild(R), this.verifiersEl.appendChild(w);
4778
4822
  }
4779
- const u = document.createElement("div");
4780
- u.className = "opt";
4823
+ const d = document.createElement("div");
4824
+ d.className = "opt";
4781
4825
  const m = document.createElement("a");
4782
4826
  m.className = "chan " + this.channelClass(a), m.href = this.buildLink(a, s.lang), m.target = "_blank", m.rel = "noopener noreferrer", m.addEventListener("click", () => {
4783
4827
  this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.showFooterWaitingState();
@@ -4787,14 +4831,14 @@ const ve = class ve extends HTMLElement {
4787
4831
  const w = document.createElement("span");
4788
4832
  w.className = "icon", w.setAttribute("aria-hidden", "true"), w.innerHTML = g, m.appendChild(w);
4789
4833
  }
4790
- const b = document.createElement("span");
4791
- b.className = "label", b.textContent = this.channelLabel(a, s.lang), m.appendChild(b), u.appendChild(m);
4792
- const _ = this.destinationText(a, s.lang);
4793
- if (_) {
4834
+ const y = document.createElement("span");
4835
+ y.className = "label", y.textContent = this.channelLabel(a, s.lang), m.appendChild(y), d.appendChild(m);
4836
+ const E = this.destinationText(a, s.lang);
4837
+ if (E) {
4794
4838
  const w = document.createElement("a");
4795
- w.className = "dest", w.href = m.href, w.target = "_blank", w.rel = "noopener noreferrer", w.textContent = _, u.appendChild(w);
4839
+ w.className = "dest", w.href = m.href, w.target = "_blank", w.rel = "noopener noreferrer", w.textContent = E, d.appendChild(w);
4796
4840
  }
4797
- this.verifiersEl.appendChild(u);
4841
+ this.verifiersEl.appendChild(d);
4798
4842
  });
4799
4843
  }
4800
4844
  channelClass(i) {
@@ -4813,8 +4857,8 @@ const ve = class ve extends HTMLElement {
4813
4857
  if (h === "email") return a.labels.email;
4814
4858
  if (h === "whatsapp") return a.labels.whatsapp;
4815
4859
  try {
4816
- const u = new URL(i, window.location.origin);
4817
- return u.protocol.startsWith("http") ? u.hostname : u.protocol.replace(":", "");
4860
+ const d = new URL(i, window.location.origin);
4861
+ return d.protocol.startsWith("http") ? d.hostname : d.protocol.replace(":", "");
4818
4862
  } catch {
4819
4863
  return i;
4820
4864
  }
@@ -4822,17 +4866,17 @@ const ve = class ve extends HTMLElement {
4822
4866
  destinationText(i, s) {
4823
4867
  const h = V(s).ui.toPrefix ?? "to";
4824
4868
  try {
4825
- const u = new URL(i, window.location.origin);
4826
- if (u.protocol === "mailto:") {
4827
- const m = decodeURIComponent(u.pathname || u.href.replace(/^mailto:/, "").split("?")[0]);
4869
+ const d = new URL(i, window.location.origin);
4870
+ if (d.protocol === "mailto:") {
4871
+ const m = decodeURIComponent(d.pathname || d.href.replace(/^mailto:/, "").split("?")[0]);
4828
4872
  return m ? `${h} ${m}` : null;
4829
4873
  }
4830
- if (u.protocol === "whatsapp:" || u.protocol === "whatsapp://") {
4831
- const m = u.searchParams.get("phone") || u.pathname.replace(/^\/+/, "");
4874
+ if (d.protocol === "whatsapp:" || d.protocol === "whatsapp://") {
4875
+ const m = d.searchParams.get("phone") || d.pathname.replace(/^\/+/, "");
4832
4876
  return m ? `${h} +${m.replace(/^\+/, "")}` : null;
4833
4877
  }
4834
- if (u.protocol.startsWith("http") && (u.hostname === "wa.me" || u.hostname === "api.whatsapp.com")) {
4835
- const m = u.pathname.replace(/^\/+/, "").replace(/[^0-9]/g, "");
4878
+ if (d.protocol.startsWith("http") && (d.hostname === "wa.me" || d.hostname === "api.whatsapp.com")) {
4879
+ const m = d.pathname.replace(/^\/+/, "").replace(/[^0-9]/g, "");
4836
4880
  return m ? `${h} +${m}` : null;
4837
4881
  }
4838
4882
  } catch {
@@ -4843,10 +4887,10 @@ const ve = class ve extends HTMLElement {
4843
4887
  try {
4844
4888
  const s = new URL(i, window.location.origin);
4845
4889
  if (s.protocol === "mailto:") return vt;
4846
- if (s.protocol === "whatsapp:" || s.protocol === "whatsapp://") return bt;
4890
+ if (s.protocol === "whatsapp:" || s.protocol === "whatsapp://") return yt;
4847
4891
  } catch {
4848
4892
  if (i.startsWith("mailto:")) return vt;
4849
- if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) return bt;
4893
+ if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) return yt;
4850
4894
  }
4851
4895
  return null;
4852
4896
  }
@@ -4860,18 +4904,18 @@ const ve = class ve extends HTMLElement {
4860
4904
  }
4861
4905
  }
4862
4906
  buildLink(i, s) {
4863
- const a = this.lastCode, h = V(s), u = window.location.host;
4907
+ const a = this.lastCode, h = V(s), d = window.location.host;
4864
4908
  if (!a) return i;
4865
4909
  if (i.startsWith("mailto:")) {
4866
- const [m, g = ""] = i.split("?"), b = new URLSearchParams(g), _ = this.applyTemplate(h.templates.emailSubject, u, a), w = this.applyTemplate(h.templates.emailBody, u, a);
4867
- b.set("subject", _), b.set("body", w);
4868
- const R = this.toQuery(b);
4910
+ const [m, g = ""] = i.split("?"), y = new URLSearchParams(g), E = this.applyTemplate(h.templates.emailSubject, d, a), w = this.applyTemplate(h.templates.emailBody, d, a);
4911
+ y.set("subject", E), y.set("body", w);
4912
+ const R = this.toQuery(y);
4869
4913
  return `${m}?${R}`;
4870
4914
  }
4871
4915
  if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) {
4872
- const [m, g = ""] = i.split("?"), b = new URLSearchParams(g), _ = this.applyTemplate(h.templates.whatsappText, u, a);
4873
- b.set("text", _);
4874
- const w = this.toQuery(b);
4916
+ const [m, g = ""] = i.split("?"), y = new URLSearchParams(g), E = this.applyTemplate(h.templates.whatsappText, d, a);
4917
+ y.set("text", E);
4918
+ const w = this.toQuery(y);
4875
4919
  return `${m}?${w}`;
4876
4920
  }
4877
4921
  return i;
@@ -4885,8 +4929,8 @@ const ve = class ve extends HTMLElement {
4885
4929
  toQuery(i) {
4886
4930
  const s = [];
4887
4931
  return i.forEach((a, h) => {
4888
- const u = encodeURIComponent(h), m = encodeURIComponent(a);
4889
- s.push(`${u}=${m}`);
4932
+ const d = encodeURIComponent(h), m = encodeURIComponent(a);
4933
+ s.push(`${d}=${m}`);
4890
4934
  }), s.join("&");
4891
4935
  }
4892
4936
  joinUrl(i, s) {