gs-maplibre-draw 0.0.71 → 0.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -81,14 +81,14 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
81
81
  return n && (u.z = a * s[0].z + e * s[1].z), u;
82
82
  }
83
83
  if (o < 4) {
84
- let u = a * a, c = e * e, l, g, d, p = 0;
85
- o === 2 ? (s = [s[0], s[1], s[2], Nt], l = u, g = a * e * 2, d = c) : o === 3 && (l = u * a, g = u * e * 3, d = a * c * 3, p = e * c);
84
+ let u = a * a, c = e * e, l, x, d, p = 0;
85
+ o === 2 ? (s = [s[0], s[1], s[2], Nt], l = u, x = a * e * 2, d = c) : o === 3 && (l = u * a, x = u * e * 3, d = a * c * 3, p = e * c);
86
86
  const z = {
87
- x: l * s[0].x + g * s[1].x + d * s[2].x + p * s[3].x,
88
- y: l * s[0].y + g * s[1].y + d * s[2].y + p * s[3].y,
87
+ x: l * s[0].x + x * s[1].x + d * s[2].x + p * s[3].x,
88
+ y: l * s[0].y + x * s[1].y + d * s[2].y + p * s[3].y,
89
89
  t: e
90
90
  };
91
- return n && (z.z = l * s[0].z + g * s[1].z + d * s[2].z + p * s[3].z), z;
91
+ return n && (z.z = l * s[0].z + x * s[1].z + d * s[2].z + p * s[3].z), z;
92
92
  }
93
93
  const i = JSON.parse(JSON.stringify(r));
94
94
  for (; i.length > 1; ) {
@@ -103,7 +103,7 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
103
103
  },
104
104
  computeWithRatios: function(e, r, n, o) {
105
105
  const a = 1 - e, s = n, i = r;
106
- let u = s[0], c = s[1], l = s[2], g = s[3], d;
106
+ let u = s[0], c = s[1], l = s[2], x = s[3], d;
107
107
  if (u *= a, c *= e, i.length === 2)
108
108
  return d = u + c, {
109
109
  x: (u * i[0].x + c * i[1].x) / d,
@@ -118,11 +118,11 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
118
118
  z: o ? (u * i[0].z + c * i[1].z + l * i[2].z) / d : !1,
119
119
  t: e
120
120
  };
121
- if (u *= a, c *= 1.5 * a, l *= 3 * a, g *= e * e * e, i.length === 4)
122
- return d = u + c + l + g, {
123
- x: (u * i[0].x + c * i[1].x + l * i[2].x + g * i[3].x) / d,
124
- y: (u * i[0].y + c * i[1].y + l * i[2].y + g * i[3].y) / d,
125
- z: o ? (u * i[0].z + c * i[1].z + l * i[2].z + g * i[3].z) / d : !1,
121
+ if (u *= a, c *= 1.5 * a, l *= 3 * a, x *= e * e * e, i.length === 4)
122
+ return d = u + c + l + x, {
123
+ x: (u * i[0].x + c * i[1].x + l * i[2].x + x * i[3].x) / d,
124
+ y: (u * i[0].y + c * i[1].y + l * i[2].y + x * i[3].y) / d,
125
+ z: o ? (u * i[0].z + c * i[1].z + l * i[2].z + x * i[3].z) / d : !1,
126
126
  t: e
127
127
  };
128
128
  },
@@ -213,12 +213,12 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
213
213
  return n / o;
214
214
  },
215
215
  lli8: function(e, r, n, o, a, s, i, u) {
216
- const c = (e * o - r * n) * (a - i) - (e - n) * (a * u - s * i), l = (e * o - r * n) * (s - u) - (r - o) * (a * u - s * i), g = (e - n) * (s - u) - (r - o) * (a - i);
217
- return g == 0 ? !1 : { x: c / g, y: l / g };
216
+ const c = (e * o - r * n) * (a - i) - (e - n) * (a * u - s * i), l = (e * o - r * n) * (s - u) - (r - o) * (a * u - s * i), x = (e - n) * (s - u) - (r - o) * (a - i);
217
+ return x == 0 ? !1 : { x: c / x, y: l / x };
218
218
  },
219
219
  lli4: function(e, r, n, o) {
220
- const a = e.x, s = e.y, i = r.x, u = r.y, c = n.x, l = n.y, g = o.x, d = o.y;
221
- return L.lli8(a, s, i, u, c, l, g, d);
220
+ const a = e.x, s = e.y, i = r.x, u = r.y, c = n.x, l = n.y, x = o.x, d = o.y;
221
+ return L.lli8(a, s, i, u, c, l, x, d);
222
222
  },
223
223
  lli: function(e, r) {
224
224
  return L.lli4(e, e.c, r, r.c);
@@ -244,15 +244,13 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
244
244
  };
245
245
  },
246
246
  shapeintersections: function(e, r, n, o, a) {
247
- if (!L.bboxoverlap(r, o))
248
- return [];
247
+ if (!L.bboxoverlap(r, o)) return [];
249
248
  const s = [], i = [e.startcap, e.forward, e.back, e.endcap], u = [n.startcap, n.forward, n.back, n.endcap];
250
249
  return i.forEach(function(c) {
251
250
  c.virtual || u.forEach(function(l) {
252
- if (l.virtual)
253
- return;
254
- const g = c.intersects(l, a);
255
- g.length > 0 && (g.c1 = c, g.c2 = l, g.s1 = e, g.s2 = n, s.push(g));
251
+ if (l.virtual) return;
252
+ const x = c.intersects(l, a);
253
+ x.length > 0 && (x.c1 = c, x.c2 = l, x.s1 = e, x.s2 = n, s.push(x));
256
254
  });
257
255
  }), s;
258
256
  },
@@ -275,8 +273,7 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
275
273
  }, u;
276
274
  },
277
275
  getminmax: function(e, r, n) {
278
- if (!n)
279
- return { min: 0, max: 0 };
276
+ if (!n) return { min: 0, max: 0 };
280
277
  let o = Qe, a = Ve, s, i;
281
278
  n.indexOf(0) === -1 && (n = [0].concat(n)), n.indexOf(1) === -1 && n.push(1);
282
279
  for (let u = 0, c = n.length; u < c; u++)
@@ -298,34 +295,34 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
298
295
  return 0 <= v && v <= 1;
299
296
  };
300
297
  if (n === 2) {
301
- const v = o[0].y, M = o[1].y, S = o[2].y, D = v - 2 * M + S;
298
+ const v = o[0].y, M = o[1].y, _ = o[2].y, D = v - 2 * M + _;
302
299
  if (D !== 0) {
303
- const A = -me(M * M - v * S), Y = -v + M, R = -(A + Y) / D, q = -(-A + Y) / D;
300
+ const A = -me(M * M - v * _), Y = -v + M, R = -(A + Y) / D, q = -(-A + Y) / D;
304
301
  return [R, q].filter(a);
305
- } else if (M !== S && D === 0)
306
- return [(2 * M - S) / (2 * M - 2 * S)].filter(a);
302
+ } else if (M !== _ && D === 0)
303
+ return [(2 * M - _) / (2 * M - 2 * _)].filter(a);
307
304
  return [];
308
305
  }
309
306
  const s = o[0].y, i = o[1].y, u = o[2].y, c = o[3].y;
310
- let l = -s + 3 * i - 3 * u + c, g = 3 * s - 6 * i + 3 * u, d = -3 * s + 3 * i, p = s;
307
+ let l = -s + 3 * i - 3 * u + c, x = 3 * s - 6 * i + 3 * u, d = -3 * s + 3 * i, p = s;
311
308
  if (L.approximately(l, 0)) {
312
- if (L.approximately(g, 0))
309
+ if (L.approximately(x, 0))
313
310
  return L.approximately(d, 0) ? [] : [-p / d].filter(a);
314
- const v = me(d * d - 4 * g * p), M = 2 * g;
311
+ const v = me(d * d - 4 * x * p), M = 2 * x;
315
312
  return [(v - d) / M, (-d - v) / M].filter(a);
316
313
  }
317
- g /= l, d /= l, p /= l;
318
- const z = (3 * d - g * g) / 3, m = z / 3, b = (2 * g * g * g - 9 * g * d + 27 * p) / 27, F = b / 2, X = F * F + m * m * m;
319
- let f, h, y, x, _;
314
+ x /= l, d /= l, p /= l;
315
+ const z = (3 * d - x * x) / 3, m = z / 3, b = (2 * x * x * x - 9 * x * d + 27 * p) / 27, F = b / 2, X = F * F + m * m * m;
316
+ let f, h, y, g, S;
320
317
  if (X < 0) {
321
- const v = -z / 3, M = v * v * v, S = me(M), D = -b / (2 * S), A = D < -1 ? -1 : D > 1 ? 1 : D, Y = Bt(A), R = Ye(S), q = 2 * R;
322
- return y = q * ge(Y / 3) - g / 3, x = q * ge((Y + Ge) / 3) - g / 3, _ = q * ge((Y + 2 * Ge) / 3) - g / 3, [y, x, _].filter(a);
318
+ const v = -z / 3, M = v * v * v, _ = me(M), D = -b / (2 * _), A = D < -1 ? -1 : D > 1 ? 1 : D, Y = Bt(A), R = Ye(_), q = 2 * R;
319
+ return y = q * ge(Y / 3) - x / 3, g = q * ge((Y + Ge) / 3) - x / 3, S = q * ge((Y + 2 * Ge) / 3) - x / 3, [y, g, S].filter(a);
323
320
  } else {
324
321
  if (X === 0)
325
- return f = F < 0 ? Ye(-F) : -Ye(F), y = 2 * f - g / 3, x = -f - g / 3, [y, x].filter(a);
322
+ return f = F < 0 ? Ye(-F) : -Ye(F), y = 2 * f - x / 3, g = -f - x / 3, [y, g].filter(a);
326
323
  {
327
324
  const v = me(X);
328
- return f = Ye(-F + v), h = Ye(F + v), [f - h - g / 3].filter(a);
325
+ return f = Ye(-F + v), h = Ye(F + v), [f - h - x / 3].filter(a);
329
326
  }
330
327
  }
331
328
  },
@@ -346,37 +343,33 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
346
343
  return [];
347
344
  },
348
345
  curvature: function(e, r, n, o, a) {
349
- let s, i, u, c, l = 0, g = 0;
346
+ let s, i, u, c, l = 0, x = 0;
350
347
  const d = L.compute(e, r), p = L.compute(e, n), z = d.x * d.x + d.y * d.y;
351
348
  if (o ? (s = me(
352
349
  he(d.y * p.z - p.y * d.z, 2) + he(d.z * p.x - p.z * d.x, 2) + he(d.x * p.y - p.x * d.y, 2)
353
350
  ), i = he(z + d.z * d.z, 3 / 2)) : (s = d.x * p.y - d.y * p.x, i = he(z, 3 / 2)), s === 0 || i === 0)
354
351
  return { k: 0, r: 0 };
355
- if (l = s / i, g = i / s, !a) {
352
+ if (l = s / i, x = i / s, !a) {
356
353
  const m = L.curvature(e - 1e-3, r, n, o, !0).k, b = L.curvature(e + 1e-3, r, n, o, !0).k;
357
354
  c = (b - l + (l - m)) / 2, u = (Ae(b - l) + Ae(l - m)) / 2;
358
355
  }
359
- return { k: l, r: g, dk: c, adk: u };
356
+ return { k: l, r: x, dk: c, adk: u };
360
357
  },
361
358
  inflections: function(e) {
362
- if (e.length < 4)
363
- return [];
359
+ if (e.length < 4) return [];
364
360
  const r = L.align(e, { p1: e[0], p2: e.slice(-1)[0] }), n = r[2].x * r[1].y, o = r[3].x * r[1].y, a = r[1].x * r[2].y, s = r[3].x * r[2].y, i = 18 * (-3 * n + 2 * o + 3 * a - s), u = 18 * (3 * n - o - 3 * a), c = 18 * (a - n);
365
361
  if (L.approximately(i, 0)) {
366
362
  if (!L.approximately(u, 0)) {
367
363
  let p = -c / u;
368
- if (0 <= p && p <= 1)
369
- return [p];
364
+ if (0 <= p && p <= 1) return [p];
370
365
  }
371
366
  return [];
372
367
  }
373
368
  const l = 2 * i;
374
- if (L.approximately(l, 0))
375
- return [];
376
- const g = u * u - 4 * i * c;
377
- if (g < 0)
378
- return [];
379
- const d = Math.sqrt(g);
369
+ if (L.approximately(l, 0)) return [];
370
+ const x = u * u - 4 * i * c;
371
+ if (x < 0) return [];
372
+ const d = Math.sqrt(x);
380
373
  return [(d - u) / l, -(u + d) / l].filter(function(p) {
381
374
  return 0 <= p && p <= 1;
382
375
  });
@@ -384,8 +377,7 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
384
377
  bboxoverlap: function(e, r) {
385
378
  const n = ["x", "y"], o = n.length;
386
379
  for (let a = 0, s, i, u, c; a < o; a++)
387
- if (s = n[a], i = e[s].mid, u = r[s].mid, c = (e[s].size + r[s].size) / 2, Ae(i - u) >= c)
388
- return !1;
380
+ if (s = n[a], i = e[s].mid, u = r[s].mid, c = (e[s].size + r[s].size) / 2, Ae(i - u) >= c) return !1;
389
381
  return !0;
390
382
  },
391
383
  expandbox: function(e, r) {
@@ -406,25 +398,25 @@ const Lt = Math.PI, Ge = 2 * Lt, ve = Lt / 2, qt = 1e-6, Qe = Number.MAX_SAFE_IN
406
398
  l = l.filter(function(d) {
407
399
  return L.bboxoverlap(d.left.bbox(), d.right.bbox());
408
400
  });
409
- let g = [];
401
+ let x = [];
410
402
  return l.length === 0 || (l.forEach(function(d) {
411
- g = g.concat(
403
+ x = x.concat(
412
404
  L.pairiteration(d.left, d.right, i)
413
405
  );
414
- }), g = g.filter(function(d, p) {
415
- return g.indexOf(d) === p;
416
- })), g;
406
+ }), x = x.filter(function(d, p) {
407
+ return x.indexOf(d) === p;
408
+ })), x;
417
409
  },
418
410
  getccenter: function(e, r, n) {
419
- const o = r.x - e.x, a = r.y - e.y, s = n.x - r.x, i = n.y - r.y, u = o * ge(ve) - a * be(ve), c = o * be(ve) + a * ge(ve), l = s * ge(ve) - i * be(ve), g = s * be(ve) + i * ge(ve), d = (e.x + r.x) / 2, p = (e.y + r.y) / 2, z = (r.x + n.x) / 2, m = (r.y + n.y) / 2, b = d + u, F = p + c, X = z + l, f = m + g, h = L.lli8(d, p, b, F, z, m, X, f), y = L.dist(h, e);
420
- let x = Xe(e.y - h.y, e.x - h.x), _ = Xe(r.y - h.y, r.x - h.x), v = Xe(n.y - h.y, n.x - h.x), M;
421
- return x < v ? ((x > _ || _ > v) && (x += Ge), x > v && (M = v, v = x, x = M)) : v < _ && _ < x ? (M = v, v = x, x = M) : v += Ge, h.s = x, h.e = v, h.r = y, h;
411
+ const o = r.x - e.x, a = r.y - e.y, s = n.x - r.x, i = n.y - r.y, u = o * ge(ve) - a * be(ve), c = o * be(ve) + a * ge(ve), l = s * ge(ve) - i * be(ve), x = s * be(ve) + i * ge(ve), d = (e.x + r.x) / 2, p = (e.y + r.y) / 2, z = (r.x + n.x) / 2, m = (r.y + n.y) / 2, b = d + u, F = p + c, X = z + l, f = m + x, h = L.lli8(d, p, b, F, z, m, X, f), y = L.dist(h, e);
412
+ let g = Xe(e.y - h.y, e.x - h.x), S = Xe(r.y - h.y, r.x - h.x), v = Xe(n.y - h.y, n.x - h.x), M;
413
+ return g < v ? ((g > S || S > v) && (g += Ge), g > v && (M = v, v = g, g = M)) : v < S && S < g ? (M = v, v = g, g = M) : v += Ge, h.s = g, h.e = v, h.r = y, h;
422
414
  },
423
415
  numberSort: function(e, r) {
424
416
  return e - r;
425
417
  }
426
418
  };
427
- class Oe {
419
+ class Ie {
428
420
  constructor(r) {
429
421
  this.curves = [], this._3d = !1, r && (this.curves = r, this._3d = this.curves[0]._3d);
430
422
  }
@@ -459,7 +451,7 @@ class Oe {
459
451
  const n = [];
460
452
  return this.curves.forEach(function(o) {
461
453
  n.push(...o.offset(r));
462
- }), new Oe(n);
454
+ }), new Ie(n);
463
455
  }
464
456
  }
465
457
  const { abs: Ce, min: dt, max: gt, cos: Tt, sin: Gt, acos: $t, sqrt: Fe } = Math, Ut = Math.PI;
@@ -497,8 +489,8 @@ class j {
497
489
  };
498
490
  i && (c.z = n[z + 2]), u.push(c);
499
491
  }
500
- const l = this.order = u.length - 1, g = this.dims = ["x", "y"];
501
- i && g.push("z"), this.dimlen = g.length;
492
+ const l = this.order = u.length - 1, x = this.dims = ["x", "y"];
493
+ i && x.push("z"), this.dimlen = x.length;
502
494
  const d = L.align(u, { p1: u[0], p2: u[l] }), p = L.dist(u[0], u[l]);
503
495
  this._linear = d.reduce((z, m) => z + Ce(m.y), 0) < p / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update();
504
496
  }
@@ -514,11 +506,11 @@ class j {
514
506
  typeof a > "u" && (a = 0.5);
515
507
  const i = j.getABC(3, r, n, o, a);
516
508
  typeof s > "u" && (s = L.dist(n, i.C));
517
- const u = s * (1 - a) / a, c = L.dist(r, o), l = (o.x - r.x) / c, g = (o.y - r.y) / c, d = s * l, p = s * g, z = u * l, m = u * g, b = { x: n.x - d, y: n.y - p }, F = { x: n.x + z, y: n.y + m }, X = i.A, f = { x: X.x + (b.x - X.x) / (1 - a), y: X.y + (b.y - X.y) / (1 - a) }, h = { x: X.x + (F.x - X.x) / a, y: X.y + (F.y - X.y) / a }, y = { x: r.x + (f.x - r.x) / a, y: r.y + (f.y - r.y) / a }, x = {
509
+ const u = s * (1 - a) / a, c = L.dist(r, o), l = (o.x - r.x) / c, x = (o.y - r.y) / c, d = s * l, p = s * x, z = u * l, m = u * x, b = { x: n.x - d, y: n.y - p }, F = { x: n.x + z, y: n.y + m }, X = i.A, f = { x: X.x + (b.x - X.x) / (1 - a), y: X.y + (b.y - X.y) / (1 - a) }, h = { x: X.x + (F.x - X.x) / a, y: X.y + (F.y - X.y) / a }, y = { x: r.x + (f.x - r.x) / a, y: r.y + (f.y - r.y) / a }, g = {
518
510
  x: o.x + (h.x - o.x) / (1 - a),
519
511
  y: o.y + (h.y - o.y) / (1 - a)
520
512
  };
521
- return new j(r, y, x, o);
513
+ return new j(r, y, g, o);
522
514
  }
523
515
  static getUtils() {
524
516
  return L;
@@ -527,7 +519,7 @@ class j {
527
519
  return j.getUtils();
528
520
  }
529
521
  static get PolyBezier() {
530
- return Oe;
522
+ return Ie;
531
523
  }
532
524
  valueOf() {
533
525
  return this.toString();
@@ -536,8 +528,7 @@ class j {
536
528
  return L.pointsToString(this.points);
537
529
  }
538
530
  toSVG() {
539
- if (this._3d)
540
- return !1;
531
+ if (this._3d) return !1;
541
532
  const r = this.points, n = r[0].x, o = r[0].y, a = ["M", n, o, this.order === 2 ? "Q" : "C"];
542
533
  for (let s = 1, i = r.length; s < i; s++)
543
534
  a.push(r[s].x), a.push(r[s].y);
@@ -599,10 +590,10 @@ class j {
599
590
  }
600
591
  project(r) {
601
592
  const n = this.getLUT(), o = n.length - 1, a = L.closest(n, r), s = a.mpos, i = (s - 1) / o, u = (s + 1) / o, c = 0.1 / o;
602
- let l = a.mdist, g = i, d = g, p;
593
+ let l = a.mdist, x = i, d = x, p;
603
594
  l += 1;
604
- for (let z; g < u + c; g += c)
605
- p = this.compute(g), z = L.dist(r, p), z < l && (l = z, d = g);
595
+ for (let z; x < u + c; x += c)
596
+ p = this.compute(x), z = L.dist(r, p), z < l && (l = z, d = x);
606
597
  return d = d < 0 ? 0 : d > 1 ? 1 : d, p = this.compute(d), p.t = d, p.d = l, p;
607
598
  }
608
599
  get(r) {
@@ -750,8 +741,7 @@ class j {
750
741
  simple() {
751
742
  if (this.order === 3) {
752
743
  const a = L.angle(this.points[0], this.points[3], this.points[1]), s = L.angle(this.points[0], this.points[3], this.points[2]);
753
- if (a > 0 && s < 0 || a < 0 && s > 0)
754
- return !1;
744
+ if (a > 0 && s < 0 || a < 0 && s > 0) return !1;
755
745
  }
756
746
  const r = this.normal(0), n = this.normal(1);
757
747
  let o = r.x * n.x + r.y * n.y;
@@ -796,8 +786,8 @@ class j {
796
786
  o ? o(0) : r,
797
787
  o ? o(1) : r
798
788
  );
799
- const i = o ? o(0) : r, u = o ? o(1) : r, c = [this.offset(0, 10), this.offset(1, 10)], l = [], g = L.lli4(c[0], c[0].c, c[1], c[1].c);
800
- if (!g)
789
+ const i = o ? o(0) : r, u = o ? o(1) : r, c = [this.offset(0, 10), this.offset(1, 10)], l = [], x = L.lli4(c[0], c[0].c, c[1], c[1].c);
790
+ if (!x)
801
791
  throw new Error("cannot scale this curve. Try reducing it first.");
802
792
  return [0, 1].forEach(function(d) {
803
793
  const p = l[d * n] = L.copy(s[d * n]);
@@ -805,8 +795,8 @@ class j {
805
795
  }), o ? ([0, 1].forEach(function(d) {
806
796
  if (!(n === 2 && d)) {
807
797
  var p = s[d + 1], z = {
808
- x: p.x - g.x,
809
- y: p.y - g.y
798
+ x: p.x - x.x,
799
+ y: p.y - x.y
810
800
  }, m = o ? o((d + 1) / n) : r;
811
801
  o && !a && (m = -m);
812
802
  var b = Fe(z.x * z.x + z.y * z.y);
@@ -816,43 +806,42 @@ class j {
816
806
  };
817
807
  }
818
808
  }), new j(l)) : ([0, 1].forEach((d) => {
819
- if (n === 2 && d)
820
- return;
809
+ if (n === 2 && d) return;
821
810
  const p = l[d * n], z = this.derivative(d), m = { x: p.x + z.x, y: p.y + z.y };
822
- l[d + 1] = L.lli4(p, m, g, s[d + 1]);
811
+ l[d + 1] = L.lli4(p, m, x, s[d + 1]);
823
812
  }), new j(l));
824
813
  }
825
814
  outline(r, n, o, a) {
826
815
  if (n = n === void 0 ? r : n, this._linear) {
827
- const x = this.normal(0), _ = this.points[0], v = this.points[this.points.length - 1];
828
- let M, S, D;
829
- o === void 0 && (o = r, a = n), M = { x: _.x + x.x * r, y: _.y + x.y * r }, D = { x: v.x + x.x * o, y: v.y + x.y * o }, S = { x: (M.x + D.x) / 2, y: (M.y + D.y) / 2 };
830
- const A = [M, S, D];
831
- M = { x: _.x - x.x * n, y: _.y - x.y * n }, D = { x: v.x - x.x * a, y: v.y - x.y * a }, S = { x: (M.x + D.x) / 2, y: (M.y + D.y) / 2 };
832
- const Y = [D, S, M], R = L.makeline(Y[2], A[0]), q = L.makeline(A[2], Y[0]), se = [R, new j(A), q, new j(Y)];
833
- return new Oe(se);
816
+ const g = this.normal(0), S = this.points[0], v = this.points[this.points.length - 1];
817
+ let M, _, D;
818
+ o === void 0 && (o = r, a = n), M = { x: S.x + g.x * r, y: S.y + g.y * r }, D = { x: v.x + g.x * o, y: v.y + g.y * o }, _ = { x: (M.x + D.x) / 2, y: (M.y + D.y) / 2 };
819
+ const A = [M, _, D];
820
+ M = { x: S.x - g.x * n, y: S.y - g.y * n }, D = { x: v.x - g.x * a, y: v.y - g.y * a }, _ = { x: (M.x + D.x) / 2, y: (M.y + D.y) / 2 };
821
+ const Y = [D, _, M], R = L.makeline(Y[2], A[0]), q = L.makeline(A[2], Y[0]), se = [R, new j(A), q, new j(Y)];
822
+ return new Ie(se);
834
823
  }
835
824
  const s = this.reduce(), i = s.length, u = [];
836
- let c = [], l, g = 0, d = this.length();
825
+ let c = [], l, x = 0, d = this.length();
837
826
  const p = typeof o < "u" && typeof a < "u";
838
- function z(x, _, v, M, S) {
827
+ function z(g, S, v, M, _) {
839
828
  return function(D) {
840
- const A = M / v, Y = (M + S) / v, R = _ - x;
841
- return L.map(D, 0, 1, x + A * R, x + Y * R);
829
+ const A = M / v, Y = (M + _) / v, R = S - g;
830
+ return L.map(D, 0, 1, g + A * R, g + Y * R);
842
831
  };
843
832
  }
844
- s.forEach(function(x) {
845
- const _ = x.length();
833
+ s.forEach(function(g) {
834
+ const S = g.length();
846
835
  p ? (u.push(
847
- x.scale(z(r, o, d, g, _))
836
+ g.scale(z(r, o, d, x, S))
848
837
  ), c.push(
849
- x.scale(z(-n, -a, d, g, _))
850
- )) : (u.push(x.scale(r)), c.push(x.scale(-n))), g += _;
851
- }), c = c.map(function(x) {
852
- return l = x.points, l[3] ? x.points = [l[3], l[2], l[1], l[0]] : x.points = [l[2], l[1], l[0]], x;
838
+ g.scale(z(-n, -a, d, x, S))
839
+ )) : (u.push(g.scale(r)), c.push(g.scale(-n))), x += S;
840
+ }), c = c.map(function(g) {
841
+ return l = g.points, l[3] ? g.points = [l[3], l[2], l[1], l[0]] : g.points = [l[2], l[1], l[0]], g;
853
842
  }).reverse();
854
843
  const m = u[0].points[0], b = u[i - 1].points[u[i - 1].points.length - 1], F = c[i - 1].points[c[i - 1].points.length - 1], X = c[0].points[0], f = L.makeline(F, m), h = L.makeline(b, X), y = [f].concat(u).concat([h]).concat(c);
855
- return new Oe(y);
844
+ return new Ie(y);
856
845
  }
857
846
  outlineshapes(r, n, o) {
858
847
  n = n || r;
@@ -908,21 +897,21 @@ class j {
908
897
  return r = r || 0.5, this._iterate(r, []);
909
898
  }
910
899
  _error(r, n, o, a) {
911
- const s = (a - o) / 4, i = this.get(o + s), u = this.get(a - s), c = L.dist(r, n), l = L.dist(r, i), g = L.dist(r, u);
912
- return Ce(l - c) + Ce(g - c);
900
+ const s = (a - o) / 4, i = this.get(o + s), u = this.get(a - s), c = L.dist(r, n), l = L.dist(r, i), x = L.dist(r, u);
901
+ return Ce(l - c) + Ce(x - c);
913
902
  }
914
903
  _iterate(r, n) {
915
904
  let o = 0, a = 1, s;
916
905
  do {
917
906
  s = 0, a = 1;
918
- let i = this.get(o), u, c, l, g, d = !1, p = !1, z, m = a, b = 1;
907
+ let i = this.get(o), u, c, l, x, d = !1, p = !1, z, m = a, b = 1;
919
908
  do
920
- if (p = d, g = l, m = (o + a) / 2, u = this.get(m), c = this.get(a), l = L.getccenter(i, u, c), l.interval = {
909
+ if (p = d, x = l, m = (o + a) / 2, u = this.get(m), c = this.get(a), l = L.getccenter(i, u, c), l.interval = {
921
910
  start: o,
922
911
  end: a
923
912
  }, d = this._error(l, i, o, a) <= r, z = p && !d, z || (b = a), d) {
924
913
  if (a >= 1) {
925
- if (l.interval.end = b = 1, g = l, a > 1) {
914
+ if (l.interval.end = b = 1, x = l, a > 1) {
926
915
  let X = {
927
916
  x: l.x + l.r * Tt(l.e),
928
917
  y: l.y + l.r * Gt(l.e)
@@ -937,7 +926,7 @@ class j {
937
926
  while (!z && s++ < 100);
938
927
  if (s >= 100)
939
928
  break;
940
- g = g || l, n.push(g), o = b;
929
+ x = x || l, n.push(x), o = b;
941
930
  } while (a < 1);
942
931
  return n;
943
932
  }
@@ -1037,14 +1026,14 @@ function xt(e) {
1037
1026
  }
1038
1027
  function Be(e, r, n) {
1039
1028
  if (e !== null)
1040
- for (var o, a, s, i, u, c, l, g = 0, d = 0, p, z = e.type, m = z === "FeatureCollection", b = z === "Feature", F = m ? e.features.length : 1, X = 0; X < F; X++) {
1029
+ for (var o, a, s, i, u, c, l, x = 0, d = 0, p, z = e.type, m = z === "FeatureCollection", b = z === "Feature", F = m ? e.features.length : 1, X = 0; X < F; X++) {
1041
1030
  l = m ? e.features[X].geometry : b ? e.geometry : e, p = l ? l.type === "GeometryCollection" : !1, u = p ? l.geometries.length : 1;
1042
1031
  for (var f = 0; f < u; f++) {
1043
1032
  var h = 0, y = 0;
1044
1033
  if (i = p ? l.geometries[f] : l, i !== null) {
1045
1034
  c = i.coordinates;
1046
- var x = i.type;
1047
- switch (g = n && (x === "Polygon" || x === "MultiPolygon") ? 1 : 0, x) {
1035
+ var g = i.type;
1036
+ switch (x = n && (g === "Polygon" || g === "MultiPolygon") ? 1 : 0, g) {
1048
1037
  case null:
1049
1038
  break;
1050
1039
  case "Point":
@@ -1069,14 +1058,14 @@ function Be(e, r, n) {
1069
1058
  y
1070
1059
  ) === !1)
1071
1060
  return !1;
1072
- d++, x === "MultiPoint" && h++;
1061
+ d++, g === "MultiPoint" && h++;
1073
1062
  }
1074
- x === "LineString" && h++;
1063
+ g === "LineString" && h++;
1075
1064
  break;
1076
1065
  case "Polygon":
1077
1066
  case "MultiLineString":
1078
1067
  for (o = 0; o < c.length; o++) {
1079
- for (a = 0; a < c[o].length - g; a++) {
1068
+ for (a = 0; a < c[o].length - x; a++) {
1080
1069
  if (r(
1081
1070
  c[o][a],
1082
1071
  d,
@@ -1087,14 +1076,14 @@ function Be(e, r, n) {
1087
1076
  return !1;
1088
1077
  d++;
1089
1078
  }
1090
- x === "MultiLineString" && h++, x === "Polygon" && y++;
1079
+ g === "MultiLineString" && h++, g === "Polygon" && y++;
1091
1080
  }
1092
- x === "Polygon" && h++;
1081
+ g === "Polygon" && h++;
1093
1082
  break;
1094
1083
  case "MultiPolygon":
1095
1084
  for (o = 0; o < c.length; o++) {
1096
1085
  for (y = 0, a = 0; a < c[o].length; a++) {
1097
- for (s = 0; s < c[o][a].length - g; s++) {
1086
+ for (s = 0; s < c[o][a].length - x; s++) {
1098
1087
  if (r(
1099
1088
  c[o][a][s],
1100
1089
  d,
@@ -1123,15 +1112,15 @@ function Be(e, r, n) {
1123
1112
  }
1124
1113
  }
1125
1114
  function jt(e, r) {
1126
- var n, o, a, s, i, u, c, l, g, d, p = 0, z = e.type === "FeatureCollection", m = e.type === "Feature", b = z ? e.features.length : 1;
1115
+ var n, o, a, s, i, u, c, l, x, d, p = 0, z = e.type === "FeatureCollection", m = e.type === "Feature", b = z ? e.features.length : 1;
1127
1116
  for (n = 0; n < b; n++) {
1128
- for (u = z ? e.features[n].geometry : m ? e.geometry : e, l = z ? e.features[n].properties : m ? e.properties : {}, g = z ? e.features[n].bbox : m ? e.bbox : void 0, d = z ? e.features[n].id : m ? e.id : void 0, c = u ? u.type === "GeometryCollection" : !1, i = c ? u.geometries.length : 1, a = 0; a < i; a++) {
1117
+ for (u = z ? e.features[n].geometry : m ? e.geometry : e, l = z ? e.features[n].properties : m ? e.properties : {}, x = z ? e.features[n].bbox : m ? e.bbox : void 0, d = z ? e.features[n].id : m ? e.id : void 0, c = u ? u.type === "GeometryCollection" : !1, i = c ? u.geometries.length : 1, a = 0; a < i; a++) {
1129
1118
  if (s = c ? u.geometries[a] : u, s === null) {
1130
1119
  if (r(
1131
1120
  null,
1132
1121
  p,
1133
1122
  l,
1134
- g,
1123
+ x,
1135
1124
  d
1136
1125
  ) === !1)
1137
1126
  return !1;
@@ -1148,7 +1137,7 @@ function jt(e, r) {
1148
1137
  s,
1149
1138
  p,
1150
1139
  l,
1151
- g,
1140
+ x,
1152
1141
  d
1153
1142
  ) === !1)
1154
1143
  return !1;
@@ -1160,7 +1149,7 @@ function jt(e, r) {
1160
1149
  s.geometries[o],
1161
1150
  p,
1162
1151
  l,
1163
- g,
1152
+ x,
1164
1153
  d
1165
1154
  ) === !1)
1166
1155
  return !1;
@@ -1220,16 +1209,14 @@ function Kt(e) {
1220
1209
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1221
1210
  }
1222
1211
  function Wt(e) {
1223
- if (e.__esModule)
1224
- return e;
1212
+ if (e.__esModule) return e;
1225
1213
  var r = e.default;
1226
1214
  if (typeof r == "function") {
1227
1215
  var n = function o() {
1228
1216
  return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
1229
1217
  };
1230
1218
  n.prototype = r.prototype;
1231
- } else
1232
- n = {};
1219
+ } else n = {};
1233
1220
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
1234
1221
  var a = Object.getOwnPropertyDescriptor(e, o);
1235
1222
  Object.defineProperty(n, o, a.get ? a : {
@@ -1245,27 +1232,25 @@ var lt = { exports: {} }, Dt = { exports: {} };
1245
1232
  (function(n, o) {
1246
1233
  e.exports = o();
1247
1234
  })(bt, function() {
1248
- function n(f, h, y, x, _) {
1249
- (function v(M, S, D, A, Y) {
1235
+ function n(f, h, y, g, S) {
1236
+ (function v(M, _, D, A, Y) {
1250
1237
  for (; A > D; ) {
1251
1238
  if (A - D > 600) {
1252
- var R = A - D + 1, q = S - D + 1, se = Math.log(R), H = 0.5 * Math.exp(2 * se / 3), K = 0.5 * Math.sqrt(se * H * (R - H) / R) * (q - R / 2 < 0 ? -1 : 1), W = Math.max(D, Math.floor(S - q * H / R + K)), Q = Math.min(A, Math.floor(S + (R - q) * H / R + K));
1253
- v(M, S, W, Q, Y);
1239
+ var R = A - D + 1, q = _ - D + 1, se = Math.log(R), H = 0.5 * Math.exp(2 * se / 3), K = 0.5 * Math.sqrt(se * H * (R - H) / R) * (q - R / 2 < 0 ? -1 : 1), W = Math.max(D, Math.floor(_ - q * H / R + K)), Q = Math.min(A, Math.floor(_ + (R - q) * H / R + K));
1240
+ v(M, _, W, Q, Y);
1254
1241
  }
1255
- var k = M[S], I = D, w = A;
1256
- for (o(M, D, S), Y(M[A], k) > 0 && o(M, D, A); I < w; ) {
1257
- for (o(M, I, w), I++, w--; Y(M[I], k) < 0; )
1258
- I++;
1259
- for (; Y(M[w], k) > 0; )
1260
- w--;
1242
+ var k = M[_], O = D, w = A;
1243
+ for (o(M, D, _), Y(M[A], k) > 0 && o(M, D, A); O < w; ) {
1244
+ for (o(M, O, w), O++, w--; Y(M[O], k) < 0; ) O++;
1245
+ for (; Y(M[w], k) > 0; ) w--;
1261
1246
  }
1262
- Y(M[D], k) === 0 ? o(M, D, w) : o(M, ++w, A), w <= S && (D = w + 1), S <= w && (A = w - 1);
1247
+ Y(M[D], k) === 0 ? o(M, D, w) : o(M, ++w, A), w <= _ && (D = w + 1), _ <= w && (A = w - 1);
1263
1248
  }
1264
- })(f, h, y || 0, x || f.length - 1, _ || a);
1249
+ })(f, h, y || 0, g || f.length - 1, S || a);
1265
1250
  }
1266
1251
  function o(f, h, y) {
1267
- var x = f[h];
1268
- f[h] = f[y], f[y] = x;
1252
+ var g = f[h];
1253
+ f[h] = f[y], f[y] = g;
1269
1254
  }
1270
1255
  function a(f, h) {
1271
1256
  return f < h ? -1 : f > h ? 1 : 0;
@@ -1274,28 +1259,25 @@ var lt = { exports: {} }, Dt = { exports: {} };
1274
1259
  f === void 0 && (f = 9), this._maxEntries = Math.max(4, f), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
1275
1260
  };
1276
1261
  function i(f, h, y) {
1277
- if (!y)
1278
- return h.indexOf(f);
1279
- for (var x = 0; x < h.length; x++)
1280
- if (y(f, h[x]))
1281
- return x;
1262
+ if (!y) return h.indexOf(f);
1263
+ for (var g = 0; g < h.length; g++) if (y(f, h[g])) return g;
1282
1264
  return -1;
1283
1265
  }
1284
1266
  function u(f, h) {
1285
1267
  c(f, 0, f.children.length, h, f);
1286
1268
  }
1287
- function c(f, h, y, x, _) {
1288
- _ || (_ = F(null)), _.minX = 1 / 0, _.minY = 1 / 0, _.maxX = -1 / 0, _.maxY = -1 / 0;
1269
+ function c(f, h, y, g, S) {
1270
+ S || (S = F(null)), S.minX = 1 / 0, S.minY = 1 / 0, S.maxX = -1 / 0, S.maxY = -1 / 0;
1289
1271
  for (var v = h; v < y; v++) {
1290
1272
  var M = f.children[v];
1291
- l(_, f.leaf ? x(M) : M);
1273
+ l(S, f.leaf ? g(M) : M);
1292
1274
  }
1293
- return _;
1275
+ return S;
1294
1276
  }
1295
1277
  function l(f, h) {
1296
1278
  return f.minX = Math.min(f.minX, h.minX), f.minY = Math.min(f.minY, h.minY), f.maxX = Math.max(f.maxX, h.maxX), f.maxY = Math.max(f.maxY, h.maxY), f;
1297
1279
  }
1298
- function g(f, h) {
1280
+ function x(f, h) {
1299
1281
  return f.minX - h.minX;
1300
1282
  }
1301
1283
  function d(f, h) {
@@ -1316,79 +1298,68 @@ var lt = { exports: {} }, Dt = { exports: {} };
1316
1298
  function F(f) {
1317
1299
  return { children: f, height: 1, leaf: !0, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
1318
1300
  }
1319
- function X(f, h, y, x, _) {
1320
- for (var v = [h, y]; v.length; )
1321
- if (!((y = v.pop()) - (h = v.pop()) <= x)) {
1322
- var M = h + Math.ceil((y - h) / x / 2) * x;
1323
- n(f, M, h, y, _), v.push(h, M, M, y);
1324
- }
1301
+ function X(f, h, y, g, S) {
1302
+ for (var v = [h, y]; v.length; ) if (!((y = v.pop()) - (h = v.pop()) <= g)) {
1303
+ var M = h + Math.ceil((y - h) / g / 2) * g;
1304
+ n(f, M, h, y, S), v.push(h, M, M, y);
1305
+ }
1325
1306
  }
1326
1307
  return s.prototype.all = function() {
1327
1308
  return this._all(this.data, []);
1328
1309
  }, s.prototype.search = function(f) {
1329
1310
  var h = this.data, y = [];
1330
- if (!b(f, h))
1331
- return y;
1332
- for (var x = this.toBBox, _ = []; h; ) {
1311
+ if (!b(f, h)) return y;
1312
+ for (var g = this.toBBox, S = []; h; ) {
1333
1313
  for (var v = 0; v < h.children.length; v++) {
1334
- var M = h.children[v], S = h.leaf ? x(M) : M;
1335
- b(f, S) && (h.leaf ? y.push(M) : m(f, S) ? this._all(M, y) : _.push(M));
1314
+ var M = h.children[v], _ = h.leaf ? g(M) : M;
1315
+ b(f, _) && (h.leaf ? y.push(M) : m(f, _) ? this._all(M, y) : S.push(M));
1336
1316
  }
1337
- h = _.pop();
1317
+ h = S.pop();
1338
1318
  }
1339
1319
  return y;
1340
1320
  }, s.prototype.collides = function(f) {
1341
1321
  var h = this.data;
1342
- if (!b(f, h))
1343
- return !1;
1322
+ if (!b(f, h)) return !1;
1344
1323
  for (var y = []; h; ) {
1345
- for (var x = 0; x < h.children.length; x++) {
1346
- var _ = h.children[x], v = h.leaf ? this.toBBox(_) : _;
1324
+ for (var g = 0; g < h.children.length; g++) {
1325
+ var S = h.children[g], v = h.leaf ? this.toBBox(S) : S;
1347
1326
  if (b(f, v)) {
1348
- if (h.leaf || m(f, v))
1349
- return !0;
1350
- y.push(_);
1327
+ if (h.leaf || m(f, v)) return !0;
1328
+ y.push(S);
1351
1329
  }
1352
1330
  }
1353
1331
  h = y.pop();
1354
1332
  }
1355
1333
  return !1;
1356
1334
  }, s.prototype.load = function(f) {
1357
- if (!f || !f.length)
1358
- return this;
1335
+ if (!f || !f.length) return this;
1359
1336
  if (f.length < this._minEntries) {
1360
- for (var h = 0; h < f.length; h++)
1361
- this.insert(f[h]);
1337
+ for (var h = 0; h < f.length; h++) this.insert(f[h]);
1362
1338
  return this;
1363
1339
  }
1364
1340
  var y = this._build(f.slice(), 0, f.length - 1, 0);
1365
- if (this.data.children.length)
1366
- if (this.data.height === y.height)
1367
- this._splitRoot(this.data, y);
1368
- else {
1369
- if (this.data.height < y.height) {
1370
- var x = this.data;
1371
- this.data = y, y = x;
1372
- }
1373
- this._insert(y, this.data.height - y.height - 1, !0);
1341
+ if (this.data.children.length) if (this.data.height === y.height) this._splitRoot(this.data, y);
1342
+ else {
1343
+ if (this.data.height < y.height) {
1344
+ var g = this.data;
1345
+ this.data = y, y = g;
1374
1346
  }
1375
- else
1376
- this.data = y;
1347
+ this._insert(y, this.data.height - y.height - 1, !0);
1348
+ }
1349
+ else this.data = y;
1377
1350
  return this;
1378
1351
  }, s.prototype.insert = function(f) {
1379
1352
  return f && this._insert(f, this.data.height - 1), this;
1380
1353
  }, s.prototype.clear = function() {
1381
1354
  return this.data = F([]), this;
1382
1355
  }, s.prototype.remove = function(f, h) {
1383
- if (!f)
1384
- return this;
1385
- for (var y, x, _, v = this.data, M = this.toBBox(f), S = [], D = []; v || S.length; ) {
1386
- if (v || (v = S.pop(), x = S[S.length - 1], y = D.pop(), _ = !0), v.leaf) {
1356
+ if (!f) return this;
1357
+ for (var y, g, S, v = this.data, M = this.toBBox(f), _ = [], D = []; v || _.length; ) {
1358
+ if (v || (v = _.pop(), g = _[_.length - 1], y = D.pop(), S = !0), v.leaf) {
1387
1359
  var A = i(f, v.children, h);
1388
- if (A !== -1)
1389
- return v.children.splice(A, 1), S.push(v), this._condense(S), this;
1360
+ if (A !== -1) return v.children.splice(A, 1), _.push(v), this._condense(_), this;
1390
1361
  }
1391
- _ || v.leaf || !m(v, M) ? x ? (y++, v = x.children[y], _ = !1) : v = null : (S.push(v), D.push(y), y = 0, x = v, v = v.children[0]);
1362
+ S || v.leaf || !m(v, M) ? g ? (y++, v = g.children[y], S = !1) : v = null : (_.push(v), D.push(y), y = 0, g = v, v = v.children[0]);
1392
1363
  }
1393
1364
  return this;
1394
1365
  }, s.prototype.toBBox = function(f) {
@@ -1402,73 +1373,68 @@ var lt = { exports: {} }, Dt = { exports: {} };
1402
1373
  }, s.prototype.fromJSON = function(f) {
1403
1374
  return this.data = f, this;
1404
1375
  }, s.prototype._all = function(f, h) {
1405
- for (var y = []; f; )
1406
- f.leaf ? h.push.apply(h, f.children) : y.push.apply(y, f.children), f = y.pop();
1376
+ for (var y = []; f; ) f.leaf ? h.push.apply(h, f.children) : y.push.apply(y, f.children), f = y.pop();
1407
1377
  return h;
1408
- }, s.prototype._build = function(f, h, y, x) {
1409
- var _, v = y - h + 1, M = this._maxEntries;
1410
- if (v <= M)
1411
- return u(_ = F(f.slice(h, y + 1)), this.toBBox), _;
1412
- x || (x = Math.ceil(Math.log(v) / Math.log(M)), M = Math.ceil(v / Math.pow(M, x - 1))), (_ = F([])).leaf = !1, _.height = x;
1413
- var S = Math.ceil(v / M), D = S * Math.ceil(Math.sqrt(M));
1378
+ }, s.prototype._build = function(f, h, y, g) {
1379
+ var S, v = y - h + 1, M = this._maxEntries;
1380
+ if (v <= M) return u(S = F(f.slice(h, y + 1)), this.toBBox), S;
1381
+ g || (g = Math.ceil(Math.log(v) / Math.log(M)), M = Math.ceil(v / Math.pow(M, g - 1))), (S = F([])).leaf = !1, S.height = g;
1382
+ var _ = Math.ceil(v / M), D = _ * Math.ceil(Math.sqrt(M));
1414
1383
  X(f, h, y, D, this.compareMinX);
1415
1384
  for (var A = h; A <= y; A += D) {
1416
1385
  var Y = Math.min(A + D - 1, y);
1417
- X(f, A, Y, S, this.compareMinY);
1418
- for (var R = A; R <= Y; R += S) {
1419
- var q = Math.min(R + S - 1, Y);
1420
- _.children.push(this._build(f, R, q, x - 1));
1386
+ X(f, A, Y, _, this.compareMinY);
1387
+ for (var R = A; R <= Y; R += _) {
1388
+ var q = Math.min(R + _ - 1, Y);
1389
+ S.children.push(this._build(f, R, q, g - 1));
1421
1390
  }
1422
1391
  }
1423
- return u(_, this.toBBox), _;
1424
- }, s.prototype._chooseSubtree = function(f, h, y, x) {
1425
- for (; x.push(h), !h.leaf && x.length - 1 !== y; ) {
1426
- for (var _ = 1 / 0, v = 1 / 0, M = void 0, S = 0; S < h.children.length; S++) {
1427
- var D = h.children[S], A = p(D), Y = (R = f, q = D, (Math.max(q.maxX, R.maxX) - Math.min(q.minX, R.minX)) * (Math.max(q.maxY, R.maxY) - Math.min(q.minY, R.minY)) - A);
1428
- Y < v ? (v = Y, _ = A < _ ? A : _, M = D) : Y === v && A < _ && (_ = A, M = D);
1392
+ return u(S, this.toBBox), S;
1393
+ }, s.prototype._chooseSubtree = function(f, h, y, g) {
1394
+ for (; g.push(h), !h.leaf && g.length - 1 !== y; ) {
1395
+ for (var S = 1 / 0, v = 1 / 0, M = void 0, _ = 0; _ < h.children.length; _++) {
1396
+ var D = h.children[_], A = p(D), Y = (R = f, q = D, (Math.max(q.maxX, R.maxX) - Math.min(q.minX, R.minX)) * (Math.max(q.maxY, R.maxY) - Math.min(q.minY, R.minY)) - A);
1397
+ Y < v ? (v = Y, S = A < S ? A : S, M = D) : Y === v && A < S && (S = A, M = D);
1429
1398
  }
1430
1399
  h = M || h.children[0];
1431
1400
  }
1432
1401
  var R, q;
1433
1402
  return h;
1434
1403
  }, s.prototype._insert = function(f, h, y) {
1435
- var x = y ? f : this.toBBox(f), _ = [], v = this._chooseSubtree(x, this.data, h, _);
1436
- for (v.children.push(f), l(v, x); h >= 0 && _[h].children.length > this._maxEntries; )
1437
- this._split(_, h), h--;
1438
- this._adjustParentBBoxes(x, _, h);
1404
+ var g = y ? f : this.toBBox(f), S = [], v = this._chooseSubtree(g, this.data, h, S);
1405
+ for (v.children.push(f), l(v, g); h >= 0 && S[h].children.length > this._maxEntries; ) this._split(S, h), h--;
1406
+ this._adjustParentBBoxes(g, S, h);
1439
1407
  }, s.prototype._split = function(f, h) {
1440
- var y = f[h], x = y.children.length, _ = this._minEntries;
1441
- this._chooseSplitAxis(y, _, x);
1442
- var v = this._chooseSplitIndex(y, _, x), M = F(y.children.splice(v, y.children.length - v));
1408
+ var y = f[h], g = y.children.length, S = this._minEntries;
1409
+ this._chooseSplitAxis(y, S, g);
1410
+ var v = this._chooseSplitIndex(y, S, g), M = F(y.children.splice(v, y.children.length - v));
1443
1411
  M.height = y.height, M.leaf = y.leaf, u(y, this.toBBox), u(M, this.toBBox), h ? f[h - 1].children.push(M) : this._splitRoot(y, M);
1444
1412
  }, s.prototype._splitRoot = function(f, h) {
1445
1413
  this.data = F([f, h]), this.data.height = f.height + 1, this.data.leaf = !1, u(this.data, this.toBBox);
1446
1414
  }, s.prototype._chooseSplitIndex = function(f, h, y) {
1447
- for (var x, _, v, M, S, D, A, Y = 1 / 0, R = 1 / 0, q = h; q <= y - h; q++) {
1448
- var se = c(f, 0, q, this.toBBox), H = c(f, q, y, this.toBBox), K = (_ = se, v = H, M = void 0, S = void 0, D = void 0, A = void 0, M = Math.max(_.minX, v.minX), S = Math.max(_.minY, v.minY), D = Math.min(_.maxX, v.maxX), A = Math.min(_.maxY, v.maxY), Math.max(0, D - M) * Math.max(0, A - S)), W = p(se) + p(H);
1449
- K < Y ? (Y = K, x = q, R = W < R ? W : R) : K === Y && W < R && (R = W, x = q);
1415
+ for (var g, S, v, M, _, D, A, Y = 1 / 0, R = 1 / 0, q = h; q <= y - h; q++) {
1416
+ var se = c(f, 0, q, this.toBBox), H = c(f, q, y, this.toBBox), K = (S = se, v = H, M = void 0, _ = void 0, D = void 0, A = void 0, M = Math.max(S.minX, v.minX), _ = Math.max(S.minY, v.minY), D = Math.min(S.maxX, v.maxX), A = Math.min(S.maxY, v.maxY), Math.max(0, D - M) * Math.max(0, A - _)), W = p(se) + p(H);
1417
+ K < Y ? (Y = K, g = q, R = W < R ? W : R) : K === Y && W < R && (R = W, g = q);
1450
1418
  }
1451
- return x || y - h;
1419
+ return g || y - h;
1452
1420
  }, s.prototype._chooseSplitAxis = function(f, h, y) {
1453
- var x = f.leaf ? this.compareMinX : g, _ = f.leaf ? this.compareMinY : d;
1454
- this._allDistMargin(f, h, y, x) < this._allDistMargin(f, h, y, _) && f.children.sort(x);
1455
- }, s.prototype._allDistMargin = function(f, h, y, x) {
1456
- f.children.sort(x);
1457
- for (var _ = this.toBBox, v = c(f, 0, h, _), M = c(f, y - h, y, _), S = z(v) + z(M), D = h; D < y - h; D++) {
1421
+ var g = f.leaf ? this.compareMinX : x, S = f.leaf ? this.compareMinY : d;
1422
+ this._allDistMargin(f, h, y, g) < this._allDistMargin(f, h, y, S) && f.children.sort(g);
1423
+ }, s.prototype._allDistMargin = function(f, h, y, g) {
1424
+ f.children.sort(g);
1425
+ for (var S = this.toBBox, v = c(f, 0, h, S), M = c(f, y - h, y, S), _ = z(v) + z(M), D = h; D < y - h; D++) {
1458
1426
  var A = f.children[D];
1459
- l(v, f.leaf ? _(A) : A), S += z(v);
1427
+ l(v, f.leaf ? S(A) : A), _ += z(v);
1460
1428
  }
1461
1429
  for (var Y = y - h - 1; Y >= h; Y--) {
1462
1430
  var R = f.children[Y];
1463
- l(M, f.leaf ? _(R) : R), S += z(M);
1431
+ l(M, f.leaf ? S(R) : R), _ += z(M);
1464
1432
  }
1465
- return S;
1433
+ return _;
1466
1434
  }, s.prototype._adjustParentBBoxes = function(f, h, y) {
1467
- for (var x = y; x >= 0; x--)
1468
- l(h[x], f);
1435
+ for (var g = y; g >= 0; g--) l(h[g], f);
1469
1436
  }, s.prototype._condense = function(f) {
1470
- for (var h = f.length - 1, y = void 0; h >= 0; h--)
1471
- f[h].children.length === 0 ? h > 0 ? (y = f[h - 1].children).splice(y.indexOf(f[h]), 1) : this.clear() : u(f[h], this.toBBox);
1437
+ for (var h = f.length - 1, y = void 0; h >= 0; h--) f[h].children.length === 0 ? h > 0 ? (y = f[h - 1].children).splice(y.indexOf(f[h]), 1) : this.clear() : u(f[h], this.toBBox);
1472
1438
  }, s;
1473
1439
  });
1474
1440
  })(Dt);
@@ -1476,15 +1442,13 @@ var er = Dt.exports;
1476
1442
  class tr {
1477
1443
  constructor(r = [], n = rr) {
1478
1444
  if (this.data = r, this.length = this.data.length, this.compare = n, this.length > 0)
1479
- for (let o = (this.length >> 1) - 1; o >= 0; o--)
1480
- this._down(o);
1445
+ for (let o = (this.length >> 1) - 1; o >= 0; o--) this._down(o);
1481
1446
  }
1482
1447
  push(r) {
1483
1448
  this.data.push(r), this.length++, this._up(this.length - 1);
1484
1449
  }
1485
1450
  pop() {
1486
- if (this.length === 0)
1487
- return;
1451
+ if (this.length === 0) return;
1488
1452
  const r = this.data[0], n = this.data.pop();
1489
1453
  return this.length--, this.length > 0 && (this.data[0] = n, this._down(0)), r;
1490
1454
  }
@@ -1495,8 +1459,7 @@ class tr {
1495
1459
  const { data: n, compare: o } = this, a = n[r];
1496
1460
  for (; r > 0; ) {
1497
1461
  const s = r - 1 >> 1, i = n[s];
1498
- if (o(a, i) >= 0)
1499
- break;
1462
+ if (o(a, i) >= 0) break;
1500
1463
  n[r] = i, r = s;
1501
1464
  }
1502
1465
  n[r] = a;
@@ -1506,8 +1469,7 @@ class tr {
1506
1469
  for (; r < a; ) {
1507
1470
  let i = (r << 1) + 1, u = n[i];
1508
1471
  const c = i + 1;
1509
- if (c < this.length && o(n[c], u) < 0 && (i = c, u = n[c]), o(u, s) >= 0)
1510
- break;
1472
+ if (c < this.length && o(n[c], u) < 0 && (i = c, u = n[c]), o(u, s) >= 0) break;
1511
1473
  n[r] = u, r = i;
1512
1474
  }
1513
1475
  n[r] = s;
@@ -1523,16 +1485,16 @@ const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1523
1485
  var je = { exports: {} }, ir = function(r, n, o, a) {
1524
1486
  var s = r[0], i = r[1], u = !1;
1525
1487
  o === void 0 && (o = 0), a === void 0 && (a = n.length);
1526
- for (var c = (a - o) / 2, l = 0, g = c - 1; l < c; g = l++) {
1527
- var d = n[o + l * 2 + 0], p = n[o + l * 2 + 1], z = n[o + g * 2 + 0], m = n[o + g * 2 + 1], b = p > i != m > i && s < (z - d) * (i - p) / (m - p) + d;
1488
+ for (var c = (a - o) / 2, l = 0, x = c - 1; l < c; x = l++) {
1489
+ var d = n[o + l * 2 + 0], p = n[o + l * 2 + 1], z = n[o + x * 2 + 0], m = n[o + x * 2 + 1], b = p > i != m > i && s < (z - d) * (i - p) / (m - p) + d;
1528
1490
  b && (u = !u);
1529
1491
  }
1530
1492
  return u;
1531
1493
  }, sr = function(r, n, o, a) {
1532
1494
  var s = r[0], i = r[1], u = !1;
1533
1495
  o === void 0 && (o = 0), a === void 0 && (a = n.length);
1534
- for (var c = a - o, l = 0, g = c - 1; l < c; g = l++) {
1535
- var d = n[l + o][0], p = n[l + o][1], z = n[g + o][0], m = n[g + o][1], b = p > i != m > i && s < (z - d) * (i - p) / (m - p) + d;
1496
+ for (var c = a - o, l = 0, x = c - 1; l < c; x = l++) {
1497
+ var d = n[l + o][0], p = n[l + o][1], z = n[x + o][0], m = n[x + o][1], b = p > i != m > i && s < (z - d) * (i - p) / (m - p) + d;
1536
1498
  b && (u = !u);
1537
1499
  }
1538
1500
  return u;
@@ -1549,46 +1511,39 @@ var ar = je.exports, it = { exports: {} };
1549
1511
  })(bt, function(n) {
1550
1512
  const a = 33306690738754706e-32;
1551
1513
  function s(b, F, X, f, h) {
1552
- let y, x, _, v, M = F[0], S = f[0], D = 0, A = 0;
1553
- S > M == S > -M ? (y = M, M = F[++D]) : (y = S, S = f[++A]);
1514
+ let y, g, S, v, M = F[0], _ = f[0], D = 0, A = 0;
1515
+ _ > M == _ > -M ? (y = M, M = F[++D]) : (y = _, _ = f[++A]);
1554
1516
  let Y = 0;
1555
- if (D < b && A < X)
1556
- for (S > M == S > -M ? (_ = y - ((x = M + y) - M), M = F[++D]) : (_ = y - ((x = S + y) - S), S = f[++A]), y = x, _ !== 0 && (h[Y++] = _); D < b && A < X; )
1557
- S > M == S > -M ? (_ = y - ((x = y + M) - (v = x - y)) + (M - v), M = F[++D]) : (_ = y - ((x = y + S) - (v = x - y)) + (S - v), S = f[++A]), y = x, _ !== 0 && (h[Y++] = _);
1558
- for (; D < b; )
1559
- _ = y - ((x = y + M) - (v = x - y)) + (M - v), M = F[++D], y = x, _ !== 0 && (h[Y++] = _);
1560
- for (; A < X; )
1561
- _ = y - ((x = y + S) - (v = x - y)) + (S - v), S = f[++A], y = x, _ !== 0 && (h[Y++] = _);
1517
+ if (D < b && A < X) for (_ > M == _ > -M ? (S = y - ((g = M + y) - M), M = F[++D]) : (S = y - ((g = _ + y) - _), _ = f[++A]), y = g, S !== 0 && (h[Y++] = S); D < b && A < X; ) _ > M == _ > -M ? (S = y - ((g = y + M) - (v = g - y)) + (M - v), M = F[++D]) : (S = y - ((g = y + _) - (v = g - y)) + (_ - v), _ = f[++A]), y = g, S !== 0 && (h[Y++] = S);
1518
+ for (; D < b; ) S = y - ((g = y + M) - (v = g - y)) + (M - v), M = F[++D], y = g, S !== 0 && (h[Y++] = S);
1519
+ for (; A < X; ) S = y - ((g = y + _) - (v = g - y)) + (_ - v), _ = f[++A], y = g, S !== 0 && (h[Y++] = S);
1562
1520
  return y === 0 && Y !== 0 || (h[Y++] = y), Y;
1563
1521
  }
1564
1522
  function i(b) {
1565
1523
  return new Float64Array(b);
1566
1524
  }
1567
- const u = 33306690738754716e-32, c = 22204460492503146e-32, l = 11093356479670487e-47, g = i(4), d = i(8), p = i(12), z = i(16), m = i(4);
1525
+ const u = 33306690738754716e-32, c = 22204460492503146e-32, l = 11093356479670487e-47, x = i(4), d = i(8), p = i(12), z = i(16), m = i(4);
1568
1526
  n.orient2d = function(b, F, X, f, h, y) {
1569
- const x = (F - y) * (X - h), _ = (b - h) * (f - y), v = x - _;
1570
- if (x === 0 || _ === 0 || x > 0 != _ > 0)
1571
- return v;
1572
- const M = Math.abs(x + _);
1573
- return Math.abs(v) >= u * M ? v : -function(S, D, A, Y, R, q, se) {
1574
- let H, K, W, Q, k, I, w, E, C, G, B, $, J, U, V, ne, ie, Z;
1575
- const oe = S - R, ee = A - R, te = D - q, ae = Y - q;
1576
- k = (V = (E = oe - (w = (I = 134217729 * oe) - (I - oe))) * (G = ae - (C = (I = 134217729 * ae) - (I - ae))) - ((U = oe * ae) - w * C - E * C - w * G)) - (B = V - (ie = (E = te - (w = (I = 134217729 * te) - (I - te))) * (G = ee - (C = (I = 134217729 * ee) - (I - ee))) - ((ne = te * ee) - w * C - E * C - w * G))), g[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), g[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, g[2] = $ - (Z - k) + (B - k), g[3] = Z;
1527
+ const g = (F - y) * (X - h), S = (b - h) * (f - y), v = g - S;
1528
+ if (g === 0 || S === 0 || g > 0 != S > 0) return v;
1529
+ const M = Math.abs(g + S);
1530
+ return Math.abs(v) >= u * M ? v : -function(_, D, A, Y, R, q, se) {
1531
+ let H, K, W, Q, k, O, w, E, C, G, B, $, J, U, V, ne, ie, Z;
1532
+ const oe = _ - R, ee = A - R, te = D - q, ae = Y - q;
1533
+ k = (V = (E = oe - (w = (O = 134217729 * oe) - (O - oe))) * (G = ae - (C = (O = 134217729 * ae) - (O - ae))) - ((U = oe * ae) - w * C - E * C - w * G)) - (B = V - (ie = (E = te - (w = (O = 134217729 * te) - (O - te))) * (G = ee - (C = (O = 134217729 * ee) - (O - ee))) - ((ne = te * ee) - w * C - E * C - w * G))), x[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), x[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, x[2] = $ - (Z - k) + (B - k), x[3] = Z;
1577
1534
  let ye = function(Ee, Le) {
1578
1535
  let Ne = Le[0];
1579
- for (let Pe = 1; Pe < Ee; Pe++)
1580
- Ne += Le[Pe];
1536
+ for (let Pe = 1; Pe < Ee; Pe++) Ne += Le[Pe];
1581
1537
  return Ne;
1582
- }(4, g), we = c * se;
1583
- if (ye >= we || -ye >= we || (H = S - (oe + (k = S - oe)) + (k - R), W = A - (ee + (k = A - ee)) + (k - R), K = D - (te + (k = D - te)) + (k - q), Q = Y - (ae + (k = Y - ae)) + (k - q), H === 0 && K === 0 && W === 0 && Q === 0) || (we = l * se + a * Math.abs(ye), (ye += oe * Q + ae * H - (te * W + ee * K)) >= we || -ye >= we))
1584
- return ye;
1585
- k = (V = (E = H - (w = (I = 134217729 * H) - (I - H))) * (G = ae - (C = (I = 134217729 * ae) - (I - ae))) - ((U = H * ae) - w * C - E * C - w * G)) - (B = V - (ie = (E = K - (w = (I = 134217729 * K) - (I - K))) * (G = ee - (C = (I = 134217729 * ee) - (I - ee))) - ((ne = K * ee) - w * C - E * C - w * G))), m[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), m[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, m[2] = $ - (Z - k) + (B - k), m[3] = Z;
1586
- const qe = s(4, g, 4, m, d);
1587
- k = (V = (E = oe - (w = (I = 134217729 * oe) - (I - oe))) * (G = Q - (C = (I = 134217729 * Q) - (I - Q))) - ((U = oe * Q) - w * C - E * C - w * G)) - (B = V - (ie = (E = te - (w = (I = 134217729 * te) - (I - te))) * (G = W - (C = (I = 134217729 * W) - (I - W))) - ((ne = te * W) - w * C - E * C - w * G))), m[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), m[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, m[2] = $ - (Z - k) + (B - k), m[3] = Z;
1538
+ }(4, x), we = c * se;
1539
+ if (ye >= we || -ye >= we || (H = _ - (oe + (k = _ - oe)) + (k - R), W = A - (ee + (k = A - ee)) + (k - R), K = D - (te + (k = D - te)) + (k - q), Q = Y - (ae + (k = Y - ae)) + (k - q), H === 0 && K === 0 && W === 0 && Q === 0) || (we = l * se + a * Math.abs(ye), (ye += oe * Q + ae * H - (te * W + ee * K)) >= we || -ye >= we)) return ye;
1540
+ k = (V = (E = H - (w = (O = 134217729 * H) - (O - H))) * (G = ae - (C = (O = 134217729 * ae) - (O - ae))) - ((U = H * ae) - w * C - E * C - w * G)) - (B = V - (ie = (E = K - (w = (O = 134217729 * K) - (O - K))) * (G = ee - (C = (O = 134217729 * ee) - (O - ee))) - ((ne = K * ee) - w * C - E * C - w * G))), m[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), m[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, m[2] = $ - (Z - k) + (B - k), m[3] = Z;
1541
+ const qe = s(4, x, 4, m, d);
1542
+ k = (V = (E = oe - (w = (O = 134217729 * oe) - (O - oe))) * (G = Q - (C = (O = 134217729 * Q) - (O - Q))) - ((U = oe * Q) - w * C - E * C - w * G)) - (B = V - (ie = (E = te - (w = (O = 134217729 * te) - (O - te))) * (G = W - (C = (O = 134217729 * W) - (O - W))) - ((ne = te * W) - w * C - E * C - w * G))), m[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), m[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, m[2] = $ - (Z - k) + (B - k), m[3] = Z;
1588
1543
  const He = s(qe, d, 4, m, p);
1589
- k = (V = (E = H - (w = (I = 134217729 * H) - (I - H))) * (G = Q - (C = (I = 134217729 * Q) - (I - Q))) - ((U = H * Q) - w * C - E * C - w * G)) - (B = V - (ie = (E = K - (w = (I = 134217729 * K) - (I - K))) * (G = W - (C = (I = 134217729 * W) - (I - W))) - ((ne = K * W) - w * C - E * C - w * G))), m[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), m[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, m[2] = $ - (Z - k) + (B - k), m[3] = Z;
1590
- const Se = s(He, p, 4, m, z);
1591
- return z[Se - 1];
1544
+ k = (V = (E = H - (w = (O = 134217729 * H) - (O - H))) * (G = Q - (C = (O = 134217729 * Q) - (O - Q))) - ((U = H * Q) - w * C - E * C - w * G)) - (B = V - (ie = (E = K - (w = (O = 134217729 * K) - (O - K))) * (G = W - (C = (O = 134217729 * W) - (O - W))) - ((ne = K * W) - w * C - E * C - w * G))), m[0] = V - (B + k) + (k - ie), k = (J = U - (($ = U + B) - (k = $ - U)) + (B - k)) - (B = J - ne), m[1] = J - (B + k) + (k - ne), k = (Z = $ + B) - $, m[2] = $ - (Z - k) + (B - k), m[3] = Z;
1545
+ const _e = s(He, p, 4, m, z);
1546
+ return z[_e - 1];
1592
1547
  }(b, F, X, f, h, y, M);
1593
1548
  }, n.orient2dfast = function(b, F, X, f, h, y) {
1594
1549
  return (F - y) * (X - h) - (b - h) * (f - y);
@@ -1619,12 +1574,11 @@ function At(e, r, n) {
1619
1574
  a.remove(c), u = wt(c, u), s.push(u);
1620
1575
  }
1621
1576
  var l = new pt(16);
1622
- for (i = 0; i < s.length; i++)
1623
- l.insert(Ke(s[i]));
1624
- for (var g = r * r, d = n * n; s.length; ) {
1577
+ for (i = 0; i < s.length; i++) l.insert(Ke(s[i]));
1578
+ for (var x = r * r, d = n * n; s.length; ) {
1625
1579
  var p = s.shift(), z = p.p, m = p.next.p, b = We(z, m);
1626
1580
  if (!(b < d)) {
1627
- var F = b / g;
1581
+ var F = b / x;
1628
1582
  c = fr(a, p.prev.p, z, m, p.next.next.p, F, l), c && Math.min(We(c, z), We(c, m)) <= F && (s.push(p), s.push(wt(c, p)), a.remove(c), l.remove(p), l.insert(Ke(p)), l.insert(Ke(p.next)));
1629
1583
  }
1630
1584
  }
@@ -1638,16 +1592,15 @@ function At(e, r, n) {
1638
1592
  function fr(e, r, n, o, a, s, i) {
1639
1593
  for (var u = new Je([], hr), c = e.data; c; ) {
1640
1594
  for (var l = 0; l < c.children.length; l++) {
1641
- var g = c.children[l], d = c.leaf ? et(g, n, o) : yr(n, o, g);
1595
+ var x = c.children[l], d = c.leaf ? et(x, n, o) : yr(n, o, x);
1642
1596
  d > s || u.push({
1643
- node: g,
1597
+ node: x,
1644
1598
  dist: d
1645
1599
  });
1646
1600
  }
1647
1601
  for (; u.length && !u.peek().node.children; ) {
1648
1602
  var p = u.pop(), z = p.node, m = et(z, r, n), b = et(z, o, a);
1649
- if (p.dist < m && p.dist < b && vt(n, z, i) && vt(o, z, i))
1650
- return z;
1603
+ if (p.dist < m && p.dist < b && vt(n, z, i) && vt(o, z, i)) return z;
1651
1604
  }
1652
1605
  c = u.pop(), c && (c = c.node);
1653
1606
  }
@@ -1657,17 +1610,13 @@ function hr(e, r) {
1657
1610
  return e.dist - r.dist;
1658
1611
  }
1659
1612
  function yr(e, r, n) {
1660
- if (mt(e, n) || mt(r, n))
1661
- return 0;
1613
+ if (mt(e, n) || mt(r, n)) return 0;
1662
1614
  var o = Ue(e[0], e[1], r[0], r[1], n.minX, n.minY, n.maxX, n.minY);
1663
- if (o === 0)
1664
- return 0;
1615
+ if (o === 0) return 0;
1665
1616
  var a = Ue(e[0], e[1], r[0], r[1], n.minX, n.minY, n.minX, n.maxY);
1666
- if (a === 0)
1667
- return 0;
1617
+ if (a === 0) return 0;
1668
1618
  var s = Ue(e[0], e[1], r[0], r[1], n.maxX, n.minY, n.maxX, n.maxY);
1669
- if (s === 0)
1670
- return 0;
1619
+ if (s === 0) return 0;
1671
1620
  var i = Ue(e[0], e[1], r[0], r[1], n.minX, n.maxY, n.maxX, n.maxY);
1672
1621
  return i === 0 ? 0 : Math.min(o, a, s, i);
1673
1622
  }
@@ -1676,8 +1625,7 @@ function mt(e, r) {
1676
1625
  }
1677
1626
  function vt(e, r, n) {
1678
1627
  for (var o = Math.min(e[0], r[0]), a = Math.min(e[1], r[1]), s = Math.max(e[0], r[0]), i = Math.max(e[1], r[1]), u = n.search({ minX: o, minY: a, maxX: s, maxY: i }), c = 0; c < u.length; c++)
1679
- if (dr(u[c].p, u[c].next.p, e, r))
1680
- return !1;
1628
+ if (dr(u[c].p, u[c].next.p, e, r)) return !1;
1681
1629
  return !0;
1682
1630
  }
1683
1631
  function De(e, r, n) {
@@ -1725,9 +1673,9 @@ function et(e, r, n) {
1725
1673
  return s = e[0] - o, i = e[1] - a, s * s + i * i;
1726
1674
  }
1727
1675
  function Ue(e, r, n, o, a, s, i, u) {
1728
- var c = n - e, l = o - r, g = i - a, d = u - s, p = e - a, z = r - s, m = c * c + l * l, b = c * g + l * d, F = g * g + d * d, X = c * p + l * z, f = g * p + d * z, h = m * F - b * b, y, x, _, v, M = h, S = h;
1729
- h === 0 ? (x = 0, M = 1, v = f, S = F) : (x = b * f - F * X, v = m * f - b * X, x < 0 ? (x = 0, v = f, S = F) : x > M && (x = M, v = f + b, S = F)), v < 0 ? (v = 0, -X < 0 ? x = 0 : -X > m ? x = M : (x = -X, M = m)) : v > S && (v = S, -X + b < 0 ? x = 0 : -X + b > m ? x = M : (x = -X + b, M = m)), y = x === 0 ? 0 : x / M, _ = v === 0 ? 0 : v / S;
1730
- var D = (1 - y) * e + y * n, A = (1 - y) * r + y * o, Y = (1 - _) * a + _ * i, R = (1 - _) * s + _ * u, q = Y - D, se = R - A;
1676
+ var c = n - e, l = o - r, x = i - a, d = u - s, p = e - a, z = r - s, m = c * c + l * l, b = c * x + l * d, F = x * x + d * d, X = c * p + l * z, f = x * p + d * z, h = m * F - b * b, y, g, S, v, M = h, _ = h;
1677
+ h === 0 ? (g = 0, M = 1, v = f, _ = F) : (g = b * f - F * X, v = m * f - b * X, g < 0 ? (g = 0, v = f, _ = F) : g > M && (g = M, v = f + b, _ = F)), v < 0 ? (v = 0, -X < 0 ? g = 0 : -X > m ? g = M : (g = -X, M = m)) : v > _ && (v = _, -X + b < 0 ? g = 0 : -X + b > m ? g = M : (g = -X + b, M = m)), y = g === 0 ? 0 : g / M, S = v === 0 ? 0 : v / _;
1678
+ var D = (1 - y) * e + y * n, A = (1 - y) * r + y * o, Y = (1 - S) * a + S * i, R = (1 - S) * s + S * u, q = Y - D, se = R - A;
1731
1679
  return q * q + se * se;
1732
1680
  }
1733
1681
  function xr(e, r) {
@@ -1889,19 +1837,19 @@ var zr = (
1889
1837
  if (o >= 1)
1890
1838
  return this.points[this.length - 1];
1891
1839
  var a = Math.floor((this.points.length - 1) * o), s = (this.length - 1) * o - a;
1892
- return _r(s, this.points[a], this.controls[a][1], this.controls[a + 1][0], this.points[a + 1]);
1840
+ return Sr(s, this.points[a], this.controls[a][1], this.controls[a + 1][0], this.points[a + 1]);
1893
1841
  }, e;
1894
1842
  }()
1895
1843
  );
1896
- function _r(e, r, n, o, a) {
1897
- var s = Sr(e), i = {
1844
+ function Sr(e, r, n, o, a) {
1845
+ var s = _r(e), i = {
1898
1846
  x: a.x * s[0] + o.x * s[1] + n.x * s[2] + r.x * s[3],
1899
1847
  y: a.y * s[0] + o.y * s[1] + n.y * s[2] + r.y * s[3],
1900
1848
  z: a.z * s[0] + o.z * s[1] + n.z * s[2] + r.z * s[3]
1901
1849
  };
1902
1850
  return i;
1903
1851
  }
1904
- function Sr(e) {
1852
+ function _r(e) {
1905
1853
  var r = e * e, n = r * e;
1906
1854
  return [
1907
1855
  n,
@@ -1919,8 +1867,8 @@ function at(e, r) {
1919
1867
  points: s,
1920
1868
  sharpness: o
1921
1869
  }), u = function(l) {
1922
- var g = i.pos(l);
1923
- Math.floor(l / 100) % 2 === 0 && a.push([g.x, g.y]);
1870
+ var x = i.pos(l);
1871
+ Math.floor(l / 100) % 2 === 0 && a.push([x.x, x.y]);
1924
1872
  }, c = 0; c < i.duration; c += 10)
1925
1873
  u(c);
1926
1874
  return u(i.duration), Ze(a, r.properties);
@@ -1935,27 +1883,27 @@ function Lr(e, r) {
1935
1883
  }
1936
1884
  function Ft(e, r, n, o) {
1937
1885
  o === void 0 && (o = {});
1938
- var a = ke(e), s = de(a[0]), i = de(a[1]), u = de(n), c = Zt(r, o.units), l = Math.asin(Math.sin(i) * Math.cos(c) + Math.cos(i) * Math.sin(c) * Math.cos(u)), g = s + Math.atan2(Math.sin(u) * Math.sin(c) * Math.cos(i), Math.cos(c) - Math.sin(i) * Math.sin(l)), d = nt(g), p = nt(l);
1886
+ var a = ke(e), s = de(a[0]), i = de(a[1]), u = de(n), c = Zt(r, o.units), l = Math.asin(Math.sin(i) * Math.cos(c) + Math.cos(i) * Math.sin(c) * Math.cos(u)), x = s + Math.atan2(Math.sin(u) * Math.sin(c) * Math.cos(i), Math.cos(c) - Math.sin(i) * Math.sin(l)), d = nt(x), p = nt(l);
1939
1887
  return pe([d, p], o.properties);
1940
1888
  }
1941
- function It(e, r, n) {
1889
+ function Ot(e, r, n) {
1942
1890
  n === void 0 && (n = {});
1943
1891
  for (var o = n.steps || 64, a = n.properties ? n.properties : !Array.isArray(e) && e.type === "Feature" && e.properties ? e.properties : {}, s = [], i = 0; i < o; i++)
1944
1892
  s.push(Ft(e, r, i * -360 / o, n).geometry.coordinates);
1945
1893
  return s.push(s[0]), Re([s], a);
1946
1894
  }
1947
- function Ot(e, r, n) {
1895
+ function It(e, r, n) {
1948
1896
  if (n === void 0 && (n = {}), n.final === !0)
1949
1897
  return Pr(e, r);
1950
- var o = ke(e), a = ke(r), s = de(o[0]), i = de(a[0]), u = de(o[1]), c = de(a[1]), l = Math.sin(i - s) * Math.cos(c), g = Math.cos(u) * Math.sin(c) - Math.sin(u) * Math.cos(c) * Math.cos(i - s);
1951
- return nt(Math.atan2(l, g));
1898
+ var o = ke(e), a = ke(r), s = de(o[0]), i = de(a[0]), u = de(o[1]), c = de(a[1]), l = Math.sin(i - s) * Math.cos(c), x = Math.cos(u) * Math.sin(c) - Math.sin(u) * Math.cos(c) * Math.cos(i - s);
1899
+ return nt(Math.atan2(l, x));
1952
1900
  }
1953
1901
  function Pr(e, r) {
1954
- var n = Ot(r, e);
1902
+ var n = It(r, e);
1955
1903
  return n = (n + 180) % 360, n;
1956
1904
  }
1957
1905
  function br(e, r) {
1958
- var n = st(e, r), o = Ot(e, r), a = Ft(e, n / 2, o);
1906
+ var n = st(e, r), o = It(e, r), a = Ft(e, n / 2, o);
1959
1907
  return a;
1960
1908
  }
1961
1909
  function Mt(e, r) {
@@ -1974,11 +1922,11 @@ function ut(e, r) {
1974
1922
  Be(e, function(y) {
1975
1923
  n.push(y);
1976
1924
  });
1977
- var o = Mt(e, { properties: r.properties }), a = o.geometry.coordinates, s = 0, i = 0, u = 0, c, l, g, d, p, z, m, b, F = n.map(function(y) {
1925
+ var o = Mt(e, { properties: r.properties }), a = o.geometry.coordinates, s = 0, i = 0, u = 0, c, l, x, d, p, z, m, b, F = n.map(function(y) {
1978
1926
  return [y[0] - a[0], y[1] - a[1]];
1979
1927
  });
1980
1928
  for (c = 0; c < n.length - 1; c++)
1981
- l = F[c], d = l[0], z = l[1], g = F[c + 1], p = g[0], m = g[1], b = d * m - p * z, u += b, s += (d + p) * b, i += (z + m) * b;
1929
+ l = F[c], d = l[0], z = l[1], x = F[c + 1], p = x[0], m = x[1], b = d * m - p * z, u += b, s += (d + p) * b, i += (z + m) * b;
1982
1930
  if (u === 0)
1983
1931
  return o;
1984
1932
  var X = u * 0.5, f = 1 / (6 * X);
@@ -1998,10 +1946,10 @@ function Dr(e) {
1998
1946
  var r = 0, n;
1999
1947
  switch (e.type) {
2000
1948
  case "Polygon":
2001
- return _t(e.coordinates);
1949
+ return St(e.coordinates);
2002
1950
  case "MultiPolygon":
2003
1951
  for (n = 0; n < e.coordinates.length; n++)
2004
- r += _t(e.coordinates[n]);
1952
+ r += St(e.coordinates[n]);
2005
1953
  return r;
2006
1954
  case "Point":
2007
1955
  case "MultiPoint":
@@ -2011,16 +1959,16 @@ function Dr(e) {
2011
1959
  }
2012
1960
  return 0;
2013
1961
  }
2014
- function _t(e) {
1962
+ function St(e) {
2015
1963
  var r = 0;
2016
1964
  if (e && e.length > 0) {
2017
- r += Math.abs(St(e[0]));
1965
+ r += Math.abs(_t(e[0]));
2018
1966
  for (var n = 1; n < e.length; n++)
2019
- r -= Math.abs(St(e[n]));
1967
+ r -= Math.abs(_t(e[n]));
2020
1968
  }
2021
1969
  return r;
2022
1970
  }
2023
- function St(e) {
1971
+ function _t(e) {
2024
1972
  var r, n, o, a, s, i, u, c = 0, l = e.length;
2025
1973
  if (l > 2) {
2026
1974
  for (u = 0; u < l; u++)
@@ -2079,11 +2027,11 @@ const kr = (e, r, n, o) => {
2079
2027
  "line-cap": "round"
2080
2028
  },
2081
2029
  paint: {
2082
- "line-color": (o == null ? void 0 : o["line-color"]) || "#ff0",
2083
- "line-width": (o == null ? void 0 : o["line-width"]) || 4
2030
+ "line-color": (o == null ? void 0 : o["line-color"]) || "black",
2031
+ "line-width": (o == null ? void 0 : o["line-width"]) || 2
2084
2032
  }
2085
2033
  });
2086
- }, Ie = (e, r, n, o) => {
2034
+ }, Oe = (e, r, n, o) => {
2087
2035
  e.addLayer({
2088
2036
  id: r,
2089
2037
  type: "symbol",
@@ -2099,7 +2047,7 @@ const kr = (e, r, n, o) => {
2099
2047
  visibility: o != null && o.visibility ? "visible" : "none"
2100
2048
  }
2101
2049
  });
2102
- }, _e = (e, r, n, o) => {
2050
+ }, Se = (e, r, n, o) => {
2103
2051
  e.addLayer({
2104
2052
  id: r,
2105
2053
  type: "fill",
@@ -2107,42 +2055,12 @@ const kr = (e, r, n, o) => {
2107
2055
  paint: {
2108
2056
  "fill-antialias": !1,
2109
2057
  "fill-color": (o == null ? void 0 : o["fill-color"]) || "#ff0",
2110
- "fill-opacity": 0.8
2058
+ "fill-opacity": (o == null ? void 0 : o["fill-opacity"]) || 0.8
2111
2059
  }
2112
2060
  });
2113
- }, Er = (e) => {
2114
- let r = !1, n = e, o = [], a = n.length - 1;
2115
- for (let i = 0; i < a; i++) {
2116
- let u = n[i], c = n[i + 1];
2117
- (u.x != c.x || u.y != c.y) && o.push(u);
2118
- }
2119
- let s = o.length - 1;
2120
- for (let i = 0; i < s; i++) {
2121
- let u = o[i], c = o[i + 1];
2122
- for (let l = i + 2; l < s; l++) {
2123
- let g = o[l], d = o[l + 1], p = Ar(u, c, g, d);
2124
- if (p == null && c.x == d.x && c.y == d.y && (p = { x: c.x, y: c.y }), p != null) {
2125
- r = !0;
2126
- break;
2127
- }
2128
- }
2129
- if (r)
2130
- break;
2131
- }
2132
- return r;
2133
2061
  };
2134
- function Ar(e, r, n, o) {
2135
- var a = null, s = (e.x - n.x) * (r.y - n.y) - (e.y - n.y) * (r.x - n.x), i = (e.x - o.x) * (r.y - o.y) - (e.y - o.y) * (r.x - o.x);
2136
- if (s * i >= 0)
2137
- return a;
2138
- var u = (n.x - e.x) * (o.y - e.y) - (n.y - e.y) * (o.x - e.x), c = u + s - i;
2139
- if (u * c >= 0)
2140
- return a;
2141
- var l = u / (i - s), g = l * (r.x - e.x), d = l * (r.y - e.y);
2142
- return a = { x: e.x + g, y: e.y + d }, a;
2143
- }
2144
- function Xr(e, r, n, o, a) {
2145
- let s = "free", i = "", u = [], c = [], l = {}, g = !1, d = !0, p = !1, z = !0, m = [], b = !0, F = 5e4, X = !1, f = {
2062
+ function Er(e, r, n, o, a) {
2063
+ let s = "free", i = "", u = [], c = [], l = {}, x = !1, d = !0, p = !1, z = !0, m = [], b = !0, F = 5e4, X = !1, f = {
2146
2064
  type: "FeatureCollection",
2147
2065
  features: []
2148
2066
  }, h = {
@@ -2160,14 +2078,14 @@ function Xr(e, r, n, o, a) {
2160
2078
  coordinates: []
2161
2079
  }
2162
2080
  };
2163
- const x = (P, O) => {
2081
+ const g = (P, I) => {
2164
2082
  let N = 0;
2165
2083
  return function(...T) {
2166
2084
  const ue = (/* @__PURE__ */ new Date()).getTime();
2167
- ue - N < O || (N = ue, P(...T));
2085
+ ue - N < I || (N = ue, P(...T));
2168
2086
  };
2169
- }, _ = (P) => {
2170
- switch (e.off("click", C), e.off("mousemove", te), e.off("contextmenu", J), Q(), ee(), g && (d = !0, E(!1)), g = !0, s = P.type || "point", b = P.multipleLine || !1, p = P.smooth || !1, F = P.brushSize * 1e3 || 3e4, l = P, z = P.showLayer, h.properties = P, y.properties = P, s) {
2087
+ }, S = (P) => {
2088
+ switch (e.off("click", C), e.off("mousemove", te), e.off("contextmenu", J), Q(), ee(), x && (d = !0, E(!1)), x = !0, s = P.type || "point", b = P.multipleLine || !1, p = P.smooth || !1, F = P.brushSize * 1e3 || 3e4, l = P, z = P.showLayer, h.properties = P, y.properties = P, s) {
2171
2089
  case "point":
2172
2090
  break;
2173
2091
  case "brush":
@@ -2184,12 +2102,12 @@ function Xr(e, r, n, o, a) {
2184
2102
  n(T);
2185
2103
  } else
2186
2104
  n([]);
2187
- I(), ee(), e.addSource(i, { type: "geojson", data: f }), ze(e, i, i, l), f.features.push({
2105
+ O(), ee(), e.addSource(i, { type: "geojson", data: f }), ze(e, i, i, l), f.features.push({
2188
2106
  type: "Feature",
2189
2107
  properties: l,
2190
2108
  geometry: { type: "Point", coordinates: P.lngLat.toArray() }
2191
2109
  }), e.getSource(i).setData(re(f)), r && r(Z());
2192
- }, S = (P) => {
2110
+ }, _ = (P) => {
2193
2111
  if (d) {
2194
2112
  if (n)
2195
2113
  if (u.length) {
@@ -2197,11 +2115,11 @@ function Xr(e, r, n, o, a) {
2197
2115
  n(T);
2198
2116
  } else
2199
2117
  n([]);
2200
- I(), ee(), e.addSource(i, { type: "geojson", data: h }), xe(e, i, i), ze(e, i + "point", i, l), d = !1, e.on("mousemove", te), e.on("contextmenu", J), e.dragRotate.enable();
2118
+ O(), ee(), e.addSource(i, { type: "geojson", data: h }), xe(e, i, i), ze(e, i + "point", i, l), d = !1, e.on("mousemove", te), e.on("contextmenu", J), e.dragRotate.enable();
2201
2119
  }
2202
2120
  h.geometry.coordinates.push(P.lngLat.toArray());
2203
- const O = e.getSource(i);
2204
- O.setData(h), !b && h.geometry.coordinates.length == 3 && (e.off("mousemove", te), e.off("contextmenu", J), d = !0, E(!1), h.geometry.coordinates.pop(), O.setData(re(h)), r && r(Z()));
2121
+ const I = e.getSource(i);
2122
+ I.setData(h), !b && h.geometry.coordinates.length == 3 && (e.off("mousemove", te), e.off("contextmenu", J), d = !0, E(!1), h.geometry.coordinates.pop(), I.setData(re(h)), r && r(Z()));
2205
2123
  }, D = (P) => {
2206
2124
  if (d) {
2207
2125
  if (n)
@@ -2210,7 +2128,7 @@ function Xr(e, r, n, o, a) {
2210
2128
  n(ue);
2211
2129
  } else
2212
2130
  n([]);
2213
- I(), ee(), e.addSource(i, { type: "geojson", data: y }), e.addSource(i + "point", { type: "geojson", data: f }), _e(e, i, i, l), xe(e, i + "outline", i, { "line-color": "black", "line-width": 2, ...l }), ze(e, i + "point", i + "point", l), d = !1, e.on("mousemove", te), e.on("contextmenu", J), e.dragRotate.enable();
2131
+ O(), ee(), e.addSource(i, { type: "geojson", data: y }), e.addSource(i + "point", { type: "geojson", data: f }), Se(e, i, i, l), xe(e, i + "outline", i, { "line-color": "black", "line-width": 2, ...l }), ze(e, i + "point", i + "point", l), d = !1, e.on("mousemove", te), e.on("contextmenu", J), e.dragRotate.enable();
2214
2132
  }
2215
2133
  y.geometry.coordinates[0].length >= 3 && y.geometry.coordinates[0].pop(), y.geometry.coordinates[0].push(P.lngLat.toArray()), y.geometry.coordinates[0].push(y.geometry.coordinates[0][0]), f.features.push(
2216
2134
  re({
@@ -2228,17 +2146,17 @@ function Xr(e, r, n, o, a) {
2228
2146
  n(T);
2229
2147
  } else
2230
2148
  n([]);
2231
- I(), ee(), e.addSource(i, { type: "geojson", data: y }), _e(e, i, i, l), xe(e, i + "outline", i, { "line-color": "black", "line-width": 2, ...l }), d = !1, y.geometry.coordinates[0].push(P.lngLat.toArray()), e.getSource(i).setData(y), e.on("mousemove", te), e.on("contextmenu", J), E(!0), e.dragRotate.enable();
2149
+ O(), ee(), e.addSource(i, { type: "geojson", data: y }), Se(e, i, i, l), xe(e, i + "outline", i, { "line-color": "black", "line-width": 2, ...l }), d = !1, y.geometry.coordinates[0].push(P.lngLat.toArray()), e.getSource(i).setData(y), e.on("mousemove", te), e.on("contextmenu", J), E(!0), e.dragRotate.enable();
2232
2150
  }
2233
2151
  }, Y = () => {
2234
2152
  e.on("mousedown", U), e.on("mouseup", V), e.on("mousemove", B), e.on("mouseover", ne), e.on("mouseout", ie);
2235
2153
  }, R = () => {
2236
- I(), ee(), e.addSource(i, { type: "geojson", data: y }), _e(e, i, i, l), xe(e, i + "outline", i, { "line-color": "black", "line-width": 2, ...l });
2237
- }, q = (P, O) => {
2238
- const N = pe([P.lng, P.lat]), T = O / 2 / 111320, ue = ot(It(N, T, { units: "degrees" }));
2154
+ O(), ee(), e.addSource(i, { type: "geojson", data: y }), Se(e, i, i, l), xe(e, i + "outline", i, { "line-color": "black", "line-width": 2, ...l });
2155
+ }, q = (P, I) => {
2156
+ const N = pe([P.lng, P.lat]), T = I / 2 / 111320, ue = ot(Ot(N, T, { units: "degrees" }));
2239
2157
  return Lr(ue);
2240
- }, se = (P, O) => {
2241
- const N = q(P, O);
2158
+ }, se = (P, I) => {
2159
+ const N = q(P, I);
2242
2160
  y.geometry = N.geometry, e.getSource(i).setData(y);
2243
2161
  }, H = () => {
2244
2162
  const P = i, N = e.getSource(P).serialize().data;
@@ -2250,10 +2168,10 @@ function Xr(e, r, n, o, a) {
2250
2168
  }, Q = () => {
2251
2169
  e.off("mousedown", U), e.off("mouseup", V), e.off("mousemove", B), e.off("mouseover", ne), e.off("mouseout", ie);
2252
2170
  }, k = (P) => {
2253
- let O = re(P);
2254
- const N = Ze(O.geometry.coordinates[0]), T = at(N, { sharpness: 0.6 });
2255
- return O.geometry.coordinates[0] = T.geometry.coordinates, O;
2256
- }, I = () => {
2171
+ let I = re(P);
2172
+ const N = Ze(I.geometry.coordinates[0]), T = at(N, { sharpness: 0.6 });
2173
+ return I.geometry.coordinates[0] = T.geometry.coordinates, I;
2174
+ }, O = () => {
2257
2175
  i = w(), u.push(i), c.push(i);
2258
2176
  }, w = () => {
2259
2177
  let P = (/* @__PURE__ */ new Date()).getTime();
@@ -2271,7 +2189,7 @@ function Xr(e, r, n, o, a) {
2271
2189
  M(P);
2272
2190
  break;
2273
2191
  case "line":
2274
- S(P);
2192
+ _(P);
2275
2193
  break;
2276
2194
  case "polygon":
2277
2195
  D(P);
@@ -2286,9 +2204,9 @@ function Xr(e, r, n, o, a) {
2286
2204
  h.geometry.coordinates.length && (h.geometry.coordinates.length == 1 && h.geometry.coordinates.push(P.lngLat.toArray()), h.geometry.coordinates[h.geometry.coordinates.length - 1] = P.lngLat.toArray(), e.getSource(i).setData(h));
2287
2205
  break;
2288
2206
  case "polygon":
2289
- const O = y.geometry.coordinates[0].length;
2290
- if (O) {
2291
- O == 2 ? y.geometry.coordinates[0][O - 1] = P.lngLat.toArray() : y.geometry.coordinates[0][O - 2] = P.lngLat.toArray();
2207
+ const I = y.geometry.coordinates[0].length;
2208
+ if (I) {
2209
+ I == 2 ? y.geometry.coordinates[0][I - 1] = P.lngLat.toArray() : y.geometry.coordinates[0][I - 2] = P.lngLat.toArray();
2292
2210
  const T = e.getSource(i);
2293
2211
  T.setData(y), p && y.geometry.coordinates[0].length >= 3 && T.setData(k(y));
2294
2212
  }
@@ -2299,28 +2217,24 @@ function Xr(e, r, n, o, a) {
2299
2217
  }
2300
2218
  }, B = (P) => {
2301
2219
  se(P.lngLat, F), X && $();
2302
- }, $ = x(H, 0), J = (P) => {
2220
+ }, $ = g(H, 0), J = (P) => {
2303
2221
  P.preventDefault(), e.off("mousemove", te), e.off("contextmenu", J), d = !0, m.push(P.point), E(!1), e.dragRotate.disable();
2304
- const O = e.getSource(i);
2222
+ const I = e.getSource(i);
2305
2223
  switch (s) {
2306
2224
  case "line":
2307
- h.geometry.coordinates.length && O.setData(re(h));
2225
+ h.geometry.coordinates.length && I.setData(re(h));
2308
2226
  break;
2309
2227
  case "polygon":
2310
2228
  if (y.geometry.coordinates[0].length) {
2311
2229
  const N = y.geometry.coordinates[0].length;
2312
- y.geometry.coordinates[0].splice(N - 2, 1), O.setData(re(y));
2230
+ y.geometry.coordinates[0].splice(N - 2, 1), I.setData(re(y));
2313
2231
  }
2314
- z || (e.setLayoutProperty(i, "visibility", "none"), e.setLayoutProperty(i + "outline", "visibility", "none")), e.setLayoutProperty(i + "point", "visibility", "none"), p && O.setData(re(k(y)));
2232
+ z || (e.setLayoutProperty(i, "visibility", "none"), e.setLayoutProperty(i + "outline", "visibility", "none")), e.setLayoutProperty(i + "point", "visibility", "none"), p && I.setData(re(k(y)));
2315
2233
  break;
2316
2234
  case "free":
2317
2235
  if (y.geometry.coordinates[0].length) {
2318
2236
  const N = y.geometry.coordinates[0].length;
2319
- if (y.geometry.coordinates[0].splice(N - 2, 1), O.setData(re(y)), Er(m)) {
2320
- alert("落区自相交,请重画"), u.pop(), c.pop(), e.removeLayer(i), e.removeLayer(i + "outline");
2321
- return;
2322
- }
2323
- if (z || (e.setLayoutProperty(i, "visibility", "none"), e.setLayoutProperty(i + "outline", "visibility", "none")), p) {
2237
+ if (y.geometry.coordinates[0].splice(N - 2, 1), I.setData(re(y)), z || (e.setLayoutProperty(i, "visibility", "none"), e.setLayoutProperty(i + "outline", "visibility", "none")), p) {
2324
2238
  const T = [...m.slice(m.length / 5), ...m.slice(0, m.length / 5), m.slice(m.length / 5)[0]], ue = T.length > 10 ? 5 : 3, ce = Math.ceil(T.length / ue), Te = [];
2325
2239
  for (let fe = 0; fe < T.length; fe += ce)
2326
2240
  Te.push(T.slice(fe, fe + ce));
@@ -2336,7 +2250,7 @@ function Xr(e, r, n, o, a) {
2336
2250
  const yt = e.unproject(Me[fe]);
2337
2251
  y.geometry.coordinates[0].push(yt.toArray());
2338
2252
  }
2339
- O.setData(re(y));
2253
+ I.setData(re(y));
2340
2254
  }
2341
2255
  }
2342
2256
  break;
@@ -2351,13 +2265,13 @@ function Xr(e, r, n, o, a) {
2351
2265
  }, ie = () => {
2352
2266
  e.getLayer(i) && e.removeLayer(i), e.getLayer(i + "outline") && e.removeLayer(i + "outline"), e.getSource(i) && e.removeSource(i);
2353
2267
  }, Z = () => {
2354
- const P = u, O = [];
2268
+ const P = u, I = [];
2355
2269
  return P.forEach((N, T) => {
2356
2270
  if (e.getSource(N)) {
2357
2271
  const ce = e.getSource(N).serialize().data;
2358
- ce.features ? (ce.features[0].properties.layerId = N, ce.features[0].properties.sourceId = c[T], O.push(...ce.features)) : (ce.properties.layerId = N, ce.properties.sourceId = c[T], O.push(ce));
2272
+ ce.features ? (ce.features[0].properties.layerId = N, ce.features[0].properties.sourceId = c[T], I.push(...ce.features)) : (ce.properties.layerId = N, ce.properties.sourceId = c[T], I.push(ce));
2359
2273
  }
2360
- }), O;
2274
+ }), I;
2361
2275
  }, oe = () => {
2362
2276
  u.forEach((P) => {
2363
2277
  e.getLayer(P) && e.removeLayer(P), e.getLayer(P + "outline") && e.removeLayer(P + "outline"), e.getLayer(P + "point") && e.removeLayer(P + "point"), e.getLayer(P + "text") && e.removeLayer(P + "text");
@@ -2366,16 +2280,16 @@ function Xr(e, r, n, o, a) {
2366
2280
  }), u.length = 0, c.length = 0;
2367
2281
  }, ee = () => {
2368
2282
  m.length = 0, f.features.length = 0, h.geometry.coordinates.length = 0, y.geometry.coordinates.length = 0, y.geometry.coordinates[0] = [], y.properties.result = "";
2369
- }, te = x(G, 30), ae = () => {
2283
+ }, te = g(G, 30), ae = () => {
2370
2284
  Q(), e.off("click", C), e.off("mousemove", te), e.off("contextmenu", J), e.getCanvas().style.cursor = "pointer", E(!1);
2371
2285
  }, ye = () => {
2372
2286
  (s == "free" || s == "polygon" || s == "point" || s == "line") && u.length && (e.removeLayer(u[u.length - 1]), e.getLayer(u[u.length - 1] + "outline") && e.removeLayer(u[u.length - 1] + "outline"), e.getLayer(u[u.length - 1] + "point") && e.removeLayer(u[u.length - 1] + "point"), u.pop());
2373
2287
  }, we = () => {
2374
2288
  if ((s == "free" || s == "polygon") && c.length) {
2375
- const P = u.length - c.length, O = c.slice(P);
2376
- if (P !== 0 && O.length) {
2377
- const ue = e.getSource(O[0]).serialize().data.valueOf();
2378
- e.getLayer(O[0]) || (u.push(O[0]), _e(e, O[0], O[0], { "fill-color": ue.properties["fill-color"] }), xe(e, O[0] + "outline", O[0], { "line-color": "black", "line-width": 2, ...ue.properties }));
2289
+ const P = u.length - c.length, I = c.slice(P);
2290
+ if (P !== 0 && I.length) {
2291
+ const ue = e.getSource(I[0]).serialize().data.valueOf();
2292
+ e.getLayer(I[0]) || (u.push(I[0]), Se(e, I[0], I[0], { "fill-color": ue.properties["fill-color"] }), xe(e, I[0] + "outline", I[0], { "line-color": "black", "line-width": 2, ...ue.properties }));
2379
2293
  }
2380
2294
  }
2381
2295
  };
@@ -2383,30 +2297,29 @@ function Xr(e, r, n, o, a) {
2383
2297
  const He = (P) => {
2384
2298
  qe = P;
2385
2299
  };
2386
- let Se, Ee = !1, Le = "";
2300
+ let _e, Ee = !1, Le = "";
2387
2301
  e.on("mousedown", (P) => {
2388
- const O = e.queryRenderedFeatures(P.point);
2389
- O.length > 0 && (Le = O[0].layer.source, qe && Ne(P));
2302
+ const I = e.queryRenderedFeatures(P.point);
2303
+ I.length > 0 && (Le = I[0].layer.source, qe && Ne(P));
2390
2304
  });
2391
2305
  const Ne = (P) => {
2392
- e.dragPan.disable(), Se = P.lngLat, Ee = !0, e.on("mouseup", Pe), e.on("mousemove", ht), a && a();
2306
+ e.dragPan.disable(), _e = P.lngLat, Ee = !0, e.on("mouseup", Pe), e.on("mousemove", ht), a && a();
2393
2307
  }, Pe = () => {
2394
2308
  if (Ee = !1, e.off("mouseup", Pe), e.off("mousemove", ht), e.dragPan.enable(), o) {
2395
- const O = e.getSource(Le).serialize().data;
2396
- o(O);
2309
+ const I = e.getSource(Le).serialize().data;
2310
+ o(I);
2397
2311
  }
2398
2312
  }, ht = (P) => {
2399
- if (!Ee)
2400
- return;
2401
- const O = P.lngLat, N = O.lng - Se.lng, T = O.lat - Se.lat;
2402
- Se = O;
2313
+ if (!Ee) return;
2314
+ const I = P.lngLat, N = I.lng - _e.lng, T = I.lat - _e.lat;
2315
+ _e = I;
2403
2316
  const ue = e.getSource(Le), ce = ue.serialize().data;
2404
2317
  ce.geometry.coordinates = ce.geometry.coordinates.map((Te) => Te.map((Me) => [Me[0] + N, Me[1] + T])), ue.setData(ce);
2405
2318
  };
2406
- return { startDraw: _, revoke: ye, redo: we, getFeaturesFromDraw: Z, clearDraw: oe, stopDraw: ae, setBrushSize: K, setValue: W, setDrawMethod: v, setDragMode: He };
2319
+ return { startDraw: S, revoke: ye, redo: we, getFeaturesFromDraw: Z, clearDraw: oe, stopDraw: ae, setBrushSize: K, setValue: W, setDrawMethod: v, setDragMode: He };
2407
2320
  }
2408
- function Yr(e, r) {
2409
- let n = "free", o = "", a = [], s = [], i = {}, u = !1, c = !0, l = !0, g = !1, d = [], p = {
2321
+ function Ar(e, r) {
2322
+ let n = "free", o = "", a = [], s = [], i = {}, u = !1, c = !0, l = !0, x = !1, d = [], p = {
2410
2323
  type: "FeatureCollection",
2411
2324
  features: []
2412
2325
  }, z = {
@@ -2432,9 +2345,9 @@ function Yr(e, r) {
2432
2345
  }
2433
2346
  };
2434
2347
  const F = (w) => {
2435
- e.off("click", D), e.off("mousemove", I), e.off("contextmenu", Y), Q(), u && (c = !0, S(!1)), u = !0, n = w.type || "point", l = w.measure || !1, g = w.smooth || !1, i = w, z.properties = w, m.properties = w, b.properties = w, e.on("click", D), e.getCanvas().style.cursor = "crosshair";
2348
+ e.off("click", D), e.off("mousemove", O), e.off("contextmenu", Y), Q(), u && (c = !0, _(!1)), u = !0, n = w.type || "point", l = w.measure || !1, x = w.smooth || !1, i = w, z.properties = w, m.properties = w, b.properties = w, e.on("click", D), e.getCanvas().style.cursor = "crosshair";
2436
2349
  }, X = (w) => {
2437
- v(), Q(), e.addSource(o, { type: "geojson", data: p }), ze(e, o, o, i), Ie(e, o + "text", o, { visibility: l }), p.features.push({
2350
+ v(), Q(), e.addSource(o, { type: "geojson", data: p }), ze(e, o, o, i), Oe(e, o + "text", o, { visibility: l }), p.features.push({
2438
2351
  type: "Feature",
2439
2352
  properties: i,
2440
2353
  geometry: { type: "Point", coordinates: w.lngLat.toArray() }
@@ -2446,24 +2359,24 @@ function Yr(e, r) {
2446
2359
  geometry: { type: "Point", coordinates: w.lngLat.toArray() }
2447
2360
  }), e.getSource(o).setData(re(p)), r && r(R());
2448
2361
  }, h = (w) => {
2449
- c && (v(), Q(), e.addSource(o, { type: "geojson", data: z }), e.addSource(o + "text", { type: "geojson", data: p }), xe(e, o, o), ze(e, o + "point", o, i), Ie(e, o + "text", o + "text", { visibility: l }), c = !1, e.on("mousemove", I), e.on("contextmenu", Y)), z.geometry.coordinates.push(w.lngLat.toArray()), e.getSource(o).setData(z), p.features.push({
2362
+ c && (v(), Q(), e.addSource(o, { type: "geojson", data: z }), e.addSource(o + "text", { type: "geojson", data: p }), xe(e, o, o), ze(e, o + "point", o, i), Oe(e, o + "text", o + "text", { visibility: l }), c = !1, e.on("mousemove", O), e.on("contextmenu", Y)), z.geometry.coordinates.push(w.lngLat.toArray()), e.getSource(o).setData(z), p.features.push({
2450
2363
  type: "Feature",
2451
2364
  properties: {},
2452
2365
  geometry: { type: "Point", coordinates: w.lngLat.toArray() }
2453
2366
  }), e.getSource(o + "text").setData(p);
2454
2367
  }, y = (w) => {
2455
- c && (v(), Q(), e.addSource(o, { type: "geojson", data: m }), e.addSource(o + "area", { type: "geojson", data: b }), _e(e, o, o), xe(e, o + "outline", o, { "line-color": "black", "line-width": 2, ...i }), ze(e, o + "point", o), Ie(e, o + "area", o + "area", { visibility: l }), c = !1, e.on("mousemove", I), e.on("contextmenu", Y)), m.geometry.coordinates[0].length >= 3 && m.geometry.coordinates[0].pop(), m.geometry.coordinates[0].push(w.lngLat.toArray()), m.geometry.coordinates[0].push(m.geometry.coordinates[0][0]), d.push(w.point), e.getSource(o).setData(m), S(!0);
2456
- }, x = (w) => {
2457
- c && (v(), Q(), e.addSource(o, { type: "geojson", data: m }), e.addSource(o + "area", { type: "geojson", data: b }), _e(e, o, o, i), xe(e, o + "outline", o, { "line-color": "black", "line-width": 2, ...i }), Ie(e, o + "area", o + "area", { visibility: l }), c = !1, m.geometry.coordinates[0].push(w.lngLat.toArray()), e.getSource(o).setData(m), e.on("mousemove", I), e.on("contextmenu", Y), S(!0));
2458
- }, _ = (w) => {
2368
+ c && (v(), Q(), e.addSource(o, { type: "geojson", data: m }), e.addSource(o + "area", { type: "geojson", data: b }), Se(e, o, o), xe(e, o + "outline", o, { "line-color": "black", "line-width": 2, ...i }), ze(e, o + "point", o), Oe(e, o + "area", o + "area", { visibility: l }), c = !1, e.on("mousemove", O), e.on("contextmenu", Y)), m.geometry.coordinates[0].length >= 3 && m.geometry.coordinates[0].pop(), m.geometry.coordinates[0].push(w.lngLat.toArray()), m.geometry.coordinates[0].push(m.geometry.coordinates[0][0]), d.push(w.point), e.getSource(o).setData(m), _(!0);
2369
+ }, g = (w) => {
2370
+ c && (v(), Q(), e.addSource(o, { type: "geojson", data: m }), e.addSource(o + "area", { type: "geojson", data: b }), Se(e, o, o, i), xe(e, o + "outline", o, { "line-color": "black", "line-width": 2, ...i }), Oe(e, o + "area", o + "area", { visibility: l }), c = !1, m.geometry.coordinates[0].push(w.lngLat.toArray()), e.getSource(o).setData(m), e.on("mousemove", O), e.on("contextmenu", Y), _(!0));
2371
+ }, S = (w) => {
2459
2372
  if (c) {
2460
- v(), Q(), e.addSource(o, { type: "geojson", data: m }), e.addSource(o + "area", { type: "geojson", data: b }), e.addSource(o + "point", { type: "geojson", data: p }), _e(e, o, o, i), xe(e, o + "outline", o, { "line-color": "black", "line-width": 2, ...i }), ze(e, o + "point", o + "point"), Ie(e, o + "area", o + "area", { visibility: l }), c = !1;
2373
+ v(), Q(), e.addSource(o, { type: "geojson", data: m }), e.addSource(o + "area", { type: "geojson", data: b }), e.addSource(o + "point", { type: "geojson", data: p }), Se(e, o, o, i), xe(e, o + "outline", o, { "line-color": "black", "line-width": 2, ...i }), ze(e, o + "point", o + "point"), Oe(e, o + "area", o + "area", { visibility: l }), c = !1;
2461
2374
  const E = {
2462
2375
  type: "Feature",
2463
2376
  properties: {},
2464
2377
  geometry: { type: "Point", coordinates: w.lngLat.toArray() }
2465
2378
  };
2466
- p.features.push(re(E)), p.features.push(re(E)), b.geometry.coordinates = w.lngLat.toArray(), e.getSource(o + "point").setData(p), e.on("mousemove", I), e.on("contextmenu", Y), S(!0);
2379
+ p.features.push(re(E)), p.features.push(re(E)), b.geometry.coordinates = w.lngLat.toArray(), e.getSource(o + "point").setData(p), e.on("mousemove", O), e.on("contextmenu", Y), _(!0);
2467
2380
  }
2468
2381
  }, v = () => {
2469
2382
  o = M(), a.push(o), s.push(o);
@@ -2473,7 +2386,7 @@ function Yr(e, r) {
2473
2386
  const G = (w + Math.random() * 16) % 16 | 0;
2474
2387
  return w = Math.floor(w / 16), (C === "x" ? G : G & 3 | 8).toString(16);
2475
2388
  });
2476
- }, S = (w) => {
2389
+ }, _ = (w) => {
2477
2390
  ["scrollZoom", "boxZoom", "dragPan", "keyboard", "doubleClickZoom", "touchZoomRotate"].forEach((C) => {
2478
2391
  w ? e[C].disable() : e[C].enable();
2479
2392
  });
@@ -2492,10 +2405,10 @@ function Yr(e, r) {
2492
2405
  y(w);
2493
2406
  break;
2494
2407
  case "free":
2495
- x(w);
2408
+ g(w);
2496
2409
  break;
2497
2410
  case "circle":
2498
- _(w);
2411
+ S(w);
2499
2412
  break;
2500
2413
  }
2501
2414
  }, A = (w) => {
@@ -2517,7 +2430,7 @@ function Yr(e, r) {
2517
2430
  b.geometry.coordinates = C.geometry.coordinates, b.properties.result = $e(ie, 2) + "km²";
2518
2431
  }
2519
2432
  const Z = e.getSource(o);
2520
- Z.setData(m), e.getSource(o + "area").setData(b), g && m.geometry.coordinates[0].length >= 3 && Z.setData(q(m));
2433
+ Z.setData(m), e.getSource(o + "area").setData(b), x && m.geometry.coordinates[0].length >= 3 && Z.setData(q(m));
2521
2434
  }
2522
2435
  break;
2523
2436
  case "free":
@@ -2535,7 +2448,7 @@ function Yr(e, r) {
2535
2448
  case "circle":
2536
2449
  if (p.features.length) {
2537
2450
  p.features[1].geometry.coordinates = w.lngLat.toArray();
2538
- var G = pe(p.features[0].geometry.coordinates), B = pe(p.features[1].geometry.coordinates), $ = st(G, B, { units: "miles" }), J = { steps: 500, units: "miles", properties: { foo: "bar" } }, U = It(G, $, J);
2451
+ var G = pe(p.features[0].geometry.coordinates), B = pe(p.features[1].geometry.coordinates), $ = st(G, B, { units: "miles" }), J = { steps: 500, units: "miles", properties: { foo: "bar" } }, U = Ot(G, $, J);
2539
2452
  m.geometry.coordinates = U.geometry.coordinates;
2540
2453
  const ie = tt(m) / 1e6;
2541
2454
  b.properties.result = $e(ie, 2) + "km²";
@@ -2545,17 +2458,17 @@ function Yr(e, r) {
2545
2458
  break;
2546
2459
  }
2547
2460
  }, Y = (w) => {
2548
- w.preventDefault(), e.off("mousemove", I), e.off("contextmenu", Y), c = !0, d.push(w.point), S(!1);
2461
+ w.preventDefault(), e.off("mousemove", O), e.off("contextmenu", Y), c = !0, d.push(w.point), _(!1);
2549
2462
  const E = e.getSource(o);
2550
2463
  switch (n) {
2551
2464
  case "line":
2552
- z.geometry.coordinates.length && (console.log(z), E.setData(re(z)), e.removeLayer(o + "point"), g && z.geometry.coordinates.length >= 2 && E.setData(se(z)));
2465
+ z.geometry.coordinates.length && (console.log(z), E.setData(re(z)), e.removeLayer(o + "point"), x && z.geometry.coordinates.length >= 2 && E.setData(se(z)));
2553
2466
  break;
2554
2467
  case "polygon":
2555
- m.geometry.coordinates[0].length && E.setData(re(m)), e.setLayoutProperty(o + "point", "visibility", "none"), g && E.setData(re(q(m)));
2468
+ m.geometry.coordinates[0].length && E.setData(re(m)), e.setLayoutProperty(o + "point", "visibility", "none"), x && E.setData(re(q(m)));
2556
2469
  break;
2557
2470
  case "free":
2558
- if (m.geometry.coordinates[0].length && (E.setData(re(m)), g)) {
2471
+ if (m.geometry.coordinates[0].length && (E.setData(re(m)), x)) {
2559
2472
  const C = [...d.slice(d.length / 5), ...d.slice(0, d.length / 5), d.slice(d.length / 5)[0]], G = C.length > 10 ? 5 : 3, B = Math.ceil(C.length / G), $ = [];
2560
2473
  for (let U = 0; U < C.length; U += B)
2561
2474
  $.push(C.slice(U, U + B));
@@ -2603,10 +2516,10 @@ function Yr(e, r) {
2603
2516
  e.removeSource(w), e.getSource(w + "point") && e.removeSource(w + "point"), e.getSource(w + "text") && e.removeSource(w + "text"), e.getSource(w + "area") && e.removeSource(w + "area");
2604
2517
  }), a.length = 0, s.length = 0;
2605
2518
  }, W = () => {
2606
- e.off("click", D), e.off("mousemove", I), e.off("contextmenu", Y), e.getCanvas().style.cursor = "pointer", S(!1);
2519
+ e.off("click", D), e.off("mousemove", O), e.off("contextmenu", Y), e.getCanvas().style.cursor = "pointer", _(!1);
2607
2520
  }, Q = () => {
2608
2521
  d.length = 0, p.features.length = 0, z.geometry.coordinates.length = 0, m.geometry.coordinates.length = 0, m.geometry.coordinates[0] = [], m.properties.result = "", b.geometry.coordinates.length = 0;
2609
- }, I = ((w, E) => {
2522
+ }, O = ((w, E) => {
2610
2523
  let C = 0;
2611
2524
  return function(...G) {
2612
2525
  const B = (/* @__PURE__ */ new Date()).getTime();
@@ -2616,6 +2529,6 @@ function Yr(e, r) {
2616
2529
  return { startMeasure: F, clearMeasure: K, stopMeasure: W, getFeaturesFromMeasure: R, clearLayerById: H };
2617
2530
  }
2618
2531
  export {
2619
- Xr as draw,
2620
- Yr as measure
2532
+ Er as draw,
2533
+ Ar as measure
2621
2534
  };