@vitessce/dev 2.0.0-beta.0 → 2.0.0-beta.1
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/dist/{deflate.498f1fff.mjs → deflate.628654fc.mjs} +1 -1
- package/dist/{index.3e7f200a.mjs → index.4511cb5d.mjs} +2200 -568
- package/dist/index.js +1 -0
- package/dist/index.mjs +3 -1
- package/dist/index.umd.js +2187 -555
- package/dist/{jpeg.76899aba.mjs → jpeg.2cba0391.mjs} +1 -1
- package/dist/{lerc.b63a936e.mjs → lerc.7110c4d8.mjs} +1 -1
- package/dist/{lzw.7a63ed8b.mjs → lzw.3bf56bd2.mjs} +1 -1
- package/dist/{packbits.f5da2e5e.mjs → packbits.cf4e19b0.mjs} +1 -1
- package/dist/{raw.b6ef11f5.mjs → raw.61eaecb4.mjs} +1 -1
- package/dist/{webimage.7e22bbfd.mjs → webimage.e4333f12.mjs} +1 -1
- package/package.json +5 -4
package/dist/index.umd.js
CHANGED
|
@@ -856,6 +856,25 @@ ${oldObj[prop][1]}`);
|
|
|
856
856
|
const maxSize = maxHeapSize || 2 ** 31 - 1;
|
|
857
857
|
return totalBytes < maxSize && height2 <= 2048 && depthDownsampled <= 2048 && width2 <= 2048 && depthDownsampled > 1;
|
|
858
858
|
};
|
|
859
|
+
const VALUE_TRANSFORM_OPTIONS = [
|
|
860
|
+
{ name: "None", value: null },
|
|
861
|
+
{ name: "Log", value: "log1p" },
|
|
862
|
+
{ name: "ArcSinh", value: "arcsinh" }
|
|
863
|
+
];
|
|
864
|
+
function getValueTransformFunction(featureValueTransform, coefficient) {
|
|
865
|
+
let transformFunction;
|
|
866
|
+
switch (featureValueTransform) {
|
|
867
|
+
case "log1p":
|
|
868
|
+
transformFunction = (v) => Math.log(1 + v * coefficient);
|
|
869
|
+
break;
|
|
870
|
+
case "arcsinh":
|
|
871
|
+
transformFunction = (v) => Math.asinh(v * coefficient);
|
|
872
|
+
break;
|
|
873
|
+
default:
|
|
874
|
+
transformFunction = (v) => v;
|
|
875
|
+
}
|
|
876
|
+
return transformFunction;
|
|
877
|
+
}
|
|
859
878
|
var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
860
879
|
function getDefaultExportFromCjs$1(x2) {
|
|
861
880
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -881,477 +900,6 @@ ${oldObj[prop][1]}`);
|
|
|
881
900
|
});
|
|
882
901
|
return a2;
|
|
883
902
|
}
|
|
884
|
-
var lzString = { exports: {} };
|
|
885
|
-
(function(module3) {
|
|
886
|
-
var LZString = function() {
|
|
887
|
-
var f2 = String.fromCharCode;
|
|
888
|
-
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
889
|
-
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
890
|
-
var baseReverseDic = {};
|
|
891
|
-
function getBaseValue(alphabet, character) {
|
|
892
|
-
if (!baseReverseDic[alphabet]) {
|
|
893
|
-
baseReverseDic[alphabet] = {};
|
|
894
|
-
for (var i2 = 0; i2 < alphabet.length; i2++) {
|
|
895
|
-
baseReverseDic[alphabet][alphabet.charAt(i2)] = i2;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
return baseReverseDic[alphabet][character];
|
|
899
|
-
}
|
|
900
|
-
var LZString2 = {
|
|
901
|
-
compressToBase64: function(input) {
|
|
902
|
-
if (input == null)
|
|
903
|
-
return "";
|
|
904
|
-
var res = LZString2._compress(input, 6, function(a2) {
|
|
905
|
-
return keyStrBase64.charAt(a2);
|
|
906
|
-
});
|
|
907
|
-
switch (res.length % 4) {
|
|
908
|
-
default:
|
|
909
|
-
case 0:
|
|
910
|
-
return res;
|
|
911
|
-
case 1:
|
|
912
|
-
return res + "===";
|
|
913
|
-
case 2:
|
|
914
|
-
return res + "==";
|
|
915
|
-
case 3:
|
|
916
|
-
return res + "=";
|
|
917
|
-
}
|
|
918
|
-
},
|
|
919
|
-
decompressFromBase64: function(input) {
|
|
920
|
-
if (input == null)
|
|
921
|
-
return "";
|
|
922
|
-
if (input == "")
|
|
923
|
-
return null;
|
|
924
|
-
return LZString2._decompress(input.length, 32, function(index2) {
|
|
925
|
-
return getBaseValue(keyStrBase64, input.charAt(index2));
|
|
926
|
-
});
|
|
927
|
-
},
|
|
928
|
-
compressToUTF16: function(input) {
|
|
929
|
-
if (input == null)
|
|
930
|
-
return "";
|
|
931
|
-
return LZString2._compress(input, 15, function(a2) {
|
|
932
|
-
return f2(a2 + 32);
|
|
933
|
-
}) + " ";
|
|
934
|
-
},
|
|
935
|
-
decompressFromUTF16: function(compressed) {
|
|
936
|
-
if (compressed == null)
|
|
937
|
-
return "";
|
|
938
|
-
if (compressed == "")
|
|
939
|
-
return null;
|
|
940
|
-
return LZString2._decompress(compressed.length, 16384, function(index2) {
|
|
941
|
-
return compressed.charCodeAt(index2) - 32;
|
|
942
|
-
});
|
|
943
|
-
},
|
|
944
|
-
compressToUint8Array: function(uncompressed) {
|
|
945
|
-
var compressed = LZString2.compress(uncompressed);
|
|
946
|
-
var buf = new Uint8Array(compressed.length * 2);
|
|
947
|
-
for (var i2 = 0, TotalLen = compressed.length; i2 < TotalLen; i2++) {
|
|
948
|
-
var current_value = compressed.charCodeAt(i2);
|
|
949
|
-
buf[i2 * 2] = current_value >>> 8;
|
|
950
|
-
buf[i2 * 2 + 1] = current_value % 256;
|
|
951
|
-
}
|
|
952
|
-
return buf;
|
|
953
|
-
},
|
|
954
|
-
decompressFromUint8Array: function(compressed) {
|
|
955
|
-
if (compressed === null || compressed === void 0) {
|
|
956
|
-
return LZString2.decompress(compressed);
|
|
957
|
-
} else {
|
|
958
|
-
var buf = new Array(compressed.length / 2);
|
|
959
|
-
for (var i2 = 0, TotalLen = buf.length; i2 < TotalLen; i2++) {
|
|
960
|
-
buf[i2] = compressed[i2 * 2] * 256 + compressed[i2 * 2 + 1];
|
|
961
|
-
}
|
|
962
|
-
var result = [];
|
|
963
|
-
buf.forEach(function(c2) {
|
|
964
|
-
result.push(f2(c2));
|
|
965
|
-
});
|
|
966
|
-
return LZString2.decompress(result.join(""));
|
|
967
|
-
}
|
|
968
|
-
},
|
|
969
|
-
compressToEncodedURIComponent: function(input) {
|
|
970
|
-
if (input == null)
|
|
971
|
-
return "";
|
|
972
|
-
return LZString2._compress(input, 6, function(a2) {
|
|
973
|
-
return keyStrUriSafe.charAt(a2);
|
|
974
|
-
});
|
|
975
|
-
},
|
|
976
|
-
decompressFromEncodedURIComponent: function(input) {
|
|
977
|
-
if (input == null)
|
|
978
|
-
return "";
|
|
979
|
-
if (input == "")
|
|
980
|
-
return null;
|
|
981
|
-
input = input.replace(/ /g, "+");
|
|
982
|
-
return LZString2._decompress(input.length, 32, function(index2) {
|
|
983
|
-
return getBaseValue(keyStrUriSafe, input.charAt(index2));
|
|
984
|
-
});
|
|
985
|
-
},
|
|
986
|
-
compress: function(uncompressed) {
|
|
987
|
-
return LZString2._compress(uncompressed, 16, function(a2) {
|
|
988
|
-
return f2(a2);
|
|
989
|
-
});
|
|
990
|
-
},
|
|
991
|
-
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
992
|
-
if (uncompressed == null)
|
|
993
|
-
return "";
|
|
994
|
-
var i2, value2, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii;
|
|
995
|
-
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
996
|
-
context_c = uncompressed.charAt(ii);
|
|
997
|
-
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
998
|
-
context_dictionary[context_c] = context_dictSize++;
|
|
999
|
-
context_dictionaryToCreate[context_c] = true;
|
|
1000
|
-
}
|
|
1001
|
-
context_wc = context_w + context_c;
|
|
1002
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {
|
|
1003
|
-
context_w = context_wc;
|
|
1004
|
-
} else {
|
|
1005
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
1006
|
-
if (context_w.charCodeAt(0) < 256) {
|
|
1007
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1008
|
-
context_data_val = context_data_val << 1;
|
|
1009
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1010
|
-
context_data_position = 0;
|
|
1011
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1012
|
-
context_data_val = 0;
|
|
1013
|
-
} else {
|
|
1014
|
-
context_data_position++;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
value2 = context_w.charCodeAt(0);
|
|
1018
|
-
for (i2 = 0; i2 < 8; i2++) {
|
|
1019
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1020
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1021
|
-
context_data_position = 0;
|
|
1022
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1023
|
-
context_data_val = 0;
|
|
1024
|
-
} else {
|
|
1025
|
-
context_data_position++;
|
|
1026
|
-
}
|
|
1027
|
-
value2 = value2 >> 1;
|
|
1028
|
-
}
|
|
1029
|
-
} else {
|
|
1030
|
-
value2 = 1;
|
|
1031
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1032
|
-
context_data_val = context_data_val << 1 | value2;
|
|
1033
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1034
|
-
context_data_position = 0;
|
|
1035
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1036
|
-
context_data_val = 0;
|
|
1037
|
-
} else {
|
|
1038
|
-
context_data_position++;
|
|
1039
|
-
}
|
|
1040
|
-
value2 = 0;
|
|
1041
|
-
}
|
|
1042
|
-
value2 = context_w.charCodeAt(0);
|
|
1043
|
-
for (i2 = 0; i2 < 16; i2++) {
|
|
1044
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1045
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1046
|
-
context_data_position = 0;
|
|
1047
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1048
|
-
context_data_val = 0;
|
|
1049
|
-
} else {
|
|
1050
|
-
context_data_position++;
|
|
1051
|
-
}
|
|
1052
|
-
value2 = value2 >> 1;
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
context_enlargeIn--;
|
|
1056
|
-
if (context_enlargeIn == 0) {
|
|
1057
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1058
|
-
context_numBits++;
|
|
1059
|
-
}
|
|
1060
|
-
delete context_dictionaryToCreate[context_w];
|
|
1061
|
-
} else {
|
|
1062
|
-
value2 = context_dictionary[context_w];
|
|
1063
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1064
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1065
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1066
|
-
context_data_position = 0;
|
|
1067
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1068
|
-
context_data_val = 0;
|
|
1069
|
-
} else {
|
|
1070
|
-
context_data_position++;
|
|
1071
|
-
}
|
|
1072
|
-
value2 = value2 >> 1;
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
context_enlargeIn--;
|
|
1076
|
-
if (context_enlargeIn == 0) {
|
|
1077
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1078
|
-
context_numBits++;
|
|
1079
|
-
}
|
|
1080
|
-
context_dictionary[context_wc] = context_dictSize++;
|
|
1081
|
-
context_w = String(context_c);
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
if (context_w !== "") {
|
|
1085
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
1086
|
-
if (context_w.charCodeAt(0) < 256) {
|
|
1087
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1088
|
-
context_data_val = context_data_val << 1;
|
|
1089
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1090
|
-
context_data_position = 0;
|
|
1091
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1092
|
-
context_data_val = 0;
|
|
1093
|
-
} else {
|
|
1094
|
-
context_data_position++;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
value2 = context_w.charCodeAt(0);
|
|
1098
|
-
for (i2 = 0; i2 < 8; i2++) {
|
|
1099
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1100
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1101
|
-
context_data_position = 0;
|
|
1102
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1103
|
-
context_data_val = 0;
|
|
1104
|
-
} else {
|
|
1105
|
-
context_data_position++;
|
|
1106
|
-
}
|
|
1107
|
-
value2 = value2 >> 1;
|
|
1108
|
-
}
|
|
1109
|
-
} else {
|
|
1110
|
-
value2 = 1;
|
|
1111
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1112
|
-
context_data_val = context_data_val << 1 | value2;
|
|
1113
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1114
|
-
context_data_position = 0;
|
|
1115
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1116
|
-
context_data_val = 0;
|
|
1117
|
-
} else {
|
|
1118
|
-
context_data_position++;
|
|
1119
|
-
}
|
|
1120
|
-
value2 = 0;
|
|
1121
|
-
}
|
|
1122
|
-
value2 = context_w.charCodeAt(0);
|
|
1123
|
-
for (i2 = 0; i2 < 16; i2++) {
|
|
1124
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1125
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1126
|
-
context_data_position = 0;
|
|
1127
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1128
|
-
context_data_val = 0;
|
|
1129
|
-
} else {
|
|
1130
|
-
context_data_position++;
|
|
1131
|
-
}
|
|
1132
|
-
value2 = value2 >> 1;
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
context_enlargeIn--;
|
|
1136
|
-
if (context_enlargeIn == 0) {
|
|
1137
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1138
|
-
context_numBits++;
|
|
1139
|
-
}
|
|
1140
|
-
delete context_dictionaryToCreate[context_w];
|
|
1141
|
-
} else {
|
|
1142
|
-
value2 = context_dictionary[context_w];
|
|
1143
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1144
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1145
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1146
|
-
context_data_position = 0;
|
|
1147
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1148
|
-
context_data_val = 0;
|
|
1149
|
-
} else {
|
|
1150
|
-
context_data_position++;
|
|
1151
|
-
}
|
|
1152
|
-
value2 = value2 >> 1;
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
context_enlargeIn--;
|
|
1156
|
-
if (context_enlargeIn == 0) {
|
|
1157
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1158
|
-
context_numBits++;
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
value2 = 2;
|
|
1162
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1163
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1164
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1165
|
-
context_data_position = 0;
|
|
1166
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1167
|
-
context_data_val = 0;
|
|
1168
|
-
} else {
|
|
1169
|
-
context_data_position++;
|
|
1170
|
-
}
|
|
1171
|
-
value2 = value2 >> 1;
|
|
1172
|
-
}
|
|
1173
|
-
while (true) {
|
|
1174
|
-
context_data_val = context_data_val << 1;
|
|
1175
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1176
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1177
|
-
break;
|
|
1178
|
-
} else
|
|
1179
|
-
context_data_position++;
|
|
1180
|
-
}
|
|
1181
|
-
return context_data.join("");
|
|
1182
|
-
},
|
|
1183
|
-
decompress: function(compressed) {
|
|
1184
|
-
if (compressed == null)
|
|
1185
|
-
return "";
|
|
1186
|
-
if (compressed == "")
|
|
1187
|
-
return null;
|
|
1188
|
-
return LZString2._decompress(compressed.length, 32768, function(index2) {
|
|
1189
|
-
return compressed.charCodeAt(index2);
|
|
1190
|
-
});
|
|
1191
|
-
},
|
|
1192
|
-
_decompress: function(length2, resetValue, getNextValue) {
|
|
1193
|
-
var dictionary = [], enlargeIn = 4, dictSize = 4, numBits = 3, entry2 = "", result = [], i2, w2, bits, resb, maxpower, power, c2, data2 = { val: getNextValue(0), position: resetValue, index: 1 };
|
|
1194
|
-
for (i2 = 0; i2 < 3; i2 += 1) {
|
|
1195
|
-
dictionary[i2] = i2;
|
|
1196
|
-
}
|
|
1197
|
-
bits = 0;
|
|
1198
|
-
maxpower = Math.pow(2, 2);
|
|
1199
|
-
power = 1;
|
|
1200
|
-
while (power != maxpower) {
|
|
1201
|
-
resb = data2.val & data2.position;
|
|
1202
|
-
data2.position >>= 1;
|
|
1203
|
-
if (data2.position == 0) {
|
|
1204
|
-
data2.position = resetValue;
|
|
1205
|
-
data2.val = getNextValue(data2.index++);
|
|
1206
|
-
}
|
|
1207
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1208
|
-
power <<= 1;
|
|
1209
|
-
}
|
|
1210
|
-
switch (bits) {
|
|
1211
|
-
case 0:
|
|
1212
|
-
bits = 0;
|
|
1213
|
-
maxpower = Math.pow(2, 8);
|
|
1214
|
-
power = 1;
|
|
1215
|
-
while (power != maxpower) {
|
|
1216
|
-
resb = data2.val & data2.position;
|
|
1217
|
-
data2.position >>= 1;
|
|
1218
|
-
if (data2.position == 0) {
|
|
1219
|
-
data2.position = resetValue;
|
|
1220
|
-
data2.val = getNextValue(data2.index++);
|
|
1221
|
-
}
|
|
1222
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1223
|
-
power <<= 1;
|
|
1224
|
-
}
|
|
1225
|
-
c2 = f2(bits);
|
|
1226
|
-
break;
|
|
1227
|
-
case 1:
|
|
1228
|
-
bits = 0;
|
|
1229
|
-
maxpower = Math.pow(2, 16);
|
|
1230
|
-
power = 1;
|
|
1231
|
-
while (power != maxpower) {
|
|
1232
|
-
resb = data2.val & data2.position;
|
|
1233
|
-
data2.position >>= 1;
|
|
1234
|
-
if (data2.position == 0) {
|
|
1235
|
-
data2.position = resetValue;
|
|
1236
|
-
data2.val = getNextValue(data2.index++);
|
|
1237
|
-
}
|
|
1238
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1239
|
-
power <<= 1;
|
|
1240
|
-
}
|
|
1241
|
-
c2 = f2(bits);
|
|
1242
|
-
break;
|
|
1243
|
-
case 2:
|
|
1244
|
-
return "";
|
|
1245
|
-
}
|
|
1246
|
-
dictionary[3] = c2;
|
|
1247
|
-
w2 = c2;
|
|
1248
|
-
result.push(c2);
|
|
1249
|
-
while (true) {
|
|
1250
|
-
if (data2.index > length2) {
|
|
1251
|
-
return "";
|
|
1252
|
-
}
|
|
1253
|
-
bits = 0;
|
|
1254
|
-
maxpower = Math.pow(2, numBits);
|
|
1255
|
-
power = 1;
|
|
1256
|
-
while (power != maxpower) {
|
|
1257
|
-
resb = data2.val & data2.position;
|
|
1258
|
-
data2.position >>= 1;
|
|
1259
|
-
if (data2.position == 0) {
|
|
1260
|
-
data2.position = resetValue;
|
|
1261
|
-
data2.val = getNextValue(data2.index++);
|
|
1262
|
-
}
|
|
1263
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1264
|
-
power <<= 1;
|
|
1265
|
-
}
|
|
1266
|
-
switch (c2 = bits) {
|
|
1267
|
-
case 0:
|
|
1268
|
-
bits = 0;
|
|
1269
|
-
maxpower = Math.pow(2, 8);
|
|
1270
|
-
power = 1;
|
|
1271
|
-
while (power != maxpower) {
|
|
1272
|
-
resb = data2.val & data2.position;
|
|
1273
|
-
data2.position >>= 1;
|
|
1274
|
-
if (data2.position == 0) {
|
|
1275
|
-
data2.position = resetValue;
|
|
1276
|
-
data2.val = getNextValue(data2.index++);
|
|
1277
|
-
}
|
|
1278
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1279
|
-
power <<= 1;
|
|
1280
|
-
}
|
|
1281
|
-
dictionary[dictSize++] = f2(bits);
|
|
1282
|
-
c2 = dictSize - 1;
|
|
1283
|
-
enlargeIn--;
|
|
1284
|
-
break;
|
|
1285
|
-
case 1:
|
|
1286
|
-
bits = 0;
|
|
1287
|
-
maxpower = Math.pow(2, 16);
|
|
1288
|
-
power = 1;
|
|
1289
|
-
while (power != maxpower) {
|
|
1290
|
-
resb = data2.val & data2.position;
|
|
1291
|
-
data2.position >>= 1;
|
|
1292
|
-
if (data2.position == 0) {
|
|
1293
|
-
data2.position = resetValue;
|
|
1294
|
-
data2.val = getNextValue(data2.index++);
|
|
1295
|
-
}
|
|
1296
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1297
|
-
power <<= 1;
|
|
1298
|
-
}
|
|
1299
|
-
dictionary[dictSize++] = f2(bits);
|
|
1300
|
-
c2 = dictSize - 1;
|
|
1301
|
-
enlargeIn--;
|
|
1302
|
-
break;
|
|
1303
|
-
case 2:
|
|
1304
|
-
return result.join("");
|
|
1305
|
-
}
|
|
1306
|
-
if (enlargeIn == 0) {
|
|
1307
|
-
enlargeIn = Math.pow(2, numBits);
|
|
1308
|
-
numBits++;
|
|
1309
|
-
}
|
|
1310
|
-
if (dictionary[c2]) {
|
|
1311
|
-
entry2 = dictionary[c2];
|
|
1312
|
-
} else {
|
|
1313
|
-
if (c2 === dictSize) {
|
|
1314
|
-
entry2 = w2 + w2.charAt(0);
|
|
1315
|
-
} else {
|
|
1316
|
-
return null;
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
result.push(entry2);
|
|
1320
|
-
dictionary[dictSize++] = w2 + entry2.charAt(0);
|
|
1321
|
-
enlargeIn--;
|
|
1322
|
-
w2 = entry2;
|
|
1323
|
-
if (enlargeIn == 0) {
|
|
1324
|
-
enlargeIn = Math.pow(2, numBits);
|
|
1325
|
-
numBits++;
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
|
-
return LZString2;
|
|
1331
|
-
}();
|
|
1332
|
-
if (module3 != null) {
|
|
1333
|
-
module3.exports = LZString;
|
|
1334
|
-
}
|
|
1335
|
-
})(lzString);
|
|
1336
|
-
const VALUE_TRANSFORM_OPTIONS = [
|
|
1337
|
-
{ name: "None", value: null },
|
|
1338
|
-
{ name: "Log", value: "log1p" },
|
|
1339
|
-
{ name: "ArcSinh", value: "arcsinh" }
|
|
1340
|
-
];
|
|
1341
|
-
function getValueTransformFunction(featureValueTransform, coefficient) {
|
|
1342
|
-
let transformFunction;
|
|
1343
|
-
switch (featureValueTransform) {
|
|
1344
|
-
case "log1p":
|
|
1345
|
-
transformFunction = (v) => Math.log(1 + v * coefficient);
|
|
1346
|
-
break;
|
|
1347
|
-
case "arcsinh":
|
|
1348
|
-
transformFunction = (v) => Math.asinh(v * coefficient);
|
|
1349
|
-
break;
|
|
1350
|
-
default:
|
|
1351
|
-
transformFunction = (v) => v;
|
|
1352
|
-
}
|
|
1353
|
-
return transformFunction;
|
|
1354
|
-
}
|
|
1355
903
|
var rngBrowser = { exports: {} };
|
|
1356
904
|
var getRandomValues$1 = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != "undefined" && typeof window.msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto);
|
|
1357
905
|
if (getRandomValues$1) {
|
|
@@ -60040,7 +59588,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
60040
59588
|
var CARRIAGE_RETURN = "\r".charCodeAt(0);
|
|
60041
59589
|
var TAB = " ".charCodeAt(0);
|
|
60042
59590
|
var STRING_BUFFER_SIZE = 64 * 1024;
|
|
60043
|
-
function
|
|
59591
|
+
function Parser2() {
|
|
60044
59592
|
this.tState = START;
|
|
60045
59593
|
this.value = void 0;
|
|
60046
59594
|
this.string = void 0;
|
|
@@ -60057,7 +59605,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
60057
59605
|
this.temp_buffs = { "2": new Buffer2(2), "3": new Buffer2(3), "4": new Buffer2(4) };
|
|
60058
59606
|
this.offset = -1;
|
|
60059
59607
|
}
|
|
60060
|
-
|
|
59608
|
+
Parser2.toknam = function(code) {
|
|
60061
59609
|
var keys3 = Object.keys(C3);
|
|
60062
59610
|
for (var i2 = 0, l2 = keys3.length; i2 < l2; i2++) {
|
|
60063
59611
|
var key2 = keys3[i2];
|
|
@@ -60067,13 +59615,13 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
60067
59615
|
}
|
|
60068
59616
|
return code && "0x" + code.toString(16);
|
|
60069
59617
|
};
|
|
60070
|
-
var proto2 =
|
|
59618
|
+
var proto2 = Parser2.prototype;
|
|
60071
59619
|
proto2.onError = function(err2) {
|
|
60072
59620
|
throw err2;
|
|
60073
59621
|
};
|
|
60074
59622
|
proto2.charError = function(buffer2, i2) {
|
|
60075
59623
|
this.tState = STOP;
|
|
60076
|
-
this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer2[i2])) + " at position " + i2 + " in state " +
|
|
59624
|
+
this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer2[i2])) + " at position " + i2 + " in state " + Parser2.toknam(this.tState)));
|
|
60077
59625
|
};
|
|
60078
59626
|
proto2.appendStringChar = function(char) {
|
|
60079
59627
|
if (this.stringBufferOffset >= STRING_BUFFER_SIZE) {
|
|
@@ -60159,7 +59707,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
60159
59707
|
i2 = i2 + j2 - 1;
|
|
60160
59708
|
} else if (this.bytes_remaining === 0 && n3 >= 128) {
|
|
60161
59709
|
if (n3 <= 193 || n3 > 244) {
|
|
60162
|
-
return this.onError(new Error("Invalid UTF-8 character at position " + i2 + " in state " +
|
|
59710
|
+
return this.onError(new Error("Invalid UTF-8 character at position " + i2 + " in state " + Parser2.toknam(this.tState)));
|
|
60163
59711
|
}
|
|
60164
59712
|
if (n3 >= 194 && n3 <= 223)
|
|
60165
59713
|
this.bytes_in_sequence = 2;
|
|
@@ -60357,7 +59905,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
60357
59905
|
};
|
|
60358
59906
|
proto2.parseError = function(token, value2) {
|
|
60359
59907
|
this.tState = STOP;
|
|
60360
|
-
this.onError(new Error("Unexpected " +
|
|
59908
|
+
this.onError(new Error("Unexpected " + Parser2.toknam(token) + (value2 ? "(" + JSON.stringify(value2) + ")" : "") + " in state " + Parser2.toknam(this.state)));
|
|
60361
59909
|
};
|
|
60362
59910
|
proto2.push = function() {
|
|
60363
59911
|
this.stack.push({ value: this.value, key: this.key, mode: this.mode });
|
|
@@ -60455,8 +60003,8 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
60455
60003
|
return this.parseError(token, value2);
|
|
60456
60004
|
}
|
|
60457
60005
|
};
|
|
60458
|
-
|
|
60459
|
-
var jsonparse =
|
|
60006
|
+
Parser2.C = C3;
|
|
60007
|
+
var jsonparse = Parser2;
|
|
60460
60008
|
var Transform$12 = Stream.Transform;
|
|
60461
60009
|
var JSON2CSVTransform = /* @__PURE__ */ function(_Transform) {
|
|
60462
60010
|
_inherits2(JSON2CSVTransform2, _Transform);
|
|
@@ -61475,19 +61023,11 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61475
61023
|
return true;
|
|
61476
61024
|
}
|
|
61477
61025
|
};
|
|
61478
|
-
var _descriptors
|
|
61479
|
-
|
|
61480
|
-
|
|
61481
|
-
|
|
61482
|
-
|
|
61483
|
-
hasRequired_descriptors = 1;
|
|
61484
|
-
_descriptors = !_fails(function() {
|
|
61485
|
-
return Object.defineProperty({}, "a", { get: function() {
|
|
61486
|
-
return 7;
|
|
61487
|
-
} }).a != 7;
|
|
61488
|
-
});
|
|
61489
|
-
return _descriptors;
|
|
61490
|
-
}
|
|
61026
|
+
var _descriptors = !_fails(function() {
|
|
61027
|
+
return Object.defineProperty({}, "a", { get: function() {
|
|
61028
|
+
return 7;
|
|
61029
|
+
} }).a != 7;
|
|
61030
|
+
});
|
|
61491
61031
|
var _domCreate;
|
|
61492
61032
|
var hasRequired_domCreate;
|
|
61493
61033
|
function require_domCreate() {
|
|
@@ -61502,19 +61042,11 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61502
61042
|
};
|
|
61503
61043
|
return _domCreate;
|
|
61504
61044
|
}
|
|
61505
|
-
var _ie8DomDefine
|
|
61506
|
-
|
|
61507
|
-
|
|
61508
|
-
|
|
61509
|
-
|
|
61510
|
-
hasRequired_ie8DomDefine = 1;
|
|
61511
|
-
_ie8DomDefine = !require_descriptors() && !_fails(function() {
|
|
61512
|
-
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
61513
|
-
return 7;
|
|
61514
|
-
} }).a != 7;
|
|
61515
|
-
});
|
|
61516
|
-
return _ie8DomDefine;
|
|
61517
|
-
}
|
|
61045
|
+
var _ie8DomDefine = !_descriptors && !_fails(function() {
|
|
61046
|
+
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
61047
|
+
return 7;
|
|
61048
|
+
} }).a != 7;
|
|
61049
|
+
});
|
|
61518
61050
|
var isObject$f = _isObject;
|
|
61519
61051
|
var _toPrimitive = function(it, S) {
|
|
61520
61052
|
if (!isObject$f(it))
|
|
@@ -61528,32 +61060,25 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61528
61060
|
return val;
|
|
61529
61061
|
throw TypeError("Can't convert object to primitive value");
|
|
61530
61062
|
};
|
|
61531
|
-
var
|
|
61532
|
-
|
|
61533
|
-
|
|
61534
|
-
|
|
61535
|
-
|
|
61536
|
-
|
|
61537
|
-
|
|
61538
|
-
|
|
61539
|
-
|
|
61540
|
-
|
|
61541
|
-
|
|
61542
|
-
|
|
61543
|
-
|
|
61544
|
-
|
|
61545
|
-
|
|
61546
|
-
|
|
61547
|
-
|
|
61548
|
-
|
|
61549
|
-
|
|
61550
|
-
throw TypeError("Accessors not supported!");
|
|
61551
|
-
if ("value" in Attributes2)
|
|
61552
|
-
O[P2] = Attributes2.value;
|
|
61553
|
-
return O;
|
|
61554
|
-
};
|
|
61555
|
-
return _objectDp;
|
|
61556
|
-
}
|
|
61063
|
+
var anObject$3 = _anObject;
|
|
61064
|
+
var IE8_DOM_DEFINE$1 = _ie8DomDefine;
|
|
61065
|
+
var toPrimitive$2 = _toPrimitive;
|
|
61066
|
+
var dP$3 = Object.defineProperty;
|
|
61067
|
+
_objectDp.f = _descriptors ? Object.defineProperty : function defineProperty2(O, P2, Attributes2) {
|
|
61068
|
+
anObject$3(O);
|
|
61069
|
+
P2 = toPrimitive$2(P2, true);
|
|
61070
|
+
anObject$3(Attributes2);
|
|
61071
|
+
if (IE8_DOM_DEFINE$1)
|
|
61072
|
+
try {
|
|
61073
|
+
return dP$3(O, P2, Attributes2);
|
|
61074
|
+
} catch (e3) {
|
|
61075
|
+
}
|
|
61076
|
+
if ("get" in Attributes2 || "set" in Attributes2)
|
|
61077
|
+
throw TypeError("Accessors not supported!");
|
|
61078
|
+
if ("value" in Attributes2)
|
|
61079
|
+
O[P2] = Attributes2.value;
|
|
61080
|
+
return O;
|
|
61081
|
+
};
|
|
61557
61082
|
var _propertyDesc = function(bitmap, value2) {
|
|
61558
61083
|
return {
|
|
61559
61084
|
enumerable: !(bitmap & 1),
|
|
@@ -61562,9 +61087,9 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61562
61087
|
value: value2
|
|
61563
61088
|
};
|
|
61564
61089
|
};
|
|
61565
|
-
var dP$2 =
|
|
61090
|
+
var dP$2 = _objectDp;
|
|
61566
61091
|
var createDesc$2 = _propertyDesc;
|
|
61567
|
-
var _hide =
|
|
61092
|
+
var _hide = _descriptors ? function(object2, key2, value2) {
|
|
61568
61093
|
return dP$2.f(object2, key2, createDesc$2(1, value2));
|
|
61569
61094
|
} : function(object2, key2, value2) {
|
|
61570
61095
|
object2[key2] = value2;
|
|
@@ -61767,7 +61292,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61767
61292
|
if (hasRequired_objectAssign)
|
|
61768
61293
|
return _objectAssign;
|
|
61769
61294
|
hasRequired_objectAssign = 1;
|
|
61770
|
-
var DESCRIPTORS2 =
|
|
61295
|
+
var DESCRIPTORS2 = _descriptors;
|
|
61771
61296
|
var getKeys2 = _objectKeys$1;
|
|
61772
61297
|
var gOPS2 = _objectGops;
|
|
61773
61298
|
var pIE2 = require_objectPie();
|
|
@@ -61830,7 +61355,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61830
61355
|
};
|
|
61831
61356
|
var defineProperty$6 = { exports: {} };
|
|
61832
61357
|
var $export$4 = _export;
|
|
61833
|
-
$export$4($export$4.S + $export$4.F * !
|
|
61358
|
+
$export$4($export$4.S + $export$4.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
|
|
61834
61359
|
var $Object$1 = _core.exports.Object;
|
|
61835
61360
|
var defineProperty$5 = function defineProperty2(it, key2, desc) {
|
|
61836
61361
|
return $Object$1.defineProperty(it, key2, desc);
|
|
@@ -61906,10 +61431,10 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61906
61431
|
module3.exports = _hide;
|
|
61907
61432
|
})(_redefine);
|
|
61908
61433
|
var _iterators = {};
|
|
61909
|
-
var dP$1 =
|
|
61434
|
+
var dP$1 = _objectDp;
|
|
61910
61435
|
var anObject$2 = _anObject;
|
|
61911
61436
|
var getKeys$1 = _objectKeys$1;
|
|
61912
|
-
var _objectDps =
|
|
61437
|
+
var _objectDps = _descriptors ? Object.defineProperties : function defineProperties2(O, Properties) {
|
|
61913
61438
|
anObject$2(O);
|
|
61914
61439
|
var keys2 = getKeys$1(Properties);
|
|
61915
61440
|
var length2 = keys2.length;
|
|
@@ -61974,7 +61499,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
61974
61499
|
return store[name2] || (store[name2] = USE_SYMBOL && Symbol$7[name2] || (USE_SYMBOL ? Symbol$7 : uid$2)("Symbol." + name2));
|
|
61975
61500
|
};
|
|
61976
61501
|
$exports.store = store;
|
|
61977
|
-
var def$1 =
|
|
61502
|
+
var def$1 = _objectDp.f;
|
|
61978
61503
|
var has$8 = _has$2;
|
|
61979
61504
|
var TAG = _wks.exports("toStringTag");
|
|
61980
61505
|
var _setToStringTag = function(it, tag2, stat) {
|
|
@@ -62144,7 +61669,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
62144
61669
|
var META$1 = _uid("meta");
|
|
62145
61670
|
var isObject$e = _isObject;
|
|
62146
61671
|
var has$6 = _has$2;
|
|
62147
|
-
var setDesc =
|
|
61672
|
+
var setDesc = _objectDp.f;
|
|
62148
61673
|
var id$2 = 0;
|
|
62149
61674
|
var isExtensible = Object.isExtensible || function() {
|
|
62150
61675
|
return true;
|
|
@@ -62194,7 +61719,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
62194
61719
|
};
|
|
62195
61720
|
var core$1 = _core.exports;
|
|
62196
61721
|
var wksExt$1 = _wksExt;
|
|
62197
|
-
var defineProperty$4 =
|
|
61722
|
+
var defineProperty$4 = _objectDp.f;
|
|
62198
61723
|
var _wksDefine = function(name2) {
|
|
62199
61724
|
var $Symbol2 = core$1.Symbol || (core$1.Symbol = {});
|
|
62200
61725
|
if (name2.charAt(0) != "_" && !(name2 in $Symbol2))
|
|
@@ -62248,9 +61773,9 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
62248
61773
|
var toIObject$1 = _toIobject;
|
|
62249
61774
|
var toPrimitive$1 = _toPrimitive;
|
|
62250
61775
|
var has$5 = _has$2;
|
|
62251
|
-
var IE8_DOM_DEFINE =
|
|
61776
|
+
var IE8_DOM_DEFINE = _ie8DomDefine;
|
|
62252
61777
|
var gOPD$4 = Object.getOwnPropertyDescriptor;
|
|
62253
|
-
_objectGopd.f =
|
|
61778
|
+
_objectGopd.f = _descriptors ? gOPD$4 : function getOwnPropertyDescriptor2(O, P2) {
|
|
62254
61779
|
O = toIObject$1(O);
|
|
62255
61780
|
P2 = toPrimitive$1(P2, true);
|
|
62256
61781
|
if (IE8_DOM_DEFINE)
|
|
@@ -62263,7 +61788,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
62263
61788
|
};
|
|
62264
61789
|
var global$2 = _global.exports;
|
|
62265
61790
|
var has$4 = _has$2;
|
|
62266
|
-
var DESCRIPTORS =
|
|
61791
|
+
var DESCRIPTORS = _descriptors;
|
|
62267
61792
|
var $export$2 = _export;
|
|
62268
61793
|
var redefine = _redefine.exports;
|
|
62269
61794
|
var META = _meta$3.exports.KEY;
|
|
@@ -62286,7 +61811,7 @@ If these are plugin file types, ensure that they have been properly registered.`
|
|
|
62286
61811
|
var gOPNExt = _objectGopnExt;
|
|
62287
61812
|
var $GOPD = _objectGopd;
|
|
62288
61813
|
var $GOPS = _objectGops;
|
|
62289
|
-
var $DP =
|
|
61814
|
+
var $DP = _objectDp;
|
|
62290
61815
|
var $keys = _objectKeys$1;
|
|
62291
61816
|
var gOPD$3 = $GOPD.f;
|
|
62292
61817
|
var dP = $DP.f;
|
|
@@ -184582,7 +184107,7 @@ attribute float isSelected;
|
|
|
184582
184107
|
"attrValueProcessor",
|
|
184583
184108
|
"rootNodeName"
|
|
184584
184109
|
];
|
|
184585
|
-
function
|
|
184110
|
+
function Parser2(options) {
|
|
184586
184111
|
this.options = buildOptions2(options, defaultOptions2, props2);
|
|
184587
184112
|
if (this.options.ignoreAttributes || this.options.attrNodeName) {
|
|
184588
184113
|
this.isAttribute = function() {
|
|
@@ -184623,7 +184148,7 @@ attribute float isSelected;
|
|
|
184623
184148
|
this.buildTextValNode = buildTextValNode;
|
|
184624
184149
|
this.buildObjectNode = buildObjectNode;
|
|
184625
184150
|
}
|
|
184626
|
-
|
|
184151
|
+
Parser2.prototype.parse = function(jObj) {
|
|
184627
184152
|
if (Array.isArray(jObj) && this.options.rootNodeName && this.options.rootNodeName.length > 1) {
|
|
184628
184153
|
jObj = {
|
|
184629
184154
|
[this.options.rootNodeName]: jObj
|
|
@@ -184631,7 +184156,7 @@ attribute float isSelected;
|
|
|
184631
184156
|
}
|
|
184632
184157
|
return this.j2x(jObj, 0).val;
|
|
184633
184158
|
};
|
|
184634
|
-
|
|
184159
|
+
Parser2.prototype.j2x = function(jObj, level) {
|
|
184635
184160
|
let attrStr = "";
|
|
184636
184161
|
let val = "";
|
|
184637
184162
|
for (let key2 in jObj) {
|
|
@@ -184763,7 +184288,7 @@ attribute float isSelected;
|
|
|
184763
184288
|
function isCDATA(name2) {
|
|
184764
184289
|
return name2 === this.options.cdataTagName;
|
|
184765
184290
|
}
|
|
184766
|
-
json2xml =
|
|
184291
|
+
json2xml = Parser2;
|
|
184767
184292
|
return json2xml;
|
|
184768
184293
|
}
|
|
184769
184294
|
(function(exports3) {
|
|
@@ -193083,7 +192608,6 @@ attribute float isSelected;
|
|
|
193083
192608
|
}
|
|
193084
192609
|
};
|
|
193085
192610
|
MinimumIntensityProjectionExtension.extensionName = "MinimumIntensityProjectionExtension";
|
|
193086
|
-
const AdditiveColormap3DExtensions = { BaseExtension, AdditiveBlendExtension, MaximumIntensityProjectionExtension, MinimumIntensityProjectionExtension };
|
|
193087
192611
|
const defaultProps$5 = { pickable: { type: "boolean", value: true, compare: true }, coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, contrastLimits: { type: "array", value: [], compare: true }, channelsVisible: { type: "array", value: [], compare: true }, selections: { type: "array", value: [], compare: true }, domain: { type: "array", value: [], compare: true }, viewportId: { type: "string", value: "", compare: true }, loader: { type: "object", value: { getRaster: async () => ({ data: [], height: 0, width: 0 }), dtype: "Uint16" }, compare: true }, onClick: { type: "function", value: null, compare: true }, onViewportLoad: { type: "function", value: null, compare: true }, interpolation: { type: "number", value: GL$1.NEAREST, compare: true }, extensions: { type: "array", value: [new ColorPaletteExtension()], compare: true } };
|
|
193088
192612
|
const ImageLayer = class extends CompositeLayer {
|
|
193089
192613
|
finalizeState() {
|
|
@@ -210192,20 +209716,20 @@ void main() {
|
|
|
210192
209716
|
if (use3d) {
|
|
210193
209717
|
if (colormap) {
|
|
210194
209718
|
if (renderingMode === "Minimum Intensity Projection") {
|
|
210195
|
-
return [new
|
|
209719
|
+
return [new (void 0)()];
|
|
210196
209720
|
}
|
|
210197
209721
|
if (renderingMode === "Maximum Intensity Projection") {
|
|
210198
|
-
return [new
|
|
209722
|
+
return [new (void 0)()];
|
|
210199
209723
|
}
|
|
210200
|
-
return [new
|
|
209724
|
+
return [new (void 0)()];
|
|
210201
209725
|
}
|
|
210202
209726
|
if (renderingMode === "Minimum Intensity Projection") {
|
|
210203
|
-
return [new
|
|
209727
|
+
return [new (void 0)()];
|
|
210204
209728
|
}
|
|
210205
209729
|
if (renderingMode === "Maximum Intensity Projection") {
|
|
210206
|
-
return [new
|
|
209730
|
+
return [new (void 0)()];
|
|
210207
209731
|
}
|
|
210208
|
-
return [new
|
|
209732
|
+
return [new (void 0)()];
|
|
210209
209733
|
}
|
|
210210
209734
|
if (colormap) {
|
|
210211
209735
|
return [new AdditiveColormapExtension()];
|
|
@@ -275169,6 +274693,2112 @@ void main() {
|
|
|
275169
274693
|
}, []);
|
|
275170
274694
|
return ready ? jsx(VitS, { ...props2 }) : null;
|
|
275171
274695
|
}
|
|
274696
|
+
const BROWSER_ALIASES_MAP = {
|
|
274697
|
+
"Amazon Silk": "amazon_silk",
|
|
274698
|
+
"Android Browser": "android",
|
|
274699
|
+
Bada: "bada",
|
|
274700
|
+
BlackBerry: "blackberry",
|
|
274701
|
+
Chrome: "chrome",
|
|
274702
|
+
Chromium: "chromium",
|
|
274703
|
+
Electron: "electron",
|
|
274704
|
+
Epiphany: "epiphany",
|
|
274705
|
+
Firefox: "firefox",
|
|
274706
|
+
Focus: "focus",
|
|
274707
|
+
Generic: "generic",
|
|
274708
|
+
"Google Search": "google_search",
|
|
274709
|
+
Googlebot: "googlebot",
|
|
274710
|
+
"Internet Explorer": "ie",
|
|
274711
|
+
"K-Meleon": "k_meleon",
|
|
274712
|
+
Maxthon: "maxthon",
|
|
274713
|
+
"Microsoft Edge": "edge",
|
|
274714
|
+
"MZ Browser": "mz",
|
|
274715
|
+
"NAVER Whale Browser": "naver",
|
|
274716
|
+
Opera: "opera",
|
|
274717
|
+
"Opera Coast": "opera_coast",
|
|
274718
|
+
PhantomJS: "phantomjs",
|
|
274719
|
+
Puffin: "puffin",
|
|
274720
|
+
QupZilla: "qupzilla",
|
|
274721
|
+
QQ: "qq",
|
|
274722
|
+
QQLite: "qqlite",
|
|
274723
|
+
Safari: "safari",
|
|
274724
|
+
Sailfish: "sailfish",
|
|
274725
|
+
"Samsung Internet for Android": "samsung_internet",
|
|
274726
|
+
SeaMonkey: "seamonkey",
|
|
274727
|
+
Sleipnir: "sleipnir",
|
|
274728
|
+
Swing: "swing",
|
|
274729
|
+
Tizen: "tizen",
|
|
274730
|
+
"UC Browser": "uc",
|
|
274731
|
+
Vivaldi: "vivaldi",
|
|
274732
|
+
"WebOS Browser": "webos",
|
|
274733
|
+
WeChat: "wechat",
|
|
274734
|
+
"Yandex Browser": "yandex",
|
|
274735
|
+
Roku: "roku"
|
|
274736
|
+
};
|
|
274737
|
+
const BROWSER_MAP = {
|
|
274738
|
+
amazon_silk: "Amazon Silk",
|
|
274739
|
+
android: "Android Browser",
|
|
274740
|
+
bada: "Bada",
|
|
274741
|
+
blackberry: "BlackBerry",
|
|
274742
|
+
chrome: "Chrome",
|
|
274743
|
+
chromium: "Chromium",
|
|
274744
|
+
electron: "Electron",
|
|
274745
|
+
epiphany: "Epiphany",
|
|
274746
|
+
firefox: "Firefox",
|
|
274747
|
+
focus: "Focus",
|
|
274748
|
+
generic: "Generic",
|
|
274749
|
+
googlebot: "Googlebot",
|
|
274750
|
+
google_search: "Google Search",
|
|
274751
|
+
ie: "Internet Explorer",
|
|
274752
|
+
k_meleon: "K-Meleon",
|
|
274753
|
+
maxthon: "Maxthon",
|
|
274754
|
+
edge: "Microsoft Edge",
|
|
274755
|
+
mz: "MZ Browser",
|
|
274756
|
+
naver: "NAVER Whale Browser",
|
|
274757
|
+
opera: "Opera",
|
|
274758
|
+
opera_coast: "Opera Coast",
|
|
274759
|
+
phantomjs: "PhantomJS",
|
|
274760
|
+
puffin: "Puffin",
|
|
274761
|
+
qupzilla: "QupZilla",
|
|
274762
|
+
qq: "QQ Browser",
|
|
274763
|
+
qqlite: "QQ Browser Lite",
|
|
274764
|
+
safari: "Safari",
|
|
274765
|
+
sailfish: "Sailfish",
|
|
274766
|
+
samsung_internet: "Samsung Internet for Android",
|
|
274767
|
+
seamonkey: "SeaMonkey",
|
|
274768
|
+
sleipnir: "Sleipnir",
|
|
274769
|
+
swing: "Swing",
|
|
274770
|
+
tizen: "Tizen",
|
|
274771
|
+
uc: "UC Browser",
|
|
274772
|
+
vivaldi: "Vivaldi",
|
|
274773
|
+
webos: "WebOS Browser",
|
|
274774
|
+
wechat: "WeChat",
|
|
274775
|
+
yandex: "Yandex Browser"
|
|
274776
|
+
};
|
|
274777
|
+
const PLATFORMS_MAP = {
|
|
274778
|
+
tablet: "tablet",
|
|
274779
|
+
mobile: "mobile",
|
|
274780
|
+
desktop: "desktop",
|
|
274781
|
+
tv: "tv"
|
|
274782
|
+
};
|
|
274783
|
+
const OS_MAP = {
|
|
274784
|
+
WindowsPhone: "Windows Phone",
|
|
274785
|
+
Windows: "Windows",
|
|
274786
|
+
MacOS: "macOS",
|
|
274787
|
+
iOS: "iOS",
|
|
274788
|
+
Android: "Android",
|
|
274789
|
+
WebOS: "WebOS",
|
|
274790
|
+
BlackBerry: "BlackBerry",
|
|
274791
|
+
Bada: "Bada",
|
|
274792
|
+
Tizen: "Tizen",
|
|
274793
|
+
Linux: "Linux",
|
|
274794
|
+
ChromeOS: "Chrome OS",
|
|
274795
|
+
PlayStation4: "PlayStation 4",
|
|
274796
|
+
Roku: "Roku"
|
|
274797
|
+
};
|
|
274798
|
+
const ENGINE_MAP = {
|
|
274799
|
+
EdgeHTML: "EdgeHTML",
|
|
274800
|
+
Blink: "Blink",
|
|
274801
|
+
Trident: "Trident",
|
|
274802
|
+
Presto: "Presto",
|
|
274803
|
+
Gecko: "Gecko",
|
|
274804
|
+
WebKit: "WebKit"
|
|
274805
|
+
};
|
|
274806
|
+
class Utils {
|
|
274807
|
+
static getFirstMatch(regexp, ua) {
|
|
274808
|
+
const match2 = ua.match(regexp);
|
|
274809
|
+
return match2 && match2.length > 0 && match2[1] || "";
|
|
274810
|
+
}
|
|
274811
|
+
static getSecondMatch(regexp, ua) {
|
|
274812
|
+
const match2 = ua.match(regexp);
|
|
274813
|
+
return match2 && match2.length > 1 && match2[2] || "";
|
|
274814
|
+
}
|
|
274815
|
+
static matchAndReturnConst(regexp, ua, _const2) {
|
|
274816
|
+
if (regexp.test(ua)) {
|
|
274817
|
+
return _const2;
|
|
274818
|
+
}
|
|
274819
|
+
return void 0;
|
|
274820
|
+
}
|
|
274821
|
+
static getWindowsVersionName(version2) {
|
|
274822
|
+
switch (version2) {
|
|
274823
|
+
case "NT":
|
|
274824
|
+
return "NT";
|
|
274825
|
+
case "XP":
|
|
274826
|
+
return "XP";
|
|
274827
|
+
case "NT 5.0":
|
|
274828
|
+
return "2000";
|
|
274829
|
+
case "NT 5.1":
|
|
274830
|
+
return "XP";
|
|
274831
|
+
case "NT 5.2":
|
|
274832
|
+
return "2003";
|
|
274833
|
+
case "NT 6.0":
|
|
274834
|
+
return "Vista";
|
|
274835
|
+
case "NT 6.1":
|
|
274836
|
+
return "7";
|
|
274837
|
+
case "NT 6.2":
|
|
274838
|
+
return "8";
|
|
274839
|
+
case "NT 6.3":
|
|
274840
|
+
return "8.1";
|
|
274841
|
+
case "NT 10.0":
|
|
274842
|
+
return "10";
|
|
274843
|
+
default:
|
|
274844
|
+
return void 0;
|
|
274845
|
+
}
|
|
274846
|
+
}
|
|
274847
|
+
static getMacOSVersionName(version2) {
|
|
274848
|
+
const v = version2.split(".").splice(0, 2).map((s2) => parseInt(s2, 10) || 0);
|
|
274849
|
+
v.push(0);
|
|
274850
|
+
if (v[0] !== 10)
|
|
274851
|
+
return void 0;
|
|
274852
|
+
switch (v[1]) {
|
|
274853
|
+
case 5:
|
|
274854
|
+
return "Leopard";
|
|
274855
|
+
case 6:
|
|
274856
|
+
return "Snow Leopard";
|
|
274857
|
+
case 7:
|
|
274858
|
+
return "Lion";
|
|
274859
|
+
case 8:
|
|
274860
|
+
return "Mountain Lion";
|
|
274861
|
+
case 9:
|
|
274862
|
+
return "Mavericks";
|
|
274863
|
+
case 10:
|
|
274864
|
+
return "Yosemite";
|
|
274865
|
+
case 11:
|
|
274866
|
+
return "El Capitan";
|
|
274867
|
+
case 12:
|
|
274868
|
+
return "Sierra";
|
|
274869
|
+
case 13:
|
|
274870
|
+
return "High Sierra";
|
|
274871
|
+
case 14:
|
|
274872
|
+
return "Mojave";
|
|
274873
|
+
case 15:
|
|
274874
|
+
return "Catalina";
|
|
274875
|
+
default:
|
|
274876
|
+
return void 0;
|
|
274877
|
+
}
|
|
274878
|
+
}
|
|
274879
|
+
static getAndroidVersionName(version2) {
|
|
274880
|
+
const v = version2.split(".").splice(0, 2).map((s2) => parseInt(s2, 10) || 0);
|
|
274881
|
+
v.push(0);
|
|
274882
|
+
if (v[0] === 1 && v[1] < 5)
|
|
274883
|
+
return void 0;
|
|
274884
|
+
if (v[0] === 1 && v[1] < 6)
|
|
274885
|
+
return "Cupcake";
|
|
274886
|
+
if (v[0] === 1 && v[1] >= 6)
|
|
274887
|
+
return "Donut";
|
|
274888
|
+
if (v[0] === 2 && v[1] < 2)
|
|
274889
|
+
return "Eclair";
|
|
274890
|
+
if (v[0] === 2 && v[1] === 2)
|
|
274891
|
+
return "Froyo";
|
|
274892
|
+
if (v[0] === 2 && v[1] > 2)
|
|
274893
|
+
return "Gingerbread";
|
|
274894
|
+
if (v[0] === 3)
|
|
274895
|
+
return "Honeycomb";
|
|
274896
|
+
if (v[0] === 4 && v[1] < 1)
|
|
274897
|
+
return "Ice Cream Sandwich";
|
|
274898
|
+
if (v[0] === 4 && v[1] < 4)
|
|
274899
|
+
return "Jelly Bean";
|
|
274900
|
+
if (v[0] === 4 && v[1] >= 4)
|
|
274901
|
+
return "KitKat";
|
|
274902
|
+
if (v[0] === 5)
|
|
274903
|
+
return "Lollipop";
|
|
274904
|
+
if (v[0] === 6)
|
|
274905
|
+
return "Marshmallow";
|
|
274906
|
+
if (v[0] === 7)
|
|
274907
|
+
return "Nougat";
|
|
274908
|
+
if (v[0] === 8)
|
|
274909
|
+
return "Oreo";
|
|
274910
|
+
if (v[0] === 9)
|
|
274911
|
+
return "Pie";
|
|
274912
|
+
return void 0;
|
|
274913
|
+
}
|
|
274914
|
+
static getVersionPrecision(version2) {
|
|
274915
|
+
return version2.split(".").length;
|
|
274916
|
+
}
|
|
274917
|
+
static compareVersions(versionA, versionB, isLoose = false) {
|
|
274918
|
+
const versionAPrecision = Utils.getVersionPrecision(versionA);
|
|
274919
|
+
const versionBPrecision = Utils.getVersionPrecision(versionB);
|
|
274920
|
+
let precision = Math.max(versionAPrecision, versionBPrecision);
|
|
274921
|
+
let lastPrecision = 0;
|
|
274922
|
+
const chunks = Utils.map([versionA, versionB], (version2) => {
|
|
274923
|
+
const delta = precision - Utils.getVersionPrecision(version2);
|
|
274924
|
+
const _version = version2 + new Array(delta + 1).join(".0");
|
|
274925
|
+
return Utils.map(_version.split("."), (chunk) => new Array(20 - chunk.length).join("0") + chunk).reverse();
|
|
274926
|
+
});
|
|
274927
|
+
if (isLoose) {
|
|
274928
|
+
lastPrecision = precision - Math.min(versionAPrecision, versionBPrecision);
|
|
274929
|
+
}
|
|
274930
|
+
precision -= 1;
|
|
274931
|
+
while (precision >= lastPrecision) {
|
|
274932
|
+
if (chunks[0][precision] > chunks[1][precision]) {
|
|
274933
|
+
return 1;
|
|
274934
|
+
}
|
|
274935
|
+
if (chunks[0][precision] === chunks[1][precision]) {
|
|
274936
|
+
if (precision === lastPrecision) {
|
|
274937
|
+
return 0;
|
|
274938
|
+
}
|
|
274939
|
+
precision -= 1;
|
|
274940
|
+
} else if (chunks[0][precision] < chunks[1][precision]) {
|
|
274941
|
+
return -1;
|
|
274942
|
+
}
|
|
274943
|
+
}
|
|
274944
|
+
return void 0;
|
|
274945
|
+
}
|
|
274946
|
+
static map(arr, iterator2) {
|
|
274947
|
+
const result = [];
|
|
274948
|
+
let i2;
|
|
274949
|
+
if (Array.prototype.map) {
|
|
274950
|
+
return Array.prototype.map.call(arr, iterator2);
|
|
274951
|
+
}
|
|
274952
|
+
for (i2 = 0; i2 < arr.length; i2 += 1) {
|
|
274953
|
+
result.push(iterator2(arr[i2]));
|
|
274954
|
+
}
|
|
274955
|
+
return result;
|
|
274956
|
+
}
|
|
274957
|
+
static find(arr, predicate) {
|
|
274958
|
+
let i2;
|
|
274959
|
+
let l2;
|
|
274960
|
+
if (Array.prototype.find) {
|
|
274961
|
+
return Array.prototype.find.call(arr, predicate);
|
|
274962
|
+
}
|
|
274963
|
+
for (i2 = 0, l2 = arr.length; i2 < l2; i2 += 1) {
|
|
274964
|
+
const value2 = arr[i2];
|
|
274965
|
+
if (predicate(value2, i2)) {
|
|
274966
|
+
return value2;
|
|
274967
|
+
}
|
|
274968
|
+
}
|
|
274969
|
+
return void 0;
|
|
274970
|
+
}
|
|
274971
|
+
static assign(obj, ...assigners) {
|
|
274972
|
+
const result = obj;
|
|
274973
|
+
let i2;
|
|
274974
|
+
let l2;
|
|
274975
|
+
if (Object.assign) {
|
|
274976
|
+
return Object.assign(obj, ...assigners);
|
|
274977
|
+
}
|
|
274978
|
+
for (i2 = 0, l2 = assigners.length; i2 < l2; i2 += 1) {
|
|
274979
|
+
const assigner = assigners[i2];
|
|
274980
|
+
if (typeof assigner === "object" && assigner !== null) {
|
|
274981
|
+
const keys2 = Object.keys(assigner);
|
|
274982
|
+
keys2.forEach((key2) => {
|
|
274983
|
+
result[key2] = assigner[key2];
|
|
274984
|
+
});
|
|
274985
|
+
}
|
|
274986
|
+
}
|
|
274987
|
+
return obj;
|
|
274988
|
+
}
|
|
274989
|
+
static getBrowserAlias(browserName) {
|
|
274990
|
+
return BROWSER_ALIASES_MAP[browserName];
|
|
274991
|
+
}
|
|
274992
|
+
static getBrowserTypeByAlias(browserAlias) {
|
|
274993
|
+
return BROWSER_MAP[browserAlias] || "";
|
|
274994
|
+
}
|
|
274995
|
+
}
|
|
274996
|
+
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
|
274997
|
+
const browsersList = [
|
|
274998
|
+
{
|
|
274999
|
+
test: [/googlebot/i],
|
|
275000
|
+
describe(ua) {
|
|
275001
|
+
const browser2 = {
|
|
275002
|
+
name: "Googlebot"
|
|
275003
|
+
};
|
|
275004
|
+
const version2 = Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275005
|
+
if (version2) {
|
|
275006
|
+
browser2.version = version2;
|
|
275007
|
+
}
|
|
275008
|
+
return browser2;
|
|
275009
|
+
}
|
|
275010
|
+
},
|
|
275011
|
+
{
|
|
275012
|
+
test: [/opera/i],
|
|
275013
|
+
describe(ua) {
|
|
275014
|
+
const browser2 = {
|
|
275015
|
+
name: "Opera"
|
|
275016
|
+
};
|
|
275017
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275018
|
+
if (version2) {
|
|
275019
|
+
browser2.version = version2;
|
|
275020
|
+
}
|
|
275021
|
+
return browser2;
|
|
275022
|
+
}
|
|
275023
|
+
},
|
|
275024
|
+
{
|
|
275025
|
+
test: [/opr\/|opios/i],
|
|
275026
|
+
describe(ua) {
|
|
275027
|
+
const browser2 = {
|
|
275028
|
+
name: "Opera"
|
|
275029
|
+
};
|
|
275030
|
+
const version2 = Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275031
|
+
if (version2) {
|
|
275032
|
+
browser2.version = version2;
|
|
275033
|
+
}
|
|
275034
|
+
return browser2;
|
|
275035
|
+
}
|
|
275036
|
+
},
|
|
275037
|
+
{
|
|
275038
|
+
test: [/SamsungBrowser/i],
|
|
275039
|
+
describe(ua) {
|
|
275040
|
+
const browser2 = {
|
|
275041
|
+
name: "Samsung Internet for Android"
|
|
275042
|
+
};
|
|
275043
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275044
|
+
if (version2) {
|
|
275045
|
+
browser2.version = version2;
|
|
275046
|
+
}
|
|
275047
|
+
return browser2;
|
|
275048
|
+
}
|
|
275049
|
+
},
|
|
275050
|
+
{
|
|
275051
|
+
test: [/Whale/i],
|
|
275052
|
+
describe(ua) {
|
|
275053
|
+
const browser2 = {
|
|
275054
|
+
name: "NAVER Whale Browser"
|
|
275055
|
+
};
|
|
275056
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, ua);
|
|
275057
|
+
if (version2) {
|
|
275058
|
+
browser2.version = version2;
|
|
275059
|
+
}
|
|
275060
|
+
return browser2;
|
|
275061
|
+
}
|
|
275062
|
+
},
|
|
275063
|
+
{
|
|
275064
|
+
test: [/MZBrowser/i],
|
|
275065
|
+
describe(ua) {
|
|
275066
|
+
const browser2 = {
|
|
275067
|
+
name: "MZ Browser"
|
|
275068
|
+
};
|
|
275069
|
+
const version2 = Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275070
|
+
if (version2) {
|
|
275071
|
+
browser2.version = version2;
|
|
275072
|
+
}
|
|
275073
|
+
return browser2;
|
|
275074
|
+
}
|
|
275075
|
+
},
|
|
275076
|
+
{
|
|
275077
|
+
test: [/focus/i],
|
|
275078
|
+
describe(ua) {
|
|
275079
|
+
const browser2 = {
|
|
275080
|
+
name: "Focus"
|
|
275081
|
+
};
|
|
275082
|
+
const version2 = Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275083
|
+
if (version2) {
|
|
275084
|
+
browser2.version = version2;
|
|
275085
|
+
}
|
|
275086
|
+
return browser2;
|
|
275087
|
+
}
|
|
275088
|
+
},
|
|
275089
|
+
{
|
|
275090
|
+
test: [/swing/i],
|
|
275091
|
+
describe(ua) {
|
|
275092
|
+
const browser2 = {
|
|
275093
|
+
name: "Swing"
|
|
275094
|
+
};
|
|
275095
|
+
const version2 = Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275096
|
+
if (version2) {
|
|
275097
|
+
browser2.version = version2;
|
|
275098
|
+
}
|
|
275099
|
+
return browser2;
|
|
275100
|
+
}
|
|
275101
|
+
},
|
|
275102
|
+
{
|
|
275103
|
+
test: [/coast/i],
|
|
275104
|
+
describe(ua) {
|
|
275105
|
+
const browser2 = {
|
|
275106
|
+
name: "Opera Coast"
|
|
275107
|
+
};
|
|
275108
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275109
|
+
if (version2) {
|
|
275110
|
+
browser2.version = version2;
|
|
275111
|
+
}
|
|
275112
|
+
return browser2;
|
|
275113
|
+
}
|
|
275114
|
+
},
|
|
275115
|
+
{
|
|
275116
|
+
test: [/opt\/\d+(?:.?_?\d+)+/i],
|
|
275117
|
+
describe(ua) {
|
|
275118
|
+
const browser2 = {
|
|
275119
|
+
name: "Opera Touch"
|
|
275120
|
+
};
|
|
275121
|
+
const version2 = Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275122
|
+
if (version2) {
|
|
275123
|
+
browser2.version = version2;
|
|
275124
|
+
}
|
|
275125
|
+
return browser2;
|
|
275126
|
+
}
|
|
275127
|
+
},
|
|
275128
|
+
{
|
|
275129
|
+
test: [/yabrowser/i],
|
|
275130
|
+
describe(ua) {
|
|
275131
|
+
const browser2 = {
|
|
275132
|
+
name: "Yandex Browser"
|
|
275133
|
+
};
|
|
275134
|
+
const version2 = Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275135
|
+
if (version2) {
|
|
275136
|
+
browser2.version = version2;
|
|
275137
|
+
}
|
|
275138
|
+
return browser2;
|
|
275139
|
+
}
|
|
275140
|
+
},
|
|
275141
|
+
{
|
|
275142
|
+
test: [/ucbrowser/i],
|
|
275143
|
+
describe(ua) {
|
|
275144
|
+
const browser2 = {
|
|
275145
|
+
name: "UC Browser"
|
|
275146
|
+
};
|
|
275147
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275148
|
+
if (version2) {
|
|
275149
|
+
browser2.version = version2;
|
|
275150
|
+
}
|
|
275151
|
+
return browser2;
|
|
275152
|
+
}
|
|
275153
|
+
},
|
|
275154
|
+
{
|
|
275155
|
+
test: [/Maxthon|mxios/i],
|
|
275156
|
+
describe(ua) {
|
|
275157
|
+
const browser2 = {
|
|
275158
|
+
name: "Maxthon"
|
|
275159
|
+
};
|
|
275160
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275161
|
+
if (version2) {
|
|
275162
|
+
browser2.version = version2;
|
|
275163
|
+
}
|
|
275164
|
+
return browser2;
|
|
275165
|
+
}
|
|
275166
|
+
},
|
|
275167
|
+
{
|
|
275168
|
+
test: [/epiphany/i],
|
|
275169
|
+
describe(ua) {
|
|
275170
|
+
const browser2 = {
|
|
275171
|
+
name: "Epiphany"
|
|
275172
|
+
};
|
|
275173
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275174
|
+
if (version2) {
|
|
275175
|
+
browser2.version = version2;
|
|
275176
|
+
}
|
|
275177
|
+
return browser2;
|
|
275178
|
+
}
|
|
275179
|
+
},
|
|
275180
|
+
{
|
|
275181
|
+
test: [/puffin/i],
|
|
275182
|
+
describe(ua) {
|
|
275183
|
+
const browser2 = {
|
|
275184
|
+
name: "Puffin"
|
|
275185
|
+
};
|
|
275186
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275187
|
+
if (version2) {
|
|
275188
|
+
browser2.version = version2;
|
|
275189
|
+
}
|
|
275190
|
+
return browser2;
|
|
275191
|
+
}
|
|
275192
|
+
},
|
|
275193
|
+
{
|
|
275194
|
+
test: [/sleipnir/i],
|
|
275195
|
+
describe(ua) {
|
|
275196
|
+
const browser2 = {
|
|
275197
|
+
name: "Sleipnir"
|
|
275198
|
+
};
|
|
275199
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275200
|
+
if (version2) {
|
|
275201
|
+
browser2.version = version2;
|
|
275202
|
+
}
|
|
275203
|
+
return browser2;
|
|
275204
|
+
}
|
|
275205
|
+
},
|
|
275206
|
+
{
|
|
275207
|
+
test: [/k-meleon/i],
|
|
275208
|
+
describe(ua) {
|
|
275209
|
+
const browser2 = {
|
|
275210
|
+
name: "K-Meleon"
|
|
275211
|
+
};
|
|
275212
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275213
|
+
if (version2) {
|
|
275214
|
+
browser2.version = version2;
|
|
275215
|
+
}
|
|
275216
|
+
return browser2;
|
|
275217
|
+
}
|
|
275218
|
+
},
|
|
275219
|
+
{
|
|
275220
|
+
test: [/micromessenger/i],
|
|
275221
|
+
describe(ua) {
|
|
275222
|
+
const browser2 = {
|
|
275223
|
+
name: "WeChat"
|
|
275224
|
+
};
|
|
275225
|
+
const version2 = Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275226
|
+
if (version2) {
|
|
275227
|
+
browser2.version = version2;
|
|
275228
|
+
}
|
|
275229
|
+
return browser2;
|
|
275230
|
+
}
|
|
275231
|
+
},
|
|
275232
|
+
{
|
|
275233
|
+
test: [/qqbrowser/i],
|
|
275234
|
+
describe(ua) {
|
|
275235
|
+
const browser2 = {
|
|
275236
|
+
name: /qqbrowserlite/i.test(ua) ? "QQ Browser Lite" : "QQ Browser"
|
|
275237
|
+
};
|
|
275238
|
+
const version2 = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275239
|
+
if (version2) {
|
|
275240
|
+
browser2.version = version2;
|
|
275241
|
+
}
|
|
275242
|
+
return browser2;
|
|
275243
|
+
}
|
|
275244
|
+
},
|
|
275245
|
+
{
|
|
275246
|
+
test: [/msie|trident/i],
|
|
275247
|
+
describe(ua) {
|
|
275248
|
+
const browser2 = {
|
|
275249
|
+
name: "Internet Explorer"
|
|
275250
|
+
};
|
|
275251
|
+
const version2 = Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, ua);
|
|
275252
|
+
if (version2) {
|
|
275253
|
+
browser2.version = version2;
|
|
275254
|
+
}
|
|
275255
|
+
return browser2;
|
|
275256
|
+
}
|
|
275257
|
+
},
|
|
275258
|
+
{
|
|
275259
|
+
test: [/\sedg\//i],
|
|
275260
|
+
describe(ua) {
|
|
275261
|
+
const browser2 = {
|
|
275262
|
+
name: "Microsoft Edge"
|
|
275263
|
+
};
|
|
275264
|
+
const version2 = Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275265
|
+
if (version2) {
|
|
275266
|
+
browser2.version = version2;
|
|
275267
|
+
}
|
|
275268
|
+
return browser2;
|
|
275269
|
+
}
|
|
275270
|
+
},
|
|
275271
|
+
{
|
|
275272
|
+
test: [/edg([ea]|ios)/i],
|
|
275273
|
+
describe(ua) {
|
|
275274
|
+
const browser2 = {
|
|
275275
|
+
name: "Microsoft Edge"
|
|
275276
|
+
};
|
|
275277
|
+
const version2 = Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275278
|
+
if (version2) {
|
|
275279
|
+
browser2.version = version2;
|
|
275280
|
+
}
|
|
275281
|
+
return browser2;
|
|
275282
|
+
}
|
|
275283
|
+
},
|
|
275284
|
+
{
|
|
275285
|
+
test: [/vivaldi/i],
|
|
275286
|
+
describe(ua) {
|
|
275287
|
+
const browser2 = {
|
|
275288
|
+
name: "Vivaldi"
|
|
275289
|
+
};
|
|
275290
|
+
const version2 = Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275291
|
+
if (version2) {
|
|
275292
|
+
browser2.version = version2;
|
|
275293
|
+
}
|
|
275294
|
+
return browser2;
|
|
275295
|
+
}
|
|
275296
|
+
},
|
|
275297
|
+
{
|
|
275298
|
+
test: [/seamonkey/i],
|
|
275299
|
+
describe(ua) {
|
|
275300
|
+
const browser2 = {
|
|
275301
|
+
name: "SeaMonkey"
|
|
275302
|
+
};
|
|
275303
|
+
const version2 = Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275304
|
+
if (version2) {
|
|
275305
|
+
browser2.version = version2;
|
|
275306
|
+
}
|
|
275307
|
+
return browser2;
|
|
275308
|
+
}
|
|
275309
|
+
},
|
|
275310
|
+
{
|
|
275311
|
+
test: [/sailfish/i],
|
|
275312
|
+
describe(ua) {
|
|
275313
|
+
const browser2 = {
|
|
275314
|
+
name: "Sailfish"
|
|
275315
|
+
};
|
|
275316
|
+
const version2 = Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, ua);
|
|
275317
|
+
if (version2) {
|
|
275318
|
+
browser2.version = version2;
|
|
275319
|
+
}
|
|
275320
|
+
return browser2;
|
|
275321
|
+
}
|
|
275322
|
+
},
|
|
275323
|
+
{
|
|
275324
|
+
test: [/silk/i],
|
|
275325
|
+
describe(ua) {
|
|
275326
|
+
const browser2 = {
|
|
275327
|
+
name: "Amazon Silk"
|
|
275328
|
+
};
|
|
275329
|
+
const version2 = Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275330
|
+
if (version2) {
|
|
275331
|
+
browser2.version = version2;
|
|
275332
|
+
}
|
|
275333
|
+
return browser2;
|
|
275334
|
+
}
|
|
275335
|
+
},
|
|
275336
|
+
{
|
|
275337
|
+
test: [/phantom/i],
|
|
275338
|
+
describe(ua) {
|
|
275339
|
+
const browser2 = {
|
|
275340
|
+
name: "PhantomJS"
|
|
275341
|
+
};
|
|
275342
|
+
const version2 = Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275343
|
+
if (version2) {
|
|
275344
|
+
browser2.version = version2;
|
|
275345
|
+
}
|
|
275346
|
+
return browser2;
|
|
275347
|
+
}
|
|
275348
|
+
},
|
|
275349
|
+
{
|
|
275350
|
+
test: [/slimerjs/i],
|
|
275351
|
+
describe(ua) {
|
|
275352
|
+
const browser2 = {
|
|
275353
|
+
name: "SlimerJS"
|
|
275354
|
+
};
|
|
275355
|
+
const version2 = Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275356
|
+
if (version2) {
|
|
275357
|
+
browser2.version = version2;
|
|
275358
|
+
}
|
|
275359
|
+
return browser2;
|
|
275360
|
+
}
|
|
275361
|
+
},
|
|
275362
|
+
{
|
|
275363
|
+
test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
|
|
275364
|
+
describe(ua) {
|
|
275365
|
+
const browser2 = {
|
|
275366
|
+
name: "BlackBerry"
|
|
275367
|
+
};
|
|
275368
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275369
|
+
if (version2) {
|
|
275370
|
+
browser2.version = version2;
|
|
275371
|
+
}
|
|
275372
|
+
return browser2;
|
|
275373
|
+
}
|
|
275374
|
+
},
|
|
275375
|
+
{
|
|
275376
|
+
test: [/(web|hpw)[o0]s/i],
|
|
275377
|
+
describe(ua) {
|
|
275378
|
+
const browser2 = {
|
|
275379
|
+
name: "WebOS Browser"
|
|
275380
|
+
};
|
|
275381
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275382
|
+
if (version2) {
|
|
275383
|
+
browser2.version = version2;
|
|
275384
|
+
}
|
|
275385
|
+
return browser2;
|
|
275386
|
+
}
|
|
275387
|
+
},
|
|
275388
|
+
{
|
|
275389
|
+
test: [/bada/i],
|
|
275390
|
+
describe(ua) {
|
|
275391
|
+
const browser2 = {
|
|
275392
|
+
name: "Bada"
|
|
275393
|
+
};
|
|
275394
|
+
const version2 = Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275395
|
+
if (version2) {
|
|
275396
|
+
browser2.version = version2;
|
|
275397
|
+
}
|
|
275398
|
+
return browser2;
|
|
275399
|
+
}
|
|
275400
|
+
},
|
|
275401
|
+
{
|
|
275402
|
+
test: [/tizen/i],
|
|
275403
|
+
describe(ua) {
|
|
275404
|
+
const browser2 = {
|
|
275405
|
+
name: "Tizen"
|
|
275406
|
+
};
|
|
275407
|
+
const version2 = Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275408
|
+
if (version2) {
|
|
275409
|
+
browser2.version = version2;
|
|
275410
|
+
}
|
|
275411
|
+
return browser2;
|
|
275412
|
+
}
|
|
275413
|
+
},
|
|
275414
|
+
{
|
|
275415
|
+
test: [/qupzilla/i],
|
|
275416
|
+
describe(ua) {
|
|
275417
|
+
const browser2 = {
|
|
275418
|
+
name: "QupZilla"
|
|
275419
|
+
};
|
|
275420
|
+
const version2 = Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275421
|
+
if (version2) {
|
|
275422
|
+
browser2.version = version2;
|
|
275423
|
+
}
|
|
275424
|
+
return browser2;
|
|
275425
|
+
}
|
|
275426
|
+
},
|
|
275427
|
+
{
|
|
275428
|
+
test: [/firefox|iceweasel|fxios/i],
|
|
275429
|
+
describe(ua) {
|
|
275430
|
+
const browser2 = {
|
|
275431
|
+
name: "Firefox"
|
|
275432
|
+
};
|
|
275433
|
+
const version2 = Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275434
|
+
if (version2) {
|
|
275435
|
+
browser2.version = version2;
|
|
275436
|
+
}
|
|
275437
|
+
return browser2;
|
|
275438
|
+
}
|
|
275439
|
+
},
|
|
275440
|
+
{
|
|
275441
|
+
test: [/electron/i],
|
|
275442
|
+
describe(ua) {
|
|
275443
|
+
const browser2 = {
|
|
275444
|
+
name: "Electron"
|
|
275445
|
+
};
|
|
275446
|
+
const version2 = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275447
|
+
if (version2) {
|
|
275448
|
+
browser2.version = version2;
|
|
275449
|
+
}
|
|
275450
|
+
return browser2;
|
|
275451
|
+
}
|
|
275452
|
+
},
|
|
275453
|
+
{
|
|
275454
|
+
test: [/MiuiBrowser/i],
|
|
275455
|
+
describe(ua) {
|
|
275456
|
+
const browser2 = {
|
|
275457
|
+
name: "Miui"
|
|
275458
|
+
};
|
|
275459
|
+
const version2 = Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275460
|
+
if (version2) {
|
|
275461
|
+
browser2.version = version2;
|
|
275462
|
+
}
|
|
275463
|
+
return browser2;
|
|
275464
|
+
}
|
|
275465
|
+
},
|
|
275466
|
+
{
|
|
275467
|
+
test: [/chromium/i],
|
|
275468
|
+
describe(ua) {
|
|
275469
|
+
const browser2 = {
|
|
275470
|
+
name: "Chromium"
|
|
275471
|
+
};
|
|
275472
|
+
const version2 = Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275473
|
+
if (version2) {
|
|
275474
|
+
browser2.version = version2;
|
|
275475
|
+
}
|
|
275476
|
+
return browser2;
|
|
275477
|
+
}
|
|
275478
|
+
},
|
|
275479
|
+
{
|
|
275480
|
+
test: [/chrome|crios|crmo/i],
|
|
275481
|
+
describe(ua) {
|
|
275482
|
+
const browser2 = {
|
|
275483
|
+
name: "Chrome"
|
|
275484
|
+
};
|
|
275485
|
+
const version2 = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275486
|
+
if (version2) {
|
|
275487
|
+
browser2.version = version2;
|
|
275488
|
+
}
|
|
275489
|
+
return browser2;
|
|
275490
|
+
}
|
|
275491
|
+
},
|
|
275492
|
+
{
|
|
275493
|
+
test: [/GSA/i],
|
|
275494
|
+
describe(ua) {
|
|
275495
|
+
const browser2 = {
|
|
275496
|
+
name: "Google Search"
|
|
275497
|
+
};
|
|
275498
|
+
const version2 = Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275499
|
+
if (version2) {
|
|
275500
|
+
browser2.version = version2;
|
|
275501
|
+
}
|
|
275502
|
+
return browser2;
|
|
275503
|
+
}
|
|
275504
|
+
},
|
|
275505
|
+
{
|
|
275506
|
+
test(parser2) {
|
|
275507
|
+
const notLikeAndroid = !parser2.test(/like android/i);
|
|
275508
|
+
const butAndroid = parser2.test(/android/i);
|
|
275509
|
+
return notLikeAndroid && butAndroid;
|
|
275510
|
+
},
|
|
275511
|
+
describe(ua) {
|
|
275512
|
+
const browser2 = {
|
|
275513
|
+
name: "Android Browser"
|
|
275514
|
+
};
|
|
275515
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275516
|
+
if (version2) {
|
|
275517
|
+
browser2.version = version2;
|
|
275518
|
+
}
|
|
275519
|
+
return browser2;
|
|
275520
|
+
}
|
|
275521
|
+
},
|
|
275522
|
+
{
|
|
275523
|
+
test: [/playstation 4/i],
|
|
275524
|
+
describe(ua) {
|
|
275525
|
+
const browser2 = {
|
|
275526
|
+
name: "PlayStation 4"
|
|
275527
|
+
};
|
|
275528
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275529
|
+
if (version2) {
|
|
275530
|
+
browser2.version = version2;
|
|
275531
|
+
}
|
|
275532
|
+
return browser2;
|
|
275533
|
+
}
|
|
275534
|
+
},
|
|
275535
|
+
{
|
|
275536
|
+
test: [/safari|applewebkit/i],
|
|
275537
|
+
describe(ua) {
|
|
275538
|
+
const browser2 = {
|
|
275539
|
+
name: "Safari"
|
|
275540
|
+
};
|
|
275541
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275542
|
+
if (version2) {
|
|
275543
|
+
browser2.version = version2;
|
|
275544
|
+
}
|
|
275545
|
+
return browser2;
|
|
275546
|
+
}
|
|
275547
|
+
},
|
|
275548
|
+
{
|
|
275549
|
+
test: [/.*/i],
|
|
275550
|
+
describe(ua) {
|
|
275551
|
+
const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
|
|
275552
|
+
const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
|
|
275553
|
+
const hasDeviceSpec = ua.search("\\(") !== -1;
|
|
275554
|
+
const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;
|
|
275555
|
+
return {
|
|
275556
|
+
name: Utils.getFirstMatch(regexp, ua),
|
|
275557
|
+
version: Utils.getSecondMatch(regexp, ua)
|
|
275558
|
+
};
|
|
275559
|
+
}
|
|
275560
|
+
}
|
|
275561
|
+
];
|
|
275562
|
+
const osParsersList = [
|
|
275563
|
+
{
|
|
275564
|
+
test: [/Roku\/DVP/],
|
|
275565
|
+
describe(ua) {
|
|
275566
|
+
const version2 = Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, ua);
|
|
275567
|
+
return {
|
|
275568
|
+
name: OS_MAP.Roku,
|
|
275569
|
+
version: version2
|
|
275570
|
+
};
|
|
275571
|
+
}
|
|
275572
|
+
},
|
|
275573
|
+
{
|
|
275574
|
+
test: [/windows phone/i],
|
|
275575
|
+
describe(ua) {
|
|
275576
|
+
const version2 = Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, ua);
|
|
275577
|
+
return {
|
|
275578
|
+
name: OS_MAP.WindowsPhone,
|
|
275579
|
+
version: version2
|
|
275580
|
+
};
|
|
275581
|
+
}
|
|
275582
|
+
},
|
|
275583
|
+
{
|
|
275584
|
+
test: [/windows /i],
|
|
275585
|
+
describe(ua) {
|
|
275586
|
+
const version2 = Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua);
|
|
275587
|
+
const versionName = Utils.getWindowsVersionName(version2);
|
|
275588
|
+
return {
|
|
275589
|
+
name: OS_MAP.Windows,
|
|
275590
|
+
version: version2,
|
|
275591
|
+
versionName
|
|
275592
|
+
};
|
|
275593
|
+
}
|
|
275594
|
+
},
|
|
275595
|
+
{
|
|
275596
|
+
test: [/Macintosh(.*?) FxiOS(.*?)\//],
|
|
275597
|
+
describe(ua) {
|
|
275598
|
+
const result = {
|
|
275599
|
+
name: OS_MAP.iOS
|
|
275600
|
+
};
|
|
275601
|
+
const version2 = Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/, ua);
|
|
275602
|
+
if (version2) {
|
|
275603
|
+
result.version = version2;
|
|
275604
|
+
}
|
|
275605
|
+
return result;
|
|
275606
|
+
}
|
|
275607
|
+
},
|
|
275608
|
+
{
|
|
275609
|
+
test: [/macintosh/i],
|
|
275610
|
+
describe(ua) {
|
|
275611
|
+
const version2 = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, ".");
|
|
275612
|
+
const versionName = Utils.getMacOSVersionName(version2);
|
|
275613
|
+
const os = {
|
|
275614
|
+
name: OS_MAP.MacOS,
|
|
275615
|
+
version: version2
|
|
275616
|
+
};
|
|
275617
|
+
if (versionName) {
|
|
275618
|
+
os.versionName = versionName;
|
|
275619
|
+
}
|
|
275620
|
+
return os;
|
|
275621
|
+
}
|
|
275622
|
+
},
|
|
275623
|
+
{
|
|
275624
|
+
test: [/(ipod|iphone|ipad)/i],
|
|
275625
|
+
describe(ua) {
|
|
275626
|
+
const version2 = Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, ua).replace(/[_\s]/g, ".");
|
|
275627
|
+
return {
|
|
275628
|
+
name: OS_MAP.iOS,
|
|
275629
|
+
version: version2
|
|
275630
|
+
};
|
|
275631
|
+
}
|
|
275632
|
+
},
|
|
275633
|
+
{
|
|
275634
|
+
test(parser2) {
|
|
275635
|
+
const notLikeAndroid = !parser2.test(/like android/i);
|
|
275636
|
+
const butAndroid = parser2.test(/android/i);
|
|
275637
|
+
return notLikeAndroid && butAndroid;
|
|
275638
|
+
},
|
|
275639
|
+
describe(ua) {
|
|
275640
|
+
const version2 = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua);
|
|
275641
|
+
const versionName = Utils.getAndroidVersionName(version2);
|
|
275642
|
+
const os = {
|
|
275643
|
+
name: OS_MAP.Android,
|
|
275644
|
+
version: version2
|
|
275645
|
+
};
|
|
275646
|
+
if (versionName) {
|
|
275647
|
+
os.versionName = versionName;
|
|
275648
|
+
}
|
|
275649
|
+
return os;
|
|
275650
|
+
}
|
|
275651
|
+
},
|
|
275652
|
+
{
|
|
275653
|
+
test: [/(web|hpw)[o0]s/i],
|
|
275654
|
+
describe(ua) {
|
|
275655
|
+
const version2 = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua);
|
|
275656
|
+
const os = {
|
|
275657
|
+
name: OS_MAP.WebOS
|
|
275658
|
+
};
|
|
275659
|
+
if (version2 && version2.length) {
|
|
275660
|
+
os.version = version2;
|
|
275661
|
+
}
|
|
275662
|
+
return os;
|
|
275663
|
+
}
|
|
275664
|
+
},
|
|
275665
|
+
{
|
|
275666
|
+
test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
|
|
275667
|
+
describe(ua) {
|
|
275668
|
+
const version2 = Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, ua) || Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, ua) || Utils.getFirstMatch(/\bbb(\d+)/i, ua);
|
|
275669
|
+
return {
|
|
275670
|
+
name: OS_MAP.BlackBerry,
|
|
275671
|
+
version: version2
|
|
275672
|
+
};
|
|
275673
|
+
}
|
|
275674
|
+
},
|
|
275675
|
+
{
|
|
275676
|
+
test: [/bada/i],
|
|
275677
|
+
describe(ua) {
|
|
275678
|
+
const version2 = Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, ua);
|
|
275679
|
+
return {
|
|
275680
|
+
name: OS_MAP.Bada,
|
|
275681
|
+
version: version2
|
|
275682
|
+
};
|
|
275683
|
+
}
|
|
275684
|
+
},
|
|
275685
|
+
{
|
|
275686
|
+
test: [/tizen/i],
|
|
275687
|
+
describe(ua) {
|
|
275688
|
+
const version2 = Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, ua);
|
|
275689
|
+
return {
|
|
275690
|
+
name: OS_MAP.Tizen,
|
|
275691
|
+
version: version2
|
|
275692
|
+
};
|
|
275693
|
+
}
|
|
275694
|
+
},
|
|
275695
|
+
{
|
|
275696
|
+
test: [/linux/i],
|
|
275697
|
+
describe() {
|
|
275698
|
+
return {
|
|
275699
|
+
name: OS_MAP.Linux
|
|
275700
|
+
};
|
|
275701
|
+
}
|
|
275702
|
+
},
|
|
275703
|
+
{
|
|
275704
|
+
test: [/CrOS/],
|
|
275705
|
+
describe() {
|
|
275706
|
+
return {
|
|
275707
|
+
name: OS_MAP.ChromeOS
|
|
275708
|
+
};
|
|
275709
|
+
}
|
|
275710
|
+
},
|
|
275711
|
+
{
|
|
275712
|
+
test: [/PlayStation 4/],
|
|
275713
|
+
describe(ua) {
|
|
275714
|
+
const version2 = Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, ua);
|
|
275715
|
+
return {
|
|
275716
|
+
name: OS_MAP.PlayStation4,
|
|
275717
|
+
version: version2
|
|
275718
|
+
};
|
|
275719
|
+
}
|
|
275720
|
+
}
|
|
275721
|
+
];
|
|
275722
|
+
const platformParsersList = [
|
|
275723
|
+
{
|
|
275724
|
+
test: [/googlebot/i],
|
|
275725
|
+
describe() {
|
|
275726
|
+
return {
|
|
275727
|
+
type: "bot",
|
|
275728
|
+
vendor: "Google"
|
|
275729
|
+
};
|
|
275730
|
+
}
|
|
275731
|
+
},
|
|
275732
|
+
{
|
|
275733
|
+
test: [/huawei/i],
|
|
275734
|
+
describe(ua) {
|
|
275735
|
+
const model = Utils.getFirstMatch(/(can-l01)/i, ua) && "Nova";
|
|
275736
|
+
const platform = {
|
|
275737
|
+
type: PLATFORMS_MAP.mobile,
|
|
275738
|
+
vendor: "Huawei"
|
|
275739
|
+
};
|
|
275740
|
+
if (model) {
|
|
275741
|
+
platform.model = model;
|
|
275742
|
+
}
|
|
275743
|
+
return platform;
|
|
275744
|
+
}
|
|
275745
|
+
},
|
|
275746
|
+
{
|
|
275747
|
+
test: [/nexus\s*(?:7|8|9|10).*/i],
|
|
275748
|
+
describe() {
|
|
275749
|
+
return {
|
|
275750
|
+
type: PLATFORMS_MAP.tablet,
|
|
275751
|
+
vendor: "Nexus"
|
|
275752
|
+
};
|
|
275753
|
+
}
|
|
275754
|
+
},
|
|
275755
|
+
{
|
|
275756
|
+
test: [/ipad/i],
|
|
275757
|
+
describe() {
|
|
275758
|
+
return {
|
|
275759
|
+
type: PLATFORMS_MAP.tablet,
|
|
275760
|
+
vendor: "Apple",
|
|
275761
|
+
model: "iPad"
|
|
275762
|
+
};
|
|
275763
|
+
}
|
|
275764
|
+
},
|
|
275765
|
+
{
|
|
275766
|
+
test: [/Macintosh(.*?) FxiOS(.*?)\//],
|
|
275767
|
+
describe() {
|
|
275768
|
+
return {
|
|
275769
|
+
type: PLATFORMS_MAP.tablet,
|
|
275770
|
+
vendor: "Apple",
|
|
275771
|
+
model: "iPad"
|
|
275772
|
+
};
|
|
275773
|
+
}
|
|
275774
|
+
},
|
|
275775
|
+
{
|
|
275776
|
+
test: [/kftt build/i],
|
|
275777
|
+
describe() {
|
|
275778
|
+
return {
|
|
275779
|
+
type: PLATFORMS_MAP.tablet,
|
|
275780
|
+
vendor: "Amazon",
|
|
275781
|
+
model: "Kindle Fire HD 7"
|
|
275782
|
+
};
|
|
275783
|
+
}
|
|
275784
|
+
},
|
|
275785
|
+
{
|
|
275786
|
+
test: [/silk/i],
|
|
275787
|
+
describe() {
|
|
275788
|
+
return {
|
|
275789
|
+
type: PLATFORMS_MAP.tablet,
|
|
275790
|
+
vendor: "Amazon"
|
|
275791
|
+
};
|
|
275792
|
+
}
|
|
275793
|
+
},
|
|
275794
|
+
{
|
|
275795
|
+
test: [/tablet(?! pc)/i],
|
|
275796
|
+
describe() {
|
|
275797
|
+
return {
|
|
275798
|
+
type: PLATFORMS_MAP.tablet
|
|
275799
|
+
};
|
|
275800
|
+
}
|
|
275801
|
+
},
|
|
275802
|
+
{
|
|
275803
|
+
test(parser2) {
|
|
275804
|
+
const iDevice = parser2.test(/ipod|iphone/i);
|
|
275805
|
+
const likeIDevice = parser2.test(/like (ipod|iphone)/i);
|
|
275806
|
+
return iDevice && !likeIDevice;
|
|
275807
|
+
},
|
|
275808
|
+
describe(ua) {
|
|
275809
|
+
const model = Utils.getFirstMatch(/(ipod|iphone)/i, ua);
|
|
275810
|
+
return {
|
|
275811
|
+
type: PLATFORMS_MAP.mobile,
|
|
275812
|
+
vendor: "Apple",
|
|
275813
|
+
model
|
|
275814
|
+
};
|
|
275815
|
+
}
|
|
275816
|
+
},
|
|
275817
|
+
{
|
|
275818
|
+
test: [/nexus\s*[0-6].*/i, /galaxy nexus/i],
|
|
275819
|
+
describe() {
|
|
275820
|
+
return {
|
|
275821
|
+
type: PLATFORMS_MAP.mobile,
|
|
275822
|
+
vendor: "Nexus"
|
|
275823
|
+
};
|
|
275824
|
+
}
|
|
275825
|
+
},
|
|
275826
|
+
{
|
|
275827
|
+
test: [/[^-]mobi/i],
|
|
275828
|
+
describe() {
|
|
275829
|
+
return {
|
|
275830
|
+
type: PLATFORMS_MAP.mobile
|
|
275831
|
+
};
|
|
275832
|
+
}
|
|
275833
|
+
},
|
|
275834
|
+
{
|
|
275835
|
+
test(parser2) {
|
|
275836
|
+
return parser2.getBrowserName(true) === "blackberry";
|
|
275837
|
+
},
|
|
275838
|
+
describe() {
|
|
275839
|
+
return {
|
|
275840
|
+
type: PLATFORMS_MAP.mobile,
|
|
275841
|
+
vendor: "BlackBerry"
|
|
275842
|
+
};
|
|
275843
|
+
}
|
|
275844
|
+
},
|
|
275845
|
+
{
|
|
275846
|
+
test(parser2) {
|
|
275847
|
+
return parser2.getBrowserName(true) === "bada";
|
|
275848
|
+
},
|
|
275849
|
+
describe() {
|
|
275850
|
+
return {
|
|
275851
|
+
type: PLATFORMS_MAP.mobile
|
|
275852
|
+
};
|
|
275853
|
+
}
|
|
275854
|
+
},
|
|
275855
|
+
{
|
|
275856
|
+
test(parser2) {
|
|
275857
|
+
return parser2.getBrowserName() === "windows phone";
|
|
275858
|
+
},
|
|
275859
|
+
describe() {
|
|
275860
|
+
return {
|
|
275861
|
+
type: PLATFORMS_MAP.mobile,
|
|
275862
|
+
vendor: "Microsoft"
|
|
275863
|
+
};
|
|
275864
|
+
}
|
|
275865
|
+
},
|
|
275866
|
+
{
|
|
275867
|
+
test(parser2) {
|
|
275868
|
+
const osMajorVersion = Number(String(parser2.getOSVersion()).split(".")[0]);
|
|
275869
|
+
return parser2.getOSName(true) === "android" && osMajorVersion >= 3;
|
|
275870
|
+
},
|
|
275871
|
+
describe() {
|
|
275872
|
+
return {
|
|
275873
|
+
type: PLATFORMS_MAP.tablet
|
|
275874
|
+
};
|
|
275875
|
+
}
|
|
275876
|
+
},
|
|
275877
|
+
{
|
|
275878
|
+
test(parser2) {
|
|
275879
|
+
return parser2.getOSName(true) === "android";
|
|
275880
|
+
},
|
|
275881
|
+
describe() {
|
|
275882
|
+
return {
|
|
275883
|
+
type: PLATFORMS_MAP.mobile
|
|
275884
|
+
};
|
|
275885
|
+
}
|
|
275886
|
+
},
|
|
275887
|
+
{
|
|
275888
|
+
test(parser2) {
|
|
275889
|
+
return parser2.getOSName(true) === "macos";
|
|
275890
|
+
},
|
|
275891
|
+
describe() {
|
|
275892
|
+
return {
|
|
275893
|
+
type: PLATFORMS_MAP.desktop,
|
|
275894
|
+
vendor: "Apple"
|
|
275895
|
+
};
|
|
275896
|
+
}
|
|
275897
|
+
},
|
|
275898
|
+
{
|
|
275899
|
+
test(parser2) {
|
|
275900
|
+
return parser2.getOSName(true) === "windows";
|
|
275901
|
+
},
|
|
275902
|
+
describe() {
|
|
275903
|
+
return {
|
|
275904
|
+
type: PLATFORMS_MAP.desktop
|
|
275905
|
+
};
|
|
275906
|
+
}
|
|
275907
|
+
},
|
|
275908
|
+
{
|
|
275909
|
+
test(parser2) {
|
|
275910
|
+
return parser2.getOSName(true) === "linux";
|
|
275911
|
+
},
|
|
275912
|
+
describe() {
|
|
275913
|
+
return {
|
|
275914
|
+
type: PLATFORMS_MAP.desktop
|
|
275915
|
+
};
|
|
275916
|
+
}
|
|
275917
|
+
},
|
|
275918
|
+
{
|
|
275919
|
+
test(parser2) {
|
|
275920
|
+
return parser2.getOSName(true) === "playstation 4";
|
|
275921
|
+
},
|
|
275922
|
+
describe() {
|
|
275923
|
+
return {
|
|
275924
|
+
type: PLATFORMS_MAP.tv
|
|
275925
|
+
};
|
|
275926
|
+
}
|
|
275927
|
+
},
|
|
275928
|
+
{
|
|
275929
|
+
test(parser2) {
|
|
275930
|
+
return parser2.getOSName(true) === "roku";
|
|
275931
|
+
},
|
|
275932
|
+
describe() {
|
|
275933
|
+
return {
|
|
275934
|
+
type: PLATFORMS_MAP.tv
|
|
275935
|
+
};
|
|
275936
|
+
}
|
|
275937
|
+
}
|
|
275938
|
+
];
|
|
275939
|
+
const enginesParsersList = [
|
|
275940
|
+
{
|
|
275941
|
+
test(parser2) {
|
|
275942
|
+
return parser2.getBrowserName(true) === "microsoft edge";
|
|
275943
|
+
},
|
|
275944
|
+
describe(ua) {
|
|
275945
|
+
const isBlinkBased = /\sedg\//i.test(ua);
|
|
275946
|
+
if (isBlinkBased) {
|
|
275947
|
+
return {
|
|
275948
|
+
name: ENGINE_MAP.Blink
|
|
275949
|
+
};
|
|
275950
|
+
}
|
|
275951
|
+
const version2 = Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275952
|
+
return {
|
|
275953
|
+
name: ENGINE_MAP.EdgeHTML,
|
|
275954
|
+
version: version2
|
|
275955
|
+
};
|
|
275956
|
+
}
|
|
275957
|
+
},
|
|
275958
|
+
{
|
|
275959
|
+
test: [/trident/i],
|
|
275960
|
+
describe(ua) {
|
|
275961
|
+
const engine = {
|
|
275962
|
+
name: ENGINE_MAP.Trident
|
|
275963
|
+
};
|
|
275964
|
+
const version2 = Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275965
|
+
if (version2) {
|
|
275966
|
+
engine.version = version2;
|
|
275967
|
+
}
|
|
275968
|
+
return engine;
|
|
275969
|
+
}
|
|
275970
|
+
},
|
|
275971
|
+
{
|
|
275972
|
+
test(parser2) {
|
|
275973
|
+
return parser2.test(/presto/i);
|
|
275974
|
+
},
|
|
275975
|
+
describe(ua) {
|
|
275976
|
+
const engine = {
|
|
275977
|
+
name: ENGINE_MAP.Presto
|
|
275978
|
+
};
|
|
275979
|
+
const version2 = Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275980
|
+
if (version2) {
|
|
275981
|
+
engine.version = version2;
|
|
275982
|
+
}
|
|
275983
|
+
return engine;
|
|
275984
|
+
}
|
|
275985
|
+
},
|
|
275986
|
+
{
|
|
275987
|
+
test(parser2) {
|
|
275988
|
+
const isGecko = parser2.test(/gecko/i);
|
|
275989
|
+
const likeGecko = parser2.test(/like gecko/i);
|
|
275990
|
+
return isGecko && !likeGecko;
|
|
275991
|
+
},
|
|
275992
|
+
describe(ua) {
|
|
275993
|
+
const engine = {
|
|
275994
|
+
name: ENGINE_MAP.Gecko
|
|
275995
|
+
};
|
|
275996
|
+
const version2 = Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275997
|
+
if (version2) {
|
|
275998
|
+
engine.version = version2;
|
|
275999
|
+
}
|
|
276000
|
+
return engine;
|
|
276001
|
+
}
|
|
276002
|
+
},
|
|
276003
|
+
{
|
|
276004
|
+
test: [/(apple)?webkit\/537\.36/i],
|
|
276005
|
+
describe() {
|
|
276006
|
+
return {
|
|
276007
|
+
name: ENGINE_MAP.Blink
|
|
276008
|
+
};
|
|
276009
|
+
}
|
|
276010
|
+
},
|
|
276011
|
+
{
|
|
276012
|
+
test: [/(apple)?webkit/i],
|
|
276013
|
+
describe(ua) {
|
|
276014
|
+
const engine = {
|
|
276015
|
+
name: ENGINE_MAP.WebKit
|
|
276016
|
+
};
|
|
276017
|
+
const version2 = Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, ua);
|
|
276018
|
+
if (version2) {
|
|
276019
|
+
engine.version = version2;
|
|
276020
|
+
}
|
|
276021
|
+
return engine;
|
|
276022
|
+
}
|
|
276023
|
+
}
|
|
276024
|
+
];
|
|
276025
|
+
class Parser {
|
|
276026
|
+
constructor(UA, skipParsing = false) {
|
|
276027
|
+
if (UA === void 0 || UA === null || UA === "") {
|
|
276028
|
+
throw new Error("UserAgent parameter can't be empty");
|
|
276029
|
+
}
|
|
276030
|
+
this._ua = UA;
|
|
276031
|
+
this.parsedResult = {};
|
|
276032
|
+
if (skipParsing !== true) {
|
|
276033
|
+
this.parse();
|
|
276034
|
+
}
|
|
276035
|
+
}
|
|
276036
|
+
getUA() {
|
|
276037
|
+
return this._ua;
|
|
276038
|
+
}
|
|
276039
|
+
test(regex2) {
|
|
276040
|
+
return regex2.test(this._ua);
|
|
276041
|
+
}
|
|
276042
|
+
parseBrowser() {
|
|
276043
|
+
this.parsedResult.browser = {};
|
|
276044
|
+
const browserDescriptor = Utils.find(browsersList, (_browser) => {
|
|
276045
|
+
if (typeof _browser.test === "function") {
|
|
276046
|
+
return _browser.test(this);
|
|
276047
|
+
}
|
|
276048
|
+
if (_browser.test instanceof Array) {
|
|
276049
|
+
return _browser.test.some((condition) => this.test(condition));
|
|
276050
|
+
}
|
|
276051
|
+
throw new Error("Browser's test function is not valid");
|
|
276052
|
+
});
|
|
276053
|
+
if (browserDescriptor) {
|
|
276054
|
+
this.parsedResult.browser = browserDescriptor.describe(this.getUA());
|
|
276055
|
+
}
|
|
276056
|
+
return this.parsedResult.browser;
|
|
276057
|
+
}
|
|
276058
|
+
getBrowser() {
|
|
276059
|
+
if (this.parsedResult.browser) {
|
|
276060
|
+
return this.parsedResult.browser;
|
|
276061
|
+
}
|
|
276062
|
+
return this.parseBrowser();
|
|
276063
|
+
}
|
|
276064
|
+
getBrowserName(toLowerCase) {
|
|
276065
|
+
if (toLowerCase) {
|
|
276066
|
+
return String(this.getBrowser().name).toLowerCase() || "";
|
|
276067
|
+
}
|
|
276068
|
+
return this.getBrowser().name || "";
|
|
276069
|
+
}
|
|
276070
|
+
getBrowserVersion() {
|
|
276071
|
+
return this.getBrowser().version;
|
|
276072
|
+
}
|
|
276073
|
+
getOS() {
|
|
276074
|
+
if (this.parsedResult.os) {
|
|
276075
|
+
return this.parsedResult.os;
|
|
276076
|
+
}
|
|
276077
|
+
return this.parseOS();
|
|
276078
|
+
}
|
|
276079
|
+
parseOS() {
|
|
276080
|
+
this.parsedResult.os = {};
|
|
276081
|
+
const os = Utils.find(osParsersList, (_os) => {
|
|
276082
|
+
if (typeof _os.test === "function") {
|
|
276083
|
+
return _os.test(this);
|
|
276084
|
+
}
|
|
276085
|
+
if (_os.test instanceof Array) {
|
|
276086
|
+
return _os.test.some((condition) => this.test(condition));
|
|
276087
|
+
}
|
|
276088
|
+
throw new Error("Browser's test function is not valid");
|
|
276089
|
+
});
|
|
276090
|
+
if (os) {
|
|
276091
|
+
this.parsedResult.os = os.describe(this.getUA());
|
|
276092
|
+
}
|
|
276093
|
+
return this.parsedResult.os;
|
|
276094
|
+
}
|
|
276095
|
+
getOSName(toLowerCase) {
|
|
276096
|
+
const { name: name2 } = this.getOS();
|
|
276097
|
+
if (toLowerCase) {
|
|
276098
|
+
return String(name2).toLowerCase() || "";
|
|
276099
|
+
}
|
|
276100
|
+
return name2 || "";
|
|
276101
|
+
}
|
|
276102
|
+
getOSVersion() {
|
|
276103
|
+
return this.getOS().version;
|
|
276104
|
+
}
|
|
276105
|
+
getPlatform() {
|
|
276106
|
+
if (this.parsedResult.platform) {
|
|
276107
|
+
return this.parsedResult.platform;
|
|
276108
|
+
}
|
|
276109
|
+
return this.parsePlatform();
|
|
276110
|
+
}
|
|
276111
|
+
getPlatformType(toLowerCase = false) {
|
|
276112
|
+
const { type: type2 } = this.getPlatform();
|
|
276113
|
+
if (toLowerCase) {
|
|
276114
|
+
return String(type2).toLowerCase() || "";
|
|
276115
|
+
}
|
|
276116
|
+
return type2 || "";
|
|
276117
|
+
}
|
|
276118
|
+
parsePlatform() {
|
|
276119
|
+
this.parsedResult.platform = {};
|
|
276120
|
+
const platform = Utils.find(platformParsersList, (_platform) => {
|
|
276121
|
+
if (typeof _platform.test === "function") {
|
|
276122
|
+
return _platform.test(this);
|
|
276123
|
+
}
|
|
276124
|
+
if (_platform.test instanceof Array) {
|
|
276125
|
+
return _platform.test.some((condition) => this.test(condition));
|
|
276126
|
+
}
|
|
276127
|
+
throw new Error("Browser's test function is not valid");
|
|
276128
|
+
});
|
|
276129
|
+
if (platform) {
|
|
276130
|
+
this.parsedResult.platform = platform.describe(this.getUA());
|
|
276131
|
+
}
|
|
276132
|
+
return this.parsedResult.platform;
|
|
276133
|
+
}
|
|
276134
|
+
getEngine() {
|
|
276135
|
+
if (this.parsedResult.engine) {
|
|
276136
|
+
return this.parsedResult.engine;
|
|
276137
|
+
}
|
|
276138
|
+
return this.parseEngine();
|
|
276139
|
+
}
|
|
276140
|
+
getEngineName(toLowerCase) {
|
|
276141
|
+
if (toLowerCase) {
|
|
276142
|
+
return String(this.getEngine().name).toLowerCase() || "";
|
|
276143
|
+
}
|
|
276144
|
+
return this.getEngine().name || "";
|
|
276145
|
+
}
|
|
276146
|
+
parseEngine() {
|
|
276147
|
+
this.parsedResult.engine = {};
|
|
276148
|
+
const engine = Utils.find(enginesParsersList, (_engine) => {
|
|
276149
|
+
if (typeof _engine.test === "function") {
|
|
276150
|
+
return _engine.test(this);
|
|
276151
|
+
}
|
|
276152
|
+
if (_engine.test instanceof Array) {
|
|
276153
|
+
return _engine.test.some((condition) => this.test(condition));
|
|
276154
|
+
}
|
|
276155
|
+
throw new Error("Browser's test function is not valid");
|
|
276156
|
+
});
|
|
276157
|
+
if (engine) {
|
|
276158
|
+
this.parsedResult.engine = engine.describe(this.getUA());
|
|
276159
|
+
}
|
|
276160
|
+
return this.parsedResult.engine;
|
|
276161
|
+
}
|
|
276162
|
+
parse() {
|
|
276163
|
+
this.parseBrowser();
|
|
276164
|
+
this.parseOS();
|
|
276165
|
+
this.parsePlatform();
|
|
276166
|
+
this.parseEngine();
|
|
276167
|
+
return this;
|
|
276168
|
+
}
|
|
276169
|
+
getResult() {
|
|
276170
|
+
return Utils.assign({}, this.parsedResult);
|
|
276171
|
+
}
|
|
276172
|
+
satisfies(checkTree) {
|
|
276173
|
+
const platformsAndOSes = {};
|
|
276174
|
+
let platformsAndOSCounter = 0;
|
|
276175
|
+
const browsers = {};
|
|
276176
|
+
let browsersCounter = 0;
|
|
276177
|
+
const allDefinitions = Object.keys(checkTree);
|
|
276178
|
+
allDefinitions.forEach((key2) => {
|
|
276179
|
+
const currentDefinition = checkTree[key2];
|
|
276180
|
+
if (typeof currentDefinition === "string") {
|
|
276181
|
+
browsers[key2] = currentDefinition;
|
|
276182
|
+
browsersCounter += 1;
|
|
276183
|
+
} else if (typeof currentDefinition === "object") {
|
|
276184
|
+
platformsAndOSes[key2] = currentDefinition;
|
|
276185
|
+
platformsAndOSCounter += 1;
|
|
276186
|
+
}
|
|
276187
|
+
});
|
|
276188
|
+
if (platformsAndOSCounter > 0) {
|
|
276189
|
+
const platformsAndOSNames = Object.keys(platformsAndOSes);
|
|
276190
|
+
const OSMatchingDefinition = Utils.find(platformsAndOSNames, (name2) => this.isOS(name2));
|
|
276191
|
+
if (OSMatchingDefinition) {
|
|
276192
|
+
const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]);
|
|
276193
|
+
if (osResult !== void 0) {
|
|
276194
|
+
return osResult;
|
|
276195
|
+
}
|
|
276196
|
+
}
|
|
276197
|
+
const platformMatchingDefinition = Utils.find(
|
|
276198
|
+
platformsAndOSNames,
|
|
276199
|
+
(name2) => this.isPlatform(name2)
|
|
276200
|
+
);
|
|
276201
|
+
if (platformMatchingDefinition) {
|
|
276202
|
+
const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);
|
|
276203
|
+
if (platformResult !== void 0) {
|
|
276204
|
+
return platformResult;
|
|
276205
|
+
}
|
|
276206
|
+
}
|
|
276207
|
+
}
|
|
276208
|
+
if (browsersCounter > 0) {
|
|
276209
|
+
const browserNames = Object.keys(browsers);
|
|
276210
|
+
const matchingDefinition = Utils.find(browserNames, (name2) => this.isBrowser(name2, true));
|
|
276211
|
+
if (matchingDefinition !== void 0) {
|
|
276212
|
+
return this.compareVersion(browsers[matchingDefinition]);
|
|
276213
|
+
}
|
|
276214
|
+
}
|
|
276215
|
+
return void 0;
|
|
276216
|
+
}
|
|
276217
|
+
isBrowser(browserName, includingAlias = false) {
|
|
276218
|
+
const defaultBrowserName = this.getBrowserName().toLowerCase();
|
|
276219
|
+
let browserNameLower = browserName.toLowerCase();
|
|
276220
|
+
const alias = Utils.getBrowserTypeByAlias(browserNameLower);
|
|
276221
|
+
if (includingAlias && alias) {
|
|
276222
|
+
browserNameLower = alias.toLowerCase();
|
|
276223
|
+
}
|
|
276224
|
+
return browserNameLower === defaultBrowserName;
|
|
276225
|
+
}
|
|
276226
|
+
compareVersion(version2) {
|
|
276227
|
+
let expectedResults = [0];
|
|
276228
|
+
let comparableVersion = version2;
|
|
276229
|
+
let isLoose = false;
|
|
276230
|
+
const currentBrowserVersion = this.getBrowserVersion();
|
|
276231
|
+
if (typeof currentBrowserVersion !== "string") {
|
|
276232
|
+
return void 0;
|
|
276233
|
+
}
|
|
276234
|
+
if (version2[0] === ">" || version2[0] === "<") {
|
|
276235
|
+
comparableVersion = version2.substr(1);
|
|
276236
|
+
if (version2[1] === "=") {
|
|
276237
|
+
isLoose = true;
|
|
276238
|
+
comparableVersion = version2.substr(2);
|
|
276239
|
+
} else {
|
|
276240
|
+
expectedResults = [];
|
|
276241
|
+
}
|
|
276242
|
+
if (version2[0] === ">") {
|
|
276243
|
+
expectedResults.push(1);
|
|
276244
|
+
} else {
|
|
276245
|
+
expectedResults.push(-1);
|
|
276246
|
+
}
|
|
276247
|
+
} else if (version2[0] === "=") {
|
|
276248
|
+
comparableVersion = version2.substr(1);
|
|
276249
|
+
} else if (version2[0] === "~") {
|
|
276250
|
+
isLoose = true;
|
|
276251
|
+
comparableVersion = version2.substr(1);
|
|
276252
|
+
}
|
|
276253
|
+
return expectedResults.indexOf(
|
|
276254
|
+
Utils.compareVersions(currentBrowserVersion, comparableVersion, isLoose)
|
|
276255
|
+
) > -1;
|
|
276256
|
+
}
|
|
276257
|
+
isOS(osName) {
|
|
276258
|
+
return this.getOSName(true) === String(osName).toLowerCase();
|
|
276259
|
+
}
|
|
276260
|
+
isPlatform(platformType) {
|
|
276261
|
+
return this.getPlatformType(true) === String(platformType).toLowerCase();
|
|
276262
|
+
}
|
|
276263
|
+
isEngine(engineName) {
|
|
276264
|
+
return this.getEngineName(true) === String(engineName).toLowerCase();
|
|
276265
|
+
}
|
|
276266
|
+
is(anything, includingAlias = false) {
|
|
276267
|
+
return this.isBrowser(anything, includingAlias) || this.isOS(anything) || this.isPlatform(anything);
|
|
276268
|
+
}
|
|
276269
|
+
some(anythings = []) {
|
|
276270
|
+
return anythings.some((anything) => this.is(anything));
|
|
276271
|
+
}
|
|
276272
|
+
}
|
|
276273
|
+
/*!
|
|
276274
|
+
* Bowser - a browser detector
|
|
276275
|
+
* https://github.com/lancedikson/bowser
|
|
276276
|
+
* MIT License | (c) Dustin Diaz 2012-2015
|
|
276277
|
+
* MIT License | (c) Denis Demchenko 2015-2019
|
|
276278
|
+
*/
|
|
276279
|
+
class Bowser {
|
|
276280
|
+
static getParser(UA, skipParsing = false) {
|
|
276281
|
+
if (typeof UA !== "string") {
|
|
276282
|
+
throw new Error("UserAgent should be a string");
|
|
276283
|
+
}
|
|
276284
|
+
return new Parser(UA, skipParsing);
|
|
276285
|
+
}
|
|
276286
|
+
static parse(UA) {
|
|
276287
|
+
return new Parser(UA).getResult();
|
|
276288
|
+
}
|
|
276289
|
+
static get BROWSER_MAP() {
|
|
276290
|
+
return BROWSER_MAP;
|
|
276291
|
+
}
|
|
276292
|
+
static get ENGINE_MAP() {
|
|
276293
|
+
return ENGINE_MAP;
|
|
276294
|
+
}
|
|
276295
|
+
static get OS_MAP() {
|
|
276296
|
+
return OS_MAP;
|
|
276297
|
+
}
|
|
276298
|
+
static get PLATFORMS_MAP() {
|
|
276299
|
+
return PLATFORMS_MAP;
|
|
276300
|
+
}
|
|
276301
|
+
}
|
|
276302
|
+
var lzString = { exports: {} };
|
|
276303
|
+
(function(module3) {
|
|
276304
|
+
var LZString = function() {
|
|
276305
|
+
var f2 = String.fromCharCode;
|
|
276306
|
+
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
276307
|
+
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
276308
|
+
var baseReverseDic = {};
|
|
276309
|
+
function getBaseValue(alphabet, character) {
|
|
276310
|
+
if (!baseReverseDic[alphabet]) {
|
|
276311
|
+
baseReverseDic[alphabet] = {};
|
|
276312
|
+
for (var i2 = 0; i2 < alphabet.length; i2++) {
|
|
276313
|
+
baseReverseDic[alphabet][alphabet.charAt(i2)] = i2;
|
|
276314
|
+
}
|
|
276315
|
+
}
|
|
276316
|
+
return baseReverseDic[alphabet][character];
|
|
276317
|
+
}
|
|
276318
|
+
var LZString2 = {
|
|
276319
|
+
compressToBase64: function(input) {
|
|
276320
|
+
if (input == null)
|
|
276321
|
+
return "";
|
|
276322
|
+
var res = LZString2._compress(input, 6, function(a2) {
|
|
276323
|
+
return keyStrBase64.charAt(a2);
|
|
276324
|
+
});
|
|
276325
|
+
switch (res.length % 4) {
|
|
276326
|
+
default:
|
|
276327
|
+
case 0:
|
|
276328
|
+
return res;
|
|
276329
|
+
case 1:
|
|
276330
|
+
return res + "===";
|
|
276331
|
+
case 2:
|
|
276332
|
+
return res + "==";
|
|
276333
|
+
case 3:
|
|
276334
|
+
return res + "=";
|
|
276335
|
+
}
|
|
276336
|
+
},
|
|
276337
|
+
decompressFromBase64: function(input) {
|
|
276338
|
+
if (input == null)
|
|
276339
|
+
return "";
|
|
276340
|
+
if (input == "")
|
|
276341
|
+
return null;
|
|
276342
|
+
return LZString2._decompress(input.length, 32, function(index2) {
|
|
276343
|
+
return getBaseValue(keyStrBase64, input.charAt(index2));
|
|
276344
|
+
});
|
|
276345
|
+
},
|
|
276346
|
+
compressToUTF16: function(input) {
|
|
276347
|
+
if (input == null)
|
|
276348
|
+
return "";
|
|
276349
|
+
return LZString2._compress(input, 15, function(a2) {
|
|
276350
|
+
return f2(a2 + 32);
|
|
276351
|
+
}) + " ";
|
|
276352
|
+
},
|
|
276353
|
+
decompressFromUTF16: function(compressed) {
|
|
276354
|
+
if (compressed == null)
|
|
276355
|
+
return "";
|
|
276356
|
+
if (compressed == "")
|
|
276357
|
+
return null;
|
|
276358
|
+
return LZString2._decompress(compressed.length, 16384, function(index2) {
|
|
276359
|
+
return compressed.charCodeAt(index2) - 32;
|
|
276360
|
+
});
|
|
276361
|
+
},
|
|
276362
|
+
compressToUint8Array: function(uncompressed) {
|
|
276363
|
+
var compressed = LZString2.compress(uncompressed);
|
|
276364
|
+
var buf = new Uint8Array(compressed.length * 2);
|
|
276365
|
+
for (var i2 = 0, TotalLen = compressed.length; i2 < TotalLen; i2++) {
|
|
276366
|
+
var current_value = compressed.charCodeAt(i2);
|
|
276367
|
+
buf[i2 * 2] = current_value >>> 8;
|
|
276368
|
+
buf[i2 * 2 + 1] = current_value % 256;
|
|
276369
|
+
}
|
|
276370
|
+
return buf;
|
|
276371
|
+
},
|
|
276372
|
+
decompressFromUint8Array: function(compressed) {
|
|
276373
|
+
if (compressed === null || compressed === void 0) {
|
|
276374
|
+
return LZString2.decompress(compressed);
|
|
276375
|
+
} else {
|
|
276376
|
+
var buf = new Array(compressed.length / 2);
|
|
276377
|
+
for (var i2 = 0, TotalLen = buf.length; i2 < TotalLen; i2++) {
|
|
276378
|
+
buf[i2] = compressed[i2 * 2] * 256 + compressed[i2 * 2 + 1];
|
|
276379
|
+
}
|
|
276380
|
+
var result = [];
|
|
276381
|
+
buf.forEach(function(c2) {
|
|
276382
|
+
result.push(f2(c2));
|
|
276383
|
+
});
|
|
276384
|
+
return LZString2.decompress(result.join(""));
|
|
276385
|
+
}
|
|
276386
|
+
},
|
|
276387
|
+
compressToEncodedURIComponent: function(input) {
|
|
276388
|
+
if (input == null)
|
|
276389
|
+
return "";
|
|
276390
|
+
return LZString2._compress(input, 6, function(a2) {
|
|
276391
|
+
return keyStrUriSafe.charAt(a2);
|
|
276392
|
+
});
|
|
276393
|
+
},
|
|
276394
|
+
decompressFromEncodedURIComponent: function(input) {
|
|
276395
|
+
if (input == null)
|
|
276396
|
+
return "";
|
|
276397
|
+
if (input == "")
|
|
276398
|
+
return null;
|
|
276399
|
+
input = input.replace(/ /g, "+");
|
|
276400
|
+
return LZString2._decompress(input.length, 32, function(index2) {
|
|
276401
|
+
return getBaseValue(keyStrUriSafe, input.charAt(index2));
|
|
276402
|
+
});
|
|
276403
|
+
},
|
|
276404
|
+
compress: function(uncompressed) {
|
|
276405
|
+
return LZString2._compress(uncompressed, 16, function(a2) {
|
|
276406
|
+
return f2(a2);
|
|
276407
|
+
});
|
|
276408
|
+
},
|
|
276409
|
+
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
276410
|
+
if (uncompressed == null)
|
|
276411
|
+
return "";
|
|
276412
|
+
var i2, value2, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii;
|
|
276413
|
+
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
276414
|
+
context_c = uncompressed.charAt(ii);
|
|
276415
|
+
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
276416
|
+
context_dictionary[context_c] = context_dictSize++;
|
|
276417
|
+
context_dictionaryToCreate[context_c] = true;
|
|
276418
|
+
}
|
|
276419
|
+
context_wc = context_w + context_c;
|
|
276420
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {
|
|
276421
|
+
context_w = context_wc;
|
|
276422
|
+
} else {
|
|
276423
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
276424
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
276425
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276426
|
+
context_data_val = context_data_val << 1;
|
|
276427
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276428
|
+
context_data_position = 0;
|
|
276429
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276430
|
+
context_data_val = 0;
|
|
276431
|
+
} else {
|
|
276432
|
+
context_data_position++;
|
|
276433
|
+
}
|
|
276434
|
+
}
|
|
276435
|
+
value2 = context_w.charCodeAt(0);
|
|
276436
|
+
for (i2 = 0; i2 < 8; i2++) {
|
|
276437
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276438
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276439
|
+
context_data_position = 0;
|
|
276440
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276441
|
+
context_data_val = 0;
|
|
276442
|
+
} else {
|
|
276443
|
+
context_data_position++;
|
|
276444
|
+
}
|
|
276445
|
+
value2 = value2 >> 1;
|
|
276446
|
+
}
|
|
276447
|
+
} else {
|
|
276448
|
+
value2 = 1;
|
|
276449
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276450
|
+
context_data_val = context_data_val << 1 | value2;
|
|
276451
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276452
|
+
context_data_position = 0;
|
|
276453
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276454
|
+
context_data_val = 0;
|
|
276455
|
+
} else {
|
|
276456
|
+
context_data_position++;
|
|
276457
|
+
}
|
|
276458
|
+
value2 = 0;
|
|
276459
|
+
}
|
|
276460
|
+
value2 = context_w.charCodeAt(0);
|
|
276461
|
+
for (i2 = 0; i2 < 16; i2++) {
|
|
276462
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276463
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276464
|
+
context_data_position = 0;
|
|
276465
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276466
|
+
context_data_val = 0;
|
|
276467
|
+
} else {
|
|
276468
|
+
context_data_position++;
|
|
276469
|
+
}
|
|
276470
|
+
value2 = value2 >> 1;
|
|
276471
|
+
}
|
|
276472
|
+
}
|
|
276473
|
+
context_enlargeIn--;
|
|
276474
|
+
if (context_enlargeIn == 0) {
|
|
276475
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276476
|
+
context_numBits++;
|
|
276477
|
+
}
|
|
276478
|
+
delete context_dictionaryToCreate[context_w];
|
|
276479
|
+
} else {
|
|
276480
|
+
value2 = context_dictionary[context_w];
|
|
276481
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276482
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276483
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276484
|
+
context_data_position = 0;
|
|
276485
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276486
|
+
context_data_val = 0;
|
|
276487
|
+
} else {
|
|
276488
|
+
context_data_position++;
|
|
276489
|
+
}
|
|
276490
|
+
value2 = value2 >> 1;
|
|
276491
|
+
}
|
|
276492
|
+
}
|
|
276493
|
+
context_enlargeIn--;
|
|
276494
|
+
if (context_enlargeIn == 0) {
|
|
276495
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276496
|
+
context_numBits++;
|
|
276497
|
+
}
|
|
276498
|
+
context_dictionary[context_wc] = context_dictSize++;
|
|
276499
|
+
context_w = String(context_c);
|
|
276500
|
+
}
|
|
276501
|
+
}
|
|
276502
|
+
if (context_w !== "") {
|
|
276503
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
276504
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
276505
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276506
|
+
context_data_val = context_data_val << 1;
|
|
276507
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276508
|
+
context_data_position = 0;
|
|
276509
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276510
|
+
context_data_val = 0;
|
|
276511
|
+
} else {
|
|
276512
|
+
context_data_position++;
|
|
276513
|
+
}
|
|
276514
|
+
}
|
|
276515
|
+
value2 = context_w.charCodeAt(0);
|
|
276516
|
+
for (i2 = 0; i2 < 8; i2++) {
|
|
276517
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276518
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276519
|
+
context_data_position = 0;
|
|
276520
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276521
|
+
context_data_val = 0;
|
|
276522
|
+
} else {
|
|
276523
|
+
context_data_position++;
|
|
276524
|
+
}
|
|
276525
|
+
value2 = value2 >> 1;
|
|
276526
|
+
}
|
|
276527
|
+
} else {
|
|
276528
|
+
value2 = 1;
|
|
276529
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276530
|
+
context_data_val = context_data_val << 1 | value2;
|
|
276531
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276532
|
+
context_data_position = 0;
|
|
276533
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276534
|
+
context_data_val = 0;
|
|
276535
|
+
} else {
|
|
276536
|
+
context_data_position++;
|
|
276537
|
+
}
|
|
276538
|
+
value2 = 0;
|
|
276539
|
+
}
|
|
276540
|
+
value2 = context_w.charCodeAt(0);
|
|
276541
|
+
for (i2 = 0; i2 < 16; i2++) {
|
|
276542
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276543
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276544
|
+
context_data_position = 0;
|
|
276545
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276546
|
+
context_data_val = 0;
|
|
276547
|
+
} else {
|
|
276548
|
+
context_data_position++;
|
|
276549
|
+
}
|
|
276550
|
+
value2 = value2 >> 1;
|
|
276551
|
+
}
|
|
276552
|
+
}
|
|
276553
|
+
context_enlargeIn--;
|
|
276554
|
+
if (context_enlargeIn == 0) {
|
|
276555
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276556
|
+
context_numBits++;
|
|
276557
|
+
}
|
|
276558
|
+
delete context_dictionaryToCreate[context_w];
|
|
276559
|
+
} else {
|
|
276560
|
+
value2 = context_dictionary[context_w];
|
|
276561
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276562
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276563
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276564
|
+
context_data_position = 0;
|
|
276565
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276566
|
+
context_data_val = 0;
|
|
276567
|
+
} else {
|
|
276568
|
+
context_data_position++;
|
|
276569
|
+
}
|
|
276570
|
+
value2 = value2 >> 1;
|
|
276571
|
+
}
|
|
276572
|
+
}
|
|
276573
|
+
context_enlargeIn--;
|
|
276574
|
+
if (context_enlargeIn == 0) {
|
|
276575
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276576
|
+
context_numBits++;
|
|
276577
|
+
}
|
|
276578
|
+
}
|
|
276579
|
+
value2 = 2;
|
|
276580
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276581
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276582
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276583
|
+
context_data_position = 0;
|
|
276584
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276585
|
+
context_data_val = 0;
|
|
276586
|
+
} else {
|
|
276587
|
+
context_data_position++;
|
|
276588
|
+
}
|
|
276589
|
+
value2 = value2 >> 1;
|
|
276590
|
+
}
|
|
276591
|
+
while (true) {
|
|
276592
|
+
context_data_val = context_data_val << 1;
|
|
276593
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276594
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276595
|
+
break;
|
|
276596
|
+
} else
|
|
276597
|
+
context_data_position++;
|
|
276598
|
+
}
|
|
276599
|
+
return context_data.join("");
|
|
276600
|
+
},
|
|
276601
|
+
decompress: function(compressed) {
|
|
276602
|
+
if (compressed == null)
|
|
276603
|
+
return "";
|
|
276604
|
+
if (compressed == "")
|
|
276605
|
+
return null;
|
|
276606
|
+
return LZString2._decompress(compressed.length, 32768, function(index2) {
|
|
276607
|
+
return compressed.charCodeAt(index2);
|
|
276608
|
+
});
|
|
276609
|
+
},
|
|
276610
|
+
_decompress: function(length2, resetValue, getNextValue) {
|
|
276611
|
+
var dictionary = [], enlargeIn = 4, dictSize = 4, numBits = 3, entry2 = "", result = [], i2, w2, bits, resb, maxpower, power, c2, data2 = { val: getNextValue(0), position: resetValue, index: 1 };
|
|
276612
|
+
for (i2 = 0; i2 < 3; i2 += 1) {
|
|
276613
|
+
dictionary[i2] = i2;
|
|
276614
|
+
}
|
|
276615
|
+
bits = 0;
|
|
276616
|
+
maxpower = Math.pow(2, 2);
|
|
276617
|
+
power = 1;
|
|
276618
|
+
while (power != maxpower) {
|
|
276619
|
+
resb = data2.val & data2.position;
|
|
276620
|
+
data2.position >>= 1;
|
|
276621
|
+
if (data2.position == 0) {
|
|
276622
|
+
data2.position = resetValue;
|
|
276623
|
+
data2.val = getNextValue(data2.index++);
|
|
276624
|
+
}
|
|
276625
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276626
|
+
power <<= 1;
|
|
276627
|
+
}
|
|
276628
|
+
switch (bits) {
|
|
276629
|
+
case 0:
|
|
276630
|
+
bits = 0;
|
|
276631
|
+
maxpower = Math.pow(2, 8);
|
|
276632
|
+
power = 1;
|
|
276633
|
+
while (power != maxpower) {
|
|
276634
|
+
resb = data2.val & data2.position;
|
|
276635
|
+
data2.position >>= 1;
|
|
276636
|
+
if (data2.position == 0) {
|
|
276637
|
+
data2.position = resetValue;
|
|
276638
|
+
data2.val = getNextValue(data2.index++);
|
|
276639
|
+
}
|
|
276640
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276641
|
+
power <<= 1;
|
|
276642
|
+
}
|
|
276643
|
+
c2 = f2(bits);
|
|
276644
|
+
break;
|
|
276645
|
+
case 1:
|
|
276646
|
+
bits = 0;
|
|
276647
|
+
maxpower = Math.pow(2, 16);
|
|
276648
|
+
power = 1;
|
|
276649
|
+
while (power != maxpower) {
|
|
276650
|
+
resb = data2.val & data2.position;
|
|
276651
|
+
data2.position >>= 1;
|
|
276652
|
+
if (data2.position == 0) {
|
|
276653
|
+
data2.position = resetValue;
|
|
276654
|
+
data2.val = getNextValue(data2.index++);
|
|
276655
|
+
}
|
|
276656
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276657
|
+
power <<= 1;
|
|
276658
|
+
}
|
|
276659
|
+
c2 = f2(bits);
|
|
276660
|
+
break;
|
|
276661
|
+
case 2:
|
|
276662
|
+
return "";
|
|
276663
|
+
}
|
|
276664
|
+
dictionary[3] = c2;
|
|
276665
|
+
w2 = c2;
|
|
276666
|
+
result.push(c2);
|
|
276667
|
+
while (true) {
|
|
276668
|
+
if (data2.index > length2) {
|
|
276669
|
+
return "";
|
|
276670
|
+
}
|
|
276671
|
+
bits = 0;
|
|
276672
|
+
maxpower = Math.pow(2, numBits);
|
|
276673
|
+
power = 1;
|
|
276674
|
+
while (power != maxpower) {
|
|
276675
|
+
resb = data2.val & data2.position;
|
|
276676
|
+
data2.position >>= 1;
|
|
276677
|
+
if (data2.position == 0) {
|
|
276678
|
+
data2.position = resetValue;
|
|
276679
|
+
data2.val = getNextValue(data2.index++);
|
|
276680
|
+
}
|
|
276681
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276682
|
+
power <<= 1;
|
|
276683
|
+
}
|
|
276684
|
+
switch (c2 = bits) {
|
|
276685
|
+
case 0:
|
|
276686
|
+
bits = 0;
|
|
276687
|
+
maxpower = Math.pow(2, 8);
|
|
276688
|
+
power = 1;
|
|
276689
|
+
while (power != maxpower) {
|
|
276690
|
+
resb = data2.val & data2.position;
|
|
276691
|
+
data2.position >>= 1;
|
|
276692
|
+
if (data2.position == 0) {
|
|
276693
|
+
data2.position = resetValue;
|
|
276694
|
+
data2.val = getNextValue(data2.index++);
|
|
276695
|
+
}
|
|
276696
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276697
|
+
power <<= 1;
|
|
276698
|
+
}
|
|
276699
|
+
dictionary[dictSize++] = f2(bits);
|
|
276700
|
+
c2 = dictSize - 1;
|
|
276701
|
+
enlargeIn--;
|
|
276702
|
+
break;
|
|
276703
|
+
case 1:
|
|
276704
|
+
bits = 0;
|
|
276705
|
+
maxpower = Math.pow(2, 16);
|
|
276706
|
+
power = 1;
|
|
276707
|
+
while (power != maxpower) {
|
|
276708
|
+
resb = data2.val & data2.position;
|
|
276709
|
+
data2.position >>= 1;
|
|
276710
|
+
if (data2.position == 0) {
|
|
276711
|
+
data2.position = resetValue;
|
|
276712
|
+
data2.val = getNextValue(data2.index++);
|
|
276713
|
+
}
|
|
276714
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276715
|
+
power <<= 1;
|
|
276716
|
+
}
|
|
276717
|
+
dictionary[dictSize++] = f2(bits);
|
|
276718
|
+
c2 = dictSize - 1;
|
|
276719
|
+
enlargeIn--;
|
|
276720
|
+
break;
|
|
276721
|
+
case 2:
|
|
276722
|
+
return result.join("");
|
|
276723
|
+
}
|
|
276724
|
+
if (enlargeIn == 0) {
|
|
276725
|
+
enlargeIn = Math.pow(2, numBits);
|
|
276726
|
+
numBits++;
|
|
276727
|
+
}
|
|
276728
|
+
if (dictionary[c2]) {
|
|
276729
|
+
entry2 = dictionary[c2];
|
|
276730
|
+
} else {
|
|
276731
|
+
if (c2 === dictSize) {
|
|
276732
|
+
entry2 = w2 + w2.charAt(0);
|
|
276733
|
+
} else {
|
|
276734
|
+
return null;
|
|
276735
|
+
}
|
|
276736
|
+
}
|
|
276737
|
+
result.push(entry2);
|
|
276738
|
+
dictionary[dictSize++] = w2 + entry2.charAt(0);
|
|
276739
|
+
enlargeIn--;
|
|
276740
|
+
w2 = entry2;
|
|
276741
|
+
if (enlargeIn == 0) {
|
|
276742
|
+
enlargeIn = Math.pow(2, numBits);
|
|
276743
|
+
numBits++;
|
|
276744
|
+
}
|
|
276745
|
+
}
|
|
276746
|
+
}
|
|
276747
|
+
};
|
|
276748
|
+
return LZString2;
|
|
276749
|
+
}();
|
|
276750
|
+
if (module3 != null) {
|
|
276751
|
+
module3.exports = LZString;
|
|
276752
|
+
}
|
|
276753
|
+
})(lzString);
|
|
276754
|
+
const CURRENT_VERSION = "0.0.1";
|
|
276755
|
+
const VITESSCE_CONF_QUERY_STRING = "vitessce_conf";
|
|
276756
|
+
const VERSION_QUERY_STRING = "vitessce_conf_version";
|
|
276757
|
+
const LENGTH_QUERY_STRING = "vitessce_conf_length";
|
|
276758
|
+
function sniffBrowser() {
|
|
276759
|
+
const { browser: browser2 } = Bowser.parse(window.navigator.userAgent);
|
|
276760
|
+
return browser2.name;
|
|
276761
|
+
}
|
|
276762
|
+
const MAX_BROWSER_URL_LENGTHS = {
|
|
276763
|
+
Chrome: 32779,
|
|
276764
|
+
"Internet Explorer": 2047,
|
|
276765
|
+
Edge: 2047,
|
|
276766
|
+
Safari: 65e3,
|
|
276767
|
+
Firefox: 65e3
|
|
276768
|
+
};
|
|
276769
|
+
class CompressedConfLengthError {
|
|
276770
|
+
constructor(message) {
|
|
276771
|
+
this.message = message;
|
|
276772
|
+
}
|
|
276773
|
+
}
|
|
276774
|
+
function encodeConfInUrl({ conf, onOverMaximumUrlLength = () => {
|
|
276775
|
+
} }) {
|
|
276776
|
+
const compressedConf = lzString.exports.compressToEncodedURIComponent(JSON.stringify(conf));
|
|
276777
|
+
const newParams = `${LENGTH_QUERY_STRING}=${compressedConf.length}&${VERSION_QUERY_STRING}=${CURRENT_VERSION}&${VITESSCE_CONF_QUERY_STRING}=${compressedConf}`;
|
|
276778
|
+
const browser2 = sniffBrowser();
|
|
276779
|
+
const maxLength = MAX_BROWSER_URL_LENGTHS[browser2];
|
|
276780
|
+
if (newParams.length > maxLength) {
|
|
276781
|
+
const willWorkOn = Object.entries(MAX_BROWSER_URL_LENGTHS).filter((entry2) => entry2[1] > newParams.length).map((entry2) => entry2[0]);
|
|
276782
|
+
const message = `Configuration is ${compressedConf.length} characters; max URL for ${browser2} is ${maxLength}: it will work on ${willWorkOn.join(", ") || "no browser"}.`;
|
|
276783
|
+
console.error(message);
|
|
276784
|
+
onOverMaximumUrlLength({ message, willWorkOn });
|
|
276785
|
+
}
|
|
276786
|
+
return newParams;
|
|
276787
|
+
}
|
|
276788
|
+
function decodeURLParamsToConf(queryString) {
|
|
276789
|
+
const params2 = new URLSearchParams(queryString.replace("#", "&"));
|
|
276790
|
+
const compressedConfString = params2.get(VITESSCE_CONF_QUERY_STRING);
|
|
276791
|
+
const expectedConfLength = Number(params2.get(LENGTH_QUERY_STRING));
|
|
276792
|
+
if (expectedConfLength !== compressedConfString.length) {
|
|
276793
|
+
throw new CompressedConfLengthError(`Compressed conf length (${compressedConfString.length}) != expected (${expectedConfLength}). URL truncated?`);
|
|
276794
|
+
}
|
|
276795
|
+
const version2 = params2.get(VERSION_QUERY_STRING);
|
|
276796
|
+
if (version2 === CURRENT_VERSION) {
|
|
276797
|
+
const conf = JSON.parse(lzString.exports.decompressFromEncodedURIComponent(compressedConfString));
|
|
276798
|
+
return conf;
|
|
276799
|
+
}
|
|
276800
|
+
throw new Error("Unrecognized URL Param Version");
|
|
276801
|
+
}
|
|
275172
276802
|
class RawDecoder extends BaseDecoder {
|
|
275173
276803
|
decodeBlock(buffer2) {
|
|
275174
276804
|
return buffer2;
|
|
@@ -282088,6 +283718,8 @@ void main() {
|
|
|
282088
283718
|
exports2.ViewType = ViewType;
|
|
282089
283719
|
exports2.Vitessce = Vitessce;
|
|
282090
283720
|
exports2.VitessceConfig = VitessceConfig;
|
|
283721
|
+
exports2.decodeURLParamsToConf = decodeURLParamsToConf;
|
|
283722
|
+
exports2.encodeConfInUrl = encodeConfInUrl;
|
|
282091
283723
|
exports2.hconcat = hconcat;
|
|
282092
283724
|
exports2.vconcat = vconcat;
|
|
282093
283725
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|