@loaders.gl/i3s 3.1.6 → 3.1.7

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.
@@ -55,7 +55,7 @@
55
55
  var nodeVersion = matches && parseFloat(matches[1]) || 0;
56
56
 
57
57
  // ../worker-utils/src/lib/env-utils/version.ts
58
- var VERSION = true ? "3.1.6" : DEFAULT_VERSION;
58
+ var VERSION = true ? "3.1.7" : DEFAULT_VERSION;
59
59
  if (false) {
60
60
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
61
61
  }
@@ -750,6 +750,21 @@
750
750
  return concatenateArrayBuffers(...arrayBuffers);
751
751
  }
752
752
 
753
+ // ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
754
+ function _defineProperty(obj, key, value) {
755
+ if (key in obj) {
756
+ Object.defineProperty(obj, key, {
757
+ value,
758
+ enumerable: true,
759
+ configurable: true,
760
+ writable: true
761
+ });
762
+ } else {
763
+ obj[key] = value;
764
+ }
765
+ return obj;
766
+ }
767
+
753
768
  // ../loader-utils/src/lib/path-utils/file-aliases.ts
754
769
  var pathPrefix = "";
755
770
  var fileAliases = {};
@@ -1001,7 +1016,7 @@
1001
1016
  var process_ = globals3.process || {};
1002
1017
 
1003
1018
  // ../../node_modules/probe.gl/dist/esm/utils/globals.js
1004
- var VERSION3 = true ? "3.1.6" : "untranspiled source";
1019
+ var VERSION3 = true ? "3.1.7" : "untranspiled source";
1005
1020
  var isBrowser4 = isBrowser3();
1006
1021
 
1007
1022
  // ../../node_modules/probe.gl/dist/esm/utils/local-storage.js
@@ -1710,6 +1725,555 @@
1710
1725
  return getGlobalLoaderRegistry();
1711
1726
  }
1712
1727
 
1728
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
1729
+ function isElectron2(mockUserAgent) {
1730
+ if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
1731
+ return true;
1732
+ }
1733
+ if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
1734
+ return true;
1735
+ }
1736
+ const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
1737
+ const userAgent = mockUserAgent || realUserAgent;
1738
+ if (userAgent && userAgent.indexOf("Electron") >= 0) {
1739
+ return true;
1740
+ }
1741
+ return false;
1742
+ }
1743
+
1744
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
1745
+ function isBrowser5() {
1746
+ const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
1747
+ return !isNode || isElectron2();
1748
+ }
1749
+
1750
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
1751
+ var globals4 = {
1752
+ self: typeof self !== "undefined" && self,
1753
+ window: typeof window !== "undefined" && window,
1754
+ global: typeof global !== "undefined" && global,
1755
+ document: typeof document !== "undefined" && document,
1756
+ process: typeof process === "object" && process
1757
+ };
1758
+ var self_4 = globals4.self || globals4.window || globals4.global;
1759
+ var window_4 = globals4.window || globals4.self || globals4.global;
1760
+ var document_4 = globals4.document || {};
1761
+ var process_2 = globals4.process || {};
1762
+
1763
+ // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
1764
+ var VERSION4 = true ? "3.1.7" : "untranspiled source";
1765
+ var isBrowser6 = isBrowser5();
1766
+
1767
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
1768
+ function getStorage2(type) {
1769
+ try {
1770
+ const storage = window[type];
1771
+ const x = "__storage_test__";
1772
+ storage.setItem(x, x);
1773
+ storage.removeItem(x);
1774
+ return storage;
1775
+ } catch (e2) {
1776
+ return null;
1777
+ }
1778
+ }
1779
+ var LocalStorage2 = class {
1780
+ constructor(id) {
1781
+ let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1782
+ let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
1783
+ _defineProperty(this, "storage", void 0);
1784
+ _defineProperty(this, "id", void 0);
1785
+ _defineProperty(this, "config", {});
1786
+ this.storage = getStorage2(type);
1787
+ this.id = id;
1788
+ this.config = {};
1789
+ Object.assign(this.config, defaultSettings);
1790
+ this._loadConfiguration();
1791
+ }
1792
+ getConfiguration() {
1793
+ return this.config;
1794
+ }
1795
+ setConfiguration(configuration) {
1796
+ this.config = {};
1797
+ return this.updateConfiguration(configuration);
1798
+ }
1799
+ updateConfiguration(configuration) {
1800
+ Object.assign(this.config, configuration);
1801
+ if (this.storage) {
1802
+ const serialized = JSON.stringify(this.config);
1803
+ this.storage.setItem(this.id, serialized);
1804
+ }
1805
+ return this;
1806
+ }
1807
+ _loadConfiguration() {
1808
+ let configuration = {};
1809
+ if (this.storage) {
1810
+ const serializedConfiguration = this.storage.getItem(this.id);
1811
+ configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
1812
+ }
1813
+ Object.assign(this.config, configuration);
1814
+ return this;
1815
+ }
1816
+ };
1817
+
1818
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
1819
+ function formatTime2(ms) {
1820
+ let formatted;
1821
+ if (ms < 10) {
1822
+ formatted = "".concat(ms.toFixed(2), "ms");
1823
+ } else if (ms < 100) {
1824
+ formatted = "".concat(ms.toFixed(1), "ms");
1825
+ } else if (ms < 1e3) {
1826
+ formatted = "".concat(ms.toFixed(0), "ms");
1827
+ } else {
1828
+ formatted = "".concat((ms / 1e3).toFixed(2), "s");
1829
+ }
1830
+ return formatted;
1831
+ }
1832
+ function leftPad2(string) {
1833
+ let length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
1834
+ const padLength = Math.max(length2 - string.length, 0);
1835
+ return "".concat(" ".repeat(padLength)).concat(string);
1836
+ }
1837
+ function formatImage2(image, message, scale2) {
1838
+ let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
1839
+ const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
1840
+ if (image.width > maxWidth) {
1841
+ scale2 = Math.min(scale2, maxWidth / image.width);
1842
+ }
1843
+ const width = image.width * scale2;
1844
+ const height = image.height * scale2;
1845
+ const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
1846
+ return ["".concat(message, " %c+"), style];
1847
+ }
1848
+
1849
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
1850
+ var COLOR2;
1851
+ (function(COLOR3) {
1852
+ COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
1853
+ COLOR3[COLOR3["RED"] = 31] = "RED";
1854
+ COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
1855
+ COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
1856
+ COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
1857
+ COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
1858
+ COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
1859
+ COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
1860
+ COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
1861
+ COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
1862
+ COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
1863
+ COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
1864
+ COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
1865
+ COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
1866
+ COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
1867
+ COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
1868
+ })(COLOR2 || (COLOR2 = {}));
1869
+ function getColor2(color) {
1870
+ return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
1871
+ }
1872
+ function addColor2(string, color, background) {
1873
+ if (!isBrowser5 && typeof string === "string") {
1874
+ if (color) {
1875
+ color = getColor2(color);
1876
+ string = "[".concat(color, "m").concat(string, "");
1877
+ }
1878
+ if (background) {
1879
+ color = getColor2(background);
1880
+ string = "[".concat(background + 10, "m").concat(string, "");
1881
+ }
1882
+ }
1883
+ return string;
1884
+ }
1885
+
1886
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
1887
+ function autobind2(obj) {
1888
+ let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
1889
+ const proto = Object.getPrototypeOf(obj);
1890
+ const propNames = Object.getOwnPropertyNames(proto);
1891
+ for (const key of propNames) {
1892
+ if (typeof obj[key] === "function") {
1893
+ if (!predefined.find((name) => key === name)) {
1894
+ obj[key] = obj[key].bind(obj);
1895
+ }
1896
+ }
1897
+ }
1898
+ }
1899
+
1900
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
1901
+ function assert4(condition, message) {
1902
+ if (!condition) {
1903
+ throw new Error(message || "Assertion failed");
1904
+ }
1905
+ }
1906
+
1907
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
1908
+ function getHiResTimestamp3() {
1909
+ let timestamp;
1910
+ if (isBrowser5 && "performance" in window_4) {
1911
+ var _window$performance, _window$performance$n;
1912
+ timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
1913
+ } else if ("hrtime" in process_2) {
1914
+ var _process$hrtime;
1915
+ const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
1916
+ timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
1917
+ } else {
1918
+ timestamp = Date.now();
1919
+ }
1920
+ return timestamp;
1921
+ }
1922
+
1923
+ // ../../node_modules/@probe.gl/log/dist/esm/log.js
1924
+ var originalConsole2 = {
1925
+ debug: isBrowser5 ? console.debug || console.log : console.log,
1926
+ log: console.log,
1927
+ info: console.info,
1928
+ warn: console.warn,
1929
+ error: console.error
1930
+ };
1931
+ var DEFAULT_SETTINGS2 = {
1932
+ enabled: true,
1933
+ level: 0
1934
+ };
1935
+ function noop2() {
1936
+ }
1937
+ var cache2 = {};
1938
+ var ONCE2 = {
1939
+ once: true
1940
+ };
1941
+ var Log2 = class {
1942
+ constructor() {
1943
+ let {
1944
+ id
1945
+ } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
1946
+ id: ""
1947
+ };
1948
+ _defineProperty(this, "id", void 0);
1949
+ _defineProperty(this, "VERSION", VERSION4);
1950
+ _defineProperty(this, "_startTs", getHiResTimestamp3());
1951
+ _defineProperty(this, "_deltaTs", getHiResTimestamp3());
1952
+ _defineProperty(this, "_storage", void 0);
1953
+ _defineProperty(this, "userData", {});
1954
+ _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
1955
+ this.id = id;
1956
+ this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
1957
+ this.userData = {};
1958
+ this.timeStamp("".concat(this.id, " started"));
1959
+ autobind2(this);
1960
+ Object.seal(this);
1961
+ }
1962
+ set level(newLevel) {
1963
+ this.setLevel(newLevel);
1964
+ }
1965
+ get level() {
1966
+ return this.getLevel();
1967
+ }
1968
+ isEnabled() {
1969
+ return this._storage.config.enabled;
1970
+ }
1971
+ getLevel() {
1972
+ return this._storage.config.level;
1973
+ }
1974
+ getTotal() {
1975
+ return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
1976
+ }
1977
+ getDelta() {
1978
+ return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
1979
+ }
1980
+ set priority(newPriority) {
1981
+ this.level = newPriority;
1982
+ }
1983
+ get priority() {
1984
+ return this.level;
1985
+ }
1986
+ getPriority() {
1987
+ return this.level;
1988
+ }
1989
+ enable() {
1990
+ let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
1991
+ this._storage.updateConfiguration({
1992
+ enabled
1993
+ });
1994
+ return this;
1995
+ }
1996
+ setLevel(level) {
1997
+ this._storage.updateConfiguration({
1998
+ level
1999
+ });
2000
+ return this;
2001
+ }
2002
+ get(setting) {
2003
+ return this._storage.config[setting];
2004
+ }
2005
+ set(setting, value) {
2006
+ this._storage.updateConfiguration({
2007
+ [setting]: value
2008
+ });
2009
+ }
2010
+ settings() {
2011
+ if (console.table) {
2012
+ console.table(this._storage.config);
2013
+ } else {
2014
+ console.log(this._storage.config);
2015
+ }
2016
+ }
2017
+ assert(condition, message) {
2018
+ assert4(condition, message);
2019
+ }
2020
+ warn(message) {
2021
+ return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
2022
+ }
2023
+ error(message) {
2024
+ return this._getLogFunction(0, message, originalConsole2.error, arguments);
2025
+ }
2026
+ deprecated(oldUsage, newUsage) {
2027
+ return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
2028
+ }
2029
+ removed(oldUsage, newUsage) {
2030
+ return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
2031
+ }
2032
+ probe(logLevel, message) {
2033
+ return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
2034
+ time: true,
2035
+ once: true
2036
+ });
2037
+ }
2038
+ log(logLevel, message) {
2039
+ return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
2040
+ }
2041
+ info(logLevel, message) {
2042
+ return this._getLogFunction(logLevel, message, console.info, arguments);
2043
+ }
2044
+ once(logLevel, message) {
2045
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
2046
+ args[_key - 2] = arguments[_key];
2047
+ }
2048
+ return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
2049
+ }
2050
+ table(logLevel, table, columns) {
2051
+ if (table) {
2052
+ return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
2053
+ tag: getTableHeader2(table)
2054
+ });
2055
+ }
2056
+ return noop2;
2057
+ }
2058
+ image(_ref) {
2059
+ let {
2060
+ logLevel,
2061
+ priority,
2062
+ image,
2063
+ message = "",
2064
+ scale: scale2 = 1
2065
+ } = _ref;
2066
+ if (!this._shouldLog(logLevel || priority)) {
2067
+ return noop2;
2068
+ }
2069
+ return isBrowser5 ? logImageInBrowser2({
2070
+ image,
2071
+ message,
2072
+ scale: scale2
2073
+ }) : logImageInNode2({
2074
+ image,
2075
+ message,
2076
+ scale: scale2
2077
+ });
2078
+ }
2079
+ time(logLevel, message) {
2080
+ return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
2081
+ }
2082
+ timeEnd(logLevel, message) {
2083
+ return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
2084
+ }
2085
+ timeStamp(logLevel, message) {
2086
+ return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
2087
+ }
2088
+ group(logLevel, message) {
2089
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
2090
+ collapsed: false
2091
+ };
2092
+ const options = normalizeArguments2({
2093
+ logLevel,
2094
+ message,
2095
+ opts
2096
+ });
2097
+ const {
2098
+ collapsed
2099
+ } = opts;
2100
+ options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
2101
+ return this._getLogFunction(options);
2102
+ }
2103
+ groupCollapsed(logLevel, message) {
2104
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2105
+ return this.group(logLevel, message, Object.assign({}, opts, {
2106
+ collapsed: true
2107
+ }));
2108
+ }
2109
+ groupEnd(logLevel) {
2110
+ return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
2111
+ }
2112
+ withGroup(logLevel, message, func) {
2113
+ this.group(logLevel, message)();
2114
+ try {
2115
+ func();
2116
+ } finally {
2117
+ this.groupEnd(logLevel)();
2118
+ }
2119
+ }
2120
+ trace() {
2121
+ if (console.trace) {
2122
+ console.trace();
2123
+ }
2124
+ }
2125
+ _shouldLog(logLevel) {
2126
+ return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
2127
+ }
2128
+ _getLogFunction(logLevel, message, method, args, opts) {
2129
+ if (this._shouldLog(logLevel)) {
2130
+ opts = normalizeArguments2({
2131
+ logLevel,
2132
+ message,
2133
+ args,
2134
+ opts
2135
+ });
2136
+ method = method || opts.method;
2137
+ assert4(method);
2138
+ opts.total = this.getTotal();
2139
+ opts.delta = this.getDelta();
2140
+ this._deltaTs = getHiResTimestamp3();
2141
+ const tag = opts.tag || opts.message;
2142
+ if (opts.once) {
2143
+ if (!cache2[tag]) {
2144
+ cache2[tag] = getHiResTimestamp3();
2145
+ } else {
2146
+ return noop2;
2147
+ }
2148
+ }
2149
+ message = decorateMessage2(this.id, opts.message, opts);
2150
+ return method.bind(console, message, ...opts.args);
2151
+ }
2152
+ return noop2;
2153
+ }
2154
+ };
2155
+ _defineProperty(Log2, "VERSION", VERSION4);
2156
+ function normalizeLogLevel2(logLevel) {
2157
+ if (!logLevel) {
2158
+ return 0;
2159
+ }
2160
+ let resolvedLevel;
2161
+ switch (typeof logLevel) {
2162
+ case "number":
2163
+ resolvedLevel = logLevel;
2164
+ break;
2165
+ case "object":
2166
+ resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
2167
+ break;
2168
+ default:
2169
+ return 0;
2170
+ }
2171
+ assert4(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
2172
+ return resolvedLevel;
2173
+ }
2174
+ function normalizeArguments2(opts) {
2175
+ const {
2176
+ logLevel,
2177
+ message
2178
+ } = opts;
2179
+ opts.logLevel = normalizeLogLevel2(logLevel);
2180
+ const args = opts.args ? Array.from(opts.args) : [];
2181
+ while (args.length && args.shift() !== message) {
2182
+ }
2183
+ switch (typeof logLevel) {
2184
+ case "string":
2185
+ case "function":
2186
+ if (message !== void 0) {
2187
+ args.unshift(message);
2188
+ }
2189
+ opts.message = logLevel;
2190
+ break;
2191
+ case "object":
2192
+ Object.assign(opts, logLevel);
2193
+ break;
2194
+ default:
2195
+ }
2196
+ if (typeof opts.message === "function") {
2197
+ opts.message = opts.message();
2198
+ }
2199
+ const messageType = typeof opts.message;
2200
+ assert4(messageType === "string" || messageType === "object");
2201
+ return Object.assign(opts, {
2202
+ args
2203
+ }, opts.opts);
2204
+ }
2205
+ function decorateMessage2(id, message, opts) {
2206
+ if (typeof message === "string") {
2207
+ const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
2208
+ message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
2209
+ message = addColor2(message, opts.color, opts.background);
2210
+ }
2211
+ return message;
2212
+ }
2213
+ function logImageInNode2(_ref2) {
2214
+ let {
2215
+ image,
2216
+ message = "",
2217
+ scale: scale2 = 1
2218
+ } = _ref2;
2219
+ let asciify = null;
2220
+ try {
2221
+ asciify = module.require("asciify-image");
2222
+ } catch (error) {
2223
+ }
2224
+ if (asciify) {
2225
+ return () => asciify(image, {
2226
+ fit: "box",
2227
+ width: "".concat(Math.round(80 * scale2), "%")
2228
+ }).then((data) => console.log(data));
2229
+ }
2230
+ return noop2;
2231
+ }
2232
+ function logImageInBrowser2(_ref3) {
2233
+ let {
2234
+ image,
2235
+ message = "",
2236
+ scale: scale2 = 1
2237
+ } = _ref3;
2238
+ if (typeof image === "string") {
2239
+ const img = new Image();
2240
+ img.onload = () => {
2241
+ const args = formatImage2(img, message, scale2);
2242
+ console.log(...args);
2243
+ };
2244
+ img.src = image;
2245
+ return noop2;
2246
+ }
2247
+ const element = image.nodeName || "";
2248
+ if (element.toLowerCase() === "img") {
2249
+ console.log(...formatImage2(image, message, scale2));
2250
+ return noop2;
2251
+ }
2252
+ if (element.toLowerCase() === "canvas") {
2253
+ const img = new Image();
2254
+ img.onload = () => console.log(...formatImage2(img, message, scale2));
2255
+ img.src = image.toDataURL();
2256
+ return noop2;
2257
+ }
2258
+ return noop2;
2259
+ }
2260
+ function getTableHeader2(table) {
2261
+ for (const key in table) {
2262
+ for (const title in table[key]) {
2263
+ return title || "untitled";
2264
+ }
2265
+ }
2266
+ return "empty";
2267
+ }
2268
+
2269
+ // ../../node_modules/@probe.gl/log/dist/esm/index.js
2270
+ var esm_default2 = new Log2({
2271
+ id: "@probe.gl/log"
2272
+ });
2273
+
2274
+ // ../core/src/lib/utils/log.ts
2275
+ var log = new Log2({ id: "loaders.gl" });
2276
+
1713
2277
  // ../core/src/lib/api/select-loader.ts
1714
2278
  var EXT_PATTERN = /\.([^.]+)$/;
1715
2279
  async function selectLoader(data, loaders = [], options, context) {
@@ -1754,13 +2318,22 @@
1754
2318
  const { url, type } = getResourceUrlAndType(data);
1755
2319
  const testUrl = url || context?.url;
1756
2320
  let loader = null;
2321
+ let reason = "";
1757
2322
  if (options?.mimeType) {
1758
2323
  loader = findLoaderByMIMEType(loaders, options?.mimeType);
2324
+ reason = `match forced by supplied MIME type ${options?.mimeType}`;
1759
2325
  }
1760
2326
  loader = loader || findLoaderByUrl(loaders, testUrl);
2327
+ reason = reason || (loader ? `matched url ${testUrl}` : "");
1761
2328
  loader = loader || findLoaderByMIMEType(loaders, type);
2329
+ reason = reason || (loader ? `matched MIME type ${type}` : "");
1762
2330
  loader = loader || findLoaderByInitialBytes(loaders, data);
2331
+ reason = reason || (loader ? `matched initial data ${getFirstCharacters(data)}` : "");
1763
2332
  loader = loader || findLoaderByMIMEType(loaders, options?.fallbackMimeType);
2333
+ reason = reason || (loader ? `matched fallback MIME type ${type}` : "");
2334
+ if (reason) {
2335
+ log.log(1, `selectLoader selected ${loader?.name}: ${reason}.`);
2336
+ }
1764
2337
  return loader;
1765
2338
  }
1766
2339
  function validHTTPResponse(data) {
@@ -2118,7 +2691,7 @@
2118
2691
  }
2119
2692
 
2120
2693
  // ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
2121
- function assert4(condition, message) {
2694
+ function assert5(condition, message) {
2122
2695
  if (!condition) {
2123
2696
  throw new Error("math.gl assertion ".concat(message));
2124
2697
  }
@@ -2230,7 +2803,7 @@
2230
2803
  }
2231
2804
  var MathArray = class extends _extendableBuiltin(Array) {
2232
2805
  get ELEMENTS() {
2233
- assert4(false);
2806
+ assert5(false);
2234
2807
  return 0;
2235
2808
  }
2236
2809
  clone() {
@@ -2445,11 +3018,11 @@
2445
3018
  // ../../node_modules/@math.gl/core/dist/esm/classes/base/vector.js
2446
3019
  var Vector = class extends MathArray {
2447
3020
  get ELEMENTS() {
2448
- assert4(false);
3021
+ assert5(false);
2449
3022
  return 0;
2450
3023
  }
2451
3024
  copy(vector) {
2452
- assert4(false);
3025
+ assert5(false);
2453
3026
  return this;
2454
3027
  }
2455
3028
  get x() {
@@ -2533,11 +3106,11 @@
2533
3106
  return this.distanceSquared(vector);
2534
3107
  }
2535
3108
  getComponent(i2) {
2536
- assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
3109
+ assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
2537
3110
  return checkNumber(this[i2]);
2538
3111
  }
2539
3112
  setComponent(i2, value) {
2540
- assert4(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
3113
+ assert5(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
2541
3114
  this[i2] = value;
2542
3115
  return this.check();
2543
3116
  }
@@ -2885,11 +3458,11 @@
2885
3458
  // ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
2886
3459
  var Matrix = class extends MathArray {
2887
3460
  get ELEMENTS() {
2888
- assert4(false);
3461
+ assert5(false);
2889
3462
  return 0;
2890
3463
  }
2891
3464
  get RANK() {
2892
- assert4(false);
3465
+ assert5(false);
2893
3466
  return 0;
2894
3467
  }
2895
3468
  toString() {
@@ -3944,13 +4517,13 @@
3944
4517
  };
3945
4518
 
3946
4519
  // ../../node_modules/@math.gl/core/dist/esm/index.js
3947
- var globals4 = {
4520
+ var globals5 = {
3948
4521
  self: typeof self !== "undefined" && self,
3949
4522
  window: typeof window !== "undefined" && window,
3950
4523
  global: typeof global !== "undefined" && global
3951
4524
  };
3952
- var global_4 = globals4.global || globals4.self || globals4.window;
3953
- global_4.mathgl = {
4525
+ var global_5 = globals5.global || globals5.self || globals5.window;
4526
+ global_5.mathgl = {
3954
4527
  config
3955
4528
  };
3956
4529
 
@@ -3968,9 +4541,9 @@
3968
4541
  };
3969
4542
 
3970
4543
  // ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
3971
- var noop2 = (x) => x;
4544
+ var noop3 = (x) => x;
3972
4545
  var scratchVector = new Vector3();
3973
- function fromCartographic(cartographic, result, map3 = noop2) {
4546
+ function fromCartographic(cartographic, result, map3 = noop3) {
3974
4547
  if (isArray(cartographic)) {
3975
4548
  result[0] = map3(cartographic[0]);
3976
4549
  result[1] = map3(cartographic[1]);
@@ -3987,9 +4560,9 @@
3987
4560
  return result;
3988
4561
  }
3989
4562
  function fromCartographicToRadians(cartographic, vector = scratchVector) {
3990
- return fromCartographic(cartographic, vector, config._cartographicRadians ? noop2 : toRadians);
4563
+ return fromCartographic(cartographic, vector, config._cartographicRadians ? noop3 : toRadians);
3991
4564
  }
3992
- function toCartographic(vector, cartographic, map3 = noop2) {
4565
+ function toCartographic(vector, cartographic, map3 = noop3) {
3993
4566
  if (isArray(cartographic)) {
3994
4567
  cartographic[0] = map3(vector[0]);
3995
4568
  cartographic[1] = map3(vector[1]);
@@ -4006,7 +4579,7 @@
4006
4579
  return cartographic;
4007
4580
  }
4008
4581
  function toCartographicFromRadians(vector, cartographic) {
4009
- return toCartographic(vector, cartographic, config._cartographicRadians ? noop2 : toDegrees);
4582
+ return toCartographic(vector, cartographic, config._cartographicRadians ? noop3 : toDegrees);
4010
4583
  }
4011
4584
 
4012
4585
  // ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
@@ -4131,7 +4704,7 @@
4131
4704
  var scratchVector3 = new Vector3();
4132
4705
  function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
4133
4706
  const thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
4134
- assert4(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
4707
+ assert5(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
4135
4708
  let firstAxisVector;
4136
4709
  let secondAxisVector;
4137
4710
  let thirdAxisVector;
@@ -4205,9 +4778,9 @@
4205
4778
  return wgs84;
4206
4779
  }
4207
4780
  constructor(x = 0, y = 0, z = 0) {
4208
- assert4(x >= 0);
4209
- assert4(y >= 0);
4210
- assert4(z >= 0);
4781
+ assert5(x >= 0);
4782
+ assert5(y >= 0);
4783
+ assert5(z >= 0);
4211
4784
  this.radii = new Vector3(x, y, z);
4212
4785
  this.radiiSquared = new Vector3(x * x, y * y, z * z);
4213
4786
  this.radiiToTheFourth = new Vector3(x * x * x * x, y * y * y * y, z * z * z * z);
@@ -4292,8 +4865,8 @@
4292
4865
  return scratchPosition.from(position).scale(this.radii).to(result);
4293
4866
  }
4294
4867
  getSurfaceNormalIntersectionWithZAxis(position, buffer = 0, result = [0, 0, 0]) {
4295
- assert4(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
4296
- assert4(this.radii.z > 0);
4868
+ assert5(equals(this.radii.x, this.radii.y, math_utils_default.EPSILON15));
4869
+ assert5(this.radii.z > 0);
4297
4870
  scratchPosition.from(position);
4298
4871
  const z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);
4299
4872
  if (Math.abs(z) >= this.radii.z - buffer) {
@@ -4304,7 +4877,7 @@
4304
4877
  };
4305
4878
 
4306
4879
  // ../images/src/lib/utils/version.ts
4307
- var VERSION4 = true ? "3.1.6" : "latest";
4880
+ var VERSION5 = true ? "3.1.7" : "latest";
4308
4881
 
4309
4882
  // ../images/src/lib/category-api/image-type.ts
4310
4883
  var { _parseImageNode } = globalThis;
@@ -4643,7 +5216,7 @@
4643
5216
  id: "image",
4644
5217
  module: "images",
4645
5218
  name: "Images",
4646
- version: VERSION4,
5219
+ version: VERSION5,
4647
5220
  mimeTypes: MIME_TYPES,
4648
5221
  extensions: EXTENSIONS,
4649
5222
  parse: parseImage,
@@ -4652,7 +5225,7 @@
4652
5225
  };
4653
5226
 
4654
5227
  // ../draco/src/lib/utils/version.ts
4655
- var VERSION5 = true ? "3.1.6" : "latest";
5228
+ var VERSION6 = true ? "3.1.7" : "latest";
4656
5229
 
4657
5230
  // ../draco/src/draco-loader.ts
4658
5231
  var DEFAULT_DRACO_OPTIONS = {
@@ -4668,7 +5241,7 @@
4668
5241
  id: "draco",
4669
5242
  module: "draco",
4670
5243
  shapes: ["mesh"],
4671
- version: VERSION5,
5244
+ version: VERSION6,
4672
5245
  worker: true,
4673
5246
  extensions: ["drc"],
4674
5247
  mimeTypes: ["application/octet-stream"],
@@ -4705,7 +5278,7 @@
4705
5278
  }
4706
5279
 
4707
5280
  // ../schema/src/lib/utils/assert.ts
4708
- function assert5(condition, message) {
5281
+ function assert6(condition, message) {
4709
5282
  if (!condition) {
4710
5283
  throw new Error(message || "loader assertion failed.");
4711
5284
  }
@@ -4714,7 +5287,7 @@
4714
5287
  // ../schema/src/lib/schema/impl/schema.ts
4715
5288
  var Schema = class {
4716
5289
  constructor(fields, metadata) {
4717
- assert5(Array.isArray(fields));
5290
+ assert6(Array.isArray(fields));
4718
5291
  checkNames(fields);
4719
5292
  this.fields = fields;
4720
5293
  this.metadata = metadata || new Map();
@@ -5636,12 +6209,12 @@
5636
6209
  }
5637
6210
 
5638
6211
  // ../textures/src/lib/utils/version.ts
5639
- var VERSION6 = true ? "3.1.6" : "latest";
6212
+ var VERSION7 = true ? "3.1.7" : "latest";
5640
6213
 
5641
6214
  // ../textures/src/lib/parsers/basis-module-loader.ts
5642
- var VERSION7 = true ? "3.1.6" : "latest";
5643
- var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.wasm`;
5644
- var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.js`;
6215
+ var VERSION8 = true ? "3.1.7" : "latest";
6216
+ var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.wasm`;
6217
+ var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.js`;
5645
6218
  var loadBasisTranscoderPromise;
5646
6219
  async function loadBasisTrascoderModule(options) {
5647
6220
  const modules = options.modules || {};
@@ -6230,7 +6803,7 @@
6230
6803
  name: "Basis",
6231
6804
  id: "basis",
6232
6805
  module: "textures",
6233
- version: VERSION6,
6806
+ version: VERSION7,
6234
6807
  worker: true,
6235
6808
  extensions: ["basis", "ktx2"],
6236
6809
  mimeTypes: ["application/octet-stream", "image/ktx2"],
@@ -6543,7 +7116,7 @@
6543
7116
  name: "Texture Containers",
6544
7117
  id: "compressed-texture",
6545
7118
  module: "textures",
6546
- version: VERSION6,
7119
+ version: VERSION7,
6547
7120
  worker: true,
6548
7121
  extensions: [
6549
7122
  "ktx",
@@ -6605,7 +7178,7 @@
6605
7178
  }
6606
7179
 
6607
7180
  // ../../node_modules/@luma.gl/constants/dist/esm/index.js
6608
- var esm_default2 = {
7181
+ var esm_default3 = {
6609
7182
  DEPTH_BUFFER_BIT: 256,
6610
7183
  STENCIL_BUFFER_BIT: 1024,
6611
7184
  COLOR_BUFFER_BIT: 16384,
@@ -7240,11 +7813,11 @@
7240
7813
  }
7241
7814
  }
7242
7815
  var GL_TYPE_MAP = {
7243
- UInt8: esm_default2.UNSIGNED_BYTE,
7244
- UInt16: esm_default2.UNSIGNED_INT,
7245
- Float32: esm_default2.FLOAT,
7246
- UInt32: esm_default2.UNSIGNED_INT,
7247
- UInt64: esm_default2.DOUBLE
7816
+ UInt8: esm_default3.UNSIGNED_BYTE,
7817
+ UInt16: esm_default3.UNSIGNED_INT,
7818
+ Float32: esm_default3.FLOAT,
7819
+ UInt32: esm_default3.UNSIGNED_INT,
7820
+ UInt64: esm_default3.DOUBLE
7248
7821
  };
7249
7822
  function sizeOf(dataType) {
7250
7823
  switch (dataType) {
@@ -7642,13 +8215,13 @@
7642
8215
  }
7643
8216
 
7644
8217
  // src/i3s-content-loader.ts
7645
- var VERSION8 = true ? "3.1.6" : "latest";
8218
+ var VERSION9 = true ? "3.1.7" : "latest";
7646
8219
  var I3SContentLoader = {
7647
8220
  name: "I3S Content (Indexed Scene Layers)",
7648
8221
  id: "i3s-content",
7649
8222
  module: "i3s",
7650
8223
  worker: true,
7651
- version: VERSION8,
8224
+ version: VERSION9,
7652
8225
  mimeTypes: ["application/octet-stream"],
7653
8226
  parse: parse3,
7654
8227
  extensions: ["bin"],