@idm-plugin/meteo2 0.6.4 → 0.6.6

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
@@ -36,10 +36,10 @@ class Q0 {
36
36
  source: c == null ? void 0 : c.toLowerCase()
37
37
  },
38
38
  timeout: 3e4
39
- }, Y = L(), n = Y.valueOf();
40
- O.isBefore(Y.subtract(1, "month")) && (s == null || s.warn("[%s] get history meteo on %s: %j", W.requestId, O.format(), o));
39
+ }, d = L(), Y = d.valueOf();
40
+ O.isBefore(d.subtract(1, "month")) && (s == null || s.warn("[%s] get history meteo on %s: %j", W.requestId, O.format(), o));
41
41
  const X = "https://aod4idm.idmwx.com/api/ocean/point", q = await Q.get(X, o).json(), T = L().valueOf();
42
- if (s == null || s.info("[%s] get meteo(cost: %d ms) from %s with options: %j", W.requestId, T - n, X, o), (q == null ? void 0 : q.code) === 0)
42
+ if (s == null || s.info("[%s] get meteo(cost: %d ms) from %s with options: %j", W.requestId, T - Y, X, o), (q == null ? void 0 : q.code) === 0)
43
43
  return {
44
44
  ...q.data,
45
45
  source: c
@@ -71,10 +71,10 @@ class Q0 {
71
71
  source: c == null ? void 0 : c.toLowerCase()
72
72
  },
73
73
  timeout: 3e4
74
- }, Y = L(), n = Y.valueOf();
75
- O.isBefore(Y.subtract(1, "month")) && (s == null || s.warn("[%s] get history factors on %s: %j", W.requestId, O.format(), o));
74
+ }, d = L(), Y = d.valueOf();
75
+ O.isBefore(d.subtract(1, "month")) && (s == null || s.warn("[%s] get history factors on %s: %j", W.requestId, O.format(), o));
76
76
  const X = "https://aod4idm.idmwx.com/api/ocean/factor", q = await Q.get(X, o).json(), T = L().valueOf();
77
- if (s == null || s.info("[%s] get factors(cost: %d ms) from %s with options: %j", W.requestId, T - n, X, o), (q == null ? void 0 : q.code) === 0)
77
+ if (s == null || s.info("[%s] get factors(cost: %d ms) from %s with options: %j", W.requestId, T - Y, X, o), (q == null ? void 0 : q.code) === 0)
78
78
  return {
79
79
  ...q.data,
80
80
  source: c
@@ -118,9 +118,9 @@ class Q0 {
118
118
  levels: ["surface"]
119
119
  }
120
120
  }).json();
121
- let Y = L().valueOf();
122
- s == null || s.info("[%s] get gfs-factors(cost: %d ms) from %s", A.requestId, Y - O, c), O = Y;
123
- const n = await Q.post(c, {
121
+ let d = L().valueOf();
122
+ s == null || s.info("[%s] get gfs-factors(cost: %d ms) from %s", A.requestId, d - O, c), O = d;
123
+ const Y = await Q.post(c, {
124
124
  headers: {
125
125
  "Content-Type": "application/json"
126
126
  },
@@ -133,7 +133,7 @@ class Q0 {
133
133
  levels: ["surface"]
134
134
  }
135
135
  }).json();
136
- Y = L().valueOf(), s == null || s.info("[%s] get gfs-wave-factors(cost: %d ms) from %s", A.requestId, Y - O, c);
136
+ d = L().valueOf(), s == null || s.info("[%s] get gfs-wave-factors(cost: %d ms) from %s", A.requestId, d - O, c);
137
137
  for (let q = 0; q < o.ts.length; q++) {
138
138
  const T = this.populateUVFactor(o["wind_u-surface"][q], o["wind_v-surface"][q], !1, A);
139
139
  T.scale = this.calculateBeaufortWindForceScale(T.speed), W.push({
@@ -159,10 +159,10 @@ class Q0 {
159
159
  });
160
160
  }
161
161
  const X = [];
162
- for (let q = 0; q < n.ts.length; q++) {
163
- const T = this.calculateDouglasScale(n["waves_height-surface"][q], n["waves_direction-surface"][q], n["waves_period-surface"][q]), i = this.calculateDouglasScale(n["wwaves_height-surface"][q], n["wwaves_direction-surface"][q], n["wwaves_period-surface"][q]), S = this.calculateDouglasScale(n["swell1_height-surface"][q], n["swell1_direction-surface"][q], n["swell1_period-surface"][q]), t = this.calculateDouglasScale(n["swell2_height-surface"][q], n["swell2_direction-surface"][q], n["swell2_period-surface"][q]);
162
+ for (let q = 0; q < Y.ts.length; q++) {
163
+ const T = this.calculateDouglasScale(Y["waves_height-surface"][q], Y["waves_direction-surface"][q], Y["waves_period-surface"][q]), i = this.calculateDouglasScale(Y["wwaves_height-surface"][q], Y["wwaves_direction-surface"][q], Y["wwaves_period-surface"][q]), S = this.calculateDouglasScale(Y["swell1_height-surface"][q], Y["swell1_direction-surface"][q], Y["swell1_period-surface"][q]), t = this.calculateDouglasScale(Y["swell2_height-surface"][q], Y["swell2_direction-surface"][q], Y["swell2_period-surface"][q]);
164
164
  X.push({
165
- utc: L(n.ts[q]).utc().format(),
165
+ utc: L(Y.ts[q]).utc().format(),
166
166
  wave: {
167
167
  sig: T,
168
168
  wd: i,
@@ -271,9 +271,9 @@ var a0 = { exports: {} };
271
271
  throw new RangeError("invalid coordinates");
272
272
  if (90 <= z)
273
273
  return "Etc/GMT";
274
- var W = -1, O = 48 * (180 + b) / 360.00000000000006, o = 24 * (90 - z) / 180.00000000000003, Y = 0 | O, n = 0 | o, X = 96 * n + 2 * Y;
274
+ var W = -1, O = 48 * (180 + b) / 360.00000000000006, o = 24 * (90 - z) / 180.00000000000003, d = 0 | O, Y = 0 | o, X = 96 * Y + 2 * d;
275
275
  for (X = 56 * A.charCodeAt(X) + A.charCodeAt(X + 1) - 1995; X + c.length < 3136; )
276
- X = 56 * A.charCodeAt(X = 8 * (W = W + X + 1) + 4 * (n = 0 | (o = 2 * (o - n) % 2)) + 2 * (Y = 0 | (O = 2 * (O - Y) % 2)) + 2304) + A.charCodeAt(X + 1) - 1995;
276
+ X = 56 * A.charCodeAt(X = 8 * (W = W + X + 1) + 4 * (Y = 0 | (o = 2 * (o - Y) % 2)) + 2 * (d = 0 | (O = 2 * (O - d) % 2)) + 2304) + A.charCodeAt(X + 1) - 1995;
277
277
  return c[X + c.length - 3136];
278
278
  }
279
279
  r.exports = M;
@@ -293,57 +293,57 @@ var n0 = { exports: {} };
293
293
  M.version === void 0 && M.default && (M = M.default);
294
294
  var z = "0.5.48", b = {}, A = {}, c = {}, W = {}, O = {}, o;
295
295
  (!M || typeof M.version != "string") && v("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/");
296
- var Y = M.version.split("."), n = +Y[0], X = +Y[1];
297
- (n < 2 || n === 2 && X < 6) && v("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js " + M.version + ". See momentjs.com");
296
+ var d = M.version.split("."), Y = +d[0], X = +d[1];
297
+ (Y < 2 || Y === 2 && X < 6) && v("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js " + M.version + ". See momentjs.com");
298
298
  function q(p) {
299
299
  return p > 96 ? p - 87 : p > 64 ? p - 29 : p - 48;
300
300
  }
301
301
  function T(p) {
302
- var d = 0, a = p.split("."), R = a[0], N = a[1] || "", u = 1, P, B = 0, I = 1;
303
- for (p.charCodeAt(0) === 45 && (d = 1, I = -1), d; d < R.length; d++)
304
- P = q(R.charCodeAt(d)), B = 60 * B + P;
305
- for (d = 0; d < N.length; d++)
306
- u = u / 60, P = q(N.charCodeAt(d)), B += P * u;
302
+ var a = 0, n = p.split("."), R = n[0], N = n[1] || "", u = 1, P, B = 0, I = 1;
303
+ for (p.charCodeAt(0) === 45 && (a = 1, I = -1), a; a < R.length; a++)
304
+ P = q(R.charCodeAt(a)), B = 60 * B + P;
305
+ for (a = 0; a < N.length; a++)
306
+ u = u / 60, P = q(N.charCodeAt(a)), B += P * u;
307
307
  return B * I;
308
308
  }
309
309
  function i(p) {
310
- for (var d = 0; d < p.length; d++)
311
- p[d] = T(p[d]);
310
+ for (var a = 0; a < p.length; a++)
311
+ p[a] = T(p[a]);
312
312
  }
313
- function S(p, d) {
314
- for (var a = 0; a < d; a++)
315
- p[a] = Math.round((p[a - 1] || 0) + p[a] * 6e4);
316
- p[d - 1] = 1 / 0;
313
+ function S(p, a) {
314
+ for (var n = 0; n < a; n++)
315
+ p[n] = Math.round((p[n - 1] || 0) + p[n] * 6e4);
316
+ p[a - 1] = 1 / 0;
317
317
  }
318
- function t(p, d) {
319
- var a = [], R;
320
- for (R = 0; R < d.length; R++)
321
- a[R] = p[d[R]];
322
- return a;
318
+ function t(p, a) {
319
+ var n = [], R;
320
+ for (R = 0; R < a.length; R++)
321
+ n[R] = p[a[R]];
322
+ return n;
323
323
  }
324
324
  function U(p) {
325
- var d = p.split("|"), a = d[2].split(" "), R = d[3].split(""), N = d[4].split(" ");
326
- return i(a), i(R), i(N), S(N, R.length), {
327
- name: d[0],
328
- abbrs: t(d[1].split(" "), R),
329
- offsets: t(a, R),
325
+ var a = p.split("|"), n = a[2].split(" "), R = a[3].split(""), N = a[4].split(" ");
326
+ return i(n), i(R), i(N), S(N, R.length), {
327
+ name: a[0],
328
+ abbrs: t(a[1].split(" "), R),
329
+ offsets: t(n, R),
330
330
  untils: N,
331
- population: d[5] | 0
331
+ population: a[5] | 0
332
332
  };
333
333
  }
334
334
  function V(p) {
335
335
  p && this._set(U(p));
336
336
  }
337
- function f(p, d) {
338
- var a = d.length;
339
- if (p < d[0])
337
+ function f(p, a) {
338
+ var n = a.length;
339
+ if (p < a[0])
340
340
  return 0;
341
- if (a > 1 && d[a - 1] === 1 / 0 && p >= d[a - 2])
342
- return a - 1;
343
- if (p >= d[a - 1])
341
+ if (n > 1 && a[n - 1] === 1 / 0 && p >= a[n - 2])
342
+ return n - 1;
343
+ if (p >= a[n - 1])
344
344
  return -1;
345
- for (var R, N = 0, u = a - 1; u - N > 1; )
346
- R = Math.floor((N + u) / 2), d[R] <= p ? N = R : u = R;
345
+ for (var R, N = 0, u = n - 1; u - N > 1; )
346
+ R = Math.floor((N + u) / 2), a[R] <= p ? N = R : u = R;
347
347
  return u;
348
348
  }
349
349
  V.prototype = {
@@ -351,22 +351,22 @@ var n0 = { exports: {} };
351
351
  this.name = p.name, this.abbrs = p.abbrs, this.untils = p.untils, this.offsets = p.offsets, this.population = p.population;
352
352
  },
353
353
  _index: function(p) {
354
- var d = +p, a = this.untils, R;
355
- if (R = f(d, a), R >= 0)
354
+ var a = +p, n = this.untils, R;
355
+ if (R = f(a, n), R >= 0)
356
356
  return R;
357
357
  },
358
358
  countries: function() {
359
359
  var p = this.name;
360
- return Object.keys(c).filter(function(d) {
361
- return c[d].zones.indexOf(p) !== -1;
360
+ return Object.keys(c).filter(function(a) {
361
+ return c[a].zones.indexOf(p) !== -1;
362
362
  });
363
363
  },
364
364
  parse: function(p) {
365
- var d = +p, a = this.offsets, R = this.untils, N = R.length - 1, u, P, B, I;
365
+ var a = +p, n = this.offsets, R = this.untils, N = R.length - 1, u, P, B, I;
366
366
  for (I = 0; I < N; I++)
367
- if (u = a[I], P = a[I + 1], B = a[I && I - 1], u < P && l.moveAmbiguousForward ? u = P : u > B && l.moveInvalidForward && (u = B), d < R[I] - u * 6e4)
368
- return a[I];
369
- return a[N];
367
+ if (u = n[I], P = n[I + 1], B = n[I && I - 1], u < P && l.moveAmbiguousForward ? u = P : u > B && l.moveInvalidForward && (u = B), a < R[I] - u * 6e4)
368
+ return n[I];
369
+ return n[N];
370
370
  },
371
371
  abbr: function(p) {
372
372
  return this.abbrs[this._index(p)];
@@ -378,12 +378,12 @@ var n0 = { exports: {} };
378
378
  return this.offsets[this._index(p)];
379
379
  }
380
380
  };
381
- function G(p, d) {
382
- this.name = p, this.zones = d;
381
+ function G(p, a) {
382
+ this.name = p, this.zones = a;
383
383
  }
384
384
  function E(p) {
385
- var d = p.toTimeString(), a = d.match(/\([a-z ]+\)/i);
386
- a && a[0] ? (a = a[0].match(/[A-Z]/g), a = a ? a.join("") : void 0) : (a = d.match(/[A-Z]{3,5}/g), a = a ? a[0] : void 0), a === "GMT" && (a = void 0), this.at = +p, this.abbr = a, this.offset = p.getTimezoneOffset();
385
+ var a = p.toTimeString(), n = a.match(/\([a-z ]+\)/i);
386
+ n && n[0] ? (n = n[0].match(/[A-Z]/g), n = n ? n.join("") : void 0) : (n = a.match(/[A-Z]{3,5}/g), n = n ? n[0] : void 0), n === "GMT" && (n = void 0), this.at = +p, this.abbr = n, this.offset = p.getTimezoneOffset();
387
387
  }
388
388
  function C(p) {
389
389
  this.zone = p, this.offsetScore = 0, this.abbrScore = 0;
@@ -391,55 +391,55 @@ var n0 = { exports: {} };
391
391
  C.prototype.scoreOffsetAt = function(p) {
392
392
  this.offsetScore += Math.abs(this.zone.utcOffset(p.at) - p.offset), this.zone.abbr(p.at).replace(/[^A-Z]/g, "") !== p.abbr && this.abbrScore++;
393
393
  };
394
- function H(p, d) {
395
- for (var a, R; R = ((d.at - p.at) / 12e4 | 0) * 6e4; )
396
- a = new E(new Date(p.at + R)), a.offset === p.offset ? p = a : d = a;
394
+ function H(p, a) {
395
+ for (var n, R; R = ((a.at - p.at) / 12e4 | 0) * 6e4; )
396
+ n = new E(new Date(p.at + R)), n.offset === p.offset ? p = n : a = n;
397
397
  return p;
398
398
  }
399
399
  function h() {
400
- var p = (/* @__PURE__ */ new Date()).getFullYear() - 2, d = new E(new Date(p, 0, 1)), a = d.offset, R = [d], N, u, P, B;
400
+ var p = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new E(new Date(p, 0, 1)), n = a.offset, R = [a], N, u, P, B;
401
401
  for (B = 1; B < 48; B++)
402
- P = new Date(p, B, 1).getTimezoneOffset(), P !== a && (u = new E(new Date(p, B, 1)), N = H(d, u), R.push(N), R.push(new E(new Date(N.at + 6e4))), d = u, a = P);
402
+ P = new Date(p, B, 1).getTimezoneOffset(), P !== n && (u = new E(new Date(p, B, 1)), N = H(a, u), R.push(N), R.push(new E(new Date(N.at + 6e4))), a = u, n = P);
403
403
  for (B = 0; B < 4; B++)
404
404
  R.push(new E(new Date(p + B, 0, 1))), R.push(new E(new Date(p + B, 6, 1)));
405
405
  return R;
406
406
  }
407
- function g(p, d) {
408
- return p.offsetScore !== d.offsetScore ? p.offsetScore - d.offsetScore : p.abbrScore !== d.abbrScore ? p.abbrScore - d.abbrScore : p.zone.population !== d.zone.population ? d.zone.population - p.zone.population : d.zone.name.localeCompare(p.zone.name);
407
+ function g(p, a) {
408
+ return p.offsetScore !== a.offsetScore ? p.offsetScore - a.offsetScore : p.abbrScore !== a.abbrScore ? p.abbrScore - a.abbrScore : p.zone.population !== a.zone.population ? a.zone.population - p.zone.population : a.zone.name.localeCompare(p.zone.name);
409
409
  }
410
- function D(p, d) {
411
- var a, R;
412
- for (i(d), a = 0; a < d.length; a++)
413
- R = d[a], O[R] = O[R] || {}, O[R][p] = !0;
410
+ function D(p, a) {
411
+ var n, R;
412
+ for (i(a), n = 0; n < a.length; n++)
413
+ R = a[n], O[R] = O[R] || {}, O[R][p] = !0;
414
414
  }
415
415
  function m(p) {
416
- var d = p.length, a = {}, R = [], N = {}, u, P, B, I;
417
- for (u = 0; u < d; u++)
416
+ var a = p.length, n = {}, R = [], N = {}, u, P, B, I;
417
+ for (u = 0; u < a; u++)
418
418
  if (B = p[u].offset, !N.hasOwnProperty(B)) {
419
419
  I = O[B] || {};
420
420
  for (P in I)
421
- I.hasOwnProperty(P) && (a[P] = !0);
421
+ I.hasOwnProperty(P) && (n[P] = !0);
422
422
  N[B] = !0;
423
423
  }
424
- for (u in a)
425
- a.hasOwnProperty(u) && R.push(W[u]);
424
+ for (u in n)
425
+ n.hasOwnProperty(u) && R.push(W[u]);
426
426
  return R;
427
427
  }
428
428
  function Z() {
429
429
  try {
430
430
  var p = Intl.DateTimeFormat().resolvedOptions().timeZone;
431
431
  if (p && p.length > 3) {
432
- var d = W[_(p)];
433
- if (d)
434
- return d;
432
+ var a = W[_(p)];
433
+ if (a)
434
+ return a;
435
435
  v("Moment Timezone found " + p + " from the Intl api, but did not have that data loaded.");
436
436
  }
437
437
  } catch {
438
438
  }
439
- var a = h(), R = a.length, N = m(a), u = [], P, B, I;
439
+ var n = h(), R = n.length, N = m(n), u = [], P, B, I;
440
440
  for (B = 0; B < N.length; B++) {
441
441
  for (P = new C(y(N[B])), I = 0; I < R; I++)
442
- P.scoreOffsetAt(a[I]);
442
+ P.scoreOffsetAt(n[I]);
443
443
  u.push(P);
444
444
  }
445
445
  return u.sort(g), u.length > 0 ? u[0].zone.name : void 0;
@@ -451,52 +451,52 @@ var n0 = { exports: {} };
451
451
  return (p || "").toLowerCase().replace(/\//g, "_");
452
452
  }
453
453
  function W0(p) {
454
- var d, a, R, N;
455
- for (typeof p == "string" && (p = [p]), d = 0; d < p.length; d++)
456
- R = p[d].split("|"), a = R[0], N = _(a), b[N] = p[d], W[N] = a, D(N, R[2].split(" "));
454
+ var a, n, R, N;
455
+ for (typeof p == "string" && (p = [p]), a = 0; a < p.length; a++)
456
+ R = p[a].split("|"), n = R[0], N = _(n), b[N] = p[a], W[N] = n, D(N, R[2].split(" "));
457
457
  }
458
- function y(p, d) {
458
+ function y(p, a) {
459
459
  p = _(p);
460
- var a = b[p], R;
461
- return a instanceof V ? a : typeof a == "string" ? (a = new V(a), b[p] = a, a) : A[p] && d !== y && (R = y(A[p], y)) ? (a = b[p] = new V(), a._set(R), a.name = W[p], a) : null;
460
+ var n = b[p], R;
461
+ return n instanceof V ? n : typeof n == "string" ? (n = new V(n), b[p] = n, n) : A[p] && a !== y && (R = y(A[p], y)) ? (n = b[p] = new V(), n._set(R), n.name = W[p], n) : null;
462
462
  }
463
463
  function L0() {
464
- var p, d = [];
464
+ var p, a = [];
465
465
  for (p in W)
466
- W.hasOwnProperty(p) && (b[p] || b[A[p]]) && W[p] && d.push(W[p]);
467
- return d.sort();
466
+ W.hasOwnProperty(p) && (b[p] || b[A[p]]) && W[p] && a.push(W[p]);
467
+ return a.sort();
468
468
  }
469
469
  function e0() {
470
470
  return Object.keys(c);
471
471
  }
472
472
  function o0(p) {
473
- var d, a, R, N;
474
- for (typeof p == "string" && (p = [p]), d = 0; d < p.length; d++)
475
- a = p[d].split("|"), R = _(a[0]), N = _(a[1]), A[R] = N, W[R] = a[0], A[N] = R, W[N] = a[1];
473
+ var a, n, R, N;
474
+ for (typeof p == "string" && (p = [p]), a = 0; a < p.length; a++)
475
+ n = p[a].split("|"), R = _(n[0]), N = _(n[1]), A[R] = N, W[R] = n[0], A[N] = R, W[N] = n[1];
476
476
  }
477
477
  function T0(p) {
478
- var d, a, R, N;
478
+ var a, n, R, N;
479
479
  if (!(!p || !p.length))
480
- for (d = 0; d < p.length; d++)
481
- N = p[d].split("|"), a = N[0].toUpperCase(), R = N[1].split(" "), c[a] = new G(
482
- a,
480
+ for (a = 0; a < p.length; a++)
481
+ N = p[a].split("|"), n = N[0].toUpperCase(), R = N[1].split(" "), c[n] = new G(
482
+ n,
483
483
  R
484
484
  );
485
485
  }
486
486
  function i0(p) {
487
487
  return p = p.toUpperCase(), c[p] || null;
488
488
  }
489
- function r0(p, d) {
489
+ function r0(p, a) {
490
490
  if (p = i0(p), !p)
491
491
  return null;
492
- var a = p.zones.sort();
493
- return d ? a.map(function(R) {
492
+ var n = p.zones.sort();
493
+ return a ? n.map(function(R) {
494
494
  var N = y(R);
495
495
  return {
496
496
  name: R,
497
497
  offset: N.utcOffset(/* @__PURE__ */ new Date())
498
498
  };
499
- }) : a;
499
+ }) : n;
500
500
  }
501
501
  function f0(p) {
502
502
  W0(p.zones), o0(p.links), T0(p.countries), l.dataVersion = p.version;
@@ -505,31 +505,31 @@ var n0 = { exports: {} };
505
505
  return O0.didShowError || (O0.didShowError = !0, v("moment.tz.zoneExists('" + p + "') has been deprecated in favor of !moment.tz.zone('" + p + "')")), !!y(p);
506
506
  }
507
507
  function A0(p) {
508
- var d = p._f === "X" || p._f === "x";
509
- return !!(p._a && p._tzm === void 0 && !d);
508
+ var a = p._f === "X" || p._f === "x";
509
+ return !!(p._a && p._tzm === void 0 && !a);
510
510
  }
511
511
  function v(p) {
512
512
  typeof console < "u" && typeof console.error == "function" && console.error(p);
513
513
  }
514
514
  function l(p) {
515
- var d = Array.prototype.slice.call(arguments, 0, -1), a = arguments[arguments.length - 1], R = M.utc.apply(null, d), N;
516
- return !M.isMoment(p) && A0(R) && (N = y(a)) && R.add(N.parse(R), "minutes"), R.tz(a), R;
515
+ var a = Array.prototype.slice.call(arguments, 0, -1), n = arguments[arguments.length - 1], R = M.utc.apply(null, a), N;
516
+ return !M.isMoment(p) && A0(R) && (N = y(n)) && R.add(N.parse(R), "minutes"), R.tz(n), R;
517
517
  }
518
518
  l.version = z, l.dataVersion = "", l._zones = b, l._links = A, l._names = W, l._countries = c, l.add = W0, l.link = o0, l.load = f0, l.zone = y, l.zoneExists = O0, l.guess = k, l.names = L0, l.Zone = V, l.unpack = U, l.unpackBase60 = T, l.needsOffset = A0, l.moveInvalidForward = !0, l.moveAmbiguousForward = !1, l.countries = e0, l.zonesForCountry = r0;
519
519
  var w = M.fn;
520
- M.tz = l, M.defaultZone = null, M.updateOffset = function(p, d) {
521
- var a = M.defaultZone, R;
522
- if (p._z === void 0 && (a && A0(p) && !p._isUTC && p.isValid() && (p._d = M.utc(p._a)._d, p.utc().add(a.parse(p), "minutes")), p._z = a), p._z)
520
+ M.tz = l, M.defaultZone = null, M.updateOffset = function(p, a) {
521
+ var n = M.defaultZone, R;
522
+ if (p._z === void 0 && (n && A0(p) && !p._isUTC && p.isValid() && (p._d = M.utc(p._a)._d, p.utc().add(n.parse(p), "minutes")), p._z = n), p._z)
523
523
  if (R = p._z.utcOffset(p), Math.abs(R) < 16 && (R = R / 60), p.utcOffset !== void 0) {
524
524
  var N = p._z;
525
- p.utcOffset(-R, d), p._z = N;
525
+ p.utcOffset(-R, a), p._z = N;
526
526
  } else
527
- p.zone(R, d);
528
- }, w.tz = function(p, d) {
527
+ p.zone(R, a);
528
+ }, w.tz = function(p, a) {
529
529
  if (p) {
530
530
  if (typeof p != "string")
531
531
  throw new Error("Time zone name must be a string, got " + p + " [" + typeof p + "]");
532
- return this._z = y(p), this._z ? M.updateOffset(this, d) : v("Moment Timezone has no data for " + p + ". See http://momentjs.com/timezone/docs/#/data-loading/."), this;
532
+ return this._z = y(p), this._z ? M.updateOffset(this, a) : v("Moment Timezone has no data for " + p + ". See http://momentjs.com/timezone/docs/#/data-loading/."), this;
533
533
  }
534
534
  if (this._z)
535
535
  return this._z.name;
@@ -550,7 +550,7 @@ var n0 = { exports: {} };
550
550
  };
551
551
  }
552
552
  w.zoneName = q0(w.zoneName), w.zoneAbbr = q0(w.zoneAbbr), w.utc = Y0(w.utc), w.local = Y0(w.local), w.utcOffset = N0(w.utcOffset), M.tz.setDefault = function(p) {
553
- return (n < 2 || n === 2 && X < 9) && v("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js " + M.version + "."), M.defaultZone = p ? y(p) : null, M;
553
+ return (Y < 2 || Y === 2 && X < 9) && v("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js " + M.version + "."), M.defaultZone = p ? y(p) : null, M;
554
554
  };
555
555
  var x = M.momentProperties;
556
556
  return Object.prototype.toString.call(x) === "[object Array]" ? (x.push("_z"), x.push("_a")) : x && (x._z = null), M;
@@ -1498,8 +1498,8 @@ class J0 {
1498
1498
  fake: M.fake,
1499
1499
  step: W
1500
1500
  });
1501
- const o = await z0(O, M), Y = await this.parseWeatherData(o, M, z);
1502
- A ? await this.mergeSegments(A, Y) : A = Y;
1501
+ const o = await z0(O, M), d = await this.parseWeatherData(o, M, z);
1502
+ A ? await this.mergeSegments(A, d) : A = d;
1503
1503
  }
1504
1504
  else {
1505
1505
  const W = await z0(M.url, M);
@@ -1529,7 +1529,7 @@ class J0 {
1529
1529
  * @param options
1530
1530
  */
1531
1531
  async marineForecast(M, z = {}) {
1532
- var b, A, c, W, O, o, Y, n;
1532
+ var b, A, c, W, O, o, d, Y;
1533
1533
  try {
1534
1534
  const X = L();
1535
1535
  let q;
@@ -1554,7 +1554,7 @@ class J0 {
1554
1554
  const T = L();
1555
1555
  this.debug && K.info("[%s] fetch marine api (%j) cost: %d ms", z.requestId, M.url, T.diff(X, "ms"));
1556
1556
  const i = await this.mergeMarineData(q), S = i.find((f) => f.model === "ncep_gfswave016"), t = i.find((f) => f.model === "ncep_gfswave025"), U = i.find((f) => f.model === "meteofrance_wave"), V = i.find((f) => f.model === "best_match");
1557
- return (A = (b = V == null ? void 0 : V.hourly) == null ? void 0 : b.wave_height) != null && A.every((f) => f !== null) ? [V] : (W = (c = U == null ? void 0 : U.hourly) == null ? void 0 : c.wave_height) != null && W.every((f) => f !== null) ? [U] : (o = (O = S == null ? void 0 : S.hourly) == null ? void 0 : O.wave_height) != null && o.every((f) => f !== null) ? [S] : (n = (Y = t == null ? void 0 : t.hourly) == null ? void 0 : Y.wave_height) != null && n.every((f) => f !== null) ? [t] : i != null && i.length ? [i[0]] : [];
1557
+ return (A = (b = V == null ? void 0 : V.hourly) == null ? void 0 : b.wave_height) != null && A.every((f) => f !== null) ? [V] : (W = (c = U == null ? void 0 : U.hourly) == null ? void 0 : c.wave_height) != null && W.every((f) => f !== null) ? [U] : (o = (O = S == null ? void 0 : S.hourly) == null ? void 0 : O.wave_height) != null && o.every((f) => f !== null) ? [S] : (Y = (d = t == null ? void 0 : t.hourly) == null ? void 0 : d.wave_height) != null && Y.every((f) => f !== null) ? [t] : i != null && i.length ? [i[0]] : [];
1558
1558
  } catch (X) {
1559
1559
  return K.warn("[%s] marine forecast failed: %s, with %j", z.requestId, X, M), [];
1560
1560
  }
@@ -1567,7 +1567,7 @@ class J0 {
1567
1567
  * @private
1568
1568
  */
1569
1569
  async parseWeatherData(M, z, b = {}) {
1570
- var W, O, o, Y, n, X, q, T, i, S;
1570
+ var W, O, o, d, Y, X, q, T, i, S;
1571
1571
  const A = [], c = Math.pow(10, b.precision || 6);
1572
1572
  for (let t = 0; t < M.length; t++) {
1573
1573
  const U = M[t], V = U.utcOffsetSeconds(), f = U.timezone(), G = U.current(), E = U.hourly(), C = U.sixHourly(), H = U.daily(), h = {};
@@ -1592,7 +1592,7 @@ class J0 {
1592
1592
  )
1593
1593
  };
1594
1594
  for (let Z = 0; Z < E.variablesLength(); Z++) {
1595
- const k = (Y = (o = (O = E.variables(Z).valuesArray()) == null ? void 0 : O.toString()) == null ? void 0 : o.split(",")) == null ? void 0 : Y.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1595
+ const k = (d = (o = (O = E.variables(Z).valuesArray()) == null ? void 0 : O.toString()) == null ? void 0 : o.split(",")) == null ? void 0 : d.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1596
1596
  h.hourly[z.hourly[Z]] = k;
1597
1597
  }
1598
1598
  const m = L();
@@ -1607,7 +1607,7 @@ class J0 {
1607
1607
  )
1608
1608
  };
1609
1609
  for (let Z = 0; Z < C.variablesLength(); Z += b.memberLength ?? 1) {
1610
- const k = (q = (X = (n = C.variables(Z).valuesArray()) == null ? void 0 : n.toString()) == null ? void 0 : X.split(",")) == null ? void 0 : q.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1610
+ const k = (q = (X = (Y = C.variables(Z).valuesArray()) == null ? void 0 : Y.toString()) == null ? void 0 : X.split(",")) == null ? void 0 : q.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1611
1611
  C.variables(Z), h.sixHourly[z.six_hourly[Z / (b.memberLength ?? 1)]] = k;
1612
1612
  }
1613
1613
  const m = L();
@@ -1647,11 +1647,11 @@ class J0 {
1647
1647
  }
1648
1648
  async mergeMarineData(M) {
1649
1649
  var c, W, O, o;
1650
- const z = [], b = M.find((Y) => Y.model === "best_match");
1650
+ const z = [], b = M.find((d) => d.model === "best_match");
1651
1651
  b && z.push(b);
1652
- const A = M.find((Y) => Y.model === "meteofrance_currents");
1653
- for (const Y of M)
1654
- ["best_match", "meteofrance_currents"].includes(Y.model) || (Y.hourly.ocean_current_velocity = (c = A == null ? void 0 : A.hourly) == null ? void 0 : c.ocean_current_velocity, Y.hourly.ocean_current_direction = (W = A == null ? void 0 : A.hourly) == null ? void 0 : W.ocean_current_direction, Y.hourly.sea_level_height_msl = (O = A == null ? void 0 : A.hourly) == null ? void 0 : O.sea_level_height_msl, Y.hourly.sea_surface_temperature = (o = A == null ? void 0 : A.hourly) == null ? void 0 : o.sea_surface_temperature, z.push(Y));
1652
+ const A = M.find((d) => d.model === "meteofrance_currents");
1653
+ for (const d of M)
1654
+ ["best_match", "meteofrance_currents"].includes(d.model) || (d.hourly.ocean_current_velocity = (c = A == null ? void 0 : A.hourly) == null ? void 0 : c.ocean_current_velocity, d.hourly.ocean_current_direction = (W = A == null ? void 0 : A.hourly) == null ? void 0 : W.ocean_current_direction, d.hourly.sea_level_height_msl = (O = A == null ? void 0 : A.hourly) == null ? void 0 : O.sea_level_height_msl, d.hourly.sea_surface_temperature = (o = A == null ? void 0 : A.hourly) == null ? void 0 : o.sea_surface_temperature, z.push(d));
1655
1655
  return z;
1656
1656
  }
1657
1657
  pickForecastUrl(M, z, b, A = {}) {
@@ -1669,8 +1669,8 @@ class J0 {
1669
1669
  }
1670
1670
  const A = b.reduce((O, o) => (O.includes(o) || O.push(o), O), []), c = ["best_match", "meteofrance_currents", "meteofrance_wave", "ecmwf_wam025", "ncep_gfswave025", "gwam", "era5_ocean", "ewam", "ncep_gfswave016"];
1671
1671
  return A.sort((O, o) => {
1672
- const Y = c.indexOf(O), n = c.indexOf(o);
1673
- return Y - n;
1672
+ const d = c.indexOf(O), Y = c.indexOf(o);
1673
+ return d - Y;
1674
1674
  }), A;
1675
1675
  }
1676
1676
  /**
@@ -1685,18 +1685,18 @@ class J0 {
1685
1685
  var o;
1686
1686
  const c = L().utc(), W = M ? L.utc(M) : void 0, O = c.clone().utc().add(z && ((o = b.models) != null && o.includes("meteofrance_wave")) ? 10 : 15, "day");
1687
1687
  if (M) {
1688
- const Y = W.clone().utc().add(A.forecastDays ?? 1, "day");
1689
- Y.isAfter(O) ? (Y.subtract(1, "year"), W.isAfter(O) ? (W.subtract(1, "year"), b.start_dates = [
1688
+ const d = W.clone().utc().add(A.forecastDays ?? 1, "day");
1689
+ d.isAfter(O) ? (d.subtract(1, "year"), W.isAfter(O) ? (W.subtract(1, "year"), b.start_dates = [
1690
1690
  W.clone().subtract(A.pastDays || 0, "day").utc().format("YYYY-MM-DD")
1691
- ], b.end_dates = [Y.utc().format("YYYY-MM-DD")], b.fakes = [!0], b.url = [this.pickForecastUrl(z, A.selfHosted ?? !0, !0, A)]) : (b.start_dates = [
1691
+ ], b.end_dates = [d.utc().format("YYYY-MM-DD")], b.fakes = [!0], b.url = [this.pickForecastUrl(z, A.selfHosted ?? !0, !0, A)]) : (b.start_dates = [
1692
1692
  W.clone().subtract(A.pastDays || 0, "day").utc().format("YYYY-MM-DD"),
1693
1693
  O.clone().subtract(1, "year").utc().format("YYYY-MM-DD")
1694
- ], b.end_dates = [O.clone().subtract(1, "day").utc().format("YYYY-MM-DD"), Y.utc().format("YYYY-MM-DD")], b.fakes = [!1, !0], b.url = [
1694
+ ], b.end_dates = [O.clone().subtract(1, "day").utc().format("YYYY-MM-DD"), d.utc().format("YYYY-MM-DD")], b.fakes = [!1, !0], b.url = [
1695
1695
  this.pickForecastUrl(z, A.selfHosted ?? !0, !1, A),
1696
1696
  this.pickForecastUrl(z, A.selfHosted ?? !0, !0, A)
1697
1697
  ])) : (b.start_dates = [
1698
1698
  W.clone().subtract(A.pastDays || 0, "day").utc().format("YYYY-MM-DD")
1699
- ], b.end_dates = [Y.utc().format("YYYY-MM-DD")], b.fakes = [!1], b.url = [this.pickForecastUrl(z, A.selfHosted ?? !0, W.isBefore(c.clone().subtract(30, "day")), A)]);
1699
+ ], b.end_dates = [d.utc().format("YYYY-MM-DD")], b.fakes = [!1], b.url = [this.pickForecastUrl(z, A.selfHosted ?? !0, W.isBefore(c.clone().subtract(30, "day")), A)]);
1700
1700
  } else
1701
1701
  b.forecast_days = A.forecastDays, b.past_days = A.pastDays, b.fake = !1, b.url = this.pickForecastUrl(z, A.selfHosted ?? !0, !1, A);
1702
1702
  return b;
@@ -1763,13 +1763,13 @@ class J0 {
1763
1763
  models: ((T = O.weatherModels) == null ? void 0 : T.split(",")) || ["best_match"],
1764
1764
  timezone: "auto"
1765
1765
  };
1766
- let Y;
1766
+ let d;
1767
1767
  if (b) {
1768
1768
  const f = this.timezoneOffset(M, z);
1769
- Y = L.utc(b).utcOffset(f), Y.subtract(f > 0 ? f : -f, "h"), O.selfHistory = !(Y != null && Y.isBefore(L.utc().subtract(120, "days")));
1769
+ d = L.utc(b).utcOffset(f), d.subtract(f > 0 ? f : -f, "h"), O.selfHistory = !(d != null && d.isBefore(L.utc().subtract(120, "days")));
1770
1770
  }
1771
- c && (o.daily = ((i = this.FORECAST.WEATHER_VARIABLES.NORMAL.DAILY) == null ? void 0 : i.split(",")) || []), Y || (O.forecastDays = O.forecastDays || 1, O.pastDays = 0, W = !0), W && (o.hourly = ((S = this.FORECAST.WEATHER_VARIABLES.NORMAL.HOURLY) == null ? void 0 : S.split(",")) || []), O.pastDays = O.pastDays || 0, O.pastDays = O.pastDays > 7 ? 7 : O.pastDays < 0 ? 0 : O.pastDays, O.forecastDays = O.forecastDays ?? 1, O.forecastDays = O.forecastDays > 14 ? 14 : O.forecastDays < 0 ? 1 : O.forecastDays, this.prepare(Y == null ? void 0 : Y.utc().format(), !1, o, O);
1772
- const n = await this.weatherForecast(o, O), X = {
1771
+ c && (o.daily = ((i = this.FORECAST.WEATHER_VARIABLES.NORMAL.DAILY) == null ? void 0 : i.split(",")) || []), d || (O.forecastDays = O.forecastDays || 1, O.pastDays = 0, W = !0), W && (o.hourly = ((S = this.FORECAST.WEATHER_VARIABLES.NORMAL.HOURLY) == null ? void 0 : S.split(",")) || []), O.pastDays = O.pastDays || 0, O.pastDays = O.pastDays > 7 ? 7 : O.pastDays < 0 ? 0 : O.pastDays, O.forecastDays = O.forecastDays ?? 1, O.forecastDays = O.forecastDays > 14 ? 14 : O.forecastDays < 0 ? 1 : O.forecastDays, this.prepare(d == null ? void 0 : d.utc().format(), !1, o, O);
1772
+ const Y = await this.weatherForecast(o, O), X = {
1773
1773
  apikey: this.apikey,
1774
1774
  latitude: M,
1775
1775
  longitude: z,
@@ -1778,9 +1778,9 @@ class J0 {
1778
1778
  wind_speed_unit: "kn",
1779
1779
  models: this.pickMarineModels(O.marineModels)
1780
1780
  };
1781
- c && (X.daily = this.FORECAST.MARINE_VARIABLES.DAILY.split(",")), Y || (O.forecastDays = O.forecastDays || 1, W = !0), W && (X.hourly = this.FORECAST.MARINE_VARIABLES.HOURLY.split(",")), this.prepare(Y == null ? void 0 : Y.utc().format(), !0, X, O);
1781
+ c && (X.daily = this.FORECAST.MARINE_VARIABLES.DAILY.split(",")), d || (O.forecastDays = O.forecastDays || 1, W = !0), W && (X.hourly = this.FORECAST.MARINE_VARIABLES.HOURLY.split(",")), this.prepare(d == null ? void 0 : d.utc().format(), !0, X, O);
1782
1782
  let q = await this.marineForecast(X, O);
1783
- return (V = (U = (t = q[0]) == null ? void 0 : t.hourly) == null ? void 0 : U.wave_height) != null && V.every((f) => f === null) && (X.models = this.pickMarineModels("best_match,ncep_gfswave025,meteofrance_wave"), q = await this.marineForecast(X, O)), { weather: n, marine: q };
1783
+ return (V = (U = (t = q[0]) == null ? void 0 : t.hourly) == null ? void 0 : U.wave_height) != null && V.every((f) => f === null) && (X.models = this.pickMarineModels("best_match,ncep_gfswave025,meteofrance_wave"), q = await this.marineForecast(X, O)), { weather: Y, marine: q };
1784
1784
  }
1785
1785
  /**
1786
1786
  * 历史再分析数据
@@ -1808,8 +1808,8 @@ class J0 {
1808
1808
  }) {
1809
1809
  var S, t;
1810
1810
  z = this.toStdLng(z), this.debug && K.info("[%s] spot historical params: %j", o.requestId, { lat: M, lng: z, startDate: b, endDate: A, withMarine: O, options: o });
1811
- const Y = this.timezoneOffset(M, z), n = L.utc(b).utcOffset(Y), X = L.utc(A).utcOffset(Y);
1812
- n.subtract(Y > 0 ? Y : -Y, "h"), X.subtract(Y > 0 ? Y : -Y, "h");
1811
+ const d = this.timezoneOffset(M, z), Y = L.utc(b).utcOffset(d), X = L.utc(A).utcOffset(d);
1812
+ Y.subtract(d > 0 ? d : -d, "h"), X.subtract(d > 0 ? d : -d, "h");
1813
1813
  const q = {
1814
1814
  apikey: this.apikey,
1815
1815
  latitude: M,
@@ -1819,7 +1819,7 @@ class J0 {
1819
1819
  models: ((S = o.weatherModels) == null ? void 0 : S.split(",")) || ["best_match"],
1820
1820
  timezone: "auto",
1821
1821
  url: this.HISTORICAL.OM_URL,
1822
- start_date: n.format("YYYY-MM-DD"),
1822
+ start_date: Y.format("YYYY-MM-DD"),
1823
1823
  end_date: X.format("YYYY-MM-DD")
1824
1824
  };
1825
1825
  c && (q.daily = this.HISTORICAL.WEATHER_VARIABLES.DAILY.split(",")), W && (q.hourly = this.HISTORICAL.WEATHER_VARIABLES.HOURLY.split(","));
@@ -1837,7 +1837,7 @@ class J0 {
1837
1837
  daily: this.FORECAST.MARINE_VARIABLES.DAILY.split(","),
1838
1838
  hourly: this.FORECAST.MARINE_VARIABLES.HOURLY.split(","),
1839
1839
  url: this.FORECAST.OM_MARINE_URL,
1840
- start_date: n.format("YYYY-MM-DD"),
1840
+ start_date: Y.format("YYYY-MM-DD"),
1841
1841
  end_date: X.format("YYYY-MM-DD")
1842
1842
  };
1843
1843
  i = await this.marineForecast(U, o);
@@ -1859,9 +1859,9 @@ class J0 {
1859
1859
  precision: 6
1860
1860
  }) {
1861
1861
  z = this.toStdLng(z), this.debug && K.info("[%s] spot seasonal params: %j", W.requestId, { lat: M, lng: z, startDate: b, endDate: A, options: W });
1862
- const O = this.timezoneOffset(M, z), o = L.utc(b).utcOffset(O), Y = A ? L.utc(A).utcOffset(O) : o.clone().add(1, "month");
1863
- o.subtract(O > 0 ? O : -O, "h"), Y.subtract(O > 0 ? O : -O, "h");
1864
- const n = {
1862
+ const O = this.timezoneOffset(M, z), o = L.utc(b).utcOffset(O), d = A ? L.utc(A).utcOffset(O) : o.clone().add(1, "month");
1863
+ o.subtract(O > 0 ? O : -O, "h"), d.subtract(O > 0 ? O : -O, "h");
1864
+ const Y = {
1865
1865
  apikey: this.apikey,
1866
1866
  latitude: M,
1867
1867
  longitude: z,
@@ -1870,10 +1870,10 @@ class J0 {
1870
1870
  timezone: "auto",
1871
1871
  url: this.SEASONAL.OM_URL,
1872
1872
  start_date: o.format("YYYY-MM-DD"),
1873
- end_date: Y.format("YYYY-MM-DD"),
1873
+ end_date: d.format("YYYY-MM-DD"),
1874
1874
  daily: this.SEASONAL.WEATHER_VARIABLES.DAILY.split(",")
1875
1875
  };
1876
- return c && (n.six_hourly = this.SEASONAL.WEATHER_VARIABLES.SIX_HOURLY.split(",")), W.memberLength = 4, { weather: await this.weatherForecast(n, W) };
1876
+ return c && (Y.six_hourly = this.SEASONAL.WEATHER_VARIABLES.SIX_HOURLY.split(",")), W.memberLength = 4, { weather: await this.weatherForecast(Y, W) };
1877
1877
  }
1878
1878
  /**
1879
1879
  * 气候态数据
@@ -1902,7 +1902,7 @@ class J0 {
1902
1902
  z = this.toStdLng(z), this.debug && K.info("[%s] spot climate params: %j", c.requestId, { lat: M, lng: z, startDate: b, endDate: A, options: c });
1903
1903
  const W = this.timezoneOffset(M, z), O = L.utc(b).utcOffset(W), o = A ? L.utc(A).utcOffset(W) : O.clone().add(1, "day");
1904
1904
  o.subtract(W > 0 ? W : -W, "h"), O.subtract(W > 0 ? W : -W, "h");
1905
- const Y = {
1905
+ const d = {
1906
1906
  apikey: this.apikey,
1907
1907
  latitude: M,
1908
1908
  longitude: z,
@@ -1915,7 +1915,7 @@ class J0 {
1915
1915
  end_date: o.format("YYYY-MM-DD"),
1916
1916
  daily: this.CLIMATE.WEATHER_VARIABLES.DAILY.split(",")
1917
1917
  };
1918
- return { weather: await this.weatherForecast(Y, c) };
1918
+ return { weather: await this.weatherForecast(d, c) };
1919
1919
  }
1920
1920
  async update(M = {}) {
1921
1921
  const z = L.unix(this.METEO2_UPDATE.etime), b = this.METEO2_UPDATE.version, A = L();
@@ -1927,9 +1927,9 @@ class J0 {
1927
1927
  }
1928
1928
  })).json();
1929
1929
  if (O.code === 0) {
1930
- const o = O.data, Y = M0.standardWeatherModels();
1931
- for (const n of Y) {
1932
- const X = M0.autoPickSubCategories(n.alias), T = o.filter((i) => X.includes(i.category)).map((i) => {
1930
+ const o = O.data, d = M0.standardWeatherModels();
1931
+ for (const Y of d) {
1932
+ const X = M0.autoPickSubCategories(Y.alias), T = o.filter((i) => X.includes(i.category)).map((i) => {
1933
1933
  var S, t, U, V, f, G;
1934
1934
  return {
1935
1935
  category: i.category,
@@ -1943,7 +1943,7 @@ class J0 {
1943
1943
  }
1944
1944
  };
1945
1945
  });
1946
- T.length && (this.METEO2_UPDATE[n.alias] = T);
1946
+ T.length && (this.METEO2_UPDATE[Y.alias] = T);
1947
1947
  }
1948
1948
  this.METEO2_UPDATE.version = b + 1, this.METEO2_UPDATE.etime = A.unix();
1949
1949
  }
@@ -1995,11 +1995,11 @@ class k0 {
1995
1995
  * @param datum
1996
1996
  * @param options
1997
1997
  */
1998
- async tidesForecast(M, z, b = 7, A = "today", c = !0, W = !1, O = !1, o = "CD", Y = {}) {
1999
- A = A || "today", b = b || 7, z = this.toStdLng(z), this.debug && R0.info("[%s] spot tides forecast params: %j", Y.requestId, { lat: M, lng: z, date: A, extremes: c, heights: W, datums: O, datum: o });
2000
- let n = `https://www.worldtides.info/api/v3?lat=${M}&lon=${z}&days=${b}&date=${A}&datum=${o}&key=${this.apikey}&localtime`;
2001
- c && (n = `${n}&extremes`), W && (n = `${n}&heights`), O && (n = `${n}&datums`);
2002
- const q = await (await fetch(n)).json();
1998
+ async tidesForecast(M, z, b = 7, A = "today", c = !0, W = !1, O = !1, o = "CD", d = {}) {
1999
+ A = A || "today", b = b || 7, z = this.toStdLng(z), this.debug && R0.info("[%s] spot tides forecast params: %j", d.requestId, { lat: M, lng: z, date: A, extremes: c, heights: W, datums: O, datum: o });
2000
+ let Y = `https://www.worldtides.info/api/v3?lat=${M}&lon=${z}&days=${b}&date=${A}&datum=${o}&key=${this.apikey}&localtime`;
2001
+ c && (Y = `${Y}&extremes`), W && (Y = `${Y}&heights`), O && (Y = `${Y}&datums`);
2002
+ const q = await (await fetch(Y)).json();
2003
2003
  return q.status === 200 ? {
2004
2004
  rqt: {
2005
2005
  lat: M,
@@ -2060,11 +2060,11 @@ class $ {
2060
2060
  var c;
2061
2061
  const b = L.utc(z.reftime).format(), A = {};
2062
2062
  return (c = z.records) == null || c.forEach((W) => {
2063
- const O = L.utc(W.time), o = O.diff(b, "hour"), Y = Number(W.pressure / 100), n = Number(W.lat), X = Number(W.lon), q = Number(W.windSpeed * 3600 / 1852);
2063
+ const O = L.utc(W.time), o = O.diff(b, "hour"), d = Number(W.pressure / 100), Y = Number(W.lat), X = Number(W.lon), q = Number(W.windSpeed * 3600 / 1852);
2064
2064
  A[o] = {
2065
- lat: isNaN(n) ? null : n,
2065
+ lat: isNaN(Y) ? null : Y,
2066
2066
  lng: isNaN(X) ? null : X,
2067
- pressure: isNaN(Y) ? null : Math.round(Y) || null,
2067
+ pressure: isNaN(d) ? null : Math.round(d) || null,
2068
2068
  utc: O.format(),
2069
2069
  wind: {
2070
2070
  datetime: O.format(),
@@ -2121,10 +2121,10 @@ const J = class J {
2121
2121
  static async parseHistory(M) {
2122
2122
  const z = `https://hifleet.com/hifleetapi/gettyphooninfo2.do?xuhao=${M}`, b = await Q.post(z).text(), A = await J.parser.parseStringPromise(b), c = A.typhoon.position instanceof Array ? A.typhoon.position : [A.typhoon.position], W = [];
2123
2123
  for (const O of c) {
2124
- const o = L(O.updatetime).utcOffset(8).utc().format(), Y = Number(O.lat), n = Number(O.lon), X = Number(O.pressure), q = Number(O.windspeed * 3600 / 1852), T = e.parseWindCircle(O.c7quad1 / 1.852), i = e.parseWindCircle(O.c7quad2 / 1.852), S = e.parseWindCircle(O.c7quad3 / 1.852), t = e.parseWindCircle(O.c7quad4 / 1.852), U = e.parseWindCircle(O.c10quad1 / 1.852), V = e.parseWindCircle(O.c10quad2 / 1.852), f = e.parseWindCircle(O.c10quad3 / 1.852), G = e.parseWindCircle(O.c10quad4 / 1.852), E = e.parseWindCircle(O.c12quad1 / 1.852), C = e.parseWindCircle(O.c12quad2 / 1.852), H = e.parseWindCircle(O.c12quad3 / 1.852), h = e.parseWindCircle(O.c12quad4 / 1.852), { r7: g, r10: D, r12: m } = e.estimateWindRadii(q, X, Y), Z = {
2124
+ const o = L(O.updatetime).utcOffset(8).utc().format(), d = Number(O.lat), Y = Number(O.lon), X = Number(O.pressure), q = Number(O.windspeed * 3600 / 1852), T = e.parseWindCircle(O.c7quad1 / 1.852), i = e.parseWindCircle(O.c7quad2 / 1.852), S = e.parseWindCircle(O.c7quad3 / 1.852), t = e.parseWindCircle(O.c7quad4 / 1.852), U = e.parseWindCircle(O.c10quad1 / 1.852), V = e.parseWindCircle(O.c10quad2 / 1.852), f = e.parseWindCircle(O.c10quad3 / 1.852), G = e.parseWindCircle(O.c10quad4 / 1.852), E = e.parseWindCircle(O.c12quad1 / 1.852), C = e.parseWindCircle(O.c12quad2 / 1.852), H = e.parseWindCircle(O.c12quad3 / 1.852), h = e.parseWindCircle(O.c12quad4 / 1.852), { r7: g, r10: D, r12: m } = e.estimateWindRadii(q, X, d), Z = {
2125
2125
  updated: o,
2126
- lat: isNaN(Y) ? null : Y,
2127
- lng: isNaN(n) ? null : n,
2126
+ lat: isNaN(d) ? null : d,
2127
+ lng: isNaN(Y) ? null : Y,
2128
2128
  pressure: isNaN(X) ? null : Math.round(X),
2129
2129
  kts: isNaN(q) ? null : Math.round(q) || null,
2130
2130
  type: e.parseTropicalType(q),
@@ -2154,18 +2154,18 @@ const J = class J {
2154
2154
  const b = `https://hifleet.com/hifleetapi/gettyphooforecast.do?xuhao=${M}`, A = await Q.post(b).text(), c = await J.parser.parseStringPromise(A), W = c.list.forecast instanceof Array ? c.list.forecast : [c.list.forecast], O = [];
2155
2155
  for (const o of W)
2156
2156
  if (o.xuhao === M) {
2157
- const Y = o.positions.forecastposition instanceof Array ? o.positions.forecastposition : [o.positions.forecastposition];
2158
- if (Y.length) {
2159
- z = z || L(Y.at(0).forecasttime).utcOffset(8).utc();
2160
- const n = {};
2161
- for (const q of Y) {
2157
+ const d = o.positions.forecastposition instanceof Array ? o.positions.forecastposition : [o.positions.forecastposition];
2158
+ if (d.length) {
2159
+ z = z || L(d.at(0).forecasttime).utcOffset(8).utc();
2160
+ const Y = {};
2161
+ for (const q of d) {
2162
2162
  const T = L(q.forecasttime).utcOffset(8).utc(), i = T.diff(z, "hours");
2163
2163
  if (i) {
2164
2164
  const S = Number(q.forelat), t = Number(q.forelon), U = Number(q.forepressure), V = Number(q.forespeed * 3600 / 1852);
2165
- n[i] = {
2165
+ Y[i] = {
2166
2166
  lat: isNaN(S) ? null : S,
2167
2167
  lng: isNaN(t) ? null : t,
2168
- pressure: U ? null : Math.round(U) || null,
2168
+ pressure: U ? Math.round(U) : null,
2169
2169
  utc: T.format(),
2170
2170
  wind: {
2171
2171
  datetime: T.format(),
@@ -2196,7 +2196,7 @@ const J = class J {
2196
2196
  const X = {
2197
2197
  date: z.utc().format(),
2198
2198
  model: e.parseTropicalModel(o.country).toLowerCase(),
2199
- hours: n
2199
+ hours: Y
2200
2200
  };
2201
2201
  O.push(X);
2202
2202
  }
@@ -2229,7 +2229,7 @@ let b0 = J;
2229
2229
  class j {
2230
2230
  static async parseHistory(M) {
2231
2231
  return M.map((z) => {
2232
- const b = Number(z.lat), A = Number(z.lon), c = Number(z.maxSP * 3600 / 1852), W = Number(z.minP), O = e.parseWindCircle(z.r7Ne / 1.852), o = e.parseWindCircle(z.r7Nw / 1.852), Y = e.parseWindCircle(z.r7Se / 1.852), n = e.parseWindCircle(z.r7Sw / 1.852), X = e.parseWindCircle(z.r10Ne / 1.852), q = e.parseWindCircle(z.r10Nw / 1.852), T = e.parseWindCircle(z.r10Se / 1.852), i = e.parseWindCircle(z.r10Sw / 1.852), S = e.parseWindCircle(z.r12Ne / 1.852), t = e.parseWindCircle(z.r12Nw / 1.852), U = e.parseWindCircle(z.r12Se / 1.852), V = e.parseWindCircle(z.r12Sw / 1.852), { r7: f, r10: G, r12: E } = e.estimateWindRadii(c, W, b);
2232
+ const b = Number(z.lat), A = Number(z.lon), c = Number(z.maxSP * 3600 / 1852), W = Number(z.minP), O = e.parseWindCircle(z.r7Ne / 1.852), o = e.parseWindCircle(z.r7Nw / 1.852), d = e.parseWindCircle(z.r7Se / 1.852), Y = e.parseWindCircle(z.r7Sw / 1.852), X = e.parseWindCircle(z.r10Ne / 1.852), q = e.parseWindCircle(z.r10Nw / 1.852), T = e.parseWindCircle(z.r10Se / 1.852), i = e.parseWindCircle(z.r10Sw / 1.852), S = e.parseWindCircle(z.r12Ne / 1.852), t = e.parseWindCircle(z.r12Nw / 1.852), U = e.parseWindCircle(z.r12Se / 1.852), V = e.parseWindCircle(z.r12Sw / 1.852), { r7: f, r10: G, r12: E } = e.estimateWindRadii(c, W, b);
2233
2233
  return {
2234
2234
  updated: L.utc(z.realTime).format(),
2235
2235
  lat: isNaN(b) ? null : b || null,
@@ -2240,8 +2240,8 @@ class j {
2240
2240
  r7: f,
2241
2241
  r7ne: O,
2242
2242
  r7nw: o,
2243
- r7se: Y,
2244
- r7sw: n,
2243
+ r7se: d,
2244
+ r7sw: Y,
2245
2245
  r10: G,
2246
2246
  r10ne: X,
2247
2247
  r10nw: q,
@@ -2260,15 +2260,15 @@ class j {
2260
2260
  return M.map((z) => {
2261
2261
  const b = z.currentPosition, A = z.forecastPoints, c = L.utc(b.realTime).format(), W = {};
2262
2262
  return A.forEach((O) => {
2263
- const o = L.utc(O.forecastTime), Y = o.diff(c, "hour"), n = Math.round(O.maxSP * 3600 / 1852), X = Math.round(O.maxSP * 3600 / 1852), q = O.pressure, T = e.parseWindCircle(O.r7Ne / 1.852), i = e.parseWindCircle(O.r7Nw / 1.852), S = e.parseWindCircle(O.r7Sw / 1.852), t = e.parseWindCircle(O.r7Se / 1.852), U = e.parseWindCircle(O.r10Ne / 1.852), V = e.parseWindCircle(O.r10Nw / 1.852), f = e.parseWindCircle(O.r10Sw / 1.852), G = e.parseWindCircle(O.r10Se / 1.852), E = e.parseWindCircle(O.r12Ne / 1.852), C = e.parseWindCircle(O.r12Nw / 1.852), H = e.parseWindCircle(O.r12Sw / 1.852), h = e.parseWindCircle(O.r12Se / 1.852), { r7: g, r10: D, r12: m } = e.estimateWindRadii(n, q, O.lat);
2264
- W[Y] = {
2263
+ const o = L.utc(O.forecastTime), d = o.diff(c, "hour"), Y = Math.round(O.maxSP * 3600 / 1852), X = Math.round(O.maxSP * 3600 / 1852), q = O.pressure, T = e.parseWindCircle(O.r7Ne / 1.852), i = e.parseWindCircle(O.r7Nw / 1.852), S = e.parseWindCircle(O.r7Sw / 1.852), t = e.parseWindCircle(O.r7Se / 1.852), U = e.parseWindCircle(O.r10Ne / 1.852), V = e.parseWindCircle(O.r10Nw / 1.852), f = e.parseWindCircle(O.r10Sw / 1.852), G = e.parseWindCircle(O.r10Se / 1.852), E = e.parseWindCircle(O.r12Ne / 1.852), C = e.parseWindCircle(O.r12Nw / 1.852), H = e.parseWindCircle(O.r12Sw / 1.852), h = e.parseWindCircle(O.r12Se / 1.852), { r7: g, r10: D, r12: m } = e.estimateWindRadii(Y, q, O.lat);
2264
+ W[d] = {
2265
2265
  lat: O.lat,
2266
2266
  lng: O.lon,
2267
2267
  pressure: O.pressure,
2268
2268
  utc: o.format(),
2269
2269
  wind: {
2270
- kts: isNaN(n) ? null : n || null,
2271
- type: e.parseTropicalType(n),
2270
+ kts: isNaN(Y) ? null : Y || null,
2271
+ type: e.parseTropicalType(Y),
2272
2272
  datetime: o.format(),
2273
2273
  r7: g,
2274
2274
  r7ne: T,
@@ -2331,41 +2331,41 @@ class e {
2331
2331
  var b;
2332
2332
  const z = Object.values(c0);
2333
2333
  return (b = M.forecasts) == null || b.sort((A, c) => {
2334
- var o, Y;
2335
- const W = z.indexOf((o = A.model) == null ? void 0 : o.toUpperCase()), O = z.indexOf((Y = c.model) == null ? void 0 : Y.toUpperCase());
2334
+ var o, d;
2335
+ const W = z.indexOf((o = A.model) == null ? void 0 : o.toUpperCase()), O = z.indexOf((d = c.model) == null ? void 0 : d.toUpperCase());
2336
2336
  return (W === -1 ? 999 : W) - (O === -1 ? 999 : O);
2337
2337
  }), M;
2338
2338
  }
2339
2339
  static async mergeTropicals(M = !0, z = !1, b = {}) {
2340
- var O, o;
2340
+ var O, o, d;
2341
2341
  const A = await $.realtimeForecast(), c = M ? await b0.realtimeForecast() : [], W = z ? await j.realtimeForecast() : [];
2342
2342
  for (const Y of A) {
2343
- const n = c.find((q) => {
2344
- var T, i;
2345
- return ((T = q.name) == null ? void 0 : T.toLowerCase()) === ((i = Y.name) == null ? void 0 : i.toLowerCase());
2346
- }), X = W.find((q) => {
2347
- var T, i;
2348
- return ((T = q.name) == null ? void 0 : T.toLowerCase()) === ((i = Y.name) == null ? void 0 : i.toLowerCase());
2343
+ const X = c.find((T) => {
2344
+ var i, S;
2345
+ return ((i = T.name) == null ? void 0 : i.toLowerCase()) === ((S = Y.name) == null ? void 0 : S.toLowerCase());
2346
+ }), q = W.find((T) => {
2347
+ var i, S;
2348
+ return ((i = T.name) == null ? void 0 : i.toLowerCase()) === ((S = Y.name) == null ? void 0 : S.toLowerCase());
2349
2349
  });
2350
- if (X) {
2351
- Y.history.push(...X.history), Y.history.sort((q, T) => L(T.updated).valueOf() - L(q.updated).valueOf());
2352
- for (const q of X.forecasts)
2353
- ["CMA", "JMA", "CNTW", "CNHK", "KMA"].includes((O = q.model) == null ? void 0 : O.toUpperCase()) && !Y.forecasts.find((T) => {
2354
- var i, S;
2355
- return ((i = T.model) == null ? void 0 : i.toLowerCase()) === ((S = q.model) == null ? void 0 : S.toLowerCase());
2356
- }) && Y.forecasts.push(q);
2350
+ if (q) {
2351
+ Y.history.sort((T, i) => L(i.updated).valueOf() - L(T.updated).valueOf());
2352
+ for (const T of q.forecasts)
2353
+ ["CMA", "JMA", "CNTW", "CNHK", "KMA"].includes((O = T.model) == null ? void 0 : O.toUpperCase()) && !Y.forecasts.find((i) => {
2354
+ var S, t;
2355
+ return ((S = i.model) == null ? void 0 : S.toLowerCase()) === ((t = T.model) == null ? void 0 : t.toLowerCase());
2356
+ }) && Y.forecasts.push(T);
2357
2357
  }
2358
- if (n) {
2359
- Y.history.push(...n.history), Y.history.sort((q, T) => L(T.updated).valueOf() - L(q.updated).valueOf());
2360
- for (const q of n.forecasts)
2361
- ["CMA", "JMA", "CNTW", "CNHK", "KMA"].includes((o = q.model) == null ? void 0 : o.toUpperCase()) && !Y.forecasts.find((T) => T.model.toLowerCase() === q.model.toLowerCase()) && Y.forecasts.push(q);
2358
+ if (X) {
2359
+ (o = X.history) != null && o.length && (Y.history = X.history), Y.history.sort((T, i) => L(i.updated).valueOf() - L(T.updated).valueOf());
2360
+ for (const T of X.forecasts)
2361
+ ["CMA", "JMA", "CNTW", "CNHK", "KMA"].includes((d = T.model) == null ? void 0 : d.toUpperCase()) && !Y.forecasts.find((i) => i.model.toLowerCase() === T.model.toLowerCase()) && Y.forecasts.push(T);
2362
2362
  }
2363
- Y.history = Y.history.reduce((q, T) => (q.find((i) => i.updated === T.updated) || q.push(T), q), []), await e.tropicalMovement(Y);
2363
+ Y.history = Y.history.reduce((T, i) => (T.find((S) => S.updated === i.updated) || T.push(i), T), []), await e.tropicalMovement(Y);
2364
2364
  }
2365
2365
  for (const Y of c)
2366
- A.every((n) => {
2367
- var X, q;
2368
- return ((X = n.name) == null ? void 0 : X.toLowerCase()) !== ((q = Y.name) == null ? void 0 : q.toLowerCase());
2366
+ A.every((X) => {
2367
+ var q, T;
2368
+ return ((q = X.name) == null ? void 0 : q.toLowerCase()) !== ((T = Y.name) == null ? void 0 : T.toLowerCase());
2369
2369
  }) && A.push(Y);
2370
2370
  return A;
2371
2371
  }
@@ -2381,10 +2381,10 @@ class e {
2381
2381
  for (let O = 0; O < W.length - 1; O++) {
2382
2382
  const o = c[W[O]];
2383
2383
  z = z || o;
2384
- const Y = c[W[O + 1]];
2385
- o.movement = e.calculateMovement(o, Y);
2386
- const n = e.supplementWindRadii(o);
2387
- o.wind = { ...o.wind || {}, ...n };
2384
+ const d = c[W[O + 1]];
2385
+ o.movement = e.calculateMovement(o, d);
2386
+ const Y = e.supplementWindRadii(o);
2387
+ o.wind = { ...o.wind || {}, ...Y };
2388
2388
  }
2389
2389
  });
2390
2390
  let b = null;
@@ -2459,8 +2459,8 @@ class e {
2459
2459
  nw: (315 - b + 360) % 360,
2460
2460
  se: (135 - b + 360) % 360,
2461
2461
  sw: (225 - b + 360) % 360
2462
- }, o = (Y) => {
2463
- const n = Y > 180 ? Y - 360 : Y, X = Math.cos(n * Math.PI / 180);
2462
+ }, o = (d) => {
2463
+ const Y = d > 180 ? d - 360 : d, X = Math.cos(Y * Math.PI / 180);
2464
2464
  return 1 - W * X;
2465
2465
  };
2466
2466
  return {
@@ -2477,8 +2477,8 @@ class e {
2477
2477
  static supplementWindRadii(M) {
2478
2478
  const { wind: z, pressure: b, lat: A, movement: c } = M;
2479
2479
  if (z.r7) {
2480
- for (const n of Object.keys(z))
2481
- /^r[7,10,12]/.test(n) && (isNaN(Number(z[n])) || z[n] < 0) && (z[n] = null);
2480
+ for (const Y of Object.keys(z))
2481
+ /^r[7,10,12]/.test(Y) && (isNaN(Number(z[Y])) || z[Y] < 0) && (z[Y] = null);
2482
2482
  return z;
2483
2483
  }
2484
2484
  const W = z.kts;
@@ -2501,14 +2501,14 @@ class e {
2501
2501
  r12sw: null
2502
2502
  };
2503
2503
  const O = e.estimateWindRadii(W, b, A), o = {};
2504
- return ["r7", "r10", "r12"].forEach((n) => {
2505
- const X = O[n];
2504
+ return ["r7", "r10", "r12"].forEach((Y) => {
2505
+ const X = O[Y];
2506
2506
  if (X) {
2507
- o[n] = X;
2507
+ o[Y] = X;
2508
2508
  const q = e.estimateAsymmetricRadii(X, (c == null ? void 0 : c.kts) || 0, (c == null ? void 0 : c.deg) || 0, A > 0 ? "N" : "S");
2509
- o[`${n}ne`] = q.ne, o[`${n}nw`] = q.nw, o[`${n}se`] = q.se, o[`${n}sw`] = q.sw;
2509
+ o[`${Y}ne`] = q.ne, o[`${Y}nw`] = q.nw, o[`${Y}se`] = q.se, o[`${Y}sw`] = q.sw;
2510
2510
  } else
2511
- o[n] = null, o[`${n}ne`] = null, o[`${n}nw`] = null, o[`${n}se`] = null, o[`${n}sw`] = null;
2511
+ o[Y] = null, o[`${Y}ne`] = null, o[`${Y}nw`] = null, o[`${Y}se`] = null, o[`${Y}sw`] = null;
2512
2512
  }), o;
2513
2513
  }
2514
2514
  /**