vue3-google-map 0.23.0 → 0.24.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.
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-e7ebb206]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-d099a3a6]{display:none}.mapdiv .custom-control-wrapper[data-v-d099a3a6]{display:inline-block}.info-window-wrapper[data-v-cbe1707b]{display:none}.mapdiv .info-window-wrapper[data-v-cbe1707b]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- var Ne = Object.defineProperty;
3
- var De = (n, e, t) => e in n ? Ne(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
- var oe = (n, e, t) => (De(n, typeof e != "symbol" ? e + "" : e, t), t);
5
- import { defineComponent as P, ref as v, provide as D, watch as S, onMounted as Ie, onBeforeUnmount as j, markRaw as x, toRef as $, openBlock as U, createElementBlock as V, createElementVNode as se, renderSlot as z, normalizeProps as Fe, guardReactiveProps as Ue, computed as G, Comment as ue, inject as C, Fragment as Ve, mergeProps as de, createCommentVNode as he } from "vue";
6
- const B = Symbol("map"), Z = Symbol("api"), pe = Symbol("marker"), fe = Symbol("markerCluster"), re = Symbol("CustomMarker"), Te = Symbol("mapTilesLoaded"), H = [
1
+ (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-289550ca]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-f0c09f6e]{display:none}.mapdiv .info-window-wrapper[data-v-f0c09f6e]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ var it = Object.defineProperty;
3
+ var at = (n, e, t) => e in n ? it(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
+ var pe = (n, e, t) => (at(n, typeof e != "symbol" ? e + "" : e, t), t);
5
+ import { defineComponent as P, ref as w, provide as G, watch as q, onMounted as Ye, onBeforeUnmount as B, markRaw as S, toRef as j, openBlock as V, createElementBlock as z, createElementVNode as le, renderSlot as W, normalizeProps as lt, guardReactiveProps as ut, computed as K, Comment as ye, inject as k, Fragment as ct, mergeProps as we, createCommentVNode as Ee } from "vue";
6
+ const D = Symbol("map"), Z = Symbol("api"), _e = Symbol("marker"), ke = Symbol("markerCluster"), ue = Symbol("CustomMarker"), Xe = Symbol("mapTilesLoaded"), H = [
7
7
  "click",
8
8
  "dblclick",
9
9
  "drag",
@@ -16,88 +16,81 @@ const B = Symbol("map"), Z = Symbol("api"), pe = Symbol("marker"), fe = Symbol("
16
16
  "mouseup",
17
17
  "rightclick"
18
18
  ];
19
- /*! *****************************************************************************
20
- Copyright (c) Microsoft Corporation.
21
-
22
- Permission to use, copy, modify, and/or distribute this software for any
23
- purpose with or without fee is hereby granted.
24
-
25
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
26
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
27
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
28
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
29
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
31
- PERFORMANCE OF THIS SOFTWARE.
32
- ***************************************************************************** */
33
- function ze(n, e, t, s) {
34
- function r(o) {
35
- return o instanceof t ? o : new t(function(a) {
36
- a(o);
19
+ function dt(n, e, t, r) {
20
+ function s(o) {
21
+ return o instanceof t ? o : new t(function(i) {
22
+ i(o);
37
23
  });
38
24
  }
39
- return new (t || (t = Promise))(function(o, a) {
40
- function l(u) {
25
+ return new (t || (t = Promise))(function(o, i) {
26
+ function l(d) {
41
27
  try {
42
- d(s.next(u));
43
- } catch (c) {
44
- a(c);
28
+ c(r.next(d));
29
+ } catch (u) {
30
+ i(u);
45
31
  }
46
32
  }
47
- function i(u) {
33
+ function a(d) {
48
34
  try {
49
- d(s.throw(u));
50
- } catch (c) {
51
- a(c);
35
+ c(r.throw(d));
36
+ } catch (u) {
37
+ i(u);
52
38
  }
53
39
  }
54
- function d(u) {
55
- u.done ? o(u.value) : r(u.value).then(l, i);
40
+ function c(d) {
41
+ d.done ? o(d.value) : s(d.value).then(l, a);
56
42
  }
57
- d((s = s.apply(n, e || [])).next());
43
+ c((r = r.apply(n, e || [])).next());
58
44
  });
59
45
  }
60
- var Ge = function n(e, t) {
61
- if (e === t)
62
- return !0;
63
- if (e && t && typeof e == "object" && typeof t == "object") {
64
- if (e.constructor !== t.constructor)
65
- return !1;
66
- var s, r, o;
67
- if (Array.isArray(e)) {
68
- if (s = e.length, s != t.length)
69
- return !1;
70
- for (r = s; r-- !== 0; )
71
- if (!n(e[r], t[r]))
72
- return !1;
46
+ function pt(n) {
47
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
48
+ }
49
+ var fe, Pe;
50
+ function ft() {
51
+ return Pe || (Pe = 1, fe = function n(e, t) {
52
+ if (e === t)
73
53
  return !0;
74
- }
75
- if (e.constructor === RegExp)
76
- return e.source === t.source && e.flags === t.flags;
77
- if (e.valueOf !== Object.prototype.valueOf)
78
- return e.valueOf() === t.valueOf();
79
- if (e.toString !== Object.prototype.toString)
80
- return e.toString() === t.toString();
81
- if (o = Object.keys(e), s = o.length, s !== Object.keys(t).length)
82
- return !1;
83
- for (r = s; r-- !== 0; )
84
- if (!Object.prototype.hasOwnProperty.call(t, o[r]))
54
+ if (e && t && typeof e == "object" && typeof t == "object") {
55
+ if (e.constructor !== t.constructor)
85
56
  return !1;
86
- for (r = s; r-- !== 0; ) {
87
- var a = o[r];
88
- if (!n(e[a], t[a]))
57
+ var r, s, o;
58
+ if (Array.isArray(e)) {
59
+ if (r = e.length, r != t.length)
60
+ return !1;
61
+ for (s = r; s-- !== 0; )
62
+ if (!n(e[s], t[s]))
63
+ return !1;
64
+ return !0;
65
+ }
66
+ if (e.constructor === RegExp)
67
+ return e.source === t.source && e.flags === t.flags;
68
+ if (e.valueOf !== Object.prototype.valueOf)
69
+ return e.valueOf() === t.valueOf();
70
+ if (e.toString !== Object.prototype.toString)
71
+ return e.toString() === t.toString();
72
+ if (o = Object.keys(e), r = o.length, r !== Object.keys(t).length)
89
73
  return !1;
74
+ for (s = r; s-- !== 0; )
75
+ if (!Object.prototype.hasOwnProperty.call(t, o[s]))
76
+ return !1;
77
+ for (s = r; s-- !== 0; ) {
78
+ var i = o[s];
79
+ if (!n(e[i], t[i]))
80
+ return !1;
81
+ }
82
+ return !0;
90
83
  }
91
- return !0;
92
- }
93
- return e !== e && t !== t;
94
- };
95
- const ye = "__googleMapsScriptId";
96
- var N;
84
+ return e !== e && t !== t;
85
+ }), fe;
86
+ }
87
+ var ht = ft(), mt = /* @__PURE__ */ pt(ht);
88
+ const qe = "__googleMapsScriptId";
89
+ var U;
97
90
  (function(n) {
98
91
  n[n.INITIALIZED = 0] = "INITIALIZED", n[n.LOADING = 1] = "LOADING", n[n.SUCCESS = 2] = "SUCCESS", n[n.FAILURE = 3] = "FAILURE";
99
- })(N || (N = {}));
100
- class q {
92
+ })(U || (U = {}));
93
+ class N {
101
94
  /**
102
95
  * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
103
96
  * using this library, instead the defaults are set by the Google Maps
@@ -107,13 +100,13 @@ class q {
107
100
  * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
108
101
  * ```
109
102
  */
110
- constructor({ apiKey: e, authReferrerPolicy: t, channel: s, client: r, id: o = ye, language: a, libraries: l = [], mapIds: i, nonce: d, region: u, retries: c = 3, url: h = "https://maps.googleapis.com/maps/api/js", version: p }) {
111
- if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = s, this.client = r, this.id = o || ye, this.language = a, this.libraries = l, this.mapIds = i, this.nonce = d, this.region = u, this.retries = c, this.url = h, this.version = p, q.instance) {
112
- if (!Ge(this.options, q.instance.options))
113
- throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(q.instance.options)}`);
114
- return q.instance;
103
+ constructor({ apiKey: e, authReferrerPolicy: t, channel: r, client: s, id: o = qe, language: i, libraries: l = [], mapIds: a, nonce: c, region: d, retries: u = 3, url: h = "https://maps.googleapis.com/maps/api/js", version: m }) {
104
+ if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = r, this.client = s, this.id = o || qe, this.language = i, this.libraries = l, this.mapIds = a, this.nonce = c, this.region = d, this.retries = u, this.url = h, this.version = m, N.instance) {
105
+ if (!mt(this.options, N.instance.options))
106
+ throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(N.instance.options)}`);
107
+ return N.instance;
115
108
  }
116
- q.instance = this;
109
+ N.instance = this;
117
110
  }
118
111
  get options() {
119
112
  return {
@@ -132,7 +125,7 @@ class q {
132
125
  };
133
126
  }
134
127
  get status() {
135
- return this.errors.length ? N.FAILURE : this.done ? N.SUCCESS : this.loading ? N.LOADING : N.INITIALIZED;
128
+ return this.errors.length ? U.FAILURE : this.done ? U.SUCCESS : this.loading ? U.LOADING : U.INITIALIZED;
136
129
  }
137
130
  get failed() {
138
131
  return this.done && !this.loading && this.errors.length >= this.retries + 1;
@@ -145,7 +138,7 @@ class q {
145
138
  */
146
139
  createUrl() {
147
140
  let e = this.url;
148
- return e += "?callback=__googleMapsCallback", this.apiKey && (e += `&key=${this.apiKey}`), this.channel && (e += `&channel=${this.channel}`), this.client && (e += `&client=${this.client}`), this.libraries.length > 0 && (e += `&libraries=${this.libraries.join(",")}`), this.language && (e += `&language=${this.language}`), this.region && (e += `&region=${this.region}`), this.version && (e += `&v=${this.version}`), this.mapIds && (e += `&map_ids=${this.mapIds.join(",")}`), this.authReferrerPolicy && (e += `&auth_referrer_policy=${this.authReferrerPolicy}`), e;
141
+ return e += "?callback=__googleMapsCallback&loading=async", this.apiKey && (e += `&key=${this.apiKey}`), this.channel && (e += `&channel=${this.channel}`), this.client && (e += `&client=${this.client}`), this.libraries.length > 0 && (e += `&libraries=${this.libraries.join(",")}`), this.language && (e += `&language=${this.language}`), this.region && (e += `&region=${this.region}`), this.version && (e += `&v=${this.version}`), this.mapIds && (e += `&map_ids=${this.mapIds.join(",")}`), this.authReferrerPolicy && (e += `&auth_referrer_policy=${this.authReferrerPolicy}`), e;
149
142
  }
150
143
  deleteScript() {
151
144
  const e = document.getElementById(this.id);
@@ -166,8 +159,8 @@ class q {
166
159
  */
167
160
  loadPromise() {
168
161
  return new Promise((e, t) => {
169
- this.loadCallback((s) => {
170
- s ? t(s.error) : e(window.google);
162
+ this.loadCallback((r) => {
163
+ r ? t(r.error) : e(window.google);
171
164
  });
172
165
  });
173
166
  }
@@ -190,7 +183,7 @@ class q {
190
183
  this.callback();
191
184
  return;
192
185
  }
193
- const s = {
186
+ const r = {
194
187
  key: this.apiKey,
195
188
  channel: this.channel,
196
189
  client: this.client,
@@ -201,28 +194,28 @@ class q {
201
194
  region: this.region,
202
195
  authReferrerPolicy: this.authReferrerPolicy
203
196
  };
204
- Object.keys(s).forEach(
197
+ Object.keys(r).forEach(
205
198
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
206
- (o) => !s[o] && delete s[o]
199
+ (o) => !r[o] && delete r[o]
207
200
  ), !((t = (e = window == null ? void 0 : window.google) === null || e === void 0 ? void 0 : e.maps) === null || t === void 0) && t.importLibrary || ((o) => {
208
- let a, l, i, d = "The Google Maps JavaScript API", u = "google", c = "importLibrary", h = "__ib__", p = document, f = window;
209
- f = f[u] || (f[u] = {});
210
- const m = f.maps || (f.maps = {}), g = /* @__PURE__ */ new Set(), y = new URLSearchParams(), _ = () => (
201
+ let i, l, a, c = "The Google Maps JavaScript API", d = "google", u = "importLibrary", h = "__ib__", m = document, p = window;
202
+ p = p[d] || (p[d] = {});
203
+ const f = p.maps || (p.maps = {}), g = /* @__PURE__ */ new Set(), v = new URLSearchParams(), E = () => (
211
204
  // @ts-ignore
212
- a || (a = new Promise((w, O) => ze(this, void 0, void 0, function* () {
213
- var b;
214
- yield l = p.createElement("script"), l.id = this.id, y.set("libraries", [...g] + "");
215
- for (i in o)
216
- y.set(i.replace(/[A-Z]/g, (E) => "_" + E[0].toLowerCase()), o[i]);
217
- y.set("callback", u + ".maps." + h), l.src = this.url + "?" + y, m[h] = w, l.onerror = () => a = O(Error(d + " could not load.")), l.nonce = this.nonce || ((b = p.querySelector("script[nonce]")) === null || b === void 0 ? void 0 : b.nonce) || "", p.head.append(l);
205
+ i || (i = new Promise((y, M) => dt(this, void 0, void 0, function* () {
206
+ var O;
207
+ yield l = m.createElement("script"), l.id = this.id, v.set("libraries", [...g] + "");
208
+ for (a in o)
209
+ v.set(a.replace(/[A-Z]/g, (b) => "_" + b[0].toLowerCase()), o[a]);
210
+ v.set("callback", d + ".maps." + h), l.src = this.url + "?" + v, f[h] = y, l.onerror = () => i = M(Error(c + " could not load.")), l.nonce = this.nonce || ((O = m.querySelector("script[nonce]")) === null || O === void 0 ? void 0 : O.nonce) || "", m.head.append(l);
218
211
  })))
219
212
  );
220
- m[c] ? console.warn(d + " only loads once. Ignoring:", o) : m[c] = (w, ...O) => g.add(w) && _().then(() => m[c](w, ...O));
221
- })(s);
222
- const r = this.libraries.map((o) => this.importLibrary(o));
223
- r.length || r.push(this.importLibrary("core")), Promise.all(r).then(() => this.callback(), (o) => {
224
- const a = new ErrorEvent("error", { error: o });
225
- this.loadErrorCallback(a);
213
+ f[u] ? console.warn(c + " only loads once. Ignoring:", o) : f[u] = (y, ...M) => g.add(y) && E().then(() => f[u](y, ...M));
214
+ })(r);
215
+ const s = this.libraries.map((o) => this.importLibrary(o));
216
+ s.length || s.push(this.importLibrary("core")), Promise.all(s).then(() => this.callback(), (o) => {
217
+ const i = new ErrorEvent("error", { error: o });
218
+ this.loadErrorCallback(i);
226
219
  });
227
220
  }
228
221
  /**
@@ -249,25 +242,26 @@ class q {
249
242
  }), this.callbacks = [];
250
243
  }
251
244
  execute() {
252
- if (this.resetIfRetryingFailed(), this.done)
253
- this.callback();
254
- else {
255
- if (window.google && window.google.maps && window.google.maps.version) {
256
- console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."), this.callback();
257
- return;
245
+ if (this.resetIfRetryingFailed(), !this.loading)
246
+ if (this.done)
247
+ this.callback();
248
+ else {
249
+ if (window.google && window.google.maps && window.google.maps.version) {
250
+ console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."), this.callback();
251
+ return;
252
+ }
253
+ this.loading = !0, this.setScript();
258
254
  }
259
- this.loading || (this.loading = !0, this.setScript());
260
- }
261
255
  }
262
256
  }
263
- function He(n) {
257
+ function gt(n) {
264
258
  return class extends n.OverlayView {
265
- constructor(s) {
259
+ constructor(r) {
266
260
  super();
267
- oe(this, "element");
268
- oe(this, "opts");
269
- const { element: r, ...o } = s;
270
- this.element = r, this.opts = o, this.opts.map && this.setMap(this.opts.map);
261
+ pe(this, "element");
262
+ pe(this, "opts");
263
+ const { element: s, ...o } = r;
264
+ this.element = s, this.opts = o, this.opts.map && this.setMap(this.opts.map);
271
265
  }
272
266
  getPosition() {
273
267
  return this.opts.position ? this.opts.position instanceof n.LatLng ? this.opts.position : new n.LatLng(this.opts.position) : null;
@@ -275,65 +269,65 @@ function He(n) {
275
269
  getVisible() {
276
270
  if (!this.element)
277
271
  return !1;
278
- const s = this.element;
279
- return s.style.display !== "none" && s.style.visibility !== "hidden" && (s.style.opacity === "" || Number(s.style.opacity) > 0.01);
272
+ const r = this.element;
273
+ return r.style.display !== "none" && r.style.visibility !== "hidden" && (r.style.opacity === "" || Number(r.style.opacity) > 0.01);
280
274
  }
281
275
  onAdd() {
282
276
  if (!this.element)
283
277
  return;
284
- const s = this.getPanes();
285
- s && s.overlayMouseTarget.appendChild(this.element);
278
+ const r = this.getPanes();
279
+ r && r.overlayMouseTarget.appendChild(this.element);
286
280
  }
287
281
  draw() {
288
282
  if (!this.element)
289
283
  return;
290
- const s = this.getProjection(), r = s == null ? void 0 : s.fromLatLngToDivPixel(this.getPosition());
291
- if (r) {
284
+ const r = this.getProjection(), s = r == null ? void 0 : r.fromLatLngToDivPixel(this.getPosition());
285
+ if (s) {
292
286
  this.element.style.position = "absolute";
293
- let o, a;
287
+ let o, i;
294
288
  switch (this.opts.anchorPoint) {
295
289
  case "TOP_CENTER":
296
- o = "-50%", a = "-100%";
290
+ o = "-50%", i = "-100%";
297
291
  break;
298
292
  case "BOTTOM_CENTER":
299
- o = "-50%", a = "0";
293
+ o = "-50%", i = "0";
300
294
  break;
301
295
  case "LEFT_CENTER":
302
- o = "-100%", a = "-50%";
296
+ o = "-100%", i = "-50%";
303
297
  break;
304
298
  case "RIGHT_CENTER":
305
- o = "0", a = "-50%";
299
+ o = "0", i = "-50%";
306
300
  break;
307
301
  case "TOP_LEFT":
308
- o = "-100%", a = "-100%";
302
+ o = "-100%", i = "-100%";
309
303
  break;
310
304
  case "TOP_RIGHT":
311
- o = "0", a = "-100%";
305
+ o = "0", i = "-100%";
312
306
  break;
313
307
  case "BOTTOM_LEFT":
314
- o = "-100%", a = "0";
308
+ o = "-100%", i = "0";
315
309
  break;
316
310
  case "BOTTOM_RIGHT":
317
- o = "0", a = "0";
311
+ o = "0", i = "0";
318
312
  break;
319
313
  default:
320
- o = "-50%", a = "-50%";
314
+ o = "-50%", i = "-50%";
321
315
  }
322
- const l = r.x + (this.opts.offsetX || 0) + "px", i = r.y + (this.opts.offsetY || 0) + "px";
323
- this.element.style.transform = `translateX(${o}) translateX(${l}) translateY(${a}) translateY(${i})`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
316
+ const l = s.x + (this.opts.offsetX || 0) + "px", a = s.y + (this.opts.offsetY || 0) + "px";
317
+ this.element.style.transform = `translateX(${o}) translateX(${l}) translateY(${i}) translateY(${a})`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
324
318
  }
325
319
  }
326
320
  onRemove() {
327
321
  this.element && this.element.remove();
328
322
  }
329
- setOptions(s) {
330
- const { element: r, ...o } = s;
331
- this.element = r, this.opts = o, this.draw();
323
+ setOptions(r) {
324
+ const { element: s, ...o } = r;
325
+ this.element = s, this.opts = o, this.draw();
332
326
  }
333
327
  };
334
328
  }
335
- let _e;
336
- const we = [
329
+ let Se;
330
+ const Ae = [
337
331
  "bounds_changed",
338
332
  "center_changed",
339
333
  "click",
@@ -356,7 +350,7 @@ const we = [
356
350
  "tilesloaded",
357
351
  "tilt_changed",
358
352
  "zoom_changed"
359
- ], We = P({
353
+ ], vt = P({
360
354
  props: {
361
355
  apiPromise: {
362
356
  type: Promise
@@ -566,105 +560,107 @@ const we = [
566
560
  default: ""
567
561
  }
568
562
  },
569
- emits: we,
563
+ emits: Ae,
570
564
  setup(n, { emit: e }) {
571
- const t = v(), s = v(!1), r = v(), o = v(), a = v(!1);
572
- D(B, r), D(Z, o), D(Te, a);
565
+ const t = w(), r = w(!1), s = w(), o = w(), i = w(!1);
566
+ G(D, s), G(Z, o), G(Xe, i);
573
567
  const l = () => {
574
- const c = { ...n };
575
- Object.keys(c).forEach((m) => {
576
- c[m] === void 0 && delete c[m];
568
+ const u = { ...n };
569
+ Object.keys(u).forEach((f) => {
570
+ u[f] === void 0 && delete u[f];
577
571
  });
578
- const p = (m) => {
572
+ const m = (f) => {
579
573
  var g;
580
- return m ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[m] } : {};
581
- }, f = {
574
+ return f ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[f] } : {};
575
+ }, p = {
582
576
  scaleControlOptions: n.scaleControlStyle ? { style: n.scaleControlStyle } : {},
583
- panControlOptions: p(n.panControlPosition),
584
- zoomControlOptions: p(n.zoomControlPosition),
585
- rotateControlOptions: p(n.rotateControlPosition),
586
- streetViewControlOptions: p(n.streetViewControlPosition),
587
- fullscreenControlOptions: p(n.fullscreenControlPosition),
588
- cameraControlOptions: p(n.cameraControlPosition),
577
+ panControlOptions: m(n.panControlPosition),
578
+ zoomControlOptions: m(n.zoomControlPosition),
579
+ rotateControlOptions: m(n.rotateControlPosition),
580
+ streetViewControlOptions: m(n.streetViewControlPosition),
581
+ fullscreenControlOptions: m(n.fullscreenControlPosition),
582
+ cameraControlOptions: m(n.cameraControlPosition),
589
583
  disableDefaultUI: n.disableDefaultUi
590
584
  };
591
- return { ...c, ...f };
592
- }, i = S(
593
- [o, r],
594
- ([c, h]) => {
595
- const p = c, f = h;
596
- p && f && (p.event.addListenerOnce(f, "tilesloaded", () => {
597
- a.value = !0;
598
- }), setTimeout(i, 0));
585
+ return { ...u, ...p };
586
+ }, a = q(
587
+ [o, s],
588
+ ([u, h]) => {
589
+ const m = u, p = h;
590
+ m && p && (m.event.addListenerOnce(p, "tilesloaded", () => {
591
+ i.value = !0;
592
+ }), setTimeout(a, 0));
599
593
  },
600
594
  { immediate: !0 }
601
- ), d = () => {
595
+ ), c = () => {
602
596
  try {
603
- const { apiKey: c, region: h, version: p, language: f, libraries: m, nonce: g } = n;
604
- _e = new q({ apiKey: c, region: h, version: p, language: f, libraries: m, nonce: g });
605
- } catch (c) {
606
- console.error(c);
597
+ const { apiKey: u, region: h, version: m, language: p, libraries: f, nonce: g } = n;
598
+ Se = new N({ apiKey: u, region: h, version: m, language: p, libraries: f, nonce: g });
599
+ } catch (u) {
600
+ console.error(u);
607
601
  }
608
- }, u = (c) => {
609
- o.value = x(c.maps), r.value = x(new c.maps.Map(t.value, l()));
610
- const h = He(o.value);
611
- o.value[re] = h, we.forEach((f) => {
612
- var m;
613
- (m = r.value) == null || m.addListener(f, (g) => e(f, g));
614
- }), s.value = !0;
615
- const p = Object.keys(n).filter(
616
- (f) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom", "nonce"].includes(f)
617
- ).map((f) => $(n, f));
618
- S(
619
- [() => n.center, () => n.zoom, ...p],
620
- ([f, m], [g, y]) => {
621
- var E, M, L;
622
- const { center: _, zoom: w, ...O } = l();
623
- (E = r.value) == null || E.setOptions(O), m !== void 0 && m !== y && ((M = r.value) == null || M.setZoom(m));
624
- const b = !g || f.lng !== g.lng || f.lat !== g.lat;
625
- f && b && ((L = r.value) == null || L.panTo(f));
602
+ }, d = (u) => {
603
+ o.value = S(u.maps), s.value = S(new u.maps.Map(t.value, l()));
604
+ const h = gt(o.value);
605
+ o.value[ue] = h, Ae.forEach((p) => {
606
+ var f;
607
+ (f = s.value) == null || f.addListener(p, (g) => e(p, g));
608
+ }), r.value = !0;
609
+ const m = Object.keys(n).filter(
610
+ (p) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom", "nonce"].includes(
611
+ p
612
+ )
613
+ ).map((p) => j(n, p));
614
+ q(
615
+ [() => n.center, () => n.zoom, ...m],
616
+ ([p, f], [g, v]) => {
617
+ var b, C, T;
618
+ const { center: E, zoom: y, ...M } = l();
619
+ (b = s.value) == null || b.setOptions(M), f !== void 0 && f !== v && ((C = s.value) == null || C.setZoom(f));
620
+ const O = !g || p.lng !== g.lng || p.lat !== g.lat;
621
+ p && O && ((T = s.value) == null || T.panTo(p));
626
622
  }
627
623
  );
628
624
  };
629
- return Ie(() => {
630
- n.apiPromise && n.apiPromise instanceof Promise ? n.apiPromise.then(u) : (d(), _e.load().then(u));
631
- }), j(() => {
632
- var c;
633
- a.value = !1, r.value && ((c = o.value) == null || c.event.clearInstanceListeners(r.value));
634
- }), { mapRef: t, ready: s, map: r, api: o, mapTilesLoaded: a };
625
+ return Ye(() => {
626
+ n.apiPromise && n.apiPromise instanceof Promise ? n.apiPromise.then(d) : (c(), Se.load().then(d));
627
+ }), B(() => {
628
+ var u;
629
+ i.value = !1, s.value && ((u = o.value) == null || u.event.clearInstanceListeners(s.value));
630
+ }), { mapRef: t, ready: r, map: s, api: o, mapTilesLoaded: i };
635
631
  }
636
632
  });
637
- const X = (n, e) => {
633
+ const re = (n, e) => {
638
634
  const t = n.__vccOpts || n;
639
- for (const [s, r] of e)
640
- t[s] = r;
635
+ for (const [r, s] of e)
636
+ t[r] = s;
641
637
  return t;
642
- }, Ke = {
638
+ }, yt = {
643
639
  ref: "mapRef",
644
640
  class: "mapdiv"
645
641
  };
646
- function Ye(n, e, t, s, r, o) {
647
- return U(), V("div", null, [
648
- se("div", Ke, null, 512),
649
- z(n.$slots, "default", Fe(Ue({ ready: n.ready, map: n.map, api: n.api, mapTilesLoaded: n.mapTilesLoaded })), void 0, !0)
642
+ function wt(n, e, t, r, s, o) {
643
+ return V(), z("div", null, [
644
+ le("div", yt, null, 512),
645
+ W(n.$slots, "default", lt(ut({ ready: n.ready, map: n.map, api: n.api, mapTilesLoaded: n.mapTilesLoaded })), void 0, !0)
650
646
  ]);
651
647
  }
652
- const It = /* @__PURE__ */ X(We, [["render", Ye], ["__scopeId", "data-v-e7ebb206"]]);
653
- function Je(n) {
648
+ const Ir = /* @__PURE__ */ re(vt, [["render", wt], ["__scopeId", "data-v-289550ca"]]);
649
+ function Et(n) {
654
650
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
655
651
  }
656
- var Xe = function n(e, t) {
652
+ var _t = function n(e, t) {
657
653
  if (e === t)
658
654
  return !0;
659
655
  if (e && t && typeof e == "object" && typeof t == "object") {
660
656
  if (e.constructor !== t.constructor)
661
657
  return !1;
662
- var s, r, o;
658
+ var r, s, o;
663
659
  if (Array.isArray(e)) {
664
- if (s = e.length, s != t.length)
660
+ if (r = e.length, r != t.length)
665
661
  return !1;
666
- for (r = s; r-- !== 0; )
667
- if (!n(e[r], t[r]))
662
+ for (s = r; s-- !== 0; )
663
+ if (!n(e[s], t[s]))
668
664
  return !1;
669
665
  return !0;
670
666
  }
@@ -674,21 +670,21 @@ var Xe = function n(e, t) {
674
670
  return e.valueOf() === t.valueOf();
675
671
  if (e.toString !== Object.prototype.toString)
676
672
  return e.toString() === t.toString();
677
- if (o = Object.keys(e), s = o.length, s !== Object.keys(t).length)
673
+ if (o = Object.keys(e), r = o.length, r !== Object.keys(t).length)
678
674
  return !1;
679
- for (r = s; r-- !== 0; )
680
- if (!Object.prototype.hasOwnProperty.call(t, o[r]))
675
+ for (s = r; s-- !== 0; )
676
+ if (!Object.prototype.hasOwnProperty.call(t, o[s]))
681
677
  return !1;
682
- for (r = s; r-- !== 0; ) {
683
- var a = o[r];
684
- if (!n(e[a], t[a]))
678
+ for (s = r; s-- !== 0; ) {
679
+ var i = o[s];
680
+ if (!n(e[i], t[i]))
685
681
  return !1;
686
682
  }
687
683
  return !0;
688
684
  }
689
685
  return e !== e && t !== t;
690
686
  };
691
- const A = /* @__PURE__ */ Je(Xe), ke = ["click", "drag", "dragend", "dragstart", "gmp-click"], Qe = P({
687
+ const ee = /* @__PURE__ */ Et(_t), Te = ["click", "drag", "dragend", "dragstart", "gmp-click"], kt = P({
692
688
  name: "AdvancedMarker",
693
689
  props: {
694
690
  options: {
@@ -700,88 +696,101 @@ const A = /* @__PURE__ */ Je(Xe), ke = ["click", "drag", "dragend", "dragstart",
700
696
  required: !1
701
697
  }
702
698
  },
703
- emits: ke,
704
- setup(n, { emit: e, expose: t, slots: s }) {
705
- const r = v(), o = G(() => {
706
- var p;
707
- return (p = s.content) == null ? void 0 : p.call(s).some((f) => f.type !== ue);
708
- }), a = $(n, "options"), l = $(n, "pinOptions"), i = v(), d = C(B, v()), u = C(Z, v()), c = C(fe, v()), h = G(
709
- () => !!(c.value && u.value && i.value instanceof google.maps.marker.AdvancedMarkerElement)
699
+ emits: Te,
700
+ setup(n, { emit: e, expose: t, slots: r }) {
701
+ const s = w(), o = K(() => {
702
+ var m;
703
+ return (m = r.content) == null ? void 0 : m.call(r).some((p) => p.type !== ye);
704
+ }), i = j(n, "options"), l = j(n, "pinOptions"), a = w(), c = k(D, w()), d = k(Z, w()), u = k(ke, w()), h = K(
705
+ () => !!(u.value && d.value && a.value instanceof google.maps.marker.AdvancedMarkerElement)
710
706
  );
711
- return S(
712
- [d, a, l],
713
- async (p, [f, m, g]) => {
714
- var b, E, M;
715
- const _ = !A(a.value, m) || !A(l.value, g) || d.value !== f;
716
- if (!d.value || !u.value || !_)
707
+ return q(
708
+ [c, i, l, s],
709
+ async (m, [p, f, g, v]) => {
710
+ var C, T, be;
711
+ const E = !ee(i.value, f) || !ee(l.value, g), y = s.value !== v, M = E || y || c.value !== p;
712
+ if (!c.value || !d.value || !M || o.value && !s.value)
717
713
  return;
718
- const { AdvancedMarkerElement: w, PinElement: O } = u.value.marker;
719
- if (i.value) {
720
- const { map: L, content: Q, ...ne } = a.value;
721
- Object.assign(i.value, {
722
- content: o.value ? r.value : l.value ? new O(l.value).element : Q,
723
- ...ne
724
- }), h.value && ((b = c.value) == null || b.removeMarker(i.value), (E = c.value) == null || E.addMarker(i.value));
714
+ const { AdvancedMarkerElement: O, PinElement: b } = d.value.marker;
715
+ if (a.value) {
716
+ const { map: ce, content: ne, ...de } = i.value;
717
+ Object.assign(a.value, {
718
+ content: o.value ? s.value : l.value ? new b(l.value).element : ne,
719
+ ...de
720
+ }), h.value && ((C = u.value) == null || C.removeMarker(a.value), (T = u.value) == null || T.addMarker(a.value));
725
721
  } else
726
- o.value ? a.value.content = r.value : l.value && (a.value.content = new O(l.value).element), i.value = x(new w(a.value)), h.value ? (M = c.value) == null || M.addMarker(i.value) : i.value.map = d.value, ke.forEach((L) => {
727
- var Q;
728
- (Q = i.value) == null || Q.addListener(L, (ne) => e(L, ne));
722
+ o.value ? i.value.content = s.value : l.value && (i.value.content = new b(l.value).element), a.value = S(new O(i.value)), h.value ? (be = u.value) == null || be.addMarker(a.value) : a.value.map = c.value, Te.forEach((ce) => {
723
+ var ne;
724
+ (ne = a.value) == null || ne.addListener(ce, (de) => e(ce, de));
729
725
  });
730
726
  },
731
727
  {
732
- immediate: !0
728
+ immediate: !0,
729
+ flush: "post"
730
+ // Ensure DOM updates happen before this watcher runs
733
731
  }
734
- ), j(() => {
735
- var p, f;
736
- i.value && ((p = u.value) == null || p.event.clearInstanceListeners(i.value), h.value ? (f = c.value) == null || f.removeMarker(i.value) : i.value.map = null);
737
- }), D(pe, i), t({ marker: i }), { hasCustomSlotContent: o, markerRef: r };
732
+ ), B(() => {
733
+ var m, p;
734
+ a.value && ((m = d.value) == null || m.event.clearInstanceListeners(a.value), h.value ? (p = u.value) == null || p.removeMarker(a.value) : a.value.map = null);
735
+ }), G(_e, a), t({ marker: a }), { hasCustomSlotContent: o, markerRef: s };
738
736
  }
739
737
  });
740
- const et = {
738
+ const Ct = {
741
739
  key: 0,
742
740
  class: "advanced-marker-wrapper"
743
741
  };
744
- function tt(n, e, t, s, r, o) {
745
- return U(), V(Ve, null, [
746
- n.hasCustomSlotContent ? (U(), V("div", et, [
747
- se("div", de({ ref: "markerRef" }, n.$attrs), [
748
- z(n.$slots, "content")
742
+ function Ot(n, e, t, r, s, o) {
743
+ return V(), z(ct, null, [
744
+ n.hasCustomSlotContent ? (V(), z("div", Ct, [
745
+ le("div", we({ ref: "markerRef" }, n.$attrs), [
746
+ W(n.$slots, "content")
749
747
  ], 16)
750
- ])) : he("", !0),
751
- z(n.$slots, "default")
748
+ ])) : Ee("", !0),
749
+ W(n.$slots, "default")
752
750
  ], 64);
753
751
  }
754
- const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker", rt = (n) => n === re, W = (n, e, t, s) => {
755
- const r = v(), o = C(B, v()), a = C(Z, v()), l = C(fe, v()), i = G(
756
- () => !!(l.value && a.value && (r.value instanceof a.value.Marker || r.value instanceof a.value[re]))
752
+ const jr = /* @__PURE__ */ re(kt, [["render", Ot]]), Le = (n) => n === "Marker", xe = (n) => n === ue, J = (n, e, t, r) => {
753
+ const s = w(), o = k(D, w()), i = k(Z, w()), l = k(ke, w()), a = K(
754
+ () => !!(l.value && i.value && (s.value instanceof i.value.Marker || s.value instanceof i.value[ue]))
757
755
  );
758
- return S(
756
+ return q(
759
757
  [o, t],
760
- (d, [u, c]) => {
761
- var p, f, m;
762
- const h = !A(t.value, c) || o.value !== u;
763
- !o.value || !a.value || !h || (r.value ? (r.value.setOptions(t.value), i.value && ((p = l.value) == null || p.removeMarker(r.value), (f = l.value) == null || f.addMarker(r.value))) : (st(n) ? r.value = x(
764
- new a.value[n](t.value)
765
- ) : rt(n) ? r.value = x(
766
- new a.value[n](t.value)
767
- ) : r.value = x(
768
- new a.value[n]({
769
- ...t.value,
770
- map: o.value
771
- })
772
- ), i.value ? (m = l.value) == null || m.addMarker(r.value) : r.value.setMap(o.value), e.forEach((g) => {
773
- var y;
774
- (y = r.value) == null || y.addListener(g, (_) => s(g, _));
775
- })));
758
+ (c, [d, u]) => {
759
+ var m, p, f;
760
+ const h = !ee(t.value, u) || o.value !== d;
761
+ if (!(!o.value || !i.value || !h))
762
+ if (s.value)
763
+ s.value.setOptions(t.value), a.value && ((m = l.value) == null || m.removeMarker(s.value), (p = l.value) == null || p.addMarker(s.value));
764
+ else {
765
+ if (Le(n))
766
+ s.value = S(
767
+ new i.value[n](t.value)
768
+ );
769
+ else if (xe(n)) {
770
+ const g = t.value;
771
+ g.element && (s.value = S(new i.value[n](g)));
772
+ } else
773
+ s.value = S(
774
+ new i.value[n]({
775
+ ...t.value,
776
+ map: o.value
777
+ })
778
+ );
779
+ s.value && (a.value ? (f = l.value) == null || f.addMarker(s.value) : (Le(n) || xe(n)) && s.value.setMap(o.value)), e.forEach((g) => {
780
+ var v;
781
+ (v = s.value) == null || v.addListener(g, (E) => r(g, E));
782
+ });
783
+ }
776
784
  },
777
785
  {
778
- immediate: !0
786
+ immediate: !0,
787
+ flush: "post"
779
788
  }
780
- ), j(() => {
781
- var d, u;
782
- r.value && ((d = a.value) == null || d.event.clearInstanceListeners(r.value), i.value ? (u = l.value) == null || u.removeMarker(r.value) : r.value.setMap(null));
783
- }), r;
784
- }, Ce = [
789
+ ), B(() => {
790
+ var c, d;
791
+ s.value && ((c = i.value) == null || c.event.clearInstanceListeners(s.value), a.value ? (d = l.value) == null || d.removeMarker(s.value) : s.value.setMap(null));
792
+ }), s;
793
+ }, Ie = [
785
794
  "animation_changed",
786
795
  "click",
787
796
  "dblclick",
@@ -798,14 +807,13 @@ const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker",
798
807
  "contextmenu",
799
808
  "cursor_changed",
800
809
  "flat_changed",
801
- "rightclick",
802
810
  "zindex_changed",
803
811
  "icon_changed",
804
812
  "position_changed",
805
813
  "shape_changed",
806
814
  "title_changed",
807
815
  "visible_changed"
808
- ], $t = P({
816
+ ], Rr = P({
809
817
  name: "Marker",
810
818
  props: {
811
819
  options: {
@@ -813,15 +821,15 @@ const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker",
813
821
  required: !0
814
822
  }
815
823
  },
816
- emits: Ce,
817
- setup(n, { emit: e, expose: t, slots: s }) {
818
- const r = $(n, "options"), o = W("Marker", Ce, r, e);
819
- return D(pe, o), t({ marker: o }), () => {
820
- var a;
821
- return (a = s.default) == null ? void 0 : a.call(s);
824
+ emits: Ie,
825
+ setup(n, { emit: e, expose: t, slots: r }) {
826
+ const s = j(n, "options"), o = J("Marker", Ie, s, e);
827
+ return G(_e, o), t({ marker: o }), () => {
828
+ var i;
829
+ return (i = r.default) == null ? void 0 : i.call(r);
822
830
  };
823
831
  }
824
- }), Rt = P({
832
+ }), $r = P({
825
833
  name: "Polyline",
826
834
  props: {
827
835
  options: {
@@ -831,11 +839,11 @@ const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker",
831
839
  },
832
840
  emits: H,
833
841
  setup(n, { emit: e }) {
834
- const t = $(n, "options");
835
- return { polyline: W("Polyline", H, t, e) };
842
+ const t = j(n, "options");
843
+ return { polyline: J("Polyline", H, t, e) };
836
844
  },
837
845
  render: () => null
838
- }), qt = P({
846
+ }), Nr = P({
839
847
  name: "Polygon",
840
848
  props: {
841
849
  options: {
@@ -845,11 +853,11 @@ const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker",
845
853
  },
846
854
  emits: H,
847
855
  setup(n, { emit: e }) {
848
- const t = $(n, "options");
849
- return { polygon: W("Polygon", H, t, e) };
856
+ const t = j(n, "options");
857
+ return { polygon: J("Polygon", H, t, e) };
850
858
  },
851
859
  render: () => null
852
- }), be = H.concat(["bounds_changed"]), jt = P({
860
+ }), je = H.concat(["bounds_changed"]), Br = P({
853
861
  name: "Rectangle",
854
862
  props: {
855
863
  options: {
@@ -857,13 +865,13 @@ const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker",
857
865
  required: !0
858
866
  }
859
867
  },
860
- emits: be,
868
+ emits: je,
861
869
  setup(n, { emit: e }) {
862
- const t = $(n, "options");
863
- return { rectangle: W("Rectangle", be, t, e) };
870
+ const t = j(n, "options");
871
+ return { rectangle: J("Rectangle", je, t, e) };
864
872
  },
865
873
  render: () => null
866
- }), Me = H.concat(["center_changed", "radius_changed"]), Bt = P({
874
+ }), Re = H.concat(["center_changed", "radius_changed"]), Dr = P({
867
875
  name: "Circle",
868
876
  props: {
869
877
  options: {
@@ -871,13 +879,13 @@ const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker",
871
879
  required: !0
872
880
  }
873
881
  },
874
- emits: Me,
882
+ emits: Re,
875
883
  setup(n, { emit: e }) {
876
- const t = $(n, "options");
877
- return { circle: W("Circle", Me, t, e) };
884
+ const t = j(n, "options");
885
+ return { circle: J("Circle", Re, t, e) };
878
886
  },
879
887
  render: () => null
880
- }), nt = P({
888
+ }), Mt = P({
881
889
  props: {
882
890
  position: {
883
891
  type: String,
@@ -890,49 +898,56 @@ const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker",
890
898
  },
891
899
  emits: ["content:loaded"],
892
900
  setup(n, { emit: e }) {
893
- const t = v(null), s = C(B, v()), r = C(Z, v()), o = C(Te, v(!1)), a = S(
894
- [o, r, t],
895
- ([d, u, c]) => {
896
- u && d && c && (l(n.position), e("content:loaded"), setTimeout(a, 0));
901
+ const t = w(null), r = k(D, w()), s = k(Z, w()), o = k(Xe, w(!1)), i = q(
902
+ [o, s, t],
903
+ ([c, d, u]) => {
904
+ d && c && u && (l(n.position), e("content:loaded"), setTimeout(i, 0));
897
905
  },
898
906
  { immediate: !0 }
899
- ), l = (d) => {
900
- if (s.value && r.value && t.value) {
901
- const u = r.value.ControlPosition[d];
902
- s.value.controls[u].push(t.value);
907
+ ), l = (c) => {
908
+ if (r.value && s.value && t.value) {
909
+ const d = s.value.ControlPosition[c];
910
+ t.value.index = n.index, r.value.controls[d].push(t.value);
903
911
  }
904
- }, i = (d) => {
905
- if (s.value && r.value) {
906
- let u = null;
907
- const c = r.value.ControlPosition[d];
908
- s.value.controls[c].forEach((h, p) => {
909
- h === t.value && (u = p);
910
- }), u !== null && s.value.controls[c].removeAt(u);
912
+ }, a = (c) => {
913
+ if (r.value && s.value) {
914
+ let d = null;
915
+ const u = s.value.ControlPosition[c];
916
+ r.value.controls[u].forEach((h, m) => {
917
+ h === t.value && (d = m);
918
+ }), d !== null && r.value.controls[u].removeAt(d);
911
919
  }
912
920
  };
913
- return j(() => i(n.position)), S(
921
+ return B(() => a(n.position)), q(
914
922
  () => n.position,
915
- (d, u) => {
916
- i(u), l(d);
923
+ (c, d) => {
924
+ a(d), l(c);
917
925
  }
918
- ), S(
926
+ ), q(
919
927
  () => n.index,
920
- (d) => {
921
- d && t.value && (t.value.index = n.index);
928
+ (c) => {
929
+ t.value && (t.value.index = c);
922
930
  }
923
931
  ), { controlRef: t };
924
932
  }
925
933
  });
926
- const ot = {
934
+ const bt = {
927
935
  ref: "controlRef",
928
936
  class: "custom-control-wrapper"
929
937
  };
930
- function it(n, e, t, s, r, o) {
931
- return U(), V("div", ot, [
932
- z(n.$slots, "default", {}, void 0, !0)
938
+ function Pt(n, e, t, r, s, o) {
939
+ return V(), z("div", bt, [
940
+ W(n.$slots, "default", {}, void 0, !0)
933
941
  ], 512);
934
942
  }
935
- const Zt = /* @__PURE__ */ X(nt, [["render", it], ["__scopeId", "data-v-d099a3a6"]]), Oe = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], at = P({
943
+ const Zr = /* @__PURE__ */ re(Mt, [["render", Pt], ["__scopeId", "data-v-ab9120cd"]]), $e = [
944
+ "closeclick",
945
+ "content_changed",
946
+ "domready",
947
+ "position_changed",
948
+ "visible",
949
+ "zindex_changed"
950
+ ], qt = P({
936
951
  inheritAttrs: !1,
937
952
  props: {
938
953
  options: {
@@ -943,68 +958,331 @@ const Zt = /* @__PURE__ */ X(nt, [["render", it], ["__scopeId", "data-v-d099a3a6
943
958
  type: Boolean
944
959
  }
945
960
  },
946
- emits: [...Oe, "update:modelValue"],
947
- setup(n, { slots: e, emit: t, expose: s }) {
948
- const r = v(), o = v(), a = C(B, v()), l = C(Z, v()), i = C(pe, v());
949
- let d, u = n.modelValue;
950
- const c = G(() => {
951
- var m;
952
- return (m = e.default) == null ? void 0 : m.call(e).some((g) => g.type !== ue);
953
- }), h = (m) => {
954
- u = m, t("update:modelValue", m);
955
- }, p = (m) => {
956
- r.value && (r.value.open({ map: a.value, anchor: i.value, ...m }), h(!0));
957
- }, f = () => {
958
- r.value && (r.value.close(), h(!1));
961
+ emits: [...$e, "update:modelValue"],
962
+ setup(n, { slots: e, emit: t, expose: r }) {
963
+ const s = w(), o = w(), i = k(D, w()), l = k(Z, w()), a = k(_e, w());
964
+ let c, d = n.modelValue;
965
+ const u = K(() => {
966
+ var f;
967
+ return (f = e.default) == null ? void 0 : f.call(e).some((g) => g.type !== ye);
968
+ }), h = (f) => {
969
+ d = f, t("update:modelValue", f);
970
+ }, m = (f) => {
971
+ s.value && (s.value.open({ map: i.value, anchor: a.value, ...f }), h(!0));
972
+ }, p = () => {
973
+ s.value && (s.value.close(), h(!1));
959
974
  };
960
- return Ie(() => {
961
- S(
962
- [a, () => n.options],
963
- ([m, g], [y, _]) => {
964
- var O;
965
- const w = !A(g, _) || a.value !== y;
966
- a.value && l.value && w && (r.value ? (r.value.setOptions({
975
+ return Ye(() => {
976
+ q(
977
+ [i, () => n.options],
978
+ ([f, g], [v, E]) => {
979
+ var M;
980
+ const y = !ee(g, E) || i.value !== v;
981
+ i.value && l.value && y && (s.value ? (s.value.setOptions({
967
982
  ...g,
968
- content: c.value ? o.value : g.content
969
- }), i.value || p()) : (r.value = x(
983
+ content: u.value ? o.value : g.content
984
+ }), a.value || m()) : (s.value = S(
970
985
  new l.value.InfoWindow({
971
986
  ...g,
972
- content: c.value ? o.value : g.content
987
+ content: u.value ? o.value : g.content
973
988
  })
974
- ), i.value && (d = i.value.addListener("click", () => {
975
- p();
976
- })), (!i.value || u) && p(), Oe.forEach((b) => {
977
- var E;
978
- (E = r.value) == null || E.addListener(b, (M) => t(b, M));
979
- }), (O = r.value) == null || O.addListener("closeclick", () => h(!1))));
989
+ ), a.value && (c = a.value.addListener("click", () => {
990
+ m();
991
+ })), (!a.value || d) && m(), $e.forEach((O) => {
992
+ var b;
993
+ (b = s.value) == null || b.addListener(O, (C) => t(O, C));
994
+ }), (M = s.value) == null || M.addListener("closeclick", () => h(!1))));
980
995
  },
981
996
  {
982
997
  immediate: !0
983
998
  }
984
- ), S(
999
+ ), q(
985
1000
  () => n.modelValue,
986
- (m) => {
987
- m !== u && (m ? p() : f());
1001
+ (f) => {
1002
+ f !== d && (f ? m() : p());
988
1003
  }
989
1004
  );
990
- }), j(() => {
991
- var m;
992
- d && d.remove(), r.value && ((m = l.value) == null || m.event.clearInstanceListeners(r.value), f());
993
- }), s({ infoWindow: r, open: p, close: f }), { infoWindow: r, infoWindowRef: o, hasSlotContent: c, open: p, close: f };
1005
+ }), B(() => {
1006
+ var f;
1007
+ c && c.remove(), s.value && ((f = l.value) == null || f.event.clearInstanceListeners(s.value), p());
1008
+ }), r({ infoWindow: s, open: m, close: p }), { infoWindow: s, infoWindowRef: o, hasSlotContent: u, open: m, close: p };
994
1009
  }
995
1010
  });
996
- const lt = {
1011
+ const St = {
997
1012
  key: 0,
998
1013
  class: "info-window-wrapper"
999
1014
  };
1000
- function ct(n, e, t, s, r, o) {
1001
- return n.hasSlotContent ? (U(), V("div", lt, [
1002
- se("div", de({ ref: "infoWindowRef" }, n.$attrs), [
1003
- z(n.$slots, "default", {}, void 0, !0)
1015
+ function At(n, e, t, r, s, o) {
1016
+ return n.hasSlotContent ? (V(), z("div", St, [
1017
+ le("div", we({ ref: "infoWindowRef" }, n.$attrs), [
1018
+ W(n.$slots, "default", {}, void 0, !0)
1004
1019
  ], 16)
1005
- ])) : he("", !0);
1020
+ ])) : Ee("", !0);
1021
+ }
1022
+ const Fr = /* @__PURE__ */ re(qt, [["render", At], ["__scopeId", "data-v-f0c09f6e"]]);
1023
+ var Tt = Object.getOwnPropertyNames, Lt = Object.getOwnPropertySymbols, xt = Object.prototype.hasOwnProperty;
1024
+ function Ne(n, e) {
1025
+ return function(r, s, o) {
1026
+ return n(r, s, o) && e(r, s, o);
1027
+ };
1028
+ }
1029
+ function se(n) {
1030
+ return function(t, r, s) {
1031
+ if (!t || !r || typeof t != "object" || typeof r != "object")
1032
+ return n(t, r, s);
1033
+ var o = s.cache, i = o.get(t), l = o.get(r);
1034
+ if (i && l)
1035
+ return i === r && l === t;
1036
+ o.set(t, r), o.set(r, t);
1037
+ var a = n(t, r, s);
1038
+ return o.delete(t), o.delete(r), a;
1039
+ };
1040
+ }
1041
+ function Be(n) {
1042
+ return Tt(n).concat(Lt(n));
1043
+ }
1044
+ var It = Object.hasOwn || function(n, e) {
1045
+ return xt.call(n, e);
1046
+ };
1047
+ function F(n, e) {
1048
+ return n === e || !n && !e && n !== n && e !== e;
1049
+ }
1050
+ var jt = "__v", Rt = "__o", $t = "_owner", De = Object.getOwnPropertyDescriptor, Ze = Object.keys;
1051
+ function Nt(n, e, t) {
1052
+ var r = n.length;
1053
+ if (e.length !== r)
1054
+ return !1;
1055
+ for (; r-- > 0; )
1056
+ if (!t.equals(n[r], e[r], r, r, n, e, t))
1057
+ return !1;
1058
+ return !0;
1059
+ }
1060
+ function Bt(n, e) {
1061
+ return F(n.getTime(), e.getTime());
1062
+ }
1063
+ function Dt(n, e) {
1064
+ return n.name === e.name && n.message === e.message && n.cause === e.cause && n.stack === e.stack;
1065
+ }
1066
+ function Zt(n, e) {
1067
+ return n === e;
1068
+ }
1069
+ function Fe(n, e, t) {
1070
+ var r = n.size;
1071
+ if (r !== e.size)
1072
+ return !1;
1073
+ if (!r)
1074
+ return !0;
1075
+ for (var s = new Array(r), o = n.entries(), i, l, a = 0; (i = o.next()) && !i.done; ) {
1076
+ for (var c = e.entries(), d = !1, u = 0; (l = c.next()) && !l.done; ) {
1077
+ if (s[u]) {
1078
+ u++;
1079
+ continue;
1080
+ }
1081
+ var h = i.value, m = l.value;
1082
+ if (t.equals(h[0], m[0], a, u, n, e, t) && t.equals(h[1], m[1], h[0], m[0], n, e, t)) {
1083
+ d = s[u] = !0;
1084
+ break;
1085
+ }
1086
+ u++;
1087
+ }
1088
+ if (!d)
1089
+ return !1;
1090
+ a++;
1091
+ }
1092
+ return !0;
1006
1093
  }
1007
- const Nt = /* @__PURE__ */ X(at, [["render", ct], ["__scopeId", "data-v-cbe1707b"]]), Ee = [
1094
+ var Ft = F;
1095
+ function Ut(n, e, t) {
1096
+ var r = Ze(n), s = r.length;
1097
+ if (Ze(e).length !== s)
1098
+ return !1;
1099
+ for (; s-- > 0; )
1100
+ if (!Qe(n, e, t, r[s]))
1101
+ return !1;
1102
+ return !0;
1103
+ }
1104
+ function Y(n, e, t) {
1105
+ var r = Be(n), s = r.length;
1106
+ if (Be(e).length !== s)
1107
+ return !1;
1108
+ for (var o, i, l; s-- > 0; )
1109
+ if (o = r[s], !Qe(n, e, t, o) || (i = De(n, o), l = De(e, o), (i || l) && (!i || !l || i.configurable !== l.configurable || i.enumerable !== l.enumerable || i.writable !== l.writable)))
1110
+ return !1;
1111
+ return !0;
1112
+ }
1113
+ function Gt(n, e) {
1114
+ return F(n.valueOf(), e.valueOf());
1115
+ }
1116
+ function Vt(n, e) {
1117
+ return n.source === e.source && n.flags === e.flags;
1118
+ }
1119
+ function Ue(n, e, t) {
1120
+ var r = n.size;
1121
+ if (r !== e.size)
1122
+ return !1;
1123
+ if (!r)
1124
+ return !0;
1125
+ for (var s = new Array(r), o = n.values(), i, l; (i = o.next()) && !i.done; ) {
1126
+ for (var a = e.values(), c = !1, d = 0; (l = a.next()) && !l.done; ) {
1127
+ if (!s[d] && t.equals(i.value, l.value, i.value, l.value, n, e, t)) {
1128
+ c = s[d] = !0;
1129
+ break;
1130
+ }
1131
+ d++;
1132
+ }
1133
+ if (!c)
1134
+ return !1;
1135
+ }
1136
+ return !0;
1137
+ }
1138
+ function zt(n, e) {
1139
+ var t = n.length;
1140
+ if (e.length !== t)
1141
+ return !1;
1142
+ for (; t-- > 0; )
1143
+ if (n[t] !== e[t])
1144
+ return !1;
1145
+ return !0;
1146
+ }
1147
+ function Wt(n, e) {
1148
+ return n.hostname === e.hostname && n.pathname === e.pathname && n.protocol === e.protocol && n.port === e.port && n.hash === e.hash && n.username === e.username && n.password === e.password;
1149
+ }
1150
+ function Qe(n, e, t, r) {
1151
+ return (r === $t || r === Rt || r === jt) && (n.$$typeof || e.$$typeof) ? !0 : It(e, r) && t.equals(n[r], e[r], r, r, n, e, t);
1152
+ }
1153
+ var Kt = "[object Arguments]", Ht = "[object Boolean]", Jt = "[object Date]", Yt = "[object Error]", Xt = "[object Map]", Qt = "[object Number]", er = "[object Object]", tr = "[object RegExp]", rr = "[object Set]", nr = "[object String]", sr = "[object URL]", or = Array.isArray, Ge = typeof ArrayBuffer == "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null, Ve = Object.assign, ir = Object.prototype.toString.call.bind(Object.prototype.toString);
1154
+ function ar(n) {
1155
+ var e = n.areArraysEqual, t = n.areDatesEqual, r = n.areErrorsEqual, s = n.areFunctionsEqual, o = n.areMapsEqual, i = n.areNumbersEqual, l = n.areObjectsEqual, a = n.arePrimitiveWrappersEqual, c = n.areRegExpsEqual, d = n.areSetsEqual, u = n.areTypedArraysEqual, h = n.areUrlsEqual;
1156
+ return function(p, f, g) {
1157
+ if (p === f)
1158
+ return !0;
1159
+ if (p == null || f == null)
1160
+ return !1;
1161
+ var v = typeof p;
1162
+ if (v !== typeof f)
1163
+ return !1;
1164
+ if (v !== "object")
1165
+ return v === "number" ? i(p, f, g) : v === "function" ? s(p, f, g) : !1;
1166
+ var E = p.constructor;
1167
+ if (E !== f.constructor)
1168
+ return !1;
1169
+ if (E === Object)
1170
+ return l(p, f, g);
1171
+ if (or(p))
1172
+ return e(p, f, g);
1173
+ if (Ge != null && Ge(p))
1174
+ return u(p, f, g);
1175
+ if (E === Date)
1176
+ return t(p, f, g);
1177
+ if (E === RegExp)
1178
+ return c(p, f, g);
1179
+ if (E === Map)
1180
+ return o(p, f, g);
1181
+ if (E === Set)
1182
+ return d(p, f, g);
1183
+ var y = ir(p);
1184
+ return y === Jt ? t(p, f, g) : y === tr ? c(p, f, g) : y === Xt ? o(p, f, g) : y === rr ? d(p, f, g) : y === er ? typeof p.then != "function" && typeof f.then != "function" && l(p, f, g) : y === sr ? h(p, f, g) : y === Yt ? r(p, f, g) : y === Kt ? l(p, f, g) : y === Ht || y === Qt || y === nr ? a(p, f, g) : !1;
1185
+ };
1186
+ }
1187
+ function lr(n) {
1188
+ var e = n.circular, t = n.createCustomConfig, r = n.strict, s = {
1189
+ areArraysEqual: r ? Y : Nt,
1190
+ areDatesEqual: Bt,
1191
+ areErrorsEqual: Dt,
1192
+ areFunctionsEqual: Zt,
1193
+ areMapsEqual: r ? Ne(Fe, Y) : Fe,
1194
+ areNumbersEqual: Ft,
1195
+ areObjectsEqual: r ? Y : Ut,
1196
+ arePrimitiveWrappersEqual: Gt,
1197
+ areRegExpsEqual: Vt,
1198
+ areSetsEqual: r ? Ne(Ue, Y) : Ue,
1199
+ areTypedArraysEqual: r ? Y : zt,
1200
+ areUrlsEqual: Wt
1201
+ };
1202
+ if (t && (s = Ve({}, s, t(s))), e) {
1203
+ var o = se(s.areArraysEqual), i = se(s.areMapsEqual), l = se(s.areObjectsEqual), a = se(s.areSetsEqual);
1204
+ s = Ve({}, s, {
1205
+ areArraysEqual: o,
1206
+ areMapsEqual: i,
1207
+ areObjectsEqual: l,
1208
+ areSetsEqual: a
1209
+ });
1210
+ }
1211
+ return s;
1212
+ }
1213
+ function ur(n) {
1214
+ return function(e, t, r, s, o, i, l) {
1215
+ return n(e, t, l);
1216
+ };
1217
+ }
1218
+ function cr(n) {
1219
+ var e = n.circular, t = n.comparator, r = n.createState, s = n.equals, o = n.strict;
1220
+ if (r)
1221
+ return function(a, c) {
1222
+ var d = r(), u = d.cache, h = u === void 0 ? e ? /* @__PURE__ */ new WeakMap() : void 0 : u, m = d.meta;
1223
+ return t(a, c, {
1224
+ cache: h,
1225
+ equals: s,
1226
+ meta: m,
1227
+ strict: o
1228
+ });
1229
+ };
1230
+ if (e)
1231
+ return function(a, c) {
1232
+ return t(a, c, {
1233
+ cache: /* @__PURE__ */ new WeakMap(),
1234
+ equals: s,
1235
+ meta: void 0,
1236
+ strict: o
1237
+ });
1238
+ };
1239
+ var i = {
1240
+ cache: void 0,
1241
+ equals: s,
1242
+ meta: void 0,
1243
+ strict: o
1244
+ };
1245
+ return function(a, c) {
1246
+ return t(a, c, i);
1247
+ };
1248
+ }
1249
+ var ae = R();
1250
+ R({ strict: !0 });
1251
+ R({ circular: !0 });
1252
+ R({
1253
+ circular: !0,
1254
+ strict: !0
1255
+ });
1256
+ R({
1257
+ createInternalComparator: function() {
1258
+ return F;
1259
+ }
1260
+ });
1261
+ R({
1262
+ strict: !0,
1263
+ createInternalComparator: function() {
1264
+ return F;
1265
+ }
1266
+ });
1267
+ R({
1268
+ circular: !0,
1269
+ createInternalComparator: function() {
1270
+ return F;
1271
+ }
1272
+ });
1273
+ R({
1274
+ circular: !0,
1275
+ createInternalComparator: function() {
1276
+ return F;
1277
+ },
1278
+ strict: !0
1279
+ });
1280
+ function R(n) {
1281
+ n === void 0 && (n = {});
1282
+ var e = n.circular, t = e === void 0 ? !1 : e, r = n.createInternalComparator, s = n.createState, o = n.strict, i = o === void 0 ? !1 : o, l = lr(n), a = ar(l), c = r ? r(a) : ur(a);
1283
+ return cr({ circular: t, comparator: a, createState: s, equals: c, strict: i });
1284
+ }
1285
+ const ze = [
1008
1286
  Int8Array,
1009
1287
  Uint8Array,
1010
1288
  Uint8ClampedArray,
@@ -1014,8 +1292,8 @@ const Nt = /* @__PURE__ */ X(at, [["render", ct], ["__scopeId", "data-v-cbe1707b
1014
1292
  Uint32Array,
1015
1293
  Float32Array,
1016
1294
  Float64Array
1017
- ], ie = 1, K = 8;
1018
- class me {
1295
+ ], he = 1, X = 8;
1296
+ class Ce {
1019
1297
  /**
1020
1298
  * Creates an index from raw `ArrayBuffer` data.
1021
1299
  * @param {ArrayBuffer} data
@@ -1023,17 +1301,17 @@ class me {
1023
1301
  static from(e) {
1024
1302
  if (!(e instanceof ArrayBuffer))
1025
1303
  throw new Error("Data must be an instance of ArrayBuffer.");
1026
- const [t, s] = new Uint8Array(e, 0, 2);
1304
+ const [t, r] = new Uint8Array(e, 0, 2);
1027
1305
  if (t !== 219)
1028
1306
  throw new Error("Data does not appear to be in a KDBush format.");
1029
- const r = s >> 4;
1030
- if (r !== ie)
1031
- throw new Error(`Got v${r} data when expected v${ie}.`);
1032
- const o = Ee[s & 15];
1307
+ const s = r >> 4;
1308
+ if (s !== he)
1309
+ throw new Error(`Got v${s} data when expected v${he}.`);
1310
+ const o = ze[r & 15];
1033
1311
  if (!o)
1034
1312
  throw new Error("Unrecognized array type.");
1035
- const [a] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
1036
- return new me(l, a, o, e);
1313
+ const [i] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
1314
+ return new Ce(l, i, o, e);
1037
1315
  }
1038
1316
  /**
1039
1317
  * Creates an index that will hold a given number of items.
@@ -1042,14 +1320,14 @@ class me {
1042
1320
  * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
1043
1321
  * @param {ArrayBuffer} [data] (For internal use only)
1044
1322
  */
1045
- constructor(e, t = 64, s = Float64Array, r) {
1323
+ constructor(e, t = 64, r = Float64Array, s) {
1046
1324
  if (isNaN(e) || e < 0)
1047
1325
  throw new Error(`Unpexpected numItems value: ${e}.`);
1048
- this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = s, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
1049
- const o = Ee.indexOf(this.ArrayType), a = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, l = e * this.IndexArrayType.BYTES_PER_ELEMENT, i = (8 - l % 8) % 8;
1326
+ this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = r, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
1327
+ const o = ze.indexOf(this.ArrayType), i = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, l = e * this.IndexArrayType.BYTES_PER_ELEMENT, a = (8 - l % 8) % 8;
1050
1328
  if (o < 0)
1051
- throw new Error(`Unexpected typed array class: ${s}.`);
1052
- r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data, K, e), this.coords = new this.ArrayType(this.data, K + l + i, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(K + a + l + i), this.ids = new this.IndexArrayType(this.data, K, e), this.coords = new this.ArrayType(this.data, K + l + i, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (ie << 4) + o]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
1329
+ throw new Error(`Unexpected typed array class: ${r}.`);
1330
+ s && s instanceof ArrayBuffer ? (this.data = s, this.ids = new this.IndexArrayType(this.data, X, e), this.coords = new this.ArrayType(this.data, X + l + a, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(X + i + l + a), this.ids = new this.IndexArrayType(this.data, X, e), this.coords = new this.ArrayType(this.data, X + l + a, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (he << 4) + o]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
1053
1331
  }
1054
1332
  /**
1055
1333
  * Add a point to the index.
@@ -1058,8 +1336,8 @@ class me {
1058
1336
  * @returns {number} An incremental index associated with the added item (starting from `0`).
1059
1337
  */
1060
1338
  add(e, t) {
1061
- const s = this._pos >> 1;
1062
- return this.ids[s] = s, this.coords[this._pos++] = e, this.coords[this._pos++] = t, s;
1339
+ const r = this._pos >> 1;
1340
+ return this.ids[r] = r, this.coords[this._pos++] = e, this.coords[this._pos++] = t, r;
1063
1341
  }
1064
1342
  /**
1065
1343
  * Perform indexing of the added points.
@@ -1068,7 +1346,7 @@ class me {
1068
1346
  const e = this._pos >> 1;
1069
1347
  if (e !== this.numItems)
1070
1348
  throw new Error(`Added ${e} items when expected ${this.numItems}.`);
1071
- return ce(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
1349
+ return ve(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
1072
1350
  }
1073
1351
  /**
1074
1352
  * Search the index for items within a given bounding box.
@@ -1078,23 +1356,23 @@ class me {
1078
1356
  * @param {number} maxY
1079
1357
  * @returns {number[]} An array of indices correponding to the found items.
1080
1358
  */
1081
- range(e, t, s, r) {
1359
+ range(e, t, r, s) {
1082
1360
  if (!this._finished)
1083
1361
  throw new Error("Data not yet indexed - call index.finish().");
1084
- const { ids: o, coords: a, nodeSize: l } = this, i = [0, o.length - 1, 0], d = [];
1085
- for (; i.length; ) {
1086
- const u = i.pop() || 0, c = i.pop() || 0, h = i.pop() || 0;
1087
- if (c - h <= l) {
1088
- for (let g = h; g <= c; g++) {
1089
- const y = a[2 * g], _ = a[2 * g + 1];
1090
- y >= e && y <= s && _ >= t && _ <= r && d.push(o[g]);
1362
+ const { ids: o, coords: i, nodeSize: l } = this, a = [0, o.length - 1, 0], c = [];
1363
+ for (; a.length; ) {
1364
+ const d = a.pop() || 0, u = a.pop() || 0, h = a.pop() || 0;
1365
+ if (u - h <= l) {
1366
+ for (let g = h; g <= u; g++) {
1367
+ const v = i[2 * g], E = i[2 * g + 1];
1368
+ v >= e && v <= r && E >= t && E <= s && c.push(o[g]);
1091
1369
  }
1092
1370
  continue;
1093
1371
  }
1094
- const p = h + c >> 1, f = a[2 * p], m = a[2 * p + 1];
1095
- f >= e && f <= s && m >= t && m <= r && d.push(o[p]), (u === 0 ? e <= f : t <= m) && (i.push(h), i.push(p - 1), i.push(1 - u)), (u === 0 ? s >= f : r >= m) && (i.push(p + 1), i.push(c), i.push(1 - u));
1372
+ const m = h + u >> 1, p = i[2 * m], f = i[2 * m + 1];
1373
+ p >= e && p <= r && f >= t && f <= s && c.push(o[m]), (d === 0 ? e <= p : t <= f) && (a.push(h), a.push(m - 1), a.push(1 - d)), (d === 0 ? r >= p : s >= f) && (a.push(m + 1), a.push(u), a.push(1 - d));
1096
1374
  }
1097
- return d;
1375
+ return c;
1098
1376
  }
1099
1377
  /**
1100
1378
  * Search the index for items within a given radius.
@@ -1103,58 +1381,58 @@ class me {
1103
1381
  * @param {number} r Query radius.
1104
1382
  * @returns {number[]} An array of indices correponding to the found items.
1105
1383
  */
1106
- within(e, t, s) {
1384
+ within(e, t, r) {
1107
1385
  if (!this._finished)
1108
1386
  throw new Error("Data not yet indexed - call index.finish().");
1109
- const { ids: r, coords: o, nodeSize: a } = this, l = [0, r.length - 1, 0], i = [], d = s * s;
1387
+ const { ids: s, coords: o, nodeSize: i } = this, l = [0, s.length - 1, 0], a = [], c = r * r;
1110
1388
  for (; l.length; ) {
1111
- const u = l.pop() || 0, c = l.pop() || 0, h = l.pop() || 0;
1112
- if (c - h <= a) {
1113
- for (let g = h; g <= c; g++)
1114
- Pe(o[2 * g], o[2 * g + 1], e, t) <= d && i.push(r[g]);
1389
+ const d = l.pop() || 0, u = l.pop() || 0, h = l.pop() || 0;
1390
+ if (u - h <= i) {
1391
+ for (let g = h; g <= u; g++)
1392
+ We(o[2 * g], o[2 * g + 1], e, t) <= c && a.push(s[g]);
1115
1393
  continue;
1116
1394
  }
1117
- const p = h + c >> 1, f = o[2 * p], m = o[2 * p + 1];
1118
- Pe(f, m, e, t) <= d && i.push(r[p]), (u === 0 ? e - s <= f : t - s <= m) && (l.push(h), l.push(p - 1), l.push(1 - u)), (u === 0 ? e + s >= f : t + s >= m) && (l.push(p + 1), l.push(c), l.push(1 - u));
1395
+ const m = h + u >> 1, p = o[2 * m], f = o[2 * m + 1];
1396
+ We(p, f, e, t) <= c && a.push(s[m]), (d === 0 ? e - r <= p : t - r <= f) && (l.push(h), l.push(m - 1), l.push(1 - d)), (d === 0 ? e + r >= p : t + r >= f) && (l.push(m + 1), l.push(u), l.push(1 - d));
1119
1397
  }
1120
- return i;
1398
+ return a;
1121
1399
  }
1122
1400
  }
1123
- function ce(n, e, t, s, r, o) {
1124
- if (r - s <= t)
1401
+ function ve(n, e, t, r, s, o) {
1402
+ if (s - r <= t)
1125
1403
  return;
1126
- const a = s + r >> 1;
1127
- $e(n, e, a, s, r, o), ce(n, e, t, s, a - 1, 1 - o), ce(n, e, t, a + 1, r, 1 - o);
1404
+ const i = r + s >> 1;
1405
+ et(n, e, i, r, s, o), ve(n, e, t, r, i - 1, 1 - o), ve(n, e, t, i + 1, s, 1 - o);
1128
1406
  }
1129
- function $e(n, e, t, s, r, o) {
1130
- for (; r > s; ) {
1131
- if (r - s > 600) {
1132
- const d = r - s + 1, u = t - s + 1, c = Math.log(d), h = 0.5 * Math.exp(2 * c / 3), p = 0.5 * Math.sqrt(c * h * (d - h) / d) * (u - d / 2 < 0 ? -1 : 1), f = Math.max(s, Math.floor(t - u * h / d + p)), m = Math.min(r, Math.floor(t + (d - u) * h / d + p));
1133
- $e(n, e, t, f, m, o);
1407
+ function et(n, e, t, r, s, o) {
1408
+ for (; s > r; ) {
1409
+ if (s - r > 600) {
1410
+ const c = s - r + 1, d = t - r + 1, u = Math.log(c), h = 0.5 * Math.exp(2 * u / 3), m = 0.5 * Math.sqrt(u * h * (c - h) / c) * (d - c / 2 < 0 ? -1 : 1), p = Math.max(r, Math.floor(t - d * h / c + m)), f = Math.min(s, Math.floor(t + (c - d) * h / c + m));
1411
+ et(n, e, t, p, f, o);
1134
1412
  }
1135
- const a = e[2 * t + o];
1136
- let l = s, i = r;
1137
- for (Y(n, e, s, t), e[2 * r + o] > a && Y(n, e, s, r); l < i; ) {
1138
- for (Y(n, e, l, i), l++, i--; e[2 * l + o] < a; )
1413
+ const i = e[2 * t + o];
1414
+ let l = r, a = s;
1415
+ for (Q(n, e, r, t), e[2 * s + o] > i && Q(n, e, r, s); l < a; ) {
1416
+ for (Q(n, e, l, a), l++, a--; e[2 * l + o] < i; )
1139
1417
  l++;
1140
- for (; e[2 * i + o] > a; )
1141
- i--;
1418
+ for (; e[2 * a + o] > i; )
1419
+ a--;
1142
1420
  }
1143
- e[2 * s + o] === a ? Y(n, e, s, i) : (i++, Y(n, e, i, r)), i <= t && (s = i + 1), t <= i && (r = i - 1);
1421
+ e[2 * r + o] === i ? Q(n, e, r, a) : (a++, Q(n, e, a, s)), a <= t && (r = a + 1), t <= a && (s = a - 1);
1144
1422
  }
1145
1423
  }
1146
- function Y(n, e, t, s) {
1147
- ae(n, t, s), ae(e, 2 * t, 2 * s), ae(e, 2 * t + 1, 2 * s + 1);
1424
+ function Q(n, e, t, r) {
1425
+ me(n, t, r), me(e, 2 * t, 2 * r), me(e, 2 * t + 1, 2 * r + 1);
1148
1426
  }
1149
- function ae(n, e, t) {
1150
- const s = n[e];
1151
- n[e] = n[t], n[t] = s;
1427
+ function me(n, e, t) {
1428
+ const r = n[e];
1429
+ n[e] = n[t], n[t] = r;
1152
1430
  }
1153
- function Pe(n, e, t, s) {
1154
- const r = n - t, o = e - s;
1155
- return r * r + o * o;
1431
+ function We(n, e, t, r) {
1432
+ const s = n - t, o = e - r;
1433
+ return s * s + o * o;
1156
1434
  }
1157
- const ut = {
1435
+ const dr = {
1158
1436
  minZoom: 0,
1159
1437
  // min zoom to generate clusters on
1160
1438
  maxZoom: 16,
@@ -1177,201 +1455,201 @@ const ut = {
1177
1455
  // properties to use for individual points when running the reducer
1178
1456
  map: (n) => n
1179
1457
  // props => ({sum: props.my_value})
1180
- }, Se = Math.fround || ((n) => (e) => (n[0] = +e, n[0]))(new Float32Array(1)), R = 2, T = 3, le = 4, I = 5, Re = 6;
1181
- class qe {
1458
+ }, Ke = Math.fround || ((n) => (e) => (n[0] = +e, n[0]))(new Float32Array(1)), $ = 2, x = 3, ge = 4, L = 5, tt = 6;
1459
+ class rt {
1182
1460
  constructor(e) {
1183
- this.options = Object.assign(Object.create(ut), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
1461
+ this.options = Object.assign(Object.create(dr), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
1184
1462
  }
1185
1463
  load(e) {
1186
- const { log: t, minZoom: s, maxZoom: r } = this.options;
1464
+ const { log: t, minZoom: r, maxZoom: s } = this.options;
1187
1465
  t && console.time("total time");
1188
1466
  const o = `prepare ${e.length} points`;
1189
1467
  t && console.time(o), this.points = e;
1190
- const a = [];
1191
- for (let i = 0; i < e.length; i++) {
1192
- const d = e[i];
1193
- if (!d.geometry)
1468
+ const i = [];
1469
+ for (let a = 0; a < e.length; a++) {
1470
+ const c = e[a];
1471
+ if (!c.geometry)
1194
1472
  continue;
1195
- const [u, c] = d.geometry.coordinates, h = Se(ee(u)), p = Se(te(c));
1196
- a.push(
1473
+ const [d, u] = c.geometry.coordinates, h = Ke(oe(d)), m = Ke(ie(u));
1474
+ i.push(
1197
1475
  h,
1198
- p,
1476
+ m,
1199
1477
  // projected point coordinates
1200
1478
  1 / 0,
1201
1479
  // the last zoom the point was processed at
1202
- i,
1480
+ a,
1203
1481
  // index of the source feature in the original input array
1204
1482
  -1,
1205
1483
  // parent cluster id
1206
1484
  1
1207
1485
  // number of points in a cluster
1208
- ), this.options.reduce && a.push(0);
1486
+ ), this.options.reduce && i.push(0);
1209
1487
  }
1210
- let l = this.trees[r + 1] = this._createTree(a);
1488
+ let l = this.trees[s + 1] = this._createTree(i);
1211
1489
  t && console.timeEnd(o);
1212
- for (let i = r; i >= s; i--) {
1213
- const d = +Date.now();
1214
- l = this.trees[i] = this._createTree(this._cluster(l, i)), t && console.log("z%d: %d clusters in %dms", i, l.numItems, +Date.now() - d);
1490
+ for (let a = s; a >= r; a--) {
1491
+ const c = +Date.now();
1492
+ l = this.trees[a] = this._createTree(this._cluster(l, a)), t && console.log("z%d: %d clusters in %dms", a, l.numItems, +Date.now() - c);
1215
1493
  }
1216
1494
  return t && console.timeEnd("total time"), this;
1217
1495
  }
1218
1496
  getClusters(e, t) {
1219
- let s = ((e[0] + 180) % 360 + 360) % 360 - 180;
1220
- const r = Math.max(-90, Math.min(90, e[1]));
1497
+ let r = ((e[0] + 180) % 360 + 360) % 360 - 180;
1498
+ const s = Math.max(-90, Math.min(90, e[1]));
1221
1499
  let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
1222
- const a = Math.max(-90, Math.min(90, e[3]));
1500
+ const i = Math.max(-90, Math.min(90, e[3]));
1223
1501
  if (e[2] - e[0] >= 360)
1224
- s = -180, o = 180;
1225
- else if (s > o) {
1226
- const c = this.getClusters([s, r, 180, a], t), h = this.getClusters([-180, r, o, a], t);
1227
- return c.concat(h);
1502
+ r = -180, o = 180;
1503
+ else if (r > o) {
1504
+ const u = this.getClusters([r, s, 180, i], t), h = this.getClusters([-180, s, o, i], t);
1505
+ return u.concat(h);
1228
1506
  }
1229
- const l = this.trees[this._limitZoom(t)], i = l.range(ee(s), te(a), ee(o), te(r)), d = l.data, u = [];
1230
- for (const c of i) {
1231
- const h = this.stride * c;
1232
- u.push(d[h + I] > 1 ? Le(d, h, this.clusterProps) : this.points[d[h + T]]);
1507
+ const l = this.trees[this._limitZoom(t)], a = l.range(oe(r), ie(i), oe(o), ie(s)), c = l.data, d = [];
1508
+ for (const u of a) {
1509
+ const h = this.stride * u;
1510
+ d.push(c[h + L] > 1 ? He(c, h, this.clusterProps) : this.points[c[h + x]]);
1233
1511
  }
1234
- return u;
1512
+ return d;
1235
1513
  }
1236
1514
  getChildren(e) {
1237
- const t = this._getOriginId(e), s = this._getOriginZoom(e), r = "No cluster with the specified id.", o = this.trees[s];
1515
+ const t = this._getOriginId(e), r = this._getOriginZoom(e), s = "No cluster with the specified id.", o = this.trees[r];
1238
1516
  if (!o)
1239
- throw new Error(r);
1240
- const a = o.data;
1241
- if (t * this.stride >= a.length)
1242
- throw new Error(r);
1243
- const l = this.options.radius / (this.options.extent * Math.pow(2, s - 1)), i = a[t * this.stride], d = a[t * this.stride + 1], u = o.within(i, d, l), c = [];
1244
- for (const h of u) {
1245
- const p = h * this.stride;
1246
- a[p + le] === e && c.push(a[p + I] > 1 ? Le(a, p, this.clusterProps) : this.points[a[p + T]]);
1517
+ throw new Error(s);
1518
+ const i = o.data;
1519
+ if (t * this.stride >= i.length)
1520
+ throw new Error(s);
1521
+ const l = this.options.radius / (this.options.extent * Math.pow(2, r - 1)), a = i[t * this.stride], c = i[t * this.stride + 1], d = o.within(a, c, l), u = [];
1522
+ for (const h of d) {
1523
+ const m = h * this.stride;
1524
+ i[m + ge] === e && u.push(i[m + L] > 1 ? He(i, m, this.clusterProps) : this.points[i[m + x]]);
1247
1525
  }
1248
- if (c.length === 0)
1249
- throw new Error(r);
1250
- return c;
1526
+ if (u.length === 0)
1527
+ throw new Error(s);
1528
+ return u;
1251
1529
  }
1252
- getLeaves(e, t, s) {
1253
- t = t || 10, s = s || 0;
1254
- const r = [];
1255
- return this._appendLeaves(r, e, t, s, 0), r;
1530
+ getLeaves(e, t, r) {
1531
+ t = t || 10, r = r || 0;
1532
+ const s = [];
1533
+ return this._appendLeaves(s, e, t, r, 0), s;
1256
1534
  }
1257
- getTile(e, t, s) {
1258
- const r = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: a, radius: l } = this.options, i = l / a, d = (s - i) / o, u = (s + 1 + i) / o, c = {
1535
+ getTile(e, t, r) {
1536
+ const s = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: i, radius: l } = this.options, a = l / i, c = (r - a) / o, d = (r + 1 + a) / o, u = {
1259
1537
  features: []
1260
1538
  };
1261
1539
  return this._addTileFeatures(
1262
- r.range((t - i) / o, d, (t + 1 + i) / o, u),
1263
- r.data,
1540
+ s.range((t - a) / o, c, (t + 1 + a) / o, d),
1541
+ s.data,
1264
1542
  t,
1265
- s,
1543
+ r,
1266
1544
  o,
1267
- c
1545
+ u
1268
1546
  ), t === 0 && this._addTileFeatures(
1269
- r.range(1 - i / o, d, 1, u),
1270
- r.data,
1547
+ s.range(1 - a / o, c, 1, d),
1548
+ s.data,
1271
1549
  o,
1272
- s,
1550
+ r,
1273
1551
  o,
1274
- c
1552
+ u
1275
1553
  ), t === o - 1 && this._addTileFeatures(
1276
- r.range(0, d, i / o, u),
1277
- r.data,
1554
+ s.range(0, c, a / o, d),
1555
+ s.data,
1278
1556
  -1,
1279
- s,
1557
+ r,
1280
1558
  o,
1281
- c
1282
- ), c.features.length ? c : null;
1559
+ u
1560
+ ), u.features.length ? u : null;
1283
1561
  }
1284
1562
  getClusterExpansionZoom(e) {
1285
1563
  let t = this._getOriginZoom(e) - 1;
1286
1564
  for (; t <= this.options.maxZoom; ) {
1287
- const s = this.getChildren(e);
1288
- if (t++, s.length !== 1)
1565
+ const r = this.getChildren(e);
1566
+ if (t++, r.length !== 1)
1289
1567
  break;
1290
- e = s[0].properties.cluster_id;
1568
+ e = r[0].properties.cluster_id;
1291
1569
  }
1292
1570
  return t;
1293
1571
  }
1294
- _appendLeaves(e, t, s, r, o) {
1295
- const a = this.getChildren(t);
1296
- for (const l of a) {
1297
- const i = l.properties;
1298
- if (i && i.cluster ? o + i.point_count <= r ? o += i.point_count : o = this._appendLeaves(e, i.cluster_id, s, r, o) : o < r ? o++ : e.push(l), e.length === s)
1572
+ _appendLeaves(e, t, r, s, o) {
1573
+ const i = this.getChildren(t);
1574
+ for (const l of i) {
1575
+ const a = l.properties;
1576
+ if (a && a.cluster ? o + a.point_count <= s ? o += a.point_count : o = this._appendLeaves(e, a.cluster_id, r, s, o) : o < s ? o++ : e.push(l), e.length === r)
1299
1577
  break;
1300
1578
  }
1301
1579
  return o;
1302
1580
  }
1303
1581
  _createTree(e) {
1304
- const t = new me(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
1305
- for (let s = 0; s < e.length; s += this.stride)
1306
- t.add(e[s], e[s + 1]);
1582
+ const t = new Ce(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
1583
+ for (let r = 0; r < e.length; r += this.stride)
1584
+ t.add(e[r], e[r + 1]);
1307
1585
  return t.finish(), t.data = e, t;
1308
1586
  }
1309
- _addTileFeatures(e, t, s, r, o, a) {
1587
+ _addTileFeatures(e, t, r, s, o, i) {
1310
1588
  for (const l of e) {
1311
- const i = l * this.stride, d = t[i + I] > 1;
1312
- let u, c, h;
1313
- if (d)
1314
- u = je(t, i, this.clusterProps), c = t[i], h = t[i + 1];
1589
+ const a = l * this.stride, c = t[a + L] > 1;
1590
+ let d, u, h;
1591
+ if (c)
1592
+ d = nt(t, a, this.clusterProps), u = t[a], h = t[a + 1];
1315
1593
  else {
1316
- const m = this.points[t[i + T]];
1317
- u = m.properties;
1318
- const [g, y] = m.geometry.coordinates;
1319
- c = ee(g), h = te(y);
1594
+ const f = this.points[t[a + x]];
1595
+ d = f.properties;
1596
+ const [g, v] = f.geometry.coordinates;
1597
+ u = oe(g), h = ie(v);
1320
1598
  }
1321
- const p = {
1599
+ const m = {
1322
1600
  type: 1,
1323
1601
  geometry: [[
1324
- Math.round(this.options.extent * (c * o - s)),
1325
- Math.round(this.options.extent * (h * o - r))
1602
+ Math.round(this.options.extent * (u * o - r)),
1603
+ Math.round(this.options.extent * (h * o - s))
1326
1604
  ]],
1327
- tags: u
1605
+ tags: d
1328
1606
  };
1329
- let f;
1330
- d || this.options.generateId ? f = t[i + T] : f = this.points[t[i + T]].id, f !== void 0 && (p.id = f), a.features.push(p);
1607
+ let p;
1608
+ c || this.options.generateId ? p = t[a + x] : p = this.points[t[a + x]].id, p !== void 0 && (m.id = p), i.features.push(m);
1331
1609
  }
1332
1610
  }
1333
1611
  _limitZoom(e) {
1334
1612
  return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
1335
1613
  }
1336
1614
  _cluster(e, t) {
1337
- const { radius: s, extent: r, reduce: o, minPoints: a } = this.options, l = s / (r * Math.pow(2, t)), i = e.data, d = [], u = this.stride;
1338
- for (let c = 0; c < i.length; c += u) {
1339
- if (i[c + R] <= t)
1615
+ const { radius: r, extent: s, reduce: o, minPoints: i } = this.options, l = r / (s * Math.pow(2, t)), a = e.data, c = [], d = this.stride;
1616
+ for (let u = 0; u < a.length; u += d) {
1617
+ if (a[u + $] <= t)
1340
1618
  continue;
1341
- i[c + R] = t;
1342
- const h = i[c], p = i[c + 1], f = e.within(i[c], i[c + 1], l), m = i[c + I];
1343
- let g = m;
1344
- for (const y of f) {
1345
- const _ = y * u;
1346
- i[_ + R] > t && (g += i[_ + I]);
1619
+ a[u + $] = t;
1620
+ const h = a[u], m = a[u + 1], p = e.within(a[u], a[u + 1], l), f = a[u + L];
1621
+ let g = f;
1622
+ for (const v of p) {
1623
+ const E = v * d;
1624
+ a[E + $] > t && (g += a[E + L]);
1347
1625
  }
1348
- if (g > m && g >= a) {
1349
- let y = h * m, _ = p * m, w, O = -1;
1350
- const b = ((c / u | 0) << 5) + (t + 1) + this.points.length;
1351
- for (const E of f) {
1352
- const M = E * u;
1353
- if (i[M + R] <= t)
1626
+ if (g > f && g >= i) {
1627
+ let v = h * f, E = m * f, y, M = -1;
1628
+ const O = ((u / d | 0) << 5) + (t + 1) + this.points.length;
1629
+ for (const b of p) {
1630
+ const C = b * d;
1631
+ if (a[C + $] <= t)
1354
1632
  continue;
1355
- i[M + R] = t;
1356
- const L = i[M + I];
1357
- y += i[M] * L, _ += i[M + 1] * L, i[M + le] = b, o && (w || (w = this._map(i, c, !0), O = this.clusterProps.length, this.clusterProps.push(w)), o(w, this._map(i, M)));
1633
+ a[C + $] = t;
1634
+ const T = a[C + L];
1635
+ v += a[C] * T, E += a[C + 1] * T, a[C + ge] = O, o && (y || (y = this._map(a, u, !0), M = this.clusterProps.length, this.clusterProps.push(y)), o(y, this._map(a, C)));
1358
1636
  }
1359
- i[c + le] = b, d.push(y / g, _ / g, 1 / 0, b, -1, g), o && d.push(O);
1637
+ a[u + ge] = O, c.push(v / g, E / g, 1 / 0, O, -1, g), o && c.push(M);
1360
1638
  } else {
1361
- for (let y = 0; y < u; y++)
1362
- d.push(i[c + y]);
1639
+ for (let v = 0; v < d; v++)
1640
+ c.push(a[u + v]);
1363
1641
  if (g > 1)
1364
- for (const y of f) {
1365
- const _ = y * u;
1366
- if (!(i[_ + R] <= t)) {
1367
- i[_ + R] = t;
1368
- for (let w = 0; w < u; w++)
1369
- d.push(i[_ + w]);
1642
+ for (const v of p) {
1643
+ const E = v * d;
1644
+ if (!(a[E + $] <= t)) {
1645
+ a[E + $] = t;
1646
+ for (let y = 0; y < d; y++)
1647
+ c.push(a[E + y]);
1370
1648
  }
1371
1649
  }
1372
1650
  }
1373
1651
  }
1374
- return d;
1652
+ return c;
1375
1653
  }
1376
1654
  // get index of the point from which the cluster originated
1377
1655
  _getOriginId(e) {
@@ -1381,73 +1659,59 @@ class qe {
1381
1659
  _getOriginZoom(e) {
1382
1660
  return (e - this.points.length) % 32;
1383
1661
  }
1384
- _map(e, t, s) {
1385
- if (e[t + I] > 1) {
1386
- const a = this.clusterProps[e[t + Re]];
1387
- return s ? Object.assign({}, a) : a;
1662
+ _map(e, t, r) {
1663
+ if (e[t + L] > 1) {
1664
+ const i = this.clusterProps[e[t + tt]];
1665
+ return r ? Object.assign({}, i) : i;
1388
1666
  }
1389
- const r = this.points[e[t + T]].properties, o = this.options.map(r);
1390
- return s && o === r ? Object.assign({}, o) : o;
1667
+ const s = this.points[e[t + x]].properties, o = this.options.map(s);
1668
+ return r && o === s ? Object.assign({}, o) : o;
1391
1669
  }
1392
1670
  }
1393
- function Le(n, e, t) {
1671
+ function He(n, e, t) {
1394
1672
  return {
1395
1673
  type: "Feature",
1396
- id: n[e + T],
1397
- properties: je(n, e, t),
1674
+ id: n[e + x],
1675
+ properties: nt(n, e, t),
1398
1676
  geometry: {
1399
1677
  type: "Point",
1400
- coordinates: [dt(n[e]), ht(n[e + 1])]
1678
+ coordinates: [pr(n[e]), fr(n[e + 1])]
1401
1679
  }
1402
1680
  };
1403
1681
  }
1404
- function je(n, e, t) {
1405
- const s = n[e + I], r = s >= 1e4 ? `${Math.round(s / 1e3)}k` : s >= 1e3 ? `${Math.round(s / 100) / 10}k` : s, o = n[e + Re], a = o === -1 ? {} : Object.assign({}, t[o]);
1406
- return Object.assign(a, {
1682
+ function nt(n, e, t) {
1683
+ const r = n[e + L], s = r >= 1e4 ? `${Math.round(r / 1e3)}k` : r >= 1e3 ? `${Math.round(r / 100) / 10}k` : r, o = n[e + tt], i = o === -1 ? {} : Object.assign({}, t[o]);
1684
+ return Object.assign(i, {
1407
1685
  cluster: !0,
1408
- cluster_id: n[e + T],
1409
- point_count: s,
1410
- point_count_abbreviated: r
1686
+ cluster_id: n[e + x],
1687
+ point_count: r,
1688
+ point_count_abbreviated: s
1411
1689
  });
1412
1690
  }
1413
- function ee(n) {
1691
+ function oe(n) {
1414
1692
  return n / 360 + 0.5;
1415
1693
  }
1416
- function te(n) {
1694
+ function ie(n) {
1417
1695
  const e = Math.sin(n * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
1418
1696
  return t < 0 ? 0 : t > 1 ? 1 : t;
1419
1697
  }
1420
- function dt(n) {
1698
+ function pr(n) {
1421
1699
  return (n - 0.5) * 360;
1422
1700
  }
1423
- function ht(n) {
1701
+ function fr(n) {
1424
1702
  const e = (180 - n * 360) * Math.PI / 180;
1425
1703
  return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
1426
1704
  }
1427
- /*! *****************************************************************************
1428
- Copyright (c) Microsoft Corporation.
1429
-
1430
- Permission to use, copy, modify, and/or distribute this software for any
1431
- purpose with or without fee is hereby granted.
1432
-
1433
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1434
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1435
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1436
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1437
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1438
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1439
- PERFORMANCE OF THIS SOFTWARE.
1440
- ***************************************************************************** */
1441
- function ge(n, e) {
1705
+ function Oe(n, e) {
1442
1706
  var t = {};
1443
- for (var s in n)
1444
- Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
1707
+ for (var r in n)
1708
+ Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
1445
1709
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
1446
- for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
1447
- e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
1710
+ for (var s = 0, r = Object.getOwnPropertySymbols(n); s < r.length; s++)
1711
+ e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (t[r[s]] = n[r[s]]);
1448
1712
  return t;
1449
1713
  }
1450
- class k {
1714
+ class _ {
1451
1715
  static isAdvancedMarkerAvailable(e) {
1452
1716
  return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
1453
1717
  }
@@ -1462,7 +1726,7 @@ class k {
1462
1726
  if (e.position) {
1463
1727
  if (e.position instanceof google.maps.LatLng)
1464
1728
  return e.position;
1465
- if (e.position.lat && e.position.lng)
1729
+ if (Number.isFinite(e.position.lat) && Number.isFinite(e.position.lng))
1466
1730
  return new google.maps.LatLng(e.position.lat, e.position.lng);
1467
1731
  }
1468
1732
  return new google.maps.LatLng(null);
@@ -1473,16 +1737,16 @@ class k {
1473
1737
  return this.isAdvancedMarker(e) ? !0 : e.getVisible();
1474
1738
  }
1475
1739
  }
1476
- class J {
1740
+ class te {
1477
1741
  constructor({ markers: e, position: t }) {
1478
- this.markers = e, t && (t instanceof google.maps.LatLng ? this._position = t : this._position = new google.maps.LatLng(t));
1742
+ this.markers = [], e && (this.markers = e), t && (t instanceof google.maps.LatLng ? this._position = t : this._position = new google.maps.LatLng(t));
1479
1743
  }
1480
1744
  get bounds() {
1481
1745
  if (this.markers.length === 0 && !this._position)
1482
1746
  return;
1483
1747
  const e = new google.maps.LatLngBounds(this._position, this._position);
1484
1748
  for (const t of this.markers)
1485
- e.extend(k.getPosition(t));
1749
+ e.extend(_.getPosition(t));
1486
1750
  return e;
1487
1751
  }
1488
1752
  get position() {
@@ -1492,7 +1756,7 @@ class J {
1492
1756
  * Get the count of **visible** markers.
1493
1757
  */
1494
1758
  get count() {
1495
- return this.markers.filter((e) => k.getVisible(e)).length;
1759
+ return this.markers.filter((e) => _.getVisible(e)).length;
1496
1760
  }
1497
1761
  /**
1498
1762
  * Add a marker to the cluster.
@@ -1504,26 +1768,32 @@ class J {
1504
1768
  * Cleanup references and remove marker from map.
1505
1769
  */
1506
1770
  delete() {
1507
- this.marker && (k.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
1771
+ this.marker && (_.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
1508
1772
  }
1509
1773
  }
1510
- const pt = (n, e, t, s) => {
1511
- const r = Be(n.getBounds(), e, s);
1512
- return t.filter((o) => r.contains(k.getPosition(o)));
1513
- }, Be = (n, e, t) => {
1514
- const { northEast: s, southWest: r } = ft(n, e), o = mt({ northEast: s, southWest: r }, t);
1515
- return gt(o, e);
1516
- }, xe = (n, e, t) => {
1517
- const s = Be(n, e, t), r = s.getNorthEast(), o = s.getSouthWest();
1518
- return [o.lng(), o.lat(), r.lng(), r.lat()];
1519
- }, ft = (n, e) => ({
1520
- northEast: e.fromLatLngToDivPixel(n.getNorthEast()),
1521
- southWest: e.fromLatLngToDivPixel(n.getSouthWest())
1522
- }), mt = ({ northEast: n, southWest: e }, t) => (n.x += t, n.y -= t, e.x -= t, e.y += t, { northEast: n, southWest: e }), gt = ({ northEast: n, southWest: e }, t) => {
1523
- const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(n);
1524
- return new google.maps.LatLngBounds(s, r);
1774
+ function A(n, e = "assertion failed") {
1775
+ if (n == null)
1776
+ throw Error(e);
1777
+ }
1778
+ const hr = (n, e, t, r) => {
1779
+ const s = n.getBounds();
1780
+ A(s);
1781
+ const o = st(s, e, r);
1782
+ return t.filter((i) => o.contains(_.getPosition(i)));
1783
+ }, st = (n, e, t) => {
1784
+ const { northEast: r, southWest: s } = gr(n, e), o = vr({ northEast: r, southWest: s }, t);
1785
+ return yr(o, e);
1786
+ }, mr = (n, e, t) => {
1787
+ const r = st(n, e, t), s = r.getNorthEast(), o = r.getSouthWest();
1788
+ return [o.lng(), o.lat(), s.lng(), s.lat()];
1789
+ }, gr = (n, e) => {
1790
+ const t = e.fromLatLngToDivPixel(n.getNorthEast()), r = e.fromLatLngToDivPixel(n.getSouthWest());
1791
+ return A(t), A(r), { northEast: t, southWest: r };
1792
+ }, vr = ({ northEast: n, southWest: e }, t) => (n.x += t, n.y -= t, e.x -= t, e.y += t, { northEast: n, southWest: e }), yr = ({ northEast: n, southWest: e }, t) => {
1793
+ const r = t.fromDivPixelToLatLng(e), s = t.fromDivPixelToLatLng(n);
1794
+ return new google.maps.LatLngBounds(r, s);
1525
1795
  };
1526
- class Ze {
1796
+ class ot {
1527
1797
  constructor({ maxZoom: e = 16 }) {
1528
1798
  this.maxZoom = e;
1529
1799
  }
@@ -1540,138 +1810,139 @@ class Ze {
1540
1810
  * ```
1541
1811
  */
1542
1812
  noop({ markers: e }) {
1543
- return yt(e);
1813
+ return Er(e);
1544
1814
  }
1545
1815
  }
1546
- class vt extends Ze {
1816
+ class wr extends ot {
1547
1817
  constructor(e) {
1548
- var { viewportPadding: t = 60 } = e, s = ge(e, ["viewportPadding"]);
1549
- super(s), this.viewportPadding = 60, this.viewportPadding = t;
1818
+ var { viewportPadding: t = 60 } = e, r = Oe(e, ["viewportPadding"]);
1819
+ super(r), this.viewportPadding = 60, this.viewportPadding = t;
1550
1820
  }
1551
- calculate({ markers: e, map: t, mapCanvasProjection: s }) {
1552
- return t.getZoom() >= this.maxZoom ? {
1821
+ calculate({ markers: e, map: t, mapCanvasProjection: r }) {
1822
+ const s = t.getZoom();
1823
+ return A(s), s >= this.maxZoom ? {
1553
1824
  clusters: this.noop({
1554
1825
  markers: e
1555
1826
  }),
1556
1827
  changed: !1
1557
1828
  } : {
1558
1829
  clusters: this.cluster({
1559
- markers: pt(t, s, e, this.viewportPadding),
1830
+ markers: hr(t, r, e, this.viewportPadding),
1560
1831
  map: t,
1561
- mapCanvasProjection: s
1832
+ mapCanvasProjection: r
1562
1833
  })
1563
1834
  };
1564
1835
  }
1565
1836
  }
1566
- const yt = (n) => n.map((t) => new J({
1567
- position: k.getPosition(t),
1837
+ const Er = (n) => n.map((t) => new te({
1838
+ position: _.getPosition(t),
1568
1839
  markers: [t]
1569
1840
  }));
1570
- class _t extends Ze {
1841
+ class _r extends ot {
1571
1842
  constructor(e) {
1572
- var { maxZoom: t, radius: s = 60 } = e, r = ge(e, ["maxZoom", "radius"]);
1573
- super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new qe(Object.assign({ maxZoom: this.maxZoom, radius: s }, r));
1843
+ var { maxZoom: t, radius: r = 60 } = e, s = Oe(e, ["maxZoom", "radius"]);
1844
+ super({ maxZoom: t }), this.markers = [], this.clusters = [], this.state = { zoom: -1 }, this.superCluster = new rt(Object.assign({ maxZoom: this.maxZoom, radius: r }, s));
1574
1845
  }
1575
1846
  calculate(e) {
1576
- let t = !1;
1577
- const s = { zoom: e.map.getZoom() };
1578
- if (!A(e.markers, this.markers)) {
1847
+ let t = !1, r = e.map.getZoom();
1848
+ A(r), r = Math.round(r);
1849
+ const s = { zoom: r };
1850
+ if (!ae(e.markers, this.markers)) {
1579
1851
  t = !0, this.markers = [...e.markers];
1580
- const r = this.markers.map((o) => {
1581
- const a = k.getPosition(o);
1852
+ const o = this.markers.map((i) => {
1853
+ const l = _.getPosition(i);
1582
1854
  return {
1583
1855
  type: "Feature",
1584
- geometry: {
1585
- type: "Point",
1586
- coordinates: [a.lng(), a.lat()]
1587
- },
1588
- properties: { marker: o }
1856
+ geometry: { type: "Point", coordinates: [l.lng(), l.lat()] },
1857
+ properties: { marker: i }
1589
1858
  };
1590
1859
  });
1591
- this.superCluster.load(r);
1860
+ this.superCluster.load(o);
1592
1861
  }
1593
- return t || (this.state.zoom <= this.maxZoom || s.zoom <= this.maxZoom) && (t = !A(this.state, s)), this.state = s, t && (this.clusters = this.cluster(e)), { clusters: this.clusters, changed: t };
1862
+ return t || (this.state.zoom <= this.maxZoom || s.zoom <= this.maxZoom) && (t = !ae(this.state, s)), this.state = s, e.markers.length === 0 ? (this.clusters = [], { clusters: this.clusters, changed: t }) : (t && (this.clusters = this.cluster(e)), { clusters: this.clusters, changed: t });
1594
1863
  }
1595
1864
  cluster({ map: e }) {
1596
- return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(e.getZoom())).map((t) => this.transformCluster(t));
1865
+ const t = e.getZoom();
1866
+ return A(t), this.superCluster.getClusters([-180, -90, 180, 90], Math.round(t)).map((r) => this.transformCluster(r));
1597
1867
  }
1598
- transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
1599
- if (s.cluster)
1600
- return new J({
1601
- markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
1868
+ transformCluster({ geometry: { coordinates: [e, t] }, properties: r }) {
1869
+ if (r.cluster)
1870
+ return new te({
1871
+ markers: this.superCluster.getLeaves(r.cluster_id, 1 / 0).map((o) => o.properties.marker),
1602
1872
  position: { lat: t, lng: e }
1603
1873
  });
1604
- const r = s.marker;
1605
- return new J({
1606
- markers: [r],
1607
- position: k.getPosition(r)
1874
+ const s = r.marker;
1875
+ return new te({
1876
+ markers: [s],
1877
+ position: _.getPosition(s)
1608
1878
  });
1609
1879
  }
1610
1880
  }
1611
- class wt extends vt {
1881
+ class kr extends wr {
1612
1882
  constructor(e) {
1613
- var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o = ge(e, ["maxZoom", "radius", "viewportPadding"]);
1614
- super({ maxZoom: t, viewportPadding: r }), this.superCluster = new qe(Object.assign({ maxZoom: this.maxZoom, radius: s }, o)), this.state = { zoom: -1, view: [0, 0, 0, 0] };
1883
+ var { maxZoom: t, radius: r = 60, viewportPadding: s = 60 } = e, o = Oe(e, ["maxZoom", "radius", "viewportPadding"]);
1884
+ super({ maxZoom: t, viewportPadding: s }), this.markers = [], this.clusters = [], this.superCluster = new rt(Object.assign({ maxZoom: this.maxZoom, radius: r }, o)), this.state = { zoom: -1, view: [0, 0, 0, 0] };
1615
1885
  }
1616
1886
  calculate(e) {
1617
- const t = {
1618
- zoom: Math.round(e.map.getZoom()),
1619
- view: xe(e.map.getBounds(), e.mapCanvasProjection, this.viewportPadding)
1620
- };
1621
- let s = !A(this.state, t);
1622
- if (!A(e.markers, this.markers)) {
1623
- s = !0, this.markers = [...e.markers];
1624
- const r = this.markers.map((o) => {
1625
- const a = k.getPosition(o);
1887
+ const t = this.getViewportState(e);
1888
+ let r = !ae(this.state, t);
1889
+ if (!ae(e.markers, this.markers)) {
1890
+ r = !0, this.markers = [...e.markers];
1891
+ const s = this.markers.map((o) => {
1892
+ const i = _.getPosition(o);
1626
1893
  return {
1627
1894
  type: "Feature",
1628
1895
  geometry: {
1629
1896
  type: "Point",
1630
- coordinates: [a.lng(), a.lat()]
1897
+ coordinates: [i.lng(), i.lat()]
1631
1898
  },
1632
1899
  properties: { marker: o }
1633
1900
  };
1634
1901
  });
1635
- this.superCluster.load(r);
1902
+ this.superCluster.load(s);
1636
1903
  }
1637
- return s && (this.clusters = this.cluster(e), this.state = t), { clusters: this.clusters, changed: s };
1904
+ return r && (this.clusters = this.cluster(e), this.state = t), { clusters: this.clusters, changed: r };
1638
1905
  }
1639
- cluster({ map: e, mapCanvasProjection: t }) {
1640
- const s = {
1641
- zoom: Math.round(e.getZoom()),
1642
- view: xe(e.getBounds(), t, this.viewportPadding)
1643
- };
1644
- return this.superCluster.getClusters(s.view, s.zoom).map((r) => this.transformCluster(r));
1906
+ cluster(e) {
1907
+ const t = this.getViewportState(e);
1908
+ return this.superCluster.getClusters(t.view, t.zoom).map((r) => this.transformCluster(r));
1645
1909
  }
1646
- transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
1647
- if (s.cluster)
1648
- return new J({
1649
- markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
1910
+ transformCluster({ geometry: { coordinates: [e, t] }, properties: r }) {
1911
+ if (r.cluster)
1912
+ return new te({
1913
+ markers: this.superCluster.getLeaves(r.cluster_id, 1 / 0).map((o) => o.properties.marker),
1650
1914
  position: { lat: t, lng: e }
1651
1915
  });
1652
- const r = s.marker;
1653
- return new J({
1654
- markers: [r],
1655
- position: k.getPosition(r)
1916
+ const s = r.marker;
1917
+ return new te({
1918
+ markers: [s],
1919
+ position: _.getPosition(s)
1656
1920
  });
1657
1921
  }
1922
+ getViewportState(e) {
1923
+ const t = e.map.getZoom(), r = e.map.getBounds();
1924
+ return A(t), A(r), {
1925
+ zoom: Math.round(t),
1926
+ view: mr(r, e.mapCanvasProjection, this.viewportPadding)
1927
+ };
1928
+ }
1658
1929
  }
1659
- class kt {
1930
+ class Cr {
1660
1931
  constructor(e, t) {
1661
1932
  this.markers = { sum: e.length };
1662
- const s = t.map((o) => o.count), r = s.reduce((o, a) => o + a, 0);
1933
+ const r = t.map((o) => o.count), s = r.reduce((o, i) => o + i, 0);
1663
1934
  this.clusters = {
1664
1935
  count: t.length,
1665
1936
  markers: {
1666
- mean: r / t.length,
1667
- sum: r,
1668
- min: Math.min(...s),
1669
- max: Math.max(...s)
1937
+ mean: s / t.length,
1938
+ sum: s,
1939
+ min: Math.min(...r),
1940
+ max: Math.max(...r)
1670
1941
  }
1671
1942
  };
1672
1943
  }
1673
1944
  }
1674
- class Ct {
1945
+ class Or {
1675
1946
  /**
1676
1947
  * The default render function for the library used by {@link MarkerClusterer}.
1677
1948
  *
@@ -1710,76 +1981,74 @@ class Ct {
1710
1981
  * });
1711
1982
  * ```
1712
1983
  */
1713
- render({ count: e, position: t }, s, r) {
1714
- const a = `<svg fill="${e > Math.max(10, s.clusters.markers.mean) ? "#ff0000" : "#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
1984
+ render({ count: e, position: t }, r, s) {
1985
+ const i = `<svg fill="${e > Math.max(10, r.clusters.markers.mean) ? "#ff0000" : "#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
1715
1986
  <circle cx="120" cy="120" opacity=".6" r="70" />
1716
1987
  <circle cx="120" cy="120" opacity=".3" r="90" />
1717
1988
  <circle cx="120" cy="120" opacity=".2" r="110" />
1718
1989
  <text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
1719
- </svg>`, l = `Cluster of ${e} markers`, i = Number(google.maps.Marker.MAX_ZINDEX) + e;
1720
- if (k.isAdvancedMarkerAvailable(r)) {
1721
- const u = document.createElement("div");
1722
- u.innerHTML = a;
1723
- const c = u.firstElementChild;
1724
- c.setAttribute("transform", "translate(0 25)");
1990
+ </svg>`, l = `Cluster of ${e} markers`, a = Number(google.maps.Marker.MAX_ZINDEX) + e;
1991
+ if (_.isAdvancedMarkerAvailable(s)) {
1992
+ const u = new DOMParser().parseFromString(i, "image/svg+xml").documentElement;
1993
+ u.setAttribute("transform", "translate(0 25)");
1725
1994
  const h = {
1726
- map: r,
1995
+ map: s,
1727
1996
  position: t,
1728
- zIndex: i,
1997
+ zIndex: a,
1729
1998
  title: l,
1730
- content: c
1999
+ content: u
1731
2000
  };
1732
2001
  return new google.maps.marker.AdvancedMarkerElement(h);
1733
2002
  }
1734
- const d = {
2003
+ const c = {
1735
2004
  position: t,
1736
- zIndex: i,
2005
+ zIndex: a,
1737
2006
  title: l,
1738
2007
  icon: {
1739
- url: `data:image/svg+xml;base64,${btoa(a)}`,
2008
+ url: `data:image/svg+xml;base64,${btoa(i)}`,
1740
2009
  anchor: new google.maps.Point(25, 25)
1741
2010
  }
1742
2011
  };
1743
- return new google.maps.Marker(d);
2012
+ return new google.maps.Marker(c);
1744
2013
  }
1745
2014
  }
1746
- function bt(n, e) {
2015
+ function Mr(n, e) {
1747
2016
  for (let t in e.prototype)
1748
2017
  n.prototype[t] = e.prototype[t];
1749
2018
  }
1750
- class ve {
2019
+ class Me {
1751
2020
  constructor() {
1752
- bt(ve, google.maps.OverlayView);
2021
+ Mr(Me, google.maps.OverlayView);
1753
2022
  }
1754
2023
  }
1755
- var F;
2024
+ var I;
1756
2025
  (function(n) {
1757
- n.CLUSTERING_BEGIN = "clusteringbegin", n.CLUSTERING_END = "clusteringend", n.CLUSTER_CLICK = "click";
1758
- })(F || (F = {}));
1759
- const Mt = (n, e, t) => {
1760
- t.fitBounds(e.bounds);
2026
+ n.CLUSTERING_BEGIN = "clusteringbegin", n.CLUSTERING_END = "clusteringend", n.CLUSTER_CLICK = "click", n.GMP_CLICK = "gmp-click";
2027
+ })(I || (I = {}));
2028
+ const br = (n, e, t) => {
2029
+ e.bounds && t.fitBounds(e.bounds);
1761
2030
  };
1762
- class Ot extends ve {
1763
- constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new _t(s), renderer: o = new Ct(), onClusterClick: a = Mt }) {
1764
- super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer = o, this.onClusterClick = a, e && this.setMap(e);
2031
+ class Pr extends Me {
2032
+ constructor({ map: e, markers: t = [], algorithmOptions: r = {}, algorithm: s = new _r(r), renderer: o = new Or(), onClusterClick: i = br }) {
2033
+ super(), this.map = null, this.idleListener = null, this.markers = [...t], this.clusters = [], this.algorithm = s, this.renderer = o, this.onClusterClick = i, e && this.setMap(e);
1765
2034
  }
1766
2035
  addMarker(e, t) {
1767
2036
  this.markers.includes(e) || (this.markers.push(e), t || this.render());
1768
2037
  }
1769
2038
  addMarkers(e, t) {
1770
- e.forEach((s) => {
1771
- this.addMarker(s, !0);
2039
+ e.forEach((r) => {
2040
+ this.addMarker(r, !0);
1772
2041
  }), t || this.render();
1773
2042
  }
1774
2043
  removeMarker(e, t) {
1775
- const s = this.markers.indexOf(e);
1776
- return s === -1 ? !1 : (k.setMap(e, null), this.markers.splice(s, 1), t || this.render(), !0);
2044
+ const r = this.markers.indexOf(e);
2045
+ return r === -1 ? !1 : (_.setMap(e, null), this.markers.splice(r, 1), t || this.render(), !0);
1777
2046
  }
1778
2047
  removeMarkers(e, t) {
1779
- let s = !1;
1780
- return e.forEach((r) => {
1781
- s = this.removeMarker(r, !0) || s;
1782
- }), s && !t && this.render(), s;
2048
+ let r = !1;
2049
+ return e.forEach((s) => {
2050
+ r = this.removeMarker(s, !0) || r;
2051
+ }), r && !t && this.render(), r;
1783
2052
  }
1784
2053
  clearMarkers(e) {
1785
2054
  this.markers.length = 0, e || this.render();
@@ -1790,47 +2059,54 @@ class Ot extends ve {
1790
2059
  render() {
1791
2060
  const e = this.getMap();
1792
2061
  if (e instanceof google.maps.Map && e.getProjection()) {
1793
- google.maps.event.trigger(this, F.CLUSTERING_BEGIN, this);
1794
- const { clusters: t, changed: s } = this.algorithm.calculate({
2062
+ google.maps.event.trigger(this, I.CLUSTERING_BEGIN, this);
2063
+ const { clusters: t, changed: r } = this.algorithm.calculate({
1795
2064
  markers: this.markers,
1796
2065
  map: e,
1797
2066
  mapCanvasProjection: this.getProjection()
1798
2067
  });
1799
- if (s || s == null) {
1800
- const r = /* @__PURE__ */ new Set();
1801
- for (const a of t)
1802
- a.markers.length == 1 && r.add(a.markers[0]);
2068
+ if (r || r == null) {
2069
+ const s = /* @__PURE__ */ new Set();
2070
+ for (const i of t)
2071
+ i.markers.length == 1 && s.add(i.markers[0]);
1803
2072
  const o = [];
1804
- for (const a of this.clusters)
1805
- a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) : o.push(a.marker));
1806
- this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((a) => k.setMap(a, null)));
2073
+ for (const i of this.clusters)
2074
+ i.marker != null && (i.markers.length == 1 ? s.has(i.marker) || _.setMap(i.marker, null) : o.push(i.marker));
2075
+ this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((i) => _.setMap(i, null)));
1807
2076
  }
1808
- google.maps.event.trigger(this, F.CLUSTERING_END, this);
2077
+ google.maps.event.trigger(this, I.CLUSTERING_END, this);
1809
2078
  }
1810
2079
  }
1811
2080
  onAdd() {
1812
- this.idleListener = this.getMap().addListener("idle", this.render.bind(this)), this.render();
2081
+ const e = this.getMap();
2082
+ A(e), this.idleListener = e.addListener("idle", this.render.bind(this)), this.render();
1813
2083
  }
1814
2084
  onRemove() {
1815
- google.maps.event.removeListener(this.idleListener), this.reset();
2085
+ this.idleListener && google.maps.event.removeListener(this.idleListener), this.reset();
1816
2086
  }
1817
2087
  reset() {
1818
- this.markers.forEach((e) => k.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
2088
+ this.markers.forEach((e) => _.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
1819
2089
  }
1820
2090
  renderClusters() {
1821
- const e = new kt(this.markers, this.clusters), t = this.getMap();
1822
- this.clusters.forEach((s) => {
1823
- s.markers.length === 1 ? s.marker = s.markers[0] : (s.marker = this.renderer.render(s, e, t), s.markers.forEach((r) => k.setMap(r, null)), this.onClusterClick && s.marker.addListener(
1824
- "click",
1825
- /* istanbul ignore next */
1826
- (r) => {
1827
- google.maps.event.trigger(this, F.CLUSTER_CLICK, s), this.onClusterClick(r, s, t);
1828
- }
1829
- )), k.setMap(s.marker, t);
2091
+ const e = new Cr(this.markers, this.clusters), t = this.getMap();
2092
+ this.clusters.forEach((r) => {
2093
+ if (r.markers.length === 1)
2094
+ r.marker = r.markers[0];
2095
+ else if (r.marker = this.renderer.render(r, e, t), r.markers.forEach((s) => _.setMap(s, null)), this.onClusterClick) {
2096
+ const s = _.isAdvancedMarker(r.marker) ? I.GMP_CLICK : I.CLUSTER_CLICK;
2097
+ r.marker.addListener(
2098
+ s,
2099
+ /* istanbul ignore next */
2100
+ (o) => {
2101
+ google.maps.event.trigger(this, I.CLUSTER_CLICK, r), this.onClusterClick(o, r, t);
2102
+ }
2103
+ );
2104
+ }
2105
+ _.setMap(r.marker, t);
1830
2106
  });
1831
2107
  }
1832
2108
  }
1833
- const Ae = Object.values(F), Dt = P({
2109
+ const Je = Object.values(I), Ur = P({
1834
2110
  name: "MarkerCluster",
1835
2111
  props: {
1836
2112
  options: {
@@ -1838,37 +2114,37 @@ const Ae = Object.values(F), Dt = P({
1838
2114
  default: () => ({})
1839
2115
  }
1840
2116
  },
1841
- emits: Ae,
1842
- setup(n, { emit: e, expose: t, slots: s }) {
1843
- const r = v(), o = C(B, v()), a = C(Z, v());
1844
- return D(fe, r), S(
2117
+ emits: Je,
2118
+ setup(n, { emit: e, expose: t, slots: r }) {
2119
+ const s = w(), o = k(D, w()), i = k(Z, w());
2120
+ return G(ke, s), q(
1845
2121
  o,
1846
2122
  () => {
1847
- o.value && (r.value = x(
1848
- new Ot({
2123
+ o.value && (s.value = S(
2124
+ new Pr({
1849
2125
  map: o.value,
1850
2126
  // Better perf than the default `SuperClusterAlgorithm`. See:
1851
2127
  // https://github.com/googlemaps/js-markerclusterer/pull/640
1852
- algorithm: new wt(n.options.algorithmOptions ?? {}),
2128
+ algorithm: new kr(n.options.algorithmOptions ?? {}),
1853
2129
  ...n.options
1854
2130
  })
1855
- ), Ae.forEach((l) => {
1856
- var i;
1857
- (i = r.value) == null || i.addListener(l, (d) => e(l, d));
2131
+ ), Je.forEach((l) => {
2132
+ var a;
2133
+ (a = s.value) == null || a.addListener(l, (c) => e(l, c));
1858
2134
  }));
1859
2135
  },
1860
2136
  {
1861
2137
  immediate: !0
1862
2138
  }
1863
- ), j(() => {
2139
+ ), B(() => {
1864
2140
  var l;
1865
- r.value && ((l = a.value) == null || l.event.clearInstanceListeners(r.value), r.value.clearMarkers(), r.value.setMap(null));
1866
- }), t({ markerCluster: r }), () => {
2141
+ s.value && ((l = i.value) == null || l.event.clearInstanceListeners(s.value), s.value.clearMarkers(), s.value.setMap(null));
2142
+ }), t({ markerCluster: s }), () => {
1867
2143
  var l;
1868
- return (l = s.default) == null ? void 0 : l.call(s);
2144
+ return (l = r.default) == null ? void 0 : l.call(r);
1869
2145
  };
1870
2146
  }
1871
- }), Et = P({
2147
+ }), qr = P({
1872
2148
  inheritAttrs: !1,
1873
2149
  props: {
1874
2150
  options: {
@@ -1876,34 +2152,34 @@ const Ae = Object.values(F), Dt = P({
1876
2152
  required: !0
1877
2153
  }
1878
2154
  },
1879
- setup(n, { slots: e, emit: t, expose: s }) {
1880
- const r = v(), o = G(() => {
1881
- var i;
1882
- return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !== ue);
1883
- }), a = G(() => ({
2155
+ setup(n, { slots: e, emit: t, expose: r }) {
2156
+ const s = w(), o = K(() => {
2157
+ var a;
2158
+ return (a = e.default) == null ? void 0 : a.call(e).some((c) => c.type !== ye);
2159
+ }), i = K(() => ({
1884
2160
  ...n.options,
1885
- element: r.value
1886
- })), l = W(re, [], a, t);
1887
- return s({
2161
+ element: s.value
2162
+ })), l = J(ue, [], i, t);
2163
+ return r({
1888
2164
  customMarker: l
1889
- }), { customMarkerRef: r, customMarker: l, hasSlotContent: o };
2165
+ }), { customMarkerRef: s, customMarker: l, hasSlotContent: o };
1890
2166
  }
1891
2167
  });
1892
- const Pt = {
2168
+ const Sr = {
1893
2169
  key: 0,
1894
2170
  class: "custom-marker-wrapper"
1895
2171
  };
1896
- function St(n, e, t, s, r, o) {
1897
- return n.hasSlotContent ? (U(), V("div", Pt, [
1898
- se("div", de({
2172
+ function Ar(n, e, t, r, s, o) {
2173
+ return n.hasSlotContent ? (V(), z("div", Sr, [
2174
+ le("div", we({
1899
2175
  ref: "customMarkerRef",
1900
2176
  style: { cursor: n.$attrs.onClick ? "pointer" : void 0 }
1901
2177
  }, n.$attrs), [
1902
- z(n.$slots, "default", {}, void 0, !0)
2178
+ W(n.$slots, "default", {}, void 0, !0)
1903
2179
  ], 16)
1904
- ])) : he("", !0);
2180
+ ])) : Ee("", !0);
1905
2181
  }
1906
- const Ft = /* @__PURE__ */ X(Et, [["render", St], ["__scopeId", "data-v-2d2d343a"]]), Ut = P({
2182
+ const Gr = /* @__PURE__ */ re(qr, [["render", Ar], ["__scopeId", "data-v-2d2d343a"]]), Vr = P({
1907
2183
  name: "HeatmapLayer",
1908
2184
  props: {
1909
2185
  options: {
@@ -1912,47 +2188,50 @@ const Ft = /* @__PURE__ */ X(Et, [["render", St], ["__scopeId", "data-v-2d2d343a
1912
2188
  }
1913
2189
  },
1914
2190
  setup(n) {
1915
- const e = v(), t = C(B, v()), s = C(Z, v());
1916
- return S(
2191
+ const e = w(), t = k(D, w()), r = k(Z, w());
2192
+ return q(
1917
2193
  [t, () => n.options],
1918
- ([r, o], [a, l]) => {
1919
- const i = !A(o, l) || t.value !== a;
1920
- if (t.value && s.value && i) {
1921
- let d;
1922
- if (o.data && !(o.data instanceof s.value.MVCArray)) {
1923
- const u = s.value.LatLng, c = o.data.map((h) => h instanceof u || "location" in h && (h.location instanceof u || h.location === null) ? h : "location" in h ? { ...h, location: new u(h.location) } : new u(h));
1924
- d = {
2194
+ ([s, o], [i, l]) => {
2195
+ const a = !ee(o, l) || t.value !== i;
2196
+ if (t.value && r.value && a) {
2197
+ let c;
2198
+ if (o.data && !(o.data instanceof r.value.MVCArray)) {
2199
+ const d = r.value.LatLng, u = o.data.map((h) => h instanceof d || "location" in h && (h.location instanceof d || h.location === null) ? h : "location" in h ? { ...h, location: new d(h.location) } : new d(h));
2200
+ c = {
1925
2201
  ...o,
1926
- data: c
2202
+ data: u
1927
2203
  };
1928
2204
  } else
1929
- d = o;
1930
- e.value ? e.value.setOptions(d) : e.value = x(
1931
- new s.value.visualization.HeatmapLayer({
1932
- ...d,
2205
+ c = o;
2206
+ e.value ? e.value.setOptions(c) : e.value = S(
2207
+ new r.value.visualization.HeatmapLayer({
2208
+ ...c,
1933
2209
  map: t.value
1934
2210
  })
1935
2211
  );
1936
2212
  }
1937
2213
  },
1938
2214
  { immediate: !0 }
1939
- ), j(() => {
2215
+ ), B(() => {
1940
2216
  e.value && e.value.setMap(null);
1941
2217
  }), { heatmapLayer: e };
1942
2218
  },
1943
2219
  render: () => null
1944
2220
  });
1945
2221
  export {
1946
- Tt as AdvancedMarker,
1947
- Bt as Circle,
1948
- Zt as CustomControl,
1949
- Ft as CustomMarker,
1950
- It as GoogleMap,
1951
- Ut as HeatmapLayer,
1952
- Nt as InfoWindow,
1953
- $t as Marker,
1954
- Dt as MarkerCluster,
1955
- qt as Polygon,
1956
- Rt as Polyline,
1957
- jt as Rectangle
2222
+ jr as AdvancedMarker,
2223
+ Dr as Circle,
2224
+ Zr as CustomControl,
2225
+ Gr as CustomMarker,
2226
+ Ir as GoogleMap,
2227
+ Vr as HeatmapLayer,
2228
+ Fr as InfoWindow,
2229
+ Rr as Marker,
2230
+ Ur as MarkerCluster,
2231
+ Nr as Polygon,
2232
+ $r as Polyline,
2233
+ Br as Rectangle,
2234
+ Z as apiSymbol,
2235
+ D as mapSymbol,
2236
+ Xe as mapTilesLoadedSymbol
1958
2237
  };