@maptiler/sdk 2.2.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,14 +4,14 @@ var me = (r) => {
4
4
  };
5
5
  var at = (r, e, t) => e in r ? rt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
6
6
  var T = (r, e, t) => at(r, typeof e != "symbol" ? e + "" : e, t), re = (r, e, t) => e.has(r) || me("Cannot " + t);
7
- var L = (r, e, t) => (re(r, e, "read from private field"), t ? t.call(r) : e.get(r)), D = (r, e, t) => e.has(r) ? me("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), $ = (r, e, t, o) => (re(r, e, "write to private field"), o ? o.call(r, t) : e.set(r, t), t), P = (r, e, t) => (re(r, e, "access private method"), t);
7
+ var L = (r, e, t) => (re(r, e, "read from private field"), t ? t.call(r) : e.get(r)), U = (r, e, t) => e.has(r) ? me("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), $ = (r, e, t, o) => (re(r, e, "write to private field"), o ? o.call(r, t) : e.set(r, t), t), k = (r, e, t) => (re(r, e, "access private method"), t);
8
8
  import f from "maplibre-gl";
9
- import nt from "events";
10
- import { config as ae, MapStyle as lt, mapStylePresetList as it, expandMapStyle as st, MapStyleVariant as ct, ReferenceMapStyle as ut, geolocation as fe } from "@maptiler/client";
11
- import { LanguageGeocoding as Qr, MapStyle as ea, MapStyleVariant as ta, ReferenceMapStyle as oa, ServiceError as ra, bufferToPixelDataBrowser as aa, circumferenceAtLatitude as na, coordinates as la, data as ia, elevation as sa, expandMapStyle as ca, geocoding as ua, geolocation as pa, getAutoLanguageGeocoding as da, getBufferToPixelDataParser as ha, getTileCache as ma, mapStylePresetList as fa, math as ga, misc as ya, staticMaps as va, styleToStyle as La } from "@maptiler/client";
12
- import { v4 as pt } from "uuid";
13
- import { Base64 as dt } from "js-base64";
14
- const ht = "@maptiler/sdk", mt = "2.2.2", ft = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", gt = "dist/maptiler-sdk.mjs", yt = "dist/maptiler-sdk.d.ts", vt = "dist/maptiler-sdk.css", Lt = "module", At = {
9
+ import { Language as nt, getLanguageInfoFromCode as fe, config as ae, MapStyle as lt, mapStylePresetList as it, expandMapStyle as st, MapStyleVariant as ct, ReferenceMapStyle as ut, getLanguageInfoFromFlag as dt, toLanguageInfo as pt, geolocation as ge } from "@maptiler/client";
10
+ import { MapStyle as oa, MapStyleVariant as ra, ReferenceMapStyle as aa, ServiceError as na, areSameLanguages as la, bufferToPixelDataBrowser as ia, circumferenceAtLatitude as sa, coordinates as ca, data as ua, elevation as da, expandMapStyle as pa, geocoding as ha, geolocation as ma, getAutoLanguage as fa, getBufferToPixelDataParser as ga, getLanguageInfoFromCode as ya, getLanguageInfoFromFlag as va, getLanguageInfoFromKey as La, getTileCache as wa, isLanguageInfo as Ca, mapStylePresetList as ba, math as Sa, misc as Aa, staticMaps as Ta, styleToStyle as Ra, toLanguageInfo as _a } from "@maptiler/client";
11
+ import ht from "events";
12
+ import { v4 as mt } from "uuid";
13
+ import { Base64 as ft } from "js-base64";
14
+ const gt = "@maptiler/sdk", yt = "2.3.0", vt = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", Lt = "dist/maptiler-sdk.mjs", wt = "dist/maptiler-sdk.d.ts", Ct = "dist/maptiler-sdk.css", bt = "module", St = {
15
15
  ".": {
16
16
  import: "./dist/maptiler-sdk.mjs",
17
17
  types: "./dist/maptiler-sdk.d.ts"
@@ -22,7 +22,7 @@ const ht = "@maptiler/sdk", mt = "2.2.2", ft = "The Javascript & TypeScript map
22
22
  "./style.css": {
23
23
  import: "./dist/maptiler-sdk.css"
24
24
  }
25
- }, Ct = [
25
+ }, At = [
26
26
  "maptiler",
27
27
  "map",
28
28
  "sdk",
@@ -30,194 +30,106 @@ const ht = "@maptiler/sdk", mt = "2.2.2", ft = "The Javascript & TypeScript map
30
30
  "cloud",
31
31
  "webGL",
32
32
  "maplibre"
33
- ], wt = "https://docs.maptiler.com/sdk-js/", St = "BSD-3-Clause", bt = {
33
+ ], Tt = "https://docs.maptiler.com/sdk-js/", Rt = "BSD-3-Clause", _t = {
34
34
  type: "git",
35
35
  url: "https://github.com/maptiler/maptiler-sdk-js.git"
36
- }, Tt = {
36
+ }, Et = {
37
37
  biome: "biome check --max-diagnostics=1000",
38
38
  "biome:fix": "npx @biomejs/biome check --max-diagnostics=1000 --write",
39
39
  doc: "rm -rf docs/* && typedoc --out docs && cp -r images docs/",
40
40
  test: "vitest run",
41
41
  "build-css": "node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css",
42
- "build-umd": "NODE_ENV=production tsc && vite build -c vite.config-umd.ts",
43
- "build-es": "NODE_ENV=production tsc && vite build -c vite.config-es.ts",
42
+ "build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts",
43
+ "build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts",
44
44
  build: "npm run build-es; npm run build-umd; npm run build-css",
45
- make: "npm run biome:fix && npm run build"
46
- }, Et = "MapTiler", It = {
45
+ make: "npm run biome:fix && npm run build",
46
+ "dev-umd": "npm run build-css && tsc && NODE_ENV=dev vite build -w -c vite.config-umd.ts",
47
+ help: "vite build --help"
48
+ }, xt = "MapTiler", It = {
47
49
  "@biomejs/biome": "1.8.3",
48
50
  "@types/uuid": "^9.0.2",
49
51
  "@types/xmldom": "^0.1.31",
52
+ "@xmldom/xmldom": "^0.8.10",
50
53
  serve: "^14.2.0",
51
54
  terser: "^5.17.1",
52
55
  typedoc: "^0.24.8",
53
56
  typescript: "^5.1.6",
54
- vitest: "^0.34.2",
55
57
  vite: "^5.3.4",
56
- "vite-plugin-dts": "^4.0.0-beta.0"
57
- }, Rt = {
58
- "@maptiler/client": "^1.8.1",
58
+ "vite-plugin-dts": "^4.0.0-beta.0",
59
+ vitest: "^0.34.2"
60
+ }, Mt = {
61
+ "@maptiler/client": "^2.0.0",
59
62
  events: "^3.3.0",
60
63
  "js-base64": "^3.7.4",
61
- "maplibre-gl": "4.4.1",
62
- uuid: "^9.0.0",
63
- xmldom: "^0.6.0"
64
- }, _t = {
65
- name: ht,
66
- version: mt,
67
- description: ft,
68
- module: gt,
69
- types: yt,
70
- style: vt,
71
- type: Lt,
72
- exports: At,
73
- keywords: Ct,
74
- homepage: wt,
75
- license: St,
76
- repository: bt,
77
- scripts: Tt,
78
- author: Et,
64
+ "maplibre-gl": "^4.7.0",
65
+ uuid: "^9.0.0"
66
+ }, Pt = {
67
+ name: gt,
68
+ version: yt,
69
+ description: vt,
70
+ module: Lt,
71
+ types: wt,
72
+ style: Ct,
73
+ type: bt,
74
+ exports: St,
75
+ keywords: At,
76
+ homepage: Tt,
77
+ license: Rt,
78
+ repository: _t,
79
+ scripts: Et,
80
+ author: xt,
79
81
  devDependencies: It,
80
- dependencies: Rt
82
+ dependencies: Mt
81
83
  }, C = {
82
84
  /**
83
- * The visitor language mode concatenates the prefered language from the user settings and the "default name".
84
- * Note: The "default name" is equivalent to OSM's `{name}`, which can be the most recognized names a global
85
- * scale or the local name.
86
- * This mode is helpful in the context where a user needs to access both the local names and the names in their
87
- * own language, for instance when traveling abroad, where signs likely to be only available in the local language.
88
- */
89
- VISITOR: "visitor",
90
- /**
91
- * The visitor language mode concatenates English and the "default name".
92
- * Note: The "default name" is equivalent to OSM's `{name}`, which can be the most recognized names a global
93
- * scale or the local name.
94
- * This mode is helpful in the context where a user needs to access both the local names and the names in their
95
- * own language, for instance when traveling abroad, where signs likely to be only available in the local language.
96
- */
97
- VISITOR_ENGLISH: "visitor_en",
98
- /**
99
- * Language as the style is designed. Not that this is the default state and one
100
- * the language has been changed to another than `STYLE`, then it cannot be set back to `STYLE`.
101
- */
102
- STYLE: "style",
103
- /**
104
- * AUTO mode uses the language of the browser
105
- */
106
- AUTO: "auto",
107
- /**
108
- * STYLE is a custom flag to keep the language of the map as defined into the style.
109
- * If STYLE is set in the constructor, then further modification of the language
110
- * with `.setLanguage()` is not possible.
111
- */
112
- STYLE_LOCK: "style_lock",
113
- /**
114
- * Default fallback languages that uses latin charaters
115
- */
116
- LATIN: "name:latin",
117
- /**
118
- * Default fallback languages that uses non-latin charaters
119
- */
120
- NON_LATIN: "name:nonlatin",
121
- /**
122
- * Labels are in their local language, when available
123
- */
124
- LOCAL: "name",
125
- /**
126
- * International name
127
- */
128
- INTERNATIONAL: "name_int",
129
- ALBANIAN: "name:sq",
130
- AMHARIC: "name:am",
131
- ARABIC: "name:ar",
132
- ARMENIAN: "name:hy",
133
- AZERBAIJANI: "name:az",
134
- BASQUE: "name:eu",
135
- BELORUSSIAN: "name:be",
136
- BENGALI: "name:bn",
137
- BOSNIAN: "name:bs",
138
- BRETON: "name:br",
139
- BULGARIAN: "name:bg",
140
- CATALAN: "name:ca",
141
- CHINESE: "name:zh",
142
- TRADITIONAL_CHINESE: "name:zh-Hant",
143
- SIMPLIFIED_CHINESE: "name:zh-Hans",
144
- CORSICAN: "name:co",
145
- CROATIAN: "name:hr",
146
- CZECH: "name:cs",
147
- DANISH: "name:da",
148
- DUTCH: "name:nl",
149
- ENGLISH: "name:en",
150
- ESPERANTO: "name:eo",
151
- ESTONIAN: "name:et",
152
- FINNISH: "name:fi",
153
- FRENCH: "name:fr",
154
- FRISIAN: "name:fy",
155
- GEORGIAN: "name:ka",
156
- GERMAN: "name:de",
157
- GREEK: "name:el",
158
- HEBREW: "name:he",
159
- HINDI: "name:hi",
160
- HUNGARIAN: "name:hu",
161
- ICELANDIC: "name:is",
162
- INDONESIAN: "name:id",
163
- IRISH: "name:ga",
164
- ITALIAN: "name:it",
165
- JAPANESE: "name:ja",
166
- JAPANESE_HIRAGANA: "name:ja-Hira",
167
- JAPANESE_KANA: "name:ja_kana",
168
- JAPANESE_LATIN: "name:ja_rm",
169
- JAPANESE_2018: "name:ja-Latn",
170
- KANNADA: "name:kn",
171
- KAZAKH: "name:kk",
172
- KOREAN: "name:ko",
173
- KOREAN_LATIN: "name:ko-Latn",
174
- KURDISH: "name:ku",
175
- ROMAN_LATIN: "name:la",
176
- LATVIAN: "name:lv",
177
- LITHUANIAN: "name:lt",
178
- LUXEMBOURGISH: "name:lb",
179
- MACEDONIAN: "name:mk",
180
- MALAYALAM: "name:ml",
181
- MALTESE: "name:mt",
182
- NORWEGIAN: "name:no",
183
- OCCITAN: "name:oc",
184
- PERSIAN: "name:fa",
185
- POLISH: "name:pl",
186
- PORTUGUESE: "name:pt",
187
- PUNJABI: "name:pa",
188
- WESTERN_PUNJABI: "name:pnb",
189
- ROMANIAN: "name:ro",
190
- ROMANSH: "name:rm",
191
- RUSSIAN: "name:ru",
192
- SCOTTISH_GAELIC: "name:gd",
193
- SERBIAN_CYRILLIC: "name:sr",
194
- SERBIAN_LATIN: "name:sr-Latn",
195
- SLOVAK: "name:sk",
196
- SLOVENE: "name:sl",
197
- SPANISH: "name:es",
198
- SWEDISH: "name:sv",
199
- TAMIL: "name:ta",
200
- TELUGU: "name:te",
201
- THAI: "name:th",
202
- TURKISH: "name:tr",
203
- UKRAINIAN: "name:uk",
204
- URDU: "name:ur",
205
- VIETNAMIAN_LATIN: "name:vi",
206
- WELSH: "name:cy"
207
- }, xt = new Set(Object.values(C));
208
- function ge(r) {
209
- return xt.has(r);
210
- }
211
- const Nt = new Set(Object.values(C));
85
+ * Language mode to display labels in both the local language and the language of the visitor's device, concatenated.
86
+ * Note that if those two languages are the same, labels won't be duplicated.
87
+ */
88
+ VISITOR: {
89
+ code: null,
90
+ flag: "visitor",
91
+ name: "Visitor",
92
+ latin: !0,
93
+ isMode: !0,
94
+ geocoding: !1
95
+ },
96
+ /**
97
+ * Language mode to display labels in both the local language and English, concatenated.
98
+ * Note that if those two languages are the same, labels won't be duplicated.
99
+ */
100
+ VISITOR_ENGLISH: {
101
+ code: null,
102
+ flag: "visitor_en",
103
+ name: "Visitor English",
104
+ latin: !0,
105
+ isMode: !0,
106
+ geocoding: !1
107
+ },
108
+ /**
109
+ * Language mode to display labels in a language enforced in the style.
110
+ */
111
+ STYLE: { code: null, flag: "style", name: "Style", latin: !1, isMode: !0, geocoding: !1 },
112
+ /**
113
+ * Language mode to display labels in a language enforced in the style. The language cannot be further modified.
114
+ */
115
+ STYLE_LOCK: {
116
+ code: null,
117
+ flag: "style_lock",
118
+ name: "Style Lock",
119
+ latin: !1,
120
+ isMode: !0,
121
+ geocoding: !1
122
+ },
123
+ ...nt
124
+ };
212
125
  function ye() {
213
- if (typeof navigator > "u")
214
- return `name:${Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0]}`;
215
- const r = Array.from(new Set(navigator.languages.map((e) => `name:${e.split("-")[0]}`))).filter(
216
- (e) => Nt.has(e)
217
- );
218
- return r.length ? r[0] : C.LOCAL;
126
+ if (typeof navigator > "u") {
127
+ const e = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0], t = fe(e);
128
+ return t || C.ENGLISH;
129
+ }
130
+ return Array.from(new Set(navigator.languages.map((e) => e.split("-")[0]))).map((e) => fe(e)).filter((e) => e)[0] ?? C.LOCAL;
219
131
  }
220
- const k = {
132
+ const O = {
221
133
  maptilerLogoURL: "https://api.maptiler.com/resources/logo.svg",
222
134
  maptilerURL: "https://www.maptiler.com/",
223
135
  maptilerApiHost: "api.maptiler.com",
@@ -227,15 +139,15 @@ const k = {
227
139
  terrainSourceURL: "https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",
228
140
  terrainSourceId: "maptiler-terrain"
229
141
  };
230
- Object.freeze(k);
231
- const Fe = pt();
232
- class Mt extends nt {
142
+ Object.freeze(O);
143
+ const Be = mt();
144
+ class kt extends ht {
233
145
  constructor() {
234
146
  super(...arguments);
235
147
  /**
236
148
  * The primary language. By default, the language of the web browser is used.
237
149
  */
238
- T(this, "primaryLanguage", k.primaryLanguage);
150
+ T(this, "primaryLanguage", O.primaryLanguage);
239
151
  /**
240
152
  * The secondary language, to overwrite the default language defined in the map style.
241
153
  * This settings is highly dependant on the style compatibility and may not work in most cases.
@@ -301,9 +213,9 @@ class Mt extends nt {
301
213
  return ae.fetch;
302
214
  }
303
215
  }
304
- const N = new Mt(), { addProtocol: ve } = f, ie = "localcache_source", se = "localcache", Pt = "maptiler_sdk", Ot = 1e3, kt = 100, ce = typeof caches < "u";
305
- function Ft(r, e) {
306
- if (ce && N.caching && N.session && r.host === k.maptilerApiHost) {
216
+ const M = new kt(), { addProtocol: ve } = f, ie = "localcache_source", se = "localcache", Ft = "maptiler_sdk", Ot = 1e3, Bt = 100, ce = typeof caches < "u";
217
+ function Nt(r, e) {
218
+ if (ce && M.caching && M.session && r.host === O.maptilerApiHost) {
307
219
  if (e === "Source" && r.href.includes("tiles.json"))
308
220
  return r.href.replace("https://", `${ie}://`);
309
221
  if (e === "Tile" || e === "Glyphs")
@@ -312,16 +224,16 @@ function Ft(r, e) {
312
224
  return r.href;
313
225
  }
314
226
  let ne;
315
- async function Be() {
316
- return ne || (ne = await caches.open(Pt)), ne;
227
+ async function Ne() {
228
+ return ne || (ne = await caches.open(Ft)), ne;
317
229
  }
318
230
  let Le = 0;
319
- async function Bt() {
320
- const r = await Be(), e = await r.keys(), t = e.slice(0, Math.max(e.length - Ot, 0));
231
+ async function zt() {
232
+ const r = await Ne(), e = await r.keys(), t = e.slice(0, Math.max(e.length - Ot, 0));
321
233
  for (const o of t)
322
234
  r.delete(o);
323
235
  }
324
- function zt() {
236
+ function Dt() {
325
237
  ve(
326
238
  ie,
327
239
  async (r, e) => {
@@ -345,18 +257,18 @@ function zt() {
345
257
  o.searchParams.delete("mtsid"), o.searchParams.delete("key");
346
258
  const a = o.toString(), n = new URL(t);
347
259
  n.searchParams.delete("last-modified");
348
- const l = n.toString(), i = async (u) => ({
349
- data: await u.arrayBuffer(),
350
- cacheControl: u.headers.get("Cache-Control"),
351
- expires: u.headers.get("Expires")
352
- }), c = await Be(), h = await c.match(a);
260
+ const l = n.toString(), i = async (d) => ({
261
+ data: await d.arrayBuffer(),
262
+ cacheControl: d.headers.get("Cache-Control"),
263
+ expires: d.headers.get("Expires")
264
+ }), u = await Ne(), h = await u.match(a);
353
265
  if (h)
354
266
  return i(h);
355
- const s = r;
356
- s.signal = e.signal;
357
- const p = await fetch(l, s);
358
- return p.status >= 200 && p.status < 300 && (c.put(a, p.clone()).catch(() => {
359
- }), ++Le > kt && (Bt(), Le = 0)), i(p);
267
+ const c = r;
268
+ c.signal = e.signal;
269
+ const s = await fetch(l, c);
270
+ return s.status >= 200 && s.status < 300 && (u.put(a, s.clone()).catch(() => {
271
+ }), ++Le > Bt && (zt(), Le = 0)), i(s);
360
272
  }
361
273
  );
362
274
  }
@@ -365,22 +277,22 @@ function Ut() {
365
277
  const r = f.getRTLTextPluginStatus();
366
278
  if (r === "unavailable" || r === "requested")
367
279
  try {
368
- f.setRTLTextPlugin(k.rtlPluginURL, !0);
280
+ f.setRTLTextPlugin(O.rtlPluginURL, !0);
369
281
  } catch {
370
282
  }
371
283
  }
372
- function Dt(r, e) {
284
+ function Gt(r, e) {
373
285
  for (const t of r)
374
286
  typeof e[t] == "function" && (e[t] = e[t].bind(e));
375
287
  }
376
- function V(r, e, t) {
288
+ function Z(r, e, t) {
377
289
  const o = window.document.createElement(r);
378
290
  return e !== void 0 && (o.className = e), t && t.appendChild(o), o;
379
291
  }
380
292
  function ze(r) {
381
293
  r.parentNode && r.parentNode.removeChild(r);
382
294
  }
383
- function Ae(r, e) {
295
+ function we(r, e) {
384
296
  let t = null;
385
297
  try {
386
298
  t = new URL(r);
@@ -389,23 +301,23 @@ function Ae(r, e) {
389
301
  url: r
390
302
  };
391
303
  }
392
- return t.host === k.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", N.apiKey), N.session && t.searchParams.append("mtsid", Fe)), {
393
- url: Ft(t, e)
304
+ return t.host === O.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", M.apiKey), M.session && t.searchParams.append("mtsid", Be)), {
305
+ url: Nt(t, e)
394
306
  };
395
307
  }
396
308
  function Ce(r) {
397
309
  return (e, t) => {
398
310
  if (r != null) {
399
- const o = r(e, t), a = Ae((o == null ? void 0 : o.url) ?? "", t);
311
+ const o = r(e, t), a = we((o == null ? void 0 : o.url) ?? "", t);
400
312
  return {
401
313
  ...o,
402
314
  ...a
403
315
  };
404
316
  }
405
- return Ae(e, t);
317
+ return we(e, t);
406
318
  };
407
319
  }
408
- function Ue() {
320
+ function De() {
409
321
  return Math.random().toString(36).substring(2);
410
322
  }
411
323
  function ee(r) {
@@ -418,11 +330,11 @@ function Ht(r) {
418
330
  }
419
331
  return null;
420
332
  }
421
- function Gt() {
333
+ function Vt() {
422
334
  return document.createElement("canvas").getContext("webgl2") ? null : typeof WebGL2RenderingContext < "u" ? "Graphic rendering with WebGL2 has been disabled or is not supported by your graphic card. The map cannot be displayed." : "Your browser does not support graphic rendering with WebGL2. The map cannot be displayed.";
423
335
  }
424
- function Vt(r) {
425
- const e = Gt();
336
+ function $t(r) {
337
+ const e = Vt();
426
338
  if (!e) return;
427
339
  let t = null;
428
340
  if (typeof r == "string" ? t = document.getElementById(r) : r instanceof HTMLElement && (t = r), !t)
@@ -430,52 +342,52 @@ function Vt(r) {
430
342
  const o = document.createElement("div");
431
343
  throw o.innerHTML = e, o.classList.add("no-webgl-support-div"), t.appendChild(o), new Error(e);
432
344
  }
433
- let Eo = class extends f.Marker {
345
+ let xo = class extends f.Marker {
434
346
  addTo(e) {
435
347
  return super.addTo(e);
436
348
  }
437
349
  };
438
- class Ro extends f.Popup {
350
+ class Mo extends f.Popup {
439
351
  addTo(e) {
440
352
  return super.addTo(e);
441
353
  }
442
354
  }
443
- class _o extends f.Style {
355
+ class Po extends f.Style {
444
356
  constructor(e, t = {}) {
445
357
  super(e, t);
446
358
  }
447
359
  }
448
- class xo extends f.CanvasSource {
360
+ class ko extends f.CanvasSource {
449
361
  onAdd(e) {
450
362
  super.onAdd(e);
451
363
  }
452
364
  }
453
- class No extends f.GeoJSONSource {
365
+ class Fo extends f.GeoJSONSource {
454
366
  onAdd(e) {
455
367
  super.onAdd(e);
456
368
  }
457
369
  }
458
- class Mo extends f.ImageSource {
370
+ class Oo extends f.ImageSource {
459
371
  onAdd(e) {
460
372
  super.onAdd(e);
461
373
  }
462
374
  }
463
- class Po extends f.RasterTileSource {
375
+ class Bo extends f.RasterTileSource {
464
376
  onAdd(e) {
465
377
  super.onAdd(e);
466
378
  }
467
379
  }
468
- class Oo extends f.RasterDEMTileSource {
380
+ class No extends f.RasterDEMTileSource {
469
381
  onAdd(e) {
470
382
  super.onAdd(e);
471
383
  }
472
384
  }
473
- class ko extends f.VectorTileSource {
385
+ class zo extends f.VectorTileSource {
474
386
  onAdd(e) {
475
387
  super.onAdd(e);
476
388
  }
477
389
  }
478
- class Fo extends f.VideoSource {
390
+ class Do extends f.VideoSource {
479
391
  onAdd(e) {
480
392
  super.onAdd(e);
481
393
  }
@@ -485,82 +397,82 @@ class jt extends f.NavigationControl {
485
397
  return super.onAdd(e);
486
398
  }
487
399
  }
488
- class $t extends f.GeolocateControl {
400
+ class Kt extends f.GeolocateControl {
489
401
  onAdd(e) {
490
402
  return super.onAdd(e);
491
403
  }
492
404
  }
493
- class Bo extends f.AttributionControl {
405
+ class Uo extends f.AttributionControl {
494
406
  onAdd(e) {
495
407
  return super.onAdd(e);
496
408
  }
497
409
  }
498
- class Kt extends f.LogoControl {
410
+ class Zt extends f.LogoControl {
499
411
  onAdd(e) {
500
412
  return super.onAdd(e);
501
413
  }
502
414
  }
503
- class Zt extends f.ScaleControl {
415
+ class Wt extends f.ScaleControl {
504
416
  onAdd(e) {
505
417
  return super.onAdd(e);
506
418
  }
507
419
  }
508
- class Wt extends f.FullscreenControl {
420
+ class Yt extends f.FullscreenControl {
509
421
  onAdd(e) {
510
422
  return super.onAdd(e);
511
423
  }
512
424
  }
513
- class zo extends f.TerrainControl {
425
+ class Go extends f.TerrainControl {
514
426
  onAdd(e) {
515
427
  return super.onAdd(e);
516
428
  }
517
429
  }
518
- class Uo extends f.BoxZoomHandler {
430
+ class Ho extends f.BoxZoomHandler {
519
431
  constructor(e, t) {
520
432
  super(e, t);
521
433
  }
522
434
  }
523
- class Do extends f.ScrollZoomHandler {
435
+ class Vo extends f.ScrollZoomHandler {
524
436
  constructor(e, t) {
525
437
  super(e, t);
526
438
  }
527
439
  }
528
- class Ho extends f.CooperativeGesturesHandler {
440
+ class $o extends f.CooperativeGesturesHandler {
529
441
  constructor(e, t) {
530
442
  super(e, t);
531
443
  }
532
444
  }
533
- class Go extends f.KeyboardHandler {
445
+ class jo extends f.KeyboardHandler {
534
446
  constructor(e) {
535
447
  super(e);
536
448
  }
537
449
  }
538
- class Vo extends f.TwoFingersTouchPitchHandler {
450
+ class Ko extends f.TwoFingersTouchPitchHandler {
539
451
  constructor(e) {
540
452
  super(e);
541
453
  }
542
454
  }
543
- class jo extends f.MapWheelEvent {
455
+ class Zo extends f.MapWheelEvent {
544
456
  constructor(e, t, o) {
545
457
  super(e, t, o);
546
458
  }
547
459
  }
548
- class $o extends f.MapTouchEvent {
460
+ class Wo extends f.MapTouchEvent {
549
461
  constructor(e, t, o) {
550
462
  super(e, t, o);
551
463
  }
552
464
  }
553
- class Ko extends f.MapMouseEvent {
465
+ class Yo extends f.MapMouseEvent {
554
466
  constructor(e, t, o, a = {}) {
555
467
  super(e, t, o, a);
556
468
  }
557
469
  }
558
- class we extends Kt {
470
+ class be extends Zt {
559
471
  constructor(t = {}) {
560
472
  super(t);
561
473
  T(this, "logoURL", "");
562
474
  T(this, "linkURL", "");
563
- this.logoURL = t.logoURL ?? k.maptilerLogoURL, this.linkURL = t.linkURL ?? k.maptilerURL;
475
+ this.logoURL = t.logoURL ?? O.maptilerLogoURL, this.linkURL = t.linkURL ?? O.maptilerURL;
564
476
  }
565
477
  onAdd(t) {
566
478
  this._map = t, this._compact = this.options.compact ?? !1, this._container = window.document.createElement("div"), this._container.className = "maplibregl-ctrl";
@@ -571,15 +483,15 @@ class we extends Kt {
571
483
  function Se(r) {
572
484
  return r ? typeof r == "string" || r instanceof String ? !r.startsWith("http") && r.toLowerCase().includes(".json") ? r : st(r) : r instanceof ct ? r.getExpandedStyleURL() : r instanceof ut ? r.getDefaultVariant().getExpandedStyleURL() : r : lt[it[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL();
573
485
  }
574
- class Yt {
486
+ class qt {
575
487
  constructor() {
576
488
  T(this, "_map");
577
489
  T(this, "_container");
578
490
  T(this, "_terrainButton");
579
- Dt(["_toggleTerrain", "_updateTerrainIcon"], this);
491
+ Gt(["_toggleTerrain", "_updateTerrainIcon"], this);
580
492
  }
581
493
  onAdd(e) {
582
- return this._map = e, this._container = V("div", "maplibregl-ctrl maplibregl-ctrl-group"), this._terrainButton = V("button", "maplibregl-ctrl-terrain", this._container), V("span", "maplibregl-ctrl-icon", this._terrainButton).setAttribute("aria-hidden", "true"), this._terrainButton.type = "button", this._terrainButton.addEventListener("click", this._toggleTerrain), this._updateTerrainIcon(), this._map.on("terrain", this._updateTerrainIcon), this._container;
494
+ return this._map = e, this._container = Z("div", "maplibregl-ctrl maplibregl-ctrl-group"), this._terrainButton = Z("button", "maplibregl-ctrl-terrain", this._container), Z("span", "maplibregl-ctrl-icon", this._terrainButton).setAttribute("aria-hidden", "true"), this._terrainButton.type = "button", this._terrainButton.addEventListener("click", this._toggleTerrain), this._updateTerrainIcon(), this._map.on("terrain", this._updateTerrainIcon), this._container;
583
495
  }
584
496
  onRemove() {
585
497
  ze(this._container), this._map.off("terrain", this._updateTerrainIcon), this._map = void 0;
@@ -592,11 +504,11 @@ class Yt {
592
504
  }
593
505
  }
594
506
  class Jt extends jt {
595
- constructor() {
507
+ constructor(t = {}) {
596
508
  super({
597
- showCompass: !0,
598
- showZoom: !0,
599
- visualizePitch: !0
509
+ showCompass: t.showCompass ?? !0,
510
+ showZoom: t.showZoom ?? !0,
511
+ visualizePitch: t.visualizePitch ?? !0
600
512
  });
601
513
  /**
602
514
  * Overloading: Limit how flat the compass icon can get
@@ -608,9 +520,9 @@ class Jt extends jt {
608
520
  )}) rotateX(${Math.min(70, this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle * (180 / Math.PI)}deg)` : `rotate(${this._map.transform.angle * (180 / Math.PI)}deg)`;
609
521
  this._compassIcon.style.transform = t;
610
522
  });
611
- this._compass.removeEventListener("click", this._compass.clickFunction), this._compass.addEventListener("click", (t) => {
612
- this._map.getPitch() === 0 ? this._map.easeTo({ pitch: Math.min(this._map.getMaxPitch(), 80) }) : this.options.visualizePitch ? this._map.resetNorthPitch({}, { originalEvent: t }) : this._map.resetNorth({}, { originalEvent: t });
613
- });
523
+ this._compass && (this._compass.removeEventListener("click", this._compass.clickFunction), this._compass.addEventListener("click", (o) => {
524
+ this._map.getPitch() === 0 ? this._map.easeTo({ pitch: Math.min(this._map.getMaxPitch(), 80) }) : this.options.visualizePitch ? this._map.resetNorthPitch({}, { originalEvent: o }) : this._map.resetNorth({}, { originalEvent: o });
525
+ }));
614
526
  }
615
527
  /**
616
528
  * Overloading: the button now stores its click callback so that we can later on delete it and replace it
@@ -620,8 +532,8 @@ class Jt extends jt {
620
532
  return a.clickFunction = o, a;
621
533
  }
622
534
  }
623
- const be = f.Marker, Te = f.LngLat, qt = f.LngLatBounds;
624
- class Xt extends $t {
535
+ const Ae = f.Marker, Te = f.LngLat, Xt = f.LngLatBounds;
536
+ class Qt extends Kt {
625
537
  constructor() {
626
538
  super(...arguments);
627
539
  T(this, "lastUpdatedCenter", new Te(0, 0));
@@ -632,39 +544,41 @@ class Xt extends $t {
632
544
  * @private
633
545
  */
634
546
  T(this, "_updateCamera", (t) => {
635
- var s, p;
547
+ var c, s;
636
548
  const o = new Te(t.coords.longitude, t.coords.latitude), a = t.coords.accuracy, l = {
637
549
  bearing: this._map.getBearing(),
638
550
  ...this.options.fitBoundsOptions,
639
551
  linear: !0
640
552
  }, i = this._map.getZoom();
641
- i > (((p = (s = this.options) == null ? void 0 : s.fitBoundsOptions) == null ? void 0 : p.maxZoom) ?? 30) && (l.zoom = i), this._map.fitBounds(qt.fromLngLat(o, a), l, {
553
+ i > (((s = (c = this.options) == null ? void 0 : c.fitBoundsOptions) == null ? void 0 : s.maxZoom) ?? 30) && (l.zoom = i), this._map.fitBounds(Xt.fromLngLat(o, a), l, {
642
554
  geolocateSource: !0
643
555
  // tag this camera change so it won't cause the control to change to background state
644
556
  });
645
- let c = !1;
557
+ let u = !1;
646
558
  const h = () => {
647
- c = !0;
559
+ u = !0;
648
560
  };
649
561
  this._map.once("click", h), this._map.once("dblclick", h), this._map.once("dragstart", h), this._map.once("mousedown", h), this._map.once("touchstart", h), this._map.once("wheel", h), this._map.once("moveend", () => {
650
- this._map.off("click", h), this._map.off("dblclick", h), this._map.off("dragstart", h), this._map.off("mousedown", h), this._map.off("touchstart", h), this._map.off("wheel", h), !c && (this.lastUpdatedCenter = this._map.getCenter());
562
+ this._map.off("click", h), this._map.off("dblclick", h), this._map.off("dragstart", h), this._map.off("mousedown", h), this._map.off("touchstart", h), this._map.off("wheel", h), !u && (this.lastUpdatedCenter = this._map.getCenter());
651
563
  });
652
564
  });
653
- T(this, "_setupUI", (t) => {
654
- if (this.lastUpdatedCenter = this._map.getCenter(), this._container.addEventListener("contextmenu", (o) => o.preventDefault()), this._geolocateButton = V("button", "maplibregl-ctrl-geolocate", this._container), V("span", "maplibregl-ctrl-icon", this._geolocateButton).setAttribute("aria-hidden", "true"), this._geolocateButton.type = "button", t === !1) {
655
- const o = this._map._getUIString("GeolocateControl.LocationNotAvailable");
656
- this._geolocateButton.disabled = !0, this._geolocateButton.title = o, this._geolocateButton.setAttribute("aria-label", o);
657
- } else {
658
- const o = this._map._getUIString("GeolocateControl.FindMyLocation");
659
- this._geolocateButton.title = o, this._geolocateButton.setAttribute("aria-label", o);
565
+ T(this, "_finishSetupUI", (t) => {
566
+ if (this._map) {
567
+ if (t === !1) {
568
+ const o = this._map._getUIString("GeolocateControl.LocationNotAvailable");
569
+ this._geolocateButton.disabled = !0, this._geolocateButton.title = o, this._geolocateButton.setAttribute("aria-label", o);
570
+ } else {
571
+ const o = this._map._getUIString("GeolocateControl.FindMyLocation");
572
+ this._geolocateButton.disabled = !1, this._geolocateButton.title = o, this._geolocateButton.setAttribute("aria-label", o);
573
+ }
574
+ this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = Z("div", "maplibregl-user-location-dot"), this._userLocationDotMarker = new Ae({ element: this._dotElement }), this._circleElement = Z("div", "maplibregl-user-location-accuracy-circle"), this._accuracyCircleMarker = new Ae({
575
+ element: this._circleElement,
576
+ pitchAlignment: "map"
577
+ }), this.options.trackUserLocation && (this._watchState = "OFF"), this._map.on("move", this._onZoom)), this._geolocateButton.addEventListener("click", this.trigger.bind(this)), this._setup = !0, this.options.trackUserLocation && this._map.on("moveend", (o) => {
578
+ const a = o.originalEvent && o.originalEvent.type === "resize", n = this.lastUpdatedCenter.distanceTo(this._map.getCenter());
579
+ !o.geolocateSource && this._watchState === "ACTIVE_LOCK" && !a && n > 1 && (this._watchState = "BACKGROUND", this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"), this.fire(new Event("trackuserlocationend")));
580
+ });
660
581
  }
661
- this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = V("div", "maplibregl-user-location-dot"), this._userLocationDotMarker = new be({ element: this._dotElement }), this._circleElement = V("div", "maplibregl-user-location-accuracy-circle"), this._accuracyCircleMarker = new be({
662
- element: this._circleElement,
663
- pitchAlignment: "map"
664
- }), this.options.trackUserLocation && (this._watchState = "OFF"), this._map.on("move", this._onZoom)), this._geolocateButton.addEventListener("click", this.trigger.bind(this)), this._setup = !0, this.options.trackUserLocation && this._map.on("moveend", (o) => {
665
- const a = o.originalEvent && o.originalEvent.type === "resize", n = this.lastUpdatedCenter.distanceTo(this._map.getCenter());
666
- !o.geolocateSource && this._watchState === "ACTIVE_LOCK" && !a && n > 1 && (this._watchState = "BACKGROUND", this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"), this.fire(new Event("trackuserlocationend")));
667
- });
668
582
  });
669
583
  T(this, "_onZoom", () => {
670
584
  this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius();
@@ -680,18 +594,18 @@ class Xt extends $t {
680
594
  this._circleElement.style.width = `${i}px`, this._circleElement.style.height = `${i}px`;
681
595
  }
682
596
  }
683
- var O, z, H, G, F, Y, _, De, B, He;
597
+ var F, z, G, H, B, Y, x, Ue, N, Ge;
684
598
  class le {
685
599
  constructor(e, t) {
686
- D(this, _);
687
- D(this, O);
600
+ U(this, x);
601
+ U(this, F);
688
602
  T(this, "map");
689
- D(this, z);
690
- D(this, H);
691
- D(this, G);
692
- D(this, F, !1);
693
- D(this, Y);
694
- e.style !== void 0 && $(this, F, !0), $(this, O, {
603
+ U(this, z);
604
+ U(this, G);
605
+ U(this, H);
606
+ U(this, B, !1);
607
+ U(this, Y);
608
+ e.style !== void 0 && $(this, B, !0), $(this, F, {
695
609
  // set defaults
696
610
  zoomAdjust: -4,
697
611
  position: "top-right",
@@ -714,52 +628,52 @@ class le {
714
628
  height: "300px",
715
629
  ...e.containerStyle ?? {}
716
630
  }
717
- }), e.lockZoom !== void 0 && (L(this, O).minZoom = e.lockZoom, L(this, O).maxZoom = e.lockZoom);
631
+ }), e.lockZoom !== void 0 && (L(this, F).minZoom = e.lockZoom, L(this, F).maxZoom = e.lockZoom);
718
632
  }
719
633
  setStyle(e, t) {
720
- L(this, F) || this.map.setStyle(e, t), P(this, _, B).call(this);
634
+ L(this, B) || this.map.setStyle(e, t), k(this, x, N).call(this);
721
635
  }
722
636
  addLayer(e, t) {
723
- return L(this, F) || this.map.addLayer(e, t), P(this, _, B).call(this), this.map;
637
+ return L(this, B) || this.map.addLayer(e, t), k(this, x, N).call(this), this.map;
724
638
  }
725
639
  moveLayer(e, t) {
726
- return L(this, F) || this.map.moveLayer(e, t), P(this, _, B).call(this), this.map;
640
+ return L(this, B) || this.map.moveLayer(e, t), k(this, x, N).call(this), this.map;
727
641
  }
728
642
  removeLayer(e) {
729
- return L(this, F) || this.map.removeLayer(e), P(this, _, B).call(this), this;
643
+ return L(this, B) || this.map.removeLayer(e), k(this, x, N).call(this), this;
730
644
  }
731
645
  setLayerZoomRange(e, t, o) {
732
- return L(this, F) || this.map.setLayerZoomRange(e, t, o), P(this, _, B).call(this), this;
646
+ return L(this, B) || this.map.setLayerZoomRange(e, t, o), k(this, x, N).call(this), this;
733
647
  }
734
648
  setFilter(e, t, o) {
735
- return L(this, F) || this.map.setFilter(e, t, o), P(this, _, B).call(this), this;
649
+ return L(this, B) || this.map.setFilter(e, t, o), k(this, x, N).call(this), this;
736
650
  }
737
651
  setPaintProperty(e, t, o, a) {
738
- return L(this, F) || this.map.setPaintProperty(e, t, o, a), P(this, _, B).call(this), this;
652
+ return L(this, B) || this.map.setPaintProperty(e, t, o, a), k(this, x, N).call(this), this;
739
653
  }
740
654
  setLayoutProperty(e, t, o, a) {
741
- return L(this, F) || this.map.setLayoutProperty(e, t, o, a), P(this, _, B).call(this), this;
655
+ return L(this, B) || this.map.setLayoutProperty(e, t, o, a), k(this, x, N).call(this), this;
742
656
  }
743
657
  setGlyphs(e, t) {
744
- return L(this, F) || this.map.setGlyphs(e, t), P(this, _, B).call(this), this;
658
+ return L(this, B) || this.map.setGlyphs(e, t), k(this, x, N).call(this), this;
745
659
  }
746
660
  onAdd(e) {
747
- $(this, z, e), $(this, H, V("div", "maplibregl-ctrl maplibregl-ctrl-group"));
748
- for (const [t, o] of Object.entries(L(this, O).containerStyle))
749
- L(this, H).style.setProperty(t, o);
750
- return L(this, O).container = L(this, H), L(this, O).zoom = e.getZoom() + L(this, O).zoomAdjust, this.map = new eo(L(this, O)), this.map.once("style.load", () => {
661
+ $(this, z, e), $(this, G, Z("div", "maplibregl-ctrl maplibregl-ctrl-group"));
662
+ for (const [t, o] of Object.entries(L(this, F).containerStyle))
663
+ L(this, G).style.setProperty(t, o);
664
+ return L(this, F).container = L(this, G), L(this, F).zoom = e.getZoom() + L(this, F).zoomAdjust, this.map = new to(L(this, F)), this.map.once("style.load", () => {
751
665
  this.map.resize();
752
666
  }), this.map.once("load", () => {
753
- P(this, _, De).call(this, L(this, O).parentRect), $(this, Y, P(this, _, He).call(this));
754
- }), L(this, H);
667
+ k(this, x, Ue).call(this, L(this, F).parentRect), $(this, Y, k(this, x, Ge).call(this));
668
+ }), L(this, G);
755
669
  }
756
670
  onRemove() {
757
671
  var e;
758
- (e = L(this, Y)) == null || e.call(this), ze(L(this, H));
672
+ (e = L(this, Y)) == null || e.call(this), ze(L(this, G));
759
673
  }
760
674
  }
761
- O = new WeakMap(), z = new WeakMap(), H = new WeakMap(), G = new WeakMap(), F = new WeakMap(), Y = new WeakMap(), _ = new WeakSet(), De = function(e) {
762
- e === void 0 || e.linePaint === void 0 && e.fillPaint === void 0 || ($(this, G, {
675
+ F = new WeakMap(), z = new WeakMap(), G = new WeakMap(), H = new WeakMap(), B = new WeakMap(), Y = new WeakMap(), x = new WeakSet(), Ue = function(e) {
676
+ e === void 0 || e.linePaint === void 0 && e.fillPaint === void 0 || ($(this, H, {
763
677
  type: "Feature",
764
678
  properties: {
765
679
  name: "parentRect"
@@ -770,7 +684,7 @@ O = new WeakMap(), z = new WeakMap(), H = new WeakMap(), G = new WeakMap(), F =
770
684
  }
771
685
  }), this.map.addSource("parentRect", {
772
686
  type: "geojson",
773
- data: L(this, G)
687
+ data: L(this, H)
774
688
  }), (e.lineLayout !== void 0 || e.linePaint !== void 0) && this.map.addLayer({
775
689
  id: "parentRectOutline",
776
690
  type: "line",
@@ -794,15 +708,15 @@ O = new WeakMap(), z = new WeakMap(), H = new WeakMap(), G = new WeakMap(), F =
794
708
  "fill-opacity": 0.135,
795
709
  ...e.fillPaint
796
710
  }
797
- }), P(this, _, B).call(this));
798
- }, B = function() {
799
- if (L(this, G) === void 0) return;
800
- const { devicePixelRatio: e } = window, t = L(this, z).getCanvas(), o = t.width / e, a = t.height / e, n = L(this, z).unproject.bind(L(this, z)), l = n([0, 0]), i = n([o, 0]), c = n([0, a]), h = n([o, a]);
801
- L(this, G).geometry.coordinates = [
802
- [c.toArray(), h.toArray(), i.toArray(), l.toArray(), c.toArray()]
803
- ], this.map.getSource("parentRect").setData(L(this, G));
804
- }, He = function() {
805
- const { pitchAdjust: e } = L(this, O), t = () => {
711
+ }), k(this, x, N).call(this));
712
+ }, N = function() {
713
+ if (L(this, H) === void 0) return;
714
+ const { devicePixelRatio: e } = window, t = L(this, z).getCanvas(), o = t.width / e, a = t.height / e, n = L(this, z).unproject.bind(L(this, z)), l = n([0, 0]), i = n([o, 0]), u = n([0, a]), h = n([o, a]);
715
+ L(this, H).geometry.coordinates = [
716
+ [u.toArray(), h.toArray(), i.toArray(), l.toArray(), u.toArray()]
717
+ ], this.map.getSource("parentRect").setData(L(this, H));
718
+ }, Ge = function() {
719
+ const { pitchAdjust: e } = L(this, F), t = () => {
806
720
  l("parent");
807
721
  }, o = () => {
808
722
  l("minimap");
@@ -812,27 +726,27 @@ O = new WeakMap(), z = new WeakMap(), H = new WeakMap(), G = new WeakMap(), F =
812
726
  L(this, z).off("move", t), this.map.off("move", o);
813
727
  }, l = (i) => {
814
728
  n();
815
- const c = i === "parent" ? L(this, z) : this.map, h = i === "parent" ? this.map : L(this, z), s = c.getCenter(), p = c.getZoom() + (L(this, O).zoomAdjust ?? -4) * (i === "parent" ? 1 : -1), u = c.getBearing(), d = c.getPitch();
729
+ const u = i === "parent" ? L(this, z) : this.map, h = i === "parent" ? this.map : L(this, z), c = u.getCenter(), s = u.getZoom() + L(this, F).zoomAdjust * (i === "parent" ? 1 : -1), d = u.getBearing(), p = u.getPitch();
816
730
  h.jumpTo({
817
- center: s,
818
- zoom: p,
819
- bearing: u,
820
- pitch: e ? d : 0
821
- }), P(this, _, B).call(this), a();
731
+ center: c,
732
+ zoom: s,
733
+ bearing: d,
734
+ pitch: e ? p : 0
735
+ }), k(this, x, N).call(this), a();
822
736
  };
823
737
  return a(), () => {
824
738
  n();
825
739
  };
826
740
  };
827
- const Qt = {
741
+ const eo = {
828
742
  POINT: "POINT",
829
743
  COUNTRY: "COUNTRY"
830
744
  };
831
- class eo extends f.Map {
745
+ class to extends f.Map {
832
746
  constructor(t) {
833
- Vt(t.container), t.apiKey && (N.apiKey = t.apiKey);
747
+ $t(t.container), t.apiKey && (M.apiKey = t.apiKey);
834
748
  const o = Se(t.style), a = location.hash;
835
- N.apiKey || console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");
749
+ M.apiKey || console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");
836
750
  let n = {
837
751
  compact: !1
838
752
  };
@@ -856,37 +770,37 @@ class eo extends f.Map {
856
770
  T(this, "forceLanguageUpdate");
857
771
  T(this, "languageAlwaysBeenStyle");
858
772
  T(this, "isReady", !1);
859
- N.caching && !ce && console.warn(
773
+ M.caching && !ce && console.warn(
860
774
  "The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"
861
- ), N.caching && ce && zt(), this.primaryLanguage = t.language ?? N.primaryLanguage, this.forceLanguageUpdate = !(this.primaryLanguage === C.STYLE || this.primaryLanguage === C.STYLE_LOCK), this.languageAlwaysBeenStyle = this.primaryLanguage === C.STYLE, this.terrainExaggeration = t.terrainExaggeration ?? this.terrainExaggeration, this.once("styledata", async () => {
775
+ ), M.caching && ce && Dt(), this.primaryLanguage = t.language ?? M.primaryLanguage, this.forceLanguageUpdate = !(this.primaryLanguage === C.STYLE || this.primaryLanguage === C.STYLE_LOCK), this.languageAlwaysBeenStyle = this.primaryLanguage === C.STYLE, this.terrainExaggeration = t.terrainExaggeration ?? this.terrainExaggeration, this.once("styledata", async () => {
862
776
  if (!t.geolocate || t.center || t.hash && a)
863
777
  return;
864
778
  try {
865
- if (t.geolocate === Qt.COUNTRY) {
779
+ if (t.geolocate === eo.COUNTRY) {
866
780
  await this.fitToIpBounds();
867
781
  return;
868
782
  }
869
- } catch (u) {
870
- console.warn(u.message);
783
+ } catch (d) {
784
+ console.warn(d.message);
871
785
  }
872
- let s;
786
+ let c;
873
787
  try {
874
- await this.centerOnIpPoint(t.zoom), s = this.getCameraHash();
875
- } catch (u) {
876
- console.warn(u.message);
788
+ await this.centerOnIpPoint(t.zoom), c = this.getCameraHash();
789
+ } catch (d) {
790
+ console.warn(d.message);
877
791
  }
878
792
  (await navigator.permissions.query({
879
793
  name: "geolocation"
880
794
  })).state === "granted" && navigator.geolocation.getCurrentPosition(
881
795
  // success callback
882
- (u) => {
883
- s === this.getCameraHash() && (this.terrain ? this.easeTo({
884
- center: [u.coords.longitude, u.coords.latitude],
796
+ (d) => {
797
+ c === this.getCameraHash() && (this.terrain ? this.easeTo({
798
+ center: [d.coords.longitude, d.coords.latitude],
885
799
  zoom: t.zoom || 12,
886
800
  duration: 2e3
887
801
  }) : this.once("terrain", () => {
888
802
  this.easeTo({
889
- center: [u.coords.longitude, u.coords.latitude],
803
+ center: [d.coords.longitude, d.coords.latitude],
890
804
  zoom: t.zoom || 12,
891
805
  duration: 2e3
892
806
  });
@@ -908,34 +822,34 @@ class eo extends f.Map {
908
822
  }), this.on("styledata", () => {
909
823
  this.getTerrain() === null && this.isTerrainEnabled && this.enableTerrain(this.terrainExaggeration);
910
824
  }), this.once("load", async () => {
911
- let s = { logo: null };
825
+ let c = { logo: null };
912
826
  try {
913
- const p = Object.keys(this.style.sourceCaches).map((m) => this.getSource(m)).filter(
827
+ const s = Object.keys(this.style.sourceCaches).map((m) => this.getSource(m)).filter(
914
828
  (m) => m && "url" in m && typeof m.url == "string" && (m == null ? void 0 : m.url.includes("tiles.json"))
915
- ), u = new URL(p[0].url);
916
- u.searchParams.has("key") || u.searchParams.append("key", N.apiKey), s = await (await fetch(u.href)).json();
829
+ ), d = new URL(s[0].url);
830
+ d.searchParams.has("key") || d.searchParams.append("key", M.apiKey), c = await (await fetch(d.href)).json();
917
831
  } catch {
918
832
  }
919
833
  if (t.forceNoAttributionControl !== !0)
920
- if ("logo" in s && s.logo) {
921
- const p = s.logo;
922
- this.addControl(new we({ logoURL: p }), t.logoPosition);
923
- } else t.maptilerLogo && this.addControl(new we(), t.logoPosition);
834
+ if ("logo" in c && c.logo) {
835
+ const s = c.logo;
836
+ this.addControl(new be({ logoURL: s }), t.logoPosition);
837
+ } else t.maptilerLogo && this.addControl(new be(), t.logoPosition);
924
838
  if (t.scaleControl) {
925
- const p = t.scaleControl === !0 || t.scaleControl === void 0 ? "bottom-right" : t.scaleControl, u = new Zt({ unit: N.unit });
926
- this.addControl(u, p), N.on("unit", (d) => {
927
- u.setUnit(d);
839
+ const s = t.scaleControl === !0 || t.scaleControl === void 0 ? "bottom-right" : t.scaleControl, d = new Wt({ unit: M.unit });
840
+ this.addControl(d, s), M.on("unit", (p) => {
841
+ d.setUnit(p);
928
842
  });
929
843
  }
930
844
  if (t.navigationControl !== !1) {
931
- const p = t.navigationControl === !0 || t.navigationControl === void 0 ? "top-right" : t.navigationControl;
932
- this.addControl(new Jt(), p);
845
+ const s = t.navigationControl === !0 || t.navigationControl === void 0 ? "top-right" : t.navigationControl;
846
+ this.addControl(new Jt(), s);
933
847
  }
934
848
  if (t.geolocateControl !== !1) {
935
- const p = t.geolocateControl === !0 || t.geolocateControl === void 0 ? "top-right" : t.geolocateControl;
849
+ const s = t.geolocateControl === !0 || t.geolocateControl === void 0 ? "top-right" : t.geolocateControl;
936
850
  this.addControl(
937
851
  // new maplibregl.GeolocateControl({
938
- new Xt({
852
+ new Qt({
939
853
  positionOptions: {
940
854
  enableHighAccuracy: !0,
941
855
  maximumAge: 0,
@@ -948,80 +862,80 @@ class eo extends f.Map {
948
862
  showAccuracyCircle: !0,
949
863
  showUserLocation: !0
950
864
  }),
951
- p
865
+ s
952
866
  );
953
867
  }
954
868
  if (t.terrainControl) {
955
- const p = t.terrainControl === !0 || t.terrainControl === void 0 ? "top-right" : t.terrainControl;
956
- this.addControl(new Yt(), p);
869
+ const s = t.terrainControl === !0 || t.terrainControl === void 0 ? "top-right" : t.terrainControl;
870
+ this.addControl(new qt(), s);
957
871
  }
958
872
  if (t.fullscreenControl) {
959
- const p = t.fullscreenControl === !0 || t.fullscreenControl === void 0 ? "top-right" : t.fullscreenControl;
960
- this.addControl(new Wt({}), p);
873
+ const s = t.fullscreenControl === !0 || t.fullscreenControl === void 0 ? "top-right" : t.fullscreenControl;
874
+ this.addControl(new Yt({}), s);
961
875
  }
962
876
  this.isReady = !0, this.fire("ready", { target: this });
963
877
  });
964
- let l = !1, i = !1, c;
878
+ let l = !1, i = !1, u;
965
879
  this.once("ready", () => {
966
- l = !0, i && this.fire("loadWithTerrain", c);
880
+ l = !0, i && this.fire("loadWithTerrain", u);
967
881
  }), this.once("style.load", () => {
968
- const { minimap: s } = t;
969
- if (typeof s == "object") {
882
+ const { minimap: c } = t;
883
+ if (typeof c == "object") {
970
884
  const {
971
- zoom: p,
972
- center: u,
973
- style: d,
885
+ zoom: s,
886
+ center: d,
887
+ style: p,
974
888
  language: m,
975
- apiKey: v,
976
- maptilerLogo: w,
977
- antialias: M,
978
- refreshExpiredTiles: A,
979
- maxBounds: I,
980
- scrollZoom: R,
981
- minZoom: E,
982
- maxZoom: U,
983
- boxZoom: j,
889
+ apiKey: y,
890
+ maptilerLogo: b,
891
+ antialias: P,
892
+ refreshExpiredTiles: w,
893
+ maxBounds: _,
894
+ scrollZoom: E,
895
+ minZoom: R,
896
+ maxZoom: D,
897
+ boxZoom: V,
984
898
  locale: W,
985
- fadeDuration: J,
986
- crossSourceCollisions: q,
899
+ fadeDuration: q,
900
+ crossSourceCollisions: J,
987
901
  clickTolerance: Xe,
988
902
  bounds: Qe,
989
903
  fitBoundsOptions: et,
990
904
  pixelRatio: tt,
991
905
  validateStyle: ot
992
906
  } = t;
993
- this.minimap = new le(s, {
994
- zoom: p,
995
- center: u,
996
- style: d,
907
+ this.minimap = new le(c, {
908
+ zoom: s,
909
+ center: d,
910
+ style: p,
997
911
  language: m,
998
- apiKey: v,
912
+ apiKey: y,
999
913
  container: "null",
1000
- maptilerLogo: w,
1001
- antialias: M,
1002
- refreshExpiredTiles: A,
1003
- maxBounds: I,
1004
- scrollZoom: R,
1005
- minZoom: E,
1006
- maxZoom: U,
1007
- boxZoom: j,
914
+ maptilerLogo: b,
915
+ antialias: P,
916
+ refreshExpiredTiles: w,
917
+ maxBounds: _,
918
+ scrollZoom: E,
919
+ minZoom: R,
920
+ maxZoom: D,
921
+ boxZoom: V,
1008
922
  locale: W,
1009
- fadeDuration: J,
1010
- crossSourceCollisions: q,
923
+ fadeDuration: q,
924
+ crossSourceCollisions: J,
1011
925
  clickTolerance: Xe,
1012
926
  bounds: Qe,
1013
927
  fitBoundsOptions: et,
1014
928
  pixelRatio: tt,
1015
929
  validateStyle: ot
1016
- }), this.addControl(this.minimap, s.position ?? "bottom-left");
1017
- } else s === !0 ? (this.minimap = new le({}, t), this.addControl(this.minimap, "bottom-left")) : s !== void 0 && s !== !1 && (this.minimap = new le({}, t), this.addControl(this.minimap, s));
930
+ }), this.addControl(this.minimap, c.position ?? "bottom-left");
931
+ } else c === !0 ? (this.minimap = new le({}, t), this.addControl(this.minimap, "bottom-left")) : c !== void 0 && c !== !1 && (this.minimap = new le({}, t), this.addControl(this.minimap, c));
1018
932
  });
1019
- const h = (s) => {
1020
- s.terrain && (i = !0, c = {
933
+ const h = (c) => {
934
+ c.terrain && (i = !0, u = {
1021
935
  type: "loadWithTerrain",
1022
936
  target: this,
1023
- terrain: s.terrain
1024
- }, this.off("terrain", h), l && this.fire("loadWithTerrain", c));
937
+ terrain: c.terrain
938
+ }, this.off("terrain", h), l && this.fire("loadWithTerrain", u));
1025
939
  };
1026
940
  this.on("terrain", h), t.terrain && this.enableTerrain(t.terrainExaggeration ?? this.terrainExaggeration);
1027
941
  }
@@ -1225,7 +1139,7 @@ class eo extends f.Map {
1225
1139
  return (a = this.minimap) == null || a.setGlyphs(t, o), super.setGlyphs(t, o);
1226
1140
  }
1227
1141
  getStyleLanguage() {
1228
- return !this.style.stylesheet.metadata || typeof this.style.stylesheet.metadata != "object" ? null : "maptiler:language" in this.style.stylesheet.metadata && typeof this.style.stylesheet.metadata["maptiler:language"] == "string" ? this.style.stylesheet.metadata["maptiler:language"] : null;
1142
+ return !this.style.stylesheet.metadata || typeof this.style.stylesheet.metadata != "object" ? null : "maptiler:language" in this.style.stylesheet.metadata && typeof this.style.stylesheet.metadata["maptiler:language"] == "string" ? dt(this.style.stylesheet.metadata["maptiler:language"]) : null;
1229
1143
  }
1230
1144
  /**
1231
1145
  * Define the primary language of the map. Note that not all the languages shorthands provided are available.
@@ -1240,68 +1154,78 @@ class eo extends f.Map {
1240
1154
  * Define the primary language of the map. Note that not all the languages shorthands provided are available.
1241
1155
  */
1242
1156
  setPrimaryLanguage(t) {
1243
- const o = this.getStyleLanguage();
1244
- if (!(t === C.STYLE && (o === C.AUTO || o === C.VISITOR)) && (t !== C.STYLE && (this.languageAlwaysBeenStyle = !1), this.languageAlwaysBeenStyle || this.primaryLanguage === t && !this.forceLanguageUpdate))
1245
- return;
1246
- if (!ge(t)) {
1247
- console.warn(`The language "${t}" is not supported.`);
1157
+ const o = this.getStyleLanguage(), a = pt(t, C);
1158
+ if (!a) {
1159
+ console.warn(`The language "${a}" is not supported.`);
1248
1160
  return;
1249
1161
  }
1250
- if (this.primaryLanguage === C.STYLE_LOCK) {
1162
+ if (!(a.flag === C.STYLE.flag && o && (o.flag === C.AUTO.flag || o.flag === C.VISITOR.flag)) && (a.flag !== C.STYLE.flag && (this.languageAlwaysBeenStyle = !1), this.languageAlwaysBeenStyle || this.primaryLanguage === a && !this.forceLanguageUpdate))
1163
+ return;
1164
+ if (this.primaryLanguage.flag === C.STYLE_LOCK.flag) {
1251
1165
  console.warn(
1252
1166
  "The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag."
1253
1167
  );
1254
1168
  return;
1255
1169
  }
1256
- this.primaryLanguage = t;
1257
- let a = t;
1258
- if (t === C.STYLE) {
1170
+ this.primaryLanguage = a;
1171
+ let n = a;
1172
+ if (a.flag === C.STYLE.flag) {
1259
1173
  if (!o) {
1260
- console.warn("The style has no default languages.");
1174
+ console.warn("The style has no default languages or has an invalid one.");
1261
1175
  return;
1262
1176
  }
1263
- if (!ge(o)) {
1264
- console.warn("The language defined in the style is not valid.");
1265
- return;
1266
- }
1267
- a = o;
1177
+ n = o;
1268
1178
  }
1269
- let n = C.LOCAL, l = `{${n}}`;
1270
- a === C.VISITOR ? (n = ye(), l = [
1179
+ let l = C.LOCAL.flag, i = `{${l}}`;
1180
+ n.flag === C.VISITOR.flag ? (l = ye().flag, i = [
1271
1181
  "case",
1272
- ["all", ["has", n], ["has", C.LOCAL]],
1182
+ ["all", ["has", l], ["has", C.LOCAL.flag]],
1273
1183
  [
1274
1184
  "case",
1275
- ["==", ["get", n], ["get", C.LOCAL]],
1276
- ["get", C.LOCAL],
1277
- ["format", ["get", n], { "font-scale": 0.8 }, `
1278
- `, ["get", C.LOCAL], { "font-scale": 1.1 }]
1185
+ ["==", ["get", l], ["get", C.LOCAL.flag]],
1186
+ ["get", C.LOCAL.flag],
1187
+ [
1188
+ "format",
1189
+ ["get", l],
1190
+ { "font-scale": 0.8 },
1191
+ `
1192
+ `,
1193
+ ["get", C.LOCAL.flag],
1194
+ { "font-scale": 1.1 }
1195
+ ]
1279
1196
  ],
1280
- ["get", C.LOCAL]
1281
- ]) : a === C.VISITOR_ENGLISH ? (n = C.ENGLISH, l = [
1197
+ ["get", C.LOCAL.flag]
1198
+ ]) : n.flag === C.VISITOR_ENGLISH.flag ? (l = C.ENGLISH.flag, i = [
1282
1199
  "case",
1283
- ["all", ["has", n], ["has", C.LOCAL]],
1200
+ ["all", ["has", l], ["has", C.LOCAL.flag]],
1284
1201
  [
1285
1202
  "case",
1286
- ["==", ["get", n], ["get", C.LOCAL]],
1287
- ["get", C.LOCAL],
1288
- ["format", ["get", n], { "font-scale": 0.8 }, `
1289
- `, ["get", C.LOCAL], { "font-scale": 1.1 }]
1203
+ ["==", ["get", l], ["get", C.LOCAL.flag]],
1204
+ ["get", C.LOCAL.flag],
1205
+ [
1206
+ "format",
1207
+ ["get", l],
1208
+ { "font-scale": 0.8 },
1209
+ `
1210
+ `,
1211
+ ["get", C.LOCAL.flag],
1212
+ { "font-scale": 1.1 }
1213
+ ]
1290
1214
  ],
1291
- ["get", C.LOCAL]
1292
- ]) : a === C.AUTO ? (n = ye(), l = ["case", ["has", n], ["get", n], ["get", C.LOCAL]]) : a === C.LOCAL ? (n = C.LOCAL, l = `{${n}}`) : (n = a, l = ["case", ["has", n], ["get", n], ["get", C.LOCAL]]);
1293
- const { layers: i } = this.getStyle();
1294
- for (const c of i) {
1295
- if (c.type !== "symbol")
1215
+ ["get", C.LOCAL.flag]
1216
+ ]) : n.flag === C.AUTO.flag ? (l = ye().flag, i = ["case", ["has", l], ["get", l], ["get", C.LOCAL.flag]]) : n === C.LOCAL ? (l = C.LOCAL.flag, i = `{${l}}`) : (l = n.flag, i = ["case", ["has", l], ["get", l], ["get", C.LOCAL.flag]]);
1217
+ const { layers: u } = this.getStyle();
1218
+ for (const h of u) {
1219
+ if (h.type !== "symbol")
1296
1220
  continue;
1297
- const h = c, s = this.getSource(h.source);
1298
- if (!s || !("url" in s && typeof s.url == "string") || new URL(s.url).host !== k.maptilerApiHost)
1221
+ const c = h, s = this.getSource(c.source);
1222
+ if (!s || !("url" in s && typeof s.url == "string") || new URL(s.url).host !== O.maptilerApiHost)
1299
1223
  continue;
1300
- const { id: u, layout: d } = h;
1301
- if (!d || !("text-field" in d))
1224
+ const { id: p, layout: m } = c;
1225
+ if (!m || !("text-field" in m))
1302
1226
  continue;
1303
- const m = this.getLayoutProperty(u, "text-field");
1304
- typeof m == "string" && (m.toLowerCase().includes("ref") || m.toLowerCase().includes("housenumber")) || this.setLayoutProperty(u, "text-field", l);
1227
+ const y = this.getLayoutProperty(p, "text-field");
1228
+ typeof y == "string" && (y.toLowerCase().includes("ref") || y.toLowerCase().includes("housenumber")) || this.setLayoutProperty(p, "text-field", i);
1305
1229
  }
1306
1230
  }
1307
1231
  /**
@@ -1331,13 +1255,13 @@ class eo extends f.Map {
1331
1255
  const a = performance.now(), n = this.terrain.exaggeration, l = t - n, i = () => {
1332
1256
  if (!this.terrain || this.terrainFlattening)
1333
1257
  return;
1334
- const c = (performance.now() - a) / o;
1335
- if (c < 0.99) {
1336
- const h = 1 - (1 - c) ** 4, s = n + h * l;
1337
- this.terrain.exaggeration = s, requestAnimationFrame(i);
1258
+ const u = (performance.now() - a) / o;
1259
+ if (u < 0.99) {
1260
+ const h = 1 - (1 - u) ** 4, c = n + h * l;
1261
+ this.terrain.exaggeration = c, requestAnimationFrame(i);
1338
1262
  } else
1339
1263
  this.terrainGrowing = !1, this.terrainFlattening = !1, this.terrain.exaggeration = t;
1340
- this.triggerRepaint();
1264
+ this._elevationFreeze = !1, this.triggerRepaint();
1341
1265
  };
1342
1266
  this.terrainGrowing = !0, this.terrainFlattening = !1, requestAnimationFrame(i);
1343
1267
  }
@@ -1352,11 +1276,11 @@ class eo extends f.Map {
1352
1276
  const o = async (n) => {
1353
1277
  !this.terrain || n.type !== "data" || n.dataType !== "source" || !("source" in n) || n.sourceId !== "maptiler-terrain" || n.source.type !== "raster-dem" || n.isSourceLoaded && (this.off("data", o), this.growTerrain(t));
1354
1278
  }, a = () => {
1355
- this.isTerrainEnabled = !0, this.terrainExaggeration = t, this.on("data", o), this.addSource(k.terrainSourceId, {
1279
+ this.isTerrainEnabled = !0, this.terrainExaggeration = t, this.on("data", o), this.addSource(O.terrainSourceId, {
1356
1280
  type: "raster-dem",
1357
- url: k.terrainSourceURL
1281
+ url: O.terrainSourceURL
1358
1282
  }), this.setTerrain({
1359
- source: k.terrainSourceId,
1283
+ source: O.terrainSourceId,
1360
1284
  exaggeration: 0
1361
1285
  });
1362
1286
  };
@@ -1365,7 +1289,7 @@ class eo extends f.Map {
1365
1289
  return;
1366
1290
  }
1367
1291
  this.loaded() || this.isTerrainEnabled ? a() : this.once("load", () => {
1368
- this.getTerrain() && this.getSource(k.terrainSourceId) || a();
1292
+ this.getTerrain() && this.getSource(O.terrainSourceId) || a();
1369
1293
  });
1370
1294
  }
1371
1295
  /**
@@ -1379,11 +1303,11 @@ class eo extends f.Map {
1379
1303
  if (!this.terrain || this.terrainGrowing)
1380
1304
  return;
1381
1305
  const l = (performance.now() - o) / t;
1382
- if (l < 0.99) {
1383
- const i = (1 - l) ** 4, c = a * i;
1384
- this.terrain.exaggeration = c, requestAnimationFrame(n);
1306
+ if (this._elevationFreeze = !1, l < 0.99) {
1307
+ const i = (1 - l) ** 4, u = a * i;
1308
+ this.terrain.exaggeration = u, requestAnimationFrame(n);
1385
1309
  } else
1386
- this.terrain.exaggeration = 0, this.terrainGrowing = !1, this.terrainFlattening = !1, this.setTerrain(), this.getSource(k.terrainSourceId) && this.removeSource(k.terrainSourceId);
1310
+ this.terrain.exaggeration = 0, this.terrainGrowing = !1, this.terrainFlattening = !1, this.setTerrain(), this.getSource(O.terrainSourceId) && this.removeSource(O.terrainSourceId);
1387
1311
  this.triggerRepaint();
1388
1312
  };
1389
1313
  this.terrainGrowing = !1, this.terrainFlattening = !0, requestAnimationFrame(n);
@@ -1408,14 +1332,14 @@ class eo extends f.Map {
1408
1332
  });
1409
1333
  }
1410
1334
  async fitToIpBounds() {
1411
- const t = await fe.info();
1335
+ const t = await ge.info();
1412
1336
  this.fitBounds(t.country_bounds, {
1413
1337
  duration: 0,
1414
1338
  padding: 100
1415
1339
  });
1416
1340
  }
1417
1341
  async centerOnIpPoint(t) {
1418
- const o = await fe.info();
1342
+ const o = await ge.info();
1419
1343
  this.jumpTo({
1420
1344
  center: [(o == null ? void 0 : o.longitude) ?? 0, (o == null ? void 0 : o.latitude) ?? 0],
1421
1345
  zoom: t || 11
@@ -1423,7 +1347,7 @@ class eo extends f.Map {
1423
1347
  }
1424
1348
  getCameraHash() {
1425
1349
  const t = new Float32Array(5), o = this.getCenter();
1426
- return t[0] = o.lng, t[1] = o.lat, t[2] = this.getZoom(), t[3] = this.getPitch(), t[4] = this.getBearing(), dt.fromUint8Array(new Uint8Array(t.buffer));
1350
+ return t[0] = o.lng, t[1] = o.lat, t[2] = this.getZoom(), t[3] = this.getPitch(), t[4] = this.getBearing(), ft.fromUint8Array(new Uint8Array(t.buffer));
1427
1351
  }
1428
1352
  /**
1429
1353
  * Get the SDK config object.
@@ -1431,7 +1355,7 @@ class eo extends f.Map {
1431
1355
  * that do not directly have access to the SDK configuration but do have access to a Map instance.
1432
1356
  */
1433
1357
  getSdkConfig() {
1434
- return N;
1358
+ return M;
1435
1359
  }
1436
1360
  /**
1437
1361
  * Get the MapTiler session ID. Convenient to dispatch to externaly built component
@@ -1439,7 +1363,7 @@ class eo extends f.Map {
1439
1363
  * @returns
1440
1364
  */
1441
1365
  getMaptilerSessionId() {
1442
- return Fe;
1366
+ return Be;
1443
1367
  }
1444
1368
  /**
1445
1369
  * Updates the requestManager's transform request with a new function.
@@ -1456,7 +1380,7 @@ class eo extends f.Map {
1456
1380
  return super.setTransformRequest(Ce(t)), this;
1457
1381
  }
1458
1382
  }
1459
- function pe(r) {
1383
+ function de(r) {
1460
1384
  if (typeof DOMParser < "u") {
1461
1385
  const e = new DOMParser().parseFromString(r, "application/xml");
1462
1386
  if (e.querySelector("parsererror"))
@@ -1465,7 +1389,7 @@ function pe(r) {
1465
1389
  }
1466
1390
  throw new Error("No XML parser found");
1467
1391
  }
1468
- function Ge(r, e) {
1392
+ function He(r, e) {
1469
1393
  if (!r.hasChildNodes())
1470
1394
  return !1;
1471
1395
  for (const t of Array.from(r.childNodes)) {
@@ -1475,71 +1399,71 @@ function Ge(r, e) {
1475
1399
  }
1476
1400
  return !1;
1477
1401
  }
1478
- function Ee(r) {
1402
+ function Re(r) {
1479
1403
  if (typeof XMLSerializer < "u")
1480
1404
  return new XMLSerializer().serializeToString(r);
1481
1405
  throw new Error("No XML serializer found");
1482
1406
  }
1483
1407
  function Ve(r) {
1484
- const e = typeof r == "string" ? pe(r) : r;
1485
- if (!Ge(e, "gpx"))
1408
+ const e = typeof r == "string" ? de(r) : r;
1409
+ if (!He(e, "gpx"))
1486
1410
  throw new Error("The XML document is not valid GPX");
1487
- const t = x(e, "trk"), o = x(e, "rte"), a = x(e, "wpt"), n = {
1411
+ const t = I(e, "trk"), o = I(e, "rte"), a = I(e, "wpt"), n = {
1488
1412
  type: "FeatureCollection",
1489
1413
  features: []
1490
1414
  };
1491
1415
  for (const l of Array.from(t)) {
1492
- const i = ao(l);
1416
+ const i = no(l);
1493
1417
  i && n.features.push(i);
1494
1418
  }
1495
1419
  for (const l of Array.from(o)) {
1496
- const i = no(l);
1420
+ const i = lo(l);
1497
1421
  i && n.features.push(i);
1498
1422
  }
1499
1423
  for (const l of Array.from(a))
1500
- n.features.push(lo(l));
1424
+ n.features.push(io(l));
1501
1425
  return n;
1502
1426
  }
1503
- function je(r, e) {
1427
+ function $e(r, e) {
1504
1428
  let t = r;
1505
- if (typeof t == "string" && (t = pe(t)), !Ge(t, "kml"))
1429
+ if (typeof t == "string" && (t = de(t)), !He(t, "kml"))
1506
1430
  throw new Error("The XML document is not valid KML");
1507
1431
  const o = {
1508
1432
  type: "FeatureCollection",
1509
1433
  features: []
1510
- }, a = {}, n = {}, l = {}, i = x(t, "Placemark"), c = x(t, "Style"), h = x(t, "StyleMap");
1511
- for (const s of Array.from(c)) {
1512
- const p = Re(e !== void 0 ? e(s) : Ee(s)).toString(16);
1513
- a[`#${K(s, "id")}`] = p, n[p] = s;
1514
- }
1515
- for (const s of Array.from(h)) {
1516
- a[`#${K(s, "id")}`] = Re(
1517
- e !== void 0 ? e(s) : Ee(s)
1434
+ }, a = {}, n = {}, l = {}, i = I(t, "Placemark"), u = I(t, "Style"), h = I(t, "StyleMap");
1435
+ for (const c of Array.from(u)) {
1436
+ const s = Ee(e !== void 0 ? e(c) : Re(c)).toString(16);
1437
+ a[`#${j(c, "id")}`] = s, n[s] = c;
1438
+ }
1439
+ for (const c of Array.from(h)) {
1440
+ a[`#${j(c, "id")}`] = Ee(
1441
+ e !== void 0 ? e(c) : Re(c)
1518
1442
  ).toString(16);
1519
- const p = x(s, "Pair"), u = {};
1520
- for (const d of Array.from(p))
1521
- u[S(y(d, "key")) ?? ""] = S(y(d, "styleUrl"));
1522
- l[`#${K(s, "id")}`] = u;
1443
+ const s = I(c, "Pair"), d = {};
1444
+ for (const p of Array.from(s))
1445
+ d[S(v(p, "key")) ?? ""] = S(v(p, "styleUrl"));
1446
+ l[`#${j(c, "id")}`] = d;
1523
1447
  }
1524
- for (const s of Array.from(i))
1525
- o.features = o.features.concat(ro(s, a, n, l));
1448
+ for (const c of Array.from(i))
1449
+ o.features = o.features.concat(ao(c, a, n, l));
1526
1450
  return o;
1527
1451
  }
1528
- function Ie(r) {
1452
+ function _e(r) {
1529
1453
  if (r === null) return ["#000000", 1];
1530
1454
  let e = "", t = 1, o = r;
1531
1455
  return o.substring(0, 1) === "#" && (o = o.substring(1)), (o.length === 6 || o.length === 3) && (e = o), o.length === 8 && (t = Number.parseInt(o.substring(0, 2), 16) / 255, e = `#${o.substring(6, 8)}${o.substring(4, 6)}${o.substring(2, 4)}`), [e ?? "#000000", t ?? 1];
1532
1456
  }
1533
- function to(r) {
1457
+ function oo(r) {
1534
1458
  return Ze(r.split(" "));
1535
1459
  }
1536
- function oo(r) {
1537
- let e = x(r, "coord");
1460
+ function ro(r) {
1461
+ let e = I(r, "coord");
1538
1462
  const t = [], o = [];
1539
- e.length === 0 && (e = x(r, "gx:coord"));
1463
+ e.length === 0 && (e = I(r, "gx:coord"));
1540
1464
  for (const n of Array.from(e))
1541
- t.push(to(S(n) ?? ""));
1542
- const a = x(r, "when");
1465
+ t.push(oo(S(n) ?? ""));
1466
+ const a = I(r, "when");
1543
1467
  for (const n of Array.from(a)) o.push(S(n));
1544
1468
  return {
1545
1469
  coords: t,
@@ -1549,84 +1473,84 @@ function oo(r) {
1549
1473
  function Q(r) {
1550
1474
  const e = ["Polygon", "LineString", "Point", "Track", "gx:Track"];
1551
1475
  let t, o, a, n, l;
1552
- const i = [], c = [];
1553
- if (y(r, "MultiGeometry") !== null)
1554
- return Q(y(r, "MultiGeometry"));
1555
- if (y(r, "MultiTrack") !== null)
1556
- return Q(y(r, "MultiTrack"));
1557
- if (y(r, "gx:MultiTrack") !== null)
1558
- return Q(y(r, "gx:MultiTrack"));
1476
+ const i = [], u = [];
1477
+ if (v(r, "MultiGeometry") !== null)
1478
+ return Q(v(r, "MultiGeometry"));
1479
+ if (v(r, "MultiTrack") !== null)
1480
+ return Q(v(r, "MultiTrack"));
1481
+ if (v(r, "gx:MultiTrack") !== null)
1482
+ return Q(v(r, "gx:MultiTrack"));
1559
1483
  for (a = 0; a < e.length; a++)
1560
- if (o = x(r, e[a]), o) {
1484
+ if (o = I(r, e[a]), o) {
1561
1485
  for (n = 0; n < o.length; n++)
1562
1486
  if (t = o[n], e[a] === "Point")
1563
1487
  i.push({
1564
1488
  type: "Point",
1565
- coordinates: We(S(y(t, "coordinates")) ?? "")
1489
+ coordinates: We(S(v(t, "coordinates")) ?? "")
1566
1490
  });
1567
1491
  else if (e[a] === "LineString")
1568
1492
  i.push({
1569
1493
  type: "LineString",
1570
- coordinates: xe(S(y(t, "coordinates")) ?? "")
1494
+ coordinates: Ie(S(v(t, "coordinates")) ?? "")
1571
1495
  });
1572
1496
  else if (e[a] === "Polygon") {
1573
- const h = x(t, "LinearRing"), s = [];
1497
+ const h = I(t, "LinearRing"), c = [];
1574
1498
  for (l = 0; l < h.length; l++)
1575
- s.push(xe(S(y(h[l], "coordinates")) ?? ""));
1499
+ c.push(Ie(S(v(h[l], "coordinates")) ?? ""));
1576
1500
  i.push({
1577
1501
  type: "Polygon",
1578
- coordinates: s
1502
+ coordinates: c
1579
1503
  });
1580
1504
  } else if (e[a] === "Track" || e[a] === "gx:Track") {
1581
- const h = oo(t);
1505
+ const h = ro(t);
1582
1506
  i.push({
1583
1507
  type: "LineString",
1584
1508
  coordinates: h.coords
1585
- }), h.times.length && c.push(h.times);
1509
+ }), h.times.length && u.push(h.times);
1586
1510
  }
1587
1511
  }
1588
- return { geoms: i, coordTimes: c };
1512
+ return { geoms: i, coordTimes: u };
1589
1513
  }
1590
- function ro(r, e, t, o) {
1591
- const a = Q(r), n = {}, l = S(y(r, "name")), i = S(y(r, "address")), c = S(y(r, "description")), h = y(r, "TimeSpan"), s = y(r, "TimeStamp"), p = y(r, "ExtendedData"), u = y(r, "visibility");
1592
- let d, m = S(y(r, "styleUrl")), v = y(r, "LineStyle"), w = y(r, "PolyStyle");
1514
+ function ao(r, e, t, o) {
1515
+ const a = Q(r), n = {}, l = S(v(r, "name")), i = S(v(r, "address")), u = S(v(r, "description")), h = v(r, "TimeSpan"), c = v(r, "TimeStamp"), s = v(r, "ExtendedData"), d = v(r, "visibility");
1516
+ let p, m = S(v(r, "styleUrl")), y = v(r, "LineStyle"), b = v(r, "PolyStyle");
1593
1517
  if (!a.geoms.length) return [];
1594
1518
  if (l && (n.name = l), i && (n.address = i), m) {
1595
1519
  m[0] !== "#" && (m = `#${m}`), n.styleUrl = m, e[m] && (n.styleHash = e[m]), o[m] && (n.styleMapHash = o[m], n.styleHash = e[o[m].normal ?? ""]);
1596
- const A = t[n.styleHash ?? ""];
1597
- if (A) {
1598
- v || (v = y(A, "LineStyle")), w || (w = y(A, "PolyStyle"));
1599
- const I = y(A, "IconStyle");
1600
- if (I) {
1601
- const R = y(I, "Icon");
1602
- if (R) {
1603
- const E = S(y(R, "href"));
1604
- E && (n.icon = E);
1520
+ const w = t[n.styleHash ?? ""];
1521
+ if (w) {
1522
+ y || (y = v(w, "LineStyle")), b || (b = v(w, "PolyStyle"));
1523
+ const _ = v(w, "IconStyle");
1524
+ if (_) {
1525
+ const E = v(_, "Icon");
1526
+ if (E) {
1527
+ const R = S(v(E, "href"));
1528
+ R && (n.icon = R);
1605
1529
  }
1606
1530
  }
1607
1531
  }
1608
1532
  }
1609
- if (c && (n.description = c), h) {
1610
- const A = S(y(h, "begin")), I = S(y(h, "end"));
1611
- A && I && (n.timespan = { begin: A, end: I });
1533
+ if (u && (n.description = u), h) {
1534
+ const w = S(v(h, "begin")), _ = S(v(h, "end"));
1535
+ w && _ && (n.timespan = { begin: w, end: _ });
1612
1536
  }
1613
- if (s !== null && (n.timestamp = S(y(s, "when")) ?? (/* @__PURE__ */ new Date()).toISOString()), v !== null) {
1614
- const A = Ie(S(y(v, "color"))), I = A[0], R = A[1], E = Number.parseFloat(S(y(v, "width")) ?? "");
1615
- I && (n.stroke = I), Number.isNaN(R) || (n["stroke-opacity"] = R), Number.isNaN(E) || (n["stroke-width"] = E);
1537
+ if (c !== null && (n.timestamp = S(v(c, "when")) ?? (/* @__PURE__ */ new Date()).toISOString()), y !== null) {
1538
+ const w = _e(S(v(y, "color"))), _ = w[0], E = w[1], R = Number.parseFloat(S(v(y, "width")) ?? "");
1539
+ _ && (n.stroke = _), Number.isNaN(E) || (n["stroke-opacity"] = E), Number.isNaN(R) || (n["stroke-width"] = R);
1616
1540
  }
1617
- if (w) {
1618
- const A = Ie(S(y(w, "color"))), I = A[0], R = A[1], E = S(y(w, "fill")), U = S(y(w, "outline"));
1619
- I && (n.fill = I), Number.isNaN(R) || (n["fill-opacity"] = R), E && (n["fill-opacity"] = E === "1" ? n["fill-opacity"] || 1 : 0), U && (n["stroke-opacity"] = U === "1" ? n["stroke-opacity"] || 1 : 0);
1541
+ if (b) {
1542
+ const w = _e(S(v(b, "color"))), _ = w[0], E = w[1], R = S(v(b, "fill")), D = S(v(b, "outline"));
1543
+ _ && (n.fill = _), Number.isNaN(E) || (n["fill-opacity"] = E), R && (n["fill-opacity"] = R === "1" ? n["fill-opacity"] || 1 : 0), D && (n["stroke-opacity"] = D === "1" ? n["stroke-opacity"] || 1 : 0);
1620
1544
  }
1621
- if (p) {
1622
- const A = x(p, "Data"), I = x(p, "SimpleData");
1623
- for (d = 0; d < A.length; d++)
1624
- n[A[d].getAttribute("name") ?? ""] = S(y(A[d], "value")) ?? "";
1625
- for (d = 0; d < I.length; d++)
1626
- n[I[d].getAttribute("name") ?? ""] = S(I[d]) ?? "";
1545
+ if (s) {
1546
+ const w = I(s, "Data"), _ = I(s, "SimpleData");
1547
+ for (p = 0; p < w.length; p++)
1548
+ n[w[p].getAttribute("name") ?? ""] = S(v(w[p], "value")) ?? "";
1549
+ for (p = 0; p < _.length; p++)
1550
+ n[_[p].getAttribute("name") ?? ""] = S(_[p]) ?? "";
1627
1551
  }
1628
- u !== null && (n.visibility = S(u) ?? ""), a.coordTimes.length !== 0 && (n.coordTimes = a.coordTimes.length === 1 ? a.coordTimes[0] : a.coordTimes);
1629
- const M = {
1552
+ d !== null && (n.visibility = S(d) ?? ""), a.coordTimes.length !== 0 && (n.coordTimes = a.coordTimes.length === 1 ? a.coordTimes[0] : a.coordTimes);
1553
+ const P = {
1630
1554
  type: "Feature",
1631
1555
  geometry: a.geoms.length === 1 ? a.geoms[0] : {
1632
1556
  type: "GeometryCollection",
@@ -1634,16 +1558,16 @@ function ro(r, e, t, o) {
1634
1558
  },
1635
1559
  properties: n
1636
1560
  };
1637
- return K(r, "id") && (M.id = K(r, "id") ?? void 0), [M];
1561
+ return j(r, "id") && (P.id = j(r, "id") ?? void 0), [P];
1638
1562
  }
1639
- function $e(r, e) {
1640
- const t = x(r, e), o = [], a = [];
1563
+ function je(r, e) {
1564
+ const t = I(r, e), o = [], a = [];
1641
1565
  let n = [];
1642
1566
  const l = t.length;
1643
1567
  if (!(l < 2)) {
1644
1568
  for (let i = 0; i < l; i++) {
1645
- const c = Ye(t[i]);
1646
- o.push(c.coordinates), c.time && a.push(c.time), (c.heartRate || n.length) && (n.length === 0 && (n = new Array(i).fill(null)), n.push(c.heartRate));
1569
+ const u = Ye(t[i]);
1570
+ o.push(u.coordinates), u.time && a.push(u.time), (u.heartRate || n.length) && (n.length === 0 && (n = new Array(i).fill(null)), n.push(u.heartRate));
1647
1571
  }
1648
1572
  return {
1649
1573
  line: o,
@@ -1652,20 +1576,20 @@ function $e(r, e) {
1652
1576
  };
1653
1577
  }
1654
1578
  }
1655
- function ao(r) {
1656
- const e = x(r, "trkseg"), t = [], o = [], a = [];
1579
+ function no(r) {
1580
+ const e = I(r, "trkseg"), t = [], o = [], a = [];
1657
1581
  let n;
1658
1582
  for (let i = 0; i < e.length; i++)
1659
- if (n = $e(e[i], "trkpt"), n !== void 0 && (n.line && t.push(n.line), n.times && n.times.length && o.push(n.times), a.length || n.heartRates && n.heartRates.length)) {
1583
+ if (n = je(e[i], "trkpt"), n !== void 0 && (n.line && t.push(n.line), n.times && n.times.length && o.push(n.times), a.length || n.heartRates && n.heartRates.length)) {
1660
1584
  if (!a.length)
1661
- for (let c = 0; c < i; c++)
1662
- a.push(new Array(t[c].length).fill(null));
1585
+ for (let u = 0; u < i; u++)
1586
+ a.push(new Array(t[u].length).fill(null));
1663
1587
  n.heartRates && n.heartRates.length ? a.push(n.heartRates) : a.push(new Array(n.line.length).fill(null));
1664
1588
  }
1665
1589
  if (t.length === 0) return;
1666
1590
  const l = {
1667
- ...de(r),
1668
- ...Ke(y(r, "extensions"))
1591
+ ...pe(r),
1592
+ ...Ke(v(r, "extensions"))
1669
1593
  };
1670
1594
  return o.length !== 0 && (l.coordTimes = t.length === 1 ? o[0] : o), a.length !== 0 && (l.heartRates = t.length === 1 ? a[0] : a), t.length === 1 ? {
1671
1595
  type: "Feature",
@@ -1683,13 +1607,13 @@ function ao(r) {
1683
1607
  }
1684
1608
  };
1685
1609
  }
1686
- function no(r) {
1687
- const e = $e(r, "rtept");
1610
+ function lo(r) {
1611
+ const e = je(r, "rtept");
1688
1612
  return e === void 0 ? void 0 : {
1689
1613
  type: "Feature",
1690
1614
  properties: {
1691
- ...de(r),
1692
- ...Ke(y(r, "extensions"))
1615
+ ...pe(r),
1616
+ ...Ke(v(r, "extensions"))
1693
1617
  },
1694
1618
  geometry: {
1695
1619
  type: "LineString",
@@ -1697,10 +1621,10 @@ function no(r) {
1697
1621
  }
1698
1622
  };
1699
1623
  }
1700
- function lo(r) {
1624
+ function io(r) {
1701
1625
  return {
1702
1626
  type: "Feature",
1703
- properties: { ...de(r), ...ue(r, ["sym"]) },
1627
+ properties: { ...pe(r), ...ue(r, ["sym"]) },
1704
1628
  geometry: {
1705
1629
  type: "Point",
1706
1630
  coordinates: Ye(r).coordinates
@@ -1710,15 +1634,15 @@ function lo(r) {
1710
1634
  function Ke(r) {
1711
1635
  const e = {};
1712
1636
  if (r) {
1713
- const t = y(r, "line");
1637
+ const t = v(r, "line");
1714
1638
  if (t) {
1715
- const o = S(y(t, "color")), a = Number.parseFloat(S(y(t, "opacity")) ?? "0"), n = Number.parseFloat(S(y(t, "width")) ?? "0");
1639
+ const o = S(v(t, "color")), a = Number.parseFloat(S(v(t, "opacity")) ?? "0"), n = Number.parseFloat(S(v(t, "width")) ?? "0");
1716
1640
  o && (e.stroke = o), Number.isNaN(a) || (e["stroke-opacity"] = a), Number.isNaN(n) || (e["stroke-width"] = n * 96 / 25.4);
1717
1641
  }
1718
1642
  }
1719
1643
  return e;
1720
1644
  }
1721
- function de(r) {
1645
+ function pe(r) {
1722
1646
  const e = ue(r, [
1723
1647
  "name",
1724
1648
  "cmt",
@@ -1726,12 +1650,12 @@ function de(r) {
1726
1650
  "type",
1727
1651
  "time",
1728
1652
  "keywords"
1729
- ]), t = x(r, "link");
1653
+ ]), t = I(r, "link");
1730
1654
  if (t.length !== 0) {
1731
1655
  e.links = [];
1732
1656
  for (const o of Array.from(t)) {
1733
1657
  const a = {
1734
- href: K(o, "href"),
1658
+ href: j(o, "href"),
1735
1659
  ...ue(o, ["text", "type"])
1736
1660
  };
1737
1661
  e.links.push(a);
@@ -1739,52 +1663,52 @@ function de(r) {
1739
1663
  }
1740
1664
  return e;
1741
1665
  }
1742
- function Re(r) {
1666
+ function Ee(r) {
1743
1667
  let e = 0;
1744
1668
  if (!r || !r.length) return e;
1745
1669
  for (let t = 0; t < r.length; t++)
1746
1670
  e = (e << 5) - e + r.charCodeAt(t) | 0;
1747
1671
  return e;
1748
1672
  }
1749
- function x(r, e) {
1673
+ function I(r, e) {
1750
1674
  return r.getElementsByTagName(e);
1751
1675
  }
1752
- function K(r, e) {
1676
+ function j(r, e) {
1753
1677
  return r.getAttribute(e);
1754
1678
  }
1755
- function _e(r, e) {
1756
- return Number.parseFloat(K(r, e) ?? "0");
1679
+ function xe(r, e) {
1680
+ return Number.parseFloat(j(r, e) ?? "0");
1757
1681
  }
1758
- function y(r, e) {
1759
- const t = x(r, e);
1682
+ function v(r, e) {
1683
+ const t = I(r, e);
1760
1684
  return t.length ? t[0] : null;
1761
1685
  }
1762
- function io(r) {
1686
+ function so(r) {
1763
1687
  return r.normalize && r.normalize(), r;
1764
1688
  }
1765
1689
  function Ze(r) {
1766
1690
  return r.map(Number.parseFloat).map((e) => Number.isNaN(e) ? null : e);
1767
1691
  }
1768
1692
  function S(r) {
1769
- return r && io(r), r && r.textContent;
1693
+ return r && so(r), r && r.textContent;
1770
1694
  }
1771
1695
  function ue(r, e) {
1772
1696
  const t = {};
1773
1697
  let o, a;
1774
1698
  for (a = 0; a < e.length; a++)
1775
- o = y(r, e[a]), o && (t[e[a]] = S(o) ?? "");
1699
+ o = v(r, e[a]), o && (t[e[a]] = S(o) ?? "");
1776
1700
  return t;
1777
1701
  }
1778
1702
  function We(r) {
1779
1703
  return Ze(r.replace(/\s*/g, "").split(","));
1780
1704
  }
1781
- function xe(r) {
1705
+ function Ie(r) {
1782
1706
  const e = r.replace(/^\s*|\s*$/g, "").split(/\s+/), t = [];
1783
1707
  for (const o of e) t.push(We(o));
1784
1708
  return t;
1785
1709
  }
1786
1710
  function Ye(r) {
1787
- const e = [_e(r, "lon"), _e(r, "lat")], t = y(r, "ele"), o = y(r, "gpxtpx:hr") || y(r, "hr"), a = y(r, "time");
1711
+ const e = [xe(r, "lon"), xe(r, "lat")], t = v(r, "ele"), o = v(r, "gpxtpx:hr") || v(r, "hr"), a = v(r, "time");
1788
1712
  let n;
1789
1713
  return t && (n = Number.parseFloat(S(t) ?? "0"), Number.isNaN(n) || e.push(n)), {
1790
1714
  coordinates: e,
@@ -1792,10 +1716,10 @@ function Ye(r) {
1792
1716
  heartRate: o !== null ? Number.parseFloat(S(o) ?? "0") : null
1793
1717
  };
1794
1718
  }
1795
- function so(r) {
1719
+ function co(r) {
1796
1720
  let e = r;
1797
1721
  try {
1798
- typeof e == "string" && (e = pe(e));
1722
+ typeof e == "string" && (e = de(e));
1799
1723
  } catch {
1800
1724
  return null;
1801
1725
  }
@@ -1804,7 +1728,7 @@ function so(r) {
1804
1728
  } catch {
1805
1729
  }
1806
1730
  try {
1807
- return je(e);
1731
+ return $e(e);
1808
1732
  } catch {
1809
1733
  }
1810
1734
  return null;
@@ -1813,7 +1737,7 @@ function X(r) {
1813
1737
  const e = r.toString(16);
1814
1738
  return e.length === 1 ? `0${e}` : e;
1815
1739
  }
1816
- function co(r) {
1740
+ function uo(r) {
1817
1741
  return `#${X(r[0])}${X(r[1])}${X(r[2])}${r.length === 4 ? X(r[3]) : ""}`;
1818
1742
  }
1819
1743
  class g extends Array {
@@ -1847,18 +1771,18 @@ class g extends Array {
1847
1771
  color: t[i].color.slice()
1848
1772
  // we want to make sure we do a deep copy and not a reference
1849
1773
  });
1850
- return a.sort((i, c) => i.value < c.value ? -1 : 1), this.min = n, this.max = l, a;
1774
+ return a.sort((i, u) => i.value < u.value ? -1 : 1), this.min = n, this.max = l, a;
1851
1775
  }
1852
1776
  scale(t, o, a = { clone: !0 }) {
1853
- const n = a.clone, l = this[0].value, c = this.at(-1).value - l, h = o - t, s = [];
1854
- for (let p = 0; p < this.length; p += 1) {
1855
- const m = (this[p].value - l) / c * h + t;
1856
- n ? s.push({
1777
+ const n = a.clone, l = this[0].value, u = this.at(-1).value - l, h = o - t, c = [];
1778
+ for (let s = 0; s < this.length; s += 1) {
1779
+ const m = (this[s].value - l) / u * h + t;
1780
+ n ? c.push({
1857
1781
  value: m,
1858
- color: this[p].color.slice()
1859
- }) : this[p].value = m;
1782
+ color: this[s].color.slice()
1783
+ }) : this[s].value = m;
1860
1784
  }
1861
- return n ? new g({ stops: s }) : this;
1785
+ return n ? new g({ stops: c }) : this;
1862
1786
  }
1863
1787
  // for some reason, I had to reimplement this
1864
1788
  at(t) {
@@ -1895,9 +1819,9 @@ class g extends Array {
1895
1819
  const n = this[a].color;
1896
1820
  if (!o.smooth)
1897
1821
  return n.slice();
1898
- const l = this[a].value, i = this[a + 1].value, c = this[a + 1].color, h = (i - t) / (i - l);
1822
+ const l = this[a].value, i = this[a + 1].value, u = this[a + 1].color, h = (i - t) / (i - l);
1899
1823
  return n.map(
1900
- (s, p) => Math.round(s * h + c[p] * (1 - h))
1824
+ (c, s) => Math.round(c * h + u[s] * (1 - h))
1901
1825
  );
1902
1826
  }
1903
1827
  return [0, 0, 0];
@@ -1909,7 +1833,7 @@ class g extends Array {
1909
1833
  smooth: !0,
1910
1834
  withAlpha: !1
1911
1835
  }) {
1912
- return co(this.getColor(t, o));
1836
+ return uo(this.getColor(t, o));
1913
1837
  }
1914
1838
  /**
1915
1839
  * Get the color of the color ramp at a relative position in [0, 1]
@@ -1927,12 +1851,12 @@ class g extends Array {
1927
1851
  o.width = t.horizontal ? t.size : 1, o.height = t.horizontal ? 1 : t.size;
1928
1852
  const a = o.getContext("2d");
1929
1853
  if (!a) throw new Error("Canvs context is missing");
1930
- const n = a.getImageData(0, 0, o.width, o.height), l = n.data, i = t.size, c = this[0].value, p = (this.at(-1).value - c) / i;
1931
- for (let u = 0; u < i; u += 1) {
1932
- const d = this.getColor(c + u * p, {
1854
+ const n = a.getImageData(0, 0, o.width, o.height), l = n.data, i = t.size, u = this[0].value, s = (this.at(-1).value - u) / i;
1855
+ for (let d = 0; d < i; d += 1) {
1856
+ const p = this.getColor(u + d * s, {
1933
1857
  smooth: t.smooth
1934
1858
  });
1935
- l[u * 4] = d[0], l[u * 4 + 1] = d[1], l[u * 4 + 2] = d[2], l[u * 4 + 3] = d.length > 3 ? d[3] : 255;
1859
+ l[d * 4] = p[0], l[d * 4 + 1] = p[1], l[d * 4 + 2] = p[2], l[d * 4 + 3] = p.length > 3 ? p[3] : 255;
1936
1860
  }
1937
1861
  return a.putImageData(n, 0, 0), o;
1938
1862
  }
@@ -1943,34 +1867,34 @@ class g extends Array {
1943
1867
  const a = this.getBounds(), n = this.scale(0, 1), l = 1 / (o - 1);
1944
1868
  let i;
1945
1869
  if (t === "ease-in-square")
1946
- i = Array.from({ length: o }, (s, p) => {
1947
- const u = p * l, d = u ** 2, m = n.getColor(d);
1948
- return { value: u, color: m };
1870
+ i = Array.from({ length: o }, (c, s) => {
1871
+ const d = s * l, p = d ** 2, m = n.getColor(p);
1872
+ return { value: d, color: m };
1949
1873
  });
1950
1874
  else if (t === "ease-out-square")
1951
- i = Array.from({ length: o }, (s, p) => {
1952
- const u = p * l, d = 1 - (1 - u) ** 2, m = n.getColor(d);
1953
- return { value: u, color: m };
1875
+ i = Array.from({ length: o }, (c, s) => {
1876
+ const d = s * l, p = 1 - (1 - d) ** 2, m = n.getColor(p);
1877
+ return { value: d, color: m };
1954
1878
  });
1955
1879
  else if (t === "ease-out-sqrt")
1956
- i = Array.from({ length: o }, (s, p) => {
1957
- const u = p * l, d = u ** 0.5, m = n.getColor(d);
1958
- return { value: u, color: m };
1880
+ i = Array.from({ length: o }, (c, s) => {
1881
+ const d = s * l, p = d ** 0.5, m = n.getColor(p);
1882
+ return { value: d, color: m };
1959
1883
  });
1960
1884
  else if (t === "ease-in-sqrt")
1961
- i = Array.from({ length: o }, (s, p) => {
1962
- const u = p * l, d = 1 - (1 - u) ** 0.5, m = n.getColor(d);
1963
- return { value: u, color: m };
1885
+ i = Array.from({ length: o }, (c, s) => {
1886
+ const d = s * l, p = 1 - (1 - d) ** 0.5, m = n.getColor(p);
1887
+ return { value: d, color: m };
1964
1888
  });
1965
1889
  else if (t === "ease-out-exp")
1966
- i = Array.from({ length: o }, (s, p) => {
1967
- const u = p * l, d = 1 - 2 ** (-10 * u), m = n.getColor(d);
1968
- return { value: u, color: m };
1890
+ i = Array.from({ length: o }, (c, s) => {
1891
+ const d = s * l, p = 1 - 2 ** (-10 * d), m = n.getColor(p);
1892
+ return { value: d, color: m };
1969
1893
  });
1970
1894
  else if (t === "ease-in-exp")
1971
- i = Array.from({ length: o }, (s, p) => {
1972
- const u = p * l, d = 2 ** (10 * u - 10), m = n.getColor(d);
1973
- return { value: u, color: m };
1895
+ i = Array.from({ length: o }, (c, s) => {
1896
+ const d = s * l, p = 2 ** (10 * d - 10), m = n.getColor(p);
1897
+ return { value: d, color: m };
1974
1898
  });
1975
1899
  else
1976
1900
  throw new Error("Invalid ressampling method.");
@@ -1996,7 +1920,7 @@ class g extends Array {
1996
1920
  return this[0].color.length === 4 && this[0].color[3] === 0;
1997
1921
  }
1998
1922
  }
1999
- const Je = {
1923
+ const qe = {
2000
1924
  /**
2001
1925
  * A fully transparent [0, 0, 0, 0] colorramp to hide data.
2002
1926
  * Defined in interval [0, 1], without unit.
@@ -2751,7 +2675,29 @@ const Je = {
2751
2675
  { value: 1, color: [222, 245, 229, 255] }
2752
2676
  ]
2753
2677
  })
2754
- }, Ne = [
2678
+ };
2679
+ async function po(r, e = {}) {
2680
+ const t = e.download ?? !1, o = await ho(r);
2681
+ if (t) {
2682
+ const a = e.filename ?? "maptiler_screenshot.png", n = document.createElement("a");
2683
+ n.style.display = "none", document.body.appendChild(n), n.href = URL.createObjectURL(o), n.download = a, n.click(), setTimeout(() => {
2684
+ document.body.removeChild(n), URL.revokeObjectURL(n.href);
2685
+ }, 0);
2686
+ }
2687
+ return o;
2688
+ }
2689
+ function ho(r) {
2690
+ return new Promise((e, t) => {
2691
+ r.redraw(), r.once("idle", () => {
2692
+ r.getCanvas().toBlob((o) => {
2693
+ if (!o)
2694
+ return t(Error("Screenshot could not be created."));
2695
+ e(o);
2696
+ }, "image/png");
2697
+ });
2698
+ });
2699
+ }
2700
+ const Me = [
2755
2701
  // https://colorhunt.co/palette/1d5b79468b97ef6262f3aa60
2756
2702
  ["#1D5B79", "#468B97", "#EF6262", "#F3AA60"],
2757
2703
  // https://colorhunt.co/palette/614bc333bbc585e6c5c8ffe0
@@ -2772,15 +2718,15 @@ const Je = {
2772
2718
  ["#10A19D", "#540375", "#FF7000", "#FFBF00"]
2773
2719
  ];
2774
2720
  function he() {
2775
- return Ne[~~(Math.random() * Ne.length)][~~(Math.random() * 4)];
2721
+ return Me[~~(Math.random() * Me.length)][~~(Math.random() * 4)];
2776
2722
  }
2777
2723
  function te() {
2778
- return `maptiler_source_${Ue()}`;
2724
+ return `maptiler_source_${De()}`;
2779
2725
  }
2780
2726
  function oe() {
2781
- return `maptiler_layer_${Ue()}`;
2727
+ return `maptiler_layer_${De()}`;
2782
2728
  }
2783
- function Me(r, e) {
2729
+ function Pe(r, e) {
2784
2730
  if (e <= r[0].zoom)
2785
2731
  return r[0].value;
2786
2732
  if (e >= r[r.length - 1].zoom)
@@ -2792,13 +2738,13 @@ function Me(r, e) {
2792
2738
  }
2793
2739
  return 0;
2794
2740
  }
2795
- function Z(r) {
2741
+ function K(r) {
2796
2742
  return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
2797
2743
  }
2798
- function b(r) {
2744
+ function A(r) {
2799
2745
  return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
2800
2746
  }
2801
- function uo(r, e) {
2747
+ function mo(r, e) {
2802
2748
  if (typeof e == "number" && typeof r == "number")
2803
2749
  return 2 * e + r;
2804
2750
  if (typeof e == "number" && Array.isArray(r))
@@ -2813,15 +2759,15 @@ function uo(r, e) {
2813
2759
  "interpolate",
2814
2760
  ["linear"],
2815
2761
  ["zoom"],
2816
- ...t.flatMap((o) => [o, 2 * Me(e, o) + Me(r, o)])
2762
+ ...t.flatMap((o) => [o, 2 * Pe(e, o) + Pe(r, o)])
2817
2763
  ];
2818
2764
  }
2819
2765
  return 0;
2820
2766
  }
2821
- function po(r, e) {
2767
+ function fo(r, e) {
2822
2768
  return ["interpolate", ["linear"], ["get", e], ...r.flatMap((t) => [t.propertyValue, t.value])];
2823
2769
  }
2824
- function qe(r) {
2770
+ function Je(r) {
2825
2771
  const e = r.trimStart(), t = `${e}${" ".repeat(r.length - e.length)}`, o = Array.from(t);
2826
2772
  if (!o.every((i) => i === " " || i === "_"))
2827
2773
  throw new Error("A dash pattern must be composed only of whitespace and underscore characters.");
@@ -2829,15 +2775,15 @@ function qe(r) {
2829
2775
  throw new Error("A dash pattern must contain at least one underscore and one whitespace character");
2830
2776
  const l = [1];
2831
2777
  for (let i = 1; i < o.length; i += 1) {
2832
- const c = o[i - 1], h = o[i];
2833
- c === h ? l[l.length - 1] += 1 : l.push(1);
2778
+ const u = o[i - 1], h = o[i];
2779
+ u === h ? l[l.length - 1] += 1 : l.push(1);
2834
2780
  }
2835
2781
  return l;
2836
2782
  }
2837
- function Pe(r, e) {
2783
+ function ke(r, e) {
2838
2784
  return ["interpolate", ["linear"], ["get", e], ...r.flatMap((t) => [t.value, t.color])];
2839
2785
  }
2840
- function Oe(r, e, t = !0) {
2786
+ function Fe(r, e, t = !0) {
2841
2787
  return t ? [
2842
2788
  "interpolate",
2843
2789
  ["linear"],
@@ -2854,7 +2800,7 @@ function Oe(r, e, t = !0) {
2854
2800
  ["interpolate", ["linear"], ["get", e], ...r.flatMap((o) => [o.value, o.pointRadius])]
2855
2801
  ] : ["interpolate", ["linear"], ["get", e], ...r.flatMap((o) => [o.value, o.pointRadius])];
2856
2802
  }
2857
- function ho(r, e, t = !0) {
2803
+ function go(r, e, t = !0) {
2858
2804
  return t ? [
2859
2805
  "interpolate",
2860
2806
  ["linear"],
@@ -2871,7 +2817,7 @@ function ho(r, e, t = !0) {
2871
2817
  ["interpolate", ["linear"], ["get", e], ...r.flatMap((o) => [o.propertyValue, o.value])]
2872
2818
  ] : ["interpolate", ["linear"], ["get", e], ...r.flatMap((o) => [o.propertyValue, o.value])];
2873
2819
  }
2874
- function ke(r, e) {
2820
+ function Oe(r, e) {
2875
2821
  return r.every((t) => t.color[3] === r[0].color[3]) ? r[0].color[3] ? r[0].color[3] / 255 : 1 : [
2876
2822
  "interpolate",
2877
2823
  ["linear"],
@@ -2882,7 +2828,7 @@ function ke(r, e) {
2882
2828
  })
2883
2829
  ];
2884
2830
  }
2885
- function mo(r, e = 10) {
2831
+ function yo(r, e = 10) {
2886
2832
  return [
2887
2833
  "interpolate",
2888
2834
  ["linear"],
@@ -2893,33 +2839,33 @@ function mo(r, e = 10) {
2893
2839
  }).flat()
2894
2840
  ];
2895
2841
  }
2896
- async function fo(r, e, t = {}) {
2842
+ async function vo(r, e, t = {}) {
2897
2843
  var a, n;
2898
2844
  if (!e.sourceId && !e.data)
2899
2845
  throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");
2900
2846
  let o = e.data;
2901
2847
  if (typeof o == "string") {
2902
2848
  if (ee(o))
2903
- o = `https://api.maptiler.com/data/${e.data}/features.json?key=${N.apiKey}`;
2849
+ o = `https://api.maptiler.com/data/${e.data}/features.json?key=${M.apiKey}`;
2904
2850
  else if (((a = o.split(".").pop()) == null ? void 0 : a.toLowerCase().trim()) === "gpx") {
2905
2851
  const i = await (await fetch(o, t)).text();
2906
2852
  o = Ve(i);
2907
2853
  } else if (((n = o.split(".").pop()) == null ? void 0 : n.toLowerCase().trim()) === "kml") {
2908
2854
  const i = await (await fetch(o, t)).text();
2909
- o = je(i);
2855
+ o = $e(i);
2910
2856
  } else {
2911
- const l = Ht(o) ?? so(o);
2857
+ const l = Ht(o) ?? co(o);
2912
2858
  l && (o = l);
2913
2859
  }
2914
2860
  if (!o)
2915
2861
  throw new Error("Polyline data was provided as string but is incompatible with valid formats.");
2916
2862
  }
2917
- return go(r, {
2863
+ return Lo(r, {
2918
2864
  ...e,
2919
2865
  data: o
2920
2866
  });
2921
2867
  }
2922
- function go(r, e) {
2868
+ function Lo(r, e) {
2923
2869
  if (e.layerId && r.getLayer(e.layerId))
2924
2870
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
2925
2871
  const t = e.sourceId ?? te(), o = e.layerId ?? oe(), a = {
@@ -2931,14 +2877,14 @@ function go(r, e) {
2931
2877
  type: "geojson",
2932
2878
  data: e.data
2933
2879
  });
2934
- const n = e.lineWidth ?? 3, l = e.lineColor ?? he(), i = e.lineOpacity ?? 1, c = e.lineBlur ?? 0, h = e.lineGapWidth ?? 0;
2935
- let s = e.lineDashArray ?? null;
2936
- const p = e.outlineWidth ?? 1, u = e.outlineColor ?? "#FFFFFF", d = e.outlineOpacity ?? 1, m = e.outlineBlur ?? 0;
2937
- if (typeof s == "string" && (s = qe(s)), e.outline === !0) {
2938
- const v = `${o}_outline`;
2939
- a.polylineOutlineLayerId = v, r.addLayer(
2880
+ const n = e.lineWidth ?? 3, l = e.lineColor ?? he(), i = e.lineOpacity ?? 1, u = e.lineBlur ?? 0, h = e.lineGapWidth ?? 0;
2881
+ let c = e.lineDashArray ?? null;
2882
+ const s = e.outlineWidth ?? 1, d = e.outlineColor ?? "#FFFFFF", p = e.outlineOpacity ?? 1, m = e.outlineBlur ?? 0;
2883
+ if (typeof c == "string" && (c = Je(c)), e.outline === !0) {
2884
+ const y = `${o}_outline`;
2885
+ a.polylineOutlineLayerId = y, r.addLayer(
2940
2886
  {
2941
- id: v,
2887
+ id: y,
2942
2888
  type: "line",
2943
2889
  source: t,
2944
2890
  layout: {
@@ -2948,10 +2894,10 @@ function go(r, e) {
2948
2894
  minzoom: e.minzoom ?? 0,
2949
2895
  maxzoom: e.maxzoom ?? 23,
2950
2896
  paint: {
2951
- "line-opacity": typeof d == "number" ? d : b(d),
2952
- "line-color": typeof u == "string" ? u : Z(u),
2953
- "line-width": uo(n, p),
2954
- "line-blur": typeof m == "number" ? m : b(m)
2897
+ "line-opacity": typeof p == "number" ? p : A(p),
2898
+ "line-color": typeof d == "string" ? d : K(d),
2899
+ "line-width": mo(n, s),
2900
+ "line-blur": typeof m == "number" ? m : A(m)
2955
2901
  }
2956
2902
  },
2957
2903
  e.beforeId
@@ -2969,23 +2915,23 @@ function go(r, e) {
2969
2915
  minzoom: e.minzoom ?? 0,
2970
2916
  maxzoom: e.maxzoom ?? 23,
2971
2917
  paint: {
2972
- "line-opacity": typeof i == "number" ? i : b(i),
2973
- "line-color": typeof l == "string" ? l : Z(l),
2974
- "line-width": typeof n == "number" ? n : b(n),
2975
- "line-blur": typeof c == "number" ? c : b(c),
2976
- "line-gap-width": typeof h == "number" ? h : b(h),
2918
+ "line-opacity": typeof i == "number" ? i : A(i),
2919
+ "line-color": typeof l == "string" ? l : K(l),
2920
+ "line-width": typeof n == "number" ? n : A(n),
2921
+ "line-blur": typeof u == "number" ? u : A(u),
2922
+ "line-gap-width": typeof h == "number" ? h : A(h),
2977
2923
  // For some reasons passing "line-dasharray" with the value "undefined"
2978
2924
  // results in no showing the line while it should have the same behavior
2979
2925
  // of not adding the property "line-dasharray" as all.
2980
2926
  // As a workaround, we are inlining the addition of the prop with a conditional
2981
2927
  // which is less readable.
2982
- ...s && { "line-dasharray": s }
2928
+ ...c && { "line-dasharray": c }
2983
2929
  }
2984
2930
  },
2985
2931
  e.beforeId
2986
2932
  ), a;
2987
2933
  }
2988
- function yo(r, e) {
2934
+ function wo(r, e) {
2989
2935
  if (e.layerId && r.getLayer(e.layerId))
2990
2936
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
2991
2937
  const t = e.sourceId ?? te(), o = e.layerId ?? oe(), a = {
@@ -2994,16 +2940,16 @@ function yo(r, e) {
2994
2940
  polygonSourceId: t
2995
2941
  };
2996
2942
  if (e.data && !r.getSource(t)) {
2997
- let v = e.data;
2998
- typeof v == "string" && ee(v) && (v = `https://api.maptiler.com/data/${v}/features.json?key=${N.apiKey}`), r.addSource(t, {
2943
+ let y = e.data;
2944
+ typeof y == "string" && ee(y) && (y = `https://api.maptiler.com/data/${y}/features.json?key=${M.apiKey}`), r.addSource(t, {
2999
2945
  type: "geojson",
3000
- data: v
2946
+ data: y
3001
2947
  });
3002
2948
  }
3003
2949
  let n = e.outlineDashArray ?? null;
3004
- const l = e.outlineWidth ?? 1, i = e.outlineColor ?? "#FFFFFF", c = e.outlineOpacity ?? 1, h = e.outlineBlur ?? 0, s = e.fillColor ?? he(), p = e.fillOpacity ?? 1, u = e.outlinePosition ?? "center", d = e.pattern ?? null;
3005
- typeof n == "string" && (n = qe(n));
3006
- const m = (v = null) => {
2950
+ const l = e.outlineWidth ?? 1, i = e.outlineColor ?? "#FFFFFF", u = e.outlineOpacity ?? 1, h = e.outlineBlur ?? 0, c = e.fillColor ?? he(), s = e.fillOpacity ?? 1, d = e.outlinePosition ?? "center", p = e.pattern ?? null;
2951
+ typeof n == "string" && (n = Je(n));
2952
+ const m = (y = null) => {
3007
2953
  if (r.addLayer(
3008
2954
  {
3009
2955
  id: o,
@@ -3012,26 +2958,26 @@ function yo(r, e) {
3012
2958
  minzoom: e.minzoom ?? 0,
3013
2959
  maxzoom: e.maxzoom ?? 23,
3014
2960
  paint: {
3015
- "fill-color": typeof s == "string" ? s : Z(s),
3016
- "fill-opacity": typeof p == "number" ? p : b(p),
2961
+ "fill-color": typeof c == "string" ? c : K(c),
2962
+ "fill-opacity": typeof s == "number" ? s : A(s),
3017
2963
  // Adding a pattern if provided
3018
- ...v && { "fill-pattern": v }
2964
+ ...y && { "fill-pattern": y }
3019
2965
  }
3020
2966
  },
3021
2967
  e.beforeId
3022
2968
  ), e.outline === !0) {
3023
- let w;
3024
- u === "inside" ? typeof l == "number" ? w = 0.5 * l : w = b(
3025
- l.map(({ zoom: M, value: A }) => ({
3026
- zoom: M,
3027
- value: 0.5 * A
2969
+ let b;
2970
+ d === "inside" ? typeof l == "number" ? b = 0.5 * l : b = A(
2971
+ l.map(({ zoom: P, value: w }) => ({
2972
+ zoom: P,
2973
+ value: 0.5 * w
3028
2974
  }))
3029
- ) : u === "outside" ? typeof l == "number" ? w = -0.5 * l : w = b(
3030
- l.map((M) => ({
3031
- zoom: M.zoom,
3032
- value: -0.5 * M.value
2975
+ ) : d === "outside" ? typeof l == "number" ? b = -0.5 * l : b = A(
2976
+ l.map((P) => ({
2977
+ zoom: P.zoom,
2978
+ value: -0.5 * P.value
3033
2979
  }))
3034
- ) : w = 0, r.addLayer(
2980
+ ) : b = 0, r.addLayer(
3035
2981
  {
3036
2982
  id: a.polygonOutlineLayerId,
3037
2983
  type: "line",
@@ -3043,11 +2989,11 @@ function yo(r, e) {
3043
2989
  minzoom: e.minzoom ?? 0,
3044
2990
  maxzoom: e.maxzoom ?? 23,
3045
2991
  paint: {
3046
- "line-opacity": typeof c == "number" ? c : b(c),
3047
- "line-color": typeof i == "string" ? i : Z(i),
3048
- "line-width": typeof l == "number" ? l : b(l),
3049
- "line-blur": typeof h == "number" ? h : b(h),
3050
- "line-offset": w,
2992
+ "line-opacity": typeof u == "number" ? u : A(u),
2993
+ "line-color": typeof i == "string" ? i : K(i),
2994
+ "line-width": typeof l == "number" ? l : A(l),
2995
+ "line-blur": typeof h == "number" ? h : A(h),
2996
+ "line-offset": b,
3051
2997
  // For some reasons passing "line-dasharray" with the value "undefined"
3052
2998
  // results in no showing the line while it should have the same behavior
3053
2999
  // of not adding the property "line-dasharray" as all.
@@ -3062,103 +3008,103 @@ function yo(r, e) {
3062
3008
  );
3063
3009
  }
3064
3010
  };
3065
- return d ? r.hasImage(d) ? m(d) : r.loadImage(d).then((v) => {
3066
- r.addImage(d, v.data), m(d);
3067
- }).catch((v) => (console.error("Could not load the pattern image.", v.message), m())) : m(), a;
3011
+ return p ? r.hasImage(p) ? m(p) : r.loadImage(p).then((y) => {
3012
+ r.addImage(p, y.data), m(p);
3013
+ }).catch((y) => (console.error("Could not load the pattern image.", y.message), m())) : m(), a;
3068
3014
  }
3069
- function vo(r, e) {
3015
+ function Co(r, e) {
3070
3016
  if (e.layerId && r.getLayer(e.layerId))
3071
3017
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
3072
- const t = e.minPointRadius ?? 10, o = e.maxPointRadius ?? 50, a = e.cluster ?? !1, n = 20, l = Array.isArray(e.pointColor) ? e.pointColor : Je.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), i = l.getBounds(), c = e.sourceId ?? te(), h = e.layerId ?? oe(), s = e.showLabel ?? a, p = e.alignOnViewport ?? !0, u = e.outline ?? !1, d = e.outlineOpacity ?? 1, m = e.outlineWidth ?? 1, v = e.outlineColor ?? "#FFFFFF";
3073
- let w;
3074
- const M = e.zoomCompensation ?? !0, A = e.minzoom ?? 0, I = e.maxzoom ?? 23;
3075
- typeof e.pointOpacity == "number" ? w = e.pointOpacity : Array.isArray(e.pointOpacity) ? w = b(e.pointOpacity) : e.cluster ? w = ke(l, "point_count") : e.property ? w = ke(l, e.property) : w = b([
3076
- { zoom: A, value: 0 },
3077
- { zoom: A + 0.25, value: 1 },
3078
- { zoom: I - 0.25, value: 1 },
3079
- { zoom: I, value: 0 }
3018
+ const t = e.minPointRadius ?? 10, o = e.maxPointRadius ?? 50, a = e.cluster ?? !1, n = 20, l = Array.isArray(e.pointColor) ? e.pointColor : qe.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), i = l.getBounds(), u = e.sourceId ?? te(), h = e.layerId ?? oe(), c = e.showLabel ?? a, s = e.alignOnViewport ?? !0, d = e.outline ?? !1, p = e.outlineOpacity ?? 1, m = e.outlineWidth ?? 1, y = e.outlineColor ?? "#FFFFFF";
3019
+ let b;
3020
+ const P = e.zoomCompensation ?? !0, w = e.minzoom ?? 0, _ = e.maxzoom ?? 23;
3021
+ typeof e.pointOpacity == "number" ? b = e.pointOpacity : Array.isArray(e.pointOpacity) ? b = A(e.pointOpacity) : e.cluster ? b = Oe(l, "point_count") : e.property ? b = Oe(l, e.property) : b = A([
3022
+ { zoom: w, value: 0 },
3023
+ { zoom: w + 0.25, value: 1 },
3024
+ { zoom: _ - 0.25, value: 1 },
3025
+ { zoom: _, value: 0 }
3080
3026
  ]);
3081
- const R = {
3027
+ const E = {
3082
3028
  pointLayerId: h,
3083
3029
  clusterLayerId: "",
3084
3030
  labelLayerId: "",
3085
- pointSourceId: c
3031
+ pointSourceId: u
3086
3032
  };
3087
- if (e.data && !r.getSource(c)) {
3088
- let E = e.data;
3089
- typeof E == "string" && ee(E) && (E = `https://api.maptiler.com/data/${E}/features.json?key=${N.apiKey}`), r.addSource(c, {
3033
+ if (e.data && !r.getSource(u)) {
3034
+ let R = e.data;
3035
+ typeof R == "string" && ee(R) && (R = `https://api.maptiler.com/data/${R}/features.json?key=${M.apiKey}`), r.addSource(u, {
3090
3036
  type: "geojson",
3091
- data: E,
3037
+ data: R,
3092
3038
  cluster: a
3093
3039
  });
3094
3040
  }
3095
3041
  if (a) {
3096
- R.clusterLayerId = `${h}_cluster`;
3097
- const E = Array.from({ length: n }, (U, j) => {
3098
- const W = i.min + j * (i.max - i.min) / (n - 1);
3042
+ E.clusterLayerId = `${h}_cluster`;
3043
+ const R = Array.from({ length: n }, (D, V) => {
3044
+ const W = i.min + V * (i.max - i.min) / (n - 1);
3099
3045
  return {
3100
3046
  value: W,
3101
- pointRadius: t + (o - t) * (j / (n - 1)) ** 0.5,
3047
+ pointRadius: t + (o - t) * (V / (n - 1)) ** 0.5,
3102
3048
  color: l.getColorHex(W)
3103
3049
  };
3104
3050
  });
3105
3051
  r.addLayer(
3106
3052
  {
3107
- id: R.clusterLayerId,
3053
+ id: E.clusterLayerId,
3108
3054
  type: "circle",
3109
- source: c,
3055
+ source: u,
3110
3056
  filter: ["has", "point_count"],
3111
3057
  paint: {
3112
3058
  // 'circle-color': options.pointColor ?? colorDrivenByProperty(clusterStyle, "point_count"),
3113
- "circle-color": typeof e.pointColor == "string" ? e.pointColor : Pe(E, "point_count"),
3114
- "circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? b(e.pointRadius) : Oe(E, "point_count", !1),
3115
- "circle-pitch-alignment": p ? "viewport" : "map",
3059
+ "circle-color": typeof e.pointColor == "string" ? e.pointColor : ke(R, "point_count"),
3060
+ "circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? A(e.pointRadius) : Fe(R, "point_count", !1),
3061
+ "circle-pitch-alignment": s ? "viewport" : "map",
3116
3062
  "circle-pitch-scale": "map",
3117
3063
  // scale with camera distance regardless of viewport/biewport alignement
3118
- "circle-opacity": w,
3119
- ...u && {
3120
- "circle-stroke-opacity": typeof d == "number" ? d : b(d),
3121
- "circle-stroke-width": typeof m == "number" ? m : b(m),
3122
- "circle-stroke-color": typeof v == "string" ? v : Z(v)
3064
+ "circle-opacity": b,
3065
+ ...d && {
3066
+ "circle-stroke-opacity": typeof p == "number" ? p : A(p),
3067
+ "circle-stroke-width": typeof m == "number" ? m : A(m),
3068
+ "circle-stroke-color": typeof y == "string" ? y : K(y)
3123
3069
  }
3124
3070
  },
3125
- minzoom: A,
3126
- maxzoom: I
3071
+ minzoom: w,
3072
+ maxzoom: _
3127
3073
  },
3128
3074
  e.beforeId
3129
3075
  ), r.addLayer(
3130
3076
  {
3131
- id: R.pointLayerId,
3077
+ id: E.pointLayerId,
3132
3078
  type: "circle",
3133
- source: c,
3079
+ source: u,
3134
3080
  filter: ["!", ["has", "point_count"]],
3135
3081
  paint: {
3136
- "circle-pitch-alignment": p ? "viewport" : "map",
3082
+ "circle-pitch-alignment": s ? "viewport" : "map",
3137
3083
  "circle-pitch-scale": "map",
3138
3084
  // scale with camera distance regardless of viewport/biewport alignement
3139
3085
  // 'circle-color': options.pointColor ?? clusterStyle[0].color,
3140
3086
  "circle-color": typeof e.pointColor == "string" ? e.pointColor : l.getColorHex(l.getBounds().min),
3141
- "circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? b(e.pointRadius) : E[0].pointRadius * 0.75,
3142
- "circle-opacity": w,
3143
- ...u && {
3144
- "circle-stroke-opacity": typeof d == "number" ? d : b(d),
3145
- "circle-stroke-width": typeof m == "number" ? m : b(m),
3146
- "circle-stroke-color": typeof v == "string" ? v : Z(v)
3087
+ "circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? A(e.pointRadius) : R[0].pointRadius * 0.75,
3088
+ "circle-opacity": b,
3089
+ ...d && {
3090
+ "circle-stroke-opacity": typeof p == "number" ? p : A(p),
3091
+ "circle-stroke-width": typeof m == "number" ? m : A(m),
3092
+ "circle-stroke-color": typeof y == "string" ? y : K(y)
3147
3093
  }
3148
3094
  },
3149
- minzoom: A,
3150
- maxzoom: I
3095
+ minzoom: w,
3096
+ maxzoom: _
3151
3097
  },
3152
3098
  e.beforeId
3153
3099
  );
3154
3100
  } else {
3155
- let E = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : he(), U = typeof e.pointRadius == "number" ? M ? b([
3101
+ let R = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : he(), D = typeof e.pointRadius == "number" ? P ? A([
3156
3102
  { zoom: 0, value: e.pointRadius * 0.025 },
3157
3103
  { zoom: 2, value: e.pointRadius * 0.05 },
3158
3104
  { zoom: 4, value: e.pointRadius * 0.1 },
3159
3105
  { zoom: 8, value: e.pointRadius * 0.25 },
3160
3106
  { zoom: 16, value: e.pointRadius * 1 }
3161
- ]) : e.pointRadius : Array.isArray(e.pointRadius) ? b(e.pointRadius) : M ? b([
3107
+ ]) : e.pointRadius : Array.isArray(e.pointRadius) ? A(e.pointRadius) : P ? A([
3162
3108
  { zoom: 0, value: t * 0.05 },
3163
3109
  { zoom: 2, value: t * 0.1 },
3164
3110
  { zoom: 4, value: t * 0.2 },
@@ -3166,74 +3112,74 @@ function vo(r, e) {
3166
3112
  { zoom: 16, value: t * 1 }
3167
3113
  ]) : t;
3168
3114
  if (e.property && Array.isArray(e.pointColor)) {
3169
- const j = Array.from({ length: n }, (W, J) => {
3170
- const q = i.min + J * (i.max - i.min) / (n - 1);
3115
+ const V = Array.from({ length: n }, (W, q) => {
3116
+ const J = i.min + q * (i.max - i.min) / (n - 1);
3171
3117
  return {
3172
- value: q,
3173
- pointRadius: typeof e.pointRadius == "number" ? e.pointRadius : t + (o - t) * (J / (n - 1)) ** 0.5,
3174
- color: typeof e.pointColor == "string" ? e.pointColor : l.getColorHex(q)
3118
+ value: J,
3119
+ pointRadius: typeof e.pointRadius == "number" ? e.pointRadius : t + (o - t) * (q / (n - 1)) ** 0.5,
3120
+ color: typeof e.pointColor == "string" ? e.pointColor : l.getColorHex(J)
3175
3121
  };
3176
3122
  });
3177
- E = Pe(j, e.property), U = Oe(j, e.property, M);
3123
+ R = ke(V, e.property), D = Fe(V, e.property, P);
3178
3124
  }
3179
3125
  r.addLayer(
3180
3126
  {
3181
- id: R.pointLayerId,
3127
+ id: E.pointLayerId,
3182
3128
  type: "circle",
3183
- source: c,
3129
+ source: u,
3184
3130
  layout: {
3185
3131
  // Contrary to labels, we want to see the small one in front. Weirdly "circle-sort-key" works in the opposite direction as "symbol-sort-key".
3186
3132
  "circle-sort-key": e.property ? ["/", 1, ["get", e.property]] : 0
3187
3133
  },
3188
3134
  paint: {
3189
- "circle-pitch-alignment": p ? "viewport" : "map",
3135
+ "circle-pitch-alignment": s ? "viewport" : "map",
3190
3136
  "circle-pitch-scale": "map",
3191
3137
  // scale with camera distance regardless of viewport/biewport alignement
3192
- "circle-color": E,
3193
- "circle-opacity": w,
3194
- "circle-radius": U,
3195
- ...u && {
3196
- "circle-stroke-opacity": typeof d == "number" ? d : b(d),
3197
- "circle-stroke-width": typeof m == "number" ? m : b(m),
3198
- "circle-stroke-color": typeof v == "string" ? v : Z(v)
3138
+ "circle-color": R,
3139
+ "circle-opacity": b,
3140
+ "circle-radius": D,
3141
+ ...d && {
3142
+ "circle-stroke-opacity": typeof p == "number" ? p : A(p),
3143
+ "circle-stroke-width": typeof m == "number" ? m : A(m),
3144
+ "circle-stroke-color": typeof y == "string" ? y : K(y)
3199
3145
  }
3200
3146
  },
3201
- minzoom: A,
3202
- maxzoom: I
3147
+ minzoom: w,
3148
+ maxzoom: _
3203
3149
  },
3204
3150
  e.beforeId
3205
3151
  );
3206
3152
  }
3207
- if (s !== !1 && (e.cluster || e.property)) {
3208
- R.labelLayerId = `${h}_label`;
3209
- const E = e.labelColor ?? "#fff", U = e.labelSize ?? 12;
3153
+ if (c !== !1 && (e.cluster || e.property)) {
3154
+ E.labelLayerId = `${h}_label`;
3155
+ const R = e.labelColor ?? "#fff", D = e.labelSize ?? 12;
3210
3156
  r.addLayer(
3211
3157
  {
3212
- id: R.labelLayerId,
3158
+ id: E.labelLayerId,
3213
3159
  type: "symbol",
3214
- source: c,
3160
+ source: u,
3215
3161
  filter: ["has", e.cluster ? "point_count" : e.property],
3216
3162
  layout: {
3217
3163
  "text-field": e.cluster ? "{point_count_abbreviated}" : `{${e.property}}`,
3218
3164
  "text-font": ["Noto Sans Regular"],
3219
- "text-size": U,
3220
- "text-pitch-alignment": p ? "viewport" : "map",
3165
+ "text-size": D,
3166
+ "text-pitch-alignment": s ? "viewport" : "map",
3221
3167
  "symbol-sort-key": ["/", 1, ["get", e.cluster ? "point_count" : e.property]]
3222
3168
  // so that the largest value goes on top
3223
3169
  },
3224
3170
  paint: {
3225
- "text-color": E,
3226
- "text-opacity": w
3171
+ "text-color": R,
3172
+ "text-opacity": b
3227
3173
  },
3228
- minzoom: A,
3229
- maxzoom: I
3174
+ minzoom: w,
3175
+ maxzoom: _
3230
3176
  },
3231
3177
  e.beforeId
3232
3178
  );
3233
3179
  }
3234
- return R;
3180
+ return E;
3235
3181
  }
3236
- function Lo(r, e) {
3182
+ function bo(r, e) {
3237
3183
  if (e.layerId && r.getLayer(e.layerId))
3238
3184
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
3239
3185
  const t = e.sourceId ?? te(), o = e.layerId ?? oe(), a = e.minzoom ?? 0, n = e.maxzoom ?? 23, l = e.zoomCompensation ?? !0, i = e.opacity ?? [
@@ -3242,218 +3188,226 @@ function Lo(r, e) {
3242
3188
  { zoom: n - 0.25, value: 1 },
3243
3189
  { zoom: n, value: 0 }
3244
3190
  ];
3245
- let c = Array.isArray(e.colorRamp) ? e.colorRamp : Je.TURBO.transparentStart();
3246
- const h = c.getBounds();
3247
- (h.min !== 0 || h.max !== 1) && (c = c.scale(0, 1)), c.hasTransparentStart() || (c = c.transparentStart());
3248
- const s = e.intensity ?? [
3191
+ let u = Array.isArray(e.colorRamp) ? e.colorRamp : qe.TURBO.transparentStart();
3192
+ const h = u.getBounds();
3193
+ (h.min !== 0 || h.max !== 1) && (u = u.scale(0, 1)), u.hasTransparentStart() || (u = u.transparentStart());
3194
+ const c = e.intensity ?? [
3249
3195
  { zoom: 0, value: 0.01 },
3250
3196
  { zoom: 4, value: 0.2 },
3251
3197
  { zoom: 16, value: 1 }
3252
- ], p = e.property ?? null, u = e.weight ?? 1;
3253
- let d = 1;
3254
- p ? typeof u == "number" ? (d = u, typeof e.weight == "number" && console.warn(
3198
+ ], s = e.property ?? null, d = e.weight ?? 1;
3199
+ let p = 1;
3200
+ s ? typeof d == "number" ? (p = d, typeof e.weight == "number" && console.warn(
3255
3201
  "The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"
3256
- )) : Array.isArray(u) ? d = po(u, p) : console.warn(
3202
+ )) : Array.isArray(d) ? p = fo(d, s) : console.warn(
3257
3203
  "The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"
3258
- ) : typeof u == "number" ? d = u : Array.isArray(u) && console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");
3204
+ ) : typeof d == "number" ? p = d : Array.isArray(d) && console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");
3259
3205
  const m = [
3260
3206
  { zoom: 0, value: 50 * 0.025 },
3261
3207
  { zoom: 2, value: 50 * 0.05 },
3262
3208
  { zoom: 4, value: 50 * 0.1 },
3263
3209
  { zoom: 8, value: 50 * 0.25 },
3264
3210
  { zoom: 16, value: 50 }
3265
- ], v = e.radius ?? (l ? m : 10);
3266
- let w = 1;
3267
- typeof v == "number" ? w = v : Array.isArray(v) && "zoom" in v[0] ? w = b(v) : p && Array.isArray(v) && "propertyValue" in v[0] ? w = ho(v, p, l) : !p && Array.isArray(v) && "propertyValue" in v[0] ? (w = b(m), console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")) : w = b(m);
3268
- const M = {
3211
+ ], y = e.radius ?? (l ? m : 10);
3212
+ let b = 1;
3213
+ typeof y == "number" ? b = y : Array.isArray(y) && "zoom" in y[0] ? b = A(y) : s && Array.isArray(y) && "propertyValue" in y[0] ? b = go(y, s, l) : !s && Array.isArray(y) && "propertyValue" in y[0] ? (b = A(m), console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")) : b = A(m);
3214
+ const P = {
3269
3215
  heatmapLayerId: o,
3270
3216
  heatmapSourceId: t
3271
3217
  };
3272
3218
  if (e.data && !r.getSource(t)) {
3273
- let A = e.data;
3274
- typeof A == "string" && ee(A) && (A = `https://api.maptiler.com/data/${A}/features.json?key=${N.apiKey}`), r.addSource(t, {
3219
+ let w = e.data;
3220
+ typeof w == "string" && ee(w) && (w = `https://api.maptiler.com/data/${w}/features.json?key=${M.apiKey}`), r.addSource(t, {
3275
3221
  type: "geojson",
3276
- data: A
3222
+ data: w
3277
3223
  });
3278
3224
  }
3279
- return r.addLayer({
3280
- id: o,
3281
- type: "heatmap",
3282
- source: t,
3283
- minzoom: a,
3284
- maxzoom: n,
3285
- paint: {
3286
- "heatmap-weight": d,
3287
- "heatmap-intensity": typeof s == "number" ? s : b(s),
3288
- "heatmap-color": mo(c),
3289
- "heatmap-radius": w,
3290
- "heatmap-opacity": typeof i == "number" ? i : b(i)
3291
- }
3292
- }), M;
3293
- }
3294
- const Zo = {
3295
- addPolyline: fo,
3296
- addPolygon: yo,
3297
- addPoint: vo,
3298
- addHeatmap: Lo
3225
+ return r.addLayer(
3226
+ {
3227
+ id: o,
3228
+ type: "heatmap",
3229
+ source: t,
3230
+ minzoom: a,
3231
+ maxzoom: n,
3232
+ paint: {
3233
+ "heatmap-weight": p,
3234
+ "heatmap-intensity": typeof c == "number" ? c : A(c),
3235
+ "heatmap-color": yo(u),
3236
+ "heatmap-radius": b,
3237
+ "heatmap-opacity": typeof i == "number" ? i : A(i)
3238
+ }
3239
+ },
3240
+ e.beforeId
3241
+ ), P;
3242
+ }
3243
+ const qo = {
3244
+ addPolyline: vo,
3245
+ addPolygon: wo,
3246
+ addPoint: Co,
3247
+ addHeatmap: bo,
3248
+ takeScreenshot: po
3299
3249
  };
3300
3250
  Ut();
3301
- function Wo() {
3302
- return _t.version;
3303
- }
3304
- const Yo = f.Map, Jo = f.Marker, qo = f.Popup, Xo = f.Style, Qo = f.CanvasSource, er = f.GeoJSONSource, tr = f.ImageSource, or = f.RasterTileSource, rr = f.RasterDEMTileSource, ar = f.VectorTileSource, nr = f.VideoSource, lr = f.NavigationControl, ir = f.GeolocateControl, sr = f.AttributionControl, cr = f.LogoControl, ur = f.ScaleControl, pr = f.FullscreenControl, dr = f.TerrainControl, hr = f.BoxZoomHandler, mr = f.ScrollZoomHandler, fr = f.CooperativeGesturesHandler, gr = f.KeyboardHandler, yr = f.TwoFingersTouchPitchHandler, vr = f.MapWheelEvent, Lr = f.MapTouchEvent, Ar = f.MapMouseEvent, Cr = f.config, wr = f.getVersion, {
3305
- setRTLTextPlugin: Sr,
3306
- getRTLTextPluginStatus: br,
3307
- LngLat: Tr,
3308
- LngLatBounds: Er,
3251
+ function Jo() {
3252
+ return Pt.version;
3253
+ }
3254
+ const Xo = f.Map, Qo = f.Marker, er = f.Popup, tr = f.Style, or = f.CanvasSource, rr = f.GeoJSONSource, ar = f.ImageSource, nr = f.RasterTileSource, lr = f.RasterDEMTileSource, ir = f.VectorTileSource, sr = f.VideoSource, cr = f.NavigationControl, ur = f.GeolocateControl, dr = f.AttributionControl, pr = f.LogoControl, hr = f.ScaleControl, mr = f.FullscreenControl, fr = f.TerrainControl, gr = f.BoxZoomHandler, yr = f.ScrollZoomHandler, vr = f.CooperativeGesturesHandler, Lr = f.KeyboardHandler, wr = f.TwoFingersTouchPitchHandler, Cr = f.MapWheelEvent, br = f.MapTouchEvent, Sr = f.MapMouseEvent, Ar = f.config, Tr = f.getVersion, {
3255
+ setRTLTextPlugin: Rr,
3256
+ getRTLTextPluginStatus: _r,
3257
+ LngLat: Er,
3258
+ LngLatBounds: xr,
3309
3259
  MercatorCoordinate: Ir,
3310
- Evented: Rr,
3311
- AJAXError: _r,
3312
- prewarm: xr,
3313
- clearPrewarmedResources: Nr,
3314
- Hash: Mr,
3315
- Point: Pr,
3316
- EdgeInsets: Or,
3317
- DragRotateHandler: kr,
3318
- DragPanHandler: Fr,
3319
- TwoFingersTouchZoomRotateHandler: Br,
3320
- DoubleClickZoomHandler: zr,
3321
- TwoFingersTouchZoomHandler: Ur,
3322
- TwoFingersTouchRotateHandler: Dr,
3323
- getWorkerCount: Hr,
3324
- setWorkerCount: Gr,
3325
- getMaxParallelImageRequests: Vr,
3326
- setMaxParallelImageRequests: jr,
3327
- getWorkerUrl: $r,
3328
- setWorkerUrl: Kr,
3329
- addSourceType: Zr,
3330
- importScriptInWorkers: Wr,
3331
- addProtocol: Yr,
3332
- removeProtocol: Jr
3260
+ Evented: Mr,
3261
+ AJAXError: Pr,
3262
+ prewarm: kr,
3263
+ clearPrewarmedResources: Fr,
3264
+ Hash: Or,
3265
+ Point: Br,
3266
+ EdgeInsets: Nr,
3267
+ DragRotateHandler: zr,
3268
+ DragPanHandler: Dr,
3269
+ TwoFingersTouchZoomRotateHandler: Ur,
3270
+ DoubleClickZoomHandler: Gr,
3271
+ TwoFingersTouchZoomHandler: Hr,
3272
+ TwoFingersTouchRotateHandler: Vr,
3273
+ getWorkerCount: $r,
3274
+ setWorkerCount: jr,
3275
+ getMaxParallelImageRequests: Kr,
3276
+ setMaxParallelImageRequests: Zr,
3277
+ getWorkerUrl: Wr,
3278
+ setWorkerUrl: Yr,
3279
+ addSourceType: qr,
3280
+ importScriptInWorkers: Jr,
3281
+ addProtocol: Xr,
3282
+ removeProtocol: Qr
3333
3283
  } = f;
3334
3284
  export {
3335
- _r as AJAXError,
3336
- Bo as AttributionControl,
3337
- sr as AttributionControlMLGL,
3338
- Uo as BoxZoomHandler,
3339
- hr as BoxZoomHandlerMLGL,
3340
- xo as CanvasSource,
3341
- Qo as CanvasSourceMLGL,
3285
+ Pr as AJAXError,
3286
+ Uo as AttributionControl,
3287
+ dr as AttributionControlMLGL,
3288
+ Ho as BoxZoomHandler,
3289
+ gr as BoxZoomHandlerMLGL,
3290
+ ko as CanvasSource,
3291
+ or as CanvasSourceMLGL,
3342
3292
  g as ColorRamp,
3343
- Je as ColorRampCollection,
3344
- Ho as CooperativeGesturesHandler,
3345
- fr as CooperativeGesturesHandlerMLGL,
3346
- zr as DoubleClickZoomHandler,
3347
- Fr as DragPanHandler,
3348
- kr as DragRotateHandler,
3349
- Or as EdgeInsets,
3350
- Rr as Evented,
3351
- Wt as FullscreenControl,
3352
- pr as FullscreenControlMLGL,
3353
- No as GeoJSONSource,
3354
- er as GeoJSONSourceMLGL,
3355
- $t as GeolocateControl,
3356
- ir as GeolocateControlMLGL,
3357
- Qt as GeolocationType,
3358
- Mr as Hash,
3359
- Mo as ImageSource,
3360
- tr as ImageSourceMLGL,
3361
- Go as KeyboardHandler,
3362
- gr as KeyboardHandlerMLGL,
3293
+ qe as ColorRampCollection,
3294
+ $o as CooperativeGesturesHandler,
3295
+ vr as CooperativeGesturesHandlerMLGL,
3296
+ Gr as DoubleClickZoomHandler,
3297
+ Dr as DragPanHandler,
3298
+ zr as DragRotateHandler,
3299
+ Nr as EdgeInsets,
3300
+ Mr as Evented,
3301
+ Yt as FullscreenControl,
3302
+ mr as FullscreenControlMLGL,
3303
+ Fo as GeoJSONSource,
3304
+ rr as GeoJSONSourceMLGL,
3305
+ Kt as GeolocateControl,
3306
+ ur as GeolocateControlMLGL,
3307
+ eo as GeolocationType,
3308
+ Or as Hash,
3309
+ Oo as ImageSource,
3310
+ ar as ImageSourceMLGL,
3311
+ jo as KeyboardHandler,
3312
+ Lr as KeyboardHandlerMLGL,
3363
3313
  C as Language,
3364
- Qr as LanguageGeocoding,
3365
- Tr as LngLat,
3366
- Er as LngLatBounds,
3367
- Kt as LogoControl,
3368
- cr as LogoControlMLGL,
3369
- eo as Map,
3370
- Yo as MapMLGL,
3371
- Ko as MapMouseEvent,
3372
- Ar as MapMouseEventMLGL,
3373
- ea as MapStyle,
3374
- ta as MapStyleVariant,
3375
- $o as MapTouchEvent,
3376
- Lr as MapTouchEventMLGL,
3377
- jo as MapWheelEvent,
3378
- vr as MapWheelEventMLGL,
3379
- Xt as MaptilerGeolocateControl,
3380
- we as MaptilerLogoControl,
3314
+ Er as LngLat,
3315
+ xr as LngLatBounds,
3316
+ Zt as LogoControl,
3317
+ pr as LogoControlMLGL,
3318
+ to as Map,
3319
+ Xo as MapMLGL,
3320
+ Yo as MapMouseEvent,
3321
+ Sr as MapMouseEventMLGL,
3322
+ oa as MapStyle,
3323
+ ra as MapStyleVariant,
3324
+ Wo as MapTouchEvent,
3325
+ br as MapTouchEventMLGL,
3326
+ Zo as MapWheelEvent,
3327
+ Cr as MapWheelEventMLGL,
3328
+ Qt as MaptilerGeolocateControl,
3329
+ be as MaptilerLogoControl,
3381
3330
  Jt as MaptilerNavigationControl,
3382
- Yt as MaptilerTerrainControl,
3383
- Eo as Marker,
3384
- Jo as MarkerMLGL,
3331
+ qt as MaptilerTerrainControl,
3332
+ xo as Marker,
3333
+ Qo as MarkerMLGL,
3385
3334
  Ir as MercatorCoordinate,
3386
- lr as NavigationControMLGL,
3335
+ cr as NavigationControMLGL,
3387
3336
  jt as NavigationControl,
3388
- Pr as Point,
3389
- Ro as Popup,
3390
- qo as PopupMLGL,
3391
- Oo as RasterDEMTileSource,
3392
- rr as RasterDEMTileSourceMLGL,
3393
- Po as RasterTileSource,
3394
- or as RasterTileSourceMLGL,
3395
- oa as ReferenceMapStyle,
3396
- Zt as ScaleControl,
3397
- ur as ScaleControlMLGL,
3398
- Do as ScrollZoomHandler,
3399
- mr as ScrollZoomHandlerMLGL,
3400
- Mt as SdkConfig,
3401
- ra as ServiceError,
3402
- _o as Style,
3403
- Xo as StyleMLGL,
3404
- dr as TerrainControMLGL,
3405
- zo as TerrainControl,
3406
- Vo as TwoFingersTouchPitchHandler,
3407
- yr as TwoFingersTouchPitchHandlerMLGL,
3408
- Dr as TwoFingersTouchRotateHandler,
3409
- Ur as TwoFingersTouchZoomHandler,
3410
- Br as TwoFingersTouchZoomRotateHandler,
3411
- ko as VectorTileSource,
3412
- ar as VectorTileSourceMLGL,
3413
- Fo as VideoSource,
3414
- nr as VideoSourceMLGL,
3415
- Yr as addProtocol,
3416
- Zr as addSourceType,
3417
- aa as bufferToPixelDataBrowser,
3418
- na as circumferenceAtLatitude,
3419
- Nr as clearPrewarmedResources,
3420
- N as config,
3421
- Cr as configMLGL,
3422
- la as coordinates,
3423
- ia as data,
3424
- sa as elevation,
3425
- ca as expandMapStyle,
3426
- ua as geocoding,
3427
- pa as geolocation,
3428
- da as getAutoLanguageGeocoding,
3337
+ Br as Point,
3338
+ Mo as Popup,
3339
+ er as PopupMLGL,
3340
+ No as RasterDEMTileSource,
3341
+ lr as RasterDEMTileSourceMLGL,
3342
+ Bo as RasterTileSource,
3343
+ nr as RasterTileSourceMLGL,
3344
+ aa as ReferenceMapStyle,
3345
+ Wt as ScaleControl,
3346
+ hr as ScaleControlMLGL,
3347
+ Vo as ScrollZoomHandler,
3348
+ yr as ScrollZoomHandlerMLGL,
3349
+ kt as SdkConfig,
3350
+ na as ServiceError,
3351
+ Po as Style,
3352
+ tr as StyleMLGL,
3353
+ fr as TerrainControMLGL,
3354
+ Go as TerrainControl,
3355
+ Ko as TwoFingersTouchPitchHandler,
3356
+ wr as TwoFingersTouchPitchHandlerMLGL,
3357
+ Vr as TwoFingersTouchRotateHandler,
3358
+ Hr as TwoFingersTouchZoomHandler,
3359
+ Ur as TwoFingersTouchZoomRotateHandler,
3360
+ zo as VectorTileSource,
3361
+ ir as VectorTileSourceMLGL,
3362
+ Do as VideoSource,
3363
+ sr as VideoSourceMLGL,
3364
+ Xr as addProtocol,
3365
+ qr as addSourceType,
3366
+ la as areSameLanguages,
3367
+ ia as bufferToPixelDataBrowser,
3368
+ sa as circumferenceAtLatitude,
3369
+ Fr as clearPrewarmedResources,
3370
+ M as config,
3371
+ Ar as configMLGL,
3372
+ ca as coordinates,
3373
+ ua as data,
3374
+ da as elevation,
3375
+ pa as expandMapStyle,
3376
+ ha as geocoding,
3377
+ ma as geolocation,
3378
+ fa as getAutoLanguage,
3429
3379
  ye as getBrowserLanguage,
3430
- ha as getBufferToPixelDataParser,
3431
- wr as getMapLibreVersion,
3432
- Vr as getMaxParallelImageRequests,
3433
- br as getRTLTextPluginStatus,
3434
- ma as getTileCache,
3435
- Wo as getVersion,
3436
- Hr as getWorkerCount,
3437
- $r as getWorkerUrl,
3380
+ ga as getBufferToPixelDataParser,
3381
+ ya as getLanguageInfoFromCode,
3382
+ va as getLanguageInfoFromFlag,
3383
+ La as getLanguageInfoFromKey,
3384
+ Tr as getMapLibreVersion,
3385
+ Kr as getMaxParallelImageRequests,
3386
+ _r as getRTLTextPluginStatus,
3387
+ wa as getTileCache,
3388
+ Jo as getVersion,
3389
+ $r as getWorkerCount,
3390
+ Wr as getWorkerUrl,
3438
3391
  Ve as gpx,
3439
- so as gpxOrKml,
3440
- Ge as hasChildNodeWithName,
3441
- Zo as helpers,
3442
- Wr as importScriptInWorkers,
3443
- ge as isLanguageSupported,
3444
- je as kml,
3445
- fa as mapStylePresetList,
3446
- ga as math,
3447
- ya as misc,
3448
- xr as prewarm,
3449
- Jr as removeProtocol,
3450
- jr as setMaxParallelImageRequests,
3451
- Sr as setRTLTextPlugin,
3452
- Gr as setWorkerCount,
3453
- Kr as setWorkerUrl,
3454
- va as staticMaps,
3455
- pe as str2xml,
3456
- La as styleToStyle,
3457
- Ee as xml2str
3392
+ co as gpxOrKml,
3393
+ He as hasChildNodeWithName,
3394
+ qo as helpers,
3395
+ Jr as importScriptInWorkers,
3396
+ Ca as isLanguageInfo,
3397
+ $e as kml,
3398
+ ba as mapStylePresetList,
3399
+ Sa as math,
3400
+ Aa as misc,
3401
+ kr as prewarm,
3402
+ Qr as removeProtocol,
3403
+ Zr as setMaxParallelImageRequests,
3404
+ Rr as setRTLTextPlugin,
3405
+ jr as setWorkerCount,
3406
+ Yr as setWorkerUrl,
3407
+ Ta as staticMaps,
3408
+ de as str2xml,
3409
+ Ra as styleToStyle,
3410
+ _a as toLanguageInfo,
3411
+ Re as xml2str
3458
3412
  };
3459
3413
  //# sourceMappingURL=maptiler-sdk.mjs.map