@talkjs/core 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/talkSession.cjs +1 -1
- package/dist/talkSession.d.ts +365 -53
- package/dist/talkSession.js +418 -327
- package/package.json +4 -3
package/dist/talkSession.js
CHANGED
|
@@ -245,7 +245,7 @@ class b {
|
|
|
245
245
|
void 0 !== this.timeout && (clearTimeout(this.timeout), this.timeout = void 0);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
class
|
|
248
|
+
class y {
|
|
249
249
|
constructor() {
|
|
250
250
|
this.i = -1;
|
|
251
251
|
}
|
|
@@ -256,9 +256,9 @@ class w {
|
|
|
256
256
|
this.i = -1;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
class
|
|
259
|
+
class w {
|
|
260
260
|
constructor(e2, t2) {
|
|
261
|
-
this.handlers = t2, this.seqCounter = new
|
|
261
|
+
this.handlers = t2, this.seqCounter = new y(), this.responseHandlers = {}, this.heartbeats = new A(this), this.socket = new v(e2, { onUpstreamRestarting: () => {
|
|
262
262
|
this.heartbeats.serverActive(), this.handlers.onUpstreamRestarting();
|
|
263
263
|
}, onOpen: () => {
|
|
264
264
|
this.heartbeats.clientActive(), this.heartbeats.serverActive(), this.handlers.onReady();
|
|
@@ -343,7 +343,7 @@ class C {
|
|
|
343
343
|
"READY" !== e3 && "RENEWING_SESSION" !== e3 || this.handlers.onNotReady(), this.authProvider.clearScheduledRefresh();
|
|
344
344
|
} }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
|
|
345
345
|
this.authProvider.clearScheduledRefresh(), this.connection.destroy();
|
|
346
|
-
} } }), this.connection = new
|
|
346
|
+
} } }), this.connection = new w(e2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onReady: () => this.stateMachine.transition("logIn"), onNotReady: () => {
|
|
347
347
|
this.stateMachine.transition("wsDisconnected");
|
|
348
348
|
}, onAuthExpired: () => {
|
|
349
349
|
this.stateMachine.transition("authExpired");
|
|
@@ -706,10 +706,10 @@ class _ {
|
|
|
706
706
|
return this.connection.isConnected();
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function O(e2, t2) {
|
|
710
710
|
return void 0 === t2 ? e2 : t2;
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function P(e2, t2) {
|
|
713
713
|
if (void 0 === t2) return e2;
|
|
714
714
|
if (null === t2) return {};
|
|
715
715
|
const s2 = __spreadValues({}, e2);
|
|
@@ -881,7 +881,7 @@ class H extends W {
|
|
|
881
881
|
this.mutate(e2, (s2) => {
|
|
882
882
|
const n2 = s2.value.snapshot;
|
|
883
883
|
if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
|
|
884
|
-
return c({ snapshot: { id: n2.id, name:
|
|
884
|
+
return c({ snapshot: { id: n2.id, name: O(n2.name, t2.diff.name), custom: P(n2.custom, t2.diff.custom), locale: O(n2.locale, t2.diff.locale), photoUrl: O(n2.photoUrl, t2.diff.photoUrl), role: O(n2.role, t2.diff.role), welcomeMessage: O(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
|
|
885
885
|
});
|
|
886
886
|
}
|
|
887
887
|
getFromCache() {
|
|
@@ -893,54 +893,34 @@ class H extends W {
|
|
|
893
893
|
teardownNested(e2) {
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
|
-
|
|
897
|
-
function z(e2) {
|
|
898
|
-
if (":arslan:" === e2.text) return ":arslan:";
|
|
899
|
-
const t2 = function({ text: e3, kind: t3 }) {
|
|
900
|
-
var _a2;
|
|
901
|
-
return "unicode" === t3 ? function(e4) {
|
|
902
|
-
const t4 = [];
|
|
903
|
-
let s3 = 0, n2 = 0, r2 = 0;
|
|
904
|
-
for (; r2 < e4.length; ) s3 = e4.charCodeAt(r2++), n2 ? (t4.push((65536 + (n2 - 55296 << 10) + (s3 - 56320)).toString(16)), n2 = 0) : 55296 <= s3 && s3 <= 56319 ? n2 = s3 : t4.push(s3.toString(16));
|
|
905
|
-
return t4.join("-");
|
|
906
|
-
}((s2 = e3).indexOf(L) < 0 ? s2.replace(G, "") : s2) : (_a2 = Y[e3]) != null ? _a2 : function(e4) {
|
|
907
|
-
if (/;-?\)/.test(e4)) return "1f609";
|
|
908
|
-
if (e4 = e4.replace(/;/g, ":"), /:-o/i.test(e4)) return "1f631";
|
|
909
|
-
return e4 = e4.replace(/-/g, "").toLowerCase(), J[e4];
|
|
910
|
-
}(e3);
|
|
911
|
-
var s2;
|
|
912
|
-
}(e2);
|
|
913
|
-
return t2 ? String.fromCodePoint(parseInt(t2, 16)) : e2.text;
|
|
914
|
-
}
|
|
915
|
-
const J = { ":)": "1f642", ":o": "1f62e", ":]": "1f60f", ":d": "1f600", xd: "1f61d", ":p": "1f61c", ":@": "1f621", ":[": "1f621", ":(": "1f626", ":'(": "1f62d", ":’(": "1f62d", ":*": "1f618", ":/": "1f614", ":s": "1f616", ":|": "1f633", ":$": "263a", ":x": "1f637", "<3": "2764", "</3": "1f494" }, Y = { ":thumbsup:": "1f44d", ":thumbsdown:": "1f44e", ":poop:": "1f4a9" };
|
|
916
|
-
var Q, V = {};
|
|
917
|
-
function Z(e2, t2) {
|
|
896
|
+
var G, L = {};
|
|
897
|
+
function z(e2, t2) {
|
|
918
898
|
const s2 = t2.lastIndex;
|
|
919
899
|
let n2;
|
|
920
900
|
const r2 = [];
|
|
921
901
|
for (; null !== (n2 = t2.exec(e2)); ) r2.push(n2);
|
|
922
902
|
return t2.lastIndex = s2, r2;
|
|
923
903
|
}
|
|
924
|
-
function
|
|
904
|
+
function J(e2) {
|
|
925
905
|
const t2 = e2.replace(/%2F/g, "/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/, "$1");
|
|
926
906
|
return decodeURIComponent(t2);
|
|
927
907
|
}
|
|
928
|
-
function
|
|
908
|
+
function Y(e2, t2) {
|
|
929
909
|
if (!e2() && !t2) {
|
|
930
910
|
t2 = e2.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/, "`$1`") + " was not true";
|
|
931
911
|
}
|
|
932
912
|
}
|
|
933
913
|
!function() {
|
|
934
|
-
if (
|
|
914
|
+
if (G) return L;
|
|
935
915
|
function e2(e3) {
|
|
936
916
|
return String.fromCharCode(parseInt(e3.slice(1), 16));
|
|
937
917
|
}
|
|
938
918
|
function t2(e3) {
|
|
939
919
|
return `%${`00${e3.charCodeAt(0).toString(16)}`.slice(-2)}`;
|
|
940
920
|
}
|
|
941
|
-
|
|
921
|
+
G = 1, Object.defineProperty(L, "__esModule", { value: true }), L.encode = function(t3) {
|
|
942
922
|
return btoa(encodeURIComponent(t3).replace(/%[0-9A-F]{2}/g, e2));
|
|
943
|
-
},
|
|
923
|
+
}, L.decode = function(e3) {
|
|
944
924
|
return decodeURIComponent(Array.from(atob(e3), t2).join(""));
|
|
945
925
|
};
|
|
946
926
|
}(), ((e2) => {
|
|
@@ -974,51 +954,51 @@ function X(e2, t2) {
|
|
|
974
954
|
}, e2.falsy = function(e3) {
|
|
975
955
|
}, e2.never = function(e3) {
|
|
976
956
|
};
|
|
977
|
-
})(
|
|
978
|
-
const
|
|
979
|
-
function
|
|
980
|
-
if (!
|
|
981
|
-
return !
|
|
957
|
+
})(Y || (Y = {}));
|
|
958
|
+
const Q = Y, V = /^\/.*[^\\]\/[im]*$/;
|
|
959
|
+
function Z(e2) {
|
|
960
|
+
if (!V.test(e2)) return false;
|
|
961
|
+
return !K(e2).test("");
|
|
982
962
|
}
|
|
983
|
-
function
|
|
963
|
+
function K(e2) {
|
|
984
964
|
const t2 = e2.match(/^\/(.*[^\\])\/(.*)$/);
|
|
985
965
|
if (!t2) throw new Error(`Expected ${e2} to be a (non-empty) regex`);
|
|
986
966
|
let s2 = t2[2] || "";
|
|
987
967
|
return s2 = s2.replace(/[^im]/g, "") + "g", new RegExp(t2[1], s2);
|
|
988
968
|
}
|
|
989
|
-
class
|
|
969
|
+
class X {
|
|
990
970
|
constructor({ mode: e2, allowedHostnames: t2, allowedPhoneNrs: s2, allowedMatches: n2, forbiddenMatches: r2, suppressLinks: i2, suppressEmailAddresses: a2, suppressPhoneNumbers: o2, replacement: u2 }) {
|
|
991
|
-
|
|
971
|
+
Q.oneOf(e2, ["all", "otherOnly", "off"]), this.mode = e2, this.suppressLinks = false !== i2, this.suppressEmailAddresses = false !== a2, this.suppressPhoneNumbers = false !== o2, this.allowedHostnames = t2 || [], this.allowedPhoneNrs = (s2 || []).filter((e3) => e3).map((e3) => e3.replace(/[^0-9]/g, "")), this.allowedMatches = (n2 || []).filter(Z).map((e3) => K(e3)), this.forbiddenMatches = (r2 || []).filter(Z).map((e3) => K(e3)), Q(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), Q(() => this.forbiddenMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"), u2 = u2 == null ? void 0 : u2.trim(), this.replacement = u2 && u2.length > 0 ? u2 : void 0;
|
|
992
972
|
}
|
|
993
973
|
shouldSuppress({ isContentBySender: e2 }) {
|
|
994
974
|
return "all" === this.mode || "otherOnly" === this.mode && !e2;
|
|
995
975
|
}
|
|
996
976
|
}
|
|
997
|
-
function
|
|
977
|
+
function ee(e2, t2) {
|
|
998
978
|
const s2 = e2.map((e3) => function(e4, t3) {
|
|
999
979
|
if ("text" === e4.type) return function(e5, t4) {
|
|
1000
980
|
const s3 = function(e6) {
|
|
1001
981
|
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l;
|
|
1002
982
|
let t5 = "";
|
|
1003
|
-
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 : [],
|
|
983
|
+
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: (_e2 = e6.enableEmojiImageFallback) != null ? _e2 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new X({ 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 : {} };
|
|
1004
984
|
}(t4);
|
|
1005
|
-
return
|
|
985
|
+
return te(e5, s3);
|
|
1006
986
|
}(e4.children, t3);
|
|
1007
|
-
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${
|
|
1008
|
-
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${
|
|
1009
|
-
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${
|
|
987
|
+
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${J(e4.url)}`;
|
|
988
|
+
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${J(e4.url)}`;
|
|
989
|
+
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${J(e4.url)}`;
|
|
1010
990
|
if ("file" === e4.type && "voice" === e4.subtype) {
|
|
1011
991
|
const t4 = e4.duration;
|
|
1012
992
|
if (void 0 === t4) return "🎙️";
|
|
1013
993
|
return `🎙️ (${Math.floor(t4 / 60)}:${Math.floor(t4 % 60).toString().padStart(2, "0")})`;
|
|
1014
994
|
}
|
|
1015
|
-
if ("file" === e4.type) return e4.subtype, `📎 ${
|
|
995
|
+
if ("file" === e4.type) return e4.subtype, `📎 ${J(e4.url)}`;
|
|
1016
996
|
if ("location" === e4.type) return "📍";
|
|
1017
997
|
return "";
|
|
1018
998
|
}(e3, t2));
|
|
1019
999
|
return s2.join("\n\n");
|
|
1020
1000
|
}
|
|
1021
|
-
function
|
|
1001
|
+
function te(e2, t2) {
|
|
1022
1002
|
return e2.flatMap((e3) => {
|
|
1023
1003
|
if ("string" == typeof e3) return e3;
|
|
1024
1004
|
switch (e3.type) {
|
|
@@ -1031,19 +1011,20 @@ function ae(e2, t2) {
|
|
|
1031
1011
|
case "actionLink":
|
|
1032
1012
|
case "actionbutton":
|
|
1033
1013
|
case "actionButton":
|
|
1034
|
-
return
|
|
1014
|
+
return te(e3.children, t2);
|
|
1035
1015
|
case "bulletlist":
|
|
1036
1016
|
case "bulletList":
|
|
1037
|
-
return "\n" +
|
|
1017
|
+
return "\n" + te(e3.children, t2);
|
|
1038
1018
|
case "bulletpoint":
|
|
1039
1019
|
case "bulletPoint":
|
|
1040
|
-
return "- " +
|
|
1020
|
+
return "- " + te(e3.children, t2) + "\n";
|
|
1041
1021
|
case "autolink":
|
|
1042
1022
|
case "autoLink":
|
|
1043
1023
|
case "codeblock":
|
|
1044
1024
|
case "codeBlock":
|
|
1045
1025
|
case "codespan":
|
|
1046
1026
|
case "codeSpan":
|
|
1027
|
+
case "emoji":
|
|
1047
1028
|
case "customemoji":
|
|
1048
1029
|
case "customEmoji":
|
|
1049
1030
|
return e3.text;
|
|
@@ -1051,12 +1032,10 @@ function ae(e2, t2) {
|
|
|
1051
1032
|
return t2.contactInfoHiddenText;
|
|
1052
1033
|
case "mention":
|
|
1053
1034
|
return `@${e3.text}`;
|
|
1054
|
-
case "emoji":
|
|
1055
|
-
return "images" === t2.emojis ? "" : "unicode" === t2.emojis ? z(e3) : e3.text;
|
|
1056
1035
|
}
|
|
1057
1036
|
}).join("");
|
|
1058
1037
|
}
|
|
1059
|
-
class
|
|
1038
|
+
class se extends $ {
|
|
1060
1039
|
constructor(e2, t2, s2, n2) {
|
|
1061
1040
|
super(e2), this.conversationId = t2, this.message = s2, this.realtimeClient = n2;
|
|
1062
1041
|
}
|
|
@@ -1072,7 +1051,7 @@ class oe extends $ {
|
|
|
1072
1051
|
if (!e3.ok) return e3;
|
|
1073
1052
|
t2 = e3.value.data;
|
|
1074
1053
|
}
|
|
1075
|
-
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:
|
|
1054
|
+
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: ee(t2.content, {}), content: t2.content } });
|
|
1076
1055
|
});
|
|
1077
1056
|
}
|
|
1078
1057
|
refetch(e2) {
|
|
@@ -1092,13 +1071,13 @@ class oe extends $ {
|
|
|
1092
1071
|
if (false === (s2 == null ? void 0 : s2.ok)) return s2;
|
|
1093
1072
|
if (null === t2.data) return c({ lastChanged: t2.lastChanged, snapshot: null });
|
|
1094
1073
|
const n2 = s2 == null ? void 0 : s2.value;
|
|
1095
|
-
return c({ lastChanged: Math.max(t2.lastChanged, (_c = n2 == null ? void 0 : n2.lastChanged) != null ? _c : 0), snapshot: { sender: (_d = n2 == null ? void 0 : n2.snapshot) != null ? _d : 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:
|
|
1074
|
+
return c({ lastChanged: Math.max(t2.lastChanged, (_c = n2 == null ? void 0 : n2.lastChanged) != null ? _c : 0), snapshot: { sender: (_d = n2 == null ? void 0 : n2.snapshot) != null ? _d : 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: ee(t2.data.content, {}), content: t2.data.content, referencedMessageId: t2.data.referencedMessageId } });
|
|
1096
1075
|
});
|
|
1097
1076
|
}
|
|
1098
1077
|
messageEdited(e2, t2) {
|
|
1099
1078
|
this.mutate(e2, (s2) => {
|
|
1100
1079
|
if (null === s2.value.data) return s2;
|
|
1101
|
-
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:
|
|
1080
|
+
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: O(s2.value.data.editedAt, t2.diff.editedAt), custom: P(s2.value.data.custom, t2.diff.custom), content: O(s2.value.data.content, t2.diff.content) } });
|
|
1102
1081
|
});
|
|
1103
1082
|
}
|
|
1104
1083
|
messageDeleted(e2, t2) {
|
|
@@ -1117,7 +1096,7 @@ class oe extends $ {
|
|
|
1117
1096
|
});
|
|
1118
1097
|
}
|
|
1119
1098
|
}
|
|
1120
|
-
class
|
|
1099
|
+
class ne extends $ {
|
|
1121
1100
|
constructor(e2, t2, s2, n2) {
|
|
1122
1101
|
super(e2), this.createdAt = t2, this.dataStore = s2, this.referencedDataStore = n2;
|
|
1123
1102
|
}
|
|
@@ -1151,7 +1130,7 @@ class ue extends $ {
|
|
|
1151
1130
|
});
|
|
1152
1131
|
}
|
|
1153
1132
|
}
|
|
1154
|
-
class
|
|
1133
|
+
class re extends W {
|
|
1155
1134
|
constructor(e2, t2, s2, n2, r2) {
|
|
1156
1135
|
super(e2, t2, r2), this.conversationId = s2, this.realtimeClient = n2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1157
1136
|
}
|
|
@@ -1165,12 +1144,12 @@ class ce extends W {
|
|
|
1165
1144
|
}
|
|
1166
1145
|
fetchInitial(e2) {
|
|
1167
1146
|
return __async(this, null, function* () {
|
|
1168
|
-
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield
|
|
1169
|
-
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) :
|
|
1147
|
+
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield ie({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
|
|
1148
|
+
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null }) : ae({ seq: e2, messages: s2.value.messages, cursor: s2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : s2;
|
|
1170
1149
|
});
|
|
1171
1150
|
}
|
|
1172
1151
|
teardownNested(e2) {
|
|
1173
|
-
|
|
1152
|
+
oe(e2);
|
|
1174
1153
|
}
|
|
1175
1154
|
equal(e2, t2) {
|
|
1176
1155
|
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!U(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!U(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && U(e2.windowEnd, t2.windowEnd)));
|
|
@@ -1197,8 +1176,8 @@ class ce extends W {
|
|
|
1197
1176
|
const t2 = yield this.lastState.resultPromise;
|
|
1198
1177
|
if (!t2.ok) return;
|
|
1199
1178
|
if (null === t2.value.windowEnd) return;
|
|
1200
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1201
|
-
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) :
|
|
1179
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield ie({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient }), r2 = this.lastState.seq + 1e-6;
|
|
1180
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) : ae({ seq: r2, prevState: e3.value, messages: n2.value.messages, cursor: n2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1202
1181
|
});
|
|
1203
1182
|
}
|
|
1204
1183
|
messageCreated(e2, t2) {
|
|
@@ -1206,12 +1185,12 @@ class ce extends W {
|
|
|
1206
1185
|
if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."), s2;
|
|
1207
1186
|
if (s2.value.windowEnd && t2.state.createdAt < s2.value.windowEnd.oldestMessageTs) return s2;
|
|
1208
1187
|
if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
|
|
1209
|
-
const n2 = __spreadValues({}, s2.value.stores), r2 = new
|
|
1188
|
+
const n2 = __spreadValues({}, s2.value.stores), r2 = new se(e2, this.conversationId, t2.state, this.realtimeClient);
|
|
1210
1189
|
n2[t2.state.id] = r2;
|
|
1211
1190
|
const i2 = t2.state.referencedMessageId;
|
|
1212
1191
|
let a2;
|
|
1213
|
-
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new
|
|
1214
|
-
const o2 = new
|
|
1192
|
+
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new se(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
|
|
1193
|
+
const o2 = new ne(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
|
|
1215
1194
|
u2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1216
1195
|
const l2 = u2[0].messageId === t2.messageId ? e2 : s2.value.lastMessageChanged;
|
|
1217
1196
|
return c({ lastChanged: e2, lastMessageChanged: l2, stores: n2, inWindow: u2, windowEnd: s2.value.windowEnd });
|
|
@@ -1231,12 +1210,12 @@ class ce extends W {
|
|
|
1231
1210
|
delete n2[t2.messageId];
|
|
1232
1211
|
const r2 = s2.value.inWindow.filter((e3) => e3.messageId !== t2.messageId);
|
|
1233
1212
|
if (t2.newLastMessage && 0 === r2.length) {
|
|
1234
|
-
const s3 = new
|
|
1213
|
+
const s3 = new se(e2, this.conversationId, t2.newLastMessage, this.realtimeClient);
|
|
1235
1214
|
n2[s3.messageId] = s3;
|
|
1236
1215
|
const i3 = t2.newLastMessage.referencedMessageId;
|
|
1237
1216
|
let a2;
|
|
1238
|
-
null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new
|
|
1239
|
-
const o2 = new
|
|
1217
|
+
null === i3 ? a2 = null : i3 in n2 ? a2 = n2[i3] : (a2 = new se(e2, this.conversationId, i3, this.realtimeClient), n2[i3] = a2);
|
|
1218
|
+
const o2 = new ne(e2, t2.newLastMessage.createdAt, s3, a2);
|
|
1240
1219
|
r2.push(o2);
|
|
1241
1220
|
}
|
|
1242
1221
|
const i2 = void 0 !== t2.newLastMessage ? e2 : s2.value.lastMessageChanged;
|
|
@@ -1246,17 +1225,17 @@ class ce extends W {
|
|
|
1246
1225
|
conversationCleared(e2, t2) {
|
|
1247
1226
|
this.mutate(e2, (t3) => {
|
|
1248
1227
|
var _a2;
|
|
1249
|
-
return 0 === ((_a2 = t3.value.inWindow) == null ? void 0 : _a2.length) && null === t3.value.windowEnd ? t3 : (
|
|
1228
|
+
return 0 === ((_a2 = t3.value.inWindow) == null ? void 0 : _a2.length) && null === t3.value.windowEnd ? t3 : (oe(t3.value), c({ lastChanged: e2, lastMessageChanged: e2, stores: {}, inWindow: [], windowEnd: null }));
|
|
1250
1229
|
});
|
|
1251
1230
|
}
|
|
1252
1231
|
sideCreated(e2, t2) {
|
|
1253
1232
|
const s2 = this.fetchInitial(e2);
|
|
1254
1233
|
this.mutate(e2, (e3) => null !== e3.value.stores ? (s2.then((e4) => {
|
|
1255
|
-
e4.ok &&
|
|
1234
|
+
e4.ok && oe(e4.value);
|
|
1256
1235
|
}), e3) : s2);
|
|
1257
1236
|
}
|
|
1258
1237
|
sideDeleted(e2, t2) {
|
|
1259
|
-
this.mutate(e2, (t3) => null === t3.value.stores ? t3 : (
|
|
1238
|
+
this.mutate(e2, (t3) => null === t3.value.stores ? t3 : (oe(t3.value), c({ lastChanged: e2, lastMessageChanged: e2, stores: null, inWindow: null, windowEnd: null })));
|
|
1260
1239
|
}
|
|
1261
1240
|
getMessageFromCache(e2) {
|
|
1262
1241
|
return __async(this, null, function* () {
|
|
@@ -1268,7 +1247,7 @@ class ce extends W {
|
|
|
1268
1247
|
});
|
|
1269
1248
|
}
|
|
1270
1249
|
}
|
|
1271
|
-
function
|
|
1250
|
+
function ie(_0) {
|
|
1272
1251
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1273
1252
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "messages"], r2, { bypassCache: true });
|
|
1274
1253
|
if (i2.ok) {
|
|
@@ -1278,34 +1257,34 @@ function le(_0) {
|
|
|
1278
1257
|
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({ messages: null, nextCursor: null });
|
|
1279
1258
|
});
|
|
1280
1259
|
}
|
|
1281
|
-
function
|
|
1260
|
+
function ae({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1282
1261
|
var _a2, _b, _c, _d;
|
|
1283
1262
|
const a2 = t2 ? __spreadValues({}, t2.stores) : {};
|
|
1284
1263
|
for (const t3 of s2) if (void 0 === a2[t3.id]) {
|
|
1285
|
-
const s3 = new
|
|
1264
|
+
const s3 = new se(e2, r2, t3, i2);
|
|
1286
1265
|
a2[s3.messageId] = s3;
|
|
1287
1266
|
}
|
|
1288
1267
|
for (const t3 of s2) {
|
|
1289
1268
|
const s3 = t3.referencedMessageId;
|
|
1290
1269
|
if (s3 && void 0 === a2[s3]) {
|
|
1291
|
-
const t4 = new
|
|
1270
|
+
const t4 = new se(e2, r2, s3, i2);
|
|
1292
1271
|
a2[t4.messageId] = t4;
|
|
1293
1272
|
}
|
|
1294
1273
|
}
|
|
1295
1274
|
const o2 = t2 ? [...t2.inWindow] : [];
|
|
1296
|
-
for (const t3 of s2) o2.push(new
|
|
1275
|
+
for (const t3 of s2) o2.push(new ne(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
|
|
1297
1276
|
o2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1298
1277
|
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;
|
|
1299
1278
|
if (null === n2) return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: null });
|
|
1300
1279
|
return c({ lastChanged: e2, lastMessageChanged: h2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
|
|
1301
1280
|
}
|
|
1302
|
-
function
|
|
1281
|
+
function oe(e2) {
|
|
1303
1282
|
if (e2.stores) {
|
|
1304
1283
|
const t2 = l("TERMINATED");
|
|
1305
1284
|
Object.values(e2.stores).forEach((e3) => e3.setError(t2)), e2.inWindow.forEach((e3) => e3.setError(t2));
|
|
1306
1285
|
}
|
|
1307
1286
|
}
|
|
1308
|
-
class
|
|
1287
|
+
class ue extends W {
|
|
1309
1288
|
constructor(e2, t2, s2, n2, r2) {
|
|
1310
1289
|
super(e2, t2, r2), this.conversationId = s2, this.realtimeClient = n2, this.unsubscribeDebounceMs = 5e3;
|
|
1311
1290
|
}
|
|
@@ -1340,13 +1319,13 @@ class pe extends W {
|
|
|
1340
1319
|
});
|
|
1341
1320
|
}
|
|
1342
1321
|
participantEdited(e2, t2) {
|
|
1343
|
-
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:
|
|
1322
|
+
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: ce(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1344
1323
|
}
|
|
1345
1324
|
conversationEdited(e2, t2) {
|
|
1346
|
-
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:
|
|
1325
|
+
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: ce(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1347
1326
|
}
|
|
1348
1327
|
sideEdited(e2, t2) {
|
|
1349
|
-
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:
|
|
1328
|
+
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: ce(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1350
1329
|
}
|
|
1351
1330
|
sideCreated(e2, t2) {
|
|
1352
1331
|
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindowStore: s2.value.messageWindowStore }));
|
|
@@ -1361,13 +1340,83 @@ class pe extends W {
|
|
|
1361
1340
|
});
|
|
1362
1341
|
}
|
|
1363
1342
|
}
|
|
1364
|
-
function
|
|
1343
|
+
function ce(e2, t2) {
|
|
1365
1344
|
const s2 = t2;
|
|
1366
|
-
return { id: e2.id, createdAt: e2.createdAt, subject:
|
|
1345
|
+
return { id: e2.id, createdAt: e2.createdAt, subject: O(e2.subject, s2.subject), photoUrl: O(e2.photoUrl, s2.photoUrl), welcomeMessages: O(e2.welcomeMessages, s2.welcomeMessages), custom: P(e2.custom, s2.custom), lastMessageAt: O(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: O(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: O(e2.isUnread, s2.isUnread), access: O(e2.access, s2.access), notify: O(e2.notify, s2.notify), readUntil: O(e2.readUntil, s2.readUntil), joinedAt: e2.joinedAt };
|
|
1346
|
+
}
|
|
1347
|
+
function le(e2, t2) {
|
|
1348
|
+
for (let s2 in e2) Object.prototype.hasOwnProperty.call(e2, s2) && t2(e2[s2], s2);
|
|
1367
1349
|
}
|
|
1368
|
-
|
|
1350
|
+
function he(e2, t2) {
|
|
1351
|
+
return function(e3, t3) {
|
|
1352
|
+
let s2 = {}, n2 = 0;
|
|
1353
|
+
return le(e3, (e4, r2) => {
|
|
1354
|
+
const [i2, a2] = t3([r2, e4], n2++);
|
|
1355
|
+
s2[i2] = a2;
|
|
1356
|
+
}), s2;
|
|
1357
|
+
}(e2, ([e3, s2]) => [e3, t2(s2, e3)]);
|
|
1358
|
+
}
|
|
1359
|
+
class de extends W {
|
|
1360
|
+
constructor(e2, t2, s2, n2, r2) {
|
|
1361
|
+
super(e2, n2, r2), this.conversationId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
|
|
1362
|
+
}
|
|
1363
|
+
fetchInitial(e2) {
|
|
1364
|
+
return __async(this, null, function* () {
|
|
1365
|
+
const t2 = yield this.realtimeClient.call("GET", ["me", "conversations", this.conversationId, "typing"], {}, { bypassCache: true });
|
|
1366
|
+
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c({ data: null, lastChanged: e2 });
|
|
1367
|
+
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return c({ data: null, lastChanged: e2 });
|
|
1368
|
+
if (!t2.ok) return t2;
|
|
1369
|
+
const s2 = t2.value.data;
|
|
1370
|
+
if (s2.many) return c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1371
|
+
return c({ data: s2, userSubscriptions: he(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
equal(e2, t2) {
|
|
1375
|
+
return U(e2.data, t2.data);
|
|
1376
|
+
}
|
|
1377
|
+
loadNested(e2, t2) {
|
|
1378
|
+
return __async(this, null, function* () {
|
|
1379
|
+
if (null === t2.data) return c({ snapshot: null, lastChanged: t2.lastChanged });
|
|
1380
|
+
if (t2.data.many) return c({ snapshot: { many: true }, lastChanged: t2.lastChanged });
|
|
1381
|
+
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);
|
|
1382
|
+
if (r2) return r2;
|
|
1383
|
+
const i2 = n2.map((e3) => e3.value), a2 = i2.map((e3) => e3.snapshot), o2 = i2.map((e3) => e3.lastChanged);
|
|
1384
|
+
return c({ snapshot: { users: a2, many: false }, lastChanged: Math.max(t2.lastChanged, ...o2) });
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
typingAvailable(e2, t2) {
|
|
1388
|
+
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : he(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
|
|
1389
|
+
}
|
|
1390
|
+
typingChanged(e2, t2) {
|
|
1391
|
+
this.mutate(e2, (s2) => {
|
|
1392
|
+
if (null === s2.value.data) return s2;
|
|
1393
|
+
if (void 0 === t2.diff.many) {
|
|
1394
|
+
if (true === s2.value.data.many) return s2;
|
|
1395
|
+
const n2 = __spreadValues({}, s2.value.data.usersTyping), r2 = __spreadValues({}, s2.value.userSubscriptions);
|
|
1396
|
+
return le(t2.diff.usersTyping, (e3, t3) => {
|
|
1397
|
+
var _a2;
|
|
1398
|
+
"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]);
|
|
1399
|
+
}), c({ data: { usersTyping: n2, many: false }, userSubscriptions: r2, lastChanged: e2 });
|
|
1400
|
+
}
|
|
1401
|
+
if (true === t2.diff.many) return s2.value.data.many ? s2 : c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1402
|
+
if (false === t2.diff.many) {
|
|
1403
|
+
if (false === s2.value.data.many) return s2;
|
|
1404
|
+
const n2 = he(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
|
|
1405
|
+
return c({ data: t2.diff, userSubscriptions: n2, lastChanged: e2 });
|
|
1406
|
+
}
|
|
1407
|
+
throw t2.diff, "Unreachable";
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
sideDeleted(e2, t2) {
|
|
1411
|
+
this.mutate(e2, (t3) => null === t3.value.data ? t3 : c({ data: null, lastChanged: e2 }));
|
|
1412
|
+
}
|
|
1413
|
+
teardownNested(e2) {
|
|
1414
|
+
e2.data && le(e2.userSubscriptions, (e3) => e3.unsubscribe());
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
class pe {
|
|
1369
1418
|
constructor(e2, t2, s2) {
|
|
1370
|
-
this.realtimeClient = s2, this.userStores = {}, this.messageWindowStores = {}, this.conversationStores = {}, this.emitMutex = new j(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new _(e2, t2, { onUpstreamRestarting: () => {
|
|
1419
|
+
this.realtimeClient = s2, this.userStores = {}, this.messageWindowStores = {}, this.conversationStores = {}, this.typingStores = {}, this.emitMutex = new j(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new _(e2, t2, { onUpstreamRestarting: () => {
|
|
1371
1420
|
this.refetchOnNextNetworkLoss = false;
|
|
1372
1421
|
}, onReady: () => {
|
|
1373
1422
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -1394,10 +1443,11 @@ class ge {
|
|
|
1394
1443
|
for (const t2 of Object.values(this.userStores)) t2.refetch(e2);
|
|
1395
1444
|
for (const t2 of Object.values(this.messageWindowStores)) t2.refetch(e2);
|
|
1396
1445
|
for (const t2 of Object.values(this.conversationStores)) t2.refetch(e2);
|
|
1446
|
+
for (const t2 of Object.values(this.typingStores)) t2.refetch(e2);
|
|
1397
1447
|
}
|
|
1398
1448
|
emitAll(e2) {
|
|
1399
1449
|
return this.emitMutex.runExclusive(() => __async(this, null, function* () {
|
|
1400
|
-
yield Promise.all([...Object.values(this.userStores).map((t2) => t2.emit(e2)), ...Object.values(this.messageWindowStores).map((t2) => t2.emit(e2)), ...Object.values(this.conversationStores).map((t2) => t2.emit(e2))]);
|
|
1450
|
+
yield Promise.all([...Object.values(this.userStores).map((t2) => t2.emit(e2)), ...Object.values(this.messageWindowStores).map((t2) => t2.emit(e2)), ...Object.values(this.conversationStores).map((t2) => t2.emit(e2)), ...Object.values(this.typingStores).map((t2) => t2.emit(e2))]);
|
|
1401
1451
|
}));
|
|
1402
1452
|
}
|
|
1403
1453
|
handlePublish(e2, t2) {
|
|
@@ -1422,11 +1472,22 @@ class ge {
|
|
|
1422
1472
|
return this.handleMessageEdited(e2, t2);
|
|
1423
1473
|
case "message.deleted":
|
|
1424
1474
|
return this.handleMessageDeleted(e2, t2);
|
|
1425
|
-
case "
|
|
1475
|
+
case "typing.available":
|
|
1476
|
+
return this.handleTypingAvailable(e2, t2);
|
|
1477
|
+
case "typing.changed":
|
|
1478
|
+
return this.handleTypingChanged(e2, t2);
|
|
1426
1479
|
case "conversation.cleared":
|
|
1427
1480
|
return this.handleConversationCleared(e2, t2);
|
|
1428
1481
|
}
|
|
1429
1482
|
}
|
|
1483
|
+
handleTypingAvailable(e2, t2) {
|
|
1484
|
+
const s2 = this.typingStores[t2.conversationId];
|
|
1485
|
+
s2 && s2.typingAvailable(e2, t2);
|
|
1486
|
+
}
|
|
1487
|
+
handleTypingChanged(e2, t2) {
|
|
1488
|
+
const s2 = this.typingStores[t2.conversationId];
|
|
1489
|
+
s2 && s2.typingChanged(e2, t2);
|
|
1490
|
+
}
|
|
1430
1491
|
handleUserCreated(e2, t2) {
|
|
1431
1492
|
const s2 = this.userStores[t2.userId];
|
|
1432
1493
|
s2 && s2.userCreated(e2, t2);
|
|
@@ -1458,6 +1519,8 @@ class ge {
|
|
|
1458
1519
|
s2 && s2.sideDeleted(e2, t2);
|
|
1459
1520
|
const n2 = this.conversationStores[t2.conversationId];
|
|
1460
1521
|
n2 && n2.sideDeleted(e2, t2);
|
|
1522
|
+
const r2 = this.typingStores[t2.conversationId];
|
|
1523
|
+
r2 && r2.sideDeleted(e2, t2);
|
|
1461
1524
|
}
|
|
1462
1525
|
handleMessageCreated(e2, t2) {
|
|
1463
1526
|
const s2 = this.messageWindowStores[t2.conversationId];
|
|
@@ -1551,7 +1614,7 @@ class ge {
|
|
|
1551
1614
|
this.connection.subscribe(["me", "conversations", t2]).then((t3) => {
|
|
1552
1615
|
t3.ok || e3.setError(t3);
|
|
1553
1616
|
});
|
|
1554
|
-
const e3 = new
|
|
1617
|
+
const e3 = new ue(this.seq, this.emitMutex, t2, this.realtimeClient, () => {
|
|
1555
1618
|
delete this.conversationStores[t2], this.connection.unsubscribe(["me", "conversations", t2]);
|
|
1556
1619
|
});
|
|
1557
1620
|
return this.conversationStores[t2] = e3, e3;
|
|
@@ -1564,16 +1627,29 @@ class ge {
|
|
|
1564
1627
|
this.connection.subscribe(["me", "conversations", t2, "messages"]).then((t3) => {
|
|
1565
1628
|
t3.ok || e3.setError(t3);
|
|
1566
1629
|
});
|
|
1567
|
-
const e3 = new
|
|
1630
|
+
const e3 = new re(this.seq, this.emitMutex, t2, this.realtimeClient, () => {
|
|
1568
1631
|
delete this.messageWindowStores[t2], this.connection.unsubscribe(["me", "conversations", t2, "messages"]);
|
|
1569
1632
|
});
|
|
1570
1633
|
return this.messageWindowStores[t2] = e3, e3;
|
|
1571
1634
|
}
|
|
1572
1635
|
}
|
|
1636
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) {
|
|
1637
|
+
const t2 = e2[2];
|
|
1638
|
+
if (Object.hasOwnProperty.call(this.typingStores, t2)) return this.typingStores[t2];
|
|
1639
|
+
{
|
|
1640
|
+
this.connection.subscribe(["me", "conversations", t2, "typing"]).then((t3) => {
|
|
1641
|
+
t3.ok || e3.setError(t3);
|
|
1642
|
+
});
|
|
1643
|
+
const e3 = new de(this.seq, t2, this.realtimeClient, this.emitMutex, () => {
|
|
1644
|
+
delete this.typingStores[t2], this.connection.unsubscribe(["me", "conversations", t2, "typing"]);
|
|
1645
|
+
});
|
|
1646
|
+
return this.typingStores[t2] = e3, e3;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1573
1649
|
throw new Error("Unrecognised subscribe path: " + e2);
|
|
1574
1650
|
}
|
|
1575
1651
|
getStoreIfExists(e2) {
|
|
1576
|
-
var _a2, _b;
|
|
1652
|
+
var _a2, _b, _c;
|
|
1577
1653
|
if (s(e2, ["users", "*"])) {
|
|
1578
1654
|
const t2 = e2[1];
|
|
1579
1655
|
return (_a2 = this.userStores[t2]) != null ? _a2 : null;
|
|
@@ -1582,6 +1658,10 @@ class ge {
|
|
|
1582
1658
|
const t2 = e2[2];
|
|
1583
1659
|
return (_b = this.messageWindowStores[t2]) != null ? _b : null;
|
|
1584
1660
|
}
|
|
1661
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) {
|
|
1662
|
+
const t2 = e2[2];
|
|
1663
|
+
return (_c = this.typingStores[t2]) != null ? _c : null;
|
|
1664
|
+
}
|
|
1585
1665
|
throw new Error("Unrecognised subscribe path: " + e2);
|
|
1586
1666
|
}
|
|
1587
1667
|
destroy() {
|
|
@@ -1591,9 +1671,9 @@ class ge {
|
|
|
1591
1671
|
return this.connection.isConnected();
|
|
1592
1672
|
}
|
|
1593
1673
|
}
|
|
1594
|
-
class
|
|
1674
|
+
class fe {
|
|
1595
1675
|
constructor(e2, t2, s2) {
|
|
1596
|
-
this.userId = t2, this.alive = true, this.connection = new
|
|
1676
|
+
this.userId = t2, this.alive = true, this.connection = new pe(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
1597
1677
|
this.destroy();
|
|
1598
1678
|
});
|
|
1599
1679
|
}
|
|
@@ -1618,7 +1698,7 @@ class me {
|
|
|
1618
1698
|
listMessages(e2, t2) {
|
|
1619
1699
|
return __async(this, null, function* () {
|
|
1620
1700
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
|
|
1621
|
-
if (!s2.ok) return
|
|
1701
|
+
if (!s2.ok) return ge(s2, "Listing messages in " + e2);
|
|
1622
1702
|
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.createMessageSnapshot(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
1623
1703
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
1624
1704
|
return c(r2.map(({ value: e3 }) => e3));
|
|
@@ -1647,7 +1727,7 @@ class me {
|
|
|
1647
1727
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
|
|
1648
1728
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
|
|
1649
1729
|
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
|
|
1650
|
-
if (!s2.ok) return
|
|
1730
|
+
if (!s2.ok) return ge(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
1651
1731
|
const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
|
|
1652
1732
|
if (!r2.ok) return r2;
|
|
1653
1733
|
const i2 = r2.value;
|
|
@@ -1658,26 +1738,26 @@ class me {
|
|
|
1658
1738
|
return __async(this, null, function* () {
|
|
1659
1739
|
const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
|
|
1660
1740
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
|
|
1661
|
-
if (!t2.ok) return
|
|
1741
|
+
if (!t2.ok) return ge(t2, "Get user " + e2);
|
|
1662
1742
|
return c(this.createUserSnapshot(t2.value.data));
|
|
1663
1743
|
});
|
|
1664
1744
|
}
|
|
1665
1745
|
createMessageSnapshotPreloaded(e2, t2, s2) {
|
|
1666
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext:
|
|
1746
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: ee(e2.content, {}) };
|
|
1667
1747
|
}
|
|
1668
1748
|
createReferencedMessageSnapshotPreloaded(e2, t2) {
|
|
1669
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext:
|
|
1749
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: ee(e2.content, {}) };
|
|
1670
1750
|
}
|
|
1671
1751
|
}
|
|
1672
|
-
function
|
|
1752
|
+
function ge(e2, t2) {
|
|
1673
1753
|
return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
1674
1754
|
}
|
|
1675
|
-
function
|
|
1755
|
+
function me(e2, s2) {
|
|
1676
1756
|
var _a2;
|
|
1677
1757
|
if (s2.ok) return s2.value;
|
|
1678
1758
|
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));
|
|
1679
1759
|
}
|
|
1680
|
-
class
|
|
1760
|
+
class ve {
|
|
1681
1761
|
constructor(e2, t2) {
|
|
1682
1762
|
this.id = e2, this._realtimeClient = t2;
|
|
1683
1763
|
}
|
|
@@ -1687,7 +1767,7 @@ class we {
|
|
|
1687
1767
|
get() {
|
|
1688
1768
|
return __async(this, null, function* () {
|
|
1689
1769
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
1690
|
-
return
|
|
1770
|
+
return me("Get user " + this.id, e2);
|
|
1691
1771
|
});
|
|
1692
1772
|
}
|
|
1693
1773
|
set(t2) {
|
|
@@ -1708,7 +1788,7 @@ class we {
|
|
|
1708
1788
|
return this._realtimeClient.subscribe(["users", this.brandedId], e2);
|
|
1709
1789
|
}
|
|
1710
1790
|
}
|
|
1711
|
-
class
|
|
1791
|
+
class be {
|
|
1712
1792
|
constructor(e2, t2, s2) {
|
|
1713
1793
|
this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
1714
1794
|
}
|
|
@@ -1752,7 +1832,7 @@ class ye {
|
|
|
1752
1832
|
});
|
|
1753
1833
|
}
|
|
1754
1834
|
}
|
|
1755
|
-
function
|
|
1835
|
+
function ye(e2) {
|
|
1756
1836
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
1757
1837
|
let s2 = 0;
|
|
1758
1838
|
const n2 = [], r2 = e2 === s2;
|
|
@@ -1770,7 +1850,7 @@ function Ae(e2) {
|
|
|
1770
1850
|
if (20 != a2.length) throw new Error("Length should be 20.");
|
|
1771
1851
|
return a2;
|
|
1772
1852
|
}
|
|
1773
|
-
const
|
|
1853
|
+
const we = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
1774
1854
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
1775
1855
|
}(e2, (e3) => {
|
|
1776
1856
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -1783,14 +1863,14 @@ const Ce = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
1783
1863
|
case "bulletList":
|
|
1784
1864
|
case "bulletpoint":
|
|
1785
1865
|
case "bulletPoint":
|
|
1786
|
-
return [{ type: e3.type, children:
|
|
1866
|
+
return [{ type: e3.type, children: we(e3.children, t2, e3.type) }];
|
|
1787
1867
|
case "link":
|
|
1788
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
1868
|
+
return [{ type: e3.type, url: e3.url, children: we(e3.children, t2, e3.type) }];
|
|
1789
1869
|
case "actionlink":
|
|
1790
1870
|
case "actionLink":
|
|
1791
1871
|
case "actionbutton":
|
|
1792
1872
|
case "actionButton":
|
|
1793
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
1873
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: we(e3.children, t2, e3.type) }];
|
|
1794
1874
|
case "mention":
|
|
1795
1875
|
case "autolink":
|
|
1796
1876
|
case "autoLink":
|
|
@@ -1805,12 +1885,12 @@ const Ce = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
1805
1885
|
return [e3];
|
|
1806
1886
|
}
|
|
1807
1887
|
});
|
|
1808
|
-
function
|
|
1888
|
+
function Ae(e2, t2) {
|
|
1809
1889
|
return (s2) => {
|
|
1810
1890
|
const n2 = s2;
|
|
1811
1891
|
let r2 = 0;
|
|
1812
1892
|
const i2 = [];
|
|
1813
|
-
for (const a2 of
|
|
1893
|
+
for (const a2 of z(s2, e2)) {
|
|
1814
1894
|
a2.index - r2 > 0 && i2.push(n2.substring(r2, a2.index));
|
|
1815
1895
|
const e3 = t2(a2);
|
|
1816
1896
|
Array.isArray(e3) ? i2.push(...e3) : i2.push(e3), r2 = a2.index + a2[0].length;
|
|
@@ -1818,29 +1898,29 @@ function Ee(e2, t2) {
|
|
|
1818
1898
|
return r2 < s2.length && i2.push(s2.substring(r2)), i2;
|
|
1819
1899
|
};
|
|
1820
1900
|
}
|
|
1821
|
-
const
|
|
1822
|
-
var
|
|
1823
|
-
const
|
|
1901
|
+
const Ce = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1902
|
+
var Ee = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(Ee || {});
|
|
1903
|
+
const ke = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
1824
1904
|
const t2 = [];
|
|
1825
1905
|
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");
|
|
1826
|
-
}),
|
|
1827
|
-
function
|
|
1828
|
-
return
|
|
1906
|
+
}), xe = { _: 1, "*": 4, "~": 2 };
|
|
1907
|
+
function Se(e2) {
|
|
1908
|
+
return Te(e2, 0);
|
|
1829
1909
|
}
|
|
1830
|
-
function
|
|
1831
|
-
const s2 =
|
|
1832
|
-
const t3 =
|
|
1910
|
+
function Te(e2, t2 = 0) {
|
|
1911
|
+
const s2 = ke[t2], n2 = s2 ? function(e3) {
|
|
1912
|
+
const t3 = De.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${Ce}])(?:${e3.source})(?=[\\s${Ce}]|$)`, "g")), s3 = Ae(t3, (e4) => {
|
|
1833
1913
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
1834
|
-
return [" ", { type: xe[
|
|
1914
|
+
return [" ", { type: Ee[xe[t4]], children: [s4] }];
|
|
1835
1915
|
});
|
|
1836
1916
|
return (e4) => {
|
|
1837
1917
|
const [t4, ...n3] = s3(" " + e4);
|
|
1838
1918
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
1839
1919
|
};
|
|
1840
1920
|
}(s2) : () => [e2];
|
|
1841
|
-
return
|
|
1921
|
+
return we(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Te(e3, t2 | Ee[s3]) : [e3]);
|
|
1842
1922
|
}
|
|
1843
|
-
const
|
|
1923
|
+
const De = function() {
|
|
1844
1924
|
const e2 = function() {
|
|
1845
1925
|
try {
|
|
1846
1926
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -1856,18 +1936,18 @@ const Fe = function() {
|
|
|
1856
1936
|
return e2.set(t2, n2), n2;
|
|
1857
1937
|
} };
|
|
1858
1938
|
}();
|
|
1859
|
-
function
|
|
1939
|
+
function Ie(e2, t2) {
|
|
1860
1940
|
if (Array.prototype.indexOf) return e2.indexOf(t2);
|
|
1861
1941
|
for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
|
|
1862
1942
|
return -1;
|
|
1863
1943
|
}
|
|
1864
|
-
function
|
|
1944
|
+
function Fe(e2, t2) {
|
|
1865
1945
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
1866
1946
|
}
|
|
1867
|
-
function
|
|
1947
|
+
function Be(e2) {
|
|
1868
1948
|
throw new Error("Unhandled case for value: '" + e2 + "'");
|
|
1869
1949
|
}
|
|
1870
|
-
var
|
|
1950
|
+
var Me = function() {
|
|
1871
1951
|
function e2(e3) {
|
|
1872
1952
|
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 || "";
|
|
1873
1953
|
}
|
|
@@ -1886,11 +1966,11 @@ var Ne = function() {
|
|
|
1886
1966
|
}, e2.prototype.setClass = function(e3) {
|
|
1887
1967
|
return this.setAttr("class", e3);
|
|
1888
1968
|
}, e2.prototype.addClass = function(e3) {
|
|
1889
|
-
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 ===
|
|
1969
|
+
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Ie(r2, t2) && r2.push(t2);
|
|
1890
1970
|
return this.getAttrs().class = r2.join(" "), this;
|
|
1891
1971
|
}, e2.prototype.removeClass = function(e3) {
|
|
1892
1972
|
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
|
|
1893
|
-
var a2 =
|
|
1973
|
+
var a2 = Ie(r2, t2);
|
|
1894
1974
|
-1 !== a2 && r2.splice(a2, 1);
|
|
1895
1975
|
}
|
|
1896
1976
|
return this.getAttrs().class = r2.join(" "), this;
|
|
@@ -1916,12 +1996,12 @@ var Ne = function() {
|
|
|
1916
1996
|
return t2.join(" ");
|
|
1917
1997
|
}, e2;
|
|
1918
1998
|
}();
|
|
1919
|
-
var
|
|
1999
|
+
var Re = function() {
|
|
1920
2000
|
function e2(e3) {
|
|
1921
2001
|
void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
|
|
1922
2002
|
}
|
|
1923
2003
|
return e2.prototype.build = function(e3) {
|
|
1924
|
-
return new
|
|
2004
|
+
return new Me({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
1925
2005
|
}, e2.prototype.createAttrs = function(e3) {
|
|
1926
2006
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
1927
2007
|
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;
|
|
@@ -1991,7 +2071,7 @@ var _e = function() {
|
|
|
1991
2071
|
}(e4, t3, s3);
|
|
1992
2072
|
}(e3, s2);
|
|
1993
2073
|
}, e2;
|
|
1994
|
-
}(),
|
|
2074
|
+
}(), Ne = function() {
|
|
1995
2075
|
function e2(e3) {
|
|
1996
2076
|
this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
|
|
1997
2077
|
}
|
|
@@ -2006,30 +2086,30 @@ var _e = function() {
|
|
|
2006
2086
|
}, e2.prototype.buildTag = function() {
|
|
2007
2087
|
return this.tagBuilder.build(this);
|
|
2008
2088
|
}, e2;
|
|
2009
|
-
}(),
|
|
2010
|
-
return
|
|
2089
|
+
}(), _e = function(e2, t2) {
|
|
2090
|
+
return _e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2011
2091
|
e3.__proto__ = t3;
|
|
2012
2092
|
} || function(e3, t3) {
|
|
2013
2093
|
for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
|
|
2014
|
-
},
|
|
2094
|
+
}, _e(e2, t2);
|
|
2015
2095
|
};
|
|
2016
|
-
function
|
|
2096
|
+
function Oe(e2, t2) {
|
|
2017
2097
|
function s2() {
|
|
2018
2098
|
this.constructor = e2;
|
|
2019
2099
|
}
|
|
2020
|
-
|
|
2100
|
+
_e(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2021
2101
|
}
|
|
2022
|
-
var
|
|
2023
|
-
return
|
|
2102
|
+
var Pe, Ue = function() {
|
|
2103
|
+
return Ue = Object.assign || function(e2) {
|
|
2024
2104
|
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]);
|
|
2025
2105
|
return e2;
|
|
2026
|
-
},
|
|
2027
|
-
},
|
|
2106
|
+
}, Ue.apply(this, arguments);
|
|
2107
|
+
}, je = function(e2) {
|
|
2028
2108
|
function t2(t3) {
|
|
2029
2109
|
var s2 = e2.call(this, t3) || this;
|
|
2030
2110
|
return s2.email = "", s2.email = t3.email, s2;
|
|
2031
2111
|
}
|
|
2032
|
-
return
|
|
2112
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2033
2113
|
return "email";
|
|
2034
2114
|
}, t2.prototype.getEmail = function() {
|
|
2035
2115
|
return this.email;
|
|
@@ -2038,12 +2118,12 @@ var je, $e = function() {
|
|
|
2038
2118
|
}, t2.prototype.getAnchorText = function() {
|
|
2039
2119
|
return this.email;
|
|
2040
2120
|
}, t2;
|
|
2041
|
-
}(
|
|
2121
|
+
}(Ne), $e = function(e2) {
|
|
2042
2122
|
function t2(t3) {
|
|
2043
2123
|
var s2 = e2.call(this, t3) || this;
|
|
2044
2124
|
return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2045
2125
|
}
|
|
2046
|
-
return
|
|
2126
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2047
2127
|
return "hashtag";
|
|
2048
2128
|
}, t2.prototype.getServiceName = function() {
|
|
2049
2129
|
return this.serviceName;
|
|
@@ -2064,12 +2144,12 @@ var je, $e = function() {
|
|
|
2064
2144
|
}, t2.prototype.getAnchorText = function() {
|
|
2065
2145
|
return "#" + this.hashtag;
|
|
2066
2146
|
}, t2;
|
|
2067
|
-
}(
|
|
2147
|
+
}(Ne), We = function(e2) {
|
|
2068
2148
|
function t2(t3) {
|
|
2069
2149
|
var s2 = e2.call(this, t3) || this;
|
|
2070
2150
|
return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2071
2151
|
}
|
|
2072
|
-
return
|
|
2152
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2073
2153
|
return "mention";
|
|
2074
2154
|
}, t2.prototype.getMention = function() {
|
|
2075
2155
|
return this.mention;
|
|
@@ -2092,12 +2172,12 @@ var je, $e = function() {
|
|
|
2092
2172
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2093
2173
|
return s2 && t3.push(s2), t3;
|
|
2094
2174
|
}, t2;
|
|
2095
|
-
}(
|
|
2175
|
+
}(Ne), qe = function(e2) {
|
|
2096
2176
|
function t2(t3) {
|
|
2097
2177
|
var s2 = e2.call(this, t3) || this;
|
|
2098
2178
|
return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2099
2179
|
}
|
|
2100
|
-
return
|
|
2180
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2101
2181
|
return "phone";
|
|
2102
2182
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2103
2183
|
return this.number;
|
|
@@ -2108,12 +2188,12 @@ var je, $e = function() {
|
|
|
2108
2188
|
}, t2.prototype.getAnchorText = function() {
|
|
2109
2189
|
return this.matchedText;
|
|
2110
2190
|
}, t2;
|
|
2111
|
-
}(
|
|
2191
|
+
}(Ne), He = function(e2) {
|
|
2112
2192
|
function t2(t3) {
|
|
2113
2193
|
var s2 = e2.call(this, t3) || this;
|
|
2114
2194
|
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;
|
|
2115
2195
|
}
|
|
2116
|
-
return
|
|
2196
|
+
return Oe(t2, e2), t2.prototype.getType = function() {
|
|
2117
2197
|
return "url";
|
|
2118
2198
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2119
2199
|
return this.urlMatchType;
|
|
@@ -2141,19 +2221,19 @@ var je, $e = function() {
|
|
|
2141
2221
|
return t3;
|
|
2142
2222
|
}
|
|
2143
2223
|
}, t2;
|
|
2144
|
-
}(
|
|
2224
|
+
}(Ne), Ge = function(e2) {
|
|
2145
2225
|
this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
|
|
2146
|
-
},
|
|
2147
|
-
return "(?=(" +
|
|
2148
|
-
},
|
|
2149
|
-
return "(?:" +
|
|
2150
|
-
}, ut = new RegExp("[" + nt + "]"), ct = /(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, lt = new RegExp("[" + nt + "!#$%&'*+/=?^_`{|}~-]"), ht = new RegExp("^" + ct.source + "$"), dt = function(e2) {
|
|
2226
|
+
}, Le = /[A-Za-z]/, ze = /[\d]/, Je = /[\D]/, Ye = /\s/, Qe = /['"]/, Ve = /[\x00-\x1F\x7F]/, Ze = /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, Ke = Ze + /\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, Xe = /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, et = Ke + Xe, tt = Ke + Xe, st = "(?:[" + Xe + "]{1,3}\\.){3}[" + Xe + "]{1,3}", nt = "[" + tt + "](?:[" + tt + "\\-]{0,61}[" + tt + "])?", rt = function(e2) {
|
|
2227
|
+
return "(?=(" + nt + "))\\" + e2;
|
|
2228
|
+
}, it = function(e2) {
|
|
2229
|
+
return "(?:" + rt(e2) + "(?:\\." + rt(e2 + 1) + "){0,126}|" + st + ")";
|
|
2230
|
+
}, at = new RegExp("[" + tt + "]"), ot = /(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, ut = new RegExp("[" + tt + "!#$%&'*+/=?^_`{|}~-]"), ct = new RegExp("^" + ot.source + "$"), lt = function(e2) {
|
|
2151
2231
|
function t2() {
|
|
2152
2232
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2153
|
-
return t3.localPartCharRegex =
|
|
2233
|
+
return t3.localPartCharRegex = ut, t3.strictTldRegex = ct, t3;
|
|
2154
2234
|
}
|
|
2155
|
-
return
|
|
2156
|
-
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new
|
|
2235
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2236
|
+
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new ht(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
|
|
2157
2237
|
var h2 = e3.charAt(u2);
|
|
2158
2238
|
switch (c2) {
|
|
2159
2239
|
case 0:
|
|
@@ -2178,19 +2258,19 @@ var je, $e = function() {
|
|
|
2178
2258
|
b2(h2);
|
|
2179
2259
|
break;
|
|
2180
2260
|
case 7:
|
|
2181
|
-
|
|
2261
|
+
y2(h2);
|
|
2182
2262
|
break;
|
|
2183
2263
|
default:
|
|
2184
|
-
|
|
2264
|
+
Be(c2);
|
|
2185
2265
|
}
|
|
2186
2266
|
u2++;
|
|
2187
2267
|
}
|
|
2188
2268
|
return C2(), r2;
|
|
2189
2269
|
function d2(e4) {
|
|
2190
|
-
"m" === e4 ?
|
|
2270
|
+
"m" === e4 ? w2(1) : s2.test(e4) && w2();
|
|
2191
2271
|
}
|
|
2192
2272
|
function p2(e4, t4) {
|
|
2193
|
-
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new
|
|
2273
|
+
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new ht(Ue(Ue({}, l2), { hasMailtoPrefix: true }))) : A2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : A2());
|
|
2194
2274
|
}
|
|
2195
2275
|
function f2(e4) {
|
|
2196
2276
|
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || A2();
|
|
@@ -2199,19 +2279,19 @@ var je, $e = function() {
|
|
|
2199
2279
|
"." === e4 || "@" === e4 ? A2() : s2.test(e4) ? c2 = 2 : A2();
|
|
2200
2280
|
}
|
|
2201
2281
|
function m2(e4) {
|
|
2202
|
-
|
|
2282
|
+
at.test(e4) ? c2 = 5 : A2();
|
|
2203
2283
|
}
|
|
2204
2284
|
function v2(e4) {
|
|
2205
|
-
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 :
|
|
2285
|
+
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : at.test(e4) || C2();
|
|
2206
2286
|
}
|
|
2207
2287
|
function b2(e4) {
|
|
2208
|
-
"-" === e4 || "." === e4 ? C2() :
|
|
2209
|
-
}
|
|
2210
|
-
function w2(e4) {
|
|
2211
|
-
"." === e4 || "-" === e4 ? C2() : ut.test(e4) ? (c2 = 5, l2 = new pt($e($e({}, l2), { hasDomainDot: true }))) : C2();
|
|
2288
|
+
"-" === e4 || "." === e4 ? C2() : at.test(e4) ? c2 = 5 : C2();
|
|
2212
2289
|
}
|
|
2213
2290
|
function y2(e4) {
|
|
2214
|
-
|
|
2291
|
+
"." === e4 || "-" === e4 ? C2() : at.test(e4) ? (c2 = 5, l2 = new ht(Ue(Ue({}, l2), { hasDomainDot: true }))) : C2();
|
|
2292
|
+
}
|
|
2293
|
+
function w2(e4) {
|
|
2294
|
+
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new ht({ idx: u2 });
|
|
2215
2295
|
}
|
|
2216
2296
|
function A2() {
|
|
2217
2297
|
c2 = 0, l2 = a2;
|
|
@@ -2224,14 +2304,14 @@ var je, $e = function() {
|
|
|
2224
2304
|
(function(e4) {
|
|
2225
2305
|
var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
|
|
2226
2306
|
return n2.test(s4);
|
|
2227
|
-
})(i3) && r2.push(new
|
|
2307
|
+
})(i3) && r2.push(new je({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
|
|
2228
2308
|
}
|
|
2229
2309
|
A2();
|
|
2230
2310
|
}
|
|
2231
2311
|
}, t2;
|
|
2232
|
-
}(
|
|
2312
|
+
}(Ge), ht = function(e2) {
|
|
2233
2313
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
|
|
2234
|
-
},
|
|
2314
|
+
}, dt = function() {
|
|
2235
2315
|
function e2() {
|
|
2236
2316
|
}
|
|
2237
2317
|
return e2.isValid = function(e3, t2) {
|
|
@@ -2249,16 +2329,16 @@ var je, $e = function() {
|
|
|
2249
2329
|
return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
|
|
2250
2330
|
}, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
|
|
2251
2331
|
return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
|
|
2252
|
-
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" +
|
|
2253
|
-
}(),
|
|
2332
|
+
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + Ze + "]"), 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;
|
|
2333
|
+
}(), pt = (Pe = new RegExp("[/?#](?:[" + tt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + tt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, it(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, it(6), ")", "|", "(", "(//)?", it(10) + "\\.", ot.source, "(?![-" + et + "])", ")", ")", "(?::[0-9]+)?", "(?:" + Pe.source + ")?"].join(""), "gi")), ft = new RegExp("[" + tt + "]"), gt = function(e2) {
|
|
2254
2334
|
function t2(t3) {
|
|
2255
2335
|
var s2 = e2.call(this, t3) || this;
|
|
2256
|
-
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex =
|
|
2336
|
+
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = pt, s2.wordCharRegExp = ft, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2257
2337
|
}
|
|
2258
|
-
return
|
|
2338
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2259
2339
|
for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
|
|
2260
2340
|
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);
|
|
2261
|
-
if (!
|
|
2341
|
+
if (!dt.isValid(s3, u3)) return "continue";
|
|
2262
2342
|
if (p2 > 0 && "@" === g2) return "continue";
|
|
2263
2343
|
if (p2 > 0 && f2 && c2.wordCharRegExp.test(g2)) return "continue";
|
|
2264
2344
|
if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
|
|
@@ -2273,8 +2353,8 @@ var je, $e = function() {
|
|
|
2273
2353
|
var b2 = s3.indexOf(v2);
|
|
2274
2354
|
s3 = s3.substr(b2), u3 = u3.substr(b2), p2 += b2;
|
|
2275
2355
|
}
|
|
2276
|
-
var
|
|
2277
|
-
o2.push(new
|
|
2356
|
+
var y2 = u3 ? "scheme" : l2 ? "www" : "tld", w2 = !!u3;
|
|
2357
|
+
o2.push(new He({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: y2, url: s3, protocolUrlMatch: w2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
|
|
2278
2358
|
}, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
|
|
2279
2359
|
return o2;
|
|
2280
2360
|
}, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
|
|
@@ -2294,58 +2374,58 @@ var je, $e = function() {
|
|
|
2294
2374
|
if (!e3) return -1;
|
|
2295
2375
|
var s2 = 0;
|
|
2296
2376
|
t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
|
|
2297
|
-
var n2 = new RegExp("^((.?//)?[-." +
|
|
2377
|
+
var n2 = new RegExp("^((.?//)?[-." + tt + "]*[-" + tt + "]\\.[-" + tt + "]+)").exec(e3);
|
|
2298
2378
|
return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
|
|
2299
2379
|
}, t2;
|
|
2300
|
-
}(
|
|
2380
|
+
}(Ge), mt = new RegExp("#[_" + tt + "]{1,139}(?![_" + tt + "])", "g"), vt = new RegExp("[^" + tt + "]"), bt = function(e2) {
|
|
2301
2381
|
function t2(t3) {
|
|
2302
2382
|
var s2 = e2.call(this, t3) || this;
|
|
2303
|
-
return s2.serviceName = "twitter", s2.matcherRegex =
|
|
2383
|
+
return s2.serviceName = "twitter", s2.matcherRegex = mt, s2.nonWordCharRegex = vt, s2.serviceName = t3.serviceName, s2;
|
|
2304
2384
|
}
|
|
2305
|
-
return
|
|
2385
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2306
2386
|
for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2307
2387
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2308
2388
|
if (0 === o2 || n2.test(u2)) {
|
|
2309
2389
|
var c2 = t3[0], l2 = t3[0].slice(1);
|
|
2310
|
-
a2.push(new
|
|
2390
|
+
a2.push(new $e({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
|
|
2311
2391
|
}
|
|
2312
2392
|
}
|
|
2313
2393
|
return a2;
|
|
2314
2394
|
}, t2;
|
|
2315
|
-
}(
|
|
2395
|
+
}(Ge), yt = 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"), wt = function(e2) {
|
|
2316
2396
|
function t2() {
|
|
2317
2397
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2318
|
-
return t3.matcherRegex =
|
|
2398
|
+
return t3.matcherRegex = yt, t3;
|
|
2319
2399
|
}
|
|
2320
|
-
return
|
|
2400
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2321
2401
|
for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2322
2402
|
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/);
|
|
2323
|
-
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new
|
|
2403
|
+
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new qe({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
|
|
2324
2404
|
}
|
|
2325
2405
|
return r2;
|
|
2326
2406
|
}, t2.prototype.testMatch = function(e3) {
|
|
2327
|
-
return
|
|
2407
|
+
return Je.test(e3);
|
|
2328
2408
|
}, t2;
|
|
2329
|
-
}(
|
|
2409
|
+
}(Ge), At = new RegExp("@[_" + tt + "]{1,50}(?![_" + tt + "])", "g"), Ct = new RegExp("@[_." + tt + "]{1,30}(?![_" + tt + "])", "g"), Et = new RegExp("@[-_." + tt + "]{1,50}(?![-_" + tt + "])", "g"), kt = new RegExp("[^" + tt + "]"), xt = function(e2) {
|
|
2330
2410
|
function t2(t3) {
|
|
2331
2411
|
var s2 = e2.call(this, t3) || this;
|
|
2332
|
-
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter:
|
|
2412
|
+
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: At, instagram: Ct, soundcloud: Et }, s2.nonWordCharRegex = kt, s2.serviceName = t3.serviceName, s2;
|
|
2333
2413
|
}
|
|
2334
|
-
return
|
|
2414
|
+
return Oe(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2335
2415
|
var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
|
|
2336
2416
|
if (!n2) return a2;
|
|
2337
2417
|
for (; null !== (t3 = n2.exec(e3)); ) {
|
|
2338
2418
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2339
2419
|
if (0 === o2 || r2.test(u2)) {
|
|
2340
2420
|
var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
|
|
2341
|
-
a2.push(new
|
|
2421
|
+
a2.push(new We({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
|
|
2342
2422
|
}
|
|
2343
2423
|
}
|
|
2344
2424
|
return a2;
|
|
2345
2425
|
}, t2;
|
|
2346
|
-
}(
|
|
2347
|
-
function
|
|
2348
|
-
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new
|
|
2426
|
+
}(Ge);
|
|
2427
|
+
function St(e2, t2) {
|
|
2428
|
+
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new Tt(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
|
|
2349
2429
|
var f2 = e2.charAt(c2);
|
|
2350
2430
|
switch (h2) {
|
|
2351
2431
|
case 0:
|
|
@@ -2361,10 +2441,10 @@ function Dt(e2, t2) {
|
|
|
2361
2441
|
v2(f2);
|
|
2362
2442
|
break;
|
|
2363
2443
|
case 4:
|
|
2364
|
-
|
|
2444
|
+
y2(f2);
|
|
2365
2445
|
break;
|
|
2366
2446
|
case 5:
|
|
2367
|
-
|
|
2447
|
+
w2(f2);
|
|
2368
2448
|
break;
|
|
2369
2449
|
case 6:
|
|
2370
2450
|
A2(f2);
|
|
@@ -2412,33 +2492,33 @@ function Dt(e2, t2) {
|
|
|
2412
2492
|
_2(f2);
|
|
2413
2493
|
break;
|
|
2414
2494
|
default:
|
|
2415
|
-
|
|
2495
|
+
Be(h2);
|
|
2416
2496
|
}
|
|
2417
2497
|
c2++;
|
|
2418
2498
|
}
|
|
2419
2499
|
function g2(e3) {
|
|
2420
|
-
"<" === e3 &&
|
|
2500
|
+
"<" === e3 && P2();
|
|
2421
2501
|
}
|
|
2422
2502
|
function m2(e3) {
|
|
2423
|
-
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new
|
|
2503
|
+
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new Tt(Ue(Ue({}, p2), { isClosing: true }))) : "<" === e3 ? P2() : Le.test(e3) ? (h2 = 3, p2 = new Tt(Ue(Ue({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
|
|
2424
2504
|
}
|
|
2425
2505
|
function v2(e3) {
|
|
2426
|
-
|
|
2506
|
+
Ye.test(e3) ? (p2 = new Tt(Ue(Ue({}, p2), { name: j2() })), h2 = 4) : "<" === e3 ? P2() : "/" === e3 ? (p2 = new Tt(Ue(Ue({}, p2), { name: j2() })), h2 = 12) : ">" === e3 ? (p2 = new Tt(Ue(Ue({}, p2), { name: j2() })), U2()) : Le.test(e3) || ze.test(e3) || ":" === e3 || O2();
|
|
2427
2507
|
}
|
|
2428
2508
|
function b2(e3) {
|
|
2429
|
-
">" === e3 ?
|
|
2430
|
-
}
|
|
2431
|
-
function w2(e3) {
|
|
2432
|
-
Ve.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : "=" === e3 || Ze.test(e3) || Ke.test(e3) ? P2() : h2 = 5);
|
|
2509
|
+
">" === e3 ? O2() : Le.test(e3) ? h2 = 3 : O2();
|
|
2433
2510
|
}
|
|
2434
2511
|
function y2(e3) {
|
|
2435
|
-
|
|
2512
|
+
Ye.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : "=" === e3 || Qe.test(e3) || Ve.test(e3) ? O2() : h2 = 5);
|
|
2513
|
+
}
|
|
2514
|
+
function w2(e3) {
|
|
2515
|
+
Ye.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : Qe.test(e3) && O2();
|
|
2436
2516
|
}
|
|
2437
2517
|
function A2(e3) {
|
|
2438
|
-
|
|
2518
|
+
Ye.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : Qe.test(e3) ? O2() : h2 = 5);
|
|
2439
2519
|
}
|
|
2440
2520
|
function C2(e3) {
|
|
2441
|
-
|
|
2521
|
+
Ye.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? O2() : "<" === e3 ? P2() : h2 = 10);
|
|
2442
2522
|
}
|
|
2443
2523
|
function E2(e3) {
|
|
2444
2524
|
'"' === e3 && (h2 = 11);
|
|
@@ -2447,22 +2527,22 @@ function Dt(e2, t2) {
|
|
|
2447
2527
|
"'" === e3 && (h2 = 11);
|
|
2448
2528
|
}
|
|
2449
2529
|
function x2(e3) {
|
|
2450
|
-
|
|
2530
|
+
Ye.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && P2();
|
|
2451
2531
|
}
|
|
2452
2532
|
function S2(e3) {
|
|
2453
|
-
|
|
2533
|
+
Ye.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : (h2 = 4, c2--);
|
|
2454
2534
|
}
|
|
2455
2535
|
function T2(e3) {
|
|
2456
|
-
">" === e3 ? (p2 = new
|
|
2536
|
+
">" === e3 ? (p2 = new Tt(Ue(Ue({}, p2), { isClosing: true })), U2()) : h2 = 4;
|
|
2457
2537
|
}
|
|
2458
2538
|
function D2(t3) {
|
|
2459
|
-
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new
|
|
2539
|
+
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new Tt(Ue(Ue({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new Tt(Ue(Ue({}, p2), { type: "doctype" })), h2 = 20) : O2();
|
|
2460
2540
|
}
|
|
2461
2541
|
function I2(e3) {
|
|
2462
|
-
"-" === e3 ? h2 = 15 : ">" === e3 ?
|
|
2542
|
+
"-" === e3 ? h2 = 15 : ">" === e3 ? O2() : h2 = 16;
|
|
2463
2543
|
}
|
|
2464
2544
|
function F2(e3) {
|
|
2465
|
-
"-" === e3 ? h2 = 18 : ">" === e3 ?
|
|
2545
|
+
"-" === e3 ? h2 = 18 : ">" === e3 ? O2() : h2 = 16;
|
|
2466
2546
|
}
|
|
2467
2547
|
function B2(e3) {
|
|
2468
2548
|
"-" === e3 && (h2 = 17);
|
|
@@ -2477,17 +2557,17 @@ function Dt(e2, t2) {
|
|
|
2477
2557
|
"-" === e3 ? h2 = 17 : ">" === e3 ? U2() : h2 = 16;
|
|
2478
2558
|
}
|
|
2479
2559
|
function _2(e3) {
|
|
2480
|
-
">" === e3 ? U2() : "<" === e3 &&
|
|
2560
|
+
">" === e3 ? U2() : "<" === e3 && P2();
|
|
2481
2561
|
}
|
|
2482
|
-
function
|
|
2562
|
+
function O2() {
|
|
2483
2563
|
h2 = 0, p2 = u2;
|
|
2484
2564
|
}
|
|
2485
|
-
function
|
|
2486
|
-
h2 = 1, p2 = new
|
|
2565
|
+
function P2() {
|
|
2566
|
+
h2 = 1, p2 = new Tt({ idx: c2 });
|
|
2487
2567
|
}
|
|
2488
2568
|
function U2() {
|
|
2489
2569
|
var t3 = e2.slice(d2, p2.idx);
|
|
2490
|
-
t3 && i2(t3, d2), "comment" === p2.type ? a2(p2.idx) : "doctype" === p2.type ? o2(p2.idx) : (p2.isOpening && n2(p2.name, p2.idx), p2.isClosing && r2(p2.name, p2.idx)),
|
|
2570
|
+
t3 && i2(t3, d2), "comment" === p2.type ? a2(p2.idx) : "doctype" === p2.type ? o2(p2.idx) : (p2.isOpening && n2(p2.name, p2.idx), p2.isClosing && r2(p2.name, p2.idx)), O2(), d2 = c2 + 1;
|
|
2491
2571
|
}
|
|
2492
2572
|
function j2() {
|
|
2493
2573
|
var t3 = p2.idx + (p2.isClosing ? 2 : 1);
|
|
@@ -2495,9 +2575,9 @@ function Dt(e2, t2) {
|
|
|
2495
2575
|
}
|
|
2496
2576
|
d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
|
|
2497
2577
|
}
|
|
2498
|
-
var
|
|
2578
|
+
var Tt = function(e2) {
|
|
2499
2579
|
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;
|
|
2500
|
-
},
|
|
2580
|
+
}, Dt = function() {
|
|
2501
2581
|
function e2(t2) {
|
|
2502
2582
|
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;
|
|
2503
2583
|
var s2 = this.mention;
|
|
@@ -2521,7 +2601,7 @@ var It = function(e2) {
|
|
|
2521
2601
|
}(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
|
|
2522
2602
|
}, e2.prototype.parse = function(e3) {
|
|
2523
2603
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
|
|
2524
|
-
return
|
|
2604
|
+
return St(e3, { onOpenTag: function(e4) {
|
|
2525
2605
|
s2.indexOf(e4) >= 0 && n2++;
|
|
2526
2606
|
}, onText: function(e4, s3) {
|
|
2527
2607
|
if (0 === n2) {
|
|
@@ -2560,19 +2640,19 @@ var It = function(e2) {
|
|
|
2560
2640
|
}
|
|
2561
2641
|
return e3;
|
|
2562
2642
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
2563
|
-
return this.hashtag ||
|
|
2643
|
+
return this.hashtag || Fe(e3, function(e4) {
|
|
2564
2644
|
return "hashtag" === e4.getType();
|
|
2565
|
-
}), this.email ||
|
|
2645
|
+
}), this.email || Fe(e3, function(e4) {
|
|
2566
2646
|
return "email" === e4.getType();
|
|
2567
|
-
}), this.phone ||
|
|
2647
|
+
}), this.phone || Fe(e3, function(e4) {
|
|
2568
2648
|
return "phone" === e4.getType();
|
|
2569
|
-
}), this.mention ||
|
|
2649
|
+
}), this.mention || Fe(e3, function(e4) {
|
|
2570
2650
|
return "mention" === e4.getType();
|
|
2571
|
-
}), this.urls.schemeMatches ||
|
|
2651
|
+
}), this.urls.schemeMatches || Fe(e3, function(e4) {
|
|
2572
2652
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
2573
|
-
}), this.urls.wwwMatches ||
|
|
2653
|
+
}), this.urls.wwwMatches || Fe(e3, function(e4) {
|
|
2574
2654
|
return "url" === e4.getType() && "www" === e4.getUrlMatchType();
|
|
2575
|
-
}), this.urls.tldMatches ||
|
|
2655
|
+
}), this.urls.tldMatches || Fe(e3, function(e4) {
|
|
2576
2656
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
2577
2657
|
}), e3;
|
|
2578
2658
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
@@ -2592,102 +2672,99 @@ var It = function(e2) {
|
|
|
2592
2672
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
2593
2673
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
2594
2674
|
var t2;
|
|
2595
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
2675
|
+
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Me ? t2.toAnchorString() : e3.buildTag().toAnchorString();
|
|
2596
2676
|
}, e2.prototype.getMatchers = function() {
|
|
2597
2677
|
if (this.matchers) return this.matchers;
|
|
2598
|
-
var e3 = this.getTagBuilder(), t2 = [new
|
|
2678
|
+
var e3 = this.getTagBuilder(), t2 = [new bt({ tagBuilder: e3, serviceName: this.hashtag }), new lt({ tagBuilder: e3 }), new wt({ tagBuilder: e3 }), new xt({ tagBuilder: e3, serviceName: this.mention }), new gt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
|
|
2599
2679
|
return this.matchers = t2;
|
|
2600
2680
|
}, e2.prototype.getTagBuilder = function() {
|
|
2601
2681
|
var e3 = this.tagBuilder;
|
|
2602
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
2603
|
-
}, e2.version = "3.14.3", e2.AnchorTagBuilder =
|
|
2682
|
+
return e3 || (e3 = this.tagBuilder = new Re({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
2683
|
+
}, e2.version = "3.14.3", e2.AnchorTagBuilder = Re, e2.HtmlTag = Me, e2.matcher = { Email: lt, Hashtag: bt, Matcher: Ge, Mention: xt, Phone: wt, Url: gt }, e2.match = { Email: je, Hashtag: $e, Match: Ne, Mention: We, Phone: qe, Url: He }, e2;
|
|
2604
2684
|
}();
|
|
2605
|
-
function
|
|
2685
|
+
function It(e2, t2 = e2) {
|
|
2606
2686
|
return { type: "autolink", url: e2, text: t2 };
|
|
2607
2687
|
}
|
|
2608
|
-
|
|
2609
|
-
return { type: "emoji", kind: e2, text: t2 };
|
|
2610
|
-
}, { emoticon: (e2) => ({ type: "emoji", kind: "emoticon", text: e2 }), unicode: (e2) => ({ type: "emoji", kind: "unicode", text: e2 }) });
|
|
2611
|
-
const Mt = Ee(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
2688
|
+
const Ft = Ae(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
2612
2689
|
return { type: "mention", id: e3, text: t3 };
|
|
2613
|
-
}(decodeURIComponent(t2), s2)),
|
|
2690
|
+
}(decodeURIComponent(t2), s2)), Bt = Ae(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
|
|
2614
2691
|
return { type: "customemoji", text: e3 };
|
|
2615
|
-
}(t2)),
|
|
2692
|
+
}(t2)), Mt = Ae(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
|
|
2616
2693
|
return { type: "link", url: e3, children: t3 };
|
|
2617
|
-
}(t2, [s2])),
|
|
2618
|
-
const { action: n2, params: r2 } =
|
|
2694
|
+
}(t2, [s2])), Rt = Ae(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
2695
|
+
const { action: n2, params: r2 } = _t(t2);
|
|
2619
2696
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2620
2697
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
2621
2698
|
}(n2, r2, [s2]);
|
|
2622
|
-
}),
|
|
2623
|
-
const { action: n2, params: r2 } =
|
|
2699
|
+
}), Nt = Ae(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
2700
|
+
const { action: n2, params: r2 } = _t(t2);
|
|
2624
2701
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2625
2702
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
2626
2703
|
}(n2, r2, [s2]);
|
|
2627
2704
|
});
|
|
2628
|
-
function
|
|
2705
|
+
function _t(e2) {
|
|
2629
2706
|
const t2 = e2.indexOf("?");
|
|
2630
2707
|
if (-1 === t2) return { action: e2, params: {} };
|
|
2631
2708
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
2632
2709
|
}
|
|
2633
|
-
const
|
|
2710
|
+
const Ot = Ae(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
|
|
2634
2711
|
return { type: "bulletlist", children: e3 };
|
|
2635
|
-
}([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
2712
|
+
}([e2.startsWith("\n") ? e2.slice(1) : e2])), Pt = Ae(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), Ut = (e2) => {
|
|
2636
2713
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
2637
2714
|
let s2 = 0;
|
|
2638
2715
|
const n2 = [];
|
|
2639
|
-
for (const r2 of
|
|
2716
|
+
for (const r2 of z(e2, t2)) {
|
|
2640
2717
|
const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
|
|
2641
2718
|
a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
|
|
2642
|
-
const o2 =
|
|
2719
|
+
const o2 = It("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
|
|
2643
2720
|
n2.push(o2), s2 = a2 + i2.length;
|
|
2644
2721
|
}
|
|
2645
2722
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
2646
|
-
},
|
|
2647
|
-
const t2 =
|
|
2723
|
+
}, jt = (e2) => Mt(e2).flatMap((e3) => "string" == typeof e3 ? $t(e3) : ["<", ...$t(e3.url), ...$t("|" + e3.children[0] + ">")]), $t = (e2) => {
|
|
2724
|
+
const t2 = Dt.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
2648
2725
|
let n2 = 0;
|
|
2649
2726
|
for (const r2 of t2) {
|
|
2650
2727
|
const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
|
|
2651
2728
|
let o2 = i2;
|
|
2652
|
-
r2 instanceof
|
|
2729
|
+
r2 instanceof je ? o2 = "mailto:" + r2.getEmail() : r2 instanceof He && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(It(o2, i2)), n2 = t3 + a2;
|
|
2653
2730
|
}
|
|
2654
2731
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
2655
|
-
},
|
|
2656
|
-
function
|
|
2732
|
+
}, Wt = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
2733
|
+
function qt(e2 = { except: [] }) {
|
|
2657
2734
|
var _a2;
|
|
2658
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
2659
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
2735
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : Wt.filter((t3) => !e2.only.includes(t3));
|
|
2736
|
+
return s2.includes("BulletPoint") || t2.multilineSteps.push(Ot, Pt), s2.includes("Mention") || t2.singlelineSteps.push(Ft), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Bt), s2.includes("Codespan") || t2.multilineSteps.push(Ae(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3 }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Mt), s2.includes("Actions") || (t2.singlelineSteps.push(Rt), t2.singlelineSteps.push(Nt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Se), s2.includes("Autolink") || t2.singlelineSteps.push(jt, Ut), t2;
|
|
2660
2737
|
}
|
|
2661
|
-
const
|
|
2738
|
+
const Ht = function(e2) {
|
|
2662
2739
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
2663
2740
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
2664
2741
|
}("\n");
|
|
2665
|
-
function
|
|
2742
|
+
function Gt(e2, t2 = { except: [] }) {
|
|
2666
2743
|
let s2 = function(e3, t3) {
|
|
2667
2744
|
let s3 = [e3];
|
|
2668
|
-
return s3 =
|
|
2669
|
-
}(e2,
|
|
2670
|
-
return s2 =
|
|
2745
|
+
return s3 = Lt(s3, t3.multilineSteps), s3 = Lt(s3, [Ht]), s3 = Lt(s3, t3.singlelineSteps), s3 = zt(s3), s3;
|
|
2746
|
+
}(e2, qt(t2));
|
|
2747
|
+
return s2 = Jt(s2, false), s2;
|
|
2671
2748
|
}
|
|
2672
|
-
function
|
|
2673
|
-
return t2.reduce((e3, t3) =>
|
|
2749
|
+
function Lt(e2, t2) {
|
|
2750
|
+
return t2.reduce((e3, t3) => we(e3, t3), e2);
|
|
2674
2751
|
}
|
|
2675
|
-
function
|
|
2752
|
+
function zt(e2) {
|
|
2676
2753
|
const t2 = [];
|
|
2677
2754
|
let s2 = -1;
|
|
2678
|
-
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:
|
|
2755
|
+
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: zt(n2.children) }) : n2;
|
|
2679
2756
|
return t2;
|
|
2680
2757
|
}
|
|
2681
|
-
function
|
|
2758
|
+
function Jt(e2, t2) {
|
|
2682
2759
|
const s2 = [];
|
|
2683
2760
|
let n2 = [];
|
|
2684
2761
|
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
2685
2762
|
const i2 = e2[r2];
|
|
2686
|
-
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children =
|
|
2763
|
+
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children = Jt(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type), s2.push(i2)) : "autolink" === i2.type && t2 ? n2.push(i2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(i2));
|
|
2687
2764
|
}
|
|
2688
2765
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
2689
2766
|
}
|
|
2690
|
-
class
|
|
2767
|
+
class Yt {
|
|
2691
2768
|
constructor(e2, t2, s2) {
|
|
2692
2769
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2693
2770
|
}
|
|
@@ -2703,12 +2780,12 @@ class Vt {
|
|
|
2703
2780
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
|
|
2704
2781
|
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
|
|
2705
2782
|
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.createMessageSnapshot(s2, this.brandedConversationId);
|
|
2706
|
-
return
|
|
2783
|
+
return me("Get message " + this.id, n2);
|
|
2707
2784
|
});
|
|
2708
2785
|
}
|
|
2709
2786
|
edit(t2) {
|
|
2710
2787
|
return __async(this, null, function* () {
|
|
2711
|
-
const s2 = { content:
|
|
2788
|
+
const s2 = { content: Qt(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
|
|
2712
2789
|
e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
|
|
2713
2790
|
});
|
|
2714
2791
|
}
|
|
@@ -2719,18 +2796,18 @@ class Vt {
|
|
|
2719
2796
|
});
|
|
2720
2797
|
}
|
|
2721
2798
|
}
|
|
2722
|
-
function
|
|
2799
|
+
function Qt(e2) {
|
|
2723
2800
|
if ("string" == typeof e2) {
|
|
2724
|
-
return [{ type: "text", children:
|
|
2801
|
+
return [{ type: "text", children: Gt(e2) }];
|
|
2725
2802
|
}
|
|
2726
2803
|
if ("text" in e2 && e2.text) {
|
|
2727
|
-
return [{ type: "text", children:
|
|
2804
|
+
return [{ type: "text", children: Gt(e2.text) }];
|
|
2728
2805
|
}
|
|
2729
2806
|
if ("content" in e2 && e2.content) return e2.content;
|
|
2730
2807
|
}
|
|
2731
|
-
class
|
|
2808
|
+
class Vt {
|
|
2732
2809
|
constructor(e2, t2) {
|
|
2733
|
-
this.id = e2, this._realtimeClient = t2;
|
|
2810
|
+
this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
|
|
2734
2811
|
}
|
|
2735
2812
|
get brandedId() {
|
|
2736
2813
|
return this.id;
|
|
@@ -2739,16 +2816,16 @@ class Kt {
|
|
|
2739
2816
|
return this._realtimeClient.userId;
|
|
2740
2817
|
}
|
|
2741
2818
|
participant(e2) {
|
|
2742
|
-
return new
|
|
2819
|
+
return new be("string" == typeof e2 ? e2 : e2.id, this.id, this._realtimeClient);
|
|
2743
2820
|
}
|
|
2744
2821
|
message(e2) {
|
|
2745
|
-
return new
|
|
2822
|
+
return new Yt(e2, this.brandedId, this._realtimeClient);
|
|
2746
2823
|
}
|
|
2747
2824
|
get() {
|
|
2748
2825
|
return __async(this, null, function* () {
|
|
2749
2826
|
const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
|
|
2750
2827
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
|
|
2751
|
-
const n2 = e("Get conversation " + this.id, s2), r2 =
|
|
2828
|
+
const n2 = e("Get conversation " + this.id, s2), r2 = me("Get last message in conversation " + this.id, yield t2), i2 = 0 === r2.length ? null : r2[0];
|
|
2752
2829
|
return this._realtimeClient.createConversationSnapshotPreloaded(n2, i2);
|
|
2753
2830
|
});
|
|
2754
2831
|
}
|
|
@@ -2791,8 +2868,8 @@ class Kt {
|
|
|
2791
2868
|
}
|
|
2792
2869
|
send(t2) {
|
|
2793
2870
|
return __async(this, null, function* () {
|
|
2794
|
-
const s2 = { content:
|
|
2795
|
-
return new
|
|
2871
|
+
const s2 = { content: Zt(t2), referencedMessageId: Kt(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: ye((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
|
|
2872
|
+
return new Yt(r2.id, this.brandedId, this._realtimeClient);
|
|
2796
2873
|
});
|
|
2797
2874
|
}
|
|
2798
2875
|
subscribeMessages(e2) {
|
|
@@ -2801,22 +2878,31 @@ class Kt {
|
|
|
2801
2878
|
subscribe(e2) {
|
|
2802
2879
|
return this._realtimeClient.subscribe(["me", "conversations", this.brandedId], e2);
|
|
2803
2880
|
}
|
|
2881
|
+
subscribeTyping(e2) {
|
|
2882
|
+
return this._realtimeClient.subscribe(["me", "conversations", this.brandedId, "typing"], e2);
|
|
2883
|
+
}
|
|
2884
|
+
markAsTyping() {
|
|
2885
|
+
return __async(this, null, function* () {
|
|
2886
|
+
const t2 = yield this._realtimeClient.call("POST", ["me", "conversations", this.brandedId, "typing"], {});
|
|
2887
|
+
e(`Set user as typing in ${this.id}`, t2);
|
|
2888
|
+
});
|
|
2889
|
+
}
|
|
2804
2890
|
}
|
|
2805
|
-
function
|
|
2891
|
+
function Zt(e2) {
|
|
2806
2892
|
if ("string" == typeof e2) {
|
|
2807
|
-
return [{ type: "text", children:
|
|
2893
|
+
return [{ type: "text", children: Gt(e2) }];
|
|
2808
2894
|
}
|
|
2809
2895
|
if ("text" in e2) {
|
|
2810
|
-
return [{ type: "text", children:
|
|
2896
|
+
return [{ type: "text", children: Gt(e2.text) }];
|
|
2811
2897
|
}
|
|
2812
2898
|
return e2.content;
|
|
2813
2899
|
}
|
|
2814
|
-
function
|
|
2900
|
+
function Kt(e2) {
|
|
2815
2901
|
if ("string" == typeof e2) return;
|
|
2816
2902
|
const t2 = e2.referencedMessage;
|
|
2817
2903
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
2818
2904
|
}
|
|
2819
|
-
class
|
|
2905
|
+
class Xt {
|
|
2820
2906
|
constructor(e2, t2, s2) {
|
|
2821
2907
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
2822
2908
|
}
|
|
@@ -2828,10 +2914,10 @@ class ts {
|
|
|
2828
2914
|
return this.realtimeWsApiUrl + `/${e2}/realtime/${r2}?talkjs-client-build=${n2 != null ? n2 : "standalone"}&talkjs-core=${s2}`;
|
|
2829
2915
|
}
|
|
2830
2916
|
}
|
|
2831
|
-
function
|
|
2917
|
+
function es({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
|
|
2832
2918
|
var _a2;
|
|
2833
2919
|
(!r2 || r2 <= 0) && (r2 = 1);
|
|
2834
|
-
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-
|
|
2920
|
+
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-05-20T11:06:18.378Z" };
|
|
2835
2921
|
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
2836
2922
|
return a(r2, () => __async(this, null, function* () {
|
|
2837
2923
|
if (o2) {
|
|
@@ -2843,19 +2929,19 @@ function ss({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
|
|
|
2843
2929
|
throw e3;
|
|
2844
2930
|
});
|
|
2845
2931
|
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
2846
|
-
return o2 && 401 === s3.status ? (
|
|
2932
|
+
return o2 && 401 === s3.status ? (us.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.refreshToken(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
|
|
2847
2933
|
}) }).catch((s3) => {
|
|
2848
|
-
if (!t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
2934
|
+
if (Math.random() < 0.1 && !t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
2849
2935
|
const n3 = `Network Error for ${e2} ${t2}`;
|
|
2850
2936
|
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
2851
|
-
s3.clone().text().then((e3) =>
|
|
2852
|
-
} else
|
|
2937
|
+
s3.clone().text().then((e3) => us.log(`${n3} ${s3.status} ${e3} (10% logged)`));
|
|
2938
|
+
} else us.log(`${n3} ${s3} (10% logged)`);
|
|
2853
2939
|
console.error("[TalkJS]", n3);
|
|
2854
2940
|
}
|
|
2855
2941
|
throw s3;
|
|
2856
2942
|
});
|
|
2857
2943
|
}
|
|
2858
|
-
const { cdnHost:
|
|
2944
|
+
const { cdnHost: ts, appHost: ss, restHost: ns, realtimeHost: rs, appProtocol: is, appWsProtocol: as } = function() {
|
|
2859
2945
|
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
2860
2946
|
const e2 = function() {
|
|
2861
2947
|
if (document.currentScript) return document.currentScript.src;
|
|
@@ -2880,11 +2966,11 @@ const { cdnHost: ns, appHost: rs, restHost: is, realtimeHost: as, appProtocol: o
|
|
|
2880
2966
|
}(n2), a2 = t2.protocol;
|
|
2881
2967
|
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
2882
2968
|
}();
|
|
2883
|
-
const
|
|
2884
|
-
const
|
|
2969
|
+
const os = ss.startsWith("app.talkjs.com");
|
|
2970
|
+
const us = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
2885
2971
|
} } : new class {
|
|
2886
2972
|
constructor(e2) {
|
|
2887
|
-
this._timeCreated = Date.now(), this._enabled =
|
|
2973
|
+
this._timeCreated = Date.now(), this._enabled = os, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-05-20T11:06:18.378Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: window.location.href, referrer: document.referrer, userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: window.location.href, stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-05-20T11:06:18.378Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
2888
2974
|
}
|
|
2889
2975
|
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
2890
2976
|
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
@@ -2894,14 +2980,14 @@ const ls = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
|
|
|
2894
2980
|
try {
|
|
2895
2981
|
if (!this._enabled) return Promise.resolve();
|
|
2896
2982
|
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
2897
|
-
yield
|
|
2983
|
+
yield es({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
2898
2984
|
} catch (e3) {
|
|
2899
2985
|
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
2900
2986
|
}
|
|
2901
2987
|
});
|
|
2902
2988
|
}
|
|
2903
2989
|
}("970cd0be0fb74630b75c8451051299dc");
|
|
2904
|
-
class
|
|
2990
|
+
class cs {
|
|
2905
2991
|
constructor(e2, t2 = {}) {
|
|
2906
2992
|
this._onSubscription = t2, this._handlers = {};
|
|
2907
2993
|
for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
|
|
@@ -2946,9 +3032,9 @@ class hs {
|
|
|
2946
3032
|
return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
|
|
2947
3033
|
}
|
|
2948
3034
|
}
|
|
2949
|
-
class
|
|
3035
|
+
class ls {
|
|
2950
3036
|
constructor(e2, t2, s2, n2, r2, i2) {
|
|
2951
|
-
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new
|
|
3037
|
+
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new cs({ tokenChanged(e3) {
|
|
2952
3038
|
}, tokenRefreshFailed(e3) {
|
|
2953
3039
|
}, tokenAccepted(e3) {
|
|
2954
3040
|
} }), this.sessionExpiryWarningTimeoutId = void 0, i2 && (n2 || r2)) throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");
|
|
@@ -3029,13 +3115,18 @@ class ds {
|
|
|
3029
3115
|
});
|
|
3030
3116
|
}
|
|
3031
3117
|
checkJwt(e2) {
|
|
3118
|
+
!function(e3) {
|
|
3119
|
+
if ("string" == typeof e3 || e3 instanceof String) return;
|
|
3120
|
+
if (void 0 === e3) throw "Token was undefined";
|
|
3121
|
+
throw "Token must be a string, got: " + e3;
|
|
3122
|
+
}(e2);
|
|
3032
3123
|
const t2 = [];
|
|
3033
3124
|
let s2, n2, r2;
|
|
3034
3125
|
if ("string" == typeof e2 ? s2 = e2 : t2.push(`Token type is ${typeof e2} instead of a string.`), s2) try {
|
|
3035
3126
|
const e3 = function(e4) {
|
|
3036
3127
|
const t3 = e4.split(".");
|
|
3037
3128
|
if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
|
|
3038
|
-
return { header:
|
|
3129
|
+
return { header: hs(t3[0]), payload: hs(t3[1]) };
|
|
3039
3130
|
}(s2);
|
|
3040
3131
|
n2 = e3.header, r2 = e3.payload;
|
|
3041
3132
|
} catch (e3) {
|
|
@@ -3049,7 +3140,7 @@ class ds {
|
|
|
3049
3140
|
const e3 = this.checkJwtPayload(r2);
|
|
3050
3141
|
t2.push(...e3);
|
|
3051
3142
|
}
|
|
3052
|
-
if (t2.length) if (this.usingBokens)
|
|
3143
|
+
if (t2.length) if (this.usingBokens) us.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
|
|
3053
3144
|
else {
|
|
3054
3145
|
console.warn("[TalkJS] Authentication token appears to be generated incorrectly. Will still attempt to authenticate, but TalkJS may not work as expected. See below for a description of any problems and how to fix them.");
|
|
3055
3146
|
const s3 = t2.length > 1;
|
|
@@ -3078,7 +3169,7 @@ class ds {
|
|
|
3078
3169
|
sendBokenRequest(e2, t2) {
|
|
3079
3170
|
return __async(this, null, function* () {
|
|
3080
3171
|
let s2 = 0;
|
|
3081
|
-
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield
|
|
3172
|
+
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield es({ method: "GET", url: n2, attempts: 1e4, shouldRetry: (e3) => {
|
|
3082
3173
|
if (e3 instanceof Error) return true;
|
|
3083
3174
|
if (401 === e3.status) throw "Check that you provided a valid signature.";
|
|
3084
3175
|
if (404 === e3.status) throw "Check that you specified the correct App ID.";
|
|
@@ -3091,7 +3182,7 @@ class ds {
|
|
|
3091
3182
|
});
|
|
3092
3183
|
}
|
|
3093
3184
|
}
|
|
3094
|
-
function
|
|
3185
|
+
function hs(e2) {
|
|
3095
3186
|
try {
|
|
3096
3187
|
const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
3097
3188
|
return JSON.parse(s2);
|
|
@@ -3099,8 +3190,8 @@ function ps(e2) {
|
|
|
3099
3190
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
3100
3191
|
}
|
|
3101
3192
|
}
|
|
3102
|
-
const
|
|
3103
|
-
class
|
|
3193
|
+
const ds = new Xt("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3194
|
+
class ps {
|
|
3104
3195
|
constructor(e2) {
|
|
3105
3196
|
this.target = e2;
|
|
3106
3197
|
}
|
|
@@ -3108,7 +3199,7 @@ class gs {
|
|
|
3108
3199
|
return this.target;
|
|
3109
3200
|
}
|
|
3110
3201
|
}
|
|
3111
|
-
const
|
|
3202
|
+
const fs = new class {
|
|
3112
3203
|
constructor() {
|
|
3113
3204
|
this.registry = {};
|
|
3114
3205
|
}
|
|
@@ -3116,7 +3207,7 @@ const ms = new class {
|
|
|
3116
3207
|
var _a2;
|
|
3117
3208
|
const t2 = this.key(e2), s2 = (_a2 = this.registry[t2]) == null ? void 0 : _a2.deref();
|
|
3118
3209
|
if (s2) return s2;
|
|
3119
|
-
const n2 = new
|
|
3210
|
+
const n2 = new ms(e2), r2 = globalThis.WeakRef ? new WeakRef(n2) : new ps(n2);
|
|
3120
3211
|
return this.registry[t2] = r2, n2;
|
|
3121
3212
|
}
|
|
3122
3213
|
deregister(e2, t2) {
|
|
@@ -3127,10 +3218,10 @@ const ms = new class {
|
|
|
3127
3218
|
return `${e2}:${t2}`;
|
|
3128
3219
|
}
|
|
3129
3220
|
}();
|
|
3130
|
-
function
|
|
3131
|
-
return e2.forceCreateNew ? new
|
|
3221
|
+
function gs(e2) {
|
|
3222
|
+
return e2.forceCreateNew ? new ms(e2) : fs.getOrCreate(e2);
|
|
3132
3223
|
}
|
|
3133
|
-
class
|
|
3224
|
+
class ms {
|
|
3134
3225
|
constructor(e2) {
|
|
3135
3226
|
!function(e3) {
|
|
3136
3227
|
function t3(e4, t4) {
|
|
@@ -3140,11 +3231,11 @@ class bs {
|
|
|
3140
3231
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
|
|
3141
3232
|
}(e2);
|
|
3142
3233
|
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
|
|
3143
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
3234
|
+
this._appId = t2, this._apiUrls = e2.apiUrls ? new Xt(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : ds, this._authProvider = new ls(this._apiUrls, t2, s2, n2, r2, i2), this._realtimeClient = new fe(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.0.1", e2.clientBuild), s2, this._authProvider), this.currentUser = new ve(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
|
|
3144
3235
|
console.error(`[TalkSession] ${e3}`);
|
|
3145
3236
|
}), function(e3, t3, s3) {
|
|
3146
3237
|
return __async(this, null, function* () {
|
|
3147
|
-
return
|
|
3238
|
+
return es({ method: "GET", url: `${t3}/${e3}/app`, authProvider: s3 }).then((e4) => 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)).catch((e4) => {
|
|
3148
3239
|
if ("string" != typeof e4 && "status" in e4) {
|
|
3149
3240
|
const t4 = e4;
|
|
3150
3241
|
return 200 === t4.status || 404 !== t4.status && (console.warn(`[TalkJS] Received unexpected ${t4.status} status code when validating app ID. Assuming that the app ID is valid.`), true);
|
|
@@ -3165,37 +3256,37 @@ class bs {
|
|
|
3165
3256
|
}), { unsubscribe: () => t2.resolve("UNSUBSCRIBED") };
|
|
3166
3257
|
}
|
|
3167
3258
|
user(e2) {
|
|
3168
|
-
return new
|
|
3259
|
+
return new ve(e2, this._realtimeClient);
|
|
3169
3260
|
}
|
|
3170
3261
|
conversation(e2) {
|
|
3171
|
-
return new
|
|
3262
|
+
return new Vt(e2, this._realtimeClient);
|
|
3172
3263
|
}
|
|
3173
3264
|
terminate(e2) {
|
|
3174
|
-
|
|
3265
|
+
fs.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
3175
3266
|
}
|
|
3176
3267
|
_isConnected() {
|
|
3177
3268
|
return this._realtimeClient.isConnected();
|
|
3178
3269
|
}
|
|
3179
3270
|
uploadFile(e2, t2) {
|
|
3180
|
-
return
|
|
3271
|
+
return vs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
|
|
3181
3272
|
}
|
|
3182
3273
|
uploadImage(e2, t2) {
|
|
3183
|
-
return
|
|
3274
|
+
return vs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
|
|
3184
3275
|
}
|
|
3185
3276
|
uploadVideo(e2, t2) {
|
|
3186
|
-
return
|
|
3277
|
+
return vs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
|
|
3187
3278
|
}
|
|
3188
3279
|
uploadAudio(e2, t2) {
|
|
3189
|
-
return
|
|
3280
|
+
return vs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
|
|
3190
3281
|
}
|
|
3191
3282
|
uploadVoice(e2, t2) {
|
|
3192
|
-
return
|
|
3283
|
+
return vs(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
|
|
3193
3284
|
}
|
|
3194
3285
|
}
|
|
3195
|
-
function
|
|
3286
|
+
function vs(_0, _1, _2, _3) {
|
|
3196
3287
|
return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
|
|
3197
3288
|
const u2 = new FormData();
|
|
3198
|
-
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()),
|
|
3289
|
+
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()), es({ method: "POST", url: e2, data: u2, authProvider: t2 }).then((e3) => e3.json()).then((e3) => e3.attachmentToken).catch((e3) => __async(this, null, function* () {
|
|
3199
3290
|
if (e3 instanceof Response) {
|
|
3200
3291
|
const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
|
|
3201
3292
|
throw new Error(s3);
|
|
@@ -3205,7 +3296,7 @@ function ws(_0, _1, _2, _3) {
|
|
|
3205
3296
|
});
|
|
3206
3297
|
}
|
|
3207
3298
|
export {
|
|
3208
|
-
|
|
3299
|
+
gs as getTalkSession,
|
|
3209
3300
|
f as registerPolyfills
|
|
3210
3301
|
};
|
|
3211
3302
|
//# sourceMappingURL=talkSession.js.map
|