vue3-google-map 0.22.0 → 0.23.1

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 Ue = (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) => (Ue(n, typeof e != "symbol" ? e + "" : e, t), t);
5
- import { defineComponent as P, ref as v, provide as U, watch as S, onMounted as Ie, onBeforeUnmount as j, markRaw as x, toRef as $, openBlock as K, createElementBlock as Y, createElementVNode as se, renderSlot as J, normalizeProps as De, guardReactiveProps as Fe, computed as F, Comment as ue, inject as C, 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"), V = [
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 Ve(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 ze = 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 (!ze(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) => Ve(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 Ge(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 Ge(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
- ], He = 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
- U(B, r), U(Z, o), U(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 = Ge(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
- }, We = {
638
+ }, yt = {
643
639
  ref: "mapRef",
644
640
  class: "mapdiv"
645
641
  };
646
- function Ke(n, e, t, s, r, o) {
647
- return K(), Y("div", null, [
648
- se("div", We, null, 512),
649
- J(n.$slots, "default", De(Fe({ 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 At = /* @__PURE__ */ X(He, [["render", Ke], ["__scopeId", "data-v-e7ebb206"]]);
653
- function Ye(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 Je = 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 Je = 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__ */ Ye(Je), ke = ["click", "drag", "dragend", "dragstart", "gmp-click"], Xe = 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,85 +696,101 @@ const A = /* @__PURE__ */ Ye(Je), 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 = F(() => {
706
- var p;
707
- return (p = s.default) == 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 = F(
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
- }), U(pe, i), t({ marker: i }), { hasSlotContent: 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 Qe = {
738
+ const Ct = {
741
739
  key: 0,
742
740
  class: "advanced-marker-wrapper"
743
741
  };
744
- function et(n, e, t, s, r, o) {
745
- return n.hasSlotContent ? (K(), Y("div", Qe, [
746
- se("div", de({ ref: "markerRef" }, n.$attrs), [
747
- J(n.$slots, "default")
748
- ], 16)
749
- ])) : he("", !0);
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")
747
+ ], 16)
748
+ ])) : Ee("", !0),
749
+ W(n.$slots, "default")
750
+ ], 64);
750
751
  }
751
- const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker", st = (n) => n === re, z = (n, e, t, s) => {
752
- const r = v(), o = C(B, v()), a = C(Z, v()), l = C(fe, v()), i = F(
753
- () => !!(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]))
754
755
  );
755
- return S(
756
+ return q(
756
757
  [o, t],
757
- (d, [u, c]) => {
758
- var p, f, m;
759
- const h = !A(t.value, c) || o.value !== u;
760
- !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))) : (tt(n) ? r.value = x(
761
- new a.value[n](t.value)
762
- ) : st(n) ? r.value = x(
763
- new a.value[n](t.value)
764
- ) : r.value = x(
765
- new a.value[n]({
766
- ...t.value,
767
- map: o.value
768
- })
769
- ), i.value ? (m = l.value) == null || m.addMarker(r.value) : r.value.setMap(o.value), e.forEach((g) => {
770
- var y;
771
- (y = r.value) == null || y.addListener(g, (_) => s(g, _));
772
- })));
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
+ }
773
784
  },
774
785
  {
775
- immediate: !0
786
+ immediate: !0,
787
+ flush: "post"
776
788
  }
777
- ), j(() => {
778
- var d, u;
779
- 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));
780
- }), r;
781
- }, 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 = [
782
794
  "animation_changed",
783
795
  "click",
784
796
  "dblclick",
@@ -795,14 +807,13 @@ const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker",
795
807
  "contextmenu",
796
808
  "cursor_changed",
797
809
  "flat_changed",
798
- "rightclick",
799
810
  "zindex_changed",
800
811
  "icon_changed",
801
812
  "position_changed",
802
813
  "shape_changed",
803
814
  "title_changed",
804
815
  "visible_changed"
805
- ], Tt = P({
816
+ ], Rr = P({
806
817
  name: "Marker",
807
818
  props: {
808
819
  options: {
@@ -810,15 +821,15 @@ const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker",
810
821
  required: !0
811
822
  }
812
823
  },
813
- emits: Ce,
814
- setup(n, { emit: e, expose: t, slots: s }) {
815
- const r = $(n, "options"), o = z("Marker", Ce, r, e);
816
- return U(pe, o), t({ marker: o }), () => {
817
- var a;
818
- 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);
819
830
  };
820
831
  }
821
- }), $t = P({
832
+ }), $r = P({
822
833
  name: "Polyline",
823
834
  props: {
824
835
  options: {
@@ -826,13 +837,13 @@ const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker",
826
837
  required: !0
827
838
  }
828
839
  },
829
- emits: V,
840
+ emits: H,
830
841
  setup(n, { emit: e }) {
831
- const t = $(n, "options");
832
- return { polyline: z("Polyline", V, t, e) };
842
+ const t = j(n, "options");
843
+ return { polyline: J("Polyline", H, t, e) };
833
844
  },
834
845
  render: () => null
835
- }), Rt = P({
846
+ }), Nr = P({
836
847
  name: "Polygon",
837
848
  props: {
838
849
  options: {
@@ -840,13 +851,13 @@ const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker",
840
851
  required: !0
841
852
  }
842
853
  },
843
- emits: V,
854
+ emits: H,
844
855
  setup(n, { emit: e }) {
845
- const t = $(n, "options");
846
- return { polygon: z("Polygon", V, t, e) };
856
+ const t = j(n, "options");
857
+ return { polygon: J("Polygon", H, t, e) };
847
858
  },
848
859
  render: () => null
849
- }), be = V.concat(["bounds_changed"]), qt = P({
860
+ }), je = H.concat(["bounds_changed"]), Br = P({
850
861
  name: "Rectangle",
851
862
  props: {
852
863
  options: {
@@ -854,13 +865,13 @@ const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker",
854
865
  required: !0
855
866
  }
856
867
  },
857
- emits: be,
868
+ emits: je,
858
869
  setup(n, { emit: e }) {
859
- const t = $(n, "options");
860
- return { rectangle: z("Rectangle", be, t, e) };
870
+ const t = j(n, "options");
871
+ return { rectangle: J("Rectangle", je, t, e) };
861
872
  },
862
873
  render: () => null
863
- }), Me = V.concat(["center_changed", "radius_changed"]), jt = P({
874
+ }), Re = H.concat(["center_changed", "radius_changed"]), Dr = P({
864
875
  name: "Circle",
865
876
  props: {
866
877
  options: {
@@ -868,13 +879,13 @@ const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker",
868
879
  required: !0
869
880
  }
870
881
  },
871
- emits: Me,
882
+ emits: Re,
872
883
  setup(n, { emit: e }) {
873
- const t = $(n, "options");
874
- return { circle: z("Circle", Me, t, e) };
884
+ const t = j(n, "options");
885
+ return { circle: J("Circle", Re, t, e) };
875
886
  },
876
887
  render: () => null
877
- }), rt = P({
888
+ }), Mt = P({
878
889
  props: {
879
890
  position: {
880
891
  type: String,
@@ -887,49 +898,56 @@ const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker",
887
898
  },
888
899
  emits: ["content:loaded"],
889
900
  setup(n, { emit: e }) {
890
- const t = v(null), s = C(B, v()), r = C(Z, v()), o = C(Te, v(!1)), a = S(
891
- [o, r, t],
892
- ([d, u, c]) => {
893
- 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));
894
905
  },
895
906
  { immediate: !0 }
896
- ), l = (d) => {
897
- if (s.value && r.value && t.value) {
898
- const u = r.value.ControlPosition[d];
899
- 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);
900
911
  }
901
- }, i = (d) => {
902
- if (s.value && r.value) {
903
- let u = null;
904
- const c = r.value.ControlPosition[d];
905
- s.value.controls[c].forEach((h, p) => {
906
- h === t.value && (u = p);
907
- }), 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);
908
919
  }
909
920
  };
910
- return j(() => i(n.position)), S(
921
+ return B(() => a(n.position)), q(
911
922
  () => n.position,
912
- (d, u) => {
913
- i(u), l(d);
923
+ (c, d) => {
924
+ a(d), l(c);
914
925
  }
915
- ), S(
926
+ ), q(
916
927
  () => n.index,
917
- (d) => {
918
- d && t.value && (t.value.index = n.index);
928
+ (c) => {
929
+ t.value && (t.value.index = c);
919
930
  }
920
931
  ), { controlRef: t };
921
932
  }
922
933
  });
923
- const nt = {
934
+ const bt = {
924
935
  ref: "controlRef",
925
936
  class: "custom-control-wrapper"
926
937
  };
927
- function ot(n, e, t, s, r, o) {
928
- return K(), Y("div", nt, [
929
- J(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)
930
941
  ], 512);
931
942
  }
932
- const Bt = /* @__PURE__ */ X(rt, [["render", ot], ["__scopeId", "data-v-d099a3a6"]]), Oe = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], it = 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({
933
951
  inheritAttrs: !1,
934
952
  props: {
935
953
  options: {
@@ -940,68 +958,331 @@ const Bt = /* @__PURE__ */ X(rt, [["render", ot], ["__scopeId", "data-v-d099a3a6
940
958
  type: Boolean
941
959
  }
942
960
  },
943
- emits: [...Oe, "update:modelValue"],
944
- setup(n, { slots: e, emit: t, expose: s }) {
945
- const r = v(), o = v(), a = C(B, v()), l = C(Z, v()), i = C(pe, v());
946
- let d, u = n.modelValue;
947
- const c = F(() => {
948
- var m;
949
- return (m = e.default) == null ? void 0 : m.call(e).some((g) => g.type !== ue);
950
- }), h = (m) => {
951
- u = m, t("update:modelValue", m);
952
- }, p = (m) => {
953
- r.value && (r.value.open({ map: a.value, anchor: i.value, ...m }), h(!0));
954
- }, f = () => {
955
- 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));
956
974
  };
957
- return Ie(() => {
958
- S(
959
- [a, () => n.options],
960
- ([m, g], [y, _]) => {
961
- var O;
962
- const w = !A(g, _) || a.value !== y;
963
- 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({
964
982
  ...g,
965
- content: c.value ? o.value : g.content
966
- }), i.value || p()) : (r.value = x(
983
+ content: u.value ? o.value : g.content
984
+ }), a.value || m()) : (s.value = S(
967
985
  new l.value.InfoWindow({
968
986
  ...g,
969
- content: c.value ? o.value : g.content
987
+ content: u.value ? o.value : g.content
970
988
  })
971
- ), i.value && (d = i.value.addListener("click", () => {
972
- p();
973
- })), (!i.value || u) && p(), Oe.forEach((b) => {
974
- var E;
975
- (E = r.value) == null || E.addListener(b, (M) => t(b, M));
976
- }), (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))));
977
995
  },
978
996
  {
979
997
  immediate: !0
980
998
  }
981
- ), S(
999
+ ), q(
982
1000
  () => n.modelValue,
983
- (m) => {
984
- m !== u && (m ? p() : f());
1001
+ (f) => {
1002
+ f !== d && (f ? m() : p());
985
1003
  }
986
1004
  );
987
- }), j(() => {
988
- var m;
989
- d && d.remove(), r.value && ((m = l.value) == null || m.event.clearInstanceListeners(r.value), f());
990
- }), 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 };
991
1009
  }
992
1010
  });
993
- const at = {
1011
+ const St = {
994
1012
  key: 0,
995
1013
  class: "info-window-wrapper"
996
1014
  };
997
- function lt(n, e, t, s, r, o) {
998
- return n.hasSlotContent ? (K(), Y("div", at, [
999
- se("div", de({ ref: "infoWindowRef" }, n.$attrs), [
1000
- J(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)
1001
1019
  ], 16)
1002
- ])) : 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));
1003
1043
  }
1004
- const Zt = /* @__PURE__ */ X(it, [["render", lt], ["__scopeId", "data-v-cbe1707b"]]), Ee = [
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;
1093
+ }
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 = [
1005
1286
  Int8Array,
1006
1287
  Uint8Array,
1007
1288
  Uint8ClampedArray,
@@ -1011,8 +1292,8 @@ const Zt = /* @__PURE__ */ X(it, [["render", lt], ["__scopeId", "data-v-cbe1707b
1011
1292
  Uint32Array,
1012
1293
  Float32Array,
1013
1294
  Float64Array
1014
- ], ie = 1, G = 8;
1015
- class me {
1295
+ ], he = 1, X = 8;
1296
+ class Ce {
1016
1297
  /**
1017
1298
  * Creates an index from raw `ArrayBuffer` data.
1018
1299
  * @param {ArrayBuffer} data
@@ -1020,17 +1301,17 @@ class me {
1020
1301
  static from(e) {
1021
1302
  if (!(e instanceof ArrayBuffer))
1022
1303
  throw new Error("Data must be an instance of ArrayBuffer.");
1023
- const [t, s] = new Uint8Array(e, 0, 2);
1304
+ const [t, r] = new Uint8Array(e, 0, 2);
1024
1305
  if (t !== 219)
1025
1306
  throw new Error("Data does not appear to be in a KDBush format.");
1026
- const r = s >> 4;
1027
- if (r !== ie)
1028
- throw new Error(`Got v${r} data when expected v${ie}.`);
1029
- 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];
1030
1311
  if (!o)
1031
1312
  throw new Error("Unrecognized array type.");
1032
- const [a] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
1033
- 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);
1034
1315
  }
1035
1316
  /**
1036
1317
  * Creates an index that will hold a given number of items.
@@ -1039,14 +1320,14 @@ class me {
1039
1320
  * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
1040
1321
  * @param {ArrayBuffer} [data] (For internal use only)
1041
1322
  */
1042
- constructor(e, t = 64, s = Float64Array, r) {
1323
+ constructor(e, t = 64, r = Float64Array, s) {
1043
1324
  if (isNaN(e) || e < 0)
1044
1325
  throw new Error(`Unpexpected numItems value: ${e}.`);
1045
- this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = s, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
1046
- 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;
1047
1328
  if (o < 0)
1048
- throw new Error(`Unexpected typed array class: ${s}.`);
1049
- r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data, G, e), this.coords = new this.ArrayType(this.data, G + l + i, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(G + a + l + i), this.ids = new this.IndexArrayType(this.data, G, e), this.coords = new this.ArrayType(this.data, G + 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);
1050
1331
  }
1051
1332
  /**
1052
1333
  * Add a point to the index.
@@ -1055,8 +1336,8 @@ class me {
1055
1336
  * @returns {number} An incremental index associated with the added item (starting from `0`).
1056
1337
  */
1057
1338
  add(e, t) {
1058
- const s = this._pos >> 1;
1059
- 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;
1060
1341
  }
1061
1342
  /**
1062
1343
  * Perform indexing of the added points.
@@ -1065,7 +1346,7 @@ class me {
1065
1346
  const e = this._pos >> 1;
1066
1347
  if (e !== this.numItems)
1067
1348
  throw new Error(`Added ${e} items when expected ${this.numItems}.`);
1068
- 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;
1069
1350
  }
1070
1351
  /**
1071
1352
  * Search the index for items within a given bounding box.
@@ -1075,23 +1356,23 @@ class me {
1075
1356
  * @param {number} maxY
1076
1357
  * @returns {number[]} An array of indices correponding to the found items.
1077
1358
  */
1078
- range(e, t, s, r) {
1359
+ range(e, t, r, s) {
1079
1360
  if (!this._finished)
1080
1361
  throw new Error("Data not yet indexed - call index.finish().");
1081
- const { ids: o, coords: a, nodeSize: l } = this, i = [0, o.length - 1, 0], d = [];
1082
- for (; i.length; ) {
1083
- const u = i.pop() || 0, c = i.pop() || 0, h = i.pop() || 0;
1084
- if (c - h <= l) {
1085
- for (let g = h; g <= c; g++) {
1086
- const y = a[2 * g], _ = a[2 * g + 1];
1087
- 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]);
1088
1369
  }
1089
1370
  continue;
1090
1371
  }
1091
- const p = h + c >> 1, f = a[2 * p], m = a[2 * p + 1];
1092
- 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));
1093
1374
  }
1094
- return d;
1375
+ return c;
1095
1376
  }
1096
1377
  /**
1097
1378
  * Search the index for items within a given radius.
@@ -1100,58 +1381,58 @@ class me {
1100
1381
  * @param {number} r Query radius.
1101
1382
  * @returns {number[]} An array of indices correponding to the found items.
1102
1383
  */
1103
- within(e, t, s) {
1384
+ within(e, t, r) {
1104
1385
  if (!this._finished)
1105
1386
  throw new Error("Data not yet indexed - call index.finish().");
1106
- 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;
1107
1388
  for (; l.length; ) {
1108
- const u = l.pop() || 0, c = l.pop() || 0, h = l.pop() || 0;
1109
- if (c - h <= a) {
1110
- for (let g = h; g <= c; g++)
1111
- 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]);
1112
1393
  continue;
1113
1394
  }
1114
- const p = h + c >> 1, f = o[2 * p], m = o[2 * p + 1];
1115
- 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));
1116
1397
  }
1117
- return i;
1398
+ return a;
1118
1399
  }
1119
1400
  }
1120
- function ce(n, e, t, s, r, o) {
1121
- if (r - s <= t)
1401
+ function ve(n, e, t, r, s, o) {
1402
+ if (s - r <= t)
1122
1403
  return;
1123
- const a = s + r >> 1;
1124
- $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);
1125
1406
  }
1126
- function $e(n, e, t, s, r, o) {
1127
- for (; r > s; ) {
1128
- if (r - s > 600) {
1129
- 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));
1130
- $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);
1131
1412
  }
1132
- const a = e[2 * t + o];
1133
- let l = s, i = r;
1134
- for (H(n, e, s, t), e[2 * r + o] > a && H(n, e, s, r); l < i; ) {
1135
- for (H(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; )
1136
1417
  l++;
1137
- for (; e[2 * i + o] > a; )
1138
- i--;
1418
+ for (; e[2 * a + o] > i; )
1419
+ a--;
1139
1420
  }
1140
- e[2 * s + o] === a ? H(n, e, s, i) : (i++, H(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);
1141
1422
  }
1142
1423
  }
1143
- function H(n, e, t, s) {
1144
- 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);
1145
1426
  }
1146
- function ae(n, e, t) {
1147
- const s = n[e];
1148
- 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;
1149
1430
  }
1150
- function Pe(n, e, t, s) {
1151
- const r = n - t, o = e - s;
1152
- 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;
1153
1434
  }
1154
- const ct = {
1435
+ const dr = {
1155
1436
  minZoom: 0,
1156
1437
  // min zoom to generate clusters on
1157
1438
  maxZoom: 16,
@@ -1174,201 +1455,201 @@ const ct = {
1174
1455
  // properties to use for individual points when running the reducer
1175
1456
  map: (n) => n
1176
1457
  // props => ({sum: props.my_value})
1177
- }, Se = Math.fround || ((n) => (e) => (n[0] = +e, n[0]))(new Float32Array(1)), R = 2, T = 3, le = 4, I = 5, Re = 6;
1178
- 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 {
1179
1460
  constructor(e) {
1180
- this.options = Object.assign(Object.create(ct), 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 = [];
1181
1462
  }
1182
1463
  load(e) {
1183
- const { log: t, minZoom: s, maxZoom: r } = this.options;
1464
+ const { log: t, minZoom: r, maxZoom: s } = this.options;
1184
1465
  t && console.time("total time");
1185
1466
  const o = `prepare ${e.length} points`;
1186
1467
  t && console.time(o), this.points = e;
1187
- const a = [];
1188
- for (let i = 0; i < e.length; i++) {
1189
- const d = e[i];
1190
- if (!d.geometry)
1468
+ const i = [];
1469
+ for (let a = 0; a < e.length; a++) {
1470
+ const c = e[a];
1471
+ if (!c.geometry)
1191
1472
  continue;
1192
- const [u, c] = d.geometry.coordinates, h = Se(ee(u)), p = Se(te(c));
1193
- a.push(
1473
+ const [d, u] = c.geometry.coordinates, h = Ke(oe(d)), m = Ke(ie(u));
1474
+ i.push(
1194
1475
  h,
1195
- p,
1476
+ m,
1196
1477
  // projected point coordinates
1197
1478
  1 / 0,
1198
1479
  // the last zoom the point was processed at
1199
- i,
1480
+ a,
1200
1481
  // index of the source feature in the original input array
1201
1482
  -1,
1202
1483
  // parent cluster id
1203
1484
  1
1204
1485
  // number of points in a cluster
1205
- ), this.options.reduce && a.push(0);
1486
+ ), this.options.reduce && i.push(0);
1206
1487
  }
1207
- let l = this.trees[r + 1] = this._createTree(a);
1488
+ let l = this.trees[s + 1] = this._createTree(i);
1208
1489
  t && console.timeEnd(o);
1209
- for (let i = r; i >= s; i--) {
1210
- const d = +Date.now();
1211
- 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);
1212
1493
  }
1213
1494
  return t && console.timeEnd("total time"), this;
1214
1495
  }
1215
1496
  getClusters(e, t) {
1216
- let s = ((e[0] + 180) % 360 + 360) % 360 - 180;
1217
- 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]));
1218
1499
  let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
1219
- const a = Math.max(-90, Math.min(90, e[3]));
1500
+ const i = Math.max(-90, Math.min(90, e[3]));
1220
1501
  if (e[2] - e[0] >= 360)
1221
- s = -180, o = 180;
1222
- else if (s > o) {
1223
- const c = this.getClusters([s, r, 180, a], t), h = this.getClusters([-180, r, o, a], t);
1224
- 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);
1225
1506
  }
1226
- const l = this.trees[this._limitZoom(t)], i = l.range(ee(s), te(a), ee(o), te(r)), d = l.data, u = [];
1227
- for (const c of i) {
1228
- const h = this.stride * c;
1229
- 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]]);
1230
1511
  }
1231
- return u;
1512
+ return d;
1232
1513
  }
1233
1514
  getChildren(e) {
1234
- 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];
1235
1516
  if (!o)
1236
- throw new Error(r);
1237
- const a = o.data;
1238
- if (t * this.stride >= a.length)
1239
- throw new Error(r);
1240
- 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 = [];
1241
- for (const h of u) {
1242
- const p = h * this.stride;
1243
- 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]]);
1244
1525
  }
1245
- if (c.length === 0)
1246
- throw new Error(r);
1247
- return c;
1526
+ if (u.length === 0)
1527
+ throw new Error(s);
1528
+ return u;
1248
1529
  }
1249
- getLeaves(e, t, s) {
1250
- t = t || 10, s = s || 0;
1251
- const r = [];
1252
- 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;
1253
1534
  }
1254
- getTile(e, t, s) {
1255
- 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 = {
1256
1537
  features: []
1257
1538
  };
1258
1539
  return this._addTileFeatures(
1259
- r.range((t - i) / o, d, (t + 1 + i) / o, u),
1260
- r.data,
1540
+ s.range((t - a) / o, c, (t + 1 + a) / o, d),
1541
+ s.data,
1261
1542
  t,
1262
- s,
1543
+ r,
1263
1544
  o,
1264
- c
1545
+ u
1265
1546
  ), t === 0 && this._addTileFeatures(
1266
- r.range(1 - i / o, d, 1, u),
1267
- r.data,
1547
+ s.range(1 - a / o, c, 1, d),
1548
+ s.data,
1268
1549
  o,
1269
- s,
1550
+ r,
1270
1551
  o,
1271
- c
1552
+ u
1272
1553
  ), t === o - 1 && this._addTileFeatures(
1273
- r.range(0, d, i / o, u),
1274
- r.data,
1554
+ s.range(0, c, a / o, d),
1555
+ s.data,
1275
1556
  -1,
1276
- s,
1557
+ r,
1277
1558
  o,
1278
- c
1279
- ), c.features.length ? c : null;
1559
+ u
1560
+ ), u.features.length ? u : null;
1280
1561
  }
1281
1562
  getClusterExpansionZoom(e) {
1282
1563
  let t = this._getOriginZoom(e) - 1;
1283
1564
  for (; t <= this.options.maxZoom; ) {
1284
- const s = this.getChildren(e);
1285
- if (t++, s.length !== 1)
1565
+ const r = this.getChildren(e);
1566
+ if (t++, r.length !== 1)
1286
1567
  break;
1287
- e = s[0].properties.cluster_id;
1568
+ e = r[0].properties.cluster_id;
1288
1569
  }
1289
1570
  return t;
1290
1571
  }
1291
- _appendLeaves(e, t, s, r, o) {
1292
- const a = this.getChildren(t);
1293
- for (const l of a) {
1294
- const i = l.properties;
1295
- 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)
1296
1577
  break;
1297
1578
  }
1298
1579
  return o;
1299
1580
  }
1300
1581
  _createTree(e) {
1301
- const t = new me(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
1302
- for (let s = 0; s < e.length; s += this.stride)
1303
- 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]);
1304
1585
  return t.finish(), t.data = e, t;
1305
1586
  }
1306
- _addTileFeatures(e, t, s, r, o, a) {
1587
+ _addTileFeatures(e, t, r, s, o, i) {
1307
1588
  for (const l of e) {
1308
- const i = l * this.stride, d = t[i + I] > 1;
1309
- let u, c, h;
1310
- if (d)
1311
- 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];
1312
1593
  else {
1313
- const m = this.points[t[i + T]];
1314
- u = m.properties;
1315
- const [g, y] = m.geometry.coordinates;
1316
- 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);
1317
1598
  }
1318
- const p = {
1599
+ const m = {
1319
1600
  type: 1,
1320
1601
  geometry: [[
1321
- Math.round(this.options.extent * (c * o - s)),
1322
- 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))
1323
1604
  ]],
1324
- tags: u
1605
+ tags: d
1325
1606
  };
1326
- let f;
1327
- 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);
1328
1609
  }
1329
1610
  }
1330
1611
  _limitZoom(e) {
1331
1612
  return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
1332
1613
  }
1333
1614
  _cluster(e, t) {
1334
- 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;
1335
- for (let c = 0; c < i.length; c += u) {
1336
- 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)
1337
1618
  continue;
1338
- i[c + R] = t;
1339
- const h = i[c], p = i[c + 1], f = e.within(i[c], i[c + 1], l), m = i[c + I];
1340
- let g = m;
1341
- for (const y of f) {
1342
- const _ = y * u;
1343
- 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]);
1344
1625
  }
1345
- if (g > m && g >= a) {
1346
- let y = h * m, _ = p * m, w, O = -1;
1347
- const b = ((c / u | 0) << 5) + (t + 1) + this.points.length;
1348
- for (const E of f) {
1349
- const M = E * u;
1350
- 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)
1351
1632
  continue;
1352
- i[M + R] = t;
1353
- const L = i[M + I];
1354
- 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)));
1355
1636
  }
1356
- 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);
1357
1638
  } else {
1358
- for (let y = 0; y < u; y++)
1359
- d.push(i[c + y]);
1639
+ for (let v = 0; v < d; v++)
1640
+ c.push(a[u + v]);
1360
1641
  if (g > 1)
1361
- for (const y of f) {
1362
- const _ = y * u;
1363
- if (!(i[_ + R] <= t)) {
1364
- i[_ + R] = t;
1365
- for (let w = 0; w < u; w++)
1366
- 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]);
1367
1648
  }
1368
1649
  }
1369
1650
  }
1370
1651
  }
1371
- return d;
1652
+ return c;
1372
1653
  }
1373
1654
  // get index of the point from which the cluster originated
1374
1655
  _getOriginId(e) {
@@ -1378,73 +1659,59 @@ class qe {
1378
1659
  _getOriginZoom(e) {
1379
1660
  return (e - this.points.length) % 32;
1380
1661
  }
1381
- _map(e, t, s) {
1382
- if (e[t + I] > 1) {
1383
- const a = this.clusterProps[e[t + Re]];
1384
- 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;
1385
1666
  }
1386
- const r = this.points[e[t + T]].properties, o = this.options.map(r);
1387
- 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;
1388
1669
  }
1389
1670
  }
1390
- function Le(n, e, t) {
1671
+ function He(n, e, t) {
1391
1672
  return {
1392
1673
  type: "Feature",
1393
- id: n[e + T],
1394
- properties: je(n, e, t),
1674
+ id: n[e + x],
1675
+ properties: nt(n, e, t),
1395
1676
  geometry: {
1396
1677
  type: "Point",
1397
- coordinates: [ut(n[e]), dt(n[e + 1])]
1678
+ coordinates: [pr(n[e]), fr(n[e + 1])]
1398
1679
  }
1399
1680
  };
1400
1681
  }
1401
- function je(n, e, t) {
1402
- 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]);
1403
- 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, {
1404
1685
  cluster: !0,
1405
- cluster_id: n[e + T],
1406
- point_count: s,
1407
- point_count_abbreviated: r
1686
+ cluster_id: n[e + x],
1687
+ point_count: r,
1688
+ point_count_abbreviated: s
1408
1689
  });
1409
1690
  }
1410
- function ee(n) {
1691
+ function oe(n) {
1411
1692
  return n / 360 + 0.5;
1412
1693
  }
1413
- function te(n) {
1694
+ function ie(n) {
1414
1695
  const e = Math.sin(n * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
1415
1696
  return t < 0 ? 0 : t > 1 ? 1 : t;
1416
1697
  }
1417
- function ut(n) {
1698
+ function pr(n) {
1418
1699
  return (n - 0.5) * 360;
1419
1700
  }
1420
- function dt(n) {
1701
+ function fr(n) {
1421
1702
  const e = (180 - n * 360) * Math.PI / 180;
1422
1703
  return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
1423
1704
  }
1424
- /*! *****************************************************************************
1425
- Copyright (c) Microsoft Corporation.
1426
-
1427
- Permission to use, copy, modify, and/or distribute this software for any
1428
- purpose with or without fee is hereby granted.
1429
-
1430
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1431
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1432
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1433
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1434
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1435
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1436
- PERFORMANCE OF THIS SOFTWARE.
1437
- ***************************************************************************** */
1438
- function ge(n, e) {
1705
+ function Oe(n, e) {
1439
1706
  var t = {};
1440
- for (var s in n)
1441
- 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]);
1442
1709
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
1443
- for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
1444
- 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]]);
1445
1712
  return t;
1446
1713
  }
1447
- class k {
1714
+ class _ {
1448
1715
  static isAdvancedMarkerAvailable(e) {
1449
1716
  return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
1450
1717
  }
@@ -1459,7 +1726,7 @@ class k {
1459
1726
  if (e.position) {
1460
1727
  if (e.position instanceof google.maps.LatLng)
1461
1728
  return e.position;
1462
- if (e.position.lat && e.position.lng)
1729
+ if (Number.isFinite(e.position.lat) && Number.isFinite(e.position.lng))
1463
1730
  return new google.maps.LatLng(e.position.lat, e.position.lng);
1464
1731
  }
1465
1732
  return new google.maps.LatLng(null);
@@ -1470,16 +1737,16 @@ class k {
1470
1737
  return this.isAdvancedMarker(e) ? !0 : e.getVisible();
1471
1738
  }
1472
1739
  }
1473
- class W {
1740
+ class te {
1474
1741
  constructor({ markers: e, position: t }) {
1475
- 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));
1476
1743
  }
1477
1744
  get bounds() {
1478
1745
  if (this.markers.length === 0 && !this._position)
1479
1746
  return;
1480
1747
  const e = new google.maps.LatLngBounds(this._position, this._position);
1481
1748
  for (const t of this.markers)
1482
- e.extend(k.getPosition(t));
1749
+ e.extend(_.getPosition(t));
1483
1750
  return e;
1484
1751
  }
1485
1752
  get position() {
@@ -1489,7 +1756,7 @@ class W {
1489
1756
  * Get the count of **visible** markers.
1490
1757
  */
1491
1758
  get count() {
1492
- return this.markers.filter((e) => k.getVisible(e)).length;
1759
+ return this.markers.filter((e) => _.getVisible(e)).length;
1493
1760
  }
1494
1761
  /**
1495
1762
  * Add a marker to the cluster.
@@ -1501,26 +1768,32 @@ class W {
1501
1768
  * Cleanup references and remove marker from map.
1502
1769
  */
1503
1770
  delete() {
1504
- 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;
1505
1772
  }
1506
1773
  }
1507
- const ht = (n, e, t, s) => {
1508
- const r = Be(n.getBounds(), e, s);
1509
- return t.filter((o) => r.contains(k.getPosition(o)));
1510
- }, Be = (n, e, t) => {
1511
- const { northEast: s, southWest: r } = pt(n, e), o = ft({ northEast: s, southWest: r }, t);
1512
- return mt(o, e);
1513
- }, xe = (n, e, t) => {
1514
- const s = Be(n, e, t), r = s.getNorthEast(), o = s.getSouthWest();
1515
- return [o.lng(), o.lat(), r.lng(), r.lat()];
1516
- }, pt = (n, e) => ({
1517
- northEast: e.fromLatLngToDivPixel(n.getNorthEast()),
1518
- southWest: e.fromLatLngToDivPixel(n.getSouthWest())
1519
- }), ft = ({ northEast: n, southWest: e }, t) => (n.x += t, n.y -= t, e.x -= t, e.y += t, { northEast: n, southWest: e }), mt = ({ northEast: n, southWest: e }, t) => {
1520
- const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(n);
1521
- 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);
1522
1795
  };
1523
- class Ze {
1796
+ class ot {
1524
1797
  constructor({ maxZoom: e = 16 }) {
1525
1798
  this.maxZoom = e;
1526
1799
  }
@@ -1537,138 +1810,139 @@ class Ze {
1537
1810
  * ```
1538
1811
  */
1539
1812
  noop({ markers: e }) {
1540
- return vt(e);
1813
+ return Er(e);
1541
1814
  }
1542
1815
  }
1543
- class gt extends Ze {
1816
+ class wr extends ot {
1544
1817
  constructor(e) {
1545
- var { viewportPadding: t = 60 } = e, s = ge(e, ["viewportPadding"]);
1546
- 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;
1547
1820
  }
1548
- calculate({ markers: e, map: t, mapCanvasProjection: s }) {
1549
- 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 ? {
1550
1824
  clusters: this.noop({
1551
1825
  markers: e
1552
1826
  }),
1553
1827
  changed: !1
1554
1828
  } : {
1555
1829
  clusters: this.cluster({
1556
- markers: ht(t, s, e, this.viewportPadding),
1830
+ markers: hr(t, r, e, this.viewportPadding),
1557
1831
  map: t,
1558
- mapCanvasProjection: s
1832
+ mapCanvasProjection: r
1559
1833
  })
1560
1834
  };
1561
1835
  }
1562
1836
  }
1563
- const vt = (n) => n.map((t) => new W({
1564
- position: k.getPosition(t),
1837
+ const Er = (n) => n.map((t) => new te({
1838
+ position: _.getPosition(t),
1565
1839
  markers: [t]
1566
1840
  }));
1567
- class yt extends Ze {
1841
+ class _r extends ot {
1568
1842
  constructor(e) {
1569
- var { maxZoom: t, radius: s = 60 } = e, r = ge(e, ["maxZoom", "radius"]);
1570
- 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));
1571
1845
  }
1572
1846
  calculate(e) {
1573
- let t = !1;
1574
- const s = { zoom: e.map.getZoom() };
1575
- 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)) {
1576
1851
  t = !0, this.markers = [...e.markers];
1577
- const r = this.markers.map((o) => {
1578
- const a = k.getPosition(o);
1852
+ const o = this.markers.map((i) => {
1853
+ const l = _.getPosition(i);
1579
1854
  return {
1580
1855
  type: "Feature",
1581
- geometry: {
1582
- type: "Point",
1583
- coordinates: [a.lng(), a.lat()]
1584
- },
1585
- properties: { marker: o }
1856
+ geometry: { type: "Point", coordinates: [l.lng(), l.lat()] },
1857
+ properties: { marker: i }
1586
1858
  };
1587
1859
  });
1588
- this.superCluster.load(r);
1860
+ this.superCluster.load(o);
1589
1861
  }
1590
- 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 });
1591
1863
  }
1592
1864
  cluster({ map: e }) {
1593
- 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));
1594
1867
  }
1595
- transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
1596
- if (s.cluster)
1597
- return new W({
1598
- 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),
1599
1872
  position: { lat: t, lng: e }
1600
1873
  });
1601
- const r = s.marker;
1602
- return new W({
1603
- markers: [r],
1604
- position: k.getPosition(r)
1874
+ const s = r.marker;
1875
+ return new te({
1876
+ markers: [s],
1877
+ position: _.getPosition(s)
1605
1878
  });
1606
1879
  }
1607
1880
  }
1608
- class _t extends gt {
1881
+ class kr extends wr {
1609
1882
  constructor(e) {
1610
- var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o = ge(e, ["maxZoom", "radius", "viewportPadding"]);
1611
- 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] };
1612
1885
  }
1613
1886
  calculate(e) {
1614
- const t = {
1615
- zoom: Math.round(e.map.getZoom()),
1616
- view: xe(e.map.getBounds(), e.mapCanvasProjection, this.viewportPadding)
1617
- };
1618
- let s = !A(this.state, t);
1619
- if (!A(e.markers, this.markers)) {
1620
- s = !0, this.markers = [...e.markers];
1621
- const r = this.markers.map((o) => {
1622
- 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);
1623
1893
  return {
1624
1894
  type: "Feature",
1625
1895
  geometry: {
1626
1896
  type: "Point",
1627
- coordinates: [a.lng(), a.lat()]
1897
+ coordinates: [i.lng(), i.lat()]
1628
1898
  },
1629
1899
  properties: { marker: o }
1630
1900
  };
1631
1901
  });
1632
- this.superCluster.load(r);
1902
+ this.superCluster.load(s);
1633
1903
  }
1634
- 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 };
1635
1905
  }
1636
- cluster({ map: e, mapCanvasProjection: t }) {
1637
- const s = {
1638
- zoom: Math.round(e.getZoom()),
1639
- view: xe(e.getBounds(), t, this.viewportPadding)
1640
- };
1641
- 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));
1642
1909
  }
1643
- transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
1644
- if (s.cluster)
1645
- return new W({
1646
- 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),
1647
1914
  position: { lat: t, lng: e }
1648
1915
  });
1649
- const r = s.marker;
1650
- return new W({
1651
- markers: [r],
1652
- position: k.getPosition(r)
1916
+ const s = r.marker;
1917
+ return new te({
1918
+ markers: [s],
1919
+ position: _.getPosition(s)
1653
1920
  });
1654
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
+ }
1655
1929
  }
1656
- class wt {
1930
+ class Cr {
1657
1931
  constructor(e, t) {
1658
1932
  this.markers = { sum: e.length };
1659
- 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);
1660
1934
  this.clusters = {
1661
1935
  count: t.length,
1662
1936
  markers: {
1663
- mean: r / t.length,
1664
- sum: r,
1665
- min: Math.min(...s),
1666
- max: Math.max(...s)
1937
+ mean: s / t.length,
1938
+ sum: s,
1939
+ min: Math.min(...r),
1940
+ max: Math.max(...r)
1667
1941
  }
1668
1942
  };
1669
1943
  }
1670
1944
  }
1671
- class kt {
1945
+ class Or {
1672
1946
  /**
1673
1947
  * The default render function for the library used by {@link MarkerClusterer}.
1674
1948
  *
@@ -1707,76 +1981,74 @@ class kt {
1707
1981
  * });
1708
1982
  * ```
1709
1983
  */
1710
- render({ count: e, position: t }, s, r) {
1711
- 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">
1712
1986
  <circle cx="120" cy="120" opacity=".6" r="70" />
1713
1987
  <circle cx="120" cy="120" opacity=".3" r="90" />
1714
1988
  <circle cx="120" cy="120" opacity=".2" r="110" />
1715
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>
1716
- </svg>`, l = `Cluster of ${e} markers`, i = Number(google.maps.Marker.MAX_ZINDEX) + e;
1717
- if (k.isAdvancedMarkerAvailable(r)) {
1718
- const u = document.createElement("div");
1719
- u.innerHTML = a;
1720
- const c = u.firstElementChild;
1721
- 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)");
1722
1994
  const h = {
1723
- map: r,
1995
+ map: s,
1724
1996
  position: t,
1725
- zIndex: i,
1997
+ zIndex: a,
1726
1998
  title: l,
1727
- content: c
1999
+ content: u
1728
2000
  };
1729
2001
  return new google.maps.marker.AdvancedMarkerElement(h);
1730
2002
  }
1731
- const d = {
2003
+ const c = {
1732
2004
  position: t,
1733
- zIndex: i,
2005
+ zIndex: a,
1734
2006
  title: l,
1735
2007
  icon: {
1736
- url: `data:image/svg+xml;base64,${btoa(a)}`,
2008
+ url: `data:image/svg+xml;base64,${btoa(i)}`,
1737
2009
  anchor: new google.maps.Point(25, 25)
1738
2010
  }
1739
2011
  };
1740
- return new google.maps.Marker(d);
2012
+ return new google.maps.Marker(c);
1741
2013
  }
1742
2014
  }
1743
- function Ct(n, e) {
2015
+ function Mr(n, e) {
1744
2016
  for (let t in e.prototype)
1745
2017
  n.prototype[t] = e.prototype[t];
1746
2018
  }
1747
- class ve {
2019
+ class Me {
1748
2020
  constructor() {
1749
- Ct(ve, google.maps.OverlayView);
2021
+ Mr(Me, google.maps.OverlayView);
1750
2022
  }
1751
2023
  }
1752
- var D;
2024
+ var I;
1753
2025
  (function(n) {
1754
- n.CLUSTERING_BEGIN = "clusteringbegin", n.CLUSTERING_END = "clusteringend", n.CLUSTER_CLICK = "click";
1755
- })(D || (D = {}));
1756
- const bt = (n, e, t) => {
1757
- 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);
1758
2030
  };
1759
- class Mt extends ve {
1760
- constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new yt(s), renderer: o = new kt(), onClusterClick: a = bt }) {
1761
- 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);
1762
2034
  }
1763
2035
  addMarker(e, t) {
1764
2036
  this.markers.includes(e) || (this.markers.push(e), t || this.render());
1765
2037
  }
1766
2038
  addMarkers(e, t) {
1767
- e.forEach((s) => {
1768
- this.addMarker(s, !0);
2039
+ e.forEach((r) => {
2040
+ this.addMarker(r, !0);
1769
2041
  }), t || this.render();
1770
2042
  }
1771
2043
  removeMarker(e, t) {
1772
- const s = this.markers.indexOf(e);
1773
- 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);
1774
2046
  }
1775
2047
  removeMarkers(e, t) {
1776
- let s = !1;
1777
- return e.forEach((r) => {
1778
- s = this.removeMarker(r, !0) || s;
1779
- }), 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;
1780
2052
  }
1781
2053
  clearMarkers(e) {
1782
2054
  this.markers.length = 0, e || this.render();
@@ -1787,47 +2059,54 @@ class Mt extends ve {
1787
2059
  render() {
1788
2060
  const e = this.getMap();
1789
2061
  if (e instanceof google.maps.Map && e.getProjection()) {
1790
- google.maps.event.trigger(this, D.CLUSTERING_BEGIN, this);
1791
- 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({
1792
2064
  markers: this.markers,
1793
2065
  map: e,
1794
2066
  mapCanvasProjection: this.getProjection()
1795
2067
  });
1796
- if (s || s == null) {
1797
- const r = /* @__PURE__ */ new Set();
1798
- for (const a of t)
1799
- 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]);
1800
2072
  const o = [];
1801
- for (const a of this.clusters)
1802
- a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) : o.push(a.marker));
1803
- 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)));
1804
2076
  }
1805
- google.maps.event.trigger(this, D.CLUSTERING_END, this);
2077
+ google.maps.event.trigger(this, I.CLUSTERING_END, this);
1806
2078
  }
1807
2079
  }
1808
2080
  onAdd() {
1809
- 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();
1810
2083
  }
1811
2084
  onRemove() {
1812
- google.maps.event.removeListener(this.idleListener), this.reset();
2085
+ this.idleListener && google.maps.event.removeListener(this.idleListener), this.reset();
1813
2086
  }
1814
2087
  reset() {
1815
- 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 = [];
1816
2089
  }
1817
2090
  renderClusters() {
1818
- const e = new wt(this.markers, this.clusters), t = this.getMap();
1819
- this.clusters.forEach((s) => {
1820
- 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(
1821
- "click",
1822
- /* istanbul ignore next */
1823
- (r) => {
1824
- google.maps.event.trigger(this, D.CLUSTER_CLICK, s), this.onClusterClick(r, s, t);
1825
- }
1826
- )), 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);
1827
2106
  });
1828
2107
  }
1829
2108
  }
1830
- const Ae = Object.values(D), Nt = P({
2109
+ const Je = Object.values(I), Ur = P({
1831
2110
  name: "MarkerCluster",
1832
2111
  props: {
1833
2112
  options: {
@@ -1835,37 +2114,37 @@ const Ae = Object.values(D), Nt = P({
1835
2114
  default: () => ({})
1836
2115
  }
1837
2116
  },
1838
- emits: Ae,
1839
- setup(n, { emit: e, expose: t, slots: s }) {
1840
- const r = v(), o = C(B, v()), a = C(Z, v());
1841
- return U(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(
1842
2121
  o,
1843
2122
  () => {
1844
- o.value && (r.value = x(
1845
- new Mt({
2123
+ o.value && (s.value = S(
2124
+ new Pr({
1846
2125
  map: o.value,
1847
2126
  // Better perf than the default `SuperClusterAlgorithm`. See:
1848
2127
  // https://github.com/googlemaps/js-markerclusterer/pull/640
1849
- algorithm: new _t(n.options.algorithmOptions ?? {}),
2128
+ algorithm: new kr(n.options.algorithmOptions ?? {}),
1850
2129
  ...n.options
1851
2130
  })
1852
- ), Ae.forEach((l) => {
1853
- var i;
1854
- (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));
1855
2134
  }));
1856
2135
  },
1857
2136
  {
1858
2137
  immediate: !0
1859
2138
  }
1860
- ), j(() => {
2139
+ ), B(() => {
1861
2140
  var l;
1862
- r.value && ((l = a.value) == null || l.event.clearInstanceListeners(r.value), r.value.clearMarkers(), r.value.setMap(null));
1863
- }), 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 }), () => {
1864
2143
  var l;
1865
- return (l = s.default) == null ? void 0 : l.call(s);
2144
+ return (l = r.default) == null ? void 0 : l.call(r);
1866
2145
  };
1867
2146
  }
1868
- }), Ot = P({
2147
+ }), qr = P({
1869
2148
  inheritAttrs: !1,
1870
2149
  props: {
1871
2150
  options: {
@@ -1873,34 +2152,34 @@ const Ae = Object.values(D), Nt = P({
1873
2152
  required: !0
1874
2153
  }
1875
2154
  },
1876
- setup(n, { slots: e, emit: t, expose: s }) {
1877
- const r = v(), o = F(() => {
1878
- var i;
1879
- return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !== ue);
1880
- }), a = F(() => ({
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(() => ({
1881
2160
  ...n.options,
1882
- element: r.value
1883
- })), l = z(re, [], a, t);
1884
- return s({
2161
+ element: s.value
2162
+ })), l = J(ue, [], i, t);
2163
+ return r({
1885
2164
  customMarker: l
1886
- }), { customMarkerRef: r, customMarker: l, hasSlotContent: o };
2165
+ }), { customMarkerRef: s, customMarker: l, hasSlotContent: o };
1887
2166
  }
1888
2167
  });
1889
- const Et = {
2168
+ const Sr = {
1890
2169
  key: 0,
1891
2170
  class: "custom-marker-wrapper"
1892
2171
  };
1893
- function Pt(n, e, t, s, r, o) {
1894
- return n.hasSlotContent ? (K(), Y("div", Et, [
1895
- se("div", de({
2172
+ function Ar(n, e, t, r, s, o) {
2173
+ return n.hasSlotContent ? (V(), z("div", Sr, [
2174
+ le("div", we({
1896
2175
  ref: "customMarkerRef",
1897
2176
  style: { cursor: n.$attrs.onClick ? "pointer" : void 0 }
1898
2177
  }, n.$attrs), [
1899
- J(n.$slots, "default", {}, void 0, !0)
2178
+ W(n.$slots, "default", {}, void 0, !0)
1900
2179
  ], 16)
1901
- ])) : he("", !0);
2180
+ ])) : Ee("", !0);
1902
2181
  }
1903
- const Ut = /* @__PURE__ */ X(Ot, [["render", Pt], ["__scopeId", "data-v-2d2d343a"]]), Dt = P({
2182
+ const Gr = /* @__PURE__ */ re(qr, [["render", Ar], ["__scopeId", "data-v-2d2d343a"]]), Vr = P({
1904
2183
  name: "HeatmapLayer",
1905
2184
  props: {
1906
2185
  options: {
@@ -1909,44 +2188,47 @@ const Ut = /* @__PURE__ */ X(Ot, [["render", Pt], ["__scopeId", "data-v-2d2d343a
1909
2188
  }
1910
2189
  },
1911
2190
  setup(n) {
1912
- const e = v(), t = C(B, v()), s = C(Z, v());
1913
- return S(
2191
+ const e = w(), t = k(D, w()), r = k(Z, w());
2192
+ return q(
1914
2193
  [t, () => n.options],
1915
- ([r, o], [a, l]) => {
1916
- var d;
1917
- const i = !A(o, l) || t.value !== a;
1918
- if (t.value && s.value && i) {
1919
- const u = structuredClone(o);
1920
- if (u.data && !(u.data instanceof s.value.MVCArray)) {
1921
- const c = s.value.LatLng;
1922
- u.data = (d = u.data) == null ? void 0 : d.map((h) => h instanceof c || "location" in h && (h.location instanceof c || h.location === null) ? h : "location" in h ? { ...h, location: new c(h.location) } : new c(h));
1923
- }
1924
- e.value ? e.value.setOptions(u) : e.value = x(
1925
- new s.value.visualization.HeatmapLayer({
1926
- ...u,
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 = {
2201
+ ...o,
2202
+ data: u
2203
+ };
2204
+ } else
2205
+ c = o;
2206
+ e.value ? e.value.setOptions(c) : e.value = S(
2207
+ new r.value.visualization.HeatmapLayer({
2208
+ ...c,
1927
2209
  map: t.value
1928
2210
  })
1929
2211
  );
1930
2212
  }
1931
2213
  },
1932
2214
  { immediate: !0 }
1933
- ), j(() => {
2215
+ ), B(() => {
1934
2216
  e.value && e.value.setMap(null);
1935
2217
  }), { heatmapLayer: e };
1936
2218
  },
1937
2219
  render: () => null
1938
2220
  });
1939
2221
  export {
1940
- It as AdvancedMarker,
1941
- jt as Circle,
1942
- Bt as CustomControl,
1943
- Ut as CustomMarker,
1944
- At as GoogleMap,
1945
- Dt as HeatmapLayer,
1946
- Zt as InfoWindow,
1947
- Tt as Marker,
1948
- Nt as MarkerCluster,
1949
- Rt as Polygon,
1950
- $t as Polyline,
1951
- qt 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
1952
2234
  };