@idm-plugin/geo 1.7.1 → 1.7.3

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
@@ -56,7 +56,7 @@ var j = { exports: {} };
56
56
  population: a[5] | 0
57
57
  };
58
58
  }
59
- function G(c) {
59
+ function I(c) {
60
60
  c && this._set(P(c));
61
61
  }
62
62
  function l(c, a) {
@@ -71,7 +71,7 @@ var j = { exports: {} };
71
71
  n = Math.floor((T + S) / 2), a[n] <= c ? T = n : S = n;
72
72
  return S;
73
73
  }
74
- G.prototype = {
74
+ I.prototype = {
75
75
  _set: function(c) {
76
76
  this.name = c.name, this.abbrs = c.abbrs, this.untils = c.untils, this.offsets = c.offsets, this.population = c.population;
77
77
  },
@@ -106,7 +106,7 @@ var j = { exports: {} };
106
106
  function f(c, a) {
107
107
  this.name = c, this.zones = a;
108
108
  }
109
- function I(c) {
109
+ function G(c) {
110
110
  var a = c.toTimeString(), X = a.match(/\([a-z ]+\)/i);
111
111
  X && X[0] ? (X = X[0].match(/[A-Z]/g), X = X ? X.join("") : void 0) : (X = a.match(/[A-Z]{3,5}/g), X = X ? X[0] : void 0), X === "GMT" && (X = void 0), this.at = +c, this.abbr = X, this.offset = c.getTimezoneOffset();
112
112
  }
@@ -118,15 +118,15 @@ var j = { exports: {} };
118
118
  };
119
119
  function Q(c, a) {
120
120
  for (var X, n; n = ((a.at - c.at) / 12e4 | 0) * 6e4; )
121
- X = new I(new Date(c.at + n)), X.offset === c.offset ? c = X : a = X;
121
+ X = new G(new Date(c.at + n)), X.offset === c.offset ? c = X : a = X;
122
122
  return c;
123
123
  }
124
124
  function F() {
125
- var c = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new I(new Date(c, 0, 1)), X = a.offset, n = [a], T, S, t, r;
125
+ var c = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new G(new Date(c, 0, 1)), X = a.offset, n = [a], T, S, t, r;
126
126
  for (r = 1; r < 48; r++)
127
- t = new Date(c, r, 1).getTimezoneOffset(), t !== X && (S = new I(new Date(c, r, 1)), T = Q(a, S), n.push(T), n.push(new I(new Date(T.at + 6e4))), a = S, X = t);
127
+ t = new Date(c, r, 1).getTimezoneOffset(), t !== X && (S = new G(new Date(c, r, 1)), T = Q(a, S), n.push(T), n.push(new G(new Date(T.at + 6e4))), a = S, X = t);
128
128
  for (r = 0; r < 4; r++)
129
- n.push(new I(new Date(c + r, 0, 1))), n.push(new I(new Date(c + r, 6, 1)));
129
+ n.push(new G(new Date(c + r, 0, 1))), n.push(new G(new Date(c + r, 6, 1)));
130
130
  return n;
131
131
  }
132
132
  function M0(c, a) {
@@ -183,7 +183,7 @@ var j = { exports: {} };
183
183
  function g(c, a) {
184
184
  c = K(c);
185
185
  var X = p[c], n;
186
- return X instanceof G ? X : typeof X == "string" ? (X = new G(X), p[c] = X, X) : O[c] && a !== g && (n = g(O[c], g)) ? (X = p[c] = new G(), X._set(n), X.name = b[c], X) : null;
186
+ return X instanceof I ? X : typeof X == "string" ? (X = new I(X), p[c] = X, X) : O[c] && a !== g && (n = g(O[c], g)) ? (X = p[c] = new I(), X._set(n), X.name = b[c], X) : null;
187
187
  }
188
188
  function A0() {
189
189
  var c, a = [];
@@ -240,7 +240,7 @@ var j = { exports: {} };
240
240
  var a = Array.prototype.slice.call(arguments, 0, -1), X = arguments[arguments.length - 1], n = M.utc.apply(null, a), T;
241
241
  return !M.isMoment(c) && J(n) && (T = g(X)) && n.add(T.parse(n), "minutes"), n.tz(X), n;
242
242
  }
243
- u.version = z, u.dataVersion = "", u._zones = p, u._links = O, u._names = b, u._countries = A, u.add = k, u.link = v, u.load = Y0, u.zone = g, u.zoneExists = $, u.guess = O0, u.names = A0, u.Zone = G, u.unpack = P, u.unpackBase60 = i, u.needsOffset = J, u.moveInvalidForward = !0, u.moveAmbiguousForward = !1, u.countries = c0, u.zonesForCountry = q0;
243
+ u.version = z, u.dataVersion = "", u._zones = p, u._links = O, u._names = b, u._countries = A, u.add = k, u.link = v, u.load = Y0, u.zone = g, u.zoneExists = $, u.guess = O0, u.names = A0, u.Zone = I, u.unpack = P, u.unpackBase60 = i, u.needsOffset = J, u.moveInvalidForward = !0, u.moveAmbiguousForward = !1, u.countries = c0, u.zonesForCountry = q0;
244
244
  var m = M.fn;
245
245
  M.tz = u, M.defaultZone = null, M.updateOffset = function(c, a) {
246
246
  var X = M.defaultZone, n;
@@ -1564,7 +1564,7 @@ class N {
1564
1564
  * @return [{lng, lat}]
1565
1565
  */
1566
1566
  static calculateRangeWaypoints(M, z, p, O = []) {
1567
- const A = this.convertRouteToCoordinates(p, 0), b = this.mergeCoordinatesToWaypoints([M, z, ...O], A), W = b.findIndex(
1567
+ const A = this.convertRouteToCoordinates(p, 0), b = this.mergeCoordinatesToWaypoints([M, z], A.length ? A : O), W = b.findIndex(
1568
1568
  (d) => R.roundPrecision(M.lng, 8) === R.roundPrecision(d.lng, 8) && R.roundPrecision(M.lat, 8) === R.roundPrecision(d.lat, 8)
1569
1569
  ), o = b.findIndex(
1570
1570
  (d) => R.roundPrecision(z.lng, 8) === R.roundPrecision(d.lng, 8) && R.roundPrecision(z.lat, 8) === R.roundPrecision(d.lat, 8)
@@ -1768,9 +1768,9 @@ class N {
1768
1768
  B.push(i[P]);
1769
1769
  else {
1770
1770
  s = { lng: i[P][0], lat: i[P][1] };
1771
- const G = this.calculateDistance(M, s, !0, 8, O);
1772
- if (q += G, q < z)
1773
- d += G, b.push(s), M = s;
1771
+ const I = this.calculateDistance(M, s, !0, 8, O);
1772
+ if (q += I, q < z)
1773
+ d += I, I && b.push(s), M = s;
1774
1774
  else {
1775
1775
  if (d = z, q === z)
1776
1776
  Y = s, B.push([Y.lng, Y.lat]);
@@ -2110,27 +2110,27 @@ class V0 {
2110
2110
  const s = (b = M == null ? void 0 : M.data) == null ? void 0 : b.features.filter(
2111
2111
  (l) => l.geometry.type === "Point" && l.properties.type === "forecast" && l.properties.category === `${d}-${Y}`
2112
2112
  );
2113
- let P, G = U.clone().add(B, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2114
- for (; P = this.pickIndex(s, G), P <= s.length - 1; ) {
2113
+ let P, I = U.clone().add(B, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2114
+ for (; P = this.pickIndex(s, I), P <= s.length - 1; ) {
2115
2115
  if (P > 0) {
2116
- const l = s[P], f = P === 0 ? void 0 : s[P - 1], I = (B / 60 - ((W = f == null ? void 0 : f.properties) == null ? void 0 : W.hour)) / (l.properties.hour - ((o = f == null ? void 0 : f.properties) == null ? void 0 : o.hour)), H = this.computeNumber(f == null ? void 0 : f.geometry.coordinates[0], l.geometry.coordinates[0], I), Q = this.computeNumber(f == null ? void 0 : f.geometry.coordinates[1], l.geometry.coordinates[1], I), F = e.point([H, Q], {
2116
+ const l = s[P], f = P === 0 ? void 0 : s[P - 1], G = (B / 60 - ((W = f == null ? void 0 : f.properties) == null ? void 0 : W.hour)) / (l.properties.hour - ((o = f == null ? void 0 : f.properties) == null ? void 0 : o.hour)), H = this.computeNumber(f == null ? void 0 : f.geometry.coordinates[0], l.geometry.coordinates[0], G), Q = this.computeNumber(f == null ? void 0 : f.geometry.coordinates[1], l.geometry.coordinates[1], G), F = e.point([H, Q], {
2117
2117
  name: d,
2118
2118
  model: Y,
2119
2119
  category: l == null ? void 0 : l.properties.category,
2120
- date: G.format(),
2121
- format: G.format("MMM-DD/HHmm[Z]"),
2122
- gusts: this.computeNumber(f == null ? void 0 : f.properties.gusts, l.properties.gusts, I),
2123
- hour: this.computeNumber(f == null ? void 0 : f.properties.hour, l.properties.hour, I),
2124
- movement: this.computeNumber(f == null ? void 0 : f.properties.movement, l.properties.movement, I),
2125
- pressure: this.computeNumber(f == null ? void 0 : f.properties.pressure, l.properties.pressure, I),
2126
- wind: this.computeNumber(f == null ? void 0 : f.properties.wind, l.properties.wind, I),
2120
+ date: I.format(),
2121
+ format: I.format("MMM-DD/HHmm[Z]"),
2122
+ gusts: this.computeNumber(f == null ? void 0 : f.properties.gusts, l.properties.gusts, G),
2123
+ hour: this.computeNumber(f == null ? void 0 : f.properties.hour, l.properties.hour, G),
2124
+ movement: this.computeNumber(f == null ? void 0 : f.properties.movement, l.properties.movement, G),
2125
+ pressure: this.computeNumber(f == null ? void 0 : f.properties.pressure, l.properties.pressure, G),
2126
+ wind: this.computeNumber(f == null ? void 0 : f.properties.wind, l.properties.wind, G),
2127
2127
  type: "forecast",
2128
2128
  disabled: i,
2129
2129
  showCircle: L
2130
2130
  });
2131
2131
  O.push(F);
2132
2132
  }
2133
- B += z * 60, G = U.clone().add(B, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2133
+ B += z * 60, I = U.clone().add(B, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2134
2134
  }
2135
2135
  }
2136
2136
  return O;