@maptiler/sdk 3.4.0 → 3.4.1-rc1

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.
@@ -3,10 +3,10 @@ var dn = (r) => {
3
3
  throw TypeError(r);
4
4
  };
5
5
  var Eo = (r, e, t) => e in r ? Ao(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
6
- var S = (r, e, t) => Eo(r, typeof e != "symbol" ? e + "" : e, t), Qt = (r, e, t) => e.has(r) || dn("Cannot " + t);
7
- var P = (r, e, t) => (Qt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), be = (r, e, t) => e.has(r) ? dn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), _e = (r, e, t, n) => (Qt(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), H = (r, e, t) => (Qt(r, e, "access private method"), t);
6
+ var S = (r, e, t) => Eo(r, typeof e != "symbol" ? e + "" : e, t), tr = (r, e, t) => e.has(r) || dn("Cannot " + t);
7
+ var P = (r, e, t) => (tr(r, e, "read from private field"), t ? t.call(r) : e.get(r)), be = (r, e, t) => e.has(r) ? dn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), _e = (r, e, t, n) => (tr(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), H = (r, e, t) => (tr(r, e, "access private method"), t);
8
8
  import k from "maplibre-gl";
9
- import { Language as To, getLanguageInfoFromCode as hn, config as er, MapStyle as Je, mapStylePresetList as tr, expandMapStyle as _o, MapStyleVariant as Mo, ReferenceMapStyle as Io, toLanguageInfo as yn, getLanguageInfoFromFlag as Po, geolocation as mn } from "@maptiler/client";
9
+ import { Language as To, getLanguageInfoFromCode as hn, config as rr, MapStyle as Qe, mapStylePresetList as nr, expandMapStyle as _o, MapStyleVariant as Mo, ReferenceMapStyle as Io, toLanguageInfo as yn, getLanguageInfoFromFlag as Po, geolocation as mn } from "@maptiler/client";
10
10
  import { MapStyle as Tp, MapStyleVariant as _p, ReferenceMapStyle as Mp, ServiceError as Ip, areSameLanguages as Pp, bufferToPixelDataBrowser as Rp, circumferenceAtLatitude as zp, coordinates as Fp, data as $p, elevation as Op, expandMapStyle as jp, geocoding as Np, geolocation as Dp, getAutoLanguage as Up, getBufferToPixelDataParser as Bp, getLanguageInfoFromCode as qp, getLanguageInfoFromFlag as Gp, getLanguageInfoFromKey as Vp, getTileCache as Hp, isLanguageInfo as Kp, mapStylePresetList as Xp, math as Wp, misc as Zp, staticMaps as Yp, styleToStyle as Jp, toLanguageInfo as Qp } from "@maptiler/client";
11
11
  import Ro from "events";
12
12
  import { v4 as zo } from "uuid";
@@ -149,7 +149,7 @@ class $o extends Ro {
149
149
  * Set the MapTiler Cloud API key
150
150
  */
151
151
  set apiKey(t) {
152
- this._apiKey = t, er.apiKey = t, this.emit("apiKey", t);
152
+ this._apiKey = t, rr.apiKey = t, this.emit("apiKey", t);
153
153
  }
154
154
  /**
155
155
  * Get the MapTiler Cloud API key
@@ -161,28 +161,28 @@ class $o extends Ro {
161
161
  * Set a the custom fetch function to replace the default one
162
162
  */
163
163
  set fetch(t) {
164
- er.fetch = t;
164
+ rr.fetch = t;
165
165
  }
166
166
  /**
167
167
  * Get the fetch fucntion
168
168
  */
169
169
  get fetch() {
170
- return er.fetch;
170
+ return rr.fetch;
171
171
  }
172
172
  }
173
- const D = new $o(), wr = "localcache_source", Sr = "localcache", Oo = "maptiler_sdk", jo = 1e3, No = 100, xr = typeof caches < "u", { addProtocol: vn } = k;
173
+ const D = new $o(), xr = "localcache_source", kr = "localcache", Oo = "maptiler_sdk", jo = 1e3, No = 100, Cr = typeof caches < "u", { addProtocol: vn } = k;
174
174
  function Do(r, e) {
175
- if (xr && D.caching && D.session && r.host === V.maptilerApiHost) {
175
+ if (Cr && D.caching && D.session && r.host === V.maptilerApiHost) {
176
176
  if (e === "Source" && r.href.includes("tiles.json"))
177
- return r.href.replace("https://", `${wr}://`);
177
+ return r.href.replace("https://", `${xr}://`);
178
178
  if (e === "Tile" || e === "Glyphs")
179
- return r.href.replace("https://", `${Sr}://`);
179
+ return r.href.replace("https://", `${kr}://`);
180
180
  }
181
181
  return r.href;
182
182
  }
183
- let rr;
183
+ let ar;
184
184
  async function fa() {
185
- return rr || (rr = await caches.open(Oo)), rr;
185
+ return ar || (ar = await caches.open(Oo)), ar;
186
186
  }
187
187
  let bn = 0;
188
188
  async function Uo() {
@@ -192,10 +192,10 @@ async function Uo() {
192
192
  }
193
193
  function Bo() {
194
194
  vn(
195
- wr,
195
+ xr,
196
196
  async (r, e) => {
197
197
  if (!r.url) throw new Error("");
198
- r.url = r.url.replace(`${wr}://`, "https://");
198
+ r.url = r.url.replace(`${xr}://`, "https://");
199
199
  const t = r;
200
200
  t.signal = e.signal;
201
201
  const n = await fetch(r.url, t), a = await n.json();
@@ -205,9 +205,9 @@ function Bo() {
205
205
  expires: n.headers.get("Expires")
206
206
  };
207
207
  }
208
- ), vn(Sr, async (r, e) => {
208
+ ), vn(kr, async (r, e) => {
209
209
  if (!r.url) throw new Error("");
210
- r.url = r.url.replace(`${Sr}://`, "https://");
210
+ r.url = r.url.replace(`${kr}://`, "https://");
211
211
  const t = new URL(r.url), n = new URL(t);
212
212
  n.searchParams.delete("mtsid"), n.searchParams.delete("key");
213
213
  const a = n.toString(), o = new URL(t);
@@ -267,7 +267,7 @@ function Sn(r) {
267
267
  function da() {
268
268
  return Math.random().toString(36).substring(2);
269
269
  }
270
- function Ft(r) {
270
+ function Ot(r) {
271
271
  return /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(r);
272
272
  }
273
273
  function Vo(r) {
@@ -3577,7 +3577,7 @@ class g {
3577
3577
  this.message = (e ? `${e}: ` : "") + n, a && (this.identifier = a), t != null && t.__line__ && (this.line = t.__line__);
3578
3578
  }
3579
3579
  }
3580
- function At(r, ...e) {
3580
+ function Tt(r, ...e) {
3581
3581
  for (const t of e)
3582
3582
  for (const n in t)
3583
3583
  r[n] = t[n];
@@ -3608,7 +3608,7 @@ class Dr {
3608
3608
  return this.bindings[e] ? !0 : this.parent ? this.parent.has(e) : !1;
3609
3609
  }
3610
3610
  }
3611
- const $t = { kind: "null" }, b = { kind: "number" }, M = { kind: "string" }, _ = { kind: "boolean" }, de = { kind: "color" }, Ot = { kind: "projectionDefinition" }, Re = { kind: "object" }, T = { kind: "value" }, Ki = { kind: "error" }, jt = { kind: "collator" }, Nt = { kind: "formatted" }, Dt = { kind: "padding" }, rt = { kind: "colorArray" }, Ut = { kind: "numberArray" }, pt = { kind: "resolvedImage" }, Bt = { kind: "variableAnchorOffsetCollection" };
3611
+ const jt = { kind: "null" }, b = { kind: "number" }, M = { kind: "string" }, _ = { kind: "boolean" }, de = { kind: "color" }, Nt = { kind: "projectionDefinition" }, Re = { kind: "object" }, T = { kind: "value" }, Ki = { kind: "error" }, Dt = { kind: "collator" }, Ut = { kind: "formatted" }, Bt = { kind: "padding" }, nt = { kind: "colorArray" }, qt = { kind: "numberArray" }, ft = { kind: "resolvedImage" }, Gt = { kind: "variableAnchorOffsetCollection" };
3612
3612
  function Z(r, e) {
3613
3613
  return {
3614
3614
  kind: "array",
@@ -3624,33 +3624,33 @@ function j(r) {
3624
3624
  return r.kind;
3625
3625
  }
3626
3626
  const Xi = [
3627
- $t,
3627
+ jt,
3628
3628
  b,
3629
3629
  M,
3630
3630
  _,
3631
3631
  de,
3632
- Ot,
3633
3632
  Nt,
3633
+ Ut,
3634
3634
  Re,
3635
3635
  Z(T),
3636
- Dt,
3637
- Ut,
3638
- rt,
3639
- pt,
3640
- Bt
3636
+ Bt,
3637
+ qt,
3638
+ nt,
3639
+ ft,
3640
+ Gt
3641
3641
  ];
3642
- function nt(r, e) {
3642
+ function at(r, e) {
3643
3643
  if (e.kind === "error")
3644
3644
  return null;
3645
3645
  if (r.kind === "array") {
3646
- if (e.kind === "array" && (e.N === 0 && e.itemType.kind === "value" || !nt(r.itemType, e.itemType)) && (typeof r.N != "number" || r.N === e.N))
3646
+ if (e.kind === "array" && (e.N === 0 && e.itemType.kind === "value" || !at(r.itemType, e.itemType)) && (typeof r.N != "number" || r.N === e.N))
3647
3647
  return null;
3648
3648
  } else {
3649
3649
  if (r.kind === e.kind)
3650
3650
  return null;
3651
3651
  if (r.kind === "value") {
3652
3652
  for (const t of Xi)
3653
- if (!nt(t, e))
3653
+ if (!at(t, e))
3654
3654
  return null;
3655
3655
  }
3656
3656
  }
@@ -3670,33 +3670,33 @@ function ba(r) {
3670
3670
  return r = r % 360, r < 0 && (r += 360), r;
3671
3671
  }
3672
3672
  function wa([r, e, t, n]) {
3673
- r = nr(r), e = nr(e), t = nr(t);
3673
+ r = or(r), e = or(e), t = or(t);
3674
3674
  let a, o;
3675
- const i = ar((0.2225045 * r + 0.7168786 * e + 0.0606169 * t) / ya);
3676
- r === e && e === t ? a = o = i : (a = ar((0.4360747 * r + 0.3850649 * e + 0.1430804 * t) / ha), o = ar((0.0139322 * r + 0.0971045 * e + 0.7141733 * t) / ma));
3675
+ const i = ir((0.2225045 * r + 0.7168786 * e + 0.0606169 * t) / ya);
3676
+ r === e && e === t ? a = o = i : (a = ir((0.4360747 * r + 0.3850649 * e + 0.1430804 * t) / ha), o = ir((0.0139322 * r + 0.0971045 * e + 0.7141733 * t) / ma));
3677
3677
  const s = 116 * i - 16;
3678
3678
  return [s < 0 ? 0 : s, 500 * (a - i), 200 * (i - o), n];
3679
3679
  }
3680
- function nr(r) {
3680
+ function or(r) {
3681
3681
  return r <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
3682
3682
  }
3683
- function ar(r) {
3683
+ function ir(r) {
3684
3684
  return r > Wi ? Math.pow(r, 1 / 3) : r / va + ga;
3685
3685
  }
3686
3686
  function Sa([r, e, t, n]) {
3687
3687
  let a = (r + 16) / 116, o = isNaN(e) ? a : a + e / 500, i = isNaN(t) ? a : a - t / 200;
3688
- return a = ya * ir(a), o = ha * ir(o), i = ma * ir(i), [
3689
- or(3.1338561 * o - 1.6168667 * a - 0.4906146 * i),
3688
+ return a = ya * lr(a), o = ha * lr(o), i = ma * lr(i), [
3689
+ sr(3.1338561 * o - 1.6168667 * a - 0.4906146 * i),
3690
3690
  // D50 -> sRGB
3691
- or(-0.9787684 * o + 1.9161415 * a + 0.033454 * i),
3692
- or(0.0719453 * o - 0.2289914 * a + 1.4052427 * i),
3691
+ sr(-0.9787684 * o + 1.9161415 * a + 0.033454 * i),
3692
+ sr(0.0719453 * o - 0.2289914 * a + 1.4052427 * i),
3693
3693
  n
3694
3694
  ];
3695
3695
  }
3696
- function or(r) {
3696
+ function sr(r) {
3697
3697
  return r = r <= 304e-5 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - 0.055, r < 0 ? 0 : r > 1 ? 1 : r;
3698
3698
  }
3699
- function ir(r) {
3699
+ function lr(r) {
3700
3700
  return r > qe ? r * r * r : va * (r - ga);
3701
3701
  }
3702
3702
  function Ji(r) {
@@ -3717,13 +3717,13 @@ function es([r, e, t, n]) {
3717
3717
  const ts = Object.hasOwn || function(e, t) {
3718
3718
  return Object.prototype.hasOwnProperty.call(e, t);
3719
3719
  };
3720
- function Qe(r, e) {
3720
+ function et(r, e) {
3721
3721
  return ts(r, e) ? r[e] : void 0;
3722
3722
  }
3723
3723
  function rs(r) {
3724
3724
  if (r = r.toLowerCase().trim(), r === "transparent")
3725
3725
  return [0, 0, 0, 0];
3726
- const e = Qe(ns, r);
3726
+ const e = et(ns, r);
3727
3727
  if (e) {
3728
3728
  const [a, o, i] = e;
3729
3729
  return [a / 255, o / 255, i / 255, 1];
@@ -3732,10 +3732,10 @@ function rs(r) {
3732
3732
  const o = r.length < 6 ? 1 : 2;
3733
3733
  let i = 1;
3734
3734
  return [
3735
- vt(r.slice(i, i += o)),
3736
- vt(r.slice(i, i += o)),
3737
- vt(r.slice(i, i += o)),
3738
- vt(r.slice(i, i + o) || "ff")
3735
+ bt(r.slice(i, i += o)),
3736
+ bt(r.slice(i, i += o)),
3737
+ bt(r.slice(i, i += o)),
3738
+ bt(r.slice(i, i + o) || "ff")
3739
3739
  ];
3740
3740
  }
3741
3741
  if (r.startsWith("rgb")) {
@@ -3817,7 +3817,7 @@ function rs(r) {
3817
3817
  }
3818
3818
  }
3819
3819
  }
3820
- function vt(r) {
3820
+ function bt(r) {
3821
3821
  return parseInt(r.padEnd(2, r), 16) / 255;
3822
3822
  }
3823
3823
  function Cn(r, e) {
@@ -3982,7 +3982,7 @@ const ns = {
3982
3982
  function Le(r, e, t) {
3983
3983
  return r + t * (e - r);
3984
3984
  }
3985
- function Ge(r, e, t) {
3985
+ function Ve(r, e, t) {
3986
3986
  return r.map((n, a) => Le(n, e[a], t));
3987
3987
  }
3988
3988
  class F {
@@ -4084,7 +4084,7 @@ class F {
4084
4084
  static interpolate(e, t, n, a = "rgb") {
4085
4085
  switch (a) {
4086
4086
  case "rgb": {
4087
- const [o, i, s, l] = Ge(e.rgb, t.rgb, n);
4087
+ const [o, i, s, l] = Ve(e.rgb, t.rgb, n);
4088
4088
  return new F(o, i, s, l, !1);
4089
4089
  }
4090
4090
  case "hcl": {
@@ -4103,7 +4103,7 @@ class F {
4103
4103
  return new F(y, m, w, v, !1);
4104
4104
  }
4105
4105
  case "lab": {
4106
- const [o, i, s, l] = Sa(Ge(e.lab, t.lab, n));
4106
+ const [o, i, s, l] = Sa(Ve(e.lab, t.lab, n));
4107
4107
  return new F(o, i, s, l, !1);
4108
4108
  }
4109
4109
  }
@@ -4125,7 +4125,7 @@ class Br {
4125
4125
  }
4126
4126
  }
4127
4127
  const as = ["bottom", "center", "top"];
4128
- class kr {
4128
+ class Lr {
4129
4129
  constructor(e, t, n, a, o, i) {
4130
4130
  this.text = e, this.image = t, this.scale = n, this.fontStack = a, this.textColor = o, this.verticalAlign = i;
4131
4131
  }
@@ -4135,7 +4135,7 @@ class me {
4135
4135
  this.sections = e;
4136
4136
  }
4137
4137
  static fromString(e) {
4138
- return new me([new kr(e, null, null, null, null, null)]);
4138
+ return new me([new Lr(e, null, null, null, null, null)]);
4139
4139
  }
4140
4140
  isEmpty() {
4141
4141
  return this.sections.length === 0 ? !0 : !this.sections.some((e) => e.text.length !== 0 || e.image && e.image.name.length !== 0);
@@ -4183,7 +4183,7 @@ class Q {
4183
4183
  return JSON.stringify(this.values);
4184
4184
  }
4185
4185
  static interpolate(e, t, n) {
4186
- return new Q(Ge(e.values, t.values, n));
4186
+ return new Q(Ve(e.values, t.values, n));
4187
4187
  }
4188
4188
  }
4189
4189
  class ee {
@@ -4211,7 +4211,7 @@ class ee {
4211
4211
  return JSON.stringify(this.values);
4212
4212
  }
4213
4213
  static interpolate(e, t, n) {
4214
- return new ee(Ge(e.values, t.values, n));
4214
+ return new ee(Ve(e.values, t.values, n));
4215
4215
  }
4216
4216
  }
4217
4217
  class X {
@@ -4330,17 +4330,17 @@ class ie {
4330
4330
  function xa(r, e, t, n) {
4331
4331
  return typeof r == "number" && r >= 0 && r <= 255 && typeof e == "number" && e >= 0 && e <= 255 && typeof t == "number" && t >= 0 && t <= 255 ? typeof n > "u" || typeof n == "number" && n >= 0 && n <= 1 ? null : `Invalid rgba value [${[r, e, t, n].join(", ")}]: 'a' must be between 0 and 1.` : `Invalid rgba value [${(typeof n == "number" ? [r, e, t, n] : [r, e, t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`;
4332
4332
  }
4333
- function at(r) {
4333
+ function ot(r) {
4334
4334
  if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof ie || r instanceof F || r instanceof Br || r instanceof me || r instanceof Q || r instanceof ee || r instanceof X || r instanceof ue || r instanceof Ee)
4335
4335
  return !0;
4336
4336
  if (Array.isArray(r)) {
4337
4337
  for (const e of r)
4338
- if (!at(e))
4338
+ if (!ot(e))
4339
4339
  return !1;
4340
4340
  return !0;
4341
4341
  } else if (typeof r == "object") {
4342
4342
  for (const e in r)
4343
- if (!at(r[e]))
4343
+ if (!ot(r[e]))
4344
4344
  return !1;
4345
4345
  return !0;
4346
4346
  } else
@@ -4348,7 +4348,7 @@ function at(r) {
4348
4348
  }
4349
4349
  function B(r) {
4350
4350
  if (r === null)
4351
- return $t;
4351
+ return jt;
4352
4352
  if (typeof r == "string")
4353
4353
  return M;
4354
4354
  if (typeof r == "boolean")
@@ -4358,21 +4358,21 @@ function B(r) {
4358
4358
  if (r instanceof F)
4359
4359
  return de;
4360
4360
  if (r instanceof ie)
4361
- return Ot;
4361
+ return Nt;
4362
4362
  if (r instanceof Br)
4363
- return jt;
4363
+ return Dt;
4364
4364
  if (r instanceof me)
4365
- return Nt;
4365
+ return Ut;
4366
4366
  if (r instanceof Q)
4367
- return Dt;
4367
+ return Bt;
4368
4368
  if (r instanceof ee)
4369
- return Ut;
4369
+ return qt;
4370
4370
  if (r instanceof X)
4371
- return rt;
4371
+ return nt;
4372
4372
  if (r instanceof ue)
4373
- return Bt;
4373
+ return Gt;
4374
4374
  if (r instanceof Ee)
4375
- return pt;
4375
+ return ft;
4376
4376
  if (Array.isArray(r)) {
4377
4377
  const e = r.length;
4378
4378
  let t;
@@ -4391,23 +4391,23 @@ function B(r) {
4391
4391
  } else
4392
4392
  return Re;
4393
4393
  }
4394
- function et(r) {
4394
+ function tt(r) {
4395
4395
  const e = typeof r;
4396
4396
  return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof F || r instanceof ie || r instanceof me || r instanceof Q || r instanceof ee || r instanceof X || r instanceof ue || r instanceof Ee ? r.toString() : JSON.stringify(r);
4397
4397
  }
4398
- class Ve {
4398
+ class He {
4399
4399
  constructor(e, t) {
4400
4400
  this.type = e, this.value = t;
4401
4401
  }
4402
4402
  static parse(e, t) {
4403
4403
  if (e.length !== 2)
4404
4404
  return t.error(`'literal' expression requires exactly one argument, but found ${e.length - 1} instead.`);
4405
- if (!at(e[1]))
4405
+ if (!ot(e[1]))
4406
4406
  return t.error("invalid value");
4407
4407
  const n = e[1];
4408
4408
  let a = B(n);
4409
4409
  const o = t.expectedType;
4410
- return a.kind === "array" && a.N === 0 && o && o.kind === "array" && (typeof o.N != "number" || o.N === 0) && (a = o), new Ve(a, n);
4410
+ return a.kind === "array" && a.N === 0 && o && o.kind === "array" && (typeof o.N != "number" || o.N === 0) && (a = o), new He(a, n);
4411
4411
  }
4412
4412
  evaluate() {
4413
4413
  return this.value;
@@ -4418,7 +4418,7 @@ class Ve {
4418
4418
  return !0;
4419
4419
  }
4420
4420
  }
4421
- const bt = {
4421
+ const wt = {
4422
4422
  string: M,
4423
4423
  number: b,
4424
4424
  boolean: _,
@@ -4437,9 +4437,9 @@ class se {
4437
4437
  let s;
4438
4438
  if (e.length > 2) {
4439
4439
  const u = e[1];
4440
- if (typeof u != "string" || !(u in bt) || u === "object")
4440
+ if (typeof u != "string" || !(u in wt) || u === "object")
4441
4441
  return t.error('The item type argument of "array" must be one of string, number, boolean', 1);
4442
- s = bt[u], n++;
4442
+ s = wt[u], n++;
4443
4443
  } else
4444
4444
  s = T;
4445
4445
  let l;
@@ -4450,9 +4450,9 @@ class se {
4450
4450
  }
4451
4451
  a = Z(s, l);
4452
4452
  } else {
4453
- if (!bt[o])
4453
+ if (!wt[o])
4454
4454
  throw new Error(`Types doesn't contain name = ${o}`);
4455
- a = bt[o];
4455
+ a = wt[o];
4456
4456
  }
4457
4457
  const i = [];
4458
4458
  for (; n < e.length; n++) {
@@ -4466,7 +4466,7 @@ class se {
4466
4466
  evaluate(e) {
4467
4467
  for (let t = 0; t < this.args.length; t++) {
4468
4468
  const n = this.args[t].evaluate(e);
4469
- if (nt(this.type, B(n))) {
4469
+ if (at(this.type, B(n))) {
4470
4470
  if (t === this.args.length - 1)
4471
4471
  throw new N(`Expected value to be of type ${j(this.type)}, but found ${j(B(n))} instead.`);
4472
4472
  } else return n;
@@ -4577,13 +4577,13 @@ class ke {
4577
4577
  throw new N(`Could not convert ${JSON.stringify(t)} to number.`);
4578
4578
  }
4579
4579
  case "formatted":
4580
- return me.fromString(et(this.args[0].evaluate(e)));
4580
+ return me.fromString(tt(this.args[0].evaluate(e)));
4581
4581
  case "resolvedImage":
4582
- return Ee.fromString(et(this.args[0].evaluate(e)));
4582
+ return Ee.fromString(tt(this.args[0].evaluate(e)));
4583
4583
  case "projectionDefinition":
4584
4584
  return this.args[0].evaluate(e);
4585
4585
  default:
4586
- return et(this.args[0].evaluate(e));
4586
+ return tt(this.args[0].evaluate(e));
4587
4587
  }
4588
4588
  }
4589
4589
  eachChild(e) {
@@ -4618,7 +4618,7 @@ class ka {
4618
4618
  return t || (t = F.parse(e), this._parseColorCache.set(e, t)), t;
4619
4619
  }
4620
4620
  }
4621
- class qt {
4621
+ class Vt {
4622
4622
  constructor(e, t, n = [], a, o = new Dr(), i = []) {
4623
4623
  this.registry = e, this.path = n, this.key = n.map((s) => `[${s}]`).join(""), this.scope = o, this.errors = i, this.expectedType = a, this._isConstant = t;
4624
4624
  }
@@ -4657,10 +4657,10 @@ class qt {
4657
4657
  else if (this.checkSubtype(s, l))
4658
4658
  return null;
4659
4659
  }
4660
- if (!(i instanceof Ve) && i.type.kind !== "resolvedImage" && this._isConstant(i)) {
4660
+ if (!(i instanceof He) && i.type.kind !== "resolvedImage" && this._isConstant(i)) {
4661
4661
  const s = new ka();
4662
4662
  try {
4663
- i = new Ve(i.type, i.evaluate(s));
4663
+ i = new He(i.type, i.evaluate(s));
4664
4664
  } catch (l) {
4665
4665
  return this.error(l.message), null;
4666
4666
  }
@@ -4680,7 +4680,7 @@ class qt {
4680
4680
  */
4681
4681
  concat(e, t, n) {
4682
4682
  const a = typeof e == "number" ? this.path.concat(e) : this.path, o = n ? this.scope.concat(n) : this.scope;
4683
- return new qt(this.registry, this._isConstant, a, t || null, o, this.errors);
4683
+ return new Vt(this.registry, this._isConstant, a, t || null, o, this.errors);
4684
4684
  }
4685
4685
  /**
4686
4686
  * Push a parsing (or type checking) error into the `this.errors`
@@ -4701,11 +4701,11 @@ class qt {
4701
4701
  * @returns null if `t` is a subtype of `expected`; otherwise returns an error message
4702
4702
  */
4703
4703
  checkSubtype(e, t) {
4704
- const n = nt(e, t);
4704
+ const n = at(e, t);
4705
4705
  return n && this.error(n), n;
4706
4706
  }
4707
4707
  }
4708
- class Gt {
4708
+ class Ht {
4709
4709
  constructor(e, t) {
4710
4710
  this.type = t.type, this.bindings = [].concat(e), this.result = t;
4711
4711
  }
@@ -4733,13 +4733,13 @@ class Gt {
4733
4733
  n.push([i, s]);
4734
4734
  }
4735
4735
  const a = t.parse(e[e.length - 1], e.length - 1, t.expectedType, n);
4736
- return a ? new Gt(n, a) : null;
4736
+ return a ? new Ht(n, a) : null;
4737
4737
  }
4738
4738
  outputDefined() {
4739
4739
  return this.result.outputDefined();
4740
4740
  }
4741
4741
  }
4742
- class Vt {
4742
+ class Kt {
4743
4743
  constructor(e, t) {
4744
4744
  this.type = t.type, this.name = e, this.boundExpression = t;
4745
4745
  }
@@ -4747,7 +4747,7 @@ class Vt {
4747
4747
  if (e.length !== 2 || typeof e[1] != "string")
4748
4748
  return t.error("'var' expression requires exactly one string literal argument.");
4749
4749
  const n = e[1];
4750
- return t.scope.has(n) ? new Vt(n, t.scope.get(n)) : t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`, 1);
4750
+ return t.scope.has(n) ? new Kt(n, t.scope.get(n)) : t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`, 1);
4751
4751
  }
4752
4752
  evaluate(e) {
4753
4753
  return this.boundExpression.evaluate(e);
@@ -4796,7 +4796,7 @@ class Gr {
4796
4796
  if (e.length !== 3)
4797
4797
  return t.error(`Expected 2 arguments, but found ${e.length - 1} instead.`);
4798
4798
  const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, T);
4799
- return !n || !a ? null : Ur(n.type, [_, M, b, $t, T]) ? new Gr(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
4799
+ return !n || !a ? null : Ur(n.type, [_, M, b, jt, T]) ? new Gr(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
4800
4800
  }
4801
4801
  evaluate(e) {
4802
4802
  const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
@@ -4815,7 +4815,7 @@ class Gr {
4815
4815
  return !0;
4816
4816
  }
4817
4817
  }
4818
- class Et {
4818
+ class _t {
4819
4819
  constructor(e, t, n) {
4820
4820
  this.type = b, this.needle = e, this.haystack = t, this.fromIndex = n;
4821
4821
  }
@@ -4825,13 +4825,13 @@ class Et {
4825
4825
  const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, T);
4826
4826
  if (!n || !a)
4827
4827
  return null;
4828
- if (!Ur(n.type, [_, M, b, $t, T]))
4828
+ if (!Ur(n.type, [_, M, b, jt, T]))
4829
4829
  return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
4830
4830
  if (e.length === 4) {
4831
4831
  const o = t.parse(e[3], 3, b);
4832
- return o ? new Et(n, a, o) : null;
4832
+ return o ? new _t(n, a, o) : null;
4833
4833
  } else
4834
- return new Et(n, a);
4834
+ return new _t(n, a);
4835
4835
  }
4836
4836
  evaluate(e) {
4837
4837
  const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
@@ -4953,7 +4953,7 @@ class Hr {
4953
4953
  return this.branches.every(([e, t]) => t.outputDefined()) && this.otherwise.outputDefined();
4954
4954
  }
4955
4955
  }
4956
- class Tt {
4956
+ class Mt {
4957
4957
  constructor(e, t, n, a) {
4958
4958
  this.type = e, this.input = t, this.beginIndex = n, this.endIndex = a;
4959
4959
  }
@@ -4967,9 +4967,9 @@ class Tt {
4967
4967
  return t.error(`Expected first argument to be of type array or string, but found ${j(n.type)} instead`);
4968
4968
  if (e.length === 4) {
4969
4969
  const o = t.parse(e[3], 3, b);
4970
- return o ? new Tt(n.type, n, a, o) : null;
4970
+ return o ? new Mt(n.type, n, a, o) : null;
4971
4971
  } else
4972
- return new Tt(n.type, n, a);
4972
+ return new Mt(n.type, n, a);
4973
4973
  }
4974
4974
  evaluate(e) {
4975
4975
  const t = this.input.evaluate(e), n = this.beginIndex.evaluate(e);
@@ -5001,7 +5001,7 @@ function Ca(r, e) {
5001
5001
  throw new N("Input is not a number.");
5002
5002
  return 0;
5003
5003
  }
5004
- class Ht {
5004
+ class Xt {
5005
5005
  constructor(e, t, n) {
5006
5006
  this.type = e, this.input = t, this.labels = [], this.outputs = [];
5007
5007
  for (const [a, o] of n)
@@ -5029,7 +5029,7 @@ class Ht {
5029
5029
  return null;
5030
5030
  o = o || p.type, a.push([s, p]);
5031
5031
  }
5032
- return new Ht(o, n, a);
5032
+ return new Xt(o, n, a);
5033
5033
  }
5034
5034
  evaluate(e) {
5035
5035
  const t = this.labels, n = this.outputs;
@@ -5056,10 +5056,10 @@ class Ht {
5056
5056
  function ss(r) {
5057
5057
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
5058
5058
  }
5059
- var sr, En;
5059
+ var ur, En;
5060
5060
  function ls() {
5061
- if (En) return sr;
5062
- En = 1, sr = r;
5061
+ if (En) return ur;
5062
+ En = 1, ur = r;
5063
5063
  function r(e, t, n, a) {
5064
5064
  this.cx = 3 * e, this.bx = 3 * (n - e) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * t, this.by = 3 * (a - t) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = e, this.p1y = t, this.p2x = n, this.p2y = a;
5065
5065
  }
@@ -5091,7 +5091,7 @@ function ls() {
5091
5091
  solve: function(e, t) {
5092
5092
  return this.sampleCurveY(this.solveCurveX(e, t));
5093
5093
  }
5094
- }, sr;
5094
+ }, ur;
5095
5095
  }
5096
5096
  var us = ls(), cs = /* @__PURE__ */ ss(us);
5097
5097
  class he {
@@ -5103,12 +5103,12 @@ class he {
5103
5103
  static interpolationFactor(e, t, n, a) {
5104
5104
  let o = 0;
5105
5105
  if (e.name === "exponential")
5106
- o = lr(t, e.base, n, a);
5106
+ o = cr(t, e.base, n, a);
5107
5107
  else if (e.name === "linear")
5108
- o = lr(t, 1, n, a);
5108
+ o = cr(t, 1, n, a);
5109
5109
  else if (e.name === "cubic-bezier") {
5110
5110
  const i = e.controlPoints;
5111
- o = new cs(i[0], i[1], i[2], i[3]).solve(lr(t, 1, n, a));
5111
+ o = new cs(i[0], i[1], i[2], i[3]).solve(cr(t, 1, n, a));
5112
5112
  }
5113
5113
  return o;
5114
5114
  }
@@ -5144,7 +5144,7 @@ class he {
5144
5144
  return null;
5145
5145
  const s = [];
5146
5146
  let l = null;
5147
- (n === "interpolate-hcl" || n === "interpolate-lab") && t.expectedType != rt ? l = de : t.expectedType && t.expectedType.kind !== "value" && (l = t.expectedType);
5147
+ (n === "interpolate-hcl" || n === "interpolate-lab") && t.expectedType != nt ? l = de : t.expectedType && t.expectedType.kind !== "value" && (l = t.expectedType);
5148
5148
  for (let u = 0; u < i.length; u += 2) {
5149
5149
  const c = i[u], p = i[u + 1], f = u + 3, d = u + 4;
5150
5150
  if (typeof c != "number")
@@ -5156,7 +5156,7 @@ class he {
5156
5156
  return null;
5157
5157
  l = l || h.type, s.push([c, h]);
5158
5158
  }
5159
- return !we(l, b) && !we(l, Ot) && !we(l, de) && !we(l, Dt) && !we(l, Ut) && !we(l, rt) && !we(l, Bt) && !we(l, Z(b)) ? t.error(`Type ${j(l)} is not interpolatable.`) : new he(l, n, a, o, s);
5159
+ return !we(l, b) && !we(l, Nt) && !we(l, de) && !we(l, Bt) && !we(l, qt) && !we(l, nt) && !we(l, Gt) && !we(l, Z(b)) ? t.error(`Type ${j(l)} is not interpolatable.`) : new he(l, n, a, o, s);
5160
5160
  }
5161
5161
  evaluate(e) {
5162
5162
  const t = this.labels, n = this.outputs;
@@ -5185,7 +5185,7 @@ class he {
5185
5185
  case "variableAnchorOffsetCollection":
5186
5186
  return ue.interpolate(c, p, u);
5187
5187
  case "array":
5188
- return Ge(c, p, u);
5188
+ return Ve(c, p, u);
5189
5189
  case "projectionDefinition":
5190
5190
  return ie.interpolate(c, p, u);
5191
5191
  }
@@ -5214,12 +5214,12 @@ class he {
5214
5214
  return this.outputs.every((e) => e.outputDefined());
5215
5215
  }
5216
5216
  }
5217
- function lr(r, e, t, n) {
5217
+ function cr(r, e, t, n) {
5218
5218
  const a = n - t, o = r - t;
5219
5219
  return a === 0 ? 0 : e === 1 ? o / a : (Math.pow(e, o) - 1) / (Math.pow(e, a) - 1);
5220
5220
  }
5221
5221
  F.interpolate, Q.interpolate, ee.interpolate, X.interpolate, ue.interpolate;
5222
- class ot {
5222
+ class it {
5223
5223
  constructor(e, t) {
5224
5224
  this.type = e, this.args = t;
5225
5225
  }
@@ -5238,7 +5238,7 @@ class ot {
5238
5238
  }
5239
5239
  if (!n)
5240
5240
  throw new Error("No output type");
5241
- return a && o.some((s) => nt(a, s.type)) ? new ot(T, o) : new ot(n, o);
5241
+ return a && o.some((s) => at(a, s.type)) ? new it(T, o) : new it(n, o);
5242
5242
  }
5243
5243
  evaluate(e) {
5244
5244
  let t = null, n = 0, a;
@@ -5293,7 +5293,7 @@ function ws(r, e, t, n) {
5293
5293
  function Ss(r, e, t, n) {
5294
5294
  return n.compare(e, t) >= 0;
5295
5295
  }
5296
- function Ke(r, e, t) {
5296
+ function Xe(r, e, t) {
5297
5297
  const n = r !== "==" && r !== "!=";
5298
5298
  return class Aa {
5299
5299
  constructor(o, i, s) {
@@ -5320,7 +5320,7 @@ function Ke(r, e, t) {
5320
5320
  if (o.length === 4) {
5321
5321
  if (l.type.kind !== "string" && u.type.kind !== "string" && l.type.kind !== "value" && u.type.kind !== "value")
5322
5322
  return i.error("Cannot use collator to compare non-string types.");
5323
- if (c = i.parse(o[3], 3, jt), !c)
5323
+ if (c = i.parse(o[3], 3, Dt), !c)
5324
5324
  return null;
5325
5325
  }
5326
5326
  return new Aa(l, u, c);
@@ -5347,10 +5347,10 @@ function Ke(r, e, t) {
5347
5347
  }
5348
5348
  };
5349
5349
  }
5350
- const xs = Ke("==", ps, La), ks = Ke("!=", fs, gs), Cs = Ke("<", ds, vs), Ls = Ke(">", hs, bs), As = Ke("<=", ys, ws), Es = Ke(">=", ms, Ss);
5351
- class Kt {
5350
+ const xs = Xe("==", ps, La), ks = Xe("!=", fs, gs), Cs = Xe("<", ds, vs), Ls = Xe(">", hs, bs), As = Xe("<=", ys, ws), Es = Xe(">=", ms, Ss);
5351
+ class Wt {
5352
5352
  constructor(e, t, n) {
5353
- this.type = jt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;
5353
+ this.type = Dt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;
5354
5354
  }
5355
5355
  static parse(e, t) {
5356
5356
  if (e.length !== 2)
@@ -5365,7 +5365,7 @@ class Kt {
5365
5365
  if (!o)
5366
5366
  return null;
5367
5367
  let i = null;
5368
- return n.locale && (i = t.parse(n.locale, 1, M), !i) ? null : new Kt(a, o, i);
5368
+ return n.locale && (i = t.parse(n.locale, 1, M), !i) ? null : new Wt(a, o, i);
5369
5369
  }
5370
5370
  evaluate(e) {
5371
5371
  return new Br(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
@@ -5419,7 +5419,7 @@ class Kr {
5419
5419
  }
5420
5420
  class Xr {
5421
5421
  constructor(e) {
5422
- this.type = Nt, this.sections = e;
5422
+ this.type = Ut, this.sections = e;
5423
5423
  }
5424
5424
  static parse(e, t) {
5425
5425
  if (e.length < 2)
@@ -5466,7 +5466,7 @@ class Xr {
5466
5466
  evaluate(e) {
5467
5467
  const t = (n) => {
5468
5468
  const a = n.content.evaluate(e);
5469
- return B(a) === pt ? new kr("", a, null, null, null, n.verticalAlign ? n.verticalAlign.evaluate(e) : null) : new kr(et(a), null, n.scale ? n.scale.evaluate(e) : null, n.font ? n.font.evaluate(e).join(",") : null, n.textColor ? n.textColor.evaluate(e) : null, n.verticalAlign ? n.verticalAlign.evaluate(e) : null);
5469
+ return B(a) === ft ? new Lr("", a, null, null, null, n.verticalAlign ? n.verticalAlign.evaluate(e) : null) : new Lr(tt(a), null, n.scale ? n.scale.evaluate(e) : null, n.font ? n.font.evaluate(e).join(",") : null, n.textColor ? n.textColor.evaluate(e) : null, n.verticalAlign ? n.verticalAlign.evaluate(e) : null);
5470
5470
  };
5471
5471
  return new me(this.sections.map(t));
5472
5472
  }
@@ -5480,7 +5480,7 @@ class Xr {
5480
5480
  }
5481
5481
  class Wr {
5482
5482
  constructor(e) {
5483
- this.type = pt, this.input = e;
5483
+ this.type = ft, this.input = e;
5484
5484
  }
5485
5485
  static parse(e, t) {
5486
5486
  if (e.length !== 2)
@@ -5545,10 +5545,10 @@ function Is(r) {
5545
5545
  function Ps(r) {
5546
5546
  return 360 / Math.PI * Math.atan(Math.exp((180 - r * 360) * Math.PI / 180)) - 90;
5547
5547
  }
5548
- function ft(r, e) {
5548
+ function dt(r, e) {
5549
5549
  r[0] = Math.min(r[0], e[0]), r[1] = Math.min(r[1], e[1]), r[2] = Math.max(r[2], e[0]), r[3] = Math.max(r[3], e[1]);
5550
5550
  }
5551
- function it(r, e) {
5551
+ function st(r, e) {
5552
5552
  return !(r[0] <= e[0] || r[2] >= e[2] || r[1] <= e[1] || r[3] >= e[3]);
5553
5553
  }
5554
5554
  function Rs(r, e, t) {
@@ -5558,18 +5558,18 @@ function zs(r, e, t) {
5558
5558
  const n = r[0] - e[0], a = r[1] - e[1], o = r[0] - t[0], i = r[1] - t[1];
5559
5559
  return n * i - o * a === 0 && n * o <= 0 && a * i <= 0;
5560
5560
  }
5561
- function Xt(r, e, t, n) {
5561
+ function Zt(r, e, t, n) {
5562
5562
  const a = [e[0] - r[0], e[1] - r[1]], o = [n[0] - t[0], n[1] - t[1]];
5563
5563
  return js(o, a) === 0 ? !1 : !!(_n(r, e, t, n) && _n(t, n, r, e));
5564
5564
  }
5565
5565
  function Fs(r, e, t) {
5566
5566
  for (const n of t)
5567
5567
  for (let a = 0; a < n.length - 1; ++a)
5568
- if (Xt(r, e, n[a], n[a + 1]))
5568
+ if (Zt(r, e, n[a], n[a + 1]))
5569
5569
  return !0;
5570
5570
  return !1;
5571
5571
  }
5572
- function Xe(r, e, t = !1) {
5572
+ function We(r, e, t = !1) {
5573
5573
  let n = !1;
5574
5574
  for (const a of e)
5575
5575
  for (let o = 0; o < a.length - 1; o++) {
@@ -5581,13 +5581,13 @@ function Xe(r, e, t = !1) {
5581
5581
  }
5582
5582
  function $s(r, e) {
5583
5583
  for (const t of e)
5584
- if (Xe(r, t))
5584
+ if (We(r, t))
5585
5585
  return !0;
5586
5586
  return !1;
5587
5587
  }
5588
5588
  function Ea(r, e) {
5589
5589
  for (const t of r)
5590
- if (!Xe(t, e))
5590
+ if (!We(t, e))
5591
5591
  return !1;
5592
5592
  for (let t = 0; t < r.length - 1; ++t)
5593
5593
  if (Fs(r[t], r[t + 1], e))
@@ -5613,7 +5613,7 @@ function Jr(r, e, t) {
5613
5613
  const o = [];
5614
5614
  for (let i = 0; i < r[a].length; i++) {
5615
5615
  const s = Ts(r[a][i], t);
5616
- ft(e, s), o.push(s);
5616
+ dt(e, s), o.push(s);
5617
5617
  }
5618
5618
  n.push(o);
5619
5619
  }
@@ -5633,7 +5633,7 @@ function _a(r, e, t, n) {
5633
5633
  let o = r[0] - t[0] > a ? -n : t[0] - r[0] > a ? n : 0;
5634
5634
  o === 0 && (o = r[0] - t[2] > a ? -n : t[2] - r[0] > a ? n : 0), r[0] += o;
5635
5635
  }
5636
- ft(e, r);
5636
+ dt(e, r);
5637
5637
  }
5638
5638
  function Ns(r) {
5639
5639
  r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
@@ -5653,7 +5653,7 @@ function In(r, e, t, n) {
5653
5653
  const l = [];
5654
5654
  for (const u of s) {
5655
5655
  const c = [u.x + o[0], u.y + o[1]];
5656
- ft(e, c), l.push(c);
5656
+ dt(e, c), l.push(c);
5657
5657
  }
5658
5658
  i.push(l);
5659
5659
  }
@@ -5669,15 +5669,15 @@ function Ds(r, e) {
5669
5669
  const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
5670
5670
  if (e.type === "Polygon") {
5671
5671
  const o = Jr(e.coordinates, n, a), i = Mn(r.geometry(), t, n, a);
5672
- if (!it(t, n))
5672
+ if (!st(t, n))
5673
5673
  return !1;
5674
5674
  for (const s of i)
5675
- if (!Xe(s, o))
5675
+ if (!We(s, o))
5676
5676
  return !1;
5677
5677
  }
5678
5678
  if (e.type === "MultiPolygon") {
5679
5679
  const o = Ta(e.coordinates, n, a), i = Mn(r.geometry(), t, n, a);
5680
- if (!it(t, n))
5680
+ if (!st(t, n))
5681
5681
  return !1;
5682
5682
  for (const s of i)
5683
5683
  if (!$s(s, o))
@@ -5689,7 +5689,7 @@ function Us(r, e) {
5689
5689
  const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
5690
5690
  if (e.type === "Polygon") {
5691
5691
  const o = Jr(e.coordinates, n, a), i = In(r.geometry(), t, n, a);
5692
- if (!it(t, n))
5692
+ if (!st(t, n))
5693
5693
  return !1;
5694
5694
  for (const s of i)
5695
5695
  if (!Ea(s, o))
@@ -5697,7 +5697,7 @@ function Us(r, e) {
5697
5697
  }
5698
5698
  if (e.type === "MultiPolygon") {
5699
5699
  const o = Ta(e.coordinates, n, a), i = In(r.geometry(), t, n, a);
5700
- if (!it(t, n))
5700
+ if (!st(t, n))
5701
5701
  return !1;
5702
5702
  for (const s of i)
5703
5703
  if (!Os(s, o))
@@ -5712,7 +5712,7 @@ class Fe {
5712
5712
  static parse(e, t) {
5713
5713
  if (e.length !== 2)
5714
5714
  return t.error(`'within' expression requires exactly one argument, but found ${e.length - 1} instead.`);
5715
- if (at(e[1])) {
5715
+ if (ot(e[1])) {
5716
5716
  const n = e[1];
5717
5717
  if (n.type === "FeatureCollection") {
5718
5718
  const a = [];
@@ -5858,20 +5858,20 @@ class Qr {
5858
5858
  return e;
5859
5859
  }
5860
5860
  }
5861
- const Cr = 100, Lr = 50;
5861
+ const Ar = 100, Er = 50;
5862
5862
  function Ia(r, e) {
5863
5863
  return e[0] - r[0];
5864
5864
  }
5865
- function _t(r) {
5865
+ function It(r) {
5866
5866
  return r[1] - r[0] + 1;
5867
5867
  }
5868
5868
  function ve(r, e) {
5869
5869
  return r[1] >= r[0] && r[1] < e;
5870
5870
  }
5871
- function Ar(r, e) {
5871
+ function Tr(r, e) {
5872
5872
  if (r[0] > r[1])
5873
5873
  return [null, null];
5874
- const t = _t(r);
5874
+ const t = It(r);
5875
5875
  if (e) {
5876
5876
  if (t === 2)
5877
5877
  return [r, null];
@@ -5889,19 +5889,19 @@ function Ar(r, e) {
5889
5889
  [r[0] + n + 1, r[1]]
5890
5890
  ];
5891
5891
  }
5892
- function Er(r, e) {
5892
+ function _r(r, e) {
5893
5893
  if (!ve(e, r.length))
5894
5894
  return [1 / 0, 1 / 0, -1 / 0, -1 / 0];
5895
5895
  const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
5896
5896
  for (let n = e[0]; n <= e[1]; ++n)
5897
- ft(t, r[n]);
5897
+ dt(t, r[n]);
5898
5898
  return t;
5899
5899
  }
5900
- function Tr(r) {
5900
+ function Mr(r) {
5901
5901
  const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
5902
5902
  for (const t of r)
5903
5903
  for (const n of t)
5904
- ft(e, n);
5904
+ dt(e, n);
5905
5905
  return e;
5906
5906
  }
5907
5907
  function Fn(r) {
@@ -5929,7 +5929,7 @@ function Vs(r, e, t, n, a) {
5929
5929
  const l = r[s], u = r[s + 1];
5930
5930
  for (let c = n[0]; c < n[1]; ++c) {
5931
5931
  const p = t[c], f = t[c + 1];
5932
- if (Xt(l, u, p, f))
5932
+ if (Zt(l, u, p, f))
5933
5933
  return 0;
5934
5934
  i = Math.min(i, tn(l, u, p, f, a));
5935
5935
  }
@@ -5947,7 +5947,7 @@ function Hs(r, e, t, n, a) {
5947
5947
  return i;
5948
5948
  }
5949
5949
  function Ks(r, e, t) {
5950
- if (Xe(r, e, !0))
5950
+ if (We(r, e, !0))
5951
5951
  return 0;
5952
5952
  let n = 1 / 0;
5953
5953
  for (const a of e) {
@@ -5964,7 +5964,7 @@ function Xs(r, e, t, n) {
5964
5964
  if (!ve(e, r.length))
5965
5965
  return NaN;
5966
5966
  for (let o = e[0]; o <= e[1]; ++o)
5967
- if (Xe(r[o], t, !0))
5967
+ if (We(r[o], t, !0))
5968
5968
  return 0;
5969
5969
  let a = 1 / 0;
5970
5970
  for (let o = e[0]; o < e[1]; ++o) {
@@ -5972,7 +5972,7 @@ function Xs(r, e, t, n) {
5972
5972
  for (const l of t)
5973
5973
  for (let u = 0, c = l.length, p = c - 1; u < c; p = u++) {
5974
5974
  const f = l[p], d = l[u];
5975
- if (Xt(i, s, f, d))
5975
+ if (Zt(i, s, f, d))
5976
5976
  return 0;
5977
5977
  a = Math.min(a, tn(i, s, f, d, n));
5978
5978
  }
@@ -5982,15 +5982,15 @@ function Xs(r, e, t, n) {
5982
5982
  function $n(r, e) {
5983
5983
  for (const t of r)
5984
5984
  for (const n of t)
5985
- if (Xe(n, e, !0))
5985
+ if (We(n, e, !0))
5986
5986
  return !0;
5987
5987
  return !1;
5988
5988
  }
5989
5989
  function Ws(r, e, t, n = 1 / 0) {
5990
- const a = Tr(r), o = Tr(e);
5990
+ const a = Mr(r), o = Mr(e);
5991
5991
  if (n !== 1 / 0 && en(a, o, t) >= n)
5992
5992
  return n;
5993
- if (it(a, o)) {
5993
+ if (st(a, o)) {
5994
5994
  if ($n(r, e))
5995
5995
  return 0;
5996
5996
  } else if ($n(e, r))
@@ -6002,7 +6002,7 @@ function Ws(r, e, t, n = 1 / 0) {
6002
6002
  for (const d of e)
6003
6003
  for (let h = 0, y = d.length, m = y - 1; h < y; m = h++) {
6004
6004
  const w = d[m], v = d[h];
6005
- if (Xt(p, f, w, v))
6005
+ if (Zt(p, f, w, v))
6006
6006
  return 0;
6007
6007
  i = Math.min(i, tn(p, f, w, v, t));
6008
6008
  }
@@ -6012,26 +6012,26 @@ function Ws(r, e, t, n = 1 / 0) {
6012
6012
  function On(r, e, t, n, a, o) {
6013
6013
  if (!o)
6014
6014
  return;
6015
- const i = en(Er(n, o), a, t);
6015
+ const i = en(_r(n, o), a, t);
6016
6016
  i < e && r.push([i, o, [0, 0]]);
6017
6017
  }
6018
- function wt(r, e, t, n, a, o, i) {
6018
+ function St(r, e, t, n, a, o, i) {
6019
6019
  if (!o || !i)
6020
6020
  return;
6021
- const s = en(Er(n, o), Er(a, i), t);
6021
+ const s = en(_r(n, o), _r(a, i), t);
6022
6022
  s < e && r.push([s, o, i]);
6023
6023
  }
6024
- function Mt(r, e, t, n, a = 1 / 0) {
6024
+ function Pt(r, e, t, n, a = 1 / 0) {
6025
6025
  let o = Math.min(n.distance(r[0], t[0][0]), a);
6026
6026
  if (o === 0)
6027
6027
  return o;
6028
- const i = new Ma([[0, [0, r.length - 1], [0, 0]]], Ia), s = Tr(t);
6028
+ const i = new Ma([[0, [0, r.length - 1], [0, 0]]], Ia), s = Mr(t);
6029
6029
  for (; i.length > 0; ) {
6030
6030
  const l = i.pop();
6031
6031
  if (l[0] >= o)
6032
6032
  continue;
6033
- const u = l[1], c = e ? Lr : Cr;
6034
- if (_t(u) <= c) {
6033
+ const u = l[1], c = e ? Er : Ar;
6034
+ if (It(u) <= c) {
6035
6035
  if (!ve(u, r.length))
6036
6036
  return NaN;
6037
6037
  if (e) {
@@ -6046,13 +6046,13 @@ function Mt(r, e, t, n, a = 1 / 0) {
6046
6046
  return 0;
6047
6047
  }
6048
6048
  } else {
6049
- const p = Ar(u, e);
6049
+ const p = Tr(u, e);
6050
6050
  On(i, o, n, r, s, p[0]), On(i, o, n, r, s, p[1]);
6051
6051
  }
6052
6052
  }
6053
6053
  return o;
6054
6054
  }
6055
- function It(r, e, t, n, a, o = 1 / 0) {
6055
+ function Rt(r, e, t, n, a, o = 1 / 0) {
6056
6056
  let i = Math.min(o, a.distance(r[0], t[0]));
6057
6057
  if (i === 0)
6058
6058
  return i;
@@ -6061,8 +6061,8 @@ function It(r, e, t, n, a, o = 1 / 0) {
6061
6061
  const l = s.pop();
6062
6062
  if (l[0] >= i)
6063
6063
  continue;
6064
- const u = l[1], c = l[2], p = e ? Lr : Cr, f = n ? Lr : Cr;
6065
- if (_t(u) <= p && _t(c) <= f) {
6064
+ const u = l[1], c = l[2], p = e ? Er : Ar, f = n ? Er : Ar;
6065
+ if (It(u) <= p && It(c) <= f) {
6066
6066
  if (!ve(u, r.length) && ve(c, t.length))
6067
6067
  return NaN;
6068
6068
  let d;
@@ -6081,8 +6081,8 @@ function It(r, e, t, n, a, o = 1 / 0) {
6081
6081
  } else
6082
6082
  d = Hs(r, u, t, c, a), i = Math.min(i, d);
6083
6083
  } else {
6084
- const d = Ar(u, e), h = Ar(c, n);
6085
- wt(s, i, a, r, t, d[0], h[0]), wt(s, i, a, r, t, d[0], h[1]), wt(s, i, a, r, t, d[1], h[0]), wt(s, i, a, r, t, d[1], h[1]);
6084
+ const d = Tr(u, e), h = Tr(c, n);
6085
+ St(s, i, a, r, t, d[0], h[0]), St(s, i, a, r, t, d[0], h[1]), St(s, i, a, r, t, d[1], h[0]), St(s, i, a, r, t, d[1], h[1]);
6086
6086
  }
6087
6087
  }
6088
6088
  return i;
@@ -6096,13 +6096,13 @@ function Zs(r, e) {
6096
6096
  for (const i of e) {
6097
6097
  switch (i.type) {
6098
6098
  case "Point":
6099
- o = Math.min(o, It(n, !1, [i.coordinates], !1, a, o));
6099
+ o = Math.min(o, Rt(n, !1, [i.coordinates], !1, a, o));
6100
6100
  break;
6101
6101
  case "LineString":
6102
- o = Math.min(o, It(n, !1, i.coordinates, !0, a, o));
6102
+ o = Math.min(o, Rt(n, !1, i.coordinates, !0, a, o));
6103
6103
  break;
6104
6104
  case "Polygon":
6105
- o = Math.min(o, Mt(n, !1, i.coordinates, a, o));
6105
+ o = Math.min(o, Pt(n, !1, i.coordinates, a, o));
6106
6106
  break;
6107
6107
  }
6108
6108
  if (o === 0)
@@ -6119,13 +6119,13 @@ function Ys(r, e) {
6119
6119
  for (const i of e) {
6120
6120
  switch (i.type) {
6121
6121
  case "Point":
6122
- o = Math.min(o, It(n, !0, [i.coordinates], !1, a, o));
6122
+ o = Math.min(o, Rt(n, !0, [i.coordinates], !1, a, o));
6123
6123
  break;
6124
6124
  case "LineString":
6125
- o = Math.min(o, It(n, !0, i.coordinates, !0, a, o));
6125
+ o = Math.min(o, Rt(n, !0, i.coordinates, !0, a, o));
6126
6126
  break;
6127
6127
  case "Polygon":
6128
- o = Math.min(o, Mt(n, !0, i.coordinates, a, o));
6128
+ o = Math.min(o, Pt(n, !0, i.coordinates, a, o));
6129
6129
  break;
6130
6130
  }
6131
6131
  if (o === 0)
@@ -6143,10 +6143,10 @@ function Js(r, e) {
6143
6143
  for (const s of n) {
6144
6144
  switch (i.type) {
6145
6145
  case "Point":
6146
- o = Math.min(o, Mt([i.coordinates], !1, s, a, o));
6146
+ o = Math.min(o, Pt([i.coordinates], !1, s, a, o));
6147
6147
  break;
6148
6148
  case "LineString":
6149
- o = Math.min(o, Mt(i.coordinates, !0, s, a, o));
6149
+ o = Math.min(o, Pt(i.coordinates, !0, s, a, o));
6150
6150
  break;
6151
6151
  case "Polygon":
6152
6152
  o = Math.min(o, Ws(s, i.coordinates, a, o));
@@ -6157,7 +6157,7 @@ function Js(r, e) {
6157
6157
  }
6158
6158
  return o;
6159
6159
  }
6160
- function ur(r) {
6160
+ function pr(r) {
6161
6161
  return r.type === "MultiPolygon" ? r.coordinates.map((e) => ({
6162
6162
  type: "Polygon",
6163
6163
  coordinates: e
@@ -6176,14 +6176,14 @@ class $e {
6176
6176
  static parse(e, t) {
6177
6177
  if (e.length !== 2)
6178
6178
  return t.error(`'distance' expression requires exactly one argument, but found ${e.length - 1} instead.`);
6179
- if (at(e[1])) {
6179
+ if (ot(e[1])) {
6180
6180
  const n = e[1];
6181
6181
  if (n.type === "FeatureCollection")
6182
- return new $e(n, n.features.map((a) => ur(a.geometry)).flat());
6182
+ return new $e(n, n.features.map((a) => pr(a.geometry)).flat());
6183
6183
  if (n.type === "Feature")
6184
- return new $e(n, ur(n.geometry));
6184
+ return new $e(n, pr(n.geometry));
6185
6185
  if ("type" in n && "coordinates" in n)
6186
- return new $e(n, ur(n));
6186
+ return new $e(n, pr(n));
6187
6187
  }
6188
6188
  return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.");
6189
6189
  }
@@ -6204,7 +6204,7 @@ class $e {
6204
6204
  return !0;
6205
6205
  }
6206
6206
  }
6207
- class dt {
6207
+ class ht {
6208
6208
  constructor(e) {
6209
6209
  this.type = T, this.key = e;
6210
6210
  }
@@ -6212,12 +6212,12 @@ class dt {
6212
6212
  if (e.length !== 2)
6213
6213
  return t.error(`Expected 1 argument, but found ${e.length - 1} instead.`);
6214
6214
  const n = e[1];
6215
- return n == null ? t.error("Global state property must be defined.") : typeof n != "string" ? t.error(`Global state property must be string, but found ${typeof e[1]} instead.`) : new dt(n);
6215
+ return n == null ? t.error("Global state property must be defined.") : typeof n != "string" ? t.error(`Global state property must be string, but found ${typeof e[1]} instead.`) : new ht(n);
6216
6216
  }
6217
6217
  evaluate(e) {
6218
6218
  var t;
6219
6219
  const n = (t = e.globals) === null || t === void 0 ? void 0 : t.globalState;
6220
- return !n || Object.keys(n).length === 0 ? null : Qe(n, this.key);
6220
+ return !n || Object.keys(n).length === 0 ? null : et(n, this.key);
6221
6221
  }
6222
6222
  eachChild() {
6223
6223
  }
@@ -6237,33 +6237,33 @@ const rn = {
6237
6237
  at: qr,
6238
6238
  boolean: se,
6239
6239
  case: Hr,
6240
- coalesce: ot,
6241
- collator: Kt,
6240
+ coalesce: it,
6241
+ collator: Wt,
6242
6242
  format: Xr,
6243
6243
  image: Wr,
6244
6244
  in: Gr,
6245
- "index-of": Et,
6245
+ "index-of": _t,
6246
6246
  interpolate: he,
6247
6247
  "interpolate-hcl": he,
6248
6248
  "interpolate-lab": he,
6249
6249
  length: Zr,
6250
- let: Gt,
6251
- literal: Ve,
6250
+ let: Ht,
6251
+ literal: He,
6252
6252
  match: Vr,
6253
6253
  number: se,
6254
6254
  "number-format": Kr,
6255
6255
  object: se,
6256
- slice: Tt,
6257
- step: Ht,
6256
+ slice: Mt,
6257
+ step: Xt,
6258
6258
  string: se,
6259
6259
  "to-boolean": ke,
6260
6260
  "to-color": ke,
6261
6261
  "to-number": ke,
6262
6262
  "to-string": ke,
6263
- var: Vt,
6263
+ var: Kt,
6264
6264
  within: Fe,
6265
6265
  distance: $e,
6266
- "global-state": dt
6266
+ "global-state": ht
6267
6267
  };
6268
6268
  class le {
6269
6269
  constructor(e, t, n, a) {
@@ -6286,7 +6286,7 @@ class le {
6286
6286
  u.length === e.length - 1);
6287
6287
  let l = null;
6288
6288
  for (const [u, c] of s) {
6289
- l = new qt(t.registry, Pt, t.path, null, t.scope);
6289
+ l = new Vt(t.registry, zt, t.path, null, t.scope);
6290
6290
  const p = [];
6291
6291
  let f = !1;
6292
6292
  for (let d = 1; d < e.length; d++) {
@@ -6340,7 +6340,7 @@ function jn(r, [e, t, n, a]) {
6340
6340
  function Nn(r, e) {
6341
6341
  return r in e;
6342
6342
  }
6343
- function cr(r, e) {
6343
+ function fr(r, e) {
6344
6344
  const t = e[r];
6345
6345
  return typeof t > "u" ? null : t;
6346
6346
  }
@@ -6405,18 +6405,18 @@ le.register(rn, {
6405
6405
  overloads: [
6406
6406
  [
6407
6407
  [M],
6408
- (r, [e]) => cr(e.evaluate(r), r.properties())
6408
+ (r, [e]) => fr(e.evaluate(r), r.properties())
6409
6409
  ],
6410
6410
  [
6411
6411
  [M, Re],
6412
- (r, [e, t]) => cr(e.evaluate(r), t.evaluate(r))
6412
+ (r, [e, t]) => fr(e.evaluate(r), t.evaluate(r))
6413
6413
  ]
6414
6414
  ]
6415
6415
  },
6416
6416
  "feature-state": [
6417
6417
  T,
6418
6418
  [M],
6419
- (r, [e]) => cr(e.evaluate(r), r.featureState || {})
6419
+ (r, [e]) => fr(e.evaluate(r), r.featureState || {})
6420
6420
  ],
6421
6421
  properties: [
6422
6422
  Re,
@@ -6778,37 +6778,37 @@ le.register(rn, {
6778
6778
  concat: [
6779
6779
  M,
6780
6780
  Me(T),
6781
- (r, e) => e.map((t) => et(t.evaluate(r))).join("")
6781
+ (r, e) => e.map((t) => tt(t.evaluate(r))).join("")
6782
6782
  ],
6783
6783
  "resolved-locale": [
6784
6784
  M,
6785
- [jt],
6785
+ [Dt],
6786
6786
  (r, [e]) => e.evaluate(r).resolvedLocale()
6787
6787
  ]
6788
6788
  });
6789
6789
  function el(r) {
6790
6790
  return Array.isArray(r) ? `(${r.map(j).join(", ")})` : `(${j(r.type)}...)`;
6791
6791
  }
6792
- function Pt(r) {
6793
- if (r instanceof Vt)
6794
- return Pt(r.boundExpression);
6792
+ function zt(r) {
6793
+ if (r instanceof Kt)
6794
+ return zt(r.boundExpression);
6795
6795
  if (r instanceof le && r.name === "error")
6796
6796
  return !1;
6797
- if (r instanceof Kt)
6797
+ if (r instanceof Wt)
6798
6798
  return !1;
6799
6799
  if (r instanceof Fe)
6800
6800
  return !1;
6801
6801
  if (r instanceof $e)
6802
6802
  return !1;
6803
- if (r instanceof dt)
6803
+ if (r instanceof ht)
6804
6804
  return !1;
6805
6805
  const e = r instanceof ke || r instanceof se;
6806
6806
  let t = !0;
6807
6807
  return r.eachChild((n) => {
6808
- e ? t = t && Pt(n) : t = t && n instanceof Ve;
6809
- }), t ? Wt(r) && Zt(r, ["zoom", "heatmap-density", "elevation", "line-progress", "accumulated", "is-supported-script"]) : !1;
6808
+ e ? t = t && zt(n) : t = t && n instanceof He;
6809
+ }), t ? Yt(r) && Jt(r, ["zoom", "heatmap-density", "elevation", "line-progress", "accumulated", "is-supported-script"]) : !1;
6810
6810
  }
6811
- function Wt(r) {
6811
+ function Yt(r) {
6812
6812
  if (r instanceof le) {
6813
6813
  if (r.name === "get" && r.args.length === 1)
6814
6814
  return !1;
@@ -6825,32 +6825,32 @@ function Wt(r) {
6825
6825
  return !1;
6826
6826
  let e = !0;
6827
6827
  return r.eachChild((t) => {
6828
- e && !Wt(t) && (e = !1);
6828
+ e && !Yt(t) && (e = !1);
6829
6829
  }), e;
6830
6830
  }
6831
- function st(r) {
6831
+ function lt(r) {
6832
6832
  if (r instanceof le && r.name === "feature-state")
6833
6833
  return !1;
6834
6834
  let e = !0;
6835
6835
  return r.eachChild((t) => {
6836
- e && !st(t) && (e = !1);
6836
+ e && !lt(t) && (e = !1);
6837
6837
  }), e;
6838
6838
  }
6839
- function Zt(r, e) {
6839
+ function Jt(r, e) {
6840
6840
  if (r instanceof le && e.indexOf(r.name) >= 0)
6841
6841
  return !1;
6842
6842
  let t = !0;
6843
6843
  return r.eachChild((n) => {
6844
- t && !Zt(n, e) && (t = !1);
6844
+ t && !Jt(n, e) && (t = !1);
6845
6845
  }), t;
6846
6846
  }
6847
- function _r(r) {
6847
+ function Ir(r) {
6848
6848
  return { result: "success", value: r };
6849
6849
  }
6850
6850
  function Be(r) {
6851
6851
  return { result: "error", value: r };
6852
6852
  }
6853
- function Rt(r) {
6853
+ function Ft(r) {
6854
6854
  return r["property-type"] === "data-driven" || r["property-type"] === "cross-faded-data-driven";
6855
6855
  }
6856
6856
  function Pa(r) {
@@ -6890,12 +6890,12 @@ function za(r) {
6890
6890
  return Array.isArray(r) && r.length > 0 && typeof r[0] == "string" && r[0] in rn;
6891
6891
  }
6892
6892
  function Fa(r, e) {
6893
- const t = new qt(rn, Pt, [], e ? nl(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
6894
- return n ? _r(new tl(n, e)) : Be(t.errors);
6893
+ const t = new Vt(rn, zt, [], e ? nl(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
6894
+ return n ? Ir(new tl(n, e)) : Be(t.errors);
6895
6895
  }
6896
6896
  class Dn {
6897
6897
  constructor(e, t) {
6898
- this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !st(t.expression), this.globalStateRefs = an(t.expression);
6898
+ this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !lt(t.expression), this.globalStateRefs = an(t.expression);
6899
6899
  }
6900
6900
  evaluateWithoutErrorHandling(e, t, n, a, o, i) {
6901
6901
  return this._styleExpression.evaluateWithoutErrorHandling(e, t, n, a, o, i);
@@ -6906,7 +6906,7 @@ class Dn {
6906
6906
  }
6907
6907
  class Un {
6908
6908
  constructor(e, t, n, a) {
6909
- this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = e !== "camera" && !st(t.expression), this.globalStateRefs = an(t.expression), this.interpolationType = a;
6909
+ this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = e !== "camera" && !lt(t.expression), this.globalStateRefs = an(t.expression), this.interpolationType = a;
6910
6910
  }
6911
6911
  evaluateWithoutErrorHandling(e, t, n, a, o, i) {
6912
6912
  return this._styleExpression.evaluateWithoutErrorHandling(e, t, n, a, o, i);
@@ -6922,13 +6922,13 @@ function rl(r, e) {
6922
6922
  const t = Fa(r, e);
6923
6923
  if (t.result === "error")
6924
6924
  return t;
6925
- const n = t.value.expression, a = Wt(n);
6926
- if (!a && !Rt(e))
6925
+ const n = t.value.expression, a = Yt(n);
6926
+ if (!a && !Ft(e))
6927
6927
  return Be([new fe("", "data expressions not supported")]);
6928
- const o = Zt(n, ["zoom"]);
6928
+ const o = Jt(n, ["zoom"]);
6929
6929
  if (!o && !Pa(e))
6930
6930
  return Be([new fe("", "zoom expressions not supported")]);
6931
- const i = kt(n);
6931
+ const i = Ct(n);
6932
6932
  if (!i && !o)
6933
6933
  return Be([new fe("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
6934
6934
  if (i instanceof fe)
@@ -6936,26 +6936,26 @@ function rl(r, e) {
6936
6936
  if (i instanceof he && !Ra(e))
6937
6937
  return Be([new fe("", '"interpolate" expressions cannot be used with this property')]);
6938
6938
  if (!i)
6939
- return _r(a ? new Dn("constant", t.value) : new Dn("source", t.value));
6939
+ return Ir(a ? new Dn("constant", t.value) : new Dn("source", t.value));
6940
6940
  const s = i instanceof he ? i.interpolation : void 0;
6941
- return _r(a ? new Un("camera", t.value, i.labels, s) : new Un("composite", t.value, i.labels, s));
6941
+ return Ir(a ? new Un("camera", t.value, i.labels, s) : new Un("composite", t.value, i.labels, s));
6942
6942
  }
6943
- function kt(r) {
6943
+ function Ct(r) {
6944
6944
  let e = null;
6945
- if (r instanceof Gt)
6946
- e = kt(r.result);
6947
- else if (r instanceof ot) {
6945
+ if (r instanceof Ht)
6946
+ e = Ct(r.result);
6947
+ else if (r instanceof it) {
6948
6948
  for (const t of r.args)
6949
- if (e = kt(t), e)
6949
+ if (e = Ct(t), e)
6950
6950
  break;
6951
- } else (r instanceof Ht || r instanceof he) && r.input instanceof le && r.input.name === "zoom" && (e = r);
6951
+ } else (r instanceof Xt || r instanceof he) && r.input instanceof le && r.input.name === "zoom" && (e = r);
6952
6952
  return e instanceof fe || r.eachChild((t) => {
6953
- const n = kt(t);
6953
+ const n = Ct(t);
6954
6954
  n instanceof fe ? e = n : !e && n ? e = new fe("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : e && n && e !== n && (e = new fe("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
6955
6955
  }), e;
6956
6956
  }
6957
6957
  function an(r, e = /* @__PURE__ */ new Set()) {
6958
- return r instanceof dt && e.add(r.key), r.eachChild((t) => {
6958
+ return r instanceof ht && e.add(r.key), r.eachChild((t) => {
6959
6959
  an(t, e);
6960
6960
  }), e;
6961
6961
  }
@@ -6966,13 +6966,13 @@ function nl(r) {
6966
6966
  number: b,
6967
6967
  enum: M,
6968
6968
  boolean: _,
6969
- formatted: Nt,
6970
- padding: Dt,
6971
- numberArray: Ut,
6972
- colorArray: rt,
6973
- projectionDefinition: Ot,
6974
- resolvedImage: pt,
6975
- variableAnchorOffsetCollection: Bt
6969
+ formatted: Ut,
6970
+ padding: Bt,
6971
+ numberArray: qt,
6972
+ colorArray: nt,
6973
+ projectionDefinition: Nt,
6974
+ resolvedImage: ft,
6975
+ variableAnchorOffsetCollection: Gt
6976
6976
  };
6977
6977
  return r.type === "array" ? Z(e[r.value] || T, r.length) : e[r.type];
6978
6978
  }
@@ -7052,11 +7052,11 @@ function te(r) {
7052
7052
  if (u !== "object")
7053
7053
  return [new g(e, t, `object expected, ${u} found`)];
7054
7054
  for (const c in t) {
7055
- const p = c.split(".")[0], f = Qe(n, p) || n["*"];
7055
+ const p = c.split(".")[0], f = et(n, p) || n["*"];
7056
7056
  let d;
7057
- if (Qe(a, p))
7057
+ if (et(a, p))
7058
7058
  d = a[p];
7059
- else if (Qe(n, p))
7059
+ else if (et(n, p))
7060
7060
  d = s;
7061
7061
  else if (a["*"])
7062
7062
  d = a["*"];
@@ -7108,7 +7108,7 @@ function on(r) {
7108
7108
  }));
7109
7109
  return u;
7110
7110
  }
7111
- function Yt(r) {
7111
+ function Qt(r) {
7112
7112
  const e = r.key, t = r.value, n = r.valueSpec;
7113
7113
  let a = I(t);
7114
7114
  return a === "number" && t !== t && (a = "NaN"), a !== "number" ? [new g(e, t, `number expected, ${a} found`)] : "minimum" in n && t < n.minimum ? [new g(e, t, `${t} is less than the minimum value ${n.minimum}`)] : "maximum" in n && t > n.maximum ? [new g(e, t, `${t} is greater than the maximum value ${n.maximum}`)] : [];
@@ -7128,7 +7128,7 @@ function ja(r) {
7128
7128
  default: h
7129
7129
  }
7130
7130
  });
7131
- return t === "identity" && s && c.push(new g(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new g(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !Ra(r.valueSpec) && c.push(new g(r.key, r.value, "exponential functions not supported")), r.styleSpec.$version >= 8 && (l && !Rt(r.valueSpec) ? c.push(new g(r.key, r.value, "property functions not supported")) : s && !Pa(r.valueSpec) && c.push(new g(r.key, r.value, "zoom functions not supported"))), (t === "categorical" || u) && r.value.property === void 0 && c.push(new g(r.key, r.value, '"property" property is required')), c;
7131
+ return t === "identity" && s && c.push(new g(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new g(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !Ra(r.valueSpec) && c.push(new g(r.key, r.value, "exponential functions not supported")), r.styleSpec.$version >= 8 && (l && !Ft(r.valueSpec) ? c.push(new g(r.key, r.value, "property functions not supported")) : s && !Pa(r.valueSpec) && c.push(new g(r.key, r.value, "zoom functions not supported"))), (t === "categorical" || u) && r.value.property === void 0 && c.push(new g(r.key, r.value, '"property" property is required')), c;
7132
7132
  function p(y) {
7133
7133
  if (t === "identity")
7134
7134
  return [new g(y.key, y.value, 'identity function may not have a "stops" property')];
@@ -7167,7 +7167,7 @@ function ja(r) {
7167
7167
  validateSpec: y.validateSpec,
7168
7168
  style: y.style,
7169
7169
  styleSpec: y.styleSpec,
7170
- objectElementValidators: { zoom: Yt, value: d }
7170
+ objectElementValidators: { zoom: Qt, value: d }
7171
7171
  }));
7172
7172
  } else
7173
7173
  m = m.concat(d({
@@ -7196,7 +7196,7 @@ function ja(r) {
7196
7196
  return [new g(y.key, x, "stop domain value must be a number, string, or boolean")];
7197
7197
  if (w !== "number" && t !== "categorical") {
7198
7198
  let A = `number expected, ${w} found`;
7199
- return Rt(e) && t === void 0 && (A += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new g(y.key, x, A)];
7199
+ return Ft(e) && t === void 0 && (A += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new g(y.key, x, A)];
7200
7200
  }
7201
7201
  return t === "categorical" && w === "number" && (!isFinite(v) || Math.floor(v) !== v) ? [new g(y.key, x, `integer expected, found ${v}`)] : t !== "categorical" && w === "number" && o !== void 0 && v < o ? [new g(y.key, x, "stop domain values must appear in ascending order")] : (o = v, t === "categorical" && v in a ? [new g(y.key, x, "stop domain values must be unique")] : (a[v] = !0, []));
7202
7202
  }
@@ -7211,21 +7211,21 @@ function ja(r) {
7211
7211
  });
7212
7212
  }
7213
7213
  }
7214
- function He(r) {
7214
+ function Ke(r) {
7215
7215
  const e = (r.expressionContext === "property" ? rl : Fa)(je(r.value), r.valueSpec);
7216
7216
  if (e.result === "error")
7217
7217
  return e.value.map((n) => new g(`${r.key}${n.key}`, r.value, n.message));
7218
7218
  const t = e.value.expression || e.value._styleExpression.expression;
7219
7219
  if (r.expressionContext === "property" && r.propertyKey === "text-font" && !t.outputDefined())
7220
7220
  return [new g(r.key, r.value, `Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];
7221
- if (r.expressionContext === "property" && r.propertyType === "layout" && !st(t))
7221
+ if (r.expressionContext === "property" && r.propertyType === "layout" && !lt(t))
7222
7222
  return [new g(r.key, r.value, '"feature-state" data expressions are not supported with layout properties.')];
7223
- if (r.expressionContext === "filter" && !st(t))
7223
+ if (r.expressionContext === "filter" && !lt(t))
7224
7224
  return [new g(r.key, r.value, '"feature-state" data expressions are not supported with filters.')];
7225
7225
  if (r.expressionContext && r.expressionContext.indexOf("cluster") === 0) {
7226
- if (!Zt(t, ["zoom", "feature-state"]))
7226
+ if (!Jt(t, ["zoom", "feature-state"]))
7227
7227
  return [new g(r.key, r.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')];
7228
- if (r.expressionContext === "cluster-initial" && !Wt(t))
7228
+ if (r.expressionContext === "cluster-initial" && !Yt(t))
7229
7229
  return [new g(r.key, r.value, "Feature data expressions are not supported with initial expression part of cluster properties.")];
7230
7230
  }
7231
7231
  return [];
@@ -7234,16 +7234,16 @@ function ol(r) {
7234
7234
  const e = r.value, t = r.key, n = I(e);
7235
7235
  return n !== "boolean" ? [new g(t, e, `boolean expected, ${n} found`)] : [];
7236
7236
  }
7237
- function Mr(r) {
7237
+ function Pr(r) {
7238
7238
  const e = r.key, t = r.value, n = I(t);
7239
7239
  return n !== "string" ? [new g(e, t, `color expected, ${n} found`)] : F.parse(String(t)) ? [] : [new g(e, t, `color expected, "${t}" found`)];
7240
7240
  }
7241
- function lt(r) {
7241
+ function ut(r) {
7242
7242
  const e = r.key, t = r.value, n = r.valueSpec, a = [];
7243
7243
  return Array.isArray(n.values) ? n.values.indexOf(U(t)) === -1 && a.push(new g(e, t, `expected one of [${n.values.join(", ")}], ${JSON.stringify(t)} found`)) : Object.keys(n.values).indexOf(U(t)) === -1 && a.push(new g(e, t, `expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(t)} found`)), a;
7244
7244
  }
7245
7245
  function sn(r) {
7246
- return $a(je(r.value)) ? He(At({}, r, {
7246
+ return $a(je(r.value)) ? Ke(Tt({}, r, {
7247
7247
  expressionContext: "filter",
7248
7248
  valueSpec: { value: "boolean" }
7249
7249
  })) : Na(r);
@@ -7256,7 +7256,7 @@ function Na(r) {
7256
7256
  let a, o = [];
7257
7257
  if (e.length < 1)
7258
7258
  return [new g(t, e, "filter array must have at least 1 element")];
7259
- switch (o = o.concat(lt({
7259
+ switch (o = o.concat(ut({
7260
7260
  key: `${t}[0]`,
7261
7261
  value: e[0],
7262
7262
  valueSpec: n.filter_operator,
@@ -7277,7 +7277,7 @@ function Na(r) {
7277
7277
  case "!in":
7278
7278
  e.length >= 2 && (a = I(e[1]), a !== "string" && o.push(new g(`${t}[1]`, e[1], `string expected, ${a} found`)));
7279
7279
  for (let i = 2; i < e.length; i++)
7280
- a = I(e[i]), U(e[1]) === "$type" ? o = o.concat(lt({
7280
+ a = I(e[i]), U(e[1]) === "$type" ? o = o.concat(ut({
7281
7281
  key: `${t}[${i}]`,
7282
7282
  value: e[i],
7283
7283
  valueSpec: n.geometry_type,
@@ -7320,7 +7320,7 @@ function Da(r, e) {
7320
7320
  if (!c)
7321
7321
  return [new g(t, i, `unknown property "${s}"`)];
7322
7322
  let p;
7323
- if (I(i) === "string" && Rt(c) && !c.tokens && (p = /^{([^}]+)}$/.exec(i)))
7323
+ if (I(i) === "string" && Ft(c) && !c.tokens && (p = /^{([^}]+)}$/.exec(i)))
7324
7324
  return [new g(t, i, `"${s}" does not support interpolation syntax
7325
7325
  Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)];
7326
7326
  const f = [];
@@ -7407,7 +7407,7 @@ function qa(r) {
7407
7407
  validateSpec: l.validateSpec,
7408
7408
  objectElementValidators: {
7409
7409
  "*"(u) {
7410
- return Ba(At({ layerType: i }, u));
7410
+ return Ba(Tt({ layerType: i }, u));
7411
7411
  }
7412
7412
  }
7413
7413
  });
@@ -7422,7 +7422,7 @@ function qa(r) {
7422
7422
  validateSpec: l.validateSpec,
7423
7423
  objectElementValidators: {
7424
7424
  "*"(u) {
7425
- return Ua(At({ layerType: i }, u));
7425
+ return Ua(Tt({ layerType: i }, u));
7426
7426
  }
7427
7427
  }
7428
7428
  });
@@ -7496,11 +7496,11 @@ function Ga(r) {
7496
7496
  }), e.cluster)
7497
7497
  for (const l in e.clusterProperties) {
7498
7498
  const [u, c] = e.clusterProperties[l], p = typeof u == "string" ? [u, ["accumulated"], ["get", l]] : u;
7499
- s.push(...He({
7499
+ s.push(...Ke({
7500
7500
  key: `${t}.${l}.map`,
7501
7501
  value: c,
7502
7502
  expressionContext: "cluster-map"
7503
- })), s.push(...He({
7503
+ })), s.push(...Ke({
7504
7504
  key: `${t}.${l}.reduce`,
7505
7505
  value: p,
7506
7506
  expressionContext: "cluster-reduce"
@@ -7528,7 +7528,7 @@ function Ga(r) {
7528
7528
  case "canvas":
7529
7529
  return [new g(t, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")];
7530
7530
  default:
7531
- return lt({
7531
+ return ut({
7532
7532
  key: `${t}.type`,
7533
7533
  value: e.type,
7534
7534
  valueSpec: { values: ["vector", "raster", "raster-dem", "geojson", "video", "image"] }
@@ -7610,10 +7610,10 @@ function Ka(r) {
7610
7610
  return o;
7611
7611
  }
7612
7612
  function ll(r) {
7613
- return Ne(r).length === 0 ? [] : He(r);
7613
+ return Ne(r).length === 0 ? [] : Ke(r);
7614
7614
  }
7615
7615
  function ul(r) {
7616
- return Ne(r).length === 0 ? [] : He(r);
7616
+ return Ne(r).length === 0 ? [] : Ke(r);
7617
7617
  }
7618
7618
  function cl(r) {
7619
7619
  const e = r.key, t = r.value;
@@ -7633,7 +7633,7 @@ function cl(r) {
7633
7633
  }));
7634
7634
  return o;
7635
7635
  } else
7636
- return Yt({
7636
+ return Qt({
7637
7637
  key: e,
7638
7638
  value: t,
7639
7639
  valueSpec: {}
@@ -7657,7 +7657,7 @@ function pl(r) {
7657
7657
  }));
7658
7658
  return o;
7659
7659
  } else
7660
- return Yt({
7660
+ return Qt({
7661
7661
  key: e,
7662
7662
  value: t,
7663
7663
  valueSpec: {}
@@ -7670,13 +7670,13 @@ function fl(r) {
7670
7670
  return [new g(e, t, "array length at least 1 expected, length 0 found")];
7671
7671
  let a = [];
7672
7672
  for (let o = 0; o < t.length; o++)
7673
- a = a.concat(Mr({
7673
+ a = a.concat(Pr({
7674
7674
  key: `${e}[${o}]`,
7675
7675
  value: t[o]
7676
7676
  }));
7677
7677
  return a;
7678
7678
  } else
7679
- return Mr({
7679
+ return Pr({
7680
7680
  key: e,
7681
7681
  value: t
7682
7682
  });
@@ -7687,7 +7687,7 @@ function dl(r) {
7687
7687
  return [new g(e, t, "variableAnchorOffsetCollection requires a non-empty array of even length")];
7688
7688
  let o = [];
7689
7689
  for (let i = 0; i < t.length; i += 2)
7690
- o = o.concat(lt({
7690
+ o = o.concat(ut({
7691
7691
  key: `${e}[${i}]`,
7692
7692
  value: t[i],
7693
7693
  valueSpec: a.layout_symbol["text-anchor"]
@@ -7779,10 +7779,10 @@ const qn = {
7779
7779
  },
7780
7780
  array: on,
7781
7781
  boolean: ol,
7782
- number: Yt,
7783
- color: Mr,
7782
+ number: Qt,
7783
+ color: Pr,
7784
7784
  constants: Oa,
7785
- enum: lt,
7785
+ enum: ut,
7786
7786
  filter: sn,
7787
7787
  function: ja,
7788
7788
  layer: qa,
@@ -7803,9 +7803,9 @@ const qn = {
7803
7803
  sprite: Xa,
7804
7804
  state: Wa
7805
7805
  };
7806
- function zt(r) {
7806
+ function $t(r) {
7807
7807
  const e = r.value, t = r.valueSpec, n = r.styleSpec;
7808
- return r.validateSpec = zt, t.expression && nn(U(e)) ? ja(r) : t.expression && za(je(e)) ? He(r) : t.type && qn[t.type] ? qn[t.type](r) : te(At({}, r, {
7808
+ return r.validateSpec = $t, t.expression && nn(U(e)) ? ja(r) : t.expression && za(je(e)) ? Ke(r) : t.type && qn[t.type] ? qn[t.type](r) : te(Tt({}, r, {
7809
7809
  valueSpec: t.type ? n[t.type] : t
7810
7810
  }));
7811
7811
  }
@@ -7815,13 +7815,13 @@ function Za(r) {
7815
7815
  }
7816
7816
  function Y(r, e = Hi) {
7817
7817
  let t = [];
7818
- return t = t.concat(zt({
7818
+ return t = t.concat($t({
7819
7819
  key: "",
7820
7820
  value: r,
7821
7821
  valueSpec: e.$root,
7822
7822
  styleSpec: e,
7823
7823
  style: r,
7824
- validateSpec: zt,
7824
+ validateSpec: $t,
7825
7825
  objectElementValidators: {
7826
7826
  glyphs: Za,
7827
7827
  "*"() {
@@ -7848,7 +7848,7 @@ function ce(r) {
7848
7848
  return function(e) {
7849
7849
  return r({
7850
7850
  ...e,
7851
- validateSpec: zt
7851
+ validateSpec: $t
7852
7852
  });
7853
7853
  };
7854
7854
  }
@@ -7863,7 +7863,7 @@ function pe(r) {
7863
7863
  function Gn(r) {
7864
7864
  if (!r)
7865
7865
  return {
7866
- style: Je[tr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
7866
+ style: Qe[nr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
7867
7867
  requiresUrlMonitoring: !1,
7868
7868
  // default styles don't require URL monitoring
7869
7869
  isFallback: !0
@@ -7875,7 +7875,7 @@ function Gn(r) {
7875
7875
  requiresUrlMonitoring: !1,
7876
7876
  isFallback: !1
7877
7877
  } : t.isValidJSON ? {
7878
- style: Je[tr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
7878
+ style: Qe[nr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
7879
7879
  requiresUrlMonitoring: !1,
7880
7880
  // default styles don't require URL monitoring
7881
7881
  isFallback: !0
@@ -7902,7 +7902,7 @@ function Gn(r) {
7902
7902
  requiresUrlMonitoring: !1,
7903
7903
  isFallback: !1
7904
7904
  } : {
7905
- style: Je[tr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
7905
+ style: Qe[nr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
7906
7906
  requiresUrlMonitoring: !1,
7907
7907
  // default styles don't require URL monitoring
7908
7908
  isFallback: !0
@@ -8065,8 +8065,8 @@ class Cl extends ri {
8065
8065
  }
8066
8066
  }
8067
8067
  }
8068
- var K, oe, Se, xe, W, ct, q, Ja, J, Qa;
8069
- class pr {
8068
+ var K, oe, Se, xe, W, pt, q, Ja, J, Qa;
8069
+ class dr {
8070
8070
  constructor(e, t) {
8071
8071
  be(this, q);
8072
8072
  be(this, K);
@@ -8075,7 +8075,7 @@ class pr {
8075
8075
  be(this, Se);
8076
8076
  be(this, xe);
8077
8077
  be(this, W, !1);
8078
- be(this, ct);
8078
+ be(this, pt);
8079
8079
  e.style !== void 0 && _e(this, W, !0), _e(this, K, {
8080
8080
  // set defaults
8081
8081
  zoomAdjust: -4,
@@ -8135,15 +8135,15 @@ class pr {
8135
8135
  return P(this, K).container = P(this, Se), P(this, K).zoom = e.getZoom() + P(this, K).zoomAdjust, this.map = new Iu(P(this, K)), this.map.once("style.load", () => {
8136
8136
  this.map.resize();
8137
8137
  }), this.map.once("load", () => {
8138
- H(this, q, Ja).call(this, P(this, K).parentRect), _e(this, ct, H(this, q, Qa).call(this));
8138
+ H(this, q, Ja).call(this, P(this, K).parentRect), _e(this, pt, H(this, q, Qa).call(this));
8139
8139
  }), P(this, Se);
8140
8140
  }
8141
8141
  onRemove() {
8142
8142
  var e;
8143
- (e = P(this, ct)) == null || e.call(this), ln(P(this, Se));
8143
+ (e = P(this, pt)) == null || e.call(this), ln(P(this, Se));
8144
8144
  }
8145
8145
  }
8146
- K = new WeakMap(), oe = new WeakMap(), Se = new WeakMap(), xe = new WeakMap(), W = new WeakMap(), ct = new WeakMap(), q = new WeakSet(), Ja = function(e) {
8146
+ K = new WeakMap(), oe = new WeakMap(), Se = new WeakMap(), xe = new WeakMap(), W = new WeakMap(), pt = new WeakMap(), q = new WeakSet(), Ja = function(e) {
8147
8147
  e === void 0 || e.linePaint === void 0 && e.fillPaint === void 0 || (_e(this, xe, {
8148
8148
  type: "Feature",
8149
8149
  properties: {
@@ -8228,7 +8228,7 @@ class Ll {
8228
8228
  this.projectionButton.classList.remove("maplibregl-ctrl-projection-globe"), this.projectionButton.classList.remove("maplibregl-ctrl-projection-mercator"), this.map.isGlobeProjection() ? (this.projectionButton.classList.add("maplibregl-ctrl-projection-mercator"), this.projectionButton.title = "Enable Mercator projection") : (this.projectionButton.classList.add("maplibregl-ctrl-projection-globe"), this.projectionButton.title = "Enable Globe projection");
8229
8229
  }
8230
8230
  }
8231
- const Al = "@maptiler/sdk", El = "3.4.0", Tl = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", _l = "MapTiler", Ml = "dist/maptiler-sdk.mjs", Il = "dist/maptiler-sdk.d.ts", Pl = "dist/maptiler-sdk.css", Rl = "module", zl = "dist/maptiler-sdk.mjs", Fl = { ".": { import: "./dist/maptiler-sdk.mjs", types: "./dist/maptiler-sdk.d.ts" }, "./dist/maptiler-sdk.css": { import: "./dist/maptiler-sdk.css" }, "./style.css": { import: "./dist/maptiler-sdk.css" } }, $l = ["maptiler", "map", "sdk", "webmap", "cloud", "webGL", "maplibre"], Ol = "https://docs.maptiler.com/sdk-js/", jl = "BSD-3-Clause", Nl = { type: "git", url: "https://github.com/maptiler/maptiler-sdk-js.git" }, Dl = { prepare: "husky", doc: "rm -rf docs/* && typedoc --out docs && cp -r images docs/", ncu: "npx npm-check-updates", lint: "tsc --noEmit && eslint src", "lint:fix": "tsc --noEmit && eslint src --fix", "test:watch": "vitest watch -c vite.config-test.ts --dom", test: "vitest run -c vite.config-test.ts --dom", "install:clean": "rm -rf build/ dist/ node_modules/ && npm ci", dev: "npm run build-css && vite -c vite.config-dev.ts", "dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts", "build-css": "mkdir -p dist build && 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", "build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts", "build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts", build: "npm run build-es; npm run build-umd; npm run build-css", make: "npm run install:clean && npm run build" }, Ul = { "@canvas/image-data": "^1.0.0", "@eslint/js": "^9.21.0", "@types/color-convert": "^2.0.4", "@types/color-name": "^2.0.0", "@types/stats.js": "^0.17.4", "@types/uuid": "^10.0.0", "@types/xmldom": "^0.1.31", "@vitest/web-worker": "^3.0.9", "@xmldom/xmldom": "^0.8.10", concurrently: "^9.1.2", eslint: "^9.21.0", "eslint-config-prettier": "^10.0.2", "eslint-plugin-prettier": "^5.2.3", "happy-dom": "^17.4.4", husky: "^8.0.0", jiti: "^2.4.2", "lint-staged": "^15.4.3", prettier: "3.5.2", "stats.js": "^0.17.0", typedoc: "^0.27.6", typescript: "^5.7.3", "typescript-eslint": "^8.25.0", vite: "^6.0.7", "vite-plugin-dts": "^4.5.0", vitest: "^3.0.9" }, Bl = { "@maplibre/maplibre-gl-style-spec": "^23.0.0", "@maptiler/client": "^2.3.2", events: "^3.3.0", "gl-matrix": "^3.4.3", "js-base64": "^3.7.7", "maplibre-gl": "^5.5.0", uuid: "^11.0.5" }, ql = {
8231
+ const Al = "@maptiler/sdk", El = "3.4.1-rc1", Tl = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", _l = "MapTiler", Ml = "dist/maptiler-sdk.mjs", Il = "dist/maptiler-sdk.d.ts", Pl = "dist/maptiler-sdk.css", Rl = "module", zl = "dist/maptiler-sdk.mjs", Fl = { ".": { import: "./dist/maptiler-sdk.mjs", types: "./dist/maptiler-sdk.d.ts" }, "./dist/maptiler-sdk.css": { import: "./dist/maptiler-sdk.css" }, "./style.css": { import: "./dist/maptiler-sdk.css" } }, $l = ["maptiler", "map", "sdk", "webmap", "cloud", "webGL", "maplibre"], Ol = "https://docs.maptiler.com/sdk-js/", jl = "BSD-3-Clause", Nl = { type: "git", url: "https://github.com/maptiler/maptiler-sdk-js.git" }, Dl = { prepare: "husky", doc: "rm -rf docs/* && typedoc --out docs && cp -r images docs/", ncu: "npx npm-check-updates", lint: "tsc --noEmit && eslint src", "lint:fix": "tsc --noEmit && eslint src --fix", "test:watch": "vitest watch -c vite.config-test.ts --dom", test: "vitest run -c vite.config-test.ts --dom", "install:clean": "rm -rf build/ dist/ node_modules/ && npm ci", dev: "npm run build-css && vite -c vite.config-dev.ts", "dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts", "build-css": "mkdir -p dist build && 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", "build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts", "build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts", build: "npm run build-es; npm run build-umd; npm run build-css", make: "npm run install:clean && npm run build" }, Ul = { "@canvas/image-data": "^1.0.0", "@eslint/js": "^9.21.0", "@types/color-convert": "^2.0.4", "@types/color-name": "^2.0.0", "@types/stats.js": "^0.17.4", "@types/uuid": "^10.0.0", "@types/xmldom": "^0.1.31", "@vitest/web-worker": "^3.0.9", "@xmldom/xmldom": "^0.8.10", concurrently: "^9.1.2", eslint: "^9.21.0", "eslint-config-prettier": "^10.0.2", "eslint-plugin-prettier": "^5.2.3", "happy-dom": "^17.4.4", husky: "^8.0.0", jiti: "^2.4.2", "lint-staged": "^15.4.3", prettier: "3.5.2", "stats.js": "^0.17.0", typedoc: "^0.27.6", typescript: "^5.7.3", "typescript-eslint": "^8.25.0", vite: "^6.0.7", "vite-plugin-dts": "^4.5.0", vitest: "^3.0.9" }, Bl = { "@maplibre/maplibre-gl-style-spec": "^23.0.0", "@maptiler/client": "^2.3.2", events: "^3.3.0", "gl-matrix": "^3.4.3", "js-base64": "^3.7.7", "maplibre-gl": "^5.5.0", uuid: "^11.0.5" }, ql = {
8232
8232
  name: Al,
8233
8233
  version: El,
8234
8234
  description: Tl,
@@ -8285,15 +8285,15 @@ class Gl {
8285
8285
  return e.searchParams.append("sdk", ql.version), e.searchParams.append("key", D.apiKey), e.searchParams.append("mtsid", Nr), e.searchParams.append("session", D.session ? "1" : "0"), e.searchParams.append("caching", D.caching ? "1" : "0"), e.searchParams.append("lang-updated", this.map.isLanguageUpdated() ? "1" : "0"), e.searchParams.append("terrain", this.map.getTerrain() ? "1" : "0"), e.searchParams.append("globe", this.map.isGlobeProjection() ? "1" : "0"), this.registeredModules.size > 0 && e.searchParams.append("modules", Array.from(this.registeredModules).join("|")), e.href;
8286
8286
  }
8287
8287
  }
8288
- var ut = typeof Float32Array < "u" ? Float32Array : Array;
8288
+ var ct = typeof Float32Array < "u" ? Float32Array : Array;
8289
8289
  Math.hypot || (Math.hypot = function() {
8290
8290
  for (var r = 0, e = arguments.length; e--; )
8291
8291
  r += arguments[e] * arguments[e];
8292
8292
  return Math.sqrt(r);
8293
8293
  });
8294
- function tt() {
8295
- var r = new ut(16);
8296
- return ut != Float32Array && (r[1] = 0, r[2] = 0, r[3] = 0, r[4] = 0, r[6] = 0, r[7] = 0, r[8] = 0, r[9] = 0, r[11] = 0, r[12] = 0, r[13] = 0, r[14] = 0), r[0] = 1, r[5] = 1, r[10] = 1, r[15] = 1, r;
8294
+ function rt() {
8295
+ var r = new ct(16);
8296
+ return ct != Float32Array && (r[1] = 0, r[2] = 0, r[3] = 0, r[4] = 0, r[6] = 0, r[7] = 0, r[8] = 0, r[9] = 0, r[11] = 0, r[12] = 0, r[13] = 0, r[14] = 0), r[0] = 1, r[5] = 1, r[10] = 1, r[15] = 1, r;
8297
8297
  }
8298
8298
  function Vl(r, e, t, n, a, o, i, s, l, u, c, p, f, d, h, y, m) {
8299
8299
  return r[0] = e, r[1] = t, r[2] = n, r[3] = a, r[4] = o, r[5] = i, r[6] = s, r[7] = l, r[8] = u, r[9] = c, r[10] = p, r[11] = f, r[12] = d, r[13] = h, r[14] = y, r[15] = m, r;
@@ -8323,15 +8323,15 @@ function Wl(r, e, t, n, a) {
8323
8323
  return r[0] = o / t, r[1] = 0, r[2] = 0, r[3] = 0, r[4] = 0, r[5] = o, r[6] = 0, r[7] = 0, r[8] = 0, r[9] = 0, r[11] = -1, r[12] = 0, r[13] = 0, r[15] = 0, a != null && a !== 1 / 0 ? (i = 1 / (n - a), r[10] = (a + n) * i, r[14] = 2 * a * n * i) : (r[10] = -1, r[14] = -2 * n), r;
8324
8324
  }
8325
8325
  var Zl = Wl;
8326
- function Ct() {
8327
- var r = new ut(3);
8328
- return ut != Float32Array && (r[0] = 0, r[1] = 0, r[2] = 0), r;
8326
+ function Lt() {
8327
+ var r = new ct(3);
8328
+ return ct != Float32Array && (r[0] = 0, r[1] = 0, r[2] = 0), r;
8329
8329
  }
8330
8330
  function Yl(r, e, t) {
8331
- var n = new ut(3);
8331
+ var n = new ct(3);
8332
8332
  return n[0] = r, n[1] = e, n[2] = t, n;
8333
8333
  }
8334
- function fr(r, e) {
8334
+ function hr(r, e) {
8335
8335
  var t = e[0], n = e[1], a = e[2], o = t * t + n * n + a * a;
8336
8336
  return o > 0 && (o = 1 / Math.sqrt(o)), r[0] = e[0] * o, r[1] = e[1] * o, r[2] = e[2] * o, r;
8337
8337
  }
@@ -8340,7 +8340,7 @@ function Wn(r, e, t) {
8340
8340
  return r[0] = a * l - o * s, r[1] = o * i - n * l, r[2] = n * s - a * i, r;
8341
8341
  }
8342
8342
  (function() {
8343
- var r = Ct();
8343
+ var r = Lt();
8344
8344
  return function(e, t, n, a, o, i) {
8345
8345
  var s, l;
8346
8346
  for (t || (t = 3), n || (n = 0), a ? l = Math.min(a * t + n, e.length) : l = e.length, s = n; s < l; s += t)
@@ -8351,9 +8351,9 @@ function Wn(r, e, t) {
8351
8351
  function Jl(r) {
8352
8352
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
8353
8353
  }
8354
- var dr, Zn;
8354
+ var yr, Zn;
8355
8355
  function Ql() {
8356
- return Zn || (Zn = 1, dr = {
8356
+ return Zn || (Zn = 1, yr = {
8357
8357
  aliceblue: [240, 248, 255],
8358
8358
  antiquewhite: [250, 235, 215],
8359
8359
  aqua: [0, 255, 255],
@@ -8502,11 +8502,11 @@ function Ql() {
8502
8502
  whitesmoke: [245, 245, 245],
8503
8503
  yellow: [255, 255, 0],
8504
8504
  yellowgreen: [154, 205, 50]
8505
- }), dr;
8505
+ }), yr;
8506
8506
  }
8507
- var hr, Yn;
8507
+ var mr, Yn;
8508
8508
  function eo() {
8509
- if (Yn) return hr;
8509
+ if (Yn) return mr;
8510
8510
  Yn = 1;
8511
8511
  const r = Ql(), e = {};
8512
8512
  for (const a of Object.keys(r))
@@ -8528,7 +8528,7 @@ function eo() {
8528
8528
  apple: { channels: 3, labels: ["r16", "g16", "b16"] },
8529
8529
  gray: { channels: 1, labels: ["gray"] }
8530
8530
  };
8531
- hr = t;
8531
+ mr = t;
8532
8532
  for (const a of Object.keys(t)) {
8533
8533
  if (!("channels" in t[a]))
8534
8534
  throw new Error("missing channels property: " + a);
@@ -8805,11 +8805,11 @@ function eo() {
8805
8805
  return "000000".substring(s.length) + s;
8806
8806
  }, t.rgb.gray = function(a) {
8807
8807
  return [(a[0] + a[1] + a[2]) / 3 / 255 * 100];
8808
- }, hr;
8808
+ }, mr;
8809
8809
  }
8810
- var yr, Jn;
8810
+ var gr, Jn;
8811
8811
  function eu() {
8812
- if (Jn) return yr;
8812
+ if (Jn) return gr;
8813
8813
  Jn = 1;
8814
8814
  const r = eo();
8815
8815
  function e() {
@@ -8846,18 +8846,18 @@ function eu() {
8846
8846
  s.unshift(i[u].parent), l = n(r[i[u].parent][u], l), u = i[u].parent;
8847
8847
  return l.conversion = s, l;
8848
8848
  }
8849
- return yr = function(o) {
8849
+ return gr = function(o) {
8850
8850
  const i = t(o), s = {}, l = Object.keys(i);
8851
8851
  for (let u = l.length, c = 0; c < u; c++) {
8852
8852
  const p = l[c];
8853
8853
  i[p].parent !== null && (s[p] = a(p, i));
8854
8854
  }
8855
8855
  return s;
8856
- }, yr;
8856
+ }, gr;
8857
8857
  }
8858
- var mr, Qn;
8858
+ var vr, Qn;
8859
8859
  function tu() {
8860
- if (Qn) return mr;
8860
+ if (Qn) return vr;
8861
8861
  Qn = 1;
8862
8862
  const r = eo(), e = eu(), t = {}, n = Object.keys(r);
8863
8863
  function a(i) {
@@ -8888,7 +8888,7 @@ function tu() {
8888
8888
  const c = s[u];
8889
8889
  t[i][u] = o(c), t[i][u].raw = a(c);
8890
8890
  });
8891
- }), mr = t, mr;
8891
+ }), vr = t, vr;
8892
8892
  }
8893
8893
  var ru = tu();
8894
8894
  const nu = /* @__PURE__ */ Jl(ru);
@@ -8939,7 +8939,7 @@ function to({
8939
8939
  indexBufferLength: f
8940
8940
  };
8941
8941
  }
8942
- function Ir(r) {
8942
+ function At(r) {
8943
8943
  if (!r)
8944
8944
  return [1, 1, 1, 0];
8945
8945
  if (r === "transparent")
@@ -8962,9 +8962,9 @@ function Ir(r) {
8962
8962
  }
8963
8963
  return console.warn([`[parseColorStringToVec4]: Color ${r} is either not a valid color or its type is not supported, defaulting to black`]), [0, 0, 0, 1];
8964
8964
  }
8965
- let Ze;
8965
+ let Ye;
8966
8966
  function iu(r) {
8967
- return Ze = Ze ?? document.createElement("canvas").getContext("2d"), Ze ? (Ze.fillStyle = r, Ze.fillStyle) : "#000000";
8967
+ return Ye = Ye ?? document.createElement("canvas").getContext("2d"), Ye ? (Ye.fillStyle = r, Ye.fillStyle) : "#000000";
8968
8968
  }
8969
8969
  const un = 1, re = un / 2, ne = un / 2, ae = un / 2, su = [-0.5, -0.5, ae, re, -0.5, ae, re, ne, ae, -0.5, ne, ae], lu = [-0.5, -0.5, -0.5, -0.5, ne, -0.5, re, ne, -0.5, re, -0.5, -0.5], uu = [-0.5, ne, -0.5, -0.5, ne, ae, re, ne, ae, re, ne, -0.5], cu = [-0.5, -0.5, -0.5, re, -0.5, -0.5, re, -0.5, ae, -0.5, -0.5, ae], pu = [re, -0.5, -0.5, re, ne, -0.5, re, ne, ae, re, -0.5, ae], fu = [-0.5, -0.5, -0.5, -0.5, -0.5, ae, -0.5, ne, ae, -0.5, ne, -0.5], du = [...su, ...lu, ...uu, ...cu, ...pu, ...fu], hu = [
8970
8970
  // Front
@@ -9050,9 +9050,9 @@ void main(void) {
9050
9050
  }
9051
9051
  `;
9052
9052
  var mu = /* @__PURE__ */ ((r) => (r.UNIVERSE_DARK = "universe-dark", r))(mu || {});
9053
- const Pr = {
9053
+ const Ge = {
9054
9054
  stars: {
9055
- color: "white",
9055
+ color: "hsl(233,100%,92%)",
9056
9056
  preset: "stars"
9057
9057
  },
9058
9058
  space: {
@@ -9073,10 +9073,10 @@ const Pr = {
9073
9073
  }
9074
9074
  };
9075
9075
  var Ie = /* @__PURE__ */ ((r) => (r.POSITIVE_X = "pX", r.NEGATIVE_X = "nX", r.POSITIVE_Y = "pY", r.NEGATIVE_Y = "nY", r.POSITIVE_Z = "pZ", r.NEGATIVE_Z = "nZ", r))(Ie || {});
9076
- let gr, ra;
9076
+ let br, ra;
9077
9077
  function gu({ gl: r, faces: e, onLoadedCallback: t, forceRefresh: n }) {
9078
- if (gr && !n && ra === JSON.stringify(e))
9079
- return gr;
9078
+ if (br && !n && ra === JSON.stringify(e))
9079
+ return br;
9080
9080
  ra = JSON.stringify(e);
9081
9081
  const a = r.createTexture();
9082
9082
  if (r.bindTexture(r.TEXTURE_CUBE_MAP, a), !e) {
@@ -9100,7 +9100,7 @@ function gu({ gl: r, faces: e, onLoadedCallback: t, forceRefresh: n }) {
9100
9100
  r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texImage2D(u, 0, p, f, d, h), l === 5 && (r.bindTexture(r.TEXTURE_CUBE_MAP, a), r.generateMipmap(r.TEXTURE_CUBE_MAP), t !== void 0 && t());
9101
9101
  }, h.src = s;
9102
9102
  }
9103
- }), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR), gr = a, a;
9103
+ }), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR), br = a, a;
9104
9104
  }
9105
9105
  function vu(r, e) {
9106
9106
  if (e === Ie.POSITIVE_X)
@@ -9128,7 +9128,7 @@ function bu(r, e, t) {
9128
9128
  function Ce(r, e, t) {
9129
9129
  return r + (e - r) * t;
9130
9130
  }
9131
- const De = "https://api.maptiler.com/resources/space", wu = ["vertexPosition"], Su = ["projectionMatrix", "modelViewMatrix", "cubeSampler", "bgColor", "fadeOpacity"], na = "%USE_TEXTURE_MACRO_MARKER%", xu = "#define USE_TEXTURE", ku = Pr.stars;
9131
+ const De = "https://api.maptiler.com/resources/space", wu = ["vertexPosition"], Su = ["projectionMatrix", "modelViewMatrix", "cubeSampler", "bgColor", "fadeOpacity"], na = "%USE_TEXTURE_MACRO_MARKER%", xu = "#define USE_TEXTURE", ku = Ge.stars;
9132
9132
  function Cu(r, e) {
9133
9133
  if (r === !0)
9134
9134
  return e;
@@ -9139,11 +9139,14 @@ function Cu(r, e) {
9139
9139
  if (r.faces || r.path)
9140
9140
  return delete t.preset, t;
9141
9141
  const n = r.preset;
9142
- if (!(n in Pr))
9143
- throw new Error(`[CubemapLayer]: Invalid preset "${n}". Available presets: ${Object.keys(Pr).join(", ")}`);
9144
- return t;
9142
+ if (!(n in Ge))
9143
+ throw new Error(`[CubemapLayer]: Invalid preset "${n}". Available presets: ${Object.keys(Ge).join(", ")}`);
9144
+ return {
9145
+ ...t,
9146
+ color: t.color ?? Ge[n].color ?? "hsl(233,100%,92%)"
9147
+ };
9145
9148
  }
9146
- class vr {
9149
+ class wr {
9147
9150
  /**
9148
9151
  * Creates a new instance of CubemapLayer
9149
9152
  *
@@ -9259,7 +9262,7 @@ class vr {
9259
9262
  */
9260
9263
  S(this, "imageFadeInDelta", 0);
9261
9264
  const t = Cu(e, ku);
9262
- this.currentFacesDefinitionKey = JSON.stringify(t.faces ?? t.preset ?? t.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor = Ir(t.color), this.faces = aa(t), this.useCubemapTexture = this.faces !== null;
9265
+ this.currentFacesDefinitionKey = JSON.stringify(t.faces ?? t.preset ?? t.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor = At(t.color), this.faces = aa(t), this.useCubemapTexture = this.faces !== null;
9263
9266
  }
9264
9267
  /**
9265
9268
  * Updates the cubemap object with the current faces and shader configuration.
@@ -9394,11 +9397,11 @@ class vr {
9394
9397
  if (this.cubemap === void 0)
9395
9398
  throw new Error("[CubemapLayer]: Cubemap is undefined");
9396
9399
  this.texture === void 0 && console.warn("[CubemapLayer]: Texture is undefined, no teture will be rendered to cubemap"), e.disable(e.DEPTH_TEST), e.enable(e.BLEND), e.blendFunc(e.SRC_ALPHA, e.DST_ALPHA), e.useProgram(this.cubemap.shaderProgram), e.bindBuffer(e.ARRAY_BUFFER, this.cubemap.positionBuffer), e.vertexAttribPointer(this.cubemap.programInfo.attributesLocations.vertexPosition, 3, e.FLOAT, !1, 0, 0), e.enableVertexAttribArray(this.cubemap.programInfo.attributesLocations.vertexPosition);
9397
- const n = 0.1, a = 1e4, o = e.canvas, i = o.clientWidth / o.clientHeight, s = this.map.transform, l = s.fov * (Math.PI / 180), u = tt();
9400
+ const n = 0.1, a = 1e4, o = e.canvas, i = o.clientWidth / o.clientHeight, s = this.map.transform, l = s.fov * (Math.PI / 180), u = rt();
9398
9401
  Zl(u, l, i, n, a), Xn(u, u, s.rollInRadians), Kn(u, u, -s.pitchInRadians), Xn(u, u, s.bearingInRadians);
9399
9402
  const c = s.center.lat * Math.PI / 180, p = s.center.lng * Math.PI / 180;
9400
9403
  Kn(u, u, c), Xl(u, u, -p), e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.projectionMatrix, !1, u);
9401
- const f = tt();
9404
+ const f = rt();
9402
9405
  if (e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.modelViewMatrix, !1, f), e.uniform4fv(this.cubemap.programInfo.uniformsLocations.bgColor, new Float32Array(this.bgColor)), this.texture === void 0 && console.warn("[CubemapLayer]: Texture is undefined, no texture will be rendered to cubemap"), this.useCubemapTexture && this.texture && (e.uniform1f(this.cubemap.programInfo.uniformsLocations.fadeOpacity, this.currentFadeOpacity), e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_CUBE_MAP, this.texture), e.uniform1i(this.cubemap.programInfo.uniformsLocations.cubeSampler, 0)), this.cubemap.indexBuffer === void 0)
9403
9406
  throw new Error("Index buffer is undefined");
9404
9407
  if (this.cubemap.indexBufferLength === void 0)
@@ -9424,10 +9427,16 @@ class vr {
9424
9427
  * Finally, it calls `updateCubemap` to apply the changes and trigger a repaint of the map.
9425
9428
  */
9426
9429
  async setCubemap(e) {
9427
- const t = Ir(e.color);
9428
- e.color && this.targetBgColor.toString() !== t.toString() && this.setBgColor(t);
9429
- const n = JSON.stringify(e.faces ?? e.preset ?? e.path);
9430
- n && this.currentFacesDefinitionKey !== n && await this.setCubemapFaces(e), this.updateCubemap();
9430
+ const t = JSON.stringify(e.faces ?? e.preset ?? e.path);
9431
+ t && this.currentFacesDefinitionKey !== t && await this.setCubemapFaces(e);
9432
+ const n = At(e.color);
9433
+ if (e.color && this.targetBgColor.toString() !== n.toString())
9434
+ this.setBgColor(n);
9435
+ else if (e.preset && e.preset in Ge) {
9436
+ const a = Ge[e.preset];
9437
+ this.setBgColor(At(a.color));
9438
+ }
9439
+ this.updateCubemap();
9431
9440
  }
9432
9441
  /**
9433
9442
  * Shows the cubemap layer by setting its visibility to "visible".
@@ -9537,18 +9546,18 @@ void main() {
9537
9546
  // gl_FragColor = color;
9538
9547
  gl_FragColor = vec4(color.rgb * color.a, color.a);
9539
9548
  }
9540
- `, Ye = 2, Eu = ["position"], Tu = ["matrix", "rotationMatrix", "stopsNumber", "stops", "colors", "maxDistance", "scale"], _u = [
9549
+ `, Je = 2, Eu = ["position"], Tu = ["matrix", "rotationMatrix", "stopsNumber", "stops", "colors", "maxDistance", "scale"], _u = [
9541
9550
  -2,
9542
9551
  -2,
9543
9552
  0,
9544
- Ye,
9553
+ Je,
9545
9554
  -2,
9546
9555
  0,
9547
9556
  -2,
9548
- Ye,
9557
+ Je,
9549
9558
  0,
9550
- Ye,
9551
- Ye,
9559
+ Je,
9560
+ Je,
9552
9561
  0
9553
9562
  ], oa = {
9554
9563
  scale: 0.9,
@@ -9558,7 +9567,7 @@ void main() {
9558
9567
  [0.2, "rgba(98, 168, 229, 0.0)"]
9559
9568
  ]
9560
9569
  }, ia = 0.075;
9561
- class br {
9570
+ class Sr {
9562
9571
  /**
9563
9572
  * Creates a new RadialGradientLayer instance.
9564
9573
  *
@@ -9695,26 +9704,26 @@ class br {
9695
9704
  e.disable(e.DEPTH_TEST), e.enable(e.BLEND), e.useProgram(this.plane.shaderProgram), e.bindBuffer(e.ARRAY_BUFFER, this.plane.positionBuffer);
9696
9705
  const n = this.plane.programInfo.attributesLocations.position;
9697
9706
  e.enableVertexAttribArray(n), e.vertexAttribPointer(n, 3, e.FLOAT, !1, 0, 0);
9698
- const a = tt(), o = this.scale;
9707
+ const a = rt(), o = this.scale;
9699
9708
  Kl(a, a, [o, o, o]);
9700
- const i = tt();
9709
+ const i = rt();
9701
9710
  Hl(i, t.defaultProjectionData.mainMatrix, a);
9702
9711
  const s = this.plane.programInfo.uniformsLocations.matrix;
9703
9712
  e.uniformMatrix4fv(s, !1, i);
9704
- const l = tt(), u = this.map.transform.cameraPosition, c = fr(Ct(), u), p = Yl(0, 1, 0), f = Ct();
9705
- Wn(f, p, c), fr(f, f);
9706
- const d = Ct();
9707
- Wn(d, c, f), fr(d, d), Vl(l, f[0], f[1], f[2], 0, d[0], d[1], d[2], 0, c[0], c[1], c[2], 0, 0, 0, 0, 1);
9713
+ const l = rt(), u = this.map.transform.cameraPosition, c = hr(Lt(), u), p = Yl(0, 1, 0), f = Lt();
9714
+ Wn(f, p, c), hr(f, f);
9715
+ const d = Lt();
9716
+ Wn(d, c, f), hr(d, d), Vl(l, f[0], f[1], f[2], 0, d[0], d[1], d[2], 0, c[0], c[1], c[2], 0, 0, 0, 0, 1);
9708
9717
  const h = this.plane.programInfo.uniformsLocations.rotationMatrix;
9709
9718
  e.uniformMatrix4fv(h, !1, l);
9710
9719
  const y = this.gradient.stops.length, m = [], w = [];
9711
9720
  for (let v = 0; v <= y; v++)
9712
9721
  if (v < y) {
9713
9722
  m[v] = this.gradient.stops[v][0];
9714
- const x = Ir(this.gradient.stops[v][1]);
9723
+ const x = At(this.gradient.stops[v][1]);
9715
9724
  w.push(...x);
9716
9725
  }
9717
- e.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber, y), e.uniform1fv(this.plane.programInfo.uniformsLocations.stops, new Float32Array(m)), e.uniform4fv(this.plane.programInfo.uniformsLocations.colors, new Float32Array(w)), e.uniform1f(this.plane.programInfo.uniformsLocations.maxDistance, Ye), e.uniform1f(this.plane.programInfo.uniformsLocations.scale, o), e.drawArrays(e.TRIANGLE_STRIP, 0, 4);
9726
+ e.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber, y), e.uniform1fv(this.plane.programInfo.uniformsLocations.stops, new Float32Array(m)), e.uniform4fv(this.plane.programInfo.uniformsLocations.colors, new Float32Array(w)), e.uniform1f(this.plane.programInfo.uniformsLocations.maxDistance, Je), e.uniform1f(this.plane.programInfo.uniformsLocations.scale, o), e.drawArrays(e.TRIANGLE_STRIP, 0, 4);
9718
9727
  }
9719
9728
  /**
9720
9729
  * Sets a new gradient for the radial gradient layer and animates the transition.
@@ -9735,7 +9744,7 @@ class br {
9735
9744
  this.map.setLayoutProperty(this.id, "visibility", "none");
9736
9745
  }
9737
9746
  }
9738
- function St(r) {
9747
+ function xt(r) {
9739
9748
  var a;
9740
9749
  const { map: e, property: t } = r, n = e.getStyle();
9741
9750
  return n ? (a = n.metadata) != null && a.maptiler ? n.metadata.maptiler[t] ? n.metadata.maptiler[t] : null : (console.warn(`[extractCustomLayerStyle]: No custom layer metadata found in the style for property \`${t}\`. The property will use default values.`), null) : (console.warn("[extractCustomLayerStyle]: `Map.getStyle()` is returning undefined, are you initiating before style is ready?"), null);
@@ -9791,7 +9800,7 @@ let Iu = class ro extends k.Map {
9791
9800
  this.options = t, this.setStyle(n), a && this.monitorStyleUrl(n);
9792
9801
  const u = () => {
9793
9802
  let h = "The distant style could not be loaded.";
9794
- this.getStyle() ? h += "Leaving the style as is." : (this.setStyle(Je.STREETS), h += `Loading default MapTiler Cloud style "${Je.STREETS.getDefaultVariant().getId()}" as a fallback.`), console.warn(h);
9803
+ this.getStyle() ? h += "Leaving the style as is." : (this.setStyle(Qe.STREETS), h += `Loading default MapTiler Cloud style "${Qe.STREETS.getDefaultVariant().getId()}" as a fallback.`), console.warn(h);
9795
9804
  };
9796
9805
  if (this.on("style.load", () => {
9797
9806
  this.styleInProcess = !1;
@@ -9807,7 +9816,7 @@ let Iu = class ro extends k.Map {
9807
9816
  u();
9808
9817
  return;
9809
9818
  }
9810
- }), D.caching && !xr && console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"), D.caching && xr && Bo(), typeof t.language > "u")
9819
+ }), D.caching && !Cr && console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"), D.caching && Cr && Bo(), typeof t.language > "u")
9811
9820
  this.primaryLanguage = D.primaryLanguage;
9812
9821
  else {
9813
9822
  const h = yn(t.language, R);
@@ -9936,9 +9945,9 @@ let Iu = class ro extends k.Map {
9936
9945
  canvasContextAttributes: L,
9937
9946
  refreshExpiredTiles: $,
9938
9947
  maxBounds: Te,
9939
- scrollZoom: We,
9940
- minZoom: mt,
9941
- maxZoom: gt,
9948
+ scrollZoom: Ze,
9949
+ minZoom: gt,
9950
+ maxZoom: vt,
9942
9951
  boxZoom: go,
9943
9952
  locale: vo,
9944
9953
  fadeDuration: bo,
@@ -9949,7 +9958,7 @@ let Iu = class ro extends k.Map {
9949
9958
  pixelRatio: Co,
9950
9959
  validateStyle: Lo
9951
9960
  } = t;
9952
- this.minimap = new pr(h, {
9961
+ this.minimap = new dr(h, {
9953
9962
  zoom: y,
9954
9963
  center: m,
9955
9964
  style: w,
@@ -9960,9 +9969,9 @@ let Iu = class ro extends k.Map {
9960
9969
  canvasContextAttributes: L,
9961
9970
  refreshExpiredTiles: $,
9962
9971
  maxBounds: Te,
9963
- scrollZoom: We,
9964
- minZoom: mt,
9965
- maxZoom: gt,
9972
+ scrollZoom: Ze,
9973
+ minZoom: gt,
9974
+ maxZoom: vt,
9966
9975
  boxZoom: go,
9967
9976
  locale: vo,
9968
9977
  fadeDuration: bo,
@@ -9973,7 +9982,7 @@ let Iu = class ro extends k.Map {
9973
9982
  pixelRatio: Co,
9974
9983
  validateStyle: Lo
9975
9984
  }), this.addControl(this.minimap, h.position ?? "bottom-left");
9976
- } else h === !0 ? (this.minimap = new pr({}, t), this.addControl(this.minimap, "bottom-left")) : h !== void 0 && h !== !1 && (this.minimap = new pr({}, t), this.addControl(this.minimap, h));
9985
+ } else h === !0 ? (this.minimap = new dr({}, t), this.addControl(this.minimap, "bottom-left")) : h !== void 0 && h !== !1 && (this.minimap = new dr({}, t), this.addControl(this.minimap, h));
9977
9986
  });
9978
9987
  const d = (h) => {
9979
9988
  h.terrain && (p = !0, f = {
@@ -10002,7 +10011,7 @@ let Iu = class ro extends k.Map {
10002
10011
  this.space.setCubemap(t);
10003
10012
  return;
10004
10013
  }
10005
- this.space = new vr(t), this.once("load", () => {
10014
+ this.space = new wr(t), this.once("load", () => {
10006
10015
  const n = this.getLayersOrder()[0];
10007
10016
  this.space && this.addLayer(this.space, n);
10008
10017
  });
@@ -10016,36 +10025,40 @@ let Iu = class ro extends k.Map {
10016
10025
  (a = (n = t.metadata) == null ? void 0 : n.maptiler) != null && a.halo && ((o = this.halo) == null || o.setGradient(t.metadata.maptiler.halo));
10017
10026
  }
10018
10027
  setSpaceFromCurrentStyle() {
10019
- const t = St({ map: this, property: "space" });
10028
+ const t = xt({ map: this, property: "space" });
10020
10029
  if (t && this.space) {
10021
10030
  this.space.setCubemap(t);
10022
10031
  return;
10023
10032
  }
10024
10033
  }
10025
10034
  setHaloFromCurrentStyle() {
10026
- const t = St({ map: this, property: "halo" });
10035
+ const t = xt({ map: this, property: "halo" });
10027
10036
  if (t && this.halo) {
10028
10037
  this.halo.setGradient(t);
10029
10038
  return;
10030
10039
  }
10031
10040
  }
10032
10041
  initSpace({ options: t = this.options, before: n }) {
10033
- if (this.space && this.getLayer(this.space.id) || t.space === !1) return;
10034
- const a = St({ map: this, property: "space" });
10042
+ if (this.space) {
10043
+ this.getLayer(this.space.id) || this.addLayer(this.space, n);
10044
+ return;
10045
+ }
10046
+ if (t.space === !1) return;
10047
+ const a = xt({ map: this, property: "space" });
10035
10048
  if (t.space) {
10036
- this.space = new vr(t.space), this.addLayer(this.space, n);
10049
+ this.space = new wr(t.space), this.addLayer(this.space, n);
10037
10050
  return;
10038
10051
  }
10039
- a && (this.space = new vr(a), this.addLayer(this.space, n));
10052
+ a && (this.space = new wr(a), this.addLayer(this.space, n));
10040
10053
  }
10041
10054
  initHalo({ options: t = this.options, before: n }) {
10042
10055
  if (this.halo && this.getLayer(this.halo.id) || t.halo === !1) return;
10043
- const a = St({ map: this, property: "halo" });
10056
+ const a = xt({ map: this, property: "halo" });
10044
10057
  if (t.halo) {
10045
- this.halo = new br(t.halo), this.addLayer(this.halo, n);
10058
+ this.halo = new Sr(t.halo), this.addLayer(this.halo, n);
10046
10059
  return;
10047
10060
  }
10048
- a && (this.halo = new br(a), this.addLayer(this.halo, n));
10061
+ a && (this.halo = new Sr(a), this.addLayer(this.halo, n));
10049
10062
  }
10050
10063
  getHalo() {
10051
10064
  return this.halo;
@@ -10055,7 +10068,7 @@ let Iu = class ro extends k.Map {
10055
10068
  this.halo.setGradient(t);
10056
10069
  return;
10057
10070
  }
10058
- this.halo = new br(t), this.once("load", () => {
10071
+ this.halo = new Sr(t), this.once("load", () => {
10059
10072
  var s;
10060
10073
  const n = this.getLayersOrder(), a = n[0], o = n.indexOf(((s = this.space) == null ? void 0 : s.id) ?? "") + 2, i = n[o];
10061
10074
  this.halo && this.addLayer(this.halo, this.space ? i : a);
@@ -10184,9 +10197,9 @@ let Iu = class ro extends k.Map {
10184
10197
  this.space ? this.setSpaceFromCurrentStyle() : this.initSpace({ before: s }), this.halo ? this.setHaloFromCurrentStyle() : this.initHalo({ before: s });
10185
10198
  });
10186
10199
  try {
10187
- console.log("[Map.setStyle]: Setting style:", a.style), super.setStyle(a.style, n);
10200
+ super.setStyle(a.style, n);
10188
10201
  } catch (s) {
10189
- this.styleInProcess = !1, console.error("[Map.setStyle]: Error while setting style:", s);
10202
+ console.error("[Map.setStyle]: Error while setting style:", s);
10190
10203
  }
10191
10204
  return this;
10192
10205
  }
@@ -10687,16 +10700,16 @@ function Ru(r) {
10687
10700
  times: n
10688
10701
  };
10689
10702
  }
10690
- function Lt(r) {
10703
+ function Et(r) {
10691
10704
  const e = ["Polygon", "LineString", "Point", "Track", "gx:Track"];
10692
10705
  let t, n, a, o, i;
10693
10706
  const s = [], l = [];
10694
10707
  if (E(r, "MultiGeometry") !== null)
10695
- return Lt(E(r, "MultiGeometry"));
10708
+ return Et(E(r, "MultiGeometry"));
10696
10709
  if (E(r, "MultiTrack") !== null)
10697
- return Lt(E(r, "MultiTrack"));
10710
+ return Et(E(r, "MultiTrack"));
10698
10711
  if (E(r, "gx:MultiTrack") !== null)
10699
- return Lt(E(r, "gx:MultiTrack"));
10712
+ return Et(E(r, "gx:MultiTrack"));
10700
10713
  for (a = 0; a < e.length; a++)
10701
10714
  if (n = G(r, e[a]), n) {
10702
10715
  for (o = 0; o < n.length; o++)
@@ -10729,7 +10742,7 @@ function Lt(r) {
10729
10742
  return { geoms: s, coordTimes: l };
10730
10743
  }
10731
10744
  function zu(r, e, t, n) {
10732
- const a = Lt(r), o = {}, i = O(E(r, "name")), s = O(E(r, "address")), l = O(E(r, "description")), u = E(r, "TimeSpan"), c = E(r, "TimeStamp"), p = E(r, "ExtendedData"), f = E(r, "visibility");
10745
+ const a = Et(r), o = {}, i = O(E(r, "name")), s = O(E(r, "address")), l = O(E(r, "description")), u = E(r, "TimeSpan"), c = E(r, "TimeStamp"), p = E(r, "ExtendedData"), f = E(r, "visibility");
10733
10746
  let d, h = O(E(r, "styleUrl")), y = E(r, "LineStyle"), m = E(r, "PolyStyle");
10734
10747
  if (!a.geoms.length) return [];
10735
10748
  if (i && (o.name = i), s && (o.address = s), h) {
@@ -10986,13 +10999,13 @@ const zr = [
10986
10999
  // https://colorhunt.co/palette/10a19d540375ff7000ffbf00
10987
11000
  ["#10A19D", "#540375", "#FF7000", "#FFBF00"]
10988
11001
  ];
10989
- function Jt() {
11002
+ function er() {
10990
11003
  return zr[~~(Math.random() * zr.length)][~~(Math.random() * 4)];
10991
11004
  }
10992
- function ht() {
11005
+ function yt() {
10993
11006
  return `maptiler_source_${da()}`;
10994
11007
  }
10995
- function yt() {
11008
+ function mt() {
10996
11009
  return `maptiler_layer_${da()}`;
10997
11010
  }
10998
11011
  function Fr(r, e) {
@@ -11101,12 +11114,12 @@ function yo(r, e = 10) {
11101
11114
  }).flat()
11102
11115
  ];
11103
11116
  }
11104
- function xt(r) {
11117
+ function kt(r) {
11105
11118
  const e = r.toString(16);
11106
11119
  return e.length === 1 ? `0${e}` : e;
11107
11120
  }
11108
11121
  function Bu(r) {
11109
- return `#${xt(r[0])}${xt(r[1])}${xt(r[2])}${r.length === 4 ? xt(r[3]) : ""}`;
11122
+ return `#${kt(r[0])}${kt(r[1])}${kt(r[2])}${r.length === 4 ? kt(r[3]) : ""}`;
11110
11123
  }
11111
11124
  class C extends Array {
11112
11125
  constructor(t = {}) {
@@ -12048,7 +12061,7 @@ async function qu(r, e, t = {}) {
12048
12061
  throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");
12049
12062
  let n = e.data;
12050
12063
  if (typeof n == "string") {
12051
- if (Ft(n))
12064
+ if (Ot(n))
12052
12065
  n = `https://api.maptiler.com/data/${e.data}/features.json?key=${D.apiKey}`;
12053
12066
  else if (((a = n.split(".").pop()) == null ? void 0 : a.toLowerCase().trim()) === "gpx") {
12054
12067
  const s = await (await fetch(n, t)).text();
@@ -12071,7 +12084,7 @@ async function qu(r, e, t = {}) {
12071
12084
  function Gu(r, e) {
12072
12085
  if (e.layerId && r.getLayer(e.layerId))
12073
12086
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
12074
- const t = e.sourceId ?? ht(), n = e.layerId ?? yt(), a = {
12087
+ const t = e.sourceId ?? yt(), n = e.layerId ?? mt(), a = {
12075
12088
  polylineLayerId: n,
12076
12089
  polylineOutlineLayerId: "",
12077
12090
  polylineSourceId: t
@@ -12080,7 +12093,7 @@ function Gu(r, e) {
12080
12093
  type: "geojson",
12081
12094
  data: e.data
12082
12095
  });
12083
- const o = e.lineWidth ?? 3, i = e.lineColor ?? Jt(), s = e.lineOpacity ?? 1, l = e.lineBlur ?? 0, u = e.lineGapWidth ?? 0;
12096
+ const o = e.lineWidth ?? 3, i = e.lineColor ?? er(), s = e.lineOpacity ?? 1, l = e.lineBlur ?? 0, u = e.lineGapWidth ?? 0;
12084
12097
  let c = e.lineDashArray ?? null;
12085
12098
  const p = e.outlineWidth ?? 1, f = e.outlineColor ?? "#FFFFFF", d = e.outlineOpacity ?? 1, h = e.outlineBlur ?? 0;
12086
12099
  if (typeof c == "string" && (c = fn(c)), e.outline === !0) {
@@ -12137,20 +12150,20 @@ function Gu(r, e) {
12137
12150
  function Vu(r, e) {
12138
12151
  if (e.layerId && r.getLayer(e.layerId))
12139
12152
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
12140
- const t = e.sourceId ?? ht(), n = e.layerId ?? yt(), a = {
12153
+ const t = e.sourceId ?? yt(), n = e.layerId ?? mt(), a = {
12141
12154
  polygonLayerId: n,
12142
12155
  polygonOutlineLayerId: e.outline ? `${n}_outline` : "",
12143
12156
  polygonSourceId: t
12144
12157
  };
12145
12158
  if (e.data && !r.getSource(t)) {
12146
12159
  let y = e.data;
12147
- typeof y == "string" && Ft(y) && (y = `https://api.maptiler.com/data/${y}/features.json?key=${D.apiKey}`), r.addSource(t, {
12160
+ typeof y == "string" && Ot(y) && (y = `https://api.maptiler.com/data/${y}/features.json?key=${D.apiKey}`), r.addSource(t, {
12148
12161
  type: "geojson",
12149
12162
  data: y
12150
12163
  });
12151
12164
  }
12152
12165
  let o = e.outlineDashArray ?? null;
12153
- const i = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ?? Jt(), p = e.fillOpacity ?? 1, f = e.outlinePosition ?? "center", d = e.pattern ?? null;
12166
+ const i = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ?? er(), p = e.fillOpacity ?? 1, f = e.outlinePosition ?? "center", d = e.pattern ?? null;
12154
12167
  typeof o == "string" && (o = fn(o));
12155
12168
  const h = (y = null) => {
12156
12169
  if (r.addLayer(
@@ -12220,7 +12233,7 @@ function Vu(r, e) {
12220
12233
  function Hu(r, e) {
12221
12234
  if (e.layerId && r.getLayer(e.layerId))
12222
12235
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
12223
- const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : mo.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ?? ht(), u = e.layerId ?? yt(), c = e.showLabel ?? a, p = e.alignOnViewport ?? !0, f = e.outline ?? !1, d = e.outlineOpacity ?? 1, h = e.outlineWidth ?? 1, y = e.outlineColor ?? "#FFFFFF";
12236
+ const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : mo.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ?? yt(), u = e.layerId ?? mt(), c = e.showLabel ?? a, p = e.alignOnViewport ?? !0, f = e.outline ?? !1, d = e.outlineOpacity ?? 1, h = e.outlineWidth ?? 1, y = e.outlineColor ?? "#FFFFFF";
12224
12237
  let m;
12225
12238
  const w = e.zoomCompensation ?? !0, v = e.minzoom ?? 0, x = e.maxzoom ?? 23;
12226
12239
  typeof e.pointOpacity == "number" ? m = e.pointOpacity : Array.isArray(e.pointOpacity) ? m = z(e.pointOpacity) : e.cluster ? m = jr(i, "point_count") : e.property ? m = jr(i, e.property) : m = z([
@@ -12237,7 +12250,7 @@ function Hu(r, e) {
12237
12250
  };
12238
12251
  if (e.data && !r.getSource(l)) {
12239
12252
  let L = e.data;
12240
- typeof L == "string" && Ft(L) && (L = `https://api.maptiler.com/data/${L}/features.json?key=${D.apiKey}`), r.addSource(l, {
12253
+ typeof L == "string" && Ot(L) && (L = `https://api.maptiler.com/data/${L}/features.json?key=${D.apiKey}`), r.addSource(l, {
12241
12254
  type: "geojson",
12242
12255
  data: L,
12243
12256
  cluster: a
@@ -12246,11 +12259,11 @@ function Hu(r, e) {
12246
12259
  if (a) {
12247
12260
  A.clusterLayerId = `${u}_cluster`;
12248
12261
  const L = Array.from({ length: o }, ($, Te) => {
12249
- const We = s.min + Te * (s.max - s.min) / (o - 1);
12262
+ const Ze = s.min + Te * (s.max - s.min) / (o - 1);
12250
12263
  return {
12251
- value: We,
12264
+ value: Ze,
12252
12265
  pointRadius: t + (n - t) * (Te / (o - 1)) ** 0.5,
12253
- color: i.getColorHex(We)
12266
+ color: i.getColorHex(Ze)
12254
12267
  };
12255
12268
  });
12256
12269
  r.addLayer(
@@ -12303,7 +12316,7 @@ function Hu(r, e) {
12303
12316
  e.beforeId
12304
12317
  );
12305
12318
  } else {
12306
- let L = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : Jt(), $ = typeof e.pointRadius == "number" ? w ? z([
12319
+ let L = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : er(), $ = typeof e.pointRadius == "number" ? w ? z([
12307
12320
  { zoom: 0, value: e.pointRadius * 0.025 },
12308
12321
  { zoom: 2, value: e.pointRadius * 0.05 },
12309
12322
  { zoom: 4, value: e.pointRadius * 0.1 },
@@ -12317,12 +12330,12 @@ function Hu(r, e) {
12317
12330
  { zoom: 16, value: t * 1 }
12318
12331
  ]) : t;
12319
12332
  if (e.property && Array.isArray(e.pointColor)) {
12320
- const Te = Array.from({ length: o }, (We, mt) => {
12321
- const gt = s.min + mt * (s.max - s.min) / (o - 1);
12333
+ const Te = Array.from({ length: o }, (Ze, gt) => {
12334
+ const vt = s.min + gt * (s.max - s.min) / (o - 1);
12322
12335
  return {
12323
- value: gt,
12324
- pointRadius: typeof e.pointRadius == "number" ? e.pointRadius : t + (n - t) * (mt / (o - 1)) ** 0.5,
12325
- color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(gt)
12336
+ value: vt,
12337
+ pointRadius: typeof e.pointRadius == "number" ? e.pointRadius : t + (n - t) * (gt / (o - 1)) ** 0.5,
12338
+ color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(vt)
12326
12339
  };
12327
12340
  });
12328
12341
  L = $r(Te, e.property), $ = Or(Te, e.property, w);
@@ -12387,7 +12400,7 @@ function Hu(r, e) {
12387
12400
  function Ku(r, e) {
12388
12401
  if (e.layerId && r.getLayer(e.layerId))
12389
12402
  throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
12390
- const t = e.sourceId ?? ht(), n = e.layerId ?? yt(), a = e.minzoom ?? 0, o = e.maxzoom ?? 23, i = e.zoomCompensation ?? !0, s = e.opacity ?? [
12403
+ const t = e.sourceId ?? yt(), n = e.layerId ?? mt(), a = e.minzoom ?? 0, o = e.maxzoom ?? 23, i = e.zoomCompensation ?? !0, s = e.opacity ?? [
12391
12404
  { zoom: a, value: 0 },
12392
12405
  { zoom: a + 0.25, value: 1 },
12393
12406
  { zoom: o - 0.25, value: 1 },
@@ -12418,7 +12431,7 @@ function Ku(r, e) {
12418
12431
  };
12419
12432
  if (e.data && !r.getSource(t)) {
12420
12433
  let v = e.data;
12421
- typeof v == "string" && Ft(v) && (v = `https://api.maptiler.com/data/${v}/features.json?key=${D.apiKey}`), r.addSource(t, {
12434
+ typeof v == "string" && Ot(v) && (v = `https://api.maptiler.com/data/${v}/features.json?key=${D.apiKey}`), r.addSource(t, {
12422
12435
  type: "geojson",
12423
12436
  data: v
12424
12437
  });
@@ -12451,9 +12464,9 @@ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12451
12464
  colorPalettes: zr,
12452
12465
  computeRampedOutlineWidth: po,
12453
12466
  dashArrayMaker: fn,
12454
- generateRandomLayerName: yt,
12455
- generateRandomSourceName: ht,
12456
- getRandomColor: Jt,
12467
+ generateRandomLayerName: mt,
12468
+ generateRandomSourceName: yt,
12469
+ getRandomColor: er,
12457
12470
  heatmapIntensityFromColorRamp: yo,
12458
12471
  lerpZoomNumberValues: Fr,
12459
12472
  opacityDrivenByProperty: jr,
@@ -12466,7 +12479,7 @@ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12466
12479
  }, Symbol.toStringTag, { value: "Module" }));
12467
12480
  qo();
12468
12481
  function kc() {
12469
- return "3.4.0";
12482
+ return "3.4.1-rc1";
12470
12483
  }
12471
12484
  const Cc = k.Map, Lc = k.Marker, Ac = k.Popup, Ec = k.Style, Tc = k.CanvasSource, _c = k.GeoJSONSource, Mc = k.ImageSource, Ic = k.RasterTileSource, Pc = k.RasterDEMTileSource, Rc = k.VectorTileSource, zc = k.VideoSource, Fc = k.NavigationControl, $c = k.GeolocateControl, Oc = k.AttributionControl, jc = k.LogoControl, Nc = k.ScaleControl, Dc = k.FullscreenControl, Uc = k.TerrainControl, Bc = k.BoxZoomHandler, qc = k.ScrollZoomHandler, Gc = k.CooperativeGesturesHandler, Vc = k.KeyboardHandler, Hc = k.TwoFingersTouchPitchHandler, Kc = k.MapWheelEvent, Xc = k.MapTouchEvent, Wc = k.MapMouseEvent, Zc = k.config, Yc = k.getVersion, {
12472
12485
  setRTLTextPlugin: Jc,
@@ -12512,7 +12525,7 @@ export {
12512
12525
  Gc as CooperativeGesturesHandlerMLGL,
12513
12526
  Ie as CubemapFaceNames,
12514
12527
  mu as CubemapImagesPresets,
12515
- vr as CubemapLayer,
12528
+ wr as CubemapLayer,
12516
12529
  ge as DOMcreate,
12517
12530
  ln as DOMremove,
12518
12531
  dp as DoubleClickZoomHandler,
@@ -12560,7 +12573,7 @@ export {
12560
12573
  lp as Point,
12561
12574
  nc as Popup,
12562
12575
  Ac as PopupMLGL,
12563
- br as RadialGradientLayer,
12576
+ Sr as RadialGradientLayer,
12564
12577
  uc as RasterDEMTileSource,
12565
12578
  Pc as RasterDEMTileSourceMLGL,
12566
12579
  lc as RasterTileSource,
@@ -12594,7 +12607,7 @@ export {
12594
12607
  D as config,
12595
12608
  Zc as configMLGL,
12596
12609
  Fp as coordinates,
12597
- Pr as cubemapPresets,
12610
+ Ge as cubemapPresets,
12598
12611
  $p as data,
12599
12612
  ec as displayWebGLContextLostWarning,
12600
12613
  Op as elevation,