@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
|
@@ -833,6 +833,25 @@ const canLoadResolution = (loader2, resolution) => {
|
|
|
833
833
|
const maxSize = maxHeapSize || 2 ** 31 - 1;
|
|
834
834
|
return totalBytes < maxSize && height2 <= 2048 && depthDownsampled <= 2048 && width2 <= 2048 && depthDownsampled > 1;
|
|
835
835
|
};
|
|
836
|
+
const VALUE_TRANSFORM_OPTIONS = [
|
|
837
|
+
{ name: "None", value: null },
|
|
838
|
+
{ name: "Log", value: "log1p" },
|
|
839
|
+
{ name: "ArcSinh", value: "arcsinh" }
|
|
840
|
+
];
|
|
841
|
+
function getValueTransformFunction(featureValueTransform, coefficient) {
|
|
842
|
+
let transformFunction;
|
|
843
|
+
switch (featureValueTransform) {
|
|
844
|
+
case "log1p":
|
|
845
|
+
transformFunction = (v) => Math.log(1 + v * coefficient);
|
|
846
|
+
break;
|
|
847
|
+
case "arcsinh":
|
|
848
|
+
transformFunction = (v) => Math.asinh(v * coefficient);
|
|
849
|
+
break;
|
|
850
|
+
default:
|
|
851
|
+
transformFunction = (v) => v;
|
|
852
|
+
}
|
|
853
|
+
return transformFunction;
|
|
854
|
+
}
|
|
836
855
|
var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
837
856
|
function getDefaultExportFromCjs$1(x2) {
|
|
838
857
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -858,477 +877,6 @@ function getAugmentedNamespace(n3) {
|
|
|
858
877
|
});
|
|
859
878
|
return a2;
|
|
860
879
|
}
|
|
861
|
-
var lzString = { exports: {} };
|
|
862
|
-
(function(module2) {
|
|
863
|
-
var LZString = function() {
|
|
864
|
-
var f2 = String.fromCharCode;
|
|
865
|
-
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
866
|
-
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
867
|
-
var baseReverseDic = {};
|
|
868
|
-
function getBaseValue(alphabet, character) {
|
|
869
|
-
if (!baseReverseDic[alphabet]) {
|
|
870
|
-
baseReverseDic[alphabet] = {};
|
|
871
|
-
for (var i2 = 0; i2 < alphabet.length; i2++) {
|
|
872
|
-
baseReverseDic[alphabet][alphabet.charAt(i2)] = i2;
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
return baseReverseDic[alphabet][character];
|
|
876
|
-
}
|
|
877
|
-
var LZString2 = {
|
|
878
|
-
compressToBase64: function(input) {
|
|
879
|
-
if (input == null)
|
|
880
|
-
return "";
|
|
881
|
-
var res = LZString2._compress(input, 6, function(a2) {
|
|
882
|
-
return keyStrBase64.charAt(a2);
|
|
883
|
-
});
|
|
884
|
-
switch (res.length % 4) {
|
|
885
|
-
default:
|
|
886
|
-
case 0:
|
|
887
|
-
return res;
|
|
888
|
-
case 1:
|
|
889
|
-
return res + "===";
|
|
890
|
-
case 2:
|
|
891
|
-
return res + "==";
|
|
892
|
-
case 3:
|
|
893
|
-
return res + "=";
|
|
894
|
-
}
|
|
895
|
-
},
|
|
896
|
-
decompressFromBase64: function(input) {
|
|
897
|
-
if (input == null)
|
|
898
|
-
return "";
|
|
899
|
-
if (input == "")
|
|
900
|
-
return null;
|
|
901
|
-
return LZString2._decompress(input.length, 32, function(index2) {
|
|
902
|
-
return getBaseValue(keyStrBase64, input.charAt(index2));
|
|
903
|
-
});
|
|
904
|
-
},
|
|
905
|
-
compressToUTF16: function(input) {
|
|
906
|
-
if (input == null)
|
|
907
|
-
return "";
|
|
908
|
-
return LZString2._compress(input, 15, function(a2) {
|
|
909
|
-
return f2(a2 + 32);
|
|
910
|
-
}) + " ";
|
|
911
|
-
},
|
|
912
|
-
decompressFromUTF16: function(compressed) {
|
|
913
|
-
if (compressed == null)
|
|
914
|
-
return "";
|
|
915
|
-
if (compressed == "")
|
|
916
|
-
return null;
|
|
917
|
-
return LZString2._decompress(compressed.length, 16384, function(index2) {
|
|
918
|
-
return compressed.charCodeAt(index2) - 32;
|
|
919
|
-
});
|
|
920
|
-
},
|
|
921
|
-
compressToUint8Array: function(uncompressed) {
|
|
922
|
-
var compressed = LZString2.compress(uncompressed);
|
|
923
|
-
var buf = new Uint8Array(compressed.length * 2);
|
|
924
|
-
for (var i2 = 0, TotalLen = compressed.length; i2 < TotalLen; i2++) {
|
|
925
|
-
var current_value = compressed.charCodeAt(i2);
|
|
926
|
-
buf[i2 * 2] = current_value >>> 8;
|
|
927
|
-
buf[i2 * 2 + 1] = current_value % 256;
|
|
928
|
-
}
|
|
929
|
-
return buf;
|
|
930
|
-
},
|
|
931
|
-
decompressFromUint8Array: function(compressed) {
|
|
932
|
-
if (compressed === null || compressed === void 0) {
|
|
933
|
-
return LZString2.decompress(compressed);
|
|
934
|
-
} else {
|
|
935
|
-
var buf = new Array(compressed.length / 2);
|
|
936
|
-
for (var i2 = 0, TotalLen = buf.length; i2 < TotalLen; i2++) {
|
|
937
|
-
buf[i2] = compressed[i2 * 2] * 256 + compressed[i2 * 2 + 1];
|
|
938
|
-
}
|
|
939
|
-
var result = [];
|
|
940
|
-
buf.forEach(function(c2) {
|
|
941
|
-
result.push(f2(c2));
|
|
942
|
-
});
|
|
943
|
-
return LZString2.decompress(result.join(""));
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
compressToEncodedURIComponent: function(input) {
|
|
947
|
-
if (input == null)
|
|
948
|
-
return "";
|
|
949
|
-
return LZString2._compress(input, 6, function(a2) {
|
|
950
|
-
return keyStrUriSafe.charAt(a2);
|
|
951
|
-
});
|
|
952
|
-
},
|
|
953
|
-
decompressFromEncodedURIComponent: function(input) {
|
|
954
|
-
if (input == null)
|
|
955
|
-
return "";
|
|
956
|
-
if (input == "")
|
|
957
|
-
return null;
|
|
958
|
-
input = input.replace(/ /g, "+");
|
|
959
|
-
return LZString2._decompress(input.length, 32, function(index2) {
|
|
960
|
-
return getBaseValue(keyStrUriSafe, input.charAt(index2));
|
|
961
|
-
});
|
|
962
|
-
},
|
|
963
|
-
compress: function(uncompressed) {
|
|
964
|
-
return LZString2._compress(uncompressed, 16, function(a2) {
|
|
965
|
-
return f2(a2);
|
|
966
|
-
});
|
|
967
|
-
},
|
|
968
|
-
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
969
|
-
if (uncompressed == null)
|
|
970
|
-
return "";
|
|
971
|
-
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;
|
|
972
|
-
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
973
|
-
context_c = uncompressed.charAt(ii);
|
|
974
|
-
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
975
|
-
context_dictionary[context_c] = context_dictSize++;
|
|
976
|
-
context_dictionaryToCreate[context_c] = true;
|
|
977
|
-
}
|
|
978
|
-
context_wc = context_w + context_c;
|
|
979
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {
|
|
980
|
-
context_w = context_wc;
|
|
981
|
-
} else {
|
|
982
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
983
|
-
if (context_w.charCodeAt(0) < 256) {
|
|
984
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
985
|
-
context_data_val = context_data_val << 1;
|
|
986
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
987
|
-
context_data_position = 0;
|
|
988
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
989
|
-
context_data_val = 0;
|
|
990
|
-
} else {
|
|
991
|
-
context_data_position++;
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
value2 = context_w.charCodeAt(0);
|
|
995
|
-
for (i2 = 0; i2 < 8; i2++) {
|
|
996
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
997
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
998
|
-
context_data_position = 0;
|
|
999
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1000
|
-
context_data_val = 0;
|
|
1001
|
-
} else {
|
|
1002
|
-
context_data_position++;
|
|
1003
|
-
}
|
|
1004
|
-
value2 = value2 >> 1;
|
|
1005
|
-
}
|
|
1006
|
-
} else {
|
|
1007
|
-
value2 = 1;
|
|
1008
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1009
|
-
context_data_val = context_data_val << 1 | value2;
|
|
1010
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1011
|
-
context_data_position = 0;
|
|
1012
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1013
|
-
context_data_val = 0;
|
|
1014
|
-
} else {
|
|
1015
|
-
context_data_position++;
|
|
1016
|
-
}
|
|
1017
|
-
value2 = 0;
|
|
1018
|
-
}
|
|
1019
|
-
value2 = context_w.charCodeAt(0);
|
|
1020
|
-
for (i2 = 0; i2 < 16; i2++) {
|
|
1021
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1022
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1023
|
-
context_data_position = 0;
|
|
1024
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1025
|
-
context_data_val = 0;
|
|
1026
|
-
} else {
|
|
1027
|
-
context_data_position++;
|
|
1028
|
-
}
|
|
1029
|
-
value2 = value2 >> 1;
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
context_enlargeIn--;
|
|
1033
|
-
if (context_enlargeIn == 0) {
|
|
1034
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1035
|
-
context_numBits++;
|
|
1036
|
-
}
|
|
1037
|
-
delete context_dictionaryToCreate[context_w];
|
|
1038
|
-
} else {
|
|
1039
|
-
value2 = context_dictionary[context_w];
|
|
1040
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1041
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1042
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1043
|
-
context_data_position = 0;
|
|
1044
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1045
|
-
context_data_val = 0;
|
|
1046
|
-
} else {
|
|
1047
|
-
context_data_position++;
|
|
1048
|
-
}
|
|
1049
|
-
value2 = value2 >> 1;
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
context_enlargeIn--;
|
|
1053
|
-
if (context_enlargeIn == 0) {
|
|
1054
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1055
|
-
context_numBits++;
|
|
1056
|
-
}
|
|
1057
|
-
context_dictionary[context_wc] = context_dictSize++;
|
|
1058
|
-
context_w = String(context_c);
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
if (context_w !== "") {
|
|
1062
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
1063
|
-
if (context_w.charCodeAt(0) < 256) {
|
|
1064
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1065
|
-
context_data_val = context_data_val << 1;
|
|
1066
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1067
|
-
context_data_position = 0;
|
|
1068
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1069
|
-
context_data_val = 0;
|
|
1070
|
-
} else {
|
|
1071
|
-
context_data_position++;
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
value2 = context_w.charCodeAt(0);
|
|
1075
|
-
for (i2 = 0; i2 < 8; i2++) {
|
|
1076
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1077
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1078
|
-
context_data_position = 0;
|
|
1079
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1080
|
-
context_data_val = 0;
|
|
1081
|
-
} else {
|
|
1082
|
-
context_data_position++;
|
|
1083
|
-
}
|
|
1084
|
-
value2 = value2 >> 1;
|
|
1085
|
-
}
|
|
1086
|
-
} else {
|
|
1087
|
-
value2 = 1;
|
|
1088
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1089
|
-
context_data_val = context_data_val << 1 | value2;
|
|
1090
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1091
|
-
context_data_position = 0;
|
|
1092
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1093
|
-
context_data_val = 0;
|
|
1094
|
-
} else {
|
|
1095
|
-
context_data_position++;
|
|
1096
|
-
}
|
|
1097
|
-
value2 = 0;
|
|
1098
|
-
}
|
|
1099
|
-
value2 = context_w.charCodeAt(0);
|
|
1100
|
-
for (i2 = 0; i2 < 16; i2++) {
|
|
1101
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1102
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1103
|
-
context_data_position = 0;
|
|
1104
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1105
|
-
context_data_val = 0;
|
|
1106
|
-
} else {
|
|
1107
|
-
context_data_position++;
|
|
1108
|
-
}
|
|
1109
|
-
value2 = value2 >> 1;
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
context_enlargeIn--;
|
|
1113
|
-
if (context_enlargeIn == 0) {
|
|
1114
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1115
|
-
context_numBits++;
|
|
1116
|
-
}
|
|
1117
|
-
delete context_dictionaryToCreate[context_w];
|
|
1118
|
-
} else {
|
|
1119
|
-
value2 = context_dictionary[context_w];
|
|
1120
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1121
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1122
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1123
|
-
context_data_position = 0;
|
|
1124
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1125
|
-
context_data_val = 0;
|
|
1126
|
-
} else {
|
|
1127
|
-
context_data_position++;
|
|
1128
|
-
}
|
|
1129
|
-
value2 = value2 >> 1;
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
context_enlargeIn--;
|
|
1133
|
-
if (context_enlargeIn == 0) {
|
|
1134
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
1135
|
-
context_numBits++;
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
value2 = 2;
|
|
1139
|
-
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
1140
|
-
context_data_val = context_data_val << 1 | value2 & 1;
|
|
1141
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1142
|
-
context_data_position = 0;
|
|
1143
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1144
|
-
context_data_val = 0;
|
|
1145
|
-
} else {
|
|
1146
|
-
context_data_position++;
|
|
1147
|
-
}
|
|
1148
|
-
value2 = value2 >> 1;
|
|
1149
|
-
}
|
|
1150
|
-
while (true) {
|
|
1151
|
-
context_data_val = context_data_val << 1;
|
|
1152
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
1153
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
1154
|
-
break;
|
|
1155
|
-
} else
|
|
1156
|
-
context_data_position++;
|
|
1157
|
-
}
|
|
1158
|
-
return context_data.join("");
|
|
1159
|
-
},
|
|
1160
|
-
decompress: function(compressed) {
|
|
1161
|
-
if (compressed == null)
|
|
1162
|
-
return "";
|
|
1163
|
-
if (compressed == "")
|
|
1164
|
-
return null;
|
|
1165
|
-
return LZString2._decompress(compressed.length, 32768, function(index2) {
|
|
1166
|
-
return compressed.charCodeAt(index2);
|
|
1167
|
-
});
|
|
1168
|
-
},
|
|
1169
|
-
_decompress: function(length2, resetValue, getNextValue) {
|
|
1170
|
-
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 };
|
|
1171
|
-
for (i2 = 0; i2 < 3; i2 += 1) {
|
|
1172
|
-
dictionary[i2] = i2;
|
|
1173
|
-
}
|
|
1174
|
-
bits = 0;
|
|
1175
|
-
maxpower = Math.pow(2, 2);
|
|
1176
|
-
power = 1;
|
|
1177
|
-
while (power != maxpower) {
|
|
1178
|
-
resb = data2.val & data2.position;
|
|
1179
|
-
data2.position >>= 1;
|
|
1180
|
-
if (data2.position == 0) {
|
|
1181
|
-
data2.position = resetValue;
|
|
1182
|
-
data2.val = getNextValue(data2.index++);
|
|
1183
|
-
}
|
|
1184
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1185
|
-
power <<= 1;
|
|
1186
|
-
}
|
|
1187
|
-
switch (bits) {
|
|
1188
|
-
case 0:
|
|
1189
|
-
bits = 0;
|
|
1190
|
-
maxpower = Math.pow(2, 8);
|
|
1191
|
-
power = 1;
|
|
1192
|
-
while (power != maxpower) {
|
|
1193
|
-
resb = data2.val & data2.position;
|
|
1194
|
-
data2.position >>= 1;
|
|
1195
|
-
if (data2.position == 0) {
|
|
1196
|
-
data2.position = resetValue;
|
|
1197
|
-
data2.val = getNextValue(data2.index++);
|
|
1198
|
-
}
|
|
1199
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1200
|
-
power <<= 1;
|
|
1201
|
-
}
|
|
1202
|
-
c2 = f2(bits);
|
|
1203
|
-
break;
|
|
1204
|
-
case 1:
|
|
1205
|
-
bits = 0;
|
|
1206
|
-
maxpower = Math.pow(2, 16);
|
|
1207
|
-
power = 1;
|
|
1208
|
-
while (power != maxpower) {
|
|
1209
|
-
resb = data2.val & data2.position;
|
|
1210
|
-
data2.position >>= 1;
|
|
1211
|
-
if (data2.position == 0) {
|
|
1212
|
-
data2.position = resetValue;
|
|
1213
|
-
data2.val = getNextValue(data2.index++);
|
|
1214
|
-
}
|
|
1215
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1216
|
-
power <<= 1;
|
|
1217
|
-
}
|
|
1218
|
-
c2 = f2(bits);
|
|
1219
|
-
break;
|
|
1220
|
-
case 2:
|
|
1221
|
-
return "";
|
|
1222
|
-
}
|
|
1223
|
-
dictionary[3] = c2;
|
|
1224
|
-
w2 = c2;
|
|
1225
|
-
result.push(c2);
|
|
1226
|
-
while (true) {
|
|
1227
|
-
if (data2.index > length2) {
|
|
1228
|
-
return "";
|
|
1229
|
-
}
|
|
1230
|
-
bits = 0;
|
|
1231
|
-
maxpower = Math.pow(2, numBits);
|
|
1232
|
-
power = 1;
|
|
1233
|
-
while (power != maxpower) {
|
|
1234
|
-
resb = data2.val & data2.position;
|
|
1235
|
-
data2.position >>= 1;
|
|
1236
|
-
if (data2.position == 0) {
|
|
1237
|
-
data2.position = resetValue;
|
|
1238
|
-
data2.val = getNextValue(data2.index++);
|
|
1239
|
-
}
|
|
1240
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1241
|
-
power <<= 1;
|
|
1242
|
-
}
|
|
1243
|
-
switch (c2 = bits) {
|
|
1244
|
-
case 0:
|
|
1245
|
-
bits = 0;
|
|
1246
|
-
maxpower = Math.pow(2, 8);
|
|
1247
|
-
power = 1;
|
|
1248
|
-
while (power != maxpower) {
|
|
1249
|
-
resb = data2.val & data2.position;
|
|
1250
|
-
data2.position >>= 1;
|
|
1251
|
-
if (data2.position == 0) {
|
|
1252
|
-
data2.position = resetValue;
|
|
1253
|
-
data2.val = getNextValue(data2.index++);
|
|
1254
|
-
}
|
|
1255
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1256
|
-
power <<= 1;
|
|
1257
|
-
}
|
|
1258
|
-
dictionary[dictSize++] = f2(bits);
|
|
1259
|
-
c2 = dictSize - 1;
|
|
1260
|
-
enlargeIn--;
|
|
1261
|
-
break;
|
|
1262
|
-
case 1:
|
|
1263
|
-
bits = 0;
|
|
1264
|
-
maxpower = Math.pow(2, 16);
|
|
1265
|
-
power = 1;
|
|
1266
|
-
while (power != maxpower) {
|
|
1267
|
-
resb = data2.val & data2.position;
|
|
1268
|
-
data2.position >>= 1;
|
|
1269
|
-
if (data2.position == 0) {
|
|
1270
|
-
data2.position = resetValue;
|
|
1271
|
-
data2.val = getNextValue(data2.index++);
|
|
1272
|
-
}
|
|
1273
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
1274
|
-
power <<= 1;
|
|
1275
|
-
}
|
|
1276
|
-
dictionary[dictSize++] = f2(bits);
|
|
1277
|
-
c2 = dictSize - 1;
|
|
1278
|
-
enlargeIn--;
|
|
1279
|
-
break;
|
|
1280
|
-
case 2:
|
|
1281
|
-
return result.join("");
|
|
1282
|
-
}
|
|
1283
|
-
if (enlargeIn == 0) {
|
|
1284
|
-
enlargeIn = Math.pow(2, numBits);
|
|
1285
|
-
numBits++;
|
|
1286
|
-
}
|
|
1287
|
-
if (dictionary[c2]) {
|
|
1288
|
-
entry2 = dictionary[c2];
|
|
1289
|
-
} else {
|
|
1290
|
-
if (c2 === dictSize) {
|
|
1291
|
-
entry2 = w2 + w2.charAt(0);
|
|
1292
|
-
} else {
|
|
1293
|
-
return null;
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
result.push(entry2);
|
|
1297
|
-
dictionary[dictSize++] = w2 + entry2.charAt(0);
|
|
1298
|
-
enlargeIn--;
|
|
1299
|
-
w2 = entry2;
|
|
1300
|
-
if (enlargeIn == 0) {
|
|
1301
|
-
enlargeIn = Math.pow(2, numBits);
|
|
1302
|
-
numBits++;
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
};
|
|
1307
|
-
return LZString2;
|
|
1308
|
-
}();
|
|
1309
|
-
if (module2 != null) {
|
|
1310
|
-
module2.exports = LZString;
|
|
1311
|
-
}
|
|
1312
|
-
})(lzString);
|
|
1313
|
-
const VALUE_TRANSFORM_OPTIONS = [
|
|
1314
|
-
{ name: "None", value: null },
|
|
1315
|
-
{ name: "Log", value: "log1p" },
|
|
1316
|
-
{ name: "ArcSinh", value: "arcsinh" }
|
|
1317
|
-
];
|
|
1318
|
-
function getValueTransformFunction(featureValueTransform, coefficient) {
|
|
1319
|
-
let transformFunction;
|
|
1320
|
-
switch (featureValueTransform) {
|
|
1321
|
-
case "log1p":
|
|
1322
|
-
transformFunction = (v) => Math.log(1 + v * coefficient);
|
|
1323
|
-
break;
|
|
1324
|
-
case "arcsinh":
|
|
1325
|
-
transformFunction = (v) => Math.asinh(v * coefficient);
|
|
1326
|
-
break;
|
|
1327
|
-
default:
|
|
1328
|
-
transformFunction = (v) => v;
|
|
1329
|
-
}
|
|
1330
|
-
return transformFunction;
|
|
1331
|
-
}
|
|
1332
880
|
var rngBrowser = { exports: {} };
|
|
1333
881
|
var getRandomValues$1 = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != "undefined" && typeof window.msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto);
|
|
1334
882
|
if (getRandomValues$1) {
|
|
@@ -60017,7 +59565,7 @@ var json2csv_umd = { exports: {} };
|
|
|
60017
59565
|
var CARRIAGE_RETURN = "\r".charCodeAt(0);
|
|
60018
59566
|
var TAB = " ".charCodeAt(0);
|
|
60019
59567
|
var STRING_BUFFER_SIZE = 64 * 1024;
|
|
60020
|
-
function
|
|
59568
|
+
function Parser2() {
|
|
60021
59569
|
this.tState = START;
|
|
60022
59570
|
this.value = void 0;
|
|
60023
59571
|
this.string = void 0;
|
|
@@ -60034,7 +59582,7 @@ var json2csv_umd = { exports: {} };
|
|
|
60034
59582
|
this.temp_buffs = { "2": new Buffer2(2), "3": new Buffer2(3), "4": new Buffer2(4) };
|
|
60035
59583
|
this.offset = -1;
|
|
60036
59584
|
}
|
|
60037
|
-
|
|
59585
|
+
Parser2.toknam = function(code) {
|
|
60038
59586
|
var keys5 = Object.keys(C3);
|
|
60039
59587
|
for (var i2 = 0, l2 = keys5.length; i2 < l2; i2++) {
|
|
60040
59588
|
var key2 = keys5[i2];
|
|
@@ -60044,13 +59592,13 @@ var json2csv_umd = { exports: {} };
|
|
|
60044
59592
|
}
|
|
60045
59593
|
return code && "0x" + code.toString(16);
|
|
60046
59594
|
};
|
|
60047
|
-
var proto =
|
|
59595
|
+
var proto = Parser2.prototype;
|
|
60048
59596
|
proto.onError = function(err2) {
|
|
60049
59597
|
throw err2;
|
|
60050
59598
|
};
|
|
60051
59599
|
proto.charError = function(buffer2, i2) {
|
|
60052
59600
|
this.tState = STOP;
|
|
60053
|
-
this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer2[i2])) + " at position " + i2 + " in state " +
|
|
59601
|
+
this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer2[i2])) + " at position " + i2 + " in state " + Parser2.toknam(this.tState)));
|
|
60054
59602
|
};
|
|
60055
59603
|
proto.appendStringChar = function(char) {
|
|
60056
59604
|
if (this.stringBufferOffset >= STRING_BUFFER_SIZE) {
|
|
@@ -60136,7 +59684,7 @@ var json2csv_umd = { exports: {} };
|
|
|
60136
59684
|
i2 = i2 + j - 1;
|
|
60137
59685
|
} else if (this.bytes_remaining === 0 && n3 >= 128) {
|
|
60138
59686
|
if (n3 <= 193 || n3 > 244) {
|
|
60139
|
-
return this.onError(new Error("Invalid UTF-8 character at position " + i2 + " in state " +
|
|
59687
|
+
return this.onError(new Error("Invalid UTF-8 character at position " + i2 + " in state " + Parser2.toknam(this.tState)));
|
|
60140
59688
|
}
|
|
60141
59689
|
if (n3 >= 194 && n3 <= 223)
|
|
60142
59690
|
this.bytes_in_sequence = 2;
|
|
@@ -60334,7 +59882,7 @@ var json2csv_umd = { exports: {} };
|
|
|
60334
59882
|
};
|
|
60335
59883
|
proto.parseError = function(token, value2) {
|
|
60336
59884
|
this.tState = STOP;
|
|
60337
|
-
this.onError(new Error("Unexpected " +
|
|
59885
|
+
this.onError(new Error("Unexpected " + Parser2.toknam(token) + (value2 ? "(" + JSON.stringify(value2) + ")" : "") + " in state " + Parser2.toknam(this.state)));
|
|
60338
59886
|
};
|
|
60339
59887
|
proto.push = function() {
|
|
60340
59888
|
this.stack.push({ value: this.value, key: this.key, mode: this.mode });
|
|
@@ -60432,8 +59980,8 @@ var json2csv_umd = { exports: {} };
|
|
|
60432
59980
|
return this.parseError(token, value2);
|
|
60433
59981
|
}
|
|
60434
59982
|
};
|
|
60435
|
-
|
|
60436
|
-
var jsonparse =
|
|
59983
|
+
Parser2.C = C3;
|
|
59984
|
+
var jsonparse = Parser2;
|
|
60437
59985
|
var Transform$12 = Stream.Transform;
|
|
60438
59986
|
var JSON2CSVTransform = /* @__PURE__ */ function(_Transform) {
|
|
60439
59987
|
_inherits2(JSON2CSVTransform2, _Transform);
|
|
@@ -61452,19 +61000,11 @@ var _fails = function(exec) {
|
|
|
61452
61000
|
return true;
|
|
61453
61001
|
}
|
|
61454
61002
|
};
|
|
61455
|
-
var _descriptors
|
|
61456
|
-
|
|
61457
|
-
|
|
61458
|
-
|
|
61459
|
-
|
|
61460
|
-
hasRequired_descriptors = 1;
|
|
61461
|
-
_descriptors = !_fails(function() {
|
|
61462
|
-
return Object.defineProperty({}, "a", { get: function() {
|
|
61463
|
-
return 7;
|
|
61464
|
-
} }).a != 7;
|
|
61465
|
-
});
|
|
61466
|
-
return _descriptors;
|
|
61467
|
-
}
|
|
61003
|
+
var _descriptors = !_fails(function() {
|
|
61004
|
+
return Object.defineProperty({}, "a", { get: function() {
|
|
61005
|
+
return 7;
|
|
61006
|
+
} }).a != 7;
|
|
61007
|
+
});
|
|
61468
61008
|
var _domCreate;
|
|
61469
61009
|
var hasRequired_domCreate;
|
|
61470
61010
|
function require_domCreate() {
|
|
@@ -61479,19 +61019,11 @@ function require_domCreate() {
|
|
|
61479
61019
|
};
|
|
61480
61020
|
return _domCreate;
|
|
61481
61021
|
}
|
|
61482
|
-
var _ie8DomDefine
|
|
61483
|
-
|
|
61484
|
-
|
|
61485
|
-
|
|
61486
|
-
|
|
61487
|
-
hasRequired_ie8DomDefine = 1;
|
|
61488
|
-
_ie8DomDefine = !require_descriptors() && !_fails(function() {
|
|
61489
|
-
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
61490
|
-
return 7;
|
|
61491
|
-
} }).a != 7;
|
|
61492
|
-
});
|
|
61493
|
-
return _ie8DomDefine;
|
|
61494
|
-
}
|
|
61022
|
+
var _ie8DomDefine = !_descriptors && !_fails(function() {
|
|
61023
|
+
return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
|
|
61024
|
+
return 7;
|
|
61025
|
+
} }).a != 7;
|
|
61026
|
+
});
|
|
61495
61027
|
var isObject$f = _isObject;
|
|
61496
61028
|
var _toPrimitive = function(it, S) {
|
|
61497
61029
|
if (!isObject$f(it))
|
|
@@ -61505,32 +61037,25 @@ var _toPrimitive = function(it, S) {
|
|
|
61505
61037
|
return val;
|
|
61506
61038
|
throw TypeError("Can't convert object to primitive value");
|
|
61507
61039
|
};
|
|
61508
|
-
var
|
|
61509
|
-
|
|
61510
|
-
|
|
61511
|
-
|
|
61512
|
-
|
|
61513
|
-
|
|
61514
|
-
|
|
61515
|
-
|
|
61516
|
-
|
|
61517
|
-
|
|
61518
|
-
|
|
61519
|
-
|
|
61520
|
-
|
|
61521
|
-
|
|
61522
|
-
|
|
61523
|
-
|
|
61524
|
-
|
|
61525
|
-
|
|
61526
|
-
|
|
61527
|
-
throw TypeError("Accessors not supported!");
|
|
61528
|
-
if ("value" in Attributes2)
|
|
61529
|
-
O[P2] = Attributes2.value;
|
|
61530
|
-
return O;
|
|
61531
|
-
};
|
|
61532
|
-
return _objectDp;
|
|
61533
|
-
}
|
|
61040
|
+
var anObject$3 = _anObject;
|
|
61041
|
+
var IE8_DOM_DEFINE$1 = _ie8DomDefine;
|
|
61042
|
+
var toPrimitive$2 = _toPrimitive;
|
|
61043
|
+
var dP$3 = Object.defineProperty;
|
|
61044
|
+
_objectDp.f = _descriptors ? Object.defineProperty : function defineProperty(O, P2, Attributes2) {
|
|
61045
|
+
anObject$3(O);
|
|
61046
|
+
P2 = toPrimitive$2(P2, true);
|
|
61047
|
+
anObject$3(Attributes2);
|
|
61048
|
+
if (IE8_DOM_DEFINE$1)
|
|
61049
|
+
try {
|
|
61050
|
+
return dP$3(O, P2, Attributes2);
|
|
61051
|
+
} catch (e3) {
|
|
61052
|
+
}
|
|
61053
|
+
if ("get" in Attributes2 || "set" in Attributes2)
|
|
61054
|
+
throw TypeError("Accessors not supported!");
|
|
61055
|
+
if ("value" in Attributes2)
|
|
61056
|
+
O[P2] = Attributes2.value;
|
|
61057
|
+
return O;
|
|
61058
|
+
};
|
|
61534
61059
|
var _propertyDesc = function(bitmap, value2) {
|
|
61535
61060
|
return {
|
|
61536
61061
|
enumerable: !(bitmap & 1),
|
|
@@ -61539,9 +61064,9 @@ var _propertyDesc = function(bitmap, value2) {
|
|
|
61539
61064
|
value: value2
|
|
61540
61065
|
};
|
|
61541
61066
|
};
|
|
61542
|
-
var dP$2 =
|
|
61067
|
+
var dP$2 = _objectDp;
|
|
61543
61068
|
var createDesc$2 = _propertyDesc;
|
|
61544
|
-
var _hide =
|
|
61069
|
+
var _hide = _descriptors ? function(object2, key2, value2) {
|
|
61545
61070
|
return dP$2.f(object2, key2, createDesc$2(1, value2));
|
|
61546
61071
|
} : function(object2, key2, value2) {
|
|
61547
61072
|
object2[key2] = value2;
|
|
@@ -61744,7 +61269,7 @@ function require_objectAssign() {
|
|
|
61744
61269
|
if (hasRequired_objectAssign)
|
|
61745
61270
|
return _objectAssign;
|
|
61746
61271
|
hasRequired_objectAssign = 1;
|
|
61747
|
-
var DESCRIPTORS2 =
|
|
61272
|
+
var DESCRIPTORS2 = _descriptors;
|
|
61748
61273
|
var getKeys2 = _objectKeys$1;
|
|
61749
61274
|
var gOPS2 = _objectGops;
|
|
61750
61275
|
var pIE2 = require_objectPie();
|
|
@@ -61807,9 +61332,9 @@ var _default$i = _assign2.default || function(target2) {
|
|
|
61807
61332
|
};
|
|
61808
61333
|
var defineProperty$6 = { exports: {} };
|
|
61809
61334
|
var $export$4 = _export;
|
|
61810
|
-
$export$4($export$4.S + $export$4.F * !
|
|
61335
|
+
$export$4($export$4.S + $export$4.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
|
|
61811
61336
|
var $Object$1 = _core.exports.Object;
|
|
61812
|
-
var defineProperty$5 = function
|
|
61337
|
+
var defineProperty$5 = function defineProperty2(it, key2, desc) {
|
|
61813
61338
|
return $Object$1.defineProperty(it, key2, desc);
|
|
61814
61339
|
};
|
|
61815
61340
|
(function(module2) {
|
|
@@ -61883,10 +61408,10 @@ var _redefine = { exports: {} };
|
|
|
61883
61408
|
module2.exports = _hide;
|
|
61884
61409
|
})(_redefine);
|
|
61885
61410
|
var _iterators = {};
|
|
61886
|
-
var dP$1 =
|
|
61411
|
+
var dP$1 = _objectDp;
|
|
61887
61412
|
var anObject$2 = _anObject;
|
|
61888
61413
|
var getKeys$1 = _objectKeys$1;
|
|
61889
|
-
var _objectDps =
|
|
61414
|
+
var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
61890
61415
|
anObject$2(O);
|
|
61891
61416
|
var keys4 = getKeys$1(Properties);
|
|
61892
61417
|
var length2 = keys4.length;
|
|
@@ -61951,7 +61476,7 @@ var $exports = _wks.exports = function(name2) {
|
|
|
61951
61476
|
return store[name2] || (store[name2] = USE_SYMBOL && Symbol$7[name2] || (USE_SYMBOL ? Symbol$7 : uid$2)("Symbol." + name2));
|
|
61952
61477
|
};
|
|
61953
61478
|
$exports.store = store;
|
|
61954
|
-
var def$1 =
|
|
61479
|
+
var def$1 = _objectDp.f;
|
|
61955
61480
|
var has$8 = _has$1;
|
|
61956
61481
|
var TAG = _wks.exports("toStringTag");
|
|
61957
61482
|
var _setToStringTag = function(it, tag2, stat) {
|
|
@@ -62121,7 +61646,7 @@ var _meta$3 = { exports: {} };
|
|
|
62121
61646
|
var META$1 = _uid("meta");
|
|
62122
61647
|
var isObject$e = _isObject;
|
|
62123
61648
|
var has$6 = _has$1;
|
|
62124
|
-
var setDesc =
|
|
61649
|
+
var setDesc = _objectDp.f;
|
|
62125
61650
|
var id$2 = 0;
|
|
62126
61651
|
var isExtensible = Object.isExtensible || function() {
|
|
62127
61652
|
return true;
|
|
@@ -62171,7 +61696,7 @@ var meta$6 = _meta$3.exports = {
|
|
|
62171
61696
|
};
|
|
62172
61697
|
var core$1 = _core.exports;
|
|
62173
61698
|
var wksExt$1 = _wksExt;
|
|
62174
|
-
var defineProperty$4 =
|
|
61699
|
+
var defineProperty$4 = _objectDp.f;
|
|
62175
61700
|
var _wksDefine = function(name2) {
|
|
62176
61701
|
var $Symbol2 = core$1.Symbol || (core$1.Symbol = {});
|
|
62177
61702
|
if (name2.charAt(0) != "_" && !(name2 in $Symbol2))
|
|
@@ -62225,9 +61750,9 @@ var createDesc$1 = _propertyDesc;
|
|
|
62225
61750
|
var toIObject$1 = _toIobject;
|
|
62226
61751
|
var toPrimitive$1 = _toPrimitive;
|
|
62227
61752
|
var has$5 = _has$1;
|
|
62228
|
-
var IE8_DOM_DEFINE =
|
|
61753
|
+
var IE8_DOM_DEFINE = _ie8DomDefine;
|
|
62229
61754
|
var gOPD$4 = Object.getOwnPropertyDescriptor;
|
|
62230
|
-
_objectGopd.f =
|
|
61755
|
+
_objectGopd.f = _descriptors ? gOPD$4 : function getOwnPropertyDescriptor2(O, P2) {
|
|
62231
61756
|
O = toIObject$1(O);
|
|
62232
61757
|
P2 = toPrimitive$1(P2, true);
|
|
62233
61758
|
if (IE8_DOM_DEFINE)
|
|
@@ -62240,7 +61765,7 @@ _objectGopd.f = require_descriptors() ? gOPD$4 : function getOwnPropertyDescript
|
|
|
62240
61765
|
};
|
|
62241
61766
|
var global$2 = _global.exports;
|
|
62242
61767
|
var has$4 = _has$1;
|
|
62243
|
-
var DESCRIPTORS =
|
|
61768
|
+
var DESCRIPTORS = _descriptors;
|
|
62244
61769
|
var $export$2 = _export;
|
|
62245
61770
|
var redefine = _redefine.exports;
|
|
62246
61771
|
var META = _meta$3.exports.KEY;
|
|
@@ -62263,7 +61788,7 @@ var _create$1 = _objectCreate;
|
|
|
62263
61788
|
var gOPNExt = _objectGopnExt;
|
|
62264
61789
|
var $GOPD = _objectGopd;
|
|
62265
61790
|
var $GOPS = _objectGops;
|
|
62266
|
-
var $DP =
|
|
61791
|
+
var $DP = _objectDp;
|
|
62267
61792
|
var $keys = _objectKeys$1;
|
|
62268
61793
|
var gOPD$3 = $GOPD.f;
|
|
62269
61794
|
var dP = $DP.f;
|
|
@@ -62306,7 +61831,7 @@ var isSymbol$6 = USE_NATIVE && typeof $Symbol$1.iterator == "symbol" ? function(
|
|
|
62306
61831
|
} : function(it) {
|
|
62307
61832
|
return it instanceof $Symbol$1;
|
|
62308
61833
|
};
|
|
62309
|
-
var $defineProperty$1 = function
|
|
61834
|
+
var $defineProperty$1 = function defineProperty3(it, key2, D2) {
|
|
62310
61835
|
if (it === ObjectProto)
|
|
62311
61836
|
$defineProperty$1(OPSymbols, key2, D2);
|
|
62312
61837
|
anObject(it);
|
|
@@ -181080,16 +180605,16 @@ async function getDecoder(fileDirectory) {
|
|
|
181080
180605
|
const Decoder = await importFn();
|
|
181081
180606
|
return new Decoder(fileDirectory);
|
|
181082
180607
|
}
|
|
181083
|
-
addDecoder([void 0, 1], () => import("./raw.
|
|
181084
|
-
addDecoder(5, () => import("./lzw.
|
|
180608
|
+
addDecoder([void 0, 1], () => import("./raw.61eaecb4.mjs").then((m2) => m2.default));
|
|
180609
|
+
addDecoder(5, () => import("./lzw.3bf56bd2.mjs").then((m2) => m2.default));
|
|
181085
180610
|
addDecoder(6, () => {
|
|
181086
180611
|
throw new Error("old style JPEG compression is not supported.");
|
|
181087
180612
|
});
|
|
181088
|
-
addDecoder(7, () => import("./jpeg.
|
|
181089
|
-
addDecoder([8, 32946], () => import("./deflate.
|
|
181090
|
-
addDecoder(32773, () => import("./packbits.
|
|
181091
|
-
addDecoder(34887, () => import("./lerc.
|
|
181092
|
-
addDecoder(50001, () => import("./webimage.
|
|
180613
|
+
addDecoder(7, () => import("./jpeg.2cba0391.mjs").then((m2) => m2.default));
|
|
180614
|
+
addDecoder([8, 32946], () => import("./deflate.628654fc.mjs").then((m2) => m2.default));
|
|
180615
|
+
addDecoder(32773, () => import("./packbits.cf4e19b0.mjs").then((m2) => m2.default));
|
|
180616
|
+
addDecoder(34887, () => import("./lerc.7110c4d8.mjs").then((m2) => m2.default));
|
|
180617
|
+
addDecoder(50001, () => import("./webimage.e4333f12.mjs").then((m2) => m2.default));
|
|
181093
180618
|
function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
|
|
181094
180619
|
return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
|
|
181095
180620
|
}
|
|
@@ -184559,7 +184084,7 @@ function requireJson2xml() {
|
|
|
184559
184084
|
"attrValueProcessor",
|
|
184560
184085
|
"rootNodeName"
|
|
184561
184086
|
];
|
|
184562
|
-
function
|
|
184087
|
+
function Parser2(options) {
|
|
184563
184088
|
this.options = buildOptions2(options, defaultOptions2, props2);
|
|
184564
184089
|
if (this.options.ignoreAttributes || this.options.attrNodeName) {
|
|
184565
184090
|
this.isAttribute = function() {
|
|
@@ -184600,7 +184125,7 @@ function requireJson2xml() {
|
|
|
184600
184125
|
this.buildTextValNode = buildTextValNode;
|
|
184601
184126
|
this.buildObjectNode = buildObjectNode;
|
|
184602
184127
|
}
|
|
184603
|
-
|
|
184128
|
+
Parser2.prototype.parse = function(jObj) {
|
|
184604
184129
|
if (Array.isArray(jObj) && this.options.rootNodeName && this.options.rootNodeName.length > 1) {
|
|
184605
184130
|
jObj = {
|
|
184606
184131
|
[this.options.rootNodeName]: jObj
|
|
@@ -184608,7 +184133,7 @@ function requireJson2xml() {
|
|
|
184608
184133
|
}
|
|
184609
184134
|
return this.j2x(jObj, 0).val;
|
|
184610
184135
|
};
|
|
184611
|
-
|
|
184136
|
+
Parser2.prototype.j2x = function(jObj, level) {
|
|
184612
184137
|
let attrStr = "";
|
|
184613
184138
|
let val = "";
|
|
184614
184139
|
for (let key2 in jObj) {
|
|
@@ -184740,7 +184265,7 @@ function requireJson2xml() {
|
|
|
184740
184265
|
function isCDATA(name2) {
|
|
184741
184266
|
return name2 === this.options.cdataTagName;
|
|
184742
184267
|
}
|
|
184743
|
-
json2xml =
|
|
184268
|
+
json2xml = Parser2;
|
|
184744
184269
|
return json2xml;
|
|
184745
184270
|
}
|
|
184746
184271
|
(function(exports) {
|
|
@@ -193060,7 +192585,6 @@ const MinimumIntensityProjectionExtension = class extends BaseExtension {
|
|
|
193060
192585
|
}
|
|
193061
192586
|
};
|
|
193062
192587
|
MinimumIntensityProjectionExtension.extensionName = "MinimumIntensityProjectionExtension";
|
|
193063
|
-
const AdditiveColormap3DExtensions = { BaseExtension, AdditiveBlendExtension, MaximumIntensityProjectionExtension, MinimumIntensityProjectionExtension };
|
|
193064
192588
|
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 } };
|
|
193065
192589
|
const ImageLayer = class extends CompositeLayer {
|
|
193066
192590
|
finalizeState() {
|
|
@@ -203686,11 +203210,11 @@ var createPow = /* @__PURE__ */ factory(name$g, dependencies$f, (_ref3) => {
|
|
|
203686
203210
|
return matrix2(_powArray(x2.valueOf(), y2));
|
|
203687
203211
|
}
|
|
203688
203212
|
});
|
|
203689
|
-
var
|
|
203213
|
+
var defineProperty4 = { exports: {} };
|
|
203690
203214
|
var hasRequiredDefineProperty;
|
|
203691
203215
|
function requireDefineProperty() {
|
|
203692
203216
|
if (hasRequiredDefineProperty)
|
|
203693
|
-
return
|
|
203217
|
+
return defineProperty4.exports;
|
|
203694
203218
|
hasRequiredDefineProperty = 1;
|
|
203695
203219
|
(function(module2) {
|
|
203696
203220
|
function _defineProperty3(obj, key2, value2) {
|
|
@@ -203707,8 +203231,8 @@ function requireDefineProperty() {
|
|
|
203707
203231
|
return obj;
|
|
203708
203232
|
}
|
|
203709
203233
|
module2.exports = _defineProperty3, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
203710
|
-
})(
|
|
203711
|
-
return
|
|
203234
|
+
})(defineProperty4);
|
|
203235
|
+
return defineProperty4.exports;
|
|
203712
203236
|
}
|
|
203713
203237
|
var definePropertyExports = requireDefineProperty();
|
|
203714
203238
|
function ownKeys$3(object2, enumerableOnly) {
|
|
@@ -210169,20 +209693,20 @@ function getVivLayerExtensions(use3d, colormap, renderingMode) {
|
|
|
210169
209693
|
if (use3d) {
|
|
210170
209694
|
if (colormap) {
|
|
210171
209695
|
if (renderingMode === "Minimum Intensity Projection") {
|
|
210172
|
-
return [new
|
|
209696
|
+
return [new (void 0)()];
|
|
210173
209697
|
}
|
|
210174
209698
|
if (renderingMode === "Maximum Intensity Projection") {
|
|
210175
|
-
return [new
|
|
209699
|
+
return [new (void 0)()];
|
|
210176
209700
|
}
|
|
210177
|
-
return [new
|
|
209701
|
+
return [new (void 0)()];
|
|
210178
209702
|
}
|
|
210179
209703
|
if (renderingMode === "Minimum Intensity Projection") {
|
|
210180
|
-
return [new
|
|
209704
|
+
return [new (void 0)()];
|
|
210181
209705
|
}
|
|
210182
209706
|
if (renderingMode === "Maximum Intensity Projection") {
|
|
210183
|
-
return [new
|
|
209707
|
+
return [new (void 0)()];
|
|
210184
209708
|
}
|
|
210185
|
-
return [new
|
|
209709
|
+
return [new (void 0)()];
|
|
210186
209710
|
}
|
|
210187
209711
|
if (colormap) {
|
|
210188
209712
|
return [new AdditiveColormapExtension()];
|
|
@@ -275146,6 +274670,2112 @@ function Vitessce(props2) {
|
|
|
275146
274670
|
}, []);
|
|
275147
274671
|
return ready ? jsx(VitS, { ...props2 }) : null;
|
|
275148
274672
|
}
|
|
274673
|
+
const BROWSER_ALIASES_MAP = {
|
|
274674
|
+
"Amazon Silk": "amazon_silk",
|
|
274675
|
+
"Android Browser": "android",
|
|
274676
|
+
Bada: "bada",
|
|
274677
|
+
BlackBerry: "blackberry",
|
|
274678
|
+
Chrome: "chrome",
|
|
274679
|
+
Chromium: "chromium",
|
|
274680
|
+
Electron: "electron",
|
|
274681
|
+
Epiphany: "epiphany",
|
|
274682
|
+
Firefox: "firefox",
|
|
274683
|
+
Focus: "focus",
|
|
274684
|
+
Generic: "generic",
|
|
274685
|
+
"Google Search": "google_search",
|
|
274686
|
+
Googlebot: "googlebot",
|
|
274687
|
+
"Internet Explorer": "ie",
|
|
274688
|
+
"K-Meleon": "k_meleon",
|
|
274689
|
+
Maxthon: "maxthon",
|
|
274690
|
+
"Microsoft Edge": "edge",
|
|
274691
|
+
"MZ Browser": "mz",
|
|
274692
|
+
"NAVER Whale Browser": "naver",
|
|
274693
|
+
Opera: "opera",
|
|
274694
|
+
"Opera Coast": "opera_coast",
|
|
274695
|
+
PhantomJS: "phantomjs",
|
|
274696
|
+
Puffin: "puffin",
|
|
274697
|
+
QupZilla: "qupzilla",
|
|
274698
|
+
QQ: "qq",
|
|
274699
|
+
QQLite: "qqlite",
|
|
274700
|
+
Safari: "safari",
|
|
274701
|
+
Sailfish: "sailfish",
|
|
274702
|
+
"Samsung Internet for Android": "samsung_internet",
|
|
274703
|
+
SeaMonkey: "seamonkey",
|
|
274704
|
+
Sleipnir: "sleipnir",
|
|
274705
|
+
Swing: "swing",
|
|
274706
|
+
Tizen: "tizen",
|
|
274707
|
+
"UC Browser": "uc",
|
|
274708
|
+
Vivaldi: "vivaldi",
|
|
274709
|
+
"WebOS Browser": "webos",
|
|
274710
|
+
WeChat: "wechat",
|
|
274711
|
+
"Yandex Browser": "yandex",
|
|
274712
|
+
Roku: "roku"
|
|
274713
|
+
};
|
|
274714
|
+
const BROWSER_MAP = {
|
|
274715
|
+
amazon_silk: "Amazon Silk",
|
|
274716
|
+
android: "Android Browser",
|
|
274717
|
+
bada: "Bada",
|
|
274718
|
+
blackberry: "BlackBerry",
|
|
274719
|
+
chrome: "Chrome",
|
|
274720
|
+
chromium: "Chromium",
|
|
274721
|
+
electron: "Electron",
|
|
274722
|
+
epiphany: "Epiphany",
|
|
274723
|
+
firefox: "Firefox",
|
|
274724
|
+
focus: "Focus",
|
|
274725
|
+
generic: "Generic",
|
|
274726
|
+
googlebot: "Googlebot",
|
|
274727
|
+
google_search: "Google Search",
|
|
274728
|
+
ie: "Internet Explorer",
|
|
274729
|
+
k_meleon: "K-Meleon",
|
|
274730
|
+
maxthon: "Maxthon",
|
|
274731
|
+
edge: "Microsoft Edge",
|
|
274732
|
+
mz: "MZ Browser",
|
|
274733
|
+
naver: "NAVER Whale Browser",
|
|
274734
|
+
opera: "Opera",
|
|
274735
|
+
opera_coast: "Opera Coast",
|
|
274736
|
+
phantomjs: "PhantomJS",
|
|
274737
|
+
puffin: "Puffin",
|
|
274738
|
+
qupzilla: "QupZilla",
|
|
274739
|
+
qq: "QQ Browser",
|
|
274740
|
+
qqlite: "QQ Browser Lite",
|
|
274741
|
+
safari: "Safari",
|
|
274742
|
+
sailfish: "Sailfish",
|
|
274743
|
+
samsung_internet: "Samsung Internet for Android",
|
|
274744
|
+
seamonkey: "SeaMonkey",
|
|
274745
|
+
sleipnir: "Sleipnir",
|
|
274746
|
+
swing: "Swing",
|
|
274747
|
+
tizen: "Tizen",
|
|
274748
|
+
uc: "UC Browser",
|
|
274749
|
+
vivaldi: "Vivaldi",
|
|
274750
|
+
webos: "WebOS Browser",
|
|
274751
|
+
wechat: "WeChat",
|
|
274752
|
+
yandex: "Yandex Browser"
|
|
274753
|
+
};
|
|
274754
|
+
const PLATFORMS_MAP = {
|
|
274755
|
+
tablet: "tablet",
|
|
274756
|
+
mobile: "mobile",
|
|
274757
|
+
desktop: "desktop",
|
|
274758
|
+
tv: "tv"
|
|
274759
|
+
};
|
|
274760
|
+
const OS_MAP = {
|
|
274761
|
+
WindowsPhone: "Windows Phone",
|
|
274762
|
+
Windows: "Windows",
|
|
274763
|
+
MacOS: "macOS",
|
|
274764
|
+
iOS: "iOS",
|
|
274765
|
+
Android: "Android",
|
|
274766
|
+
WebOS: "WebOS",
|
|
274767
|
+
BlackBerry: "BlackBerry",
|
|
274768
|
+
Bada: "Bada",
|
|
274769
|
+
Tizen: "Tizen",
|
|
274770
|
+
Linux: "Linux",
|
|
274771
|
+
ChromeOS: "Chrome OS",
|
|
274772
|
+
PlayStation4: "PlayStation 4",
|
|
274773
|
+
Roku: "Roku"
|
|
274774
|
+
};
|
|
274775
|
+
const ENGINE_MAP = {
|
|
274776
|
+
EdgeHTML: "EdgeHTML",
|
|
274777
|
+
Blink: "Blink",
|
|
274778
|
+
Trident: "Trident",
|
|
274779
|
+
Presto: "Presto",
|
|
274780
|
+
Gecko: "Gecko",
|
|
274781
|
+
WebKit: "WebKit"
|
|
274782
|
+
};
|
|
274783
|
+
class Utils {
|
|
274784
|
+
static getFirstMatch(regexp, ua) {
|
|
274785
|
+
const match2 = ua.match(regexp);
|
|
274786
|
+
return match2 && match2.length > 0 && match2[1] || "";
|
|
274787
|
+
}
|
|
274788
|
+
static getSecondMatch(regexp, ua) {
|
|
274789
|
+
const match2 = ua.match(regexp);
|
|
274790
|
+
return match2 && match2.length > 1 && match2[2] || "";
|
|
274791
|
+
}
|
|
274792
|
+
static matchAndReturnConst(regexp, ua, _const2) {
|
|
274793
|
+
if (regexp.test(ua)) {
|
|
274794
|
+
return _const2;
|
|
274795
|
+
}
|
|
274796
|
+
return void 0;
|
|
274797
|
+
}
|
|
274798
|
+
static getWindowsVersionName(version2) {
|
|
274799
|
+
switch (version2) {
|
|
274800
|
+
case "NT":
|
|
274801
|
+
return "NT";
|
|
274802
|
+
case "XP":
|
|
274803
|
+
return "XP";
|
|
274804
|
+
case "NT 5.0":
|
|
274805
|
+
return "2000";
|
|
274806
|
+
case "NT 5.1":
|
|
274807
|
+
return "XP";
|
|
274808
|
+
case "NT 5.2":
|
|
274809
|
+
return "2003";
|
|
274810
|
+
case "NT 6.0":
|
|
274811
|
+
return "Vista";
|
|
274812
|
+
case "NT 6.1":
|
|
274813
|
+
return "7";
|
|
274814
|
+
case "NT 6.2":
|
|
274815
|
+
return "8";
|
|
274816
|
+
case "NT 6.3":
|
|
274817
|
+
return "8.1";
|
|
274818
|
+
case "NT 10.0":
|
|
274819
|
+
return "10";
|
|
274820
|
+
default:
|
|
274821
|
+
return void 0;
|
|
274822
|
+
}
|
|
274823
|
+
}
|
|
274824
|
+
static getMacOSVersionName(version2) {
|
|
274825
|
+
const v = version2.split(".").splice(0, 2).map((s2) => parseInt(s2, 10) || 0);
|
|
274826
|
+
v.push(0);
|
|
274827
|
+
if (v[0] !== 10)
|
|
274828
|
+
return void 0;
|
|
274829
|
+
switch (v[1]) {
|
|
274830
|
+
case 5:
|
|
274831
|
+
return "Leopard";
|
|
274832
|
+
case 6:
|
|
274833
|
+
return "Snow Leopard";
|
|
274834
|
+
case 7:
|
|
274835
|
+
return "Lion";
|
|
274836
|
+
case 8:
|
|
274837
|
+
return "Mountain Lion";
|
|
274838
|
+
case 9:
|
|
274839
|
+
return "Mavericks";
|
|
274840
|
+
case 10:
|
|
274841
|
+
return "Yosemite";
|
|
274842
|
+
case 11:
|
|
274843
|
+
return "El Capitan";
|
|
274844
|
+
case 12:
|
|
274845
|
+
return "Sierra";
|
|
274846
|
+
case 13:
|
|
274847
|
+
return "High Sierra";
|
|
274848
|
+
case 14:
|
|
274849
|
+
return "Mojave";
|
|
274850
|
+
case 15:
|
|
274851
|
+
return "Catalina";
|
|
274852
|
+
default:
|
|
274853
|
+
return void 0;
|
|
274854
|
+
}
|
|
274855
|
+
}
|
|
274856
|
+
static getAndroidVersionName(version2) {
|
|
274857
|
+
const v = version2.split(".").splice(0, 2).map((s2) => parseInt(s2, 10) || 0);
|
|
274858
|
+
v.push(0);
|
|
274859
|
+
if (v[0] === 1 && v[1] < 5)
|
|
274860
|
+
return void 0;
|
|
274861
|
+
if (v[0] === 1 && v[1] < 6)
|
|
274862
|
+
return "Cupcake";
|
|
274863
|
+
if (v[0] === 1 && v[1] >= 6)
|
|
274864
|
+
return "Donut";
|
|
274865
|
+
if (v[0] === 2 && v[1] < 2)
|
|
274866
|
+
return "Eclair";
|
|
274867
|
+
if (v[0] === 2 && v[1] === 2)
|
|
274868
|
+
return "Froyo";
|
|
274869
|
+
if (v[0] === 2 && v[1] > 2)
|
|
274870
|
+
return "Gingerbread";
|
|
274871
|
+
if (v[0] === 3)
|
|
274872
|
+
return "Honeycomb";
|
|
274873
|
+
if (v[0] === 4 && v[1] < 1)
|
|
274874
|
+
return "Ice Cream Sandwich";
|
|
274875
|
+
if (v[0] === 4 && v[1] < 4)
|
|
274876
|
+
return "Jelly Bean";
|
|
274877
|
+
if (v[0] === 4 && v[1] >= 4)
|
|
274878
|
+
return "KitKat";
|
|
274879
|
+
if (v[0] === 5)
|
|
274880
|
+
return "Lollipop";
|
|
274881
|
+
if (v[0] === 6)
|
|
274882
|
+
return "Marshmallow";
|
|
274883
|
+
if (v[0] === 7)
|
|
274884
|
+
return "Nougat";
|
|
274885
|
+
if (v[0] === 8)
|
|
274886
|
+
return "Oreo";
|
|
274887
|
+
if (v[0] === 9)
|
|
274888
|
+
return "Pie";
|
|
274889
|
+
return void 0;
|
|
274890
|
+
}
|
|
274891
|
+
static getVersionPrecision(version2) {
|
|
274892
|
+
return version2.split(".").length;
|
|
274893
|
+
}
|
|
274894
|
+
static compareVersions(versionA, versionB, isLoose = false) {
|
|
274895
|
+
const versionAPrecision = Utils.getVersionPrecision(versionA);
|
|
274896
|
+
const versionBPrecision = Utils.getVersionPrecision(versionB);
|
|
274897
|
+
let precision = Math.max(versionAPrecision, versionBPrecision);
|
|
274898
|
+
let lastPrecision = 0;
|
|
274899
|
+
const chunks = Utils.map([versionA, versionB], (version2) => {
|
|
274900
|
+
const delta = precision - Utils.getVersionPrecision(version2);
|
|
274901
|
+
const _version = version2 + new Array(delta + 1).join(".0");
|
|
274902
|
+
return Utils.map(_version.split("."), (chunk) => new Array(20 - chunk.length).join("0") + chunk).reverse();
|
|
274903
|
+
});
|
|
274904
|
+
if (isLoose) {
|
|
274905
|
+
lastPrecision = precision - Math.min(versionAPrecision, versionBPrecision);
|
|
274906
|
+
}
|
|
274907
|
+
precision -= 1;
|
|
274908
|
+
while (precision >= lastPrecision) {
|
|
274909
|
+
if (chunks[0][precision] > chunks[1][precision]) {
|
|
274910
|
+
return 1;
|
|
274911
|
+
}
|
|
274912
|
+
if (chunks[0][precision] === chunks[1][precision]) {
|
|
274913
|
+
if (precision === lastPrecision) {
|
|
274914
|
+
return 0;
|
|
274915
|
+
}
|
|
274916
|
+
precision -= 1;
|
|
274917
|
+
} else if (chunks[0][precision] < chunks[1][precision]) {
|
|
274918
|
+
return -1;
|
|
274919
|
+
}
|
|
274920
|
+
}
|
|
274921
|
+
return void 0;
|
|
274922
|
+
}
|
|
274923
|
+
static map(arr, iterator2) {
|
|
274924
|
+
const result = [];
|
|
274925
|
+
let i2;
|
|
274926
|
+
if (Array.prototype.map) {
|
|
274927
|
+
return Array.prototype.map.call(arr, iterator2);
|
|
274928
|
+
}
|
|
274929
|
+
for (i2 = 0; i2 < arr.length; i2 += 1) {
|
|
274930
|
+
result.push(iterator2(arr[i2]));
|
|
274931
|
+
}
|
|
274932
|
+
return result;
|
|
274933
|
+
}
|
|
274934
|
+
static find(arr, predicate) {
|
|
274935
|
+
let i2;
|
|
274936
|
+
let l2;
|
|
274937
|
+
if (Array.prototype.find) {
|
|
274938
|
+
return Array.prototype.find.call(arr, predicate);
|
|
274939
|
+
}
|
|
274940
|
+
for (i2 = 0, l2 = arr.length; i2 < l2; i2 += 1) {
|
|
274941
|
+
const value2 = arr[i2];
|
|
274942
|
+
if (predicate(value2, i2)) {
|
|
274943
|
+
return value2;
|
|
274944
|
+
}
|
|
274945
|
+
}
|
|
274946
|
+
return void 0;
|
|
274947
|
+
}
|
|
274948
|
+
static assign(obj, ...assigners) {
|
|
274949
|
+
const result = obj;
|
|
274950
|
+
let i2;
|
|
274951
|
+
let l2;
|
|
274952
|
+
if (Object.assign) {
|
|
274953
|
+
return Object.assign(obj, ...assigners);
|
|
274954
|
+
}
|
|
274955
|
+
for (i2 = 0, l2 = assigners.length; i2 < l2; i2 += 1) {
|
|
274956
|
+
const assigner = assigners[i2];
|
|
274957
|
+
if (typeof assigner === "object" && assigner !== null) {
|
|
274958
|
+
const keys4 = Object.keys(assigner);
|
|
274959
|
+
keys4.forEach((key2) => {
|
|
274960
|
+
result[key2] = assigner[key2];
|
|
274961
|
+
});
|
|
274962
|
+
}
|
|
274963
|
+
}
|
|
274964
|
+
return obj;
|
|
274965
|
+
}
|
|
274966
|
+
static getBrowserAlias(browserName) {
|
|
274967
|
+
return BROWSER_ALIASES_MAP[browserName];
|
|
274968
|
+
}
|
|
274969
|
+
static getBrowserTypeByAlias(browserAlias) {
|
|
274970
|
+
return BROWSER_MAP[browserAlias] || "";
|
|
274971
|
+
}
|
|
274972
|
+
}
|
|
274973
|
+
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
|
274974
|
+
const browsersList = [
|
|
274975
|
+
{
|
|
274976
|
+
test: [/googlebot/i],
|
|
274977
|
+
describe(ua) {
|
|
274978
|
+
const browser2 = {
|
|
274979
|
+
name: "Googlebot"
|
|
274980
|
+
};
|
|
274981
|
+
const version2 = Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
274982
|
+
if (version2) {
|
|
274983
|
+
browser2.version = version2;
|
|
274984
|
+
}
|
|
274985
|
+
return browser2;
|
|
274986
|
+
}
|
|
274987
|
+
},
|
|
274988
|
+
{
|
|
274989
|
+
test: [/opera/i],
|
|
274990
|
+
describe(ua) {
|
|
274991
|
+
const browser2 = {
|
|
274992
|
+
name: "Opera"
|
|
274993
|
+
};
|
|
274994
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
274995
|
+
if (version2) {
|
|
274996
|
+
browser2.version = version2;
|
|
274997
|
+
}
|
|
274998
|
+
return browser2;
|
|
274999
|
+
}
|
|
275000
|
+
},
|
|
275001
|
+
{
|
|
275002
|
+
test: [/opr\/|opios/i],
|
|
275003
|
+
describe(ua) {
|
|
275004
|
+
const browser2 = {
|
|
275005
|
+
name: "Opera"
|
|
275006
|
+
};
|
|
275007
|
+
const version2 = Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275008
|
+
if (version2) {
|
|
275009
|
+
browser2.version = version2;
|
|
275010
|
+
}
|
|
275011
|
+
return browser2;
|
|
275012
|
+
}
|
|
275013
|
+
},
|
|
275014
|
+
{
|
|
275015
|
+
test: [/SamsungBrowser/i],
|
|
275016
|
+
describe(ua) {
|
|
275017
|
+
const browser2 = {
|
|
275018
|
+
name: "Samsung Internet for Android"
|
|
275019
|
+
};
|
|
275020
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275021
|
+
if (version2) {
|
|
275022
|
+
browser2.version = version2;
|
|
275023
|
+
}
|
|
275024
|
+
return browser2;
|
|
275025
|
+
}
|
|
275026
|
+
},
|
|
275027
|
+
{
|
|
275028
|
+
test: [/Whale/i],
|
|
275029
|
+
describe(ua) {
|
|
275030
|
+
const browser2 = {
|
|
275031
|
+
name: "NAVER Whale Browser"
|
|
275032
|
+
};
|
|
275033
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, ua);
|
|
275034
|
+
if (version2) {
|
|
275035
|
+
browser2.version = version2;
|
|
275036
|
+
}
|
|
275037
|
+
return browser2;
|
|
275038
|
+
}
|
|
275039
|
+
},
|
|
275040
|
+
{
|
|
275041
|
+
test: [/MZBrowser/i],
|
|
275042
|
+
describe(ua) {
|
|
275043
|
+
const browser2 = {
|
|
275044
|
+
name: "MZ Browser"
|
|
275045
|
+
};
|
|
275046
|
+
const version2 = Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275047
|
+
if (version2) {
|
|
275048
|
+
browser2.version = version2;
|
|
275049
|
+
}
|
|
275050
|
+
return browser2;
|
|
275051
|
+
}
|
|
275052
|
+
},
|
|
275053
|
+
{
|
|
275054
|
+
test: [/focus/i],
|
|
275055
|
+
describe(ua) {
|
|
275056
|
+
const browser2 = {
|
|
275057
|
+
name: "Focus"
|
|
275058
|
+
};
|
|
275059
|
+
const version2 = Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275060
|
+
if (version2) {
|
|
275061
|
+
browser2.version = version2;
|
|
275062
|
+
}
|
|
275063
|
+
return browser2;
|
|
275064
|
+
}
|
|
275065
|
+
},
|
|
275066
|
+
{
|
|
275067
|
+
test: [/swing/i],
|
|
275068
|
+
describe(ua) {
|
|
275069
|
+
const browser2 = {
|
|
275070
|
+
name: "Swing"
|
|
275071
|
+
};
|
|
275072
|
+
const version2 = Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275073
|
+
if (version2) {
|
|
275074
|
+
browser2.version = version2;
|
|
275075
|
+
}
|
|
275076
|
+
return browser2;
|
|
275077
|
+
}
|
|
275078
|
+
},
|
|
275079
|
+
{
|
|
275080
|
+
test: [/coast/i],
|
|
275081
|
+
describe(ua) {
|
|
275082
|
+
const browser2 = {
|
|
275083
|
+
name: "Opera Coast"
|
|
275084
|
+
};
|
|
275085
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275086
|
+
if (version2) {
|
|
275087
|
+
browser2.version = version2;
|
|
275088
|
+
}
|
|
275089
|
+
return browser2;
|
|
275090
|
+
}
|
|
275091
|
+
},
|
|
275092
|
+
{
|
|
275093
|
+
test: [/opt\/\d+(?:.?_?\d+)+/i],
|
|
275094
|
+
describe(ua) {
|
|
275095
|
+
const browser2 = {
|
|
275096
|
+
name: "Opera Touch"
|
|
275097
|
+
};
|
|
275098
|
+
const version2 = Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275099
|
+
if (version2) {
|
|
275100
|
+
browser2.version = version2;
|
|
275101
|
+
}
|
|
275102
|
+
return browser2;
|
|
275103
|
+
}
|
|
275104
|
+
},
|
|
275105
|
+
{
|
|
275106
|
+
test: [/yabrowser/i],
|
|
275107
|
+
describe(ua) {
|
|
275108
|
+
const browser2 = {
|
|
275109
|
+
name: "Yandex Browser"
|
|
275110
|
+
};
|
|
275111
|
+
const version2 = Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275112
|
+
if (version2) {
|
|
275113
|
+
browser2.version = version2;
|
|
275114
|
+
}
|
|
275115
|
+
return browser2;
|
|
275116
|
+
}
|
|
275117
|
+
},
|
|
275118
|
+
{
|
|
275119
|
+
test: [/ucbrowser/i],
|
|
275120
|
+
describe(ua) {
|
|
275121
|
+
const browser2 = {
|
|
275122
|
+
name: "UC Browser"
|
|
275123
|
+
};
|
|
275124
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275125
|
+
if (version2) {
|
|
275126
|
+
browser2.version = version2;
|
|
275127
|
+
}
|
|
275128
|
+
return browser2;
|
|
275129
|
+
}
|
|
275130
|
+
},
|
|
275131
|
+
{
|
|
275132
|
+
test: [/Maxthon|mxios/i],
|
|
275133
|
+
describe(ua) {
|
|
275134
|
+
const browser2 = {
|
|
275135
|
+
name: "Maxthon"
|
|
275136
|
+
};
|
|
275137
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275138
|
+
if (version2) {
|
|
275139
|
+
browser2.version = version2;
|
|
275140
|
+
}
|
|
275141
|
+
return browser2;
|
|
275142
|
+
}
|
|
275143
|
+
},
|
|
275144
|
+
{
|
|
275145
|
+
test: [/epiphany/i],
|
|
275146
|
+
describe(ua) {
|
|
275147
|
+
const browser2 = {
|
|
275148
|
+
name: "Epiphany"
|
|
275149
|
+
};
|
|
275150
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275151
|
+
if (version2) {
|
|
275152
|
+
browser2.version = version2;
|
|
275153
|
+
}
|
|
275154
|
+
return browser2;
|
|
275155
|
+
}
|
|
275156
|
+
},
|
|
275157
|
+
{
|
|
275158
|
+
test: [/puffin/i],
|
|
275159
|
+
describe(ua) {
|
|
275160
|
+
const browser2 = {
|
|
275161
|
+
name: "Puffin"
|
|
275162
|
+
};
|
|
275163
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275164
|
+
if (version2) {
|
|
275165
|
+
browser2.version = version2;
|
|
275166
|
+
}
|
|
275167
|
+
return browser2;
|
|
275168
|
+
}
|
|
275169
|
+
},
|
|
275170
|
+
{
|
|
275171
|
+
test: [/sleipnir/i],
|
|
275172
|
+
describe(ua) {
|
|
275173
|
+
const browser2 = {
|
|
275174
|
+
name: "Sleipnir"
|
|
275175
|
+
};
|
|
275176
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275177
|
+
if (version2) {
|
|
275178
|
+
browser2.version = version2;
|
|
275179
|
+
}
|
|
275180
|
+
return browser2;
|
|
275181
|
+
}
|
|
275182
|
+
},
|
|
275183
|
+
{
|
|
275184
|
+
test: [/k-meleon/i],
|
|
275185
|
+
describe(ua) {
|
|
275186
|
+
const browser2 = {
|
|
275187
|
+
name: "K-Meleon"
|
|
275188
|
+
};
|
|
275189
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275190
|
+
if (version2) {
|
|
275191
|
+
browser2.version = version2;
|
|
275192
|
+
}
|
|
275193
|
+
return browser2;
|
|
275194
|
+
}
|
|
275195
|
+
},
|
|
275196
|
+
{
|
|
275197
|
+
test: [/micromessenger/i],
|
|
275198
|
+
describe(ua) {
|
|
275199
|
+
const browser2 = {
|
|
275200
|
+
name: "WeChat"
|
|
275201
|
+
};
|
|
275202
|
+
const version2 = Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275203
|
+
if (version2) {
|
|
275204
|
+
browser2.version = version2;
|
|
275205
|
+
}
|
|
275206
|
+
return browser2;
|
|
275207
|
+
}
|
|
275208
|
+
},
|
|
275209
|
+
{
|
|
275210
|
+
test: [/qqbrowser/i],
|
|
275211
|
+
describe(ua) {
|
|
275212
|
+
const browser2 = {
|
|
275213
|
+
name: /qqbrowserlite/i.test(ua) ? "QQ Browser Lite" : "QQ Browser"
|
|
275214
|
+
};
|
|
275215
|
+
const version2 = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275216
|
+
if (version2) {
|
|
275217
|
+
browser2.version = version2;
|
|
275218
|
+
}
|
|
275219
|
+
return browser2;
|
|
275220
|
+
}
|
|
275221
|
+
},
|
|
275222
|
+
{
|
|
275223
|
+
test: [/msie|trident/i],
|
|
275224
|
+
describe(ua) {
|
|
275225
|
+
const browser2 = {
|
|
275226
|
+
name: "Internet Explorer"
|
|
275227
|
+
};
|
|
275228
|
+
const version2 = Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, ua);
|
|
275229
|
+
if (version2) {
|
|
275230
|
+
browser2.version = version2;
|
|
275231
|
+
}
|
|
275232
|
+
return browser2;
|
|
275233
|
+
}
|
|
275234
|
+
},
|
|
275235
|
+
{
|
|
275236
|
+
test: [/\sedg\//i],
|
|
275237
|
+
describe(ua) {
|
|
275238
|
+
const browser2 = {
|
|
275239
|
+
name: "Microsoft Edge"
|
|
275240
|
+
};
|
|
275241
|
+
const version2 = Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275242
|
+
if (version2) {
|
|
275243
|
+
browser2.version = version2;
|
|
275244
|
+
}
|
|
275245
|
+
return browser2;
|
|
275246
|
+
}
|
|
275247
|
+
},
|
|
275248
|
+
{
|
|
275249
|
+
test: [/edg([ea]|ios)/i],
|
|
275250
|
+
describe(ua) {
|
|
275251
|
+
const browser2 = {
|
|
275252
|
+
name: "Microsoft Edge"
|
|
275253
|
+
};
|
|
275254
|
+
const version2 = Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275255
|
+
if (version2) {
|
|
275256
|
+
browser2.version = version2;
|
|
275257
|
+
}
|
|
275258
|
+
return browser2;
|
|
275259
|
+
}
|
|
275260
|
+
},
|
|
275261
|
+
{
|
|
275262
|
+
test: [/vivaldi/i],
|
|
275263
|
+
describe(ua) {
|
|
275264
|
+
const browser2 = {
|
|
275265
|
+
name: "Vivaldi"
|
|
275266
|
+
};
|
|
275267
|
+
const version2 = Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275268
|
+
if (version2) {
|
|
275269
|
+
browser2.version = version2;
|
|
275270
|
+
}
|
|
275271
|
+
return browser2;
|
|
275272
|
+
}
|
|
275273
|
+
},
|
|
275274
|
+
{
|
|
275275
|
+
test: [/seamonkey/i],
|
|
275276
|
+
describe(ua) {
|
|
275277
|
+
const browser2 = {
|
|
275278
|
+
name: "SeaMonkey"
|
|
275279
|
+
};
|
|
275280
|
+
const version2 = Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275281
|
+
if (version2) {
|
|
275282
|
+
browser2.version = version2;
|
|
275283
|
+
}
|
|
275284
|
+
return browser2;
|
|
275285
|
+
}
|
|
275286
|
+
},
|
|
275287
|
+
{
|
|
275288
|
+
test: [/sailfish/i],
|
|
275289
|
+
describe(ua) {
|
|
275290
|
+
const browser2 = {
|
|
275291
|
+
name: "Sailfish"
|
|
275292
|
+
};
|
|
275293
|
+
const version2 = Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, ua);
|
|
275294
|
+
if (version2) {
|
|
275295
|
+
browser2.version = version2;
|
|
275296
|
+
}
|
|
275297
|
+
return browser2;
|
|
275298
|
+
}
|
|
275299
|
+
},
|
|
275300
|
+
{
|
|
275301
|
+
test: [/silk/i],
|
|
275302
|
+
describe(ua) {
|
|
275303
|
+
const browser2 = {
|
|
275304
|
+
name: "Amazon Silk"
|
|
275305
|
+
};
|
|
275306
|
+
const version2 = Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275307
|
+
if (version2) {
|
|
275308
|
+
browser2.version = version2;
|
|
275309
|
+
}
|
|
275310
|
+
return browser2;
|
|
275311
|
+
}
|
|
275312
|
+
},
|
|
275313
|
+
{
|
|
275314
|
+
test: [/phantom/i],
|
|
275315
|
+
describe(ua) {
|
|
275316
|
+
const browser2 = {
|
|
275317
|
+
name: "PhantomJS"
|
|
275318
|
+
};
|
|
275319
|
+
const version2 = Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275320
|
+
if (version2) {
|
|
275321
|
+
browser2.version = version2;
|
|
275322
|
+
}
|
|
275323
|
+
return browser2;
|
|
275324
|
+
}
|
|
275325
|
+
},
|
|
275326
|
+
{
|
|
275327
|
+
test: [/slimerjs/i],
|
|
275328
|
+
describe(ua) {
|
|
275329
|
+
const browser2 = {
|
|
275330
|
+
name: "SlimerJS"
|
|
275331
|
+
};
|
|
275332
|
+
const version2 = Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275333
|
+
if (version2) {
|
|
275334
|
+
browser2.version = version2;
|
|
275335
|
+
}
|
|
275336
|
+
return browser2;
|
|
275337
|
+
}
|
|
275338
|
+
},
|
|
275339
|
+
{
|
|
275340
|
+
test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
|
|
275341
|
+
describe(ua) {
|
|
275342
|
+
const browser2 = {
|
|
275343
|
+
name: "BlackBerry"
|
|
275344
|
+
};
|
|
275345
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275346
|
+
if (version2) {
|
|
275347
|
+
browser2.version = version2;
|
|
275348
|
+
}
|
|
275349
|
+
return browser2;
|
|
275350
|
+
}
|
|
275351
|
+
},
|
|
275352
|
+
{
|
|
275353
|
+
test: [/(web|hpw)[o0]s/i],
|
|
275354
|
+
describe(ua) {
|
|
275355
|
+
const browser2 = {
|
|
275356
|
+
name: "WebOS Browser"
|
|
275357
|
+
};
|
|
275358
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275359
|
+
if (version2) {
|
|
275360
|
+
browser2.version = version2;
|
|
275361
|
+
}
|
|
275362
|
+
return browser2;
|
|
275363
|
+
}
|
|
275364
|
+
},
|
|
275365
|
+
{
|
|
275366
|
+
test: [/bada/i],
|
|
275367
|
+
describe(ua) {
|
|
275368
|
+
const browser2 = {
|
|
275369
|
+
name: "Bada"
|
|
275370
|
+
};
|
|
275371
|
+
const version2 = Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275372
|
+
if (version2) {
|
|
275373
|
+
browser2.version = version2;
|
|
275374
|
+
}
|
|
275375
|
+
return browser2;
|
|
275376
|
+
}
|
|
275377
|
+
},
|
|
275378
|
+
{
|
|
275379
|
+
test: [/tizen/i],
|
|
275380
|
+
describe(ua) {
|
|
275381
|
+
const browser2 = {
|
|
275382
|
+
name: "Tizen"
|
|
275383
|
+
};
|
|
275384
|
+
const version2 = Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275385
|
+
if (version2) {
|
|
275386
|
+
browser2.version = version2;
|
|
275387
|
+
}
|
|
275388
|
+
return browser2;
|
|
275389
|
+
}
|
|
275390
|
+
},
|
|
275391
|
+
{
|
|
275392
|
+
test: [/qupzilla/i],
|
|
275393
|
+
describe(ua) {
|
|
275394
|
+
const browser2 = {
|
|
275395
|
+
name: "QupZilla"
|
|
275396
|
+
};
|
|
275397
|
+
const version2 = Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275398
|
+
if (version2) {
|
|
275399
|
+
browser2.version = version2;
|
|
275400
|
+
}
|
|
275401
|
+
return browser2;
|
|
275402
|
+
}
|
|
275403
|
+
},
|
|
275404
|
+
{
|
|
275405
|
+
test: [/firefox|iceweasel|fxios/i],
|
|
275406
|
+
describe(ua) {
|
|
275407
|
+
const browser2 = {
|
|
275408
|
+
name: "Firefox"
|
|
275409
|
+
};
|
|
275410
|
+
const version2 = Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275411
|
+
if (version2) {
|
|
275412
|
+
browser2.version = version2;
|
|
275413
|
+
}
|
|
275414
|
+
return browser2;
|
|
275415
|
+
}
|
|
275416
|
+
},
|
|
275417
|
+
{
|
|
275418
|
+
test: [/electron/i],
|
|
275419
|
+
describe(ua) {
|
|
275420
|
+
const browser2 = {
|
|
275421
|
+
name: "Electron"
|
|
275422
|
+
};
|
|
275423
|
+
const version2 = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275424
|
+
if (version2) {
|
|
275425
|
+
browser2.version = version2;
|
|
275426
|
+
}
|
|
275427
|
+
return browser2;
|
|
275428
|
+
}
|
|
275429
|
+
},
|
|
275430
|
+
{
|
|
275431
|
+
test: [/MiuiBrowser/i],
|
|
275432
|
+
describe(ua) {
|
|
275433
|
+
const browser2 = {
|
|
275434
|
+
name: "Miui"
|
|
275435
|
+
};
|
|
275436
|
+
const version2 = Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
275437
|
+
if (version2) {
|
|
275438
|
+
browser2.version = version2;
|
|
275439
|
+
}
|
|
275440
|
+
return browser2;
|
|
275441
|
+
}
|
|
275442
|
+
},
|
|
275443
|
+
{
|
|
275444
|
+
test: [/chromium/i],
|
|
275445
|
+
describe(ua) {
|
|
275446
|
+
const browser2 = {
|
|
275447
|
+
name: "Chromium"
|
|
275448
|
+
};
|
|
275449
|
+
const version2 = Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275450
|
+
if (version2) {
|
|
275451
|
+
browser2.version = version2;
|
|
275452
|
+
}
|
|
275453
|
+
return browser2;
|
|
275454
|
+
}
|
|
275455
|
+
},
|
|
275456
|
+
{
|
|
275457
|
+
test: [/chrome|crios|crmo/i],
|
|
275458
|
+
describe(ua) {
|
|
275459
|
+
const browser2 = {
|
|
275460
|
+
name: "Chrome"
|
|
275461
|
+
};
|
|
275462
|
+
const version2 = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275463
|
+
if (version2) {
|
|
275464
|
+
browser2.version = version2;
|
|
275465
|
+
}
|
|
275466
|
+
return browser2;
|
|
275467
|
+
}
|
|
275468
|
+
},
|
|
275469
|
+
{
|
|
275470
|
+
test: [/GSA/i],
|
|
275471
|
+
describe(ua) {
|
|
275472
|
+
const browser2 = {
|
|
275473
|
+
name: "Google Search"
|
|
275474
|
+
};
|
|
275475
|
+
const version2 = Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275476
|
+
if (version2) {
|
|
275477
|
+
browser2.version = version2;
|
|
275478
|
+
}
|
|
275479
|
+
return browser2;
|
|
275480
|
+
}
|
|
275481
|
+
},
|
|
275482
|
+
{
|
|
275483
|
+
test(parser2) {
|
|
275484
|
+
const notLikeAndroid = !parser2.test(/like android/i);
|
|
275485
|
+
const butAndroid = parser2.test(/android/i);
|
|
275486
|
+
return notLikeAndroid && butAndroid;
|
|
275487
|
+
},
|
|
275488
|
+
describe(ua) {
|
|
275489
|
+
const browser2 = {
|
|
275490
|
+
name: "Android Browser"
|
|
275491
|
+
};
|
|
275492
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275493
|
+
if (version2) {
|
|
275494
|
+
browser2.version = version2;
|
|
275495
|
+
}
|
|
275496
|
+
return browser2;
|
|
275497
|
+
}
|
|
275498
|
+
},
|
|
275499
|
+
{
|
|
275500
|
+
test: [/playstation 4/i],
|
|
275501
|
+
describe(ua) {
|
|
275502
|
+
const browser2 = {
|
|
275503
|
+
name: "PlayStation 4"
|
|
275504
|
+
};
|
|
275505
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275506
|
+
if (version2) {
|
|
275507
|
+
browser2.version = version2;
|
|
275508
|
+
}
|
|
275509
|
+
return browser2;
|
|
275510
|
+
}
|
|
275511
|
+
},
|
|
275512
|
+
{
|
|
275513
|
+
test: [/safari|applewebkit/i],
|
|
275514
|
+
describe(ua) {
|
|
275515
|
+
const browser2 = {
|
|
275516
|
+
name: "Safari"
|
|
275517
|
+
};
|
|
275518
|
+
const version2 = Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
275519
|
+
if (version2) {
|
|
275520
|
+
browser2.version = version2;
|
|
275521
|
+
}
|
|
275522
|
+
return browser2;
|
|
275523
|
+
}
|
|
275524
|
+
},
|
|
275525
|
+
{
|
|
275526
|
+
test: [/.*/i],
|
|
275527
|
+
describe(ua) {
|
|
275528
|
+
const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
|
|
275529
|
+
const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
|
|
275530
|
+
const hasDeviceSpec = ua.search("\\(") !== -1;
|
|
275531
|
+
const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;
|
|
275532
|
+
return {
|
|
275533
|
+
name: Utils.getFirstMatch(regexp, ua),
|
|
275534
|
+
version: Utils.getSecondMatch(regexp, ua)
|
|
275535
|
+
};
|
|
275536
|
+
}
|
|
275537
|
+
}
|
|
275538
|
+
];
|
|
275539
|
+
const osParsersList = [
|
|
275540
|
+
{
|
|
275541
|
+
test: [/Roku\/DVP/],
|
|
275542
|
+
describe(ua) {
|
|
275543
|
+
const version2 = Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, ua);
|
|
275544
|
+
return {
|
|
275545
|
+
name: OS_MAP.Roku,
|
|
275546
|
+
version: version2
|
|
275547
|
+
};
|
|
275548
|
+
}
|
|
275549
|
+
},
|
|
275550
|
+
{
|
|
275551
|
+
test: [/windows phone/i],
|
|
275552
|
+
describe(ua) {
|
|
275553
|
+
const version2 = Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, ua);
|
|
275554
|
+
return {
|
|
275555
|
+
name: OS_MAP.WindowsPhone,
|
|
275556
|
+
version: version2
|
|
275557
|
+
};
|
|
275558
|
+
}
|
|
275559
|
+
},
|
|
275560
|
+
{
|
|
275561
|
+
test: [/windows /i],
|
|
275562
|
+
describe(ua) {
|
|
275563
|
+
const version2 = Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua);
|
|
275564
|
+
const versionName = Utils.getWindowsVersionName(version2);
|
|
275565
|
+
return {
|
|
275566
|
+
name: OS_MAP.Windows,
|
|
275567
|
+
version: version2,
|
|
275568
|
+
versionName
|
|
275569
|
+
};
|
|
275570
|
+
}
|
|
275571
|
+
},
|
|
275572
|
+
{
|
|
275573
|
+
test: [/Macintosh(.*?) FxiOS(.*?)\//],
|
|
275574
|
+
describe(ua) {
|
|
275575
|
+
const result = {
|
|
275576
|
+
name: OS_MAP.iOS
|
|
275577
|
+
};
|
|
275578
|
+
const version2 = Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/, ua);
|
|
275579
|
+
if (version2) {
|
|
275580
|
+
result.version = version2;
|
|
275581
|
+
}
|
|
275582
|
+
return result;
|
|
275583
|
+
}
|
|
275584
|
+
},
|
|
275585
|
+
{
|
|
275586
|
+
test: [/macintosh/i],
|
|
275587
|
+
describe(ua) {
|
|
275588
|
+
const version2 = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, ".");
|
|
275589
|
+
const versionName = Utils.getMacOSVersionName(version2);
|
|
275590
|
+
const os = {
|
|
275591
|
+
name: OS_MAP.MacOS,
|
|
275592
|
+
version: version2
|
|
275593
|
+
};
|
|
275594
|
+
if (versionName) {
|
|
275595
|
+
os.versionName = versionName;
|
|
275596
|
+
}
|
|
275597
|
+
return os;
|
|
275598
|
+
}
|
|
275599
|
+
},
|
|
275600
|
+
{
|
|
275601
|
+
test: [/(ipod|iphone|ipad)/i],
|
|
275602
|
+
describe(ua) {
|
|
275603
|
+
const version2 = Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, ua).replace(/[_\s]/g, ".");
|
|
275604
|
+
return {
|
|
275605
|
+
name: OS_MAP.iOS,
|
|
275606
|
+
version: version2
|
|
275607
|
+
};
|
|
275608
|
+
}
|
|
275609
|
+
},
|
|
275610
|
+
{
|
|
275611
|
+
test(parser2) {
|
|
275612
|
+
const notLikeAndroid = !parser2.test(/like android/i);
|
|
275613
|
+
const butAndroid = parser2.test(/android/i);
|
|
275614
|
+
return notLikeAndroid && butAndroid;
|
|
275615
|
+
},
|
|
275616
|
+
describe(ua) {
|
|
275617
|
+
const version2 = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua);
|
|
275618
|
+
const versionName = Utils.getAndroidVersionName(version2);
|
|
275619
|
+
const os = {
|
|
275620
|
+
name: OS_MAP.Android,
|
|
275621
|
+
version: version2
|
|
275622
|
+
};
|
|
275623
|
+
if (versionName) {
|
|
275624
|
+
os.versionName = versionName;
|
|
275625
|
+
}
|
|
275626
|
+
return os;
|
|
275627
|
+
}
|
|
275628
|
+
},
|
|
275629
|
+
{
|
|
275630
|
+
test: [/(web|hpw)[o0]s/i],
|
|
275631
|
+
describe(ua) {
|
|
275632
|
+
const version2 = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua);
|
|
275633
|
+
const os = {
|
|
275634
|
+
name: OS_MAP.WebOS
|
|
275635
|
+
};
|
|
275636
|
+
if (version2 && version2.length) {
|
|
275637
|
+
os.version = version2;
|
|
275638
|
+
}
|
|
275639
|
+
return os;
|
|
275640
|
+
}
|
|
275641
|
+
},
|
|
275642
|
+
{
|
|
275643
|
+
test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
|
|
275644
|
+
describe(ua) {
|
|
275645
|
+
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);
|
|
275646
|
+
return {
|
|
275647
|
+
name: OS_MAP.BlackBerry,
|
|
275648
|
+
version: version2
|
|
275649
|
+
};
|
|
275650
|
+
}
|
|
275651
|
+
},
|
|
275652
|
+
{
|
|
275653
|
+
test: [/bada/i],
|
|
275654
|
+
describe(ua) {
|
|
275655
|
+
const version2 = Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, ua);
|
|
275656
|
+
return {
|
|
275657
|
+
name: OS_MAP.Bada,
|
|
275658
|
+
version: version2
|
|
275659
|
+
};
|
|
275660
|
+
}
|
|
275661
|
+
},
|
|
275662
|
+
{
|
|
275663
|
+
test: [/tizen/i],
|
|
275664
|
+
describe(ua) {
|
|
275665
|
+
const version2 = Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, ua);
|
|
275666
|
+
return {
|
|
275667
|
+
name: OS_MAP.Tizen,
|
|
275668
|
+
version: version2
|
|
275669
|
+
};
|
|
275670
|
+
}
|
|
275671
|
+
},
|
|
275672
|
+
{
|
|
275673
|
+
test: [/linux/i],
|
|
275674
|
+
describe() {
|
|
275675
|
+
return {
|
|
275676
|
+
name: OS_MAP.Linux
|
|
275677
|
+
};
|
|
275678
|
+
}
|
|
275679
|
+
},
|
|
275680
|
+
{
|
|
275681
|
+
test: [/CrOS/],
|
|
275682
|
+
describe() {
|
|
275683
|
+
return {
|
|
275684
|
+
name: OS_MAP.ChromeOS
|
|
275685
|
+
};
|
|
275686
|
+
}
|
|
275687
|
+
},
|
|
275688
|
+
{
|
|
275689
|
+
test: [/PlayStation 4/],
|
|
275690
|
+
describe(ua) {
|
|
275691
|
+
const version2 = Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, ua);
|
|
275692
|
+
return {
|
|
275693
|
+
name: OS_MAP.PlayStation4,
|
|
275694
|
+
version: version2
|
|
275695
|
+
};
|
|
275696
|
+
}
|
|
275697
|
+
}
|
|
275698
|
+
];
|
|
275699
|
+
const platformParsersList = [
|
|
275700
|
+
{
|
|
275701
|
+
test: [/googlebot/i],
|
|
275702
|
+
describe() {
|
|
275703
|
+
return {
|
|
275704
|
+
type: "bot",
|
|
275705
|
+
vendor: "Google"
|
|
275706
|
+
};
|
|
275707
|
+
}
|
|
275708
|
+
},
|
|
275709
|
+
{
|
|
275710
|
+
test: [/huawei/i],
|
|
275711
|
+
describe(ua) {
|
|
275712
|
+
const model = Utils.getFirstMatch(/(can-l01)/i, ua) && "Nova";
|
|
275713
|
+
const platform = {
|
|
275714
|
+
type: PLATFORMS_MAP.mobile,
|
|
275715
|
+
vendor: "Huawei"
|
|
275716
|
+
};
|
|
275717
|
+
if (model) {
|
|
275718
|
+
platform.model = model;
|
|
275719
|
+
}
|
|
275720
|
+
return platform;
|
|
275721
|
+
}
|
|
275722
|
+
},
|
|
275723
|
+
{
|
|
275724
|
+
test: [/nexus\s*(?:7|8|9|10).*/i],
|
|
275725
|
+
describe() {
|
|
275726
|
+
return {
|
|
275727
|
+
type: PLATFORMS_MAP.tablet,
|
|
275728
|
+
vendor: "Nexus"
|
|
275729
|
+
};
|
|
275730
|
+
}
|
|
275731
|
+
},
|
|
275732
|
+
{
|
|
275733
|
+
test: [/ipad/i],
|
|
275734
|
+
describe() {
|
|
275735
|
+
return {
|
|
275736
|
+
type: PLATFORMS_MAP.tablet,
|
|
275737
|
+
vendor: "Apple",
|
|
275738
|
+
model: "iPad"
|
|
275739
|
+
};
|
|
275740
|
+
}
|
|
275741
|
+
},
|
|
275742
|
+
{
|
|
275743
|
+
test: [/Macintosh(.*?) FxiOS(.*?)\//],
|
|
275744
|
+
describe() {
|
|
275745
|
+
return {
|
|
275746
|
+
type: PLATFORMS_MAP.tablet,
|
|
275747
|
+
vendor: "Apple",
|
|
275748
|
+
model: "iPad"
|
|
275749
|
+
};
|
|
275750
|
+
}
|
|
275751
|
+
},
|
|
275752
|
+
{
|
|
275753
|
+
test: [/kftt build/i],
|
|
275754
|
+
describe() {
|
|
275755
|
+
return {
|
|
275756
|
+
type: PLATFORMS_MAP.tablet,
|
|
275757
|
+
vendor: "Amazon",
|
|
275758
|
+
model: "Kindle Fire HD 7"
|
|
275759
|
+
};
|
|
275760
|
+
}
|
|
275761
|
+
},
|
|
275762
|
+
{
|
|
275763
|
+
test: [/silk/i],
|
|
275764
|
+
describe() {
|
|
275765
|
+
return {
|
|
275766
|
+
type: PLATFORMS_MAP.tablet,
|
|
275767
|
+
vendor: "Amazon"
|
|
275768
|
+
};
|
|
275769
|
+
}
|
|
275770
|
+
},
|
|
275771
|
+
{
|
|
275772
|
+
test: [/tablet(?! pc)/i],
|
|
275773
|
+
describe() {
|
|
275774
|
+
return {
|
|
275775
|
+
type: PLATFORMS_MAP.tablet
|
|
275776
|
+
};
|
|
275777
|
+
}
|
|
275778
|
+
},
|
|
275779
|
+
{
|
|
275780
|
+
test(parser2) {
|
|
275781
|
+
const iDevice = parser2.test(/ipod|iphone/i);
|
|
275782
|
+
const likeIDevice = parser2.test(/like (ipod|iphone)/i);
|
|
275783
|
+
return iDevice && !likeIDevice;
|
|
275784
|
+
},
|
|
275785
|
+
describe(ua) {
|
|
275786
|
+
const model = Utils.getFirstMatch(/(ipod|iphone)/i, ua);
|
|
275787
|
+
return {
|
|
275788
|
+
type: PLATFORMS_MAP.mobile,
|
|
275789
|
+
vendor: "Apple",
|
|
275790
|
+
model
|
|
275791
|
+
};
|
|
275792
|
+
}
|
|
275793
|
+
},
|
|
275794
|
+
{
|
|
275795
|
+
test: [/nexus\s*[0-6].*/i, /galaxy nexus/i],
|
|
275796
|
+
describe() {
|
|
275797
|
+
return {
|
|
275798
|
+
type: PLATFORMS_MAP.mobile,
|
|
275799
|
+
vendor: "Nexus"
|
|
275800
|
+
};
|
|
275801
|
+
}
|
|
275802
|
+
},
|
|
275803
|
+
{
|
|
275804
|
+
test: [/[^-]mobi/i],
|
|
275805
|
+
describe() {
|
|
275806
|
+
return {
|
|
275807
|
+
type: PLATFORMS_MAP.mobile
|
|
275808
|
+
};
|
|
275809
|
+
}
|
|
275810
|
+
},
|
|
275811
|
+
{
|
|
275812
|
+
test(parser2) {
|
|
275813
|
+
return parser2.getBrowserName(true) === "blackberry";
|
|
275814
|
+
},
|
|
275815
|
+
describe() {
|
|
275816
|
+
return {
|
|
275817
|
+
type: PLATFORMS_MAP.mobile,
|
|
275818
|
+
vendor: "BlackBerry"
|
|
275819
|
+
};
|
|
275820
|
+
}
|
|
275821
|
+
},
|
|
275822
|
+
{
|
|
275823
|
+
test(parser2) {
|
|
275824
|
+
return parser2.getBrowserName(true) === "bada";
|
|
275825
|
+
},
|
|
275826
|
+
describe() {
|
|
275827
|
+
return {
|
|
275828
|
+
type: PLATFORMS_MAP.mobile
|
|
275829
|
+
};
|
|
275830
|
+
}
|
|
275831
|
+
},
|
|
275832
|
+
{
|
|
275833
|
+
test(parser2) {
|
|
275834
|
+
return parser2.getBrowserName() === "windows phone";
|
|
275835
|
+
},
|
|
275836
|
+
describe() {
|
|
275837
|
+
return {
|
|
275838
|
+
type: PLATFORMS_MAP.mobile,
|
|
275839
|
+
vendor: "Microsoft"
|
|
275840
|
+
};
|
|
275841
|
+
}
|
|
275842
|
+
},
|
|
275843
|
+
{
|
|
275844
|
+
test(parser2) {
|
|
275845
|
+
const osMajorVersion = Number(String(parser2.getOSVersion()).split(".")[0]);
|
|
275846
|
+
return parser2.getOSName(true) === "android" && osMajorVersion >= 3;
|
|
275847
|
+
},
|
|
275848
|
+
describe() {
|
|
275849
|
+
return {
|
|
275850
|
+
type: PLATFORMS_MAP.tablet
|
|
275851
|
+
};
|
|
275852
|
+
}
|
|
275853
|
+
},
|
|
275854
|
+
{
|
|
275855
|
+
test(parser2) {
|
|
275856
|
+
return parser2.getOSName(true) === "android";
|
|
275857
|
+
},
|
|
275858
|
+
describe() {
|
|
275859
|
+
return {
|
|
275860
|
+
type: PLATFORMS_MAP.mobile
|
|
275861
|
+
};
|
|
275862
|
+
}
|
|
275863
|
+
},
|
|
275864
|
+
{
|
|
275865
|
+
test(parser2) {
|
|
275866
|
+
return parser2.getOSName(true) === "macos";
|
|
275867
|
+
},
|
|
275868
|
+
describe() {
|
|
275869
|
+
return {
|
|
275870
|
+
type: PLATFORMS_MAP.desktop,
|
|
275871
|
+
vendor: "Apple"
|
|
275872
|
+
};
|
|
275873
|
+
}
|
|
275874
|
+
},
|
|
275875
|
+
{
|
|
275876
|
+
test(parser2) {
|
|
275877
|
+
return parser2.getOSName(true) === "windows";
|
|
275878
|
+
},
|
|
275879
|
+
describe() {
|
|
275880
|
+
return {
|
|
275881
|
+
type: PLATFORMS_MAP.desktop
|
|
275882
|
+
};
|
|
275883
|
+
}
|
|
275884
|
+
},
|
|
275885
|
+
{
|
|
275886
|
+
test(parser2) {
|
|
275887
|
+
return parser2.getOSName(true) === "linux";
|
|
275888
|
+
},
|
|
275889
|
+
describe() {
|
|
275890
|
+
return {
|
|
275891
|
+
type: PLATFORMS_MAP.desktop
|
|
275892
|
+
};
|
|
275893
|
+
}
|
|
275894
|
+
},
|
|
275895
|
+
{
|
|
275896
|
+
test(parser2) {
|
|
275897
|
+
return parser2.getOSName(true) === "playstation 4";
|
|
275898
|
+
},
|
|
275899
|
+
describe() {
|
|
275900
|
+
return {
|
|
275901
|
+
type: PLATFORMS_MAP.tv
|
|
275902
|
+
};
|
|
275903
|
+
}
|
|
275904
|
+
},
|
|
275905
|
+
{
|
|
275906
|
+
test(parser2) {
|
|
275907
|
+
return parser2.getOSName(true) === "roku";
|
|
275908
|
+
},
|
|
275909
|
+
describe() {
|
|
275910
|
+
return {
|
|
275911
|
+
type: PLATFORMS_MAP.tv
|
|
275912
|
+
};
|
|
275913
|
+
}
|
|
275914
|
+
}
|
|
275915
|
+
];
|
|
275916
|
+
const enginesParsersList = [
|
|
275917
|
+
{
|
|
275918
|
+
test(parser2) {
|
|
275919
|
+
return parser2.getBrowserName(true) === "microsoft edge";
|
|
275920
|
+
},
|
|
275921
|
+
describe(ua) {
|
|
275922
|
+
const isBlinkBased = /\sedg\//i.test(ua);
|
|
275923
|
+
if (isBlinkBased) {
|
|
275924
|
+
return {
|
|
275925
|
+
name: ENGINE_MAP.Blink
|
|
275926
|
+
};
|
|
275927
|
+
}
|
|
275928
|
+
const version2 = Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275929
|
+
return {
|
|
275930
|
+
name: ENGINE_MAP.EdgeHTML,
|
|
275931
|
+
version: version2
|
|
275932
|
+
};
|
|
275933
|
+
}
|
|
275934
|
+
},
|
|
275935
|
+
{
|
|
275936
|
+
test: [/trident/i],
|
|
275937
|
+
describe(ua) {
|
|
275938
|
+
const engine = {
|
|
275939
|
+
name: ENGINE_MAP.Trident
|
|
275940
|
+
};
|
|
275941
|
+
const version2 = Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275942
|
+
if (version2) {
|
|
275943
|
+
engine.version = version2;
|
|
275944
|
+
}
|
|
275945
|
+
return engine;
|
|
275946
|
+
}
|
|
275947
|
+
},
|
|
275948
|
+
{
|
|
275949
|
+
test(parser2) {
|
|
275950
|
+
return parser2.test(/presto/i);
|
|
275951
|
+
},
|
|
275952
|
+
describe(ua) {
|
|
275953
|
+
const engine = {
|
|
275954
|
+
name: ENGINE_MAP.Presto
|
|
275955
|
+
};
|
|
275956
|
+
const version2 = Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275957
|
+
if (version2) {
|
|
275958
|
+
engine.version = version2;
|
|
275959
|
+
}
|
|
275960
|
+
return engine;
|
|
275961
|
+
}
|
|
275962
|
+
},
|
|
275963
|
+
{
|
|
275964
|
+
test(parser2) {
|
|
275965
|
+
const isGecko = parser2.test(/gecko/i);
|
|
275966
|
+
const likeGecko = parser2.test(/like gecko/i);
|
|
275967
|
+
return isGecko && !likeGecko;
|
|
275968
|
+
},
|
|
275969
|
+
describe(ua) {
|
|
275970
|
+
const engine = {
|
|
275971
|
+
name: ENGINE_MAP.Gecko
|
|
275972
|
+
};
|
|
275973
|
+
const version2 = Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275974
|
+
if (version2) {
|
|
275975
|
+
engine.version = version2;
|
|
275976
|
+
}
|
|
275977
|
+
return engine;
|
|
275978
|
+
}
|
|
275979
|
+
},
|
|
275980
|
+
{
|
|
275981
|
+
test: [/(apple)?webkit\/537\.36/i],
|
|
275982
|
+
describe() {
|
|
275983
|
+
return {
|
|
275984
|
+
name: ENGINE_MAP.Blink
|
|
275985
|
+
};
|
|
275986
|
+
}
|
|
275987
|
+
},
|
|
275988
|
+
{
|
|
275989
|
+
test: [/(apple)?webkit/i],
|
|
275990
|
+
describe(ua) {
|
|
275991
|
+
const engine = {
|
|
275992
|
+
name: ENGINE_MAP.WebKit
|
|
275993
|
+
};
|
|
275994
|
+
const version2 = Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, ua);
|
|
275995
|
+
if (version2) {
|
|
275996
|
+
engine.version = version2;
|
|
275997
|
+
}
|
|
275998
|
+
return engine;
|
|
275999
|
+
}
|
|
276000
|
+
}
|
|
276001
|
+
];
|
|
276002
|
+
class Parser {
|
|
276003
|
+
constructor(UA, skipParsing = false) {
|
|
276004
|
+
if (UA === void 0 || UA === null || UA === "") {
|
|
276005
|
+
throw new Error("UserAgent parameter can't be empty");
|
|
276006
|
+
}
|
|
276007
|
+
this._ua = UA;
|
|
276008
|
+
this.parsedResult = {};
|
|
276009
|
+
if (skipParsing !== true) {
|
|
276010
|
+
this.parse();
|
|
276011
|
+
}
|
|
276012
|
+
}
|
|
276013
|
+
getUA() {
|
|
276014
|
+
return this._ua;
|
|
276015
|
+
}
|
|
276016
|
+
test(regex2) {
|
|
276017
|
+
return regex2.test(this._ua);
|
|
276018
|
+
}
|
|
276019
|
+
parseBrowser() {
|
|
276020
|
+
this.parsedResult.browser = {};
|
|
276021
|
+
const browserDescriptor = Utils.find(browsersList, (_browser) => {
|
|
276022
|
+
if (typeof _browser.test === "function") {
|
|
276023
|
+
return _browser.test(this);
|
|
276024
|
+
}
|
|
276025
|
+
if (_browser.test instanceof Array) {
|
|
276026
|
+
return _browser.test.some((condition) => this.test(condition));
|
|
276027
|
+
}
|
|
276028
|
+
throw new Error("Browser's test function is not valid");
|
|
276029
|
+
});
|
|
276030
|
+
if (browserDescriptor) {
|
|
276031
|
+
this.parsedResult.browser = browserDescriptor.describe(this.getUA());
|
|
276032
|
+
}
|
|
276033
|
+
return this.parsedResult.browser;
|
|
276034
|
+
}
|
|
276035
|
+
getBrowser() {
|
|
276036
|
+
if (this.parsedResult.browser) {
|
|
276037
|
+
return this.parsedResult.browser;
|
|
276038
|
+
}
|
|
276039
|
+
return this.parseBrowser();
|
|
276040
|
+
}
|
|
276041
|
+
getBrowserName(toLowerCase) {
|
|
276042
|
+
if (toLowerCase) {
|
|
276043
|
+
return String(this.getBrowser().name).toLowerCase() || "";
|
|
276044
|
+
}
|
|
276045
|
+
return this.getBrowser().name || "";
|
|
276046
|
+
}
|
|
276047
|
+
getBrowserVersion() {
|
|
276048
|
+
return this.getBrowser().version;
|
|
276049
|
+
}
|
|
276050
|
+
getOS() {
|
|
276051
|
+
if (this.parsedResult.os) {
|
|
276052
|
+
return this.parsedResult.os;
|
|
276053
|
+
}
|
|
276054
|
+
return this.parseOS();
|
|
276055
|
+
}
|
|
276056
|
+
parseOS() {
|
|
276057
|
+
this.parsedResult.os = {};
|
|
276058
|
+
const os = Utils.find(osParsersList, (_os) => {
|
|
276059
|
+
if (typeof _os.test === "function") {
|
|
276060
|
+
return _os.test(this);
|
|
276061
|
+
}
|
|
276062
|
+
if (_os.test instanceof Array) {
|
|
276063
|
+
return _os.test.some((condition) => this.test(condition));
|
|
276064
|
+
}
|
|
276065
|
+
throw new Error("Browser's test function is not valid");
|
|
276066
|
+
});
|
|
276067
|
+
if (os) {
|
|
276068
|
+
this.parsedResult.os = os.describe(this.getUA());
|
|
276069
|
+
}
|
|
276070
|
+
return this.parsedResult.os;
|
|
276071
|
+
}
|
|
276072
|
+
getOSName(toLowerCase) {
|
|
276073
|
+
const { name: name2 } = this.getOS();
|
|
276074
|
+
if (toLowerCase) {
|
|
276075
|
+
return String(name2).toLowerCase() || "";
|
|
276076
|
+
}
|
|
276077
|
+
return name2 || "";
|
|
276078
|
+
}
|
|
276079
|
+
getOSVersion() {
|
|
276080
|
+
return this.getOS().version;
|
|
276081
|
+
}
|
|
276082
|
+
getPlatform() {
|
|
276083
|
+
if (this.parsedResult.platform) {
|
|
276084
|
+
return this.parsedResult.platform;
|
|
276085
|
+
}
|
|
276086
|
+
return this.parsePlatform();
|
|
276087
|
+
}
|
|
276088
|
+
getPlatformType(toLowerCase = false) {
|
|
276089
|
+
const { type: type3 } = this.getPlatform();
|
|
276090
|
+
if (toLowerCase) {
|
|
276091
|
+
return String(type3).toLowerCase() || "";
|
|
276092
|
+
}
|
|
276093
|
+
return type3 || "";
|
|
276094
|
+
}
|
|
276095
|
+
parsePlatform() {
|
|
276096
|
+
this.parsedResult.platform = {};
|
|
276097
|
+
const platform = Utils.find(platformParsersList, (_platform) => {
|
|
276098
|
+
if (typeof _platform.test === "function") {
|
|
276099
|
+
return _platform.test(this);
|
|
276100
|
+
}
|
|
276101
|
+
if (_platform.test instanceof Array) {
|
|
276102
|
+
return _platform.test.some((condition) => this.test(condition));
|
|
276103
|
+
}
|
|
276104
|
+
throw new Error("Browser's test function is not valid");
|
|
276105
|
+
});
|
|
276106
|
+
if (platform) {
|
|
276107
|
+
this.parsedResult.platform = platform.describe(this.getUA());
|
|
276108
|
+
}
|
|
276109
|
+
return this.parsedResult.platform;
|
|
276110
|
+
}
|
|
276111
|
+
getEngine() {
|
|
276112
|
+
if (this.parsedResult.engine) {
|
|
276113
|
+
return this.parsedResult.engine;
|
|
276114
|
+
}
|
|
276115
|
+
return this.parseEngine();
|
|
276116
|
+
}
|
|
276117
|
+
getEngineName(toLowerCase) {
|
|
276118
|
+
if (toLowerCase) {
|
|
276119
|
+
return String(this.getEngine().name).toLowerCase() || "";
|
|
276120
|
+
}
|
|
276121
|
+
return this.getEngine().name || "";
|
|
276122
|
+
}
|
|
276123
|
+
parseEngine() {
|
|
276124
|
+
this.parsedResult.engine = {};
|
|
276125
|
+
const engine = Utils.find(enginesParsersList, (_engine) => {
|
|
276126
|
+
if (typeof _engine.test === "function") {
|
|
276127
|
+
return _engine.test(this);
|
|
276128
|
+
}
|
|
276129
|
+
if (_engine.test instanceof Array) {
|
|
276130
|
+
return _engine.test.some((condition) => this.test(condition));
|
|
276131
|
+
}
|
|
276132
|
+
throw new Error("Browser's test function is not valid");
|
|
276133
|
+
});
|
|
276134
|
+
if (engine) {
|
|
276135
|
+
this.parsedResult.engine = engine.describe(this.getUA());
|
|
276136
|
+
}
|
|
276137
|
+
return this.parsedResult.engine;
|
|
276138
|
+
}
|
|
276139
|
+
parse() {
|
|
276140
|
+
this.parseBrowser();
|
|
276141
|
+
this.parseOS();
|
|
276142
|
+
this.parsePlatform();
|
|
276143
|
+
this.parseEngine();
|
|
276144
|
+
return this;
|
|
276145
|
+
}
|
|
276146
|
+
getResult() {
|
|
276147
|
+
return Utils.assign({}, this.parsedResult);
|
|
276148
|
+
}
|
|
276149
|
+
satisfies(checkTree) {
|
|
276150
|
+
const platformsAndOSes = {};
|
|
276151
|
+
let platformsAndOSCounter = 0;
|
|
276152
|
+
const browsers = {};
|
|
276153
|
+
let browsersCounter = 0;
|
|
276154
|
+
const allDefinitions = Object.keys(checkTree);
|
|
276155
|
+
allDefinitions.forEach((key2) => {
|
|
276156
|
+
const currentDefinition = checkTree[key2];
|
|
276157
|
+
if (typeof currentDefinition === "string") {
|
|
276158
|
+
browsers[key2] = currentDefinition;
|
|
276159
|
+
browsersCounter += 1;
|
|
276160
|
+
} else if (typeof currentDefinition === "object") {
|
|
276161
|
+
platformsAndOSes[key2] = currentDefinition;
|
|
276162
|
+
platformsAndOSCounter += 1;
|
|
276163
|
+
}
|
|
276164
|
+
});
|
|
276165
|
+
if (platformsAndOSCounter > 0) {
|
|
276166
|
+
const platformsAndOSNames = Object.keys(platformsAndOSes);
|
|
276167
|
+
const OSMatchingDefinition = Utils.find(platformsAndOSNames, (name2) => this.isOS(name2));
|
|
276168
|
+
if (OSMatchingDefinition) {
|
|
276169
|
+
const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]);
|
|
276170
|
+
if (osResult !== void 0) {
|
|
276171
|
+
return osResult;
|
|
276172
|
+
}
|
|
276173
|
+
}
|
|
276174
|
+
const platformMatchingDefinition = Utils.find(
|
|
276175
|
+
platformsAndOSNames,
|
|
276176
|
+
(name2) => this.isPlatform(name2)
|
|
276177
|
+
);
|
|
276178
|
+
if (platformMatchingDefinition) {
|
|
276179
|
+
const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);
|
|
276180
|
+
if (platformResult !== void 0) {
|
|
276181
|
+
return platformResult;
|
|
276182
|
+
}
|
|
276183
|
+
}
|
|
276184
|
+
}
|
|
276185
|
+
if (browsersCounter > 0) {
|
|
276186
|
+
const browserNames = Object.keys(browsers);
|
|
276187
|
+
const matchingDefinition = Utils.find(browserNames, (name2) => this.isBrowser(name2, true));
|
|
276188
|
+
if (matchingDefinition !== void 0) {
|
|
276189
|
+
return this.compareVersion(browsers[matchingDefinition]);
|
|
276190
|
+
}
|
|
276191
|
+
}
|
|
276192
|
+
return void 0;
|
|
276193
|
+
}
|
|
276194
|
+
isBrowser(browserName, includingAlias = false) {
|
|
276195
|
+
const defaultBrowserName = this.getBrowserName().toLowerCase();
|
|
276196
|
+
let browserNameLower = browserName.toLowerCase();
|
|
276197
|
+
const alias = Utils.getBrowserTypeByAlias(browserNameLower);
|
|
276198
|
+
if (includingAlias && alias) {
|
|
276199
|
+
browserNameLower = alias.toLowerCase();
|
|
276200
|
+
}
|
|
276201
|
+
return browserNameLower === defaultBrowserName;
|
|
276202
|
+
}
|
|
276203
|
+
compareVersion(version2) {
|
|
276204
|
+
let expectedResults = [0];
|
|
276205
|
+
let comparableVersion = version2;
|
|
276206
|
+
let isLoose = false;
|
|
276207
|
+
const currentBrowserVersion = this.getBrowserVersion();
|
|
276208
|
+
if (typeof currentBrowserVersion !== "string") {
|
|
276209
|
+
return void 0;
|
|
276210
|
+
}
|
|
276211
|
+
if (version2[0] === ">" || version2[0] === "<") {
|
|
276212
|
+
comparableVersion = version2.substr(1);
|
|
276213
|
+
if (version2[1] === "=") {
|
|
276214
|
+
isLoose = true;
|
|
276215
|
+
comparableVersion = version2.substr(2);
|
|
276216
|
+
} else {
|
|
276217
|
+
expectedResults = [];
|
|
276218
|
+
}
|
|
276219
|
+
if (version2[0] === ">") {
|
|
276220
|
+
expectedResults.push(1);
|
|
276221
|
+
} else {
|
|
276222
|
+
expectedResults.push(-1);
|
|
276223
|
+
}
|
|
276224
|
+
} else if (version2[0] === "=") {
|
|
276225
|
+
comparableVersion = version2.substr(1);
|
|
276226
|
+
} else if (version2[0] === "~") {
|
|
276227
|
+
isLoose = true;
|
|
276228
|
+
comparableVersion = version2.substr(1);
|
|
276229
|
+
}
|
|
276230
|
+
return expectedResults.indexOf(
|
|
276231
|
+
Utils.compareVersions(currentBrowserVersion, comparableVersion, isLoose)
|
|
276232
|
+
) > -1;
|
|
276233
|
+
}
|
|
276234
|
+
isOS(osName) {
|
|
276235
|
+
return this.getOSName(true) === String(osName).toLowerCase();
|
|
276236
|
+
}
|
|
276237
|
+
isPlatform(platformType) {
|
|
276238
|
+
return this.getPlatformType(true) === String(platformType).toLowerCase();
|
|
276239
|
+
}
|
|
276240
|
+
isEngine(engineName) {
|
|
276241
|
+
return this.getEngineName(true) === String(engineName).toLowerCase();
|
|
276242
|
+
}
|
|
276243
|
+
is(anything, includingAlias = false) {
|
|
276244
|
+
return this.isBrowser(anything, includingAlias) || this.isOS(anything) || this.isPlatform(anything);
|
|
276245
|
+
}
|
|
276246
|
+
some(anythings = []) {
|
|
276247
|
+
return anythings.some((anything) => this.is(anything));
|
|
276248
|
+
}
|
|
276249
|
+
}
|
|
276250
|
+
/*!
|
|
276251
|
+
* Bowser - a browser detector
|
|
276252
|
+
* https://github.com/lancedikson/bowser
|
|
276253
|
+
* MIT License | (c) Dustin Diaz 2012-2015
|
|
276254
|
+
* MIT License | (c) Denis Demchenko 2015-2019
|
|
276255
|
+
*/
|
|
276256
|
+
class Bowser {
|
|
276257
|
+
static getParser(UA, skipParsing = false) {
|
|
276258
|
+
if (typeof UA !== "string") {
|
|
276259
|
+
throw new Error("UserAgent should be a string");
|
|
276260
|
+
}
|
|
276261
|
+
return new Parser(UA, skipParsing);
|
|
276262
|
+
}
|
|
276263
|
+
static parse(UA) {
|
|
276264
|
+
return new Parser(UA).getResult();
|
|
276265
|
+
}
|
|
276266
|
+
static get BROWSER_MAP() {
|
|
276267
|
+
return BROWSER_MAP;
|
|
276268
|
+
}
|
|
276269
|
+
static get ENGINE_MAP() {
|
|
276270
|
+
return ENGINE_MAP;
|
|
276271
|
+
}
|
|
276272
|
+
static get OS_MAP() {
|
|
276273
|
+
return OS_MAP;
|
|
276274
|
+
}
|
|
276275
|
+
static get PLATFORMS_MAP() {
|
|
276276
|
+
return PLATFORMS_MAP;
|
|
276277
|
+
}
|
|
276278
|
+
}
|
|
276279
|
+
var lzString = { exports: {} };
|
|
276280
|
+
(function(module2) {
|
|
276281
|
+
var LZString = function() {
|
|
276282
|
+
var f2 = String.fromCharCode;
|
|
276283
|
+
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
276284
|
+
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
276285
|
+
var baseReverseDic = {};
|
|
276286
|
+
function getBaseValue(alphabet, character) {
|
|
276287
|
+
if (!baseReverseDic[alphabet]) {
|
|
276288
|
+
baseReverseDic[alphabet] = {};
|
|
276289
|
+
for (var i2 = 0; i2 < alphabet.length; i2++) {
|
|
276290
|
+
baseReverseDic[alphabet][alphabet.charAt(i2)] = i2;
|
|
276291
|
+
}
|
|
276292
|
+
}
|
|
276293
|
+
return baseReverseDic[alphabet][character];
|
|
276294
|
+
}
|
|
276295
|
+
var LZString2 = {
|
|
276296
|
+
compressToBase64: function(input) {
|
|
276297
|
+
if (input == null)
|
|
276298
|
+
return "";
|
|
276299
|
+
var res = LZString2._compress(input, 6, function(a2) {
|
|
276300
|
+
return keyStrBase64.charAt(a2);
|
|
276301
|
+
});
|
|
276302
|
+
switch (res.length % 4) {
|
|
276303
|
+
default:
|
|
276304
|
+
case 0:
|
|
276305
|
+
return res;
|
|
276306
|
+
case 1:
|
|
276307
|
+
return res + "===";
|
|
276308
|
+
case 2:
|
|
276309
|
+
return res + "==";
|
|
276310
|
+
case 3:
|
|
276311
|
+
return res + "=";
|
|
276312
|
+
}
|
|
276313
|
+
},
|
|
276314
|
+
decompressFromBase64: function(input) {
|
|
276315
|
+
if (input == null)
|
|
276316
|
+
return "";
|
|
276317
|
+
if (input == "")
|
|
276318
|
+
return null;
|
|
276319
|
+
return LZString2._decompress(input.length, 32, function(index2) {
|
|
276320
|
+
return getBaseValue(keyStrBase64, input.charAt(index2));
|
|
276321
|
+
});
|
|
276322
|
+
},
|
|
276323
|
+
compressToUTF16: function(input) {
|
|
276324
|
+
if (input == null)
|
|
276325
|
+
return "";
|
|
276326
|
+
return LZString2._compress(input, 15, function(a2) {
|
|
276327
|
+
return f2(a2 + 32);
|
|
276328
|
+
}) + " ";
|
|
276329
|
+
},
|
|
276330
|
+
decompressFromUTF16: function(compressed) {
|
|
276331
|
+
if (compressed == null)
|
|
276332
|
+
return "";
|
|
276333
|
+
if (compressed == "")
|
|
276334
|
+
return null;
|
|
276335
|
+
return LZString2._decompress(compressed.length, 16384, function(index2) {
|
|
276336
|
+
return compressed.charCodeAt(index2) - 32;
|
|
276337
|
+
});
|
|
276338
|
+
},
|
|
276339
|
+
compressToUint8Array: function(uncompressed) {
|
|
276340
|
+
var compressed = LZString2.compress(uncompressed);
|
|
276341
|
+
var buf = new Uint8Array(compressed.length * 2);
|
|
276342
|
+
for (var i2 = 0, TotalLen = compressed.length; i2 < TotalLen; i2++) {
|
|
276343
|
+
var current_value = compressed.charCodeAt(i2);
|
|
276344
|
+
buf[i2 * 2] = current_value >>> 8;
|
|
276345
|
+
buf[i2 * 2 + 1] = current_value % 256;
|
|
276346
|
+
}
|
|
276347
|
+
return buf;
|
|
276348
|
+
},
|
|
276349
|
+
decompressFromUint8Array: function(compressed) {
|
|
276350
|
+
if (compressed === null || compressed === void 0) {
|
|
276351
|
+
return LZString2.decompress(compressed);
|
|
276352
|
+
} else {
|
|
276353
|
+
var buf = new Array(compressed.length / 2);
|
|
276354
|
+
for (var i2 = 0, TotalLen = buf.length; i2 < TotalLen; i2++) {
|
|
276355
|
+
buf[i2] = compressed[i2 * 2] * 256 + compressed[i2 * 2 + 1];
|
|
276356
|
+
}
|
|
276357
|
+
var result = [];
|
|
276358
|
+
buf.forEach(function(c2) {
|
|
276359
|
+
result.push(f2(c2));
|
|
276360
|
+
});
|
|
276361
|
+
return LZString2.decompress(result.join(""));
|
|
276362
|
+
}
|
|
276363
|
+
},
|
|
276364
|
+
compressToEncodedURIComponent: function(input) {
|
|
276365
|
+
if (input == null)
|
|
276366
|
+
return "";
|
|
276367
|
+
return LZString2._compress(input, 6, function(a2) {
|
|
276368
|
+
return keyStrUriSafe.charAt(a2);
|
|
276369
|
+
});
|
|
276370
|
+
},
|
|
276371
|
+
decompressFromEncodedURIComponent: function(input) {
|
|
276372
|
+
if (input == null)
|
|
276373
|
+
return "";
|
|
276374
|
+
if (input == "")
|
|
276375
|
+
return null;
|
|
276376
|
+
input = input.replace(/ /g, "+");
|
|
276377
|
+
return LZString2._decompress(input.length, 32, function(index2) {
|
|
276378
|
+
return getBaseValue(keyStrUriSafe, input.charAt(index2));
|
|
276379
|
+
});
|
|
276380
|
+
},
|
|
276381
|
+
compress: function(uncompressed) {
|
|
276382
|
+
return LZString2._compress(uncompressed, 16, function(a2) {
|
|
276383
|
+
return f2(a2);
|
|
276384
|
+
});
|
|
276385
|
+
},
|
|
276386
|
+
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
276387
|
+
if (uncompressed == null)
|
|
276388
|
+
return "";
|
|
276389
|
+
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;
|
|
276390
|
+
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
276391
|
+
context_c = uncompressed.charAt(ii);
|
|
276392
|
+
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
276393
|
+
context_dictionary[context_c] = context_dictSize++;
|
|
276394
|
+
context_dictionaryToCreate[context_c] = true;
|
|
276395
|
+
}
|
|
276396
|
+
context_wc = context_w + context_c;
|
|
276397
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {
|
|
276398
|
+
context_w = context_wc;
|
|
276399
|
+
} else {
|
|
276400
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
276401
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
276402
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276403
|
+
context_data_val = context_data_val << 1;
|
|
276404
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276405
|
+
context_data_position = 0;
|
|
276406
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276407
|
+
context_data_val = 0;
|
|
276408
|
+
} else {
|
|
276409
|
+
context_data_position++;
|
|
276410
|
+
}
|
|
276411
|
+
}
|
|
276412
|
+
value2 = context_w.charCodeAt(0);
|
|
276413
|
+
for (i2 = 0; i2 < 8; i2++) {
|
|
276414
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276415
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276416
|
+
context_data_position = 0;
|
|
276417
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276418
|
+
context_data_val = 0;
|
|
276419
|
+
} else {
|
|
276420
|
+
context_data_position++;
|
|
276421
|
+
}
|
|
276422
|
+
value2 = value2 >> 1;
|
|
276423
|
+
}
|
|
276424
|
+
} else {
|
|
276425
|
+
value2 = 1;
|
|
276426
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276427
|
+
context_data_val = context_data_val << 1 | value2;
|
|
276428
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276429
|
+
context_data_position = 0;
|
|
276430
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276431
|
+
context_data_val = 0;
|
|
276432
|
+
} else {
|
|
276433
|
+
context_data_position++;
|
|
276434
|
+
}
|
|
276435
|
+
value2 = 0;
|
|
276436
|
+
}
|
|
276437
|
+
value2 = context_w.charCodeAt(0);
|
|
276438
|
+
for (i2 = 0; i2 < 16; i2++) {
|
|
276439
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276440
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276441
|
+
context_data_position = 0;
|
|
276442
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276443
|
+
context_data_val = 0;
|
|
276444
|
+
} else {
|
|
276445
|
+
context_data_position++;
|
|
276446
|
+
}
|
|
276447
|
+
value2 = value2 >> 1;
|
|
276448
|
+
}
|
|
276449
|
+
}
|
|
276450
|
+
context_enlargeIn--;
|
|
276451
|
+
if (context_enlargeIn == 0) {
|
|
276452
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276453
|
+
context_numBits++;
|
|
276454
|
+
}
|
|
276455
|
+
delete context_dictionaryToCreate[context_w];
|
|
276456
|
+
} else {
|
|
276457
|
+
value2 = context_dictionary[context_w];
|
|
276458
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276459
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276460
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276461
|
+
context_data_position = 0;
|
|
276462
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276463
|
+
context_data_val = 0;
|
|
276464
|
+
} else {
|
|
276465
|
+
context_data_position++;
|
|
276466
|
+
}
|
|
276467
|
+
value2 = value2 >> 1;
|
|
276468
|
+
}
|
|
276469
|
+
}
|
|
276470
|
+
context_enlargeIn--;
|
|
276471
|
+
if (context_enlargeIn == 0) {
|
|
276472
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276473
|
+
context_numBits++;
|
|
276474
|
+
}
|
|
276475
|
+
context_dictionary[context_wc] = context_dictSize++;
|
|
276476
|
+
context_w = String(context_c);
|
|
276477
|
+
}
|
|
276478
|
+
}
|
|
276479
|
+
if (context_w !== "") {
|
|
276480
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
276481
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
276482
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276483
|
+
context_data_val = context_data_val << 1;
|
|
276484
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276485
|
+
context_data_position = 0;
|
|
276486
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276487
|
+
context_data_val = 0;
|
|
276488
|
+
} else {
|
|
276489
|
+
context_data_position++;
|
|
276490
|
+
}
|
|
276491
|
+
}
|
|
276492
|
+
value2 = context_w.charCodeAt(0);
|
|
276493
|
+
for (i2 = 0; i2 < 8; i2++) {
|
|
276494
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276495
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276496
|
+
context_data_position = 0;
|
|
276497
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276498
|
+
context_data_val = 0;
|
|
276499
|
+
} else {
|
|
276500
|
+
context_data_position++;
|
|
276501
|
+
}
|
|
276502
|
+
value2 = value2 >> 1;
|
|
276503
|
+
}
|
|
276504
|
+
} else {
|
|
276505
|
+
value2 = 1;
|
|
276506
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276507
|
+
context_data_val = context_data_val << 1 | value2;
|
|
276508
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276509
|
+
context_data_position = 0;
|
|
276510
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276511
|
+
context_data_val = 0;
|
|
276512
|
+
} else {
|
|
276513
|
+
context_data_position++;
|
|
276514
|
+
}
|
|
276515
|
+
value2 = 0;
|
|
276516
|
+
}
|
|
276517
|
+
value2 = context_w.charCodeAt(0);
|
|
276518
|
+
for (i2 = 0; i2 < 16; i2++) {
|
|
276519
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276520
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276521
|
+
context_data_position = 0;
|
|
276522
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276523
|
+
context_data_val = 0;
|
|
276524
|
+
} else {
|
|
276525
|
+
context_data_position++;
|
|
276526
|
+
}
|
|
276527
|
+
value2 = value2 >> 1;
|
|
276528
|
+
}
|
|
276529
|
+
}
|
|
276530
|
+
context_enlargeIn--;
|
|
276531
|
+
if (context_enlargeIn == 0) {
|
|
276532
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276533
|
+
context_numBits++;
|
|
276534
|
+
}
|
|
276535
|
+
delete context_dictionaryToCreate[context_w];
|
|
276536
|
+
} else {
|
|
276537
|
+
value2 = context_dictionary[context_w];
|
|
276538
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276539
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276540
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276541
|
+
context_data_position = 0;
|
|
276542
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276543
|
+
context_data_val = 0;
|
|
276544
|
+
} else {
|
|
276545
|
+
context_data_position++;
|
|
276546
|
+
}
|
|
276547
|
+
value2 = value2 >> 1;
|
|
276548
|
+
}
|
|
276549
|
+
}
|
|
276550
|
+
context_enlargeIn--;
|
|
276551
|
+
if (context_enlargeIn == 0) {
|
|
276552
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
276553
|
+
context_numBits++;
|
|
276554
|
+
}
|
|
276555
|
+
}
|
|
276556
|
+
value2 = 2;
|
|
276557
|
+
for (i2 = 0; i2 < context_numBits; i2++) {
|
|
276558
|
+
context_data_val = context_data_val << 1 | value2 & 1;
|
|
276559
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276560
|
+
context_data_position = 0;
|
|
276561
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276562
|
+
context_data_val = 0;
|
|
276563
|
+
} else {
|
|
276564
|
+
context_data_position++;
|
|
276565
|
+
}
|
|
276566
|
+
value2 = value2 >> 1;
|
|
276567
|
+
}
|
|
276568
|
+
while (true) {
|
|
276569
|
+
context_data_val = context_data_val << 1;
|
|
276570
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
276571
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
276572
|
+
break;
|
|
276573
|
+
} else
|
|
276574
|
+
context_data_position++;
|
|
276575
|
+
}
|
|
276576
|
+
return context_data.join("");
|
|
276577
|
+
},
|
|
276578
|
+
decompress: function(compressed) {
|
|
276579
|
+
if (compressed == null)
|
|
276580
|
+
return "";
|
|
276581
|
+
if (compressed == "")
|
|
276582
|
+
return null;
|
|
276583
|
+
return LZString2._decompress(compressed.length, 32768, function(index2) {
|
|
276584
|
+
return compressed.charCodeAt(index2);
|
|
276585
|
+
});
|
|
276586
|
+
},
|
|
276587
|
+
_decompress: function(length2, resetValue, getNextValue) {
|
|
276588
|
+
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 };
|
|
276589
|
+
for (i2 = 0; i2 < 3; i2 += 1) {
|
|
276590
|
+
dictionary[i2] = i2;
|
|
276591
|
+
}
|
|
276592
|
+
bits = 0;
|
|
276593
|
+
maxpower = Math.pow(2, 2);
|
|
276594
|
+
power = 1;
|
|
276595
|
+
while (power != maxpower) {
|
|
276596
|
+
resb = data2.val & data2.position;
|
|
276597
|
+
data2.position >>= 1;
|
|
276598
|
+
if (data2.position == 0) {
|
|
276599
|
+
data2.position = resetValue;
|
|
276600
|
+
data2.val = getNextValue(data2.index++);
|
|
276601
|
+
}
|
|
276602
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276603
|
+
power <<= 1;
|
|
276604
|
+
}
|
|
276605
|
+
switch (bits) {
|
|
276606
|
+
case 0:
|
|
276607
|
+
bits = 0;
|
|
276608
|
+
maxpower = Math.pow(2, 8);
|
|
276609
|
+
power = 1;
|
|
276610
|
+
while (power != maxpower) {
|
|
276611
|
+
resb = data2.val & data2.position;
|
|
276612
|
+
data2.position >>= 1;
|
|
276613
|
+
if (data2.position == 0) {
|
|
276614
|
+
data2.position = resetValue;
|
|
276615
|
+
data2.val = getNextValue(data2.index++);
|
|
276616
|
+
}
|
|
276617
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276618
|
+
power <<= 1;
|
|
276619
|
+
}
|
|
276620
|
+
c2 = f2(bits);
|
|
276621
|
+
break;
|
|
276622
|
+
case 1:
|
|
276623
|
+
bits = 0;
|
|
276624
|
+
maxpower = Math.pow(2, 16);
|
|
276625
|
+
power = 1;
|
|
276626
|
+
while (power != maxpower) {
|
|
276627
|
+
resb = data2.val & data2.position;
|
|
276628
|
+
data2.position >>= 1;
|
|
276629
|
+
if (data2.position == 0) {
|
|
276630
|
+
data2.position = resetValue;
|
|
276631
|
+
data2.val = getNextValue(data2.index++);
|
|
276632
|
+
}
|
|
276633
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276634
|
+
power <<= 1;
|
|
276635
|
+
}
|
|
276636
|
+
c2 = f2(bits);
|
|
276637
|
+
break;
|
|
276638
|
+
case 2:
|
|
276639
|
+
return "";
|
|
276640
|
+
}
|
|
276641
|
+
dictionary[3] = c2;
|
|
276642
|
+
w2 = c2;
|
|
276643
|
+
result.push(c2);
|
|
276644
|
+
while (true) {
|
|
276645
|
+
if (data2.index > length2) {
|
|
276646
|
+
return "";
|
|
276647
|
+
}
|
|
276648
|
+
bits = 0;
|
|
276649
|
+
maxpower = Math.pow(2, numBits);
|
|
276650
|
+
power = 1;
|
|
276651
|
+
while (power != maxpower) {
|
|
276652
|
+
resb = data2.val & data2.position;
|
|
276653
|
+
data2.position >>= 1;
|
|
276654
|
+
if (data2.position == 0) {
|
|
276655
|
+
data2.position = resetValue;
|
|
276656
|
+
data2.val = getNextValue(data2.index++);
|
|
276657
|
+
}
|
|
276658
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276659
|
+
power <<= 1;
|
|
276660
|
+
}
|
|
276661
|
+
switch (c2 = bits) {
|
|
276662
|
+
case 0:
|
|
276663
|
+
bits = 0;
|
|
276664
|
+
maxpower = Math.pow(2, 8);
|
|
276665
|
+
power = 1;
|
|
276666
|
+
while (power != maxpower) {
|
|
276667
|
+
resb = data2.val & data2.position;
|
|
276668
|
+
data2.position >>= 1;
|
|
276669
|
+
if (data2.position == 0) {
|
|
276670
|
+
data2.position = resetValue;
|
|
276671
|
+
data2.val = getNextValue(data2.index++);
|
|
276672
|
+
}
|
|
276673
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276674
|
+
power <<= 1;
|
|
276675
|
+
}
|
|
276676
|
+
dictionary[dictSize++] = f2(bits);
|
|
276677
|
+
c2 = dictSize - 1;
|
|
276678
|
+
enlargeIn--;
|
|
276679
|
+
break;
|
|
276680
|
+
case 1:
|
|
276681
|
+
bits = 0;
|
|
276682
|
+
maxpower = Math.pow(2, 16);
|
|
276683
|
+
power = 1;
|
|
276684
|
+
while (power != maxpower) {
|
|
276685
|
+
resb = data2.val & data2.position;
|
|
276686
|
+
data2.position >>= 1;
|
|
276687
|
+
if (data2.position == 0) {
|
|
276688
|
+
data2.position = resetValue;
|
|
276689
|
+
data2.val = getNextValue(data2.index++);
|
|
276690
|
+
}
|
|
276691
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
276692
|
+
power <<= 1;
|
|
276693
|
+
}
|
|
276694
|
+
dictionary[dictSize++] = f2(bits);
|
|
276695
|
+
c2 = dictSize - 1;
|
|
276696
|
+
enlargeIn--;
|
|
276697
|
+
break;
|
|
276698
|
+
case 2:
|
|
276699
|
+
return result.join("");
|
|
276700
|
+
}
|
|
276701
|
+
if (enlargeIn == 0) {
|
|
276702
|
+
enlargeIn = Math.pow(2, numBits);
|
|
276703
|
+
numBits++;
|
|
276704
|
+
}
|
|
276705
|
+
if (dictionary[c2]) {
|
|
276706
|
+
entry2 = dictionary[c2];
|
|
276707
|
+
} else {
|
|
276708
|
+
if (c2 === dictSize) {
|
|
276709
|
+
entry2 = w2 + w2.charAt(0);
|
|
276710
|
+
} else {
|
|
276711
|
+
return null;
|
|
276712
|
+
}
|
|
276713
|
+
}
|
|
276714
|
+
result.push(entry2);
|
|
276715
|
+
dictionary[dictSize++] = w2 + entry2.charAt(0);
|
|
276716
|
+
enlargeIn--;
|
|
276717
|
+
w2 = entry2;
|
|
276718
|
+
if (enlargeIn == 0) {
|
|
276719
|
+
enlargeIn = Math.pow(2, numBits);
|
|
276720
|
+
numBits++;
|
|
276721
|
+
}
|
|
276722
|
+
}
|
|
276723
|
+
}
|
|
276724
|
+
};
|
|
276725
|
+
return LZString2;
|
|
276726
|
+
}();
|
|
276727
|
+
if (module2 != null) {
|
|
276728
|
+
module2.exports = LZString;
|
|
276729
|
+
}
|
|
276730
|
+
})(lzString);
|
|
276731
|
+
const CURRENT_VERSION = "0.0.1";
|
|
276732
|
+
const VITESSCE_CONF_QUERY_STRING = "vitessce_conf";
|
|
276733
|
+
const VERSION_QUERY_STRING = "vitessce_conf_version";
|
|
276734
|
+
const LENGTH_QUERY_STRING = "vitessce_conf_length";
|
|
276735
|
+
function sniffBrowser() {
|
|
276736
|
+
const { browser: browser2 } = Bowser.parse(window.navigator.userAgent);
|
|
276737
|
+
return browser2.name;
|
|
276738
|
+
}
|
|
276739
|
+
const MAX_BROWSER_URL_LENGTHS = {
|
|
276740
|
+
Chrome: 32779,
|
|
276741
|
+
"Internet Explorer": 2047,
|
|
276742
|
+
Edge: 2047,
|
|
276743
|
+
Safari: 65e3,
|
|
276744
|
+
Firefox: 65e3
|
|
276745
|
+
};
|
|
276746
|
+
class CompressedConfLengthError {
|
|
276747
|
+
constructor(message) {
|
|
276748
|
+
this.message = message;
|
|
276749
|
+
}
|
|
276750
|
+
}
|
|
276751
|
+
function encodeConfInUrl({ conf, onOverMaximumUrlLength = () => {
|
|
276752
|
+
} }) {
|
|
276753
|
+
const compressedConf = lzString.exports.compressToEncodedURIComponent(JSON.stringify(conf));
|
|
276754
|
+
const newParams = `${LENGTH_QUERY_STRING}=${compressedConf.length}&${VERSION_QUERY_STRING}=${CURRENT_VERSION}&${VITESSCE_CONF_QUERY_STRING}=${compressedConf}`;
|
|
276755
|
+
const browser2 = sniffBrowser();
|
|
276756
|
+
const maxLength = MAX_BROWSER_URL_LENGTHS[browser2];
|
|
276757
|
+
if (newParams.length > maxLength) {
|
|
276758
|
+
const willWorkOn = Object.entries(MAX_BROWSER_URL_LENGTHS).filter((entry2) => entry2[1] > newParams.length).map((entry2) => entry2[0]);
|
|
276759
|
+
const message = `Configuration is ${compressedConf.length} characters; max URL for ${browser2} is ${maxLength}: it will work on ${willWorkOn.join(", ") || "no browser"}.`;
|
|
276760
|
+
console.error(message);
|
|
276761
|
+
onOverMaximumUrlLength({ message, willWorkOn });
|
|
276762
|
+
}
|
|
276763
|
+
return newParams;
|
|
276764
|
+
}
|
|
276765
|
+
function decodeURLParamsToConf(queryString) {
|
|
276766
|
+
const params2 = new URLSearchParams(queryString.replace("#", "&"));
|
|
276767
|
+
const compressedConfString = params2.get(VITESSCE_CONF_QUERY_STRING);
|
|
276768
|
+
const expectedConfLength = Number(params2.get(LENGTH_QUERY_STRING));
|
|
276769
|
+
if (expectedConfLength !== compressedConfString.length) {
|
|
276770
|
+
throw new CompressedConfLengthError(`Compressed conf length (${compressedConfString.length}) != expected (${expectedConfLength}). URL truncated?`);
|
|
276771
|
+
}
|
|
276772
|
+
const version2 = params2.get(VERSION_QUERY_STRING);
|
|
276773
|
+
if (version2 === CURRENT_VERSION) {
|
|
276774
|
+
const conf = JSON.parse(lzString.exports.decompressFromEncodedURIComponent(compressedConfString));
|
|
276775
|
+
return conf;
|
|
276776
|
+
}
|
|
276777
|
+
throw new Error("Unrecognized URL Param Version");
|
|
276778
|
+
}
|
|
275149
276779
|
export {
|
|
275150
276780
|
BaseDecoder as B,
|
|
275151
276781
|
CoordinationType as C,
|
|
@@ -275156,6 +276786,8 @@ export {
|
|
|
275156
276786
|
LercAddCompression as a,
|
|
275157
276787
|
VitessceConfig as b,
|
|
275158
276788
|
Vitessce as c,
|
|
276789
|
+
decodeURLParamsToConf as d,
|
|
276790
|
+
encodeConfInUrl as e,
|
|
275159
276791
|
hconcat as h,
|
|
275160
276792
|
vconcat as v
|
|
275161
276793
|
};
|