@maptiler/sdk 3.5.1-rc6 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -3,11 +3,11 @@ var fn = (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),
|
|
7
|
-
var P = (r, e, t) => (
|
|
6
|
+
var S = (r, e, t) => Eo(r, typeof e != "symbol" ? e + "" : e, t), tr = (r, e, t) => e.has(r) || fn("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) ? fn("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 dn, config as
|
|
10
|
-
import { MapStyle as Tp, MapStyleVariant as _p, ReferenceMapStyle as Ip, ServiceError as Mp, areSameLanguages as Pp, bufferToPixelDataBrowser as Rp, circumferenceAtLatitude as zp, coordinates as Fp, data as $p, elevation as Op, expandMapStyle as
|
|
9
|
+
import { Language as To, getLanguageInfoFromCode as dn, config as rr, MapStyle as Qe, mapStylePresetList as nr, expandMapStyle as _o, MapStyleVariant as Io, ReferenceMapStyle as Mo, toLanguageInfo as hn, getLanguageInfoFromFlag as Po, geolocation as yn } from "@maptiler/client";
|
|
10
|
+
import { MapStyle as Tp, MapStyleVariant as _p, ReferenceMapStyle as Ip, ServiceError as Mp, areSameLanguages as Pp, bufferToPixelDataBrowser as Rp, circumferenceAtLatitude as zp, coordinates as Fp, data as $p, elevation as Op, expandMapStyle as Np, geocoding as jp, 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 Zp, misc as Wp, 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";
|
|
13
13
|
import { Base64 as Fo } from "js-base64";
|
|
@@ -79,7 +79,7 @@ const V = {
|
|
|
79
79
|
terrainSourceId: "maptiler-terrain"
|
|
80
80
|
};
|
|
81
81
|
Object.freeze(V);
|
|
82
|
-
const
|
|
82
|
+
const Nr = zo();
|
|
83
83
|
class $o extends Ro {
|
|
84
84
|
constructor() {
|
|
85
85
|
super(...arguments);
|
|
@@ -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,
|
|
152
|
+
this._apiKey = t, rr.apiKey = t, this.emit("apiKey", t);
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Get the MapTiler Cloud API key
|
|
@@ -161,16 +161,16 @@ 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
|
-
|
|
164
|
+
rr.fetch = t;
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* Get the fetch fucntion
|
|
168
168
|
*/
|
|
169
169
|
get fetch() {
|
|
170
|
-
return
|
|
170
|
+
return rr.fetch;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
const D = new $o(), Sr = "localcache_source", xr = "localcache", Oo = "maptiler_sdk",
|
|
173
|
+
const D = new $o(), Sr = "localcache_source", xr = "localcache", Oo = "maptiler_sdk", No = 1e3, jo = 100, kr = typeof caches < "u", { addProtocol: gn } = k;
|
|
174
174
|
function Do(r, e) {
|
|
175
175
|
if (kr && D.caching && D.session && r.host === V.maptilerApiHost) {
|
|
176
176
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
@@ -180,13 +180,13 @@ function Do(r, e) {
|
|
|
180
180
|
}
|
|
181
181
|
return r.href;
|
|
182
182
|
}
|
|
183
|
-
let
|
|
183
|
+
let ar;
|
|
184
184
|
async function fa() {
|
|
185
|
-
return
|
|
185
|
+
return ar || (ar = await caches.open(Oo)), ar;
|
|
186
186
|
}
|
|
187
187
|
let vn = 0;
|
|
188
188
|
async function Uo() {
|
|
189
|
-
const r = await fa(), e = await r.keys(), t = e.slice(0, Math.max(e.length -
|
|
189
|
+
const r = await fa(), e = await r.keys(), t = e.slice(0, Math.max(e.length - No, 0));
|
|
190
190
|
for (const n of t)
|
|
191
191
|
r.delete(n);
|
|
192
192
|
}
|
|
@@ -223,7 +223,7 @@ function Bo() {
|
|
|
223
223
|
c.signal = e.signal;
|
|
224
224
|
const p = await fetch(i, c);
|
|
225
225
|
return p.status >= 200 && p.status < 300 && (l.put(a, p.clone()).catch(() => {
|
|
226
|
-
}), ++vn >
|
|
226
|
+
}), ++vn > jo && (Uo(), vn = 0)), s(p);
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
function qo() {
|
|
@@ -248,7 +248,7 @@ function bn(r, e) {
|
|
|
248
248
|
url: r
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
|
-
return t.host === V.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", D.apiKey), D.session && t.searchParams.append("mtsid",
|
|
251
|
+
return t.host === V.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", D.apiKey), D.session && t.searchParams.append("mtsid", Nr)), {
|
|
252
252
|
url: Do(t, e)
|
|
253
253
|
};
|
|
254
254
|
}
|
|
@@ -267,7 +267,7 @@ function wn(r) {
|
|
|
267
267
|
function da() {
|
|
268
268
|
return Math.random().toString(36).substring(2);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
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) {
|
|
@@ -2476,7 +2476,7 @@ var ii = 8, si = {
|
|
|
2476
2476
|
},
|
|
2477
2477
|
"property-type": "color-ramp"
|
|
2478
2478
|
}
|
|
2479
|
-
},
|
|
2479
|
+
}, Ni = {
|
|
2480
2480
|
"circle-radius": {
|
|
2481
2481
|
type: "number",
|
|
2482
2482
|
default: 5,
|
|
@@ -2649,7 +2649,7 @@ var ii = 8, si = {
|
|
|
2649
2649
|
},
|
|
2650
2650
|
"property-type": "data-driven"
|
|
2651
2651
|
}
|
|
2652
|
-
},
|
|
2652
|
+
}, ji = {
|
|
2653
2653
|
"heatmap-radius": {
|
|
2654
2654
|
type: "number",
|
|
2655
2655
|
default: 30,
|
|
@@ -3516,8 +3516,8 @@ var ii = 8, si = {
|
|
|
3516
3516
|
}
|
|
3517
3517
|
},
|
|
3518
3518
|
paint_line: Oi,
|
|
3519
|
-
paint_circle:
|
|
3520
|
-
paint_heatmap:
|
|
3519
|
+
paint_circle: Ni,
|
|
3520
|
+
paint_heatmap: ji,
|
|
3521
3521
|
paint_symbol: Di,
|
|
3522
3522
|
paint_raster: Ui,
|
|
3523
3523
|
paint_hillshade: Bi,
|
|
@@ -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
|
|
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];
|
|
@@ -3588,14 +3588,14 @@ class fe extends Error {
|
|
|
3588
3588
|
super(t), this.message = t, this.key = e;
|
|
3589
3589
|
}
|
|
3590
3590
|
}
|
|
3591
|
-
class
|
|
3591
|
+
class jr {
|
|
3592
3592
|
constructor(e, t = []) {
|
|
3593
3593
|
this.parent = e, this.bindings = {};
|
|
3594
3594
|
for (const [n, a] of t)
|
|
3595
3595
|
this.bindings[n] = a;
|
|
3596
3596
|
}
|
|
3597
3597
|
concat(e) {
|
|
3598
|
-
return new
|
|
3598
|
+
return new jr(this, e);
|
|
3599
3599
|
}
|
|
3600
3600
|
get(e) {
|
|
3601
3601
|
if (this.bindings[e])
|
|
@@ -3608,7 +3608,7 @@ class Nr {
|
|
|
3608
3608
|
return this.bindings[e] ? !0 : this.parent ? this.parent.has(e) : !1;
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
const
|
|
3611
|
+
const Nt = { kind: "null" }, b = { kind: "number" }, I = { kind: "string" }, _ = { kind: "boolean" }, de = { kind: "color" }, jt = { 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 W(r, e) {
|
|
3613
3613
|
return {
|
|
3614
3614
|
kind: "array",
|
|
@@ -3616,28 +3616,28 @@ function W(r, e) {
|
|
|
3616
3616
|
N: e
|
|
3617
3617
|
};
|
|
3618
3618
|
}
|
|
3619
|
-
function
|
|
3619
|
+
function N(r) {
|
|
3620
3620
|
if (r.kind === "array") {
|
|
3621
|
-
const e =
|
|
3621
|
+
const e = N(r.itemType);
|
|
3622
3622
|
return typeof r.N == "number" ? `array<${e}, ${r.N}>` : r.itemType.kind === "value" ? "array" : `array<${e}>`;
|
|
3623
3623
|
} else
|
|
3624
3624
|
return r.kind;
|
|
3625
3625
|
}
|
|
3626
3626
|
const Xi = [
|
|
3627
|
-
|
|
3627
|
+
Nt,
|
|
3628
3628
|
b,
|
|
3629
3629
|
I,
|
|
3630
3630
|
_,
|
|
3631
3631
|
de,
|
|
3632
3632
|
jt,
|
|
3633
|
-
|
|
3633
|
+
Ut,
|
|
3634
3634
|
Re,
|
|
3635
3635
|
W(T),
|
|
3636
|
-
Ut,
|
|
3637
3636
|
Bt,
|
|
3637
|
+
qt,
|
|
3638
3638
|
nt,
|
|
3639
3639
|
ft,
|
|
3640
|
-
|
|
3640
|
+
Gt
|
|
3641
3641
|
];
|
|
3642
3642
|
function at(r, e) {
|
|
3643
3643
|
if (e.kind === "error")
|
|
@@ -3654,7 +3654,7 @@ function at(r, e) {
|
|
|
3654
3654
|
return null;
|
|
3655
3655
|
}
|
|
3656
3656
|
}
|
|
3657
|
-
return `Expected ${
|
|
3657
|
+
return `Expected ${N(r)} but found ${N(e)} instead.`;
|
|
3658
3658
|
}
|
|
3659
3659
|
function Dr(r, e) {
|
|
3660
3660
|
return e.some((t) => t.kind === r.kind);
|
|
@@ -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 =
|
|
3673
|
+
r = or(r), e = or(e), t = or(t);
|
|
3674
3674
|
let a, o;
|
|
3675
|
-
const i =
|
|
3676
|
-
r === e && e === t ? a = o = i : (a =
|
|
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
|
|
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
|
|
3683
|
+
function ir(r) {
|
|
3684
3684
|
return r > Zi ? 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 *
|
|
3689
|
-
|
|
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
|
-
|
|
3692
|
-
|
|
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
|
|
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
|
|
3699
|
+
function lr(r) {
|
|
3700
3700
|
return r > qe ? r * r * r : va * (r - ga);
|
|
3701
3701
|
}
|
|
3702
3702
|
function Ji(r) {
|
|
@@ -4255,7 +4255,7 @@ class X {
|
|
|
4255
4255
|
return new X(o);
|
|
4256
4256
|
}
|
|
4257
4257
|
}
|
|
4258
|
-
class
|
|
4258
|
+
class j extends Error {
|
|
4259
4259
|
constructor(e) {
|
|
4260
4260
|
super(e), this.name = "RuntimeError";
|
|
4261
4261
|
}
|
|
@@ -4286,11 +4286,11 @@ class ue {
|
|
|
4286
4286
|
static interpolate(e, t, n) {
|
|
4287
4287
|
const a = e.values, o = t.values;
|
|
4288
4288
|
if (a.length !== o.length)
|
|
4289
|
-
throw new
|
|
4289
|
+
throw new j(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);
|
|
4290
4290
|
const i = [];
|
|
4291
4291
|
for (let s = 0; s < a.length; s += 2) {
|
|
4292
4292
|
if (a[s] !== o[s])
|
|
4293
|
-
throw new
|
|
4293
|
+
throw new j(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${a[s]}, to[${s}]: ${o[s]}`);
|
|
4294
4294
|
i.push(a[s]);
|
|
4295
4295
|
const [l, u] = a[s + 1], [c, p] = o[s + 1];
|
|
4296
4296
|
i.push([Le(l, c, n), Le(u, p, n)]);
|
|
@@ -4348,7 +4348,7 @@ function ot(r) {
|
|
|
4348
4348
|
}
|
|
4349
4349
|
function B(r) {
|
|
4350
4350
|
if (r === null)
|
|
4351
|
-
return
|
|
4351
|
+
return Nt;
|
|
4352
4352
|
if (typeof r == "string")
|
|
4353
4353
|
return I;
|
|
4354
4354
|
if (typeof r == "boolean")
|
|
@@ -4360,17 +4360,17 @@ function B(r) {
|
|
|
4360
4360
|
if (r instanceof ie)
|
|
4361
4361
|
return jt;
|
|
4362
4362
|
if (r instanceof Ur)
|
|
4363
|
-
return Nt;
|
|
4364
|
-
if (r instanceof me)
|
|
4365
4363
|
return Dt;
|
|
4366
|
-
if (r instanceof
|
|
4364
|
+
if (r instanceof me)
|
|
4367
4365
|
return Ut;
|
|
4368
|
-
if (r instanceof
|
|
4366
|
+
if (r instanceof Q)
|
|
4369
4367
|
return Bt;
|
|
4368
|
+
if (r instanceof ee)
|
|
4369
|
+
return qt;
|
|
4370
4370
|
if (r instanceof X)
|
|
4371
4371
|
return nt;
|
|
4372
4372
|
if (r instanceof ue)
|
|
4373
|
-
return
|
|
4373
|
+
return Gt;
|
|
4374
4374
|
if (r instanceof Ee)
|
|
4375
4375
|
return ft;
|
|
4376
4376
|
if (Array.isArray(r)) {
|
|
@@ -4468,7 +4468,7 @@ class se {
|
|
|
4468
4468
|
const n = this.args[t].evaluate(e);
|
|
4469
4469
|
if (at(this.type, B(n))) {
|
|
4470
4470
|
if (t === this.args.length - 1)
|
|
4471
|
-
throw new
|
|
4471
|
+
throw new j(`Expected value to be of type ${N(this.type)}, but found ${N(B(n))} instead.`);
|
|
4472
4472
|
} else return n;
|
|
4473
4473
|
}
|
|
4474
4474
|
throw new Error();
|
|
@@ -4523,7 +4523,7 @@ class ke {
|
|
|
4523
4523
|
} else if (Array.isArray(t) && (t.length < 3 || t.length > 4 ? n = `Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.` : n = xa(t[0], t[1], t[2], t[3]), !n))
|
|
4524
4524
|
return new F(t[0] / 255, t[1] / 255, t[2] / 255, t[3]);
|
|
4525
4525
|
}
|
|
4526
|
-
throw new
|
|
4526
|
+
throw new j(n || `Could not parse color from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4527
4527
|
}
|
|
4528
4528
|
case "padding": {
|
|
4529
4529
|
let t;
|
|
@@ -4533,7 +4533,7 @@ class ke {
|
|
|
4533
4533
|
if (a)
|
|
4534
4534
|
return a;
|
|
4535
4535
|
}
|
|
4536
|
-
throw new
|
|
4536
|
+
throw new j(`Could not parse padding from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4537
4537
|
}
|
|
4538
4538
|
case "numberArray": {
|
|
4539
4539
|
let t;
|
|
@@ -4543,7 +4543,7 @@ class ke {
|
|
|
4543
4543
|
if (a)
|
|
4544
4544
|
return a;
|
|
4545
4545
|
}
|
|
4546
|
-
throw new
|
|
4546
|
+
throw new j(`Could not parse numberArray from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4547
4547
|
}
|
|
4548
4548
|
case "colorArray": {
|
|
4549
4549
|
let t;
|
|
@@ -4553,7 +4553,7 @@ class ke {
|
|
|
4553
4553
|
if (a)
|
|
4554
4554
|
return a;
|
|
4555
4555
|
}
|
|
4556
|
-
throw new
|
|
4556
|
+
throw new j(`Could not parse colorArray from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4557
4557
|
}
|
|
4558
4558
|
case "variableAnchorOffsetCollection": {
|
|
4559
4559
|
let t;
|
|
@@ -4563,7 +4563,7 @@ class ke {
|
|
|
4563
4563
|
if (a)
|
|
4564
4564
|
return a;
|
|
4565
4565
|
}
|
|
4566
|
-
throw new
|
|
4566
|
+
throw new j(`Could not parse variableAnchorOffsetCollection from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4567
4567
|
}
|
|
4568
4568
|
case "number": {
|
|
4569
4569
|
let t = null;
|
|
@@ -4574,7 +4574,7 @@ class ke {
|
|
|
4574
4574
|
if (!isNaN(a))
|
|
4575
4575
|
return a;
|
|
4576
4576
|
}
|
|
4577
|
-
throw new
|
|
4577
|
+
throw new j(`Could not convert ${JSON.stringify(t)} to number.`);
|
|
4578
4578
|
}
|
|
4579
4579
|
case "formatted":
|
|
4580
4580
|
return me.fromString(tt(this.args[0].evaluate(e)));
|
|
@@ -4618,8 +4618,8 @@ class ka {
|
|
|
4618
4618
|
return t || (t = F.parse(e), this._parseColorCache.set(e, t)), t;
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
|
-
class
|
|
4622
|
-
constructor(e, t, n = [], a, o = new
|
|
4621
|
+
class Vt {
|
|
4622
|
+
constructor(e, t, n = [], a, o = new jr(), 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
|
}
|
|
4625
4625
|
/**
|
|
@@ -4680,7 +4680,7 @@ class Gt {
|
|
|
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
|
|
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`
|
|
@@ -4705,7 +4705,7 @@ class Gt {
|
|
|
4705
4705
|
return n && this.error(n), n;
|
|
4706
4706
|
}
|
|
4707
4707
|
}
|
|
4708
|
-
class
|
|
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 Vt {
|
|
|
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
|
|
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
|
|
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 Ht {
|
|
|
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
|
|
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);
|
|
@@ -4774,11 +4774,11 @@ class Br {
|
|
|
4774
4774
|
evaluate(e) {
|
|
4775
4775
|
const t = this.index.evaluate(e), n = this.input.evaluate(e);
|
|
4776
4776
|
if (t < 0)
|
|
4777
|
-
throw new
|
|
4777
|
+
throw new j(`Array index out of bounds: ${t} < 0.`);
|
|
4778
4778
|
if (t >= n.length)
|
|
4779
|
-
throw new
|
|
4779
|
+
throw new j(`Array index out of bounds: ${t} > ${n.length - 1}.`);
|
|
4780
4780
|
if (t !== Math.floor(t))
|
|
4781
|
-
throw new
|
|
4781
|
+
throw new j(`Array index must be an integer, but found ${t} instead.`);
|
|
4782
4782
|
return n[t];
|
|
4783
4783
|
}
|
|
4784
4784
|
eachChild(e) {
|
|
@@ -4796,16 +4796,16 @@ class qr {
|
|
|
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 : Dr(n.type, [_, I, b,
|
|
4799
|
+
return !n || !a ? null : Dr(n.type, [_, I, b, Nt, T]) ? new qr(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(n.type)} instead`);
|
|
4800
4800
|
}
|
|
4801
4801
|
evaluate(e) {
|
|
4802
4802
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
4803
4803
|
if (!n)
|
|
4804
4804
|
return !1;
|
|
4805
4805
|
if (!ze(t, ["boolean", "string", "number", "null"]))
|
|
4806
|
-
throw new
|
|
4806
|
+
throw new j(`Expected first argument to be of type boolean, string, number or null, but found ${N(B(t))} instead.`);
|
|
4807
4807
|
if (!ze(n, ["string", "array"]))
|
|
4808
|
-
throw new
|
|
4808
|
+
throw new j(`Expected second argument to be of type array or string, but found ${N(B(n))} instead.`);
|
|
4809
4809
|
return n.indexOf(t) >= 0;
|
|
4810
4810
|
}
|
|
4811
4811
|
eachChild(e) {
|
|
@@ -4815,7 +4815,7 @@ class qr {
|
|
|
4815
4815
|
return !0;
|
|
4816
4816
|
}
|
|
4817
4817
|
}
|
|
4818
|
-
class
|
|
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,18 +4825,18 @@ class Tt {
|
|
|
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 (!Dr(n.type, [_, I, b,
|
|
4829
|
-
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${
|
|
4828
|
+
if (!Dr(n.type, [_, I, b, Nt, T]))
|
|
4829
|
+
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(n.type)} instead`);
|
|
4830
4830
|
if (e.length === 4) {
|
|
4831
4831
|
const o = t.parse(e[3], 3, b);
|
|
4832
|
-
return o ? new
|
|
4832
|
+
return o ? new _t(n, a, o) : null;
|
|
4833
4833
|
} else
|
|
4834
|
-
return new
|
|
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);
|
|
4838
4838
|
if (!ze(t, ["boolean", "string", "number", "null"]))
|
|
4839
|
-
throw new
|
|
4839
|
+
throw new j(`Expected first argument to be of type boolean, string, number or null, but found ${N(B(t))} instead.`);
|
|
4840
4840
|
let a;
|
|
4841
4841
|
if (this.fromIndex && (a = this.fromIndex.evaluate(e)), ze(n, ["string"])) {
|
|
4842
4842
|
const o = n.indexOf(t, a);
|
|
@@ -4844,7 +4844,7 @@ class Tt {
|
|
|
4844
4844
|
} else {
|
|
4845
4845
|
if (ze(n, ["array"]))
|
|
4846
4846
|
return n.indexOf(t, a);
|
|
4847
|
-
throw new
|
|
4847
|
+
throw new j(`Expected second argument to be of type array or string, but found ${N(B(n))} instead.`);
|
|
4848
4848
|
}
|
|
4849
4849
|
}
|
|
4850
4850
|
eachChild(e) {
|
|
@@ -4953,7 +4953,7 @@ class Vr {
|
|
|
4953
4953
|
return this.branches.every(([e, t]) => t.outputDefined()) && this.otherwise.outputDefined();
|
|
4954
4954
|
}
|
|
4955
4955
|
}
|
|
4956
|
-
class
|
|
4956
|
+
class It {
|
|
4957
4957
|
constructor(e, t, n, a) {
|
|
4958
4958
|
this.type = e, this.input = t, this.beginIndex = n, this.endIndex = a;
|
|
4959
4959
|
}
|
|
@@ -4964,12 +4964,12 @@ class _t {
|
|
|
4964
4964
|
if (!n || !a)
|
|
4965
4965
|
return null;
|
|
4966
4966
|
if (!Dr(n.type, [W(T), I, T]))
|
|
4967
|
-
return t.error(`Expected first argument to be of type array or string, but found ${
|
|
4967
|
+
return t.error(`Expected first argument to be of type array or string, but found ${N(n.type)} instead`);
|
|
4968
4968
|
if (e.length === 4) {
|
|
4969
4969
|
const o = t.parse(e[3], 3, b);
|
|
4970
|
-
return o ? new
|
|
4970
|
+
return o ? new It(n.type, n, a, o) : null;
|
|
4971
4971
|
} else
|
|
4972
|
-
return new
|
|
4972
|
+
return new It(n.type, n, a);
|
|
4973
4973
|
}
|
|
4974
4974
|
evaluate(e) {
|
|
4975
4975
|
const t = this.input.evaluate(e), n = this.beginIndex.evaluate(e);
|
|
@@ -4978,7 +4978,7 @@ class _t {
|
|
|
4978
4978
|
return [...t].slice(n, a).join("");
|
|
4979
4979
|
if (ze(t, ["array"]))
|
|
4980
4980
|
return t.slice(n, a);
|
|
4981
|
-
throw new
|
|
4981
|
+
throw new j(`Expected first argument to be of type array or string, but found ${N(B(t))} instead.`);
|
|
4982
4982
|
}
|
|
4983
4983
|
eachChild(e) {
|
|
4984
4984
|
e(this.input), e(this.beginIndex), this.endIndex && e(this.endIndex);
|
|
@@ -4998,10 +4998,10 @@ function Ca(r, e) {
|
|
|
4998
4998
|
} else if (i > e)
|
|
4999
4999
|
a = o - 1;
|
|
5000
5000
|
else
|
|
5001
|
-
throw new
|
|
5001
|
+
throw new j("Input is not a number.");
|
|
5002
5002
|
return 0;
|
|
5003
5003
|
}
|
|
5004
|
-
class
|
|
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 Kt {
|
|
|
5029
5029
|
return null;
|
|
5030
5030
|
o = o || p.type, a.push([s, p]);
|
|
5031
5031
|
}
|
|
5032
|
-
return new
|
|
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 Kt {
|
|
|
5056
5056
|
function ss(r) {
|
|
5057
5057
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5058
5058
|
}
|
|
5059
|
-
var
|
|
5059
|
+
var ur, An;
|
|
5060
5060
|
function ls() {
|
|
5061
|
-
if (An) return
|
|
5062
|
-
An = 1,
|
|
5061
|
+
if (An) return ur;
|
|
5062
|
+
An = 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
|
-
},
|
|
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 =
|
|
5106
|
+
o = cr(t, e.base, n, a);
|
|
5107
5107
|
else if (e.name === "linear")
|
|
5108
|
-
o =
|
|
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(
|
|
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
|
}
|
|
@@ -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, jt) && !we(l, de) && !we(l,
|
|
5159
|
+
return !we(l, b) && !we(l, jt) && !we(l, de) && !we(l, Bt) && !we(l, qt) && !we(l, nt) && !we(l, Gt) && !we(l, W(b)) ? t.error(`Type ${N(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;
|
|
@@ -5214,7 +5214,7 @@ class he {
|
|
|
5214
5214
|
return this.outputs.every((e) => e.outputDefined());
|
|
5215
5215
|
}
|
|
5216
5216
|
}
|
|
5217
|
-
function
|
|
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
|
}
|
|
@@ -5307,20 +5307,20 @@ function Xe(r, e, t) {
|
|
|
5307
5307
|
if (!l)
|
|
5308
5308
|
return null;
|
|
5309
5309
|
if (!En(s, l.type))
|
|
5310
|
-
return i.concat(1).error(`"${s}" comparisons are not supported for type '${
|
|
5310
|
+
return i.concat(1).error(`"${s}" comparisons are not supported for type '${N(l.type)}'.`);
|
|
5311
5311
|
let u = i.parse(o[2], 2, T);
|
|
5312
5312
|
if (!u)
|
|
5313
5313
|
return null;
|
|
5314
5314
|
if (!En(s, u.type))
|
|
5315
|
-
return i.concat(2).error(`"${s}" comparisons are not supported for type '${
|
|
5315
|
+
return i.concat(2).error(`"${s}" comparisons are not supported for type '${N(u.type)}'.`);
|
|
5316
5316
|
if (l.type.kind !== u.type.kind && l.type.kind !== "value" && u.type.kind !== "value")
|
|
5317
|
-
return i.error(`Cannot compare types '${
|
|
5317
|
+
return i.error(`Cannot compare types '${N(l.type)}' and '${N(u.type)}'.`);
|
|
5318
5318
|
n && (l.type.kind === "value" && u.type.kind !== "value" ? l = new se(u.type, [l]) : l.type.kind !== "value" && u.type.kind === "value" && (u = new se(l.type, [u])));
|
|
5319
5319
|
let c = null;
|
|
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,
|
|
5323
|
+
if (c = i.parse(o[3], 3, Dt), !c)
|
|
5324
5324
|
return null;
|
|
5325
5325
|
}
|
|
5326
5326
|
return new Aa(l, u, c);
|
|
@@ -5330,7 +5330,7 @@ function Xe(r, e, t) {
|
|
|
5330
5330
|
if (n && this.hasUntypedArgument) {
|
|
5331
5331
|
const l = B(i), u = B(s);
|
|
5332
5332
|
if (l.kind !== u.kind || !(l.kind === "string" || l.kind === "number"))
|
|
5333
|
-
throw new
|
|
5333
|
+
throw new j(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`);
|
|
5334
5334
|
}
|
|
5335
5335
|
if (this.collator && !n && this.hasUntypedArgument) {
|
|
5336
5336
|
const l = B(i), u = B(s);
|
|
@@ -5348,9 +5348,9 @@ function Xe(r, e, t) {
|
|
|
5348
5348
|
};
|
|
5349
5349
|
}
|
|
5350
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
|
|
5351
|
+
class Zt {
|
|
5352
5352
|
constructor(e, t, n) {
|
|
5353
|
-
this.type =
|
|
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 Xt {
|
|
|
5365
5365
|
if (!o)
|
|
5366
5366
|
return null;
|
|
5367
5367
|
let i = null;
|
|
5368
|
-
return n.locale && (i = t.parse(n.locale, 1, I), !i) ? null : new
|
|
5368
|
+
return n.locale && (i = t.parse(n.locale, 1, I), !i) ? null : new Zt(a, o, i);
|
|
5369
5369
|
}
|
|
5370
5370
|
evaluate(e) {
|
|
5371
5371
|
return new Ur(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
|
|
@@ -5419,7 +5419,7 @@ class Hr {
|
|
|
5419
5419
|
}
|
|
5420
5420
|
class Kr {
|
|
5421
5421
|
constructor(e) {
|
|
5422
|
-
this.type =
|
|
5422
|
+
this.type = Ut, this.sections = e;
|
|
5423
5423
|
}
|
|
5424
5424
|
static parse(e, t) {
|
|
5425
5425
|
if (e.length < 2)
|
|
@@ -5507,7 +5507,7 @@ class Zr {
|
|
|
5507
5507
|
if (e.length !== 2)
|
|
5508
5508
|
return t.error(`Expected 1 argument, but found ${e.length - 1} instead.`);
|
|
5509
5509
|
const n = t.parse(e[1], 1);
|
|
5510
|
-
return n ? n.type.kind !== "array" && n.type.kind !== "string" && n.type.kind !== "value" ? t.error(`Expected argument of type string or array, but found ${
|
|
5510
|
+
return n ? n.type.kind !== "array" && n.type.kind !== "string" && n.type.kind !== "value" ? t.error(`Expected argument of type string or array, but found ${N(n.type)} instead.`) : new Zr(n) : null;
|
|
5511
5511
|
}
|
|
5512
5512
|
evaluate(e) {
|
|
5513
5513
|
const t = this.input.evaluate(e);
|
|
@@ -5515,7 +5515,7 @@ class Zr {
|
|
|
5515
5515
|
return [...t].length;
|
|
5516
5516
|
if (Array.isArray(t))
|
|
5517
5517
|
return t.length;
|
|
5518
|
-
throw new
|
|
5518
|
+
throw new j(`Expected value to be of type string or array, but found ${N(B(t))} instead.`);
|
|
5519
5519
|
}
|
|
5520
5520
|
eachChild(e) {
|
|
5521
5521
|
e(this.input);
|
|
@@ -5558,14 +5558,14 @@ 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
|
|
5561
|
+
function Wt(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
|
-
return
|
|
5563
|
+
return Ns(o, a) === 0 ? !1 : !!(Tn(r, e, t, n) && Tn(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 (
|
|
5568
|
+
if (Wt(r, e, n[a], n[a + 1]))
|
|
5569
5569
|
return !0;
|
|
5570
5570
|
return !1;
|
|
5571
5571
|
}
|
|
@@ -5600,7 +5600,7 @@ function Os(r, e) {
|
|
|
5600
5600
|
return !0;
|
|
5601
5601
|
return !1;
|
|
5602
5602
|
}
|
|
5603
|
-
function
|
|
5603
|
+
function Ns(r, e) {
|
|
5604
5604
|
return r[0] * e[1] - r[1] * e[0];
|
|
5605
5605
|
}
|
|
5606
5606
|
function Tn(r, e, t, n) {
|
|
@@ -5635,7 +5635,7 @@ function _a(r, e, t, n) {
|
|
|
5635
5635
|
}
|
|
5636
5636
|
dt(e, r);
|
|
5637
5637
|
}
|
|
5638
|
-
function
|
|
5638
|
+
function js(r) {
|
|
5639
5639
|
r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
|
|
5640
5640
|
}
|
|
5641
5641
|
function _n(r, e, t, n) {
|
|
@@ -5658,7 +5658,7 @@ function In(r, e, t, n) {
|
|
|
5658
5658
|
i.push(l);
|
|
5659
5659
|
}
|
|
5660
5660
|
if (e[2] - e[0] <= a / 2) {
|
|
5661
|
-
|
|
5661
|
+
js(e);
|
|
5662
5662
|
for (const s of i)
|
|
5663
5663
|
for (const l of s)
|
|
5664
5664
|
_a(l, e, t, a);
|
|
@@ -5862,7 +5862,7 @@ const Lr = 100, Ar = 50;
|
|
|
5862
5862
|
function Ma(r, e) {
|
|
5863
5863
|
return e[0] - r[0];
|
|
5864
5864
|
}
|
|
5865
|
-
function
|
|
5865
|
+
function Mt(r) {
|
|
5866
5866
|
return r[1] - r[0] + 1;
|
|
5867
5867
|
}
|
|
5868
5868
|
function ve(r, e) {
|
|
@@ -5871,7 +5871,7 @@ function ve(r, e) {
|
|
|
5871
5871
|
function Er(r, e) {
|
|
5872
5872
|
if (r[0] > r[1])
|
|
5873
5873
|
return [null, null];
|
|
5874
|
-
const t =
|
|
5874
|
+
const t = Mt(r);
|
|
5875
5875
|
if (e) {
|
|
5876
5876
|
if (t === 2)
|
|
5877
5877
|
return [r, null];
|
|
@@ -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 (
|
|
5932
|
+
if (Wt(l, u, p, f))
|
|
5933
5933
|
return 0;
|
|
5934
5934
|
i = Math.min(i, en(l, u, p, f, a));
|
|
5935
5935
|
}
|
|
@@ -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 (
|
|
5975
|
+
if (Wt(i, s, f, d))
|
|
5976
5976
|
return 0;
|
|
5977
5977
|
a = Math.min(a, en(i, s, f, d, n));
|
|
5978
5978
|
}
|
|
@@ -6002,7 +6002,7 @@ function Zs(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 (
|
|
6005
|
+
if (Wt(p, f, w, v))
|
|
6006
6006
|
return 0;
|
|
6007
6007
|
i = Math.min(i, en(p, f, w, v, t));
|
|
6008
6008
|
}
|
|
@@ -6021,7 +6021,7 @@ function St(r, e, t, n, a, o, i) {
|
|
|
6021
6021
|
const s = Qr(Tr(n, o), Tr(a, i), t);
|
|
6022
6022
|
s < e && r.push([s, o, i]);
|
|
6023
6023
|
}
|
|
6024
|
-
function
|
|
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;
|
|
@@ -6031,7 +6031,7 @@ function Mt(r, e, t, n, a = 1 / 0) {
|
|
|
6031
6031
|
if (l[0] >= o)
|
|
6032
6032
|
continue;
|
|
6033
6033
|
const u = l[1], c = e ? Ar : Lr;
|
|
6034
|
-
if (
|
|
6034
|
+
if (Mt(u) <= c) {
|
|
6035
6035
|
if (!ve(u, r.length))
|
|
6036
6036
|
return NaN;
|
|
6037
6037
|
if (e) {
|
|
@@ -6052,7 +6052,7 @@ function Mt(r, e, t, n, a = 1 / 0) {
|
|
|
6052
6052
|
}
|
|
6053
6053
|
return o;
|
|
6054
6054
|
}
|
|
6055
|
-
function
|
|
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;
|
|
@@ -6062,7 +6062,7 @@ function Pt(r, e, t, n, a, o = 1 / 0) {
|
|
|
6062
6062
|
if (l[0] >= i)
|
|
6063
6063
|
continue;
|
|
6064
6064
|
const u = l[1], c = l[2], p = e ? Ar : Lr, f = n ? Ar : Lr;
|
|
6065
|
-
if (
|
|
6065
|
+
if (Mt(u) <= p && Mt(c) <= f) {
|
|
6066
6066
|
if (!ve(u, r.length) && ve(c, t.length))
|
|
6067
6067
|
return NaN;
|
|
6068
6068
|
let d;
|
|
@@ -6096,13 +6096,13 @@ function Ws(r, e) {
|
|
|
6096
6096
|
for (const i of e) {
|
|
6097
6097
|
switch (i.type) {
|
|
6098
6098
|
case "Point":
|
|
6099
|
-
o = Math.min(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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
6146
|
+
o = Math.min(o, Pt([i.coordinates], !1, s, a, o));
|
|
6147
6147
|
break;
|
|
6148
6148
|
case "LineString":
|
|
6149
|
-
o = Math.min(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, Zs(s, i.coordinates, a, o));
|
|
@@ -6157,7 +6157,7 @@ function Js(r, e) {
|
|
|
6157
6157
|
}
|
|
6158
6158
|
return o;
|
|
6159
6159
|
}
|
|
6160
|
-
function
|
|
6160
|
+
function pr(r) {
|
|
6161
6161
|
return r.type === "MultiPolygon" ? r.coordinates.map((e) => ({
|
|
6162
6162
|
type: "Polygon",
|
|
6163
6163
|
coordinates: e
|
|
@@ -6179,11 +6179,11 @@ class $e {
|
|
|
6179
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) =>
|
|
6182
|
+
return new $e(n, n.features.map((a) => pr(a.geometry)).flat());
|
|
6183
6183
|
if (n.type === "Feature")
|
|
6184
|
-
return new $e(n,
|
|
6184
|
+
return new $e(n, pr(n.geometry));
|
|
6185
6185
|
if ("type" in n && "coordinates" in n)
|
|
6186
|
-
return new $e(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
|
}
|
|
@@ -6238,29 +6238,29 @@ const tn = {
|
|
|
6238
6238
|
boolean: se,
|
|
6239
6239
|
case: Vr,
|
|
6240
6240
|
coalesce: it,
|
|
6241
|
-
collator:
|
|
6241
|
+
collator: Zt,
|
|
6242
6242
|
format: Kr,
|
|
6243
6243
|
image: Xr,
|
|
6244
6244
|
in: qr,
|
|
6245
|
-
"index-of":
|
|
6245
|
+
"index-of": _t,
|
|
6246
6246
|
interpolate: he,
|
|
6247
6247
|
"interpolate-hcl": he,
|
|
6248
6248
|
"interpolate-lab": he,
|
|
6249
6249
|
length: Zr,
|
|
6250
|
-
let:
|
|
6250
|
+
let: Ht,
|
|
6251
6251
|
literal: He,
|
|
6252
6252
|
match: Gr,
|
|
6253
6253
|
number: se,
|
|
6254
6254
|
"number-format": Hr,
|
|
6255
6255
|
object: se,
|
|
6256
|
-
slice:
|
|
6257
|
-
step:
|
|
6256
|
+
slice: It,
|
|
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:
|
|
6263
|
+
var: Kt,
|
|
6264
6264
|
within: Fe,
|
|
6265
6265
|
distance: $e,
|
|
6266
6266
|
"global-state": ht
|
|
@@ -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
|
|
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++) {
|
|
@@ -6318,7 +6318,7 @@ class le {
|
|
|
6318
6318
|
const d = t.parse(e[f], 1 + p.length);
|
|
6319
6319
|
if (!d)
|
|
6320
6320
|
return null;
|
|
6321
|
-
p.push(
|
|
6321
|
+
p.push(N(d.type));
|
|
6322
6322
|
}
|
|
6323
6323
|
t.error(`Expected arguments of type ${c}, but found (${p.join(", ")}) instead.`);
|
|
6324
6324
|
}
|
|
@@ -6334,13 +6334,13 @@ function On(r, [e, t, n, a]) {
|
|
|
6334
6334
|
e = e.evaluate(r), t = t.evaluate(r), n = n.evaluate(r);
|
|
6335
6335
|
const o = a ? a.evaluate(r) : 1, i = xa(e, t, n, o);
|
|
6336
6336
|
if (i)
|
|
6337
|
-
throw new
|
|
6337
|
+
throw new j(i);
|
|
6338
6338
|
return new F(e / 255, t / 255, n / 255, o, !1);
|
|
6339
6339
|
}
|
|
6340
|
-
function
|
|
6340
|
+
function Nn(r, e) {
|
|
6341
6341
|
return r in e;
|
|
6342
6342
|
}
|
|
6343
|
-
function
|
|
6343
|
+
function fr(r, e) {
|
|
6344
6344
|
const t = e[r];
|
|
6345
6345
|
return typeof t > "u" ? null : t;
|
|
6346
6346
|
}
|
|
@@ -6361,13 +6361,13 @@ le.register(tn, {
|
|
|
6361
6361
|
Ki,
|
|
6362
6362
|
[I],
|
|
6363
6363
|
(r, [e]) => {
|
|
6364
|
-
throw new
|
|
6364
|
+
throw new j(e.evaluate(r));
|
|
6365
6365
|
}
|
|
6366
6366
|
],
|
|
6367
6367
|
typeof: [
|
|
6368
6368
|
I,
|
|
6369
6369
|
[T],
|
|
6370
|
-
(r, [e]) =>
|
|
6370
|
+
(r, [e]) => N(B(e.evaluate(r)))
|
|
6371
6371
|
],
|
|
6372
6372
|
"to-rgba": [
|
|
6373
6373
|
W(b, 4),
|
|
@@ -6392,11 +6392,11 @@ le.register(tn, {
|
|
|
6392
6392
|
overloads: [
|
|
6393
6393
|
[
|
|
6394
6394
|
[I],
|
|
6395
|
-
(r, [e]) =>
|
|
6395
|
+
(r, [e]) => Nn(e.evaluate(r), r.properties())
|
|
6396
6396
|
],
|
|
6397
6397
|
[
|
|
6398
6398
|
[I, Re],
|
|
6399
|
-
(r, [e, t]) =>
|
|
6399
|
+
(r, [e, t]) => Nn(e.evaluate(r), t.evaluate(r))
|
|
6400
6400
|
]
|
|
6401
6401
|
]
|
|
6402
6402
|
},
|
|
@@ -6405,18 +6405,18 @@ le.register(tn, {
|
|
|
6405
6405
|
overloads: [
|
|
6406
6406
|
[
|
|
6407
6407
|
[I],
|
|
6408
|
-
(r, [e]) =>
|
|
6408
|
+
(r, [e]) => fr(e.evaluate(r), r.properties())
|
|
6409
6409
|
],
|
|
6410
6410
|
[
|
|
6411
6411
|
[I, Re],
|
|
6412
|
-
(r, [e, t]) =>
|
|
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
|
[I],
|
|
6419
|
-
(r, [e]) =>
|
|
6419
|
+
(r, [e]) => fr(e.evaluate(r), r.featureState || {})
|
|
6420
6420
|
],
|
|
6421
6421
|
properties: [
|
|
6422
6422
|
Re,
|
|
@@ -6782,19 +6782,19 @@ le.register(tn, {
|
|
|
6782
6782
|
],
|
|
6783
6783
|
"resolved-locale": [
|
|
6784
6784
|
I,
|
|
6785
|
-
[
|
|
6785
|
+
[Dt],
|
|
6786
6786
|
(r, [e]) => e.evaluate(r).resolvedLocale()
|
|
6787
6787
|
]
|
|
6788
6788
|
});
|
|
6789
6789
|
function el(r) {
|
|
6790
|
-
return Array.isArray(r) ? `(${r.map(
|
|
6790
|
+
return Array.isArray(r) ? `(${r.map(N).join(", ")})` : `(${N(r.type)}...)`;
|
|
6791
6791
|
}
|
|
6792
|
-
function
|
|
6793
|
-
if (r instanceof
|
|
6794
|
-
return
|
|
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
|
|
6797
|
+
if (r instanceof Zt)
|
|
6798
6798
|
return !1;
|
|
6799
6799
|
if (r instanceof Fe)
|
|
6800
6800
|
return !1;
|
|
@@ -6805,10 +6805,10 @@ function Rt(r) {
|
|
|
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 &&
|
|
6809
|
-
}), t ?
|
|
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
|
|
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,7 +6825,7 @@ function Wt(r) {
|
|
|
6825
6825
|
return !1;
|
|
6826
6826
|
let e = !0;
|
|
6827
6827
|
return r.eachChild((t) => {
|
|
6828
|
-
e && !
|
|
6828
|
+
e && !Yt(t) && (e = !1);
|
|
6829
6829
|
}), e;
|
|
6830
6830
|
}
|
|
6831
6831
|
function lt(r) {
|
|
@@ -6836,12 +6836,12 @@ function lt(r) {
|
|
|
6836
6836
|
e && !lt(t) && (e = !1);
|
|
6837
6837
|
}), e;
|
|
6838
6838
|
}
|
|
6839
|
-
function
|
|
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 && !
|
|
6844
|
+
t && !Jt(n, e) && (t = !1);
|
|
6845
6845
|
}), t;
|
|
6846
6846
|
}
|
|
6847
6847
|
function Ir(r) {
|
|
@@ -6850,7 +6850,7 @@ function Ir(r) {
|
|
|
6850
6850
|
function Be(r) {
|
|
6851
6851
|
return { result: "error", value: r };
|
|
6852
6852
|
}
|
|
6853
|
-
function
|
|
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) {
|
|
@@ -6879,7 +6879,7 @@ class tl {
|
|
|
6879
6879
|
if (s == null || typeof s == "number" && s !== s)
|
|
6880
6880
|
return this._defaultValue;
|
|
6881
6881
|
if (this._enumValues && !(s in this._enumValues))
|
|
6882
|
-
throw new
|
|
6882
|
+
throw new j(`Expected value to be one of ${Object.keys(this._enumValues).map((l) => JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(s)} instead.`);
|
|
6883
6883
|
return s;
|
|
6884
6884
|
} catch (s) {
|
|
6885
6885
|
return this._warningHistory[s.message] || (this._warningHistory[s.message] = !0, typeof console < "u" && console.warn(s.message)), this._defaultValue;
|
|
@@ -6890,10 +6890,10 @@ function za(r) {
|
|
|
6890
6890
|
return Array.isArray(r) && r.length > 0 && typeof r[0] == "string" && r[0] in tn;
|
|
6891
6891
|
}
|
|
6892
6892
|
function Fa(r, e) {
|
|
6893
|
-
const t = new
|
|
6893
|
+
const t = new Vt(tn, 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
6894
|
return n ? Ir(new tl(n, e)) : Be(t.errors);
|
|
6895
6895
|
}
|
|
6896
|
-
class
|
|
6896
|
+
class jn {
|
|
6897
6897
|
constructor(e, t) {
|
|
6898
6898
|
this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !lt(t.expression), this.globalStateRefs = nn(t.expression);
|
|
6899
6899
|
}
|
|
@@ -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 =
|
|
6926
|
-
if (!a && !
|
|
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 =
|
|
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 =
|
|
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,21 +6936,21 @@ 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 Ir(a ? new
|
|
6939
|
+
return Ir(a ? new jn("constant", t.value) : new jn("source", t.value));
|
|
6940
6940
|
const s = i instanceof he ? i.interpolation : void 0;
|
|
6941
6941
|
return Ir(a ? new Dn("camera", t.value, i.labels, s) : new Dn("composite", t.value, i.labels, s));
|
|
6942
6942
|
}
|
|
6943
|
-
function
|
|
6943
|
+
function Ct(r) {
|
|
6944
6944
|
let e = null;
|
|
6945
|
-
if (r instanceof
|
|
6946
|
-
e =
|
|
6945
|
+
if (r instanceof Ht)
|
|
6946
|
+
e = Ct(r.result);
|
|
6947
6947
|
else if (r instanceof it) {
|
|
6948
6948
|
for (const t of r.args)
|
|
6949
|
-
if (e =
|
|
6949
|
+
if (e = Ct(t), e)
|
|
6950
6950
|
break;
|
|
6951
|
-
} else (r instanceof
|
|
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 =
|
|
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
|
}
|
|
@@ -6966,13 +6966,13 @@ function nl(r) {
|
|
|
6966
6966
|
number: b,
|
|
6967
6967
|
enum: I,
|
|
6968
6968
|
boolean: _,
|
|
6969
|
-
formatted:
|
|
6970
|
-
padding:
|
|
6971
|
-
numberArray:
|
|
6969
|
+
formatted: Ut,
|
|
6970
|
+
padding: Bt,
|
|
6971
|
+
numberArray: qt,
|
|
6972
6972
|
colorArray: nt,
|
|
6973
6973
|
projectionDefinition: jt,
|
|
6974
6974
|
resolvedImage: ft,
|
|
6975
|
-
variableAnchorOffsetCollection:
|
|
6975
|
+
variableAnchorOffsetCollection: Gt
|
|
6976
6976
|
};
|
|
6977
6977
|
return r.type === "array" ? W(e[r.value] || T, r.length) : e[r.type];
|
|
6978
6978
|
}
|
|
@@ -7034,13 +7034,13 @@ function Oa(r) {
|
|
|
7034
7034
|
function U(r) {
|
|
7035
7035
|
return r instanceof Number || r instanceof String || r instanceof Boolean ? r.valueOf() : r;
|
|
7036
7036
|
}
|
|
7037
|
-
function
|
|
7037
|
+
function Ne(r) {
|
|
7038
7038
|
if (Array.isArray(r))
|
|
7039
|
-
return r.map(
|
|
7039
|
+
return r.map(Ne);
|
|
7040
7040
|
if (r instanceof Object && !(r instanceof Number || r instanceof String || r instanceof Boolean)) {
|
|
7041
7041
|
const e = {};
|
|
7042
7042
|
for (const t in r)
|
|
7043
|
-
e[t] =
|
|
7043
|
+
e[t] = Ne(r[t]);
|
|
7044
7044
|
return e;
|
|
7045
7045
|
}
|
|
7046
7046
|
return U(r);
|
|
@@ -7108,12 +7108,12 @@ function an(r) {
|
|
|
7108
7108
|
}));
|
|
7109
7109
|
return u;
|
|
7110
7110
|
}
|
|
7111
|
-
function
|
|
7111
|
+
function Qt(r) {
|
|
7112
7112
|
const e = r.key, t = r.value, n = r.valueSpec;
|
|
7113
7113
|
let a = M(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}`)] : [];
|
|
7115
7115
|
}
|
|
7116
|
-
function
|
|
7116
|
+
function Na(r) {
|
|
7117
7117
|
const e = r.valueSpec, t = U(r.value.type);
|
|
7118
7118
|
let n, a = {}, o, i;
|
|
7119
7119
|
const s = t !== "categorical" && r.value.property === void 0, l = !s, u = M(r.value.stops) === "array" && M(r.value.stops[0]) === "array" && M(r.value.stops[0][0]) === "object", c = te({
|
|
@@ -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 && !
|
|
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:
|
|
7170
|
+
objectElementValidators: { zoom: Qt, value: d }
|
|
7171
7171
|
}));
|
|
7172
7172
|
} else
|
|
7173
7173
|
m = m.concat(d({
|
|
@@ -7177,7 +7177,7 @@ function ja(r) {
|
|
|
7177
7177
|
style: y.style,
|
|
7178
7178
|
styleSpec: y.styleSpec
|
|
7179
7179
|
}, w));
|
|
7180
|
-
return za(
|
|
7180
|
+
return za(Ne(w[1])) ? m.concat([new g(`${v}[1]`, w[1], "expressions are not allowed in function stops.")]) : m.concat(y.validateSpec({
|
|
7181
7181
|
key: `${v}[1]`,
|
|
7182
7182
|
value: w[1],
|
|
7183
7183
|
valueSpec: e,
|
|
@@ -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
|
|
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
|
}
|
|
@@ -7212,7 +7212,7 @@ function ja(r) {
|
|
|
7212
7212
|
}
|
|
7213
7213
|
}
|
|
7214
7214
|
function Ke(r) {
|
|
7215
|
-
const e = (r.expressionContext === "property" ? rl : Fa)(
|
|
7215
|
+
const e = (r.expressionContext === "property" ? rl : Fa)(Ne(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;
|
|
@@ -7223,9 +7223,9 @@ function Ke(r) {
|
|
|
7223
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 (!
|
|
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" && !
|
|
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 [];
|
|
@@ -7243,12 +7243,12 @@ function ut(r) {
|
|
|
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 on(r) {
|
|
7246
|
-
return $a(
|
|
7246
|
+
return $a(Ne(r.value)) ? Ke(Tt({}, r, {
|
|
7247
7247
|
expressionContext: "filter",
|
|
7248
7248
|
valueSpec: { value: "boolean" }
|
|
7249
|
-
})) :
|
|
7249
|
+
})) : ja(r);
|
|
7250
7250
|
}
|
|
7251
|
-
function
|
|
7251
|
+
function ja(r) {
|
|
7252
7252
|
const e = r.value, t = r.key;
|
|
7253
7253
|
if (M(e) !== "array")
|
|
7254
7254
|
return [new g(t, e, `array expected, ${M(e)} found`)];
|
|
@@ -7289,7 +7289,7 @@ function Na(r) {
|
|
|
7289
7289
|
case "all":
|
|
7290
7290
|
case "none":
|
|
7291
7291
|
for (let i = 1; i < e.length; i++)
|
|
7292
|
-
o = o.concat(
|
|
7292
|
+
o = o.concat(ja({
|
|
7293
7293
|
key: `${t}[${i}]`,
|
|
7294
7294
|
value: e[i],
|
|
7295
7295
|
style: r.style,
|
|
@@ -7320,11 +7320,11 @@ function Da(r, e) {
|
|
|
7320
7320
|
if (!c)
|
|
7321
7321
|
return [new g(t, i, `unknown property "${s}"`)];
|
|
7322
7322
|
let p;
|
|
7323
|
-
if (M(i) === "string" &&
|
|
7323
|
+
if (M(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 = [];
|
|
7327
|
-
return r.layerType === "symbol" && (s === "text-field" && a && !a.glyphs && f.push(new g(t, i, 'use of "text-field" requires a style "glyphs" property')), s === "text-font" && rn(
|
|
7327
|
+
return r.layerType === "symbol" && (s === "text-field" && a && !a.glyphs && f.push(new g(t, i, 'use of "text-field" requires a style "glyphs" property')), s === "text-font" && rn(Ne(i)) && U(i.type) === "identity" && f.push(new g(t, i, '"text-font" does not support identity functions'))), f.concat(n({
|
|
7328
7328
|
key: r.key,
|
|
7329
7329
|
value: i,
|
|
7330
7330
|
valueSpec: c,
|
|
@@ -7407,7 +7407,7 @@ function qa(r) {
|
|
|
7407
7407
|
validateSpec: l.validateSpec,
|
|
7408
7408
|
objectElementValidators: {
|
|
7409
7409
|
"*"(u) {
|
|
7410
|
-
return Ba(
|
|
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(
|
|
7425
|
+
return Ua(Tt({ layerType: i }, u));
|
|
7426
7426
|
}
|
|
7427
7427
|
}
|
|
7428
7428
|
});
|
|
@@ -7430,7 +7430,7 @@ function qa(r) {
|
|
|
7430
7430
|
}
|
|
7431
7431
|
})), e;
|
|
7432
7432
|
}
|
|
7433
|
-
function
|
|
7433
|
+
function je(r) {
|
|
7434
7434
|
const e = r.value, t = r.key, n = M(e);
|
|
7435
7435
|
return n !== "string" ? [new g(t, e, `string expected, ${n} found`)] : [];
|
|
7436
7436
|
}
|
|
@@ -7537,11 +7537,11 @@ function Ga(r) {
|
|
|
7537
7537
|
}
|
|
7538
7538
|
function sl({ key: r, value: e }) {
|
|
7539
7539
|
if (M(e) === "string")
|
|
7540
|
-
return
|
|
7540
|
+
return je({ key: r, value: e });
|
|
7541
7541
|
{
|
|
7542
7542
|
const t = [];
|
|
7543
7543
|
for (const n in e)
|
|
7544
|
-
t.push(...
|
|
7544
|
+
t.push(...je({ key: `${r}.${n}`, value: e[n] }));
|
|
7545
7545
|
return t;
|
|
7546
7546
|
}
|
|
7547
7547
|
}
|
|
@@ -7610,10 +7610,10 @@ function Ka(r) {
|
|
|
7610
7610
|
return o;
|
|
7611
7611
|
}
|
|
7612
7612
|
function ll(r) {
|
|
7613
|
-
return
|
|
7613
|
+
return je(r).length === 0 ? [] : Ke(r);
|
|
7614
7614
|
}
|
|
7615
7615
|
function ul(r) {
|
|
7616
|
-
return
|
|
7616
|
+
return je(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
|
|
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
|
|
7660
|
+
return Qt({
|
|
7661
7661
|
key: e,
|
|
7662
7662
|
value: t,
|
|
7663
7663
|
valueSpec: {}
|
|
@@ -7730,7 +7730,7 @@ function Xa(r) {
|
|
|
7730
7730
|
}
|
|
7731
7731
|
return e;
|
|
7732
7732
|
} else
|
|
7733
|
-
return
|
|
7733
|
+
return je({
|
|
7734
7734
|
key: n,
|
|
7735
7735
|
value: t
|
|
7736
7736
|
});
|
|
@@ -7779,12 +7779,12 @@ const Bn = {
|
|
|
7779
7779
|
},
|
|
7780
7780
|
array: an,
|
|
7781
7781
|
boolean: ol,
|
|
7782
|
-
number:
|
|
7782
|
+
number: Qt,
|
|
7783
7783
|
color: Mr,
|
|
7784
7784
|
constants: Oa,
|
|
7785
7785
|
enum: ut,
|
|
7786
7786
|
filter: on,
|
|
7787
|
-
function:
|
|
7787
|
+
function: Na,
|
|
7788
7788
|
layer: qa,
|
|
7789
7789
|
object: te,
|
|
7790
7790
|
source: Ga,
|
|
@@ -7793,7 +7793,7 @@ const Bn = {
|
|
|
7793
7793
|
terrain: Ka,
|
|
7794
7794
|
projection: hl,
|
|
7795
7795
|
projectionDefinition: yl,
|
|
7796
|
-
string:
|
|
7796
|
+
string: je,
|
|
7797
7797
|
formatted: ll,
|
|
7798
7798
|
resolvedImage: ul,
|
|
7799
7799
|
padding: cl,
|
|
@@ -7803,25 +7803,25 @@ const Bn = {
|
|
|
7803
7803
|
sprite: Xa,
|
|
7804
7804
|
state: Za
|
|
7805
7805
|
};
|
|
7806
|
-
function
|
|
7806
|
+
function $t(r) {
|
|
7807
7807
|
const e = r.value, t = r.valueSpec, n = r.styleSpec;
|
|
7808
|
-
return r.validateSpec =
|
|
7808
|
+
return r.validateSpec = $t, t.expression && rn(U(e)) ? Na(r) : t.expression && za(Ne(e)) ? Ke(r) : t.type && Bn[t.type] ? Bn[t.type](r) : te(Tt({}, r, {
|
|
7809
7809
|
valueSpec: t.type ? n[t.type] : t
|
|
7810
7810
|
}));
|
|
7811
7811
|
}
|
|
7812
7812
|
function Wa(r) {
|
|
7813
|
-
const e = r.value, t = r.key, n =
|
|
7813
|
+
const e = r.value, t = r.key, n = je(r);
|
|
7814
7814
|
return n.length || (e.indexOf("{fontstack}") === -1 && n.push(new g(t, e, '"glyphs" url must include a "{fontstack}" token')), e.indexOf("{range}") === -1 && n.push(new g(t, e, '"glyphs" url must include a "{range}" token'))), n;
|
|
7815
7815
|
}
|
|
7816
7816
|
function Y(r, e = Hi) {
|
|
7817
7817
|
let t = [];
|
|
7818
|
-
return t = t.concat(
|
|
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:
|
|
7824
|
+
validateSpec: $t,
|
|
7825
7825
|
objectElementValidators: {
|
|
7826
7826
|
glyphs: Wa,
|
|
7827
7827
|
"*"() {
|
|
@@ -7848,7 +7848,7 @@ function ce(r) {
|
|
|
7848
7848
|
return function(e) {
|
|
7849
7849
|
return r({
|
|
7850
7850
|
...e,
|
|
7851
|
-
validateSpec:
|
|
7851
|
+
validateSpec: $t
|
|
7852
7852
|
});
|
|
7853
7853
|
};
|
|
7854
7854
|
}
|
|
@@ -7863,7 +7863,7 @@ function pe(r) {
|
|
|
7863
7863
|
function qn(r) {
|
|
7864
7864
|
if (!r)
|
|
7865
7865
|
return {
|
|
7866
|
-
style: Qe[
|
|
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 qn(r) {
|
|
|
7875
7875
|
requiresUrlMonitoring: !1,
|
|
7876
7876
|
isFallback: !1
|
|
7877
7877
|
} : t.isValidJSON ? {
|
|
7878
|
-
style: Qe[
|
|
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 qn(r) {
|
|
|
7902
7902
|
requiresUrlMonitoring: !1,
|
|
7903
7903
|
isFallback: !1
|
|
7904
7904
|
} : {
|
|
7905
|
-
style: Qe[
|
|
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
|
|
@@ -8066,7 +8066,7 @@ class Cl extends ri {
|
|
|
8066
8066
|
}
|
|
8067
8067
|
}
|
|
8068
8068
|
var K, oe, Se, xe, Z, pt, q, Ja, J, Qa;
|
|
8069
|
-
class
|
|
8069
|
+
class dr {
|
|
8070
8070
|
constructor(e, t) {
|
|
8071
8071
|
be(this, q);
|
|
8072
8072
|
be(this, K);
|
|
@@ -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.
|
|
8231
|
+
const Al = "@maptiler/sdk", El = "3.6.0", Tl = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", _l = "MapTiler", Il = "dist/maptiler-sdk.mjs", Ml = "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/", Nl = "BSD-3-Clause", jl = { 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.3.0", "@maptiler/client": "~2.4.0", events: "^3.3.0", "gl-matrix": "^3.4.3", "js-base64": "^3.7.7", "maplibre-gl": "~5.6.0", uuid: "^11.0.5" }, ql = {
|
|
8232
8232
|
name: Al,
|
|
8233
8233
|
version: El,
|
|
8234
8234
|
description: Tl,
|
|
@@ -8241,8 +8241,8 @@ const Al = "@maptiler/sdk", El = "3.5.1-rc6", Tl = "The Javascript & TypeScript
|
|
|
8241
8241
|
exports: Fl,
|
|
8242
8242
|
keywords: $l,
|
|
8243
8243
|
homepage: Ol,
|
|
8244
|
-
license:
|
|
8245
|
-
repository:
|
|
8244
|
+
license: Nl,
|
|
8245
|
+
repository: jl,
|
|
8246
8246
|
scripts: Dl,
|
|
8247
8247
|
"lint-staged": { "*.ts": "npm run lint:fix" },
|
|
8248
8248
|
"ts-typecheck": { "*.ts": "npm tsc --noEmit" },
|
|
@@ -8282,7 +8282,7 @@ class Gl {
|
|
|
8282
8282
|
}
|
|
8283
8283
|
preparePayload() {
|
|
8284
8284
|
const e = new URL(V.telemetryURL);
|
|
8285
|
-
return e.searchParams.append("sdk", ql.version), e.searchParams.append("key", D.apiKey), e.searchParams.append("mtsid",
|
|
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
8288
|
var ct = typeof Float32Array < "u" ? Float32Array : Array;
|
|
@@ -8323,7 +8323,7 @@ function Zl(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 Wl = Zl;
|
|
8326
|
-
function
|
|
8326
|
+
function Lt() {
|
|
8327
8327
|
var r = new ct(3);
|
|
8328
8328
|
return ct != Float32Array && (r[0] = 0, r[1] = 0, r[2] = 0), r;
|
|
8329
8329
|
}
|
|
@@ -8331,7 +8331,7 @@ function Yl(r, e, t) {
|
|
|
8331
8331
|
var n = new ct(3);
|
|
8332
8332
|
return n[0] = r, n[1] = e, n[2] = t, n;
|
|
8333
8333
|
}
|
|
8334
|
-
function
|
|
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 Xn(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 =
|
|
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 Xn(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
|
|
8354
|
+
var yr, Zn;
|
|
8355
8355
|
function Ql() {
|
|
8356
|
-
return Zn || (Zn = 1,
|
|
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
|
-
}),
|
|
8505
|
+
}), yr;
|
|
8506
8506
|
}
|
|
8507
|
-
var
|
|
8507
|
+
var mr, Wn;
|
|
8508
8508
|
function eo() {
|
|
8509
|
-
if (Wn) return
|
|
8509
|
+
if (Wn) return mr;
|
|
8510
8510
|
Wn = 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
|
-
|
|
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
|
-
},
|
|
8808
|
+
}, mr;
|
|
8809
8809
|
}
|
|
8810
|
-
var
|
|
8810
|
+
var gr, Yn;
|
|
8811
8811
|
function eu() {
|
|
8812
|
-
if (Yn) return
|
|
8812
|
+
if (Yn) return gr;
|
|
8813
8813
|
Yn = 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
|
|
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
|
-
},
|
|
8856
|
+
}, gr;
|
|
8857
8857
|
}
|
|
8858
|
-
var
|
|
8858
|
+
var vr, Jn;
|
|
8859
8859
|
function tu() {
|
|
8860
|
-
if (Jn) return
|
|
8860
|
+
if (Jn) return vr;
|
|
8861
8861
|
Jn = 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
|
-
}),
|
|
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
|
|
8942
|
+
function At(r) {
|
|
8943
8943
|
if (!r)
|
|
8944
8944
|
return [1, 1, 1, 0];
|
|
8945
8945
|
if (r === "transparent")
|
|
@@ -9077,11 +9077,11 @@ const Ge = {
|
|
|
9077
9077
|
}
|
|
9078
9078
|
};
|
|
9079
9079
|
var Me = /* @__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))(Me || {});
|
|
9080
|
-
let
|
|
9080
|
+
let xt, ta, ra;
|
|
9081
9081
|
function gu({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
9082
|
-
|
|
9083
|
-
const a = r.createTexture();
|
|
9084
|
-
if (!e) {
|
|
9082
|
+
xt && !n && ra === JSON.stringify(e) && t(xt, ta), ra = JSON.stringify(e);
|
|
9083
|
+
const a = xt ?? r.createTexture();
|
|
9084
|
+
if (r.bindTexture(r.TEXTURE_CUBE_MAP, a), !e) {
|
|
9085
9085
|
console.warn("[CubemapLayer][loadCubemapTexture]: Faces are null");
|
|
9086
9086
|
return;
|
|
9087
9087
|
}
|
|
@@ -9117,7 +9117,7 @@ function gu({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
|
9117
9117
|
}
|
|
9118
9118
|
r.bindTexture(r.TEXTURE_CUBE_MAP, a), r.generateMipmap(r.TEXTURE_CUBE_MAP), 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);
|
|
9119
9119
|
const l = s.map((u) => u.image);
|
|
9120
|
-
t(a, l), ta = l,
|
|
9120
|
+
t(a, l), ta = l, xt = a;
|
|
9121
9121
|
}).catch((s) => {
|
|
9122
9122
|
console.error("[CubemapLayer][loadCubemapTexture]: Error loading cubemap texture", s);
|
|
9123
9123
|
});
|
|
@@ -9288,7 +9288,7 @@ class br {
|
|
|
9288
9288
|
*/
|
|
9289
9289
|
S(this, "imageFadeInDelta", 0);
|
|
9290
9290
|
const t = Cu(e, ku);
|
|
9291
|
-
this.options = t, this.currentFacesDefinitionKey = JSON.stringify(t.faces ?? t.preset ?? t.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor =
|
|
9291
|
+
this.options = t, 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;
|
|
9292
9292
|
}
|
|
9293
9293
|
/**
|
|
9294
9294
|
* Updates the cubemap object with the current faces and shader configuration.
|
|
@@ -9298,19 +9298,19 @@ class br {
|
|
|
9298
9298
|
* It creates a new Object3D instance with the specified vertex and fragment shaders,
|
|
9299
9299
|
* attributes, and uniforms. The cubemap will be rendered using this configuration.
|
|
9300
9300
|
*/
|
|
9301
|
-
updateCubemap() {
|
|
9301
|
+
updateCubemap({ facesNeedUpdate: e } = { facesNeedUpdate: !0 }) {
|
|
9302
9302
|
this.useCubemapTexture = this.faces !== null;
|
|
9303
|
-
const
|
|
9303
|
+
const t = Su.filter((n) => n === "cubeSampler" || n === "fadeOpacity" ? this.useCubemapTexture : !0);
|
|
9304
9304
|
this.cubemap = to({
|
|
9305
9305
|
gl: this.gl,
|
|
9306
9306
|
vertexShaderSource: yu,
|
|
9307
9307
|
// Because we only want to use the read the texture in gl if we're supposed to
|
|
9308
9308
|
fragmentShaderSource: this.useCubemapTexture ? ea.replace(na, xu) : ea.replace(na, ""),
|
|
9309
9309
|
attributesKeys: wu,
|
|
9310
|
-
uniformsKeys:
|
|
9310
|
+
uniformsKeys: t,
|
|
9311
9311
|
vertices: du,
|
|
9312
9312
|
indices: hu
|
|
9313
|
-
}), this.cubeMapNeedsUpdate =
|
|
9313
|
+
}), this.cubeMapNeedsUpdate = e, this.useCubemapTexture && this.updateTexture(this.gl, this.faces), this.animateColorChange();
|
|
9314
9314
|
}
|
|
9315
9315
|
/**
|
|
9316
9316
|
* Called when the layer is added to the map.
|
|
@@ -9466,16 +9466,16 @@ class br {
|
|
|
9466
9466
|
*/
|
|
9467
9467
|
async setCubemap(e) {
|
|
9468
9468
|
this.options = e;
|
|
9469
|
-
const t = JSON.stringify(e.faces ?? e.preset ?? e.path);
|
|
9470
|
-
|
|
9471
|
-
const
|
|
9472
|
-
if (e.color && this.targetBgColor.toString() !==
|
|
9473
|
-
this.setBgColor(
|
|
9469
|
+
const t = JSON.stringify(e.faces ?? e.preset ?? e.path), n = this.currentFacesDefinitionKey !== t;
|
|
9470
|
+
n && (await this.setCubemapFaces(e), this.cubeMapNeedsUpdate = !0);
|
|
9471
|
+
const a = At(e.color);
|
|
9472
|
+
if (e.color && this.targetBgColor.toString() !== a.toString())
|
|
9473
|
+
this.setBgColor(a);
|
|
9474
9474
|
else if (!e.color && e.preset && e.preset in Ge) {
|
|
9475
|
-
const
|
|
9476
|
-
this.setBgColor(
|
|
9475
|
+
const o = Ge[e.preset];
|
|
9476
|
+
this.setBgColor(At(o.color));
|
|
9477
9477
|
}
|
|
9478
|
-
this.updateCubemap();
|
|
9478
|
+
this.updateCubemap({ facesNeedUpdate: n });
|
|
9479
9479
|
}
|
|
9480
9480
|
/**
|
|
9481
9481
|
* Shows the cubemap layer by setting its visibility to "visible".
|
|
@@ -9757,17 +9757,17 @@ class wr {
|
|
|
9757
9757
|
Hl(i, t.defaultProjectionData.mainMatrix, a);
|
|
9758
9758
|
const s = this.plane.programInfo.uniformsLocations.matrix;
|
|
9759
9759
|
e.uniformMatrix4fv(s, !1, i);
|
|
9760
|
-
const l = rt(), u = this.map.transform.cameraPosition, c =
|
|
9761
|
-
Xn(f, p, c),
|
|
9762
|
-
const d =
|
|
9763
|
-
Xn(d, c, f),
|
|
9760
|
+
const l = rt(), u = this.map.transform.cameraPosition, c = hr(Lt(), u), p = Yl(0, 1, 0), f = Lt();
|
|
9761
|
+
Xn(f, p, c), hr(f, f);
|
|
9762
|
+
const d = Lt();
|
|
9763
|
+
Xn(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);
|
|
9764
9764
|
const h = this.plane.programInfo.uniformsLocations.rotationMatrix;
|
|
9765
9765
|
e.uniformMatrix4fv(h, !1, l);
|
|
9766
9766
|
const y = this.gradient.stops.length, m = [], w = [];
|
|
9767
9767
|
for (let v = 0; v <= y; v++)
|
|
9768
9768
|
if (v < y) {
|
|
9769
9769
|
m[v] = this.gradient.stops[v][0];
|
|
9770
|
-
const x =
|
|
9770
|
+
const x = At(this.gradient.stops[v][1]);
|
|
9771
9771
|
w.push(...x);
|
|
9772
9772
|
}
|
|
9773
9773
|
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);
|
|
@@ -10000,7 +10000,7 @@ let Mu = class ro extends k.Map {
|
|
|
10000
10000
|
pixelRatio: Co,
|
|
10001
10001
|
validateStyle: Lo
|
|
10002
10002
|
} = t;
|
|
10003
|
-
this.minimap = new
|
|
10003
|
+
this.minimap = new dr(h, {
|
|
10004
10004
|
zoom: y,
|
|
10005
10005
|
center: m,
|
|
10006
10006
|
style: w,
|
|
@@ -10024,7 +10024,7 @@ let Mu = class ro extends k.Map {
|
|
|
10024
10024
|
pixelRatio: Co,
|
|
10025
10025
|
validateStyle: Lo
|
|
10026
10026
|
}), this.addControl(this.minimap, h.position ?? "bottom-left");
|
|
10027
|
-
} else h === !0 ? (this.minimap = new
|
|
10027
|
+
} 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));
|
|
10028
10028
|
});
|
|
10029
10029
|
const d = (h) => {
|
|
10030
10030
|
h.terrain && (p = !0, f = {
|
|
@@ -10042,7 +10042,7 @@ let Mu = class ro extends k.Map {
|
|
|
10042
10042
|
console.warn("[webglcontextlost]", "Unexpected loss of WebGL context!"), this.fire("webglContextLost", y);
|
|
10043
10043
|
});
|
|
10044
10044
|
const h = this.getLayersOrder()[0];
|
|
10045
|
-
this.initSpace({ options: t, before: h }), this.initHalo({ options: t, before: h });
|
|
10045
|
+
t.space && this.initSpace({ options: t, before: h }), t.halo && this.initHalo({ options: t, before: h });
|
|
10046
10046
|
}), this.telemetry = new Gl(this);
|
|
10047
10047
|
}
|
|
10048
10048
|
getSpace() {
|
|
@@ -10283,7 +10283,6 @@ let Mu = class ro extends k.Map {
|
|
|
10283
10283
|
return l(), this;
|
|
10284
10284
|
return this.styleInProcess && this.once("style.load", () => {
|
|
10285
10285
|
var m, w, v, x;
|
|
10286
|
-
console.log("style.load");
|
|
10287
10286
|
const h = this.getLayersOrder()[0], y = a.style;
|
|
10288
10287
|
this.space ? this.setSpaceFromStyle({ style: y }) : this.initSpace({ before: h, spec: (w = (m = y.metadata) == null ? void 0 : m.maptiler) == null ? void 0 : w.space }), this.halo ? this.setHaloFromStyle({ style: y }) : this.initHalo({ before: h, spec: (x = (v = y.metadata) == null ? void 0 : v.maptiler) == null ? void 0 : x.halo });
|
|
10289
10288
|
}), this;
|
|
@@ -10577,9 +10576,18 @@ let Mu = class ro extends k.Map {
|
|
|
10577
10576
|
this.isTerrainEnabled = !0, this.growTerrain(t);
|
|
10578
10577
|
return;
|
|
10579
10578
|
}
|
|
10580
|
-
this.loaded() || this.isTerrainEnabled
|
|
10581
|
-
|
|
10582
|
-
|
|
10579
|
+
if (this.loaded() || this.isTerrainEnabled)
|
|
10580
|
+
a();
|
|
10581
|
+
else {
|
|
10582
|
+
const o = () => {
|
|
10583
|
+
this.getTerrain() && this.getSource(V.terrainSourceId) || a();
|
|
10584
|
+
};
|
|
10585
|
+
this.once("load", () => {
|
|
10586
|
+
o();
|
|
10587
|
+
}), this.once("moveend", () => {
|
|
10588
|
+
o();
|
|
10589
|
+
});
|
|
10590
|
+
}
|
|
10583
10591
|
}
|
|
10584
10592
|
/**
|
|
10585
10593
|
* Disable the 3D terrain visualization
|
|
@@ -10652,7 +10660,7 @@ let Mu = class ro extends k.Map {
|
|
|
10652
10660
|
* @returns
|
|
10653
10661
|
*/
|
|
10654
10662
|
getMaptilerSessionId() {
|
|
10655
|
-
return
|
|
10663
|
+
return Nr;
|
|
10656
10664
|
}
|
|
10657
10665
|
/**
|
|
10658
10666
|
* Updates the requestManager's transform request with a new function.
|
|
@@ -10785,16 +10793,16 @@ function Ru(r) {
|
|
|
10785
10793
|
times: n
|
|
10786
10794
|
};
|
|
10787
10795
|
}
|
|
10788
|
-
function
|
|
10796
|
+
function Et(r) {
|
|
10789
10797
|
const e = ["Polygon", "LineString", "Point", "Track", "gx:Track"];
|
|
10790
10798
|
let t, n, a, o, i;
|
|
10791
10799
|
const s = [], l = [];
|
|
10792
10800
|
if (E(r, "MultiGeometry") !== null)
|
|
10793
|
-
return
|
|
10801
|
+
return Et(E(r, "MultiGeometry"));
|
|
10794
10802
|
if (E(r, "MultiTrack") !== null)
|
|
10795
|
-
return
|
|
10803
|
+
return Et(E(r, "MultiTrack"));
|
|
10796
10804
|
if (E(r, "gx:MultiTrack") !== null)
|
|
10797
|
-
return
|
|
10805
|
+
return Et(E(r, "gx:MultiTrack"));
|
|
10798
10806
|
for (a = 0; a < e.length; a++)
|
|
10799
10807
|
if (n = G(r, e[a]), n) {
|
|
10800
10808
|
for (o = 0; o < n.length; o++)
|
|
@@ -10827,7 +10835,7 @@ function At(r) {
|
|
|
10827
10835
|
return { geoms: s, coordTimes: l };
|
|
10828
10836
|
}
|
|
10829
10837
|
function zu(r, e, t, n) {
|
|
10830
|
-
const a =
|
|
10838
|
+
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");
|
|
10831
10839
|
let d, h = O(E(r, "styleUrl")), y = E(r, "LineStyle"), m = E(r, "PolyStyle");
|
|
10832
10840
|
if (!a.geoms.length) return [];
|
|
10833
10841
|
if (i && (o.name = i), s && (o.address = s), h) {
|
|
@@ -10991,14 +10999,14 @@ function E(r, e) {
|
|
|
10991
10999
|
const t = G(r, e);
|
|
10992
11000
|
return t.length ? t[0] : null;
|
|
10993
11001
|
}
|
|
10994
|
-
function
|
|
11002
|
+
function Nu(r) {
|
|
10995
11003
|
return r.normalize && r.normalize(), r;
|
|
10996
11004
|
}
|
|
10997
11005
|
function lo(r) {
|
|
10998
11006
|
return r.map(Number.parseFloat).map((e) => Number.isNaN(e) ? null : e);
|
|
10999
11007
|
}
|
|
11000
11008
|
function O(r) {
|
|
11001
|
-
return r &&
|
|
11009
|
+
return r && Nu(r), r && r.textContent;
|
|
11002
11010
|
}
|
|
11003
11011
|
function Pr(r, e) {
|
|
11004
11012
|
const t = {};
|
|
@@ -11024,7 +11032,7 @@ function co(r) {
|
|
|
11024
11032
|
heartRate: n !== null ? Number.parseFloat(O(n) ?? "0") : null
|
|
11025
11033
|
};
|
|
11026
11034
|
}
|
|
11027
|
-
function
|
|
11035
|
+
function ju(r) {
|
|
11028
11036
|
let e = r;
|
|
11029
11037
|
try {
|
|
11030
11038
|
typeof e == "string" && (e = un(e));
|
|
@@ -11084,7 +11092,7 @@ const Rr = [
|
|
|
11084
11092
|
// https://colorhunt.co/palette/10a19d540375ff7000ffbf00
|
|
11085
11093
|
["#10A19D", "#540375", "#FF7000", "#FFBF00"]
|
|
11086
11094
|
];
|
|
11087
|
-
function
|
|
11095
|
+
function er() {
|
|
11088
11096
|
return Rr[~~(Math.random() * Rr.length)][~~(Math.random() * 4)];
|
|
11089
11097
|
}
|
|
11090
11098
|
function yt() {
|
|
@@ -11199,12 +11207,12 @@ function yo(r, e = 10) {
|
|
|
11199
11207
|
}).flat()
|
|
11200
11208
|
];
|
|
11201
11209
|
}
|
|
11202
|
-
function
|
|
11210
|
+
function kt(r) {
|
|
11203
11211
|
const e = r.toString(16);
|
|
11204
11212
|
return e.length === 1 ? `0${e}` : e;
|
|
11205
11213
|
}
|
|
11206
11214
|
function Bu(r) {
|
|
11207
|
-
return `#${
|
|
11215
|
+
return `#${kt(r[0])}${kt(r[1])}${kt(r[2])}${r.length === 4 ? kt(r[3]) : ""}`;
|
|
11208
11216
|
}
|
|
11209
11217
|
class C extends Array {
|
|
11210
11218
|
constructor(t = {}) {
|
|
@@ -12146,7 +12154,7 @@ async function qu(r, e, t = {}) {
|
|
|
12146
12154
|
throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");
|
|
12147
12155
|
let n = e.data;
|
|
12148
12156
|
if (typeof n == "string") {
|
|
12149
|
-
if (
|
|
12157
|
+
if (Ot(n))
|
|
12150
12158
|
n = `https://api.maptiler.com/data/${e.data}/features.json?key=${D.apiKey}`;
|
|
12151
12159
|
else if (((a = n.split(".").pop()) == null ? void 0 : a.toLowerCase().trim()) === "gpx") {
|
|
12152
12160
|
const s = await (await fetch(n, t)).text();
|
|
@@ -12155,7 +12163,7 @@ async function qu(r, e, t = {}) {
|
|
|
12155
12163
|
const s = await (await fetch(n, t)).text();
|
|
12156
12164
|
n = oo(s);
|
|
12157
12165
|
} else {
|
|
12158
|
-
const i = Vo(n) ??
|
|
12166
|
+
const i = Vo(n) ?? ju(n);
|
|
12159
12167
|
i && (n = i);
|
|
12160
12168
|
}
|
|
12161
12169
|
if (!n)
|
|
@@ -12178,7 +12186,7 @@ function Gu(r, e) {
|
|
|
12178
12186
|
type: "geojson",
|
|
12179
12187
|
data: e.data
|
|
12180
12188
|
});
|
|
12181
|
-
const o = e.lineWidth ?? 3, i = e.lineColor ??
|
|
12189
|
+
const o = e.lineWidth ?? 3, i = e.lineColor ?? er(), s = e.lineOpacity ?? 1, l = e.lineBlur ?? 0, u = e.lineGapWidth ?? 0;
|
|
12182
12190
|
let c = e.lineDashArray ?? null;
|
|
12183
12191
|
const p = e.outlineWidth ?? 1, f = e.outlineColor ?? "#FFFFFF", d = e.outlineOpacity ?? 1, h = e.outlineBlur ?? 0;
|
|
12184
12192
|
if (typeof c == "string" && (c = pn(c)), e.outline === !0) {
|
|
@@ -12242,13 +12250,13 @@ function Vu(r, e) {
|
|
|
12242
12250
|
};
|
|
12243
12251
|
if (e.data && !r.getSource(t)) {
|
|
12244
12252
|
let y = e.data;
|
|
12245
|
-
typeof y == "string" &&
|
|
12253
|
+
typeof y == "string" && Ot(y) && (y = `https://api.maptiler.com/data/${y}/features.json?key=${D.apiKey}`), r.addSource(t, {
|
|
12246
12254
|
type: "geojson",
|
|
12247
12255
|
data: y
|
|
12248
12256
|
});
|
|
12249
12257
|
}
|
|
12250
12258
|
let o = e.outlineDashArray ?? null;
|
|
12251
|
-
const i = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ??
|
|
12259
|
+
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;
|
|
12252
12260
|
typeof o == "string" && (o = pn(o));
|
|
12253
12261
|
const h = (y = null) => {
|
|
12254
12262
|
if (r.addLayer(
|
|
@@ -12335,7 +12343,7 @@ function Hu(r, e) {
|
|
|
12335
12343
|
};
|
|
12336
12344
|
if (e.data && !r.getSource(l)) {
|
|
12337
12345
|
let L = e.data;
|
|
12338
|
-
typeof L == "string" &&
|
|
12346
|
+
typeof L == "string" && Ot(L) && (L = `https://api.maptiler.com/data/${L}/features.json?key=${D.apiKey}`), r.addSource(l, {
|
|
12339
12347
|
type: "geojson",
|
|
12340
12348
|
data: L,
|
|
12341
12349
|
cluster: a
|
|
@@ -12401,7 +12409,7 @@ function Hu(r, e) {
|
|
|
12401
12409
|
e.beforeId
|
|
12402
12410
|
);
|
|
12403
12411
|
} else {
|
|
12404
|
-
let L = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) :
|
|
12412
|
+
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([
|
|
12405
12413
|
{ zoom: 0, value: e.pointRadius * 0.025 },
|
|
12406
12414
|
{ zoom: 2, value: e.pointRadius * 0.05 },
|
|
12407
12415
|
{ zoom: 4, value: e.pointRadius * 0.1 },
|
|
@@ -12516,7 +12524,7 @@ function Ku(r, e) {
|
|
|
12516
12524
|
};
|
|
12517
12525
|
if (e.data && !r.getSource(t)) {
|
|
12518
12526
|
let v = e.data;
|
|
12519
|
-
typeof v == "string" &&
|
|
12527
|
+
typeof v == "string" && Ot(v) && (v = `https://api.maptiler.com/data/${v}/features.json?key=${D.apiKey}`), r.addSource(t, {
|
|
12520
12528
|
type: "geojson",
|
|
12521
12529
|
data: v
|
|
12522
12530
|
});
|
|
@@ -12551,7 +12559,7 @@ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12551
12559
|
dashArrayMaker: pn,
|
|
12552
12560
|
generateRandomLayerName: mt,
|
|
12553
12561
|
generateRandomSourceName: yt,
|
|
12554
|
-
getRandomColor:
|
|
12562
|
+
getRandomColor: er,
|
|
12555
12563
|
heatmapIntensityFromColorRamp: yo,
|
|
12556
12564
|
lerpZoomNumberValues: zr,
|
|
12557
12565
|
opacityDrivenByProperty: Or,
|
|
@@ -12564,9 +12572,9 @@ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12564
12572
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12565
12573
|
qo();
|
|
12566
12574
|
function kc() {
|
|
12567
|
-
return "3.
|
|
12575
|
+
return "3.6.0";
|
|
12568
12576
|
}
|
|
12569
|
-
const Cc = k.Map, Lc = k.Marker, Ac = k.Popup, Ec = k.Style, Tc = k.CanvasSource, _c = k.GeoJSONSource, Ic = k.ImageSource, Mc = k.RasterTileSource, Pc = k.RasterDEMTileSource, Rc = k.VectorTileSource, zc = k.VideoSource, Fc = k.NavigationControl, $c = k.GeolocateControl, Oc = k.AttributionControl,
|
|
12577
|
+
const Cc = k.Map, Lc = k.Marker, Ac = k.Popup, Ec = k.Style, Tc = k.CanvasSource, _c = k.GeoJSONSource, Ic = k.ImageSource, Mc = k.RasterTileSource, Pc = k.RasterDEMTileSource, Rc = k.VectorTileSource, zc = k.VideoSource, Fc = k.NavigationControl, $c = k.GeolocateControl, Oc = k.AttributionControl, Nc = k.LogoControl, jc = 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, Zc = k.MapMouseEvent, Wc = k.config, Yc = k.getVersion, {
|
|
12570
12578
|
setRTLTextPlugin: Jc,
|
|
12571
12579
|
getRTLTextPluginStatus: Qc,
|
|
12572
12580
|
LngLat: ep,
|
|
@@ -12634,7 +12642,7 @@ export {
|
|
|
12634
12642
|
ep as LngLat,
|
|
12635
12643
|
tp as LngLatBounds,
|
|
12636
12644
|
ni as LogoControl,
|
|
12637
|
-
|
|
12645
|
+
Nc as LogoControlMLGL,
|
|
12638
12646
|
Mu as Map,
|
|
12639
12647
|
Cc as MapMLGL,
|
|
12640
12648
|
Sc as MapMouseEvent,
|
|
@@ -12665,7 +12673,7 @@ export {
|
|
|
12665
12673
|
Mc as RasterTileSourceMLGL,
|
|
12666
12674
|
Ip as ReferenceMapStyle,
|
|
12667
12675
|
ai as ScaleControl,
|
|
12668
|
-
|
|
12676
|
+
jc as ScaleControlMLGL,
|
|
12669
12677
|
yc as ScrollZoomHandler,
|
|
12670
12678
|
qc as ScrollZoomHandlerMLGL,
|
|
12671
12679
|
$o as SdkConfig,
|
|
@@ -12696,8 +12704,8 @@ export {
|
|
|
12696
12704
|
$p as data,
|
|
12697
12705
|
ec as displayWebGLContextLostWarning,
|
|
12698
12706
|
Op as elevation,
|
|
12699
|
-
|
|
12700
|
-
|
|
12707
|
+
Np as expandMapStyle,
|
|
12708
|
+
jp as geocoding,
|
|
12701
12709
|
Dp as geolocation,
|
|
12702
12710
|
Up as getAutoLanguage,
|
|
12703
12711
|
mn as getBrowserLanguage,
|
|
@@ -12714,7 +12722,7 @@ export {
|
|
|
12714
12722
|
mp as getWorkerCount,
|
|
12715
12723
|
wp as getWorkerUrl,
|
|
12716
12724
|
ao as gpx,
|
|
12717
|
-
|
|
12725
|
+
ju as gpxOrKml,
|
|
12718
12726
|
no as hasChildNodeWithName,
|
|
12719
12727
|
xc as helpers,
|
|
12720
12728
|
kp as importScriptInWorkers,
|