@maptiler/geocoding-control 1.4.2-dev.3 → 2.0.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.
Files changed (52) hide show
  1. package/MapLibreBasedGeocodingControl.d.ts +70 -35
  2. package/leaflet-controller.d.ts +1 -1
  3. package/leaflet-controller.js +407 -398
  4. package/leaflet-controller.js.map +1 -1
  5. package/leaflet-controller.umd.js +3 -3
  6. package/leaflet-controller.umd.js.map +1 -1
  7. package/leaflet.d.ts +52 -16
  8. package/leaflet.js +654 -638
  9. package/leaflet.js.map +1 -1
  10. package/leaflet.umd.js +3 -3
  11. package/leaflet.umd.js.map +1 -1
  12. package/maplibregl-controller.d.ts +7 -7
  13. package/maplibregl-controller.js +421 -413
  14. package/maplibregl-controller.js.map +1 -1
  15. package/maplibregl-controller.umd.js +3 -3
  16. package/maplibregl-controller.umd.js.map +1 -1
  17. package/maplibregl.d.ts +29 -5
  18. package/maplibregl.js +1352 -1346
  19. package/maplibregl.js.map +1 -1
  20. package/maplibregl.umd.js +3 -3
  21. package/maplibregl.umd.js.map +1 -1
  22. package/maptilersdk.d.ts +29 -5
  23. package/maptilersdk.js +1315 -1303
  24. package/maptilersdk.js.map +1 -1
  25. package/maptilersdk.umd.js +3 -3
  26. package/maptilersdk.umd.js.map +1 -1
  27. package/openlayers.js +1 -1
  28. package/openlayers.js.map +1 -1
  29. package/openlayers.umd.js +1 -1
  30. package/openlayers.umd.js.map +1 -1
  31. package/package.json +5 -5
  32. package/react.js +1 -1
  33. package/react.js.map +1 -1
  34. package/react.umd.js +1 -1
  35. package/react.umd.js.map +1 -1
  36. package/svelte/GeocodingControl.svelte +1 -1
  37. package/svelte/MapLibreBasedGeocodingControl.d.ts +70 -35
  38. package/svelte/MapLibreBasedGeocodingControl.js +69 -66
  39. package/svelte/leaflet-controller.d.ts +1 -1
  40. package/svelte/leaflet-controller.js +47 -24
  41. package/svelte/leaflet.d.ts +52 -16
  42. package/svelte/leaflet.js +14 -2
  43. package/svelte/maplibregl-controller.d.ts +7 -7
  44. package/svelte/maplibregl-controller.js +55 -34
  45. package/svelte/maplibregl.d.ts +29 -5
  46. package/svelte/maplibregl.js +3 -8
  47. package/svelte/maptilersdk.d.ts +29 -5
  48. package/svelte/maptilersdk.js +15 -18
  49. package/vanilla.js +1 -1
  50. package/vanilla.js.map +1 -1
  51. package/vanilla.umd.js +1 -1
  52. package/vanilla.umd.js.map +1 -1
@@ -1,7 +1,7 @@
1
- var Jt = Object.defineProperty;
2
- var Kt = (i, t, e) => t in i ? Jt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var it = (i, t, e) => Kt(i, typeof t != "symbol" ? t + "" : t, e);
4
- function V(i, t, e = {}) {
1
+ var Kt = Object.defineProperty;
2
+ var Ht = (i, t, e) => t in i ? Kt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var it = (i, t, e) => Ht(i, typeof t != "symbol" ? t + "" : t, e);
4
+ function X(i, t, e = {}) {
5
5
  const n = { type: "Feature" };
6
6
  return (e.id === 0 || e.id) && (n.id = e.id), e.bbox && (n.bbox = e.bbox), n.properties = t || {}, n.geometry = i, n;
7
7
  }
@@ -17,17 +17,17 @@ function pt(i, t, e = {}) {
17
17
  if (r[r.length - 1][o] !== r[0][o])
18
18
  throw new Error("First and last Position are not equivalent.");
19
19
  }
20
- return V({
20
+ return X({
21
21
  type: "Polygon",
22
22
  coordinates: i
23
23
  }, t, e);
24
24
  }
25
- function Z(i, t = {}) {
25
+ function V(i, t = {}) {
26
26
  const e = { type: "FeatureCollection" };
27
27
  return t.id && (e.id = t.id), t.bbox && (e.bbox = t.bbox), e.features = i, e;
28
28
  }
29
- function Ft(i, t, e = {}) {
30
- return V({
29
+ function jt(i, t, e = {}) {
30
+ return X({
31
31
  type: "MultiPolygon",
32
32
  coordinates: i
33
33
  }, t, e);
@@ -54,67 +54,67 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
54
54
  See the Apache Version 2.0 License for specific language governing permissions
55
55
  and limitations under the License.
56
56
  ***************************************************************************** */
57
- function Ht(i, t) {
57
+ function te(i, t) {
58
58
  var e = { label: 0, sent: function() {
59
59
  if (o[0] & 1) throw o[1];
60
60
  return o[1];
61
- }, trys: [], ops: [] }, n, r, o, u;
62
- return u = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
61
+ }, trys: [], ops: [] }, n, r, o, f;
62
+ return f = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
63
63
  return this;
64
- }), u;
65
- function s(f) {
64
+ }), f;
65
+ function s(u) {
66
66
  return function(g) {
67
- return c([f, g]);
67
+ return c([u, g]);
68
68
  };
69
69
  }
70
- function c(f) {
70
+ function c(u) {
71
71
  if (n) throw new TypeError("Generator is already executing.");
72
72
  for (; e; ) try {
73
- if (n = 1, r && (o = f[0] & 2 ? r.return : f[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, f[1])).done) return o;
74
- switch (r = 0, o && (f = [f[0] & 2, o.value]), f[0]) {
73
+ if (n = 1, r && (o = u[0] & 2 ? r.return : u[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, u[1])).done) return o;
74
+ switch (r = 0, o && (u = [u[0] & 2, o.value]), u[0]) {
75
75
  case 0:
76
76
  case 1:
77
- o = f;
77
+ o = u;
78
78
  break;
79
79
  case 4:
80
- return e.label++, { value: f[1], done: !1 };
80
+ return e.label++, { value: u[1], done: !1 };
81
81
  case 5:
82
- e.label++, r = f[1], f = [0];
82
+ e.label++, r = u[1], u = [0];
83
83
  continue;
84
84
  case 7:
85
- f = e.ops.pop(), e.trys.pop();
85
+ u = e.ops.pop(), e.trys.pop();
86
86
  continue;
87
87
  default:
88
- if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (f[0] === 6 || f[0] === 2)) {
88
+ if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) {
89
89
  e = 0;
90
90
  continue;
91
91
  }
92
- if (f[0] === 3 && (!o || f[1] > o[0] && f[1] < o[3])) {
93
- e.label = f[1];
92
+ if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) {
93
+ e.label = u[1];
94
94
  break;
95
95
  }
96
- if (f[0] === 6 && e.label < o[1]) {
97
- e.label = o[1], o = f;
96
+ if (u[0] === 6 && e.label < o[1]) {
97
+ e.label = o[1], o = u;
98
98
  break;
99
99
  }
100
100
  if (o && e.label < o[2]) {
101
- e.label = o[2], e.ops.push(f);
101
+ e.label = o[2], e.ops.push(u);
102
102
  break;
103
103
  }
104
104
  o[2] && e.ops.pop(), e.trys.pop();
105
105
  continue;
106
106
  }
107
- f = t.call(i, e);
107
+ u = t.call(i, e);
108
108
  } catch (g) {
109
- f = [6, g], r = 0;
109
+ u = [6, g], r = 0;
110
110
  } finally {
111
111
  n = o = 0;
112
112
  }
113
- if (f[0] & 5) throw f[1];
114
- return { value: f[0] ? f[1] : void 0, done: !0 };
113
+ if (u[0] & 5) throw u[1];
114
+ return { value: u[0] ? u[1] : void 0, done: !0 };
115
115
  }
116
116
  }
117
- var F = (
117
+ var G = (
118
118
  /** @class */
119
119
  /* @__PURE__ */ function() {
120
120
  function i(t, e) {
@@ -123,13 +123,13 @@ var F = (
123
123
  return i;
124
124
  }()
125
125
  );
126
- function te(i, t) {
126
+ function ee(i, t) {
127
127
  return i > t ? 1 : i < t ? -1 : 0;
128
128
  }
129
129
  function B(i, t, e) {
130
- for (var n = new F(null, null), r = n, o = n; ; ) {
131
- var u = e(i, t.key);
132
- if (u < 0) {
130
+ for (var n = new G(null, null), r = n, o = n; ; ) {
131
+ var f = e(i, t.key);
132
+ if (f < 0) {
133
133
  if (t.left === null)
134
134
  break;
135
135
  if (e(i, t.left.key) < 0) {
@@ -138,7 +138,7 @@ function B(i, t, e) {
138
138
  break;
139
139
  }
140
140
  o.left = t, o = t, t = t.left;
141
- } else if (u > 0) {
141
+ } else if (f > 0) {
142
142
  if (t.right === null)
143
143
  break;
144
144
  if (e(i, t.right.key) > 0) {
@@ -153,7 +153,7 @@ function B(i, t, e) {
153
153
  return r.right = t.left, o.left = t.right, t.left = n.right, t.right = n.left, t;
154
154
  }
155
155
  function rt(i, t, e, n) {
156
- var r = new F(i, t);
156
+ var r = new G(i, t);
157
157
  if (e === null)
158
158
  return r.left = r.right = null, r;
159
159
  e = B(i, e, n);
@@ -169,7 +169,7 @@ function vt(i, t, e) {
169
169
  }
170
170
  return { left: n, right: r };
171
171
  }
172
- function ee(i, t, e) {
172
+ function ne(i, t, e) {
173
173
  return t === null ? i : (i === null || (t = B(i.key, t, e), t.left = i), t);
174
174
  }
175
175
  function lt(i, t, e, n, r) {
@@ -184,15 +184,15 @@ var yt = (
184
184
  /** @class */
185
185
  function() {
186
186
  function i(t) {
187
- t === void 0 && (t = te), this._root = null, this._size = 0, this._comparator = t;
187
+ t === void 0 && (t = ee), this._root = null, this._size = 0, this._comparator = t;
188
188
  }
189
189
  return i.prototype.insert = function(t, e) {
190
190
  return this._size++, this._root = rt(t, e, this._root, this._comparator);
191
191
  }, i.prototype.add = function(t, e) {
192
- var n = new F(t, e);
192
+ var n = new G(t, e);
193
193
  this._root === null && (n.left = n.right = null, this._size++, this._root = n);
194
- var r = this._comparator, o = B(t, this._root, r), u = r(t, o.key);
195
- return u === 0 ? this._root = o : (u < 0 ? (n.left = o.left, n.right = o, o.left = null) : u > 0 && (n.right = o.right, n.left = o, o.right = null), this._size++, this._root = n), this._root;
194
+ var r = this._comparator, o = B(t, this._root, r), f = r(t, o.key);
195
+ return f === 0 ? this._root = o : (f < 0 ? (n.left = o.left, n.right = o, o.left = null) : f > 0 && (n.right = o.right, n.left = o, o.right = null), this._size++, this._root = n), this._root;
196
196
  }, i.prototype.remove = function(t) {
197
197
  this._root = this._remove(t, this._root, this._comparator);
198
198
  }, i.prototype._remove = function(t, e, n) {
@@ -233,13 +233,13 @@ var yt = (
233
233
  n !== null ? (r.push(n), n = n.left) : r.length !== 0 ? (n = r.pop(), t.call(e, n), n = n.right) : o = !0;
234
234
  return this;
235
235
  }, i.prototype.range = function(t, e, n, r) {
236
- for (var o = [], u = this._comparator, s = this._root, c; o.length !== 0 || s; )
236
+ for (var o = [], f = this._comparator, s = this._root, c; o.length !== 0 || s; )
237
237
  if (s)
238
238
  o.push(s), s = s.left;
239
239
  else {
240
- if (s = o.pop(), c = u(s.key, e), c > 0)
240
+ if (s = o.pop(), c = f(s.key, e), c > 0)
241
241
  break;
242
- if (u(s.key, t) >= 0 && n.call(r, s))
242
+ if (f(s.key, t) >= 0 && n.call(r, s))
243
243
  return this;
244
244
  s = s.right;
245
245
  }
@@ -312,15 +312,15 @@ var yt = (
312
312
  }, i.prototype.clear = function() {
313
313
  return this._root = null, this._size = 0, this;
314
314
  }, i.prototype.toList = function() {
315
- return ie(this._root);
315
+ return re(this._root);
316
316
  }, i.prototype.load = function(t, e, n) {
317
317
  e === void 0 && (e = []), n === void 0 && (n = !1);
318
318
  var r = t.length, o = this._comparator;
319
319
  if (n && ct(t, e, 0, r - 1, o), this._root === null)
320
320
  this._root = ut(t, e, 0, r), this._size = r;
321
321
  else {
322
- var u = re(this.toList(), ne(t, e), o);
323
- r = this._size + r, this._root = ft({ head: u }, 0, r);
322
+ var f = oe(this.toList(), ie(t, e), o);
323
+ r = this._size + r, this._root = ft({ head: f }, 0, r);
324
324
  }
325
325
  return this;
326
326
  }, i.prototype.isEmpty = function() {
@@ -346,13 +346,13 @@ var yt = (
346
346
  return e.push(n);
347
347
  }, t), e.join("");
348
348
  }, i.prototype.update = function(t, e, n) {
349
- var r = this._comparator, o = vt(t, this._root, r), u = o.left, s = o.right;
350
- r(t, e) < 0 ? s = rt(e, n, s, r) : u = rt(e, n, u, r), this._root = ee(u, s, r);
349
+ var r = this._comparator, o = vt(t, this._root, r), f = o.left, s = o.right;
350
+ r(t, e) < 0 ? s = rt(e, n, s, r) : f = rt(e, n, f, r), this._root = ne(f, s, r);
351
351
  }, i.prototype.split = function(t) {
352
352
  return vt(t, this._root, this._comparator);
353
353
  }, i.prototype[Symbol.iterator] = function() {
354
354
  var t, e, n;
355
- return Ht(this, function(r) {
355
+ return te(this, function(r) {
356
356
  switch (r.label) {
357
357
  case 0:
358
358
  t = this._root, e = [], n = !1, r.label = 1;
@@ -379,66 +379,66 @@ var yt = (
379
379
  function ut(i, t, e, n) {
380
380
  var r = n - e;
381
381
  if (r > 0) {
382
- var o = e + Math.floor(r / 2), u = i[o], s = t[o], c = new F(u, s);
382
+ var o = e + Math.floor(r / 2), f = i[o], s = t[o], c = new G(f, s);
383
383
  return c.left = ut(i, t, e, o), c.right = ut(i, t, o + 1, n), c;
384
384
  }
385
385
  return null;
386
386
  }
387
- function ne(i, t) {
388
- for (var e = new F(null, null), n = e, r = 0; r < i.length; r++)
389
- n = n.next = new F(i[r], t[r]);
387
+ function ie(i, t) {
388
+ for (var e = new G(null, null), n = e, r = 0; r < i.length; r++)
389
+ n = n.next = new G(i[r], t[r]);
390
390
  return n.next = null, e.next;
391
391
  }
392
- function ie(i) {
393
- for (var t = i, e = [], n = !1, r = new F(null, null), o = r; !n; )
392
+ function re(i) {
393
+ for (var t = i, e = [], n = !1, r = new G(null, null), o = r; !n; )
394
394
  t ? (e.push(t), t = t.left) : e.length > 0 ? (t = o = o.next = e.pop(), t = t.right) : n = !0;
395
395
  return o.next = null, r.next;
396
396
  }
397
397
  function ft(i, t, e) {
398
398
  var n = e - t;
399
399
  if (n > 0) {
400
- var r = t + Math.floor(n / 2), o = ft(i, t, r), u = i.head;
401
- return u.left = o, i.head = i.head.next, u.right = ft(i, r + 1, e), u;
400
+ var r = t + Math.floor(n / 2), o = ft(i, t, r), f = i.head;
401
+ return f.left = o, i.head = i.head.next, f.right = ft(i, r + 1, e), f;
402
402
  }
403
403
  return null;
404
404
  }
405
- function re(i, t, e) {
406
- for (var n = new F(null, null), r = n, o = i, u = t; o !== null && u !== null; )
407
- e(o.key, u.key) < 0 ? (r.next = o, o = o.next) : (r.next = u, u = u.next), r = r.next;
408
- return o !== null ? r.next = o : u !== null && (r.next = u), n.next;
405
+ function oe(i, t, e) {
406
+ for (var n = new G(null, null), r = n, o = i, f = t; o !== null && f !== null; )
407
+ e(o.key, f.key) < 0 ? (r.next = o, o = o.next) : (r.next = f, f = f.next), r = r.next;
408
+ return o !== null ? r.next = o : f !== null && (r.next = f), n.next;
409
409
  }
410
410
  function ct(i, t, e, n, r) {
411
411
  if (!(e >= n)) {
412
- for (var o = i[e + n >> 1], u = e - 1, s = n + 1; ; ) {
412
+ for (var o = i[e + n >> 1], f = e - 1, s = n + 1; ; ) {
413
413
  do
414
- u++;
415
- while (r(i[u], o) < 0);
414
+ f++;
415
+ while (r(i[f], o) < 0);
416
416
  do
417
417
  s--;
418
418
  while (r(i[s], o) > 0);
419
- if (u >= s)
419
+ if (f >= s)
420
420
  break;
421
- var c = i[u];
422
- i[u] = i[s], i[s] = c, c = t[u], t[u] = t[s], t[s] = c;
421
+ var c = i[f];
422
+ i[f] = i[s], i[s] = c, c = t[f], t[f] = t[s], t[s] = c;
423
423
  }
424
424
  ct(i, t, e, s, r), ct(i, t, s + 1, n, r);
425
425
  }
426
426
  }
427
- const O = 11102230246251565e-32, S = 134217729, oe = (3 + 8 * O) * O;
427
+ const O = 11102230246251565e-32, S = 134217729, se = (3 + 8 * O) * O;
428
428
  function ot(i, t, e, n, r) {
429
- let o, u, s, c, f = t[0], g = n[0], l = 0, h = 0;
430
- g > f == g > -f ? (o = f, f = t[++l]) : (o = g, g = n[++h]);
429
+ let o, f, s, c, u = t[0], g = n[0], l = 0, h = 0;
430
+ g > u == g > -u ? (o = u, u = t[++l]) : (o = g, g = n[++h]);
431
431
  let a = 0;
432
432
  if (l < i && h < e)
433
- for (g > f == g > -f ? (u = f + o, s = o - (u - f), f = t[++l]) : (u = g + o, s = o - (u - g), g = n[++h]), o = u, s !== 0 && (r[a++] = s); l < i && h < e; )
434
- g > f == g > -f ? (u = o + f, c = u - o, s = o - (u - c) + (f - c), f = t[++l]) : (u = o + g, c = u - o, s = o - (u - c) + (g - c), g = n[++h]), o = u, s !== 0 && (r[a++] = s);
433
+ for (g > u == g > -u ? (f = u + o, s = o - (f - u), u = t[++l]) : (f = g + o, s = o - (f - g), g = n[++h]), o = f, s !== 0 && (r[a++] = s); l < i && h < e; )
434
+ g > u == g > -u ? (f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l]) : (f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h]), o = f, s !== 0 && (r[a++] = s);
435
435
  for (; l < i; )
436
- u = o + f, c = u - o, s = o - (u - c) + (f - c), f = t[++l], o = u, s !== 0 && (r[a++] = s);
436
+ f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l], o = f, s !== 0 && (r[a++] = s);
437
437
  for (; h < e; )
438
- u = o + g, c = u - o, s = o - (u - c) + (g - c), g = n[++h], o = u, s !== 0 && (r[a++] = s);
438
+ f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h], o = f, s !== 0 && (r[a++] = s);
439
439
  return (o !== 0 || a === 0) && (r[a++] = o), a;
440
440
  }
441
- function se(i, t) {
441
+ function le(i, t) {
442
442
  let e = t[0];
443
443
  for (let n = 1; n < i; n++) e += t[n];
444
444
  return e;
@@ -446,26 +446,26 @@ function se(i, t) {
446
446
  function J(i) {
447
447
  return new Float64Array(i);
448
448
  }
449
- const le = (3 + 16 * O) * O, ue = (2 + 12 * O) * O, fe = (9 + 64 * O) * O * O, j = J(4), wt = J(8), Et = J(12), mt = J(16), P = J(4);
450
- function ce(i, t, e, n, r, o, u) {
451
- let s, c, f, g, l, h, a, d, x, y, p, v, E, w, m, b, M, _;
449
+ const ue = (3 + 16 * O) * O, fe = (2 + 12 * O) * O, ce = (9 + 64 * O) * O * O, j = J(4), mt = J(8), Et = J(12), wt = J(16), P = J(4);
450
+ function he(i, t, e, n, r, o, f) {
451
+ let s, c, u, g, l, h, a, d, x, p, y, v, m, E, w, b, M, _;
452
452
  const R = i - r, k = e - r, C = t - o, I = n - o;
453
- w = R * I, h = S * R, a = h - (h - R), d = R - a, h = S * I, x = h - (h - I), y = I - x, m = d * y - (w - a * x - d * x - a * y), b = C * k, h = S * C, a = h - (h - C), d = C - a, h = S * k, x = h - (h - k), y = k - x, M = d * y - (b - a * x - d * x - a * y), p = m - M, l = m - p, j[0] = m - (p + l) + (l - M), v = w + p, l = v - w, E = w - (v - l) + (p - l), p = E - b, l = E - p, j[1] = E - (p + l) + (l - b), _ = v + p, l = _ - v, j[2] = v - (_ - l) + (p - l), j[3] = _;
454
- let A = se(4, j), Y = ue * u;
455
- if (A >= Y || -A >= Y || (l = i - R, s = i - (R + l) + (l - r), l = e - k, f = e - (k + l) + (l - r), l = t - C, c = t - (C + l) + (l - o), l = n - I, g = n - (I + l) + (l - o), s === 0 && c === 0 && f === 0 && g === 0) || (Y = fe * u + oe * Math.abs(A), A += R * g + I * s - (C * f + k * c), A >= Y || -A >= Y)) return A;
456
- w = s * I, h = S * s, a = h - (h - s), d = s - a, h = S * I, x = h - (h - I), y = I - x, m = d * y - (w - a * x - d * x - a * y), b = c * k, h = S * c, a = h - (h - c), d = c - a, h = S * k, x = h - (h - k), y = k - x, M = d * y - (b - a * x - d * x - a * y), p = m - M, l = m - p, P[0] = m - (p + l) + (l - M), v = w + p, l = v - w, E = w - (v - l) + (p - l), p = E - b, l = E - p, P[1] = E - (p + l) + (l - b), _ = v + p, l = _ - v, P[2] = v - (_ - l) + (p - l), P[3] = _;
457
- const Zt = ot(4, j, 4, P, wt);
458
- w = R * g, h = S * R, a = h - (h - R), d = R - a, h = S * g, x = h - (h - g), y = g - x, m = d * y - (w - a * x - d * x - a * y), b = C * f, h = S * C, a = h - (h - C), d = C - a, h = S * f, x = h - (h - f), y = f - x, M = d * y - (b - a * x - d * x - a * y), p = m - M, l = m - p, P[0] = m - (p + l) + (l - M), v = w + p, l = v - w, E = w - (v - l) + (p - l), p = E - b, l = E - p, P[1] = E - (p + l) + (l - b), _ = v + p, l = _ - v, P[2] = v - (_ - l) + (p - l), P[3] = _;
459
- const Gt = ot(Zt, wt, 4, P, Et);
460
- w = s * g, h = S * s, a = h - (h - s), d = s - a, h = S * g, x = h - (h - g), y = g - x, m = d * y - (w - a * x - d * x - a * y), b = c * f, h = S * c, a = h - (h - c), d = c - a, h = S * f, x = h - (h - f), y = f - x, M = d * y - (b - a * x - d * x - a * y), p = m - M, l = m - p, P[0] = m - (p + l) + (l - M), v = w + p, l = v - w, E = w - (v - l) + (p - l), p = E - b, l = E - p, P[1] = E - (p + l) + (l - b), _ = v + p, l = _ - v, P[2] = v - (_ - l) + (p - l), P[3] = _;
461
- const Wt = ot(Gt, Et, 4, P, mt);
462
- return mt[Wt - 1];
463
- }
464
- function he(i, t, e, n, r, o) {
465
- const u = (t - o) * (e - r), s = (i - r) * (n - o), c = u - s, f = Math.abs(u + s);
466
- return Math.abs(c) >= le * f ? c : -ce(i, t, e, n, r, o, f);
467
- }
468
- const D = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.ur.y, ht = (i, t) => {
453
+ E = R * I, h = S * R, a = h - (h - R), d = R - a, h = S * I, x = h - (h - I), p = I - x, w = d * p - (E - a * x - d * x - a * p), b = C * k, h = S * C, a = h - (h - C), d = C - a, h = S * k, x = h - (h - k), p = k - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, j[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, j[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, j[2] = v - (_ - l) + (y - l), j[3] = _;
454
+ let A = le(4, j), Y = fe * f;
455
+ if (A >= Y || -A >= Y || (l = i - R, s = i - (R + l) + (l - r), l = e - k, u = e - (k + l) + (l - r), l = t - C, c = t - (C + l) + (l - o), l = n - I, g = n - (I + l) + (l - o), s === 0 && c === 0 && u === 0 && g === 0) || (Y = ce * f + se * Math.abs(A), A += R * g + I * s - (C * u + k * c), A >= Y || -A >= Y)) return A;
456
+ E = s * I, h = S * s, a = h - (h - s), d = s - a, h = S * I, x = h - (h - I), p = I - x, w = d * p - (E - a * x - d * x - a * p), b = c * k, h = S * c, a = h - (h - c), d = c - a, h = S * k, x = h - (h - k), p = k - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
457
+ const Zt = ot(4, j, 4, P, mt);
458
+ E = R * g, h = S * R, a = h - (h - R), d = R - a, h = S * g, x = h - (h - g), p = g - x, w = d * p - (E - a * x - d * x - a * p), b = C * u, h = S * C, a = h - (h - C), d = C - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
459
+ const Wt = ot(Zt, mt, 4, P, Et);
460
+ E = s * g, h = S * s, a = h - (h - s), d = s - a, h = S * g, x = h - (h - g), p = g - x, w = d * p - (E - a * x - d * x - a * p), b = c * u, h = S * c, a = h - (h - c), d = c - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
461
+ const Jt = ot(Wt, Et, 4, P, wt);
462
+ return wt[Jt - 1];
463
+ }
464
+ function ae(i, t, e, n, r, o) {
465
+ const f = (t - o) * (e - r), s = (i - r) * (n - o), c = f - s, u = Math.abs(f + s);
466
+ return Math.abs(c) >= ue * u ? c : -he(i, t, e, n, r, o, u);
467
+ }
468
+ const F = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.ur.y, ht = (i, t) => {
469
469
  if (t.ur.x < i.ll.x || i.ur.x < t.ll.x || t.ur.y < i.ll.y || i.ur.y < t.ll.y) return null;
470
470
  const e = i.ll.x < t.ll.x ? t.ll.x : i.ll.x, n = i.ur.x < t.ur.x ? i.ur.x : t.ur.x, r = i.ll.y < t.ll.y ? t.ll.y : i.ll.y, o = i.ur.y < t.ur.y ? i.ur.y : t.ur.y;
471
471
  return {
@@ -481,13 +481,13 @@ const D = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.
481
481
  };
482
482
  let z = Number.EPSILON;
483
483
  z === void 0 && (z = Math.pow(2, -52));
484
- const ae = z * z, bt = (i, t) => {
484
+ const ge = z * z, bt = (i, t) => {
485
485
  if (-z < i && i < z && -z < t && t < z)
486
486
  return 0;
487
487
  const e = i - t;
488
- return e * e < ae * i * t ? 0 : i < t ? -1 : 1;
488
+ return e * e < ge * i * t ? 0 : i < t ? -1 : 1;
489
489
  };
490
- class ge {
490
+ class pe {
491
491
  constructor() {
492
492
  this.reset();
493
493
  }
@@ -520,10 +520,10 @@ class _t {
520
520
  return r !== null && bt(e.key, r.key) === 0 ? (this.tree.remove(t), r.key) : t;
521
521
  }
522
522
  }
523
- const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.x + i.y * t.y, St = (i, t, e) => {
524
- const n = he(i.x, i.y, t.x, t.y, e.x, e.y);
523
+ const Z = new pe(), H = (i, t) => i.x * t.y - i.y * t.x, qt = (i, t) => i.x * t.x + i.y * t.y, St = (i, t, e) => {
524
+ const n = ae(i.x, i.y, t.x, t.y, e.x, e.y);
525
525
  return n > 0 ? -1 : n < 0 ? 1 : 0;
526
- }, tt = (i) => Math.sqrt(jt(i, i)), pe = (i, t, e) => {
526
+ }, tt = (i) => Math.sqrt(qt(i, i)), ye = (i, t, e) => {
527
527
  const n = {
528
528
  x: t.x - i.x,
529
529
  y: t.y - i.y
@@ -532,7 +532,7 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
532
532
  y: e.y - i.y
533
533
  };
534
534
  return H(r, n) / tt(r) / tt(n);
535
- }, ye = (i, t, e) => {
535
+ }, de = (i, t, e) => {
536
536
  const n = {
537
537
  x: t.x - i.x,
538
538
  y: t.y - i.y
@@ -540,14 +540,14 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
540
540
  x: e.x - i.x,
541
541
  y: e.y - i.y
542
542
  };
543
- return jt(r, n) / tt(r) / tt(n);
543
+ return qt(r, n) / tt(r) / tt(n);
544
544
  }, Pt = (i, t, e) => t.y === 0 ? null : {
545
545
  x: i.x + t.x / t.y * (e - i.y),
546
546
  y: e
547
547
  }, Mt = (i, t, e) => t.x === 0 ? null : {
548
548
  x: e,
549
549
  y: i.y + t.y / t.x * (e - i.x)
550
- }, de = (i, t, e, n) => {
550
+ }, xe = (i, t, e, n) => {
551
551
  if (t.x === 0) return Mt(e, n, i.x);
552
552
  if (n.x === 0) return Mt(i, t, e.x);
553
553
  if (t.y === 0) return Pt(e, n, i.y);
@@ -557,7 +557,7 @@ const G = new ge(), H = (i, t) => i.x * t.y - i.y * t.x, jt = (i, t) => i.x * t.
557
557
  const o = {
558
558
  x: e.x - i.x,
559
559
  y: e.y - i.y
560
- }, u = H(o, t) / r, s = H(o, n) / r, c = i.x + s * t.x, f = e.x + u * n.x, g = i.y + s * t.y, l = e.y + u * n.y, h = (c + f) / 2, a = (g + l) / 2;
560
+ }, f = H(o, t) / r, s = H(o, n) / r, c = i.x + s * t.x, u = e.x + f * n.x, g = i.y + s * t.y, l = e.y + f * n.y, h = (c + u) / 2, a = (g + l) / 2;
561
561
  return {
562
562
  x: h,
563
563
  y: a
@@ -622,24 +622,24 @@ class L {
622
622
  const e = /* @__PURE__ */ new Map(), n = (r) => {
623
623
  const o = r.otherSE;
624
624
  e.set(r, {
625
- sine: pe(this.point, t.point, o.point),
626
- cosine: ye(this.point, t.point, o.point)
625
+ sine: ye(this.point, t.point, o.point),
626
+ cosine: de(this.point, t.point, o.point)
627
627
  });
628
628
  };
629
629
  return (r, o) => {
630
630
  e.has(r) || n(r), e.has(o) || n(o);
631
631
  const {
632
- sine: u,
632
+ sine: f,
633
633
  cosine: s
634
634
  } = e.get(r), {
635
635
  sine: c,
636
- cosine: f
636
+ cosine: u
637
637
  } = e.get(o);
638
- return u >= 0 && c >= 0 ? s < f ? 1 : s > f ? -1 : 0 : u < 0 && c < 0 ? s < f ? -1 : s > f ? 1 : 0 : c < u ? -1 : c > u ? 1 : 0;
638
+ return f >= 0 && c >= 0 ? s < u ? 1 : s > u ? -1 : 0 : f < 0 && c < 0 ? s < u ? -1 : s > u ? 1 : 0 : c < f ? -1 : c > f ? 1 : 0;
639
639
  };
640
640
  }
641
641
  }
642
- let xe = 0;
642
+ let ve = 0;
643
643
  class T {
644
644
  /* This compare() function is for ordering segments in the sweep
645
645
  * line tree, and does so according to the following criteria:
@@ -655,13 +655,13 @@ class T {
655
655
  * is directly on the right-more of the two left inputs.
656
656
  */
657
657
  static compare(t, e) {
658
- const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x, u = e.rightSE.point.x;
659
- if (u < n) return 1;
658
+ const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x, f = e.rightSE.point.x;
659
+ if (f < n) return 1;
660
660
  if (o < r) return -1;
661
- const s = t.leftSE.point.y, c = e.leftSE.point.y, f = t.rightSE.point.y, g = e.rightSE.point.y;
661
+ const s = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y, g = e.rightSE.point.y;
662
662
  if (n < r) {
663
- if (c < s && c < f) return 1;
664
- if (c > s && c > f) return -1;
663
+ if (c < s && c < u) return 1;
664
+ if (c > s && c > u) return -1;
665
665
  const l = t.comparePoint(e.leftSE.point);
666
666
  if (l < 0) return 1;
667
667
  if (l > 0) return -1;
@@ -678,37 +678,37 @@ class T {
678
678
  }
679
679
  if (s < c) return -1;
680
680
  if (s > c) return 1;
681
- if (o < u) {
681
+ if (o < f) {
682
682
  const l = e.comparePoint(t.rightSE.point);
683
683
  if (l !== 0) return l;
684
684
  }
685
- if (o > u) {
685
+ if (o > f) {
686
686
  const l = t.comparePoint(e.rightSE.point);
687
687
  if (l < 0) return 1;
688
688
  if (l > 0) return -1;
689
689
  }
690
- if (o !== u) {
691
- const l = f - s, h = o - n, a = g - c, d = u - r;
690
+ if (o !== f) {
691
+ const l = u - s, h = o - n, a = g - c, d = f - r;
692
692
  if (l > h && a < d) return 1;
693
693
  if (l < h && a > d) return -1;
694
694
  }
695
- return o > u ? 1 : o < u || f < g ? -1 : f > g ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
695
+ return o > f ? 1 : o < f || u < g ? -1 : u > g ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
696
696
  }
697
697
  /* Warning: a reference to ringWindings input will be stored,
698
698
  * and possibly will be later modified */
699
699
  constructor(t, e, n, r) {
700
- this.id = ++xe, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
700
+ this.id = ++ve, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
701
701
  }
702
702
  static fromRing(t, e, n) {
703
- let r, o, u;
703
+ let r, o, f;
704
704
  const s = L.comparePoints(t, e);
705
705
  if (s < 0)
706
- r = t, o = e, u = 1;
706
+ r = t, o = e, f = 1;
707
707
  else if (s > 0)
708
- r = e, o = t, u = -1;
708
+ r = e, o = t, f = -1;
709
709
  else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);
710
- const c = new L(r, !0), f = new L(o, !1);
711
- return new T(c, f, [n], [u]);
710
+ const c = new L(r, !0), u = new L(o, !1);
711
+ return new T(c, u, [n], [f]);
712
712
  }
713
713
  /* When a segment is split, the rightSE is replaced with a new sweep event */
714
714
  replaceRightSE(t) {
@@ -755,8 +755,8 @@ class T {
755
755
  const e = this.leftSE.point, n = this.rightSE.point, r = this.vector();
756
756
  if (e.x === n.x)
757
757
  return t.x === e.x ? 0 : t.x < e.x ? 1 : -1;
758
- const o = (t.y - e.y) / r.y, u = e.x + o * r.x;
759
- if (t.x === u) return 0;
758
+ const o = (t.y - e.y) / r.y, f = e.x + o * r.x;
759
+ if (t.x === f) return 0;
760
760
  const s = (t.x - e.x) / r.x, c = e.y + s * r.y;
761
761
  return t.y === c ? 0 : t.y < c ? -1 : 1;
762
762
  }
@@ -778,18 +778,18 @@ class T {
778
778
  getIntersection(t) {
779
779
  const e = this.bbox(), n = t.bbox(), r = ht(e, n);
780
780
  if (r === null) return null;
781
- const o = this.leftSE.point, u = this.rightSE.point, s = t.leftSE.point, c = t.rightSE.point, f = D(e, s) && this.comparePoint(s) === 0, g = D(n, o) && t.comparePoint(o) === 0, l = D(e, c) && this.comparePoint(c) === 0, h = D(n, u) && t.comparePoint(u) === 0;
782
- if (g && f)
783
- return h && !l ? u : !h && l ? c : null;
781
+ const o = this.leftSE.point, f = this.rightSE.point, s = t.leftSE.point, c = t.rightSE.point, u = F(e, s) && this.comparePoint(s) === 0, g = F(n, o) && t.comparePoint(o) === 0, l = F(e, c) && this.comparePoint(c) === 0, h = F(n, f) && t.comparePoint(f) === 0;
782
+ if (g && u)
783
+ return h && !l ? f : !h && l ? c : null;
784
784
  if (g)
785
785
  return l && o.x === c.x && o.y === c.y ? null : o;
786
- if (f)
787
- return h && u.x === s.x && u.y === s.y ? null : s;
786
+ if (u)
787
+ return h && f.x === s.x && f.y === s.y ? null : s;
788
788
  if (h && l) return null;
789
- if (h) return u;
789
+ if (h) return f;
790
790
  if (l) return c;
791
- const a = de(o, this.vector(), s, t.vector());
792
- return a === null || !D(r, a) ? null : G.round(a.x, a.y);
791
+ const a = xe(o, this.vector(), s, t.vector());
792
+ return a === null || !F(r, a) ? null : Z.round(a.x, a.y);
793
793
  }
794
794
  /**
795
795
  * Split the given segment into multiple segments on the given points.
@@ -804,9 +804,9 @@ class T {
804
804
  * Warning: input array of points is modified
805
805
  */
806
806
  split(t) {
807
- const e = [], n = t.events !== void 0, r = new L(t, !0), o = new L(t, !1), u = this.rightSE;
807
+ const e = [], n = t.events !== void 0, r = new L(t, !0), o = new L(t, !1), f = this.rightSE;
808
808
  this.replaceRightSE(o), e.push(o), e.push(r);
809
- const s = new T(r, u, this.rings.slice(), this.windings.slice());
809
+ const s = new T(r, f, this.rings.slice(), this.windings.slice());
810
810
  return L.comparePoints(s.leftSE.point, s.rightSE.point) > 0 && s.swapEvents(), L.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (r.checkForConsuming(), o.checkForConsuming()), e;
811
811
  }
812
812
  /* Swap which event is left and right */
@@ -832,9 +832,9 @@ class T {
832
832
  const o = e;
833
833
  e = n, n = o;
834
834
  }
835
- for (let o = 0, u = n.rings.length; o < u; o++) {
836
- const s = n.rings[o], c = n.windings[o], f = e.rings.indexOf(s);
837
- f === -1 ? (e.rings.push(s), e.windings.push(c)) : e.windings[f] += c;
835
+ for (let o = 0, f = n.rings.length; o < f; o++) {
836
+ const s = n.rings[o], c = n.windings[o], u = e.rings.indexOf(s);
837
+ u === -1 ? (e.rings.push(s), e.windings.push(c)) : e.windings[u] += c;
838
838
  }
839
839
  n.rings = null, n.windings = null, n.consumedBy = e, n.leftSE.consumedBy = e.leftSE, n.rightSE.consumedBy = e.rightSE;
840
840
  }
@@ -866,24 +866,24 @@ class T {
866
866
  };
867
867
  const e = this._afterState.rings, n = this._afterState.windings, r = this._afterState.multiPolys;
868
868
  for (let s = 0, c = this.rings.length; s < c; s++) {
869
- const f = this.rings[s], g = this.windings[s], l = e.indexOf(f);
870
- l === -1 ? (e.push(f), n.push(g)) : n[l] += g;
869
+ const u = this.rings[s], g = this.windings[s], l = e.indexOf(u);
870
+ l === -1 ? (e.push(u), n.push(g)) : n[l] += g;
871
871
  }
872
- const o = [], u = [];
872
+ const o = [], f = [];
873
873
  for (let s = 0, c = e.length; s < c; s++) {
874
874
  if (n[s] === 0) continue;
875
- const f = e[s], g = f.poly;
876
- if (u.indexOf(g) === -1)
877
- if (f.isExterior) o.push(g);
875
+ const u = e[s], g = u.poly;
876
+ if (f.indexOf(g) === -1)
877
+ if (u.isExterior) o.push(g);
878
878
  else {
879
- u.indexOf(g) === -1 && u.push(g);
880
- const l = o.indexOf(f.poly);
879
+ f.indexOf(g) === -1 && f.push(g);
880
+ const l = o.indexOf(u.poly);
881
881
  l !== -1 && o.splice(l, 1);
882
882
  }
883
883
  }
884
884
  for (let s = 0, c = o.length; s < c; s++) {
885
- const f = o[s].multiPoly;
886
- r.indexOf(f) === -1 && r.push(f);
885
+ const u = o[s].multiPoly;
886
+ r.indexOf(u) === -1 && r.push(u);
887
887
  }
888
888
  return this._afterState;
889
889
  }
@@ -925,7 +925,7 @@ class Lt {
925
925
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
926
926
  if (this.poly = e, this.isExterior = n, this.segments = [], typeof t[0][0] != "number" || typeof t[0][1] != "number")
927
927
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
928
- const r = G.round(t[0][0], t[0][1]);
928
+ const r = Z.round(t[0][0], t[0][1]);
929
929
  this.bbox = {
930
930
  ll: {
931
931
  x: r.x,
@@ -937,10 +937,10 @@ class Lt {
937
937
  }
938
938
  };
939
939
  let o = r;
940
- for (let u = 1, s = t.length; u < s; u++) {
941
- if (typeof t[u][0] != "number" || typeof t[u][1] != "number")
940
+ for (let f = 1, s = t.length; f < s; f++) {
941
+ if (typeof t[f][0] != "number" || typeof t[f][1] != "number")
942
942
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
943
- let c = G.round(t[u][0], t[u][1]);
943
+ let c = Z.round(t[f][0], t[f][1]);
944
944
  c.x === o.x && c.y === o.y || (this.segments.push(T.fromRing(o, c, this)), c.x < this.bbox.ll.x && (this.bbox.ll.x = c.x), c.y < this.bbox.ll.y && (this.bbox.ll.y = c.y), c.x > this.bbox.ur.x && (this.bbox.ur.x = c.x), c.y > this.bbox.ur.y && (this.bbox.ur.y = c.y), o = c);
945
945
  }
946
946
  (r.x !== o.x || r.y !== o.y) && this.segments.push(T.fromRing(o, r, this));
@@ -954,7 +954,7 @@ class Lt {
954
954
  return t;
955
955
  }
956
956
  }
957
- class ve {
957
+ class me {
958
958
  constructor(t, e) {
959
959
  if (!Array.isArray(t))
960
960
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
@@ -978,7 +978,7 @@ class ve {
978
978
  const t = this.exteriorRing.getSweepEvents();
979
979
  for (let e = 0, n = this.interiorRings.length; e < n; e++) {
980
980
  const r = this.interiorRings[e].getSweepEvents();
981
- for (let o = 0, u = r.length; o < u; o++)
981
+ for (let o = 0, f = r.length; o < f; o++)
982
982
  t.push(r[o]);
983
983
  }
984
984
  return t;
@@ -1003,7 +1003,7 @@ class Rt {
1003
1003
  }
1004
1004
  };
1005
1005
  for (let n = 0, r = t.length; n < r; n++) {
1006
- const o = new ve(t[n], this);
1006
+ const o = new me(t[n], this);
1007
1007
  o.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = o.bbox.ll.x), o.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = o.bbox.ll.y), o.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = o.bbox.ur.x), o.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = o.bbox.ur.y), this.polys.push(o);
1008
1008
  }
1009
1009
  this.isSubject = e;
@@ -1012,7 +1012,7 @@ class Rt {
1012
1012
  const t = [];
1013
1013
  for (let e = 0, n = this.polys.length; e < n; e++) {
1014
1014
  const r = this.polys[e].getSweepEvents();
1015
- for (let o = 0, u = r.length; o < u; o++)
1015
+ for (let o = 0, f = r.length; o < f; o++)
1016
1016
  t.push(r[o]);
1017
1017
  }
1018
1018
  return t;
@@ -1026,39 +1026,39 @@ class et {
1026
1026
  for (let n = 0, r = t.length; n < r; n++) {
1027
1027
  const o = t[n];
1028
1028
  if (!o.isInResult() || o.ringOut) continue;
1029
- let u = null, s = o.leftSE, c = o.rightSE;
1030
- const f = [s], g = s.point, l = [];
1031
- for (; u = s, s = c, f.push(s), s.point !== g; )
1029
+ let f = null, s = o.leftSE, c = o.rightSE;
1030
+ const u = [s], g = s.point, l = [];
1031
+ for (; f = s, s = c, u.push(s), s.point !== g; )
1032
1032
  for (; ; ) {
1033
1033
  const h = s.getAvailableLinkedEvents();
1034
1034
  if (h.length === 0) {
1035
- const x = f[0].point, y = f[f.length - 1].point;
1036
- throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${y.x}, ${y.y}].`);
1035
+ const x = u[0].point, p = u[u.length - 1].point;
1036
+ throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${p.x}, ${p.y}].`);
1037
1037
  }
1038
1038
  if (h.length === 1) {
1039
1039
  c = h[0].otherSE;
1040
1040
  break;
1041
1041
  }
1042
1042
  let a = null;
1043
- for (let x = 0, y = l.length; x < y; x++)
1043
+ for (let x = 0, p = l.length; x < p; x++)
1044
1044
  if (l[x].point === s.point) {
1045
1045
  a = x;
1046
1046
  break;
1047
1047
  }
1048
1048
  if (a !== null) {
1049
- const x = l.splice(a)[0], y = f.splice(x.index);
1050
- y.unshift(y[0].otherSE), e.push(new et(y.reverse()));
1049
+ const x = l.splice(a)[0], p = u.splice(x.index);
1050
+ p.unshift(p[0].otherSE), e.push(new et(p.reverse()));
1051
1051
  continue;
1052
1052
  }
1053
1053
  l.push({
1054
- index: f.length,
1054
+ index: u.length,
1055
1055
  point: s.point
1056
1056
  });
1057
- const d = s.getLeftmostComparator(u);
1057
+ const d = s.getLeftmostComparator(f);
1058
1058
  c = h.sort(d)[0].otherSE;
1059
1059
  break;
1060
1060
  }
1061
- e.push(new et(f));
1061
+ e.push(new et(u));
1062
1062
  }
1063
1063
  return e;
1064
1064
  }
@@ -1071,15 +1071,15 @@ class et {
1071
1071
  getGeom() {
1072
1072
  let t = this.events[0].point;
1073
1073
  const e = [t];
1074
- for (let f = 1, g = this.events.length - 1; f < g; f++) {
1075
- const l = this.events[f].point, h = this.events[f + 1].point;
1074
+ for (let u = 1, g = this.events.length - 1; u < g; u++) {
1075
+ const l = this.events[u].point, h = this.events[u + 1].point;
1076
1076
  St(l, t, h) !== 0 && (e.push(l), t = l);
1077
1077
  }
1078
1078
  if (e.length === 1) return null;
1079
1079
  const n = e[0], r = e[1];
1080
1080
  St(n, t, r) === 0 && e.shift(), e.push(e[0]);
1081
- const o = this.isExteriorRing() ? 1 : -1, u = this.isExteriorRing() ? 0 : e.length - 1, s = this.isExteriorRing() ? e.length : -1, c = [];
1082
- for (let f = u; f != s; f += o) c.push([e[f].x, e[f].y]);
1081
+ const o = this.isExteriorRing() ? 1 : -1, f = this.isExteriorRing() ? 0 : e.length - 1, s = this.isExteriorRing() ? e.length : -1, c = [];
1082
+ for (let u = f; u != s; u += o) c.push([e[u].x, e[u].y]);
1083
1083
  return c;
1084
1084
  }
1085
1085
  isExteriorRing() {
@@ -1096,8 +1096,8 @@ class et {
1096
1096
  _calcEnclosingRing() {
1097
1097
  let t = this.events[0];
1098
1098
  for (let r = 1, o = this.events.length; r < o; r++) {
1099
- const u = this.events[r];
1100
- L.compare(t, u) > 0 && (t = u);
1099
+ const f = this.events[r];
1100
+ L.compare(t, f) > 0 && (t = f);
1101
1101
  }
1102
1102
  let e = t.segment.prevInResult(), n = e ? e.prevInResult() : null;
1103
1103
  for (; ; ) {
@@ -1126,7 +1126,7 @@ class kt {
1126
1126
  return t;
1127
1127
  }
1128
1128
  }
1129
- class we {
1129
+ class Ee {
1130
1130
  constructor(t) {
1131
1131
  this.rings = t, this.polys = this._composePolys(t);
1132
1132
  }
@@ -1145,14 +1145,14 @@ class we {
1145
1145
  if (!o.poly)
1146
1146
  if (o.isExteriorRing()) e.push(new kt(o));
1147
1147
  else {
1148
- const u = o.enclosingRing();
1149
- u.poly || e.push(new kt(u)), u.poly.addInterior(o);
1148
+ const f = o.enclosingRing();
1149
+ f.poly || e.push(new kt(f)), f.poly.addInterior(o);
1150
1150
  }
1151
1151
  }
1152
1152
  return e;
1153
1153
  }
1154
1154
  }
1155
- class Ee {
1155
+ class we {
1156
1156
  constructor(t) {
1157
1157
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : T.compare;
1158
1158
  this.queue = t, this.tree = new yt(e), this.segments = [];
@@ -1163,16 +1163,16 @@ class Ee {
1163
1163
  return t.isLeft ? this.queue.remove(t.otherSE) : this.tree.remove(e), n;
1164
1164
  const r = t.isLeft ? this.tree.add(e) : this.tree.find(e);
1165
1165
  if (!r) throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);
1166
- let o = r, u = r, s, c;
1166
+ let o = r, f = r, s, c;
1167
1167
  for (; s === void 0; )
1168
1168
  o = this.tree.prev(o), o === null ? s = null : o.key.consumedBy === void 0 && (s = o.key);
1169
1169
  for (; c === void 0; )
1170
- u = this.tree.next(u), u === null ? c = null : u.key.consumedBy === void 0 && (c = u.key);
1170
+ f = this.tree.next(f), f === null ? c = null : f.key.consumedBy === void 0 && (c = f.key);
1171
1171
  if (t.isLeft) {
1172
- let f = null;
1172
+ let u = null;
1173
1173
  if (s) {
1174
1174
  const l = s.getIntersection(e);
1175
- if (l !== null && (e.isAnEndpoint(l) || (f = l), !s.isAnEndpoint(l))) {
1175
+ if (l !== null && (e.isAnEndpoint(l) || (u = l), !s.isAnEndpoint(l))) {
1176
1176
  const h = this._splitSafely(s, l);
1177
1177
  for (let a = 0, d = h.length; a < d; a++)
1178
1178
  n.push(h[a]);
@@ -1187,9 +1187,9 @@ class Ee {
1187
1187
  n.push(h[a]);
1188
1188
  }
1189
1189
  }
1190
- if (f !== null || g !== null) {
1190
+ if (u !== null || g !== null) {
1191
1191
  let l = null;
1192
- f === null ? l = g : g === null ? l = f : l = L.comparePoints(f, g) <= 0 ? f : g, this.queue.remove(e.rightSE), n.push(e.rightSE);
1192
+ u === null ? l = g : g === null ? l = u : l = L.comparePoints(u, g) <= 0 ? u : g, this.queue.remove(e.rightSE), n.push(e.rightSE);
1193
1193
  const h = e.split(l);
1194
1194
  for (let a = 0, d = h.length; a < d; a++)
1195
1195
  n.push(h[a]);
@@ -1197,15 +1197,15 @@ class Ee {
1197
1197
  n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = s);
1198
1198
  } else {
1199
1199
  if (s && c) {
1200
- const f = s.getIntersection(c);
1201
- if (f !== null) {
1202
- if (!s.isAnEndpoint(f)) {
1203
- const g = this._splitSafely(s, f);
1200
+ const u = s.getIntersection(c);
1201
+ if (u !== null) {
1202
+ if (!s.isAnEndpoint(u)) {
1203
+ const g = this._splitSafely(s, u);
1204
1204
  for (let l = 0, h = g.length; l < h; l++)
1205
1205
  n.push(g[l]);
1206
1206
  }
1207
- if (!c.isAnEndpoint(f)) {
1208
- const g = this._splitSafely(c, f);
1207
+ if (!c.isAnEndpoint(u)) {
1208
+ const g = this._splitSafely(c, u);
1209
1209
  for (let l = 0, h = g.length; l < h; l++)
1210
1210
  n.push(g[l]);
1211
1211
  }
@@ -1225,10 +1225,10 @@ class Ee {
1225
1225
  return r.push(n), t.consumedBy === void 0 && this.tree.add(t), r;
1226
1226
  }
1227
1227
  }
1228
- const Ct = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, me = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
1229
- class be {
1228
+ const Ct = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, be = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
1229
+ class _e {
1230
1230
  run(t, e, n) {
1231
- $.type = t, G.reset();
1231
+ $.type = t, Z.reset();
1232
1232
  const r = [new Rt(e, !0)];
1233
1233
  for (let l = 0, h = n.length; l < h; l++)
1234
1234
  r.push(new Rt(n[l], !1));
@@ -1251,7 +1251,7 @@ class be {
1251
1251
  if (o.insert(a[d]), o.size > Ct)
1252
1252
  throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
1253
1253
  }
1254
- const u = new Ee(o);
1254
+ const f = new we(o);
1255
1255
  let s = o.size, c = o.pop();
1256
1256
  for (; c; ) {
1257
1257
  const l = c.key;
@@ -1261,65 +1261,65 @@ class be {
1261
1261
  }
1262
1262
  if (o.size > Ct)
1263
1263
  throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
1264
- if (u.segments.length > me)
1264
+ if (f.segments.length > be)
1265
1265
  throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
1266
- const h = u.process(l);
1266
+ const h = f.process(l);
1267
1267
  for (let a = 0, d = h.length; a < d; a++) {
1268
1268
  const x = h[a];
1269
1269
  x.consumedBy === void 0 && o.insert(x);
1270
1270
  }
1271
1271
  s = o.size, c = o.pop();
1272
1272
  }
1273
- G.reset();
1274
- const f = et.factory(u.segments);
1275
- return new we(f).getGeom();
1273
+ Z.reset();
1274
+ const u = et.factory(f.segments);
1275
+ return new Ee(u).getGeom();
1276
1276
  }
1277
1277
  }
1278
- const $ = new be(), _e = function(i) {
1278
+ const $ = new _e(), Se = function(i) {
1279
1279
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1280
1280
  e[n - 1] = arguments[n];
1281
1281
  return $.run("union", i, e);
1282
- }, Se = function(i) {
1282
+ }, Pe = function(i) {
1283
1283
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1284
1284
  e[n - 1] = arguments[n];
1285
1285
  return $.run("intersection", i, e);
1286
- }, Pe = function(i) {
1286
+ }, Me = function(i) {
1287
1287
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1288
1288
  e[n - 1] = arguments[n];
1289
1289
  return $.run("xor", i, e);
1290
- }, Me = function(i) {
1290
+ }, Le = function(i) {
1291
1291
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1292
1292
  e[n - 1] = arguments[n];
1293
1293
  return $.run("difference", i, e);
1294
1294
  };
1295
- var qt = {
1296
- union: _e,
1297
- intersection: Se,
1298
- xor: Pe,
1299
- difference: Me
1295
+ var Qt = {
1296
+ union: Se,
1297
+ intersection: Pe,
1298
+ xor: Me,
1299
+ difference: Le
1300
1300
  };
1301
- function Qt(i, t, e) {
1301
+ function Ut(i, t, e) {
1302
1302
  if (i !== null)
1303
- for (var n, r, o, u, s, c, f, g = 0, l = 0, h, a = i.type, d = a === "FeatureCollection", x = a === "Feature", y = d ? i.features.length : 1, p = 0; p < y; p++) {
1304
- f = d ? i.features[p].geometry : x ? i.geometry : i, h = f ? f.type === "GeometryCollection" : !1, s = h ? f.geometries.length : 1;
1303
+ for (var n, r, o, f, s, c, u, g = 0, l = 0, h, a = i.type, d = a === "FeatureCollection", x = a === "Feature", p = d ? i.features.length : 1, y = 0; y < p; y++) {
1304
+ u = d ? i.features[y].geometry : x ? i.geometry : i, h = u ? u.type === "GeometryCollection" : !1, s = h ? u.geometries.length : 1;
1305
1305
  for (var v = 0; v < s; v++) {
1306
- var E = 0, w = 0;
1307
- if (u = h ? f.geometries[v] : f, u !== null) {
1308
- c = u.coordinates;
1309
- var m = u.type;
1310
- switch (g = 0, m) {
1306
+ var m = 0, E = 0;
1307
+ if (f = h ? u.geometries[v] : u, f !== null) {
1308
+ c = f.coordinates;
1309
+ var w = f.type;
1310
+ switch (g = 0, w) {
1311
1311
  case null:
1312
1312
  break;
1313
1313
  case "Point":
1314
1314
  if (t(
1315
1315
  c,
1316
1316
  l,
1317
- p,
1318
- E,
1319
- w
1317
+ y,
1318
+ m,
1319
+ E
1320
1320
  ) === !1)
1321
1321
  return !1;
1322
- l++, E++;
1322
+ l++, m++;
1323
1323
  break;
1324
1324
  case "LineString":
1325
1325
  case "MultiPoint":
@@ -1327,14 +1327,14 @@ function Qt(i, t, e) {
1327
1327
  if (t(
1328
1328
  c[n],
1329
1329
  l,
1330
- p,
1331
- E,
1332
- w
1330
+ y,
1331
+ m,
1332
+ E
1333
1333
  ) === !1)
1334
1334
  return !1;
1335
- l++, m === "MultiPoint" && E++;
1335
+ l++, w === "MultiPoint" && m++;
1336
1336
  }
1337
- m === "LineString" && E++;
1337
+ w === "LineString" && m++;
1338
1338
  break;
1339
1339
  case "Polygon":
1340
1340
  case "MultiLineString":
@@ -1343,39 +1343,39 @@ function Qt(i, t, e) {
1343
1343
  if (t(
1344
1344
  c[n][r],
1345
1345
  l,
1346
- p,
1347
- E,
1348
- w
1346
+ y,
1347
+ m,
1348
+ E
1349
1349
  ) === !1)
1350
1350
  return !1;
1351
1351
  l++;
1352
1352
  }
1353
- m === "MultiLineString" && E++, m === "Polygon" && w++;
1353
+ w === "MultiLineString" && m++, w === "Polygon" && E++;
1354
1354
  }
1355
- m === "Polygon" && E++;
1355
+ w === "Polygon" && m++;
1356
1356
  break;
1357
1357
  case "MultiPolygon":
1358
1358
  for (n = 0; n < c.length; n++) {
1359
- for (w = 0, r = 0; r < c[n].length; r++) {
1359
+ for (E = 0, r = 0; r < c[n].length; r++) {
1360
1360
  for (o = 0; o < c[n][r].length - g; o++) {
1361
1361
  if (t(
1362
1362
  c[n][r][o],
1363
1363
  l,
1364
- p,
1365
- E,
1366
- w
1364
+ y,
1365
+ m,
1366
+ E
1367
1367
  ) === !1)
1368
1368
  return !1;
1369
1369
  l++;
1370
1370
  }
1371
- w++;
1371
+ E++;
1372
1372
  }
1373
- E++;
1373
+ m++;
1374
1374
  }
1375
1375
  break;
1376
1376
  case "GeometryCollection":
1377
- for (n = 0; n < u.geometries.length; n++)
1378
- if (Qt(u.geometries[n], t) === !1)
1377
+ for (n = 0; n < f.geometries.length; n++)
1378
+ if (Ut(f.geometries[n], t) === !1)
1379
1379
  return !1;
1380
1380
  break;
1381
1381
  default:
@@ -1386,14 +1386,14 @@ function Qt(i, t, e) {
1386
1386
  }
1387
1387
  }
1388
1388
  function dt(i, t) {
1389
- var e, n, r, o, u, s, c, f, g, l, h = 0, a = i.type === "FeatureCollection", d = i.type === "Feature", x = a ? i.features.length : 1;
1389
+ var e, n, r, o, f, s, c, u, g, l, h = 0, a = i.type === "FeatureCollection", d = i.type === "Feature", x = a ? i.features.length : 1;
1390
1390
  for (e = 0; e < x; e++) {
1391
- for (s = a ? i.features[e].geometry : d ? i.geometry : i, f = a ? i.features[e].properties : d ? i.properties : {}, g = a ? i.features[e].bbox : d ? i.bbox : void 0, l = a ? i.features[e].id : d ? i.id : void 0, c = s ? s.type === "GeometryCollection" : !1, u = c ? s.geometries.length : 1, r = 0; r < u; r++) {
1391
+ for (s = a ? i.features[e].geometry : d ? i.geometry : i, u = a ? i.features[e].properties : d ? i.properties : {}, g = a ? i.features[e].bbox : d ? i.bbox : void 0, l = a ? i.features[e].id : d ? i.id : void 0, c = s ? s.type === "GeometryCollection" : !1, f = c ? s.geometries.length : 1, r = 0; r < f; r++) {
1392
1392
  if (o = c ? s.geometries[r] : s, o === null) {
1393
1393
  if (t(
1394
1394
  null,
1395
1395
  h,
1396
- f,
1396
+ u,
1397
1397
  g,
1398
1398
  l
1399
1399
  ) === !1)
@@ -1410,7 +1410,7 @@ function dt(i, t) {
1410
1410
  if (t(
1411
1411
  o,
1412
1412
  h,
1413
- f,
1413
+ u,
1414
1414
  g,
1415
1415
  l
1416
1416
  ) === !1)
@@ -1422,7 +1422,7 @@ function dt(i, t) {
1422
1422
  if (t(
1423
1423
  o.geometries[n],
1424
1424
  h,
1425
- f,
1425
+ u,
1426
1426
  g,
1427
1427
  l
1428
1428
  ) === !1)
@@ -1436,8 +1436,8 @@ function dt(i, t) {
1436
1436
  h++;
1437
1437
  }
1438
1438
  }
1439
- function Le(i, t) {
1440
- dt(i, function(e, n, r, o, u) {
1439
+ function Re(i, t) {
1440
+ dt(i, function(e, n, r, o, f) {
1441
1441
  var s = e === null ? null : e.type;
1442
1442
  switch (s) {
1443
1443
  case null:
@@ -1445,7 +1445,7 @@ function Le(i, t) {
1445
1445
  case "LineString":
1446
1446
  case "Polygon":
1447
1447
  return t(
1448
- V(e, r, { bbox: o, id: u }),
1448
+ X(e, r, { bbox: o, id: f }),
1449
1449
  n,
1450
1450
  0
1451
1451
  ) === !1 ? !1 : void 0;
@@ -1462,50 +1462,50 @@ function Le(i, t) {
1462
1462
  c = "Polygon";
1463
1463
  break;
1464
1464
  }
1465
- for (var f = 0; f < e.coordinates.length; f++) {
1466
- var g = e.coordinates[f], l = {
1465
+ for (var u = 0; u < e.coordinates.length; u++) {
1466
+ var g = e.coordinates[u], l = {
1467
1467
  type: c,
1468
1468
  coordinates: g
1469
1469
  };
1470
- if (t(V(l, r), n, f) === !1)
1470
+ if (t(X(l, r), n, u) === !1)
1471
1471
  return !1;
1472
1472
  }
1473
1473
  });
1474
1474
  }
1475
- function Re(i, t = {}) {
1475
+ function ke(i, t = {}) {
1476
1476
  const e = [];
1477
1477
  if (dt(i, (r) => {
1478
1478
  e.push(r.coordinates);
1479
1479
  }), e.length < 2)
1480
1480
  throw new Error("Must have at least 2 geometries");
1481
- const n = qt.union(e[0], ...e.slice(1));
1482
- return n.length === 0 ? null : n.length === 1 ? pt(n[0], t.properties) : Ft(n, t.properties);
1481
+ const n = Qt.union(e[0], ...e.slice(1));
1482
+ return n.length === 0 ? null : n.length === 1 ? pt(n[0], t.properties) : jt(n, t.properties);
1483
1483
  }
1484
- var Ut = Re;
1484
+ var Yt = ke;
1485
1485
  function W() {
1486
1486
  }
1487
- function Yt(i) {
1487
+ function Ft(i) {
1488
1488
  return i();
1489
1489
  }
1490
1490
  function It() {
1491
1491
  return /* @__PURE__ */ Object.create(null);
1492
1492
  }
1493
1493
  function nt(i) {
1494
- i.forEach(Yt);
1494
+ i.forEach(Ft);
1495
1495
  }
1496
1496
  function Dt(i) {
1497
1497
  return typeof i == "function";
1498
1498
  }
1499
- function ke(i, t) {
1499
+ function Ce(i, t) {
1500
1500
  return i != i ? t == t : i !== t || i && typeof i == "object" || typeof i == "function";
1501
1501
  }
1502
- function Ce(i) {
1502
+ function Ie(i) {
1503
1503
  return Object.keys(i).length === 0;
1504
1504
  }
1505
- function Ie(i, t) {
1505
+ function $e(i, t) {
1506
1506
  i.appendChild(t);
1507
1507
  }
1508
- function $e(i, t, e) {
1508
+ function Ae(i, t, e) {
1509
1509
  i.insertBefore(t, e || null);
1510
1510
  }
1511
1511
  function Xt(i) {
@@ -1517,22 +1517,22 @@ function $t(i) {
1517
1517
  function N(i, t, e) {
1518
1518
  e == null ? i.removeAttribute(t) : i.getAttribute(t) !== e && i.setAttribute(t, e);
1519
1519
  }
1520
- function Ae(i) {
1520
+ function Oe(i) {
1521
1521
  return Array.from(i.childNodes);
1522
1522
  }
1523
1523
  function K(i, t, e) {
1524
1524
  i.classList.toggle(t, !!e);
1525
1525
  }
1526
1526
  let xt;
1527
- function X(i) {
1527
+ function D(i) {
1528
1528
  xt = i;
1529
1529
  }
1530
1530
  const Q = [], At = [];
1531
1531
  let U = [];
1532
- const Ot = [], Oe = /* @__PURE__ */ Promise.resolve();
1532
+ const Ot = [], Ne = /* @__PURE__ */ Promise.resolve();
1533
1533
  let at = !1;
1534
- function Ne() {
1535
- at || (at = !0, Oe.then(Vt));
1534
+ function Be() {
1535
+ at || (at = !0, Ne.then(Vt));
1536
1536
  }
1537
1537
  function gt(i) {
1538
1538
  U.push(i);
@@ -1547,12 +1547,12 @@ function Vt() {
1547
1547
  try {
1548
1548
  for (; q < Q.length; ) {
1549
1549
  const t = Q[q];
1550
- q++, X(t), Be(t.$$);
1550
+ q++, D(t), ze(t.$$);
1551
1551
  }
1552
1552
  } catch (t) {
1553
1553
  throw Q.length = 0, q = 0, t;
1554
1554
  }
1555
- for (X(null), Q.length = 0, q = 0; At.length; ) At.pop()();
1555
+ for (D(null), Q.length = 0, q = 0; At.length; ) At.pop()();
1556
1556
  for (let t = 0; t < U.length; t += 1) {
1557
1557
  const e = U[t];
1558
1558
  st.has(e) || (st.add(e), e());
@@ -1561,41 +1561,41 @@ function Vt() {
1561
1561
  } while (Q.length);
1562
1562
  for (; Ot.length; )
1563
1563
  Ot.pop()();
1564
- at = !1, st.clear(), X(i);
1564
+ at = !1, st.clear(), D(i);
1565
1565
  }
1566
- function Be(i) {
1566
+ function ze(i) {
1567
1567
  if (i.fragment !== null) {
1568
1568
  i.update(), nt(i.before_update);
1569
1569
  const t = i.dirty;
1570
1570
  i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, t), i.after_update.forEach(gt);
1571
1571
  }
1572
1572
  }
1573
- function ze(i) {
1573
+ function Te(i) {
1574
1574
  const t = [], e = [];
1575
1575
  U.forEach((n) => i.indexOf(n) === -1 ? t.push(n) : e.push(n)), e.forEach((n) => n()), U = t;
1576
1576
  }
1577
- const Te = /* @__PURE__ */ new Set();
1578
- function Fe(i, t) {
1579
- i && i.i && (Te.delete(i), i.i(t));
1577
+ const Ge = /* @__PURE__ */ new Set();
1578
+ function je(i, t) {
1579
+ i && i.i && (Ge.delete(i), i.i(t));
1580
1580
  }
1581
- function je(i, t, e) {
1581
+ function qe(i, t, e) {
1582
1582
  const { fragment: n, after_update: r } = i.$$;
1583
1583
  n && n.m(t, e), gt(() => {
1584
- const o = i.$$.on_mount.map(Yt).filter(Dt);
1584
+ const o = i.$$.on_mount.map(Ft).filter(Dt);
1585
1585
  i.$$.on_destroy ? i.$$.on_destroy.push(...o) : nt(o), i.$$.on_mount = [];
1586
1586
  }), r.forEach(gt);
1587
1587
  }
1588
- function qe(i, t) {
1588
+ function Qe(i, t) {
1589
1589
  const e = i.$$;
1590
- e.fragment !== null && (ze(e.after_update), nt(e.on_destroy), e.fragment && e.fragment.d(t), e.on_destroy = e.fragment = null, e.ctx = []);
1590
+ e.fragment !== null && (Te(e.after_update), nt(e.on_destroy), e.fragment && e.fragment.d(t), e.on_destroy = e.fragment = null, e.ctx = []);
1591
1591
  }
1592
- function Qe(i, t) {
1593
- i.$$.dirty[0] === -1 && (Q.push(i), Ne(), i.$$.dirty.fill(0)), i.$$.dirty[t / 31 | 0] |= 1 << t % 31;
1592
+ function Ue(i, t) {
1593
+ i.$$.dirty[0] === -1 && (Q.push(i), Be(), i.$$.dirty.fill(0)), i.$$.dirty[t / 31 | 0] |= 1 << t % 31;
1594
1594
  }
1595
- function Ue(i, t, e, n, r, o, u = null, s = [-1]) {
1595
+ function Ye(i, t, e, n, r, o, f = null, s = [-1]) {
1596
1596
  const c = xt;
1597
- X(i);
1598
- const f = i.$$ = {
1597
+ D(i);
1598
+ const u = i.$$ = {
1599
1599
  fragment: null,
1600
1600
  ctx: [],
1601
1601
  // state
@@ -1616,22 +1616,22 @@ function Ue(i, t, e, n, r, o, u = null, s = [-1]) {
1616
1616
  skip_bound: !1,
1617
1617
  root: t.target || c.$$.root
1618
1618
  };
1619
- u && u(f.root);
1619
+ f && f(u.root);
1620
1620
  let g = !1;
1621
- if (f.ctx = e ? e(i, t.props || {}, (l, h, ...a) => {
1621
+ if (u.ctx = e ? e(i, t.props || {}, (l, h, ...a) => {
1622
1622
  const d = a.length ? a[0] : h;
1623
- return f.ctx && r(f.ctx[l], f.ctx[l] = d) && (!f.skip_bound && f.bound[l] && f.bound[l](d), g && Qe(i, l)), h;
1624
- }) : [], f.update(), g = !0, nt(f.before_update), f.fragment = n ? n(f.ctx) : !1, t.target) {
1623
+ return u.ctx && r(u.ctx[l], u.ctx[l] = d) && (!u.skip_bound && u.bound[l] && u.bound[l](d), g && Ue(i, l)), h;
1624
+ }) : [], u.update(), g = !0, nt(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
1625
1625
  if (t.hydrate) {
1626
- const l = Ae(t.target);
1627
- f.fragment && f.fragment.l(l), l.forEach(Xt);
1626
+ const l = Oe(t.target);
1627
+ u.fragment && u.fragment.l(l), l.forEach(Xt);
1628
1628
  } else
1629
- f.fragment && f.fragment.c();
1630
- t.intro && Fe(i.$$.fragment), je(i, t.target, t.anchor), Vt();
1629
+ u.fragment && u.fragment.c();
1630
+ t.intro && je(i.$$.fragment), qe(i, t.target, t.anchor), Vt();
1631
1631
  }
1632
- X(c);
1632
+ D(c);
1633
1633
  }
1634
- class Ye {
1634
+ class Fe {
1635
1635
  constructor() {
1636
1636
  /**
1637
1637
  * ### PRIVATE API
@@ -1652,7 +1652,7 @@ class Ye {
1652
1652
  }
1653
1653
  /** @returns {void} */
1654
1654
  $destroy() {
1655
- qe(this, 1), this.$destroy = W;
1655
+ Qe(this, 1), this.$destroy = W;
1656
1656
  }
1657
1657
  /**
1658
1658
  * @template {Extract<keyof Events, string>} K
@@ -1674,7 +1674,7 @@ class Ye {
1674
1674
  * @returns {void}
1675
1675
  */
1676
1676
  $set(t) {
1677
- this.$$set && !Ce(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
1677
+ this.$$set && !Ie(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
1678
1678
  }
1679
1679
  }
1680
1680
  const De = "4";
@@ -1697,7 +1697,7 @@ function Xe(i) {
1697
1697
  );
1698
1698
  },
1699
1699
  m(r, o) {
1700
- $e(r, t, o), Ie(t, e);
1700
+ Ae(r, t, o), $e(t, e);
1701
1701
  },
1702
1702
  p(r, [o]) {
1703
1703
  o & /*displayIn*/
@@ -1729,46 +1729,46 @@ function Ve(i, t, e) {
1729
1729
  "displayIn" in r && e(0, n = r.displayIn);
1730
1730
  }, [n];
1731
1731
  }
1732
- class Ze extends Ye {
1732
+ class Ze extends Fe {
1733
1733
  constructor(t) {
1734
- super(), Ue(this, t, Ve, Xe, ke, { displayIn: 0 });
1734
+ super(), Ye(this, t, Ve, Xe, Ce, { displayIn: 0 });
1735
1735
  }
1736
1736
  }
1737
- function Ge(i, t = {}) {
1737
+ function We(i, t = {}) {
1738
1738
  if (i.bbox != null && t.recompute !== !0)
1739
1739
  return i.bbox;
1740
1740
  const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
1741
- return Qt(i, (n) => {
1741
+ return Ut(i, (n) => {
1742
1742
  e[0] > n[0] && (e[0] = n[0]), e[1] > n[1] && (e[1] = n[1]), e[2] < n[0] && (e[2] = n[0]), e[3] < n[1] && (e[3] = n[1]);
1743
1743
  }), e;
1744
1744
  }
1745
- var Nt = Ge;
1746
- function We(i) {
1745
+ var Nt = We;
1746
+ function Je(i) {
1747
1747
  const t = [];
1748
1748
  if (dt(i, (r) => {
1749
1749
  t.push(r.coordinates);
1750
1750
  }), t.length < 2)
1751
1751
  throw new Error("Must have at least two features");
1752
- const e = i.features[0].properties || {}, n = qt.difference(t[0], ...t.slice(1));
1753
- return n.length === 0 ? null : n.length === 1 ? pt(n[0], e) : Ft(n, e);
1752
+ const e = i.features[0].properties || {}, n = Qt.difference(t[0], ...t.slice(1));
1753
+ return n.length === 0 ? null : n.length === 1 ? pt(n[0], e) : jt(n, e);
1754
1754
  }
1755
- var Je = We;
1756
- function Ke(i) {
1755
+ var Ke = Je;
1756
+ function He(i) {
1757
1757
  if (!i)
1758
1758
  throw new Error("geojson is required");
1759
1759
  var t = [];
1760
- return Le(i, function(e) {
1760
+ return Re(i, function(e) {
1761
1761
  t.push(e);
1762
- }), Z(t);
1762
+ }), V(t);
1763
1763
  }
1764
- var He = Ke;
1764
+ var tn = He;
1765
1765
  function Bt(i) {
1766
1766
  const t = [...i];
1767
1767
  return t[2] < t[0] && (Math.abs((t[0] + t[2] + 360) / 2) > Math.abs((t[0] - 360 + t[2]) / 2) ? t[0] -= 360 : t[2] += 360), t;
1768
1768
  }
1769
1769
  function zt(i, t) {
1770
- const e = Je(
1771
- Z([
1770
+ const e = Ke(
1771
+ V([
1772
1772
  pt([
1773
1773
  [
1774
1774
  [180, 90],
@@ -1784,28 +1784,27 @@ function zt(i, t) {
1784
1784
  if (!e)
1785
1785
  return;
1786
1786
  e.properties = { isMask: !0 };
1787
- const n = Bt(Nt(i)), r = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, u = n[2] > 180, s = He(i);
1788
- if (s.features.length > 1 && (o || u))
1787
+ const n = Bt(Nt(i)), r = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, f = n[2] > 180, s = tn(i);
1788
+ if (s.features.length > 1 && (o || f))
1789
1789
  for (const c of s.features) {
1790
- const f = Bt(Nt(c));
1791
- if (u && f[0] < -180 + r)
1790
+ const u = Bt(Nt(c));
1791
+ if (f && u[0] < -180 + r)
1792
1792
  for (const g of c.geometry.coordinates)
1793
1793
  for (const l of g)
1794
1794
  l[0] += 360 - r;
1795
- if (o && f[2] > 180 - r)
1795
+ if (o && u[2] > 180 - r)
1796
1796
  for (const g of c.geometry.coordinates)
1797
1797
  for (const l of g)
1798
1798
  l[0] -= 360 - r;
1799
1799
  }
1800
1800
  t(
1801
- Z([
1802
- s.features.length < 2 ? i : Ut(s) ?? i,
1801
+ V([
1802
+ s.features.length < 2 ? i : Yt(s) ?? i,
1803
1803
  e
1804
1804
  ])
1805
1805
  );
1806
1806
  }
1807
- const Tt = Z([]);
1808
- function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
1807
+ const Tt = V([]), Gt = {
1809
1808
  fill: {
1810
1809
  paint: {
1811
1810
  "fill-color": "#000",
@@ -1824,21 +1823,23 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
1824
1823
  },
1825
1824
  filter: ["!", ["has", "isMask"]]
1826
1825
  }
1827
- }) {
1826
+ };
1827
+ function nn(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt) {
1828
1828
  let s;
1829
1829
  const c = [];
1830
- let f, g, l;
1830
+ let u, g, l;
1831
1831
  function h() {
1832
- !i.getSource("full-geom") && (u != null && u.fill || u != null && u.line) && i.addSource("full-geom", {
1832
+ const p = f ? f === !0 ? Gt : f : void 0;
1833
+ !i.getSource("full-geom") && (p != null && p.fill || p != null && p.line) && i.addSource("full-geom", {
1833
1834
  type: "geojson",
1834
1835
  data: Tt
1835
- }), !i.getLayer("full-geom-fill") && (u != null && u.fill) && i.addLayer({
1836
- ...u == null ? void 0 : u.fill,
1836
+ }), !i.getLayer("full-geom-fill") && (p != null && p.fill) && i.addLayer({
1837
+ ...p == null ? void 0 : p.fill,
1837
1838
  id: "full-geom-fill",
1838
1839
  type: "fill",
1839
1840
  source: "full-geom"
1840
- }), !i.getLayer("full-geom-line") && (u != null && u.line) && i.addLayer({
1841
- ...u == null ? void 0 : u.line,
1841
+ }), !i.getLayer("full-geom-line") && (p != null && p.line) && i.addLayer({
1842
+ ...p == null ? void 0 : p.line,
1842
1843
  id: "full-geom-line",
1843
1844
  type: "line",
1844
1845
  source: "full-geom"
@@ -1849,98 +1850,105 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
1849
1850
  }), i.on("styledata", () => {
1850
1851
  h();
1851
1852
  });
1852
- const a = (y) => {
1853
+ const a = (p) => {
1853
1854
  s == null || s({
1854
1855
  type: "mapClick",
1855
- coordinates: [y.lngLat.lng, y.lngLat.lat]
1856
+ coordinates: [p.lngLat.lng, p.lngLat.lat]
1856
1857
  });
1857
1858
  };
1858
- function d(y = !1) {
1859
+ function d(p = !1) {
1859
1860
  if (!t)
1860
1861
  throw new Error();
1861
- const p = document.createElement("div");
1862
- return y && p.classList.add("marker-interactive"), new Ze({
1862
+ const y = document.createElement("div");
1863
+ return p && y.classList.add("marker-interactive"), new Ze({
1863
1864
  props: { displayIn: "maplibre" },
1864
- target: p
1865
- }), new t.Marker({ element: p, offset: [1, -13] });
1865
+ target: y
1866
+ }), new t.Marker({ element: y, offset: [1, -13] });
1866
1867
  }
1867
- function x(y) {
1868
- var p;
1869
- l = y, y && ((p = i.getSource("full-geom")) == null || p.setData(y));
1868
+ function x(p) {
1869
+ var y;
1870
+ l = p, p && ((y = i.getSource("full-geom")) == null || y.setData(p));
1870
1871
  }
1871
1872
  return {
1872
- setEventHandler(y) {
1873
- y ? (s = y, i.on("click", a)) : (s = void 0, i.off("click", a));
1873
+ setEventHandler(p) {
1874
+ p ? (s = p, i.on("click", a)) : (s = void 0, i.off("click", a));
1874
1875
  },
1875
- flyTo(y, p) {
1876
- i.flyTo({ center: y, ...p ? { zoom: p } : {}, ...r });
1876
+ flyTo(p, y) {
1877
+ i.flyTo({ center: p, ...y ? { zoom: y } : {}, ...r });
1877
1878
  },
1878
- fitBounds(y, p, v) {
1879
+ fitBounds(p, y, v) {
1879
1880
  i.fitBounds(
1880
1881
  [
1881
- [y[0], y[1]],
1882
- [y[2], y[3]]
1882
+ [p[0], p[1]],
1883
+ [p[2], p[3]]
1883
1884
  ],
1884
- { padding: p, ...v ? { maxZoom: v } : {}, ...o }
1885
+ { padding: y, ...v ? { maxZoom: v } : {}, ...o }
1885
1886
  );
1886
1887
  },
1887
- indicateReverse(y) {
1888
- i.getCanvasContainer().style.cursor = y ? "crosshair" : "";
1888
+ indicateReverse(p) {
1889
+ i.getCanvasContainer().style.cursor = p ? "crosshair" : "";
1889
1890
  },
1890
- setReverseMarker(y) {
1891
- !t || !e || (g ? y ? g.setLngLat(y) : (g.remove(), g = void 0) : y && (g = (typeof e == "object" ? new t.Marker(e) : d()).setLngLat(y).addTo(i), g.getElement().classList.add("marker-reverse")));
1891
+ setReverseMarker(p) {
1892
+ !t || !e || (g ? p ? g.setLngLat(p) : (g.remove(), g = void 0) : p && (e instanceof Function ? g = e(i) ?? void 0 : (g = (typeof e == "object" ? new t.Marker(e) : d()).setLngLat(p).addTo(i), g.getElement().classList.add("marker-reverse"))));
1892
1893
  },
1893
- setMarkers(y, p) {
1894
- if (e) {
1895
- for (const v of c)
1896
- v.remove();
1897
- if (c.length = 0, x(Tt), !!t) {
1898
- if (p) {
1899
- let v = !1;
1900
- if (p.geometry.type === "GeometryCollection") {
1901
- const E = p.geometry.geometries.filter(
1902
- (w) => w.type === "Polygon" || w.type === "MultiPolygon"
1894
+ setMarkers(p, y) {
1895
+ for (const v of c)
1896
+ v.remove();
1897
+ if (c.length = 0, x(Tt), !!t) {
1898
+ if (y) {
1899
+ let v = !1;
1900
+ if (y.geometry.type === "GeometryCollection") {
1901
+ const m = y.geometry.geometries.filter(
1902
+ (E) => E.type === "Polygon" || E.type === "MultiPolygon"
1903
+ );
1904
+ t: if (m.length > 0) {
1905
+ const E = Yt(
1906
+ V(m.map((w) => X(w)))
1903
1907
  );
1904
- t: if (E.length > 0) {
1905
- const w = Ut(
1906
- Z(E.map((m) => V(m)))
1907
- );
1908
- if (!w)
1909
- break t;
1910
- zt(
1911
- {
1912
- ...p,
1913
- geometry: w.geometry
1914
- },
1915
- x
1916
- ), v = !0;
1917
- } else {
1918
- const w = p.geometry.geometries.filter(
1919
- (m) => m.type === "LineString" || m.type === "MultiLineString"
1920
- );
1921
- w.length > 0 && (x({
1922
- ...p,
1923
- geometry: { type: "GeometryCollection", geometries: w }
1924
- }), v = !0);
1925
- }
1908
+ if (!E)
1909
+ break t;
1910
+ zt(
1911
+ {
1912
+ ...y,
1913
+ geometry: E.geometry
1914
+ },
1915
+ x
1916
+ ), v = !0;
1917
+ } else {
1918
+ const E = y.geometry.geometries.filter(
1919
+ (w) => w.type === "LineString" || w.type === "MultiLineString"
1920
+ );
1921
+ E.length > 0 && (x({
1922
+ ...y,
1923
+ geometry: { type: "GeometryCollection", geometries: E }
1924
+ }), v = !0);
1926
1925
  }
1927
- if (!v) {
1928
- if (p.geometry.type === "Polygon" || p.geometry.type === "MultiPolygon")
1929
- zt(p, x);
1930
- else if (p.geometry.type === "LineString" || p.geometry.type === "MultiLineString") {
1931
- x(p);
1932
- return;
1933
- }
1926
+ }
1927
+ if (!v) {
1928
+ if (y.geometry.type === "Polygon" || y.geometry.type === "MultiPolygon")
1929
+ zt(y, x);
1930
+ else if (y.geometry.type === "LineString" || y.geometry.type === "MultiLineString") {
1931
+ x(y);
1932
+ return;
1934
1933
  }
1935
- e && c.push(
1936
- (typeof e == "object" ? new t.Marker(e) : d()).setLngLat(p.center).addTo(i)
1937
- );
1938
1934
  }
1939
- if (n)
1940
- for (const v of y ?? []) {
1941
- if (v === p)
1935
+ if (e instanceof Function) {
1936
+ const m = e(i, y);
1937
+ m && c.push(m);
1938
+ } else e && c.push(
1939
+ typeof e == "object" ? new t.Marker(e) : d().setLngLat(y.center).addTo(i)
1940
+ );
1941
+ }
1942
+ if (n)
1943
+ for (const v of p ?? []) {
1944
+ if (v === y)
1945
+ continue;
1946
+ let m;
1947
+ if (n instanceof Function) {
1948
+ if (m = n(i, v), !m)
1942
1949
  continue;
1943
- const E = (typeof n == "object" ? new t.Marker(n) : d(!0)).setLngLat(v.center).setPopup(
1950
+ } else
1951
+ m = (typeof n == "object" ? new t.Marker(n) : d(!0)).setLngLat(v.center).setPopup(
1944
1952
  new t.Popup({
1945
1953
  offset: [1, -27],
1946
1954
  closeButton: !1,
@@ -1949,28 +1957,28 @@ function en(i, t, e = !0, n = !0, r = {}, o = {}, u = {
1949
1957
  }).setText(
1950
1958
  v.place_type[0] === "reverse" ? v.place_name : v.place_name.replace(/,.*/, "")
1951
1959
  )
1952
- ).addTo(i), w = E.getElement();
1953
- w.addEventListener("click", (m) => {
1954
- m.stopPropagation(), s == null || s({ type: "markerClick", id: v.id });
1955
- }), w.addEventListener("mouseenter", () => {
1956
- s == null || s({ type: "markerMouseEnter", id: v.id }), E.togglePopup();
1957
- }), w.addEventListener("mouseleave", () => {
1958
- s == null || s({ type: "markerMouseLeave", id: v.id }), E.togglePopup();
1959
- }), c.push(E);
1960
- }
1961
- }
1960
+ ).addTo(i);
1961
+ const E = m.getElement();
1962
+ E.addEventListener("click", (w) => {
1963
+ w.stopPropagation(), s == null || s({ type: "markerClick", id: v.id });
1964
+ }), E.addEventListener("mouseenter", () => {
1965
+ s == null || s({ type: "markerMouseEnter", id: v.id }), m.togglePopup();
1966
+ }), E.addEventListener("mouseleave", () => {
1967
+ s == null || s({ type: "markerMouseLeave", id: v.id }), m.togglePopup();
1968
+ }), c.push(m);
1969
+ }
1962
1970
  }
1963
1971
  },
1964
- setSelectedMarker(y) {
1965
- f && f.getElement().classList.toggle("marker-selected", !1), f = y > -1 ? c[y] : void 0, f == null || f.getElement().classList.toggle("marker-selected", !0);
1972
+ setSelectedMarker(p) {
1973
+ u && u.getElement().classList.toggle("marker-selected", !1), u = p > -1 ? c[p] : void 0, u == null || u.getElement().classList.toggle("marker-selected", !0);
1966
1974
  },
1967
1975
  getCenterAndZoom() {
1968
- const y = i.getCenter();
1969
- return [i.getZoom(), y.lng, y.lat];
1976
+ const p = i.getCenter();
1977
+ return [i.getZoom(), p.lng, p.lat];
1970
1978
  }
1971
1979
  };
1972
1980
  }
1973
1981
  export {
1974
- en as createMapLibreGlMapController
1982
+ nn as createMapLibreGlMapController
1975
1983
  };
1976
1984
  //# sourceMappingURL=maplibregl-controller.js.map