@kong-ui-public/analytics-geo-map 1.4.7 → 1.4.8-pr.2556.a2c3cfd3b.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.
@@ -1,14 +1,14 @@
1
- import { computed as L, defineComponent as s0, createElementBlock as T, openBlock as k, createCommentVNode as W, toDisplayString as U, Fragment as C0, renderList as D0, createElementVNode as B, normalizeStyle as N0, useCssVars as I0, toRef as p0, ref as j, useId as U0, onMounted as O0, watch as a0, createBlock as m0, renderSlot as r0, createVNode as R0, unref as I, createTextVNode as E0 } from "vue";
2
- import { Map as A0 } from "maplibre-gl";
3
- import { createI18n as $0, i18nTComponent as G0 } from "@kong-ui-public/i18n";
4
- import { AnalyticsIcon as q0 } from "@kong/icons";
5
- const H0 = {
1
+ import { computed as w, defineComponent as l0, createElementBlock as T, openBlock as M, createCommentVNode as j, toDisplayString as I, Fragment as U0, renderList as I0, createElementVNode as B, normalizeStyle as R0, useCssVars as O0, toRef as m0, ref as K, useId as E0, onMounted as A0, watch as a0, createBlock as y0, renderSlot as r0, createVNode as $0, unref as U, createTextVNode as G0 } from "vue";
2
+ import { Map as q0 } from "maplibre-gl";
3
+ import { createI18n as H0, i18nTComponent as K0 } from "@kong-ui-public/i18n";
4
+ import { AnalyticsIcon as j0 } from "@kong/icons";
5
+ const W0 = {
6
6
  ms: "ms",
7
7
  bytes: "Byte{plural}",
8
8
  count: "request{plural}",
9
9
  "count/minute": "rpm",
10
10
  requests: "request{plural}"
11
- }, K0 = {
11
+ }, Z0 = {
12
12
  request_count: "Request count",
13
13
  request_per_minute: "Requests per minute",
14
14
  response_latency_average: "Response latency (avg)",
@@ -33,98 +33,112 @@ const H0 = {
33
33
  request_size_p95: "Request size (p95)",
34
34
  request_size_p50: "Request size (p50)",
35
35
  request_size_sum: "Request size (sum)"
36
- }, j0 = {
36
+ }, J0 = {
37
37
  windows_zoom_help_text: "Use Ctrl + Scroll to zoom the map",
38
38
  mac_zoom_help_text: "Use ⌘ + Scroll to zoom the map",
39
39
  mobile_zoom_help_text: "Use two fingers to zoom the map"
40
- }, W0 = "No location", Z0 = "No location data found.", J0 = {
41
- metricUnits: H0,
42
- metrics: K0,
43
- cooperative_gestures: j0,
44
- no_location_data: W0,
45
- no_location_data_description: Z0
40
+ }, X0 = "No location", Q0 = "No location data found.", Y0 = {
41
+ metricUnits: W0,
42
+ metrics: Z0,
43
+ cooperative_gestures: J0,
44
+ no_location_data: X0,
45
+ no_location_data_description: Q0
46
46
  };
47
- function X0() {
48
- const e = $0("en-us", J0);
47
+ function b0() {
48
+ const e = H0("en-us", Y0);
49
49
  return {
50
50
  i18n: e,
51
- i18nT: G0(e)
51
+ i18nT: K0(e)
52
52
  // Translation component <i18n-t>
53
53
  };
54
54
  }
55
- function w0(e) {
55
+ function M0(e) {
56
56
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
57
57
  }
58
- var k0 = { exports: {} };
58
+ var L0 = { exports: {} };
59
59
  (function(e) {
60
60
  (function() {
61
- function t(l, a) {
62
- if (a.separator === !1 || l < 1e3)
61
+ function t(l, r) {
62
+ if (r.separator === !1 || l < 1e3)
63
63
  return l.toString();
64
- var u = typeof a.separator == "string" ? a.separator : ",", p = [], m = Math.round(l).toString().split("");
65
- return m.reverse().forEach(function(_, w) {
66
- w && w % 3 === 0 && p.push(u), p.push(_);
64
+ var u = typeof r.separator == "string" ? r.separator : ",", p = [], m = Math.round(l).toString().split("");
65
+ return m.reverse().forEach(function(k, g) {
66
+ g && g % 3 === 0 && p.push(u), p.push(k);
67
67
  }), p.reverse().join("");
68
68
  }
69
- function i(l, a, u) {
70
- var p = l / a, m = u.round ? "round" : "floor";
69
+ function i(l, r, u) {
70
+ var p = l / r, m = u.round ? "round" : "floor";
71
71
  return u.decimal === !1 ? (l = Math[m](p), l.toString()) : (u.precision ? l = p : l = p < 10 ? Math[m](p * 10) / 10 : Math[m](p), l = l.toString(), typeof u.decimal == "string" && (l = l.replace(".", u.decimal)), l);
72
72
  }
73
- var r = 1e3, n = 1e4, o = 1e6, s = 1e9, c = 1e12;
74
- function f(l, a) {
73
+ var a = 1e3, n = 1e4, o = 1e6, s = 1e9, d = 1e12;
74
+ function f(l, r) {
75
75
  var u;
76
- a = a || {};
76
+ r = r || {};
77
77
  var p = l < 0;
78
- p && (l = Math.abs(l)), a.precision && (l = parseFloat(l.toPrecision(a.precision)));
79
- var m = a.min10k ? n : r;
80
- return l < m || a.precision && a.precision > Math.log10(l) ? u = t(i(l, 1, a), a) : l < o ? u = i(l, r, a) + "k" : l < s ? u = i(l, o, a) + "m" : l < c ? u = t(i(l, s, a), a) + "b" : u = t(i(l, c, a), a) + "t", p && (u = "-" + u), a.capital && (u = u.toUpperCase()), a.prefix && (u = a.prefix + u), a.suffix && (u = u + a.suffix), u;
78
+ p && (l = Math.abs(l)), r.precision && (l = parseFloat(l.toPrecision(r.precision)));
79
+ var m = r.min10k ? n : a;
80
+ return l < m || r.precision && r.precision > Math.log10(l) ? u = t(i(l, 1, r), r) : l < o ? u = i(l, a, r) + "k" : l < s ? u = i(l, o, r) + "m" : l < d ? u = t(i(l, s, r), r) + "b" : u = t(i(l, d, r), r) + "t", p && (u = "-" + u), r.capital && (u = u.toUpperCase()), r.prefix && (u = r.prefix + u), r.suffix && (u = u + r.suffix), u;
81
81
  }
82
82
  f.addCommas = t, e.exports = f;
83
83
  })();
84
- })(k0);
85
- var Q0 = k0.exports;
86
- const Y0 = /* @__PURE__ */ w0(Q0);
87
- function b0({
84
+ })(L0);
85
+ var ee = L0.exports;
86
+ const te = /* @__PURE__ */ M0(ee), W = "#e0e4ea", ie = "#828a9e", ne = "32px", x0 = 5, o0 = [
87
+ "#00819d",
88
+ "#00abd2",
89
+ "#00c8f4",
90
+ "#67e3ff",
91
+ "#b3f1ff"
92
+ ], ae = (e, t) => {
93
+ const i = e.length;
94
+ if (!i)
95
+ return NaN;
96
+ const a = (i - 1) * t, n = Math.floor(a), o = Math.ceil(a);
97
+ return n === o ? e[n] : e[n] + (a - n) * (e[o] - e[n]);
98
+ }, re = (e, t) => {
99
+ if (e.length === 0)
100
+ return [];
101
+ const i = e.filter((n) => n > 0).map(Math.log).sort((n, o) => n - o);
102
+ return Array.from({ length: t }, (n, o) => ae(i, o / t)).map((n) => Math.exp(n)).reverse();
103
+ };
104
+ function oe({
88
105
  countryMetrics: e,
89
106
  metric: t
90
107
  }) {
91
- const i = L(() => Math.log(Math.min(...Object.values(e.value)))), r = L(() => Math.log(Math.max(...Object.values(e.value)))), n = L(() => {
92
- var f;
93
- return !((f = t.value) != null && f.includes("latency"));
94
- }), o = L(() => {
95
- const l = (r.value - i.value) / 5, a = [
96
- i.value + 4 * l,
97
- i.value + 3 * l,
98
- i.value + 2 * l,
99
- i.value + 1 * l,
100
- i.value
101
- ];
102
- return a.map((u, p) => {
103
- const m = p === 0 ? r.value : a[p - 1], _ = Math.exp(u), w = Math.exp(m);
104
- let O = "";
105
- return p === 0 ? O = `> ${c(_)}` : p === a.length - 1 ? O = `< ${c(w)}` : O = `${c(_)} - ${c(w)}`, {
106
- color: s(_),
107
- range: O
108
- };
109
- });
110
- }), s = (f) => {
111
- const l = Math.log(f), u = (r.value - i.value) / 5;
112
- return l >= i.value + 4 * u ? "#00819d" : l >= i.value + 3 * u ? "#00abd2" : l >= i.value + 2 * u ? "#00c8f4" : l >= i.value + 1 * u ? "#67e3ff" : "#b3f1ff";
113
- }, c = (f) => {
114
- var a;
115
- const l = Math.trunc(f);
116
- return n.value ? Y0(l, { capital: !0 }) : new Intl.NumberFormat(((a = document == null ? void 0 : document.documentElement) == null ? void 0 : a.lang) || "en-US").format(l);
108
+ const i = w(() => Object.values(e.value)), a = w(() => Object.keys(e.value).length), n = w(() => a.value < x0 - 1 ? a.value : x0), o = w(() => {
109
+ var r;
110
+ return !((r = t.value) != null && r.includes("latency"));
111
+ }), s = w(() => re(i.value, n.value)), d = w(() => i.value.length === 1 ? [{
112
+ color: f(i.value[0]),
113
+ range: l(i.value[0])
114
+ }] : s.value.map((r, u) => {
115
+ const p = u === 0 ? Math.max(...s.value) : s.value[u - 1], m = r, k = p;
116
+ let g = "";
117
+ return u === 0 ? g = `> ${l(m)}` : u === s.value.length - 1 ? g = `< ${l(k)}` : g = `${l(m)} - ${l(k)}`, {
118
+ color: f(m),
119
+ range: g
120
+ };
121
+ })), f = (r) => {
122
+ if (r === 0)
123
+ return W;
124
+ const u = s.value.findIndex((p) => r >= p);
125
+ return u === -1 ? o0[o0.length - 1] : o0[u] ?? W;
126
+ }, l = (r) => {
127
+ var p;
128
+ const u = Math.trunc(r);
129
+ return o.value ? te(u, { capital: !0 }) : new Intl.NumberFormat(((p = document == null ? void 0 : document.documentElement) == null ? void 0 : p.lang) || "en-US").format(u);
117
130
  };
118
131
  return {
119
- getColor: s,
120
- formatMetric: c,
121
- legendData: o
132
+ getColor: f,
133
+ formatMetric: l,
134
+ legendData: d,
135
+ scale: s
122
136
  };
123
137
  }
124
- const y0 = {
125
- useI18n: X0,
126
- useMetricUtils: b0
127
- }, ee = "FeatureCollection", te = [
138
+ const v0 = {
139
+ useI18n: b0,
140
+ useMetricUtils: oe
141
+ }, se = "FeatureCollection", le = [
128
142
  {
129
143
  type: "Feature",
130
144
  properties: {
@@ -2556,11 +2570,11 @@ const y0 = {
2556
2570
  ]
2557
2571
  }
2558
2572
  }
2559
- ], ie = {
2560
- type: ee,
2561
- features: te
2573
+ ], ue = {
2574
+ type: se,
2575
+ features: le
2562
2576
  };
2563
- var ne = re, b, G, g, e0, i0, ae = [
2577
+ var ce = fe, b, $, _, e0, i0, de = [
2564
2578
  "Point",
2565
2579
  "MultiPoint",
2566
2580
  "LineString",
@@ -2569,106 +2583,106 @@ var ne = re, b, G, g, e0, i0, ae = [
2569
2583
  "MultiPolygon",
2570
2584
  "GeometryCollection"
2571
2585
  ];
2572
- function re(e) {
2573
- e0 = 2, i0 = Math.pow(10, 6), g = null, b = [], G = [];
2574
- var t = e.readFields(oe, {});
2586
+ function fe(e) {
2587
+ e0 = 2, i0 = Math.pow(10, 6), _ = null, b = [], $ = [];
2588
+ var t = e.readFields(he, {});
2575
2589
  return b = null, t;
2576
2590
  }
2577
- function oe(e, t, i) {
2578
- e === 1 ? b.push(i.readString()) : e === 2 ? e0 = i.readVarint() : e === 3 ? i0 = Math.pow(10, i.readVarint()) : e === 4 ? se(i, t) : e === 5 ? M0(i, t) : e === 6 && l0(i, t);
2591
+ function he(e, t, i) {
2592
+ e === 1 ? b.push(i.readString()) : e === 2 ? e0 = i.readVarint() : e === 3 ? i0 = Math.pow(10, i.readVarint()) : e === 4 ? pe(i, t) : e === 5 ? B0(i, t) : e === 6 && u0(i, t);
2579
2593
  }
2580
- function se(e, t) {
2581
- return t.type = "FeatureCollection", t.features = [], e.readMessage(le, t);
2594
+ function pe(e, t) {
2595
+ return t.type = "FeatureCollection", t.features = [], e.readMessage(me, t);
2582
2596
  }
2583
- function M0(e, t) {
2597
+ function B0(e, t) {
2584
2598
  t.type = "Feature";
2585
- var i = e.readMessage(ue, t);
2599
+ var i = e.readMessage(ye, t);
2586
2600
  return "geometry" in i || (i.geometry = null), i;
2587
2601
  }
2588
- function l0(e, t) {
2589
- return t.type = "Point", e.readMessage(ce, t);
2602
+ function u0(e, t) {
2603
+ return t.type = "Point", e.readMessage(xe, t);
2590
2604
  }
2591
- function le(e, t, i) {
2592
- e === 1 ? t.features.push(M0(i, {})) : e === 13 ? G.push(u0(i)) : e === 15 && t0(i, t);
2605
+ function me(e, t, i) {
2606
+ e === 1 ? t.features.push(B0(i, {})) : e === 13 ? $.push(c0(i)) : e === 15 && t0(i, t);
2593
2607
  }
2594
- function ue(e, t, i) {
2595
- e === 1 ? t.geometry = l0(i, {}) : e === 11 ? t.id = i.readString() : e === 12 ? t.id = i.readSVarint() : e === 13 ? G.push(u0(i)) : e === 14 ? t.properties = t0(i, {}) : e === 15 && t0(i, t);
2608
+ function ye(e, t, i) {
2609
+ e === 1 ? t.geometry = u0(i, {}) : e === 11 ? t.id = i.readString() : e === 12 ? t.id = i.readSVarint() : e === 13 ? $.push(c0(i)) : e === 14 ? t.properties = t0(i, {}) : e === 15 && t0(i, t);
2596
2610
  }
2597
- function ce(e, t, i) {
2598
- e === 1 ? t.type = ae[i.readVarint()] : e === 2 ? g = i.readPackedVarint() : e === 3 ? de(t, i, t.type) : e === 4 ? (t.geometries = t.geometries || [], t.geometries.push(l0(i, {}))) : e === 13 ? G.push(u0(i)) : e === 15 && t0(i, t);
2611
+ function xe(e, t, i) {
2612
+ e === 1 ? t.type = de[i.readVarint()] : e === 2 ? _ = i.readPackedVarint() : e === 3 ? ve(t, i, t.type) : e === 4 ? (t.geometries = t.geometries || [], t.geometries.push(u0(i, {}))) : e === 13 ? $.push(c0(i)) : e === 15 && t0(i, t);
2599
2613
  }
2600
- function de(e, t, i) {
2601
- i === "Point" ? e.coordinates = fe(t) : i === "MultiPoint" || i === "LineString" ? e.coordinates = x0(t) : i === "MultiLineString" ? e.coordinates = v0(t) : i === "Polygon" ? e.coordinates = v0(t, !0) : i === "MultiPolygon" && (e.coordinates = he(t));
2614
+ function ve(e, t, i) {
2615
+ i === "Point" ? e.coordinates = ge(t) : i === "MultiPoint" || i === "LineString" ? e.coordinates = g0(t) : i === "MultiLineString" ? e.coordinates = _0(t) : i === "Polygon" ? e.coordinates = _0(t, !0) : i === "MultiPolygon" && (e.coordinates = _e(t));
2602
2616
  }
2603
- function u0(e) {
2617
+ function c0(e) {
2604
2618
  for (var t = e.readVarint() + e.pos, i = null; e.pos < t; ) {
2605
- var r = e.readVarint(), n = r >> 3;
2619
+ var a = e.readVarint(), n = a >> 3;
2606
2620
  n === 1 ? i = e.readString() : n === 2 ? i = e.readDouble() : n === 3 ? i = e.readVarint() : n === 4 ? i = -e.readVarint() : n === 5 ? i = e.readBoolean() : n === 6 && (i = JSON.parse(e.readString()));
2607
2621
  }
2608
2622
  return i;
2609
2623
  }
2610
2624
  function t0(e, t) {
2611
- for (var i = e.readVarint() + e.pos; e.pos < i; ) t[b[e.readVarint()]] = G[e.readVarint()];
2612
- return G = [], t;
2625
+ for (var i = e.readVarint() + e.pos; e.pos < i; ) t[b[e.readVarint()]] = $[e.readVarint()];
2626
+ return $ = [], t;
2613
2627
  }
2614
- function fe(e) {
2628
+ function ge(e) {
2615
2629
  for (var t = e.readVarint() + e.pos, i = []; e.pos < t; ) i.push(e.readSVarint() / i0);
2616
2630
  return i;
2617
2631
  }
2618
- function Z(e, t, i, r) {
2619
- var n = 0, o = [], s, c, f = [];
2620
- for (c = 0; c < e0; c++) f[c] = 0;
2632
+ function Z(e, t, i, a) {
2633
+ var n = 0, o = [], s, d, f = [];
2634
+ for (d = 0; d < e0; d++) f[d] = 0;
2621
2635
  for (; i ? n < i : e.pos < t; ) {
2622
- for (s = [], c = 0; c < e0; c++)
2623
- f[c] += e.readSVarint(), s[c] = f[c] / i0;
2636
+ for (s = [], d = 0; d < e0; d++)
2637
+ f[d] += e.readSVarint(), s[d] = f[d] / i0;
2624
2638
  o.push(s), n++;
2625
2639
  }
2626
- return r && o.push(o[0]), o;
2640
+ return a && o.push(o[0]), o;
2627
2641
  }
2628
- function x0(e) {
2642
+ function g0(e) {
2629
2643
  return Z(e, e.readVarint() + e.pos);
2630
2644
  }
2631
- function v0(e, t) {
2645
+ function _0(e, t) {
2632
2646
  var i = e.readVarint() + e.pos;
2633
- if (!g) return [Z(e, i, null, t)];
2634
- for (var r = [], n = 0; n < g.length; n++) r.push(Z(e, i, g[n], t));
2635
- return g = null, r;
2647
+ if (!_) return [Z(e, i, null, t)];
2648
+ for (var a = [], n = 0; n < _.length; n++) a.push(Z(e, i, _[n], t));
2649
+ return _ = null, a;
2636
2650
  }
2637
- function he(e) {
2651
+ function _e(e) {
2638
2652
  var t = e.readVarint() + e.pos;
2639
- if (!g) return [[Z(e, t, null, !0)]];
2640
- for (var i = [], r = 1, n = 0; n < g[0]; n++) {
2641
- for (var o = [], s = 0; s < g[r]; s++) o.push(Z(e, t, g[r + 1 + s], !0));
2642
- r += g[r] + 1, i.push(o);
2653
+ if (!_) return [[Z(e, t, null, !0)]];
2654
+ for (var i = [], a = 1, n = 0; n < _[0]; n++) {
2655
+ for (var o = [], s = 0; s < _[a]; s++) o.push(Z(e, t, _[a + 1 + s], !0));
2656
+ a += _[a] + 1, i.push(o);
2643
2657
  }
2644
- return g = null, i;
2658
+ return _ = null, i;
2645
2659
  }
2646
- var pe = ne, c0 = {};
2660
+ var Fe = ce, d0 = {};
2647
2661
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
2648
- c0.read = function(e, t, i, r, n) {
2649
- var o, s, c = n * 8 - r - 1, f = (1 << c) - 1, l = f >> 1, a = -7, u = i ? n - 1 : 0, p = i ? -1 : 1, m = e[t + u];
2650
- for (u += p, o = m & (1 << -a) - 1, m >>= -a, a += c; a > 0; o = o * 256 + e[t + u], u += p, a -= 8)
2662
+ d0.read = function(e, t, i, a, n) {
2663
+ var o, s, d = n * 8 - a - 1, f = (1 << d) - 1, l = f >> 1, r = -7, u = i ? n - 1 : 0, p = i ? -1 : 1, m = e[t + u];
2664
+ for (u += p, o = m & (1 << -r) - 1, m >>= -r, r += d; r > 0; o = o * 256 + e[t + u], u += p, r -= 8)
2651
2665
  ;
2652
- for (s = o & (1 << -a) - 1, o >>= -a, a += r; a > 0; s = s * 256 + e[t + u], u += p, a -= 8)
2666
+ for (s = o & (1 << -r) - 1, o >>= -r, r += a; r > 0; s = s * 256 + e[t + u], u += p, r -= 8)
2653
2667
  ;
2654
2668
  if (o === 0)
2655
2669
  o = 1 - l;
2656
2670
  else {
2657
2671
  if (o === f)
2658
2672
  return s ? NaN : (m ? -1 : 1) * (1 / 0);
2659
- s = s + Math.pow(2, r), o = o - l;
2673
+ s = s + Math.pow(2, a), o = o - l;
2660
2674
  }
2661
- return (m ? -1 : 1) * s * Math.pow(2, o - r);
2675
+ return (m ? -1 : 1) * s * Math.pow(2, o - a);
2662
2676
  };
2663
- c0.write = function(e, t, i, r, n, o) {
2664
- var s, c, f, l = o * 8 - n - 1, a = (1 << l) - 1, u = a >> 1, p = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = r ? 0 : o - 1, _ = r ? 1 : -1, w = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
2665
- for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (c = isNaN(t) ? 1 : 0, s = a) : (s = Math.floor(Math.log(t) / Math.LN2), t * (f = Math.pow(2, -s)) < 1 && (s--, f *= 2), s + u >= 1 ? t += p / f : t += p * Math.pow(2, 1 - u), t * f >= 2 && (s++, f /= 2), s + u >= a ? (c = 0, s = a) : s + u >= 1 ? (c = (t * f - 1) * Math.pow(2, n), s = s + u) : (c = t * Math.pow(2, u - 1) * Math.pow(2, n), s = 0)); n >= 8; e[i + m] = c & 255, m += _, c /= 256, n -= 8)
2677
+ d0.write = function(e, t, i, a, n, o) {
2678
+ var s, d, f, l = o * 8 - n - 1, r = (1 << l) - 1, u = r >> 1, p = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = a ? 0 : o - 1, k = a ? 1 : -1, g = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
2679
+ for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (d = isNaN(t) ? 1 : 0, s = r) : (s = Math.floor(Math.log(t) / Math.LN2), t * (f = Math.pow(2, -s)) < 1 && (s--, f *= 2), s + u >= 1 ? t += p / f : t += p * Math.pow(2, 1 - u), t * f >= 2 && (s++, f /= 2), s + u >= r ? (d = 0, s = r) : s + u >= 1 ? (d = (t * f - 1) * Math.pow(2, n), s = s + u) : (d = t * Math.pow(2, u - 1) * Math.pow(2, n), s = 0)); n >= 8; e[i + m] = d & 255, m += k, d /= 256, n -= 8)
2666
2680
  ;
2667
- for (s = s << n | c, l += n; l > 0; e[i + m] = s & 255, m += _, s /= 256, l -= 8)
2681
+ for (s = s << n | d, l += n; l > 0; e[i + m] = s & 255, m += k, s /= 256, l -= 8)
2668
2682
  ;
2669
- e[i + m - _] |= w * 128;
2683
+ e[i + m - k] |= g * 128;
2670
2684
  };
2671
- var me = h, Q = c0;
2685
+ var we = h, Q = d0;
2672
2686
  function h(e) {
2673
2687
  this.buf = ArrayBuffer.isView && ArrayBuffer.isView(e) ? e : new Uint8Array(e || 0), this.pos = 0, this.type = 0, this.length = this.buf.length;
2674
2688
  }
@@ -2676,7 +2690,7 @@ h.Varint = 0;
2676
2690
  h.Fixed64 = 1;
2677
2691
  h.Bytes = 2;
2678
2692
  h.Fixed32 = 5;
2679
- var o0 = 65536 * 65536, g0 = 1 / o0, ye = 12, L0 = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8");
2693
+ var s0 = 65536 * 65536, F0 = 1 / s0, ke = 12, P0 = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8");
2680
2694
  h.prototype = {
2681
2695
  destroy: function() {
2682
2696
  this.buf = null;
@@ -2684,8 +2698,8 @@ h.prototype = {
2684
2698
  // === READING =================================================================
2685
2699
  readFields: function(e, t, i) {
2686
2700
  for (i = i || this.length; this.pos < i; ) {
2687
- var r = this.readVarint(), n = r >> 3, o = this.pos;
2688
- this.type = r & 7, e(n, t, this), this.pos === o && this.skip(r);
2701
+ var a = this.readVarint(), n = a >> 3, o = this.pos;
2702
+ this.type = a & 7, e(n, t, this), this.pos === o && this.skip(a);
2689
2703
  }
2690
2704
  return t;
2691
2705
  },
@@ -2697,16 +2711,16 @@ h.prototype = {
2697
2711
  return this.pos += 4, e;
2698
2712
  },
2699
2713
  readSFixed32: function() {
2700
- var e = F0(this.buf, this.pos);
2714
+ var e = k0(this.buf, this.pos);
2701
2715
  return this.pos += 4, e;
2702
2716
  },
2703
2717
  // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
2704
2718
  readFixed64: function() {
2705
- var e = Y(this.buf, this.pos) + Y(this.buf, this.pos + 4) * o0;
2719
+ var e = Y(this.buf, this.pos) + Y(this.buf, this.pos + 4) * s0;
2706
2720
  return this.pos += 8, e;
2707
2721
  },
2708
2722
  readSFixed64: function() {
2709
- var e = Y(this.buf, this.pos) + F0(this.buf, this.pos + 4) * o0;
2723
+ var e = Y(this.buf, this.pos) + k0(this.buf, this.pos + 4) * s0;
2710
2724
  return this.pos += 8, e;
2711
2725
  },
2712
2726
  readFloat: function() {
@@ -2718,8 +2732,8 @@ h.prototype = {
2718
2732
  return this.pos += 8, e;
2719
2733
  },
2720
2734
  readVarint: function(e) {
2721
- var t = this.buf, i, r;
2722
- return r = t[this.pos++], i = r & 127, r < 128 || (r = t[this.pos++], i |= (r & 127) << 7, r < 128) || (r = t[this.pos++], i |= (r & 127) << 14, r < 128) || (r = t[this.pos++], i |= (r & 127) << 21, r < 128) ? i : (r = t[this.pos], i |= (r & 15) << 28, xe(i, e, this));
2735
+ var t = this.buf, i, a;
2736
+ return a = t[this.pos++], i = a & 127, a < 128 || (a = t[this.pos++], i |= (a & 127) << 7, a < 128) || (a = t[this.pos++], i |= (a & 127) << 14, a < 128) || (a = t[this.pos++], i |= (a & 127) << 21, a < 128) ? i : (a = t[this.pos], i |= (a & 15) << 28, Me(i, e, this));
2723
2737
  },
2724
2738
  readVarint64: function() {
2725
2739
  return this.readVarint(!0);
@@ -2733,7 +2747,7 @@ h.prototype = {
2733
2747
  },
2734
2748
  readString: function() {
2735
2749
  var e = this.readVarint() + this.pos, t = this.pos;
2736
- return this.pos = e, e - t >= ye && L0 ? Te(this.buf, t, e) : ze(this.buf, t, e);
2750
+ return this.pos = e, e - t >= ke && P0 ? Oe(this.buf, t, e) : Re(this.buf, t, e);
2737
2751
  },
2738
2752
  readBytes: function() {
2739
2753
  var e = this.readVarint() + this.pos, t = this.buf.subarray(this.pos, e);
@@ -2742,55 +2756,55 @@ h.prototype = {
2742
2756
  // verbose for performance reasons; doesn't affect gzipped size
2743
2757
  readPackedVarint: function(e, t) {
2744
2758
  if (this.type !== h.Bytes) return e.push(this.readVarint(t));
2745
- var i = M(this);
2759
+ var i = L(this);
2746
2760
  for (e = e || []; this.pos < i; ) e.push(this.readVarint(t));
2747
2761
  return e;
2748
2762
  },
2749
2763
  readPackedSVarint: function(e) {
2750
2764
  if (this.type !== h.Bytes) return e.push(this.readSVarint());
2751
- var t = M(this);
2765
+ var t = L(this);
2752
2766
  for (e = e || []; this.pos < t; ) e.push(this.readSVarint());
2753
2767
  return e;
2754
2768
  },
2755
2769
  readPackedBoolean: function(e) {
2756
2770
  if (this.type !== h.Bytes) return e.push(this.readBoolean());
2757
- var t = M(this);
2771
+ var t = L(this);
2758
2772
  for (e = e || []; this.pos < t; ) e.push(this.readBoolean());
2759
2773
  return e;
2760
2774
  },
2761
2775
  readPackedFloat: function(e) {
2762
2776
  if (this.type !== h.Bytes) return e.push(this.readFloat());
2763
- var t = M(this);
2777
+ var t = L(this);
2764
2778
  for (e = e || []; this.pos < t; ) e.push(this.readFloat());
2765
2779
  return e;
2766
2780
  },
2767
2781
  readPackedDouble: function(e) {
2768
2782
  if (this.type !== h.Bytes) return e.push(this.readDouble());
2769
- var t = M(this);
2783
+ var t = L(this);
2770
2784
  for (e = e || []; this.pos < t; ) e.push(this.readDouble());
2771
2785
  return e;
2772
2786
  },
2773
2787
  readPackedFixed32: function(e) {
2774
2788
  if (this.type !== h.Bytes) return e.push(this.readFixed32());
2775
- var t = M(this);
2789
+ var t = L(this);
2776
2790
  for (e = e || []; this.pos < t; ) e.push(this.readFixed32());
2777
2791
  return e;
2778
2792
  },
2779
2793
  readPackedSFixed32: function(e) {
2780
2794
  if (this.type !== h.Bytes) return e.push(this.readSFixed32());
2781
- var t = M(this);
2795
+ var t = L(this);
2782
2796
  for (e = e || []; this.pos < t; ) e.push(this.readSFixed32());
2783
2797
  return e;
2784
2798
  },
2785
2799
  readPackedFixed64: function(e) {
2786
2800
  if (this.type !== h.Bytes) return e.push(this.readFixed64());
2787
- var t = M(this);
2801
+ var t = L(this);
2788
2802
  for (e = e || []; this.pos < t; ) e.push(this.readFixed64());
2789
2803
  return e;
2790
2804
  },
2791
2805
  readPackedSFixed64: function(e) {
2792
2806
  if (this.type !== h.Bytes) return e.push(this.readSFixed64());
2793
- var t = M(this);
2807
+ var t = L(this);
2794
2808
  for (e = e || []; this.pos < t; ) e.push(this.readSFixed64());
2795
2809
  return e;
2796
2810
  },
@@ -2818,20 +2832,20 @@ h.prototype = {
2818
2832
  return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
2819
2833
  },
2820
2834
  writeFixed32: function(e) {
2821
- this.realloc(4), $(this.buf, e, this.pos), this.pos += 4;
2835
+ this.realloc(4), A(this.buf, e, this.pos), this.pos += 4;
2822
2836
  },
2823
2837
  writeSFixed32: function(e) {
2824
- this.realloc(4), $(this.buf, e, this.pos), this.pos += 4;
2838
+ this.realloc(4), A(this.buf, e, this.pos), this.pos += 4;
2825
2839
  },
2826
2840
  writeFixed64: function(e) {
2827
- this.realloc(8), $(this.buf, e & -1, this.pos), $(this.buf, Math.floor(e * g0), this.pos + 4), this.pos += 8;
2841
+ this.realloc(8), A(this.buf, e & -1, this.pos), A(this.buf, Math.floor(e * F0), this.pos + 4), this.pos += 8;
2828
2842
  },
2829
2843
  writeSFixed64: function(e) {
2830
- this.realloc(8), $(this.buf, e & -1, this.pos), $(this.buf, Math.floor(e * g0), this.pos + 4), this.pos += 8;
2844
+ this.realloc(8), A(this.buf, e & -1, this.pos), A(this.buf, Math.floor(e * F0), this.pos + 4), this.pos += 8;
2831
2845
  },
2832
2846
  writeVarint: function(e) {
2833
2847
  if (e = +e || 0, e > 268435455 || e < 0) {
2834
- ve(e, this);
2848
+ Le(e, this);
2835
2849
  return;
2836
2850
  }
2837
2851
  this.realloc(4), this.buf[this.pos++] = e & 127 | (e > 127 ? 128 : 0), !(e <= 127) && (this.buf[this.pos++] = (e >>>= 7) & 127 | (e > 127 ? 128 : 0), !(e <= 127) && (this.buf[this.pos++] = (e >>>= 7) & 127 | (e > 127 ? 128 : 0), !(e <= 127) && (this.buf[this.pos++] = e >>> 7 & 127)));
@@ -2845,9 +2859,9 @@ h.prototype = {
2845
2859
  writeString: function(e) {
2846
2860
  e = String(e), this.realloc(e.length * 4), this.pos++;
2847
2861
  var t = this.pos;
2848
- this.pos = Ce(this.buf, e, this.pos);
2862
+ this.pos = Ee(this.buf, e, this.pos);
2849
2863
  var i = this.pos - t;
2850
- i >= 128 && _0(t, i, this), this.pos = t - 1, this.writeVarint(i), this.pos += i;
2864
+ i >= 128 && w0(t, i, this), this.pos = t - 1, this.writeVarint(i), this.pos += i;
2851
2865
  },
2852
2866
  writeFloat: function(e) {
2853
2867
  this.realloc(4), Q.write(this.buf, e, this.pos, !0, 23, 4), this.pos += 4;
@@ -2864,38 +2878,38 @@ h.prototype = {
2864
2878
  this.pos++;
2865
2879
  var i = this.pos;
2866
2880
  e(t, this);
2867
- var r = this.pos - i;
2868
- r >= 128 && _0(i, r, this), this.pos = i - 1, this.writeVarint(r), this.pos += r;
2881
+ var a = this.pos - i;
2882
+ a >= 128 && w0(i, a, this), this.pos = i - 1, this.writeVarint(a), this.pos += a;
2869
2883
  },
2870
2884
  writeMessage: function(e, t, i) {
2871
2885
  this.writeTag(e, h.Bytes), this.writeRawMessage(t, i);
2872
2886
  },
2873
2887
  writePackedVarint: function(e, t) {
2874
- t.length && this.writeMessage(e, Fe, t);
2888
+ t.length && this.writeMessage(e, Se, t);
2875
2889
  },
2876
2890
  writePackedSVarint: function(e, t) {
2877
- t.length && this.writeMessage(e, we, t);
2891
+ t.length && this.writeMessage(e, Ve, t);
2878
2892
  },
2879
2893
  writePackedBoolean: function(e, t) {
2880
- t.length && this.writeMessage(e, Le, t);
2894
+ t.length && this.writeMessage(e, Ce, t);
2881
2895
  },
2882
2896
  writePackedFloat: function(e, t) {
2883
- t.length && this.writeMessage(e, ke, t);
2897
+ t.length && this.writeMessage(e, ze, t);
2884
2898
  },
2885
2899
  writePackedDouble: function(e, t) {
2886
- t.length && this.writeMessage(e, Me, t);
2900
+ t.length && this.writeMessage(e, Te, t);
2887
2901
  },
2888
2902
  writePackedFixed32: function(e, t) {
2889
- t.length && this.writeMessage(e, Be, t);
2903
+ t.length && this.writeMessage(e, De, t);
2890
2904
  },
2891
2905
  writePackedSFixed32: function(e, t) {
2892
- t.length && this.writeMessage(e, Pe, t);
2906
+ t.length && this.writeMessage(e, Ne, t);
2893
2907
  },
2894
2908
  writePackedFixed64: function(e, t) {
2895
- t.length && this.writeMessage(e, Se, t);
2909
+ t.length && this.writeMessage(e, Ue, t);
2896
2910
  },
2897
2911
  writePackedSFixed64: function(e, t) {
2898
- t.length && this.writeMessage(e, Ve, t);
2912
+ t.length && this.writeMessage(e, Ie, t);
2899
2913
  },
2900
2914
  writeBytesField: function(e, t) {
2901
2915
  this.writeTag(e, h.Bytes), this.writeBytes(t);
@@ -2931,86 +2945,86 @@ h.prototype = {
2931
2945
  this.writeVarintField(e, !!t);
2932
2946
  }
2933
2947
  };
2934
- function xe(e, t, i) {
2935
- var r = i.buf, n, o;
2936
- if (o = r[i.pos++], n = (o & 112) >> 4, o < 128 || (o = r[i.pos++], n |= (o & 127) << 3, o < 128) || (o = r[i.pos++], n |= (o & 127) << 10, o < 128) || (o = r[i.pos++], n |= (o & 127) << 17, o < 128) || (o = r[i.pos++], n |= (o & 127) << 24, o < 128) || (o = r[i.pos++], n |= (o & 1) << 31, o < 128)) return A(e, n, t);
2948
+ function Me(e, t, i) {
2949
+ var a = i.buf, n, o;
2950
+ if (o = a[i.pos++], n = (o & 112) >> 4, o < 128 || (o = a[i.pos++], n |= (o & 127) << 3, o < 128) || (o = a[i.pos++], n |= (o & 127) << 10, o < 128) || (o = a[i.pos++], n |= (o & 127) << 17, o < 128) || (o = a[i.pos++], n |= (o & 127) << 24, o < 128) || (o = a[i.pos++], n |= (o & 1) << 31, o < 128)) return E(e, n, t);
2937
2951
  throw new Error("Expected varint not more than 10 bytes");
2938
2952
  }
2939
- function M(e) {
2953
+ function L(e) {
2940
2954
  return e.type === h.Bytes ? e.readVarint() + e.pos : e.pos + 1;
2941
2955
  }
2942
- function A(e, t, i) {
2956
+ function E(e, t, i) {
2943
2957
  return i ? t * 4294967296 + (e >>> 0) : (t >>> 0) * 4294967296 + (e >>> 0);
2944
2958
  }
2945
- function ve(e, t) {
2946
- var i, r;
2947
- if (e >= 0 ? (i = e % 4294967296 | 0, r = e / 4294967296 | 0) : (i = ~(-e % 4294967296), r = ~(-e / 4294967296), i ^ 4294967295 ? i = i + 1 | 0 : (i = 0, r = r + 1 | 0)), e >= 18446744073709552e3 || e < -18446744073709552e3)
2959
+ function Le(e, t) {
2960
+ var i, a;
2961
+ if (e >= 0 ? (i = e % 4294967296 | 0, a = e / 4294967296 | 0) : (i = ~(-e % 4294967296), a = ~(-e / 4294967296), i ^ 4294967295 ? i = i + 1 | 0 : (i = 0, a = a + 1 | 0)), e >= 18446744073709552e3 || e < -18446744073709552e3)
2948
2962
  throw new Error("Given varint doesn't fit into 10 bytes");
2949
- t.realloc(10), ge(i, r, t), _e(r, t);
2963
+ t.realloc(10), Be(i, a, t), Pe(a, t);
2950
2964
  }
2951
- function ge(e, t, i) {
2965
+ function Be(e, t, i) {
2952
2966
  i.buf[i.pos++] = e & 127 | 128, e >>>= 7, i.buf[i.pos++] = e & 127 | 128, e >>>= 7, i.buf[i.pos++] = e & 127 | 128, e >>>= 7, i.buf[i.pos++] = e & 127 | 128, e >>>= 7, i.buf[i.pos] = e & 127;
2953
2967
  }
2954
- function _e(e, t) {
2968
+ function Pe(e, t) {
2955
2969
  var i = (e & 7) << 4;
2956
2970
  t.buf[t.pos++] |= i | ((e >>>= 3) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127)))));
2957
2971
  }
2958
- function _0(e, t, i) {
2959
- var r = t <= 16383 ? 1 : t <= 2097151 ? 2 : t <= 268435455 ? 3 : Math.floor(Math.log(t) / (Math.LN2 * 7));
2960
- i.realloc(r);
2961
- for (var n = i.pos - 1; n >= e; n--) i.buf[n + r] = i.buf[n];
2972
+ function w0(e, t, i) {
2973
+ var a = t <= 16383 ? 1 : t <= 2097151 ? 2 : t <= 268435455 ? 3 : Math.floor(Math.log(t) / (Math.LN2 * 7));
2974
+ i.realloc(a);
2975
+ for (var n = i.pos - 1; n >= e; n--) i.buf[n + a] = i.buf[n];
2962
2976
  }
2963
- function Fe(e, t) {
2977
+ function Se(e, t) {
2964
2978
  for (var i = 0; i < e.length; i++) t.writeVarint(e[i]);
2965
2979
  }
2966
- function we(e, t) {
2980
+ function Ve(e, t) {
2967
2981
  for (var i = 0; i < e.length; i++) t.writeSVarint(e[i]);
2968
2982
  }
2969
- function ke(e, t) {
2983
+ function ze(e, t) {
2970
2984
  for (var i = 0; i < e.length; i++) t.writeFloat(e[i]);
2971
2985
  }
2972
- function Me(e, t) {
2986
+ function Te(e, t) {
2973
2987
  for (var i = 0; i < e.length; i++) t.writeDouble(e[i]);
2974
2988
  }
2975
- function Le(e, t) {
2989
+ function Ce(e, t) {
2976
2990
  for (var i = 0; i < e.length; i++) t.writeBoolean(e[i]);
2977
2991
  }
2978
- function Be(e, t) {
2992
+ function De(e, t) {
2979
2993
  for (var i = 0; i < e.length; i++) t.writeFixed32(e[i]);
2980
2994
  }
2981
- function Pe(e, t) {
2995
+ function Ne(e, t) {
2982
2996
  for (var i = 0; i < e.length; i++) t.writeSFixed32(e[i]);
2983
2997
  }
2984
- function Se(e, t) {
2998
+ function Ue(e, t) {
2985
2999
  for (var i = 0; i < e.length; i++) t.writeFixed64(e[i]);
2986
3000
  }
2987
- function Ve(e, t) {
3001
+ function Ie(e, t) {
2988
3002
  for (var i = 0; i < e.length; i++) t.writeSFixed64(e[i]);
2989
3003
  }
2990
3004
  function Y(e, t) {
2991
3005
  return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + e[t + 3] * 16777216;
2992
3006
  }
2993
- function $(e, t, i) {
3007
+ function A(e, t, i) {
2994
3008
  e[i] = t, e[i + 1] = t >>> 8, e[i + 2] = t >>> 16, e[i + 3] = t >>> 24;
2995
3009
  }
2996
- function F0(e, t) {
3010
+ function k0(e, t) {
2997
3011
  return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + (e[t + 3] << 24);
2998
3012
  }
2999
- function ze(e, t, i) {
3000
- for (var r = "", n = t; n < i; ) {
3001
- var o = e[n], s = null, c = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
3002
- if (n + c > i) break;
3003
- var f, l, a;
3004
- c === 1 ? o < 128 && (s = o) : c === 2 ? (f = e[n + 1], (f & 192) === 128 && (s = (o & 31) << 6 | f & 63, s <= 127 && (s = null))) : c === 3 ? (f = e[n + 1], l = e[n + 2], (f & 192) === 128 && (l & 192) === 128 && (s = (o & 15) << 12 | (f & 63) << 6 | l & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (f = e[n + 1], l = e[n + 2], a = e[n + 3], (f & 192) === 128 && (l & 192) === 128 && (a & 192) === 128 && (s = (o & 15) << 18 | (f & 63) << 12 | (l & 63) << 6 | a & 63, (s <= 65535 || s >= 1114112) && (s = null))), s === null ? (s = 65533, c = 1) : s > 65535 && (s -= 65536, r += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), r += String.fromCharCode(s), n += c;
3013
+ function Re(e, t, i) {
3014
+ for (var a = "", n = t; n < i; ) {
3015
+ var o = e[n], s = null, d = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
3016
+ if (n + d > i) break;
3017
+ var f, l, r;
3018
+ d === 1 ? o < 128 && (s = o) : d === 2 ? (f = e[n + 1], (f & 192) === 128 && (s = (o & 31) << 6 | f & 63, s <= 127 && (s = null))) : d === 3 ? (f = e[n + 1], l = e[n + 2], (f & 192) === 128 && (l & 192) === 128 && (s = (o & 15) << 12 | (f & 63) << 6 | l & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : d === 4 && (f = e[n + 1], l = e[n + 2], r = e[n + 3], (f & 192) === 128 && (l & 192) === 128 && (r & 192) === 128 && (s = (o & 15) << 18 | (f & 63) << 12 | (l & 63) << 6 | r & 63, (s <= 65535 || s >= 1114112) && (s = null))), s === null ? (s = 65533, d = 1) : s > 65535 && (s -= 65536, a += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), a += String.fromCharCode(s), n += d;
3005
3019
  }
3006
- return r;
3020
+ return a;
3007
3021
  }
3008
- function Te(e, t, i) {
3009
- return L0.decode(e.subarray(t, i));
3022
+ function Oe(e, t, i) {
3023
+ return P0.decode(e.subarray(t, i));
3010
3024
  }
3011
- function Ce(e, t, i) {
3012
- for (var r = 0, n, o; r < t.length; r++) {
3013
- if (n = t.charCodeAt(r), n > 55295 && n < 57344)
3025
+ function Ee(e, t, i) {
3026
+ for (var a = 0, n, o; a < t.length; a++) {
3027
+ if (n = t.charCodeAt(a), n > 55295 && n < 57344)
3014
3028
  if (o)
3015
3029
  if (n < 56320) {
3016
3030
  e[i++] = 239, e[i++] = 191, e[i++] = 189, o = n;
@@ -3018,7 +3032,7 @@ function Ce(e, t, i) {
3018
3032
  } else
3019
3033
  n = o - 55296 << 10 | n - 56320 | 65536, o = null;
3020
3034
  else {
3021
- n > 56319 || r + 1 === t.length ? (e[i++] = 239, e[i++] = 191, e[i++] = 189) : o = n;
3035
+ n > 56319 || a + 1 === t.length ? (e[i++] = 239, e[i++] = 191, e[i++] = 189) : o = n;
3022
3036
  continue;
3023
3037
  }
3024
3038
  else o && (e[i++] = 239, e[i++] = 191, e[i++] = 189, o = null);
@@ -3026,28 +3040,28 @@ function Ce(e, t, i) {
3026
3040
  }
3027
3041
  return i;
3028
3042
  }
3029
- const De = /* @__PURE__ */ w0(me), a1 = (e) => {
3030
- var r, n;
3043
+ const Ae = /* @__PURE__ */ M0(we), u1 = (e) => {
3044
+ var a, n;
3031
3045
  if (!e || !e.data)
3032
3046
  return {};
3033
3047
  const t = {}, i = e.data;
3034
3048
  if (i)
3035
3049
  for (const o of i) {
3036
- const s = (r = o == null ? void 0 : o.event) == null ? void 0 : r.country_code, c = (n = e.meta.metric_names) == null ? void 0 : n[0];
3037
- s && (t[s] = c ? o.event[c] : 0);
3050
+ const s = (a = o == null ? void 0 : o.event) == null ? void 0 : a.country_code, d = (n = e.meta.metric_names) == null ? void 0 : n[0];
3051
+ s && (t[s] = d ? o.event[d] : 0);
3038
3052
  }
3039
3053
  return t;
3040
3054
  };
3041
- function Ne(e, t = 0) {
3055
+ function $e(e, t = 0) {
3042
3056
  let i = null;
3043
- return (...r) => {
3044
- i && clearTimeout(i), i = setTimeout(() => e(...r), t);
3057
+ return (...a) => {
3058
+ i && clearTimeout(i), i = setTimeout(() => e(...a), t);
3045
3059
  };
3046
3060
  }
3047
- const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3061
+ const Ge = { class: "legend" }, qe = {
3048
3062
  key: 0,
3049
3063
  class: "legend-title"
3050
- }, Ee = { class: "legend-text" }, Ae = /* @__PURE__ */ s0({
3064
+ }, He = { class: "legend-text" }, Ke = /* @__PURE__ */ l0({
3051
3065
  __name: "MapLegend",
3052
3066
  props: {
3053
3067
  metric: {},
@@ -3055,26 +3069,26 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3055
3069
  data: {}
3056
3070
  },
3057
3071
  setup(e) {
3058
- return (t, i) => (k(), T("div", Oe, [
3059
- t.metric ? (k(), T("div", Re, U(t.title), 1)) : W("", !0),
3060
- (k(!0), T(C0, null, D0(t.data, (r, n) => (k(), T("div", {
3072
+ return (t, i) => (M(), T("div", Ge, [
3073
+ t.metric ? (M(), T("div", qe, I(t.title), 1)) : j("", !0),
3074
+ (M(!0), T(U0, null, I0(t.data, (a, n) => (M(), T("div", {
3061
3075
  key: n,
3062
3076
  class: "legend-item"
3063
3077
  }, [
3064
3078
  B("span", {
3065
3079
  class: "legend-color",
3066
- style: N0({ backgroundColor: r.color })
3080
+ style: R0({ backgroundColor: a.color })
3067
3081
  }, null, 4),
3068
- B("span", Ee, U(r.range), 1)
3082
+ B("span", He, I(a.range), 1)
3069
3083
  ]))), 128))
3070
3084
  ]));
3071
3085
  }
3072
- }), d0 = (e, t) => {
3086
+ }), f0 = (e, t) => {
3073
3087
  const i = e.__vccOpts || e;
3074
- for (const [r, n] of t)
3075
- i[r] = n;
3088
+ for (const [a, n] of t)
3089
+ i[a] = n;
3076
3090
  return i;
3077
- }, $e = /* @__PURE__ */ d0(Ae, [["__scopeId", "data-v-5f034736"]]), Ge = { class: "map-tooltip" }, qe = { class: "map-tooltip-text" }, He = { key: 0 }, Ke = /* @__PURE__ */ s0({
3091
+ }, je = /* @__PURE__ */ f0(Ke, [["__scopeId", "data-v-5f034736"]]), We = { class: "map-tooltip" }, Ze = { class: "map-tooltip-text" }, Je = { key: 0 }, Xe = /* @__PURE__ */ l0({
3078
3092
  __name: "MapTooltip",
3079
3093
  props: {
3080
3094
  data: {},
@@ -3083,22 +3097,22 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3083
3097
  left: {}
3084
3098
  },
3085
3099
  setup(e) {
3086
- return I0((t) => ({
3100
+ return O0((t) => ({
3087
3101
  "55ff282a": t.left,
3088
3102
  "23ce2e1e": t.top,
3089
3103
  "011f7503": t.data.color
3090
- })), (t, i) => (k(), T("div", Ge, [
3104
+ })), (t, i) => (M(), T("div", We, [
3091
3105
  i[0] || (i[0] = B("div", { class: "map-tooltip-color" }, null, -1)),
3092
- B("div", qe, [
3093
- B("div", null, U(t.data.label), 1),
3094
- t.showValue ? (k(), T("span", He, U(t.data.value) + " " + U(t.data.unit), 1)) : W("", !0)
3106
+ B("div", Ze, [
3107
+ B("div", null, I(t.data.label), 1),
3108
+ t.showValue ? (M(), T("span", Je, I(t.data.value) + " " + I(t.data.unit), 1)) : j("", !0)
3095
3109
  ])
3096
3110
  ]));
3097
3111
  }
3098
- }), je = /* @__PURE__ */ d0(Ke, [["__scopeId", "data-v-5e8af715"]]), We = { class: "kong-ui-public-analytics-geo-map" }, Ze = {
3112
+ }), Qe = /* @__PURE__ */ f0(Xe, [["__scopeId", "data-v-5e8af715"]]), Ye = { class: "kong-ui-public-analytics-geo-map" }, be = {
3099
3113
  key: 0,
3100
3114
  class: "no-location-overlay"
3101
- }, Je = { class: "no-location-overlay-title" }, Xe = { class: "no-location-overlay-description" }, Qe = ["id"], Ye = /* @__PURE__ */ s0({
3115
+ }, e1 = { class: "no-location-overlay-title" }, t1 = { class: "no-location-overlay-description" }, i1 = ["id"], n1 = /* @__PURE__ */ l0({
3102
3116
  __name: "AnalyticsGeoMap",
3103
3117
  props: {
3104
3118
  countryMetrics: {},
@@ -3113,10 +3127,10 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3113
3127
  },
3114
3128
  emits: ["boundsChange"],
3115
3129
  setup(e, { emit: t }) {
3116
- const i = import("./countries-simple-geo-BFUDnSiE.js").then((d) => d.default), r = t, { i18n: n } = y0.useI18n(), { getColor: o, formatMetric: s, legendData: c } = y0.useMetricUtils({
3117
- countryMetrics: p0(() => e.countryMetrics),
3118
- metric: p0(() => e.metric)
3119
- }), f = j(), l = U0(), a = j(), u = j(null), p = j({ left: "0px", top: "0px" }), m = j(!1), _ = L(() => Object.keys(e.countryMetrics).length === 0 && !e.fitToCountry), w = L(() => ({
3130
+ const i = import("./countries-simple-geo-BFUDnSiE.js").then((c) => c.default), a = t, { i18n: n } = v0.useI18n(), { getColor: o, formatMetric: s, legendData: d } = v0.useMetricUtils({
3131
+ countryMetrics: m0(() => e.countryMetrics),
3132
+ metric: m0(() => e.metric)
3133
+ }), f = K(), l = E0(), r = K(), u = K(null), p = K({ left: "0px", top: "0px" }), m = K(!1), k = w(() => Object.keys(e.countryMetrics).length === 0 && !e.fitToCountry), g = w(() => ({
3120
3134
  "fill-color": [
3121
3135
  "match",
3122
3136
  [
@@ -3129,39 +3143,39 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3129
3143
  ],
3130
3144
  ["get", "ISO_A2"]
3131
3145
  ],
3132
- ...Object.keys(e.countryMetrics).length ? Object.entries(e.countryMetrics).flatMap(([d, y]) => [
3133
- d,
3146
+ ...Object.keys(e.countryMetrics).length ? Object.entries(e.countryMetrics).flatMap(([c, y]) => [
3147
+ c,
3134
3148
  o(y)
3135
- ]) : ["#ccc", "#ccc"],
3136
- "#ccc"
3149
+ ]) : [W, W],
3150
+ W
3137
3151
  // default color if no match
3138
3152
  ],
3139
3153
  "fill-opacity": 0.7
3140
- })), O = L(() => e.withLegend && Object.keys(e.countryMetrics).length > 0), B0 = L(() => e.metric && n.t(`metrics.${e.metric}`) || ""), f0 = (d) => {
3141
- const y = d.flat(1);
3142
- return Array.isArray(y[0]) && Array.isArray(y[0][0]) ? f0(y) : y;
3143
- }, h0 = (d) => {
3144
- var x, v, q, R, D, H, K;
3145
- if (d === "RU") {
3146
- (x = a.value) == null || x.fitBounds([
3154
+ })), S0 = w(() => e.withLegend && Object.keys(e.countryMetrics).length > 0), V0 = w(() => e.metric && n.t(`metrics.${e.metric}`) || ""), h0 = (c) => {
3155
+ const y = c.flat(1);
3156
+ return Array.isArray(y[0]) && Array.isArray(y[0][0]) ? h0(y) : y;
3157
+ }, p0 = (c) => {
3158
+ var x, v, G, R, D, q, H;
3159
+ if (c === "RU") {
3160
+ (x = r.value) == null || x.fitBounds([
3147
3161
  [20, 40],
3148
3162
  [180, 80]
3149
3163
  ]);
3150
3164
  return;
3151
- } else if (d === "US") {
3152
- (v = a.value) == null || v.fitBounds([
3165
+ } else if (c === "US") {
3166
+ (v = r.value) == null || v.fitBounds([
3153
3167
  [-130, 20],
3154
3168
  [-60, 50]
3155
3169
  ]);
3156
3170
  return;
3157
- } else if (d === "FR") {
3158
- (q = a.value) == null || q.fitBounds([
3171
+ } else if (c === "FR") {
3172
+ (G = r.value) == null || G.fitBounds([
3159
3173
  [-5, 42],
3160
3174
  [9, 51]
3161
3175
  ]);
3162
3176
  return;
3163
- } else if (d === "NO") {
3164
- (R = a.value) == null || R.fitBounds([
3177
+ } else if (c === "NO") {
3178
+ (R = r.value) == null || R.fitBounds([
3165
3179
  [4, 57],
3166
3180
  [32, 71]
3167
3181
  ]);
@@ -3169,19 +3183,19 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3169
3183
  }
3170
3184
  const y = (D = u.value) == null ? void 0 : D.features.find((F) => {
3171
3185
  var P, S, V, N, z;
3172
- return (P = F.properties) != null && P.ISO_A2 ? ((S = F.properties) == null ? void 0 : S.ISO_A2) === d : ((V = F.properties) == null ? void 0 : V.iso_a2) === "-99" ? ((N = F.properties) == null ? void 0 : N.iso_a2_eh) === d : ((z = F.properties) == null ? void 0 : z.iso_a2) === d;
3186
+ return (P = F.properties) != null && P.ISO_A2 ? ((S = F.properties) == null ? void 0 : S.ISO_A2) === c : ((V = F.properties) == null ? void 0 : V.iso_a2) === "-99" ? ((N = F.properties) == null ? void 0 : N.iso_a2_eh) === c : ((z = F.properties) == null ? void 0 : z.iso_a2) === c;
3173
3187
  });
3174
3188
  if (y) {
3175
- const F = (H = y.geometry) == null ? void 0 : H.coordinates;
3189
+ const F = (q = y.geometry) == null ? void 0 : q.coordinates;
3176
3190
  if (!F) return;
3177
- const P = f0(F), S = P.map((E) => E[1]), V = P.map((E) => E[0]), N = Math.min(...S), z = Math.max(...S), J = Math.min(...V), X = Math.max(...V);
3178
- (K = a.value) == null || K.fitBounds([
3191
+ const P = h0(F), S = P.map((O) => O[1]), V = P.map((O) => O[0]), N = Math.min(...S), z = Math.max(...S), J = Math.min(...V), X = Math.max(...V);
3192
+ (H = r.value) == null || H.fitBounds([
3179
3193
  [J, N],
3180
3194
  [X, z]
3181
3195
  ]);
3182
3196
  }
3183
- }, C = L(() => {
3184
- const d = {
3197
+ }, C = w(() => {
3198
+ const c = {
3185
3199
  container: l,
3186
3200
  style: { version: 8, sources: {}, layers: [] },
3187
3201
  attributionControl: !1,
@@ -3198,46 +3212,46 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3198
3212
  "CooperativeGesturesHandler.MobileHelpText": n.t("cooperative_gestures.mobile_zoom_help_text")
3199
3213
  }
3200
3214
  };
3201
- return e.bounds && (d.bounds = e.bounds), d;
3202
- }), P0 = Ne(() => {
3203
- if (!a.value) return;
3204
- const d = a.value.getBounds(), y = d.getSouthWest(), x = d.getNorthEast();
3205
- r("boundsChange", [
3215
+ return e.bounds && (c.bounds = e.bounds), c;
3216
+ }), z0 = $e(() => {
3217
+ if (!r.value) return;
3218
+ const c = r.value.getBounds(), y = c.getSouthWest(), x = c.getNorthEast();
3219
+ a("boundsChange", [
3206
3220
  [y.lng, y.lat],
3207
3221
  [x.lng, x.lat]
3208
3222
  ]);
3209
3223
  }, 300);
3210
- return O0(async () => {
3211
- var d, y, x;
3224
+ return A0(async () => {
3225
+ var c, y, x;
3212
3226
  try {
3213
- const v = await i, q = await fetch(v), R = new Uint8Array(await q.arrayBuffer()), D = pe(new De(R));
3214
- u.value = D, a.value = new A0(C.value), a.value.on("load", () => {
3215
- var H, K, F, P, S, V, N;
3216
- (H = a.value) == null || H.addSource("countries", {
3227
+ const v = await i, G = await fetch(v), R = new Uint8Array(await G.arrayBuffer()), D = Fe(new Ae(R));
3228
+ u.value = D, r.value = new q0(C.value), r.value.on("load", () => {
3229
+ var q, H, F, P, S, V, N;
3230
+ (q = r.value) == null || q.addSource("countries", {
3217
3231
  type: "geojson",
3218
3232
  data: D
3219
- }), (K = a.value) == null || K.addLayer({
3233
+ }), (H = r.value) == null || H.addLayer({
3220
3234
  id: "countries-layer",
3221
3235
  type: "fill",
3222
3236
  source: "countries",
3223
- paint: w.value
3224
- }), (F = a.value) == null || F.addSource("lakes", {
3237
+ paint: g.value
3238
+ }), (F = r.value) == null || F.addSource("lakes", {
3225
3239
  type: "geojson",
3226
- data: ie
3227
- }), (P = a.value) == null || P.addLayer({
3240
+ data: ue
3241
+ }), (P = r.value) == null || P.addLayer({
3228
3242
  id: "lakes-layer",
3229
3243
  type: "fill",
3230
3244
  source: "lakes",
3231
3245
  paint: {
3232
3246
  "fill-color": "#FFFFFF"
3233
3247
  }
3234
- }), (S = a.value) == null || S.on("mousemove", "countries-layer", (z) => {
3248
+ }), (S = r.value) == null || S.on("mousemove", "countries-layer", (z) => {
3235
3249
  var X;
3236
3250
  const J = (X = z.features) == null ? void 0 : X[0];
3237
3251
  if (J) {
3238
- const { iso_a2: E, iso_a2_eh: S0, ISO_A2: V0, admin: z0 } = J.properties, T0 = V0 ?? E === "-99" ? S0 : E, n0 = e.countryMetrics[T0];
3252
+ const { iso_a2: O, iso_a2_eh: T0, ISO_A2: C0, admin: D0 } = J.properties, N0 = C0 ?? O === "-99" ? T0 : O, n0 = e.countryMetrics[N0];
3239
3253
  n0 !== void 0 && (f.value = {
3240
- label: z0,
3254
+ label: D0,
3241
3255
  color: o(n0),
3242
3256
  value: s(n0),
3243
3257
  unit: e.metricUnit
@@ -3246,21 +3260,21 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3246
3260
  top: `${z.point.y}px`
3247
3261
  });
3248
3262
  }
3249
- }), (V = a.value) == null || V.on("mouseleave", "countries-layer", () => {
3263
+ }), (V = r.value) == null || V.on("mouseleave", "countries-layer", () => {
3250
3264
  m.value = !1;
3251
- }), (N = a.value) == null || N.on("move", P0), e.fitToCountry && h0(e.fitToCountry);
3252
- }), (d = a.value) == null || d.dragRotate.disable(), (y = a.value) == null || y.keyboard.disable(), (x = a.value) == null || x.touchZoomRotate.disableRotation();
3265
+ }), (N = r.value) == null || N.on("move", z0), e.fitToCountry && p0(e.fitToCountry);
3266
+ }), (c = r.value) == null || c.dragRotate.disable(), (y = r.value) == null || y.keyboard.disable(), (x = r.value) == null || x.touchZoomRotate.disableRotation();
3253
3267
  } catch (v) {
3254
3268
  console.error(v);
3255
3269
  }
3256
3270
  }), a0(() => e.countryMetrics, () => {
3257
- var d;
3258
- a.value && a.value.isStyleLoaded() && (a.value.getLayer("countries-layer") && a.value.removeLayer("countries-layer"), a.value.addLayer({
3271
+ var c;
3272
+ r.value && r.value.isStyleLoaded() && (r.value.getLayer("countries-layer") && r.value.removeLayer("countries-layer"), r.value.addLayer({
3259
3273
  id: "countries-layer",
3260
3274
  type: "fill",
3261
3275
  source: "countries",
3262
- paint: w.value
3263
- }), a.value.removeLayer("lakes-layer"), (d = a.value) == null || d.addLayer({
3276
+ paint: g.value
3277
+ }), r.value.removeLayer("lakes-layer"), (c = r.value) == null || c.addLayer({
3264
3278
  id: "lakes-layer",
3265
3279
  type: "fill",
3266
3280
  source: "lakes",
@@ -3268,58 +3282,58 @@ const Ie = "#828a9e", Ue = "32px", Oe = { class: "legend" }, Re = {
3268
3282
  "fill-color": "#FFFFFF"
3269
3283
  }
3270
3284
  }));
3271
- }), a0(() => e.fitToCountry, (d) => {
3285
+ }), a0(() => e.fitToCountry, (c) => {
3272
3286
  var y, x, v;
3273
- a.value && d ? h0(d) : !C.value.center && !C.value.zoom ? (y = a.value) == null || y.fitBounds([
3287
+ r.value && c ? p0(c) : !C.value.center && !C.value.zoom ? (y = r.value) == null || y.fitBounds([
3274
3288
  [-180, -90],
3275
3289
  [180, 90]
3276
- ]) : (C.value.zoom && ((x = a.value) == null || x.setZoom(C.value.zoom)), C.value.center && ((v = a.value) == null || v.flyTo({ center: C.value.center })));
3277
- }), a0(() => e.bounds, (d, y) => {
3278
- if (!d) return;
3279
- const x = d == null ? void 0 : d.flat(), v = y == null ? void 0 : y.flat();
3280
- !(x && v && x.length === v.length && x.every((R, D) => Math.round(R * 100) / 100 === Math.round(v[D] * 100) / 100)) && a.value && a.value.fitBounds(d);
3281
- }), (d, y) => (k(), T("div", We, [
3282
- _.value ? (k(), T("div", Ze, [
3283
- r0(d.$slots, "no-location-icon", {}, () => [
3284
- R0(I(q0), {
3285
- color: I(Ie),
3286
- size: I(Ue)
3290
+ ]) : (C.value.zoom && ((x = r.value) == null || x.setZoom(C.value.zoom)), C.value.center && ((v = r.value) == null || v.flyTo({ center: C.value.center })));
3291
+ }), a0(() => e.bounds, (c, y) => {
3292
+ if (!c) return;
3293
+ const x = c == null ? void 0 : c.flat(), v = y == null ? void 0 : y.flat();
3294
+ !(x && v && x.length === v.length && x.every((R, D) => Math.round(R * 100) / 100 === Math.round(v[D] * 100) / 100)) && r.value && r.value.fitBounds(c);
3295
+ }), (c, y) => (M(), T("div", Ye, [
3296
+ k.value ? (M(), T("div", be, [
3297
+ r0(c.$slots, "no-location-icon", {}, () => [
3298
+ $0(U(j0), {
3299
+ color: U(ie),
3300
+ size: U(ne)
3287
3301
  }, null, 8, ["color", "size"])
3288
3302
  ], !0),
3289
- B("div", Je, [
3290
- r0(d.$slots, "no-location-title", {}, () => [
3291
- E0(U(I(n).t("no_location_data")), 1)
3303
+ B("div", e1, [
3304
+ r0(c.$slots, "no-location-title", {}, () => [
3305
+ G0(I(U(n).t("no_location_data")), 1)
3292
3306
  ], !0)
3293
3307
  ]),
3294
- B("div", Xe, [
3295
- r0(d.$slots, "no-location-description", {}, () => [
3296
- B("p", null, U(I(n).t("no_location_data_description")), 1)
3308
+ B("div", t1, [
3309
+ r0(c.$slots, "no-location-description", {}, () => [
3310
+ B("p", null, I(U(n).t("no_location_data_description")), 1)
3297
3311
  ], !0)
3298
3312
  ])
3299
- ])) : W("", !0),
3313
+ ])) : j("", !0),
3300
3314
  B("div", {
3301
- id: I(l),
3315
+ id: U(l),
3302
3316
  class: "analytics-geo-map-container"
3303
- }, null, 8, Qe),
3304
- O.value ? (k(), m0($e, {
3317
+ }, null, 8, i1),
3318
+ S0.value ? (M(), y0(je, {
3305
3319
  key: 1,
3306
3320
  class: "legend-container",
3307
- data: I(c),
3308
- metric: d.metric,
3309
- title: B0.value
3310
- }, null, 8, ["data", "metric", "title"])) : W("", !0),
3311
- m.value && f.value ? (k(), m0(je, {
3321
+ data: U(d),
3322
+ metric: c.metric,
3323
+ title: V0.value
3324
+ }, null, 8, ["data", "metric", "title"])) : j("", !0),
3325
+ m.value && f.value ? (M(), y0(Qe, {
3312
3326
  key: 2,
3313
3327
  data: f.value,
3314
3328
  left: p.value.left,
3315
- "show-value": d.showTooltipValue,
3329
+ "show-value": c.showTooltipValue,
3316
3330
  top: p.value.top
3317
- }, null, 8, ["data", "left", "show-value", "top"])) : W("", !0)
3331
+ }, null, 8, ["data", "left", "show-value", "top"])) : j("", !0)
3318
3332
  ]));
3319
3333
  }
3320
- }), r1 = /* @__PURE__ */ d0(Ye, [["__scopeId", "data-v-2d66a3eb"]]);
3334
+ }), c1 = /* @__PURE__ */ f0(n1, [["__scopeId", "data-v-ae0abcd8"]]);
3321
3335
  export {
3322
- r1 as AnalyticsGeoMap,
3323
- Ne as debounce,
3324
- a1 as exploreResultToCountryMetrics
3336
+ c1 as AnalyticsGeoMap,
3337
+ $e as debounce,
3338
+ u1 as exploreResultToCountryMetrics
3325
3339
  };