@talkjs/core 1.6.1 → 1.6.2

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.
@@ -56,7 +56,7 @@ var __async = (__this, __arguments, generator) => {
56
56
  step((generator = generator.apply(__this, __arguments)).next());
57
57
  });
58
58
  };
59
- var _a, _e2, _t2;
59
+ var _a, _b, _e2, _t2;
60
60
  function e(e2, s2) {
61
61
  if (s2.ok) return s2.value.data;
62
62
  if ("SESSION_DESTROYED" === s2.value) throw new Error(`${e2} failed because the session was destroyed`);
@@ -135,7 +135,7 @@ let p = null;
135
135
  function f({ WebSocket: e2 }) {
136
136
  p = e2;
137
137
  }
138
- class g {
138
+ class m {
139
139
  constructor(e2, t2) {
140
140
  this.realtimeUrl = e2, this.handlers = t2, this.socket = null, this.stateMachine = new u("ReconnectingSocket", ["STOPPED", "CONNECTING", "READY", "DISCONNECTED", "TERMINATED"], { startWs: { from: ["STOPPED", "DISCONNECTED"], to: "CONNECTING", afterTransition: () => {
141
141
  const e3 = new (function() {
@@ -184,9 +184,9 @@ class g {
184
184
  this.stateMachine.transition("destroy");
185
185
  }
186
186
  }
187
- class m {
187
+ class g {
188
188
  constructor(e2, t2) {
189
- this.handlers = t2, this.socket = new g(e2, { onOpen: () => this.handlers.onOpen(), onClose: () => this.handlers.onClose(), onMessage: (e3) => this.onWebSocketMessage(e3) });
189
+ this.handlers = t2, this.socket = new m(e2, { onOpen: () => this.handlers.onOpen(), onClose: () => this.handlers.onClose(), onMessage: (e3) => this.onWebSocketMessage(e3) });
190
190
  }
191
191
  call(e2, t2, s2, n2) {
192
192
  const r2 = `/${s2.map((e3) => encodeURIComponent(e3)).join("/")}`, i2 = JSON.stringify([e2, t2, r2, n2]);
@@ -235,7 +235,8 @@ class v {
235
235
  void 0 !== this.timeout && (clearTimeout(this.timeout), this.timeout = void 0);
236
236
  }
237
237
  }
238
- class w {
238
+ const w = "undefined" != typeof window ? (_a = window.queueMicrotask) != null ? _a : setTimeout : setTimeout;
239
+ class b {
239
240
  constructor() {
240
241
  this.i = -1;
241
242
  }
@@ -246,9 +247,9 @@ class w {
246
247
  this.i = -1;
247
248
  }
248
249
  }
249
- class b {
250
+ class y {
250
251
  constructor(e2, t2) {
251
- this.handlers = t2, this.seqCounter = new w(), this.responseHandlers = {}, this.heartbeats = new y(this), this.socket = new m(e2, { onUpstreamRestarting: () => {
252
+ this.handlers = t2, this.seqCounter = new b(), this.responseHandlers = {}, this.heartbeats = new C(this), this.socket = new g(e2, { onUpstreamRestarting: () => {
252
253
  this.heartbeats.serverActive(), this.handlers.onUpstreamRestarting();
253
254
  }, onOpen: () => {
254
255
  this.heartbeats.clientActive(), this.heartbeats.serverActive(), this.handlers.onReady();
@@ -264,11 +265,19 @@ class b {
264
265
  this.heartbeats.serverActive(), this.handlers.onAuthExpired();
265
266
  } });
266
267
  }
268
+ sync() {
269
+ return __async(this, null, function* () {
270
+ yield new Promise((e3) => w(() => e3()));
271
+ const e2 = Object.values(this.responseHandlers).map((e3) => e3.promise.catch(() => {
272
+ }));
273
+ return Promise.all(e2);
274
+ });
275
+ }
267
276
  call(e2, t2, s2) {
268
277
  const n2 = this.seqCounter.next(), r2 = d();
269
278
  this.responseHandlers[n2] = r2;
270
279
  const i2 = this.socket.call(n2, e2, t2, s2);
271
- return i2.ok || r2.resolve(i2), this.heartbeats.clientActive(), r2.promise;
280
+ return i2.ok || (r2.resolve(i2), delete this.responseHandlers[n2]), this.heartbeats.clientActive(), r2.promise;
272
281
  }
273
282
  onResponse(e2, t2, s2) {
274
283
  return __async(this, null, function* () {
@@ -291,7 +300,7 @@ class b {
291
300
  this.socket.terminate();
292
301
  }
293
302
  }
294
- class y {
303
+ class C {
295
304
  constructor(e2) {
296
305
  this.connection = e2, this.clientInactivityTimer = new v(25e3), this.serverInactivityTimer = new v(1e4), this.serverTimeoutTimer = new v(5e3);
297
306
  }
@@ -315,7 +324,7 @@ class y {
315
324
  });
316
325
  }
317
326
  }
318
- class C {
327
+ class A {
319
328
  constructor(e2, t2, s2) {
320
329
  this.authProvider = t2, this.handlers = s2, this.stateMachine = new u("AuthenticatedConnection", ["WAITING_FOR_WS", "LOGGING_IN", "RENEWING_SESSION", "READY", "TERMINATED"], { logIn: { from: ["WAITING_FOR_WS"], to: "LOGGING_IN", afterTransition: () => __async(this, null, function* () {
321
330
  yield this.renewSession();
@@ -333,7 +342,7 @@ class C {
333
342
  "READY" !== e3 && "RENEWING_SESSION" !== e3 || this.handlers.onNotReady(), this.authProvider.clearScheduledRefresh();
334
343
  } }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
335
344
  this.authProvider.clearScheduledRefresh(), this.connection.destroy();
336
- } } }), this.connection = new b(e2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onReady: () => this.stateMachine.transition("logIn"), onNotReady: () => {
345
+ } } }), this.connection = new y(e2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onReady: () => this.stateMachine.transition("logIn"), onNotReady: () => {
337
346
  this.stateMachine.transition("wsDisconnected");
338
347
  }, onAuthExpired: () => {
339
348
  this.stateMachine.transition("authExpired");
@@ -343,6 +352,11 @@ class C {
343
352
  "READY" === this.stateMachine.state && this.stateMachine.transition("scheduledReauth");
344
353
  });
345
354
  }
355
+ sync() {
356
+ return __async(this, null, function* () {
357
+ return this.connection.sync();
358
+ });
359
+ }
346
360
  call(e2, t2, s2) {
347
361
  const n2 = this.connection.call(e2, t2, s2);
348
362
  return n2.then((e3) => {
@@ -382,7 +396,7 @@ class C {
382
396
  });
383
397
  }
384
398
  }
385
- class A {
399
+ class E {
386
400
  constructor(e2, t2, s2) {
387
401
  this.handlers = s2, this.stateMachine = new u("StopStartConnection", ["STOPPED", "WAITING_FOR_WS", "READY", "TERMINATED"], { unexpectedDisconnect: { from: ["READY"], to: "WAITING_FOR_WS", afterTransition: () => {
388
402
  this.inactivityTimer.stop(), this.handlers.onNotReady();
@@ -396,7 +410,7 @@ class A {
396
410
  }), this.handlers.onReady();
397
411
  } }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
398
412
  this.inactivityTimer.stop(), this.connection.destroy();
399
- } } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new v(3e3), this.connection = new C(e2, t2, { onUpstreamRestarting: () => {
413
+ } } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new v(3e3), this.connection = new A(e2, t2, { onUpstreamRestarting: () => {
400
414
  this.handlers.onUpstreamRestarting();
401
415
  }, onReady: () => {
402
416
  this.stateMachine.transition("ready");
@@ -409,6 +423,11 @@ class A {
409
423
  get inactive() {
410
424
  return 0 === this.pendingCalls && 0 === this.activeSubscriptions;
411
425
  }
426
+ sync() {
427
+ return __async(this, null, function* () {
428
+ return this.connection.sync();
429
+ });
430
+ }
412
431
  ensureStarted() {
413
432
  this.stateMachine.canTransition("start") && this.stateMachine.transition("start");
414
433
  }
@@ -430,7 +449,7 @@ class A {
430
449
  logTrace(e2, t2, s2) {
431
450
  }
432
451
  }
433
- class E {
452
+ class k {
434
453
  constructor(e2, t2, s2) {
435
454
  this.handlers = s2, this.stateMachine = new u("QueuedConnection", ["NOT_READY", "PROCESSING_QUEUE", "READY", "TERMINATED"], { processQueue: { from: ["NOT_READY"], to: "PROCESSING_QUEUE", afterTransition: () => {
436
455
  this.sendQueuedCalls();
@@ -445,7 +464,7 @@ class E {
445
464
  e3 == null ? void 0 : e3.clientErr("SESSION_DESTROYED");
446
465
  }
447
466
  this.connection.destroy();
448
- } } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new A(e2, t2, { onUpstreamRestarting: () => {
467
+ } } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new E(e2, t2, { onUpstreamRestarting: () => {
449
468
  this.handlers.onUpstreamRestarting();
450
469
  }, onReady: () => {
451
470
  this.stateMachine.transition("processQueue");
@@ -455,6 +474,11 @@ class E {
455
474
  this.handlers.onPublish(e3, t3);
456
475
  } });
457
476
  }
477
+ sync() {
478
+ return __async(this, null, function* () {
479
+ return this.connection.sync();
480
+ });
481
+ }
458
482
  call(e2, t2, s2) {
459
483
  return "READY" === this.stateMachine.state ? this.connection.call(e2, t2, s2) : ("NOT_READY" === this.stateMachine.state && this.connection.ensureStarted(), "SUBSCRIBE" === e2 || "UNSUBSCRIBE" === e2 ? this._subscribe(e2, t2, s2) : this._call(e2, t2, s2));
460
484
  }
@@ -496,10 +520,10 @@ class E {
496
520
  return "READY" === this.stateMachine.state || "PROCESSING_QUEUE" === this.stateMachine.state;
497
521
  }
498
522
  }
499
- const k = "undefined" != typeof window ? (_a = window.queueMicrotask) != null ? _a : setTimeout : setTimeout;
500
- class x {
523
+ const x = "undefined" != typeof window ? (_b = window.queueMicrotask) != null ? _b : setTimeout : setTimeout;
524
+ class T {
501
525
  constructor(e2, t2) {
502
- this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false, k(() => this.send());
526
+ this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false, x(() => this.send());
503
527
  }
504
528
  send() {
505
529
  this.sent || (this.sent = true, this.clearPendingBatch(), this.sendCalls());
@@ -508,14 +532,14 @@ class x {
508
532
  this.sent = true;
509
533
  }
510
534
  }
511
- class T extends x {
535
+ class I extends T {
512
536
  constructor(e2, t2) {
513
537
  super(t2, () => {
514
538
  this.sendSubscribe(), this.sendGet();
515
539
  }), this.connection = e2, this.getCalls = [], this.subscribeCalls = [];
516
540
  }
517
541
  canPush(e2, t2) {
518
- return T.isCorrectBatchTypeFor(e2, t2);
542
+ return I.isCorrectBatchTypeFor(e2, t2);
519
543
  }
520
544
  static isCorrectBatchTypeFor(e2, t2) {
521
545
  return s(t2, ["users", "*"]) && ("GET" === e2 || "SUBSCRIBE" === e2);
@@ -541,12 +565,12 @@ class T extends x {
541
565
  this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
542
566
  }
543
567
  }
544
- class I extends x {
568
+ class D extends T {
545
569
  constructor(e2, t2, s2) {
546
570
  super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
547
571
  }
548
572
  canPush(e2, t2) {
549
- return !!I.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
573
+ return !!D.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
550
574
  }
551
575
  static isCorrectBatchTypeFor(e2, t2) {
552
576
  return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
@@ -567,9 +591,14 @@ class I extends x {
567
591
  });
568
592
  }
569
593
  }
570
- class D {
594
+ class S {
571
595
  constructor(e2, t2, s2) {
572
- this.pendingBatch = null, this.connection = new E(e2, t2, s2);
596
+ this.pendingBatch = null, this.connection = new k(e2, t2, s2);
597
+ }
598
+ sync() {
599
+ return __async(this, null, function* () {
600
+ return this.connection.sync();
601
+ });
573
602
  }
574
603
  call(e2, t2, s2) {
575
604
  return __async(this, null, function* () {
@@ -588,18 +617,23 @@ class D {
588
617
  return this.connection.isConnected();
589
618
  }
590
619
  createEmptyBatchFor(e2, t2) {
591
- if (T.isCorrectBatchTypeFor(e2, t2)) return new T(this.connection, () => this.pendingBatch = null);
592
- if (I.isCorrectBatchTypeFor(e2, t2)) {
620
+ if (I.isCorrectBatchTypeFor(e2, t2)) return new I(this.connection, () => this.pendingBatch = null);
621
+ if (D.isCorrectBatchTypeFor(e2, t2)) {
593
622
  const e3 = t2[1];
594
- return new I(e3, this.connection, () => this.pendingBatch = null);
623
+ return new D(e3, this.connection, () => this.pendingBatch = null);
595
624
  }
596
625
  return null;
597
626
  }
598
627
  }
599
- const S = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
600
- class M {
628
+ const M = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
629
+ class F {
601
630
  constructor(e2, t2, s2) {
602
- this.throttler = new F(), this.alive = true, this.connection = new D(e2, t2, s2);
631
+ this.throttler = new B(), this.alive = true, this.connection = new S(e2, t2, s2);
632
+ }
633
+ sync() {
634
+ return __async(this, null, function* () {
635
+ return this.connection.sync();
636
+ });
603
637
  }
604
638
  call(e2, t2, s2) {
605
639
  return __async(this, null, function* () {
@@ -608,7 +642,7 @@ class M {
608
642
  const r2 = yield this.connection.call(e2, t2, s2);
609
643
  if ((r2.ok || "client" !== r2.where || "SOCKET_NOT_READY" !== r2.value) && (r2.ok || "server" !== r2.where || 500 !== r2.value.status) || n2++, 10 === n2) return r2;
610
644
  if (r2.ok || "client" !== r2.where) {
611
- const e3 = r2.value, t3 = e3.status, s3 = S[t3];
645
+ const e3 = r2.value, t3 = e3.status, s3 = M[t3];
612
646
  if ("RESOLVE" === s3) return this.throttler.resetDelay(), r2;
613
647
  if ("RETRY" === s3) continue;
614
648
  if ("DELAY" === s3) {
@@ -630,7 +664,7 @@ class M {
630
664
  return this.connection.isConnected();
631
665
  }
632
666
  }
633
- class F {
667
+ class B {
634
668
  constructor() {
635
669
  this.initialDelayMs = 200, this.exponentialFactor = 1.2, this.maxDelayMs = 3e4, this.currentDelayMs = this.initialDelayMs, this.lastCall = 0;
636
670
  }
@@ -645,21 +679,21 @@ class F {
645
679
  this.currentDelayMs = this.initialDelayMs;
646
680
  }
647
681
  }
648
- function B(e2) {
682
+ function R(e2) {
649
683
  return e2.map((e3) => encodeURIComponent(e3)).join();
650
684
  }
651
- class R {
685
+ class N {
652
686
  constructor() {
653
687
  this.paths = {};
654
688
  }
655
689
  add(e2) {
656
- this.paths[B(e2)] = e2;
690
+ this.paths[R(e2)] = e2;
657
691
  }
658
692
  delete(e2) {
659
- delete this.paths[B(e2)];
693
+ delete this.paths[R(e2)];
660
694
  }
661
695
  has(e2) {
662
- return Object.hasOwnProperty.call(this.paths, B(e2));
696
+ return Object.hasOwnProperty.call(this.paths, R(e2));
663
697
  }
664
698
  clear() {
665
699
  this.paths = {};
@@ -668,9 +702,9 @@ class R {
668
702
  Object.values(this.paths).forEach((t2) => e2(t2));
669
703
  }
670
704
  }
671
- class N {
705
+ class _ {
672
706
  constructor(e2, t2, s2) {
673
- this.handlers = s2, this.targetSubscriptions = new R(), this.connection = new M(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
707
+ this.handlers = s2, this.targetSubscriptions = new N(), this.connection = new F(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
674
708
  this.targetSubscriptions.forEach((e3) => {
675
709
  this.resubscribe(e3);
676
710
  }), this.handlers.onResubscribeSent();
@@ -678,6 +712,11 @@ class N {
678
712
  this.handlers.onPublish(e3, t3);
679
713
  } });
680
714
  }
715
+ sync() {
716
+ return __async(this, null, function* () {
717
+ return this.connection.sync();
718
+ });
719
+ }
681
720
  call(e2, t2, s2) {
682
721
  return this.connection.call(e2, t2, s2);
683
722
  }
@@ -704,22 +743,22 @@ class N {
704
743
  return this.connection.isConnected();
705
744
  }
706
745
  }
707
- function _(e2) {
746
+ function O(e2) {
708
747
  return Object.freeze(e2);
709
748
  }
710
- function O(e2) {
711
- return _(e2.map((e3) => function(e4) {
749
+ function P(e2) {
750
+ return O(e2.map((e3) => function(e4) {
712
751
  switch (e4.type) {
713
752
  case "text":
714
- return Object.freeze({ type: "text", children: P(e4.children) });
753
+ return Object.freeze({ type: "text", children: j(e4.children) });
715
754
  case "file":
716
755
  case "location":
717
756
  return Object.freeze(e4);
718
757
  }
719
758
  }(e3)));
720
759
  }
721
- function P(e2) {
722
- return _(e2.map((e3) => function(e4) {
760
+ function j(e2) {
761
+ return O(e2.map((e3) => function(e4) {
723
762
  if ("string" == typeof e4) return e4;
724
763
  switch (e4.type) {
725
764
  case "bold":
@@ -730,7 +769,7 @@ function P(e2) {
730
769
  case "link":
731
770
  case "actionLink":
732
771
  case "actionButton":
733
- return Object.freeze(__spreadProps(__spreadValues({}, e4), { children: P(e4.children) }));
772
+ return Object.freeze(__spreadProps(__spreadValues({}, e4), { children: j(e4.children) }));
734
773
  case "mention":
735
774
  case "autoLink":
736
775
  case "codeSpan":
@@ -739,41 +778,41 @@ function P(e2) {
739
778
  }
740
779
  }(e3)));
741
780
  }
742
- function j(e2, t2) {
743
- return void 0 === t2 ? e2 : t2;
744
- }
745
781
  function U(e2, t2) {
746
- return void 0 === t2 ? e2 : _(t2);
782
+ return void 0 === t2 ? e2 : t2;
747
783
  }
748
784
  function $(e2, t2) {
785
+ return void 0 === t2 ? e2 : O(t2);
786
+ }
787
+ function W(e2, t2) {
749
788
  if (void 0 === t2) return e2;
750
- if (null === t2) return _({});
789
+ if (null === t2) return O({});
751
790
  const s2 = __spreadValues({}, e2);
752
791
  for (const e3 in t2) {
753
792
  const n2 = t2[e3];
754
793
  null === n2 ? delete s2[e3] : s2[e3] = n2;
755
794
  }
756
- return _(s2);
795
+ return O(s2);
757
796
  }
758
- function W(e2, t2) {
797
+ function q(e2, t2) {
759
798
  if (e2 === t2) return true;
760
799
  if (!e2 || !t2) return false;
761
800
  if ("object" != typeof e2 || "object" != typeof t2) return false;
762
801
  if (e2.constructor !== t2.constructor) return false;
763
802
  if (Array.isArray(e2) && Array.isArray(t2)) {
764
803
  if (e2.length !== t2.length) return false;
765
- for (let s2 = 0; s2 < e2.length; s2++) if (!W(e2[s2], t2[s2])) return false;
804
+ for (let s2 = 0; s2 < e2.length; s2++) if (!q(e2[s2], t2[s2])) return false;
766
805
  } else {
767
806
  const s2 = Object.keys(e2);
768
807
  if (s2.length !== Object.keys(t2).length) return false;
769
808
  for (const n2 of s2) {
770
809
  if (!Object.hasOwnProperty.call(t2, n2)) return false;
771
- if (!W(e2[n2], t2[n2])) return false;
810
+ if (!q(e2[n2], t2[n2])) return false;
772
811
  }
773
812
  }
774
813
  return true;
775
814
  }
776
- class q {
815
+ class H {
777
816
  constructor() {
778
817
  this.prev = Promise.resolve();
779
818
  }
@@ -783,8 +822,14 @@ class q {
783
822
  return this.prev = t2, t2;
784
823
  });
785
824
  }
825
+ sync() {
826
+ return __async(this, null, function* () {
827
+ return this.runExclusive(() => {
828
+ });
829
+ });
830
+ }
786
831
  }
787
- class H {
832
+ class L {
788
833
  constructor(e2) {
789
834
  this.initialised = false, this.getPointer = void 0, this.pendingStates = [e2], e2.resultPromise.then(() => this.initialised = true);
790
835
  }
@@ -796,10 +841,10 @@ class H {
796
841
  return (_a2 = this.pendingPointer) != null ? _a2 : this.getPointer;
797
842
  }
798
843
  canAppendState(e2) {
799
- var _a2, _b;
844
+ var _a2, _b2;
800
845
  const t2 = (_a2 = this.getPointer) == null ? void 0 : _a2.seq;
801
846
  if (void 0 !== t2 && e2 <= t2) return false;
802
- const s2 = (_b = this.pendingPointer) == null ? void 0 : _b.seq;
847
+ const s2 = (_b2 = this.pendingPointer) == null ? void 0 : _b2.seq;
803
848
  return !(void 0 !== s2 && e2 < s2);
804
849
  }
805
850
  set(e2) {
@@ -817,7 +862,7 @@ class H {
817
862
  return this.getPointer;
818
863
  }
819
864
  }
820
- class L extends H {
865
+ class G extends L {
821
866
  constructor(e2, t2) {
822
867
  super(e2), this.onTeardown = t2, this._error = null, this._lastGoodState = Promise.resolve(void 0), this.registerNewState(e2.resultPromise);
823
868
  }
@@ -846,10 +891,10 @@ class L extends H {
846
891
  }));
847
892
  }
848
893
  }
849
- class G extends L {
894
+ class z extends G {
850
895
  constructor(e2, t2) {
851
896
  const s2 = new Promise((e3) => setTimeout(e3)).then(() => this.fetchInitial(e2));
852
- super({ seq: e2, resultPromise: s2 }, t2.onTeardown), this.initialSeq = e2, this.getDeepMutex = new q(), this.lastDeep = void 0;
897
+ super({ seq: e2, resultPromise: s2 }, t2.onTeardown), this.initialSeq = e2, this.getDeepMutex = new H(), this.lastDeep = void 0;
853
898
  }
854
899
  refetchInitial(e2) {
855
900
  return __async(this, null, function* () {
@@ -892,31 +937,35 @@ class G extends L {
892
937
  });
893
938
  }
894
939
  }
895
- class z extends G {
940
+ class J extends z {
896
941
  constructor(e2, t2, s2) {
897
- super(e2, s2), this.emitMutex = t2, this.unsubscribeTimer = new J(), this.referencedByOtherStores = 0, this.listeners = [], this.lastEmitSeq = void 0, this.lastEmitResult = void 0, t2.runExclusive(() => __async(this, null, function* () {
942
+ super(e2, s2), this.emitMutex = t2, this.externallyIdleTimer = new Y(), this.externallyIdle = true, this.internallyIdleTimer = new Y(), this.internallyIdle = true, this.referencedByOtherStores = 0, this.listeners = [], this.lastEmitSeq = void 0, this.lastEmitResult = void 0, t2.runExclusive(() => __async(this, null, function* () {
898
943
  yield this.emit(e2);
899
944
  }));
900
945
  }
901
946
  registerInternalSubscription() {
902
- this.referencedByOtherStores++;
947
+ this.internallyIdleTimer.stop(), this.internallyIdle = false, this.referencedByOtherStores++;
903
948
  let e2 = true;
904
949
  return () => {
905
- e2 && (e2 = false, this.referencedByOtherStores--, this.startUnsubscribeTimerIfOrphan());
950
+ e2 && (e2 = false, this.referencedByOtherStores--, 0 === this.referencedByOtherStores && this.internallyIdleTimer.restart(() => {
951
+ this.internallyIdle = true, this.tryFullyUnsubscribe();
952
+ }, this.unsubscribeDebounceMs), this.tryFullyUnsubscribe());
906
953
  };
907
954
  }
908
955
  get onlyUsedInternally() {
909
956
  return 0 === this.listeners.length;
910
957
  }
911
958
  listen(e2) {
912
- return this.unsubscribeTimer.stop(), this.listeners.push(e2), void 0 !== this.lastEmitResult && e2(this.lastEmitResult), () => {
913
- this.listeners = this.listeners.filter((t2) => t2 !== e2), this.startUnsubscribeTimerIfOrphan();
959
+ this.externallyIdleTimer.stop(), this.externallyIdle = false, this.listeners.push(e2), void 0 !== this.lastEmitResult && e2(this.lastEmitResult);
960
+ let t2 = true;
961
+ return () => {
962
+ t2 && (t2 = false, this.listeners = this.listeners.filter((t3) => t3 !== e2), 0 === this.listeners.length && this.externallyIdleTimer.restart(() => {
963
+ this.externallyIdle = true, this.tryFullyUnsubscribe();
964
+ }, this.unsubscribeDebounceMs));
914
965
  };
915
966
  }
916
- startUnsubscribeTimerIfOrphan() {
917
- 0 === this.referencedByOtherStores && 0 === this.listeners.length && this.unsubscribeTimer.restart(() => {
918
- this.setError(l("UNSUBSCRIBED"));
919
- }, this.unsubscribeDebounceMs);
967
+ tryFullyUnsubscribe() {
968
+ this.externallyIdle && this.internallyIdle && this.setError(l("UNSUBSCRIBED"));
920
969
  }
921
970
  emit(e2) {
922
971
  return __async(this, null, function* () {
@@ -929,7 +978,7 @@ class z extends G {
929
978
  });
930
979
  }
931
980
  }
932
- class J {
981
+ class Y {
933
982
  constructor() {
934
983
  this.timerId = void 0;
935
984
  }
@@ -940,33 +989,33 @@ class J {
940
989
  clearTimeout(this.timerId);
941
990
  }
942
991
  }
943
- var Y, Q = {};
992
+ var Q, V = {};
944
993
  !function() {
945
- if (Y) return Q;
994
+ if (Q) return V;
946
995
  function e2(e3) {
947
996
  return String.fromCharCode(parseInt(e3.slice(1), 16));
948
997
  }
949
998
  function t2(e3) {
950
999
  return `%${`00${e3.charCodeAt(0).toString(16)}`.slice(-2)}`;
951
1000
  }
952
- Y = 1, Object.defineProperty(Q, "__esModule", { value: true }), Q.encode = function(t3) {
1001
+ Q = 1, Object.defineProperty(V, "__esModule", { value: true }), V.encode = function(t3) {
953
1002
  return btoa(encodeURIComponent(t3).replace(/%[0-9A-F]{2}/g, e2));
954
- }, Q.decode = function(e3) {
1003
+ }, V.decode = function(e3) {
955
1004
  return decodeURIComponent(Array.from(atob(e3), t2).join(""));
956
1005
  };
957
1006
  }();
958
- function V(e2, t2) {
1007
+ function Z(e2, t2) {
959
1008
  const s2 = t2.lastIndex;
960
1009
  let n2;
961
1010
  const r2 = [];
962
1011
  for (; null !== (n2 = t2.exec(e2)); ) r2.push(n2), "" === n2[0] && (t2.lastIndex += 1);
963
1012
  return t2.lastIndex = s2, r2;
964
1013
  }
965
- function Z(e2) {
1014
+ function K(e2) {
966
1015
  const t2 = e2.replace(/%2F/g, "/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/, "$1");
967
1016
  return decodeURIComponent(t2);
968
1017
  }
969
- function K(e2, t2) {
1018
+ function X(e2, t2) {
970
1019
  if (!e2() && !t2) {
971
1020
  t2 = e2.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/, "`$1`") + " was not true";
972
1021
  }
@@ -1002,55 +1051,55 @@ function K(e2, t2) {
1002
1051
  }, e2.falsy = function(e3) {
1003
1052
  }, e2.never = function(e3) {
1004
1053
  };
1005
- })(K || (K = {}));
1006
- const X = K, ee = /^\/.*[^\\]\/[im]*$/;
1007
- function te(e2) {
1008
- if (!ee.test(e2)) return false;
1009
- return !se(e2).test("");
1010
- }
1054
+ })(X || (X = {}));
1055
+ const ee = X, te = /^\/.*[^\\]\/[im]*$/;
1011
1056
  function se(e2) {
1057
+ if (!te.test(e2)) return false;
1058
+ return !ne(e2).test("");
1059
+ }
1060
+ function ne(e2) {
1012
1061
  const t2 = e2.match(/^\/(.*[^\\])\/(.*)$/);
1013
1062
  if (!t2) throw new Error(`Expected ${e2} to be a (non-empty) regex`);
1014
1063
  let s2 = t2[2] || "";
1015
1064
  return s2 = s2.replace(/[^im]/g, "") + "g", new RegExp(t2[1], s2);
1016
1065
  }
1017
- class ne {
1066
+ class re {
1018
1067
  constructor({ mode: e2, allowedHostnames: t2, allowedPhoneNrs: s2, allowedMatches: n2, forbiddenMatches: r2, forbiddenWords: i2, suppressLinks: a2, suppressEmailAddresses: o2, suppressPhoneNumbers: u2, replacement: c2 }) {
1019
- if (X.oneOf(e2, ["all", "otherOnly", "off"]), this.mode = e2, this.suppressLinks = false !== a2, this.suppressEmailAddresses = false !== o2, this.suppressPhoneNumbers = false !== u2, this.allowedHostnames = t2 || [], this.allowedPhoneNrs = (s2 || []).filter((e3) => e3).map((e3) => e3.replace(/[^0-9]/g, "")), this.allowedMatches = (n2 || []).filter(te).map((e3) => se(e3)), this.forbiddenMatches = (r2 || []).filter(te).map((e3) => se(e3)), i2) {
1068
+ if (ee.oneOf(e2, ["all", "otherOnly", "off"]), this.mode = e2, this.suppressLinks = false !== a2, this.suppressEmailAddresses = false !== o2, this.suppressPhoneNumbers = false !== u2, this.allowedHostnames = t2 || [], this.allowedPhoneNrs = (s2 || []).filter((e3) => e3).map((e3) => e3.replace(/[^0-9]/g, "")), this.allowedMatches = (n2 || []).filter(se).map((e3) => ne(e3)), this.forbiddenMatches = (r2 || []).filter(se).map((e3) => ne(e3)), i2) {
1020
1069
  const e3 = i2.split("\n").map((e4) => e4.trim().toLowerCase()).filter((e4) => e4.length > 0 && !e4.startsWith("#")).map((e4) => e4.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"));
1021
1070
  e3.length && this.forbiddenMatches.push(new RegExp(`\\b(${e3.join("|")})\\b`, "gi"));
1022
1071
  }
1023
- X(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), X(() => this.forbiddenMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"), c2 = c2 == null ? void 0 : c2.trim(), this.replacement = c2 && c2.length > 0 ? c2 : void 0;
1072
+ ee(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), ee(() => this.forbiddenMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"), c2 = c2 == null ? void 0 : c2.trim(), this.replacement = c2 && c2.length > 0 ? c2 : void 0;
1024
1073
  }
1025
1074
  shouldSuppress({ isContentBySender: e2 }) {
1026
1075
  return "all" === this.mode || "otherOnly" === this.mode && !e2;
1027
1076
  }
1028
1077
  }
1029
- function re(e2, t2) {
1078
+ function ie(e2, t2) {
1030
1079
  const s2 = e2.map((e3) => function(e4, t3) {
1031
1080
  if ("text" === e4.type) return function(e5, t4) {
1032
1081
  const s3 = function(e6) {
1033
- var _a2, _b, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m;
1082
+ var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m;
1034
1083
  let t5 = "";
1035
- return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b = e6.markup) != null ? _b : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], enableEmojiImageFallback: (_e3 = e6.enableEmojiImageFallback) != null ? _e3 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new ne({ mode: "off" }), contactInfoHiddenText: (_k = (_j = e6.contactInfoHiddenText) != null ? _j : (_i = e6.suppression) == null ? void 0 : _i.replacement) != null ? _k : t5, customEmojiUrls: (_l = e6.customEmojiUrls) != null ? _l : {}, enableActions: (_m = e6.enableActions) != null ? _m : true };
1084
+ return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b2 = e6.markup) != null ? _b2 : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], enableEmojiImageFallback: (_e3 = e6.enableEmojiImageFallback) != null ? _e3 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new re({ mode: "off" }), contactInfoHiddenText: (_k = (_j = e6.contactInfoHiddenText) != null ? _j : (_i = e6.suppression) == null ? void 0 : _i.replacement) != null ? _k : t5, customEmojiUrls: (_l = e6.customEmojiUrls) != null ? _l : {}, enableActions: (_m = e6.enableActions) != null ? _m : true };
1036
1085
  }(t4);
1037
- return ie(e5, s3);
1086
+ return ae(e5, s3);
1038
1087
  }(e4.children, t3);
1039
- if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${Z(e4.url)}`;
1040
- if ("file" === e4.type && "image" === e4.subtype) return `📷 ${Z(e4.url)}`;
1041
- if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${Z(e4.url)}`;
1088
+ if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${K(e4.url)}`;
1089
+ if ("file" === e4.type && "image" === e4.subtype) return `📷 ${K(e4.url)}`;
1090
+ if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${K(e4.url)}`;
1042
1091
  if ("file" === e4.type && "voice" === e4.subtype) {
1043
1092
  const t4 = e4.duration;
1044
1093
  if (void 0 === t4) return "🎙️";
1045
1094
  return `🎙️ (${Math.floor(t4 / 60)}:${Math.floor(t4 % 60).toString().padStart(2, "0")})`;
1046
1095
  }
1047
- if ("file" === e4.type) return e4.subtype, `📎 ${Z(e4.url)}`;
1096
+ if ("file" === e4.type) return e4.subtype, `📎 ${K(e4.url)}`;
1048
1097
  if ("location" === e4.type) return "📍";
1049
1098
  return "";
1050
1099
  }(e3, t2));
1051
1100
  return s2.join("\n\n");
1052
1101
  }
1053
- function ie(e2, t2) {
1102
+ function ae(e2, t2) {
1054
1103
  return e2.flatMap((e3) => {
1055
1104
  if ("string" == typeof e3) return e3;
1056
1105
  switch (e3.type) {
@@ -1063,13 +1112,13 @@ function ie(e2, t2) {
1063
1112
  case "actionLink":
1064
1113
  case "actionbutton":
1065
1114
  case "actionButton":
1066
- return ie(e3.children, t2);
1115
+ return ae(e3.children, t2);
1067
1116
  case "bulletlist":
1068
1117
  case "bulletList":
1069
- return "\n" + ie(e3.children, t2);
1118
+ return "\n" + ae(e3.children, t2);
1070
1119
  case "bulletpoint":
1071
1120
  case "bulletPoint":
1072
- return "- " + ie(e3.children, t2) + "\n";
1121
+ return "- " + ae(e3.children, t2) + "\n";
1073
1122
  case "autolink":
1074
1123
  case "autoLink":
1075
1124
  case "codeblock":
@@ -1087,28 +1136,28 @@ function ie(e2, t2) {
1087
1136
  }
1088
1137
  }).join("");
1089
1138
  }
1090
- function ae(e2) {
1091
- return _({ id: e2.id, name: e2.name, custom: _(e2.custom), locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage });
1139
+ function oe(e2) {
1140
+ return O({ id: e2.id, name: e2.name, custom: O(e2.custom), locale: e2.locale, photoUrl: e2.photoUrl, role: e2.role, welcomeMessage: e2.welcomeMessage });
1092
1141
  }
1093
- function oe(e2, t2) {
1094
- return _({ user: t2, access: e2.access, notify: e2.notify, joinedAt: e2.joinedAt });
1142
+ function ue(e2, t2) {
1143
+ return O({ user: t2, access: e2.access, notify: e2.notify, joinedAt: e2.joinedAt });
1095
1144
  }
1096
- function ue(e2) {
1097
- const t2 = Object.entries(e2).map(([e3, t3]) => _({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
1098
- return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), _(t2);
1145
+ function ce(e2) {
1146
+ const t2 = Object.entries(e2).map(([e3, t3]) => O({ emoji: e3, count: t3.count, currentUserReacted: t3.currentUserReacted }));
1147
+ return t2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), O(t2);
1099
1148
  }
1100
- class ce extends z {
1149
+ class le extends J {
1101
1150
  constructor(e2, t2, s2, n2, r2) {
1102
- super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
1151
+ super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
1103
1152
  }
1104
1153
  fetchInitial(e2) {
1105
1154
  return __async(this, null, function* () {
1106
1155
  const t2 = yield this.realtimeClient.call("GET", ["users", this.userId], { includePrivateFields: false }, { bypassCache: true });
1107
- return t2.ok ? c({ snapshot: ae(t2.value.data), lastChanged: e2 }) : "server" === t2.where && 404 === t2.value.status ? c({ snapshot: null, lastChanged: e2 }) : t2;
1156
+ return t2.ok ? c({ snapshot: oe(t2.value.data), lastChanged: e2 }) : "server" === t2.where && 404 === t2.value.status ? c({ snapshot: null, lastChanged: e2 }) : t2;
1108
1157
  });
1109
1158
  }
1110
1159
  equal(e2, t2) {
1111
- return W(e2.snapshot, t2.snapshot);
1160
+ return q(e2.snapshot, t2.snapshot);
1112
1161
  }
1113
1162
  loadNested(e2, t2) {
1114
1163
  return __async(this, null, function* () {
@@ -1116,13 +1165,13 @@ class ce extends z {
1116
1165
  });
1117
1166
  }
1118
1167
  userCreated(e2, t2) {
1119
- this.mutate(e2, (s2) => null !== s2.value.snapshot ? s2 : c({ snapshot: ae(t2.state), lastChanged: e2 }));
1168
+ this.mutate(e2, (s2) => null !== s2.value.snapshot ? s2 : c({ snapshot: oe(t2.state), lastChanged: e2 }));
1120
1169
  }
1121
1170
  userEdited(e2, t2) {
1122
1171
  this.mutate(e2, (s2) => {
1123
1172
  const n2 = s2.value.snapshot;
1124
1173
  if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
1125
- return c({ snapshot: { id: n2.id, name: j(n2.name, t2.diff.name), custom: $(n2.custom, t2.diff.custom), locale: j(n2.locale, t2.diff.locale), photoUrl: j(n2.photoUrl, t2.diff.photoUrl), role: j(n2.role, t2.diff.role), welcomeMessage: j(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
1174
+ return c({ snapshot: { id: n2.id, name: U(n2.name, t2.diff.name), custom: W(n2.custom, t2.diff.custom), locale: U(n2.locale, t2.diff.locale), photoUrl: U(n2.photoUrl, t2.diff.photoUrl), role: U(n2.role, t2.diff.role), welcomeMessage: U(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
1126
1175
  });
1127
1176
  }
1128
1177
  getFromCache() {
@@ -1139,7 +1188,7 @@ class ce extends z {
1139
1188
  });
1140
1189
  }
1141
1190
  }
1142
- class le extends G {
1191
+ class he extends z {
1143
1192
  constructor(e2, t2, s2, n2) {
1144
1193
  super(e2, {}), this.conversationId = t2, this.message = s2, this.realtimeClient = n2;
1145
1194
  }
@@ -1155,14 +1204,14 @@ class le extends G {
1155
1204
  if (!e3.ok) return e3;
1156
1205
  t2 = e3.value.data;
1157
1206
  }
1158
- return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: _(t2.custom), createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: re(t2.content, {}), content: O(t2.content), reactions: ue(t2.reactions) } });
1207
+ return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: O(t2.custom), createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: ie(t2.content, {}), content: P(t2.content), reactions: ce(t2.reactions) } });
1159
1208
  });
1160
1209
  }
1161
1210
  refetch(e2) {
1162
1211
  throw "Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead";
1163
1212
  }
1164
1213
  equal(e2, t2) {
1165
- return W(e2.data, t2.data);
1214
+ return q(e2.data, t2.data);
1166
1215
  }
1167
1216
  teardownNested(e2) {
1168
1217
  var _a2;
@@ -1177,21 +1226,21 @@ class le extends G {
1177
1226
  }
1178
1227
  loadNested(e2, t2) {
1179
1228
  return __async(this, null, function* () {
1180
- var _a2, _b, _c;
1181
- const s2 = yield (_b = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b.getDeep(e2);
1229
+ var _a2, _b2, _c;
1230
+ const s2 = yield (_b2 = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b2.getDeep(e2);
1182
1231
  if (false === (s2 == null ? void 0 : s2.ok)) return s2;
1183
1232
  if (null === t2.data) return c({ snapshot: null });
1184
1233
  const n2 = s2 == null ? void 0 : s2.value;
1185
- return c({ snapshot: _({ sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: _(t2.data.custom), createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: t2.data.plaintext, content: t2.data.content, referencedMessageId: t2.data.referencedMessageId, reactions: t2.data.reactions }) });
1234
+ return c({ snapshot: O({ sender: (_c = n2 == null ? void 0 : n2.snapshot) != null ? _c : null, id: t2.data.id, type: t2.data.type, custom: O(t2.data.custom), createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: t2.data.plaintext, content: t2.data.content, referencedMessageId: t2.data.referencedMessageId, reactions: t2.data.reactions }) });
1186
1235
  });
1187
1236
  }
1188
1237
  messageEdited(e2, t2) {
1189
1238
  this.mutate(e2, (s2) => {
1190
1239
  if (null === s2.value.data) return s2;
1191
- const n2 = s2.value.data.content, r2 = (i2 = n2, void 0 === (a2 = t2.diff.content) ? i2 : O(a2));
1240
+ const n2 = s2.value.data.content, r2 = (i2 = n2, void 0 === (a2 = t2.diff.content) ? i2 : P(a2));
1192
1241
  var i2, a2;
1193
- const o2 = n2 === r2 ? s2.value.data.plaintext : re(r2, {});
1194
- return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: j(s2.value.data.editedAt, t2.diff.editedAt), custom: $(s2.value.data.custom, t2.diff.custom), plaintext: o2, content: r2, reactions: he(s2.value.data.reactions, t2.diff.reactions) } });
1242
+ const o2 = n2 === r2 ? s2.value.data.plaintext : ie(r2, {});
1243
+ return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: U(s2.value.data.editedAt, t2.diff.editedAt), custom: W(s2.value.data.custom, t2.diff.custom), plaintext: o2, content: r2, reactions: de(s2.value.data.reactions, t2.diff.reactions) } });
1195
1244
  });
1196
1245
  }
1197
1246
  messageDeleted(e2, t2) {
@@ -1199,7 +1248,7 @@ class le extends G {
1199
1248
  }
1200
1249
  getFromCache() {
1201
1250
  return __async(this, null, function* () {
1202
- var _b;
1251
+ var _b2;
1203
1252
  const e2 = yield this.mostRecentState.resultPromise;
1204
1253
  if (!e2.ok) return l("NOT_IN_CACHE");
1205
1254
  if (null === e2.value.data) {
@@ -1208,23 +1257,23 @@ class le extends G {
1208
1257
  const _a2 = e2.value, { sender: t2 } = _a2, s2 = __objRest(_a2, ["sender"]), n2 = {};
1209
1258
  return s2.data.reactions.forEach((e3) => {
1210
1259
  n2[e3.emoji] = { count: e3.count, currentUserReacted: e3.currentUserReacted };
1211
- }), c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b = t2 == null ? void 0 : t2.store.userId) != null ? _b : null, reactions: n2 }) });
1260
+ }), c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b2 = t2 == null ? void 0 : t2.store.userId) != null ? _b2 : null, reactions: n2 }) });
1212
1261
  });
1213
1262
  }
1214
1263
  }
1215
- function he(e2, t2) {
1264
+ function de(e2, t2) {
1216
1265
  if (void 0 === t2) return e2;
1217
1266
  const s2 = e2.map((e3) => {
1218
1267
  const s3 = t2[e3.emoji];
1219
- return void 0 === s3 ? e3 : _(null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count: j(e3.count, s3.count), currentUserReacted: j(e3.currentUserReacted, s3.currentUserReacted) });
1268
+ return void 0 === s3 ? e3 : O(null === s3 ? __spreadProps(__spreadValues({}, e3), { count: 0 }) : { emoji: e3.emoji, count: U(e3.count, s3.count), currentUserReacted: U(e3.currentUserReacted, s3.currentUserReacted) });
1220
1269
  }).filter((e3) => e3.count > 0), n2 = new Set(s2.map((e3) => e3.emoji));
1221
1270
  for (const e3 in t2) {
1222
1271
  const r2 = t2[e3];
1223
- r2 && !n2.has(e3) && s2.push(_({ emoji: e3, count: r2.count, currentUserReacted: r2.currentUserReacted }));
1272
+ r2 && !n2.has(e3) && s2.push(O({ emoji: e3, count: r2.count, currentUserReacted: r2.currentUserReacted }));
1224
1273
  }
1225
- return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), _(s2);
1274
+ return s2.sort((e3, t3) => e3.emoji.localeCompare(t3.emoji)), O(s2);
1226
1275
  }
1227
- class de extends G {
1276
+ class pe extends z {
1228
1277
  constructor(e2, t2, s2, n2) {
1229
1278
  super(e2, {}), this.createdAt = t2, this.dataStore = s2, this.referencedDataStore = n2;
1230
1279
  }
@@ -1252,21 +1301,21 @@ class de extends G {
1252
1301
  }
1253
1302
  loadNested(e2, t2) {
1254
1303
  return __async(this, null, function* () {
1255
- var _a2, _b, _c;
1304
+ var _a2, _b2, _c;
1256
1305
  const s2 = yield t2.dataStore.getDeep(e2);
1257
1306
  if (!s2.ok) return s2;
1258
1307
  const n2 = s2.value;
1259
1308
  if (null === n2.snapshot) return c({ snapshot: null });
1260
1309
  const r2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
1261
1310
  if (r2 && !r2.ok) return r2;
1262
- const i2 = (_b = r2 == null ? void 0 : r2.value) != null ? _b : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
1263
- return c({ snapshot: _({ id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: _(n2.snapshot.custom), createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content, reactions: n2.snapshot.reactions }) });
1311
+ const i2 = (_b2 = r2 == null ? void 0 : r2.value) != null ? _b2 : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
1312
+ return c({ snapshot: O({ id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: O(n2.snapshot.custom), createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content, reactions: n2.snapshot.reactions }) });
1264
1313
  });
1265
1314
  }
1266
1315
  }
1267
- class pe extends z {
1316
+ class fe extends J {
1268
1317
  constructor(e2, t2, s2, n2, r2) {
1269
- super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
1318
+ super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e4, this.pendingLoadMore = void 0;
1270
1319
  }
1271
1320
  listen(e2) {
1272
1321
  return this.onlyUsedInternally && this.mostRecentState.resultPromise.then((e3) => {
@@ -1278,7 +1327,7 @@ class pe extends z {
1278
1327
  }
1279
1328
  fetchInitial(e2) {
1280
1329
  return __async(this, null, function* () {
1281
- const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield fe({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
1330
+ const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield me({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
1282
1331
  return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) : ge({ seq: e2, messages: s2.value.messages, cursor: s2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : s2;
1283
1332
  });
1284
1333
  }
@@ -1310,14 +1359,14 @@ class pe extends z {
1310
1359
  });
1311
1360
  }
1312
1361
  equal(e2, t2) {
1313
- return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!W(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && W(e2.windowEnd, t2.windowEnd)));
1362
+ return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!q(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!q(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && q(e2.windowEnd, t2.windowEnd)));
1314
1363
  }
1315
1364
  loadNested(e2, t2) {
1316
1365
  return __async(this, null, function* () {
1317
1366
  if (null === t2.stores) return c({ snapshot: null, loadedAll: true });
1318
1367
  const s2 = yield Promise.all(t2.inWindow.map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
1319
1368
  if (n2) return n2;
1320
- return c({ snapshot: _(s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot)), loadedAll: null === t2.windowEnd });
1369
+ return c({ snapshot: O(s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot)), loadedAll: null === t2.windowEnd });
1321
1370
  });
1322
1371
  }
1323
1372
  loadMore(e2) {
@@ -1332,7 +1381,7 @@ class pe extends z {
1332
1381
  const t2 = yield this.mostRecentState.resultPromise;
1333
1382
  if (!t2.ok) return;
1334
1383
  if (null === t2.value.windowEnd) return;
1335
- const s2 = t2.value.windowEnd.cursor, n2 = yield fe({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1384
+ const s2 = t2.value.windowEnd.cursor, n2 = yield me({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1336
1385
  yield this.handlers.onLoadedMore({ type: "virtual.messages.loadedmore", conversationId: this.conversationId, data: n2 });
1337
1386
  });
1338
1387
  }
@@ -1344,12 +1393,12 @@ class pe extends z {
1344
1393
  if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."), s2;
1345
1394
  if (s2.value.windowEnd && t2.state.createdAt < s2.value.windowEnd.oldestMessageTs) return s2;
1346
1395
  if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
1347
- const n2 = __spreadValues({}, s2.value.stores), r2 = new le(e2, this.conversationId, t2.state, this.realtimeClient);
1396
+ const n2 = __spreadValues({}, s2.value.stores), r2 = new he(e2, this.conversationId, t2.state, this.realtimeClient);
1348
1397
  n2[t2.state.id] = r2;
1349
1398
  const i2 = t2.state.referencedMessageId;
1350
1399
  let a2;
1351
- null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new le(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
1352
- const o2 = new de(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
1400
+ null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new he(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
1401
+ const o2 = new pe(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
1353
1402
  u2.sort((e3, t3) => t3.createdAt - e3.createdAt);
1354
1403
  const l2 = u2[0].messageId === t2.messageId ? e2 : s2.value.lastMessageChanged;
1355
1404
  return c({ lastChanged: e2, lastMessageChanged: l2, stores: n2, inWindow: u2, windowEnd: s2.value.windowEnd });
@@ -1369,12 +1418,12 @@ class pe extends z {
1369
1418
  delete n2[t2.messageId];
1370
1419
  const r2 = s2.value.inWindow.filter((e3) => e3.messageId !== t2.messageId);
1371
1420
  if (t2.newLastMessage && 0 === r2.length) {
1372
- const s3 = new le(e2, this.conversationId, t2.newLastMessage, this.realtimeClient);
1421
+ const s3 = new he(e2, this.conversationId, t2.newLastMessage, this.realtimeClient);
1373
1422
  n2[s3.messageId] = s3;
1374
1423
  const i3 = t2.newLastMessage.referencedMessageId;
1375
1424
  let a2;
1376
- null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new le(e2, this.conversationId, i3, this.realtimeClient), n2[i3] = a2);
1377
- const o2 = new de(e2, t2.newLastMessage.createdAt, s3, a2);
1425
+ null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new he(e2, this.conversationId, i3, this.realtimeClient), n2[i3] = a2);
1426
+ const o2 = new pe(e2, t2.newLastMessage.createdAt, s3, a2);
1378
1427
  r2.push(o2);
1379
1428
  }
1380
1429
  const i2 = void 0 !== t2.newLastMessage ? e2 : s2.value.lastMessageChanged;
@@ -1406,7 +1455,7 @@ class pe extends z {
1406
1455
  });
1407
1456
  }
1408
1457
  }
1409
- function fe(_0) {
1458
+ function me(_0) {
1410
1459
  return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
1411
1460
  const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "messages"], r2, { bypassCache: true });
1412
1461
  if (i2.ok) {
@@ -1417,29 +1466,29 @@ function fe(_0) {
1417
1466
  });
1418
1467
  }
1419
1468
  function ge({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1420
- var _a2, _b, _c, _d;
1469
+ var _a2, _b2, _c, _d;
1421
1470
  const a2 = t2 ? __spreadValues({}, t2.stores) : {};
1422
1471
  for (const t3 of s2) if (void 0 === a2[t3.id]) {
1423
- const s3 = new le(e2, r2, t3, i2);
1472
+ const s3 = new he(e2, r2, t3, i2);
1424
1473
  a2[s3.messageId] = s3;
1425
1474
  }
1426
1475
  for (const t3 of s2) {
1427
1476
  const s3 = t3.referencedMessageId;
1428
1477
  if (s3 && void 0 === a2[s3]) {
1429
- const t4 = new le(e2, r2, s3, i2);
1478
+ const t4 = new he(e2, r2, s3, i2);
1430
1479
  a2[t4.messageId] = t4;
1431
1480
  }
1432
1481
  }
1433
1482
  const o2 = t2 ? [...t2.inWindow] : [];
1434
- for (const t3 of s2) o2.push(new de(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
1483
+ for (const t3 of s2) o2.push(new pe(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
1435
1484
  o2.sort((e3, t3) => t3.createdAt - e3.createdAt);
1436
- const u2 = (_b = (_a2 = t2 == null ? void 0 : t2.inWindow) == null ? void 0 : _a2[0]) == null ? void 0 : _b.messageId, l2 = (_c = o2 == null ? void 0 : o2[0]) == null ? void 0 : _c.messageId, h2 = u2 === l2 ? (_d = t2 == null ? void 0 : t2.lastMessageChanged) != null ? _d : e2 : e2;
1485
+ const u2 = (_b2 = (_a2 = t2 == null ? void 0 : t2.inWindow) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.messageId, l2 = (_c = o2 == null ? void 0 : o2[0]) == null ? void 0 : _c.messageId, h2 = u2 === l2 ? (_d = t2 == null ? void 0 : t2.lastMessageChanged) != null ? _d : e2 : e2;
1437
1486
  if (null === n2) return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: null });
1438
1487
  return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
1439
1488
  }
1440
- class me extends z {
1489
+ class ve extends J {
1441
1490
  constructor(e2, t2, s2, n2, r2) {
1442
- super(e2, n2, r2), this.convData = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
1491
+ super(e2, n2, r2), this.convData = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
1443
1492
  }
1444
1493
  fetchInitial(e2) {
1445
1494
  return __async(this, null, function* () {
@@ -1468,19 +1517,19 @@ class me extends z {
1468
1517
  });
1469
1518
  }
1470
1519
  }
1471
- function ve(e2, t2) {
1520
+ function we(e2, t2) {
1472
1521
  for (let s2 in e2) Object.prototype.hasOwnProperty.call(e2, s2) && t2(e2[s2], s2);
1473
1522
  }
1474
- function we(e2, t2) {
1523
+ function be(e2, t2) {
1475
1524
  return function(e3, t3) {
1476
1525
  let s2 = {}, n2 = 0;
1477
- return ve(e3, (e4, r2) => {
1526
+ return we(e3, (e4, r2) => {
1478
1527
  const [i2, a2] = t3([r2, e4], n2++);
1479
1528
  s2[i2] = a2;
1480
1529
  }), s2;
1481
1530
  }(e2, ([e3, s2]) => [e3, t2(s2, e3)]);
1482
1531
  }
1483
- class be extends z {
1532
+ class ye extends J {
1484
1533
  constructor(e2, t2, s2, n2, r2) {
1485
1534
  super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
1486
1535
  }
@@ -1492,24 +1541,24 @@ class be extends z {
1492
1541
  if (!t2.ok) return t2;
1493
1542
  const s2 = t2.value.data;
1494
1543
  if (s2.many) return c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
1495
- return c({ data: s2, userSubscriptions: we(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
1544
+ return c({ data: s2, userSubscriptions: be(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
1496
1545
  });
1497
1546
  }
1498
1547
  equal(e2, t2) {
1499
- return W(e2.data, t2.data);
1548
+ return q(e2.data, t2.data);
1500
1549
  }
1501
1550
  loadNested(e2, t2) {
1502
1551
  return __async(this, null, function* () {
1503
1552
  if (null === t2.data) return c({ snapshot: null, lastChanged: t2.lastChanged });
1504
- if (t2.data.many) return c({ snapshot: _({ many: true }), lastChanged: t2.lastChanged });
1553
+ if (t2.data.many) return c({ snapshot: O({ many: true }), lastChanged: t2.lastChanged });
1505
1554
  const s2 = Object.entries(t2.data.usersTyping).sort(([e3, t3], [s3, n3]) => t3 - n3).map(([e3, t3]) => e3).map((s3) => t2.userSubscriptions[s3].store.getDeep(e2)), n2 = yield Promise.all(s2), r2 = n2.find((e3) => !e3.ok);
1506
1555
  if (r2) return r2;
1507
1556
  const i2 = n2.map((e3) => e3.value), a2 = i2.map((e3) => e3.snapshot), o2 = i2.map((e3) => e3.lastChanged), u2 = Math.max(t2.lastChanged, ...o2);
1508
- return c({ snapshot: _({ users: _(a2), many: false }), lastChanged: u2 });
1557
+ return c({ snapshot: O({ users: O(a2), many: false }), lastChanged: u2 });
1509
1558
  });
1510
1559
  }
1511
1560
  typingAvailable(e2, t2) {
1512
- this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : we(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
1561
+ this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : be(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
1513
1562
  }
1514
1563
  typingChanged(e2, t2) {
1515
1564
  this.mutate(e2, (s2) => {
@@ -1517,7 +1566,7 @@ class be extends z {
1517
1566
  if (void 0 === t2.diff.many) {
1518
1567
  if (true === s2.value.data.many) return s2;
1519
1568
  const n2 = __spreadValues({}, s2.value.data.usersTyping), r2 = __spreadValues({}, s2.value.userSubscriptions);
1520
- return ve(t2.diff.usersTyping, (e3, t3) => {
1569
+ return we(t2.diff.usersTyping, (e3, t3) => {
1521
1570
  var _a2;
1522
1571
  "number" == typeof e3 ? (n2[t3] = e3, r2[t3] = this.realtimeClient.internalSubscribe(["users", t3])) : null === e3 && (delete n2[t3], (_a2 = r2[t3]) == null ? void 0 : _a2.unsubscribe(), delete r2[t3]);
1523
1572
  }), c({ data: { usersTyping: n2, many: false }, userSubscriptions: r2, lastChanged: e2 });
@@ -1525,7 +1574,7 @@ class be extends z {
1525
1574
  if (true === t2.diff.many) return s2.value.data.many ? s2 : c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
1526
1575
  if (false === t2.diff.many) {
1527
1576
  if (false === s2.value.data.many) return s2;
1528
- const n2 = we(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
1577
+ const n2 = be(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
1529
1578
  return c({ data: t2.diff, userSubscriptions: n2, lastChanged: e2 });
1530
1579
  }
1531
1580
  throw t2.diff, "Unreachable";
@@ -1535,7 +1584,7 @@ class be extends z {
1535
1584
  this.mutate(e2, (t3) => null === t3.value.data ? t3 : c({ data: null, lastChanged: e2 }));
1536
1585
  }
1537
1586
  teardownNested(e2) {
1538
- e2.data && ve(e2.userSubscriptions, (e3) => e3.unsubscribe());
1587
+ e2.data && we(e2.userSubscriptions, (e3) => e3.unsubscribe());
1539
1588
  }
1540
1589
  anyChildChanged(e2, t2, s2) {
1541
1590
  return __async(this, null, function* () {
@@ -1549,7 +1598,7 @@ class be extends z {
1549
1598
  });
1550
1599
  }
1551
1600
  }
1552
- class ye extends G {
1601
+ class Ce extends z {
1553
1602
  constructor(e2, t2, s2, n2) {
1554
1603
  super(e2, {}), this.conversationId = t2, this.participantData = s2, this.realtimeClient = n2;
1555
1604
  }
@@ -1562,8 +1611,8 @@ class ye extends G {
1562
1611
  throw "Do not call refetch on participant data stores, it can return outdated data. Destroy and remake them instead";
1563
1612
  }
1564
1613
  equal(e2, t2) {
1565
- var _a2, _b, _c, _d;
1566
- return ((_b = (_a2 = e2.user) == null ? void 0 : _a2.store) == null ? void 0 : _b.userId) === ((_d = (_c = t2.user) == null ? void 0 : _c.store) == null ? void 0 : _d.userId) && W(e2.data, t2.data);
1614
+ var _a2, _b2, _c, _d;
1615
+ return ((_b2 = (_a2 = e2.user) == null ? void 0 : _a2.store) == null ? void 0 : _b2.userId) === ((_d = (_c = t2.user) == null ? void 0 : _c.store) == null ? void 0 : _d.userId) && q(e2.data, t2.data);
1567
1616
  }
1568
1617
  teardownNested(e2) {
1569
1618
  var _a2;
@@ -1582,13 +1631,13 @@ class ye extends G {
1582
1631
  const s2 = yield t2.user.store.getDeep(e2);
1583
1632
  if (false === s2.ok) return s2;
1584
1633
  const n2 = s2.value.snapshot;
1585
- return c({ snapshot: oe(t2.data, n2) });
1634
+ return c({ snapshot: ue(t2.data, n2) });
1586
1635
  });
1587
1636
  }
1588
1637
  participantEdited(e2, t2) {
1589
1638
  this.mutate(e2, (s2) => {
1590
1639
  if (null === s2.value.data) return s2;
1591
- return c({ lastChanged: e2, user: s2.value.user, data: { id: s2.value.data.id, access: j(s2.value.data.access, t2.diff.access), notify: j(s2.value.data.notify, t2.diff.notify), joinedAt: s2.value.data.joinedAt } });
1640
+ return c({ lastChanged: e2, user: s2.value.user, data: { id: s2.value.data.id, access: U(s2.value.data.access, t2.diff.access), notify: U(s2.value.data.notify, t2.diff.notify), joinedAt: s2.value.data.joinedAt } });
1592
1641
  });
1593
1642
  }
1594
1643
  participantDeleted(e2, t2) {
@@ -1605,14 +1654,14 @@ class ye extends G {
1605
1654
  });
1606
1655
  }
1607
1656
  }
1608
- class Ce extends z {
1657
+ class Ae extends J {
1609
1658
  constructor(e2, t2, s2, n2, r2) {
1610
- super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
1659
+ super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 3e4, this.pendingLoadMore = void 0;
1611
1660
  }
1612
1661
  fetchInitial(e2) {
1613
1662
  return __async(this, null, function* () {
1614
- const t2 = yield Ae({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
1615
- return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : Ee({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2;
1663
+ const t2 = yield Ee({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
1664
+ return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : ke({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2;
1616
1665
  });
1617
1666
  }
1618
1667
  teardownNested(e2) {
@@ -1631,7 +1680,7 @@ class Ce extends z {
1631
1680
  });
1632
1681
  }
1633
1682
  equal(e2, t2) {
1634
- return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && W(e2.windowEnd, t2.windowEnd));
1683
+ return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!q(Object.keys(e2.stores), Object.keys(t2.stores)) && q(e2.windowEnd, t2.windowEnd));
1635
1684
  }
1636
1685
  loadNested(e2, t2) {
1637
1686
  return __async(this, null, function* () {
@@ -1639,7 +1688,7 @@ class Ce extends z {
1639
1688
  const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
1640
1689
  if (n2) return n2;
1641
1690
  const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
1642
- return r2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), c({ snapshot: _(r2), loadedAll: null === t2.windowEnd });
1691
+ return r2.sort((e3, t3) => t3.joinedAt - e3.joinedAt), c({ snapshot: O(r2), loadedAll: null === t2.windowEnd });
1643
1692
  });
1644
1693
  }
1645
1694
  loadMore(e2) {
@@ -1654,19 +1703,19 @@ class Ce extends z {
1654
1703
  const t2 = yield this.mostRecentState.resultPromise;
1655
1704
  if (!t2.ok) return;
1656
1705
  if (null === t2.value.windowEnd) return;
1657
- const s2 = t2.value.windowEnd.cursor, n2 = yield Ae({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1706
+ const s2 = t2.value.windowEnd.cursor, n2 = yield Ee({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient });
1658
1707
  yield this.handlers.onLoadedMore({ type: "virtual.participants.loadedmore", conversationId: this.conversationId, data: n2 });
1659
1708
  });
1660
1709
  }
1661
1710
  loadedMore(e2, t2) {
1662
- this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) : Ee({ seq: e2, prevStores: s2.value.stores, participants: t2.data.value.participants, cursor: t2.data.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2.data);
1711
+ this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), s2) : ke({ seq: e2, prevStores: s2.value.stores, participants: t2.data.value.participants, cursor: t2.data.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2.data);
1663
1712
  }
1664
1713
  participantCreated(e2, t2) {
1665
1714
  this.mutate(e2, (s2) => {
1666
1715
  if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."), s2;
1667
1716
  if (s2.value.windowEnd && t2.state.joinedAt < s2.value.windowEnd.oldestParticipantTs) return s2;
1668
1717
  if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
1669
- const n2 = __spreadValues({}, s2.value.stores), r2 = new ye(e2, this.conversationId, t2.state, this.realtimeClient);
1718
+ const n2 = __spreadValues({}, s2.value.stores), r2 = new Ce(e2, this.conversationId, t2.state, this.realtimeClient);
1670
1719
  n2[t2.state.id] = r2;
1671
1720
  return c({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
1672
1721
  });
@@ -1706,7 +1755,7 @@ class Ce extends z {
1706
1755
  });
1707
1756
  }
1708
1757
  }
1709
- function Ae(_0) {
1758
+ function Ee(_0) {
1710
1759
  return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
1711
1760
  const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "participants"], r2, { bypassCache: true });
1712
1761
  if (i2.ok) {
@@ -1716,23 +1765,23 @@ function Ae(_0) {
1716
1765
  return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ participants: null, nextCursor: null });
1717
1766
  });
1718
1767
  }
1719
- function Ee({ seq: e2, prevStores: t2, participants: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1768
+ function ke({ seq: e2, prevStores: t2, participants: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
1720
1769
  const a2 = t2 ? __spreadValues({}, t2) : {};
1721
1770
  for (const t3 of s2) if (void 0 === a2[t3.id]) {
1722
- const s3 = new ye(e2, r2, t3, i2);
1771
+ const s3 = new Ce(e2, r2, t3, i2);
1723
1772
  a2[t3.id] = s3;
1724
1773
  }
1725
1774
  if (null === n2) return c({ lastChanged: e2, stores: a2, windowEnd: null });
1726
1775
  return c({ lastChanged: e2, stores: a2, windowEnd: { cursor: n2, oldestParticipantTs: s2[s2.length - 1].joinedAt } });
1727
1776
  }
1728
- class ke extends z {
1777
+ class xe extends J {
1729
1778
  constructor(e2, t2, s2, n2, r2) {
1730
- super(e2, n2, r2), this.getConvDataStore = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
1779
+ super(e2, n2, r2), this.getConvDataStore = t2, this.realtimeClient = s2, this.handlers = r2, this.unsubscribeDebounceMs = 1e4, this.pendingLoadMore = void 0;
1731
1780
  }
1732
1781
  fetchInitial(e2) {
1733
1782
  return __async(this, null, function* () {
1734
- const t2 = yield xe({ realtimeClient: this.realtimeClient, count: 20 });
1735
- return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) : Te({ seq: e2, conversations: t2.value.conversations, cursor: t2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2;
1783
+ const t2 = yield Te({ realtimeClient: this.realtimeClient, count: 20 });
1784
+ return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) : Ie({ seq: e2, conversations: t2.value.conversations, cursor: t2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2;
1736
1785
  });
1737
1786
  }
1738
1787
  teardownNested(e2) {
@@ -1749,19 +1798,19 @@ class ke extends z {
1749
1798
  });
1750
1799
  }
1751
1800
  equal(e2, t2) {
1752
- return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!W(Object.keys(e2.stores), Object.keys(t2.stores)) && W(e2.windowEnd, t2.windowEnd));
1801
+ return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!q(Object.keys(e2.stores), Object.keys(t2.stores)) && q(e2.windowEnd, t2.windowEnd));
1753
1802
  }
1754
1803
  loadNested(e2, t2) {
1755
1804
  return __async(this, null, function* () {
1756
- if (null === t2.stores) return c({ snapshot: _([]), loadedAll: true });
1805
+ if (null === t2.stores) return c({ snapshot: O([]), loadedAll: true });
1757
1806
  const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.store.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
1758
1807
  if (n2) return n2;
1759
1808
  const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
1760
1809
  return r2.sort((e3, t3) => {
1761
- var _a2, _b, _c, _d;
1762
- const s3 = (_b = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b : e3.joinedAt;
1810
+ var _a2, _b2, _c, _d;
1811
+ const s3 = (_b2 = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b2 : e3.joinedAt;
1763
1812
  return ((_d = (_c = t3.lastMessage) == null ? void 0 : _c.createdAt) != null ? _d : t3.joinedAt) - s3;
1764
- }), c({ snapshot: _(r2), loadedAll: null === t2.windowEnd });
1813
+ }), c({ snapshot: O(r2), loadedAll: null === t2.windowEnd });
1765
1814
  });
1766
1815
  }
1767
1816
  loadMore(e2) {
@@ -1776,7 +1825,7 @@ class ke extends z {
1776
1825
  const t2 = yield this.mostRecentState.resultPromise;
1777
1826
  if (!t2.ok) return;
1778
1827
  if (null === t2.value.windowEnd) return;
1779
- const s2 = t2.value.windowEnd.cursor, n2 = yield xe({ count: e2, cursor: s2, realtimeClient: this.realtimeClient });
1828
+ const s2 = t2.value.windowEnd.cursor, n2 = yield Te({ count: e2, cursor: s2, realtimeClient: this.realtimeClient });
1780
1829
  yield this.handlers.onLoadedMore({ type: "virtual.conversations.loadedmore", data: n2 });
1781
1830
  });
1782
1831
  }
@@ -1790,7 +1839,7 @@ class ke extends z {
1790
1839
  });
1791
1840
  }
1792
1841
  loadedMore(e2, t2) {
1793
- this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), s2) : Te({ seq: e2, prevStores: s2.value.stores, conversations: t2.data.value.conversations, cursor: t2.data.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2.data);
1842
+ this.mutate(e2, (s2) => null === s2.value.windowEnd ? s2 : t2.data.ok ? null === t2.data.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), s2) : Ie({ seq: e2, prevStores: s2.value.stores, conversations: t2.data.value.conversations, cursor: t2.data.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2.data);
1794
1843
  }
1795
1844
  userCreated(e2, t2) {
1796
1845
  this.mutate(e2, (e3) => null !== e3.value.stores ? e3 : c({ lastChanged: e3.value.lastChanged, stores: {}, windowEnd: null }));
@@ -1829,7 +1878,7 @@ class ke extends z {
1829
1878
  });
1830
1879
  }
1831
1880
  }
1832
- function xe(_0) {
1881
+ function Te(_0) {
1833
1882
  return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, count: s2 }) {
1834
1883
  const n2 = { limit: s2, cursor: e2 }, r2 = yield t2.call("GET", ["me", "conversations"], n2, { bypassCache: true });
1835
1884
  if (r2.ok) {
@@ -1839,15 +1888,15 @@ function xe(_0) {
1839
1888
  return r2.ok || "server" !== r2.where || 404 !== r2.value.status || "USER_NOT_FOUND" !== r2.value.errorCode ? r2 : c({ conversations: null, nextCursor: null });
1840
1889
  });
1841
1890
  }
1842
- function Te({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
1891
+ function Ie({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
1843
1892
  const i2 = t2 ? __spreadValues({}, t2) : {};
1844
1893
  for (const e3 of s2) void 0 === i2[e3.id] && (i2[e3.id] = r2(e3));
1845
1894
  if (null === n2) return c({ lastChanged: e2, stores: i2, windowEnd: null });
1846
1895
  return c({ lastChanged: e2, stores: i2, windowEnd: { cursor: n2, oldestMessageTs: Math.min(...s2.map((e3) => e3.lastMessageAt)) } });
1847
1896
  }
1848
- class Ie extends z {
1897
+ class De extends J {
1849
1898
  constructor(e2, t2, s2, n2, r2) {
1850
- super(e2, n2, r2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 5e3;
1899
+ super(e2, n2, r2), this.conversation = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 0;
1851
1900
  }
1852
1901
  get conversationId() {
1853
1902
  return "string" == typeof this.conversation ? this.conversation : this.conversation.id;
@@ -1877,7 +1926,7 @@ class Ie extends z {
1877
1926
  });
1878
1927
  }
1879
1928
  equal(e2, t2) {
1880
- return W(e2.snapshot, t2.snapshot);
1929
+ return q(e2.snapshot, t2.snapshot);
1881
1930
  }
1882
1931
  loadNested(e2, t2) {
1883
1932
  return __async(this, null, function* () {
@@ -1886,17 +1935,17 @@ class Ie extends z {
1886
1935
  const s2 = yield t2.messageWindow.store.getDeep(e2);
1887
1936
  if (!s2.ok) return s2;
1888
1937
  const n2 = s2.value.snapshot, r2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
1889
- return c({ snapshot: _(__spreadProps(__spreadValues({}, t2.snapshot), { custom: _(t2.snapshot.custom), welcomeMessages: _(t2.snapshot.welcomeMessages), lastMessage: r2 })) });
1938
+ return c({ snapshot: O(__spreadProps(__spreadValues({}, t2.snapshot), { custom: O(t2.snapshot.custom), welcomeMessages: O(t2.snapshot.welcomeMessages), lastMessage: r2 })) });
1890
1939
  });
1891
1940
  }
1892
1941
  participantEdited(e2, t2) {
1893
- this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1942
+ this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: Se(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1894
1943
  }
1895
1944
  conversationEdited(e2, t2) {
1896
- this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1945
+ this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: Se(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1897
1946
  }
1898
1947
  sideEdited(e2, t2) {
1899
- this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: De(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1948
+ this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: Se(s2.value.snapshot, t2.diff), messageWindow: s2.value.messageWindow }));
1900
1949
  }
1901
1950
  sideCreated(e2, t2) {
1902
1951
  this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindow: s2.value.messageWindow }));
@@ -1911,13 +1960,13 @@ class Ie extends z {
1911
1960
  });
1912
1961
  }
1913
1962
  }
1914
- function De(e2, t2) {
1963
+ function Se(e2, t2) {
1915
1964
  const s2 = t2;
1916
- return { id: e2.id, createdAt: e2.createdAt, subject: j(e2.subject, s2.subject), photoUrl: j(e2.photoUrl, s2.photoUrl), welcomeMessages: U(e2.welcomeMessages, s2.welcomeMessages), custom: $(e2.custom, s2.custom), lastMessageAt: j(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: j(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: j(e2.isUnread, s2.isUnread), access: j(e2.access, s2.access), notify: j(e2.notify, s2.notify), readUntil: j(e2.readUntil, s2.readUntil), everyoneReadUntil: j(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
1965
+ return { id: e2.id, createdAt: e2.createdAt, subject: U(e2.subject, s2.subject), photoUrl: U(e2.photoUrl, s2.photoUrl), welcomeMessages: $(e2.welcomeMessages, s2.welcomeMessages), custom: W(e2.custom, s2.custom), lastMessageAt: U(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: U(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: U(e2.isUnread, s2.isUnread), access: U(e2.access, s2.access), notify: U(e2.notify, s2.notify), readUntil: U(e2.readUntil, s2.readUntil), everyoneReadUntil: U(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
1917
1966
  }
1918
- class Se extends z {
1967
+ class Me extends J {
1919
1968
  constructor(e2, t2, s2, n2, r2) {
1920
- super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e3;
1969
+ super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 3e4;
1921
1970
  }
1922
1971
  fetchInitial(e2) {
1923
1972
  return __async(this, null, function* () {
@@ -1926,7 +1975,7 @@ class Se extends z {
1926
1975
  });
1927
1976
  }
1928
1977
  equal(e2, t2) {
1929
- return W(e2.data, t2.data);
1978
+ return q(e2.data, t2.data);
1930
1979
  }
1931
1980
  teardownNested(e2) {
1932
1981
  e2.user.unsubscribe();
@@ -1941,7 +1990,7 @@ class Se extends z {
1941
1990
  const s2 = yield t2.user.store.getDeep(e2);
1942
1991
  if (!s2.ok) return s2;
1943
1992
  const n2 = s2.value.snapshot;
1944
- return null === t2.data || null === n2 ? c({ snapshot: null }) : c({ snapshot: _(__spreadProps(__spreadValues({}, t2.data), { user: n2 })) });
1993
+ return null === t2.data || null === n2 ? c({ snapshot: null }) : c({ snapshot: O(__spreadProps(__spreadValues({}, t2.data), { user: n2 })) });
1945
1994
  });
1946
1995
  }
1947
1996
  userCreated(e2, t2) {
@@ -1965,9 +2014,9 @@ class Se extends z {
1965
2014
  });
1966
2015
  }
1967
2016
  }
1968
- class Me {
2017
+ class Fe {
1969
2018
  constructor(e2, t2, s2) {
1970
- this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new q(), this.virtualSeqOffset = 0, this.realPublishSeq = 0, this.refetchOnNextNetworkLoss = true, this.connection = new N(e2, t2, { onUpstreamRestarting: () => {
2019
+ this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new H(), this.virtualSeqOffset = 0, this.realPublishSeq = 0, this.refetchOnNextNetworkLoss = true, this.connection = new _(e2, t2, { onUpstreamRestarting: () => {
1971
2020
  this.refetchOnNextNetworkLoss = false;
1972
2021
  }, onReady: () => {
1973
2022
  this.refetchOnNextNetworkLoss = true;
@@ -1979,7 +2028,7 @@ class Me {
1979
2028
  }
1980
2029
  }, onResubscribeError: (e3, t3) => {
1981
2030
  var _a2;
1982
- (_a2 = this.storeMap[Fe(e3)]) == null ? void 0 : _a2.setError(t3);
2031
+ (_a2 = this.storeMap[Be(e3)]) == null ? void 0 : _a2.setError(t3);
1983
2032
  }, onPublish: (e3, t3) => {
1984
2033
  this.realPublishSeq = e3;
1985
2034
  const s3 = this.virtualSeq;
@@ -1990,6 +2039,11 @@ class Me {
1990
2039
  get virtualSeq() {
1991
2040
  return this.realPublishSeq + this.virtualSeqOffset;
1992
2041
  }
2042
+ sync() {
2043
+ return __async(this, null, function* () {
2044
+ yield this.connection.sync(), yield this.emitMutex.sync();
2045
+ });
2046
+ }
1993
2047
  refetchAll(e2) {
1994
2048
  Object.values(this.storeMap).forEach((t2) => t2 == null ? void 0 : t2.refetch(e2));
1995
2049
  }
@@ -2000,10 +2054,10 @@ class Me {
2000
2054
  }));
2001
2055
  }
2002
2056
  handlePublish(e2, t2) {
2003
- var _a2, _b, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t3, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
2057
+ var _a2, _b2, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t3, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
2004
2058
  switch (t2.type) {
2005
2059
  case "user.created":
2006
- return (_a2 = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _a2.userCreated(e2, t2), (_b = this.storeMap["/me/conversations"]) == null ? void 0 : _b.userCreated(e2, t2), void ((_c = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _c.userCreated(e2, t2));
2060
+ return (_a2 = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _a2.userCreated(e2, t2), (_b2 = this.storeMap["/me/conversations"]) == null ? void 0 : _b2.userCreated(e2, t2), void ((_c = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _c.userCreated(e2, t2));
2007
2061
  case "user.edited":
2008
2062
  return void ((_d = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _d.userEdited(e2, t2));
2009
2063
  case "side.created":
@@ -2045,28 +2099,32 @@ class Me {
2045
2099
  call(e2, t2, n2, r2) {
2046
2100
  return __async(this, null, function* () {
2047
2101
  if (!r2.bypassCache && "GET" === e2) {
2048
- const e3 = Fe(t2);
2102
+ const e3 = Be(t2);
2049
2103
  if (e3 in this.storeMap) {
2050
2104
  const t3 = e3, s2 = this.storeMap[t3];
2051
2105
  if (s2 && "getFromCache" in s2) {
2106
+ yield this.sync();
2052
2107
  const e4 = yield s2.getFromCache();
2053
2108
  if ("NOT_IN_CACHE" !== e4.value) return e4;
2054
2109
  }
2055
2110
  } else if (s(t2, ["me", "conversations", "*", "messages", "*"])) {
2056
2111
  const e4 = this.storeMap[`/me/conversations/${t2[2]}/messages`];
2057
2112
  if (e4) {
2113
+ yield this.sync();
2058
2114
  const s2 = yield e4.getMessageFromCache(t2[4]);
2059
2115
  if ("NOT_IN_CACHE" !== s2.value) return s2;
2060
2116
  }
2061
2117
  } else if (s(t2, ["me", "conversations", "*", "participants", "*"])) {
2062
2118
  const e4 = this.storeMap[`/me/conversations/${t2[2]}/participants`];
2063
2119
  if (e4) {
2120
+ yield this.sync();
2064
2121
  const s2 = yield e4.getParticipantFromCache(t2[4]);
2065
2122
  if ("NOT_IN_CACHE" !== s2.value) return s2;
2066
2123
  }
2067
2124
  } else if (s(t2, ["me", "conversations", "*"])) {
2068
2125
  const e4 = this.storeMap["/me/conversations"];
2069
2126
  if (e4) {
2127
+ yield this.sync();
2070
2128
  const s2 = yield e4.getConvFromCache(t2[2]);
2071
2129
  if ("NOT_IN_CACHE" !== s2.value) return s2;
2072
2130
  }
@@ -2117,7 +2175,7 @@ class Me {
2117
2175
  });
2118
2176
  }
2119
2177
  getOrCreateStore(e2) {
2120
- const t2 = Fe(e2);
2178
+ const t2 = Be(e2);
2121
2179
  if (t2 in this.storeMap) return this.storeMap[t2];
2122
2180
  this.connection.subscribe(e2).then((e3) => {
2123
2181
  e3.ok || s2.setError(e3);
@@ -2134,13 +2192,13 @@ class Me {
2134
2192
  return this.connection.isConnected();
2135
2193
  }
2136
2194
  instantiateStore(e2, t2) {
2137
- if (s(e2, ["users", "*"])) return new ce(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2138
- if (s(e2, ["me", "conversations", "*"])) return new me(this.virtualSeq, this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2139
- if (s(e2, ["me", "conversations", "*", "messages"])) return new pe(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2140
- if (s(e2, ["me", "conversations", "*", "participants"])) return new Ce(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2141
- if (s(e2, ["me", "conversations", "*", "typing"])) return new be(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2142
- if (s(e2, ["me", "conversations"])) return new ke(this.virtualSeq, (e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2143
- if (s(e2, ["users", "*", "online"])) return new Se(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2195
+ if (s(e2, ["users", "*"])) return new le(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2196
+ if (s(e2, ["me", "conversations", "*"])) return new ve(this.virtualSeq, this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2197
+ if (s(e2, ["me", "conversations", "*", "messages"])) return new fe(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2198
+ if (s(e2, ["me", "conversations", "*", "participants"])) return new Ae(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2199
+ if (s(e2, ["me", "conversations", "*", "typing"])) return new ye(this.virtualSeq, e2[2], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2200
+ if (s(e2, ["me", "conversations"])) return new xe(this.virtualSeq, (e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, { onTeardown: t2, onLoadedMore: (e3) => this.onVirtualPublish(e3) });
2201
+ if (s(e2, ["users", "*", "online"])) return new Me(this.virtualSeq, e2[1], this.realtimeClient, this.emitMutex, { onTeardown: t2 });
2144
2202
  throw "Unreachable";
2145
2203
  }
2146
2204
  subscribeConvData(e2) {
@@ -2149,18 +2207,18 @@ class Me {
2149
2207
  const e3 = this.convDataStores[t2];
2150
2208
  return { store: e3, unsubscribe: e3.registerInternalSubscription() };
2151
2209
  }
2152
- const s2 = new Ie(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
2210
+ const s2 = new De(this.virtualSeq, e2, this.realtimeClient, this.emitMutex, { onTeardown: () => {
2153
2211
  delete this.convDataStores[t2];
2154
2212
  } });
2155
2213
  return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
2156
2214
  }
2157
2215
  }
2158
- function Fe(e2) {
2216
+ function Be(e2) {
2159
2217
  return `/${e2.join("/")}`;
2160
2218
  }
2161
- class Be {
2219
+ class Re {
2162
2220
  constructor(e2, t2, s2) {
2163
- this.userId = t2, this.alive = true, this.connection = new Me(e2, s2, this), s2.onTokenRefreshFailed(() => {
2221
+ this.userId = t2, this.alive = true, this.connection = new Fe(e2, s2, this), s2.onTokenRefreshFailed(() => {
2164
2222
  this.destroy();
2165
2223
  });
2166
2224
  }
@@ -2182,13 +2240,9 @@ class Be {
2182
2240
  isConnected() {
2183
2241
  return this.connection.isConnected();
2184
2242
  }
2185
- listMessages(e2, t2) {
2243
+ sync() {
2186
2244
  return __async(this, null, function* () {
2187
- const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
2188
- if (!s2.ok) return Re(s2, "Listing messages in " + e2);
2189
- const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.hydrateMessageData(t3, e2))), i2 = r2.find((e3) => !e3.ok);
2190
- if (void 0 !== i2 && !i2.ok) return i2;
2191
- return c(r2.map(({ value: e3 }) => e3));
2245
+ yield this.connection.sync();
2192
2246
  });
2193
2247
  }
2194
2248
  hydrateMessageData(e2, t2) {
@@ -2198,7 +2252,7 @@ class Be {
2198
2252
  const i2 = yield n2;
2199
2253
  if (!i2.ok) return i2;
2200
2254
  const a2 = function(e3, t3, s3) {
2201
- return _({ id: e3.id, type: e3.type, sender: t3, referencedMessage: s3, custom: _(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ue(e3.reactions), plaintext: re(e3.content, {}) });
2255
+ return O({ id: e3.id, type: e3.type, sender: t3, referencedMessage: s3, custom: O(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ce(e3.reactions), plaintext: ie(e3.content, {}) });
2202
2256
  }(e2, r2.value, i2.value);
2203
2257
  return c(a2);
2204
2258
  });
@@ -2208,11 +2262,11 @@ class Be {
2208
2262
  const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
2209
2263
  if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
2210
2264
  if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
2211
- if (!s2.ok) return Re(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
2265
+ if (!s2.ok) return Ne(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
2212
2266
  const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
2213
2267
  if (!r2.ok) return r2;
2214
2268
  const i2 = function(e3, t3) {
2215
- return _({ id: e3.id, type: e3.type, sender: t3, referencedMessageId: e3.referencedMessageId, custom: _(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ue(e3.reactions), plaintext: re(e3.content, {}) });
2269
+ return O({ id: e3.id, type: e3.type, sender: t3, referencedMessageId: e3.referencedMessageId, custom: O(e3.custom), createdAt: e3.createdAt, editedAt: e3.editedAt, origin: e3.origin, content: e3.content, reactions: ce(e3.reactions), plaintext: ie(e3.content, {}) });
2216
2270
  }(n2, r2.value);
2217
2271
  return c(i2);
2218
2272
  });
@@ -2221,20 +2275,20 @@ class Be {
2221
2275
  return __async(this, null, function* () {
2222
2276
  const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
2223
2277
  if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
2224
- if (!t2.ok) return Re(t2, "Get user " + e2);
2225
- return c(ae(t2.value.data));
2278
+ if (!t2.ok) return Ne(t2, "Get user " + e2);
2279
+ return c(oe(t2.value.data));
2226
2280
  });
2227
2281
  }
2228
2282
  }
2229
- function Re(e2, t2) {
2283
+ function Ne(e2, t2) {
2230
2284
  return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
2231
2285
  }
2232
- function Ne(e2, s2) {
2286
+ function _e(e2, s2) {
2233
2287
  var _a2;
2234
2288
  if (s2.ok) return s2.value;
2235
2289
  throw "SESSION_DESTROYED" === s2.value ? new Error(`${e2} failed because the session was destroyed`) : new Error(t((_a2 = s2.value.operation) != null ? _a2 : e2, s2.value));
2236
2290
  }
2237
- class _e {
2291
+ class Oe {
2238
2292
  constructor(e2, t2) {
2239
2293
  this.id = e2, this._realtimeClient = t2;
2240
2294
  }
@@ -2244,7 +2298,7 @@ class _e {
2244
2298
  get() {
2245
2299
  return __async(this, null, function* () {
2246
2300
  const e2 = yield this._realtimeClient.getUser(this.brandedId);
2247
- return Ne("Get user " + this.id, e2);
2301
+ return _e("Get user " + this.id, e2);
2248
2302
  });
2249
2303
  }
2250
2304
  set(t2) {
@@ -2268,7 +2322,7 @@ class _e {
2268
2322
  return this._realtimeClient.subscribe(["users", this.brandedId, "online"], e2);
2269
2323
  }
2270
2324
  }
2271
- class Oe {
2325
+ class Pe {
2272
2326
  constructor(e2, t2, s2) {
2273
2327
  this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
2274
2328
  }
@@ -2283,7 +2337,7 @@ class Oe {
2283
2337
  const t2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedConversationId, "participants", this.brandedUserId], {}), s2 = yield this._realtimeClient.call("GET", ["users", this.brandedUserId], { includePrivateFields: false }), [n2, r2] = yield Promise.all([t2, s2]);
2284
2338
  if (!n2.ok && "server" === n2.where && 404 === n2.value.status) return null;
2285
2339
  if (!r2.ok && "server" === r2.where && 404 === r2.value.status) return null;
2286
- return oe(e(`Get participant ${this.userId} in conversation ${this.conversationId}`, n2), ae(e(`Get user ${this.userId}`, r2)));
2340
+ return ue(e(`Get participant ${this.userId} in conversation ${this.conversationId}`, n2), oe(e(`Get user ${this.userId}`, r2)));
2287
2341
  });
2288
2342
  }
2289
2343
  set() {
@@ -2311,7 +2365,7 @@ class Oe {
2311
2365
  });
2312
2366
  }
2313
2367
  }
2314
- function Pe(e2) {
2368
+ function je(e2) {
2315
2369
  const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
2316
2370
  let s2 = 0;
2317
2371
  const n2 = [], r2 = e2 === s2;
@@ -2329,7 +2383,7 @@ function Pe(e2) {
2329
2383
  if (20 != a2.length) throw new Error("Length should be 20.");
2330
2384
  return a2;
2331
2385
  }
2332
- const je = (e2, t2, s2 = void 0) => function(e3, t3) {
2386
+ const Ue = (e2, t2, s2 = void 0) => function(e3, t3) {
2333
2387
  return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
2334
2388
  }(e2, (e3) => {
2335
2389
  if ("string" == typeof e3) return t2(e3, s2);
@@ -2342,14 +2396,14 @@ const je = (e2, t2, s2 = void 0) => function(e3, t3) {
2342
2396
  case "bulletList":
2343
2397
  case "bulletpoint":
2344
2398
  case "bulletPoint":
2345
- return [{ type: e3.type, children: je(e3.children, t2, e3.type) }];
2399
+ return [{ type: e3.type, children: Ue(e3.children, t2, e3.type) }];
2346
2400
  case "link":
2347
- return [{ type: e3.type, url: e3.url, children: je(e3.children, t2, e3.type) }];
2401
+ return [{ type: e3.type, url: e3.url, children: Ue(e3.children, t2, e3.type) }];
2348
2402
  case "actionlink":
2349
2403
  case "actionLink":
2350
2404
  case "actionbutton":
2351
2405
  case "actionButton":
2352
- return [{ type: e3.type, action: e3.action, params: e3.params, children: je(e3.children, t2, e3.type) }];
2406
+ return [{ type: e3.type, action: e3.action, params: e3.params, children: Ue(e3.children, t2, e3.type) }];
2353
2407
  case "mention":
2354
2408
  case "autolink":
2355
2409
  case "autoLink":
@@ -2364,12 +2418,12 @@ const je = (e2, t2, s2 = void 0) => function(e3, t3) {
2364
2418
  return [e3];
2365
2419
  }
2366
2420
  });
2367
- function Ue(e2, t2) {
2421
+ function $e(e2, t2) {
2368
2422
  return (s2) => {
2369
2423
  const n2 = s2;
2370
2424
  let r2 = 0;
2371
2425
  const i2 = [];
2372
- for (const a2 of V(s2, e2)) {
2426
+ for (const a2 of Z(s2, e2)) {
2373
2427
  a2.index - r2 > 0 && i2.push(n2.substring(r2, a2.index));
2374
2428
  const e3 = t2(a2);
2375
2429
  Array.isArray(e3) ? i2.push(...e3) : i2.push(e3), r2 = a2.index + a2[0].length;
@@ -2377,29 +2431,29 @@ function Ue(e2, t2) {
2377
2431
  return r2 < s2.length && i2.push(s2.substring(r2)), i2;
2378
2432
  };
2379
2433
  }
2380
- const $e = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
2381
- var We = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(We || {});
2382
- const qe = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
2434
+ const We = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
2435
+ var qe = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(qe || {});
2436
+ const He = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
2383
2437
  const t2 = [];
2384
2438
  return 1 & e2 || t2.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/), 2 & e2 || t2.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/), 4 & e2 || t2.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/), new RegExp(t2.map((e3) => e3.source).join("|"), "g");
2385
- }), He = { _: 1, "*": 4, "~": 2 };
2386
- function Le(e2) {
2387
- return Ge(e2, 0);
2439
+ }), Le = { _: 1, "*": 4, "~": 2 };
2440
+ function Ge(e2) {
2441
+ return ze(e2, 0);
2388
2442
  }
2389
- function Ge(e2, t2 = 0) {
2390
- const s2 = qe[t2], n2 = s2 ? function(e3) {
2391
- const t3 = ze.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${$e}])(?:${e3.source})(?=[\\s${$e}]|$)`, "g")), s3 = Ue(t3, (e4) => {
2443
+ function ze(e2, t2 = 0) {
2444
+ const s2 = He[t2], n2 = s2 ? function(e3) {
2445
+ const t3 = Je.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${We}])(?:${e3.source})(?=[\\s${We}]|$)`, "g")), s3 = $e(t3, (e4) => {
2392
2446
  const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
2393
- return [" ", { type: We[He[t4]], children: [s4] }];
2447
+ return [" ", { type: qe[Le[t4]], children: [s4] }];
2394
2448
  });
2395
2449
  return (e4) => {
2396
2450
  const [t4, ...n3] = s3(" " + e4);
2397
2451
  return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
2398
2452
  };
2399
2453
  }(s2) : () => [e2];
2400
- return je(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Ge(e3, t2 | We[s3]) : [e3]);
2454
+ return Ue(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? ze(e3, t2 | qe[s3]) : [e3]);
2401
2455
  }
2402
- const ze = function() {
2456
+ const Je = function() {
2403
2457
  const e2 = function() {
2404
2458
  try {
2405
2459
  return /* @__PURE__ */ new WeakMap();
@@ -2415,18 +2469,18 @@ const ze = function() {
2415
2469
  return e2.set(t2, n2), n2;
2416
2470
  } };
2417
2471
  }();
2418
- function Je(e2, t2) {
2472
+ function Ye(e2, t2) {
2419
2473
  if (Array.prototype.indexOf) return e2.indexOf(t2);
2420
2474
  for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
2421
2475
  return -1;
2422
2476
  }
2423
- function Ye(e2, t2) {
2477
+ function Qe(e2, t2) {
2424
2478
  for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
2425
2479
  }
2426
- function Qe(e2) {
2480
+ function Ve(e2) {
2427
2481
  throw new Error("Unhandled case for value: '" + e2 + "'");
2428
2482
  }
2429
- var Ve = function() {
2483
+ var Ze = function() {
2430
2484
  function e2(e3) {
2431
2485
  void 0 === e3 && (e3 = {}), this.tagName = "", this.attrs = {}, this.innerHTML = "", this.whitespaceRegex = /\s+/, this.tagName = e3.tagName || "", this.attrs = e3.attrs || {}, this.innerHTML = e3.innerHtml || e3.innerHTML || "";
2432
2486
  }
@@ -2445,11 +2499,11 @@ var Ve = function() {
2445
2499
  }, e2.prototype.setClass = function(e3) {
2446
2500
  return this.setAttr("class", e3);
2447
2501
  }, e2.prototype.addClass = function(e3) {
2448
- for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Je(r2, t2) && r2.push(t2);
2502
+ for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Ye(r2, t2) && r2.push(t2);
2449
2503
  return this.getAttrs().class = r2.join(" "), this;
2450
2504
  }, e2.prototype.removeClass = function(e3) {
2451
2505
  for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
2452
- var a2 = Je(r2, t2);
2506
+ var a2 = Ye(r2, t2);
2453
2507
  -1 !== a2 && r2.splice(a2, 1);
2454
2508
  }
2455
2509
  return this.getAttrs().class = r2.join(" "), this;
@@ -2475,12 +2529,12 @@ var Ve = function() {
2475
2529
  return t2.join(" ");
2476
2530
  }, e2;
2477
2531
  }();
2478
- var Ze = function() {
2532
+ var Ke = function() {
2479
2533
  function e2(e3) {
2480
2534
  void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
2481
2535
  }
2482
2536
  return e2.prototype.build = function(e3) {
2483
- return new Ve({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
2537
+ return new Ze({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
2484
2538
  }, e2.prototype.createAttrs = function(e3) {
2485
2539
  var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
2486
2540
  return s2 && (t2.class = s2), this.newWindow && (t2.target = "_blank", t2.rel = "noopener noreferrer"), this.truncate && this.truncate.length && this.truncate.length < e3.getAnchorText().length && (t2.title = e3.getAnchorHref()), t2;
@@ -2550,7 +2604,7 @@ var Ze = function() {
2550
2604
  }(e4, t3, s3);
2551
2605
  }(e3, s2);
2552
2606
  }, e2;
2553
- }(), Ke = function() {
2607
+ }(), Xe = function() {
2554
2608
  function e2(e3) {
2555
2609
  this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
2556
2610
  }
@@ -2565,30 +2619,30 @@ var Ze = function() {
2565
2619
  }, e2.prototype.buildTag = function() {
2566
2620
  return this.tagBuilder.build(this);
2567
2621
  }, e2;
2568
- }(), Xe = function(e2, t2) {
2569
- return Xe = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
2622
+ }(), et = function(e2, t2) {
2623
+ return et = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
2570
2624
  e3.__proto__ = t3;
2571
2625
  } || function(e3, t3) {
2572
2626
  for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
2573
- }, Xe(e2, t2);
2627
+ }, et(e2, t2);
2574
2628
  };
2575
- function et(e2, t2) {
2629
+ function tt(e2, t2) {
2576
2630
  function s2() {
2577
2631
  this.constructor = e2;
2578
2632
  }
2579
- Xe(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
2633
+ et(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
2580
2634
  }
2581
- var tt, st = function() {
2582
- return st = Object.assign || function(e2) {
2635
+ var st, nt = function() {
2636
+ return nt = Object.assign || function(e2) {
2583
2637
  for (var t2, s2 = 1, n2 = arguments.length; s2 < n2; s2++) for (var r2 in t2 = arguments[s2]) Object.prototype.hasOwnProperty.call(t2, r2) && (e2[r2] = t2[r2]);
2584
2638
  return e2;
2585
- }, st.apply(this, arguments);
2586
- }, nt = function(e2) {
2639
+ }, nt.apply(this, arguments);
2640
+ }, rt = function(e2) {
2587
2641
  function t2(t3) {
2588
2642
  var s2 = e2.call(this, t3) || this;
2589
2643
  return s2.email = "", s2.email = t3.email, s2;
2590
2644
  }
2591
- return et(t2, e2), t2.prototype.getType = function() {
2645
+ return tt(t2, e2), t2.prototype.getType = function() {
2592
2646
  return "email";
2593
2647
  }, t2.prototype.getEmail = function() {
2594
2648
  return this.email;
@@ -2597,12 +2651,12 @@ var tt, st = function() {
2597
2651
  }, t2.prototype.getAnchorText = function() {
2598
2652
  return this.email;
2599
2653
  }, t2;
2600
- }(Ke), rt = function(e2) {
2654
+ }(Xe), it = function(e2) {
2601
2655
  function t2(t3) {
2602
2656
  var s2 = e2.call(this, t3) || this;
2603
2657
  return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
2604
2658
  }
2605
- return et(t2, e2), t2.prototype.getType = function() {
2659
+ return tt(t2, e2), t2.prototype.getType = function() {
2606
2660
  return "hashtag";
2607
2661
  }, t2.prototype.getServiceName = function() {
2608
2662
  return this.serviceName;
@@ -2623,12 +2677,12 @@ var tt, st = function() {
2623
2677
  }, t2.prototype.getAnchorText = function() {
2624
2678
  return "#" + this.hashtag;
2625
2679
  }, t2;
2626
- }(Ke), it = function(e2) {
2680
+ }(Xe), at = function(e2) {
2627
2681
  function t2(t3) {
2628
2682
  var s2 = e2.call(this, t3) || this;
2629
2683
  return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
2630
2684
  }
2631
- return et(t2, e2), t2.prototype.getType = function() {
2685
+ return tt(t2, e2), t2.prototype.getType = function() {
2632
2686
  return "mention";
2633
2687
  }, t2.prototype.getMention = function() {
2634
2688
  return this.mention;
@@ -2651,12 +2705,12 @@ var tt, st = function() {
2651
2705
  var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
2652
2706
  return s2 && t3.push(s2), t3;
2653
2707
  }, t2;
2654
- }(Ke), at = function(e2) {
2708
+ }(Xe), ot = function(e2) {
2655
2709
  function t2(t3) {
2656
2710
  var s2 = e2.call(this, t3) || this;
2657
2711
  return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
2658
2712
  }
2659
- return et(t2, e2), t2.prototype.getType = function() {
2713
+ return tt(t2, e2), t2.prototype.getType = function() {
2660
2714
  return "phone";
2661
2715
  }, t2.prototype.getPhoneNumber = function() {
2662
2716
  return this.number;
@@ -2667,12 +2721,12 @@ var tt, st = function() {
2667
2721
  }, t2.prototype.getAnchorText = function() {
2668
2722
  return this.matchedText;
2669
2723
  }, t2;
2670
- }(Ke), ot = function(e2) {
2724
+ }(Xe), ut = function(e2) {
2671
2725
  function t2(t3) {
2672
2726
  var s2 = e2.call(this, t3) || this;
2673
2727
  return s2.url = "", s2.urlMatchType = "scheme", s2.protocolUrlMatch = false, s2.protocolRelativeMatch = false, s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.schemePrefixRegex = /^(https?:\/\/)?/i, s2.wwwPrefixRegex = /^(https?:\/\/)?(www\.)?/i, s2.protocolRelativeRegex = /^\/\//, s2.protocolPrepended = false, s2.urlMatchType = t3.urlMatchType, s2.url = t3.url, s2.protocolUrlMatch = t3.protocolUrlMatch, s2.protocolRelativeMatch = t3.protocolRelativeMatch, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
2674
2728
  }
2675
- return et(t2, e2), t2.prototype.getType = function() {
2729
+ return tt(t2, e2), t2.prototype.getType = function() {
2676
2730
  return "url";
2677
2731
  }, t2.prototype.getUrlMatchType = function() {
2678
2732
  return this.urlMatchType;
@@ -2700,19 +2754,19 @@ var tt, st = function() {
2700
2754
  return t3;
2701
2755
  }
2702
2756
  }, t2;
2703
- }(Ke), ut = function(e2) {
2757
+ }(Xe), ct = function(e2) {
2704
2758
  this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
2705
- }, ct = /[A-Za-z]/, lt = /[\d]/, ht = /[\D]/, dt = /\s/, pt = /['"]/, ft = /[\x00-\x1F\x7F]/, gt = /A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source, mt = gt + /\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source + /\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source, vt = /0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source, wt = mt + vt, bt = mt + vt, yt = "(?:[" + vt + "]{1,3}\\.){3}[" + vt + "]{1,3}", Ct = "[" + bt + "](?:[" + bt + "\\-]{0,61}[" + bt + "])?", At = function(e2) {
2706
- return "(?=(" + Ct + "))\\" + e2;
2707
- }, Et = function(e2) {
2708
- return "(?:" + At(e2) + "(?:\\." + At(e2 + 1) + "){0,126}|" + yt + ")";
2709
- }, kt = new RegExp("[" + bt + "]"), xt = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, Tt = new RegExp("[" + bt + "!#$%&'*+/=?^_`{|}~-]"), It = new RegExp("^" + xt.source + "$"), Dt = function(e2) {
2759
+ }, lt = /[A-Za-z]/, ht = /[\d]/, dt = /[\D]/, pt = /\s/, ft = /['"]/, mt = /[\x00-\x1F\x7F]/, gt = /A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source, vt = gt + /\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source + /\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source, wt = /0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source, bt = vt + wt, yt = vt + wt, Ct = "(?:[" + wt + "]{1,3}\\.){3}[" + wt + "]{1,3}", At = "[" + yt + "](?:[" + yt + "\\-]{0,61}[" + yt + "])?", Et = function(e2) {
2760
+ return "(?=(" + At + "))\\" + e2;
2761
+ }, kt = function(e2) {
2762
+ return "(?:" + Et(e2) + "(?:\\." + Et(e2 + 1) + "){0,126}|" + Ct + ")";
2763
+ }, xt = new RegExp("[" + yt + "]"), Tt = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, It = new RegExp("[" + yt + "!#$%&'*+/=?^_`{|}~-]"), Dt = new RegExp("^" + Tt.source + "$"), St = function(e2) {
2710
2764
  function t2() {
2711
2765
  var t3 = null !== e2 && e2.apply(this, arguments) || this;
2712
- return t3.localPartCharRegex = Tt, t3.strictTldRegex = It, t3;
2766
+ return t3.localPartCharRegex = It, t3.strictTldRegex = Dt, t3;
2713
2767
  }
2714
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2715
- for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new St(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
2768
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2769
+ for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new Mt(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
2716
2770
  var h2 = e3.charAt(u2);
2717
2771
  switch (c2) {
2718
2772
  case 0:
@@ -2725,10 +2779,10 @@ var tt, st = function() {
2725
2779
  f2(h2);
2726
2780
  break;
2727
2781
  case 3:
2728
- g2(h2);
2782
+ m2(h2);
2729
2783
  break;
2730
2784
  case 4:
2731
- m2(h2);
2785
+ g2(h2);
2732
2786
  break;
2733
2787
  case 5:
2734
2788
  v2(h2);
@@ -2740,7 +2794,7 @@ var tt, st = function() {
2740
2794
  b2(h2);
2741
2795
  break;
2742
2796
  default:
2743
- Qe(c2);
2797
+ Ve(c2);
2744
2798
  }
2745
2799
  u2++;
2746
2800
  }
@@ -2749,28 +2803,28 @@ var tt, st = function() {
2749
2803
  "m" === e4 ? y2(1) : s2.test(e4) && y2();
2750
2804
  }
2751
2805
  function p2(e4, t4) {
2752
- ":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new St(st(st({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
2806
+ ":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new Mt(nt(nt({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
2753
2807
  }
2754
2808
  function f2(e4) {
2755
2809
  "." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || C2();
2756
2810
  }
2757
- function g2(e4) {
2811
+ function m2(e4) {
2758
2812
  "." === e4 || "@" === e4 ? C2() : s2.test(e4) ? c2 = 2 : C2();
2759
2813
  }
2760
- function m2(e4) {
2761
- kt.test(e4) ? c2 = 5 : C2();
2814
+ function g2(e4) {
2815
+ xt.test(e4) ? c2 = 5 : C2();
2762
2816
  }
2763
2817
  function v2(e4) {
2764
- "." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : kt.test(e4) || A2();
2818
+ "." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : xt.test(e4) || A2();
2765
2819
  }
2766
2820
  function w2(e4) {
2767
- "-" === e4 || "." === e4 ? A2() : kt.test(e4) ? c2 = 5 : A2();
2821
+ "-" === e4 || "." === e4 ? A2() : xt.test(e4) ? c2 = 5 : A2();
2768
2822
  }
2769
2823
  function b2(e4) {
2770
- "." === e4 || "-" === e4 ? A2() : kt.test(e4) ? (c2 = 5, l2 = new St(st(st({}, l2), { hasDomainDot: true }))) : A2();
2824
+ "." === e4 || "-" === e4 ? A2() : xt.test(e4) ? (c2 = 5, l2 = new Mt(nt(nt({}, l2), { hasDomainDot: true }))) : A2();
2771
2825
  }
2772
2826
  function y2(e4) {
2773
- void 0 === e4 && (e4 = 2), c2 = e4, l2 = new St({ idx: u2 });
2827
+ void 0 === e4 && (e4 = 2), c2 = e4, l2 = new Mt({ idx: u2 });
2774
2828
  }
2775
2829
  function C2() {
2776
2830
  c2 = 0, l2 = a2;
@@ -2783,14 +2837,14 @@ var tt, st = function() {
2783
2837
  (function(e4) {
2784
2838
  var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
2785
2839
  return n2.test(s4);
2786
- })(i3) && r2.push(new nt({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
2840
+ })(i3) && r2.push(new rt({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
2787
2841
  }
2788
2842
  C2();
2789
2843
  }
2790
2844
  }, t2;
2791
- }(ut), St = function(e2) {
2845
+ }(ct), Mt = function(e2) {
2792
2846
  void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
2793
- }, Mt = function() {
2847
+ }, Ft = function() {
2794
2848
  function e2() {
2795
2849
  }
2796
2850
  return e2.isValid = function(e3, t2) {
@@ -2809,21 +2863,21 @@ var tt, st = function() {
2809
2863
  }, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
2810
2864
  return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
2811
2865
  }, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + gt + "]"), e2.ipRegex = /[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/, e2;
2812
- }(), Ft = (tt = new RegExp("[/?#](?:[" + bt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + bt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, Et(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, Et(6), ")", "|", "(", "(//)?", Et(10) + "\\.", xt.source, "(?![-" + wt + "])", ")", ")", "(?::[0-9]+)?", "(?:" + tt.source + ")?"].join(""), "gi")), Bt = new RegExp("[" + bt + "]"), Rt = function(e2) {
2866
+ }(), Bt = (st = new RegExp("[/?#](?:[" + yt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + yt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, kt(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, kt(6), ")", "|", "(", "(//)?", kt(10) + "\\.", Tt.source, "(?![-" + bt + "])", ")", ")", "(?::[0-9]+)?", "(?:" + st.source + ")?"].join(""), "gi")), Rt = new RegExp("[" + yt + "]"), Nt = function(e2) {
2813
2867
  function t2(t3) {
2814
2868
  var s2 = e2.call(this, t3) || this;
2815
- return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = Ft, s2.wordCharRegExp = Bt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
2869
+ return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = Bt, s2.wordCharRegExp = Rt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
2816
2870
  }
2817
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2871
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2818
2872
  for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
2819
- var s3 = t3[0], u3 = t3[1], l2 = t3[4], h2 = t3[5], d2 = t3[9], p2 = t3.index, f2 = h2 || d2, g2 = e3.charAt(p2 - 1);
2820
- if (!Mt.isValid(s3, u3)) return "continue";
2821
- if (p2 > 0 && "@" === g2) return "continue";
2822
- if (p2 > 0 && f2 && c2.wordCharRegExp.test(g2)) return "continue";
2873
+ var s3 = t3[0], u3 = t3[1], l2 = t3[4], h2 = t3[5], d2 = t3[9], p2 = t3.index, f2 = h2 || d2, m2 = e3.charAt(p2 - 1);
2874
+ if (!Ft.isValid(s3, u3)) return "continue";
2875
+ if (p2 > 0 && "@" === m2) return "continue";
2876
+ if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
2823
2877
  if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
2824
2878
  else {
2825
- var m2 = c2.matchHasInvalidCharAfterTld(s3, u3);
2826
- m2 > -1 && (s3 = s3.substr(0, m2));
2879
+ var g2 = c2.matchHasInvalidCharAfterTld(s3, u3);
2880
+ g2 > -1 && (s3 = s3.substr(0, g2));
2827
2881
  }
2828
2882
  var v2 = ["http://", "https://"].find(function(e4) {
2829
2883
  return !!u3 && -1 !== u3.indexOf(e4);
@@ -2833,7 +2887,7 @@ var tt, st = function() {
2833
2887
  s3 = s3.substr(w2), u3 = u3.substr(w2), p2 += w2;
2834
2888
  }
2835
2889
  var b2 = u3 ? "scheme" : l2 ? "www" : "tld", y2 = !!u3;
2836
- o2.push(new ot({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
2890
+ o2.push(new ut({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
2837
2891
  }, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
2838
2892
  return o2;
2839
2893
  }, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
@@ -2853,65 +2907,65 @@ var tt, st = function() {
2853
2907
  if (!e3) return -1;
2854
2908
  var s2 = 0;
2855
2909
  t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
2856
- var n2 = new RegExp("^((.?//)?[-." + bt + "]*[-" + bt + "]\\.[-" + bt + "]+)").exec(e3);
2910
+ var n2 = new RegExp("^((.?//)?[-." + yt + "]*[-" + yt + "]\\.[-" + yt + "]+)").exec(e3);
2857
2911
  return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
2858
2912
  }, t2;
2859
- }(ut), Nt = new RegExp("#[_" + bt + "]{1,139}(?![_" + bt + "])", "g"), _t = new RegExp("[^" + bt + "]"), Ot = function(e2) {
2913
+ }(ct), _t = new RegExp("#[_" + yt + "]{1,139}(?![_" + yt + "])", "g"), Ot = new RegExp("[^" + yt + "]"), Pt = function(e2) {
2860
2914
  function t2(t3) {
2861
2915
  var s2 = e2.call(this, t3) || this;
2862
- return s2.serviceName = "twitter", s2.matcherRegex = Nt, s2.nonWordCharRegex = _t, s2.serviceName = t3.serviceName, s2;
2916
+ return s2.serviceName = "twitter", s2.matcherRegex = _t, s2.nonWordCharRegex = Ot, s2.serviceName = t3.serviceName, s2;
2863
2917
  }
2864
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2918
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2865
2919
  for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
2866
2920
  var o2 = t3.index, u2 = e3.charAt(o2 - 1);
2867
2921
  if (0 === o2 || n2.test(u2)) {
2868
2922
  var c2 = t3[0], l2 = t3[0].slice(1);
2869
- a2.push(new rt({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
2923
+ a2.push(new it({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
2870
2924
  }
2871
2925
  }
2872
2926
  return a2;
2873
2927
  }, t2;
2874
- }(ut), Pt = new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source + "|" + /(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source, "g"), jt = function(e2) {
2928
+ }(ct), jt = new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source + "|" + /(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source, "g"), Ut = function(e2) {
2875
2929
  function t2() {
2876
2930
  var t3 = null !== e2 && e2.apply(this, arguments) || this;
2877
- return t3.matcherRegex = Pt, t3;
2931
+ return t3.matcherRegex = jt, t3;
2878
2932
  }
2879
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2933
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2880
2934
  for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
2881
2935
  var i2 = t3[0], a2 = i2.replace(/[^0-9,;#]/g, ""), o2 = !(!t3[1] && !t3[2]), u2 = 0 == t3.index ? "" : e3.substr(t3.index - 1, 1), c2 = e3.substr(t3.index + i2.length, 1), l2 = !u2.match(/\d/) && !c2.match(/\d/);
2882
- this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new at({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
2936
+ this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new ot({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
2883
2937
  }
2884
2938
  return r2;
2885
2939
  }, t2.prototype.testMatch = function(e3) {
2886
- return ht.test(e3);
2940
+ return dt.test(e3);
2887
2941
  }, t2;
2888
- }(ut), Ut = new RegExp("@[_" + bt + "]{1,50}(?![_" + bt + "])", "g"), $t = new RegExp("@[_." + bt + "]{1,30}(?![_" + bt + "])", "g"), Wt = new RegExp("@[-_." + bt + "]{1,50}(?![-_" + bt + "])", "g"), qt = new RegExp("[^" + bt + "]"), Ht = function(e2) {
2942
+ }(ct), $t = new RegExp("@[_" + yt + "]{1,50}(?![_" + yt + "])", "g"), Wt = new RegExp("@[_." + yt + "]{1,30}(?![_" + yt + "])", "g"), qt = new RegExp("@[-_." + yt + "]{1,50}(?![-_" + yt + "])", "g"), Ht = new RegExp("[^" + yt + "]"), Lt = function(e2) {
2889
2943
  function t2(t3) {
2890
2944
  var s2 = e2.call(this, t3) || this;
2891
- return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Ut, instagram: $t, soundcloud: Wt }, s2.nonWordCharRegex = qt, s2.serviceName = t3.serviceName, s2;
2945
+ return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: $t, instagram: Wt, soundcloud: qt }, s2.nonWordCharRegex = Ht, s2.serviceName = t3.serviceName, s2;
2892
2946
  }
2893
- return et(t2, e2), t2.prototype.parseMatches = function(e3) {
2947
+ return tt(t2, e2), t2.prototype.parseMatches = function(e3) {
2894
2948
  var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
2895
2949
  if (!n2) return a2;
2896
2950
  for (; null !== (t3 = n2.exec(e3)); ) {
2897
2951
  var o2 = t3.index, u2 = e3.charAt(o2 - 1);
2898
2952
  if (0 === o2 || r2.test(u2)) {
2899
2953
  var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
2900
- a2.push(new it({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
2954
+ a2.push(new at({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
2901
2955
  }
2902
2956
  }
2903
2957
  return a2;
2904
2958
  }, t2;
2905
- }(ut);
2906
- function Lt(e2, t2) {
2907
- for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new Gt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
2959
+ }(ct);
2960
+ function Gt(e2, t2) {
2961
+ for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new zt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
2908
2962
  var f2 = e2.charAt(c2);
2909
2963
  switch (h2) {
2910
2964
  case 0:
2911
- g2(f2);
2965
+ m2(f2);
2912
2966
  break;
2913
2967
  case 1:
2914
- m2(f2);
2968
+ g2(f2);
2915
2969
  break;
2916
2970
  case 2:
2917
2971
  w2(f2);
@@ -2971,33 +3025,33 @@ function Lt(e2, t2) {
2971
3025
  _2(f2);
2972
3026
  break;
2973
3027
  default:
2974
- Qe(h2);
3028
+ Ve(h2);
2975
3029
  }
2976
3030
  c2++;
2977
3031
  }
2978
- function g2(e3) {
3032
+ function m2(e3) {
2979
3033
  "<" === e3 && P2();
2980
3034
  }
2981
- function m2(e3) {
2982
- "!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new Gt(st(st({}, p2), { isClosing: true }))) : "<" === e3 ? P2() : ct.test(e3) ? (h2 = 3, p2 = new Gt(st(st({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
3035
+ function g2(e3) {
3036
+ "!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new zt(nt(nt({}, p2), { isClosing: true }))) : "<" === e3 ? P2() : lt.test(e3) ? (h2 = 3, p2 = new zt(nt(nt({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
2983
3037
  }
2984
3038
  function v2(e3) {
2985
- dt.test(e3) ? (p2 = new Gt(st(st({}, p2), { name: U2() })), h2 = 4) : "<" === e3 ? P2() : "/" === e3 ? (p2 = new Gt(st(st({}, p2), { name: U2() })), h2 = 12) : ">" === e3 ? (p2 = new Gt(st(st({}, p2), { name: U2() })), j2()) : ct.test(e3) || lt.test(e3) || ":" === e3 || O2();
3039
+ pt.test(e3) ? (p2 = new zt(nt(nt({}, p2), { name: U2() })), h2 = 4) : "<" === e3 ? P2() : "/" === e3 ? (p2 = new zt(nt(nt({}, p2), { name: U2() })), h2 = 12) : ">" === e3 ? (p2 = new zt(nt(nt({}, p2), { name: U2() })), j2()) : lt.test(e3) || ht.test(e3) || ":" === e3 || O2();
2986
3040
  }
2987
3041
  function w2(e3) {
2988
- ">" === e3 ? O2() : ct.test(e3) ? h2 = 3 : O2();
3042
+ ">" === e3 ? O2() : lt.test(e3) ? h2 = 3 : O2();
2989
3043
  }
2990
3044
  function b2(e3) {
2991
- dt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? P2() : "=" === e3 || pt.test(e3) || ft.test(e3) ? O2() : h2 = 5);
3045
+ pt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? P2() : "=" === e3 || ft.test(e3) || mt.test(e3) ? O2() : h2 = 5);
2992
3046
  }
2993
3047
  function y2(e3) {
2994
- dt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? P2() : pt.test(e3) && O2();
3048
+ pt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? P2() : ft.test(e3) && O2();
2995
3049
  }
2996
3050
  function C2(e3) {
2997
- dt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? P2() : pt.test(e3) ? O2() : h2 = 5);
3051
+ pt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? j2() : "<" === e3 ? P2() : ft.test(e3) ? O2() : h2 = 5);
2998
3052
  }
2999
3053
  function A2(e3) {
3000
- dt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? O2() : "<" === e3 ? P2() : h2 = 10);
3054
+ pt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? O2() : "<" === e3 ? P2() : h2 = 10);
3001
3055
  }
3002
3056
  function E2(e3) {
3003
3057
  '"' === e3 && (h2 = 11);
@@ -3006,16 +3060,16 @@ function Lt(e2, t2) {
3006
3060
  "'" === e3 && (h2 = 11);
3007
3061
  }
3008
3062
  function x2(e3) {
3009
- dt.test(e3) ? h2 = 4 : ">" === e3 ? j2() : "<" === e3 && P2();
3063
+ pt.test(e3) ? h2 = 4 : ">" === e3 ? j2() : "<" === e3 && P2();
3010
3064
  }
3011
3065
  function T2(e3) {
3012
- dt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? P2() : (h2 = 4, c2--);
3066
+ pt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? j2() : "<" === e3 ? P2() : (h2 = 4, c2--);
3013
3067
  }
3014
3068
  function I2(e3) {
3015
- ">" === e3 ? (p2 = new Gt(st(st({}, p2), { isClosing: true })), j2()) : h2 = 4;
3069
+ ">" === e3 ? (p2 = new zt(nt(nt({}, p2), { isClosing: true })), j2()) : h2 = 4;
3016
3070
  }
3017
3071
  function D2(t3) {
3018
- "--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new Gt(st(st({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new Gt(st(st({}, p2), { type: "doctype" })), h2 = 20) : O2();
3072
+ "--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new zt(nt(nt({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new zt(nt(nt({}, p2), { type: "doctype" })), h2 = 20) : O2();
3019
3073
  }
3020
3074
  function S2(e3) {
3021
3075
  "-" === e3 ? h2 = 15 : ">" === e3 ? O2() : h2 = 16;
@@ -3042,7 +3096,7 @@ function Lt(e2, t2) {
3042
3096
  h2 = 0, p2 = u2;
3043
3097
  }
3044
3098
  function P2() {
3045
- h2 = 1, p2 = new Gt({ idx: c2 });
3099
+ h2 = 1, p2 = new zt({ idx: c2 });
3046
3100
  }
3047
3101
  function j2() {
3048
3102
  var t3 = e2.slice(d2, p2.idx);
@@ -3054,9 +3108,9 @@ function Lt(e2, t2) {
3054
3108
  }
3055
3109
  d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
3056
3110
  }
3057
- var Gt = function(e2) {
3111
+ var zt = function(e2) {
3058
3112
  void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.type = e2.type || "tag", this.name = e2.name || "", this.isOpening = !!e2.isOpening, this.isClosing = !!e2.isClosing;
3059
- }, zt = function() {
3113
+ }, Jt = function() {
3060
3114
  function e2(t2) {
3061
3115
  void 0 === t2 && (t2 = {}), this.version = e2.version, this.urls = {}, this.email = true, this.phone = true, this.hashtag = false, this.mention = false, this.newWindow = true, this.stripPrefix = { scheme: true, www: true }, this.stripTrailingSlash = true, this.decodePercentEncoding = true, this.truncate = { length: 0, location: "end" }, this.className = "", this.replaceFn = null, this.context = void 0, this.sanitizeHtml = false, this.matchers = null, this.tagBuilder = null, this.urls = this.normalizeUrlsCfg(t2.urls), this.email = "boolean" == typeof t2.email ? t2.email : this.email, this.phone = "boolean" == typeof t2.phone ? t2.phone : this.phone, this.hashtag = t2.hashtag || this.hashtag, this.mention = t2.mention || this.mention, this.newWindow = "boolean" == typeof t2.newWindow ? t2.newWindow : this.newWindow, this.stripPrefix = this.normalizeStripPrefixCfg(t2.stripPrefix), this.stripTrailingSlash = "boolean" == typeof t2.stripTrailingSlash ? t2.stripTrailingSlash : this.stripTrailingSlash, this.decodePercentEncoding = "boolean" == typeof t2.decodePercentEncoding ? t2.decodePercentEncoding : this.decodePercentEncoding, this.sanitizeHtml = t2.sanitizeHtml || false;
3062
3116
  var s2 = this.mention;
@@ -3080,7 +3134,7 @@ var Gt = function(e2) {
3080
3134
  }(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
3081
3135
  }, e2.prototype.parse = function(e3) {
3082
3136
  var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
3083
- return Lt(e3, { onOpenTag: function(e4) {
3137
+ return Gt(e3, { onOpenTag: function(e4) {
3084
3138
  s2.indexOf(e4) >= 0 && n2++;
3085
3139
  }, onText: function(e4, s3) {
3086
3140
  if (0 === n2) {
@@ -3119,19 +3173,19 @@ var Gt = function(e2) {
3119
3173
  }
3120
3174
  return e3;
3121
3175
  }, e2.prototype.removeUnwantedMatches = function(e3) {
3122
- return this.hashtag || Ye(e3, function(e4) {
3176
+ return this.hashtag || Qe(e3, function(e4) {
3123
3177
  return "hashtag" === e4.getType();
3124
- }), this.email || Ye(e3, function(e4) {
3178
+ }), this.email || Qe(e3, function(e4) {
3125
3179
  return "email" === e4.getType();
3126
- }), this.phone || Ye(e3, function(e4) {
3180
+ }), this.phone || Qe(e3, function(e4) {
3127
3181
  return "phone" === e4.getType();
3128
- }), this.mention || Ye(e3, function(e4) {
3182
+ }), this.mention || Qe(e3, function(e4) {
3129
3183
  return "mention" === e4.getType();
3130
- }), this.urls.schemeMatches || Ye(e3, function(e4) {
3184
+ }), this.urls.schemeMatches || Qe(e3, function(e4) {
3131
3185
  return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
3132
- }), this.urls.wwwMatches || Ye(e3, function(e4) {
3186
+ }), this.urls.wwwMatches || Qe(e3, function(e4) {
3133
3187
  return "url" === e4.getType() && "www" === e4.getUrlMatchType();
3134
- }), this.urls.tldMatches || Ye(e3, function(e4) {
3188
+ }), this.urls.tldMatches || Qe(e3, function(e4) {
3135
3189
  return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
3136
3190
  }), e3;
3137
3191
  }, e2.prototype.parseText = function(e3, t2) {
@@ -3151,93 +3205,93 @@ var Gt = function(e2) {
3151
3205
  return s2.push(e3.substring(n2)), s2.join("");
3152
3206
  }, e2.prototype.createMatchReturnVal = function(e3) {
3153
3207
  var t2;
3154
- return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Ve ? t2.toAnchorString() : e3.buildTag().toAnchorString();
3208
+ return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Ze ? t2.toAnchorString() : e3.buildTag().toAnchorString();
3155
3209
  }, e2.prototype.getMatchers = function() {
3156
3210
  if (this.matchers) return this.matchers;
3157
- var e3 = this.getTagBuilder(), t2 = [new Ot({ tagBuilder: e3, serviceName: this.hashtag }), new Dt({ tagBuilder: e3 }), new jt({ tagBuilder: e3 }), new Ht({ tagBuilder: e3, serviceName: this.mention }), new Rt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
3211
+ var e3 = this.getTagBuilder(), t2 = [new Pt({ tagBuilder: e3, serviceName: this.hashtag }), new St({ tagBuilder: e3 }), new Ut({ tagBuilder: e3 }), new Lt({ tagBuilder: e3, serviceName: this.mention }), new Nt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
3158
3212
  return this.matchers = t2;
3159
3213
  }, e2.prototype.getTagBuilder = function() {
3160
3214
  var e3 = this.tagBuilder;
3161
- return e3 || (e3 = this.tagBuilder = new Ze({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
3162
- }, e2.version = "3.14.3", e2.AnchorTagBuilder = Ze, e2.HtmlTag = Ve, e2.matcher = { Email: Dt, Hashtag: Ot, Matcher: ut, Mention: Ht, Phone: jt, Url: Rt }, e2.match = { Email: nt, Hashtag: rt, Match: Ke, Mention: it, Phone: at, Url: ot }, e2;
3215
+ return e3 || (e3 = this.tagBuilder = new Ke({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
3216
+ }, e2.version = "3.14.3", e2.AnchorTagBuilder = Ke, e2.HtmlTag = Ze, e2.matcher = { Email: St, Hashtag: Pt, Matcher: ct, Mention: Lt, Phone: Ut, Url: Nt }, e2.match = { Email: rt, Hashtag: it, Match: Xe, Mention: at, Phone: ot, Url: ut }, e2;
3163
3217
  }();
3164
- function Jt(e2, t2 = e2) {
3218
+ function Yt(e2, t2 = e2) {
3165
3219
  return { type: "autolink", url: e2, text: t2 };
3166
3220
  }
3167
- const Yt = Ue(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
3221
+ const Qt = $e(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
3168
3222
  return { type: "mention", id: e3, text: t3 };
3169
- }(decodeURIComponent(t2), s2)), Qt = Ue(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
3223
+ }(decodeURIComponent(t2), s2)), Vt = $e(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
3170
3224
  return { type: "customemoji", text: e3 };
3171
- }(t2)), Vt = Ue(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
3225
+ }(t2)), Zt = $e(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
3172
3226
  return { type: "link", url: e3, children: t3 };
3173
- }(t2, [s2])), Zt = Ue(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3174
- const { action: n2, params: r2 } = Xt(t2);
3227
+ }(t2, [s2])), Kt = $e(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3228
+ const { action: n2, params: r2 } = es(t2);
3175
3229
  return /* @__PURE__ */ function(e3, t3, s3 = []) {
3176
3230
  return { type: "actionlink", action: e3, params: t3, children: s3 };
3177
3231
  }(n2, r2, [s2]);
3178
- }), Kt = Ue(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3179
- const { action: n2, params: r2 } = Xt(t2);
3232
+ }), Xt = $e(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
3233
+ const { action: n2, params: r2 } = es(t2);
3180
3234
  return /* @__PURE__ */ function(e3, t3, s3 = []) {
3181
3235
  return { type: "actionbutton", action: e3, params: t3, children: s3 };
3182
3236
  }(n2, r2, [s2]);
3183
3237
  });
3184
- function Xt(e2) {
3238
+ function es(e2) {
3185
3239
  const t2 = e2.indexOf("?");
3186
3240
  if (-1 === t2) return { action: e2, params: {} };
3187
3241
  return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
3188
3242
  }
3189
- const es = Ue(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
3243
+ const ts = $e(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
3190
3244
  return { type: "bulletlist", children: e3 };
3191
- }([e2.startsWith("\n") ? e2.slice(1) : e2])), ts = Ue(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), ss = (e2) => {
3245
+ }([e2.startsWith("\n") ? e2.slice(1) : e2])), ss = $e(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), ns = (e2) => {
3192
3246
  const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
3193
3247
  let s2 = 0;
3194
3248
  const n2 = [];
3195
- for (const r2 of V(e2, t2)) {
3249
+ for (const r2 of Z(e2, t2)) {
3196
3250
  const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
3197
3251
  a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
3198
- const o2 = Jt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
3252
+ const o2 = Yt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
3199
3253
  n2.push(o2), s2 = a2 + i2.length;
3200
3254
  }
3201
3255
  return s2 < e2.length && n2.push(e2.substring(s2)), n2;
3202
- }, ns = (e2) => Vt(e2).flatMap((e3) => "string" == typeof e3 ? rs(e3) : ["<", ...rs(e3.url), ...rs("|" + e3.children[0] + ">")]), rs = (e2) => {
3203
- const t2 = zt.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
3256
+ }, rs = (e2) => Zt(e2).flatMap((e3) => "string" == typeof e3 ? is(e3) : ["<", ...is(e3.url), ...is("|" + e3.children[0] + ">")]), is = (e2) => {
3257
+ const t2 = Jt.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
3204
3258
  let n2 = 0;
3205
3259
  for (const r2 of t2) {
3206
3260
  const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
3207
3261
  let o2 = i2;
3208
- r2 instanceof nt ? o2 = "mailto:" + r2.getEmail() : r2 instanceof ot && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Jt(o2, i2)), n2 = t3 + a2;
3262
+ r2 instanceof rt ? o2 = "mailto:" + r2.getEmail() : r2 instanceof ut && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Yt(o2, i2)), n2 = t3 + a2;
3209
3263
  }
3210
3264
  return n2 < e2.length && s2.push(e2.substring(n2)), s2;
3211
- }, is = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
3212
- function as(e2 = { except: [] }) {
3265
+ }, as = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
3266
+ function os(e2 = { except: [] }) {
3213
3267
  var _a2;
3214
- const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : is.filter((t3) => !e2.only.includes(t3));
3215
- return s2.includes("BulletPoint") || t2.multilineSteps.push(es, ts), s2.includes("Mention") || t2.singlelineSteps.push(Yt), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Qt), s2.includes("Codespan") || t2.multilineSteps.push(Ue(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3.replace(/<!!mention:.*?\|([^>]*)>/gim, "@$1").replace(/<!!customemoji:(.*?)>/gim, "$1") }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Vt), s2.includes("Actions") || (t2.singlelineSteps.push(Zt), t2.singlelineSteps.push(Kt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Le), s2.includes("Autolink") || t2.singlelineSteps.push(ns, ss), t2;
3268
+ const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : as.filter((t3) => !e2.only.includes(t3));
3269
+ return s2.includes("BulletPoint") || t2.multilineSteps.push(ts, ss), s2.includes("Mention") || t2.singlelineSteps.push(Qt), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Vt), s2.includes("Codespan") || t2.multilineSteps.push($e(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3.replace(/<!!mention:.*?\|([^>]*)>/gim, "@$1").replace(/<!!customemoji:(.*?)>/gim, "$1") }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Zt), s2.includes("Actions") || (t2.singlelineSteps.push(Kt), t2.singlelineSteps.push(Xt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Ge), s2.includes("Autolink") || t2.singlelineSteps.push(rs, ns), t2;
3216
3270
  }
3217
- const os = function(e2) {
3271
+ const us = function(e2) {
3218
3272
  const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
3219
3273
  return (e3) => Array.from(e3.match(t2) || []);
3220
3274
  }("\n");
3221
- function us(e2, t2 = { except: [] }) {
3275
+ function cs(e2, t2 = { except: [] }) {
3222
3276
  let s2 = function(e3, t3) {
3223
3277
  let s3 = [e3];
3224
- return s3 = ls(s3, t3.multilineSteps), s3 = ls(s3, [os]), s3 = ls(s3, t3.singlelineSteps), s3 = hs(s3), s3;
3225
- }(e2, as(t2));
3226
- return s2 = ds(s2, false), s2;
3278
+ return s3 = hs(s3, t3.multilineSteps), s3 = hs(s3, [us]), s3 = hs(s3, t3.singlelineSteps), s3 = ds(s3), s3;
3279
+ }(e2, os(t2));
3280
+ return s2 = ps(s2, false), s2;
3227
3281
  }
3228
- function cs(e2) {
3229
- return us(e2, { except: ["FormattedLink", "Actions"] });
3282
+ function ls(e2) {
3283
+ return cs(e2, { except: ["FormattedLink", "Actions"] });
3230
3284
  }
3231
- function ls(e2, t2) {
3232
- return t2.reduce((e3, t3) => je(e3, t3), e2);
3285
+ function hs(e2, t2) {
3286
+ return t2.reduce((e3, t3) => Ue(e3, t3), e2);
3233
3287
  }
3234
- function hs(e2) {
3288
+ function ds(e2) {
3235
3289
  const t2 = [];
3236
3290
  let s2 = -1;
3237
- for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children: hs(n2.children) }) : n2;
3291
+ for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children: ds(n2.children) }) : n2;
3238
3292
  return t2;
3239
3293
  }
3240
- function ds(e2, t2) {
3294
+ function ps(e2, t2) {
3241
3295
  const s2 = [];
3242
3296
  let n2 = [];
3243
3297
  for (let r2 = 0; r2 < e2.length; r2++) {
@@ -3245,13 +3299,13 @@ function ds(e2, t2) {
3245
3299
  if ("string" == typeof i2) n2.push(i2);
3246
3300
  else if ("children" in i2) {
3247
3301
  n2.length > 0 && (s2.push(n2.join("")), n2 = []);
3248
- const e3 = ds(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type);
3302
+ const e3 = ps(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type);
3249
3303
  s2.push(__spreadProps(__spreadValues({}, i2), { children: e3 }));
3250
3304
  } else "autolink" === i2.type && t2 ? n2.push(i2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(i2));
3251
3305
  }
3252
3306
  return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
3253
3307
  }
3254
- class ps {
3308
+ class fs {
3255
3309
  constructor(e2, t2, s2, n2) {
3256
3310
  this.emoji = e2, this.messageId = t2, this.conversationId = s2, this._realtimeClient = n2;
3257
3311
  }
@@ -3274,7 +3328,7 @@ class ps {
3274
3328
  });
3275
3329
  }
3276
3330
  }
3277
- class fs {
3331
+ class ms {
3278
3332
  constructor(e2, t2, s2) {
3279
3333
  this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
3280
3334
  }
@@ -3287,7 +3341,7 @@ class fs {
3287
3341
  reaction(e2) {
3288
3342
  if ("string" != typeof e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is not a string`);
3289
3343
  if ("" === e2) throw new Error(`Creating ReactionRef failed because emoji "${e2}" is an empty string`);
3290
- return new ps(e2, this.brandedId, this.brandedConversationId, this._realtimeClient);
3344
+ return new fs(e2, this.brandedId, this.brandedConversationId, this._realtimeClient);
3291
3345
  }
3292
3346
  get() {
3293
3347
  return __async(this, null, function* () {
@@ -3295,7 +3349,7 @@ class fs {
3295
3349
  if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
3296
3350
  if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
3297
3351
  const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.hydrateMessageData(s2, this.brandedConversationId);
3298
- return Ne("Get message " + this.id, n2);
3352
+ return _e("Get message " + this.id, n2);
3299
3353
  });
3300
3354
  }
3301
3355
  edit(t2) {
@@ -3313,14 +3367,14 @@ class fs {
3313
3367
  }
3314
3368
  function gs(e2) {
3315
3369
  if ("string" == typeof e2) {
3316
- return [{ type: "text", children: us(e2) }];
3370
+ return [{ type: "text", children: cs(e2) }];
3317
3371
  }
3318
3372
  if ("text" in e2 && e2.text) {
3319
- return [{ type: "text", children: us(e2.text) }];
3373
+ return [{ type: "text", children: cs(e2.text) }];
3320
3374
  }
3321
3375
  if ("content" in e2 && e2.content) return e2.content;
3322
3376
  }
3323
- class ms {
3377
+ class vs {
3324
3378
  constructor(e2, t2) {
3325
3379
  this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
3326
3380
  }
@@ -3333,24 +3387,27 @@ class ms {
3333
3387
  participant(e2) {
3334
3388
  if ("string" == typeof e2) {
3335
3389
  if ("" === e2) throw new Error(`Creating ParticipantRef failed because ID "${e2}" is an empty string`);
3336
- return new Oe(e2, this.id, this._realtimeClient);
3390
+ return new Pe(e2, this.id, this._realtimeClient);
3337
3391
  }
3338
- if ("brandedId" in e2) return new Oe(e2.id, this.id, this._realtimeClient);
3392
+ if ("brandedId" in e2) return new Pe(e2.id, this.id, this._realtimeClient);
3339
3393
  throw new Error(`Creating ParticipantRef failed because user "${e2}" is not a string or a UserRef`);
3340
3394
  }
3341
3395
  message(e2) {
3342
3396
  if ("string" != typeof e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is not a string`);
3343
3397
  if ("" === e2) throw new Error(`Creating MessageRef failed because ID "${e2}" is an empty string`);
3344
- return new fs(e2, this.brandedId, this._realtimeClient);
3398
+ return new ms(e2, this.brandedId, this._realtimeClient);
3345
3399
  }
3346
3400
  get() {
3347
3401
  return __async(this, null, function* () {
3348
- const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
3349
- if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
3350
- const n2 = e("Get conversation " + this.id, s2), r2 = Ne("Get last message in conversation " + this.id, yield t2);
3351
- return function(e2, t3) {
3352
- return _({ id: e2.id, subject: e2.subject, photoUrl: e2.photoUrl, welcomeMessages: _(e2.welcomeMessages), custom: _(e2.custom), createdAt: e2.createdAt, joinedAt: e2.joinedAt, lastMessageAt: e2.lastMessageAt, unreadMessageCount: e2.unreadMessageCount, isUnread: e2.isUnread, access: e2.access, notify: e2.notify, lastMessage: t3, readUntil: e2.readUntil, everyoneReadUntil: e2.everyoneReadUntil });
3353
- }(n2, 0 === r2.length ? null : r2[0]);
3402
+ const e2 = this.subscribe(), t2 = yield e2.connected.catch(() => {
3403
+ throw new Error("GET Conversation failed, could not fetch conversation");
3404
+ });
3405
+ yield this._realtimeClient.sync();
3406
+ const s2 = e2.state;
3407
+ if (e2.unsubscribe(), "active" === s2.type) return s2.latestSnapshot;
3408
+ if ("pending" === s2.type) return t2.latestSnapshot;
3409
+ if ("unsubscribed" === s2.type) return t2.latestSnapshot;
3410
+ throw "error" === s2.type ? s2.error : "Unreachable";
3354
3411
  });
3355
3412
  }
3356
3413
  set(t2) {
@@ -3392,8 +3449,8 @@ class ms {
3392
3449
  }
3393
3450
  send(t2) {
3394
3451
  return __async(this, null, function* () {
3395
- const s2 = { content: vs(t2), referencedMessageId: ws(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: Pe((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
3396
- return new fs(r2.id, this.brandedId, this._realtimeClient);
3452
+ const s2 = { content: ws(t2), referencedMessageId: bs(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: je((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
3453
+ return new ms(r2.id, this.brandedId, this._realtimeClient);
3397
3454
  });
3398
3455
  }
3399
3456
  subscribeMessages(e2) {
@@ -3415,21 +3472,21 @@ class ms {
3415
3472
  });
3416
3473
  }
3417
3474
  }
3418
- function vs(e2) {
3475
+ function ws(e2) {
3419
3476
  if ("string" == typeof e2) {
3420
- return [{ type: "text", children: cs(e2) }];
3477
+ return [{ type: "text", children: ls(e2) }];
3421
3478
  }
3422
3479
  if ("text" in e2) {
3423
- return [{ type: "text", children: cs(e2.text) }];
3480
+ return [{ type: "text", children: ls(e2.text) }];
3424
3481
  }
3425
3482
  return e2.content;
3426
3483
  }
3427
- function ws(e2) {
3484
+ function bs(e2) {
3428
3485
  if ("string" == typeof e2) return;
3429
3486
  const t2 = e2.referencedMessage;
3430
3487
  return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
3431
3488
  }
3432
- class bs {
3489
+ class ys {
3433
3490
  constructor(e2, t2, s2) {
3434
3491
  this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
3435
3492
  }
@@ -3442,7 +3499,7 @@ class bs {
3442
3499
  }
3443
3500
  static fromHost(e2) {
3444
3501
  var _a2;
3445
- const t2 = new bs("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
3502
+ const t2 = new ys("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
3446
3503
  if (!e2) return t2;
3447
3504
  if ("@currentHost" === e2) {
3448
3505
  if ("undefined" == typeof location) throw new Error("You can only use @currentHost in a browser.");
@@ -3452,17 +3509,17 @@ class bs {
3452
3509
  const s2 = e2.match(/^(?:\w+-)?([^.]+)\.talkjs\.com$/);
3453
3510
  if (s2) {
3454
3511
  const e3 = s2[1];
3455
- return ["app", "cdn", "api", "realtime"].includes(e3) ? t2 : new bs(`wss://realtime-${e3}.talkjs.com/v1`, `https://app-${e3}.talkjs.com/api/v0`, `https://api-${e3}.talkjs.com/v1`);
3512
+ return ["app", "cdn", "api", "realtime"].includes(e3) ? t2 : new ys(`wss://realtime-${e3}.talkjs.com/v1`, `https://app-${e3}.talkjs.com/api/v0`, `https://api-${e3}.talkjs.com/v1`);
3456
3513
  }
3457
3514
  return t2;
3458
3515
  }
3459
- return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new bs(`ws://${e2}/public_api/v1`, `http://${e2}/api/v0`, `http://${e2}/public_api/v1`) : new bs(`wss://${e2}/public_api/v1`, `https://${e2}/api/v0`, `https://${e2}/public_api/v1`);
3516
+ return e2.includes("localhost") || e2.includes("localtest.me") || /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e2) ? new ys(`ws://${e2}/public_api/v1`, `http://${e2}/api/v0`, `http://${e2}/public_api/v1`) : new ys(`wss://${e2}/public_api/v1`, `https://${e2}/api/v0`, `https://${e2}/public_api/v1`);
3460
3517
  }
3461
3518
  }
3462
- function ys({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2, errorTracker: u2 }) {
3519
+ function Cs({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2, errorTracker: u2 }) {
3463
3520
  var _a2;
3464
3521
  (!r2 || r2 <= 0) && (r2 = 1);
3465
- const c2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-12-30T13:54:18.982Z" };
3522
+ const c2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2026-01-08T15:43:23.764Z" };
3466
3523
  s2 instanceof FormData || (c2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
3467
3524
  return a(r2, () => __async(this, null, function* () {
3468
3525
  if (o2) {
@@ -3486,12 +3543,12 @@ function ys({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
3486
3543
  throw s3;
3487
3544
  });
3488
3545
  }
3489
- class Cs {
3546
+ class As {
3490
3547
  constructor(e2) {
3491
3548
  __privateAdd(this, _e2);
3492
3549
  __privateAdd(this, _t2);
3493
- var _a2, _b, _c, _d;
3494
- this._timeCreated = Date.now(), __privateSet(this, _e2, (_b = (_a2 = globalThis.document) == null ? void 0 : _a2.referrer) != null ? _b : ""), __privateSet(this, _t2, ((_d = (_c = globalThis.location) == null ? void 0 : _c.href) != null ? _d : globalThis.HermesInternal) ? "React Native Hermes" : ""), this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-12-30T13:54:18.982Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: __privateGet(this, _t2), referrer: __privateGet(this, _e2), userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: __privateGet(this, _t2), stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-12-30T13:54:18.982Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
3550
+ var _a2, _b2, _c, _d;
3551
+ this._timeCreated = Date.now(), __privateSet(this, _e2, (_b2 = (_a2 = globalThis.document) == null ? void 0 : _a2.referrer) != null ? _b2 : ""), __privateSet(this, _t2, ((_d = (_c = globalThis.location) == null ? void 0 : _c.href) != null ? _d : globalThis.HermesInternal) ? "React Native Hermes" : ""), this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2026-01-08T15:43:23.764Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: __privateGet(this, _t2), referrer: __privateGet(this, _e2), userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: __privateGet(this, _t2), stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2026-01-08T15:43:23.764Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
3495
3552
  }
3496
3553
  setData({ appId: e2, meId: t2, sessionId: s2 }) {
3497
3554
  this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
@@ -3501,7 +3558,7 @@ class Cs {
3501
3558
  try {
3502
3559
  0;
3503
3560
  const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
3504
- yield ys({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
3561
+ yield Cs({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
3505
3562
  } catch (e3) {
3506
3563
  console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
3507
3564
  }
@@ -3510,9 +3567,9 @@ class Cs {
3510
3567
  }
3511
3568
  _e2 = new WeakMap();
3512
3569
  _t2 = new WeakMap();
3513
- const As = { log: (e2) => Promise.resolve(), setData: (e2) => {
3570
+ const Es = { log: (e2) => Promise.resolve(), setData: (e2) => {
3514
3571
  } };
3515
- class Es {
3572
+ class ks {
3516
3573
  constructor(e2, t2 = {}) {
3517
3574
  this._onSubscription = t2, this._handlers = {};
3518
3575
  for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
@@ -3538,9 +3595,9 @@ class Es {
3538
3595
  return e2 in this._handlers;
3539
3596
  }
3540
3597
  on(e2, t2) {
3541
- var _a2, _b;
3598
+ var _a2, _b2;
3542
3599
  if (!this.supports(e2)) throw new Error(`Unknown event type '${String(e2)}'`);
3543
- (_b = (_a2 = this._onSubscription)[e2]) == null ? void 0 : _b.call(_a2), this._handlers[e2].push(t2);
3600
+ (_b2 = (_a2 = this._onSubscription)[e2]) == null ? void 0 : _b2.call(_a2), this._handlers[e2].push(t2);
3544
3601
  }
3545
3602
  off(e2, t2) {
3546
3603
  if (!Object.hasOwnProperty.call(this._handlers, e2)) throw new Error(`Unknown event type '${String(e2)}'`);
@@ -3557,7 +3614,7 @@ class Es {
3557
3614
  return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
3558
3615
  }
3559
3616
  }
3560
- class ks {
3617
+ class xs {
3561
3618
  constructor(e2) {
3562
3619
  this.handlers = e2, this.tokenResult = null, this.pendingToken = null;
3563
3620
  }
@@ -3579,9 +3636,9 @@ class ks {
3579
3636
  this.tokenResult = null, this.refreshToken();
3580
3637
  }
3581
3638
  }
3582
- class xs {
3639
+ class Ts {
3583
3640
  constructor(e2, t2, s2, n2) {
3584
- this.apiUrls = e2, this.appId = t2, this.userId = s2, this.signature = n2, this.inner = new ks({ onChange: (e3) => {
3641
+ this.apiUrls = e2, this.appId = t2, this.userId = s2, this.signature = n2, this.inner = new xs({ onChange: (e3) => {
3585
3642
  e3.ok ? this.eventEmitter.emit("tokenChanged", e3.value) : this.emitTokenRefreshFailed(e3.value);
3586
3643
  }, onNeedToken: () => __async(this, null, function* () {
3587
3644
  if (this._usingBokens && !this.signature && !this._calledBokens && (yield new Promise((e3) => setTimeout(e3, 1))), this._usingBokens) yield this.sendBokenRequest().then((e3) => this.inner.setTokenResult(c(e3))).catch((e3) => this.inner.setTokenResult(h(e3)));
@@ -3590,12 +3647,12 @@ class xs {
3590
3647
  const e3 = l("Cannot refresh token, no `onNeedToken` provided.");
3591
3648
  this.inner.setTokenResult(e3);
3592
3649
  }
3593
- }) }), this._usingBokens = true, this._calledBokens = false, this.onNeedToken = void 0, this.eventEmitter = new Es({ tokenChanged(e3) {
3650
+ }) }), this._usingBokens = true, this._calledBokens = false, this.onNeedToken = void 0, this.eventEmitter = new ks({ tokenChanged(e3) {
3594
3651
  }, tokenRefreshFailed(e3) {
3595
3652
  }, tokenAccepted(e3) {
3596
3653
  } }), this.sessionExpiryWarningTimeoutId = void 0;
3597
3654
  const r2 = "undefined" != typeof window && e2.restApiHttpUrl.includes("api.talkjs.com");
3598
- this.errorTracker = r2 ? new Cs("970cd0be0fb74630b75c8451051299dc") : As;
3655
+ this.errorTracker = r2 ? new As("970cd0be0fb74630b75c8451051299dc") : Es;
3599
3656
  }
3600
3657
  get usingBokens() {
3601
3658
  return this._usingBokens;
@@ -3670,7 +3727,7 @@ class xs {
3670
3727
  const e3 = function(e4) {
3671
3728
  const t3 = e4.split(".");
3672
3729
  if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
3673
- return { header: Ts(t3[0]), payload: Ts(t3[1]) };
3730
+ return { header: Is(t3[0]), payload: Is(t3[1]) };
3674
3731
  }(s2);
3675
3732
  n2 = e3.header, r2 = e3.payload;
3676
3733
  } catch (e3) {
@@ -3714,7 +3771,7 @@ class xs {
3714
3771
  return __async(this, null, function* () {
3715
3772
  this._calledBokens = true;
3716
3773
  let e2 = 0;
3717
- const t2 = this.apiUrls.getBokensUrl(this.appId, this.userId, this.signature), s2 = yield ys({ method: "GET", url: t2, attempts: 1e4, shouldRetry: (t3) => {
3774
+ const t2 = this.apiUrls.getBokensUrl(this.appId, this.userId, this.signature), s2 = yield Cs({ method: "GET", url: t2, attempts: 1e4, shouldRetry: (t3) => {
3718
3775
  if (t3 instanceof Error) return true;
3719
3776
  if (401 === t3.status) throw "Check that you provided a valid signature.";
3720
3777
  if (404 === t3.status) throw "Check that you specified the correct App ID.";
@@ -3727,7 +3784,7 @@ class xs {
3727
3784
  });
3728
3785
  }
3729
3786
  }
3730
- function Ts(e2) {
3787
+ function Is(e2) {
3731
3788
  try {
3732
3789
  const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
3733
3790
  return JSON.parse(s2);
@@ -3735,14 +3792,14 @@ function Ts(e2) {
3735
3792
  throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
3736
3793
  }
3737
3794
  }
3738
- const Is = new class {
3795
+ const Ds = new class {
3739
3796
  constructor() {
3740
3797
  this.registry = {};
3741
3798
  }
3742
3799
  getOrCreate(e2) {
3743
3800
  const t2 = this.key(e2), s2 = this.registry[t2];
3744
3801
  if (s2) return s2;
3745
- const n2 = new Ss(e2);
3802
+ const n2 = new Ms(e2);
3746
3803
  return this.registry[t2] = n2, n2;
3747
3804
  }
3748
3805
  deregister(e2, t2) {
@@ -3753,11 +3810,11 @@ const Is = new class {
3753
3810
  return `${e2}:${t2}`;
3754
3811
  }
3755
3812
  }();
3756
- function Ds(e2) {
3813
+ function Ss(e2) {
3757
3814
  if (!e2) throw new Error("[TalkJS] Must provide an options object to `getTalkSession`");
3758
- return e2.forceCreateNew ? new Ss(e2) : Is.getOrCreate(e2);
3815
+ return e2.forceCreateNew ? new Ms(e2) : Ds.getOrCreate(e2);
3759
3816
  }
3760
- class Ss {
3817
+ class Ms {
3761
3818
  constructor(e2) {
3762
3819
  this._onNeedToken = void 0, function(e3) {
3763
3820
  function t3(e4, t4) {
@@ -3767,7 +3824,7 @@ class Ss {
3767
3824
  void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of the `getTalkSession` options must be a function.");
3768
3825
  }(e2);
3769
3826
  const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
3770
- this._appId = t2, this._apiUrls = e2.apiUrls ? new bs(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : bs.fromHost(e2.host), this._authProvider = new xs(this._apiUrls, t2, s2, i2), n2 && this._authProvider.setToken(n2), r2 && this._authProvider.setOnNeedToken(() => __async(this, null, function* () {
3827
+ this._appId = t2, this._apiUrls = e2.apiUrls ? new ys(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : ys.fromHost(e2.host), this._authProvider = new Ts(this._apiUrls, t2, s2, i2), n2 && this._authProvider.setToken(n2), r2 && this._authProvider.setOnNeedToken(() => __async(this, null, function* () {
3771
3828
  try {
3772
3829
  const e3 = yield r2();
3773
3830
  this._authProvider.setToken(e3);
@@ -3776,11 +3833,11 @@ class Ss {
3776
3833
  }
3777
3834
  }));
3778
3835
  const a2 = Math.random().toString().split(".")[1];
3779
- this._realtimeClient = new Be(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.6.0", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new _e(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
3836
+ this._realtimeClient = new Re(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.6.1", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new Oe(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
3780
3837
  console.error(`[TalkJS] ${e3}`);
3781
3838
  }), function(e3, t3) {
3782
3839
  return __async(this, null, function* () {
3783
- return ys({ method: "GET", url: `${t3}/${e3}` }).then((e4) => __async(this, null, function* () {
3840
+ return Cs({ method: "GET", url: `${t3}/${e3}` }).then((e4) => __async(this, null, function* () {
3784
3841
  return 200 === e4.status || 404 !== e4.status && (console.warn(`[TalkJS] Received unexpected ${e4.status} status code when validating app ID. Assuming that the app ID is valid.`), true);
3785
3842
  })).catch((e4) => {
3786
3843
  if ("string" != typeof e4 && "status" in e4) {
@@ -3820,42 +3877,42 @@ class Ss {
3820
3877
  user(e2) {
3821
3878
  if ("string" != typeof e2) throw new Error(`Creating UserRef failed because ID "${e2}" is not a string`);
3822
3879
  if ("" === e2) throw new Error(`Creating UserRef failed because ID "${e2}" is an empty string`);
3823
- return new _e(e2, this._realtimeClient);
3880
+ return new Oe(e2, this._realtimeClient);
3824
3881
  }
3825
3882
  conversation(e2) {
3826
3883
  if ("string" != typeof e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is not a string`);
3827
3884
  if ("" === e2) throw new Error(`Creating ConversationRef failed because ID "${e2}" is an empty string`);
3828
- return new ms(e2, this._realtimeClient);
3885
+ return new vs(e2, this._realtimeClient);
3829
3886
  }
3830
3887
  subscribeConversations(e2) {
3831
3888
  return this._realtimeClient.subscribe(["me", "conversations"], e2);
3832
3889
  }
3833
3890
  terminate(e2) {
3834
- Is.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
3891
+ Ds.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
3835
3892
  }
3836
3893
  _isConnected() {
3837
3894
  return this._realtimeClient.isConnected();
3838
3895
  }
3839
3896
  uploadFile(e2, t2) {
3840
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
3897
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
3841
3898
  }
3842
3899
  uploadImage(e2, t2) {
3843
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
3900
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
3844
3901
  }
3845
3902
  uploadVideo(e2, t2) {
3846
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
3903
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
3847
3904
  }
3848
3905
  uploadAudio(e2, t2) {
3849
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
3906
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
3850
3907
  }
3851
3908
  uploadVoice(e2, t2) {
3852
- return Ms(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
3909
+ return Fs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
3853
3910
  }
3854
3911
  }
3855
- function Ms(_0, _1, _2, _3) {
3912
+ function Fs(_0, _1, _2, _3) {
3856
3913
  return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
3857
3914
  const u2 = new FormData();
3858
- return u2.set("file", s2, r2), void 0 !== n2 && u2.set("subtype", n2), void 0 !== i2 && u2.set("width", i2.toString()), void 0 !== a2 && u2.set("height", a2.toString()), void 0 !== o2 && u2.set("duration", o2.toString()), ys({ method: "POST", url: e2, data: u2, authProvider: t2, errorTracker: t2.errorTracker }).then((e3) => e3.json()).then((e3) => e3.fileToken).catch((e3) => __async(this, null, function* () {
3915
+ return u2.set("file", s2, r2), void 0 !== n2 && u2.set("subtype", n2), void 0 !== i2 && u2.set("width", i2.toString()), void 0 !== a2 && u2.set("height", a2.toString()), void 0 !== o2 && u2.set("duration", o2.toString()), Cs({ method: "POST", url: e2, data: u2, authProvider: t2, errorTracker: t2.errorTracker }).then((e3) => e3.json()).then((e3) => e3.fileToken).catch((e3) => __async(this, null, function* () {
3859
3916
  if (e3 instanceof Response) {
3860
3917
  const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
3861
3918
  throw new Error(s3);
@@ -3865,7 +3922,7 @@ function Ms(_0, _1, _2, _3) {
3865
3922
  });
3866
3923
  }
3867
3924
  export {
3868
- Ds as getTalkSession,
3925
+ Ss as getTalkSession,
3869
3926
  f as registerPolyfills
3870
3927
  };
3871
3928
  //# sourceMappingURL=talkSession.js.map