basemapkit 0.1.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.
@@ -0,0 +1,3340 @@
1
+ import { language_script_pairs as G, get_country_name as q, get_multiline_name as P } from "@protomaps/basemaps";
2
+ const k = {
3
+ aliceblue: [240, 248, 255],
4
+ antiquewhite: [250, 235, 215],
5
+ aqua: [0, 255, 255],
6
+ aquamarine: [127, 255, 212],
7
+ azure: [240, 255, 255],
8
+ beige: [245, 245, 220],
9
+ bisque: [255, 228, 196],
10
+ black: [0, 0, 0],
11
+ blanchedalmond: [255, 235, 205],
12
+ blue: [0, 0, 255],
13
+ blueviolet: [138, 43, 226],
14
+ brown: [165, 42, 42],
15
+ burlywood: [222, 184, 135],
16
+ cadetblue: [95, 158, 160],
17
+ chartreuse: [127, 255, 0],
18
+ chocolate: [210, 105, 30],
19
+ coral: [255, 127, 80],
20
+ cornflowerblue: [100, 149, 237],
21
+ cornsilk: [255, 248, 220],
22
+ crimson: [220, 20, 60],
23
+ cyan: [0, 255, 255],
24
+ darkblue: [0, 0, 139],
25
+ darkcyan: [0, 139, 139],
26
+ darkgoldenrod: [184, 134, 11],
27
+ darkgray: [169, 169, 169],
28
+ darkgreen: [0, 100, 0],
29
+ darkgrey: [169, 169, 169],
30
+ darkkhaki: [189, 183, 107],
31
+ darkmagenta: [139, 0, 139],
32
+ darkolivegreen: [85, 107, 47],
33
+ darkorange: [255, 140, 0],
34
+ darkorchid: [153, 50, 204],
35
+ darkred: [139, 0, 0],
36
+ darksalmon: [233, 150, 122],
37
+ darkseagreen: [143, 188, 143],
38
+ darkslateblue: [72, 61, 139],
39
+ darkslategray: [47, 79, 79],
40
+ darkslategrey: [47, 79, 79],
41
+ darkturquoise: [0, 206, 209],
42
+ darkviolet: [148, 0, 211],
43
+ deeppink: [255, 20, 147],
44
+ deepskyblue: [0, 191, 255],
45
+ dimgray: [105, 105, 105],
46
+ dimgrey: [105, 105, 105],
47
+ dodgerblue: [30, 144, 255],
48
+ firebrick: [178, 34, 34],
49
+ floralwhite: [255, 250, 240],
50
+ forestgreen: [34, 139, 34],
51
+ fuchsia: [255, 0, 255],
52
+ gainsboro: [220, 220, 220],
53
+ ghostwhite: [248, 248, 255],
54
+ gold: [255, 215, 0],
55
+ goldenrod: [218, 165, 32],
56
+ gray: [128, 128, 128],
57
+ green: [0, 128, 0],
58
+ greenyellow: [173, 255, 47],
59
+ grey: [128, 128, 128],
60
+ honeydew: [240, 255, 240],
61
+ hotpink: [255, 105, 180],
62
+ indianred: [205, 92, 92],
63
+ indigo: [75, 0, 130],
64
+ ivory: [255, 255, 240],
65
+ khaki: [240, 230, 140],
66
+ lavender: [230, 230, 250],
67
+ lavenderblush: [255, 240, 245],
68
+ lawngreen: [124, 252, 0],
69
+ lemonchiffon: [255, 250, 205],
70
+ lightblue: [173, 216, 230],
71
+ lightcoral: [240, 128, 128],
72
+ lightcyan: [224, 255, 255],
73
+ lightgoldenrodyellow: [250, 250, 210],
74
+ lightgray: [211, 211, 211],
75
+ lightgreen: [144, 238, 144],
76
+ lightgrey: [211, 211, 211],
77
+ lightpink: [255, 182, 193],
78
+ lightsalmon: [255, 160, 122],
79
+ lightseagreen: [32, 178, 170],
80
+ lightskyblue: [135, 206, 250],
81
+ lightslategray: [119, 136, 153],
82
+ lightslategrey: [119, 136, 153],
83
+ lightsteelblue: [176, 196, 222],
84
+ lightyellow: [255, 255, 224],
85
+ lime: [0, 255, 0],
86
+ limegreen: [50, 205, 50],
87
+ linen: [250, 240, 230],
88
+ magenta: [255, 0, 255],
89
+ maroon: [128, 0, 0],
90
+ mediumaquamarine: [102, 205, 170],
91
+ mediumblue: [0, 0, 205],
92
+ mediumorchid: [186, 85, 211],
93
+ mediumpurple: [147, 112, 219],
94
+ mediumseagreen: [60, 179, 113],
95
+ mediumslateblue: [123, 104, 238],
96
+ mediumspringgreen: [0, 250, 154],
97
+ mediumturquoise: [72, 209, 204],
98
+ mediumvioletred: [199, 21, 133],
99
+ midnightblue: [25, 25, 112],
100
+ mintcream: [245, 255, 250],
101
+ mistyrose: [255, 228, 225],
102
+ moccasin: [255, 228, 181],
103
+ navajowhite: [255, 222, 173],
104
+ navy: [0, 0, 128],
105
+ oldlace: [253, 245, 230],
106
+ olive: [128, 128, 0],
107
+ olivedrab: [107, 142, 35],
108
+ orange: [255, 165, 0],
109
+ orangered: [255, 69, 0],
110
+ orchid: [218, 112, 214],
111
+ palegoldenrod: [238, 232, 170],
112
+ palegreen: [152, 251, 152],
113
+ paleturquoise: [175, 238, 238],
114
+ palevioletred: [219, 112, 147],
115
+ papayawhip: [255, 239, 213],
116
+ peachpuff: [255, 218, 185],
117
+ peru: [205, 133, 63],
118
+ pink: [255, 192, 203],
119
+ plum: [221, 160, 221],
120
+ powderblue: [176, 224, 230],
121
+ purple: [128, 0, 128],
122
+ rebeccapurple: [102, 51, 153],
123
+ red: [255, 0, 0],
124
+ rosybrown: [188, 143, 143],
125
+ royalblue: [65, 105, 225],
126
+ saddlebrown: [139, 69, 19],
127
+ salmon: [250, 128, 114],
128
+ sandybrown: [244, 164, 96],
129
+ seagreen: [46, 139, 87],
130
+ seashell: [255, 245, 238],
131
+ sienna: [160, 82, 45],
132
+ silver: [192, 192, 192],
133
+ skyblue: [135, 206, 235],
134
+ slateblue: [106, 90, 205],
135
+ slategray: [112, 128, 144],
136
+ slategrey: [112, 128, 144],
137
+ snow: [255, 250, 250],
138
+ springgreen: [0, 255, 127],
139
+ steelblue: [70, 130, 180],
140
+ tan: [210, 180, 140],
141
+ teal: [0, 128, 128],
142
+ thistle: [216, 191, 216],
143
+ tomato: [255, 99, 71],
144
+ turquoise: [64, 224, 208],
145
+ violet: [238, 130, 238],
146
+ wheat: [245, 222, 179],
147
+ white: [255, 255, 255],
148
+ whitesmoke: [245, 245, 245],
149
+ yellow: [255, 255, 0],
150
+ yellowgreen: [154, 205, 50]
151
+ }, B = /* @__PURE__ */ Object.create(null);
152
+ for (const n in k)
153
+ Object.hasOwn(k, n) && (B[k[n]] = n);
154
+ const y = {
155
+ to: {},
156
+ get: {}
157
+ };
158
+ y.get = function(n) {
159
+ const e = n.slice(0, 3).toLowerCase();
160
+ let t, o;
161
+ switch (e) {
162
+ case "hsl": {
163
+ t = y.get.hsl(n), o = "hsl";
164
+ break;
165
+ }
166
+ case "hwb": {
167
+ t = y.get.hwb(n), o = "hwb";
168
+ break;
169
+ }
170
+ default: {
171
+ t = y.get.rgb(n), o = "rgb";
172
+ break;
173
+ }
174
+ }
175
+ return t ? { model: o, value: t } : null;
176
+ };
177
+ y.get.rgb = function(n) {
178
+ if (!n)
179
+ return null;
180
+ const e = /^#([a-f\d]{3,4})$/i, t = /^#([a-f\d]{6})([a-f\d]{2})?$/i, o = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, i = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, l = /^(\w+)$/;
181
+ let r = [0, 0, 0, 1], a, s, u;
182
+ if (a = n.match(t)) {
183
+ for (u = a[2], a = a[1], s = 0; s < 3; s++) {
184
+ const _ = s * 2;
185
+ r[s] = Number.parseInt(a.slice(_, _ + 2), 16);
186
+ }
187
+ u && (r[3] = Number.parseInt(u, 16) / 255);
188
+ } else if (a = n.match(e)) {
189
+ for (a = a[1], u = a[3], s = 0; s < 3; s++)
190
+ r[s] = Number.parseInt(a[s] + a[s], 16);
191
+ u && (r[3] = Number.parseInt(u + u, 16) / 255);
192
+ } else if (a = n.match(o)) {
193
+ for (s = 0; s < 3; s++)
194
+ r[s] = Number.parseInt(a[s + 1], 10);
195
+ a[4] && (r[3] = a[5] ? Number.parseFloat(a[4]) * 0.01 : Number.parseFloat(a[4]));
196
+ } else if (a = n.match(i)) {
197
+ for (s = 0; s < 3; s++)
198
+ r[s] = Math.round(Number.parseFloat(a[s + 1]) * 2.55);
199
+ a[4] && (r[3] = a[5] ? Number.parseFloat(a[4]) * 0.01 : Number.parseFloat(a[4]));
200
+ } else return (a = n.match(l)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(k, a[1]) ? (r = k[a[1]], r[3] = 1, r) : null : null;
201
+ for (s = 0; s < 3; s++)
202
+ r[s] = z(r[s], 0, 255);
203
+ return r[3] = z(r[3], 0, 1), r;
204
+ };
205
+ y.get.hsl = function(n) {
206
+ if (!n)
207
+ return null;
208
+ const e = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = n.match(e);
209
+ if (t) {
210
+ const o = Number.parseFloat(t[4]), i = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = z(Number.parseFloat(t[2]), 0, 100), r = z(Number.parseFloat(t[3]), 0, 100), a = z(Number.isNaN(o) ? 1 : o, 0, 1);
211
+ return [i, l, r, a];
212
+ }
213
+ return null;
214
+ };
215
+ y.get.hwb = function(n) {
216
+ if (!n)
217
+ return null;
218
+ const e = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = n.match(e);
219
+ if (t) {
220
+ const o = Number.parseFloat(t[4]), i = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = z(Number.parseFloat(t[2]), 0, 100), r = z(Number.parseFloat(t[3]), 0, 100), a = z(Number.isNaN(o) ? 1 : o, 0, 1);
221
+ return [i, l, r, a];
222
+ }
223
+ return null;
224
+ };
225
+ y.to.hex = function(...n) {
226
+ return "#" + C(n[0]) + C(n[1]) + C(n[2]) + (n[3] < 1 ? C(Math.round(n[3] * 255)) : "");
227
+ };
228
+ y.to.rgb = function(...n) {
229
+ return n.length < 4 || n[3] === 1 ? "rgb(" + Math.round(n[0]) + ", " + Math.round(n[1]) + ", " + Math.round(n[2]) + ")" : "rgba(" + Math.round(n[0]) + ", " + Math.round(n[1]) + ", " + Math.round(n[2]) + ", " + n[3] + ")";
230
+ };
231
+ y.to.rgb.percent = function(...n) {
232
+ const e = Math.round(n[0] / 255 * 100), t = Math.round(n[1] / 255 * 100), o = Math.round(n[2] / 255 * 100);
233
+ return n.length < 4 || n[3] === 1 ? "rgb(" + e + "%, " + t + "%, " + o + "%)" : "rgba(" + e + "%, " + t + "%, " + o + "%, " + n[3] + ")";
234
+ };
235
+ y.to.hsl = function(...n) {
236
+ return n.length < 4 || n[3] === 1 ? "hsl(" + n[0] + ", " + n[1] + "%, " + n[2] + "%)" : "hsla(" + n[0] + ", " + n[1] + "%, " + n[2] + "%, " + n[3] + ")";
237
+ };
238
+ y.to.hwb = function(...n) {
239
+ let e = "";
240
+ return n.length >= 4 && n[3] !== 1 && (e = ", " + n[3]), "hwb(" + n[0] + ", " + n[1] + "%, " + n[2] + "%" + e + ")";
241
+ };
242
+ y.to.keyword = function(...n) {
243
+ return B[n.slice(0, 3)];
244
+ };
245
+ function z(n, e, t) {
246
+ return Math.min(Math.max(e, n), t);
247
+ }
248
+ function C(n) {
249
+ const e = Math.round(n).toString(16).toUpperCase();
250
+ return e.length < 2 ? "0" + e : e;
251
+ }
252
+ const J = {};
253
+ for (const n of Object.keys(k))
254
+ J[k[n]] = n;
255
+ const c = {
256
+ rgb: { channels: 3, labels: "rgb" },
257
+ hsl: { channels: 3, labels: "hsl" },
258
+ hsv: { channels: 3, labels: "hsv" },
259
+ hwb: { channels: 3, labels: "hwb" },
260
+ cmyk: { channels: 4, labels: "cmyk" },
261
+ xyz: { channels: 3, labels: "xyz" },
262
+ lab: { channels: 3, labels: "lab" },
263
+ oklab: { channels: 3, labels: ["okl", "oka", "okb"] },
264
+ lch: { channels: 3, labels: "lch" },
265
+ oklch: { channels: 3, labels: ["okl", "okc", "okh"] },
266
+ hex: { channels: 1, labels: ["hex"] },
267
+ keyword: { channels: 1, labels: ["keyword"] },
268
+ ansi16: { channels: 1, labels: ["ansi16"] },
269
+ ansi256: { channels: 1, labels: ["ansi256"] },
270
+ hcg: { channels: 3, labels: ["h", "c", "g"] },
271
+ apple: { channels: 3, labels: ["r16", "g16", "b16"] },
272
+ gray: { channels: 1, labels: ["gray"] }
273
+ }, w = (6 / 29) ** 3;
274
+ function N(n) {
275
+ const e = n > 31308e-7 ? 1.055 * n ** 0.4166666666666667 - 0.055 : n * 12.92;
276
+ return Math.min(Math.max(0, e), 1);
277
+ }
278
+ function S(n) {
279
+ return n > 0.04045 ? ((n + 0.055) / 1.055) ** 2.4 : n / 12.92;
280
+ }
281
+ for (const n of Object.keys(c)) {
282
+ if (!("channels" in c[n]))
283
+ throw new Error("missing channels property: " + n);
284
+ if (!("labels" in c[n]))
285
+ throw new Error("missing channel labels property: " + n);
286
+ if (c[n].labels.length !== c[n].channels)
287
+ throw new Error("channel and label counts mismatch: " + n);
288
+ const { channels: e, labels: t } = c[n];
289
+ delete c[n].channels, delete c[n].labels, Object.defineProperty(c[n], "channels", { value: e }), Object.defineProperty(c[n], "labels", { value: t });
290
+ }
291
+ c.rgb.hsl = function(n) {
292
+ const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.min(e, t, o), l = Math.max(e, t, o), r = l - i;
293
+ let a, s;
294
+ switch (l) {
295
+ case i: {
296
+ a = 0;
297
+ break;
298
+ }
299
+ case e: {
300
+ a = (t - o) / r;
301
+ break;
302
+ }
303
+ case t: {
304
+ a = 2 + (o - e) / r;
305
+ break;
306
+ }
307
+ case o: {
308
+ a = 4 + (e - t) / r;
309
+ break;
310
+ }
311
+ }
312
+ a = Math.min(a * 60, 360), a < 0 && (a += 360);
313
+ const u = (i + l) / 2;
314
+ return l === i ? s = 0 : u <= 0.5 ? s = r / (l + i) : s = r / (2 - l - i), [a, s * 100, u * 100];
315
+ };
316
+ c.rgb.hsv = function(n) {
317
+ let e, t, o, i, l;
318
+ const r = n[0] / 255, a = n[1] / 255, s = n[2] / 255, u = Math.max(r, a, s), _ = u - Math.min(r, a, s), m = function(F) {
319
+ return (u - F) / 6 / _ + 1 / 2;
320
+ };
321
+ if (_ === 0)
322
+ i = 0, l = 0;
323
+ else {
324
+ switch (l = _ / u, e = m(r), t = m(a), o = m(s), u) {
325
+ case r: {
326
+ i = o - t;
327
+ break;
328
+ }
329
+ case a: {
330
+ i = 1 / 3 + e - o;
331
+ break;
332
+ }
333
+ case s: {
334
+ i = 2 / 3 + t - e;
335
+ break;
336
+ }
337
+ }
338
+ i < 0 ? i += 1 : i > 1 && (i -= 1);
339
+ }
340
+ return [
341
+ i * 360,
342
+ l * 100,
343
+ u * 100
344
+ ];
345
+ };
346
+ c.rgb.hwb = function(n) {
347
+ const e = n[0], t = n[1];
348
+ let o = n[2];
349
+ const i = c.rgb.hsl(n)[0], l = 1 / 255 * Math.min(e, Math.min(t, o));
350
+ return o = 1 - 1 / 255 * Math.max(e, Math.max(t, o)), [i, l * 100, o * 100];
351
+ };
352
+ c.rgb.oklab = function(n) {
353
+ const e = S(n[0] / 255), t = S(n[1] / 255), o = S(n[2] / 255), i = Math.cbrt(0.4122214708 * e + 0.5363325363 * t + 0.0514459929 * o), l = Math.cbrt(0.2119034982 * e + 0.6806995451 * t + 0.1073969566 * o), r = Math.cbrt(0.0883024619 * e + 0.2817188376 * t + 0.6299787005 * o), a = 0.2104542553 * i + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * i - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * i + 0.7827717662 * l - 0.808675766 * r;
354
+ return [a * 100, s * 100, u * 100];
355
+ };
356
+ c.rgb.cmyk = function(n) {
357
+ const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.min(1 - e, 1 - t, 1 - o), l = (1 - e - i) / (1 - i) || 0, r = (1 - t - i) / (1 - i) || 0, a = (1 - o - i) / (1 - i) || 0;
358
+ return [l * 100, r * 100, a * 100, i * 100];
359
+ };
360
+ function V(n, e) {
361
+ return (n[0] - e[0]) ** 2 + (n[1] - e[1]) ** 2 + (n[2] - e[2]) ** 2;
362
+ }
363
+ c.rgb.keyword = function(n) {
364
+ const e = J[n];
365
+ if (e)
366
+ return e;
367
+ let t = Number.POSITIVE_INFINITY, o;
368
+ for (const i of Object.keys(k)) {
369
+ const l = k[i], r = V(n, l);
370
+ r < t && (t = r, o = i);
371
+ }
372
+ return o;
373
+ };
374
+ c.keyword.rgb = function(n) {
375
+ return k[n];
376
+ };
377
+ c.rgb.xyz = function(n) {
378
+ const e = S(n[0] / 255), t = S(n[1] / 255), o = S(n[2] / 255), i = e * 0.4124564 + t * 0.3575761 + o * 0.1804375, l = e * 0.2126729 + t * 0.7151522 + o * 0.072175, r = e * 0.0193339 + t * 0.119192 + o * 0.9503041;
379
+ return [i * 100, l * 100, r * 100];
380
+ };
381
+ c.rgb.lab = function(n) {
382
+ const e = c.rgb.xyz(n);
383
+ let t = e[0], o = e[1], i = e[2];
384
+ t /= 95.047, o /= 100, i /= 108.883, t = t > w ? t ** (1 / 3) : 7.787 * t + 16 / 116, o = o > w ? o ** (1 / 3) : 7.787 * o + 16 / 116, i = i > w ? i ** (1 / 3) : 7.787 * i + 16 / 116;
385
+ const l = 116 * o - 16, r = 500 * (t - o), a = 200 * (o - i);
386
+ return [l, r, a];
387
+ };
388
+ c.hsl.rgb = function(n) {
389
+ const e = n[0] / 360, t = n[1] / 100, o = n[2] / 100;
390
+ let i, l;
391
+ if (t === 0)
392
+ return l = o * 255, [l, l, l];
393
+ const r = o < 0.5 ? o * (1 + t) : o + t - o * t, a = 2 * o - r, s = [0, 0, 0];
394
+ for (let u = 0; u < 3; u++)
395
+ i = e + 1 / 3 * -(u - 1), i < 0 && i++, i > 1 && i--, 6 * i < 1 ? l = a + (r - a) * 6 * i : 2 * i < 1 ? l = r : 3 * i < 2 ? l = a + (r - a) * (2 / 3 - i) * 6 : l = a, s[u] = l * 255;
396
+ return s;
397
+ };
398
+ c.hsl.hsv = function(n) {
399
+ const e = n[0];
400
+ let t = n[1] / 100, o = n[2] / 100, i = t;
401
+ const l = Math.max(o, 0.01);
402
+ o *= 2, t *= o <= 1 ? o : 2 - o, i *= l <= 1 ? l : 2 - l;
403
+ const r = (o + t) / 2, a = o === 0 ? 2 * i / (l + i) : 2 * t / (o + t);
404
+ return [e, a * 100, r * 100];
405
+ };
406
+ c.hsv.rgb = function(n) {
407
+ const e = n[0] / 60, t = n[1] / 100;
408
+ let o = n[2] / 100;
409
+ const i = Math.floor(e) % 6, l = e - Math.floor(e), r = 255 * o * (1 - t), a = 255 * o * (1 - t * l), s = 255 * o * (1 - t * (1 - l));
410
+ switch (o *= 255, i) {
411
+ case 0:
412
+ return [o, s, r];
413
+ case 1:
414
+ return [a, o, r];
415
+ case 2:
416
+ return [r, o, s];
417
+ case 3:
418
+ return [r, a, o];
419
+ case 4:
420
+ return [s, r, o];
421
+ case 5:
422
+ return [o, r, a];
423
+ }
424
+ };
425
+ c.hsv.hsl = function(n) {
426
+ const e = n[0], t = n[1] / 100, o = n[2] / 100, i = Math.max(o, 0.01);
427
+ let l, r;
428
+ r = (2 - t) * o;
429
+ const a = (2 - t) * i;
430
+ return l = t * i, l /= a <= 1 ? a : 2 - a, l = l || 0, r /= 2, [e, l * 100, r * 100];
431
+ };
432
+ c.hwb.rgb = function(n) {
433
+ const e = n[0] / 360;
434
+ let t = n[1] / 100, o = n[2] / 100;
435
+ const i = t + o;
436
+ let l;
437
+ i > 1 && (t /= i, o /= i);
438
+ const r = Math.floor(6 * e), a = 1 - o;
439
+ l = 6 * e - r, (r & 1) !== 0 && (l = 1 - l);
440
+ const s = t + l * (a - t);
441
+ let u, _, m;
442
+ switch (r) {
443
+ default:
444
+ case 6:
445
+ case 0: {
446
+ u = a, _ = s, m = t;
447
+ break;
448
+ }
449
+ case 1: {
450
+ u = s, _ = a, m = t;
451
+ break;
452
+ }
453
+ case 2: {
454
+ u = t, _ = a, m = s;
455
+ break;
456
+ }
457
+ case 3: {
458
+ u = t, _ = s, m = a;
459
+ break;
460
+ }
461
+ case 4: {
462
+ u = s, _ = t, m = a;
463
+ break;
464
+ }
465
+ case 5: {
466
+ u = a, _ = t, m = s;
467
+ break;
468
+ }
469
+ }
470
+ return [u * 255, _ * 255, m * 255];
471
+ };
472
+ c.cmyk.rgb = function(n) {
473
+ const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = n[3] / 100, l = 1 - Math.min(1, e * (1 - i) + i), r = 1 - Math.min(1, t * (1 - i) + i), a = 1 - Math.min(1, o * (1 - i) + i);
474
+ return [l * 255, r * 255, a * 255];
475
+ };
476
+ c.xyz.rgb = function(n) {
477
+ const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100;
478
+ let i, l, r;
479
+ return i = e * 3.2404542 + t * -1.5371385 + o * -0.4985314, l = e * -0.969266 + t * 1.8760108 + o * 0.041556, r = e * 0.0556434 + t * -0.2040259 + o * 1.0572252, i = N(i), l = N(l), r = N(r), [i * 255, l * 255, r * 255];
480
+ };
481
+ c.xyz.lab = function(n) {
482
+ let e = n[0], t = n[1], o = n[2];
483
+ e /= 95.047, t /= 100, o /= 108.883, e = e > w ? e ** (1 / 3) : 7.787 * e + 16 / 116, t = t > w ? t ** (1 / 3) : 7.787 * t + 16 / 116, o = o > w ? o ** (1 / 3) : 7.787 * o + 16 / 116;
484
+ const i = 116 * t - 16, l = 500 * (e - t), r = 200 * (t - o);
485
+ return [i, l, r];
486
+ };
487
+ c.xyz.oklab = function(n) {
488
+ const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = Math.cbrt(0.8189330101 * e + 0.3618667424 * t - 0.1288597137 * o), l = Math.cbrt(0.0329845436 * e + 0.9293118715 * t + 0.0361456387 * o), r = Math.cbrt(0.0482003018 * e + 0.2643662691 * t + 0.633851707 * o), a = 0.2104542553 * i + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * i - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * i + 0.7827717662 * l - 0.808675766 * r;
489
+ return [a * 100, s * 100, u * 100];
490
+ };
491
+ c.oklab.oklch = function(n) {
492
+ return c.lab.lch(n);
493
+ };
494
+ c.oklab.xyz = function(n) {
495
+ const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = (0.999999998 * e + 0.396337792 * t + 0.215803758 * o) ** 3, l = (1.000000008 * e - 0.105561342 * t - 0.063854175 * o) ** 3, r = (1.000000055 * e - 0.089484182 * t - 1.291485538 * o) ** 3, a = 1.227013851 * i - 0.55779998 * l + 0.281256149 * r, s = -0.040580178 * i + 1.11225687 * l - 0.071676679 * r, u = -0.076381285 * i - 0.421481978 * l + 1.58616322 * r;
496
+ return [a * 100, s * 100, u * 100];
497
+ };
498
+ c.oklab.rgb = function(n) {
499
+ const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = (e + 0.3963377774 * t + 0.2158037573 * o) ** 3, l = (e - 0.1055613458 * t - 0.0638541728 * o) ** 3, r = (e - 0.0894841775 * t - 1.291485548 * o) ** 3, a = N(4.0767416621 * i - 3.3077115913 * l + 0.2309699292 * r), s = N(-1.2684380046 * i + 2.6097574011 * l - 0.3413193965 * r), u = N(-0.0041960863 * i - 0.7034186147 * l + 1.707614701 * r);
500
+ return [a * 255, s * 255, u * 255];
501
+ };
502
+ c.oklch.oklab = function(n) {
503
+ return c.lch.lab(n);
504
+ };
505
+ c.lab.xyz = function(n) {
506
+ const e = n[0], t = n[1], o = n[2];
507
+ let i, l, r;
508
+ l = (e + 16) / 116, i = t / 500 + l, r = l - o / 200;
509
+ const a = l ** 3, s = i ** 3, u = r ** 3;
510
+ return l = a > w ? a : (l - 16 / 116) / 7.787, i = s > w ? s : (i - 16 / 116) / 7.787, r = u > w ? u : (r - 16 / 116) / 7.787, i *= 95.047, l *= 100, r *= 108.883, [i, l, r];
511
+ };
512
+ c.lab.lch = function(n) {
513
+ const e = n[0], t = n[1], o = n[2];
514
+ let i;
515
+ i = Math.atan2(o, t) * 360 / 2 / Math.PI, i < 0 && (i += 360);
516
+ const r = Math.sqrt(t * t + o * o);
517
+ return [e, r, i];
518
+ };
519
+ c.lch.lab = function(n) {
520
+ const e = n[0], t = n[1], i = n[2] / 360 * 2 * Math.PI, l = t * Math.cos(i), r = t * Math.sin(i);
521
+ return [e, l, r];
522
+ };
523
+ c.rgb.ansi16 = function(n, e = null) {
524
+ const [t, o, i] = n;
525
+ let l = e === null ? c.rgb.hsv(n)[2] : e;
526
+ if (l = Math.round(l / 50), l === 0)
527
+ return 30;
528
+ let r = 30 + (Math.round(i / 255) << 2 | Math.round(o / 255) << 1 | Math.round(t / 255));
529
+ return l === 2 && (r += 60), r;
530
+ };
531
+ c.hsv.ansi16 = function(n) {
532
+ return c.rgb.ansi16(c.hsv.rgb(n), n[2]);
533
+ };
534
+ c.rgb.ansi256 = function(n) {
535
+ const e = n[0], t = n[1], o = n[2];
536
+ return e >> 4 === t >> 4 && t >> 4 === o >> 4 ? e < 8 ? 16 : e > 248 ? 231 : Math.round((e - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(e / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(o / 255 * 5);
537
+ };
538
+ c.ansi16.rgb = function(n) {
539
+ n = n[0];
540
+ let e = n % 10;
541
+ if (e === 0 || e === 7)
542
+ return n > 50 && (e += 3.5), e = e / 10.5 * 255, [e, e, e];
543
+ const t = (Math.trunc(n > 50) + 1) * 0.5, o = (e & 1) * t * 255, i = (e >> 1 & 1) * t * 255, l = (e >> 2 & 1) * t * 255;
544
+ return [o, i, l];
545
+ };
546
+ c.ansi256.rgb = function(n) {
547
+ if (n = n[0], n >= 232) {
548
+ const l = (n - 232) * 10 + 8;
549
+ return [l, l, l];
550
+ }
551
+ n -= 16;
552
+ let e;
553
+ const t = Math.floor(n / 36) / 5 * 255, o = Math.floor((e = n % 36) / 6) / 5 * 255, i = e % 6 / 5 * 255;
554
+ return [t, o, i];
555
+ };
556
+ c.rgb.hex = function(n) {
557
+ const t = (((Math.round(n[0]) & 255) << 16) + ((Math.round(n[1]) & 255) << 8) + (Math.round(n[2]) & 255)).toString(16).toUpperCase();
558
+ return "000000".slice(t.length) + t;
559
+ };
560
+ c.hex.rgb = function(n) {
561
+ const e = n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
562
+ if (!e)
563
+ return [0, 0, 0];
564
+ let t = e[0];
565
+ e[0].length === 3 && (t = [...t].map((a) => a + a).join(""));
566
+ const o = Number.parseInt(t, 16), i = o >> 16 & 255, l = o >> 8 & 255, r = o & 255;
567
+ return [i, l, r];
568
+ };
569
+ c.rgb.hcg = function(n) {
570
+ const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.max(Math.max(e, t), o), l = Math.min(Math.min(e, t), o), r = i - l;
571
+ let a;
572
+ const s = r < 1 ? l / (1 - r) : 0;
573
+ return r <= 0 ? a = 0 : i === e ? a = (t - o) / r % 6 : i === t ? a = 2 + (o - e) / r : a = 4 + (e - t) / r, a /= 6, a %= 1, [a * 360, r * 100, s * 100];
574
+ };
575
+ c.hsl.hcg = function(n) {
576
+ const e = n[1] / 100, t = n[2] / 100, o = t < 0.5 ? 2 * e * t : 2 * e * (1 - t);
577
+ let i = 0;
578
+ return o < 1 && (i = (t - 0.5 * o) / (1 - o)), [n[0], o * 100, i * 100];
579
+ };
580
+ c.hsv.hcg = function(n) {
581
+ const e = n[1] / 100, t = n[2] / 100, o = e * t;
582
+ let i = 0;
583
+ return o < 1 && (i = (t - o) / (1 - o)), [n[0], o * 100, i * 100];
584
+ };
585
+ c.hcg.rgb = function(n) {
586
+ const e = n[0] / 360, t = n[1] / 100, o = n[2] / 100;
587
+ if (t === 0)
588
+ return [o * 255, o * 255, o * 255];
589
+ const i = [0, 0, 0], l = e % 1 * 6, r = l % 1, a = 1 - r;
590
+ let s = 0;
591
+ switch (Math.floor(l)) {
592
+ case 0: {
593
+ i[0] = 1, i[1] = r, i[2] = 0;
594
+ break;
595
+ }
596
+ case 1: {
597
+ i[0] = a, i[1] = 1, i[2] = 0;
598
+ break;
599
+ }
600
+ case 2: {
601
+ i[0] = 0, i[1] = 1, i[2] = r;
602
+ break;
603
+ }
604
+ case 3: {
605
+ i[0] = 0, i[1] = a, i[2] = 1;
606
+ break;
607
+ }
608
+ case 4: {
609
+ i[0] = r, i[1] = 0, i[2] = 1;
610
+ break;
611
+ }
612
+ default:
613
+ i[0] = 1, i[1] = 0, i[2] = a;
614
+ }
615
+ return s = (1 - t) * o, [
616
+ (t * i[0] + s) * 255,
617
+ (t * i[1] + s) * 255,
618
+ (t * i[2] + s) * 255
619
+ ];
620
+ };
621
+ c.hcg.hsv = function(n) {
622
+ const e = n[1] / 100, t = n[2] / 100, o = e + t * (1 - e);
623
+ let i = 0;
624
+ return o > 0 && (i = e / o), [n[0], i * 100, o * 100];
625
+ };
626
+ c.hcg.hsl = function(n) {
627
+ const e = n[1] / 100, o = n[2] / 100 * (1 - e) + 0.5 * e;
628
+ let i = 0;
629
+ return o > 0 && o < 0.5 ? i = e / (2 * o) : o >= 0.5 && o < 1 && (i = e / (2 * (1 - o))), [n[0], i * 100, o * 100];
630
+ };
631
+ c.hcg.hwb = function(n) {
632
+ const e = n[1] / 100, t = n[2] / 100, o = e + t * (1 - e);
633
+ return [n[0], (o - e) * 100, (1 - o) * 100];
634
+ };
635
+ c.hwb.hcg = function(n) {
636
+ const e = n[1] / 100, o = 1 - n[2] / 100, i = o - e;
637
+ let l = 0;
638
+ return i < 1 && (l = (o - i) / (1 - i)), [n[0], i * 100, l * 100];
639
+ };
640
+ c.apple.rgb = function(n) {
641
+ return [n[0] / 65535 * 255, n[1] / 65535 * 255, n[2] / 65535 * 255];
642
+ };
643
+ c.rgb.apple = function(n) {
644
+ return [n[0] / 255 * 65535, n[1] / 255 * 65535, n[2] / 255 * 65535];
645
+ };
646
+ c.gray.rgb = function(n) {
647
+ return [n[0] / 100 * 255, n[0] / 100 * 255, n[0] / 100 * 255];
648
+ };
649
+ c.gray.hsl = function(n) {
650
+ return [0, 0, n[0]];
651
+ };
652
+ c.gray.hsv = c.gray.hsl;
653
+ c.gray.hwb = function(n) {
654
+ return [0, 100, n[0]];
655
+ };
656
+ c.gray.cmyk = function(n) {
657
+ return [0, 0, 0, n[0]];
658
+ };
659
+ c.gray.lab = function(n) {
660
+ return [n[0], 0, 0];
661
+ };
662
+ c.gray.hex = function(n) {
663
+ const e = Math.round(n[0] / 100 * 255) & 255, o = ((e << 16) + (e << 8) + e).toString(16).toUpperCase();
664
+ return "000000".slice(o.length) + o;
665
+ };
666
+ c.rgb.gray = function(n) {
667
+ return [(n[0] + n[1] + n[2]) / 3 / 255 * 100];
668
+ };
669
+ function Q() {
670
+ const n = {}, e = Object.keys(c);
671
+ for (let { length: t } = e, o = 0; o < t; o++)
672
+ n[e[o]] = {
673
+ // http://jsperf.com/1-vs-infinity
674
+ // micro-opt, but this is simple.
675
+ distance: -1,
676
+ parent: null
677
+ };
678
+ return n;
679
+ }
680
+ function X(n) {
681
+ const e = Q(), t = [n];
682
+ for (e[n].distance = 0; t.length > 0; ) {
683
+ const o = t.pop(), i = Object.keys(c[o]);
684
+ for (let { length: l } = i, r = 0; r < l; r++) {
685
+ const a = i[r], s = e[a];
686
+ s.distance === -1 && (s.distance = e[o].distance + 1, s.parent = o, t.unshift(a));
687
+ }
688
+ }
689
+ return e;
690
+ }
691
+ function Z(n, e) {
692
+ return function(t) {
693
+ return e(n(t));
694
+ };
695
+ }
696
+ function nn(n, e) {
697
+ const t = [e[n].parent, n];
698
+ let o = c[e[n].parent][n], i = e[n].parent;
699
+ for (; e[i].parent; )
700
+ t.unshift(e[i].parent), o = Z(c[e[i].parent][i], o), i = e[i].parent;
701
+ return o.conversion = t, o;
702
+ }
703
+ function en(n) {
704
+ const e = X(n), t = {}, o = Object.keys(e);
705
+ for (let { length: i } = o, l = 0; l < i; l++) {
706
+ const r = o[l];
707
+ e[r].parent !== null && (t[r] = nn(r, e));
708
+ }
709
+ return t;
710
+ }
711
+ const b = {}, tn = Object.keys(c);
712
+ function on(n) {
713
+ const e = function(...t) {
714
+ const o = t[0];
715
+ return o == null ? o : (o.length > 1 && (t = o), n(t));
716
+ };
717
+ return "conversion" in n && (e.conversion = n.conversion), e;
718
+ }
719
+ function rn(n) {
720
+ const e = function(...t) {
721
+ const o = t[0];
722
+ if (o == null)
723
+ return o;
724
+ o.length > 1 && (t = o);
725
+ const i = n(t);
726
+ if (typeof i == "object")
727
+ for (let { length: l } = i, r = 0; r < l; r++)
728
+ i[r] = Math.round(i[r]);
729
+ return i;
730
+ };
731
+ return "conversion" in n && (e.conversion = n.conversion), e;
732
+ }
733
+ for (const n of tn) {
734
+ b[n] = {}, Object.defineProperty(b[n], "channels", { value: c[n].channels }), Object.defineProperty(b[n], "labels", { value: c[n].labels });
735
+ const e = en(n), t = Object.keys(e);
736
+ for (const o of t) {
737
+ const i = e[o];
738
+ b[n][o] = rn(i), b[n][o].raw = on(i);
739
+ }
740
+ }
741
+ const K = [
742
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
743
+ "keyword",
744
+ // Gray conflicts with some method names, and has its own method defined.
745
+ "gray",
746
+ // Shouldn't really be in color-convert either...
747
+ "hex"
748
+ ], I = {};
749
+ for (const n of Object.keys(b))
750
+ I[[...b[n].labels].sort().join("")] = n;
751
+ const A = {};
752
+ function h(n, e) {
753
+ if (!(this instanceof h))
754
+ return new h(n, e);
755
+ if (e && e in K && (e = null), e && !(e in b))
756
+ throw new Error("Unknown model: " + e);
757
+ let t, o;
758
+ if (n == null)
759
+ this.model = "rgb", this.color = [0, 0, 0], this.valpha = 1;
760
+ else if (n instanceof h)
761
+ this.model = n.model, this.color = [...n.color], this.valpha = n.valpha;
762
+ else if (typeof n == "string") {
763
+ const i = y.get(n);
764
+ if (i === null)
765
+ throw new Error("Unable to parse color from string: " + n);
766
+ this.model = i.model, o = b[this.model].channels, this.color = i.value.slice(0, o), this.valpha = typeof i.value[o] == "number" ? i.value[o] : 1;
767
+ } else if (n.length > 0) {
768
+ this.model = e || "rgb", o = b[this.model].channels;
769
+ const i = Array.prototype.slice.call(n, 0, o);
770
+ this.color = R(i, o), this.valpha = typeof n[o] == "number" ? n[o] : 1;
771
+ } else if (typeof n == "number")
772
+ this.model = "rgb", this.color = [
773
+ n >> 16 & 255,
774
+ n >> 8 & 255,
775
+ n & 255
776
+ ], this.valpha = 1;
777
+ else {
778
+ this.valpha = 1;
779
+ const i = Object.keys(n);
780
+ "alpha" in n && (i.splice(i.indexOf("alpha"), 1), this.valpha = typeof n.alpha == "number" ? n.alpha : 0);
781
+ const l = i.sort().join("");
782
+ if (!(l in I))
783
+ throw new Error("Unable to parse color from object: " + JSON.stringify(n));
784
+ this.model = I[l];
785
+ const { labels: r } = b[this.model], a = [];
786
+ for (t = 0; t < r.length; t++)
787
+ a.push(n[r[t]]);
788
+ this.color = R(a);
789
+ }
790
+ if (A[this.model])
791
+ for (o = b[this.model].channels, t = 0; t < o; t++) {
792
+ const i = A[this.model][t];
793
+ i && (this.color[t] = i(this.color[t]));
794
+ }
795
+ this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
796
+ }
797
+ h.prototype = {
798
+ toString() {
799
+ return this.string();
800
+ },
801
+ toJSON() {
802
+ return this[this.model]();
803
+ },
804
+ string(n) {
805
+ let e = this.model in y.to ? this : this.rgb();
806
+ e = e.round(typeof n == "number" ? n : 1);
807
+ const t = e.valpha === 1 ? e.color : [...e.color, this.valpha];
808
+ return y.to[e.model](...t);
809
+ },
810
+ percentString(n) {
811
+ const e = this.rgb().round(typeof n == "number" ? n : 1), t = e.valpha === 1 ? e.color : [...e.color, this.valpha];
812
+ return y.to.rgb.percent(...t);
813
+ },
814
+ array() {
815
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
816
+ },
817
+ object() {
818
+ const n = {}, { channels: e } = b[this.model], { labels: t } = b[this.model];
819
+ for (let o = 0; o < e; o++)
820
+ n[t[o]] = this.color[o];
821
+ return this.valpha !== 1 && (n.alpha = this.valpha), n;
822
+ },
823
+ unitArray() {
824
+ const n = this.rgb().color;
825
+ return n[0] /= 255, n[1] /= 255, n[2] /= 255, this.valpha !== 1 && n.push(this.valpha), n;
826
+ },
827
+ unitObject() {
828
+ const n = this.rgb().object();
829
+ return n.r /= 255, n.g /= 255, n.b /= 255, this.valpha !== 1 && (n.alpha = this.valpha), n;
830
+ },
831
+ round(n) {
832
+ return n = Math.max(n || 0, 0), new h([...this.color.map(an(n)), this.valpha], this.model);
833
+ },
834
+ alpha(n) {
835
+ return n !== void 0 ? new h([...this.color, Math.max(0, Math.min(1, n))], this.model) : this.valpha;
836
+ },
837
+ // Rgb
838
+ red: d("rgb", 0, f(255)),
839
+ green: d("rgb", 1, f(255)),
840
+ blue: d("rgb", 2, f(255)),
841
+ hue: d(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (n) => (n % 360 + 360) % 360),
842
+ saturationl: d("hsl", 1, f(100)),
843
+ lightness: d("hsl", 2, f(100)),
844
+ saturationv: d("hsv", 1, f(100)),
845
+ value: d("hsv", 2, f(100)),
846
+ chroma: d("hcg", 1, f(100)),
847
+ gray: d("hcg", 2, f(100)),
848
+ white: d("hwb", 1, f(100)),
849
+ wblack: d("hwb", 2, f(100)),
850
+ cyan: d("cmyk", 0, f(100)),
851
+ magenta: d("cmyk", 1, f(100)),
852
+ yellow: d("cmyk", 2, f(100)),
853
+ black: d("cmyk", 3, f(100)),
854
+ x: d("xyz", 0, f(95.047)),
855
+ y: d("xyz", 1, f(100)),
856
+ z: d("xyz", 2, f(108.833)),
857
+ l: d("lab", 0, f(100)),
858
+ a: d("lab", 1),
859
+ b: d("lab", 2),
860
+ keyword(n) {
861
+ return n !== void 0 ? new h(n) : b[this.model].keyword(this.color);
862
+ },
863
+ hex(n) {
864
+ return n !== void 0 ? new h(n) : y.to.hex(...this.rgb().round().color);
865
+ },
866
+ hexa(n) {
867
+ if (n !== void 0)
868
+ return new h(n);
869
+ const e = this.rgb().round().color;
870
+ let t = Math.round(this.valpha * 255).toString(16).toUpperCase();
871
+ return t.length === 1 && (t = "0" + t), y.to.hex(...e) + t;
872
+ },
873
+ rgbNumber() {
874
+ const n = this.rgb().color;
875
+ return (n[0] & 255) << 16 | (n[1] & 255) << 8 | n[2] & 255;
876
+ },
877
+ luminosity() {
878
+ const n = this.rgb().color, e = [];
879
+ for (const [t, o] of n.entries()) {
880
+ const i = o / 255;
881
+ e[t] = i <= 0.04045 ? i / 12.92 : ((i + 0.055) / 1.055) ** 2.4;
882
+ }
883
+ return 0.2126 * e[0] + 0.7152 * e[1] + 0.0722 * e[2];
884
+ },
885
+ contrast(n) {
886
+ const e = this.luminosity(), t = n.luminosity();
887
+ return e > t ? (e + 0.05) / (t + 0.05) : (t + 0.05) / (e + 0.05);
888
+ },
889
+ level(n) {
890
+ const e = this.contrast(n);
891
+ return e >= 7 ? "AAA" : e >= 4.5 ? "AA" : "";
892
+ },
893
+ isDark() {
894
+ const n = this.rgb().color;
895
+ return (n[0] * 2126 + n[1] * 7152 + n[2] * 722) / 1e4 < 128;
896
+ },
897
+ isLight() {
898
+ return !this.isDark();
899
+ },
900
+ negate() {
901
+ const n = this.rgb();
902
+ for (let e = 0; e < 3; e++)
903
+ n.color[e] = 255 - n.color[e];
904
+ return n;
905
+ },
906
+ lighten(n) {
907
+ const e = this.hsl();
908
+ return e.color[2] += e.color[2] * n, e;
909
+ },
910
+ darken(n) {
911
+ const e = this.hsl();
912
+ return e.color[2] -= e.color[2] * n, e;
913
+ },
914
+ saturate(n) {
915
+ const e = this.hsl();
916
+ return e.color[1] += e.color[1] * n, e;
917
+ },
918
+ desaturate(n) {
919
+ const e = this.hsl();
920
+ return e.color[1] -= e.color[1] * n, e;
921
+ },
922
+ whiten(n) {
923
+ const e = this.hwb();
924
+ return e.color[1] += e.color[1] * n, e;
925
+ },
926
+ blacken(n) {
927
+ const e = this.hwb();
928
+ return e.color[2] += e.color[2] * n, e;
929
+ },
930
+ grayscale() {
931
+ const n = this.rgb().color, e = n[0] * 0.3 + n[1] * 0.59 + n[2] * 0.11;
932
+ return h.rgb(e, e, e);
933
+ },
934
+ fade(n) {
935
+ return this.alpha(this.valpha - this.valpha * n);
936
+ },
937
+ opaquer(n) {
938
+ return this.alpha(this.valpha + this.valpha * n);
939
+ },
940
+ rotate(n) {
941
+ const e = this.hsl();
942
+ let t = e.color[0];
943
+ return t = (t + n) % 360, t = t < 0 ? 360 + t : t, e.color[0] = t, e;
944
+ },
945
+ mix(n, e) {
946
+ if (!n || !n.rgb)
947
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof n);
948
+ const t = n.rgb(), o = this.rgb(), i = e === void 0 ? 0.5 : e, l = 2 * i - 1, r = t.alpha() - o.alpha(), a = ((l * r === -1 ? l : (l + r) / (1 + l * r)) + 1) / 2, s = 1 - a;
949
+ return h.rgb(
950
+ a * t.red() + s * o.red(),
951
+ a * t.green() + s * o.green(),
952
+ a * t.blue() + s * o.blue(),
953
+ t.alpha() * i + o.alpha() * (1 - i)
954
+ );
955
+ }
956
+ };
957
+ for (const n of Object.keys(b)) {
958
+ if (K.includes(n))
959
+ continue;
960
+ const { channels: e } = b[n];
961
+ h.prototype[n] = function(...t) {
962
+ return this.model === n ? new h(this) : t.length > 0 ? new h(t, n) : new h([...sn(b[this.model][n].raw(this.color)), this.valpha], n);
963
+ }, h[n] = function(...t) {
964
+ let o = t[0];
965
+ return typeof o == "number" && (o = R(t, e)), new h(o, n);
966
+ };
967
+ }
968
+ function ln(n, e) {
969
+ return Number(n.toFixed(e));
970
+ }
971
+ function an(n) {
972
+ return function(e) {
973
+ return ln(e, n);
974
+ };
975
+ }
976
+ function d(n, e, t) {
977
+ n = Array.isArray(n) ? n : [n];
978
+ for (const o of n)
979
+ (A[o] || (A[o] = []))[e] = t;
980
+ return n = n[0], function(o) {
981
+ let i;
982
+ return o !== void 0 ? (t && (o = t(o)), i = this[n](), i.color[e] = o, i) : (i = this[n]().color[e], t && (i = t(i)), i);
983
+ };
984
+ }
985
+ function f(n) {
986
+ return function(e) {
987
+ return Math.max(0, Math.min(n, e));
988
+ };
989
+ }
990
+ function sn(n) {
991
+ return Array.isArray(n) ? n : [n];
992
+ }
993
+ function R(n, e) {
994
+ for (let t = 0; t < e; t++)
995
+ typeof n[t] != "number" && (n[t] = 0);
996
+ return n;
997
+ }
998
+ function W(n) {
999
+ return !!(typeof n == "string" && (n.startsWith("#") || n.startsWith("rgb(") || n.startsWith("rgba(") || n.startsWith("hsl(") || n.startsWith("hwb(")));
1000
+ }
1001
+ function T(n, e) {
1002
+ if (!(typeof n == "string" || typeof n == "number" || typeof n == "boolean" || n === null || n === void 0)) {
1003
+ if (Array.isArray(n))
1004
+ for (let t = 0; t < n.length; t += 1) {
1005
+ const o = n[t];
1006
+ if (W(o)) {
1007
+ n[t] = e(o);
1008
+ continue;
1009
+ }
1010
+ T(o, e);
1011
+ }
1012
+ else if (typeof n == "object") {
1013
+ const t = n, o = Object.keys(n);
1014
+ for (const i of o) {
1015
+ const l = t[i];
1016
+ if (W(l)) {
1017
+ t[i] = e(l);
1018
+ continue;
1019
+ }
1020
+ T(l, e);
1021
+ }
1022
+ }
1023
+ }
1024
+ }
1025
+ function cn(n, e) {
1026
+ const t = n / 255, o = t + (1 - t) * t * e;
1027
+ return Math.max(0, Math.min(255, o * 255));
1028
+ }
1029
+ function un(n, e) {
1030
+ return n.map((t) => cn(t, e));
1031
+ }
1032
+ function pn(n, e, t = 127) {
1033
+ const o = n - t, i = e >= 0 ? 1 + e * 2 : (
1034
+ // Map [0, 1] to [1, 3]
1035
+ 1 + e
1036
+ );
1037
+ let l;
1038
+ if (e >= 0) {
1039
+ const r = Math.abs(o) / t, a = i * (1 + r * e * 0.5);
1040
+ l = t + o * a;
1041
+ } else
1042
+ l = t + o * i;
1043
+ return Math.round(Math.max(0, Math.min(255, l)));
1044
+ }
1045
+ function dn(n, e, t = 127) {
1046
+ return n.map((o) => pn(o, e, t));
1047
+ }
1048
+ function hn(n, e, t = 1) {
1049
+ return 255 * (n / 255) * (e / 255) * t + n / 255 * (1 - t) * 255;
1050
+ }
1051
+ function _n(n, e, t = 1) {
1052
+ return n.map((o, i) => hn(n[i], e[i], t));
1053
+ }
1054
+ const fn = `[
1055
+ {
1056
+ "id": "background",
1057
+ "type": "background",
1058
+ "layout": {"visibility": "visible"},
1059
+ "paint": {"background-color": "#cccccc"}
1060
+ },
1061
+ {
1062
+ "id": "earth",
1063
+ "type": "fill",
1064
+ "source": "__protomaps_source",
1065
+ "source-layer": "earth",
1066
+ "filter": ["==", "$type", "Polygon"],
1067
+ "layout": {"visibility": "visible"},
1068
+ "paint": {"fill-color": "#fcf5e3"}
1069
+ },
1070
+ {
1071
+ "id": "landcover",
1072
+ "type": "fill",
1073
+ "source": "__protomaps_source",
1074
+ "source-layer": "landcover",
1075
+ "filter": [
1076
+ "all",
1077
+ [
1078
+ "in",
1079
+ "kind",
1080
+ "grassland",
1081
+ "barren",
1082
+ "urban_area",
1083
+ "farmland",
1084
+ "glacier",
1085
+ "scrub"
1086
+ ]
1087
+ ],
1088
+ "layout": {"visibility": "visible"},
1089
+ "paint": {
1090
+ "fill-color": [
1091
+ "match",
1092
+ ["get", "kind"],
1093
+ "grassland",
1094
+ "#cee6b5",
1095
+ "barren",
1096
+ "#fff0d4",
1097
+ "urban_area",
1098
+ "rgba(230, 230, 230, 1)",
1099
+ "farmland",
1100
+ "rgba(192, 222, 160, 0.3)",
1101
+ "glacier",
1102
+ "#e6ffff",
1103
+ "scrub",
1104
+ "#cee6b5",
1105
+ "#ff0000"
1106
+ ],
1107
+ "fill-opacity": [
1108
+ "interpolate",
1109
+ ["linear"],
1110
+ ["zoom"],
1111
+ 0,
1112
+ 1,
1113
+ 7,
1114
+ 0.8,
1115
+ 8,
1116
+ 0
1117
+ ]
1118
+ }
1119
+ },
1120
+ {
1121
+ "id": "landuse_residential",
1122
+ "type": "fill",
1123
+ "source": "__protomaps_source",
1124
+ "source-layer": "landuse",
1125
+ "filter": ["all", ["==", "kind", "residential"]],
1126
+ "layout": {"visibility": "visible"},
1127
+ "paint": {
1128
+ "fill-opacity": ["interpolate", ["linear"], ["zoom"], 8, 0, 12, 1],
1129
+ "fill-color": "#f7f3e9"
1130
+ }
1131
+ },
1132
+ {
1133
+ "id": "landuse_urban_green",
1134
+ "type": "fill",
1135
+ "source": "__protomaps_source",
1136
+ "source-layer": "landuse",
1137
+ "filter": ["in", "kind", "allotments", "village_green", "playground"],
1138
+ "layout": {"visibility": "visible"},
1139
+ "paint": {"fill-color": "#9cd3b4", "fill-opacity": 0.7}
1140
+ },
1141
+ {
1142
+ "id": "landuse-sand",
1143
+ "type": "fill",
1144
+ "source": "__protomaps_source",
1145
+ "source-layer": "landuse",
1146
+ "filter": ["all", ["==", "kind", "sand"]],
1147
+ "layout": {"visibility": "visible"},
1148
+ "paint": {
1149
+ "fill-opacity": ["interpolate", ["linear"], ["zoom"], 0, 1, 20, 0],
1150
+ "fill-color": "rgba(240, 226, 199, 1)"
1151
+ }
1152
+ },
1153
+ {
1154
+ "id": "landuse_bare_rock",
1155
+ "type": "fill",
1156
+ "source": "__protomaps_source",
1157
+ "source-layer": "landuse",
1158
+ "filter": ["all", ["in", "kind", "bare_rock"]],
1159
+ "layout": {"visibility": "visible"},
1160
+ "paint": {"fill-color": "rgb(221, 226, 226)"}
1161
+ },
1162
+ {
1163
+ "id": "landuse_park",
1164
+ "type": "fill",
1165
+ "source": "__protomaps_source",
1166
+ "source-layer": "landuse",
1167
+ "filter": [
1168
+ "all",
1169
+ [
1170
+ "in",
1171
+ "kind",
1172
+ "meadow",
1173
+ "park",
1174
+ "glacier",
1175
+ "cemetery",
1176
+ "golf_course",
1177
+ "scrub",
1178
+ "grassland",
1179
+ "grass",
1180
+ "naval_base",
1181
+ "airfield"
1182
+ ]
1183
+ ],
1184
+ "layout": {"visibility": "visible"},
1185
+ "paint": {
1186
+ "fill-opacity": 1,
1187
+ "fill-color": [
1188
+ "case",
1189
+ ["in", ["get", "kind"], ["literal", ["grass"]]],
1190
+ "#a5e87d",
1191
+ ["in", ["get", "kind"], ["literal", ["park", "golf_course"]]],
1192
+ "#b6e996",
1193
+ ["in", ["get", "kind"], ["literal", ["park", "meadow"]]],
1194
+ "#a6e085",
1195
+ ["in", ["get", "kind"], ["literal", ["scrub", "grassland"]]],
1196
+ "#cee6b5",
1197
+ ["in", ["get", "kind"], ["literal", ["glacier"]]],
1198
+ "#e6ffff",
1199
+ ["in", ["get", "kind"], ["literal", ["cemetery"]]],
1200
+ "#ccdbc5",
1201
+ ["in", ["get", "kind"], ["literal", ["sand"]]],
1202
+ "#fff3d5",
1203
+ [
1204
+ "in",
1205
+ ["get", "kind"],
1206
+ ["literal", ["military", "naval_base", "airfield"]]
1207
+ ],
1208
+ "#d1dede",
1209
+ "#e2dfda"
1210
+ ]
1211
+ }
1212
+ },
1213
+ {
1214
+ "id": "landuse_farmland",
1215
+ "type": "fill",
1216
+ "source": "__protomaps_source",
1217
+ "source-layer": "landuse",
1218
+ "filter": ["all", ["==", "kind", "farmland"]],
1219
+ "layout": {"visibility": "visible"},
1220
+ "paint": {"fill-color": "rgba(185, 255, 152, 1)", "fill-opacity": 0.2}
1221
+ },
1222
+ {
1223
+ "id": "landuse_pitch",
1224
+ "type": "fill",
1225
+ "source": "__protomaps_source",
1226
+ "source-layer": "landuse",
1227
+ "filter": ["all", ["==", "kind", "pitch"]],
1228
+ "layout": {"visibility": "visible"},
1229
+ "paint": {"fill-color": "rgba(81, 201, 70, 1)", "fill-opacity": 0.2}
1230
+ },
1231
+ {
1232
+ "id": "landuse_military",
1233
+ "type": "fill",
1234
+ "source": "__protomaps_source",
1235
+ "source-layer": "landuse",
1236
+ "filter": ["all", ["==", "kind", "military"]],
1237
+ "layout": {"visibility": "visible"},
1238
+ "paint": {"fill-color": "rgba(145, 145, 145, 1)", "fill-opacity": 0.2}
1239
+ },
1240
+ {
1241
+ "id": "landuse_wood-forest",
1242
+ "type": "fill",
1243
+ "source": "__protomaps_source",
1244
+ "source-layer": "landuse",
1245
+ "filter": ["all", ["in", "kind", "forest", "wood"]],
1246
+ "layout": {"visibility": "visible"},
1247
+ "paint": {
1248
+ "fill-opacity": ["interpolate", ["linear"], ["zoom"], 0, 1, 7, 1],
1249
+ "fill-color": "rgba(170, 222, 156, 1)"
1250
+ }
1251
+ },
1252
+ {
1253
+ "id": "landuse_hospital",
1254
+ "type": "fill",
1255
+ "source": "__protomaps_source",
1256
+ "source-layer": "landuse",
1257
+ "filter": ["==", "kind", "hospital"],
1258
+ "layout": {"visibility": "visible"},
1259
+ "paint": {"fill-color": "#e4dad9"}
1260
+ },
1261
+ {
1262
+ "id": "landuse_industrial",
1263
+ "type": "fill",
1264
+ "source": "__protomaps_source",
1265
+ "source-layer": "landuse",
1266
+ "filter": ["==", "kind", "industrial"],
1267
+ "layout": {"visibility": "visible"},
1268
+ "paint": {"fill-color": "#d1dde1"}
1269
+ },
1270
+ {
1271
+ "id": "landuse_school",
1272
+ "type": "fill",
1273
+ "source": "__protomaps_source",
1274
+ "source-layer": "landuse",
1275
+ "filter": ["in", "kind", "school", "university", "college"],
1276
+ "layout": {"visibility": "visible"},
1277
+ "paint": {"fill-color": "#e4ded7"}
1278
+ },
1279
+ {
1280
+ "id": "landuse_zoo",
1281
+ "type": "fill",
1282
+ "source": "__protomaps_source",
1283
+ "source-layer": "landuse",
1284
+ "filter": ["in", "kind", "zoo"],
1285
+ "layout": {"visibility": "visible"},
1286
+ "paint": {"fill-color": "#c6dcdc"}
1287
+ },
1288
+ {
1289
+ "id": "landuse_aerodrome",
1290
+ "type": "fill",
1291
+ "source": "__protomaps_source",
1292
+ "source-layer": "landuse",
1293
+ "filter": ["in", "kind", "aerodrome"],
1294
+ "layout": {"visibility": "visible"},
1295
+ "paint": {"fill-color": "#dadbdf"}
1296
+ },
1297
+ {
1298
+ "id": "roads_runway",
1299
+ "type": "line",
1300
+ "source": "__protomaps_source",
1301
+ "source-layer": "roads",
1302
+ "filter": ["==", "kind_detail", "runway"],
1303
+ "layout": {"visibility": "visible"},
1304
+ "paint": {
1305
+ "line-color": "#e9e9ed",
1306
+ "line-width": [
1307
+ "interpolate",
1308
+ ["exponential", 1.6],
1309
+ ["zoom"],
1310
+ 10,
1311
+ 0,
1312
+ 12,
1313
+ 4,
1314
+ 18,
1315
+ 30
1316
+ ]
1317
+ }
1318
+ },
1319
+ {
1320
+ "id": "roads_taxiway",
1321
+ "type": "line",
1322
+ "source": "__protomaps_source",
1323
+ "source-layer": "roads",
1324
+ "minzoom": 13,
1325
+ "filter": ["==", "kind_detail", "taxiway"],
1326
+ "layout": {"visibility": "visible"},
1327
+ "paint": {
1328
+ "line-color": "#e9e9ed",
1329
+ "line-width": [
1330
+ "interpolate",
1331
+ ["exponential", 1.6],
1332
+ ["zoom"],
1333
+ 13,
1334
+ 0,
1335
+ 13.5,
1336
+ 1,
1337
+ 15,
1338
+ 6
1339
+ ]
1340
+ }
1341
+ },
1342
+ {
1343
+ "id": "landuse_runway",
1344
+ "type": "fill",
1345
+ "source": "__protomaps_source",
1346
+ "source-layer": "landuse",
1347
+ "filter": ["any", ["in", "kind", "runway", "taxiway"]],
1348
+ "paint": {"fill-color": "#e9e9ed"}
1349
+ },
1350
+ {
1351
+ "id": "water",
1352
+ "type": "fill",
1353
+ "source": "__protomaps_source",
1354
+ "source-layer": "water",
1355
+ "filter": ["==", "$type", "Polygon"],
1356
+ "layout": {"visibility": "visible"},
1357
+ "paint": {"fill-color": "rgb(135, 199, 236)"}
1358
+ },
1359
+ {
1360
+ "id": "water_stream",
1361
+ "type": "line",
1362
+ "source": "__protomaps_source",
1363
+ "source-layer": "water",
1364
+ "minzoom": 14,
1365
+ "filter": ["in", "kind", "stream"],
1366
+ "layout": {"visibility": "visible"},
1367
+ "paint": {"line-width": 0.5, "line-color": "rgba(18, 157, 222, 1)"}
1368
+ },
1369
+ {
1370
+ "id": "landuse_beach",
1371
+ "type": "fill",
1372
+ "source": "__protomaps_source",
1373
+ "source-layer": "landuse",
1374
+ "filter": ["in", "kind", "beach"],
1375
+ "layout": {"visibility": "visible"},
1376
+ "paint": {"fill-color": "#fff0d4"}
1377
+ },
1378
+ {
1379
+ "id": "water_river",
1380
+ "type": "line",
1381
+ "source": "__protomaps_source",
1382
+ "source-layer": "water",
1383
+ "minzoom": 9,
1384
+ "filter": ["in", "kind", "river"],
1385
+ "layout": {"visibility": "visible"},
1386
+ "paint": {
1387
+ "line-width": [
1388
+ "interpolate",
1389
+ ["exponential", 1.6],
1390
+ ["zoom"],
1391
+ 9,
1392
+ 0,
1393
+ 9.5,
1394
+ 1,
1395
+ 18,
1396
+ 12
1397
+ ],
1398
+ "line-color": "#C4EAFF"
1399
+ }
1400
+ },
1401
+ {
1402
+ "id": "landuse_wetland",
1403
+ "type": "fill",
1404
+ "source": "__protomaps_source",
1405
+ "source-layer": "landuse",
1406
+ "filter": ["all", ["==", "kind", "wetland"]],
1407
+ "layout": {"visibility": "visible"},
1408
+ "paint": {"fill-color": "rgba(43, 63, 131, 0.07)"}
1409
+ },
1410
+ {
1411
+ "id": "ferry",
1412
+ "type": "line",
1413
+ "source": "__protomaps_source",
1414
+ "source-layer": "roads",
1415
+ "filter": ["all", ["==", "kind", "ferry"]],
1416
+ "layout": {"visibility": "visible"},
1417
+ "paint": {
1418
+ "line-dasharray": [1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3],
1419
+ "line-opacity": 0.5,
1420
+ "line-color": "rgba(76, 154, 205, 1)",
1421
+ "line-width": [
1422
+ "interpolate",
1423
+ ["exponential", 1.6],
1424
+ ["zoom"],
1425
+ 3,
1426
+ 0,
1427
+ 6,
1428
+ 1,
1429
+ 18,
1430
+ 3
1431
+ ]
1432
+ }
1433
+ },
1434
+ {
1435
+ "id": "landuse_pedestrian",
1436
+ "type": "fill",
1437
+ "source": "__protomaps_source",
1438
+ "source-layer": "landuse",
1439
+ "filter": ["in", "kind", "pedestrian", "dam"],
1440
+ "layout": {"visibility": "visible"},
1441
+ "paint": {"fill-color": "#e3e0d4"}
1442
+ },
1443
+ {
1444
+ "id": "landuse_pier",
1445
+ "type": "fill",
1446
+ "source": "__protomaps_source",
1447
+ "source-layer": "landuse",
1448
+ "filter": ["==", "kind", "pier"],
1449
+ "paint": {"fill-color": "#e0e0e0"}
1450
+ },
1451
+ {
1452
+ "id": "roads_tunnels_other_casing",
1453
+ "type": "line",
1454
+ "source": "__protomaps_source",
1455
+ "source-layer": "roads",
1456
+ "filter": ["all", ["has", "is_tunnel"], ["in", "kind", "other", "path"]],
1457
+ "paint": {
1458
+ "line-color": "#e0e0e0",
1459
+ "line-gap-width": [
1460
+ "interpolate",
1461
+ ["exponential", 1.6],
1462
+ ["zoom"],
1463
+ 14,
1464
+ 0,
1465
+ 20,
1466
+ 7
1467
+ ]
1468
+ }
1469
+ },
1470
+ {
1471
+ "id": "roads_tunnels_minor_casing",
1472
+ "type": "line",
1473
+ "source": "__protomaps_source",
1474
+ "source-layer": "roads",
1475
+ "filter": ["all", ["has", "is_tunnel"], ["==", "kind", "minor_road"]],
1476
+ "paint": {
1477
+ "line-color": "#e0e0e0",
1478
+ "line-dasharray": [3, 2],
1479
+ "line-gap-width": [
1480
+ "interpolate",
1481
+ ["exponential", 1.6],
1482
+ ["zoom"],
1483
+ 11,
1484
+ 0,
1485
+ 12.5,
1486
+ 0.5,
1487
+ 15,
1488
+ 2,
1489
+ 18,
1490
+ 11
1491
+ ],
1492
+ "line-width": [
1493
+ "interpolate",
1494
+ ["exponential", 1.6],
1495
+ ["zoom"],
1496
+ 12,
1497
+ 0,
1498
+ 12.5,
1499
+ 1
1500
+ ]
1501
+ }
1502
+ },
1503
+ {
1504
+ "id": "roads_tunnels_link_casing",
1505
+ "type": "line",
1506
+ "source": "__protomaps_source",
1507
+ "source-layer": "roads",
1508
+ "filter": ["all", ["has", "is_tunnel"], ["has", "is_link"]],
1509
+ "paint": {
1510
+ "line-color": "#e0e0e0",
1511
+ "line-dasharray": [3, 2],
1512
+ "line-gap-width": [
1513
+ "interpolate",
1514
+ ["exponential", 1.6],
1515
+ ["zoom"],
1516
+ 13,
1517
+ 0,
1518
+ 13.5,
1519
+ 1,
1520
+ 18,
1521
+ 11
1522
+ ],
1523
+ "line-width": [
1524
+ "interpolate",
1525
+ ["exponential", 1.6],
1526
+ ["zoom"],
1527
+ 12,
1528
+ 0,
1529
+ 12.5,
1530
+ 1
1531
+ ]
1532
+ }
1533
+ },
1534
+ {
1535
+ "id": "roads_tunnels_major_casing",
1536
+ "type": "line",
1537
+ "source": "__protomaps_source",
1538
+ "source-layer": "roads",
1539
+ "filter": [
1540
+ "all",
1541
+ ["!has", "is_tunnel"],
1542
+ ["!has", "is_bridge"],
1543
+ ["==", "kind", "major_road"]
1544
+ ],
1545
+ "layout": {"visibility": "visible"},
1546
+ "paint": {
1547
+ "line-color": "#e0e0e0",
1548
+ "line-dasharray": [3, 2],
1549
+ "line-gap-width": [
1550
+ "interpolate",
1551
+ ["exponential", 1.6],
1552
+ ["zoom"],
1553
+ 7,
1554
+ 0,
1555
+ 7.5,
1556
+ 0.5,
1557
+ 18,
1558
+ 13
1559
+ ],
1560
+ "line-width": [
1561
+ "interpolate",
1562
+ ["exponential", 1.6],
1563
+ ["zoom"],
1564
+ 9,
1565
+ 0,
1566
+ 9.5,
1567
+ 1
1568
+ ]
1569
+ }
1570
+ },
1571
+ {
1572
+ "id": "roads_tunnels_highway_casing",
1573
+ "type": "line",
1574
+ "source": "__protomaps_source",
1575
+ "source-layer": "roads",
1576
+ "filter": [
1577
+ "all",
1578
+ ["!has", "is_tunnel"],
1579
+ ["!has", "is_bridge"],
1580
+ ["==", "kind", "highway"],
1581
+ ["!has", "is_link"]
1582
+ ],
1583
+ "paint": {
1584
+ "line-color": "#e0e0e0",
1585
+ "line-dasharray": [6, 0.5],
1586
+ "line-gap-width": [
1587
+ "interpolate",
1588
+ ["exponential", 1.6],
1589
+ ["zoom"],
1590
+ 3,
1591
+ 0,
1592
+ 3.5,
1593
+ 0.5,
1594
+ 18,
1595
+ 15
1596
+ ],
1597
+ "line-width": [
1598
+ "interpolate",
1599
+ ["exponential", 1.6],
1600
+ ["zoom"],
1601
+ 7,
1602
+ 0,
1603
+ 7.5,
1604
+ 1,
1605
+ 20,
1606
+ 15
1607
+ ]
1608
+ }
1609
+ },
1610
+ {
1611
+ "id": "roads_tunnels_other",
1612
+ "type": "line",
1613
+ "source": "__protomaps_source",
1614
+ "source-layer": "roads",
1615
+ "filter": ["all", ["has", "is_tunnel"], ["in", "kind", "other", "path"]],
1616
+ "paint": {
1617
+ "line-color": "#d5d5d5",
1618
+ "line-dasharray": [4.5, 0.5],
1619
+ "line-width": [
1620
+ "interpolate",
1621
+ ["exponential", 1.6],
1622
+ ["zoom"],
1623
+ 14,
1624
+ 0,
1625
+ 20,
1626
+ 7
1627
+ ]
1628
+ }
1629
+ },
1630
+ {
1631
+ "id": "roads_tunnels_minor",
1632
+ "type": "line",
1633
+ "source": "__protomaps_source",
1634
+ "source-layer": "roads",
1635
+ "filter": ["all", ["has", "is_tunnel"], ["==", "kind", "minor_road"]],
1636
+ "paint": {
1637
+ "line-color": "#d5d5d5",
1638
+ "line-width": [
1639
+ "interpolate",
1640
+ ["exponential", 1.6],
1641
+ ["zoom"],
1642
+ 11,
1643
+ 0,
1644
+ 12.5,
1645
+ 0.5,
1646
+ 15,
1647
+ 2,
1648
+ 18,
1649
+ 11
1650
+ ]
1651
+ }
1652
+ },
1653
+ {
1654
+ "id": "roads_tunnels_link",
1655
+ "type": "line",
1656
+ "source": "__protomaps_source",
1657
+ "source-layer": "roads",
1658
+ "filter": ["all", ["has", "is_tunnel"], ["has", "is_link"]],
1659
+ "paint": {
1660
+ "line-color": "#d5d5d5",
1661
+ "line-width": [
1662
+ "interpolate",
1663
+ ["exponential", 1.6],
1664
+ ["zoom"],
1665
+ 13,
1666
+ 0,
1667
+ 13.5,
1668
+ 1,
1669
+ 18,
1670
+ 11
1671
+ ]
1672
+ }
1673
+ },
1674
+ {
1675
+ "id": "roads_tunnels_major",
1676
+ "type": "line",
1677
+ "source": "__protomaps_source",
1678
+ "source-layer": "roads",
1679
+ "filter": ["all", ["has", "is_tunnel"], ["==", "kind", "major_road"]],
1680
+ "paint": {
1681
+ "line-color": "#d5d5d5",
1682
+ "line-width": [
1683
+ "interpolate",
1684
+ ["exponential", 1.6],
1685
+ ["zoom"],
1686
+ 6,
1687
+ 0,
1688
+ 12,
1689
+ 1.6,
1690
+ 15,
1691
+ 3,
1692
+ 18,
1693
+ 13
1694
+ ]
1695
+ }
1696
+ },
1697
+ {
1698
+ "id": "roads_tunnels_highway",
1699
+ "type": "line",
1700
+ "source": "__protomaps_source",
1701
+ "source-layer": "roads",
1702
+ "filter": [
1703
+ "all",
1704
+ ["has", "is_tunnel"],
1705
+ ["==", ["get", "kind"], "highway"],
1706
+ ["!", ["has", "is_link"]]
1707
+ ],
1708
+ "paint": {
1709
+ "line-color": "#d5d5d5",
1710
+ "line-width": [
1711
+ "interpolate",
1712
+ ["exponential", 1.6],
1713
+ ["zoom"],
1714
+ 3,
1715
+ 0,
1716
+ 6,
1717
+ 1.1,
1718
+ 12,
1719
+ 1.6,
1720
+ 15,
1721
+ 5,
1722
+ 18,
1723
+ 15
1724
+ ]
1725
+ }
1726
+ },
1727
+ {
1728
+ "id": "buildings",
1729
+ "type": "fill",
1730
+ "source": "__protomaps_source",
1731
+ "source-layer": "buildings",
1732
+ "filter": ["in", "kind", "building", "building_part"],
1733
+ "paint": {"fill-opacity": 0.3, "fill-color": "#c2beba"}
1734
+ },
1735
+ {
1736
+ "id": "roads_pier",
1737
+ "type": "line",
1738
+ "source": "__protomaps_source",
1739
+ "source-layer": "roads",
1740
+ "filter": ["==", "kind_detail", "pier"],
1741
+ "paint": {
1742
+ "line-color": "#e0e0e0",
1743
+ "line-width": [
1744
+ "interpolate",
1745
+ ["exponential", 1.6],
1746
+ ["zoom"],
1747
+ 12,
1748
+ 0,
1749
+ 12.5,
1750
+ 0.5,
1751
+ 20,
1752
+ 16
1753
+ ]
1754
+ }
1755
+ },
1756
+ {
1757
+ "id": "roads_minor_service_casing",
1758
+ "type": "line",
1759
+ "source": "__protomaps_source",
1760
+ "source-layer": "roads",
1761
+ "minzoom": 13,
1762
+ "filter": [
1763
+ "all",
1764
+ ["!has", "is_tunnel"],
1765
+ ["!has", "is_bridge"],
1766
+ ["==", "kind", "minor_road"],
1767
+ ["==", "kind_detail", "service"]
1768
+ ],
1769
+ "layout": {"visibility": "visible"},
1770
+ "paint": {
1771
+ "line-color": "#e0e0e0",
1772
+ "line-gap-width": [
1773
+ "interpolate",
1774
+ ["exponential", 1.6],
1775
+ ["zoom"],
1776
+ 13,
1777
+ 0,
1778
+ 18,
1779
+ 8
1780
+ ],
1781
+ "line-width": [
1782
+ "interpolate",
1783
+ ["exponential", 1.6],
1784
+ ["zoom"],
1785
+ 13,
1786
+ 0,
1787
+ 13.5,
1788
+ 0.8
1789
+ ]
1790
+ }
1791
+ },
1792
+ {
1793
+ "id": "roads_minor_casing",
1794
+ "type": "line",
1795
+ "source": "__protomaps_source",
1796
+ "source-layer": "roads",
1797
+ "filter": [
1798
+ "all",
1799
+ ["!has", "is_tunnel"],
1800
+ ["!has", "is_bridge"],
1801
+ ["==", "kind", "minor_road"],
1802
+ ["!=", "kind_detail", "service"]
1803
+ ],
1804
+ "layout": {"visibility": "visible"},
1805
+ "paint": {
1806
+ "line-gap-width": [
1807
+ "interpolate",
1808
+ ["exponential", 1.6],
1809
+ ["zoom"],
1810
+ 11,
1811
+ 0,
1812
+ 12.5,
1813
+ 0.5,
1814
+ 15,
1815
+ 2,
1816
+ 18,
1817
+ 11
1818
+ ],
1819
+ "line-width": [
1820
+ "interpolate",
1821
+ ["exponential", 1.6],
1822
+ ["zoom"],
1823
+ 12,
1824
+ 0,
1825
+ 12.5,
1826
+ 1,
1827
+ 17,
1828
+ 1.25
1829
+ ],
1830
+ "line-color": "#D1CFC7"
1831
+ }
1832
+ },
1833
+ {
1834
+ "id": "roads_link_casing",
1835
+ "type": "line",
1836
+ "source": "__protomaps_source",
1837
+ "source-layer": "roads",
1838
+ "minzoom": 13,
1839
+ "filter": ["has", "is_link"],
1840
+ "paint": {
1841
+ "line-gap-width": [
1842
+ "interpolate",
1843
+ ["exponential", 1.6],
1844
+ ["zoom"],
1845
+ 13,
1846
+ 0,
1847
+ 13.5,
1848
+ 1,
1849
+ 18,
1850
+ 11
1851
+ ],
1852
+ "line-width": [
1853
+ "interpolate",
1854
+ ["exponential", 1.6],
1855
+ ["zoom"],
1856
+ 13,
1857
+ 0,
1858
+ 13.5,
1859
+ 1.5
1860
+ ],
1861
+ "line-color": "#D1CFC7"
1862
+ }
1863
+ },
1864
+ {
1865
+ "id": "roads_major_casing_late",
1866
+ "type": "line",
1867
+ "source": "__protomaps_source",
1868
+ "source-layer": "roads",
1869
+ "minzoom": 12,
1870
+ "filter": [
1871
+ "all",
1872
+ ["!has", "is_tunnel"],
1873
+ ["!has", "is_bridge"],
1874
+ ["==", "kind", "major_road"]
1875
+ ],
1876
+ "layout": {"visibility": "visible"},
1877
+ "paint": {
1878
+ "line-gap-width": [
1879
+ "interpolate",
1880
+ ["exponential", 1.6],
1881
+ ["zoom"],
1882
+ 6,
1883
+ 0,
1884
+ 12,
1885
+ 1.6,
1886
+ 15,
1887
+ 3,
1888
+ 18,
1889
+ 13
1890
+ ],
1891
+ "line-width": [
1892
+ "interpolate",
1893
+ ["exponential", 1.6],
1894
+ ["zoom"],
1895
+ 9,
1896
+ 0,
1897
+ 9.5,
1898
+ 1,
1899
+ 15,
1900
+ 1.5
1901
+ ],
1902
+ "line-color": "#D1CFC7"
1903
+ }
1904
+ },
1905
+ {
1906
+ "id": "roads_highway_casing_late",
1907
+ "type": "line",
1908
+ "source": "__protomaps_source",
1909
+ "source-layer": "roads",
1910
+ "minzoom": 12,
1911
+ "filter": [
1912
+ "all",
1913
+ ["!has", "is_tunnel"],
1914
+ ["!has", "is_bridge"],
1915
+ ["==", "kind", "highway"],
1916
+ ["!has", "is_link"]
1917
+ ],
1918
+ "layout": {"visibility": "visible"},
1919
+ "paint": {
1920
+ "line-color": "#e0e0e0",
1921
+ "line-gap-width": [
1922
+ "interpolate",
1923
+ ["exponential", 1.6],
1924
+ ["zoom"],
1925
+ 3,
1926
+ 0,
1927
+ 3.5,
1928
+ 0.5,
1929
+ 18,
1930
+ 15
1931
+ ],
1932
+ "line-width": [
1933
+ "interpolate",
1934
+ ["exponential", 1.6],
1935
+ ["zoom"],
1936
+ 7,
1937
+ 0,
1938
+ 7.5,
1939
+ 1,
1940
+ 20,
1941
+ 15
1942
+ ]
1943
+ }
1944
+ },
1945
+ {
1946
+ "id": "roads_other-bg",
1947
+ "type": "line",
1948
+ "source": "__protomaps_source",
1949
+ "source-layer": "roads",
1950
+ "minzoom": 13,
1951
+ "filter": [
1952
+ "all",
1953
+ ["!has", "is_tunnel"],
1954
+ ["!has", "is_bridge"],
1955
+ ["in", "kind", "other", "path"],
1956
+ ["!=", "kind_detail", "pier"]
1957
+ ],
1958
+ "layout": {"visibility": "visible"},
1959
+ "paint": {
1960
+ "line-width": [
1961
+ "interpolate",
1962
+ ["exponential", 1.6],
1963
+ ["zoom"],
1964
+ 14,
1965
+ 0.75,
1966
+ 20,
1967
+ 6
1968
+ ],
1969
+ "line-color": "rgba(0, 0, 0, 0.15)"
1970
+ }
1971
+ },
1972
+ {
1973
+ "id": "roads_other",
1974
+ "type": "line",
1975
+ "source": "__protomaps_source",
1976
+ "source-layer": "roads",
1977
+ "minzoom": 13,
1978
+ "filter": [
1979
+ "all",
1980
+ ["!has", "is_tunnel"],
1981
+ ["!has", "is_bridge"],
1982
+ ["in", "kind", "other", "path"],
1983
+ ["!=", "kind_detail", "pier"]
1984
+ ],
1985
+ "layout": {"visibility": "visible"},
1986
+ "paint": {
1987
+ "line-dasharray": [2, 2],
1988
+ "line-width": [
1989
+ "interpolate",
1990
+ ["exponential", 1.6],
1991
+ ["zoom"],
1992
+ 14,
1993
+ 1.5,
1994
+ 20,
1995
+ 9
1996
+ ],
1997
+ "line-color": "rgba(249, 247, 241, 1)"
1998
+ }
1999
+ },
2000
+ {
2001
+ "id": "roads_link",
2002
+ "type": "line",
2003
+ "source": "__protomaps_source",
2004
+ "source-layer": "roads",
2005
+ "filter": ["has", "is_link"],
2006
+ "paint": {
2007
+ "line-width": [
2008
+ "interpolate",
2009
+ ["exponential", 1.6],
2010
+ ["zoom"],
2011
+ 13,
2012
+ 0,
2013
+ 13.5,
2014
+ 1,
2015
+ 18,
2016
+ 11
2017
+ ],
2018
+ "line-color": "#E7E5DE"
2019
+ }
2020
+ },
2021
+ {
2022
+ "id": "roads_minor_service",
2023
+ "type": "line",
2024
+ "source": "__protomaps_source",
2025
+ "source-layer": "roads",
2026
+ "filter": [
2027
+ "all",
2028
+ ["!has", "is_tunnel"],
2029
+ ["!has", "is_bridge"],
2030
+ ["==", "kind", "minor_road"],
2031
+ ["==", "kind_detail", "service"]
2032
+ ],
2033
+ "paint": {
2034
+ "line-width": [
2035
+ "interpolate",
2036
+ ["exponential", 1.6],
2037
+ ["zoom"],
2038
+ 13,
2039
+ 0,
2040
+ 18,
2041
+ 8
2042
+ ],
2043
+ "line-color": "#E7E5DE"
2044
+ }
2045
+ },
2046
+ {
2047
+ "id": "roads_minor",
2048
+ "type": "line",
2049
+ "source": "__protomaps_source",
2050
+ "source-layer": "roads",
2051
+ "filter": [
2052
+ "all",
2053
+ ["!has", "is_tunnel"],
2054
+ ["!has", "is_bridge"],
2055
+ ["==", "kind", "minor_road"],
2056
+ ["!=", "kind_detail", "service"]
2057
+ ],
2058
+ "layout": {"visibility": "visible"},
2059
+ "paint": {
2060
+ "line-width": [
2061
+ "interpolate",
2062
+ ["exponential", 1.6],
2063
+ ["zoom"],
2064
+ 11,
2065
+ 0,
2066
+ 12.5,
2067
+ 0.5,
2068
+ 15,
2069
+ 2,
2070
+ 18,
2071
+ 11
2072
+ ],
2073
+ "line-color": "#E7E5DE"
2074
+ }
2075
+ },
2076
+ {
2077
+ "id": "roads_major_casing_early",
2078
+ "type": "line",
2079
+ "source": "__protomaps_source",
2080
+ "source-layer": "roads",
2081
+ "maxzoom": 12,
2082
+ "filter": [
2083
+ "all",
2084
+ ["!has", "is_tunnel"],
2085
+ ["!has", "is_bridge"],
2086
+ ["==", "kind", "major_road"]
2087
+ ],
2088
+ "layout": {"visibility": "visible"},
2089
+ "paint": {
2090
+ "line-color": "rgba(194, 194, 194, 1)",
2091
+ "line-gap-width": [
2092
+ "interpolate",
2093
+ ["exponential", 1.6],
2094
+ ["zoom"],
2095
+ 7,
2096
+ 0,
2097
+ 7.5,
2098
+ 0.5,
2099
+ 18,
2100
+ 13
2101
+ ],
2102
+ "line-width": [
2103
+ "interpolate",
2104
+ ["exponential", 1.6],
2105
+ ["zoom"],
2106
+ 9,
2107
+ 0,
2108
+ 9.5,
2109
+ 1
2110
+ ]
2111
+ }
2112
+ },
2113
+ {
2114
+ "id": "roads_major",
2115
+ "type": "line",
2116
+ "source": "__protomaps_source",
2117
+ "source-layer": "roads",
2118
+ "filter": [
2119
+ "all",
2120
+ ["!has", "is_tunnel"],
2121
+ ["!has", "is_bridge"],
2122
+ ["==", "kind", "major_road"]
2123
+ ],
2124
+ "layout": {"visibility": "visible"},
2125
+ "paint": {
2126
+ "line-width": [
2127
+ "interpolate",
2128
+ ["exponential", 1.6],
2129
+ ["zoom"],
2130
+ 6,
2131
+ 0,
2132
+ 12,
2133
+ 1.6,
2134
+ 15,
2135
+ 3,
2136
+ 18,
2137
+ 13
2138
+ ],
2139
+ "line-color": "#E7E5DE"
2140
+ }
2141
+ },
2142
+ {
2143
+ "id": "roads_highway_casing_early",
2144
+ "type": "line",
2145
+ "source": "__protomaps_source",
2146
+ "source-layer": "roads",
2147
+ "maxzoom": 12,
2148
+ "filter": [
2149
+ "all",
2150
+ ["!has", "is_tunnel"],
2151
+ ["!has", "is_bridge"],
2152
+ ["==", "kind", "highway"],
2153
+ ["!has", "is_link"]
2154
+ ],
2155
+ "layout": {"visibility": "visible"},
2156
+ "paint": {
2157
+ "line-color": "rgba(214, 213, 213, 1)",
2158
+ "line-gap-width": [
2159
+ "interpolate",
2160
+ ["exponential", 1.6],
2161
+ ["zoom"],
2162
+ 3,
2163
+ 0,
2164
+ 3.5,
2165
+ 0.5,
2166
+ 18,
2167
+ 15
2168
+ ],
2169
+ "line-width": [
2170
+ "interpolate",
2171
+ ["exponential", 1.6],
2172
+ ["zoom"],
2173
+ 3,
2174
+ 0,
2175
+ 6,
2176
+ 1.8,
2177
+ 12,
2178
+ 2.2,
2179
+ 15,
2180
+ 5,
2181
+ 18,
2182
+ 15
2183
+ ]
2184
+ }
2185
+ },
2186
+ {
2187
+ "id": "roads_highway",
2188
+ "type": "line",
2189
+ "source": "__protomaps_source",
2190
+ "source-layer": "roads",
2191
+ "filter": [
2192
+ "all",
2193
+ ["!has", "is_tunnel"],
2194
+ ["!has", "is_bridge"],
2195
+ ["==", "kind", "highway"],
2196
+ ["!has", "is_link"]
2197
+ ],
2198
+ "layout": {"visibility": "visible"},
2199
+ "paint": {
2200
+ "line-width": [
2201
+ "interpolate",
2202
+ ["exponential", 1.6],
2203
+ ["zoom"],
2204
+ 3,
2205
+ 0,
2206
+ 6,
2207
+ 1.1,
2208
+ 12,
2209
+ 1.6,
2210
+ 15,
2211
+ 5,
2212
+ 18,
2213
+ 15
2214
+ ],
2215
+ "line-color": "#E7E5DE"
2216
+ }
2217
+ },
2218
+ {
2219
+ "id": "roads_rail",
2220
+ "type": "line",
2221
+ "source": "__protomaps_source",
2222
+ "source-layer": "roads",
2223
+ "filter": ["==", "kind", "rail"],
2224
+ "layout": {"visibility": "visible"},
2225
+ "paint": {
2226
+ "line-dasharray": [0.3, 0.75],
2227
+ "line-opacity": 0.5,
2228
+ "line-color": "rgba(97, 116, 129, 1)",
2229
+ "line-width": [
2230
+ "interpolate",
2231
+ ["exponential", 1.6],
2232
+ ["zoom"],
2233
+ 3,
2234
+ 0,
2235
+ 6,
2236
+ 0.15,
2237
+ 18,
2238
+ 6
2239
+ ]
2240
+ }
2241
+ },
2242
+ {
2243
+ "id": "boundaries_country_casing",
2244
+ "type": "line",
2245
+ "source": "__protomaps_source",
2246
+ "source-layer": "boundaries",
2247
+ "minzoom": 3,
2248
+ "filter": ["<=", "kind_detail", 2],
2249
+ "layout": {"visibility": "visible"},
2250
+ "paint": {
2251
+ "line-color": "rgba(0, 0, 0, 1)",
2252
+ "line-opacity": 0.1,
2253
+ "line-width": [
2254
+ "interpolate",
2255
+ ["exponential", 1.6],
2256
+ ["zoom"],
2257
+ 0,
2258
+ 2,
2259
+ 8,
2260
+ 7,
2261
+ 15,
2262
+ 20
2263
+ ]
2264
+ }
2265
+ },
2266
+ {
2267
+ "id": "boundaries_country",
2268
+ "type": "line",
2269
+ "source": "__protomaps_source",
2270
+ "source-layer": "boundaries",
2271
+ "filter": ["<=", "kind_detail", 2],
2272
+ "layout": {"visibility": "visible"},
2273
+ "paint": {
2274
+ "line-color": "rgba(0, 0, 0, 1)",
2275
+ "line-dasharray": [
2276
+ "step",
2277
+ ["zoom"],
2278
+ ["literal", [2]],
2279
+ 4,
2280
+ ["literal", [2, 1]]
2281
+ ],
2282
+ "line-opacity": 0.3,
2283
+ "line-width": [
2284
+ "interpolate",
2285
+ ["exponential", 1.6],
2286
+ ["zoom"],
2287
+ 0,
2288
+ 1,
2289
+ 8,
2290
+ 1.5,
2291
+ 15,
2292
+ 3
2293
+ ]
2294
+ }
2295
+ },
2296
+ {
2297
+ "id": "boundaries",
2298
+ "type": "line",
2299
+ "source": "__protomaps_source",
2300
+ "source-layer": "boundaries",
2301
+ "filter": [">", "kind_detail", 2],
2302
+ "layout": {"visibility": "visible"},
2303
+ "paint": {
2304
+ "line-color": "#adadad",
2305
+ "line-width": 0.4,
2306
+ "line-dasharray": [
2307
+ "step",
2308
+ ["zoom"],
2309
+ ["literal", [2]],
2310
+ 4,
2311
+ ["literal", [2, 1]]
2312
+ ]
2313
+ }
2314
+ },
2315
+ {
2316
+ "id": "roads_bridges_other_casing",
2317
+ "type": "line",
2318
+ "source": "__protomaps_source",
2319
+ "source-layer": "roads",
2320
+ "minzoom": 12,
2321
+ "filter": ["all", ["has", "is_bridge"], ["in", "kind", "other", "path"]],
2322
+ "paint": {
2323
+ "line-color": "#e0e0e0",
2324
+ "line-gap-width": [
2325
+ "interpolate",
2326
+ ["exponential", 1.6],
2327
+ ["zoom"],
2328
+ 14,
2329
+ 0,
2330
+ 20,
2331
+ 7
2332
+ ]
2333
+ }
2334
+ },
2335
+ {
2336
+ "id": "roads_bridges_link_casing",
2337
+ "type": "line",
2338
+ "source": "__protomaps_source",
2339
+ "source-layer": "roads",
2340
+ "minzoom": 12,
2341
+ "filter": ["all", ["has", "is_bridge"], ["has", "is_link"]],
2342
+ "paint": {
2343
+ "line-color": "#e0e0e0",
2344
+ "line-gap-width": [
2345
+ "interpolate",
2346
+ ["exponential", 1.6],
2347
+ ["zoom"],
2348
+ 13,
2349
+ 0,
2350
+ 13.5,
2351
+ 1,
2352
+ 18,
2353
+ 11
2354
+ ],
2355
+ "line-width": [
2356
+ "interpolate",
2357
+ ["exponential", 1.6],
2358
+ ["zoom"],
2359
+ 12,
2360
+ 0,
2361
+ 12.5,
2362
+ 1.5
2363
+ ]
2364
+ }
2365
+ },
2366
+ {
2367
+ "id": "roads_bridges_minor_casing",
2368
+ "type": "line",
2369
+ "source": "__protomaps_source",
2370
+ "source-layer": "roads",
2371
+ "minzoom": 12,
2372
+ "filter": ["all", ["has", "is_bridge"], ["==", "kind", "minor_road"]],
2373
+ "paint": {
2374
+ "line-color": "#e0e0e0",
2375
+ "line-gap-width": [
2376
+ "interpolate",
2377
+ ["exponential", 1.6],
2378
+ ["zoom"],
2379
+ 11,
2380
+ 0,
2381
+ 12.5,
2382
+ 0.5,
2383
+ 15,
2384
+ 2,
2385
+ 18,
2386
+ 11
2387
+ ],
2388
+ "line-width": [
2389
+ "interpolate",
2390
+ ["exponential", 1.6],
2391
+ ["zoom"],
2392
+ 13,
2393
+ 0,
2394
+ 13.5,
2395
+ 0.8
2396
+ ]
2397
+ }
2398
+ },
2399
+ {
2400
+ "id": "roads_bridges_major_casing",
2401
+ "type": "line",
2402
+ "source": "__protomaps_source",
2403
+ "source-layer": "roads",
2404
+ "minzoom": 12,
2405
+ "filter": ["all", ["has", "is_bridge"], ["==", "kind", "major_road"]],
2406
+ "paint": {
2407
+ "line-color": "#e0e0e0",
2408
+ "line-gap-width": [
2409
+ "interpolate",
2410
+ ["exponential", 1.6],
2411
+ ["zoom"],
2412
+ 7,
2413
+ 0,
2414
+ 7.5,
2415
+ 0.5,
2416
+ 18,
2417
+ 10
2418
+ ],
2419
+ "line-width": [
2420
+ "interpolate",
2421
+ ["exponential", 1.6],
2422
+ ["zoom"],
2423
+ 9,
2424
+ 0,
2425
+ 9.5,
2426
+ 1.5
2427
+ ]
2428
+ }
2429
+ },
2430
+ {
2431
+ "id": "roads_bridges_other",
2432
+ "type": "line",
2433
+ "source": "__protomaps_source",
2434
+ "source-layer": "roads",
2435
+ "minzoom": 12,
2436
+ "filter": ["all", ["has", "is_bridge"], ["in", "kind", "other", "path"]],
2437
+ "layout": {"visibility": "visible"},
2438
+ "paint": {
2439
+ "line-color": "#ebebeb",
2440
+ "line-dasharray": [2, 1],
2441
+ "line-width": [
2442
+ "interpolate",
2443
+ ["exponential", 1.6],
2444
+ ["zoom"],
2445
+ 14,
2446
+ 0,
2447
+ 20,
2448
+ 7
2449
+ ]
2450
+ }
2451
+ },
2452
+ {
2453
+ "id": "roads_bridges_minor",
2454
+ "type": "line",
2455
+ "source": "__protomaps_source",
2456
+ "source-layer": "roads",
2457
+ "minzoom": 12,
2458
+ "filter": ["all", ["has", "is_bridge"], ["==", "kind", "minor_road"]],
2459
+ "paint": {
2460
+ "line-color": "#ffffff",
2461
+ "line-width": [
2462
+ "interpolate",
2463
+ ["exponential", 1.6],
2464
+ ["zoom"],
2465
+ 11,
2466
+ 0,
2467
+ 12.5,
2468
+ 0.5,
2469
+ 15,
2470
+ 2,
2471
+ 18,
2472
+ 11
2473
+ ]
2474
+ }
2475
+ },
2476
+ {
2477
+ "id": "roads_bridges_link",
2478
+ "type": "line",
2479
+ "source": "__protomaps_source",
2480
+ "source-layer": "roads",
2481
+ "minzoom": 12,
2482
+ "filter": ["all", ["has", "is_bridge"], ["has", "is_link"]],
2483
+ "paint": {
2484
+ "line-color": "#ffffff",
2485
+ "line-width": [
2486
+ "interpolate",
2487
+ ["exponential", 1.6],
2488
+ ["zoom"],
2489
+ 13,
2490
+ 0,
2491
+ 13.5,
2492
+ 1,
2493
+ 18,
2494
+ 11
2495
+ ]
2496
+ }
2497
+ },
2498
+ {
2499
+ "id": "roads_bridges_major",
2500
+ "type": "line",
2501
+ "source": "__protomaps_source",
2502
+ "source-layer": "roads",
2503
+ "minzoom": 12,
2504
+ "filter": ["all", ["has", "is_bridge"], ["==", "kind", "major_road"]],
2505
+ "paint": {
2506
+ "line-color": "#f5f5f5",
2507
+ "line-width": [
2508
+ "interpolate",
2509
+ ["exponential", 1.6],
2510
+ ["zoom"],
2511
+ 6,
2512
+ 0,
2513
+ 12,
2514
+ 1.6,
2515
+ 15,
2516
+ 3,
2517
+ 18,
2518
+ 13
2519
+ ]
2520
+ }
2521
+ },
2522
+ {
2523
+ "id": "cycleway_bg",
2524
+ "type": "line",
2525
+ "source": "__protomaps_source",
2526
+ "source-layer": "roads",
2527
+ "filter": ["any", ["==", "kind_detail", "cycleway"]],
2528
+ "layout": {"visibility": "visible"},
2529
+ "paint": {
2530
+ "line-width": [
2531
+ "interpolate",
2532
+ ["exponential", 1.6],
2533
+ ["zoom"],
2534
+ 12.5,
2535
+ 0.9,
2536
+ 15,
2537
+ 1.9,
2538
+ 18,
2539
+ 3.9
2540
+ ],
2541
+ "line-dasharray": [2],
2542
+ "line-color": "#ffffff"
2543
+ }
2544
+ },
2545
+ {
2546
+ "id": "cycleway",
2547
+ "type": "line",
2548
+ "source": "__protomaps_source",
2549
+ "source-layer": "roads",
2550
+ "filter": ["any", ["==", "kind_detail", "cycleway"]],
2551
+ "layout": {"visibility": "visible"},
2552
+ "paint": {
2553
+ "line-width": [
2554
+ "interpolate",
2555
+ ["exponential", 1.6],
2556
+ ["zoom"],
2557
+ 12.5,
2558
+ 1,
2559
+ 15,
2560
+ 2,
2561
+ 18,
2562
+ 4
2563
+ ],
2564
+ "line-color": "rgba(20, 116, 0, 1)",
2565
+ "line-dasharray": [2, 1.5]
2566
+ }
2567
+ },
2568
+ {
2569
+ "id": "roads_bridges_highway_casing",
2570
+ "type": "line",
2571
+ "source": "__protomaps_source",
2572
+ "source-layer": "roads",
2573
+ "minzoom": 12,
2574
+ "filter": [
2575
+ "all",
2576
+ ["has", "is_bridge"],
2577
+ ["==", "kind", "highway"],
2578
+ ["!has", "is_link"]
2579
+ ],
2580
+ "paint": {
2581
+ "line-color": "#e0e0e0",
2582
+ "line-gap-width": [
2583
+ "interpolate",
2584
+ ["exponential", 1.6],
2585
+ ["zoom"],
2586
+ 3,
2587
+ 0,
2588
+ 3.5,
2589
+ 0.5,
2590
+ 18,
2591
+ 15
2592
+ ],
2593
+ "line-width": [
2594
+ "interpolate",
2595
+ ["exponential", 1.6],
2596
+ ["zoom"],
2597
+ 7,
2598
+ 0,
2599
+ 7.5,
2600
+ 1,
2601
+ 20,
2602
+ 15
2603
+ ]
2604
+ }
2605
+ },
2606
+ {
2607
+ "id": "roads_bridges_highway",
2608
+ "type": "line",
2609
+ "source": "__protomaps_source",
2610
+ "source-layer": "roads",
2611
+ "filter": [
2612
+ "all",
2613
+ ["has", "is_bridge"],
2614
+ ["==", "kind", "highway"],
2615
+ ["!has", "is_link"]
2616
+ ],
2617
+ "paint": {
2618
+ "line-color": "#ffffff",
2619
+ "line-width": [
2620
+ "interpolate",
2621
+ ["exponential", 1.6],
2622
+ ["zoom"],
2623
+ 3,
2624
+ 0,
2625
+ 6,
2626
+ 1.1,
2627
+ 12,
2628
+ 1.6,
2629
+ 15,
2630
+ 5,
2631
+ 18,
2632
+ 15
2633
+ ]
2634
+ }
2635
+ },
2636
+ {
2637
+ "id": "address_label",
2638
+ "type": "symbol",
2639
+ "source": "__protomaps_source",
2640
+ "source-layer": "buildings",
2641
+ "minzoom": 18,
2642
+ "filter": ["==", "kind", "address"],
2643
+ "layout": {
2644
+ "symbol-placement": "point",
2645
+ "text-font": ["Noto Sans Italic"],
2646
+ "text-field": ["get", "addr_housenumber"],
2647
+ "text-size": 12
2648
+ },
2649
+ "paint": {
2650
+ "text-color": "#91888b",
2651
+ "text-halo-color": "#ffffff",
2652
+ "text-halo-width": 1
2653
+ }
2654
+ },
2655
+ {
2656
+ "id": "water_waterway_label",
2657
+ "type": "symbol",
2658
+ "source": "__protomaps_source",
2659
+ "source-layer": "water",
2660
+ "minzoom": 13,
2661
+ "filter": ["in", "kind", "river", "stream"],
2662
+ "layout": {
2663
+ "symbol-placement": "line",
2664
+ "text-font": ["Noto Sans Italic"],
2665
+ "text-field": "<LANG>",
2666
+ "text-size": 12,
2667
+ "text-letter-spacing": 0.2
2668
+ },
2669
+ "paint": {"text-color": "rgba(13, 117, 143, 0.64)", "text-halo-width": 1}
2670
+ },
2671
+ {
2672
+ "id": "roads_labels_minor",
2673
+ "type": "symbol",
2674
+ "source": "__protomaps_source",
2675
+ "source-layer": "roads",
2676
+ "minzoom": 15,
2677
+ "filter": ["in", "kind", "minor_road", "other", "path"],
2678
+ "layout": {
2679
+ "symbol-sort-key": ["get", "min_zoom"],
2680
+ "symbol-placement": "line",
2681
+ "text-font": ["Noto Sans Regular"],
2682
+ "text-field": "<LANG>",
2683
+ "text-size": 12,
2684
+ "visibility": "visible"
2685
+ },
2686
+ "paint": {
2687
+ "text-color": "rgba(94, 88, 90, 1)",
2688
+ "text-halo-color": "#ffffff",
2689
+ "text-halo-width": 1
2690
+ }
2691
+ },
2692
+ {
2693
+ "id": "water_label_ocean",
2694
+ "type": "symbol",
2695
+ "source": "__protomaps_source",
2696
+ "source-layer": "water",
2697
+ "filter": ["in", "kind", "sea", "ocean", "bay", "strait", "fjord"],
2698
+ "layout": {
2699
+ "text-font": ["Noto Sans Italic"],
2700
+ "text-field": "<LANG>",
2701
+ "text-size": ["interpolate", ["linear"], ["zoom"], 1, 12, 10, 12],
2702
+ "text-letter-spacing": 0.1,
2703
+ "text-max-width": 9,
2704
+ "text-transform": "uppercase"
2705
+ },
2706
+ "paint": {
2707
+ "text-color": "rgba(4, 69, 98, 0.64)",
2708
+ "text-halo-width": 1,
2709
+ "text-halo-color": "rgba(0, 0, 0, 0)"
2710
+ }
2711
+ },
2712
+ {
2713
+ "id": "earth_label_islands",
2714
+ "type": "symbol",
2715
+ "source": "__protomaps_source",
2716
+ "source-layer": "earth",
2717
+ "filter": ["in", "kind", "island"],
2718
+ "layout": {
2719
+ "text-font": ["Noto Sans Italic"],
2720
+ "text-field": "<LANG>",
2721
+ "text-size": 10,
2722
+ "text-letter-spacing": 0.1,
2723
+ "text-max-width": 8
2724
+ },
2725
+ "paint": {
2726
+ "text-color": "#8f8f8f",
2727
+ "text-halo-color": "#e0e0e0",
2728
+ "text-halo-width": 1
2729
+ }
2730
+ },
2731
+ {
2732
+ "id": "water_label_lakes",
2733
+ "type": "symbol",
2734
+ "source": "__protomaps_source",
2735
+ "source-layer": "water",
2736
+ "filter": ["in", "kind", "lake", "water"],
2737
+ "layout": {
2738
+ "text-font": ["Noto Sans Italic"],
2739
+ "text-field": "<LANG>",
2740
+ "text-size": [
2741
+ "interpolate",
2742
+ ["linear"],
2743
+ ["zoom"],
2744
+ 3,
2745
+ 10,
2746
+ 6,
2747
+ 12,
2748
+ 10,
2749
+ 12
2750
+ ],
2751
+ "text-letter-spacing": 0.1,
2752
+ "text-max-width": 9
2753
+ },
2754
+ "paint": {"text-color": "rgba(13, 117, 143, 0.64)", "text-halo-width": 1}
2755
+ },
2756
+ {
2757
+ "id": "roads_labels_major",
2758
+ "type": "symbol",
2759
+ "source": "__protomaps_source",
2760
+ "source-layer": "roads",
2761
+ "minzoom": 11,
2762
+ "filter": ["in", "kind", "highway", "major_road"],
2763
+ "layout": {
2764
+ "symbol-sort-key": ["get", "min_zoom"],
2765
+ "symbol-placement": "line",
2766
+ "text-font": ["Noto Sans Regular"],
2767
+ "text-field": "<LANG>",
2768
+ "text-size": 12,
2769
+ "visibility": "visible"
2770
+ },
2771
+ "paint": {
2772
+ "text-color": "rgba(110, 104, 106, 1)",
2773
+ "text-halo-color": "#ffffff",
2774
+ "text-halo-width": 1
2775
+ }
2776
+ },
2777
+ {
2778
+ "id": "pois",
2779
+ "type": "symbol",
2780
+ "source": "__protomaps_source",
2781
+ "source-layer": "pois",
2782
+ "filter": [
2783
+ "all",
2784
+ [
2785
+ "in",
2786
+ ["get", "kind"],
2787
+ [
2788
+ "literal",
2789
+ [
2790
+ "beach",
2791
+ "forest",
2792
+ "marina",
2793
+ "park",
2794
+ "peak",
2795
+ "zoo",
2796
+ "garden",
2797
+ "aerodrome",
2798
+ "station",
2799
+ "ferry_terminal",
2800
+ "stadium",
2801
+ "university",
2802
+ "library",
2803
+ "school",
2804
+ "animal",
2805
+ "toilet",
2806
+ "drinking_water",
2807
+ "viewpoint",
2808
+ "attraction",
2809
+ "camp_site",
2810
+ "college",
2811
+ "fishing",
2812
+ "golf_course",
2813
+ "hospital",
2814
+ "information",
2815
+ "landmark",
2816
+ "military",
2817
+ "national_park",
2818
+ "nature_reserve",
2819
+ "picnic_site",
2820
+ "picnic_table",
2821
+ "playground",
2822
+ "railway",
2823
+ "townhall",
2824
+ "zoo"
2825
+ ]
2826
+ ]
2827
+ ],
2828
+ [">=", ["zoom"], ["+", ["get", "min_zoom"], -2]]
2829
+ ],
2830
+ "layout": {
2831
+ "icon-image": [
2832
+ "match",
2833
+ ["get", "kind"],
2834
+ "park",
2835
+ "garden",
2836
+ ["get", "kind"]
2837
+ ],
2838
+ "text-font": ["Noto Sans Regular"],
2839
+ "text-justify": "auto",
2840
+ "text-field": "<LANG>",
2841
+ "text-size": ["interpolate", ["linear"], ["zoom"], 17, 11, 19, 14],
2842
+ "text-max-width": 8,
2843
+ "text-offset": [1.5, 0],
2844
+ "text-variable-anchor": ["left", "right"],
2845
+ "visibility": "visible"
2846
+ },
2847
+ "paint": {
2848
+ "text-color": [
2849
+ "case",
2850
+ [
2851
+ "in",
2852
+ ["get", "kind"],
2853
+ [
2854
+ "literal",
2855
+ [
2856
+ "forest",
2857
+ "park",
2858
+ "peak",
2859
+ "zoo",
2860
+ "garden",
2861
+ "bench",
2862
+ "golf_course",
2863
+ "national_park",
2864
+ "nature_reserve",
2865
+ "picnic_site",
2866
+ "picnic_table",
2867
+ "camp_site"
2868
+ ]
2869
+ ]
2870
+ ],
2871
+ "#076331",
2872
+ [
2873
+ "in",
2874
+ ["get", "kind"],
2875
+ ["literal", ["beach", "marina", "ferry_terminal", "fishing"]]
2876
+ ],
2877
+ "#634c00",
2878
+ ["in", ["get", "kind"], ["literal", ["hospital"]]],
2879
+ "#730303",
2880
+ "#1f5fa3"
2881
+ ],
2882
+ "text-halo-color": "rgba(253, 252, 252, 1)",
2883
+ "text-halo-width": 1.5
2884
+ }
2885
+ },
2886
+ {
2887
+ "id": "places_subplace",
2888
+ "type": "symbol",
2889
+ "source": "__protomaps_source",
2890
+ "source-layer": "places",
2891
+ "filter": ["==", "kind", "neighbourhood"],
2892
+ "layout": {
2893
+ "symbol-sort-key": [
2894
+ "case",
2895
+ ["has", "sort_key"],
2896
+ ["get", "sort_key"],
2897
+ ["get", "min_zoom"]
2898
+ ],
2899
+ "text-field": "<LANG>",
2900
+ "text-font": ["Noto Sans Regular"],
2901
+ "text-max-width": 7,
2902
+ "text-letter-spacing": 0.1,
2903
+ "text-padding": [
2904
+ "interpolate",
2905
+ ["linear"],
2906
+ ["zoom"],
2907
+ 5,
2908
+ 2,
2909
+ 8,
2910
+ 4,
2911
+ 12,
2912
+ 18,
2913
+ 15,
2914
+ 20
2915
+ ],
2916
+ "text-size": [
2917
+ "interpolate",
2918
+ ["exponential", 1.2],
2919
+ ["zoom"],
2920
+ 11,
2921
+ 8,
2922
+ 14,
2923
+ 14,
2924
+ 18,
2925
+ 24
2926
+ ],
2927
+ "text-transform": "uppercase"
2928
+ },
2929
+ "paint": {
2930
+ "text-color": "rgba(88, 72, 69, 1)",
2931
+ "text-halo-color": "rgba(248, 241, 241, 1)",
2932
+ "text-halo-width": 1
2933
+ }
2934
+ },
2935
+ {
2936
+ "id": "places_region",
2937
+ "type": "symbol",
2938
+ "source": "__protomaps_source",
2939
+ "source-layer": "places",
2940
+ "filter": ["==", "kind", "region"],
2941
+ "layout": {
2942
+ "symbol-sort-key": ["get", "sort_key"],
2943
+ "text-field": "<LANG>",
2944
+ "text-font": ["Noto Sans Regular"],
2945
+ "text-size": ["interpolate", ["linear"], ["zoom"], 3, 11, 7, 16],
2946
+ "text-radial-offset": 0.2,
2947
+ "text-anchor": "center",
2948
+ "text-transform": "uppercase"
2949
+ },
2950
+ "paint": {
2951
+ "text-color": "rgba(127, 123, 120, 1)",
2952
+ "text-halo-color": "rgba(246, 240, 240, 1)",
2953
+ "text-halo-width": 1
2954
+ }
2955
+ },
2956
+ {
2957
+ "id": "places_locality",
2958
+ "type": "symbol",
2959
+ "source": "__protomaps_source",
2960
+ "source-layer": "places",
2961
+ "filter": ["==", "kind", "locality"],
2962
+ "layout": {
2963
+ "icon-image": ["step", ["zoom"], "townspot", 8, ""],
2964
+ "icon-size": 0.7,
2965
+ "text-field": "<LANG>",
2966
+ "text-font": [
2967
+ "case",
2968
+ ["<=", ["get", "min_zoom"], 5],
2969
+ ["literal", ["Noto Sans Medium"]],
2970
+ ["literal", ["Noto Sans Regular"]]
2971
+ ],
2972
+ "symbol-sort-key": [
2973
+ "case",
2974
+ ["has", "sort_key"],
2975
+ ["get", "sort_key"],
2976
+ ["get", "min_zoom"]
2977
+ ],
2978
+ "text-padding": [
2979
+ "interpolate",
2980
+ ["linear"],
2981
+ ["zoom"],
2982
+ 5,
2983
+ 3,
2984
+ 8,
2985
+ 7,
2986
+ 12,
2987
+ 11
2988
+ ],
2989
+ "text-size": [
2990
+ "interpolate",
2991
+ ["linear"],
2992
+ ["zoom"],
2993
+ 2,
2994
+ [
2995
+ "case",
2996
+ ["<", ["get", "population_rank"], 13],
2997
+ 8,
2998
+ [">=", ["get", "population_rank"], 13],
2999
+ 13,
3000
+ 0
3001
+ ],
3002
+ 4,
3003
+ [
3004
+ "case",
3005
+ ["<", ["get", "population_rank"], 13],
3006
+ 12,
3007
+ [">=", ["get", "population_rank"], 13],
3008
+ 17,
3009
+ 0
3010
+ ],
3011
+ 6,
3012
+ [
3013
+ "case",
3014
+ ["<", ["get", "population_rank"], 12],
3015
+ 13,
3016
+ [">=", ["get", "population_rank"], 12],
3017
+ 18,
3018
+ 0
3019
+ ],
3020
+ 8,
3021
+ [
3022
+ "case",
3023
+ ["<", ["get", "population_rank"], 11],
3024
+ 11,
3025
+ [">=", ["get", "population_rank"], 11],
3026
+ 18,
3027
+ 0
3028
+ ],
3029
+ 10,
3030
+ [
3031
+ "case",
3032
+ ["<", ["get", "population_rank"], 9],
3033
+ 12,
3034
+ [">=", ["get", "population_rank"], 9],
3035
+ 20,
3036
+ 0
3037
+ ],
3038
+ 15,
3039
+ [
3040
+ "case",
3041
+ ["<", ["get", "population_rank"], 8],
3042
+ 12,
3043
+ [">=", ["get", "population_rank"], 8],
3044
+ 22,
3045
+ 0
3046
+ ]
3047
+ ],
3048
+ "icon-padding": [
3049
+ "interpolate",
3050
+ ["linear"],
3051
+ ["zoom"],
3052
+ 0,
3053
+ 0,
3054
+ 8,
3055
+ 6,
3056
+ 10,
3057
+ 8,
3058
+ 12,
3059
+ 6,
3060
+ 22,
3061
+ 2
3062
+ ],
3063
+ "text-justify": "auto",
3064
+ "text-variable-anchor": [
3065
+ "step",
3066
+ ["zoom"],
3067
+ ["literal", ["bottom", "left", "right", "top"]],
3068
+ 8,
3069
+ ["literal", ["center"]]
3070
+ ],
3071
+ "text-radial-offset": 0.3,
3072
+ "visibility": "visible"
3073
+ },
3074
+ "paint": {
3075
+ "text-color": "rgba(94, 68, 51, 1)",
3076
+ "text-halo-color": "rgba(253, 250, 249, 1)",
3077
+ "text-halo-width": 1
3078
+ }
3079
+ },
3080
+ {
3081
+ "id": "places_country",
3082
+ "type": "symbol",
3083
+ "source": "__protomaps_source",
3084
+ "source-layer": "places",
3085
+ "filter": ["==", "kind", "country"],
3086
+ "layout": {
3087
+ "symbol-sort-key": [
3088
+ "case",
3089
+ ["has", "sort_key"],
3090
+ ["get", "sort_key"],
3091
+ ["get", "min_zoom"]
3092
+ ],
3093
+ "text-field": "<LANG_COUNTRY>",
3094
+ "text-font": ["Noto Sans Medium"],
3095
+ "text-size": [
3096
+ "interpolate",
3097
+ ["linear"],
3098
+ ["zoom"],
3099
+ 2,
3100
+ [
3101
+ "case",
3102
+ ["<", ["get", "population_rank"], 10],
3103
+ 12,
3104
+ [">=", ["get", "population_rank"], 10],
3105
+ 15,
3106
+ 0
3107
+ ],
3108
+ 6,
3109
+ [
3110
+ "case",
3111
+ ["<", ["get", "population_rank"], 9],
3112
+ 11,
3113
+ [">=", ["get", "population_rank"], 8],
3114
+ 18,
3115
+ 0
3116
+ ],
3117
+ 8,
3118
+ [
3119
+ "case",
3120
+ ["<", ["get", "population_rank"], 7],
3121
+ 12,
3122
+ [">=", ["get", "population_rank"], 7],
3123
+ 20,
3124
+ 0
3125
+ ]
3126
+ ],
3127
+ "icon-padding": [
3128
+ "interpolate",
3129
+ ["linear"],
3130
+ ["zoom"],
3131
+ 0,
3132
+ 2,
3133
+ 14,
3134
+ 2,
3135
+ 16,
3136
+ 20,
3137
+ 17,
3138
+ 2,
3139
+ 22,
3140
+ 2
3141
+ ],
3142
+ "text-transform": "none"
3143
+ },
3144
+ "paint": {
3145
+ "text-color": "rgba(84, 79, 73, 1)",
3146
+ "text-halo-color": "rgba(255, 255, 255, 1)",
3147
+ "text-halo-width": 1.5
3148
+ }
3149
+ },
3150
+ {
3151
+ "id": "building_extrusion",
3152
+ "type": "fill-extrusion",
3153
+ "source": "__protomaps_source",
3154
+ "source-layer": "buildings",
3155
+ "filter": [
3156
+ "any",
3157
+ ["==", "kind", "building_part"],
3158
+ ["==", "kind", "building"]
3159
+ ],
3160
+ "layout": {"visibility": "none"},
3161
+ "paint": {
3162
+ "fill-extrusion-opacity": 0.1,
3163
+ "fill-extrusion-height": {"type": "identity", "property": "height"}
3164
+ }
3165
+ }
3166
+ ]`;
3167
+ function Y(n, e) {
3168
+ const t = G.filter((o) => o.lang === n);
3169
+ if (t.length === 0)
3170
+ throw new Error(
3171
+ `The language "${n}". The languages available are: ${G.map((o) => o.lang).join(", ")}.`
3172
+ );
3173
+ if (e) {
3174
+ if (t.filter((i) => i.script === e).length)
3175
+ return !0;
3176
+ throw new Error(
3177
+ `The script "${e}" for the language "${n}" is unsupported. Script available for this language: ${t.map((i) => i.script).join(", ")}.`
3178
+ );
3179
+ }
3180
+ return !0;
3181
+ }
3182
+ function yn() {
3183
+ const n = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];
3184
+ return Y(n, void 0) ? n : "en";
3185
+ }
3186
+ const O = {
3187
+ versatile: fn
3188
+ }, $ = {
3189
+ "versatile-night": {
3190
+ baseStyle: "versatile",
3191
+ colorEdit: {
3192
+ brightness: -0.3,
3193
+ saturation: -0.8,
3194
+ multiplyColor: ["#171075", 0.6],
3195
+ contrast: [1.6, 160]
3196
+ }
3197
+ },
3198
+ "versatile-bright": {
3199
+ baseStyle: "versatile",
3200
+ colorEdit: {
3201
+ exposure: 0.6,
3202
+ saturation: -0.1,
3203
+ hueRotation: 15,
3204
+ contrast: [0.2, 220]
3205
+ }
3206
+ },
3207
+ "versatile-bnw": {
3208
+ baseStyle: "versatile",
3209
+ colorEdit: {
3210
+ exposure: -1,
3211
+ saturation: -1,
3212
+ contrast: [1.2, 160]
3213
+ }
3214
+ },
3215
+ "versatile-blueprint": {
3216
+ baseStyle: "versatile",
3217
+ colorEdit: {
3218
+ exposure: -0.7,
3219
+ saturation: -1,
3220
+ contrast: [1.2, 160],
3221
+ mixColor: ["#3355bb", 0.15]
3222
+ }
3223
+ },
3224
+ "versatile-warm": {
3225
+ baseStyle: "versatile",
3226
+ colorEdit: {
3227
+ exposure: -0.7,
3228
+ contrast: [-0.1, 110],
3229
+ mixColor: ["#ff8800", 0.1]
3230
+ }
3231
+ },
3232
+ "versatile-vintage": {
3233
+ baseStyle: "versatile",
3234
+ colorEdit: {
3235
+ exposure: -0.25,
3236
+ multiplyColor: ["#ff8800", 0.4],
3237
+ hueRotation: -5
3238
+ }
3239
+ },
3240
+ "versatile-saturated": {
3241
+ baseStyle: "versatile",
3242
+ colorEdit: {
3243
+ exposure: -1,
3244
+ saturation: 0.1
3245
+ }
3246
+ }
3247
+ };
3248
+ function kn() {
3249
+ return Object.keys(O).concat(Object.keys($));
3250
+ }
3251
+ function xn(n, e) {
3252
+ if (n in O)
3253
+ return U({
3254
+ ...e,
3255
+ baseStyleName: n
3256
+ });
3257
+ if (n in $) {
3258
+ const t = $[n];
3259
+ return U({
3260
+ ...e,
3261
+ baseStyleName: t.baseStyle,
3262
+ colorEdit: t.colorEdit
3263
+ });
3264
+ }
3265
+ throw new Error(`The style "${n}" does not exist as a base style, nor as a preset.`);
3266
+ }
3267
+ function U(n) {
3268
+ let e, t;
3269
+ const o = n.hideLabels ?? !1;
3270
+ if (o)
3271
+ e = '""', t = '""';
3272
+ else if (typeof n.lang == "string" && Y(n.lang, n.script))
3273
+ e = JSON.stringify(q(n.lang, n.script)), t = JSON.stringify(P(n.lang, n.script));
3274
+ else {
3275
+ const g = yn();
3276
+ e = JSON.stringify(q(g)), t = JSON.stringify(P(g));
3277
+ }
3278
+ if (!(n.baseStyleName in O))
3279
+ throw new Error(`The base style ${n.baseStyleName} does not exist.`);
3280
+ const l = O[n.baseStyleName].replaceAll('"<LANG>"', t).replaceAll('"<LANG_COUNTRY>"', e);
3281
+ let r;
3282
+ if (typeof n.tilejson == "string")
3283
+ r = n.tilejson;
3284
+ else if (typeof n.pmtiles == "string")
3285
+ r = `pmtiles://${n.pmtiles}`;
3286
+ else
3287
+ throw new Error('At least one option of "tilejson" or "pmtiles" must be provided as data source.');
3288
+ let a = JSON.parse(l);
3289
+ const s = n.hidePOIs ?? !1;
3290
+ if (s && (a = a.filter((g) => g.id !== "pois")), o) {
3291
+ const g = a.filter((p) => p.id === "pois");
3292
+ if (g.length) {
3293
+ const p = g[0];
3294
+ if (p.layout !== void 0) {
3295
+ const v = p.layout;
3296
+ v["text-field"] !== void 0 && (v["text-field"] = "");
3297
+ }
3298
+ }
3299
+ a = a.filter((p) => p.id === "pois" || p.type !== "symbol" ? !0 : !(p.layout !== void 0 && p.layout["text-field"] !== void 0));
3300
+ }
3301
+ const u = n.colorEdit ?? {}, _ = u.brightness ?? 0, m = u.hueRotation ?? 0, F = u.saturation ?? 0, D = u.negate ?? !1, E = u.brightnessShift ?? 0, j = u.exposure ?? 0;
3302
+ return (_ !== 0 || m !== 0 || F !== 0 || D === !0 || u.multiplyColor !== void 0 || u.mixColor !== void 0 || E !== 0 || u.contrast !== void 0 || j !== 0) && T(a, (g) => {
3303
+ let p = h(g);
3304
+ if (D && (p = p.negate()), m !== 0 && (p = p.rotate(m)), F !== 0 && (p = p.saturate(F)), _ > 0 ? p = p.lighten(_) : _ < 0 && (p = p.darken(_ * -1)), E !== 0) {
3305
+ const M = p.hsl().array();
3306
+ M[2] += E * 100, p = h.hsl(...M);
3307
+ }
3308
+ Array.isArray(u.mixColor) && typeof u.mixColor[0] == "string" && typeof u.mixColor[1] == "number" && u.mixColor[1] !== 0 && (p = p.mix(h(u.mixColor[0]), u.mixColor[1]));
3309
+ const v = p.rgb(), H = v.alpha();
3310
+ let x = [v.red(), v.green(), v.blue()];
3311
+ if (j !== 0 && (x = un(x, j)), Array.isArray(u.contrast) && typeof u.contrast[0] == "number" && typeof u.contrast[1] == "number" && u.contrast[0] !== 0 && (x = dn(x, u.contrast[0], u.contrast[1])), Array.isArray(u.multiplyColor) && typeof u.multiplyColor[0] == "string" && typeof u.multiplyColor[1] == "number" && u.multiplyColor[1] !== 0) {
3312
+ const M = h(u.multiplyColor[0]);
3313
+ x = _n(
3314
+ x,
3315
+ [M.red(), M.green(), M.blue()],
3316
+ u.multiplyColor[1]
3317
+ );
3318
+ }
3319
+ const L = h({ r: x[0], g: x[1], b: x[2], alpha: H });
3320
+ return g.startsWith("rgba(") || g.startsWith("rgb(") ? L.rgb().toString() : g.startsWith("hsl(") || g.startsWith("hsla(") ? L.hsl().toString() : L.hexa();
3321
+ }), {
3322
+ version: 8,
3323
+ ...n.sprite && !s ? { sprite: n.sprite } : {},
3324
+ glyphs: n.glyphs,
3325
+ sources: {
3326
+ __protomaps_source: {
3327
+ type: "vector",
3328
+ url: r,
3329
+ attribution: "<a href='https://openstreetmap.org/copyright'>© OpenStreetMap Contributors</a>"
3330
+ }
3331
+ },
3332
+ layers: a
3333
+ };
3334
+ }
3335
+ export {
3336
+ U as buildStyle,
3337
+ xn as getStyle,
3338
+ kn as getStyleList
3339
+ };
3340
+ //# sourceMappingURL=basemapkit.js.map