@florasync/leaflet-geokit 0.7.0 → 0.8.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.
@@ -126,13 +126,13 @@ function so() {
126
126
  var i = Math.pow(10, e === void 0 ? 6 : e);
127
127
  return Math.round(t * i) / i;
128
128
  }
129
- function A(t) {
129
+ function E(t) {
130
130
  return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
131
131
  }
132
- function E(t) {
133
- return A(t).split(/\s+/);
132
+ function P(t) {
133
+ return E(t).split(/\s+/);
134
134
  }
135
- function P(t, e) {
135
+ function M(t, e) {
136
136
  Object.prototype.hasOwnProperty.call(t, "options") || (t.options = t.options ? r(t.options) : {});
137
137
  for (var i in e)
138
138
  t.options[i] = e[i];
@@ -144,9 +144,9 @@ function so() {
144
144
  o.push(encodeURIComponent(i ? l.toUpperCase() : l) + "=" + encodeURIComponent(t[l]));
145
145
  return (!e || e.indexOf("?") === -1 ? "?" : "&") + o.join("&");
146
146
  }
147
- var H = /\{ *([\w_ -]+) *\}/g;
148
- function S(t, e) {
149
- return t.replace(H, function(i, o) {
147
+ var F = /\{ *([\w_ -]+) *\}/g;
148
+ function C(t, e) {
149
+ return t.replace(F, function(i, o) {
150
150
  var l = e[o];
151
151
  if (l === void 0)
152
152
  throw new Error("No value provided for variable " + i);
@@ -196,11 +196,11 @@ function so() {
196
196
  wrapNum: g,
197
197
  falseFn: w,
198
198
  formatNum: x,
199
- trim: A,
200
- splitWords: E,
201
- setOptions: P,
199
+ trim: E,
200
+ splitWords: P,
201
+ setOptions: M,
202
202
  getParamString: U,
203
- template: S,
203
+ template: C,
204
204
  isArray: D,
205
205
  indexOf: G,
206
206
  emptyImageUrl: Y,
@@ -213,7 +213,7 @@ function so() {
213
213
  }
214
214
  ut.extend = function(t) {
215
215
  var e = function() {
216
- P(this), this.initialize && this.initialize.apply(this, arguments), this.callInitHooks();
216
+ M(this), this.initialize && this.initialize.apply(this, arguments), this.callInitHooks();
217
217
  }, i = e.__super__ = this.prototype, o = r(i);
218
218
  o.constructor = e, e.prototype = o;
219
219
  for (var l in this)
@@ -256,7 +256,7 @@ function so() {
256
256
  for (var o in t)
257
257
  this._on(o, t[o], e);
258
258
  else {
259
- t = E(t);
259
+ t = P(t);
260
260
  for (var l = 0, u = t.length; l < u; l++)
261
261
  this._on(t[l], e, i);
262
262
  }
@@ -280,7 +280,7 @@ function so() {
280
280
  for (var o in t)
281
281
  this._off(o, t[o], e);
282
282
  else {
283
- t = E(t);
283
+ t = P(t);
284
284
  for (var l = arguments.length === 1, u = 0, m = t.length; u < m; u++)
285
285
  l ? this._off(t[u]) : this._off(t[u], e, i);
286
286
  }
@@ -382,7 +382,7 @@ function so() {
382
382
  for (var o in t)
383
383
  this._on(o, t[o], e, !0);
384
384
  else {
385
- t = E(t);
385
+ t = P(t);
386
386
  for (var l = 0, u = t.length; l < u; l++)
387
387
  this._on(t[l], e, i, !0);
388
388
  }
@@ -1131,7 +1131,7 @@ function so() {
1131
1131
  }
1132
1132
  return i === "auto" ? null : i;
1133
1133
  }
1134
- function F(t, e, i) {
1134
+ function H(t, e, i) {
1135
1135
  var o = document.createElement(t);
1136
1136
  return o.className = e || "", i && i.appendChild(o), o;
1137
1137
  }
@@ -1159,7 +1159,7 @@ function so() {
1159
1159
  }
1160
1160
  function B(t, e) {
1161
1161
  if (t.classList !== void 0)
1162
- for (var i = E(e), o = 0, l = i.length; o < l; o++)
1162
+ for (var i = P(e), o = 0, l = i.length; o < l; o++)
1163
1163
  t.classList.add(i[o]);
1164
1164
  else if (!ti(t, e)) {
1165
1165
  var u = Le(t);
@@ -1167,7 +1167,7 @@ function so() {
1167
1167
  }
1168
1168
  }
1169
1169
  function K(t, e) {
1170
- t.classList !== void 0 ? t.classList.remove(e) : ei(t, A((" " + Le(t) + " ").replace(" " + e + " ", " ")));
1170
+ t.classList !== void 0 ? t.classList.remove(e) : ei(t, E((" " + Le(t) + " ").replace(" " + e + " ", " ")));
1171
1171
  }
1172
1172
  function ei(t, e) {
1173
1173
  t.className.baseVal === void 0 ? t.className = e : t.className.baseVal = e;
@@ -1260,7 +1260,7 @@ function so() {
1260
1260
  TRANSITION_END: nn,
1261
1261
  get: on,
1262
1262
  getStyle: ee,
1263
- create: F,
1263
+ create: H,
1264
1264
  remove: J,
1265
1265
  empty: ye,
1266
1266
  toFront: Zt,
@@ -1293,7 +1293,7 @@ function so() {
1293
1293
  for (var l in e)
1294
1294
  hi(t, l, e[l], i);
1295
1295
  else {
1296
- e = E(e);
1296
+ e = P(e);
1297
1297
  for (var u = 0, m = e.length; u < m; u++)
1298
1298
  hi(t, e[u], i, o);
1299
1299
  }
@@ -1306,7 +1306,7 @@ function so() {
1306
1306
  else if (e && typeof e == "object")
1307
1307
  for (var l in e)
1308
1308
  ci(t, l, e[l], i);
1309
- else if (e = E(e), arguments.length === 2)
1309
+ else if (e = P(e), arguments.length === 2)
1310
1310
  sn(t, function(v) {
1311
1311
  return G(e, v) !== -1;
1312
1312
  });
@@ -1541,7 +1541,7 @@ function so() {
1541
1541
  trackResize: !0
1542
1542
  },
1543
1543
  initialize: function(t, e) {
1544
- e = P(this, e), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this._initContainer(t), this._initLayout(), this._onResize = a(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.zoom !== void 0 && (this._zoom = this._limitZoom(e.zoom)), e.center && e.zoom !== void 0 && this.setView(N(e.center), e.zoom, { reset: !0 }), this.callInitHooks(), this._zoomAnimated = te && T.any3d && !T.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), O(this._proxy, nn, this._catchTransitionEnd, this)), this._addLayers(this.options.layers);
1544
+ e = M(this, e), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this._initContainer(t), this._initLayout(), this._onResize = a(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.zoom !== void 0 && (this._zoom = this._limitZoom(e.zoom)), e.center && e.zoom !== void 0 && this.setView(N(e.center), e.zoom, { reset: !0 }), this.callInitHooks(), this._zoomAnimated = te && T.any3d && !T.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), O(this._proxy, nn, this._catchTransitionEnd, this)), this._addLayers(this.options.layers);
1545
1545
  },
1546
1546
  // @section Methods for modifying map state
1547
1547
  // @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this
@@ -1642,9 +1642,9 @@ function so() {
1642
1642
  this._stop();
1643
1643
  var o = this.project(this.getCenter()), l = this.project(t), u = this.getSize(), m = this._zoom;
1644
1644
  t = N(t), e = e === void 0 ? m : e;
1645
- var v = Math.max(u.x, u.y), y = v * this.getZoomScale(m, e), b = l.distanceTo(o) || 1, M = 1.42, C = M * M;
1645
+ var v = Math.max(u.x, u.y), y = v * this.getZoomScale(m, e), b = l.distanceTo(o) || 1, A = 1.42, S = A * A;
1646
1646
  function R($) {
1647
- var Oe = $ ? -1 : 1, Br = $ ? y : v, Rr = y * y - v * v + Oe * C * C * b * b, Ur = 2 * Br * C * b, xi = Rr / Ur, Vn = Math.sqrt(xi * xi + 1) - xi, Nr = Vn < 1e-9 ? -18 : Math.log(Vn);
1647
+ var Oe = $ ? -1 : 1, Br = $ ? y : v, Rr = y * y - v * v + Oe * S * S * b * b, Ur = 2 * Br * S * b, xi = Rr / Ur, Vn = Math.sqrt(xi * xi + 1) - xi, Nr = Vn < 1e-9 ? -18 : Math.log(Vn);
1648
1648
  return Nr;
1649
1649
  }
1650
1650
  function st($) {
@@ -1658,15 +1658,15 @@ function so() {
1658
1658
  }
1659
1659
  var ct = R(0);
1660
1660
  function qt($) {
1661
- return v * (et(ct) / et(ct + M * $));
1661
+ return v * (et(ct) / et(ct + A * $));
1662
1662
  }
1663
1663
  function Dr($) {
1664
- return v * (et(ct) * mt(ct + M * $) - st(ct)) / C;
1664
+ return v * (et(ct) * mt(ct + A * $) - st(ct)) / S;
1665
1665
  }
1666
1666
  function Ir($) {
1667
1667
  return 1 - Math.pow(1 - $, 1.5);
1668
1668
  }
1669
- var zr = Date.now(), Fn = (R(1) - ct) / M, Or = i.duration ? 1e3 * i.duration : 1e3 * Fn * 0.8;
1669
+ var zr = Date.now(), Fn = (R(1) - ct) / A, Or = i.duration ? 1e3 * i.duration : 1e3 * Fn * 0.8;
1670
1670
  function Gn() {
1671
1671
  var $ = (Date.now() - zr) / Or, Oe = Ir($) * Fn;
1672
1672
  $ <= 1 ? (this._flyToFrame = ot(Gn, this), this._move(
@@ -1718,8 +1718,8 @@ function so() {
1718
1718
  var i = I(e.paddingTopLeft || e.padding || [0, 0]), o = I(e.paddingBottomRight || e.padding || [0, 0]), l = this.project(this.getCenter()), u = this.project(t), m = this.getPixelBounds(), v = lt([m.min.add(i), m.max.subtract(o)]), y = v.getSize();
1719
1719
  if (!v.contains(u)) {
1720
1720
  this._enforcingBounds = !0;
1721
- var b = u.subtract(v.getCenter()), M = v.extend(u).getSize().subtract(y);
1722
- l.x += b.x < 0 ? -M.x : M.x, l.y += b.y < 0 ? -M.y : M.y, this.panTo(this.unproject(l), e), this._enforcingBounds = !1;
1721
+ var b = u.subtract(v.getCenter()), A = v.extend(u).getSize().subtract(y);
1722
+ l.x += b.x < 0 ? -A.x : A.x, l.y += b.y < 0 ? -A.y : A.y, this.panTo(this.unproject(l), e), this._enforcingBounds = !1;
1723
1723
  }
1724
1724
  return this;
1725
1725
  },
@@ -1848,7 +1848,7 @@ function so() {
1848
1848
  // then returns it. The pane is created as a child of `container`, or
1849
1849
  // as a child of the main map pane if not set.
1850
1850
  createPane: function(t, e) {
1851
- var i = "leaflet-pane" + (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""), o = F("div", i, e || this._mapPane);
1851
+ var i = "leaflet-pane" + (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""), o = H("div", i, e || this._mapPane);
1852
1852
  return t && (this._panes[t] = o), o;
1853
1853
  },
1854
1854
  // @section Methods for Getting Map State
@@ -1885,8 +1885,8 @@ function so() {
1885
1885
  // the given bounds in its entirety.
1886
1886
  getBoundsZoom: function(t, e, i) {
1887
1887
  t = X(t), i = I(i || [0, 0]);
1888
- var o = this.getZoom() || 0, l = this.getMinZoom(), u = this.getMaxZoom(), m = t.getNorthWest(), v = t.getSouthEast(), y = this.getSize().subtract(i), b = lt(this.project(v, o), this.project(m, o)).getSize(), M = T.any3d ? this.options.zoomSnap : 1, C = y.x / b.x, R = y.y / b.y, st = e ? Math.max(C, R) : Math.min(C, R);
1889
- return o = this.getScaleZoom(st, o), M && (o = Math.round(o / (M / 100)) * (M / 100), o = e ? Math.ceil(o / M) * M : Math.floor(o / M) * M), Math.max(l, Math.min(u, o));
1888
+ var o = this.getZoom() || 0, l = this.getMinZoom(), u = this.getMaxZoom(), m = t.getNorthWest(), v = t.getSouthEast(), y = this.getSize().subtract(i), b = lt(this.project(v, o), this.project(m, o)).getSize(), A = T.any3d ? this.options.zoomSnap : 1, S = y.x / b.x, R = y.y / b.y, st = e ? Math.max(S, R) : Math.min(S, R);
1889
+ return o = this.getScaleZoom(st, o), A && (o = Math.round(o / (A / 100)) * (A / 100), o = e ? Math.ceil(o / A) * A : Math.floor(o / A) * A), Math.max(l, Math.min(u, o));
1890
1890
  },
1891
1891
  // @method getSize(): Point
1892
1892
  // Returns the current size of the map container (in pixels).
@@ -2268,7 +2268,7 @@ function so() {
2268
2268
  return (e && e.animate) !== !0 && !this.getSize().contains(i) ? !1 : (this.panBy(i, e), !0);
2269
2269
  },
2270
2270
  _createAnimProxy: function() {
2271
- var t = this._proxy = F("div", "leaflet-proxy leaflet-zoom-animated");
2271
+ var t = this._proxy = H("div", "leaflet-proxy leaflet-zoom-animated");
2272
2272
  this._panes.mapPane.appendChild(t), this.on("zoomanim", function(e) {
2273
2273
  var i = $e, o = this._proxy.style[i];
2274
2274
  Dt(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1)), o === this._proxy.style[i] && this._animatingZoom && this._onZoomTransitionEnd();
@@ -2321,7 +2321,7 @@ function so() {
2321
2321
  position: "topright"
2322
2322
  },
2323
2323
  initialize: function(t) {
2324
- P(this, t);
2324
+ M(this, t);
2325
2325
  },
2326
2326
  /* @section
2327
2327
  * Classes extending L.Control will inherit the following methods:
@@ -2373,10 +2373,10 @@ function so() {
2373
2373
  return t.remove(), this;
2374
2374
  },
2375
2375
  _initControlPos: function() {
2376
- var t = this._controlCorners = {}, e = "leaflet-", i = this._controlContainer = F("div", e + "control-container", this._container);
2376
+ var t = this._controlCorners = {}, e = "leaflet-", i = this._controlContainer = H("div", e + "control-container", this._container);
2377
2377
  function o(l, u) {
2378
2378
  var m = e + l + " " + e + u;
2379
- t[l + u] = F("div", m, i);
2379
+ t[l + u] = H("div", m, i);
2380
2380
  }
2381
2381
  o("top", "left"), o("top", "right"), o("bottom", "left"), o("bottom", "right");
2382
2382
  },
@@ -2415,7 +2415,7 @@ function so() {
2415
2415
  }
2416
2416
  },
2417
2417
  initialize: function(t, e, i) {
2418
- P(this, i), this._layerControlInputs = [], this._layers = [], this._lastZIndex = 0, this._handlingClick = !1, this._preventClick = !1;
2418
+ M(this, i), this._layerControlInputs = [], this._layers = [], this._lastZIndex = 0, this._handlingClick = !1, this._preventClick = !1;
2419
2419
  for (var o in t)
2420
2420
  this._addLayer(t[o], o);
2421
2421
  for (o in e)
@@ -2465,14 +2465,14 @@ function so() {
2465
2465
  return K(this._container, "leaflet-control-layers-expanded"), this;
2466
2466
  },
2467
2467
  _initLayout: function() {
2468
- var t = "leaflet-control-layers", e = this._container = F("div", t), i = this.options.collapsed;
2468
+ var t = "leaflet-control-layers", e = this._container = H("div", t), i = this.options.collapsed;
2469
2469
  e.setAttribute("aria-haspopup", !0), re(e), di(e);
2470
- var o = this._section = F("section", t + "-list");
2470
+ var o = this._section = H("section", t + "-list");
2471
2471
  i && (this._map.on("click", this.collapse, this), O(e, {
2472
2472
  mouseenter: this._expandSafely,
2473
2473
  mouseleave: this.collapse
2474
2474
  }, this));
2475
- var l = this._layersLink = F("a", t + "-toggle", e);
2475
+ var l = this._layersLink = H("a", t + "-toggle", e);
2476
2476
  l.href = "#", l.title = "Layers", l.setAttribute("role", "button"), O(l, {
2477
2477
  keydown: function(u) {
2478
2478
  u.keyCode === 13 && this._expandSafely();
@@ -2481,7 +2481,7 @@ function so() {
2481
2481
  click: function(u) {
2482
2482
  it(u), this._expandSafely();
2483
2483
  }
2484
- }, this), i || this.expand(), this._baseLayersList = F("div", t + "-base", o), this._separator = F("div", t + "-separator", o), this._overlaysList = F("div", t + "-overlays", o), e.appendChild(o);
2484
+ }, this), i || this.expand(), this._baseLayersList = H("div", t + "-base", o), this._separator = H("div", t + "-separator", o), this._overlaysList = H("div", t + "-overlays", o), e.appendChild(o);
2485
2485
  },
2486
2486
  _getLayer: function(t) {
2487
2487
  for (var e = 0; e < this._layers.length; e++)
@@ -2575,7 +2575,7 @@ function so() {
2575
2575
  zoomOutTitle: "Zoom out"
2576
2576
  },
2577
2577
  onAdd: function(t) {
2578
- var e = "leaflet-control-zoom", i = F("div", e + " leaflet-bar"), o = this.options;
2578
+ var e = "leaflet-control-zoom", i = H("div", e + " leaflet-bar"), o = this.options;
2579
2579
  return this._zoomInButton = this._createButton(
2580
2580
  o.zoomInText,
2581
2581
  o.zoomInTitle,
@@ -2606,7 +2606,7 @@ function so() {
2606
2606
  !this._disabled && this._map._zoom > this._map.getMinZoom() && this._map.zoomOut(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1));
2607
2607
  },
2608
2608
  _createButton: function(t, e, i, o, l) {
2609
- var u = F("a", i, o);
2609
+ var u = H("a", i, o);
2610
2610
  return u.innerHTML = t, u.href = "#", u.title = e, u.setAttribute("role", "button"), u.setAttribute("aria-label", e), re(u), O(u, "click", Ot), O(u, "click", l, this), O(u, "click", this._refocusOnMap, this), u;
2611
2611
  },
2612
2612
  _updateDisabled: function() {
@@ -2639,14 +2639,14 @@ function so() {
2639
2639
  // If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).
2640
2640
  },
2641
2641
  onAdd: function(t) {
2642
- var e = "leaflet-control-scale", i = F("div", e), o = this.options;
2642
+ var e = "leaflet-control-scale", i = H("div", e), o = this.options;
2643
2643
  return this._addScales(o, e + "-line", i), t.on(o.updateWhenIdle ? "moveend" : "move", this._update, this), t.whenReady(this._update, this), i;
2644
2644
  },
2645
2645
  onRemove: function(t) {
2646
2646
  t.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this);
2647
2647
  },
2648
2648
  _addScales: function(t, e, i) {
2649
- t.metric && (this._mScale = F("div", e, i)), t.imperial && (this._iScale = F("div", e, i));
2649
+ t.metric && (this._mScale = H("div", e, i)), t.imperial && (this._iScale = H("div", e, i));
2650
2650
  },
2651
2651
  _update: function() {
2652
2652
  var t = this._map, e = t.getSize().y / 2, i = t.distance(
@@ -2685,10 +2685,10 @@ function so() {
2685
2685
  prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' + (T.inlineSvg ? $o + " " : "") + "Leaflet</a>"
2686
2686
  },
2687
2687
  initialize: function(t) {
2688
- P(this, t), this._attributions = {};
2688
+ M(this, t), this._attributions = {};
2689
2689
  },
2690
2690
  onAdd: function(t) {
2691
- t.attributionControl = this, this._container = F("div", "leaflet-control-attribution"), re(this._container);
2691
+ t.attributionControl = this, this._container = H("div", "leaflet-control-attribution"), re(this._container);
2692
2692
  for (var e in t._layers)
2693
2693
  t._layers[e].getAttribution && this.addAttribution(t._layers[e].getAttribution());
2694
2694
  return this._update(), t.on("layeradd", this._addAttribution, this), this._container;
@@ -2776,7 +2776,7 @@ function so() {
2776
2776
  // @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)
2777
2777
  // Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).
2778
2778
  initialize: function(t, e, i, o) {
2779
- P(this, o), this._element = t, this._dragStartTarget = e || t, this._preventOutline = i;
2779
+ M(this, o), this._element = t, this._dragStartTarget = e || t, this._preventOutline = i;
2780
2780
  },
2781
2781
  // @method enable()
2782
2782
  // Enables the dragging ability
@@ -2830,33 +2830,33 @@ function so() {
2830
2830
  }
2831
2831
  });
2832
2832
  function pn(t, e, i) {
2833
- var o, l = [1, 4, 2, 8], u, m, v, y, b, M, C, R;
2834
- for (u = 0, M = t.length; u < M; u++)
2833
+ var o, l = [1, 4, 2, 8], u, m, v, y, b, A, S, R;
2834
+ for (u = 0, A = t.length; u < A; u++)
2835
2835
  t[u]._code = Bt(t[u], e);
2836
2836
  for (v = 0; v < 4; v++) {
2837
- for (C = l[v], o = [], u = 0, M = t.length, m = M - 1; u < M; m = u++)
2838
- y = t[u], b = t[m], y._code & C ? b._code & C || (R = ke(b, y, C, e, i), R._code = Bt(R, e), o.push(R)) : (b._code & C && (R = ke(b, y, C, e, i), R._code = Bt(R, e), o.push(R)), o.push(y));
2837
+ for (S = l[v], o = [], u = 0, A = t.length, m = A - 1; u < A; m = u++)
2838
+ y = t[u], b = t[m], y._code & S ? b._code & S || (R = ke(b, y, S, e, i), R._code = Bt(R, e), o.push(R)) : (b._code & S && (R = ke(b, y, S, e, i), R._code = Bt(R, e), o.push(R)), o.push(y));
2839
2839
  t = o;
2840
2840
  }
2841
2841
  return t;
2842
2842
  }
2843
2843
  function mn(t, e) {
2844
- var i, o, l, u, m, v, y, b, M;
2844
+ var i, o, l, u, m, v, y, b, A;
2845
2845
  if (!t || t.length === 0)
2846
2846
  throw new Error("latlngs not passed");
2847
2847
  pt(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
2848
- var C = N([0, 0]), R = X(t), st = R.getNorthWest().distanceTo(R.getSouthWest()) * R.getNorthEast().distanceTo(R.getNorthWest());
2849
- st < 1700 && (C = mi(t));
2848
+ var S = N([0, 0]), R = X(t), st = R.getNorthWest().distanceTo(R.getSouthWest()) * R.getNorthEast().distanceTo(R.getNorthWest());
2849
+ st < 1700 && (S = mi(t));
2850
2850
  var et = t.length, mt = [];
2851
2851
  for (i = 0; i < et; i++) {
2852
2852
  var ct = N(t[i]);
2853
- mt.push(e.project(N([ct.lat - C.lat, ct.lng - C.lng])));
2853
+ mt.push(e.project(N([ct.lat - S.lat, ct.lng - S.lng])));
2854
2854
  }
2855
2855
  for (v = y = b = 0, i = 0, o = et - 1; i < et; o = i++)
2856
2856
  l = mt[i], u = mt[o], m = l.y * u.x - u.y * l.x, y += (l.x + u.x) * m, b += (l.y + u.y) * m, v += m * 3;
2857
- v === 0 ? M = mt[0] : M = [y / v, b / v];
2858
- var qt = e.unproject(I(M));
2859
- return N([qt.lat + C.lat, qt.lng + C.lng]);
2857
+ v === 0 ? A = mt[0] : A = [y / v, b / v];
2858
+ var qt = e.unproject(I(A));
2859
+ return N([qt.lat + S.lat, qt.lng + S.lng]);
2860
2860
  }
2861
2861
  function mi(t) {
2862
2862
  for (var e = 0, i = 0, o = 0, l = 0; l < t.length; l++) {
@@ -2914,8 +2914,8 @@ function so() {
2914
2914
  }
2915
2915
  }
2916
2916
  function ke(t, e, i, o, l) {
2917
- var u = e.x - t.x, m = e.y - t.y, v = o.min, y = o.max, b, M;
2918
- return i & 8 ? (b = t.x + u * (y.y - t.y) / m, M = y.y) : i & 4 ? (b = t.x + u * (v.y - t.y) / m, M = v.y) : i & 2 ? (b = y.x, M = t.y + m * (y.x - t.x) / u) : i & 1 && (b = v.x, M = t.y + m * (v.x - t.x) / u), new z(b, M, l);
2917
+ var u = e.x - t.x, m = e.y - t.y, v = o.min, y = o.max, b, A;
2918
+ return i & 8 ? (b = t.x + u * (y.y - t.y) / m, A = y.y) : i & 4 ? (b = t.x + u * (v.y - t.y) / m, A = v.y) : i & 2 ? (b = y.x, A = t.y + m * (y.x - t.x) / u) : i & 1 && (b = v.x, A = t.y + m * (v.x - t.x) / u), new z(b, A, l);
2919
2919
  }
2920
2920
  function Bt(t, e) {
2921
2921
  var i = 0;
@@ -2940,12 +2940,12 @@ function so() {
2940
2940
  if (!t || t.length === 0)
2941
2941
  throw new Error("latlngs not passed");
2942
2942
  pt(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
2943
- var M = N([0, 0]), C = X(t), R = C.getNorthWest().distanceTo(C.getSouthWest()) * C.getNorthEast().distanceTo(C.getNorthWest());
2944
- R < 1700 && (M = mi(t));
2943
+ var A = N([0, 0]), S = X(t), R = S.getNorthWest().distanceTo(S.getSouthWest()) * S.getNorthEast().distanceTo(S.getNorthWest());
2944
+ R < 1700 && (A = mi(t));
2945
2945
  var st = t.length, et = [];
2946
2946
  for (i = 0; i < st; i++) {
2947
2947
  var mt = N(t[i]);
2948
- et.push(e.project(N([mt.lat - M.lat, mt.lng - M.lng])));
2948
+ et.push(e.project(N([mt.lat - A.lat, mt.lng - A.lng])));
2949
2949
  }
2950
2950
  for (i = 0, o = 0; i < st - 1; i++)
2951
2951
  o += et[i].distanceTo(et[i + 1]) / 2;
@@ -2961,7 +2961,7 @@ function so() {
2961
2961
  break;
2962
2962
  }
2963
2963
  var ct = e.unproject(I(b));
2964
- return N([ct.lat + M.lat, ct.lng + M.lng]);
2964
+ return N([ct.lat + A.lat, ct.lng + A.lng]);
2965
2965
  }
2966
2966
  var ar = {
2967
2967
  __proto__: null,
@@ -3147,7 +3147,7 @@ function so() {
3147
3147
  });
3148
3148
  var Ft = vt.extend({
3149
3149
  initialize: function(t, e) {
3150
- P(this, e), this._layers = {};
3150
+ M(this, e), this._layers = {};
3151
3151
  var i, o;
3152
3152
  if (t)
3153
3153
  for (i = 0, o = t.length; i < o; i++)
@@ -3317,7 +3317,7 @@ function so() {
3317
3317
  crossOrigin: !1
3318
3318
  },
3319
3319
  initialize: function(t) {
3320
- P(this, t);
3320
+ M(this, t);
3321
3321
  },
3322
3322
  // @method createIcon(oldIcon?: HTMLElement): HTMLElement
3323
3323
  // Called internally when the icon has to be shown, returns a `<img>` HTML element
@@ -3378,7 +3378,7 @@ function so() {
3378
3378
  return t = e(t, /^url\((['"])?(.+)\1\)$/, 2), t && e(t, /^(.*)marker-icon\.png$/, 1);
3379
3379
  },
3380
3380
  _detectIconPath: function() {
3381
- var t = F("div", "leaflet-default-icon-path", document.body), e = ee(t, "background-image") || ee(t, "backgroundImage");
3381
+ var t = H("div", "leaflet-default-icon-path", document.body), e = ee(t, "background-image") || ee(t, "backgroundImage");
3382
3382
  if (document.body.removeChild(t), e = this._stripUrl(e), e)
3383
3383
  return e;
3384
3384
  var i = document.querySelector('link[href$="leaflet.css"]');
@@ -3503,7 +3503,7 @@ function so() {
3503
3503
  * In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:
3504
3504
  */
3505
3505
  initialize: function(t, e) {
3506
- P(this, e), this._latlng = N(t);
3506
+ M(this, e), this._latlng = N(t);
3507
3507
  },
3508
3508
  onAdd: function(t) {
3509
3509
  this._zoomAnimated = this._zoomAnimated && t.options.markerZoomAnimation, this._zoomAnimated && t.on("zoomanim", this._animateZoom, this), this._initIcon(), this.update();
@@ -3687,7 +3687,7 @@ function so() {
3687
3687
  // @method setStyle(style: Path options): this
3688
3688
  // Changes the appearance of a Path based on the options in the `Path options` object.
3689
3689
  setStyle: function(t) {
3690
- return P(this, t), this._renderer && (this._renderer._updateStyle(this), this.options.stroke && t && Object.prototype.hasOwnProperty.call(t, "weight") && this._updateBounds()), this;
3690
+ return M(this, t), this._renderer && (this._renderer._updateStyle(this), this.options.stroke && t && Object.prototype.hasOwnProperty.call(t, "weight") && this._updateBounds()), this;
3691
3691
  },
3692
3692
  // @method bringToFront(): this
3693
3693
  // Brings the layer to the top of all path layers.
@@ -3718,7 +3718,7 @@ function so() {
3718
3718
  radius: 10
3719
3719
  },
3720
3720
  initialize: function(t, e) {
3721
- P(this, e), this._latlng = N(t), this._radius = this.options.radius;
3721
+ M(this, e), this._latlng = N(t), this._radius = this.options.radius;
3722
3722
  },
3723
3723
  // @method setLatLng(latLng: LatLng): this
3724
3724
  // Sets the position of a circle marker to a new location.
@@ -3771,7 +3771,7 @@ function so() {
3771
3771
  }
3772
3772
  var yi = Me.extend({
3773
3773
  initialize: function(t, e, i) {
3774
- if (typeof e == "number" && (e = n({}, i, { radius: e })), P(this, e), this._latlng = N(t), isNaN(this.options.radius))
3774
+ if (typeof e == "number" && (e = n({}, i, { radius: e })), M(this, e), this._latlng = N(t), isNaN(this.options.radius))
3775
3775
  throw new Error("Circle radius cannot be NaN");
3776
3776
  this._mRadius = this.options.radius;
3777
3777
  },
@@ -3798,11 +3798,11 @@ function so() {
3798
3798
  _project: function() {
3799
3799
  var t = this._latlng.lng, e = this._latlng.lat, i = this._map, o = i.options.crs;
3800
3800
  if (o.distance === Pt.distance) {
3801
- var l = Math.PI / 180, u = this._mRadius / Pt.R / l, m = i.project([e + u, t]), v = i.project([e - u, t]), y = m.add(v).divideBy(2), b = i.unproject(y).lat, M = Math.acos((Math.cos(u * l) - Math.sin(e * l) * Math.sin(b * l)) / (Math.cos(e * l) * Math.cos(b * l))) / l;
3802
- (isNaN(M) || M === 0) && (M = u / Math.cos(Math.PI / 180 * e)), this._point = y.subtract(i.getPixelOrigin()), this._radius = isNaN(M) ? 0 : y.x - i.project([b, t - M]).x, this._radiusY = y.y - m.y;
3801
+ var l = Math.PI / 180, u = this._mRadius / Pt.R / l, m = i.project([e + u, t]), v = i.project([e - u, t]), y = m.add(v).divideBy(2), b = i.unproject(y).lat, A = Math.acos((Math.cos(u * l) - Math.sin(e * l) * Math.sin(b * l)) / (Math.cos(e * l) * Math.cos(b * l))) / l;
3802
+ (isNaN(A) || A === 0) && (A = u / Math.cos(Math.PI / 180 * e)), this._point = y.subtract(i.getPixelOrigin()), this._radius = isNaN(A) ? 0 : y.x - i.project([b, t - A]).x, this._radiusY = y.y - m.y;
3803
3803
  } else {
3804
- var C = o.unproject(o.project(this._latlng).subtract([this._mRadius, 0]));
3805
- this._point = i.latLngToLayerPoint(this._latlng), this._radius = this._point.x - i.latLngToLayerPoint(C).x;
3804
+ var S = o.unproject(o.project(this._latlng).subtract([this._mRadius, 0]));
3805
+ this._point = i.latLngToLayerPoint(this._latlng), this._radius = this._point.x - i.latLngToLayerPoint(S).x;
3806
3806
  }
3807
3807
  this._updateBounds();
3808
3808
  }
@@ -3823,7 +3823,7 @@ function so() {
3823
3823
  noClip: !1
3824
3824
  },
3825
3825
  initialize: function(t, e) {
3826
- P(this, e), this._setLatLngs(t);
3826
+ M(this, e), this._setLatLngs(t);
3827
3827
  },
3828
3828
  // @method getLatLngs(): LatLng[]
3829
3829
  // Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
@@ -3844,10 +3844,10 @@ function so() {
3844
3844
  // Returns the point closest to `p` on the Polyline.
3845
3845
  closestLayerPoint: function(t) {
3846
3846
  for (var e = 1 / 0, i = null, o = ae, l, u, m = 0, v = this._parts.length; m < v; m++)
3847
- for (var y = this._parts[m], b = 1, M = y.length; b < M; b++) {
3847
+ for (var y = this._parts[m], b = 1, A = y.length; b < A; b++) {
3848
3848
  l = y[b - 1], u = y[b];
3849
- var C = o(t, l, u, !0);
3850
- C < e && (e = C, i = o(t, l, u));
3849
+ var S = o(t, l, u, !0);
3850
+ S < e && (e = S, i = o(t, l, u));
3851
3851
  }
3852
3852
  return i && (i.distance = Math.sqrt(e)), i;
3853
3853
  },
@@ -4048,7 +4048,7 @@ function so() {
4048
4048
  * Whether default Markers for "Point" type Features inherit from group options.
4049
4049
  */
4050
4050
  initialize: function(t, e) {
4051
- P(this, e), this._layers = {}, t && this.addData(t);
4051
+ M(this, e), this._layers = {}, t && this.addData(t);
4052
4052
  },
4053
4053
  // @method addData( <GeoJSON> data ): this
4054
4054
  // Adds a GeoJSON object to the layer.
@@ -4083,14 +4083,14 @@ function so() {
4083
4083
  }
4084
4084
  });
4085
4085
  function Ee(t, e) {
4086
- var i = t.type === "Feature" ? t.geometry : t, o = i ? i.coordinates : null, l = [], u = e && e.pointToLayer, m = e && e.coordsToLatLng || Li, v, y, b, M;
4086
+ var i = t.type === "Feature" ? t.geometry : t, o = i ? i.coordinates : null, l = [], u = e && e.pointToLayer, m = e && e.coordsToLatLng || Li, v, y, b, A;
4087
4087
  if (!o && !i)
4088
4088
  return null;
4089
4089
  switch (i.type) {
4090
4090
  case "Point":
4091
4091
  return v = m(o), kn(u, t, v, e);
4092
4092
  case "MultiPoint":
4093
- for (b = 0, M = o.length; b < M; b++)
4093
+ for (b = 0, A = o.length; b < A; b++)
4094
4094
  v = m(o[b]), l.push(kn(u, t, v, e));
4095
4095
  return new kt(l);
4096
4096
  case "LineString":
@@ -4100,17 +4100,17 @@ function so() {
4100
4100
  case "MultiPolygon":
4101
4101
  return y = Pe(o, i.type === "Polygon" ? 1 : 2, m), new Vt(y, e);
4102
4102
  case "GeometryCollection":
4103
- for (b = 0, M = i.geometries.length; b < M; b++) {
4104
- var C = Ee({
4103
+ for (b = 0, A = i.geometries.length; b < A; b++) {
4104
+ var S = Ee({
4105
4105
  geometry: i.geometries[b],
4106
4106
  type: "Feature",
4107
4107
  properties: t.properties
4108
4108
  }, e);
4109
- C && l.push(C);
4109
+ S && l.push(S);
4110
4110
  }
4111
4111
  return new kt(l);
4112
4112
  case "FeatureCollection":
4113
- for (b = 0, M = i.features.length; b < M; b++) {
4113
+ for (b = 0, A = i.features.length; b < A; b++) {
4114
4114
  var R = Ee(i.features[b], e);
4115
4115
  R && l.push(R);
4116
4116
  }
@@ -4241,7 +4241,7 @@ function so() {
4241
4241
  className: ""
4242
4242
  },
4243
4243
  initialize: function(t, e, i) {
4244
- this._url = t, this._bounds = X(e), P(this, i);
4244
+ this._url = t, this._bounds = X(e), M(this, i);
4245
4245
  },
4246
4246
  onAdd: function() {
4247
4247
  this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), this.options.interactive && (B(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), this.getPane().appendChild(this._image), this._reset();
@@ -4301,7 +4301,7 @@ function so() {
4301
4301
  return this._image;
4302
4302
  },
4303
4303
  _initImage: function() {
4304
- var t = this._url.tagName === "IMG", e = this._image = t ? this._url : F("img");
4304
+ var t = this._url.tagName === "IMG", e = this._image = t ? this._url : H("img");
4305
4305
  if (B(e, "leaflet-image-layer"), this._zoomAnimated && B(e, "leaflet-zoom-animated"), this.options.className && B(e, this.options.className), e.onselectstart = w, e.onmousemove = w, e.onload = a(this.fire, this, "load"), e.onerror = a(this._overlayOnError, this, "error"), (this.options.crossOrigin || this.options.crossOrigin === "") && (e.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), this.options.zIndex && this._updateZIndex(), t) {
4306
4306
  this._url = e.src;
4307
4307
  return;
@@ -4360,7 +4360,7 @@ function so() {
4360
4360
  playsInline: !0
4361
4361
  },
4362
4362
  _initImage: function() {
4363
- var t = this._url.tagName === "VIDEO", e = this._image = t ? this._url : F("video");
4363
+ var t = this._url.tagName === "VIDEO", e = this._image = t ? this._url : H("video");
4364
4364
  if (B(e, "leaflet-image-layer"), this._zoomAnimated && B(e, "leaflet-zoom-animated"), this.options.className && B(e, this.options.className), e.onselectstart = w, e.onmousemove = w, e.onloadeddata = a(this.fire, this, "load"), t) {
4365
4365
  for (var i = e.getElementsByTagName("source"), o = [], l = 0; l < i.length; l++)
4366
4366
  o.push(i[l].src);
@@ -4369,7 +4369,7 @@ function so() {
4369
4369
  }
4370
4370
  D(this._url) || (this._url = [this._url]), !this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(e.style, "objectFit") && (e.style.objectFit = "fill"), e.autoplay = !!this.options.autoplay, e.loop = !!this.options.loop, e.muted = !!this.options.muted, e.playsInline = !!this.options.playsInline;
4371
4371
  for (var u = 0; u < this._url.length; u++) {
4372
- var m = F("source");
4372
+ var m = H("source");
4373
4373
  m.src = this._url[u], e.appendChild(m);
4374
4374
  }
4375
4375
  }
@@ -4414,7 +4414,7 @@ function so() {
4414
4414
  content: ""
4415
4415
  },
4416
4416
  initialize: function(t, e) {
4417
- t && (t instanceof V || D(t)) ? (this._latlng = N(t), P(this, e)) : (P(this, t), this._source = e), this.options.content && (this._content = this.options.content);
4417
+ t && (t instanceof V || D(t)) ? (this._latlng = N(t), M(this, e)) : (M(this, t), this._source = e), this.options.content && (this._content = this.options.content);
4418
4418
  },
4419
4419
  // @method openOn(map: Map): this
4420
4420
  // Adds the overlay to the map.
@@ -4557,7 +4557,7 @@ function so() {
4557
4557
  }), vt.include({
4558
4558
  _initOverlay: function(t, e, i, o) {
4559
4559
  var l = i;
4560
- return l instanceof t ? (P(l, o), l._source = this) : (l = e && !o ? e : new t(o, this), l.setContent(i)), l;
4560
+ return l instanceof t ? (M(l, o), l._source = this) : (l = e && !o ? e : new t(o, this), l.setContent(i)), l;
4561
4561
  }
4562
4562
  });
4563
4563
  var De = bt.extend({
@@ -4637,12 +4637,12 @@ function so() {
4637
4637
  return (this.options.closeOnClick !== void 0 ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (t.preclick = this.close), this.options.keepInView && (t.moveend = this._adjustPan), t;
4638
4638
  },
4639
4639
  _initLayout: function() {
4640
- var t = "leaflet-popup", e = this._container = F(
4640
+ var t = "leaflet-popup", e = this._container = H(
4641
4641
  "div",
4642
4642
  t + " " + (this.options.className || "") + " leaflet-zoom-animated"
4643
- ), i = this._wrapper = F("div", t + "-content-wrapper", e);
4644
- if (this._contentNode = F("div", t + "-content", i), re(e), di(this._contentNode), O(e, "contextmenu", zt), this._tipContainer = F("div", t + "-tip-container", e), this._tip = F("div", t + "-tip", this._tipContainer), this.options.closeButton) {
4645
- var o = this._closeButton = F("a", t + "-close-button", e);
4643
+ ), i = this._wrapper = H("div", t + "-content-wrapper", e);
4644
+ if (this._contentNode = H("div", t + "-content", i), re(e), di(this._contentNode), O(e, "contextmenu", zt), this._tipContainer = H("div", t + "-tip-container", e), this._tip = H("div", t + "-tip", this._tipContainer), this.options.closeButton) {
4645
+ var o = this._closeButton = H("a", t + "-close-button", e);
4646
4646
  o.setAttribute("role", "button"), o.setAttribute("aria-label", "Close popup"), o.href = "#close", o.innerHTML = '<span aria-hidden="true">&#215;</span>', O(o, "click", function(l) {
4647
4647
  it(l), this.close();
4648
4648
  }, this);
@@ -4668,8 +4668,8 @@ function so() {
4668
4668
  }
4669
4669
  var t = this._map, e = parseInt(ee(this._container, "marginBottom"), 10) || 0, i = this._container.offsetHeight + e, o = this._containerWidth, l = new z(this._containerLeft, -i - this._containerBottom);
4670
4670
  l._add(It(this._container));
4671
- var u = t.layerPointToContainerPoint(l), m = I(this.options.autoPanPadding), v = I(this.options.autoPanPaddingTopLeft || m), y = I(this.options.autoPanPaddingBottomRight || m), b = t.getSize(), M = 0, C = 0;
4672
- u.x + o + y.x > b.x && (M = u.x + o - b.x + y.x), u.x - M - v.x < 0 && (M = u.x - v.x), u.y + i + y.y > b.y && (C = u.y + i - b.y + y.y), u.y - C - v.y < 0 && (C = u.y - v.y), (M || C) && (this.options.keepInView && (this._autopanning = !0), t.fire("autopanstart").panBy([M, C]));
4671
+ var u = t.layerPointToContainerPoint(l), m = I(this.options.autoPanPadding), v = I(this.options.autoPanPaddingTopLeft || m), y = I(this.options.autoPanPaddingBottomRight || m), b = t.getSize(), A = 0, S = 0;
4672
+ u.x + o + y.x > b.x && (A = u.x + o - b.x + y.x), u.x - A - v.x < 0 && (A = u.x - v.x), u.y + i + y.y > b.y && (S = u.y + i - b.y + y.y), u.y - S - v.y < 0 && (S = u.y - v.y), (A || S) && (this.options.keepInView && (this._autopanning = !0), t.fire("autopanstart").panBy([A, S]));
4673
4673
  }
4674
4674
  },
4675
4675
  _getAnchor: function() {
@@ -4803,15 +4803,15 @@ function so() {
4803
4803
  },
4804
4804
  _initLayout: function() {
4805
4805
  var t = "leaflet-tooltip", e = t + " " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide");
4806
- this._contentNode = this._container = F("div", e), this._container.setAttribute("role", "tooltip"), this._container.setAttribute("id", "leaflet-tooltip-" + f(this));
4806
+ this._contentNode = this._container = H("div", e), this._container.setAttribute("role", "tooltip"), this._container.setAttribute("id", "leaflet-tooltip-" + f(this));
4807
4807
  },
4808
4808
  _updateLayout: function() {
4809
4809
  },
4810
4810
  _adjustPan: function() {
4811
4811
  },
4812
4812
  _setPosition: function(t) {
4813
- var e, i, o = this._map, l = this._container, u = o.latLngToContainerPoint(o.getCenter()), m = o.layerPointToContainerPoint(t), v = this.options.direction, y = l.offsetWidth, b = l.offsetHeight, M = I(this.options.offset), C = this._getAnchor();
4814
- v === "top" ? (e = y / 2, i = b) : v === "bottom" ? (e = y / 2, i = 0) : v === "center" ? (e = y / 2, i = b / 2) : v === "right" ? (e = 0, i = b / 2) : v === "left" ? (e = y, i = b / 2) : m.x < u.x ? (v = "right", e = 0, i = b / 2) : (v = "left", e = y + (M.x + C.x) * 2, i = b / 2), t = t.subtract(I(e, i, !0)).add(M).add(C), K(l, "leaflet-tooltip-right"), K(l, "leaflet-tooltip-left"), K(l, "leaflet-tooltip-top"), K(l, "leaflet-tooltip-bottom"), B(l, "leaflet-tooltip-" + v), Q(l, t);
4813
+ var e, i, o = this._map, l = this._container, u = o.latLngToContainerPoint(o.getCenter()), m = o.layerPointToContainerPoint(t), v = this.options.direction, y = l.offsetWidth, b = l.offsetHeight, A = I(this.options.offset), S = this._getAnchor();
4814
+ v === "top" ? (e = y / 2, i = b) : v === "bottom" ? (e = y / 2, i = 0) : v === "center" ? (e = y / 2, i = b / 2) : v === "right" ? (e = 0, i = b / 2) : v === "left" ? (e = y, i = b / 2) : m.x < u.x ? (v = "right", e = 0, i = b / 2) : (v = "left", e = y + (A.x + S.x) * 2, i = b / 2), t = t.subtract(I(e, i, !0)).add(A).add(S), K(l, "leaflet-tooltip-right"), K(l, "leaflet-tooltip-left"), K(l, "leaflet-tooltip-top"), K(l, "leaflet-tooltip-bottom"), B(l, "leaflet-tooltip-" + v), Q(l, t);
4815
4815
  },
4816
4816
  _updatePosition: function() {
4817
4817
  var t = this._map.latLngToLayerPoint(this._latlng);
@@ -5023,7 +5023,7 @@ function so() {
5023
5023
  keepBuffer: 2
5024
5024
  },
5025
5025
  initialize: function(t) {
5026
- P(this, t);
5026
+ M(this, t);
5027
5027
  },
5028
5028
  onAdd: function() {
5029
5029
  this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView();
@@ -5123,7 +5123,7 @@ function so() {
5123
5123
  },
5124
5124
  _onOpaqueTile: w,
5125
5125
  _initContainer: function() {
5126
- this._container || (this._container = F("div", "leaflet-layer " + (this.options.className || "")), this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container));
5126
+ this._container || (this._container = H("div", "leaflet-layer " + (this.options.className || "")), this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container));
5127
5127
  },
5128
5128
  _updateLevels: function() {
5129
5129
  var t = this._tileZoom, e = this.options.maxZoom;
@@ -5131,7 +5131,7 @@ function so() {
5131
5131
  for (var i in this._levels)
5132
5132
  i = Number(i), this._levels[i].el.children.length || i === t ? (this._levels[i].el.style.zIndex = e - Math.abs(t - i), this._onUpdateLevel(i)) : (J(this._levels[i].el), this._removeTilesAtZoom(i), this._onRemoveLevel(i), delete this._levels[i]);
5133
5133
  var o = this._levels[t], l = this._map;
5134
- return o || (o = this._levels[t] = {}, o.el = F("div", "leaflet-tile-container leaflet-zoom-animated", this._container), o.el.style.zIndex = e, o.origin = l.project(l.unproject(l.getPixelOrigin()), t).round(), o.zoom = t, this._setZoomTransform(o, l.getCenter(), l.getZoom()), w(o.el.offsetWidth), this._onCreateLevel(o)), this._level = o, o;
5134
+ return o || (o = this._levels[t] = {}, o.el = H("div", "leaflet-tile-container leaflet-zoom-animated", this._container), o.el.style.zIndex = e, o.origin = l.project(l.unproject(l.getPixelOrigin()), t).round(), o.zoom = t, this._setZoomTransform(o, l.getCenter(), l.getZoom()), w(o.el.offsetWidth), this._onCreateLevel(o)), this._level = o, o;
5135
5135
  }
5136
5136
  },
5137
5137
  _onUpdateLevel: w,
@@ -5242,16 +5242,16 @@ function so() {
5242
5242
  if (!(isFinite(l.min.x) && isFinite(l.min.y) && isFinite(l.max.x) && isFinite(l.max.y)))
5243
5243
  throw new Error("Attempted to load an infinite number of tiles");
5244
5244
  for (var b in this._tiles) {
5245
- var M = this._tiles[b].coords;
5246
- (M.z !== this._tileZoom || !y.contains(new z(M.x, M.y))) && (this._tiles[b].current = !1);
5245
+ var A = this._tiles[b].coords;
5246
+ (A.z !== this._tileZoom || !y.contains(new z(A.x, A.y))) && (this._tiles[b].current = !1);
5247
5247
  }
5248
5248
  if (Math.abs(i - this._tileZoom) > 1) {
5249
5249
  this._setView(t, i);
5250
5250
  return;
5251
5251
  }
5252
- for (var C = l.min.y; C <= l.max.y; C++)
5252
+ for (var S = l.min.y; S <= l.max.y; S++)
5253
5253
  for (var R = l.min.x; R <= l.max.x; R++) {
5254
- var st = new z(R, C);
5254
+ var st = new z(R, S);
5255
5255
  if (st.z = this._tileZoom, !!this._isValidTile(st)) {
5256
5256
  var et = this._tiles[this._tileCoordsToKey(st)];
5257
5257
  et ? et.current = !0 : m.push(st);
@@ -5406,7 +5406,7 @@ function so() {
5406
5406
  referrerPolicy: !1
5407
5407
  },
5408
5408
  initialize: function(t, e) {
5409
- this._url = t, e = P(this, e), e.detectRetina && T.retina && e.maxZoom > 0 ? (e.tileSize = Math.floor(e.tileSize / 2), e.zoomReverse ? (e.zoomOffset--, e.minZoom = Math.min(e.maxZoom, e.minZoom + 1)) : (e.zoomOffset++, e.maxZoom = Math.max(e.minZoom, e.maxZoom - 1)), e.minZoom = Math.max(0, e.minZoom)) : e.zoomReverse ? e.minZoom = Math.min(e.maxZoom, e.minZoom) : e.maxZoom = Math.max(e.minZoom, e.maxZoom), typeof e.subdomains == "string" && (e.subdomains = e.subdomains.split("")), this.on("tileunload", this._onTileRemove);
5409
+ this._url = t, e = M(this, e), e.detectRetina && T.retina && e.maxZoom > 0 ? (e.tileSize = Math.floor(e.tileSize / 2), e.zoomReverse ? (e.zoomOffset--, e.minZoom = Math.min(e.maxZoom, e.minZoom + 1)) : (e.zoomOffset++, e.maxZoom = Math.max(e.minZoom, e.maxZoom - 1)), e.minZoom = Math.max(0, e.minZoom)) : e.zoomReverse ? e.minZoom = Math.min(e.maxZoom, e.minZoom) : e.maxZoom = Math.max(e.minZoom, e.maxZoom), typeof e.subdomains == "string" && (e.subdomains = e.subdomains.split("")), this.on("tileunload", this._onTileRemove);
5410
5410
  },
5411
5411
  // @method setUrl(url: String, noRedraw?: Boolean): this
5412
5412
  // Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).
@@ -5441,7 +5441,7 @@ function so() {
5441
5441
  var i = this._globalTileRange.max.y - t.y;
5442
5442
  this.options.tms && (e.y = i), e["-y"] = i;
5443
5443
  }
5444
- return S(this._url, n(e, this.options));
5444
+ return C(this._url, n(e, this.options));
5445
5445
  },
5446
5446
  _tileOnLoad: function(t, e) {
5447
5447
  T.ielt9 ? setTimeout(a(t, this, null, e), 0) : t(null, e);
@@ -5526,7 +5526,7 @@ function so() {
5526
5526
  var i = n({}, this.defaultWmsParams);
5527
5527
  for (var o in e)
5528
5528
  o in this.options || (i[o] = e[o]);
5529
- e = P(this, e);
5529
+ e = M(this, e);
5530
5530
  var l = e.detectRetina && T.retina ? 2 : 1, u = this.getTileSize();
5531
5531
  i.width = u.x * l, i.height = u.y * l, this.wmsParams = i;
5532
5532
  },
@@ -5559,7 +5559,7 @@ function so() {
5559
5559
  padding: 0.1
5560
5560
  },
5561
5561
  initialize: function(t) {
5562
- P(this, t), f(this), this._layers = this._layers || {};
5562
+ M(this, t), f(this), this._layers = this._layers || {};
5563
5563
  },
5564
5564
  onAdd: function() {
5565
5565
  this._container || (this._initContainer(), B(this._container, "leaflet-zoom-animated")), this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this);
@@ -5802,7 +5802,7 @@ function so() {
5802
5802
  };
5803
5803
  })(), Pr = {
5804
5804
  _initContainer: function() {
5805
- this._container = F("div", "leaflet-vml-container");
5805
+ this._container = H("div", "leaflet-vml-container");
5806
5806
  },
5807
5807
  _update: function() {
5808
5808
  this._map._animatingZoom || (Et.prototype._update.call(this), this.fire("update"));
@@ -5969,7 +5969,7 @@ function so() {
5969
5969
  }, this);
5970
5970
  },
5971
5971
  _onMouseMove: function(t) {
5972
- this._moved || (this._moved = !0, this._box = F("div", "leaflet-zoom-box", this._container), B(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(t);
5972
+ this._moved || (this._moved = !0, this._box = H("div", "leaflet-zoom-box", this._container), B(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(t);
5973
5973
  var e = new j(this._point, this._startPoint), i = e.getSize();
5974
5974
  Q(this._box, e.min), this._box.style.width = i.x + "px", this._box.style.height = i.y + "px";
5975
5975
  },
@@ -6117,10 +6117,10 @@ function so() {
6117
6117
  e.fire("moveend");
6118
6118
  else {
6119
6119
  this._prunePositions(+/* @__PURE__ */ new Date());
6120
- var l = this._lastPos.subtract(this._positions[0]), u = (this._lastTime - this._times[0]) / 1e3, m = i.easeLinearity, v = l.multiplyBy(m / u), y = v.distanceTo([0, 0]), b = Math.min(i.inertiaMaxSpeed, y), M = v.multiplyBy(b / y), C = b / (i.inertiaDeceleration * m), R = M.multiplyBy(-C / 2).round();
6120
+ var l = this._lastPos.subtract(this._positions[0]), u = (this._lastTime - this._times[0]) / 1e3, m = i.easeLinearity, v = l.multiplyBy(m / u), y = v.distanceTo([0, 0]), b = Math.min(i.inertiaMaxSpeed, y), A = v.multiplyBy(b / y), S = b / (i.inertiaDeceleration * m), R = A.multiplyBy(-S / 2).round();
6121
6121
  !R.x && !R.y ? e.fire("moveend") : (R = e._limitOffset(R, e.options.maxBounds), ot(function() {
6122
6122
  e.panBy(R, {
6123
- duration: C,
6123
+ duration: S,
6124
6124
  easeLinearity: m,
6125
6125
  noMoveStart: !0,
6126
6126
  animate: !0
@@ -6371,7 +6371,7 @@ function so() {
6371
6371
  this._zooming = !1, rt(this._animRequest), W(document, "touchmove", this._onTouchMove, this), W(document, "touchend touchcancel", this._onTouchEnd, this), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom));
6372
6372
  }
6373
6373
  });
6374
- Z.addInitHook("addHandler", "touchZoom", Hn), Z.BoxZoom = On, Z.DoubleClickZoom = Bn, Z.Drag = Rn, Z.Keyboard = Un, Z.ScrollWheelZoom = Nn, Z.TapHold = Zn, Z.TouchZoom = Hn, s.Bounds = j, s.Browser = T, s.CRS = xt, s.Canvas = Sn, s.Circle = yi, s.CircleMarker = Me, s.Class = ut, s.Control = gt, s.DivIcon = Pn, s.DivOverlay = bt, s.DomEvent = jo, s.DomUtil = Yo, s.Draggable = Tt, s.Evented = Xt, s.FeatureGroup = kt, s.GeoJSON = Mt, s.GridLayer = he, s.Handler = wt, s.Icon = Gt, s.ImageOverlay = Se, s.LatLng = V, s.LatLngBounds = ht, s.Layer = vt, s.LayerGroup = Ft, s.LineUtil = ar, s.Map = Z, s.Marker = Ae, s.Mixin = er, s.Path = Ct, s.Point = z, s.PolyUtil = ir, s.Polygon = Vt, s.Polyline = At, s.Popup = De, s.PosAnimation = cn, s.Projection = lr, s.Rectangle = zn, s.Renderer = Et, s.SVG = de, s.SVGOverlay = En, s.TileLayer = Yt, s.Tooltip = Ie, s.Transformation = We, s.Util = _e, s.VideoOverlay = Mn, s.bind = a, s.bounds = lt, s.canvas = Dn, s.circle = _r, s.circleMarker = mr, s.control = se, s.divIcon = Ar, s.extend = n, s.featureGroup = ur, s.geoJSON = An, s.geoJson = yr, s.gridLayer = Mr, s.icon = fr, s.imageOverlay = Lr, s.latLng = N, s.latLngBounds = X, s.layerGroup = dr, s.map = Jo, s.marker = pr, s.point = I, s.polygon = vr, s.polyline = gr, s.popup = xr, s.rectangle = Tr, s.setOptions = P, s.stamp = f, s.svg = In, s.svgOverlay = br, s.tileLayer = Tn, s.tooltip = kr, s.transformation = Qt, s.version = c, s.videoOverlay = wr;
6374
+ Z.addInitHook("addHandler", "touchZoom", Hn), Z.BoxZoom = On, Z.DoubleClickZoom = Bn, Z.Drag = Rn, Z.Keyboard = Un, Z.ScrollWheelZoom = Nn, Z.TapHold = Zn, Z.TouchZoom = Hn, s.Bounds = j, s.Browser = T, s.CRS = xt, s.Canvas = Sn, s.Circle = yi, s.CircleMarker = Me, s.Class = ut, s.Control = gt, s.DivIcon = Pn, s.DivOverlay = bt, s.DomEvent = jo, s.DomUtil = Yo, s.Draggable = Tt, s.Evented = Xt, s.FeatureGroup = kt, s.GeoJSON = Mt, s.GridLayer = he, s.Handler = wt, s.Icon = Gt, s.ImageOverlay = Se, s.LatLng = V, s.LatLngBounds = ht, s.Layer = vt, s.LayerGroup = Ft, s.LineUtil = ar, s.Map = Z, s.Marker = Ae, s.Mixin = er, s.Path = Ct, s.Point = z, s.PolyUtil = ir, s.Polygon = Vt, s.Polyline = At, s.Popup = De, s.PosAnimation = cn, s.Projection = lr, s.Rectangle = zn, s.Renderer = Et, s.SVG = de, s.SVGOverlay = En, s.TileLayer = Yt, s.Tooltip = Ie, s.Transformation = We, s.Util = _e, s.VideoOverlay = Mn, s.bind = a, s.bounds = lt, s.canvas = Dn, s.circle = _r, s.circleMarker = mr, s.control = se, s.divIcon = Ar, s.extend = n, s.featureGroup = ur, s.geoJSON = An, s.geoJson = yr, s.gridLayer = Mr, s.icon = fr, s.imageOverlay = Lr, s.latLng = N, s.latLngBounds = X, s.layerGroup = dr, s.map = Jo, s.marker = pr, s.point = I, s.polygon = vr, s.polyline = gr, s.popup = xr, s.rectangle = Tr, s.setOptions = M, s.stamp = f, s.svg = In, s.svgOverlay = br, s.tileLayer = Tn, s.tooltip = kr, s.transformation = Qt, s.version = c, s.videoOverlay = wr;
6375
6375
  var Sr = window.L;
6376
6376
  s.noConflict = function() {
6377
6377
  return window.L = Sr, this;
@@ -7461,7 +7461,7 @@ function as() {
7461
7461
  _calculateBearingAndDistance: function() {
7462
7462
  var c = this._clickedLatLong.lat, n = this._clickedLatLong.lng, r = this._movingLatLong.lat, a = this._movingLatLong.lng, d = Math.PI / 180, f = Math.sin((a - n) * d) * Math.cos(r * d), _ = Math.cos(c * d) * Math.sin(r * d) - Math.sin(c * d) * Math.cos(r * d) * Math.cos((a - n) * d), g = Math.atan2(f, _) * ((this.options.angleUnit.factor ? this.options.angleUnit.factor / 2 : 180) / Math.PI);
7463
7463
  g += g < 0 ? this.options.angleUnit.factor ? this.options.angleUnit.factor : 360 : 0;
7464
- var w = this.options.lengthUnit.factor ? 6371 * this.options.lengthUnit.factor : 6371, x = (r - c) * d, A = (a - n) * d, E = Math.sin(x / 2) * Math.sin(x / 2) + Math.cos(c * d) * Math.cos(r * d) * Math.sin(A / 2) * Math.sin(A / 2), P = 2 * Math.atan2(Math.sqrt(E), Math.sqrt(1 - E)), U = w * P;
7464
+ var w = this.options.lengthUnit.factor ? 6371 * this.options.lengthUnit.factor : 6371, x = (r - c) * d, E = (a - n) * d, P = Math.sin(x / 2) * Math.sin(x / 2) + Math.cos(c * d) * Math.cos(r * d) * Math.sin(E / 2) * Math.sin(E / 2), M = 2 * Math.atan2(Math.sqrt(P), Math.sqrt(1 - P)), U = w * M;
7465
7465
  this._result = {
7466
7466
  Bearing: g,
7467
7467
  Distance: U
@@ -8099,8 +8099,8 @@ function Xn(p) {
8099
8099
  return p * 180 / Math.PI;
8100
8100
  }
8101
8101
  function ks(p, h, s) {
8102
- const c = h / xs, n = Ai(s), r = Ai(p.lat), a = Ai(p.lng), d = Math.sin(r), f = Math.cos(r), _ = Math.sin(c), g = Math.cos(c), w = d * g + f * _ * Math.cos(n), x = Math.asin(w), A = Math.sin(n) * _ * f, E = g - d * w, P = a + Math.atan2(A, E);
8103
- return { lat: Xn(x), lng: Xn(P) };
8102
+ const c = h / xs, n = Ai(s), r = Ai(p.lat), a = Ai(p.lng), d = Math.sin(r), f = Math.cos(r), _ = Math.sin(c), g = Math.cos(c), w = d * g + f * _ * Math.cos(n), x = Math.asin(w), E = Math.sin(n) * _ * f, P = g - d * w, M = a + Math.atan2(E, P);
8103
+ return { lat: Xn(x), lng: Xn(M) };
8104
8104
  }
8105
8105
  function As(p) {
8106
8106
  let h = 0;
@@ -8246,28 +8246,28 @@ class Ss {
8246
8246
  this.map = h, this.onSave = c, this.measurementSystem = n, this.controlsGroup = tt.layerGroup().addTo(h), this.baseCircleOptions = { ...s.options }, delete this.baseCircleOptions.editing, delete this.baseCircleOptions.original, this.addLayer(s), this.installEditEventBridges(), this.renderControls();
8247
8247
  }
8248
8248
  installEditEventBridges() {
8249
- var g, w, x, A, E, P, U, H;
8250
- const h = Ue, s = (w = (g = h == null ? void 0 : h.Draw) == null ? void 0 : g.Event) == null ? void 0 : w.EDITMOVE, c = (A = (x = h == null ? void 0 : h.Draw) == null ? void 0 : x.Event) == null ? void 0 : A.EDITRESIZE, n = (P = (E = h == null ? void 0 : h.Draw) == null ? void 0 : E.Event) == null ? void 0 : P.EDITSTART, r = (H = (U = h == null ? void 0 : h.Draw) == null ? void 0 : U.Event) == null ? void 0 : H.EDITSTOP;
8249
+ var g, w, x, E, P, M, U, F;
8250
+ const h = Ue, s = (w = (g = h == null ? void 0 : h.Draw) == null ? void 0 : g.Event) == null ? void 0 : w.EDITMOVE, c = (E = (x = h == null ? void 0 : h.Draw) == null ? void 0 : x.Event) == null ? void 0 : E.EDITRESIZE, n = (M = (P = h == null ? void 0 : h.Draw) == null ? void 0 : P.Event) == null ? void 0 : M.EDITSTART, r = (F = (U = h == null ? void 0 : h.Draw) == null ? void 0 : U.Event) == null ? void 0 : F.EDITSTOP;
8251
8251
  if (!s || !c) return;
8252
- const a = (S) => {
8253
- const D = S == null ? void 0 : S.layer;
8252
+ const a = (C) => {
8253
+ const D = C == null ? void 0 : C.layer;
8254
8254
  D && this.layers.includes(D) && this.syncCenters(D);
8255
- }, d = (S) => {
8256
- const D = S == null ? void 0 : S.layer;
8255
+ }, d = (C) => {
8256
+ const D = C == null ? void 0 : C.layer;
8257
8257
  D && this.layers.includes(D) && (this.updateLabels(D), this.requestRenderControls());
8258
- }, f = (S) => {
8258
+ }, f = (C) => {
8259
8259
  var q;
8260
- const D = S == null ? void 0 : S.layer;
8260
+ const D = C == null ? void 0 : C.layer;
8261
8261
  if (!D || !this.layers.includes(D)) return;
8262
8262
  const G = D;
8263
8263
  ((q = G.getTooltip) == null ? void 0 : q.call(G)) && this.updateLabels(G);
8264
8264
  }, _ = () => {
8265
- this.layers.forEach((S) => {
8265
+ this.layers.forEach((C) => {
8266
8266
  var G;
8267
- const D = (G = S.getTooltip) == null ? void 0 : G.call(S);
8268
- D && (S.setTooltipContent(
8269
- fe(S.getRadius(), this.measurementSystem)
8270
- ), D.options.offset = [10, 0], D.options.direction = "right", S.closeTooltip(), S.openTooltip());
8267
+ const D = (G = C.getTooltip) == null ? void 0 : G.call(C);
8268
+ D && (C.setTooltipContent(
8269
+ fe(C.getRadius(), this.measurementSystem)
8270
+ ), D.options.offset = [10, 0], D.options.direction = "right", C.closeTooltip(), C.openTooltip());
8271
8271
  });
8272
8272
  };
8273
8273
  this.map.on(s, a), this.map.on(c, d), n && (this.map.on(n, f), this.detachMapListeners.push(() => this.map.off(n, f))), r && (this.map.on(r, _), this.detachMapListeners.push(() => this.map.off(r, _))), this.detachMapListeners.push(() => this.map.off(s, a)), this.detachMapListeners.push(() => this.map.off(c, d));
@@ -8458,51 +8458,51 @@ function Rs(p, h, s, c) {
8458
8458
  }
8459
8459
  function Us(p, h, s, c) {
8460
8460
  const n = Jt(p), r = Jt(s), a = Jt(c - h), d = Math.atan((1 - Rt) * Math.tan(n)), f = Math.atan((1 - Rt) * Math.tan(r)), _ = Math.sin(d), g = Math.cos(d), w = Math.sin(f), x = Math.cos(f);
8461
- let A = a, E = 0, P = 0;
8461
+ let E = a, P = 0, M = 0;
8462
8462
  const U = 200;
8463
- let H = 0, S = 0, D = 0, G = 0, Y = 0;
8464
- for (; Math.abs(A - E) > 1e-12 && P < U; ) {
8465
- const rt = Math.sin(A), _e = Math.cos(A);
8466
- if (H = Math.sqrt(
8463
+ let F = 0, C = 0, D = 0, G = 0, Y = 0;
8464
+ for (; Math.abs(E - P) > 1e-12 && M < U; ) {
8465
+ const rt = Math.sin(E), _e = Math.cos(E);
8466
+ if (F = Math.sqrt(
8467
8467
  (x * rt) ** 2 + (g * w - _ * x * _e) ** 2
8468
- ), H === 0)
8468
+ ), F === 0)
8469
8469
  return {
8470
8470
  distanceMeters: 0,
8471
8471
  bearingRad: 0,
8472
- iterations: P,
8472
+ iterations: M,
8473
8473
  converged: !0
8474
8474
  };
8475
- S = _ * w + g * x * _e, D = Math.atan2(H, S);
8476
- const ut = g * x * rt / H;
8477
- G = 1 - ut ** 2, Y = G === 0 ? 0 : S - 2 * _ * w / G;
8475
+ C = _ * w + g * x * _e, D = Math.atan2(F, C);
8476
+ const ut = g * x * rt / F;
8477
+ G = 1 - ut ** 2, Y = G === 0 ? 0 : C - 2 * _ * w / G;
8478
8478
  const Kt = Rt / 16 * G * (4 + Rt * (4 - 3 * G));
8479
- E = A, A = a + (1 - Kt) * Rt * ut * (D + Kt * H * (Y + Kt * S * (-1 + 2 * Y ** 2))), P += 1;
8479
+ P = E, E = a + (1 - Kt) * Rt * ut * (D + Kt * F * (Y + Kt * C * (-1 + 2 * Y ** 2))), M += 1;
8480
8480
  }
8481
- if (P >= U)
8481
+ if (M >= U)
8482
8482
  return {
8483
8483
  distanceMeters: Number.NaN,
8484
8484
  bearingRad: 0,
8485
- iterations: P,
8485
+ iterations: M,
8486
8486
  converged: !1
8487
8487
  };
8488
- const q = (co ** 2 - jt ** 2) / jt ** 2 * G, at = 1 + q / 16384 * (4096 + q * (-768 + q * (320 - 175 * q))), _t = q / 1024 * (256 + q * (-128 + q * (74 - 47 * q))), Ut = _t * H * (Y + _t / 4 * (S * (-1 + 2 * Y ** 2) - _t / 6 * Y * (-3 + 4 * H ** 2) * (-3 + 4 * Y ** 2))), me = jt * at * (D - Ut), ot = Math.atan2(
8489
- x * Math.sin(A),
8490
- g * w - _ * x * Math.cos(A)
8488
+ const q = (co ** 2 - jt ** 2) / jt ** 2 * G, at = 1 + q / 16384 * (4096 + q * (-768 + q * (320 - 175 * q))), _t = q / 1024 * (256 + q * (-128 + q * (74 - 47 * q))), Ut = _t * F * (Y + _t / 4 * (C * (-1 + 2 * Y ** 2) - _t / 6 * Y * (-3 + 4 * F ** 2) * (-3 + 4 * Y ** 2))), me = jt * at * (D - Ut), ot = Math.atan2(
8489
+ x * Math.sin(E),
8490
+ g * w - _ * x * Math.cos(E)
8491
8491
  );
8492
8492
  return {
8493
8493
  distanceMeters: me,
8494
8494
  bearingRad: ot,
8495
- iterations: P,
8495
+ iterations: M,
8496
8496
  converged: !0
8497
8497
  };
8498
8498
  }
8499
8499
  function Ns(p, h, s, c) {
8500
- const n = Jt(p), r = Jt(s), a = Jt(c - h), d = Math.atan((1 - Rt) * Math.tan(n)), f = Math.atan((1 - Rt) * Math.tan(r)), _ = Math.sin(d), g = Math.cos(d), w = Math.sin(f), x = Math.cos(f), A = Math.sqrt(
8500
+ const n = Jt(p), r = Jt(s), a = Jt(c - h), d = Math.atan((1 - Rt) * Math.tan(n)), f = Math.atan((1 - Rt) * Math.tan(r)), _ = Math.sin(d), g = Math.cos(d), w = Math.sin(f), x = Math.cos(f), E = Math.sqrt(
8501
8501
  (x * Math.sin(a)) ** 2 + (g * w - _ * x * Math.cos(a)) ** 2
8502
- ), E = _ * w + g * x * Math.cos(a), P = Math.atan2(A, E);
8503
- if (P === 0)
8502
+ ), P = _ * w + g * x * Math.cos(a), M = Math.atan2(E, P);
8503
+ if (M === 0)
8504
8504
  return { distanceMeters: 0, bearingRad: 0 };
8505
- const H = 1 - (g * x * Math.sin(a) / Math.sin(P)) ** 2, S = H === 0 ? 0 : E - 2 * _ * w / H, D = (co ** 2 - jt ** 2) / jt ** 2 * H, G = 1 + D / 16384 * (4096 + D * (-768 + D * (320 - 175 * D))), Y = D / 1024 * (256 + D * (-128 + D * (74 - 47 * D))), q = Y * A * (S + Y / 4 * (E * (-1 + 2 * S ** 2) - Y / 6 * S * (-3 + 4 * A ** 2) * (-3 + 4 * S ** 2))), at = jt * G * (P - q), _t = Math.atan2(
8505
+ const F = 1 - (g * x * Math.sin(a) / Math.sin(M)) ** 2, C = F === 0 ? 0 : P - 2 * _ * w / F, D = (co ** 2 - jt ** 2) / jt ** 2 * F, G = 1 + D / 16384 * (4096 + D * (-768 + D * (320 - 175 * D))), Y = D / 1024 * (256 + D * (-128 + D * (74 - 47 * D))), q = Y * E * (C + Y / 4 * (P * (-1 + 2 * C ** 2) - Y / 6 * C * (-3 + 4 * E ** 2) * (-3 + 4 * C ** 2))), at = jt * G * (M - q), _t = Math.atan2(
8506
8506
  x * Math.sin(a),
8507
8507
  g * w - _ * x * Math.cos(a)
8508
8508
  );
@@ -8555,7 +8555,14 @@ function Mi(p, h = {}) {
8555
8555
  ), n;
8556
8556
  }
8557
8557
  let $n = !1;
8558
- class Ws {
8558
+ const Ws = {
8559
+ polygon: "tool:polygon:created",
8560
+ polyline: "tool:polyline:created",
8561
+ rectangle: "tool:rectangle:created",
8562
+ circle: "tool:circle:created",
8563
+ marker: "tool:marker:created"
8564
+ };
8565
+ class Ys {
8559
8566
  constructor(h) {
8560
8567
  k(this, "container");
8561
8568
  k(this, "logger");
@@ -8596,6 +8603,32 @@ class Ws {
8596
8603
  useExternalLeaflet: h.useExternalLeaflet
8597
8604
  }), ws(this.L), bs(this.L), Ls(this.L);
8598
8605
  }
8606
+ emitToolEvent(h, s) {
8607
+ var n, r;
8608
+ try {
8609
+ (r = (n = this.options.toolHooks) == null ? void 0 : n[h]) == null || r.call(n, s);
8610
+ } catch (a) {
8611
+ this._error(`tool hook failed: ${h}`, a);
8612
+ }
8613
+ const c = this.options.toolEventEmitter;
8614
+ if (c)
8615
+ try {
8616
+ if (typeof c.emit == "function") {
8617
+ c.emit(h, s);
8618
+ return;
8619
+ }
8620
+ typeof c.dispatchEvent == "function" && c.dispatchEvent(
8621
+ new CustomEvent(h, {
8622
+ detail: s
8623
+ })
8624
+ );
8625
+ } catch (a) {
8626
+ this._error(`tool emitter failed: ${h}`, a);
8627
+ }
8628
+ }
8629
+ setToolObservers(h) {
8630
+ this.options.toolHooks = h.toolHooks, this.options.toolEventEmitter = h.toolEventEmitter;
8631
+ }
8599
8632
  resolveLeaflet(h) {
8600
8633
  if (!h.useExternalLeaflet)
8601
8634
  return Ue;
@@ -8618,29 +8651,29 @@ class Ws {
8618
8651
  zoom: g,
8619
8652
  minZoom: w,
8620
8653
  maxZoom: x,
8621
- tileUrl: A,
8622
- tileAttribution: E,
8623
- preferCanvas: P = !0,
8654
+ tileUrl: E,
8655
+ tileAttribution: P,
8656
+ preferCanvas: M = !0,
8624
8657
  // Default to Canvas rendering for better performance
8625
8658
  useExternalLeaflet: U
8626
- } = this.options.map, H = [f, _], S = this.L;
8627
- U && Mi(S, {
8659
+ } = this.options.map, F = [f, _], C = this.L;
8660
+ U && Mi(C, {
8628
8661
  onError: (at) => this.logger.warn("external-leaflet-missing-draw", { message: at })
8629
- }), this.map = S.map(this.container, {
8662
+ }), this.map = C.map(this.container, {
8630
8663
  zoomControl: !0,
8631
- preferCanvas: P
8632
- }).setView(H, g), this.setTileLayer({
8633
- urlTemplate: A,
8634
- attribution: E != null ? E : "",
8664
+ preferCanvas: M
8665
+ }).setView(F, g), this.setTileLayer({
8666
+ urlTemplate: E,
8667
+ attribution: P != null ? P : "",
8635
8668
  maxZoom: x
8636
- }), this.drawnItems = S.featureGroup().addTo(this.map);
8669
+ }), this.drawnItems = C.featureGroup().addTo(this.map);
8637
8670
  const D = this.buildDrawOptions(
8638
8671
  this.options.controls,
8639
8672
  !!this.options.readOnly
8640
- ), G = S.Control.Draw;
8673
+ ), G = C.Control.Draw;
8641
8674
  this.drawControl = new G(D), this.map.addControl(this.drawControl), this.applyLayerCakeToolbarIcon(), this.applyMoveToolbarIcon(), this.options.controls.ruler && (this.logger.debug("init:ruler", {
8642
- available: typeof S.control.ruler == "function"
8643
- }), typeof S.control.ruler == "function" ? (this.addRulerControl(), this.installMeasurementSettingsControl()) : this.logger.warn("init:ruler:missing", {
8675
+ available: typeof C.control.ruler == "function"
8676
+ }), typeof C.control.ruler == "function" ? (this.addRulerControl(), this.installMeasurementSettingsControl()) : this.logger.warn("init:ruler:missing", {
8644
8677
  msg: "L.control.ruler is not defined"
8645
8678
  })), this.patchLeafletDrawBugs(), this.installPolygonFinishPatch(), this.map.invalidateSize(), setTimeout(() => {
8646
8679
  var at;
@@ -8817,7 +8850,12 @@ class Ws {
8817
8850
  return a || null;
8818
8851
  }
8819
8852
  setRulerUnits(h) {
8820
- this.measurementSystem !== h && (this.measurementSystem = h, this.logger.debug("ruler:units", { system: h }), this.syncMeasurementModalState(), this.rebuildRulerControl());
8853
+ if (this.measurementSystem === h) return;
8854
+ const s = this.measurementSystem;
8855
+ this.measurementSystem = h, this.logger.debug("ruler:units", { system: h }), this.emitToolEvent("tool:ruler:units-changed", {
8856
+ previous: s,
8857
+ current: h
8858
+ }), this.syncMeasurementModalState(), this.rebuildRulerControl();
8821
8859
  }
8822
8860
  // ---------------- Internals ----------------
8823
8861
  buildDrawOptions(h, s) {
@@ -8927,8 +8965,8 @@ class Ws {
8927
8965
  _.lng,
8928
8966
  g.lat,
8929
8967
  g.lng
8930
- ), A = w / 1e3, E = typeof ((f = (d = this.options) == null ? void 0 : d.lengthUnit) == null ? void 0 : f.factor) == "number" ? this.options.lengthUnit.factor : 1, P = Si(A * E);
8931
- this._result = this._result || {}, this._result.Distance = P, this._result.Bearing = x, this._result.meters = w;
8968
+ ), E = w / 1e3, P = typeof ((f = (d = this.options) == null ? void 0 : d.lengthUnit) == null ? void 0 : f.factor) == "number" ? this.options.lengthUnit.factor : 1, M = Si(E * P);
8969
+ this._result = this._result || {}, this._result.Distance = M, this._result.Bearing = x, this._result.meters = w;
8932
8970
  } catch (_) {
8933
8971
  n == null || n.warn("ruler:precision-patch", _);
8934
8972
  }
@@ -9048,16 +9086,16 @@ class Ws {
9048
9086
  const h = this.map, s = (f = (d = this.drawControl) == null ? void 0 : d._toolbars) == null ? void 0 : f.draw;
9049
9087
  if (!s || !!!((g = (_ = s._modes) == null ? void 0 : _.polygon) != null && g.handler)) return;
9050
9088
  const n = 10, r = (w) => {
9051
- var x, A, E, P, U, H, S, D;
9089
+ var x, E, P, M, U, F, C, D;
9052
9090
  try {
9053
- const G = (A = (x = s._modes) == null ? void 0 : x.polygon) == null ? void 0 : A.handler;
9091
+ const G = (E = (x = s._modes) == null ? void 0 : x.polygon) == null ? void 0 : E.handler;
9054
9092
  if (!G || !G._enabled) return;
9055
9093
  const Y = G._markers;
9056
9094
  if (!Array.isArray(Y) || Y.length < 4) return;
9057
- const q = (P = (E = Y[0]) == null ? void 0 : E.getLatLng) == null ? void 0 : P.call(E);
9095
+ const q = (M = (P = Y[0]) == null ? void 0 : P.getLatLng) == null ? void 0 : M.call(P);
9058
9096
  if (!q) return;
9059
9097
  const at = h.latLngToContainerPoint(q), _t = h.latLngToContainerPoint(w.latlng);
9060
- Math.hypot(at.x - _t.x, at.y - _t.y) <= n && typeof G._finishShape == "function" && ((H = (U = w.originalEvent) == null ? void 0 : U.preventDefault) == null || H.call(U), (D = (S = w.originalEvent) == null ? void 0 : S.stopPropagation) == null || D.call(S), G._finishShape());
9098
+ Math.hypot(at.x - _t.x, at.y - _t.y) <= n && typeof G._finishShape == "function" && ((F = (U = w.originalEvent) == null ? void 0 : U.preventDefault) == null || F.call(U), (D = (C = w.originalEvent) == null ? void 0 : C.stopPropagation) == null || D.call(C), G._finishShape());
9061
9099
  } catch (G) {
9062
9100
  this._error("polygon-finish-patch", G);
9063
9101
  }
@@ -9085,16 +9123,16 @@ class Ws {
9085
9123
  nm: 2
9086
9124
  }, _ = (s = (h = d.formattedNumber) == null ? void 0 : h.bind(d)) != null ? s : ((g, w) => Number(g).toFixed(w));
9087
9125
  d.readableArea = (g, w, x) => {
9088
- var P;
9089
- const A = (P = a.Util) != null && P.extend ? a.Util.extend({}, f, x || {}) : { ...f, ...x || {} };
9090
- let E;
9126
+ var M;
9127
+ const E = (M = a.Util) != null && M.extend ? a.Util.extend({}, f, x || {}) : { ...f, ...x || {} };
9128
+ let P;
9091
9129
  if (w) {
9092
9130
  let U = ["ha", "m"];
9093
- const H = typeof w;
9094
- H === "string" ? U = [w] : H !== "boolean" && (U = Array.isArray(w) ? w : U), g >= 1e6 && U.indexOf("km") !== -1 ? E = `${_(1e-6 * g, A.km)} km²` : g >= 1e4 && U.indexOf("ha") !== -1 ? E = `${_(1e-4 * g, A.ha)} ha` : E = `${_(g, A.m)} m²`;
9131
+ const F = typeof w;
9132
+ F === "string" ? U = [w] : F !== "boolean" && (U = Array.isArray(w) ? w : U), g >= 1e6 && U.indexOf("km") !== -1 ? P = `${_(1e-6 * g, E.km)} km²` : g >= 1e4 && U.indexOf("ha") !== -1 ? P = `${_(1e-4 * g, E.ha)} ha` : P = `${_(g, E.m)} m²`;
9095
9133
  } else
9096
- g = g / 0.836127, g >= 3097600 ? E = `${_(g / 3097600, A.mi)} mi²` : g >= 4840 ? E = `${_(g / 4840, A.ac)} acres` : E = `${_(g, A.yd)} yd²`;
9097
- return E;
9134
+ g = g / 0.836127, g >= 3097600 ? P = `${_(g / 3097600, E.mi)} mi²` : g >= 4840 ? P = `${_(g / 4840, E.ac)} acres` : P = `${_(g, E.yd)} yd²`;
9135
+ return P;
9098
9136
  };
9099
9137
  } catch (a) {
9100
9138
  this.logger.warn("leaflet-draw-patch:readableArea", a);
@@ -9103,14 +9141,14 @@ class Ws {
9103
9141
  const a = this.L, d = (c = a.Edit) == null ? void 0 : c.Circle, f = (n = a.Draw) == null ? void 0 : n.Event, _ = a.GeometryUtil;
9104
9142
  if (!((r = d == null ? void 0 : d.prototype) != null && r._resize) || !f || !_) return;
9105
9143
  d.prototype._resize = function(w) {
9106
- var E, P, U;
9107
- const x = this._moveMarker.getLatLng(), A = _.isVersion07x() ? x.distanceTo(w) : this._map.distance(x, w);
9108
- this._shape.setRadius(A);
9144
+ var P, M, U;
9145
+ const x = this._moveMarker.getLatLng(), E = _.isVersion07x() ? x.distanceTo(w) : this._map.distance(x, w);
9146
+ this._shape.setRadius(E);
9109
9147
  try {
9110
- (E = this._map) != null && E.editTooltip && ((U = (P = this._map) == null ? void 0 : P._editTooltip) != null && U.updateContent) && this._map._editTooltip.updateContent({
9148
+ (P = this._map) != null && P.editTooltip && ((U = (M = this._map) == null ? void 0 : M._editTooltip) != null && U.updateContent) && this._map._editTooltip.updateContent({
9111
9149
  text: a.drawLocal.edit.handlers.edit.tooltip.subtext + "<br />" + a.drawLocal.edit.handlers.edit.tooltip.text,
9112
9150
  subtext: a.drawLocal.draw.handlers.circle.radius + ": " + _.readableDistance(
9113
- A,
9151
+ E,
9114
9152
  !0,
9115
9153
  this.options.feet,
9116
9154
  this.options.nautic
@@ -9137,22 +9175,27 @@ class Ws {
9137
9175
  this.activeCakeSession = new Ss(
9138
9176
  this.map,
9139
9177
  r,
9140
- (g) => {
9178
+ (w) => {
9141
9179
  if (!this.drawnItems) return;
9142
- const w = this.store.add(g), x = this.L.geoJSON(g);
9143
- let A = 0;
9144
- x.eachLayer((E) => {
9145
- var U, H, S;
9146
- const P = (U = w[A]) != null ? U : w[w.length - 1];
9147
- E._fid = P, this.drawnItems.addLayer(E), this.installVertexContextMenu(E), (S = (H = this.options.callbacks) == null ? void 0 : H.onCreated) == null || S.call(H, {
9148
- id: P,
9180
+ const x = this.store.add(w), E = this.L.geoJSON(w);
9181
+ let P = 0;
9182
+ E.eachLayer((M) => {
9183
+ var F, C, D;
9184
+ const U = (F = x[P]) != null ? F : x[x.length - 1];
9185
+ M._fid = U, this.drawnItems.addLayer(M), this.installVertexContextMenu(M), (D = (C = this.options.callbacks) == null ? void 0 : C.onCreated) == null || D.call(C, {
9186
+ id: U,
9149
9187
  layerType: "polygon",
9150
- geoJSON: E.toGeoJSON()
9151
- }), A++;
9152
- }), this.activeCakeSession = null;
9188
+ geoJSON: M.toGeoJSON()
9189
+ }), P++;
9190
+ }), this.activeCakeSession = null, this.emitToolEvent("tool:layer-cake:saved", {
9191
+ featureCollection: w
9192
+ });
9153
9193
  },
9154
9194
  this.measurementSystem
9155
- );
9195
+ ), this.emitToolEvent("tool:layer-cake:session-started", {
9196
+ center: r.getLatLng(),
9197
+ radius: r.getRadius()
9198
+ });
9156
9199
  return;
9157
9200
  }
9158
9201
  this.drawnItems.addLayer(r);
@@ -9161,6 +9204,11 @@ class Ws {
9161
9204
  features: [d]
9162
9205
  })[0];
9163
9206
  r._fid = _, this.installVertexContextMenu(r), (n = (c = this.options.callbacks) == null ? void 0 : c.onCreated) == null || n.call(c, { id: _, layerType: a, geoJSON: d });
9207
+ const g = Ws[a];
9208
+ g && this.emitToolEvent(g, {
9209
+ id: _,
9210
+ geoJSON: d
9211
+ });
9164
9212
  } catch (r) {
9165
9213
  this._error("onCreated handler failed", r);
9166
9214
  }
@@ -9168,20 +9216,25 @@ class Ws {
9168
9216
  var s, c;
9169
9217
  try {
9170
9218
  const n = [];
9171
- h.layers.eachLayer((a) => {
9172
- const d = a.toGeoJSON(), f = a._fid;
9173
- if (f)
9174
- this.store.update(f, d), n.push(f);
9219
+ h.layers.eachLayer((d) => {
9220
+ const f = d.toGeoJSON(), _ = d._fid;
9221
+ if (_)
9222
+ this.store.update(_, f), n.push(_);
9175
9223
  else {
9176
- const _ = this.store.add({
9224
+ const g = this.store.add({
9177
9225
  type: "FeatureCollection",
9178
- features: [d]
9226
+ features: [f]
9179
9227
  })[0];
9180
- a._fid = _, n.push(_);
9228
+ d._fid = g, n.push(g);
9181
9229
  }
9182
- }), (c = (s = this.options.callbacks) == null ? void 0 : s.onEdited) == null || c.call(s, {
9230
+ });
9231
+ const a = this.store.toFeatureCollection();
9232
+ (c = (s = this.options.callbacks) == null ? void 0 : s.onEdited) == null || c.call(s, {
9183
9233
  ids: n,
9184
- geoJSON: this.store.toFeatureCollection()
9234
+ geoJSON: a
9235
+ }), this.emitToolEvent("tool:edit:applied", {
9236
+ ids: n,
9237
+ geoJSON: a
9185
9238
  });
9186
9239
  } catch (n) {
9187
9240
  this._error("onEdited handler failed", n);
@@ -9190,36 +9243,51 @@ class Ws {
9190
9243
  var s, c;
9191
9244
  try {
9192
9245
  const n = [];
9193
- h.layers.eachLayer((a) => {
9194
- const d = a._fid;
9195
- d && (n.push(d), this.store.remove(d));
9196
- }), (c = (s = this.options.callbacks) == null ? void 0 : s.onDeleted) == null || c.call(s, {
9246
+ h.layers.eachLayer((d) => {
9247
+ const f = d._fid;
9248
+ f && (n.push(f), this.store.remove(f));
9249
+ });
9250
+ const a = this.store.toFeatureCollection();
9251
+ (c = (s = this.options.callbacks) == null ? void 0 : s.onDeleted) == null || c.call(s, {
9197
9252
  ids: n,
9198
- geoJSON: this.store.toFeatureCollection()
9253
+ geoJSON: a
9254
+ }), this.emitToolEvent("tool:delete:applied", {
9255
+ ids: n,
9256
+ geoJSON: a
9199
9257
  });
9200
9258
  } catch (n) {
9201
9259
  this._error("onDeleted handler failed", n);
9202
9260
  }
9203
9261
  }), this.map.on("draw:moveend", (h) => {
9262
+ var s;
9204
9263
  try {
9205
- this.showMoveConfirmationUI(h.layer, h.originalGeoJSON, h.newGeoJSON);
9206
- } catch (s) {
9207
- this._error("draw:moveend handler failed", s);
9264
+ this.emitToolEvent("tool:move:pending", {
9265
+ layerId: (s = h == null ? void 0 : h.layer) == null ? void 0 : s._fid,
9266
+ originalGeoJSON: h == null ? void 0 : h.originalGeoJSON,
9267
+ newGeoJSON: h == null ? void 0 : h.newGeoJSON
9268
+ }), this.showMoveConfirmationUI(h.layer);
9269
+ } catch (c) {
9270
+ this._error("draw:moveend handler failed", c);
9208
9271
  }
9209
9272
  }), this.map.on("draw:moveconfirmed", (h) => {
9210
- var s, c;
9273
+ var s, c, n;
9211
9274
  try {
9212
- const n = h.layer, r = n._fid;
9213
- if (r) {
9214
- const a = n.toGeoJSON();
9215
- this.store.update(r, a), (c = (s = this.options.callbacks) == null ? void 0 : s.onEdited) == null || c.call(s, {
9216
- ids: [r],
9275
+ this.emitToolEvent("tool:move:confirmed", {
9276
+ layerId: (s = h == null ? void 0 : h.layer) == null ? void 0 : s._fid,
9277
+ originalGeoJSON: h == null ? void 0 : h.originalGeoJSON,
9278
+ newGeoJSON: h == null ? void 0 : h.newGeoJSON
9279
+ });
9280
+ const r = h.layer, a = r._fid;
9281
+ if (a) {
9282
+ const d = r.toGeoJSON();
9283
+ this.store.update(a, d), (n = (c = this.options.callbacks) == null ? void 0 : c.onEdited) == null || n.call(c, {
9284
+ ids: [a],
9217
9285
  geoJSON: this.store.toFeatureCollection()
9218
9286
  });
9219
9287
  }
9220
9288
  this.hideMoveConfirmationUI();
9221
- } catch (n) {
9222
- this._error("draw:moveconfirmed handler failed", n);
9289
+ } catch (r) {
9290
+ this._error("draw:moveconfirmed handler failed", r);
9223
9291
  }
9224
9292
  }));
9225
9293
  }
@@ -9296,13 +9364,13 @@ class Ws {
9296
9364
  }
9297
9365
  findNearestVertex(h, s, c) {
9298
9366
  if (!this.map) return null;
9299
- const n = (x) => this.map.latLngToContainerPoint(x), r = (x, A) => Math.hypot(x.x - A.x, x.y - A.y), a = n(s);
9367
+ const n = (x) => this.map.latLngToContainerPoint(x), r = (x, E) => Math.hypot(x.x - E.x, x.y - E.y), a = n(s);
9300
9368
  let d = 1 / 0, f = -1, _ = -1;
9301
9369
  const g = h.getLatLngs();
9302
- return (Array.isArray(g[0]) ? g : [g]).forEach((x, A) => {
9303
- x.forEach((E, P) => {
9304
- const U = n(E), H = r(U, a);
9305
- H < d && (d = H, f = A, _ = P);
9370
+ return (Array.isArray(g[0]) ? g : [g]).forEach((x, E) => {
9371
+ x.forEach((P, M) => {
9372
+ const U = n(P), F = r(U, a);
9373
+ F < d && (d = F, f = E, _ = M);
9306
9374
  });
9307
9375
  }), f === -1 || d > c ? null : { pathIndex: f, vertexIndex: _ };
9308
9376
  }
@@ -9317,15 +9385,15 @@ class Ws {
9317
9385
  if (g.splice(c, 1), _.length === 1)
9318
9386
  h.setLatLngs(g);
9319
9387
  else {
9320
- const E = _.map((P, U) => U === s ? g : P);
9321
- h.setLatLngs(E);
9388
+ const P = _.map((M, U) => U === s ? g : M);
9389
+ h.setLatLngs(P);
9322
9390
  }
9323
9391
  (n = h.redraw) == null || n.call(h);
9324
- const A = h._fid;
9325
- if (A) {
9326
- const E = h.toGeoJSON();
9327
- this.store.update(A, E), (a = (r = this.options.callbacks) == null ? void 0 : r.onEdited) == null || a.call(r, {
9328
- ids: [A],
9392
+ const E = h._fid;
9393
+ if (E) {
9394
+ const P = h.toGeoJSON();
9395
+ this.store.update(E, P), (a = (r = this.options.callbacks) == null ? void 0 : r.onEdited) == null || a.call(r, {
9396
+ ids: [E],
9329
9397
  geoJSON: this.store.toFeatureCollection()
9330
9398
  });
9331
9399
  }
@@ -9334,38 +9402,40 @@ class Ws {
9334
9402
  }
9335
9403
  }
9336
9404
  // -------- Move tool Save/Cancel UI --------
9337
- showMoveConfirmationUI(h, s, c) {
9338
- var n, r;
9405
+ showMoveConfirmationUI(h) {
9406
+ var s, c;
9339
9407
  try {
9340
9408
  if (this.hideMoveConfirmationUI(), !this.container || !this.map) return;
9341
- const a = this.drawControl;
9342
- if (!a) return;
9343
- const d = (n = a == null ? void 0 : a._toolbars) == null ? void 0 : n.draw;
9344
- if (!d) return;
9345
- const f = d._modes || {};
9346
- let _ = null;
9347
- for (const A in f) {
9348
- const E = f[A];
9349
- if (((r = E == null ? void 0 : E.handler) == null ? void 0 : r.type) === "move") {
9350
- _ = E.handler;
9409
+ const n = this.drawControl;
9410
+ if (!n) return;
9411
+ const r = (s = n == null ? void 0 : n._toolbars) == null ? void 0 : s.draw;
9412
+ if (!r) return;
9413
+ const a = r._modes || {};
9414
+ let d = null;
9415
+ for (const w in a) {
9416
+ const x = a[w];
9417
+ if (((c = x == null ? void 0 : x.handler) == null ? void 0 : c.type) === "move") {
9418
+ d = x.handler;
9351
9419
  break;
9352
9420
  }
9353
9421
  }
9354
- this.activeMoveHandler = _;
9355
- const g = document.createElement("div");
9356
- g.style.position = "absolute", g.style.bottom = "60px", g.style.left = "50%", g.style.transform = "translateX(-50%)", g.style.display = "flex", g.style.gap = "8px", g.style.background = "#fff", g.style.border = "2px solid #3388ff", g.style.borderRadius = "8px", g.style.padding = "12px 16px", g.style.boxShadow = "0 4px 12px rgba(0,0,0,0.2)", g.style.zIndex = "10000", g.style.fontSize = "14px", g.style.fontFamily = "system-ui, sans-serif";
9357
- const w = document.createElement("button");
9358
- w.textContent = "✓ Save", w.style.padding = "8px 16px", w.style.border = "none", w.style.background = "#28a745", w.style.color = "#fff", w.style.borderRadius = "4px", w.style.cursor = "pointer", w.style.fontWeight = "600", w.style.fontSize = "14px", w.addEventListener("click", (A) => {
9359
- A.stopPropagation(), A.preventDefault(), _ != null && _.confirmMove && _.confirmMove();
9422
+ this.activeMoveHandler = d;
9423
+ const f = document.createElement("div");
9424
+ f.style.position = "absolute", f.style.bottom = "60px", f.style.left = "50%", f.style.transform = "translateX(-50%)", f.style.display = "flex", f.style.gap = "8px", f.style.background = "#fff", f.style.border = "2px solid #3388ff", f.style.borderRadius = "8px", f.style.padding = "12px 16px", f.style.boxShadow = "0 4px 12px rgba(0,0,0,0.2)", f.style.zIndex = "10000", f.style.fontSize = "14px", f.style.fontFamily = "system-ui, sans-serif";
9425
+ const _ = document.createElement("button");
9426
+ _.textContent = "✓ Save", _.style.padding = "8px 16px", _.style.border = "none", _.style.background = "#28a745", _.style.color = "#fff", _.style.borderRadius = "4px", _.style.cursor = "pointer", _.style.fontWeight = "600", _.style.fontSize = "14px", _.addEventListener("click", (w) => {
9427
+ w.stopPropagation(), w.preventDefault(), d != null && d.confirmMove && d.confirmMove();
9360
9428
  });
9361
- const x = document.createElement("button");
9362
- x.textContent = "✕ Cancel", x.style.padding = "8px 16px", x.style.border = "1px solid #ccc", x.style.background = "#fff", x.style.color = "#333", x.style.borderRadius = "4px", x.style.cursor = "pointer", x.style.fontWeight = "600", x.style.fontSize = "14px", x.addEventListener("click", (A) => {
9363
- A.stopPropagation(), A.preventDefault(), _ != null && _.cancelMove && _.cancelMove(), this.hideMoveConfirmationUI();
9364
- }), g.appendChild(w), g.appendChild(x), this.container.appendChild(g), this.moveConfirmationUI = g, this.logger.debug("showMoveConfirmationUI", {
9429
+ const g = document.createElement("button");
9430
+ g.textContent = "✕ Cancel", g.style.padding = "8px 16px", g.style.border = "1px solid #ccc", g.style.background = "#fff", g.style.color = "#333", g.style.borderRadius = "4px", g.style.cursor = "pointer", g.style.fontWeight = "600", g.style.fontSize = "14px", g.addEventListener("click", (w) => {
9431
+ w.stopPropagation(), w.preventDefault(), this.emitToolEvent("tool:move:cancelled", {
9432
+ layerId: h == null ? void 0 : h._fid
9433
+ }), d != null && d.cancelMove && d.cancelMove(), this.hideMoveConfirmationUI();
9434
+ }), f.appendChild(_), f.appendChild(g), this.container.appendChild(f), this.moveConfirmationUI = f, this.logger.debug("showMoveConfirmationUI", {
9365
9435
  layerId: h._fid
9366
9436
  });
9367
- } catch (a) {
9368
- this._error("showMoveConfirmationUI", a);
9437
+ } catch (n) {
9438
+ this._error("showMoveConfirmationUI", n);
9369
9439
  }
9370
9440
  }
9371
9441
  hideMoveConfirmationUI() {
@@ -9402,7 +9472,7 @@ function fo(p) {
9402
9472
  const h = p.trim();
9403
9473
  return h.length > 0 ? h : void 0;
9404
9474
  }
9405
- function Ys(p) {
9475
+ function qs(p) {
9406
9476
  const { style: h, attribution: s } = p, c = uo(p.provider), n = fo(p.apiKey);
9407
9477
  switch (c) {
9408
9478
  case "osm":
@@ -9427,7 +9497,7 @@ function Ys(p) {
9427
9497
  throw new Error(`Unknown tile provider: ${p.provider}`);
9428
9498
  }
9429
9499
  }
9430
- function qs(p) {
9500
+ function js(p) {
9431
9501
  const h = uo(p.provider), s = fo(p.apiKey);
9432
9502
  return h ? h === "here" && !s ? { valid: !1, error: "HERE Maps requires an API key" } : { valid: !0 } : { valid: !1, error: "Provider is required" };
9433
9503
  }
@@ -9468,6 +9538,8 @@ class po extends HTMLElement {
9468
9538
  k(this, "_useExternalLeaflet", !1);
9469
9539
  k(this, "_skipLeafletStyles", !1);
9470
9540
  k(this, "_leafletInstance");
9541
+ k(this, "_toolHooks");
9542
+ k(this, "_toolEventEmitter");
9471
9543
  this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = `
9472
9544
  <style>
9473
9545
  :host {
@@ -9529,7 +9601,7 @@ class po extends HTMLElement {
9529
9601
  this._logger.debug("connectedCallback", this._currentConfig()), ss({
9530
9602
  root: this._root,
9531
9603
  skipStyles: this._skipLeafletStyles
9532
- }), this._applyThemeStyles(), this._controller = new Ws({
9604
+ }), this._applyThemeStyles(), this._controller = new Ys({
9533
9605
  container: this._container,
9534
9606
  map: this._mapConfig(),
9535
9607
  controls: this._controlsFromAttributes(),
@@ -9559,7 +9631,9 @@ class po extends HTMLElement {
9559
9631
  }
9560
9632
  },
9561
9633
  leaflet: (s = this._leafletInstance) != null ? s : void 0,
9562
- useExternalLeaflet: this._useExternalLeaflet
9634
+ useExternalLeaflet: this._useExternalLeaflet,
9635
+ toolHooks: this._toolHooks,
9636
+ toolEventEmitter: this._toolEventEmitter
9563
9637
  }), await this._controller.init(), this._tileProvider && this._updateTileLayer();
9564
9638
  }
9565
9639
  async disconnectedCallback() {
@@ -9682,7 +9756,7 @@ class po extends HTMLElement {
9682
9756
  style: this._tileStyle,
9683
9757
  apiKey: this._apiKey,
9684
9758
  attribution: this._tileAttribution
9685
- }, _ = qs(f);
9759
+ }, _ = js(f);
9686
9760
  if (!_.valid) {
9687
9761
  const x = (c = _.error) != null && c.toLowerCase().includes("api key") ? "missing_api_key" : "tile_load_failed";
9688
9762
  this._handleTileProviderError(
@@ -9692,12 +9766,12 @@ class po extends HTMLElement {
9692
9766
  );
9693
9767
  return;
9694
9768
  }
9695
- const g = Ys(f), w = this._activeTileProvider;
9769
+ const g = qs(f), w = this._activeTileProvider;
9696
9770
  s.setTileLayer(g, {
9697
9771
  onTileError: (x) => {
9698
9772
  if (this._tileProvider !== d) return;
9699
- const A = this._describeTileLayerError(x, d), E = d === "here" ? this._resolveHereTileLayerErrorCode(A) : "tile_load_failed";
9700
- this._handleTileProviderError(E, A, d);
9773
+ const E = this._describeTileLayerError(x, d), P = d === "here" ? this._resolveHereTileLayerErrorCode(E) : "tile_load_failed";
9774
+ this._handleTileProviderError(P, E, d);
9701
9775
  }
9702
9776
  }), this._activeTileProvider = d, this._emitTileProviderChanged(
9703
9777
  d,
@@ -9862,6 +9936,28 @@ class po extends HTMLElement {
9862
9936
  set leafletInstance(s) {
9863
9937
  this._leafletInstance = s;
9864
9938
  }
9939
+ get toolHooks() {
9940
+ return this._toolHooks;
9941
+ }
9942
+ set toolHooks(s) {
9943
+ this._toolHooks = s;
9944
+ const c = this._controller;
9945
+ typeof (c == null ? void 0 : c.setToolObservers) == "function" && c.setToolObservers({
9946
+ toolHooks: this._toolHooks,
9947
+ toolEventEmitter: this._toolEventEmitter
9948
+ });
9949
+ }
9950
+ get toolEventEmitter() {
9951
+ return this._toolEventEmitter;
9952
+ }
9953
+ set toolEventEmitter(s) {
9954
+ this._toolEventEmitter = s;
9955
+ const c = this._controller;
9956
+ typeof (c == null ? void 0 : c.setToolObservers) == "function" && c.setToolObservers({
9957
+ toolHooks: this._toolHooks,
9958
+ toolEventEmitter: this._toolEventEmitter
9959
+ });
9960
+ }
9865
9961
  get themeCss() {
9866
9962
  return this._themeCss;
9867
9963
  }
@@ -10070,22 +10166,22 @@ const io = ".geokit-editor-widget", no = "400px", mo = "data-geokit-", oo = [
10070
10166
  "leaflet-draw:deleted",
10071
10167
  "leaflet-draw:merged"
10072
10168
  ];
10073
- function js(p = io, h) {
10169
+ function Js(p = io, h) {
10074
10170
  var a;
10075
- const s = Js(p, h), c = (a = s.selector) != null ? a : io, n = [];
10171
+ const s = Ks(p, h), c = (a = s.selector) != null ? a : io, n = [];
10076
10172
  return document.querySelectorAll(c).forEach((d) => {
10077
10173
  var _;
10078
- const f = Ks(d, s);
10174
+ const f = Xs(d, s);
10079
10175
  f && (n.push(f), (_ = s.onInit) == null || _.call(s, f));
10080
10176
  }), n;
10081
10177
  }
10082
- function Js(p, h) {
10178
+ function Ks(p, h) {
10083
10179
  return typeof p == "string" ? {
10084
10180
  selector: p,
10085
10181
  ...h
10086
10182
  } : p != null ? p : {};
10087
10183
  }
10088
- function Ks(p, h) {
10184
+ function Xs(p, h) {
10089
10185
  var w, x;
10090
10186
  if (p.dataset.geokitBound === "true")
10091
10187
  return null;
@@ -10101,16 +10197,16 @@ function Ks(p, h) {
10101
10197
  const n = document.createElement(
10102
10198
  "leaflet-geokit"
10103
10199
  );
10104
- n.style.display = "block", n.style.width = "100%", n.style.height = Xs(p, h);
10200
+ n.style.display = "block", n.style.width = "100%", n.style.height = Qs(p, h);
10105
10201
  const r = (x = h.attributePrefix) != null ? x : mo;
10106
- Qs(p, n, r), $s(n, h.elementAttributes), s.insertBefore(c, p), c.appendChild(n), p.style.display = "none", p.setAttribute("aria-hidden", "true");
10202
+ $s(p, n, r), ta(n, h.elementAttributes), s.insertBefore(c, p), c.appendChild(n), p.style.display = "none", p.setAttribute("aria-hidden", "true");
10107
10203
  const a = async () => {
10108
- var A;
10204
+ var E;
10109
10205
  try {
10110
- const E = await n.getGeoJSON();
10111
- p.value = JSON.stringify(E);
10112
- } catch (E) {
10113
- (A = h.onError) == null || A.call(h, ro(E), {
10206
+ const P = await n.getGeoJSON();
10207
+ p.value = JSON.stringify(P);
10208
+ } catch (P) {
10209
+ (E = h.onError) == null || E.call(h, ro(P), {
10114
10210
  phase: "sync",
10115
10211
  textarea: p,
10116
10212
  element: n
@@ -10119,15 +10215,15 @@ function Ks(p, h) {
10119
10215
  }, d = () => {
10120
10216
  a();
10121
10217
  };
10122
- oo.forEach((A) => {
10123
- n.addEventListener(A, d);
10218
+ oo.forEach((E) => {
10219
+ n.addEventListener(E, d);
10124
10220
  });
10125
10221
  const f = p.value.trim();
10126
10222
  let _ = null;
10127
10223
  return f && (_ = () => {
10128
- n.loadGeoJSONFromText(f).then(() => a()).catch((A) => {
10129
- var E;
10130
- (E = h.onError) == null || E.call(h, ro(A), {
10224
+ n.loadGeoJSONFromText(f).then(() => a()).catch((E) => {
10225
+ var P;
10226
+ (P = h.onError) == null || P.call(h, ro(E), {
10131
10227
  phase: "parse",
10132
10228
  textarea: p,
10133
10229
  element: n
@@ -10139,13 +10235,13 @@ function Ks(p, h) {
10139
10235
  container: c,
10140
10236
  sync: a,
10141
10237
  destroy: () => {
10142
- oo.forEach((A) => {
10143
- n.removeEventListener(A, d);
10238
+ oo.forEach((E) => {
10239
+ n.removeEventListener(E, d);
10144
10240
  }), _ && n.removeEventListener("leaflet-draw:ready", _), p.style.display = "", p.removeAttribute("aria-hidden"), delete p.dataset.geokitBound, c.remove();
10145
10241
  }
10146
10242
  };
10147
10243
  }
10148
- function Xs(p, h) {
10244
+ function Qs(p, h) {
10149
10245
  var a, d;
10150
10246
  const s = (a = h.attributePrefix) != null ? a : mo, c = p.getAttribute(`${s}height`), n = (d = c != null ? c : h.height) != null ? d : no;
10151
10247
  if (typeof n == "number")
@@ -10153,7 +10249,7 @@ function Xs(p, h) {
10153
10249
  const r = n.trim();
10154
10250
  return r ? /^\d+$/.test(r) ? `${r}px` : r : no;
10155
10251
  }
10156
- function Qs(p, h, s) {
10252
+ function $s(p, h, s) {
10157
10253
  Array.from(p.attributes).forEach((c) => {
10158
10254
  if (!c.name.startsWith(s)) return;
10159
10255
  const n = c.name.slice(s.length);
@@ -10170,7 +10266,7 @@ function Re(p, h, s) {
10170
10266
  p.setAttribute(h, s);
10171
10267
  }
10172
10268
  }
10173
- function $s(p, h) {
10269
+ function ta(p, h) {
10174
10270
  h && Object.entries(h).forEach(([s, c]) => {
10175
10271
  if (!(s === "height" || s === "bound")) {
10176
10272
  if (typeof c == "boolean") {
@@ -10191,9 +10287,9 @@ function ro(p) {
10191
10287
  );
10192
10288
  }
10193
10289
  typeof window != "undefined" && (window.GeoKitDjango = {
10194
- init: js
10290
+ init: Js
10195
10291
  });
10196
10292
  export {
10197
- js as initDjangoGeokit
10293
+ Js as initDjangoGeokit
10198
10294
  };
10199
10295
  //# sourceMappingURL=index.js.map